| | |
| | | public class ConsumablesUnInventoryServiceImpl extends ServiceImpl<ConsumablesUnInventoryMapper, ConsumablesUnInventory> implements ConsumablesUnInventoryService { |
| | | |
| | | private ConsumablesUnInventoryMapper consumablesUnInventoryMapper; |
| | | private ConsumablesOutRecordService ConsumablesOutRecordService; |
| | | private ConsumablesInRecordService ConsumablesInRecordService; |
| | | private ConsumablesOutRecordService consumablesOutRecordService; |
| | | private ConsumablesInRecordService consumablesInRecordService; |
| | | |
| | | @Override |
| | | public IPage<ConsumablesUnInventoryDto> pageConsumablesUnInventory(Page page, ConsumablesUnInventoryDto consumablesUnInventoryDto) { |
| | |
| | | consumablesInRecordDto.setStockInNum(consumablesUnInventoryDto.getQualitity()); |
| | | consumablesInRecordDto.setProductModelId(consumablesUnInventoryDto.getProductModelId()); |
| | | consumablesInRecordDto.setType("1"); |
| | | ConsumablesInRecordService.add(consumablesInRecordDto); |
| | | consumablesInRecordService.add(consumablesInRecordDto); |
| | | //再进行新增库存数量库存 |
| | | //先查询库存表中的产品是否存在,不存在新增,存在更新 |
| | | ConsumablesUnInventory oldConsumablesUnInventory = consumablesUnInventoryMapper.selectOne(new QueryWrapper<ConsumablesUnInventory>().lambda().eq(ConsumablesUnInventory::getProductModelId, consumablesUnInventoryDto.getProductModelId())); |
| | |
| | | consumablesOutRecordDto.setStockOutNum(consumablesUnInventoryDto.getQualitity()); |
| | | consumablesOutRecordDto.setProductModelId(consumablesUnInventoryDto.getProductModelId()); |
| | | consumablesOutRecordDto.setType("1"); |
| | | ConsumablesOutRecordService.add(consumablesOutRecordDto); |
| | | consumablesOutRecordService.add(consumablesOutRecordDto); |
| | | ConsumablesUnInventory oldConsumablesInventory = consumablesUnInventoryMapper.selectOne(new QueryWrapper<ConsumablesUnInventory>().lambda().eq(ConsumablesUnInventory::getProductModelId, consumablesUnInventoryDto.getProductModelId())); |
| | | if (ObjectUtils.isEmpty(oldConsumablesInventory)) { |
| | | throw new RuntimeException("产品库存不存在"); |