diff --git a/blade-service/logpm-patch/src/main/java/com/logpm/patch/jobhandle/DistributionDatarepair.java b/blade-service/logpm-patch/src/main/java/com/logpm/patch/jobhandle/DistributionDatarepair.java index bae91e777..0c68e87c8 100644 --- a/blade-service/logpm-patch/src/main/java/com/logpm/patch/jobhandle/DistributionDatarepair.java +++ b/blade-service/logpm-patch/src/main/java/com/logpm/patch/jobhandle/DistributionDatarepair.java @@ -3,26 +3,22 @@ package com.logpm.patch.jobhandle; import cn.hutool.json.JSONObject; import com.logpm.distribution.entity.DistributionParcelListEntity; -import com.logpm.distribution.entity.DistributionSignforEntity; import com.logpm.distribution.feign.IDistributionDeliveryListClient; import com.logpm.distribution.feign.IDistributionReservationClient; import com.logpm.distribution.feign.IDistributionSignforClient; import com.logpm.distribution.feign.IDistrilbutionBillLadingClient; import com.logpm.patch.mapper.WarehouseMappingDataMapper; import com.logpm.patch.service.ISyncDistributionParcelListService; +import com.logpm.patch.service.IWarehouseMappingDataService; import com.logpm.warehouse.feign.IWarehouseUpdownTypeClient; import com.xxl.job.core.biz.model.ReturnT; import com.xxl.job.core.handler.annotation.XxlJob; -import io.jsonwebtoken.lang.Objects; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang.StringUtils; -import org.springblade.common.constant.RabbitConstant; -import org.springblade.common.utils.CommonUtil; import org.springblade.core.tool.utils.Func; import org.springblade.core.tool.utils.StringUtil; import org.springframework.amqp.rabbit.core.RabbitTemplate; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import java.util.HashMap; @@ -38,6 +34,7 @@ import java.util.stream.Collectors; @Component public class DistributionDatarepair { + private final IWarehouseMappingDataService warehouseMappingDataService; private final ISyncDistributionParcelListService iSyncDistributionParcelListService; @@ -339,7 +336,20 @@ public class DistributionDatarepair { @XxlJob("handletrunklineWaybillSignLog") public ReturnT handletrunklineWaybillSignLog(String params) { // 得到当前仓库所有的签收任务 - Boolean b = distributionSignforClient.handletrunklineWaybillSignLog(params); + List ls = warehouseMappingDataService.findAllDealWithWaybillNo(); + + ls.forEach(json -> { + Integer id = json.getInt("id"); + String waybillNo = json.getStr("waybillNo"); + + log.info("###################saveBasicdataZero: 当前处理的运单为 waybillNo={}",waybillNo); + + Boolean b = distributionSignforClient.handletrunklineWaybillSignLog(waybillNo); + + warehouseMappingDataService.updateStatusDealwithWaybillById(id); + }); + + return ReturnT.SUCCESS; } diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/listener/mq/WaybillCheckListener.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/listener/mq/WaybillCheckListener.java index 62123b642..9d0b032ee 100644 --- a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/listener/mq/WaybillCheckListener.java +++ b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/listener/mq/WaybillCheckListener.java @@ -61,35 +61,39 @@ public class WaybillCheckListener { )) @Transactional(rollbackFor = Exception.class) public void checkWaybillIncomingData(String msg) { - log.info("#########checkWaybillIncomingData: 运单审核处理收入结算数据 msg={}", msg); - JSONObject jsonObject = JSONUtil.parseObj(msg); - Long waybillId = jsonObject.getLong("waybillId"); - - WarehouseWaybillEntity waybillEntity = warehouseWaybillClient.findByWaybillId(waybillId); - if (Objects.isNull(waybillEntity)) { - log.warn("###########checkWaybillIncomingData: 运单信息不存在 waybillId={}", waybillId); - throw new CustomerException(405, "运单信息不存在"); - } + try{ + log.info("#########checkWaybillIncomingData: 运单审核处理收入结算数据 msg={}", msg); + JSONObject jsonObject = JSONUtil.parseObj(msg); + Long waybillId = jsonObject.getLong("waybillId"); + + WarehouseWaybillEntity waybillEntity = warehouseWaybillClient.findByWaybillId(waybillId); + if (Objects.isNull(waybillEntity)) { + log.warn("###########checkWaybillIncomingData: 运单信息不存在 waybillId={}", waybillId); + throw new CustomerException(405, "运单信息不存在"); + } - Integer waybillType = waybillEntity.getWaybillType(); - String payWay = waybillEntity.getPayWay(); - if (waybillType.equals(1)) { - //订制品(包含有数据库存品) - dealwithPackageOrder(waybillEntity); + Integer waybillType = waybillEntity.getWaybillType(); + String payWay = waybillEntity.getPayWay(); + if (waybillType.equals(1)) { + //订制品(包含有数据库存品) + dealwithPackageOrder(waybillEntity); - } else if (waybillType.equals(2)) { - //零担 - dealwithZeroOrder(waybillEntity); + } else if (waybillType.equals(2)) { + //零担 + dealwithZeroOrder(waybillEntity); - } else { - log.warn("###############checkWaybillIncomingData: 运单类型不正确 waybillId={} waybillType={}", waybillId, waybillType); - } + } else { + log.warn("###############checkWaybillIncomingData: 运单类型不正确 waybillId={} waybillType={}", waybillId, waybillType); + } // if (payWay.equals("1") || payWay.equals("2")) { // //如果是现付和到付需要直接生成结算单 // createBalanceOrder(waybillEntity); // } - log.info("#########checkWaybillIncomingData: 运单审核处理收入结算数据 结束 waybillId={}", waybillId); + log.info("#########checkWaybillIncomingData: 运单审核处理收入结算数据 结束 waybillId={}", waybillId); + } catch (Exception e) { + log.error("###############checkWaybillIncomingData: 运单审核处理收入结算数据 异常 msg={}", msg, e); + } } private void createBalanceOrder(WarehouseWaybillEntity waybillEntity) { diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/WarehouseWaybillController.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/WarehouseWaybillController.java index 971da470e..19cac21f6 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/WarehouseWaybillController.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/WarehouseWaybillController.java @@ -16,6 +16,7 @@ */ package com.logpm.warehouse.controller; +import cn.hutool.core.collection.CollUtil; import com.baomidou.mybatisplus.core.metadata.IPage; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import com.logpm.basicdata.entity.BasicdataWarehouseEntity; @@ -314,10 +315,14 @@ public class WarehouseWaybillController extends BladeController { String method = "############pageFinanceWaybillList: "; log.info(method + "请求参数{}", waybillDTO); try{ - List destinationWarehouseIds = warehouseClient.getWarehouseIds(); - //当前登录人选择的仓库 - waybillDTO.setDestinationWarehouseIds(destinationWarehouseIds); + List destinationWarehouseIds1 = waybillDTO.getDestinationWarehouseIds(); + + if(CollUtil.isEmpty(destinationWarehouseIds1)){ + List destinationWarehouseIds = warehouseClient.getWarehouseIds(); + //当前登录人选择的仓库 + waybillDTO.setDestinationWarehouseIds(destinationWarehouseIds); + } IPage pages = warehouseWaybillService.pageFinanceWaybillList(waybillDTO); @@ -338,20 +343,13 @@ public class WarehouseWaybillController extends BladeController { public void financeWaybillListExport(@RequestBody WarehouseWaybillDTO waybillDTO, HttpServletResponse response) { String method = "############financeWaybillListExport: "; log.info(method+"请求参数{}",waybillDTO); - List destinationWarehouseIds = new ArrayList<>(); - //当前登录人选择的仓库 - BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); - if(Objects.isNull(myCurrentWarehouse)){ - List myWatchWarehouse = warehouseClient.getMyWatchWarehouse(); - if(!myWatchWarehouse.isEmpty()){ - myWatchWarehouse.forEach(warehouseEntity -> { - destinationWarehouseIds.add(warehouseEntity.getId()); - }); - } - }else{ - destinationWarehouseIds.add(myCurrentWarehouse.getId()); + List destinationWarehouseIds1 = waybillDTO.getDestinationWarehouseIds(); + + if(CollUtil.isEmpty(destinationWarehouseIds1)){ + List destinationWarehouseIds = warehouseClient.getWarehouseIds(); + //当前登录人选择的仓库 + waybillDTO.setDestinationWarehouseIds(destinationWarehouseIds); } - waybillDTO.setDestinationWarehouseIds(destinationWarehouseIds); List ls = warehouseWaybillService.financeWaybillListExport(waybillDTO); //导出ls