| | |
| | | import com.ruoyi.common.enums.FileNameType; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.other.service.impl.TempFileServiceImpl; |
| | | import com.ruoyi.procurementrecord.service.impl.ReturnManagementServiceImpl; |
| | | import com.ruoyi.sales.dto.ShippingInfoDto; |
| | | import com.ruoyi.sales.pojo.ShippingInfo; |
| | | import com.ruoyi.sales.pojo.ShippingInfoDetail; |
| | |
| | | @Autowired |
| | | private CommonFileServiceImpl commonFileService; |
| | | |
| | | @Autowired |
| | | private ReturnManagementServiceImpl returnManagementService; |
| | | |
| | | @Override |
| | | public IPage<ShippingInfoDetail> listPage(Page page, ShippingInfoDetail shippingInfoDetail) { |
| | | IPage<ShippingInfoDetail> shippingInfoDetailIPage = shippingInfoDetailMapper.listPage(page, shippingInfoDetail); |
| | | shippingInfoDetailIPage.getRecords().forEach(item ->{ |
| | | item.setCommonFileList(commonFileService.getFileListByBusinessId(item.getId(), FileNameType.SHIP.getValue())); |
| | | BigDecimal returnSaleProductCountByShippingId = returnManagementService.getReturnSaleProductCountByShippingId(Collections.singletonList(item.getId())); |
| | | item.setReturnTotal(returnSaleProductCountByShippingId); |
| | | }); |
| | | return shippingInfoDetailIPage; |
| | | } |
| | |
| | | }else{ |
| | | shippingInfo.setStatus("发货中"); |
| | | } |
| | | // 扣库存 |
| | | shippingInfo.setShippingTotal(shippingInfoDetail.getShippingNum()); |
| | | shippingInfoService.deductStock(shippingInfo); |
| | | // 迁移文件 |
| | | if(CollectionUtils.isNotEmpty(shippingInfoDetail.getTempFileIds())){ |