diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionSignforClient.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionSignforClient.java index 53ca6e01c..be055727d 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionSignforClient.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionSignforClient.java @@ -24,6 +24,8 @@ import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestParam; +import java.util.Map; + /** * 签收管理 Feign接口类 * @@ -61,5 +63,5 @@ public interface IDistributionSignforClient { * @return */ @GetMapping(CLERKCHECKPUSHDATA) - Boolean clerkCheckPushData(@RequestParam("id") Long id); + Map clerkCheckPushData(@RequestParam("id") Long id); } diff --git a/blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IOldSignPushClient.java b/blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IOldSignPushClient.java index f5c0818e6..90d735e35 100644 --- a/blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IOldSignPushClient.java +++ b/blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IOldSignPushClient.java @@ -20,7 +20,7 @@ public interface IOldSignPushClient { String API_PREFIX = "/client"; @PostMapping(API_PREFIX + "/pushOldSystemSignInfo") - Boolean pushOldSystemSignInfo(@RequestBody SignPushDataDTO signPushDataDTO); + Map pushOldSystemSignInfo(@RequestBody SignPushDataDTO signPushDataDTO); diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionSignforClient.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionSignforClient.java index ed3aa21d3..a347285fa 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionSignforClient.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionSignforClient.java @@ -51,6 +51,7 @@ import springfox.documentation.annotations.ApiIgnore; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.stream.Collectors; /** @@ -109,7 +110,7 @@ public class DistributionSignforClient implements IDistributionSignforClient { * @return */ @Override - public Boolean clerkCheckPushData(Long id) { + public Map clerkCheckPushData(Long id) { return distributionSignforService.clerkCheckPushData(id); diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/ClerkCheckPushDataQueueHandler.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/ClerkCheckPushDataQueueHandler.java index e8bc11e97..94ca9f12a 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/ClerkCheckPushDataQueueHandler.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/ClerkCheckPushDataQueueHandler.java @@ -64,8 +64,8 @@ public class ClerkCheckPushDataQueueHandler { log.info(">>>>>>>>>>>>> clerkCheckPushDataHandler 签收ID为空"); return; } - Boolean b = distributionSignforService.clerkCheckPushData(t); - log.info(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 推送老系统签收队列 成功状态: {}",b); + Map map1= distributionSignforService.clerkCheckPushData(t); + log.info(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 推送老系统签收队列 成功状态: {}",map1); } catch (Exception e) { log.error(">>>>> 推送老系统签收信息报错", e); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionSignforService.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionSignforService.java index bfafa9103..fbb265899 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionSignforService.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionSignforService.java @@ -339,7 +339,7 @@ public interface IDistributionSignforService extends BaseService clerkCheckPushData(Long id); /** * 导出签收详情列表 diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java index 04a39fd2f..519785df1 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java @@ -1727,7 +1727,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl map = oldSystemDataPushClient.pushOldSystemSignInfo(delivery); } catch (Exception e) { log.error(">>>>> 推送老系统签收信息报错", e); } @@ -6445,13 +6445,15 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl clerkCheckPushData(Long id) { + Map resultMap = new HashMap<>(); try { log.info(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 推送老系统签收队列"); //得到审核的任务ID if (ObjectUtil.isEmpty(id)) { log.info(">>>>>>>>>>>>> clerkCheckPushDataHandler 签收ID为空"); - return false; + resultMap.put("result",false); + return resultMap; } //得到签收对象 @@ -6461,20 +6463,23 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl>>>>>>>>>>> clerkCheckPushDataHandler distributionSignforEntity {}", distributionSignforEntity); - return false; + resultMap.put("result",false); + return resultMap; } // 得到配送计划 DistributionDeliveryListEntity distributionDeliveryListEntity = distributionDeliveryListMapper.selectById(distributionSignforEntity.getDeliveryId()); if (ObjectUtil.isEmpty(distributionDeliveryListEntity)) { log.info(">>>>>>>>>>> clerkCheckPushDataHandler distributionDeliveryListEntity {}", distributionDeliveryListEntity); - return false; + resultMap.put("result",false); + return resultMap; } // 得到配送客户 DistributionReservationEntity distributionReservationEntity = distributionReservationMapper.selectById(distributionSignforEntity.getReservationId()); if (ObjectUtil.isEmpty(distributionReservationEntity)) { log.info(">>>>>>>>>>>> clerkCheckPushDataHandler distributionReservationEntity {}", distributionReservationEntity); - return false; + resultMap.put("result",false); + return resultMap; } @@ -6582,14 +6587,14 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl>>> clerkCheckPushData SignPushDataDTO :{}", delivery); - Boolean b = oldSystemDataPushClient.pushOldSystemSignInfo(delivery); - return b; + resultMap= oldSystemDataPushClient.pushOldSystemSignInfo(delivery); + return resultMap; } catch (Exception e) { log.error(">>>>> 推送老系统签收信息报错", e); } + return resultMap; - return false; } @Override diff --git a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/SignPushClient.java b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/SignPushClient.java index 8dccde415..516b52037 100644 --- a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/SignPushClient.java +++ b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/SignPushClient.java @@ -26,11 +26,11 @@ public class SignPushClient implements IOldSignPushClient { @Autowired private OldSystemProperties oldSystemProperties; @Override - public Boolean pushOldSystemSignInfo(SignPushDataDTO signPushDataDTO) { + public Map pushOldSystemSignInfo(SignPushDataDTO signPushDataDTO) { //todo 这里存在调用老系统的接口 将数据会写给老系统 int timeoutMilliseconds = 60000; - + Map resultMap = new HashMap<>(); Boolean result =false; log.info(">>>> pushOldSystemSignInfo 程序执行 start time: {}",System.currentTimeMillis()); String authCode = oldLogin(signPushDataDTO.getWarehouseId()+""); @@ -41,12 +41,14 @@ public class SignPushClient implements IOldSignPushClient { log.info(">>>> pushOldSystemSignInfo request url:{} data:{}",url,data); String body = HttpRequest.post(url).body(data).header("token", authCode).setConnectionTimeout(timeoutMilliseconds).execute().body(); + log.info(">>>> pushOldSystemSignInfo body :{}",body); if (StringUtil.isNotBlank(body)) { JSONObject res = JSON.parseObject(body); if ("200".equals(res.getString("code"))) { result= true; }else { String msg = res.getString("msg"); + resultMap.put("msg",result); log.info(">>>> pushOldSystemSignInfo response msg:{}",msg); log.info(">>>> pushOldSystemSignInfo 推送配送ID signPushDataDTO ID:{}",signPushDataDTO.getId()); } @@ -55,7 +57,10 @@ public class SignPushClient implements IOldSignPushClient { log.info(">>>> pushOldSystemSignInfo 程序执行 end time : {} >> return result :{} ",System.currentTimeMillis(),result); - return result; + resultMap.put("result",result); + + + return resultMap; } @Override 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 171609dce..8176174fc 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 @@ -82,20 +82,22 @@ public class DistributionDatarepair { Map> packageMap = deliveryParcelListEntities.stream().collect(Collectors.groupingBy(DistributionParcelListEntity::getWarehouseId)); packageMap.forEach((k, v) -> { String orderPackageCodes = v.stream().map(DistributionParcelListEntity::getOrderPackageCode).collect(Collectors.joining(",")); - stringBuffer.append("仓库:"+k).append("包件下架"+orderPackageCodes);; - Map map = new HashMap<>(); - map.put("orderPackageCode",orderPackageCodes); - map.put("warehouseId",k); + stringBuffer.append("仓库:" + k).append("包件下架" + orderPackageCodes); + ; + Map map = new HashMap<>(); + map.put("orderPackageCode", orderPackageCodes); + map.put("warehouseId", k); warehouseUpdownTypeClient.downDeliveryPackage(map); }); } - log.info("执行包件下架操作>>>>>>>>>>>>>"+stringBuffer.toString()); + log.info("执行包件下架操作>>>>>>>>>>>>>" + stringBuffer.toString()); return ReturnT.SUCCESS; } /** * 对已签收包件进行解托 + * * @return */ @XxlJob("downTrayOldPackage") @@ -108,144 +110,150 @@ public class DistributionDatarepair { Map> packageMap = deliveryParcelListEntities.stream().collect(Collectors.groupingBy(DistributionParcelListEntity::getWarehouseId)); packageMap.forEach((k, v) -> { String orderPackageCodes = v.stream().map(DistributionParcelListEntity::getOrderPackageCode).collect(Collectors.joining(",")); - stringBuffer.append("仓库:"+k).append("包件解托"+orderPackageCodes);; - warehouseUpdownTypeClient.downPackageOrDelTray(orderPackageCodes, k,"签收下架解托"); + stringBuffer.append("仓库:" + k).append("包件解托" + orderPackageCodes); + ; + warehouseUpdownTypeClient.downPackageOrDelTray(orderPackageCodes, k, "签收下架解托"); }); } - log.info("执行包件下架操作>>>>>>>>>>>>>"+stringBuffer.toString()); + log.info("执行包件下架操作>>>>>>>>>>>>>" + stringBuffer.toString()); return ReturnT.SUCCESS; } /** * 维护配送状态 + * * @return */ @XxlJob("maintenanceDeliveryStatus") public ReturnT maintenanceDeliveryStatus(String params) { //维护配送的状态 String method = "######################DistributionDatarepair.maintenanceDeliveryStatus"; - log.info(method+"维护配送订单id:{}",params); + log.info(method + "维护配送订单id:{}", params); deliveryListClient.maintenanceDeliveryInfo(params); - log.info(method+"维护配送订单结束"); + log.info(method + "维护配送订单结束"); return ReturnT.SUCCESS; } /** * 维护预约单信息 + * * @return */ @XxlJob("maintenanceReservationInfo") public ReturnT maintenanceReservationInfo(String params) { //维护配送的状态 String method = "######################DistributionDatarepair.maintenanceDeliveryStatus"; - log.info(method+"维护配送订单id:{}",params); + log.info(method + "维护配送订单id:{}", params); distributionReservationClient.maintenanceReservationInfo(params); - log.info(method+"维护配送订单结束"); + log.info(method + "维护配送订单结束"); return ReturnT.SUCCESS; } /** * 维护指定取消预约信息 + * * @return */ @XxlJob("maintenanceCancelReservation") public ReturnT maintenanceCancelReservation(String params) { //维护配送的状态 String method = "######################DistributionDatarepair.maintenanceDeliveryStatus"; - log.info(method+"维护配送订单id:{}",params); + log.info(method + "维护配送订单id:{}", params); distributionReservationClient.maintenanceCancelReservation(params); - log.info(method+"维护配送订单结束"); + log.info(method + "维护配送订单结束"); return ReturnT.SUCCESS; } - /** * 维护指定取消预约信息 + * * @return */ @XxlJob("maintenanceDeliveryInfo") public ReturnT maintenanceDeliveryInfo(String params) { //维护配送的状态 String method = "######################DistributionDatarepair.maintenanceDeliveryStatus"; - log.info(method+"维护配送订单id:{}",params); + log.info(method + "维护配送订单id:{}", params); deliveryListClient.maintenanceDeliveryInfoByWarehouseId(params); - log.info(method+"维护配送订单结束"); + log.info(method + "维护配送订单结束"); return ReturnT.SUCCESS; } - - /** * 推送老系统系统 + * * @return */ @XxlJob("pushNotification") public ReturnT pushNotification(String params) { // 得到当前仓库所有的签收任务 Integer parmeId = null; - if(StringUtil.isNotBlank(params)){ + if (StringUtil.isNotBlank(params)) { parmeId = Integer.parseInt(params); } List allSignfor = warehouseMappingDataMapper.findAllSignfor(parmeId); for (JSONObject entries : allSignfor) { Long id = entries.getLong("singnforId"); - Boolean b = distributionSignforClient.clerkCheckPushData(id); - if(b!=null&&b){ + Map map = distributionSignforClient.clerkCheckPushData(id); + Boolean b = (Boolean) map.get("b"); + if (b != null && b) { warehouseMappingDataMapper.updateClearSignforStatus(id, entries.getLong("warehouseId"), 1); - log.info(">>> 推送成功 {}",id); - }else{ - log.error(">>> 推送失败 id="+id); + log.info(">>> 推送成功 {}", id); + } else { + log.error(">>> 推送失败 id=" + id); } } return ReturnT.SUCCESS; } - /** * 推送单个 老系统系统 + * * @return */ @XxlJob("pushSingleNotification") public ReturnT pushSingleNotification(String params) { - Boolean b = distributionSignforClient.clerkCheckPushData(Long.parseLong(params)); - if(b!=null&&b){ - warehouseMappingDataMapper.updateClearSignforStatusBysignforId(Long.parseLong(params), 1); - log.info(">>> 推送成功 {}",Long.parseLong(params)); - }else{ - log.error(">>> 推送失败 id="+Long.parseLong(params)); - } + Map map = distributionSignforClient.clerkCheckPushData(Long.parseLong(params)); + Boolean b = (Boolean) map.get("b"); + if (b != null && b) { + warehouseMappingDataMapper.updateClearSignforStatusBysignforId(Long.parseLong(params), 1); + log.info(">>> 推送成功 {}", Long.parseLong(params)); + } else { + log.error(">>> 推送失败 id=" + Long.parseLong(params)); + } return ReturnT.SUCCESS; } /** * 推送自提签收老系统系统 + * * @return */ @XxlJob("pushBillNotification") public ReturnT pushBillNotification(String params) { // 得到当前仓库所有的签收任务 Long parmeId = null; - if(StringUtil.isNotBlank(params)){ + if (StringUtil.isNotBlank(params)) { parmeId = Long.parseLong(params); } List allSignfor = warehouseMappingDataMapper.findAllBillSign(parmeId); for (JSONObject entries : allSignfor) { try { Long id = entries.getLong("billId"); - Boolean b =distrilbutionBillLadingClient.clerkBillCheckPushData(id); - if(b!=null&&b){ + Boolean b = distrilbutionBillLadingClient.clerkBillCheckPushData(id); + if (b != null && b) { warehouseMappingDataMapper.updateClearBillSignforStatus(entries.getLong("id"), entries.getLong("warehouseId"), 1); - log.info(">>> pushBillNotification 成功 id={}",id); - }else{ - log.error(">>> pushBillNotification 失败 id="+id); + log.info(">>> pushBillNotification 成功 id={}", id); + } else { + log.error(">>> pushBillNotification 失败 id=" + id); } - Thread.sleep(1000*60); + Thread.sleep(1000 * 60); } catch (InterruptedException e) { throw new RuntimeException(e); } finally { @@ -257,22 +265,17 @@ public class DistributionDatarepair { } - /** * 推送自提签收信息至工厂 + * * @return */ @XxlJob("sendFactorySignforInfo") public ReturnT sendFactorySignforInfo(String params) { // 得到当前仓库所有的签收任务 - Boolean b =distrilbutionBillLadingClient.sendFactorySignforInfo(params); + Boolean b = distrilbutionBillLadingClient.sendFactorySignforInfo(params); return ReturnT.SUCCESS; } - - - - - }