update:号码匹配修改

This commit is contained in:
Damonny 2025-02-23 00:46:18 +08:00
parent 4295baf3bc
commit 324df6b903
1 changed files with 31 additions and 47 deletions

View File

@ -232,23 +232,15 @@ public class DouDianOrderCatchServiceImpl implements OrderCatchService {
} }
ordersDO.setRefundStatus(String.valueOf(HaokaOrderRefundStatus)); ordersDO.setRefundStatus(String.valueOf(HaokaOrderRefundStatus));
// 获取计划手机号 // 获取计划手机号
for (com.doudian.open.api.order_orderDetail.data.LogisticsInfoItem logisticsInfoItem : logisticsInfo) { String productName = skuOrderListItem.getProductName();
for (com.doudian.open.api.order_orderDetail.data.ProductInfoItem productInfoItem : logisticsInfoItem.getProductInfo()) {
String skuOrderId = productInfoItem.getSkuOrderId();
if(skuOrderId.equals(orderId)){
String productName = productInfoItem.getProductName();
ordersDO.setSupplierProductName(productName); ordersDO.setSupplierProductName(productName);
List<com.doudian.open.api.order_orderDetail.data.SkuSpecsItem> skuSpecs = productInfoItem.getSkuSpecs(); for (com.doudian.open.api.order_orderDetail.data.SpecItem specItem : skuOrderListItem.getSpec()) {
for (com.doudian.open.api.order_orderDetail.data.SkuSpecsItem skuSpec : skuSpecs) { String value = specItem.getValue();
String name = skuSpec.getName(); String planMobile = getPlanMobile(value);
String planMobile = getPlanMobile(name);
if(planMobile != null){ if(planMobile != null){
ordersDO.setPlanMobile(planMobile); ordersDO.setPlanMobile(planMobile);
} }
} }
}
}
}
// 查询订单是否存在 不存在则新增存在则更新 // 查询订单是否存在 不存在则新增存在则更新
List<OrdersDO> ordersDOS = ordersMapper.selectList(new QueryWrapper<OrdersDO>().eq("real_source_id", orderId).eq("deleted", 0)); List<OrdersDO> ordersDOS = ordersMapper.selectList(new QueryWrapper<OrdersDO>().eq("real_source_id", orderId).eq("deleted", 0));
if(CollectionUtil.isNotEmpty(ordersDOS)){ if(CollectionUtil.isNotEmpty(ordersDOS)){
@ -305,6 +297,14 @@ public class DouDianOrderCatchServiceImpl implements OrderCatchService {
// 106 doudian_trade_TradeCanceled // 106 doudian_trade_TradeCanceled
// 订单取消消息 // 订单取消消息
TradeTradeCanceledParam tradeTradeCanceledParam = gson.fromJson(message.getData()+"", TradeTradeCanceledParam.class); TradeTradeCanceledParam tradeTradeCanceledParam = gson.fromJson(message.getData()+"", TradeTradeCanceledParam.class);
Long pId = tradeTradeCanceledParam.getPId();
// 更新订单取消
List<OrdersDO> ordersDOS = ordersMapper.selectList(new LambdaQueryWrapperX<OrdersDO>().eq(OrdersDO::getRealSourceId, pId).eq(OrdersDO::getDeleted, 0));
if(CollectionUtil.isNotEmpty(ordersDOS)){
OrdersDO ordersDO = ordersDOS.get(0);
ordersDO.setRefundStatus("300");
ordersMapper.updateById(ordersDO);
}
} else if("110".equals(tag)) { } else if("110".equals(tag)) {
// 110 doudian_trade_TradePending // 110 doudian_trade_TradePending
// 订单已支付待处理 // 订单已支付待处理
@ -417,23 +417,15 @@ public class DouDianOrderCatchServiceImpl implements OrderCatchService {
} }
ordersDO.setRefundStatus(String.valueOf(HaokaOrderRefundStatus)); ordersDO.setRefundStatus(String.valueOf(HaokaOrderRefundStatus));
// 获取计划手机号 // 获取计划手机号
for (com.doudian.open.api.order_orderDetail.data.LogisticsInfoItem logisticsInfoItem : logisticsInfo) { String productName = skuOrderListItem.getProductName();
for (com.doudian.open.api.order_orderDetail.data.ProductInfoItem productInfoItem : logisticsInfoItem.getProductInfo()) {
String skuOrderId = productInfoItem.getSkuOrderId();
if(skuOrderId.equals(orderId)){
String productName = productInfoItem.getProductName();
ordersDO.setSupplierProductName(productName); ordersDO.setSupplierProductName(productName);
List<com.doudian.open.api.order_orderDetail.data.SkuSpecsItem> skuSpecs = productInfoItem.getSkuSpecs(); for (com.doudian.open.api.order_orderDetail.data.SpecItem specItem : skuOrderListItem.getSpec()) {
for (com.doudian.open.api.order_orderDetail.data.SkuSpecsItem skuSpec : skuSpecs) { String value = specItem.getValue();
String name = skuSpec.getName(); String planMobile = getPlanMobile(value);
String planMobile = getPlanMobile(name);
if(planMobile != null){ if(planMobile != null){
ordersDO.setPlanMobile(planMobile); ordersDO.setPlanMobile(planMobile);
} }
} }
}
}
}
// 查询订单是否存在 不存在则新增存在则更新 // 查询订单是否存在 不存在则新增存在则更新
List<OrdersDO> ordersDOS = ordersMapper.selectList(new QueryWrapper<OrdersDO>().eq("real_source_id", orderId).eq("deleted", 0)); List<OrdersDO> ordersDOS = ordersMapper.selectList(new QueryWrapper<OrdersDO>().eq("real_source_id", orderId).eq("deleted", 0));
if(CollectionUtil.isNotEmpty(ordersDOS)){ if(CollectionUtil.isNotEmpty(ordersDOS)){
@ -609,23 +601,15 @@ public class DouDianOrderCatchServiceImpl implements OrderCatchService {
ordersDO.setRefundStatus(String.valueOf(HaokaOrderRefundStatus)); ordersDO.setRefundStatus(String.valueOf(HaokaOrderRefundStatus));
ordersDO.setStatusName(skuOrderListItem.getOrderStatusDesc()); ordersDO.setStatusName(skuOrderListItem.getOrderStatusDesc());
// 获取计划手机号 // 获取计划手机号
for (LogisticsInfoItem logisticsInfoItem : logisticsInfo) { String productName = skuOrderListItem.getProductName();
for (ProductInfoItem productInfoItem : logisticsInfoItem.getProductInfo()) {
String skuOrderId = productInfoItem.getSkuOrderId();
if(skuOrderId.equals(orderId)){
String productName = productInfoItem.getProductName();
ordersDO.setSupplierProductName(productName); ordersDO.setSupplierProductName(productName);
List<SkuSpecsItem> skuSpecs = productInfoItem.getSkuSpecs(); for (SpecItem specItem : skuOrderListItem.getSpec()) {
for (SkuSpecsItem skuSpec : skuSpecs) { String value = specItem.getValue();
String name = skuSpec.getName(); String planMobile = getPlanMobile(value);
String planMobile = getPlanMobile(name);
if(planMobile != null){ if(planMobile != null){
ordersDO.setPlanMobile(planMobile); ordersDO.setPlanMobile(planMobile);
} }
} }
}
}
}
// 查询订单是否存在 不存在则新增存在则更新 // 查询订单是否存在 不存在则新增存在则更新
List<OrdersDO> ordersDOS = ordersMapper.selectList(new QueryWrapper<OrdersDO>().eq("real_source_id", orderId).eq("deleted", 0)); List<OrdersDO> ordersDOS = ordersMapper.selectList(new QueryWrapper<OrdersDO>().eq("real_source_id", orderId).eq("deleted", 0));
if(CollectionUtil.isNotEmpty(ordersDOS)){ if(CollectionUtil.isNotEmpty(ordersDOS)){
@ -735,12 +719,12 @@ public class DouDianOrderCatchServiceImpl implements OrderCatchService {
private String getPlanMobile(String skuName) { private String getPlanMobile(String skuName) {
// 去除空格 // 去除空格
String noSpace = StringUtils.deleteWhitespace(skuName); String noSpace = StringUtils.deleteWhitespace(skuName);
String pattern = "(?<=\\/)\\d{11}"; String pattern = "1\\d{10}";
Pattern compile = Pattern.compile(pattern); Pattern compile = Pattern.compile(pattern);
Matcher matcher = compile.matcher(noSpace); Matcher matcher = compile.matcher(noSpace);
if(matcher.find()){ if(matcher.find()){
// 找到匹配手机号 // 找到匹配手机号
return matcher.group(1); return matcher.group(0);
}else { }else {
return null; return null;
} }