| | |
| | | approveProcessService.addApprove(approveProcessVO); |
| | | } |
| | | |
| | | @Override |
| | | public Integer addStockUninventoryNoReview(StockUninventoryDto stockUninventoryDto) { |
| | | //新增入库记录再添加库存 |
| | | StockInRecordDto stockInRecordDto = new StockInRecordDto(); |
| | | stockInRecordDto.setRecordId(stockUninventoryDto.getRecordId()); |
| | | stockInRecordDto.setRecordType(stockUninventoryDto.getRecordType()); |
| | | stockInRecordDto.setStockInNum(stockUninventoryDto.getQualitity()); |
| | | stockInRecordDto.setProductModelId(stockUninventoryDto.getProductModelId()); |
| | | stockInRecordDto.setType("1"); |
| | | stockInRecordService.add(stockInRecordDto); |
| | | //再进行新增库存数量库存 |
| | | //先查询库存表中的产品是否存在,不存在新增,存在更新 |
| | | StockUninventory oldStockUnInventory = stockUninventoryMapper.selectOne(new QueryWrapper<StockUninventory>().lambda().eq(StockUninventory::getProductModelId, stockUninventoryDto.getProductModelId())); |
| | | if (ObjectUtils.isEmpty(oldStockUnInventory)) { |
| | | StockUninventory newStockUnInventory = new StockUninventory(); |
| | | newStockUnInventory.setProductModelId(stockUninventoryDto.getProductModelId()); |
| | | newStockUnInventory.setQualitity(stockUninventoryDto.getQualitity()); |
| | | newStockUnInventory.setVersion(1); |
| | | newStockUnInventory.setRemark(stockUninventoryDto.getRemark()); |
| | | stockUninventoryMapper.insert(newStockUnInventory); |
| | | }else { |
| | | stockUninventoryMapper.updateAddStockUnInventory(stockUninventoryDto); |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | /** |
| | | * 更新或创建非良品库存信息 |
| | | * |