chenxiaofei 6 месяцев назад
Родитель
Сommit
2c934ce118

+ 2 - 1
sckw-modules/sckw-contract/src/main/java/com/sckw/contract/service/operateService/KwcContractLogisticsService.java

@@ -1520,7 +1520,8 @@ public class KwcContractLogisticsService {
         tradeBaseInfo.setDispatchWayDesc(DispatchingTypeEnum.getLabel(logistics.getDispatchWay()));
 
         tradeBaseInfo.setStartTime(logistics.getStartTime());
-        tradeBaseInfo.setCommonPrice(logistics.getCommonPrice());
+
+        tradeBaseInfo.setCommonPrice(logistics.getCommonPrice().compareTo(new BigDecimal("0.00"))==0 ? null: logistics.getCommonPrice());
         tradeBaseInfo.setContractStatus(String.valueOf(logistics.getStatus()));
         tradeBaseInfo.setContractStatusDesc(ContractStatusEnum.getNameByCode(logistics.getStatus()));
 

+ 1 - 2
sckw-modules/sckw-system/src/main/java/com/sckw/system/repository/SysDictRepository.java

@@ -27,11 +27,10 @@ public class SysDictRepository extends ServiceImpl<SysDictDao, SysDict> {
     /**
      * 根据条件查询唯一字典
      */
-    public SysDict selectUniqueDict(Long dictTypeId, String value, String label,String type, String parentId) {
+    public SysDict selectUniqueDict(Long dictTypeId,String label, String type, String parentId) {
         return this.getOne(Wrappers.<SysDict>lambdaQuery()
                 .eq(BaseModel::getDelFlag,0)
                 .eq(Objects.nonNull(dictTypeId),SysDict::getDictId, dictTypeId)
-                .eq(StringUtils.isNotBlank(value),SysDict::getValue, value)
                 .eq(StringUtils.isNotBlank(label),SysDict::getLabel, label)
                 .eq(StringUtils.isNotBlank( type),SysDict::getType, type)
                 .eq(StringUtils.isNotBlank(parentId),SysDict::getParentId, parentId)

+ 18 - 4
sckw-modules/sckw-system/src/main/java/com/sckw/system/service/SysDictFlexBusinessService.java

@@ -3,6 +3,7 @@ package com.sckw.system.service;
 import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.google.common.collect.Maps;
+import com.sckw.core.exception.BusinessException;
 import com.sckw.core.model.base.BaseModel;
 import com.sckw.core.utils.IdWorker;
 import com.sckw.core.web.context.LoginUserHolder;
@@ -47,15 +48,22 @@ public class SysDictFlexBusinessService {
         
         // 业务校验:检查是否存在相同的字典项
         SysDict existDict = sysDictRepository.selectUniqueDict(
-            entity.getDictId(), 
-            entity.getValue(), 
+            entity.getDictId(),
             entity.getLabel(),
             entity.getType(),
             entity.getParentId()
         );
         if (existDict != null) {
-            log.error("字典项已存在,请勿重复添加");
-            return Boolean.FALSE;
+           // return Boolean.FALSE;
+            if (StringUtils.equals(entity.getLabel(), existDict.getLabel())){
+                log.error("字典名称已存在,请勿重复添加");
+                throw new BusinessException("字典名称已存在,请勿重复添加");
+            }
+            if (StringUtils.equals(entity.getValue(), existDict.getValue())) {
+                log.error("字典项值已存在,请勿重复添加");
+                throw new BusinessException("字典项值已存在,请勿重复添加");
+            }
+
         }
         
         // 设置创建信息
@@ -111,6 +119,12 @@ public class SysDictFlexBusinessService {
         // 设置更新信息
         Long userId = LoginUserHolder.getUserId();
         SysDict sysDict = new SysDict();
+        sysDict.setDictId(entity.getDictId());
+        sysDict.setValue(entity.getValue());
+        sysDict.setLabel(entity.getLabel());
+        sysDict.setType(entity.getType());
+        sysDict.setDescription(entity.getDescription());
+        sysDict.setParentId(entity.getParentId());
         sysDict.setId(existDict.getId());
         sysDict.setSort(entity.getSort());
         sysDict.setRemark(entity.getRemark());