| | |
| | | stockInRecordService.add(stockInRecordDto); |
| | | //再进行新增库存数量库存 |
| | | //先查询库存表中的产品是否存在,不存在新增,存在更新 |
| | | StockUninventory oldStockUnInventory = stockUninventoryMapper.selectOne(wrapper); |
| | | if (ObjectUtils.isEmpty(oldStockUnInventory)) { |
| | | StockUninventory newStockUnInventory = new StockUninventory(); |
| | | newStockUnInventory.setProductModelId(stockUninventoryDto.getProductModelId()); |
| | | newStockUnInventory.setQualitity(stockUninventoryDto.getQualitity()); |
| | | newStockUnInventory.setLockedQuantity(stockUninventoryDto.getLockedQuantity()); |
| | | newStockUnInventory.setBatchNo(stockUninventoryDto.getBatchNo()); |
| | | newStockUnInventory.setWarehouseInfoId(stockUninventoryDto.getWarehouseInfoId()); |
| | | newStockUnInventory.setVersion(1); |
| | | newStockUnInventory.setRemark(stockUninventoryDto.getRemark()); |
| | | stockUninventoryMapper.insert(newStockUnInventory); |
| | | }else { |
| | | stockUninventoryMapper.updateAddStockUnInventory(stockUninventoryDto); |
| | | } |
| | | // StockUninventory oldStockUnInventory = stockUninventoryMapper.selectOne(wrapper); |
| | | // if (ObjectUtils.isEmpty(oldStockUnInventory)) { |
| | | // StockUninventory newStockUnInventory = new StockUninventory(); |
| | | // newStockUnInventory.setProductModelId(stockUninventoryDto.getProductModelId()); |
| | | // newStockUnInventory.setQualitity(stockUninventoryDto.getQualitity()); |
| | | // newStockUnInventory.setLockedQuantity(stockUninventoryDto.getLockedQuantity()); |
| | | // newStockUnInventory.setBatchNo(stockUninventoryDto.getBatchNo()); |
| | | // newStockUnInventory.setWarehouseInfoId(stockUninventoryDto.getWarehouseInfoId()); |
| | | // newStockUnInventory.setVersion(1); |
| | | // newStockUnInventory.setRemark(stockUninventoryDto.getRemark()); |
| | | // stockUninventoryMapper.insert(newStockUnInventory); |
| | | // }else { |
| | | // stockUninventoryMapper.updateAddStockUnInventory(stockUninventoryDto); |
| | | // } |
| | | return 1; |
| | | } |
| | | |
| | |
| | | stockOutRecordDto.setRecordId(stockUninventoryDto.getRecordId()); |
| | | stockOutRecordDto.setRecordType(stockUninventoryDto.getRecordType()); |
| | | stockOutRecordDto.setStockOutNum(stockUninventoryDto.getQualitity()); |
| | | stockOutRecordDto.setWarehouseInfoId(stockUninventoryDto.getWarehouseInfoId()); |
| | | stockOutRecordDto.setBatchNo(stockUninventoryDto.getBatchNo()); |
| | | stockOutRecordDto.setProductModelId(stockUninventoryDto.getProductModelId()); |
| | | stockOutRecordDto.setType("1"); |