| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.List; |
| | | import java.util.concurrent.ThreadLocalRandom; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | } else { |
| | | wrapper.eq(StockUninventory::getBatchNo, stockUninventoryDto.getBatchNo()); |
| | | } |
| | | if (ObjectUtils.isEmpty(stockUninventoryDto.getBatchNo())) { |
| | | String time = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyMMddHHmm")); |
| | | int suffix = ThreadLocalRandom.current().nextInt(100, 1000); |
| | | stockUninventoryDto.setBatchNo("PY" + time + suffix); |
| | | } |
| | | //新增入库记录再添加库存 |
| | | StockInRecordDto stockInRecordDto = new StockInRecordDto(); |
| | | stockInRecordDto.setRecordId(stockUninventoryDto.getRecordId()); |