From fe7a3963f6fa830a71e7cd6dc0086942c1531cfd Mon Sep 17 00:00:00 2001 From: wangchaoxu Date: Mon, 4 Sep 2023 00:43:53 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=87=E8=B4=AD=E5=8D=95=E5=90=8C=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/service/impl/OpOrderServiceImpl.java | 27 +++++++++++-------- ...RsyncDdOrdersAndPurchaseOrdersService.java | 11 ++++++-- .../java/com/ms/api/util/DdRequestUtil.java | 17 ++++++++++++ 3 files changed, 42 insertions(+), 13 deletions(-) diff --git a/ms-biz/src/main/java/com/ms/api/service/impl/OpOrderServiceImpl.java b/ms-biz/src/main/java/com/ms/api/service/impl/OpOrderServiceImpl.java index b20ad3a7..90dcb8e2 100644 --- a/ms-biz/src/main/java/com/ms/api/service/impl/OpOrderServiceImpl.java +++ b/ms-biz/src/main/java/com/ms/api/service/impl/OpOrderServiceImpl.java @@ -27,17 +27,7 @@ import com.doudian.open.api.order_logisticsAddMultiPack.data.OrderLogisticsAddMu import com.doudian.open.api.order_logisticsAddMultiPack.param.OrderLogisticsAddMultiPackParam; import com.doudian.open.api.order_logisticsAddMultiPack.param.PackListItem; import com.doudian.open.api.order_logisticsAddMultiPack.param.ShippedOrderInfoItem; -import com.doudian.open.api.order_orderDetail.data.AfterSaleInfo; -import com.doudian.open.api.order_orderDetail.data.CouponInfoItem; -import com.doudian.open.api.order_orderDetail.data.CouponInfoItem_6_6; -import com.doudian.open.api.order_orderDetail.data.LogisticsInfoItem; -import com.doudian.open.api.order_orderDetail.data.OrderPhaseListItem; -import com.doudian.open.api.order_orderDetail.data.PostAddr; -import com.doudian.open.api.order_orderDetail.data.ProductInfoItem; -import com.doudian.open.api.order_orderDetail.data.PromotionDetail_4_4; -import com.doudian.open.api.order_orderDetail.data.ShopOrderDetail; -import com.doudian.open.api.order_orderDetail.data.SkuOrderListItem; -import com.doudian.open.api.order_orderDetail.data.SkuOrderTagUiItem; +import com.doudian.open.api.order_orderDetail.data.*; import com.doudian.open.api.order_orderDetail.param.OrderOrderDetailParam; import com.doudian.open.api.order_searchList.OrderSearchListRequest; import com.doudian.open.api.order_searchList.OrderSearchListResponse; @@ -1751,6 +1741,21 @@ public class OpOrderServiceImpl implements OpOrderService { } return true; } + + public void rsyncOpOrderByOrderIds(Long shopId, List orderIds, Map orderIdAndDdMsgOrderStatusMap, boolean fromDyCloud) { + for (String orderId : orderIds) { + if (fromDyCloud) { +// todo: + } +// todo: + OrderOrderDetailParam param = new OrderOrderDetailParam(); + param.setShopOrderId(orderId); + param.setIsSearchable(true); + OrderOrderDetailData orderOrderDetailData = DdRequestUtil.orderDetailRequest(param); + + } + + } } diff --git a/ms-biz/src/main/java/com/ms/api/spi/order/RsyncDdOrdersAndPurchaseOrdersService.java b/ms-biz/src/main/java/com/ms/api/spi/order/RsyncDdOrdersAndPurchaseOrdersService.java index 3d9f7502..8203033d 100644 --- a/ms-biz/src/main/java/com/ms/api/spi/order/RsyncDdOrdersAndPurchaseOrdersService.java +++ b/ms-biz/src/main/java/com/ms/api/spi/order/RsyncDdOrdersAndPurchaseOrdersService.java @@ -40,9 +40,12 @@ public class RsyncDdOrdersAndPurchaseOrdersService extends SPIBaseService implem String orderIdsStr = req.getData().getOrderIds(); String sourceOrderIdsStr = req.getData().getSourceOrderIds(); + List orderIds; + Map orderIdAndOrderMap; + if (!StringUtils.isEmpty(orderIdsStr)) { - List orderIds = CommonTool.splitWithComma(orderIdsStr); - Map orderIdAndOrderMap = opOrderService.getOpOrdersByOrderIds(orderIds); + orderIds = CommonTool.splitWithComma(orderIdsStr); + orderIdAndOrderMap = opOrderService.getOpOrdersByOrderIds(orderIds); if (!opOrderService.checkOrdersBelongShop(shopId, orderIdAndOrderMap.values())) { return R.ok(Ret.fail("无法操作不属于本店铺的订单")); } @@ -66,6 +69,10 @@ public class RsyncDdOrdersAndPurchaseOrdersService extends SPIBaseService implem } } + if (!StringUtils.isEmpty(orderIdsStr)) { + + } + // todo: return R.ok(Ret.success()); diff --git a/ms-biz/src/main/java/com/ms/api/util/DdRequestUtil.java b/ms-biz/src/main/java/com/ms/api/util/DdRequestUtil.java index 2a7d844e..ee02134b 100644 --- a/ms-biz/src/main/java/com/ms/api/util/DdRequestUtil.java +++ b/ms-biz/src/main/java/com/ms/api/util/DdRequestUtil.java @@ -22,6 +22,7 @@ import com.doudian.open.api.order_logisticsCompanyList.OrderLogisticsCompanyList import com.doudian.open.api.order_logisticsCompanyList.data.DataItem; import com.doudian.open.api.order_orderDetail.OrderOrderDetailRequest; import com.doudian.open.api.order_orderDetail.OrderOrderDetailResponse; +import com.doudian.open.api.order_orderDetail.data.OrderOrderDetailData; import com.doudian.open.api.order_orderDetail.data.ShopOrderDetail; import com.doudian.open.api.order_orderDetail.param.OrderOrderDetailParam; import com.doudian.open.api.order_searchList.OrderSearchListRequest; @@ -162,4 +163,20 @@ public class DdRequestUtil { throw new RuntimeException(String.format("抖店请求错误:msg:%s,code:%s,subCode:%s,subMsg:%s,", response.getMsg(), response.getCode(), response.getSubCode(), response.getSubMsg())); } + public static OrderOrderDetailData orderDetailRequest(OrderOrderDetailParam param) { + String activeProfile= System.getenv("sys-deploy-env"); + if (!"Prod".equals(activeProfile)){ + AuthThreadLocalUtil.set(AppConst.TEST_SHOP_ID); + } + OrderOrderDetailRequest request = new OrderOrderDetailRequest(); + request.setParam(param); + log.info("=============Dd请求餐素:{}===================", JSONObject.toJSONString(param)); + OrderOrderDetailResponse response = request.execute(); + log.info("=============Dd请求返回:{}===================", JSONObject.toJSONString(response)); + boolean success = CommonTool.checkDdApiRequestIsSuccess(response); + if (success && ObjectUtil.isNotEmpty(response.getData())) { + return response.getData(); + } + throw new RuntimeException(String.format("抖店请求错误:msg:%s,code:%s,subCode:%s,subMsg:%s,", response.getMsg(), response.getCode(), response.getSubCode(), response.getSubMsg())); + } }