Merge remote-tracking branch 'origin/master'

20230922-ljl-fixBug
daixiaogang 1 year ago
commit fb59538cea

@ -17,7 +17,7 @@ public interface DistributionOrderService {
BatchCreateDistributionOrdersResponseDTO batchCreateDistributionOrders(Long shopId, BatchCreateDistributionOrdersRequestDTO request);
GetPurchaseOrderItemsAndSourceItemsResponseDTO getSourceSkuInfos(Long shopId, List<OrderItemDTO> orderItems);
HashMap<String, Long> batchAddDsPurchaseConfirmLog(Long shopId, BatchAddPurchaseConfirmLogRequestDTO request);
void cancelPurchaseOrder(Long shopId, String orderId, List<Long> skuIds, String source, boolean isForce);
void cancelPurchaseOrder(Long shopId, String orderId, List<Long> skuIds, String source, boolean isForce, boolean needCancelDs);
void closeSourceOrderAndCancelRelatePurchaseOrder(Long shopId, String orderId, String purchaseOrderSn);
String getDsPurchaseOrderPayUrl(Long shopId, GetDsPurchaseOrderPayUrlRequestDTO request);
void processDsMessage(Long dsMessageId);

@ -1107,14 +1107,16 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
}
@Override
public void cancelPurchaseOrder(Long shopId, String orderId, List<Long> skuIds, String source, boolean isForce) {
public void cancelPurchaseOrder(Long shopId, String orderId, List<Long> skuIds, String source, boolean isForce, boolean needCancelDs) {
OpOrder opOrder = opOrderService.selectByOrderId(orderId);
if (opOrder == null || !Objects.equals(opOrder.getShopId(), shopId)) {
throw new RuntimeException("店铺不存在");
}
CommonResponseDTO response = dsApiService.cancelPurchaseOrderRelate(CommonConst.PLATFORM, shopId, orderId, skuIds);
if (!response.isSuccess()) {
throw new RuntimeException(response.getReason());
if (needCancelDs) {
CommonResponseDTO response = dsApiService.cancelPurchaseOrderRelate(CommonConst.PLATFORM, shopId, orderId, skuIds);
if (!response.isSuccess()) {
throw new RuntimeException(response.getReason());
}
}
if (!skuIds.isEmpty()) {
cancelPurchaseOrderByOrderId(shopId, orderId, source);
@ -1248,7 +1250,7 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
}
String cancelSource = PurchaseOrderConst.PURCHASE_ORDER_CANCEL_SOURCE_DS_CLOSE_CANCEL;
List<Long> skuIds = items.stream().map(PurchaseOrderItem::getSkuId).collect(Collectors.toList());
cancelPurchaseOrder(shopId, orderId, skuIds, cancelSource, false);
cancelPurchaseOrder(shopId, orderId, skuIds, cancelSource, false, false);
}
@Override

@ -44,8 +44,8 @@ public class DsApiServiceImpl implements DsApiService {
item.setPlatformItemId(SecurityTool.encodeByAES(item.getPlatformItemId()));
}
}
String resp = execute("/order/batchCreateDistributionOrders", objectToMap(request));
// String resp = "{\"result\":\"success\",\"successCount\":1,\"failCount\":0,\"successList\":[{\"result\":\"success\",\"data\":{\"success\":true,\"totalSuccessAmount\":15620,\"orderId\":\"3517835906881847640\",\"postFee\":0,\"mutilOrders\":null},\"createAlibabaOrderLogId\":1030,\"platformOrderIds\":[\"6921501314893420328\"],\"isEncryptOrder\":1,\"isSupportEncryptOrder\":1,\"isUseManualConsignee\":0,\"flow\":\"fenxiao\",\"includeSplitJxhy\":false,\"sourceOrderIds\":[\"3517835906881847640\"],\"payRet\":{\"3517835906881847640\":{\"result\":\"fail\",\"code\":\"NO_SIGN_UP_ERROR\",\"reason\":\"\\u672a\\u7b7e\\u7ea6\\u6216\\u672a\\u7ed1\\u5b9a\"}},\"platformOrderId\":\"6921501314893420328\",\"relatePurchaseOrderInfos\":[{\"platformOrderId\":\"6921501314893420328\",\"purchasePlatform\":\"1688DS\",\"purchaseOrderSn\":\"3517835906881847640\",\"purchaseOrderBuyer\":\"goufx_ms\",\"purchaseOrderSeller\":\"\\u8d27\\u770b\\u7535\\u5b50\\u5546\\u52a1\\u5546\\u884c\",\"purchaseOrderPayment\":\"156.2\",\"purchaseOrderFullname\":\"\\u554a*\",\"purchaseOrderMobile\":\"1********66\",\"purchaseOrderFullAddress\":\"\\u5c71\\u897f\\u7701 \\u664b\\u4e2d\\u5e02 \\u4ecb\\u4f11\\u5e02 \\u5b8b\\u53e4\\u4e61 ***\\u4e61\\u9053*****\\u6751*****\",\"purchaseOrderStartTime\":\"2023-09-11 21:08:09\",\"platformPushStatus\":\"wait\",\"purchaseOrderLogisticsName\":\"\",\"purchaseOrderWaybillCode\":\"\",\"purchaseOrderStatus\":\"wait_pay\",\"purchaseOrderFlow\":\"fenxiao\",\"alibabaOrderStatus\":\"waitbuyerpay\",\"isUseManualConsignee\":0,\"isDsEncryptOrder\":\"1\",\"isSupportEncryptOrder\":\"1\",\"logisticsIsAccept\":false,\"items\":[{\"skuId\":\"1759603409503247\",\"wareId\":\"3603667784447454901\",\"purchaseNum\":\"2\",\"purchasePrice\":\"78.1\",\"sourceItemId\":\"721794394704\"},{\"skuId\":\"1759603409502271\",\"wareId\":\"3603667784447454901\",\"purchaseNum\":\"2\",\"purchasePrice\":\"78.1\",\"sourceItemId\":\"721794394704\"}],\"mergePurchasePlatformOrderIds\":null}]}],\"errorList\":null,\"lockSourceItems\":[{\"createPurchaseOrderLockSkuId\":\"1599\",\"createPurchaseOrderLockId\":\"20001137\",\"sourceItemId\":\"721794394704\",\"sourceSkuId\":\"5191968122810\",\"createPurchaseOrderLogId\":\"1087\",\"sourceOrderId\":\"3517835906881847640\",\"sourceNum\":null,\"reqId\":null,\"status\":\"lock\",\"gmtCreate\":\"2023-09-11 21:08:08\",\"gmtModified\":\"2023-09-11 21:08:09\",\"platformOrderId\":\"6921501314893420328\",\"platformItemId\":\"3603667784447454901\",\"platformSkuId\":\"1759603409503247\"},{\"createPurchaseOrderLockSkuId\":\"1600\",\"createPurchaseOrderLockId\":\"20001138\",\"sourceItemId\":\"721794394704\",\"sourceSkuId\":\"5191968122810\",\"createPurchaseOrderLogId\":\"1087\",\"sourceOrderId\":\"3517835906881847640\",\"sourceNum\":null,\"reqId\":null,\"status\":\"lock\",\"gmtCreate\":\"2023-09-11 21:08:08\",\"gmtModified\":\"2023-09-11 21:08:09\",\"platformOrderId\":\"6921501314893420328\",\"platformItemId\":\"3603667784447454901\",\"platformSkuId\":\"1759603409502271\"}]}";
// String resp = execute("/order/batchCreateDistributionOrders", objectToMap(request));
String resp = "{\"result\":\"success\",\"successCount\":1,\"failCount\":0,\"successList\":[{\"result\":\"success\",\"data\":{\"success\":true,\"totalSuccessAmount\":15620,\"orderId\":\"3518292495537847640\",\"postFee\":0,\"mutilOrders\":null},\"createAlibabaOrderLogId\":1031,\"platformOrderIds\":[\"6921501314893420328\"],\"isEncryptOrder\":1,\"isSupportEncryptOrder\":1,\"isUseManualConsignee\":0,\"flow\":\"fenxiao\",\"includeSplitJxhy\":false,\"sourceOrderIds\":[\"3518292495537847640\"],\"payRet\":{\"3518292495537847640\":{\"result\":\"fail\",\"code\":\"NO_SIGN_UP_ERROR\",\"reason\":\"\\u672a\\u7b7e\\u7ea6\\u6216\\u672a\\u7ed1\\u5b9a\"}},\"platformOrderId\":\"6921501314893420328\",\"relatePurchaseOrderInfos\":[{\"platformOrderId\":\"6921501314893420328\",\"purchasePlatform\":\"1688DS\",\"purchaseOrderSn\":\"3518292495537847640\",\"purchaseOrderBuyer\":\"goufx_ms\",\"purchaseOrderSeller\":\"\\u8d27\\u770b\\u7535\\u5b50\\u5546\\u52a1\\u5546\\u884c\",\"purchaseOrderPayment\":\"156.2\",\"purchaseOrderFullname\":\"\\u554a*\",\"purchaseOrderMobile\":\"1********66\",\"purchaseOrderFullAddress\":\"\\u5c71\\u897f\\u7701 \\u664b\\u4e2d\\u5e02 \\u4ecb\\u4f11\\u5e02 \\u5b8b\\u53e4\\u4e61 ***\\u4e61\\u9053*****\\u6751*****\",\"purchaseOrderStartTime\":\"2023-09-12 09:13:57\",\"platformPushStatus\":\"wait\",\"purchaseOrderLogisticsName\":\"\",\"purchaseOrderWaybillCode\":\"\",\"purchaseOrderStatus\":\"wait_pay\",\"purchaseOrderFlow\":\"fenxiao\",\"alibabaOrderStatus\":\"waitbuyerpay\",\"isUseManualConsignee\":0,\"isDsEncryptOrder\":\"1\",\"isSupportEncryptOrder\":\"1\",\"logisticsIsAccept\":false,\"items\":[{\"skuId\":\"1759603409503247\",\"wareId\":\"3603667784447454901\",\"purchaseNum\":\"2\",\"purchasePrice\":\"78.1\",\"sourceItemId\":\"721794394704\"},{\"skuId\":\"1759603409502271\",\"wareId\":\"3603667784447454901\",\"purchaseNum\":\"2\",\"purchasePrice\":\"78.1\",\"sourceItemId\":\"721794394704\"}],\"mergePurchasePlatformOrderIds\":null}]}],\"errorList\":null,\"lockSourceItems\":[{\"createPurchaseOrderLockSkuId\":\"1601\",\"createPurchaseOrderLockId\":\"20001139\",\"sourceItemId\":\"721794394704\",\"sourceSkuId\":\"5191968122810\",\"createPurchaseOrderLogId\":\"1088\",\"sourceOrderId\":\"3518292495537847640\",\"sourceNum\":null,\"reqId\":null,\"status\":\"lock\",\"gmtCreate\":\"2023-09-12 09:13:56\",\"gmtModified\":\"2023-09-12 09:13:57\",\"platformOrderId\":\"6921501314893420328\",\"platformItemId\":\"3603667784447454901\",\"platformSkuId\":\"1759603409503247\"},{\"createPurchaseOrderLockSkuId\":\"1602\",\"createPurchaseOrderLockId\":\"20001140\",\"sourceItemId\":\"721794394704\",\"sourceSkuId\":\"5191968122810\",\"createPurchaseOrderLogId\":\"1088\",\"sourceOrderId\":\"3518292495537847640\",\"sourceNum\":null,\"reqId\":null,\"status\":\"lock\",\"gmtCreate\":\"2023-09-12 09:13:56\",\"gmtModified\":\"2023-09-12 09:13:57\",\"platformOrderId\":\"6921501314893420328\",\"platformItemId\":\"3603667784447454901\",\"platformSkuId\":\"1759603409502271\"}]}";
return JSON.parseObject(resp, BatchCreateDistributionOrdersResponseDTO.class);
}

@ -30,7 +30,7 @@ public class CancelPurchaseOrderService extends SPIBaseService implements Extens
initHandle(req);
CanclePurchaseOrderRequestDTO requestDTO = req.getData();
String source = PurchaseOrderConst.PURCHASE_ORDER_CANCEL_SOURCE_CG_CANCEL;
distributionOrderService.cancelPurchaseOrder(shopId, requestDTO.getOrderId(), requestDTO.getSkuIds(), source, false);
distributionOrderService.cancelPurchaseOrder(shopId, requestDTO.getOrderId(), requestDTO.getSkuIds(), source, false, true);
return R.ok(Ret.success());
} catch (Exception e) {
log.error("cancelPurchaseOrder error", e);

Loading…
Cancel
Save