diff --git a/yudao-module-haoka/yudao-module-haoka-api/src/main/java/cn/iocoder/yudao/module/haoka/enums/LogisticsCompany.java b/yudao-module-haoka/yudao-module-haoka-api/src/main/java/cn/iocoder/yudao/module/haoka/enums/LogisticsCompany.java new file mode 100644 index 0000000000..5b00cde6b4 --- /dev/null +++ b/yudao-module-haoka/yudao-module-haoka-api/src/main/java/cn/iocoder/yudao/module/haoka/enums/LogisticsCompany.java @@ -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; } +} \ No newline at end of file diff --git a/yudao-module-haoka/yudao-module-haoka-biz/src/main/java/cn/iocoder/yudao/module/haoka/service/orders/OrdersServiceImpl.java b/yudao-module-haoka/yudao-module-haoka-biz/src/main/java/cn/iocoder/yudao/module/haoka/service/orders/OrdersServiceImpl.java index ee787a3d1b..108030f326 100644 --- a/yudao-module-haoka/yudao-module-haoka-biz/src/main/java/cn/iocoder/yudao/module/haoka/service/orders/OrdersServiceImpl.java +++ b/yudao-module-haoka/yudao-module-haoka-biz/src/main/java/cn/iocoder/yudao/module/haoka/service/orders/OrdersServiceImpl.java @@ -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 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 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 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 imple if (StringUtils.isNotEmpty(planMobileProduced)){ ordersDO.setPlanMobileProduced(planMobileProduced); } - + // 如果是抖音订单 则需要调用抖音接口 返回审核结果 + orderRevicer(ordersDO.getSource(), ordersDO.getRealSourceId()); } } else { // 系统失败操作记录