From e8dfcd723f3d0fa6d0f7fa00ddc594793e4ce3e6 Mon Sep 17 00:00:00 2001 From: zhaoqing <1670883518@qq.com> Date: Thu, 14 May 2026 11:31:26 +0800 Subject: [PATCH] =?UTF-8?q?=E5=95=86=E4=B8=9A=E5=90=88=E4=BD=9C=E4=BC=99?= =?UTF-8?q?=E4=BC=B4=E6=8E=A8=E9=80=81=E4=BA=BA=E5=A7=93=E5=90=8D=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/mhd/system/api/UserServiceFeign.java | 3 ++- .../factory/RemoteUserFeignFallbackFactory.java | 2 +- .../service/UserShipperApplicationService.java | 3 ++- .../userAggregate/entity/UserShipperEntity.java | 3 ++- .../userAggregate/repository/po/UserShipperPo.java | 3 +++ .../mhd/user/interfaces/facade/UserShipperAPI.java | 5 +++-- .../main/resources/mapper/UserShipperMapper.xml | 1 + .../BusinessPartnerApplicationService.java | 14 +++++++------- 8 files changed, 21 insertions(+), 13 deletions(-) diff --git a/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/UserServiceFeign.java b/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/UserServiceFeign.java index 295544734..d2232e594 100644 --- a/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/UserServiceFeign.java +++ b/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/UserServiceFeign.java @@ -208,5 +208,6 @@ public interface UserServiceFeign { public AjaxResult updatePushStatus(@RequestParam(value = "shipperId") Long shipperId, @RequestParam(value = "pushStatus", required = false) Integer pushStatus, @RequestParam(value = "pushTime", required = false) String pushTime, - @RequestParam(value = "pushBy", required = false) Long pushBy); + @RequestParam(value = "pushBy", required = false) Long pushBy, + @RequestParam(value = "pushByName", required = false) String pushByName); } \ No newline at end of file diff --git a/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/factory/RemoteUserFeignFallbackFactory.java b/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/factory/RemoteUserFeignFallbackFactory.java index 3ec982c94..6bd712c13 100644 --- a/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/factory/RemoteUserFeignFallbackFactory.java +++ b/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/factory/RemoteUserFeignFallbackFactory.java @@ -198,7 +198,7 @@ public class RemoteUserFeignFallbackFactory implements FallbackFactory updatePushStatus(Long shipperId, Integer pushStatus, String pushTime, Long pushBy) { + public AjaxResult updatePushStatus(Long shipperId, Integer pushStatus, String pushTime, Long pushBy, String pushByName) { return AjaxResult.error("更新失败" + throwable.getMessage()); } }; diff --git a/mhd-user-center/src/main/java/com/mhd/user/application/service/UserShipperApplicationService.java b/mhd-user-center/src/main/java/com/mhd/user/application/service/UserShipperApplicationService.java index 9faccfa09..87e3aaac0 100644 --- a/mhd-user-center/src/main/java/com/mhd/user/application/service/UserShipperApplicationService.java +++ b/mhd-user-center/src/main/java/com/mhd/user/application/service/UserShipperApplicationService.java @@ -1221,7 +1221,7 @@ public class UserShipperApplicationService { * @param pushBy * @return */ - public int updatePushStatus(Long shipperId, Integer pushStatus, String pushTime, Long pushBy) { + public int updatePushStatus(Long shipperId, Integer pushStatus, String pushTime, Long pushBy,String pushByName) { UserShipperEntity userShipper = new UserShipperEntity(); userShipper.setShipperId(shipperId); userShipper.setPushStatus(pushStatus); @@ -1229,6 +1229,7 @@ public class UserShipperApplicationService { userShipper.setPushTime(DateUtil.parse(pushTime)); } userShipper.setPushBy(pushBy); + userShipper.setPushByName(pushByName); return userShipperMapper.updatePushStatus(userShipper); } } \ No newline at end of file diff --git a/mhd-user-center/src/main/java/com/mhd/user/domain/userAggregate/entity/UserShipperEntity.java b/mhd-user-center/src/main/java/com/mhd/user/domain/userAggregate/entity/UserShipperEntity.java index c18bfb7db..9dc934f64 100644 --- a/mhd-user-center/src/main/java/com/mhd/user/domain/userAggregate/entity/UserShipperEntity.java +++ b/mhd-user-center/src/main/java/com/mhd/user/domain/userAggregate/entity/UserShipperEntity.java @@ -272,6 +272,7 @@ public class UserShipperEntity extends BaseVOEntity { private Date pushTime; @ApiModelProperty(name = "推送人") private Long pushBy; - + @ApiModelProperty(name = "推送人姓名") + private String pushByName; } diff --git a/mhd-user-center/src/main/java/com/mhd/user/domain/userAggregate/repository/po/UserShipperPo.java b/mhd-user-center/src/main/java/com/mhd/user/domain/userAggregate/repository/po/UserShipperPo.java index 2dd5170d8..f02467097 100644 --- a/mhd-user-center/src/main/java/com/mhd/user/domain/userAggregate/repository/po/UserShipperPo.java +++ b/mhd-user-center/src/main/java/com/mhd/user/domain/userAggregate/repository/po/UserShipperPo.java @@ -332,4 +332,7 @@ public class UserShipperPo implements Serializable { @ApiModelProperty(value = "推送人ID") private Long pushBy; + + @ApiModelProperty(value = "推送人姓名") + private String pushByName; } diff --git a/mhd-user-center/src/main/java/com/mhd/user/interfaces/facade/UserShipperAPI.java b/mhd-user-center/src/main/java/com/mhd/user/interfaces/facade/UserShipperAPI.java index a21505014..d354f95aa 100644 --- a/mhd-user-center/src/main/java/com/mhd/user/interfaces/facade/UserShipperAPI.java +++ b/mhd-user-center/src/main/java/com/mhd/user/interfaces/facade/UserShipperAPI.java @@ -242,10 +242,11 @@ public class UserShipperAPI extends BaseController { public AjaxResult updatePushStatus(@RequestParam("shipperId") Long shipperId, @RequestParam("pushStatus") Integer pushStatus, @RequestParam(value = "pushTime", required = false) String pushTime, - @RequestParam(value = "pushBy", required = false) Long pushBy){ + @RequestParam(value = "pushBy", required = false) Long pushBy, + @RequestParam(value = "pushByName", required = false) String pushByName){ try{ - int result = userShipperApplicationService.updatePushStatus(shipperId,pushStatus,pushTime,pushBy); + int result = userShipperApplicationService.updatePushStatus(shipperId,pushStatus,pushTime,pushBy,pushByName); return result > 0 ? AjaxResult.success() : AjaxResult.error("更新失败"); }catch (Exception e){ log.error("更新推送状态异常: shipperId = {} , error = ", e.getMessage()); diff --git a/mhd-user-center/src/main/resources/mapper/UserShipperMapper.xml b/mhd-user-center/src/main/resources/mapper/UserShipperMapper.xml index 86bf79790..eb19d41c7 100644 --- a/mhd-user-center/src/main/resources/mapper/UserShipperMapper.xml +++ b/mhd-user-center/src/main/resources/mapper/UserShipperMapper.xml @@ -429,6 +429,7 @@ push_status = #{pushStatus}, push_time = #{pushTime}, push_by = #{pushBy}, + push_by_name = #{pushByName}, WHERE shipper_id = #{shipperId} diff --git a/mhd_oms/src/main/java/com/mhd/oms/application/service/businessPartner/BusinessPartnerApplicationService.java b/mhd_oms/src/main/java/com/mhd/oms/application/service/businessPartner/BusinessPartnerApplicationService.java index 0ef8cf865..37f1aefa7 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/application/service/businessPartner/BusinessPartnerApplicationService.java +++ b/mhd_oms/src/main/java/com/mhd/oms/application/service/businessPartner/BusinessPartnerApplicationService.java @@ -96,7 +96,7 @@ public class BusinessPartnerApplicationService { GwLog gwLog = new GwLog(); gwLog.setType("商业合作伙伴"); - gwLog.setBusinessId(businessPartnerDTO.getShipperId()); + gwLog.setBusinessId(Long.valueOf(businessPartnerDTO.getShipperId())); gwLog.setRequestBody(JSONObject.toJSONString(body)); gwLog.setResponseBody(""); gwLog.setStatus(1); @@ -109,7 +109,7 @@ public class BusinessPartnerApplicationService { gwLog.setDelFlag(1); gwLogMapper.insert(gwLog); - updatePushStatus(Long.valueOf(businessPartnerDTO.getShipperId()),2,new Date(),pushBy); + updatePushStatus(Long.valueOf(businessPartnerDTO.getShipperId()),2,new Date(),pushBy,pushByName); CloseableHttpClient httpClient = HttpClients.createDefault(); HttpPost httpPost = new HttpPost(PUSH_API_URL); @@ -125,12 +125,12 @@ public class BusinessPartnerApplicationService { if(response.getStatusLine().getStatusCode() == 200){ gwLog.setStatus(2); - updatePushStatus(Long.valueOf(businessPartnerDTO.getShipperId()),3, new Date(), pushBy); + updatePushStatus(Long.valueOf(businessPartnerDTO.getShipperId()),3, new Date(), pushBy,pushByName); successCount++; }else{ gwLog.setStatus(3); gwLog.setErrorMsg(responseString); - updatePushStatus(Long.valueOf(businessPartnerDTO.getShipperId()),4, new Date(), pushBy); + updatePushStatus(Long.valueOf(businessPartnerDTO.getShipperId()),4, new Date(), pushBy,pushByName); failCount++; failMsg.append("CorpCode:").append(businessPartnerDTO.getCorpCode()).append("失败:"); } @@ -143,7 +143,7 @@ public class BusinessPartnerApplicationService { gwLog.setStatus(3); gwLog.setErrorMsg(e.getMessage()); gwLogMapper.updateById(gwLog); - updatePushStatus(Long.valueOf(businessPartnerDTO.getShipperId()),4, new Date(), pushBy); + updatePushStatus(Long.valueOf(businessPartnerDTO.getShipperId()),4, new Date(), pushBy,pushByName); failCount++; failMsg.append("CorpCode:").append(businessPartnerDTO.getCorpCode()).append("异常:").append(e.getMessage()).append(":"); log.error("GW推送异常:shipperId={}, error={}",businessPartnerDTO.getShipperId(),e.getMessage()); @@ -169,11 +169,11 @@ public class BusinessPartnerApplicationService { - private void updatePushStatus(Long shipperId, Integer pushStatus, Date pushTime, Long pushBy) { + private void updatePushStatus(Long shipperId, Integer pushStatus, Date pushTime, Long pushBy,String pushByName) { try { // 调用user-center的Feign接口,更新货主的推送状态 String pushTimeStr = pushTime != null ? DateUtil.format(pushTime, "yyyy-MM-dd HH:mm:ss") : null; - AjaxResult result = userServiceFeign.updatePushStatus(shipperId, pushStatus, pushTimeStr, pushBy); + AjaxResult result = userServiceFeign.updatePushStatus(shipperId, pushStatus, pushTimeStr, pushBy, pushByName); log.info("更新返回结果:{}",result); } catch (Exception e) { // 如果更新失败,记录错误日志,但不阻断主流程