| | |
| | | private ApproveProcessServiceImpl approveProcessService; |
| | | |
| | | @Override |
| | | public IPage<ShippingInfo> listPage(Page page, ShippingInfo req) { |
| | | IPage<ShippingInfo> listPage = shippingInfoMapper.listPage(page, req); |
| | | |
| | | public IPage<ShippingInfoDto> listPage(Page page, ShippingInfo req) { |
| | | IPage<ShippingInfoDto> listPage = shippingInfoMapper.listPage(page, req); |
| | | listPage.getRecords().forEach(item ->{ |
| | | item.setCommonFileList(commonFileService.getFileListByBusinessId(item.getId(), FileNameType.SHIP.getValue())); |
| | | }); |
| | | return listPage; |
| | | } |
| | | |
| | |
| | | if (byId == null) { |
| | | throw new RuntimeException("发货信息不存在"); |
| | | } |
| | | //扣减库存 |
| | | if(!"已发货".equals(byId.getStatus())){ |
| | | SalesLedgerProduct salesLedgerProduct = salesLedgerProductMapper.selectById(byId.getSalesLedgerProductId()); |
| | | stockUtils.substractStock(salesLedgerProduct.getProductModelId(), salesLedgerProduct.getQuantity(), StockQualifiedRecordTypeEnum.SALE_SHIP_STOCK_OUT.getCode(), req.getId()); |
| | | } |
| | | byId.setExpressNumber(req.getExpressNumber()); |
| | | byId.setExpressCompany(req.getExpressCompany()); |
| | | byId.setStatus("已发货"); |
| | | byId.setShippingCarNumber(req.getShippingCarNumber()); |
| | | boolean update = this.updateById(req); |
| | | //扣减库存 |
| | | SalesLedgerProduct salesLedgerProduct = salesLedgerProductMapper.selectById(req.getSalesLedgerProductId()); |
| | | stockUtils.substractStock(salesLedgerProduct.getProductModelId(), salesLedgerProduct.getQuantity(), StockQualifiedRecordTypeEnum.SALE_SHIP_STOCK_OUT.getCode(), req.getId()); |
| | | boolean update = this.updateById(byId); |
| | | // 迁移文件 |
| | | if(CollectionUtils.isNotEmpty(req.getTempFileIds())){ |
| | | tempFileService.migrateTempFilesToFormal(req.getId(), req.getTempFileIds(), FileNameType.SHIP.getValue()); |