| | |
| | | import java.math.BigDecimal; |
| | | import java.util.Collections; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Component |
| | | @RequiredArgsConstructor |
| | |
| | | |
| | | /** |
| | | * 不合格入库 |
| | | * |
| | | * @param productModelId |
| | | * @param quantity |
| | | * @param recordType |
| | |
| | | |
| | | /** |
| | | * 不合格出库 |
| | | * |
| | | * @param productModelId |
| | | * @param quantity |
| | | * @param recordType |
| | |
| | | |
| | | /** |
| | | * 合格入库 |
| | | * |
| | | * @param productModelId |
| | | * @param quantity |
| | | * @param recordType |
| | |
| | | |
| | | /** |
| | | * 合格出库 |
| | | * |
| | | * @param productModelId |
| | | * @param quantity |
| | | * @param recordType |
| | |
| | | |
| | | //不合格库存删除 |
| | | public void deleteStockInRecord(Long recordId, String recordType) { |
| | | StockInRecord one = stockInRecordService.getOne(new QueryWrapper<StockInRecord>() |
| | | List<StockInRecord> stockInRecords = stockInRecordService.list(new QueryWrapper<StockInRecord>() |
| | | .lambda().eq(StockInRecord::getRecordId, recordId) |
| | | .eq(StockInRecord::getRecordType, recordType)); |
| | | if (ObjectUtils.isNotEmpty(one)) { |
| | | stockInRecordService.batchDelete(Collections.singletonList(one.getId())); |
| | | if (ObjectUtils.isNotEmpty(stockInRecords)) { |
| | | List<Long> collect = stockInRecords.stream().map(StockInRecord::getId).collect(Collectors.toList()); |
| | | stockInRecordService.batchDelete(collect); |
| | | } |
| | | } |
| | | |
| | | public void deleteStockOutRecord(Long recordId, String recordType) { |
| | | StockOutRecord one = stockOutRecordService.getOne(new QueryWrapper<StockOutRecord>() |
| | | List<StockOutRecord> stockOutRecords = stockOutRecordService.list(new QueryWrapper<StockOutRecord>() |
| | | .lambda().eq(StockOutRecord::getRecordId, recordId) |
| | | .eq(StockOutRecord::getRecordType, recordType)); |
| | | if (ObjectUtils.isNotEmpty(one)) { |
| | | stockOutRecordService.batchDelete(Collections.singletonList(one.getId())); |
| | | |
| | | if (ObjectUtils.isNotEmpty(stockOutRecords)) { |
| | | List<Long> collect = stockOutRecords.stream().map(StockOutRecord::getId).collect(Collectors.toList()); |
| | | stockOutRecordService.batchDelete(collect); |
| | | } |
| | | } |
| | | } |