From 324df6b9031163af8160e198e1e6f9e9f729688a Mon Sep 17 00:00:00 2001 From: Damonny <826010988@qq.com> Date: Sun, 23 Feb 2025 00:46:18 +0800 Subject: [PATCH] =?UTF-8?q?update:=E5=8F=B7=E7=A0=81=E5=8C=B9=E9=85=8D?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DouDianOrderCatchServiceImpl.java | 78 ++++++++----------- 1 file changed, 31 insertions(+), 47 deletions(-) diff --git a/yudao-module-haoka/yudao-module-haoka-biz/src/main/java/cn/iocoder/yudao/module/haoka/service/orderCatch/DouDianOrderCatchServiceImpl.java b/yudao-module-haoka/yudao-module-haoka-biz/src/main/java/cn/iocoder/yudao/module/haoka/service/orderCatch/DouDianOrderCatchServiceImpl.java index 16abb40419..aa7b304c91 100644 --- a/yudao-module-haoka/yudao-module-haoka-biz/src/main/java/cn/iocoder/yudao/module/haoka/service/orderCatch/DouDianOrderCatchServiceImpl.java +++ b/yudao-module-haoka/yudao-module-haoka-biz/src/main/java/cn/iocoder/yudao/module/haoka/service/orderCatch/DouDianOrderCatchServiceImpl.java @@ -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 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 ordersDOS = ordersMapper.selectList(new LambdaQueryWrapperX().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 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 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; }