OMS-GW推送-商业合作伙伴

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