diff --git a/ms-biz/src/main/java/com/ms/api/service/impl/DistributionOrderServiceImpl.java b/ms-biz/src/main/java/com/ms/api/service/impl/DistributionOrderServiceImpl.java index a91cea6c..4f75e885 100644 --- a/ms-biz/src/main/java/com/ms/api/service/impl/DistributionOrderServiceImpl.java +++ b/ms-biz/src/main/java/com/ms/api/service/impl/DistributionOrderServiceImpl.java @@ -700,6 +700,9 @@ public class DistributionOrderServiceImpl implements DistributionOrderService { Double purchasePayment = purchasePaymentInfo.get("purchaseOrderPayment"); Double orderCommission = purchasePaymentInfo.get("purchaseOrderCommission"); + purchasePayment = purchasePayment == null ? 0 : purchasePayment; + orderCommission = orderCommission == null ? 0 : orderCommission; + double orderProfitSum = orderPayment + platformCostAmount + orderCommission - purchasePayment - postInsuranceAmount; double orderTotalProfitRate = orderPayment > 0 ? orderProfitSum / orderPayment * 100 : 0; @@ -878,7 +881,6 @@ public class DistributionOrderServiceImpl implements DistributionOrderService { for (PurchaseOrderItemDTO itemDto: purchaseOrderDto.getItems()) { realPurchaseNumMap.put(itemDto.getSkuId(), itemDto.getPurchaseNum()); - // TODO purchasePlatform1688DS opOrderOutstorageCheckBuffer } HashMap purchaseNumMap = buildPurchaseOrderItemsPurchaseNum(skuIdAndOpOrderChildMap, needRebuildSkuIds, realPurchaseNumMap); diff --git a/ms-biz/src/main/java/com/ms/api/service/impl/DsApiServiceImpl.java b/ms-biz/src/main/java/com/ms/api/service/impl/DsApiServiceImpl.java index e2db3a59..0f4e8c23 100644 --- a/ms-biz/src/main/java/com/ms/api/service/impl/DsApiServiceImpl.java +++ b/ms-biz/src/main/java/com/ms/api/service/impl/DsApiServiceImpl.java @@ -45,6 +45,7 @@ public class DsApiServiceImpl implements DsApiService { } } 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\"}]}"; return JSON.parseObject(resp, BatchCreateDistributionOrdersResponseDTO.class); } diff --git a/ms-biz/src/main/java/com/ms/api/service/impl/PurchaseOrderTagServiceImpl.java b/ms-biz/src/main/java/com/ms/api/service/impl/PurchaseOrderTagServiceImpl.java index 26371127..b1425ea5 100644 --- a/ms-biz/src/main/java/com/ms/api/service/impl/PurchaseOrderTagServiceImpl.java +++ b/ms-biz/src/main/java/com/ms/api/service/impl/PurchaseOrderTagServiceImpl.java @@ -5,14 +5,12 @@ import com.ms.dal.entity.PurchaseOrderItem; import com.ms.dal.entity.PurchaseOrderTag; import com.ms.api.service.PurchaseOrderTagService; import com.ms.dal.mapper.PurchaseOrderTagMapper; +import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; /** @@ -73,7 +71,7 @@ public class PurchaseOrderTagServiceImpl implements PurchaseOrderTagService{ } tag.setTagValue(tagValue); tag.setGmtModified(new Date()); - if (tag.getPurchaseOrderTagId() > 0) { + if (tag.getPurchaseOrderTagId() != null && tag.getPurchaseOrderTagId() > 0) { purchaseOrderTagMapper.updateByPrimaryKeySelective(tag); } else { purchaseOrderTagMapper.insertSelective(tag);