商业合作伙伴推送人姓名字段添加

This commit is contained in:
zhaoqing
2026-05-14 11:31:26 +08:00
parent 43c64779ce
commit e8dfcd723f
8 changed files with 21 additions and 13 deletions
@@ -208,5 +208,6 @@ public interface UserServiceFeign {
public AjaxResult<?> updatePushStatus(@RequestParam(value = "shipperId") Long shipperId, public AjaxResult<?> updatePushStatus(@RequestParam(value = "shipperId") Long shipperId,
@RequestParam(value = "pushStatus", required = false) Integer pushStatus, @RequestParam(value = "pushStatus", required = false) Integer pushStatus,
@RequestParam(value = "pushTime", required = false) String pushTime, @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);
} }
@@ -198,7 +198,7 @@ public class RemoteUserFeignFallbackFactory implements FallbackFactory<UserServi
@Override @Override
public AjaxResult<?> 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()); return AjaxResult.error("更新失败" + throwable.getMessage());
} }
}; };
@@ -1221,7 +1221,7 @@ public class UserShipperApplicationService {
* @param pushBy * @param pushBy
* @return * @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(); UserShipperEntity userShipper = new UserShipperEntity();
userShipper.setShipperId(shipperId); userShipper.setShipperId(shipperId);
userShipper.setPushStatus(pushStatus); userShipper.setPushStatus(pushStatus);
@@ -1229,6 +1229,7 @@ public class UserShipperApplicationService {
userShipper.setPushTime(DateUtil.parse(pushTime)); userShipper.setPushTime(DateUtil.parse(pushTime));
} }
userShipper.setPushBy(pushBy); userShipper.setPushBy(pushBy);
userShipper.setPushByName(pushByName);
return userShipperMapper.updatePushStatus(userShipper); return userShipperMapper.updatePushStatus(userShipper);
} }
} }
@@ -272,6 +272,7 @@ public class UserShipperEntity extends BaseVOEntity {
private Date pushTime; private Date pushTime;
@ApiModelProperty(name = "推送人") @ApiModelProperty(name = "推送人")
private Long pushBy; private Long pushBy;
@ApiModelProperty(name = "推送人姓名")
private String pushByName;
} }
@@ -332,4 +332,7 @@ public class UserShipperPo implements Serializable {
@ApiModelProperty(value = "推送人ID") @ApiModelProperty(value = "推送人ID")
private Long pushBy; private Long pushBy;
@ApiModelProperty(value = "推送人姓名")
private String pushByName;
} }
@@ -242,10 +242,11 @@ public class UserShipperAPI extends BaseController {
public AjaxResult updatePushStatus(@RequestParam("shipperId") Long shipperId, public AjaxResult updatePushStatus(@RequestParam("shipperId") Long shipperId,
@RequestParam("pushStatus") Integer pushStatus, @RequestParam("pushStatus") Integer pushStatus,
@RequestParam(value = "pushTime", required = false) String pushTime, @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{ 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("更新失败"); return result > 0 ? AjaxResult.success() : AjaxResult.error("更新失败");
}catch (Exception e){ }catch (Exception e){
log.error("更新推送状态异常: shipperId = {} , error = ", e.getMessage()); log.error("更新推送状态异常: shipperId = {} , error = ", e.getMessage());
@@ -429,6 +429,7 @@
<if test="pushStatus != null">push_status = #{pushStatus},</if> <if test="pushStatus != null">push_status = #{pushStatus},</if>
<if test="pushTime != null">push_time = #{pushTime},</if> <if test="pushTime != null">push_time = #{pushTime},</if>
<if test="pushBy != null">push_by = #{pushBy},</if> <if test="pushBy != null">push_by = #{pushBy},</if>
<if test="pushByName != null">push_by_name = #{pushByName},</if>
</set> </set>
WHERE shipper_id = #{shipperId} WHERE shipper_id = #{shipperId}
</update> </update>
@@ -96,7 +96,7 @@ public class BusinessPartnerApplicationService {
GwLog gwLog = new GwLog(); GwLog gwLog = new GwLog();
gwLog.setType("商业合作伙伴"); gwLog.setType("商业合作伙伴");
gwLog.setBusinessId(businessPartnerDTO.getShipperId()); gwLog.setBusinessId(Long.valueOf(businessPartnerDTO.getShipperId()));
gwLog.setRequestBody(JSONObject.toJSONString(body)); gwLog.setRequestBody(JSONObject.toJSONString(body));
gwLog.setResponseBody(""); gwLog.setResponseBody("");
gwLog.setStatus(1); gwLog.setStatus(1);
@@ -109,7 +109,7 @@ public class BusinessPartnerApplicationService {
gwLog.setDelFlag(1); gwLog.setDelFlag(1);
gwLogMapper.insert(gwLog); 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(); CloseableHttpClient httpClient = HttpClients.createDefault();
HttpPost httpPost = new HttpPost(PUSH_API_URL); HttpPost httpPost = new HttpPost(PUSH_API_URL);
@@ -125,12 +125,12 @@ public class BusinessPartnerApplicationService {
if(response.getStatusLine().getStatusCode() == 200){ if(response.getStatusLine().getStatusCode() == 200){
gwLog.setStatus(2); gwLog.setStatus(2);
updatePushStatus(Long.valueOf(businessPartnerDTO.getShipperId()),3, new Date(), pushBy); updatePushStatus(Long.valueOf(businessPartnerDTO.getShipperId()),3, new Date(), pushBy,pushByName);
successCount++; successCount++;
}else{ }else{
gwLog.setStatus(3); gwLog.setStatus(3);
gwLog.setErrorMsg(responseString); gwLog.setErrorMsg(responseString);
updatePushStatus(Long.valueOf(businessPartnerDTO.getShipperId()),4, new Date(), pushBy); updatePushStatus(Long.valueOf(businessPartnerDTO.getShipperId()),4, new Date(), pushBy,pushByName);
failCount++; failCount++;
failMsg.append("CorpCode:").append(businessPartnerDTO.getCorpCode()).append("失败:"); failMsg.append("CorpCode:").append(businessPartnerDTO.getCorpCode()).append("失败:");
} }
@@ -143,7 +143,7 @@ public class BusinessPartnerApplicationService {
gwLog.setStatus(3); gwLog.setStatus(3);
gwLog.setErrorMsg(e.getMessage()); gwLog.setErrorMsg(e.getMessage());
gwLogMapper.updateById(gwLog); gwLogMapper.updateById(gwLog);
updatePushStatus(Long.valueOf(businessPartnerDTO.getShipperId()),4, new Date(), pushBy); updatePushStatus(Long.valueOf(businessPartnerDTO.getShipperId()),4, new Date(), pushBy,pushByName);
failCount++; failCount++;
failMsg.append("CorpCode:").append(businessPartnerDTO.getCorpCode()).append("异常:").append(e.getMessage()).append(":"); failMsg.append("CorpCode:").append(businessPartnerDTO.getCorpCode()).append("异常:").append(e.getMessage()).append(":");
log.error("GW推送异常:shipperId={} error={}",businessPartnerDTO.getShipperId(),e.getMessage()); 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 { try {
// 调用user-center的Feign接口,更新货主的推送状态 // 调用user-center的Feign接口,更新货主的推送状态
String pushTimeStr = pushTime != null ? DateUtil.format(pushTime, "yyyy-MM-dd HH:mm:ss") : null; 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); log.info("更新返回结果:{}",result);
} catch (Exception e) { } catch (Exception e) {
// 如果更新失败,记录错误日志,但不阻断主流程 // 如果更新失败,记录错误日志,但不阻断主流程