update:号码匹配修改
This commit is contained in:
parent
4295baf3bc
commit
324df6b903
|
@ -232,21 +232,13 @@ public class DouDianOrderCatchServiceImpl implements OrderCatchService {
|
|||
}
|
||||
ordersDO.setRefundStatus(String.valueOf(HaokaOrderRefundStatus));
|
||||
// 获取计划手机号
|
||||
for (com.doudian.open.api.order_orderDetail.data.LogisticsInfoItem logisticsInfoItem : logisticsInfo) {
|
||||
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);
|
||||
List<com.doudian.open.api.order_orderDetail.data.SkuSpecsItem> skuSpecs = productInfoItem.getSkuSpecs();
|
||||
for (com.doudian.open.api.order_orderDetail.data.SkuSpecsItem skuSpec : skuSpecs) {
|
||||
String name = skuSpec.getName();
|
||||
String planMobile = getPlanMobile(name);
|
||||
if(planMobile != null){
|
||||
ordersDO.setPlanMobile(planMobile);
|
||||
}
|
||||
}
|
||||
}
|
||||
String productName = skuOrderListItem.getProductName();
|
||||
ordersDO.setSupplierProductName(productName);
|
||||
for (com.doudian.open.api.order_orderDetail.data.SpecItem specItem : skuOrderListItem.getSpec()) {
|
||||
String value = specItem.getValue();
|
||||
String planMobile = getPlanMobile(value);
|
||||
if(planMobile != null){
|
||||
ordersDO.setPlanMobile(planMobile);
|
||||
}
|
||||
}
|
||||
// 查询订单是否存在 不存在则新增,存在则更新
|
||||
|
@ -305,6 +297,14 @@ public class DouDianOrderCatchServiceImpl implements OrderCatchService {
|
|||
// 106 doudian_trade_TradeCanceled
|
||||
// 订单取消消息
|
||||
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)) {
|
||||
// 110 doudian_trade_TradePending
|
||||
// 订单已支付待处理
|
||||
|
@ -417,21 +417,13 @@ public class DouDianOrderCatchServiceImpl implements OrderCatchService {
|
|||
}
|
||||
ordersDO.setRefundStatus(String.valueOf(HaokaOrderRefundStatus));
|
||||
// 获取计划手机号
|
||||
for (com.doudian.open.api.order_orderDetail.data.LogisticsInfoItem logisticsInfoItem : logisticsInfo) {
|
||||
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);
|
||||
List<com.doudian.open.api.order_orderDetail.data.SkuSpecsItem> skuSpecs = productInfoItem.getSkuSpecs();
|
||||
for (com.doudian.open.api.order_orderDetail.data.SkuSpecsItem skuSpec : skuSpecs) {
|
||||
String name = skuSpec.getName();
|
||||
String planMobile = getPlanMobile(name);
|
||||
if(planMobile != null){
|
||||
ordersDO.setPlanMobile(planMobile);
|
||||
}
|
||||
}
|
||||
}
|
||||
String productName = skuOrderListItem.getProductName();
|
||||
ordersDO.setSupplierProductName(productName);
|
||||
for (com.doudian.open.api.order_orderDetail.data.SpecItem specItem : skuOrderListItem.getSpec()) {
|
||||
String value = specItem.getValue();
|
||||
String planMobile = getPlanMobile(value);
|
||||
if(planMobile != null){
|
||||
ordersDO.setPlanMobile(planMobile);
|
||||
}
|
||||
}
|
||||
// 查询订单是否存在 不存在则新增,存在则更新
|
||||
|
@ -609,21 +601,13 @@ public class DouDianOrderCatchServiceImpl implements OrderCatchService {
|
|||
ordersDO.setRefundStatus(String.valueOf(HaokaOrderRefundStatus));
|
||||
ordersDO.setStatusName(skuOrderListItem.getOrderStatusDesc());
|
||||
// 获取计划手机号
|
||||
for (LogisticsInfoItem logisticsInfoItem : logisticsInfo) {
|
||||
for (ProductInfoItem productInfoItem : logisticsInfoItem.getProductInfo()) {
|
||||
String skuOrderId = productInfoItem.getSkuOrderId();
|
||||
if(skuOrderId.equals(orderId)){
|
||||
String productName = productInfoItem.getProductName();
|
||||
ordersDO.setSupplierProductName(productName);
|
||||
List<SkuSpecsItem> skuSpecs = productInfoItem.getSkuSpecs();
|
||||
for (SkuSpecsItem skuSpec : skuSpecs) {
|
||||
String name = skuSpec.getName();
|
||||
String planMobile = getPlanMobile(name);
|
||||
if(planMobile != null){
|
||||
ordersDO.setPlanMobile(planMobile);
|
||||
}
|
||||
}
|
||||
}
|
||||
String productName = skuOrderListItem.getProductName();
|
||||
ordersDO.setSupplierProductName(productName);
|
||||
for (SpecItem specItem : skuOrderListItem.getSpec()) {
|
||||
String value = specItem.getValue();
|
||||
String planMobile = getPlanMobile(value);
|
||||
if(planMobile != null){
|
||||
ordersDO.setPlanMobile(planMobile);
|
||||
}
|
||||
}
|
||||
// 查询订单是否存在 不存在则新增,存在则更新
|
||||
|
@ -735,12 +719,12 @@ public class DouDianOrderCatchServiceImpl implements OrderCatchService {
|
|||
private String getPlanMobile(String skuName) {
|
||||
// 去除空格
|
||||
String noSpace = StringUtils.deleteWhitespace(skuName);
|
||||
String pattern = "(?<=\\/)\\d{11}";
|
||||
String pattern = "1\\d{10}";
|
||||
Pattern compile = Pattern.compile(pattern);
|
||||
Matcher matcher = compile.matcher(noSpace);
|
||||
if(matcher.find()){
|
||||
// 找到匹配手机号
|
||||
return matcher.group(1);
|
||||
return matcher.group(0);
|
||||
}else {
|
||||
return null;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue