From 15c72266d8584fdbfb7ea996e37a9f4a3bd99803 Mon Sep 17 00:00:00 2001 From: wangchaoxu Date: Sat, 2 Sep 2023 23:58:33 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=87=E8=B4=AD=E9=85=8D=E7=BD=AE=E7=9B=B8?= =?UTF-8?q?=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../spi/order/SavePurchaseSettingService.java | 46 +++++++++++++------ 1 file changed, 32 insertions(+), 14 deletions(-) diff --git a/ms-biz/src/main/java/com/ms/api/spi/order/SavePurchaseSettingService.java b/ms-biz/src/main/java/com/ms/api/spi/order/SavePurchaseSettingService.java index f8d6b6ea..b90b6fab 100644 --- a/ms-biz/src/main/java/com/ms/api/spi/order/SavePurchaseSettingService.java +++ b/ms-biz/src/main/java/com/ms/api/spi/order/SavePurchaseSettingService.java @@ -21,7 +21,6 @@ import com.ms.api.util.PurchaseOrderUtil; import com.ms.dal.entity.DsAutoPurchaseAgreement; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import java.util.ArrayList; @@ -94,10 +93,18 @@ public class SavePurchaseSettingService extends SPIBaseService implements Extens Map params = new HashMap<>(); params.put("userId", SecurityTool.encodeByAES(String.valueOf(shopId))); params.put("platform", "ddMicroApp"); - params.put("isEncryptDsOrder", platformShopSetting.get("isEncryptDsOrder")); - params.put("encryptDsOrderType", platformShopSetting.get("encryptDsOrderType")); - params.put("allowDsEncryptOrderSourceSellers", platformShopSetting.get("allowDsEncryptOrderSourceSellers")); - params.put("isEncryptDsOrderIfSellerSupport", platformShopSetting.get("isEncryptDsOrderIfSellerSupport")); + if (platformShopSetting.containsKey("isEncryptDsOrder") && platformShopSetting.get("isEncryptDsOrder") != null) { + params.put("isEncryptDsOrder", Integer.valueOf(platformShopSetting.get("isEncryptDsOrder").toString())); + } + if (platformShopSetting.containsKey("encryptDsOrderType") && platformShopSetting.get("encryptDsOrderType") != null) { + params.put("encryptDsOrderType", platformShopSetting.get("encryptDsOrderType")); + } + if (platformShopSetting.containsKey("allowDsEncryptOrderSourceSellers") && platformShopSetting.get("allowDsEncryptOrderSourceSellers") != null) { + params.put("allowDsEncryptOrderSourceSellers", platformShopSetting.get("allowDsEncryptOrderSourceSellers")); + } + if (platformShopSetting.containsKey("isEncryptDsOrderIfSellerSupport") && platformShopSetting.get("isEncryptDsOrderIfSellerSupport") != null) { + params.put("isEncryptDsOrderIfSellerSupport", Integer.valueOf(platformShopSetting.get("isEncryptDsOrderIfSellerSupport").toString())); + } Map operateInfo = new HashMap<>(); operateInfo.put("userId", SecurityTool.encodeByAES(String.valueOf(shopId))); operateInfo.put("ip", ""); // todo: 获取ip @@ -126,7 +133,6 @@ public class SavePurchaseSettingService extends SPIBaseService implements Extens error = true; }; } - } catch (Exception e) { error = true; log.error("1688分销配置保存失败,原因:" + e.getMessage()); @@ -140,12 +146,25 @@ public class SavePurchaseSettingService extends SPIBaseService implements Extens Map dsSettingParams = new HashMap<>(); dsSettingParams.put("userId", SecurityTool.encodeByAES(String.valueOf(shopId))); dsSettingParams.put("platform", "ddMicroApp"); - dsSettingParams.put("isApplyRefundOnPlatformRefundingAndSourceWaitSend", platformShopSetting.get("isApplyRefundOnPlatformRefundingAndSourceWaitSend")); - dsSettingParams.put("isCancelOrderOnPlatformRefundingAndSourceWaitPay", platformShopSetting.get("isCancelOrderOnPlatformRefundingAndSourceWaitPay")); - dsSettingParams.put("isApplyRefundOnPlatformRefundEndAndSourceWaitSend", platformShopSetting.get("isApplyRefundOnPlatformRefundEndAndSourceWaitSend")); - dsSettingParams.put("isCancelOrderOnPlatformRefundEndAndSourceWaitPay", platformShopSetting.get("isCancelOrderOnPlatformRefundEndAndSourceWaitPay")); - dsSettingParams.put("refundReason", platformShopSetting.get("refundReason")); - dsSettingParams.put("isSaveManualSelectedSku", platformShopSetting.get("isSaveManualSelectedSku")); + + if (platformShopSetting.containsKey("isApplyRefundOnPlatformRefundingAndSourceWaitSend") && platformShopSetting.get("isApplyRefundOnPlatformRefundingAndSourceWaitSend") != null) { + dsSettingParams.put("isApplyRefundOnPlatformRefundingAndSourceWaitSend", Integer.valueOf(platformShopSetting.get("isApplyRefundOnPlatformRefundingAndSourceWaitSend").toString())); + } + if (platformShopSetting.containsKey("isCancelOrderOnPlatformRefundingAndSourceWaitPay") && platformShopSetting.get("isCancelOrderOnPlatformRefundingAndSourceWaitPay") != null) { + dsSettingParams.put("isCancelOrderOnPlatformRefundingAndSourceWaitPay", Integer.valueOf(platformShopSetting.get("isCancelOrderOnPlatformRefundingAndSourceWaitPay").toString())); + } + if (platformShopSetting.containsKey("isApplyRefundOnPlatformRefundEndAndSourceWaitSend") && platformShopSetting.get("isApplyRefundOnPlatformRefundEndAndSourceWaitSend") != null) { + dsSettingParams.put("isApplyRefundOnPlatformRefundEndAndSourceWaitSend", Integer.valueOf(platformShopSetting.get("isApplyRefundOnPlatformRefundEndAndSourceWaitSend").toString())); + } + if (platformShopSetting.containsKey("isCancelOrderOnPlatformRefundEndAndSourceWaitPay") && platformShopSetting.get("isCancelOrderOnPlatformRefundEndAndSourceWaitPay") != null) { + dsSettingParams.put("isCancelOrderOnPlatformRefundEndAndSourceWaitPay", Integer.valueOf(platformShopSetting.get("isCancelOrderOnPlatformRefundEndAndSourceWaitPay").toString())); + } + if (platformShopSetting.containsKey("refundReason") && platformShopSetting.get("refundReason") != null) { + dsSettingParams.put("refundReason", platformShopSetting.get("refundReason")); + } + if (platformShopSetting.containsKey("isSaveManualSelectedSku") && platformShopSetting.get("isSaveManualSelectedSku") != null) { + dsSettingParams.put("isSaveManualSelectedSku", Integer.valueOf(platformShopSetting.get("isSaveManualSelectedSku").toString())); + } dsSettingParams.put("operateSource", platformShopSetting.get("operateSource")); Map operateInfo = new HashMap<>(); operateInfo.put("userId", shopId); @@ -163,11 +182,10 @@ public class SavePurchaseSettingService extends SPIBaseService implements Extens log.error("1688分销配置保存失败,原因:" + e.getMessage()); } } - + if (error) { return R.ok(Ret.fail("1688分销配置保存失败")); } - return R.ok(Ret.success()); }