update:修改订单失败成功通知顺序

This commit is contained in:
Damonny 2025-03-07 14:36:14 +08:00
parent 37dcf068f3
commit d4947dce0b
2 changed files with 83 additions and 15 deletions

View File

@ -0,0 +1,61 @@
package cn.iocoder.yudao.module.haoka.enums;
public enum LogisticsCompany {
SHUNFENG(44L, "顺丰快递", "shunfeng"),
YUANTONG(85L, "圆通快递", "yuantong"),
ZHONGTONG(115L, "中通快递", "zhongtong"),
YOUSU(117L, "优速快递", "youshuwuliu"),
EMS(118L, "邮政EMS", "ems"),
JD(120L, "京东配送", "jd"),
YUNDA(121L, "韵达快递", "yunda"),
ZHAIJISONG(129L, "宅急送快递", "zhaijisong"),
DEBANG(131L, "德邦快递", "debangwuliu"),
POST(132L, "邮政快递包裹", "youzhengguonei"),
SUER(155L, "速尔快递", "suer"),
CAINIAO(191L, "菜鸟物流", "danniao"),
BAISHI(204L, "百世快递", "baishiwuliu"),
JINGGUANG(281L, "京广速递", "jinguangsudikuaijian"),
SHENTONG(1001L, "申通快递", "shentong"),
DANNIAO(500L, "丹鸟快递", "danniao"),
// 其他未匹配的物流公司
QUANFENG(116L, "全峰快递", "xiaoshidayun"),
TIANTIAN(119L, "天天快递", "xiaoshidayun"),
KUAIJIE(122L, "快捷快递", "xiaoshidayun"),
GUOTONG(124L, "国通快递", "xiaoshidayun"),
NO_LOGISTICS(1000L, "无需物流", "xiaoshidayun"),
PROVINCE_SELF(1002L, "省公司自建物流", "xiaoshidayun"),
PROVINCE_SELF2(10002L, "省公司自建物流", "xiaoshidayun");
private final Long ourCode;
private final String ourName;
private final String otherCode;
LogisticsCompany(Long ourCode, String ourName, String otherCode) {
this.ourCode = ourCode;
this.ourName = ourName;
this.otherCode = otherCode;
}
public static String getOtherSystemCode(Long ourCode) {
for (LogisticsCompany company : values()) {
if (company.ourCode == ourCode) {
return company.otherCode;
}
}
return null;
}
public static String getOtherSystemName(Long ourCode) {
for (LogisticsCompany company : values()) {
if (company.ourCode == ourCode) {
return company.name();
}
}
return null;
}
// Getter方法
public Long getOurCode() { return ourCode; }
public String getOurName() { return ourName; }
public String getOtherCode() { return otherCode; }
}

View File

@ -11,6 +11,7 @@ import cn.iocoder.yudao.module.haoka.controller.admin.product.vo.ProductLimitAre
import cn.iocoder.yudao.module.haoka.controller.admin.product.vo.ProductLimitCardRespVO;
import cn.iocoder.yudao.module.haoka.controller.admin.product.vo.ProductLimitRespVO;
import cn.iocoder.yudao.module.haoka.dal.dataobject.blacklist.BlackListDO;
import cn.iocoder.yudao.module.haoka.enums.LogisticsCompany;
import cn.iocoder.yudao.module.haoka.service.api.models.ApiDealResp;
import cn.iocoder.yudao.module.haoka.service.api.ApiDealStrategyService;
import cn.iocoder.yudao.module.haoka.service.api.models.OrderApiCreateParam;
@ -427,8 +428,10 @@ public class OrdersServiceImpl extends ServiceImpl<OrdersMapper, OrdersDO> imple
String trackingNumber = updateObj.getTrackingNumber();
if(StringUtils.isNotBlank(trackingNumber)){
Long trackingCompanyId = updateObj.getTrackingCompanyId();
String otherSystemCode = LogisticsCompany.getOtherSystemCode(trackingCompanyId);
String otherSystemName = LogisticsCompany.getOtherSystemName(trackingCompanyId);
DouDianOrderCatchServiceImpl douDianOrderCatchService = new DouDianOrderCatchServiceImpl();
douDianOrderCatchService.logisticsAdd(updateObj.getRealSourceId(),"","",trackingNumber);
douDianOrderCatchService.logisticsAdd(updateObj.getRealSourceId(),otherSystemName,otherSystemCode,trackingNumber);
}
}
}
@ -502,19 +505,7 @@ public class OrdersServiceImpl extends ServiceImpl<OrdersMapper, OrdersDO> imple
updateOrderById(updateObj);
}
// 如果是抖音订单 则需要调用抖音接口 返回审核结果
String source = ordersOld.getSource();
if("2".equals(source)){
if(status != null && status == 450L){
//审核通过
DouDianOrderCatchServiceImpl douDianOrderCatchService = new DouDianOrderCatchServiceImpl();
douDianOrderCatchService.reviewOrder(0L,ordersOld.getRealSourceId());
}
if(status != null && status == -450L){
//审核不通过
DouDianOrderCatchServiceImpl douDianOrderCatchService = new DouDianOrderCatchServiceImpl();
douDianOrderCatchService.reviewOrder(200005L,ordersOld.getRealSourceId());
}
}
// orderRevicer(ordersOld.getSource(), ordersOld.getRealSourceId());
// 状态变化发送短信提醒
if (updateObj.getStatus() != null && !updateObj.getStatus().equals(ordersOld.getStatus())) {
smsTaskService.sendSMS(
@ -530,6 +521,21 @@ public class OrdersServiceImpl extends ServiceImpl<OrdersMapper, OrdersDO> imple
}
}
private static void orderRevicer(String source, String realSourceId) {
if("2".equals(source)){
// if(status != null && status == 450L){
//审核通过
DouDianOrderCatchServiceImpl douDianOrderCatchService = new DouDianOrderCatchServiceImpl();
douDianOrderCatchService.reviewOrder(0L, realSourceId);
// }
// if(status != null && status == -450L){
// //审核不通过
// DouDianOrderCatchServiceImpl douDianOrderCatchService = new DouDianOrderCatchServiceImpl();
// douDianOrderCatchService.reviewOrder(200005L, realSourceId);
// }
}
}
/**
* 提交订单
*
@ -624,7 +630,8 @@ public class OrdersServiceImpl extends ServiceImpl<OrdersMapper, OrdersDO> imple
if (StringUtils.isNotEmpty(planMobileProduced)){
ordersDO.setPlanMobileProduced(planMobileProduced);
}
// 如果是抖音订单 则需要调用抖音接口 返回审核结果
orderRevicer(ordersDO.getSource(), ordersDO.getRealSourceId());
}
} else {
// 系统失败操作记录