Browse Source

修复推送老系统报错 没有错误信息的清理

dist.1.3.0
pref_mail@163.com 5 months ago
parent
commit
1a1bc0048c
  1. 4
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionSignforClient.java
  2. 2
      blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IOldSignPushClient.java
  3. 3
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionSignforClient.java
  4. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/ClerkCheckPushDataQueueHandler.java
  5. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionSignforService.java
  6. 23
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java
  7. 11
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/SignPushClient.java
  8. 97
      blade-service/logpm-patch/src/main/java/com/logpm/patch/jobhandle/DistributionDatarepair.java

4
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<String,Object> clerkCheckPushData(@RequestParam("id") Long id);
}

2
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<String,Object> pushOldSystemSignInfo(@RequestBody SignPushDataDTO signPushDataDTO);

3
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<String,Object> clerkCheckPushData(Long id) {
return distributionSignforService.clerkCheckPushData(id);

4
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<String,Object> map1= distributionSignforService.clerkCheckPushData(t);
log.info(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 推送老系统签收队列 成功状态: {}",map1);
} catch (Exception e) {
log.error(">>>>> 推送老系统签收信息报错", e);
}

2
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionSignforService.java

@ -339,7 +339,7 @@ public interface IDistributionSignforService extends BaseService<DistributionSig
SignforPageCountVO selectDistributionSignforPageCount( DistributionSignforVO distributionSignfor);
Boolean clerkCheckPushData(Long id);
Map<String,Object> clerkCheckPushData(Long id);
/**
* 导出签收详情列表

23
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java

@ -1727,7 +1727,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
}
Boolean b = oldSystemDataPushClient.pushOldSystemSignInfo(delivery);
Map<String ,Object> map = oldSystemDataPushClient.pushOldSystemSignInfo(delivery);
} catch (Exception e) {
log.error(">>>>> 推送老系统签收信息报错", e);
}
@ -6445,13 +6445,15 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
}
@Override
public Boolean clerkCheckPushData(Long id) {
public Map<String,Object> clerkCheckPushData(Long id) {
Map<String,Object> 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<Distribution
if (ObjectUtil.isEmpty(distributionSignforEntity)) {
log.info(">>>>>>>>>>>> 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<Distribution
log.info(">>>> 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

11
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<String,Object> pushOldSystemSignInfo(SignPushDataDTO signPushDataDTO) {
//todo 这里存在调用老系统的接口 将数据会写给老系统
int timeoutMilliseconds = 60000;
Map<String,Object> 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

97
blade-service/logpm-patch/src/main/java/com/logpm/patch/jobhandle/DistributionDatarepair.java

@ -82,20 +82,22 @@ public class DistributionDatarepair {
Map<Long, List<DistributionParcelListEntity>> 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<String,Object> map = new HashMap<>();
map.put("orderPackageCode",orderPackageCodes);
map.put("warehouseId",k);
stringBuffer.append("仓库:" + k).append("包件下架" + orderPackageCodes);
;
Map<String, Object> 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<Long, List<DistributionParcelListEntity>> 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<String> 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<String> 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<String> 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<String> 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<String> pushNotification(String params) {
// 得到当前仓库所有的签收任务
Integer parmeId = null;
if(StringUtil.isNotBlank(params)){
if (StringUtil.isNotBlank(params)) {
parmeId = Integer.parseInt(params);
}
List<JSONObject> allSignfor = warehouseMappingDataMapper.findAllSignfor(parmeId);
for (JSONObject entries : allSignfor) {
Long id = entries.getLong("singnforId");
Boolean b = distributionSignforClient.clerkCheckPushData(id);
if(b!=null&&b){
Map<String, Object> 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<String> 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<String, Object> 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<String> pushBillNotification(String params) {
// 得到当前仓库所有的签收任务
Long parmeId = null;
if(StringUtil.isNotBlank(params)){
if (StringUtil.isNotBlank(params)) {
parmeId = Long.parseLong(params);
}
List<JSONObject> 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<String> sendFactorySignforInfo(String params) {
// 得到当前仓库所有的签收任务
Boolean b =distrilbutionBillLadingClient.sendFactorySignforInfo(params);
Boolean b = distrilbutionBillLadingClient.sendFactorySignforInfo(params);
return ReturnT.SUCCESS;
}
}

Loading…
Cancel
Save