diff --git a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataClientClient.java b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataClientClient.java index 7320af293..b2a8f1adb 100644 --- a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataClientClient.java +++ b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataClientClient.java @@ -88,4 +88,12 @@ public interface IBasicdataClientClient { */ @GetMapping(API_PREFIX+"/getMallById") BasicdataClientEntity getMallById(Long mallId); + + /** + * 根据名称查询客户 + * @param consigneeUnit + * @return + */ + @GetMapping(API_PREFIX+"/getClientByName") + List getClientByName(String consigneeUnit); } diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionStockArticleClient.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionStockArticleClient.java index 482860443..b5ae4f088 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionStockArticleClient.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionStockArticleClient.java @@ -151,4 +151,8 @@ public interface IDistributionStockArticleClient { @GetMapping(API_PREFIX + "/updateAllOrderTotalNum") void updateAllOrderTotalNum(@RequestParam String orderCode, @RequestParam Integer total); + + + @GetMapping(API_PREFIX + "/maintenanceOrderMall") + Boolean maintenanceOrderMall(@RequestParam String orderIds); } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataClientClient.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataClientClient.java index 97402e729..b0ab86b1c 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataClientClient.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataClientClient.java @@ -121,4 +121,13 @@ public class BasicdataClientClient implements IBasicdataClientClient { return basicdataClientService.getById(mallId); } + /** + * @param consigneeUnit + * @return + */ + @Override + public List getClientByName(String consigneeUnit) { + return basicdataClientService.list(Wrappers.query().lambda().eq(BasicdataClientEntity::getClientName,consigneeUnit)); + } + } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionStockArticleClient.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionStockArticleClient.java index e603188e1..0e76bdad5 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionStockArticleClient.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionStockArticleClient.java @@ -311,4 +311,15 @@ public class DistributionStockArticleClient implements IDistributionStockArticle distributionStockArticleService.updateAllOrderTotalNum(orderCode,total); } + /** + * @param orderIds + * @return + */ + @Override + public Boolean maintenanceOrderMall(String orderIds) { + + + return distributionStockArticleService.maintenanceOrderMall(orderIds); + } + } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.java index fbb1bebc4..699c89438 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.java @@ -193,4 +193,6 @@ public interface DistributionStockArticleMapper extends BaseMapper pageSignforListOwe(IPage page,@Param("param") DistributionStockArticleOweDTO stockArticleEntity); void updateAllOrderTotalNum(@Param("orderCode") String orderCode, @Param("total") Integer total); + + List> selectAdvance(@Param("orderCode")String orderCode); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml index 2b166bf28..c2c79af28 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml @@ -1316,6 +1316,9 @@ GROUP BY ldsa.id + update logpm_distribution_stock_article diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockArticleService.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockArticleService.java index 416cf23ab..aedad2977 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockArticleService.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockArticleService.java @@ -264,4 +264,11 @@ public interface IDistributionStockArticleService extends BaseService exportSignforDistributionStockArticleList(Map distributionStockArticle, IPage page); + + /** + * 维护指定订单的商场信息 + * @param orderIds + * @return + */ + Boolean maintenanceOrderMall(String orderIds); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java index 63cb8f5ef..eed503779 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java @@ -28,7 +28,9 @@ import com.logpm.basic.entity.BasicMaterialEntity; import com.logpm.basic.entity.BasicPrintTemplateEntity; import com.logpm.basic.feign.IBasicMaterialClient; import com.logpm.basic.feign.IBasicPrintTemplateClient; +import com.logpm.basicdata.entity.BasicdataClientEntity; import com.logpm.basicdata.entity.BasicdataWarehouseEntity; +import com.logpm.basicdata.feign.IBasicdataClientClient; import com.logpm.basicdata.feign.IBasicdataWarehouseClient; import com.logpm.distribution.dto.DistributionStockArticleDTO; import com.logpm.distribution.dto.DistributionStockArticleOweDTO; @@ -138,6 +140,7 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl selectDistributionStockArticlePage(IPage page, DistributionStockArticleVO distributionStockArticle) { @@ -180,14 +183,14 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl { DistributionStockArticleVO distributionStockArticleVO = buildVo(li); DistributionStockArticleExcel excel = new DistributionStockArticleExcel(); - assert distributionStockArticleVO != null; - if (distributionStockArticleVO.getTotalNumber() != null && + assert distributionStockArticleVO != null; + if (distributionStockArticleVO.getTotalNumber() != null && distributionStockArticleVO.getIncomingNum() != null) { distributionStockArticleVO.setUnreceivedQuantity( distributionStockArticleVO.getTotalNumber() - distributionStockArticleVO.getIncomingNum() ); } - excel.setIsZeroString("1".equals(distributionStockArticleVO.getIsZero())?"是":"否"); + excel.setIsZeroString("1".equals(distributionStockArticleVO.getIsZero()) ? "是" : "否"); BeanUtil.copyProperties(distributionStockArticleVO, excel); excelList.add(excel); }); @@ -199,6 +202,7 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl stockArticleEntityList = baseMapper.selectAllDistributionOrder(page, stockArticleEntity); List stockArticleVOS = DistributionStockArticleNewWrapper.build().listVO(stockArticleEntityList.getRecords()); for (DistributionStockArticleVO stockArticleVO : stockArticleVOS) { - if (IsOrNoConstant.no.getValue().equals(stockArticleVO.getIsZero())){ + if (IsOrNoConstant.no.getValue().equals(stockArticleVO.getIsZero())) { stockArticleVO.setReservationNum(stockArticleVO.getHandQuantity()); - }else { + } else { List distributionParcelNumberVOS = distributionParcelNumberMapper.selectZeroPackage(stockArticleVO.getId()); // 零担查询当前操作计划可用数量 int reservationNum = distributionParcelNumberVOS.stream().mapToInt(DistributionParcelNumberVO::getHandQuantity).sum() - distributionParcelNumberVOS.stream().mapToInt(DistributionParcelNumberVO::getDeliveryQuantity).sum(); @@ -2010,7 +2014,7 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl distributionStockArticleEntities = this.listByIds(Func.toLongList(orderIds)); + List list = new ArrayList<>(); + for (DistributionStockArticleEntity distributionStockArticleEntity : distributionStockArticleEntities) { + DistributionStockArticleEntity stockArticleEntity = new DistributionStockArticleEntity(); + stockArticleEntity.setId(distributionStockArticleEntity.getId()); + if (Func.isNotEmpty(distributionStockArticleEntity.getConsigneeUnit())) { + //查询客户 + List clientByName = basicdataClientClient.getClientByName(distributionStockArticleEntity.getConsigneeUnit()); + if (!clientByName.isEmpty()) { + BasicdataClientEntity basicdataClientEntity = clientByName.get(0); + stockArticleEntity.setMallId(basicdataClientEntity.getId()); + stockArticleEntity.setMallName(basicdataClientEntity.getClientName()); + stockArticleEntity.setMallCode(basicdataClientEntity.getClientCode()); + } else { + List> maps = baseMapper.selectAdvance(distributionStockArticleEntity.getOrderCode()); + if (!maps.isEmpty()) { + String dealerName = (String) maps.get(0).get("dealer_name"); + String dealerCode = (String) maps.get(0).get("dealer_code"); + stockArticleEntity.setMallName(dealerName); + stockArticleEntity.setMallCode(dealerCode); + } else { + stockArticleEntity.setMallName(distributionStockArticleEntity.getConsigneeUnit()); + } + } + list.add(stockArticleEntity); + } else { + + + } + + + } + + boolean flag = this.updateBatchById(list); + log.info(">>>>>>>>>>>>>>>>>>>维护订单商场信息,:{}",flag); + return null; + } + @Override public R findEditCustomerLog(Long orderId) { diff --git a/blade-service/logpm-patch/src/main/java/com/logpm/patch/jobhandle/OrderDataRepair.java b/blade-service/logpm-patch/src/main/java/com/logpm/patch/jobhandle/OrderDataRepair.java index 13a73f734..16b4de17a 100644 --- a/blade-service/logpm-patch/src/main/java/com/logpm/patch/jobhandle/OrderDataRepair.java +++ b/blade-service/logpm-patch/src/main/java/com/logpm/patch/jobhandle/OrderDataRepair.java @@ -32,6 +32,20 @@ public class OrderDataRepair { return ReturnT.SUCCESS; } + /** + * 维护指定收货单位订单商场信息 + * @param param + * @return + */ + @XxlJob("maintenanceOrderMall") + public ReturnT maintenanceOrderMall(String param) { + log.info("####################OrderDataRepair.maintenanceOrderStatus: 维护订单状态 开始"); + log.info("####################OrderDataRepair.param: param"); + Boolean flag = distributionStockArticleClient.maintenanceOrderMall(param); + log.info("####################OrderDataRepair.maintenanceOrderStatus: 维护订单状态 完成"); + return ReturnT.SUCCESS; + } + @XxlJob("repairOrderSignStatus") public ReturnT repairOrderSignStatus(String param) {