修改bug

20240115-ljl-multiPay
ljl 12 months ago
parent cb51fb2c49
commit 1718dca3af

@ -27,6 +27,7 @@ import com.ms.biz.service.DsMessageConsumerBufferService;
import com.ms.biz.service.DsMessageConsumerQueueService; import com.ms.biz.service.DsMessageConsumerQueueService;
import com.ms.biz.service.DsMessageService; import com.ms.biz.service.DsMessageService;
import com.ms.api.dto.dsorder.*; import com.ms.api.dto.dsorder.*;
import com.ms.biz.service.LogisticsService;
import com.ms.biz.tool.CommonTool; import com.ms.biz.tool.CommonTool;
import com.ms.biz.util.DDApi; import com.ms.biz.util.DDApi;
import com.ms.dal.entity.*; import com.ms.dal.entity.*;
@ -63,6 +64,8 @@ public class DsMessageServiceImpl implements DsMessageService {
private RefundPurchaseOrderMapper refundPurchaseOrderMapper; private RefundPurchaseOrderMapper refundPurchaseOrderMapper;
private RefundPurchaseOrderSkuMapper refundPurchaseOrderSkuMapper; private RefundPurchaseOrderSkuMapper refundPurchaseOrderSkuMapper;
private LogisticsService logisticsService;
@Override @Override
public int deleteByPrimaryKey(Long id) { public int deleteByPrimaryKey(Long id) {
return dsMessageMapper.deleteByPrimaryKey(id); return dsMessageMapper.deleteByPrimaryKey(id);
@ -339,11 +342,14 @@ public class DsMessageServiceImpl implements DsMessageService {
OrderLogisticsAddMultiPackParam param = new OrderLogisticsAddMultiPackParam(); OrderLogisticsAddMultiPackParam param = new OrderLogisticsAddMultiPackParam();
param.setOrderId(purchaseOrderDTO.getPlatformOrderId()); param.setOrderId(purchaseOrderDTO.getPlatformOrderId());
Map<String, String> matchResult = logisticsService.matchLogisticsInfo("1688DS", purchaseOrderDTO.getPurchaseOrderLogisticsName(), purchaseOrderDTO.getPurchaseOrderWaybillCode(), null);
String logisticsName = matchResult.get("logisticsName");
String waybillCode = matchResult.get("waybillCode");
List<PackListItem> packageList = new ArrayList<>(); List<PackListItem> packageList = new ArrayList<>();
PackListItem packListItem = new PackListItem(); PackListItem packListItem = new PackListItem();
packListItem.setLogisticsCode(purchaseOrderDTO.getPurchaseOrderWaybillCode()); packListItem.setLogisticsCode(waybillCode);
String logisticsName = LogisticsConst.getDDLogisticsName(purchaseOrderDTO.getPurchaseOrderLogisticsName());
Logistics logistics = logisticsMapper.getByLogisticsName(logisticsName); Logistics logistics = logisticsMapper.getByLogisticsName(logisticsName);
if (logistics == null) { if (logistics == null) {
log.info("物流不存在: 1688[{}] 抖店[{}]", purchaseOrderDTO.getPurchaseOrderLogisticsName(), logisticsName); log.info("物流不存在: 1688[{}] 抖店[{}]", purchaseOrderDTO.getPurchaseOrderLogisticsName(), logisticsName);

@ -194,34 +194,34 @@ public class LogisticsServiceImpl implements LogisticsService{
} }
if ((logisticsName.contains("中通") && logisticsName.contains("中通快运")) || (Arrays.asList("其他", "其它", "其它快递", "卖家负责配送").contains(logisticsName) && CommonTool.isMatch("^78299\\d+$", waybillCode))) { if ((logisticsName.contains("中通") && logisticsName.contains("中通快运")) || (Arrays.asList("其他", "其它", "其它快递", "卖家负责配送").contains(logisticsName) && CommonTool.isMatch("^78299\\d+$", waybillCode))) {
logisticsName = "中通快递"; logisticsName = "中通快递(常用)";
} }
if (logisticsName.contains("EMS") || logisticsName.contains("邮政标准")) { if (logisticsName.contains("EMS") || logisticsName.contains("邮政标准")) {
logisticsName = "邮政EMS"; logisticsName = "EMS(常用)";
} else if (logisticsName.contains("邮政") && logisticsName.contains("邮政电商标快")) { } else if (logisticsName.contains("邮政") && logisticsName.contains("邮政电商标快")) {
logisticsName = "邮政快递包裹"; logisticsName = "邮政快递包裹";
} }
if ((logisticsName.contains("圆通") && logisticsName.contains("圆通快运")) || (Arrays.asList("其他", "其它", "其它快递", "卖家负责配送").contains(logisticsName) && Pattern.compile("^YT\\d+$").matcher(waybillCode).find())) { if ((logisticsName.contains("圆通") && logisticsName.contains("圆通快运")) || (Arrays.asList("其他", "其它", "其它快递", "卖家负责配送").contains(logisticsName) && Pattern.compile("^YT\\d+$").matcher(waybillCode).find())) {
logisticsName = "圆通快递"; logisticsName = "圆通快递(常用)";
} }
if (logisticsName.contains("国通")) { if (logisticsName.contains("国通")) {
logisticsName = "国通快递"; logisticsName = "国通快递";
} }
if (logisticsName.contains("申通达") || (Arrays.asList("点点送", "菜鸟裹裹商家寄件", "官方直送", "其他", "其它", "其它快递", "卖家负责配送").contains(logisticsName) && Pattern.compile("^77[03567]\\d+$").matcher(waybillCode).find())) { if (logisticsName.contains("申通达") || (Arrays.asList("点点送", "菜鸟裹裹商家寄件", "官方直送", "其他", "其它", "其它快递", "卖家负责配送").contains(logisticsName) && Pattern.compile("^77[03567]\\d+$").matcher(waybillCode).find())) {
logisticsName = "申通快递"; logisticsName = "申通快递(常用)";
} }
if ((logisticsName.contains("韵达") && logisticsName.contains("韵达快运")) || ("官方物流".equals(logisticsName) && Pattern.compile("^462\\d+$").matcher(waybillCode).find())) { if ((logisticsName.contains("韵达") && logisticsName.contains("韵达快运")) || ("官方物流".equals(logisticsName) && Pattern.compile("^462\\d+$").matcher(waybillCode).find())) {
logisticsName = "韵达快递"; logisticsName = "韵达快递(常用)";
} }
if (logisticsName.contains("德邦") && (logisticsName.contains("德邦物流") || Pattern.compile("^DPK\\d+$").matcher(waybillCode).find())) { if (logisticsName.contains("德邦") && (logisticsName.contains("德邦物流") || Pattern.compile("^DPK\\d+$").matcher(waybillCode).find())) {
logisticsName = "德邦快递"; logisticsName = "德邦快递(常用)";
} }
if (Arrays.asList("其他", "其它", "卖家负责配送").contains(logisticsName) && Pattern.compile("^2\\d{8,9}").matcher(waybillCode).find()) { if (Arrays.asList("其他", "其它", "卖家负责配送").contains(logisticsName) && Pattern.compile("^2\\d{8,9}").matcher(waybillCode).find()) {
logisticsName = "德邦快递"; logisticsName = "德邦快递(常用)";
} }
if (Pattern.compile("圆通.+快递").matcher(logisticsName).find()) { if (Pattern.compile("圆通.+快递").matcher(logisticsName).find()) {
logisticsName = "圆通快递"; logisticsName = "圆通快递(常用)";
} }
if (Pattern.compile("^JT\\d+$").matcher(waybillCode).find() && (logisticsName.contains("龙邦速递") || logisticsName.contains("百世") || logisticsName.contains("极兔") || Arrays.asList("其他", "其它", "卖家负责配送", "点点送", "juti").contains(logisticsName))) { if (Pattern.compile("^JT\\d+$").matcher(waybillCode).find() && (logisticsName.contains("龙邦速递") || logisticsName.contains("百世") || logisticsName.contains("极兔") || Arrays.asList("其他", "其它", "卖家负责配送", "点点送", "juti").contains(logisticsName))) {
logisticsName = "极兔速递"; logisticsName = "极兔速递";
@ -230,7 +230,7 @@ public class LogisticsServiceImpl implements LogisticsService{
logisticsName = "百世快运"; logisticsName = "百世快运";
} }
if (Pattern.compile("^SF\\d+$").matcher(waybillCode).find()) { if (Pattern.compile("^SF\\d+$").matcher(waybillCode).find()) {
logisticsName = "顺丰快递"; logisticsName = "顺丰速运(常用)";
} }
if (logisticsName.contains("丰网")) { if (logisticsName.contains("丰网")) {
logisticsName = "丰网速运"; logisticsName = "丰网速运";

@ -274,7 +274,7 @@ public class Test {
@GetMapping("/match-rule") @GetMapping("/match-rule")
public String matchRule() { public String matchRule() {
Map<String, String> result = logisticsService.matchLogisticsInfo("1688DS", "顺丰速运", "SF1610042925672", null); Map<String, String> result = logisticsService.matchLogisticsInfo("1688DS", "顺丰", "SF1610042925672", null);
System.out.println(result); System.out.println(result);
return result.toString(); return result.toString();
} }

Loading…
Cancel
Save