采购单同步

20230922-ljl-fixBug
wangchaoxu 1 year ago
parent e436ea672f
commit fe7a3963f6

@ -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<String> 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);
}
}
}

@ -40,9 +40,12 @@ public class RsyncDdOrdersAndPurchaseOrdersService extends SPIBaseService implem
String orderIdsStr = req.getData().getOrderIds();
String sourceOrderIdsStr = req.getData().getSourceOrderIds();
List<String> orderIds;
Map<String, OpOrder> orderIdAndOrderMap;
if (!StringUtils.isEmpty(orderIdsStr)) {
List<String> orderIds = CommonTool.splitWithComma(orderIdsStr);
Map<String, OpOrder> 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());

@ -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()));
}
}

Loading…
Cancel
Save