修改商业合作伙伴推送-各组织独立问题

This commit is contained in:
zhaoqing
2026-06-11 11:22:43 +08:00
parent cc37974239
commit 0c69a6ef36
7 changed files with 118 additions and 29 deletions
@@ -124,7 +124,7 @@ public class BusinessPartnerApplicationService {
gwLog.setDelFlag(1);
gwLogMapper.insert(gwLog);
updatePushStatus(Long.valueOf(businessPartnerDTO.getShipperId()),2,new Date(),pushBy,pushByName);
updatePushStatus(Long.valueOf(businessPartnerDTO.getShipperId()),2, new Date(), pushBy, pushByName, organizationId);
CloseableHttpClient httpClient = HttpClients.createDefault();
HttpPost httpPost = new HttpPost(pushUrl);
@@ -140,7 +140,7 @@ public class BusinessPartnerApplicationService {
if(response.getStatusLine().getStatusCode() == 200){
// gwLog.setStatus(2);
// updatePushStatus(Long.valueOf(businessPartnerDTO.getShipperId()),3, new Date(), pushBy,pushByName);
// updatePushStatus(Long.valueOf(businessPartnerDTO.getShipperId()),3, new Date(), pushBy,pushByName, organizationId);
// successCount++;
// 解析返回内容
JSONObject responseJson = JSONObject.parseObject(responseString);
@@ -150,19 +150,19 @@ public class BusinessPartnerApplicationService {
if (dataCode != null && dataCode == 200) { // 业务也成功
gwLog.setStatus(2);
updatePushStatus(Long.valueOf(businessPartnerDTO.getShipperId()), 3, new Date(), pushBy, pushByName);
updatePushStatus(Long.valueOf(businessPartnerDTO.getShipperId()),3, new Date(), pushBy, pushByName, organizationId);
successCount++;
} else {
gwLog.setStatus(3);
gwLog.setErrorMsg(responseString);
updatePushStatus(Long.valueOf(businessPartnerDTO.getShipperId()), 4, new Date(), pushBy, pushByName);
updatePushStatus(Long.valueOf(businessPartnerDTO.getShipperId()),4, new Date(), pushBy, pushByName, organizationId);
failCount++;
failMsg.append("CorpCode:").append(businessPartnerDTO.getCorpCode()).append("失败;");
}
}else{
gwLog.setStatus(3);
gwLog.setErrorMsg(responseString);
updatePushStatus(Long.valueOf(businessPartnerDTO.getShipperId()),4, new Date(), pushBy,pushByName);
updatePushStatus(Long.valueOf(businessPartnerDTO.getShipperId()),4, new Date(), pushBy,pushByName, organizationId);
failCount++;
failMsg.append("CorpCode:").append(businessPartnerDTO.getCorpCode()).append("失败:");
}
@@ -176,7 +176,7 @@ public class BusinessPartnerApplicationService {
gwLog.setErrorMsg(e.getMessage());
gwLog.setResponseBody("请求异常:" + e.getMessage());
gwLogMapper.updateById(gwLog);
updatePushStatus(Long.valueOf(businessPartnerDTO.getShipperId()),4, new Date(), pushBy,pushByName);
updatePushStatus(Long.valueOf(businessPartnerDTO.getShipperId()),4, new Date(), pushBy,pushByName, organizationId);
failCount++;
failMsg.append("CorpCode:").append(businessPartnerDTO.getCorpCode()).append("异常:").append(e.getMessage()).append(":");
log.error("GW推送异常:shipperId={} error={}",businessPartnerDTO.getShipperId(),e.getMessage());
@@ -202,11 +202,11 @@ public class BusinessPartnerApplicationService {
private void updatePushStatus(Long shipperId, Integer pushStatus, Date pushTime, Long pushBy,String pushByName) {
private void updatePushStatus(Long shipperId, Integer pushStatus, Date pushTime, Long pushBy, String pushByName, Long organizationId) {
try {
// 调用user-center的Feign接口,更新货主的推送状态
// 调用user-center的Feign接口,写入 business_partner_push_log 表(按 shipper_id + organization_id 维度)
String pushTimeStr = pushTime != null ? DateUtil.format(pushTime, "yyyy-MM-dd HH:mm:ss") : null;
AjaxResult result = userServiceFeign.updatePushStatus(shipperId, pushStatus, pushTimeStr, pushBy, pushByName);
AjaxResult result = userServiceFeign.updatePushStatus(shipperId, pushStatus, pushTimeStr, pushBy, pushByName, organizationId);
log.info("更新返回结果:{}",result);
} catch (Exception e) {
// 如果更新失败,记录错误日志,但不阻断主流程