| | |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | import java.util.Collections; |
| | | |
| | | @Component |
| | |
| | | * @param recordId |
| | | */ |
| | | public void addStock(Long productModelId, BigDecimal quantity, String recordType, Long recordId) { |
| | | addStock(productModelId, quantity, recordType, recordId, null); |
| | | } |
| | | |
| | | /** |
| | | * 合格入库 |
| | | * @param recordType |
| | | * @param recordId |
| | | */ |
| | | public void addStock(Long productModelId, BigDecimal quantity, String recordType, Long recordId, LocalDateTime createTime) { |
| | | StockInventoryDto stockInventoryDto = new StockInventoryDto(); |
| | | stockInventoryDto.setRecordId(recordId); |
| | | stockInventoryDto.setRecordType(String.valueOf(recordType)); |
| | | stockInventoryDto.setQualitity(quantity); |
| | | stockInventoryDto.setProductModelId(productModelId); |
| | | stockInventoryDto.setCreateTime(createTime); |
| | | stockInventoryService.addStockInRecordOnly(stockInventoryDto); |
| | | } |
| | | |
| | |
| | | * @param recordId |
| | | */ |
| | | public void addStockWithBatchNo(Long productModelId, BigDecimal quantity, String recordType, Long recordId, String batchNo) { |
| | | addStockWithBatchNo(productModelId, quantity, recordType, recordId, batchNo, null); |
| | | } |
| | | |
| | | /** |
| | | * 合格入库带批次号 |
| | | * @param recordType |
| | | * @param recordId |
| | | */ |
| | | public void addStockWithBatchNo(Long productModelId, BigDecimal quantity, String recordType, Long recordId, String batchNo, LocalDateTime createTime) { |
| | | StockInventoryDto stockInventoryDto = new StockInventoryDto(); |
| | | stockInventoryDto.setRecordId(recordId); |
| | | stockInventoryDto.setRecordType(String.valueOf(recordType)); |
| | | stockInventoryDto.setQualitity(quantity); |
| | | stockInventoryDto.setProductModelId(productModelId); |
| | | stockInventoryDto.setBatchNo(batchNo); |
| | | stockInventoryDto.setCreateTime(createTime); |
| | | stockInventoryService.addStockInRecordOnly(stockInventoryDto); |
| | | } |
| | | |
| | |
| | | |
| | | } |
| | | |
| | | //删除出库记录 |
| | | public void deleteStockOutRecord(Long recordId, String recordType) { |
| | | StockOutRecord one = stockOutRecordService.getOne(new QueryWrapper<StockOutRecord>() |
| | | .lambda().eq(StockOutRecord::getRecordId, recordId) |