Browse Source

Merge remote-tracking branch 'origin/dev/icss' into dev/icss

wangyu 6 years ago
parent
commit
2dcc95ff2e

+ 3 - 1
icssman-service/src/main/java/com/diagbot/dto/IntroducePageDTO.java

@@ -1,5 +1,6 @@
 package com.diagbot.dto;
 
+import com.diagbot.entity.IntroduceDetail;
 import com.diagbot.entity.IntroduceInfo;
 import lombok.Getter;
 import lombok.Setter;
@@ -20,5 +21,6 @@ public class IntroducePageDTO extends IntroduceInfo {
     private Date gmtOperate;
     private String tagName;
     private List<QuestionShortDTO> questionList;
-    private List<QuestionShortDTO> unRelatedQuestionList;
+    //private List<QuestionShortDTO> unRelatedQuestionList;
+    private List<IntroduceDetail> details;
 }

+ 26 - 17
icssman-service/src/main/java/com/diagbot/facade/IntroduceInfoFacade.java

@@ -19,6 +19,7 @@ import com.diagbot.service.IntroduceMapService;
 import com.diagbot.service.impl.IntroduceInfoServiceImpl;
 import com.diagbot.util.BeanUtil;
 import com.diagbot.util.DateUtil;
+import com.diagbot.util.ListUtil;
 import com.diagbot.util.UserUtils;
 import com.diagbot.vo.IdVO;
 import com.diagbot.vo.IntroduceDetailVO;
@@ -275,26 +276,28 @@ public class IntroduceInfoFacade extends IntroduceInfoServiceImpl {
         List<IntroduceMap> introduceMapList = introduceMapFacade.list(introduceMapQueryWrapper);
 
         List<Long> questionIds = introduceMapList.stream().map(introduceMap -> introduceMap.getQuestionId()).collect(Collectors.toList());
-        QueryWrapper<QuestionInfo> questionInfoQueryWrapper = new QueryWrapper<>();
-        questionInfoQueryWrapper.in("id", questionIds).eq("is_deleted", IsDeleteEnum.N.getKey());
-        List<QuestionInfo> questionInfoList = questionFacade.list(questionInfoQueryWrapper);
+        if(ListUtil.isNotEmpty(questionIds)) {
+            QueryWrapper<QuestionInfo> questionInfoQueryWrapper = new QueryWrapper<>();
+            questionInfoQueryWrapper.in("id", questionIds).eq("is_deleted", IsDeleteEnum.N.getKey());
+            List<QuestionInfo> questionInfoList = questionFacade.list(questionInfoQueryWrapper);
 
-        List<QuestionShortDTO> questionShortDTOList = Lists.newLinkedList();
-        String tagName = "";
-        for (QuestionInfo questionInfo : questionInfoList) {
-            QuestionShortDTO questionShortDTO = new QuestionShortDTO();
-            BeanUtil.copyProperties(questionInfo, questionShortDTO);
-            questionShortDTOList.add(questionShortDTO);
-            tagName += questionInfo.getTagName() + ",";
-        }
-        if (tagName.endsWith(",")) {
-            tagName = tagName.substring(0, tagName.length() - 1);
+            List<QuestionShortDTO> questionShortDTOList = Lists.newLinkedList();
+            String tagName = "";
+            for (QuestionInfo questionInfo : questionInfoList) {
+                QuestionShortDTO questionShortDTO = new QuestionShortDTO();
+                BeanUtil.copyProperties(questionInfo, questionShortDTO);
+                questionShortDTOList.add(questionShortDTO);
+                tagName += questionInfo.getTagName() + ",";
+            }
+            if (tagName.endsWith(",")) {
+                tagName = tagName.substring(0, tagName.length() - 1);
+            }
+            introducePageDTO.setTagName(tagName);
+            introducePageDTO.setQuestionList(questionShortDTOList);
         }
-        introducePageDTO.setTagName(tagName);
-        introducePageDTO.setQuestionList(questionShortDTOList);
 
         //未关联的标签
-        QueryWrapper<QuestionInfo> unRelatedQuestionWrapper = new QueryWrapper<>();
+        /*QueryWrapper<QuestionInfo> unRelatedQuestionWrapper = new QueryWrapper<>();
         unRelatedQuestionWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
                 .eq("sub_type", 0)
                 .notIn("id", questionIds);
@@ -302,7 +305,13 @@ public class IntroduceInfoFacade extends IntroduceInfoServiceImpl {
 
         List<QuestionShortDTO> unRelatedQuestionDTOList
                 = BeanUtil.listCopyTo(unRelatedQuestionList, QuestionShortDTO.class);
-        introducePageDTO.setUnRelatedQuestionList(unRelatedQuestionDTOList);
+        introducePageDTO.setUnRelatedQuestionList(unRelatedQuestionDTOList);*/
+
+        //提示信息明细
+        QueryWrapper<IntroduceDetail> introduceDetailQueryWrapper=new QueryWrapper<>();
+        introduceDetailQueryWrapper.eq("is_deleted",IsDeleteEnum.N).eq("introduce_id",id).orderByAsc("order_no");
+        List<IntroduceDetail> introduceDetailList=introduceDetailFacade.list(introduceDetailQueryWrapper);
+        introducePageDTO.setDetails(introduceDetailList);
 
         return introducePageDTO;
     }

+ 1 - 1
icssman-service/src/main/java/com/diagbot/facade/VersionInfoFacade.java

@@ -187,7 +187,7 @@ public class VersionInfoFacade extends VersionInfoServiceImpl {
         QueryWrapper<VersionInfo> templateInfoFand = new QueryWrapper<>();
         templateInfoFand.eq("name", versionInfoVO.getName()).eq("is_deleted", IsDeleteEnum.N.getKey());
         VersionInfo dataInfo = getOne(templateInfoFand);
-        if (dataInfo != null) {
+        if (dataInfo != null && !dataInfo.getId().equals(versionInfoVO.getId())) {
             throw new CommonException(CommonErrorCode.NOT_EXISTS, "该版本号已存在");
         }
         // 3.修改版本信息

+ 1 - 0
icssman-service/src/main/resources/mapper/DeptVitalMapper.xml

@@ -40,6 +40,7 @@
           <if test="deptVitalPageVO.deptName!=null and deptVitalPageVO.deptName!=''">
               AND a.name like CONCAT("%",#{deptVitalPageVO.deptName},"%")
           </if>
+        order by gmt_modified desc
     </select>
 
 </mapper>