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 93264d5e9..d99a28b8a 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 @@ -210,10 +210,10 @@ public interface UserServiceFeign { @RequestParam(value = "updateTimeTo", required = false) String updateTimeTo, @RequestParam(value = "shipperType", required = false) Integer shipperType); - @ApiOperation("商业合作伙伴-更新推送") + @PostMapping("/userShipperApi/updatePushStatus") - void updatePushStatus(@RequestParam(value = "shipperId") Long shipperId, - @RequestParam(value = "pushStatus") Integer pushStatus, - @RequestParam(value = "pushTime") Date pushTime, - @RequestParam(value = "pushBy") Long pushBy); + public AjaxResult updatePushStatus(@RequestParam(value = "shipperId") Long shipperId, + @RequestParam(value = "pushStatus", required = false) Integer pushStatus, + @RequestParam(value = "pushTime", required = false) Date pushTime, + @RequestParam(value = "pushBy", required = false) Long pushBy); } \ 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 dbbf0623b..85a7f0d36 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 @@ -189,8 +189,8 @@ public class RemoteUserFeignFallbackFactory implements FallbackFactory updatePushStatus(Long shipperId, Integer pushStatus, Date pushTime, Long pushBy) { + return AjaxResult.error("更新失败" + throwable.getMessage()); } }; } 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 97972a569..484768893 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 @@ -20,6 +20,7 @@ import com.mhd.user.interfaces.vo.SettlementInfoQueryVo; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; +import org.springframework.format.annotation.DateTimeFormat; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; @@ -240,7 +241,8 @@ public class UserShipperAPI extends BaseController { @PostMapping("/updatePushStatus") public AjaxResult updatePushStatus(@RequestParam("shipperId") Long shipperId, @RequestParam("pushStatus") Integer pushStatus, - @RequestParam("pushTime") Date pushTime, + @RequestParam("pushTime") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date pushTime, @RequestParam("pushBy") Long pushBy){ try{ 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 b922182b4..fb1e26a78 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 @@ -110,7 +110,7 @@ public class BusinessPartnerApplicationService { gwLog.setDelFlag(1); gwLogMapper.insert(gwLog); - updatePushStatus(Long.valueOf(businessPartnerDTO.getShipperId()),2,null,pushBy); + updatePushStatus(Long.valueOf(businessPartnerDTO.getShipperId()),2,new Date(),pushBy); CloseableHttpClient httpClient = HttpClients.createDefault(); HttpPost httpPost = new HttpPost(PUSH_API_URL); @@ -173,7 +173,8 @@ public class BusinessPartnerApplicationService { private void updatePushStatus(Long shipperId, Integer pushStatus, Date pushTime, Long pushBy) { try { // 调用user-center的Feign接口,更新货主的推送状态 - userServiceFeign.updatePushStatus(shipperId, pushStatus, pushTime, pushBy); + AjaxResult result = userServiceFeign.updatePushStatus(shipperId, pushStatus, pushTime, pushBy); + log.info("更新返回结果:{}",result); } catch (Exception e) { // 如果更新失败,记录错误日志,但不阻断主流程 log.info("更新推送状态失败: shipperId={}, error={}", shipperId, e.getMessage());