Browse Source

in代码格式化

wangfeng 5 years ago
parent
commit
92edc8f52c

+ 9 - 6
knowledgeman-service/src/main/java/com/diagbot/facade/EvaluationFacade.java

@@ -143,14 +143,17 @@ public class EvaluationFacade extends EvaluationServiceImpl {
                 regionName.add(e.getRegionName());
             }
 
-            QueryWrapper<Evaluation> evaluationQuery = new QueryWrapper<>();
+            if(ListUtil.isNotEmpty(regionName)){
+                QueryWrapper<Evaluation> evaluationQuery = new QueryWrapper<>();
 
-            evaluationQuery.in("region_name", regionName).eq("is_deleted", IsDeleteEnum.N.getKey());
-            List<Evaluation> dataUnique = list(evaluationQuery);
-            if (dataUnique != null && dataUnique.size() > 0) {
-                throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
-                        "该'" + dataUnique.get(0).getRegionName() + "'已存在");
+                evaluationQuery.in("region_name", regionName).eq("is_deleted", IsDeleteEnum.N.getKey());
+                List<Evaluation> dataUnique = list(evaluationQuery);
+                if (dataUnique != null && dataUnique.size() > 0) {
+                    throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
+                            "该'" + dataUnique.get(0).getRegionName() + "'已存在");
+                }
             }
+
             List<Evaluation> evaluationModuleLsit = new ArrayList<Evaluation>();
             List<EvaluationVO> data = evaluationModuleListVO.getEvaluationModuleData();
             Date optDate = DateUtil.now();

+ 12 - 9
knowledgeman-service/src/main/java/com/diagbot/facade/IndexConfigFacade.java

@@ -156,17 +156,20 @@ public class IndexConfigFacade extends IndexConfigServiceImpl {
                 conceptId.add(e.getConceptId());
             }
 
-            QueryWrapper<IndexConfig> IndexConfigQuery = new QueryWrapper<>();
-
-            IndexConfigQuery
-                    .eq("disease_id", indexConfigListVO.getDiseaseId())
-                    .in("concept_id", conceptId);
-            List<IndexConfig> dataUnique = list(IndexConfigQuery);
-            if (ListUtil.isNotEmpty(dataUnique)) {
-                throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
-                        "该'" + dataUnique.get(0).getConceptId() + "'已存在");
+            if(ListUtil.isNotEmpty(conceptId)){
+                QueryWrapper<IndexConfig> IndexConfigQuery = new QueryWrapper<>();
+
+                IndexConfigQuery
+                        .eq("disease_id", indexConfigListVO.getDiseaseId())
+                        .in("concept_id", conceptId);
+                List<IndexConfig> dataUnique = list(IndexConfigQuery);
+                if (ListUtil.isNotEmpty(dataUnique)) {
+                    throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
+                            "该'" + dataUnique.get(0).getConceptId() + "'已存在");
+                }
             }
 
+
             List<IndexConfig> IndexConfigLsit = new ArrayList<IndexConfig>();
             List<IndexConfigVO> data = indexConfigListVO.getIndexConfigData();
             Date optDate = DateUtil.now();