Переглянути джерело

字典编辑:提交后再生成编码

yucheng 3 роки тому
батько
коміт
089b311715

+ 1 - 1
dmp-business/dmp-rwd-version/src/main/java/com/persagy/dmp/rwd/demand/controller/DictionaryDemandController.java

@@ -211,7 +211,7 @@ public class DictionaryDemandController {
         wrapper.eq(cond.getCreatorCond()!=null&&1==cond.getCreatorCond(),
                 AuditableEntity.PROP_CREATOR, AppContext.getContext().getAccountId());
         // 模糊匹配
-        String matchColumn = " concat(code, '@', subject) ";
+        String matchColumn = " concat(ifnull(code, ''), '@', ifnull(subject, '')) ";
         wrapper.like(StrUtil.isNotBlank(cond.getMatchingCond()), matchColumn, cond.getMatchingCond());
         // 产线
         wrapper.in(CollUtil.isNotEmpty(cond.getProductCond()), "product_line", cond.getProductCond());

+ 5 - 2
dmp-business/dmp-rwd-version/src/main/java/com/persagy/dmp/rwd/demand/service/impl/DictionaryDemandServiceImpl.java

@@ -35,8 +35,11 @@ public class DictionaryDemandServiceImpl extends ServiceImpl<DictionaryDemandMap
         }
         vo.setValid(ValidEnum.TRUE.getType());
         saveOrUpdate(vo);
-        // 保存后,更新编码(有值就不再更新了)
-        getBaseMapper().updateMaxCode(vo.getId());
+        // 首次提交后,生成编码
+        if(BooleanUtil.isTrue(submitFlag)) {
+            // 保存后,更新编码(有值就不再更新了)
+            getBaseMapper().updateMaxCode(vo.getId());
+        }
         return getById(vo.getId());
     }