From 639eb18312a62ac2a76e2b59e16bcc1ff8d70d03 Mon Sep 17 00:00:00 2001
From: doum <doum>
Date: 星期三, 14 一月 2026 18:00:59 +0800
Subject: [PATCH] 经销商管理
---
server/dmmall_service/src/main/java/com/doumee/service/system/impl/SystemDictDataServiceImpl.java | 88 ++++++++++++++++++++++---------------------
1 files changed, 45 insertions(+), 43 deletions(-)
diff --git a/server/dmmall_service/src/main/java/com/doumee/service/system/impl/SystemDictDataServiceImpl.java b/server/dmmall_service/src/main/java/com/doumee/service/system/impl/SystemDictDataServiceImpl.java
index 4bb1bfc..7f78aa0 100644
--- a/server/dmmall_service/src/main/java/com/doumee/service/system/impl/SystemDictDataServiceImpl.java
+++ b/server/dmmall_service/src/main/java/com/doumee/service/system/impl/SystemDictDataServiceImpl.java
@@ -21,6 +21,7 @@
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
+import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -233,56 +234,57 @@
@Override
@Transactional(rollbackFor = {Exception.class, BusinessException.class})
public void updPlatformConfig(PlatformConfigDTO platformConfigDTO) {
- /* SystemDict dict = systemDictMapper.selectOne(new QueryWrapper<SystemDict>().lambda()
- .eq(SystemDict::getCode, Constants.ORDER_SET).last("limit 1"));
- if (dict == null) {
- throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(), "鏁版嵁瀛楀吀閰嶇疆鏁版嵁鏈夎锛岃鑱旂郴绯荤粺绠$悊鍛樺鐞嗭紒");
- }*/
+ if (platformConfigDTO.getDictCode() == null) {
+ throw new BusinessException(ResponseStatus.BAD_REQUEST);
+ }
List<SystemDictData> systemDictDataList = systemDictDataMapper.selectJoinList(SystemDictData.class,new MPJLambdaWrapper<SystemDictData>()
.selectAll(SystemDictData.class)
.leftJoin(SystemDict.class,SystemDict::getId,SystemDictData::getDictId)
- .in(SystemDict::getCode,Constants.ORDER_SET,Constants.INTEGRAL_SET)
+ .eq(SystemDict::getCode,platformConfigDTO.getDictCode())
);
if (com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(systemDictDataList)) {
for (SystemDictData systemDictData : systemDictDataList) {
- if (systemDictData.getLabel().equals(Constants.ORDERSET_REG_INTEGRAL_REWARD_STATUS)) {
- systemDictData.setCode(Constants.formatIntegerNum(platformConfigDTO.getRegIntegralRewardStatus()) + "");
- } else if (systemDictData.getLabel().equals(Constants.ORDERSET_SHARE_INTEGRAL_REWARD_STATUS)) {
- systemDictData.setCode(Constants.formatIntegerNum(platformConfigDTO.getShareIntegralRewardStatus()) + "");
- } else if (systemDictData.getLabel().equals(Constants.ORDERSET_REG_COUPON_REWARD_STATUS)) {
- systemDictData.setCode(Constants.formatIntegerNum(platformConfigDTO.getRegCouponRewardStatus()) + "");
- } else if (systemDictData.getLabel().equals(Constants.ORDERSET_SHARE_COUPON_REWARD_STATUS)) {
- systemDictData.setCode(Constants.formatIntegerNum(platformConfigDTO.getShareCouponRewardStatus()) + "");
- } else if (systemDictData.getLabel().equals(Constants.ORDERSET_REG_INTEGRAL_REWARD)) {
- systemDictData.setCode(Constants.formatBigdecimal(platformConfigDTO.getRegIntegralReward()).doubleValue() + "");
- } else if (systemDictData.getLabel().equals(Constants.ORDERSET_SHARE_INTEGRAL_REWARD)) {
- systemDictData.setCode(Constants.formatBigdecimal(platformConfigDTO.getShareIntegralReward()).doubleValue() + "");
- } else if (systemDictData.getLabel().equals(Constants.ORDERSET_REG_COUPON_REWARD_LIST)) {
- systemDictData.setCode(JSONObject.toJSONString(platformConfigDTO.getRegCouponRewardList() == null ? new ArrayList() : platformConfigDTO.getRegCouponRewardList()));
- } else if (systemDictData.getLabel().equals(Constants.ORDERSET_SHARE_COUPON_REWARD_LIST)) {
- systemDictData.setCode(JSONObject.toJSONString(platformConfigDTO.getShareCouponRewardList() == null ? new ArrayList() : platformConfigDTO.getShareCouponRewardList()));
- } else if (systemDictData.getLabel().equals(Constants.ORDERSET_RETURN_MEMBER_INTEGRAL_STATUS)) {
- systemDictData.setCode(Constants.formatIntegerNum(platformConfigDTO.getReturnMemberIntegralStatus()) + "");
- } else if (systemDictData.getLabel().equals(Constants.ORDERSET_RETURN_SHOP_INTEGRAL_STATUS)) {
- systemDictData.setCode(Constants.formatIntegerNum(platformConfigDTO.getReturnShopIntegralStatus()) + "");
- } else if (systemDictData.getLabel().equals(Constants.ORDERSET_RETURN_MEMBER_INTEGRAL)) {
- systemDictData.setCode(Constants.formatBigdecimal(platformConfigDTO.getReturnMemberIntegral()).doubleValue() + "");
- } else if (systemDictData.getLabel().equals(Constants.ORDERSET_RETURN_SHOP_INTEGRAL)) {
- systemDictData.setCode(Constants.formatBigdecimal(platformConfigDTO.getReturnShopIntegral()).doubleValue() + "");
- } else if (systemDictData.getLabel().equals(Constants.ORDERSET_TOTAL_RATE)) {
- systemDictData.setCode(Constants.formatBigdecimal(platformConfigDTO.getTotalRate()).doubleValue() + "");
+ if(StringUtils.equals(platformConfigDTO.getDictCode(),Constants.ORDER_SET)){
+ if (systemDictData.getLabel().equals(Constants.ORDERSET_REG_INTEGRAL_REWARD_STATUS)) {
+ systemDictData.setCode(Constants.formatIntegerNum(platformConfigDTO.getRegIntegralRewardStatus()) + "");
+ } else if (systemDictData.getLabel().equals(Constants.ORDERSET_SHARE_INTEGRAL_REWARD_STATUS)) {
+ systemDictData.setCode(Constants.formatIntegerNum(platformConfigDTO.getShareIntegralRewardStatus()) + "");
+ } else if (systemDictData.getLabel().equals(Constants.ORDERSET_REG_COUPON_REWARD_STATUS)) {
+ systemDictData.setCode(Constants.formatIntegerNum(platformConfigDTO.getRegCouponRewardStatus()) + "");
+ } else if (systemDictData.getLabel().equals(Constants.ORDERSET_SHARE_COUPON_REWARD_STATUS)) {
+ systemDictData.setCode(Constants.formatIntegerNum(platformConfigDTO.getShareCouponRewardStatus()) + "");
+ } else if (systemDictData.getLabel().equals(Constants.ORDERSET_REG_INTEGRAL_REWARD)) {
+ systemDictData.setCode(Constants.formatBigdecimal(platformConfigDTO.getRegIntegralReward()).doubleValue() + "");
+ } else if (systemDictData.getLabel().equals(Constants.ORDERSET_SHARE_INTEGRAL_REWARD)) {
+ systemDictData.setCode(Constants.formatBigdecimal(platformConfigDTO.getShareIntegralReward()).doubleValue() + "");
+ } else if (systemDictData.getLabel().equals(Constants.ORDERSET_REG_COUPON_REWARD_LIST)) {
+ systemDictData.setCode(JSONObject.toJSONString(platformConfigDTO.getRegCouponRewardList() == null ? new ArrayList() : platformConfigDTO.getRegCouponRewardList()));
+ } else if (systemDictData.getLabel().equals(Constants.ORDERSET_SHARE_COUPON_REWARD_LIST)) {
+ systemDictData.setCode(JSONObject.toJSONString(platformConfigDTO.getShareCouponRewardList() == null ? new ArrayList() : platformConfigDTO.getShareCouponRewardList()));
+ } else if (systemDictData.getLabel().equals(Constants.ORDERSET_RETURN_MEMBER_INTEGRAL_STATUS)) {
+ systemDictData.setCode(Constants.formatIntegerNum(platformConfigDTO.getReturnMemberIntegralStatus()) + "");
+ } else if (systemDictData.getLabel().equals(Constants.ORDERSET_RETURN_SHOP_INTEGRAL_STATUS)) {
+ systemDictData.setCode(Constants.formatIntegerNum(platformConfigDTO.getReturnShopIntegralStatus()) + "");
+ } else if (systemDictData.getLabel().equals(Constants.ORDERSET_RETURN_MEMBER_INTEGRAL)) {
+ systemDictData.setCode(Constants.formatBigdecimal(platformConfigDTO.getReturnMemberIntegral()).doubleValue() + "");
+ } else if (systemDictData.getLabel().equals(Constants.ORDERSET_RETURN_SHOP_INTEGRAL)) {
+ systemDictData.setCode(Constants.formatBigdecimal(platformConfigDTO.getReturnShopIntegral()).doubleValue() + "");
+ } else if (systemDictData.getLabel().equals(Constants.ORDERSET_TOTAL_RATE)) {
+ systemDictData.setCode(Constants.formatBigdecimal(platformConfigDTO.getTotalRate()).doubleValue() + "");
+ }
}
-
- else if(systemDictData.getLabel().equals(Constants.INTERALSET_INTEGRALINVALIDTYPE)) {
- systemDictData.setCode(Constants.formatIntegerNum(platformConfigDTO.getIntegralInvalidType()) + "");
- }else if(systemDictData.getLabel().equals(Constants.INTERALSET_INTEGRALINVALIDCIRCLE)) {
- systemDictData.setCode(Constants.formatIntegerNum(platformConfigDTO.getIntegralInvalidCircle()) + "");
- }else if(systemDictData.getLabel().equals(Constants.INTERALSET_INTEGRALRULEINFO)) {
- systemDictData.setCode(platformConfigDTO.getIntegralRuleInfo());
- }else if(systemDictData.getLabel().equals(Constants.INTERALSET_DEDUCTINTEGRALLIMIT)) {
- systemDictData.setCode(Constants.formatIntegerNum(platformConfigDTO.getDeductIntegralLimit()) + "");
- }else if(systemDictData.getLabel().equals(Constants.INTERALSET_MININTEGRALPRICELIMIT)) {
- systemDictData.setCode(Constants.formatBigdecimal(platformConfigDTO.getReturnShopIntegral()).doubleValue() + "");
+ if(StringUtils.equals(platformConfigDTO.getDictCode(),Constants.INTEGRAL_SET)){
+ if(systemDictData.getLabel().equals(Constants.INTERALSET_INTEGRALINVALIDTYPE)) {
+ systemDictData.setCode(Constants.formatIntegerNum(platformConfigDTO.getIntegralInvalidType()) + "");
+ }else if(systemDictData.getLabel().equals(Constants.INTERALSET_INTEGRALINVALIDCIRCLE)) {
+ systemDictData.setCode(Constants.formatIntegerNum(platformConfigDTO.getIntegralInvalidCircle()) + "");
+ }else if(systemDictData.getLabel().equals(Constants.INTERALSET_INTEGRALRULEINFO)) {
+ systemDictData.setCode(platformConfigDTO.getIntegralRuleInfo());
+ }else if(systemDictData.getLabel().equals(Constants.INTERALSET_DEDUCTINTEGRALLIMIT)) {
+ systemDictData.setCode(Constants.formatIntegerNum(platformConfigDTO.getDeductIntegralLimit()) + "");
+ }else if(systemDictData.getLabel().equals(Constants.INTERALSET_MININTEGRALPRICELIMIT)) {
+ systemDictData.setCode(Constants.formatBigdecimal(platformConfigDTO.getMinIntegralPriceLimit()).doubleValue() + "");
+ }
}
systemDictDataMapper.update(new UpdateWrapper<SystemDictData>().lambda()
.set(SystemDictData::getCode, systemDictData.getCode())
--
Gitblit v1.9.3