| | |
| | | import com.ruoyi.stock.service.StockOutRecordService; |
| | | import com.ruoyi.stock.word.WeighbridgeDocGenerator; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | stockInRecordDto.setWeighingOperator(stockInventoryDto.getWeighingOperator()); |
| | | stockInRecordDto.setProductModelId(stockInventoryDto.getProductModelId()); |
| | | stockInRecordDto.setProductId(stockInventoryDto.getProductId()); |
| | | stockInRecordDto.setRemark(stockInventoryDto.getRemark()); |
| | | stockInRecordDto.setType("0"); |
| | | //生成磅单 |
| | | String absoluteDocPath = weighbridgeDocGenerator.generateWeighbridgeDoc(stockInRecordDto); |
| | |
| | | newStockInventory.setRemark(stockInventoryDto.getRemark()); |
| | | newStockInventory.setLockedQuantity(stockInventoryDto.getLockedQuantity()); |
| | | newStockInventory.setWarnNum(stockInventoryDto.getWarnNum()); |
| | | newStockInventory.setProductId(stockInventoryDto.getProductId()); |
| | | stockInventoryMapper.insert(newStockInventory); |
| | | } else { |
| | | stockInventoryDto.setQualitity(stockInventoryDto.getNetWeight()); |
| | |
| | | StockOutRecordDto stockOutRecordDto = new StockOutRecordDto(); |
| | | stockOutRecordDto.setRecordId(stockInventoryDto.getRecordId()); |
| | | stockOutRecordDto.setRecordType(stockInventoryDto.getRecordType()); |
| | | stockInventoryDto.setWeighingDate(stockInventoryDto.getWeighingDate()); |
| | | stockOutRecordDto.setWeighingDate(stockInventoryDto.getWeighingDate()); |
| | | stockOutRecordDto.setStockOutNum(stockInventoryDto.getNetWeight()); |
| | | stockOutRecordDto.setNetWeight(stockInventoryDto.getNetWeight()); |
| | | stockOutRecordDto.setGrossWeight(stockInventoryDto.getGrossWeight()); |
| | |
| | | stockOutRecordDto.setProductModelId(stockInventoryDto.getProductModelId()); |
| | | stockOutRecordDto.setLicensePlateNo(stockInventoryDto.getLicensePlateNo()); |
| | | stockOutRecordDto.setProductId(stockInventoryDto.getProductId()); |
| | | stockOutRecordDto.setRemark(stockInventoryDto.getRemark()); |
| | | stockOutRecordDto.setType("0"); |
| | | //生成磅单 |
| | | StockInRecordDto stockInRecordDto = new StockInRecordDto(); |
| | | BeanUtils.copyProperties(stockOutRecordDto, stockInRecordDto); |
| | | String absoluteDocPath = weighbridgeDocGenerator.generateWeighbridgeDoc(stockInRecordDto); |
| | | stockOutRecordDto.setWeighbridgeDocPath(absoluteDocPath); |
| | | stockOutRecordService.add(stockOutRecordDto); |
| | | StockInventory oldStockInventory = stockInventoryMapper.selectOne(new QueryWrapper<StockInventory>().lambda().eq(StockInventory::getProductModelId, stockInventoryDto.getProductModelId())); |
| | | if (ObjectUtils.isEmpty(oldStockInventory)) { |