Bladeren bron

Merge branch 'dev/icss' into debug

gaodm 6 jaren geleden
bovenliggende
commit
262bbf4bfe
29 gewijzigde bestanden met toevoegingen van 802 en 594 verwijderingen
  1. 1 1
      icss-service/src/main/java/com/diagbot/entity/IntroduceDetail.java
  2. 2 1
      icss-service/src/main/java/com/diagbot/enums/IntroducePositionEnum.java
  3. 4 0
      icssman-service/src/main/java/com/diagbot/client/UserServiceClient.java
  4. 9 4
      icssman-service/src/main/java/com/diagbot/client/hystrix/UserServiceHystrix.java
  5. 8 8
      icssman-service/src/main/java/com/diagbot/config/ResourceServerConfigurer.java
  6. 46 40
      icssman-service/src/main/java/com/diagbot/config/security/UrlAccessDecisionManager.java
  7. 44 0
      icssman-service/src/main/java/com/diagbot/dto/GetModuleDetailInfoDTO.java
  8. 22 0
      icssman-service/src/main/java/com/diagbot/dto/GetModuleInfoOneDTO.java
  9. 1 1
      icssman-service/src/main/java/com/diagbot/entity/IntroduceDetail.java
  10. 5 0
      icssman-service/src/main/java/com/diagbot/entity/ModuleDetail.java
  11. 2 1
      icssman-service/src/main/java/com/diagbot/enums/IntroducePositionEnum.java
  12. 3 3
      icssman-service/src/main/java/com/diagbot/facade/DeptInfoFacade.java
  13. 3 18
      icssman-service/src/main/java/com/diagbot/facade/DeptVitalFacade.java
  14. 197 203
      icssman-service/src/main/java/com/diagbot/facade/DisclaimerInformationFacaed.java
  15. 25 31
      icssman-service/src/main/java/com/diagbot/facade/IntroduceInfoFacade.java
  16. 8 6
      icssman-service/src/main/java/com/diagbot/facade/ModuleDetailFacade.java
  17. 125 54
      icssman-service/src/main/java/com/diagbot/facade/ModuleInfoFacade.java
  18. 33 2
      icssman-service/src/main/java/com/diagbot/facade/QuestionFacade.java
  19. 2 2
      icssman-service/src/main/java/com/diagbot/facade/QuestionUsualFacade.java
  20. 197 194
      icssman-service/src/main/java/com/diagbot/facade/RetrievalFacade.java
  21. 1 1
      icssman-service/src/main/java/com/diagbot/facade/VersionInfoFacade.java
  22. 2 0
      icssman-service/src/main/java/com/diagbot/vo/AddModuleDetailVO.java
  23. 1 1
      icssman-service/src/main/java/com/diagbot/vo/AddModuleInfoVO.java
  24. 18 0
      icssman-service/src/main/java/com/diagbot/vo/GetModuleInfoOneVO.java
  25. 8 8
      icssman-service/src/main/java/com/diagbot/web/DisclaimerInformationController.java
  26. 4 2
      icssman-service/src/main/java/com/diagbot/web/IntroduceInfoController.java
  27. 22 6
      icssman-service/src/main/java/com/diagbot/web/ModuleInfoController.java
  28. 3 5
      icssman-service/src/main/java/com/diagbot/web/UploadController.java
  29. 6 2
      icssman-service/src/main/resources/mapper/IntroduceInfoMapper.xml

+ 1 - 1
icss-service/src/main/java/com/diagbot/entity/IntroduceDetail.java

@@ -76,7 +76,7 @@ public class IntroduceDetail implements Serializable {
     private Integer orderNo;
 
     /**
-     * 显示位置(多选):1-推送展示,2-更多展示,3-一般治疗展示,4-手术治疗展示
+     * 显示位置(多选):1-推送展示,2-更多展示,3-一般治疗展示,4-手术治疗展示,5-药品说明书
      */
     private String position;
 

+ 2 - 1
icss-service/src/main/java/com/diagbot/enums/IntroducePositionEnum.java

@@ -12,7 +12,8 @@ public enum IntroducePositionEnum implements KeyedNamed {
     Push(1, "推送展示"),
     More(2, "更多展示"),
     CommonTreatment(3, "一般治疗展示"),
-    SurgeryTreatment(4, "手术治疗展示");
+    SurgeryTreatment(4, "手术治疗展示"),
+    Drug(5, "药品说明书");
     @Setter
     private Integer key;
 

+ 4 - 0
icssman-service/src/main/java/com/diagbot/client/UserServiceClient.java

@@ -2,6 +2,7 @@ package com.diagbot.client;
 
 import com.diagbot.client.hystrix.UserServiceHystrix;
 import com.diagbot.dto.RespDTO;
+import com.diagbot.entity.Token;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
@@ -20,6 +21,9 @@ public interface UserServiceClient {
 
     @PostMapping(value = "/user/getUserInfoByIds")
     RespDTO<Map<String, String>> getUserInfoByIds(@RequestBody List<String> ids);
+
+    @PostMapping("/user/verifyToken")
+    RespDTO<Boolean> verifyToken(@RequestBody Token token);
 }
 
 

+ 9 - 4
icssman-service/src/main/java/com/diagbot/client/hystrix/UserServiceHystrix.java

@@ -2,6 +2,7 @@ package com.diagbot.client.hystrix;
 
 import com.diagbot.client.UserServiceClient;
 import com.diagbot.dto.RespDTO;
+import com.diagbot.entity.Token;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Component;
 import org.springframework.web.bind.annotation.RequestBody;
@@ -19,12 +20,16 @@ import java.util.Map;
 @Slf4j
 public class UserServiceHystrix implements UserServiceClient {
 
-	@Override
-    public RespDTO<Map<String, String>> getUserInfoByIds(@RequestBody List<String> ids){
+    @Override
+    public RespDTO<Map<String, String>> getUserInfoByIds(@RequestBody List<String> ids) {
         log.error("【hystrix】调用{}异常", "getUserInfoByIds");
         return null;
     }
 
-    
-    
+    @Override
+    public RespDTO<Boolean> verifyToken(Token token) {
+        log.error("【hystrix】调用{}异常", "verifyToken");
+        return null;
+    }
+
 }

+ 8 - 8
icssman-service/src/main/java/com/diagbot/config/ResourceServerConfigurer.java

@@ -25,14 +25,14 @@ public class ResourceServerConfigurer extends ResourceServerConfigurerAdapter {
         http
                 .csrf().disable()
                 .authorizeRequests()
-//                .regexMatchers(".*swagger.*", ".*v2.*", ".*webjars.*", "/druid.*", "/actuator.*", "/hystrix.*").permitAll()
-//                .antMatchers("/file/upload").permitAll()
-//                .antMatchers("/introduceInfo/saveIntroduce").permitAll()
-//                .antMatchers("/questionInfo/delete").permitAll()
-//                .antMatchers("/questionInfo/index").permitAll()
-//                .antMatchers("/getIcssEnumsData").permitAll()
-//                .antMatchers("/**").authenticated();
-                .antMatchers("/**").permitAll();
+                .regexMatchers(".*swagger.*", ".*v2.*", ".*webjars.*", "/druid.*", "/actuator.*", "/hystrix.*").permitAll()
+                .antMatchers("/file/deleteRemoteFile").permitAll()
+                .antMatchers("/file/uploadImage").permitAll()
+                .antMatchers("/introduceInfo/saveIntroduce").permitAll()
+                .antMatchers("/dictionaryInfo/getList").permitAll()
+                .antMatchers("/getIcssEnumsData").permitAll()
+                .antMatchers("/**").authenticated();
+//                .antMatchers("/**").permitAll();
     }
 
 

+ 46 - 40
icssman-service/src/main/java/com/diagbot/config/security/UrlAccessDecisionManager.java

@@ -1,19 +1,26 @@
 package com.diagbot.config.security;
 
 import com.diagbot.client.UserServiceClient;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.entity.Token;
+import com.diagbot.exception.CommonErrorCode;
+import com.diagbot.util.HttpUtils;
+import com.diagbot.util.StringUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.AccessDecisionManager;
 import org.springframework.security.access.AccessDeniedException;
 import org.springframework.security.access.ConfigAttribute;
+import org.springframework.security.authentication.AccountExpiredException;
 import org.springframework.security.authentication.InsufficientAuthenticationException;
 import org.springframework.security.core.Authentication;
+import org.springframework.security.core.GrantedAuthority;
+import org.springframework.security.web.FilterInvocation;
 import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
 import org.springframework.stereotype.Service;
 
 import javax.servlet.http.HttpServletRequest;
 import java.util.Collection;
 
-
 /**
  * @Description: 自定义权限拦截
  * @author: gaodm
@@ -26,40 +33,40 @@ public class UrlAccessDecisionManager implements AccessDecisionManager {
 
     @Override
     public void decide(Authentication authentication, Object object, Collection<ConfigAttribute> configAttributes) throws AccessDeniedException, InsufficientAuthenticationException {
-//        HttpServletRequest request = ((FilterInvocation) object).getHttpRequest();
-//        String url, method;
-//        if (matchPermitAllUrl(request)) {
-//            return;
-//        }
-//        if ("anonymousUser".equals(authentication.getPrincipal())) {
-//            throw new AccessDeniedException("no right");
-//        } else {
-//            //验证token有效性
-//            String tokenStr = HttpUtils.getHeaders(request).get("Authorization");
-//            if (StringUtil.isNotEmpty(tokenStr)) {
-//                Token token = new Token();
-//                tokenStr = tokenStr.replaceFirst("Bearer ", "");
-//                token.setToken(tokenStr);
-//                RespDTO<Boolean> res = userServiceClient.verifyToken(token);
-//                if (res == null || !CommonErrorCode.OK.getCode().equals(res.code)) {
-//                    throw new AccountExpiredException("token expire");
-//                }
-//                if (!res.data) {
-//                    throw new AccountExpiredException("token expire");
-//                }
-//            }
-//            for (GrantedAuthority ga : authentication.getAuthorities()) {
-//                String[] authority = ga.getAuthority().split(";");
-//                url = authority[0];
-//                method = authority[1];
-//                if (matchers(url, request)) {
-//                    if (method.equals(request.getMethod()) || "ALL".equals(method)) {
-//                        return;
-//                    }
-//                }
-//            }
-//        }
-//        throw new AccessDeniedException("no right");
+        HttpServletRequest request = ((FilterInvocation) object).getHttpRequest();
+        String url, method;
+        if (matchPermitAllUrl(request)) {
+            return;
+        }
+        if ("anonymousUser".equals(authentication.getPrincipal())) {
+            throw new AccessDeniedException("no right");
+        } else {
+            //验证token有效性
+            String tokenStr = HttpUtils.getHeaders(request).get("Authorization");
+            if (StringUtil.isNotEmpty(tokenStr)) {
+                Token token = new Token();
+                tokenStr = tokenStr.replaceFirst("Bearer ", "");
+                token.setToken(tokenStr);
+                RespDTO<Boolean> res = userServiceClient.verifyToken(token);
+                if (res == null || !CommonErrorCode.OK.getCode().equals(res.code)) {
+                    throw new AccountExpiredException("token expire");
+                }
+                if (!res.data) {
+                    throw new AccountExpiredException("token expire");
+                }
+            }
+            for (GrantedAuthority ga : authentication.getAuthorities()) {
+                String[] authority = ga.getAuthority().split(";");
+                url = authority[0];
+                method = authority[1];
+                if (matchers(url, request)) {
+                    if (method.equals(request.getMethod()) || "ALL".equals(method)) {
+                        return;
+                    }
+                }
+            }
+        }
+        throw new AccessDeniedException("no right");
     }
 
 
@@ -73,7 +80,7 @@ public class UrlAccessDecisionManager implements AccessDecisionManager {
         return true;
     }
 
-    private Boolean matchPermitAllUrl(HttpServletRequest request){
+    private Boolean matchPermitAllUrl(HttpServletRequest request) {
         if (matchers("/swagger/**", request)
                 || matchers("/v2/**", request)
                 || matchers("/swagger-ui.html/**", request)
@@ -82,11 +89,10 @@ public class UrlAccessDecisionManager implements AccessDecisionManager {
                 || matchers("/druid/**", request)
                 || matchers("/actuator/**", request)
                 || matchers("/hystrix/**", request)
-                || matchers("/file/upload", request)
+                || matchers("/file/deleteRemoteFile", request)
+                || matchers("/file/uploadImage", request)
                 || matchers("/getIcssEnumsData", request)
-                || matchers("introduceInfo/saveIntroduce", request)
-                || matchers("/questionInfo/delete", request)
-                || matchers("/questionInfo/index", request)
+                || matchers("/dictionaryInfo/getList", request)
                 || matchers("/", request)) {
             return true;
         }

+ 44 - 0
icssman-service/src/main/java/com/diagbot/dto/GetModuleDetailInfoDTO.java

@@ -0,0 +1,44 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @author: wangyu
+ * @time: 2018/12/28 13:35
+ */
+@Setter
+@Getter
+public class GetModuleDetailInfoDTO {
+
+    /**
+     * 前置内容
+     */
+    private String prefix;
+
+    /**
+     * 后置内容
+     */
+    private String suffix;
+
+    /**
+     * questionId
+     */
+    private Long questionId;
+
+    /**
+     * 标签名
+     */
+    private String tagName;
+
+    /**
+     * 关联模板
+     */
+    private Long relationModule;
+
+    /**
+     * 子模板名称
+     */
+    private String relationModuleName;
+}

+ 22 - 0
icssman-service/src/main/java/com/diagbot/dto/GetModuleInfoOneDTO.java

@@ -0,0 +1,22 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @author: wangyu
+ * @time: 2018/12/28 17:11
+ */
+@Setter
+@Getter
+public class GetModuleInfoOneDTO {
+    //模板id
+    private Long id;
+    //模板名称
+    private String name;
+    //模板类型
+    private Integer type;
+    //归属名称
+    private String ascriptionName;
+}

+ 1 - 1
icssman-service/src/main/java/com/diagbot/entity/IntroduceDetail.java

@@ -76,7 +76,7 @@ public class IntroduceDetail implements Serializable {
     private Integer orderNo;
 
     /**
-     * 显示位置(多选):1-推送展示,2-更多展示,3-一般治疗展示,4-手术治疗展示
+     * 显示位置(多选):1-推送展示,2-更多展示,3-一般治疗展示,4-手术治疗展示,5-药品说明书
      */
     private String position;
 

+ 5 - 0
icssman-service/src/main/java/com/diagbot/entity/ModuleDetail.java

@@ -75,6 +75,11 @@ public class ModuleDetail implements Serializable {
      */
     private Long questionId;
 
+    /**
+     * 关联模板
+     */
+    private Long relationModule;
+
     /**
      * 排序号
      */

+ 2 - 1
icssman-service/src/main/java/com/diagbot/enums/IntroducePositionEnum.java

@@ -12,7 +12,8 @@ public enum IntroducePositionEnum implements KeyedNamed {
     Push(1, "推送展示"),
     More(2, "更多展示"),
     CommonTreatment(3, "一般治疗展示"),
-    SurgeryTreatment(4, "手术治疗展示");
+    SurgeryTreatment(4, "手术治疗展示"),
+    Drug(5, "药品说明书");
 
     @Setter
     private Integer key;

+ 3 - 3
icssman-service/src/main/java/com/diagbot/facade/DeptInfoFacade.java

@@ -74,7 +74,7 @@ public class DeptInfoFacade extends DeptInfoServiceImpl {
     public Boolean updateDeptInfo(UpdateDeptInfoVO updateDeptInfoVO) {
         //判断科室是否已被删除
         if(deptInfoIsDeletedStatus(updateDeptInfoVO.getId())){
-            throw new CommonException(CommonErrorCode.RPC_ERROR,
+            throw new CommonException(CommonErrorCode.NOT_EXISTS,
                     "科室已删除");
         }
         //修改操作
@@ -95,7 +95,7 @@ public class DeptInfoFacade extends DeptInfoServiceImpl {
     public Boolean deleteDeptInfo(DeleteDeptInfoVO deleteDeptInfoVO) {
         //判断科室是否已被删除
         if(deptInfoIsDeletedStatus(deleteDeptInfoVO.getId())){
-            throw new CommonException(CommonErrorCode.RPC_ERROR,
+            throw new CommonException(CommonErrorCode.NOT_EXISTS,
                     "科室已删除");
         }
         //删除操作
@@ -156,7 +156,7 @@ public class DeptInfoFacade extends DeptInfoServiceImpl {
                     .eq("id",getDeptInfoDetialsVO.getId());
         DeptInfo deptInfo = this.getOne(queryWrapper);
         if(deptInfo == null){
-            throw new CommonException(CommonErrorCode.RPC_ERROR,
+            throw new CommonException(CommonErrorCode.NOT_EXISTS,
                     "科室信息不存在");
         }
         return deptInfo;

+ 3 - 18
icssman-service/src/main/java/com/diagbot/facade/DeptVitalFacade.java

@@ -160,12 +160,7 @@ public class DeptVitalFacade extends DeptVitalServiceImpl {
                 .map(deptVitals -> deptVitals.getVitalId())
                 .collect(Collectors.toList());
         List<QuestionInfo> vitalList = Lists.newArrayList(questionFacade.listByIds(vitalIds));
-        List<QuestionShortDTO> vitals = Lists.newArrayList();
-        for (QuestionInfo questionInfo : vitalList) {
-            QuestionShortDTO questionShortDTO = new QuestionShortDTO();
-            BeanUtil.copyProperties(questionInfo, questionShortDTO);
-            vitals.add(questionShortDTO);
-        }
+        List<QuestionShortDTO> vitals = BeanUtil.listCopyTo(vitalList, QuestionShortDTO.class);
         deptVitalDTO.setVitals(vitals);
 
         //未关联查体
@@ -175,12 +170,7 @@ public class DeptVitalFacade extends DeptVitalServiceImpl {
                 notIn("id", vitalIds).
                 eq("type", QuestionTypeEnum.Vital.getKey());
         List<QuestionInfo> unSelectedVitalList = questionFacade.list(unSelectedVitalQueryWrapper);
-        List<QuestionShortDTO> unSelectedVitals = Lists.newArrayList();
-        for (QuestionInfo questionInfo : unSelectedVitalList) {
-            QuestionShortDTO questionShortDTO = new QuestionShortDTO();
-            BeanUtil.copyProperties(questionInfo, questionShortDTO);
-            unSelectedVitals.add(questionShortDTO);
-        }
+        List<QuestionShortDTO> unSelectedVitals = BeanUtil.listCopyTo(unSelectedVitalList, QuestionShortDTO.class);
         deptVitalDTO.setUnSelectedVitals(unSelectedVitals);
         return deptVitalDTO;
     }
@@ -213,16 +203,11 @@ public class DeptVitalFacade extends DeptVitalServiceImpl {
      * @return
      */
     public List<DeptShortDTO> getDeptShortList(List<Long> deptIds) {
-        List<DeptShortDTO> deptShortDTOList = Lists.newLinkedList();
         QueryWrapper<DeptInfo> deptInfoQueryWrapper = new QueryWrapper<>();
         deptInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey()).
                 notIn("id", deptIds);
         List<DeptInfo> deptInfoList = deptInfoFacade.list(deptInfoQueryWrapper);
-        for (DeptInfo deptInfo : deptInfoList) {
-            DeptShortDTO deptShortDTO = new DeptShortDTO();
-            BeanUtil.copyProperties(deptInfo, deptShortDTO);
-            deptShortDTOList.add(deptShortDTO);
-        }
+        List<DeptShortDTO> deptShortDTOList = BeanUtil.listCopyTo(deptInfoList, DeptShortDTO.class);
         return deptShortDTOList;
     }
 

+ 197 - 203
icssman-service/src/main/java/com/diagbot/facade/DisclaimerInformationFacaed.java

@@ -1,203 +1,197 @@
-package com.diagbot.facade;
-
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.diagbot.client.UserServiceClient;
-import com.diagbot.dto.DisclaimerInformationDTO;
-import com.diagbot.dto.RespDTO;
-import com.diagbot.entity.DisclaimerInformation;
-import com.diagbot.enums.IsDeleteEnum;
-import com.diagbot.enums.StatusEnum;
-import com.diagbot.exception.CommonErrorCode;
-import com.diagbot.exception.CommonException;
-import com.diagbot.service.impl.DisclaimerInformationServiceImpl;
-import com.diagbot.util.DateUtil;
-import com.diagbot.util.UserUtils;
-import com.diagbot.vo.DisclaimerInformationAllVO;
-import com.diagbot.vo.DisclaimerInformationIdVO;
-import com.diagbot.vo.DisclaimerInformationVO;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
-
-/**
- * @author wangfeng
- * @Description: TODO
- * @date 2018年11月21日 下午4:25:48
- */
-@Component
-public class DisclaimerInformationFacaed extends DisclaimerInformationServiceImpl {
-
-    @Autowired
-    UserServiceClient userServiceClient;
-
-    
-    /**
-     * 分页查询免责声明
-     * @param page
-     * @param title
-     * @return
-     */
-    public List<DisclaimerInformationDTO> getDisclaimerInformation(Page page, String title) {
-
-        DisclaimerInformationAllVO disAll = new DisclaimerInformationAllVO();
-        disAll.setTitle(title);
-        IPage<DisclaimerInformationDTO> querDisclaimerInformation = getDisclaimerInformationAll(page, disAll);
-        List<DisclaimerInformationDTO> data = querDisclaimerInformation.getRecords();
-
-        List<String> modifierid = new ArrayList<>();
-        modifierid = data.stream().map(ac -> ac.getModifier()).collect(Collectors.toList());
-
-        Map<String, String> userNames = new HashMap<>();
-        if (modifierid.size() > 0) {
-            RespDTO<Map<String, String>> userNamesDTO = userServiceClient.getUserInfoByIds(modifierid);
-            if (userNamesDTO == null || !CommonErrorCode.OK.getCode().equals(userNamesDTO.code)) {
-                throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
-                        "获取所有用户信息失败");
-            }
-            userNames = userNamesDTO.data;
-        }
-
-
-        List<DisclaimerInformationDTO> dataNew = new ArrayList<DisclaimerInformationDTO>();
-        for (DisclaimerInformationDTO disclaimerInformationDTO : data) {
-            DisclaimerInformationDTO dis = new DisclaimerInformationDTO();
-            dis.setId(disclaimerInformationDTO.getId());
-            dis.setDescription(disclaimerInformationDTO.getDescription());
-            dis.setDisclaimerCode(disclaimerInformationDTO.getDisclaimerCode());
-            dis.setGmtCreate(disclaimerInformationDTO.getGmtCreate());
-            dis.setModifier(userNames.get(disclaimerInformationDTO.getModifier()));
-            dis.setOrderNo(disclaimerInformationDTO.getOrderNo());
-            dis.setRemark(disclaimerInformationDTO.getRemark());
-            dis.setStatus(disclaimerInformationDTO.getStatus());
-            dis.setTitle(disclaimerInformationDTO.getTitle());
-            //dis.setVersionId(disclaimerInformationDTO.getVersionId());
-
-            dataNew.add(dis);
-        }
-        return dataNew;
-    }
-
-    /**
-     * 增加
-     *
-     * @return
-     */
-    public Boolean addDisclaimerInformation(DisclaimerInformationVO disclaimerInformationVO) {
-        DisclaimerInformation disclaimerInformation = new DisclaimerInformation();
-        disclaimerInformation.setCreator(UserUtils.getCurrentPrincipleID());
-        disclaimerInformation.setModifier(UserUtils.getCurrentPrincipleID());
-        disclaimerInformation.setDescription(disclaimerInformationVO.getDescription());
-        disclaimerInformation.setDisclaimerCode(disclaimerInformationVO.getDisclaimerCode());
-        disclaimerInformation.setGmtCreate(DateUtil.now());
-        disclaimerInformation.setGmtModified(DateUtil.now());
-        disclaimerInformation.setOrderNo(disclaimerInformationVO.getOrderNo());
-        disclaimerInformation.setRemark(disclaimerInformationVO.getRemark());
-        disclaimerInformation.setStatus(String.valueOf(StatusEnum.Enable.getKey()));
-        disclaimerInformation.setTitle(disclaimerInformationVO.getTitle());
-        //disclaimerInformation.setVersionId();
-
-        boolean res = save(disclaimerInformation);
-
-        return res;
-    }
-
-    /**
-     * 修改
-     *
-     * @return
-     */
-    public Boolean updateDisclaimerInformation(DisclaimerInformationAllVO disclaimerInformationAllVO) {
-        // 1.先判断数据是否存在有效
-        checkExist(disclaimerInformationAllVO.getId());
-        // 2.修改版本详情信息
-        DisclaimerInformation disclaimerInformation = new DisclaimerInformation();
-
-        disclaimerInformation.setGmtModified(DateUtil.now());// 修改时间
-        disclaimerInformation.setModifier(UserUtils.getCurrentPrincipleID());
-        disclaimerInformation.setDescription(disclaimerInformationAllVO.getDescription());
-        disclaimerInformation.setDisclaimerCode(disclaimerInformationAllVO.getDisclaimerCode());
-        disclaimerInformation.setGmtCreate(DateUtil.now());
-        disclaimerInformation.setId(disclaimerInformationAllVO.getId());
-        disclaimerInformation.setOrderNo(disclaimerInformationAllVO.getOrderNo());
-        disclaimerInformation.setRemark(disclaimerInformationAllVO.getRemark());
-        disclaimerInformation.setStatus(String.valueOf(StatusEnum.Enable.getKey()));
-        disclaimerInformation.setTitle(disclaimerInformationAllVO.getTitle());
-        disclaimerInformation.setVersionId(0L);
-
-        boolean res = updateById(disclaimerInformation);
-
-        if (!res) {
-            throw new CommonException(CommonErrorCode.UPDATE_INFO_FAIL);
-        }
-
-        return res;
-    }
-
-    /**
-     * 删除
-     *
-     * @return
-     */
-    public Boolean cancelDisclaimerInformation(DisclaimerInformationIdVO disclaimerInformationIdVO) {
-        // 1.先判断数据是否存在有效
-        checkExist(disclaimerInformationIdVO.getId());
-        UpdateWrapper<DisclaimerInformation> disclaimerInformationNew = new UpdateWrapper<>();
-        disclaimerInformationNew.in("id", disclaimerInformationIdVO.getId()).eq("is_deleted", IsDeleteEnum.N.getKey())
-                .set("is_deleted", IsDeleteEnum.Y.getKey()).set("modifier", UserUtils.getCurrentPrincipleID())
-                .set("gmt_modified", DateUtil.now());
-        return update(new DisclaimerInformation(), disclaimerInformationNew);
-    }
-
-    /**
-     * 启用
-     *
-     * @return
-     */
-    public boolean startDisclaimerInformations(DisclaimerInformationIdVO disclaimerInformationIdVO) {
-        // 1.先判断数据是否存在有效
-        checkExist(disclaimerInformationIdVO.getId());
-        UpdateWrapper<DisclaimerInformation> disclaimerInformationNew = new UpdateWrapper<>();
-        disclaimerInformationNew.in("id", disclaimerInformationIdVO.getId()).eq("is_deleted", IsDeleteEnum.N.getKey())
-                .eq("status", StatusEnum.Disable.getKey()).set("modifier", UserUtils.getCurrentPrincipleID())
-                .set("gmt_modified", DateUtil.now()).set("status", StatusEnum.Enable.getKey());
-        return update(new DisclaimerInformation(), disclaimerInformationNew);
-    }
-
-    /**
-     * 停用
-     *
-     * @return
-     */
-    public boolean endDisclaimerInformations(DisclaimerInformationIdVO disclaimerInformationIdVO) {
-        // 1.先判断数据是否存在有效
-        checkExist(disclaimerInformationIdVO.getId());
-        UpdateWrapper<DisclaimerInformation> disclaimerInformationNew = new UpdateWrapper<>();
-        disclaimerInformationNew.in("id", disclaimerInformationIdVO.getId()).eq("is_deleted", IsDeleteEnum.N.getKey())
-                .eq("status", StatusEnum.Enable.getKey()).set("modifier", UserUtils.getCurrentPrincipleID())
-                .set("gmt_modified", DateUtil.now()).set("status", StatusEnum.Disable.getKey());
-        return update(new DisclaimerInformation(), disclaimerInformationNew);
-    }
-
-    /**
-     * 判断数据是否存在有效
-     *
-     * @param id
-     */
-    private void checkExist(Long id) {
-        QueryWrapper<DisclaimerInformation> disclaimerInformationFand = new QueryWrapper<>();
-        disclaimerInformationFand.eq("is_deleted", IsDeleteEnum.N.getKey()).eq("id", id);
-        int sum = count(disclaimerInformationFand);
-        if (sum == 0) {
-            throw new CommonException(CommonErrorCode.NOT_EXISTS, "该数据不存在");
-        }
-    }
-
-}
+package com.diagbot.facade;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.diagbot.client.UserServiceClient;
+import com.diagbot.dto.DisclaimerInformationDTO;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.entity.DisclaimerInformation;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.enums.StatusEnum;
+import com.diagbot.exception.CommonErrorCode;
+import com.diagbot.exception.CommonException;
+import com.diagbot.service.impl.DisclaimerInformationServiceImpl;
+import com.diagbot.util.BeanUtil;
+import com.diagbot.util.DateUtil;
+import com.diagbot.util.ListUtil;
+import com.diagbot.util.UserUtils;
+import com.diagbot.vo.DisclaimerInformationAllVO;
+import com.diagbot.vo.DisclaimerInformationIdVO;
+import com.diagbot.vo.DisclaimerInformationVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ * @author wangfeng
+ * @Description: TODO
+ * @date 2018年11月21日 下午4:25:48
+ */
+@Component
+public class DisclaimerInformationFacade extends DisclaimerInformationServiceImpl {
+
+    @Autowired
+    UserServiceClient userServiceClient;
+
+    
+    /**
+     * 分页查询免责声明
+     * @param page
+     * @param title
+     * @return
+     */
+    public List<DisclaimerInformationDTO> getDisclaimerInformation(Page page, String title) {
+
+        DisclaimerInformationAllVO disAll = new DisclaimerInformationAllVO();
+        disAll.setTitle(title);
+        IPage<DisclaimerInformationDTO> querDisclaimerInformation = getDisclaimerInformationAll(page, disAll);
+        List<DisclaimerInformationDTO> data = querDisclaimerInformation.getRecords();
+
+        List<String> modifierid = new ArrayList<>();
+        modifierid = data.stream().map(ac -> ac.getModifier()).collect(Collectors.toList());
+
+        Map<String, String> userNames = new HashMap<>();
+        if (ListUtil.isNotEmpty(modifierid)) {
+            RespDTO<Map<String, String>> userNamesDTO = userServiceClient.getUserInfoByIds(modifierid);
+            if (userNamesDTO == null || !CommonErrorCode.OK.getCode().equals(userNamesDTO.code)) {
+                throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
+                        "获取所有用户信息失败");
+            }
+            userNames = userNamesDTO.data;
+        }
+
+
+        List<DisclaimerInformationDTO> dataNew = new ArrayList<DisclaimerInformationDTO>();
+        for (DisclaimerInformationDTO disclaimerInformationDTO : data) {
+            DisclaimerInformationDTO dis = new DisclaimerInformationDTO();
+            BeanUtil.copyProperties(disclaimerInformationDTO, dis);
+            dis.setModifier(userNames.get(disclaimerInformationDTO.getModifier()));
+
+            dataNew.add(dis);
+        }
+        return dataNew;
+    }
+
+    /**
+     * 增加
+     *
+     * @return
+     */
+    public Boolean addDisclaimerInformation(DisclaimerInformationVO disclaimerInformationVO) {
+        DisclaimerInformation disclaimerInformation = new DisclaimerInformation();
+        disclaimerInformation.setCreator(UserUtils.getCurrentPrincipleID());
+        disclaimerInformation.setModifier(UserUtils.getCurrentPrincipleID());
+        disclaimerInformation.setDescription(disclaimerInformationVO.getDescription());
+        disclaimerInformation.setDisclaimerCode(disclaimerInformationVO.getDisclaimerCode());
+        disclaimerInformation.setGmtCreate(DateUtil.now());
+        disclaimerInformation.setGmtModified(DateUtil.now());
+        disclaimerInformation.setOrderNo(disclaimerInformationVO.getOrderNo());
+        disclaimerInformation.setRemark(disclaimerInformationVO.getRemark());
+        disclaimerInformation.setStatus(String.valueOf(StatusEnum.Enable.getKey()));
+        disclaimerInformation.setTitle(disclaimerInformationVO.getTitle());
+        //disclaimerInformation.setVersionId();
+
+        boolean res = save(disclaimerInformation);
+
+        return res;
+    }
+
+    /**
+     * 修改
+     *
+     * @return
+     */
+    public Boolean updateDisclaimerInformation(DisclaimerInformationAllVO disclaimerInformationAllVO) {
+        // 1.先判断数据是否存在有效
+        checkExist(disclaimerInformationAllVO.getId());
+        // 2.修改版本详情信息
+        DisclaimerInformation disclaimerInformation = new DisclaimerInformation();
+
+        disclaimerInformation.setGmtModified(DateUtil.now());// 修改时间
+        disclaimerInformation.setModifier(UserUtils.getCurrentPrincipleID());
+        disclaimerInformation.setDescription(disclaimerInformationAllVO.getDescription());
+        disclaimerInformation.setDisclaimerCode(disclaimerInformationAllVO.getDisclaimerCode());
+        disclaimerInformation.setGmtCreate(DateUtil.now());
+        disclaimerInformation.setId(disclaimerInformationAllVO.getId());
+        disclaimerInformation.setOrderNo(disclaimerInformationAllVO.getOrderNo());
+        disclaimerInformation.setRemark(disclaimerInformationAllVO.getRemark());
+        disclaimerInformation.setStatus(String.valueOf(StatusEnum.Enable.getKey()));
+        disclaimerInformation.setTitle(disclaimerInformationAllVO.getTitle());
+        disclaimerInformation.setVersionId(0L);
+
+        boolean res = updateById(disclaimerInformation);
+
+        if (!res) {
+            throw new CommonException(CommonErrorCode.UPDATE_INFO_FAIL);
+        }
+
+        return res;
+    }
+
+    /**
+     * 删除
+     *
+     * @return
+     */
+    public Boolean cancelDisclaimerInformation(DisclaimerInformationIdVO disclaimerInformationIdVO) {
+        // 1.先判断数据是否存在有效
+        checkExist(disclaimerInformationIdVO.getId());
+        UpdateWrapper<DisclaimerInformation> disclaimerInformationNew = new UpdateWrapper<>();
+        disclaimerInformationNew.in("id", disclaimerInformationIdVO.getId()).eq("is_deleted", IsDeleteEnum.N.getKey())
+                .set("is_deleted", IsDeleteEnum.Y.getKey()).set("modifier", UserUtils.getCurrentPrincipleID())
+                .set("gmt_modified", DateUtil.now());
+        return update(new DisclaimerInformation(), disclaimerInformationNew);
+    }
+
+    /**
+     * 启用
+     *
+     * @return
+     */
+    public boolean startDisclaimerInformations(DisclaimerInformationIdVO disclaimerInformationIdVO) {
+        // 1.先判断数据是否存在有效
+        checkExist(disclaimerInformationIdVO.getId());
+        UpdateWrapper<DisclaimerInformation> disclaimerInformationNew = new UpdateWrapper<>();
+        disclaimerInformationNew.in("id", disclaimerInformationIdVO.getId()).eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("status", StatusEnum.Disable.getKey()).set("modifier", UserUtils.getCurrentPrincipleID())
+                .set("gmt_modified", DateUtil.now()).set("status", StatusEnum.Enable.getKey());
+        return update(new DisclaimerInformation(), disclaimerInformationNew);
+    }
+
+    /**
+     * 停用
+     *
+     * @return
+     */
+    public boolean endDisclaimerInformations(DisclaimerInformationIdVO disclaimerInformationIdVO) {
+        // 1.先判断数据是否存在有效
+        checkExist(disclaimerInformationIdVO.getId());
+        UpdateWrapper<DisclaimerInformation> disclaimerInformationNew = new UpdateWrapper<>();
+        disclaimerInformationNew.in("id", disclaimerInformationIdVO.getId()).eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("status", StatusEnum.Enable.getKey()).set("modifier", UserUtils.getCurrentPrincipleID())
+                .set("gmt_modified", DateUtil.now()).set("status", StatusEnum.Disable.getKey());
+        return update(new DisclaimerInformation(), disclaimerInformationNew);
+    }
+
+    /**
+     * 判断数据是否存在有效
+     *
+     * @param id
+     */
+    private void checkExist(Long id) {
+        QueryWrapper<DisclaimerInformation> disclaimerInformationFand = new QueryWrapper<>();
+        disclaimerInformationFand.eq("is_deleted", IsDeleteEnum.N.getKey()).eq("id", id);
+        int sum = count(disclaimerInformationFand);
+        if (sum == 0) {
+            throw new CommonException(CommonErrorCode.NOT_EXISTS, "该数据不存在");
+        }
+    }
+
+}

+ 25 - 31
icssman-service/src/main/java/com/diagbot/facade/IntroduceInfoFacade.java

@@ -64,22 +64,20 @@ public class IntroduceInfoFacade extends IntroduceInfoServiceImpl {
      */
     public Boolean saveIntroduce(IntroduceVO introduceVO) {
         IntroduceInfo introduceInfo = new IntroduceInfo();
-        if (!(introduceVO.getId() == null || introduceInfo.getId().equals(0))) {
+        Date now = DateUtil.now();
+        String userId = UserUtils.getCurrentPrincipleID();
+        if (!(introduceVO.getId() == null || introduceVO.getId().equals(0L))) {
             introduceInfo = this.getById(introduceVO.getId());
             if (introduceInfo == null) {
                 throw new CommonException(CommonErrorCode.NOT_EXISTS, "提示信息不存在");
             } else if (introduceInfo.getIsDeleted().equals(IsDeleteEnum.Y.getKey())) {
                 throw new CommonException(CommonErrorCode.NOT_EXISTS, "提示信息已删除");
-            } else {
-                introduceInfo.setModifier(UserUtils.getCurrentPrincipleID());
-                introduceInfo.setGmtModified(DateUtil.now());
             }
+        } else {
+            introduceInfo.setCreator(userId);
+            introduceInfo.setGmtCreate(now);
         }
 
-        Date now = DateUtil.now();
-        String userId = UserUtils.getCurrentPrincipleID();
-        introduceInfo.setCreator(userId);
-        introduceInfo.setGmtCreate(now);
         introduceInfo.setModifier(userId);
         introduceInfo.setGmtModified(now);
         introduceInfo.setName(introduceVO.getName());
@@ -90,15 +88,14 @@ public class IntroduceInfoFacade extends IntroduceInfoServiceImpl {
 
         //明细信息不更新,每次都删除重新插入
         //删除已有明细,逻辑删除
-        if (!(introduceInfo.getId() == null)) {
-            UpdateWrapper<IntroduceDetail> detailUpdateWrapper = new UpdateWrapper<>();
-            detailUpdateWrapper.eq("introduce_id", introduceInfo.getId()).
-                    eq("is_deleted", IsDeleteEnum.N.getKey()).
-                    set("is_deleted", IsDeleteEnum.Y.getKey()).
-                    set("modifier", UserUtils.getCurrentPrincipleID()).
-                    set("gmt_modified", DateUtil.now());
-            introduceDetailFacade.update(new IntroduceDetail(), detailUpdateWrapper);
-        }
+        UpdateWrapper<IntroduceDetail> detailUpdateWrapper = new UpdateWrapper<>();
+        detailUpdateWrapper.eq("introduce_id", introduceInfo.getId()).
+                eq("is_deleted", IsDeleteEnum.N.getKey()).
+                set("is_deleted", IsDeleteEnum.Y.getKey()).
+                set("modifier", userId).
+                set("gmt_modified", now);
+        introduceDetailFacade.update(new IntroduceDetail(), detailUpdateWrapper);
+
         List<IntroduceDetail> introduceDetailList = Lists.newArrayList();
         for (IntroduceDetailVO detailVO : introduceVO.getDetailVOList()) {
             IntroduceDetail detail = new IntroduceDetail();
@@ -296,14 +293,13 @@ public class IntroduceInfoFacade extends IntroduceInfoServiceImpl {
 
         //未关联的标签
         QueryWrapper<QuestionInfo> unRelatedQuestionWrapper = new QueryWrapper<>();
-        unRelatedQuestionWrapper.eq("is_deleted", IsDeleteEnum.N.getKey()).notIn("id", questionIds);
+        unRelatedQuestionWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("sub_type", 0)
+                .notIn("id", questionIds);
         List<QuestionInfo> unRelatedQuestionList = questionFacade.list(unRelatedQuestionWrapper);
-        List<QuestionShortDTO> unRelatedQuestionDTOList = Lists.newLinkedList();
-        for (QuestionInfo questionInfo : unRelatedQuestionList) {
-            QuestionShortDTO questionShortDTO = new QuestionShortDTO();
-            BeanUtil.copyProperties(questionInfo, questionShortDTO);
-            unRelatedQuestionDTOList.add(questionShortDTO);
-        }
+
+        List<QuestionShortDTO> unRelatedQuestionDTOList
+                = BeanUtil.listCopyTo(unRelatedQuestionList, QuestionShortDTO.class);
         introducePageDTO.setUnRelatedQuestionList(unRelatedQuestionDTOList);
 
         return introducePageDTO;
@@ -316,14 +312,12 @@ public class IntroduceInfoFacade extends IntroduceInfoServiceImpl {
      */
     public List<QuestionShortDTO> getAllQuestionList() {
         QueryWrapper<QuestionInfo> unRelatedQuestionWrapper = new QueryWrapper<>();
-        unRelatedQuestionWrapper.eq("is_deleted", IsDeleteEnum.N.getKey());
+        unRelatedQuestionWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("sub_type", 0);
         List<QuestionInfo> unRelatedQuestionList = questionFacade.list(unRelatedQuestionWrapper);
-        List<QuestionShortDTO> unRelatedQuestionDTOList = Lists.newLinkedList();
-        for (QuestionInfo questionInfo : unRelatedQuestionList) {
-            QuestionShortDTO questionShortDTO = new QuestionShortDTO();
-            BeanUtil.copyProperties(questionInfo, questionShortDTO);
-            unRelatedQuestionDTOList.add(questionShortDTO);
-        }
+
+        List<QuestionShortDTO> unRelatedQuestionDTOList
+                = BeanUtil.listCopyTo(unRelatedQuestionList, QuestionShortDTO.class);
         return unRelatedQuestionDTOList;
     }
 }

+ 8 - 6
icssman-service/src/main/java/com/diagbot/facade/ModuleDetailFacade.java

@@ -11,6 +11,7 @@ import com.diagbot.service.QuestionInfoService;
 import com.diagbot.service.impl.ModuleDetailServiceImpl;
 import com.diagbot.util.DateUtil;
 import com.diagbot.util.StringUtil;
+import com.diagbot.util.UserUtils;
 import com.diagbot.vo.AddModuleDetailVO;
 import com.diagbot.vo.AddModuleInfoVO;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -69,14 +70,14 @@ public class ModuleDetailFacade extends ModuleDetailServiceImpl {
      * @return
      */
     public Boolean saveOrUpdateInfos(AddModuleInfoVO addModuleInfoVO,Long moduleId){
-        /*String userId = UserUtils.getCurrentPrincipleID();*/
+        String userId = UserUtils.getCurrentPrincipleID();
         Date now = DateUtil.now();
         //如果该模板添加过明细,先删除
         UpdateWrapper<ModuleDetail> moduleDetailUpdateWrapper = new UpdateWrapper<>();
         moduleDetailUpdateWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
                 .eq("module_id",moduleId)
                 .set("is_deleted",IsDeleteEnum.Y.getKey())
-                .set("modifier","1"/*userId*/)
+                .set("modifier",userId)
                 .set("gmt_modified",now);
         this.update(new ModuleDetail(),moduleDetailUpdateWrapper);
         //查询自定义标签的id
@@ -104,8 +105,8 @@ public class ModuleDetailFacade extends ModuleDetailServiceImpl {
                 addModuleDetailVO.setQuestionId(questionIdMap.get(addModuleDetailVO.getText()));
                 if(addModuleDetailVO.getQuestionId() == null){
                     addquestionInfo = new QuestionInfo();
-                    addquestionInfo.setModifier("1");
-                    addquestionInfo.setCreator("1");
+                    addquestionInfo.setModifier(userId);
+                    addquestionInfo.setCreator(userId);
                     addquestionInfo.setGmtCreate(now);
                     addquestionInfo.setGmtModified(now);
                     addquestionInfo.setTagType(TagTypeEnum.T8.getKey());
@@ -133,11 +134,12 @@ public class ModuleDetailFacade extends ModuleDetailServiceImpl {
         for(int i = 0; i < addModuleInfoVO.getModelDetils().size(); i++){
             moduleDetail = new ModuleDetail();
             moduleDetail.setModuleId(moduleId);
-            moduleDetail.setCreator("1"/*userId*/);
-            moduleDetail.setModifier("1"/*userId*/);
+            moduleDetail.setCreator(userId);
+            moduleDetail.setModifier(userId);
             moduleDetail.setGmtCreate(now);
             moduleDetail.setGmtModified(now);
             moduleDetail.setOrderNo(i+1);
+            moduleDetail.setRelationModule(addModuleInfoVO.getModelDetils().get(i).getRelationModule());
             if (StringUtil.isNotEmpty(addModuleInfoVO.getModelDetils().get(i).getText())){
                 moduleDetail.setQuestionId(questionIdMap.get(addModuleInfoVO.getModelDetils().get(i).getText()));
             }else {

+ 125 - 54
icssman-service/src/main/java/com/diagbot/facade/ModuleInfoFacade.java

@@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.diagbot.client.UserServiceClient;
+import com.diagbot.dto.GetModuleDetailInfoDTO;
+import com.diagbot.dto.GetModuleInfoOneDTO;
 import com.diagbot.dto.GetQuestionInfoDTO;
 import com.diagbot.dto.ModuleInfoDTO;
 import com.diagbot.dto.ModuleInfoListDTO;
@@ -11,6 +13,7 @@ import com.diagbot.dto.RespDTO;
 import com.diagbot.entity.DictionaryInfo;
 import com.diagbot.entity.ModuleDetail;
 import com.diagbot.entity.ModuleInfo;
+import com.diagbot.entity.QuestionInfo;
 import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.exception.CommonErrorCode;
 import com.diagbot.exception.CommonException;
@@ -21,6 +24,7 @@ import com.diagbot.util.StringUtil;
 import com.diagbot.util.UserUtils;
 import com.diagbot.vo.AddModuleInfoVO;
 import com.diagbot.vo.GetModuleDetailInfoVO;
+import com.diagbot.vo.GetModuleInfoOneVO;
 import com.diagbot.vo.GetModuleInfoVO;
 import com.diagbot.vo.ModuleGetQuestionInfoVO;
 import com.diagbot.vo.UpdateModuleInfoVO;
@@ -33,6 +37,7 @@ import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.stream.Collectors;
 
 /**
  * @Description:
@@ -82,47 +87,48 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
      * @param addModulInfoVO
      * @return
      */
-    public Boolean saveModuleInfo(AddModuleInfoVO addModulInfoVO){
-/*        String userId = UserUtils.getCurrentPrincipleID();*/
+    public Boolean saveModuleInfo(AddModuleInfoVO addModulInfoVO) {
+        String userId = UserUtils.getCurrentPrincipleID();
         Date now = DateUtil.now();
         //查询该模板是否添加过
         QueryWrapper<ModuleInfo> moduleInfoQueryWrapper = new QueryWrapper<>();
         moduleInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
-                .eq("name",addModulInfoVO.getName());
+                .eq("name", addModulInfoVO.getName());
         ModuleInfo moduleInfos = this.getOne(moduleInfoQueryWrapper);
-        if(null != moduleInfos){
+        if (null != moduleInfos) {
             throw new CommonException(CommonErrorCode.INSERT_DATA_FAILED,
                     "模板名重复,请勿重复添加");
         }
         ModuleInfo moduleInfo = new ModuleInfo();
-        BeanUtil.copyProperties(addModulInfoVO,moduleInfo);
-        moduleInfo.setCreator("1"/*userId*/);
-        moduleInfo.setModifier("1"/*userId*/);
+        BeanUtil.copyProperties(addModulInfoVO, moduleInfo);
+        moduleInfo.setCreator(userId);
+        moduleInfo.setModifier(userId);
         moduleInfo.setGmtCreate(now);
         moduleInfo.setGmtModified(now);
         this.save(moduleInfo);
         Long moduleId = moduleInfo.getId();
-        return moduleDetailFacade.saveOrUpdateInfos(addModulInfoVO,moduleId);
+        return moduleDetailFacade.saveOrUpdateInfos(addModulInfoVO, moduleId);
     }
+
     /**
      * 修改模板
      *
      * @param updateModuleInfoVO
      * @return
      */
-    public Boolean updateModuleInfo(UpdateModuleInfoVO updateModuleInfoVO){
-        /*        String userId = UserUtils.getCurrentPrincipleID();*/
+    public Boolean updateModuleInfo(UpdateModuleInfoVO updateModuleInfoVO) {
+        String userId = UserUtils.getCurrentPrincipleID();
         UpdateWrapper<ModuleInfo> moduleInfoUpdateWrapper = new UpdateWrapper<>();
         moduleInfoUpdateWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
-                .eq("id",updateModuleInfoVO.getId())
-                .set("name",updateModuleInfoVO.getName())
-                .set("type",updateModuleInfoVO.getType())
-                .set("modifier","1")
-                .set("gmt_modified",DateUtil.now());
-        this.update(new ModuleInfo(),moduleInfoUpdateWrapper);
+                .eq("id", updateModuleInfoVO.getId())
+                .set("name", updateModuleInfoVO.getName())
+                .set("type", updateModuleInfoVO.getType())
+                .set("modifier", userId)
+                .set("gmt_modified", DateUtil.now());
+        this.update(new ModuleInfo(), moduleInfoUpdateWrapper);
         AddModuleInfoVO addModuleInfoVO = new AddModuleInfoVO();
-        BeanUtil.copyProperties(updateModuleInfoVO,addModuleInfoVO);
-        return moduleDetailFacade.saveOrUpdateInfos(addModuleInfoVO,updateModuleInfoVO.getId());
+        BeanUtil.copyProperties(updateModuleInfoVO, addModuleInfoVO);
+        return moduleDetailFacade.saveOrUpdateInfos(addModuleInfoVO, updateModuleInfoVO.getId());
     }
 
     /**
@@ -131,7 +137,7 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
      * @param moduleGetQuestionInfoVO
      * @return
      */
-    public List<GetQuestionInfoDTO> getQuestionInfos(ModuleGetQuestionInfoVO moduleGetQuestionInfoVO){
+    public List<GetQuestionInfoDTO> getQuestionInfos(ModuleGetQuestionInfoVO moduleGetQuestionInfoVO) {
         List<GetQuestionInfoDTO> getQuestionInfoDTOS = questionFacade.moduleGetQuestiongInfoByName(moduleGetQuestionInfoVO);
         return getQuestionInfoDTOS;
     }
@@ -142,45 +148,42 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
      * @param getModuleInfoVO
      * @return
      */
-    public List<ModuleInfoDTO> getModuleInfo(GetModuleInfoVO getModuleInfoVO){
+    public List<ModuleInfoDTO> getModuleInfo(GetModuleInfoVO getModuleInfoVO) {
         //获取模板信息
         QueryWrapper<ModuleInfo> moduleInfoQueryWrapper = new QueryWrapper<>();
-        moduleInfoQueryWrapper.eq("is_deleted",IsDeleteEnum.N.getKey());
-        if(getModuleInfoVO.getType() != null){
-            moduleInfoQueryWrapper.eq("type",getModuleInfoVO.getType());
+        moduleInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey());
+        if (getModuleInfoVO.getType() != null) {
+            moduleInfoQueryWrapper.eq("type", getModuleInfoVO.getType());
         }
         List<ModuleInfo> moduleInfoList = this.list(moduleInfoQueryWrapper);
-        List<Long> moduleIdList = new ArrayList<>();
-        for (ModuleInfo moduleInfo:moduleInfoList) {
-            moduleIdList.add(moduleInfo.getId());
-        }
+        List<Long> moduleIdList = moduleInfoList.stream().map(m -> m.getId()).collect(Collectors.toList());
         //获取模板明细信息
         QueryWrapper<ModuleDetail> moduleDetailQueryWrapper = new QueryWrapper<>();
-        moduleDetailQueryWrapper.eq("is_deleted",IsDeleteEnum.N.getKey())
-            .in("module_id",moduleIdList);
+        moduleDetailQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .in("module_id", moduleIdList);
         List<ModuleDetail> moduleDetailList = moduleDetailFacade.list(moduleDetailQueryWrapper);
         //将模板明细根据模板id放入map
-        Map<Long,List<ModuleDetail>> moduleDetailMap = new HashMap<>();
+        Map<Long, List<ModuleDetail>> moduleDetailMap = new HashMap<>();
         List<ModuleDetail> allModuleDetials = null;
-        for (ModuleInfo moduleInfo:moduleInfoList) {
+        for (ModuleInfo moduleInfo : moduleInfoList) {
             allModuleDetials = new ArrayList<>();
-            for (ModuleDetail moduleDetail:moduleDetailList) {
-               if(moduleInfo.getId().longValue() == moduleDetail.getModuleId().longValue()){
-                   allModuleDetials.add(moduleDetail);
-               }
+            for (ModuleDetail moduleDetail : moduleDetailList) {
+                if (moduleInfo.getId().longValue() == moduleDetail.getModuleId().longValue()) {
+                    allModuleDetials.add(moduleDetail);
+                }
             }
-            moduleDetailMap.put(moduleInfo.getId(),allModuleDetials);
+            moduleDetailMap.put(moduleInfo.getId(), allModuleDetials);
         }
         //给ModuleInfoDTO设值
         List<ModuleInfoDTO> moduleInfoDTOList = new ArrayList<>();
         ModuleInfoDTO moduleInfoDTO = null;
-            for (ModuleInfo moduleInfo:moduleInfoList) {
-                moduleInfoDTO = new ModuleInfoDTO();
-                moduleInfoDTO.setId(moduleInfo.getId());
-                moduleInfoDTO.setName(moduleInfo.getName());
-                moduleInfoDTO.setModuleDetails(moduleDetailMap.get(moduleInfoDTO.getId()));
-                moduleInfoDTOList.add(moduleInfoDTO);
-            }
+        for (ModuleInfo moduleInfo : moduleInfoList) {
+            moduleInfoDTO = new ModuleInfoDTO();
+            moduleInfoDTO.setId(moduleInfo.getId());
+            moduleInfoDTO.setName(moduleInfo.getName());
+            moduleInfoDTO.setModuleDetails(moduleDetailMap.get(moduleInfoDTO.getId()));
+            moduleInfoDTOList.add(moduleInfoDTO);
+        }
         return moduleInfoDTOList;
     }
 
@@ -190,7 +193,7 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
      * @param getModuleInfoVO
      * @return
      */
-    public IPage<ModuleInfoListDTO> getModuleInfoList(GetModuleInfoVO getModuleInfoVO){
+    public IPage<ModuleInfoListDTO> getModuleInfoList(GetModuleInfoVO getModuleInfoVO) {
         //获取模板信息
         IPage<ModuleInfoListDTO> moduleInfoDTOIPage = this.getModuleInfoListByType(getModuleInfoVO);
         List<String> ids = new ArrayList<>();
@@ -199,14 +202,14 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
         }
         //获取模板类型名称
         QueryWrapper<DictionaryInfo> dictionaryInfoQueryWrapper = new QueryWrapper<>();
-        dictionaryInfoQueryWrapper.eq("is_deleted",IsDeleteEnum.N.getKey())
-            .eq("group_type",4)
-            .eq("return_type",1)
-            .orderByDesc("order_no");
+        dictionaryInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("group_type", 4)
+                .eq("return_type", 1)
+                .orderByDesc("order_no");
         List<DictionaryInfo> dictionaryInfoList = dictionaryFacade.list(dictionaryInfoQueryWrapper);
-        Map<String,DictionaryInfo> dictionaryInfoMap = new HashMap<>();
-        for (DictionaryInfo dictionaryInfo:dictionaryInfoList) {
-            dictionaryInfoMap.put(dictionaryInfo.getVal(),dictionaryInfo);
+        Map<String, DictionaryInfo> dictionaryInfoMap = new HashMap<>();
+        for (DictionaryInfo dictionaryInfo : dictionaryInfoList) {
+            dictionaryInfoMap.put(dictionaryInfo.getVal(), dictionaryInfo);
         }
         //获取用户信息
         RespDTO<Map<String, String>> respDTO = userServiceClient.getUserInfoByIds(ids);
@@ -222,8 +225,76 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
         return moduleInfoDTOIPage;
     }
 
-    public List<GetQuestionInfoDTO> getModuleDetailInfo(GetModuleDetailInfoVO getModuleDetailInfoVO){
-        List<GetQuestionInfoDTO> getQuestionInfoDTOList = questionFacade.getQuestionByModuleId(getModuleDetailInfoVO.getModuleId());
-        return getQuestionInfoDTOList;
+    /**
+     * 模板维护修改获取已添加标签信息
+     *
+     * @param getModuleDetailInfoVO
+     * @return
+     */
+    public List<GetModuleDetailInfoDTO> getModuleDetailInfo(GetModuleDetailInfoVO getModuleDetailInfoVO) {
+        List<GetModuleDetailInfoDTO> getModuleDetailInfoDTOList = new ArrayList<>();
+        GetModuleDetailInfoDTO getModuleDetailInfoDTO = null;
+        //获取模板明细
+        QueryWrapper<ModuleDetail> moduleDetailQueryWrapper = new QueryWrapper<>();
+        moduleDetailQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("module_id", getModuleDetailInfoVO.getModuleId());
+        List<ModuleDetail> moduleDetailList = moduleDetailFacade.list(moduleDetailQueryWrapper);
+        //获取标签信息
+        QueryWrapper<QuestionInfo> questionInfoQueryWrapper = new QueryWrapper<>();
+        questionInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey());
+        List<QuestionInfo> questionInfoList = questionFacade.list(questionInfoQueryWrapper);
+        Map<Long, QuestionInfo> questionInfoMap = new HashMap<>();
+        for (QuestionInfo questionInfo : questionInfoList) {
+            questionInfoMap.put(questionInfo.getId(), questionInfo);
+        }
+        //获取模板信息
+        QueryWrapper<ModuleInfo> moduleInfoQueryWrapper = new QueryWrapper<>();
+        questionInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey());
+        List<ModuleInfo> moduleInfoList = this.list(moduleInfoQueryWrapper);
+        Map<Long, ModuleInfo> moduleInfoMap = new HashMap<>();
+        for (ModuleInfo moduleInfo : moduleInfoList) {
+            moduleInfoMap.put(moduleInfo.getId(), moduleInfo);
+        }
+        //循环给出参赋值
+        for (ModuleDetail moduleDetail : moduleDetailList) {
+            getModuleDetailInfoDTO = new GetModuleDetailInfoDTO();
+            BeanUtil.copyProperties(moduleDetail, getModuleDetailInfoDTO);
+            if (moduleDetail.getQuestionId() != null) {
+                getModuleDetailInfoDTO.setTagName(questionInfoMap.get(moduleDetail.getQuestionId()).getTagName());
+            } else {
+                getModuleDetailInfoDTO.setRelationModuleName(moduleInfoMap.get(moduleDetail.getModuleId()).getName());
+            }
+            getModuleDetailInfoDTOList.add(getModuleDetailInfoDTO);
+        }
+
+        return getModuleDetailInfoDTOList;
+    }
+
+    /**
+     * 模板维护页面获取模板列表
+     *
+     * @param getModuleInfoOneVO
+     * @return
+     */
+    public GetModuleInfoOneDTO getModuleInfoOne(GetModuleInfoOneVO getModuleInfoOneVO) {
+        GetModuleInfoOneDTO getModuleInfoOneDTO = new GetModuleInfoOneDTO();
+        //获取模板信息
+        QueryWrapper<ModuleInfo> moduleInfoQueryWrapper = new QueryWrapper<>();
+        moduleInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("id", getModuleInfoOneVO.getModuleId());
+        ModuleInfo moduleInfo = this.getOne(moduleInfoQueryWrapper);
+        //获取模板类型名称
+        QueryWrapper<DictionaryInfo> dictionaryInfoQueryWrapper = new QueryWrapper<>();
+        dictionaryInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey());
+        List<DictionaryInfo> dictionaryInfoList = dictionaryFacade.list(dictionaryInfoQueryWrapper);
+        Map<String, DictionaryInfo> dictionaryInfoMap = new HashMap<>();
+        for (DictionaryInfo dictionaryInfo : dictionaryInfoList) {
+            dictionaryInfoMap.put(dictionaryInfo.getVal(), dictionaryInfo);
+        }
+        BeanUtil.copyProperties(moduleInfo, getModuleInfoOneDTO);
+        getModuleInfoOneDTO.setAscriptionName(dictionaryInfoMap.get(String.valueOf(moduleInfo.getType())).getName());
+        return getModuleInfoOneDTO;
     }
+
+
 }

+ 33 - 2
icssman-service/src/main/java/com/diagbot/facade/QuestionFacade.java

@@ -10,11 +10,14 @@ import com.diagbot.dto.QuestionPageDTO;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.entity.CommonParam;
 import com.diagbot.entity.DeptInfo;
+import com.diagbot.entity.DeptVital;
 import com.diagbot.entity.ModuleDetail;
 import com.diagbot.entity.ModuleInfo;
 import com.diagbot.entity.QuestionDetail;
 import com.diagbot.entity.QuestionInfo;
 import com.diagbot.entity.QuestionMapping;
+import com.diagbot.entity.RetrievalMapping;
+import com.diagbot.entity.VitalOrder;
 import com.diagbot.entity.wrapper.QuestionInfoWrapper;
 import com.diagbot.entity.wrapper.QuestionMappingWrapper;
 import com.diagbot.entity.wrapper.QuestionWrapper;
@@ -81,6 +84,12 @@ public class QuestionFacade extends QuestionInfoServiceImpl {
     UserServiceClient userServiceClient;
     @Autowired
     ModuleInfoFacade moduleInfoFacade;
+    @Autowired
+    VitalOrderFacade vitalOrderFacade;
+    @Autowired
+    DeptVitalFacade deptVitalFacade;
+    @Autowired
+    RetrievalMappingFacade retrievalMappingFacade;
 
 
     /**
@@ -397,6 +406,8 @@ public class QuestionFacade extends QuestionInfoServiceImpl {
         }
         List<String> idList = Arrays.asList(ids.split(","));
         StringBuffer errMsg = new StringBuffer();
+        Date now = DateUtil.now();
+        String person = UserUtils.getCurrentPrincipleID();
         for (String id : idList) {
             // 查询映射关系中是否存在父级
             List<QuestionInfo> info = this.getParentQuestion(Long.parseLong(id));
@@ -429,14 +440,34 @@ public class QuestionFacade extends QuestionInfoServiceImpl {
             Map paramMap = new HashMap<>();
             paramMap.put("delete", IsDeleteEnum.Y.getKey());
             paramMap.put("ids", Arrays.asList(ids.split(",")));
-            paramMap.put("gmtModified", DateUtil.now());
-            paramMap.put("modifier", UserUtils.getCurrentPrincipleID());
+            paramMap.put("gmtModified", now);
+            paramMap.put("modifier", person);
             //删除自身
             this.deleteByIds(paramMap);
             //删除明细
             questionDetailFacade.deleteByQuestionIdFac(paramMap);
             //删除映射关系
             questionMappingFacade.deleteByIdsFac(paramMap);
+            //删除查体模板
+            vitalOrderFacade.update(new VitalOrder(), new UpdateWrapper<VitalOrder>()
+                    .eq("question_id", id)
+                    .eq("is_deleted", IsDeleteEnum.N.getKey())
+                    .set("gmt_modified", now)
+                    .set("modifier", person)
+                    .set("is_deleted", IsDeleteEnum.Y.getKey()));
+            deptVitalFacade.update(new DeptVital(), new UpdateWrapper<DeptVital>()
+                    .eq("vital_id", id)
+                    .eq("is_deleted", IsDeleteEnum.N.getKey())
+                    .set("gmt_modified", now)
+                    .set("modifier", person)
+                    .set("is_deleted", IsDeleteEnum.Y.getKey()));
+            //删除检索映射
+            retrievalMappingFacade.update(new RetrievalMapping(), new UpdateWrapper<RetrievalMapping>()
+                    .eq("question_id", id)
+                    .eq("is_deleted", IsDeleteEnum.N.getKey())
+                    .set("gmt_modified", now)
+                    .set("modifier", person)
+                    .set("is_deleted", IsDeleteEnum.Y.getKey()));
         }
         return true;
     }

+ 2 - 2
icssman-service/src/main/java/com/diagbot/facade/QuestionUsualFacade.java

@@ -54,7 +54,7 @@ public class QuestionUsualFacade extends QuestionUsualServiceImpl {
     public Boolean addQuestionUsual(QuestionUsualVO questionUsualVO) {
         //判断科室是否已被删除
         if(deptIsDeletedStatus(questionUsualVO.getDeptId())){
-            throw new CommonException(CommonErrorCode.RPC_ERROR,
+            throw new CommonException(CommonErrorCode.NOT_EXISTS,
                     "科室已删除");
         }
         List<QuestionUsual> addList = Lists.newArrayList();
@@ -101,7 +101,7 @@ public class QuestionUsualFacade extends QuestionUsualServiceImpl {
     public Boolean deleteQuestionUsualByDeptId(DeleteQuestionUsualVO deleteQuestionUsualVO) {
         //判断科室是否已被删除
         if(deptIsDeletedStatus(deleteQuestionUsualVO.getDeptId())){
-            throw new CommonException(CommonErrorCode.RPC_ERROR,
+            throw new CommonException(CommonErrorCode.NOT_EXISTS,
                     "科室已删除");
         }
         //查询常用标签是否已被删除

+ 197 - 194
icssman-service/src/main/java/com/diagbot/facade/RetrievalFacade.java

@@ -65,10 +65,10 @@ public class RetrievalFacade extends RetrievalServiceImpl {
      * @return
      */
     public List<GetRetrievalsByTagDTO> getRetrievalsByTag(GetRetrievalsByTagVO getRetrievalsByTagVO) {
-    	List<GetRetrievalsByTagDTO> retList = baseMapper.getRetrievalsByTag(getRetrievalsByTagVO);
-    	if(ListUtil.isEmpty(retList)){
-    		throw new CommonException(CommonErrorCode.NOT_EXISTS);
-    	}
+        List<GetRetrievalsByTagDTO> retList = baseMapper.getRetrievalsByTag(getRetrievalsByTagVO);
+        if (ListUtil.isEmpty(retList)) {
+            throw new CommonException(CommonErrorCode.NOT_EXISTS);
+        }
         return retList;
     }
 
@@ -79,19 +79,19 @@ public class RetrievalFacade extends RetrievalServiceImpl {
      * @return
      */
     public Boolean delRetrievalsByQuesId(DelRetrievalsByQuesIdVO delRetrievalsByQuesIdVO) {
-    	QueryWrapper<RetrievalMapping> mappingQe = new QueryWrapper<>();
-    	mappingQe.eq("question_id", delRetrievalsByQuesIdVO.getQuestionId());
-    	if(retrievalMappingFacade.count(mappingQe)==0){
-    		throw new CommonException(CommonErrorCode.NOT_EXISTS);
-    	}
-		String userId = UserUtils.getCurrentPrincipleID();
-		RetrievalMapping retrievalMapping = new RetrievalMapping();
-		retrievalMapping.setGmtModified(DateUtil.now());
-		retrievalMapping.setModifier(userId);
-		retrievalMapping.setIsDeleted(IsDeleteEnum.Y.getKey());
-		
-		retrievalMappingFacade.update(retrievalMapping, mappingQe);
-		return true;
+        QueryWrapper<RetrievalMapping> mappingQe = new QueryWrapper<>();
+        mappingQe.eq("question_id", delRetrievalsByQuesIdVO.getQuestionId());
+        if (retrievalMappingFacade.count(mappingQe) == 0) {
+            throw new CommonException(CommonErrorCode.NOT_EXISTS);
+        }
+        String userId = UserUtils.getCurrentPrincipleID();
+        RetrievalMapping retrievalMapping = new RetrievalMapping();
+        retrievalMapping.setGmtModified(DateUtil.now());
+        retrievalMapping.setModifier(userId);
+        retrievalMapping.setIsDeleted(IsDeleteEnum.Y.getKey());
+
+        retrievalMappingFacade.update(retrievalMapping, mappingQe);
+        return true;
     }
 
     /**
@@ -101,240 +101,243 @@ public class RetrievalFacade extends RetrievalServiceImpl {
      * @return
      */
     public Boolean addTagRetrieval(AddTagRetrievalVO addTagRetrievalVO) {
-    	if(addTagRetrievalVO.getItemList().stream().distinct().count()!=addTagRetrievalVO.getItemList().size()){
-    		throw new CommonException(CommonErrorCode.RPC_ERROR,
+        if (addTagRetrievalVO.getItemList().stream().distinct().count() != addTagRetrievalVO.getItemList().size()) {
+            throw new CommonException(CommonErrorCode.RPC_ERROR,
                     "同义词中存在重复数据!");
-    	}
-    	
-    	Date now = DateUtil.now();
-    	String userId = UserUtils.getCurrentPrincipleID();
-    	
-        Map<String,AddTagRetrievalDetailVO> detailMap = addTagRetrievalVO.getItemList().stream().collect(Collectors.toMap(AddTagRetrievalDetailVO::getRetrievalName,i->i));
-    	List<String> retrievalNames = addTagRetrievalVO.getItemList().stream().map(i->i.getRetrievalName()).collect(Collectors.toList());
-    	
+        }
+
+        Date now = DateUtil.now();
+        String userId = UserUtils.getCurrentPrincipleID();
+
+        Map<String, AddTagRetrievalDetailVO> detailMap = addTagRetrievalVO.getItemList().stream().collect(Collectors.toMap(AddTagRetrievalDetailVO::getRetrievalName, i -> i));
+        List<String> retrievalNames = addTagRetrievalVO.getItemList().stream().map(i -> i.getRetrievalName()).collect(Collectors.toList());
+
         QueryWrapper<Retrieval> retrievalQe = new QueryWrapper<Retrieval>();
         retrievalQe.in("name", retrievalNames);
         retrievalQe.eq("is_deleted", IsDeleteEnum.N.getKey());
-        Map<String,Retrieval> retrievalMap = this.list(retrievalQe).stream().collect(Collectors.toMap(Retrieval::getName,i->i));
-        
+        Map<String, Retrieval> retrievalMap = this.list(retrievalQe).stream().collect(Collectors.toMap(Retrieval::getName, i -> i));
+
         List<Retrieval> saveOrUpdateRetrievals = new ArrayList<>();
         List<Retrieval> retrievals = new ArrayList<>();
-        addTagRetrievalVO.getItemList().forEach(i->{
-        	Retrieval retrieval = retrievalMap.get(i.getRetrievalName());
-        	if(retrieval==null){
-        		retrieval = new Retrieval();
-        		retrieval.setName(i.getRetrievalName());
-        		retrieval.setSpell(i.getRetrievalSpell());
-        		retrieval.setCreator(userId);
-        		retrieval.setGmtCreate(now);
-        		retrieval.setModifier(userId);
-        		retrieval.setGmtModified(now);
-        		saveOrUpdateRetrievals.add(retrieval);
-        	}else if(!retrieval.getSpell().equals(i.getRetrievalSpell())){
-        		retrieval.setSpell(i.getRetrievalSpell());
-        		retrieval.setModifier(userId);
-        		retrieval.setGmtModified(now);
-        		saveOrUpdateRetrievals.add(retrieval);
-        	}else{
-        		retrievals.add(retrieval);
-        	}
+        addTagRetrievalVO.getItemList().forEach(i -> {
+            Retrieval retrieval = retrievalMap.get(i.getRetrievalName());
+            if (retrieval == null) {
+                retrieval = new Retrieval();
+                retrieval.setName(i.getRetrievalName());
+                retrieval.setSpell(i.getRetrievalSpell());
+                retrieval.setCreator(userId);
+                retrieval.setGmtCreate(now);
+                retrieval.setModifier(userId);
+                retrieval.setGmtModified(now);
+                saveOrUpdateRetrievals.add(retrieval);
+            } else if (!retrieval.getSpell().equals(i.getRetrievalSpell())) {
+                retrieval.setSpell(i.getRetrievalSpell());
+                retrieval.setModifier(userId);
+                retrieval.setGmtModified(now);
+                saveOrUpdateRetrievals.add(retrieval);
+            } else {
+                retrievals.add(retrieval);
+            }
         });
         this.saveOrUpdateBatch(saveOrUpdateRetrievals);
         retrievals.addAll(saveOrUpdateRetrievals);
-        List<Long> retrievalIds = retrievals.stream().map(i->i.getId()).collect(Collectors.toList());
-        
-    	QueryWrapper<RetrievalMapping> retrievalMappingQe = new QueryWrapper<RetrievalMapping>();
-    	retrievalMappingQe.eq("question_id", addTagRetrievalVO.getQuestionId());
+        List<Long> retrievalIds = retrievals.stream().map(i -> i.getId()).collect(Collectors.toList());
+
+        QueryWrapper<RetrievalMapping> retrievalMappingQe = new QueryWrapper<RetrievalMapping>();
+        retrievalMappingQe.eq("question_id", addTagRetrievalVO.getQuestionId());
         List<RetrievalMapping> retrievalMappings = retrievalMappingFacade.list(retrievalMappingQe);
-        Map<Long,RetrievalMapping> retrievalMappingMap = retrievalMappings.stream().collect(Collectors.toMap(RetrievalMapping::getRetrievalId, i->i));
-        
+        Map<Long, RetrievalMapping> retrievalMappingMap = retrievalMappings.stream().collect(Collectors.toMap(RetrievalMapping::getRetrievalId, i -> i));
+
         List<RetrievalMapping> addOrUpdateRetrievalMappings = new ArrayList<>();
-        retrievalMappings.stream().filter(i->retrievalIds.contains(i.getRetrievalId())).forEach(i->{
-        	i.setIsDeleted(IsDeleteEnum.Y.getKey());
-        	i.setGmtModified(now);
-        	i.setModifier(userId);
-        	addOrUpdateRetrievalMappings.add(i);
+        retrievalMappings.stream().filter(i -> retrievalIds.contains(i.getRetrievalId())).forEach(i -> {
+            i.setIsDeleted(IsDeleteEnum.Y.getKey());
+            i.setGmtModified(now);
+            i.setModifier(userId);
+            addOrUpdateRetrievalMappings.add(i);
         });
-        
-        retrievals.forEach(i->{
-        	RetrievalMapping retrievalMapping = retrievalMappingMap.get(i.getId());
-        	AddTagRetrievalDetailVO detail = detailMap.get(i.getName());
-        	if(retrievalMapping==null){
-        		retrievalMapping = new RetrievalMapping();
-        		retrievalMapping.setQuestionId(addTagRetrievalVO.getQuestionId());
-        		retrievalMapping.setRetrievalId(i.getId());
-        		retrievalMapping.setGmtCreate(now);
-        		retrievalMapping.setGmtModified(now);
-        		retrievalMapping.setCreator(userId);
-        		retrievalMapping.setModifier(userId);
-        		retrievalMapping.setShowType(detail.getRetrievalType());
-        		addOrUpdateRetrievalMappings.add(retrievalMapping);
-        	}else{
-        		if(detail.getRetrievalType()!=retrievalMapping.getShowType()||retrievalMapping.getIsDeleted().equals("Y")){
-        			retrievalMapping.setShowType(detailMap.get(i.getName()).getRetrievalType());
-        			retrievalMapping.setGmtModified(now);
-        			retrievalMapping.setModifier(userId);
-        			retrievalMapping.setIsDeleted(IsDeleteEnum.N.getKey());
-        			addOrUpdateRetrievalMappings.add(retrievalMapping);
-        		}
-        	}
+
+        retrievals.forEach(i -> {
+            RetrievalMapping retrievalMapping = retrievalMappingMap.get(i.getId());
+            AddTagRetrievalDetailVO detail = detailMap.get(i.getName());
+            if (retrievalMapping == null) {
+                retrievalMapping = new RetrievalMapping();
+                retrievalMapping.setQuestionId(addTagRetrievalVO.getQuestionId());
+                retrievalMapping.setRetrievalId(i.getId());
+                retrievalMapping.setGmtCreate(now);
+                retrievalMapping.setGmtModified(now);
+                retrievalMapping.setCreator(userId);
+                retrievalMapping.setModifier(userId);
+                retrievalMapping.setShowType(detail.getRetrievalType());
+                addOrUpdateRetrievalMappings.add(retrievalMapping);
+            } else {
+                if (detail.getRetrievalType() != retrievalMapping.getShowType()
+                        || retrievalMapping.getIsDeleted().equals(IsDeleteEnum.Y.getKey())) {
+                    retrievalMapping.setShowType(detailMap.get(i.getName()).getRetrievalType());
+                    retrievalMapping.setGmtModified(now);
+                    retrievalMapping.setModifier(userId);
+                    retrievalMapping.setIsDeleted(IsDeleteEnum.N.getKey());
+                    addOrUpdateRetrievalMappings.add(retrievalMapping);
+                }
+            }
         });
-        
-        retrievalMappingFacade.saveOrUpdateBatch(addOrUpdateRetrievalMappings);     
+
+        retrievalMappingFacade.saveOrUpdateBatch(addOrUpdateRetrievalMappings);
 
         return true;
     }
-    
+
     /**
-	 * 获取标签同义词列表
-	 * @param retrievalListVO
-	 * @return
-	 */
+     * 获取标签同义词列表
+     *
+     * @param retrievalListVO
+     * @return
+     */
     public IPage<RetrievalListDTO> retrievalList(RetrievalListVO retrievalListVO) {
         IPage<RetrievalListDTO> ipage = this.getRetrievalList(retrievalListVO);
-        
+
         List<RetrievalListDTO> retrievalListDTOList = ipage.getRecords();
-        if(retrievalListDTOList.size()==0){
-        	return ipage;
+        if (retrievalListDTOList.size() == 0) {
+            return ipage;
         }
-        
-        List<Long> questionIds = retrievalListDTOList.stream().map(i->i.getQuestionId()).collect(Collectors.toList());
-        
+
+        List<Long> questionIds = retrievalListDTOList.stream().map(i -> i.getQuestionId()).collect(Collectors.toList());
+
         QueryWrapper<RetrievalMapping> retrievalMappingQe = new QueryWrapper<RetrievalMapping>();
         retrievalMappingQe.in("question_id", questionIds);
         List<RetrievalMapping> retrievalMappings = retrievalMappingFacade.list(retrievalMappingQe);
-        Map<Long,List<RetrievalMapping>> retrievalMappingListMap = retrievalMappings.stream().collect(Collectors.groupingBy(RetrievalMapping::getQuestionId));
-        
-        List<Long> retrievalIds = retrievalMappings.stream().map(i->i.getRetrievalId()).distinct().collect(Collectors.toList());
-        Map<Long,Retrieval> retrievalMap = this.listByIds(retrievalIds).stream().filter(i->i.getIsDeleted().equals("N")).collect(Collectors.toMap(Retrieval::getId,i->i));
-        
-        retrievalListDTOList.forEach(retrievalListDTO->{
-        	List<RetrievalMapping> retrievalMappingList = retrievalMappingListMap.get(retrievalListDTO.getQuestionId());
-        	retrievalMappingList = retrievalMappingList.stream().filter(i->retrievalMap.get(i.getRetrievalId())==null).sorted((t1,t2)->t2.getGmtModified().compareTo(t1.getGmtModified())).collect(Collectors.toList());
-        	retrievalListDTO.setOperatorName(retrievalMappingList.get(0).getModifier());
-        	retrievalListDTO.setRetrievalSelfName(retrievalMappingList.stream().filter(i->i.getShowType()==1&&i.getIsDeleted().equals("N")).map(i->retrievalMap.get(i.getRetrievalId()).getName()).collect(Collectors.joining()));
-        	retrievalListDTO.setRetrievalNames(retrievalMappingList.stream().filter(i->i.getShowType()==2&&i.getIsDeleted().equals("N")).map(i->retrievalMap.get(i.getRetrievalId()).getName()).collect(Collectors.joining()));
-        	retrievalListDTO.setRetrievalSonNames(retrievalMappingList.stream().filter(i->i.getShowType()==3&&i.getIsDeleted().equals("N")).map(i->retrievalMap.get(i.getRetrievalId()).getName()).collect(Collectors.joining()));
+        Map<Long, List<RetrievalMapping>> retrievalMappingListMap = retrievalMappings.stream().collect(Collectors.groupingBy(RetrievalMapping::getQuestionId));
+
+        List<Long> retrievalIds = retrievalMappings.stream().map(i -> i.getRetrievalId()).distinct().collect(Collectors.toList());
+        Map<Long, Retrieval> retrievalMap = this.listByIds(retrievalIds).stream().filter(i -> i.getIsDeleted().equals("N")).collect(Collectors.toMap(Retrieval::getId, i -> i));
+
+        retrievalListDTOList.forEach(retrievalListDTO -> {
+            List<RetrievalMapping> retrievalMappingList = retrievalMappingListMap.get(retrievalListDTO.getQuestionId());
+            retrievalMappingList = retrievalMappingList.stream().filter(i -> retrievalMap.get(i.getRetrievalId()) == null).sorted((t1, t2) -> t2.getGmtModified().compareTo(t1.getGmtModified())).collect(Collectors.toList());
+            retrievalListDTO.setOperatorName(retrievalMappingList.get(0).getModifier());
+            retrievalListDTO.setRetrievalSelfName(retrievalMappingList.stream().filter(i -> i.getShowType() == 1 && i.getIsDeleted().equals("N")).map(i -> retrievalMap.get(i.getRetrievalId()).getName()).collect(Collectors.joining()));
+            retrievalListDTO.setRetrievalNames(retrievalMappingList.stream().filter(i -> i.getShowType() == 2 && i.getIsDeleted().equals("N")).map(i -> retrievalMap.get(i.getRetrievalId()).getName()).collect(Collectors.joining()));
+            retrievalListDTO.setRetrievalSonNames(retrievalMappingList.stream().filter(i -> i.getShowType() == 3 && i.getIsDeleted().equals("N")).map(i -> retrievalMap.get(i.getRetrievalId()).getName()).collect(Collectors.joining()));
         });
-        
-        List<String> ids = retrievalListDTOList.stream().map(i->i.getOperatorName()).collect(Collectors.toList());
+
+        List<String> ids = retrievalListDTOList.stream().map(i -> i.getOperatorName()).collect(Collectors.toList());
         RespDTO<Map<String, String>> respDTO = userServiceClient.getUserInfoByIds(ids);
         if (respDTO == null || !CommonErrorCode.OK.getCode().equals(respDTO.code)) {
             throw new CommonException(CommonErrorCode.RPC_ERROR,
                     "获取用户信息失败");
         }
-        
-        retrievalListDTOList.forEach(i->i.setOperatorName(respDTO.data.get(i.getOperatorName())));
+
+        retrievalListDTOList.forEach(i -> i.setOperatorName(respDTO.data.get(i.getOperatorName())));
         ipage.setRecords(retrievalListDTOList);
         return ipage;
     }
-    
+
     /**
      * 同义词excel文件导入
+     *
      * @param file
      * @return
      */
-    public RetrievalExcelImDTO retrievalExcelIm(MultipartFile file){
-    	List<AddTagRetrievalVO> addTagRetrievalVOList = new ArrayList<>();
-    	List<String> messages = new ArrayList<>();
-    	InputStream inputStream = null;
+    public RetrievalExcelImDTO retrievalExcelIm(MultipartFile file) {
+        List<AddTagRetrievalVO> addTagRetrievalVOList = new ArrayList<>();
+        List<String> messages = new ArrayList<>();
+        InputStream inputStream = null;
         Workbook wb = null;
-    	try{
-    		if(!file.isEmpty()){
-    			inputStream = file.getInputStream();
-                if(inputStream.available() > 512000){
+        try {
+            if (!file.isEmpty()) {
+                inputStream = file.getInputStream();
+                if (inputStream.available() > 512000) {
                     messages.add("文件最大支持500KB!");
-                }else{
-                	String fileName = file.getOriginalFilename();
-                	if(fileName.lastIndexOf(".") != -1){
-                		String type = fileName.substring(fileName.lastIndexOf("."));
+                } else {
+                    String fileName = file.getOriginalFilename();
+                    if (fileName.lastIndexOf(".") != -1) {
+                        String type = fileName.substring(fileName.lastIndexOf("."));
                         if (type.equals(".xls")) {
                             wb = new HSSFWorkbook(inputStream);
                         } else if (type.equals(".xlsx")) {
                             wb = new XSSFWorkbook(inputStream);
                         }
-                        if(wb!=null){
-                        	List<AddTagRetrievalDetailVO> detailList = new ArrayList<>();
-                        	Sheet sheet = wb.getSheetAt(0);
+                        if (wb != null) {
+                            List<AddTagRetrievalDetailVO> detailList = new ArrayList<>();
+                            Sheet sheet = wb.getSheetAt(0);
                             int count = 0;
-                            String questionName,retrievalName,retrievalSpell,retrievalType;
-                            for(Row row : sheet){
-                            	count++;
-                            	if (count == 1||row==null) {
-                            		continue;
+                            String questionName, retrievalName, retrievalSpell, retrievalType;
+                            for (Row row : sheet) {
+                                count++;
+                                if (count == 1 || row == null) {
+                                    continue;
                                 }
-                            	questionName = getValue(row.getCell(0)).trim().replace(" ", "");
+                                questionName = getValue(row.getCell(0)).trim().replace(" ", "");
                                 retrievalName = getValue(row.getCell(1)).trim().replace(" ", "");
                                 retrievalSpell = getValue(row.getCell(2)).trim().replace(" ", "");
                                 retrievalType = getValue(row.getCell(3)).trim().replace(" ", "");
-                            	if(StringUtil.isEmpty(questionName) || StringUtil.isEmpty(retrievalName)
-                                        || StringUtil.isEmpty(retrievalSpell) || StringUtil.isEmpty(retrievalType)){
-                            		messages.add("第"+count+"行数据不完整!");
-                            		continue;
-                            	}
-                            	
-                            	AddTagRetrievalDetailVO addTagRetrievalDetailVO = new AddTagRetrievalDetailVO();
-                            	addTagRetrievalDetailVO.setQuestionName(questionName);
-                            	addTagRetrievalDetailVO.setRetrievalName(retrievalName);
-                            	addTagRetrievalDetailVO.setRetrievalSpell(retrievalSpell);
-                            	addTagRetrievalDetailVO.setRetrievalType(Integer.parseInt(retrievalType));
-                            	detailList.add(addTagRetrievalDetailVO);
+                                if (StringUtil.isEmpty(questionName) || StringUtil.isEmpty(retrievalName)
+                                        || StringUtil.isEmpty(retrievalSpell) || StringUtil.isEmpty(retrievalType)) {
+                                    messages.add("第" + count + "行数据不完整!");
+                                    continue;
+                                }
+
+                                AddTagRetrievalDetailVO addTagRetrievalDetailVO = new AddTagRetrievalDetailVO();
+                                addTagRetrievalDetailVO.setQuestionName(questionName);
+                                addTagRetrievalDetailVO.setRetrievalName(retrievalName);
+                                addTagRetrievalDetailVO.setRetrievalSpell(retrievalSpell);
+                                addTagRetrievalDetailVO.setRetrievalType(Integer.parseInt(retrievalType));
+                                detailList.add(addTagRetrievalDetailVO);
                             }
-                            
-                            if(detailList.size()>0){
-                            	List<String> questionNames = detailList.stream().map(i->i.getQuestionName()).distinct().collect(Collectors.toList());
-                            	QueryWrapper<QuestionInfo> questionInfoQe = new QueryWrapper<>();
-                            	questionInfoQe.in("tag_name",questionNames);
-                            	List<QuestionInfo> questionInfos = questionFacade.list(questionInfoQe);
-                            	if(questionInfos.size()>0){
-                            		Map<String,Long> questionIdMap = questionInfos.stream().collect(Collectors.toMap(QuestionInfo::getTagName, i->i.getId()));
-                            		detailList.forEach(i->{
-                            			i.setQuestionId(questionIdMap.get(i.getQuestionName()));
-                            		});
-                            		Map<Long,List<AddTagRetrievalDetailVO>> detailMap = detailList.stream().collect(Collectors.groupingBy(AddTagRetrievalDetailVO::getQuestionId));
-                                    for(Long key : detailMap.keySet()){
-                                    	AddTagRetrievalVO addTagRetrievalVO = new AddTagRetrievalVO();
-                                    	addTagRetrievalVO.setQuestionId(key);
-                                    	addTagRetrievalVO.setItemList(detailMap.get(key));
-                                    	addTagRetrievalVOList.add(addTagRetrievalVO);
+
+                            if (detailList.size() > 0) {
+                                List<String> questionNames = detailList.stream().map(i -> i.getQuestionName()).distinct().collect(Collectors.toList());
+                                QueryWrapper<QuestionInfo> questionInfoQe = new QueryWrapper<>();
+                                questionInfoQe.in("tag_name", questionNames);
+                                List<QuestionInfo> questionInfos = questionFacade.list(questionInfoQe);
+                                if (questionInfos.size() > 0) {
+                                    Map<String, Long> questionIdMap = questionInfos.stream().collect(Collectors.toMap(QuestionInfo::getTagName, i -> i.getId()));
+                                    detailList.forEach(i -> {
+                                        i.setQuestionId(questionIdMap.get(i.getQuestionName()));
+                                    });
+                                    Map<Long, List<AddTagRetrievalDetailVO>> detailMap = detailList.stream().collect(Collectors.groupingBy(AddTagRetrievalDetailVO::getQuestionId));
+                                    for (Long key : detailMap.keySet()) {
+                                        AddTagRetrievalVO addTagRetrievalVO = new AddTagRetrievalVO();
+                                        addTagRetrievalVO.setQuestionId(key);
+                                        addTagRetrievalVO.setItemList(detailMap.get(key));
+                                        addTagRetrievalVOList.add(addTagRetrievalVO);
                                     }
-                            	}
+                                }
                             }
-                        }else{
-                        	messages.add("非excel文件无法解析!");
+                        } else {
+                            messages.add("非excel文件无法解析!");
                         }
-                	}else{
-                		messages.add("未知文件无法解析!");
-                	}
+                    } else {
+                        messages.add("未知文件无法解析!");
+                    }
+                }
+            } else {
+                messages.add("无文件上传!");
+            }
+        } catch (Exception e) {
+            messages.add("解析失败!");
+        } finally {
+            try {
+                if (wb != null) {
+                    wb.close();
+                }
+                if (inputStream != null) {
+                    inputStream.close();
                 }
-    		}else{
-    			messages.add("无文件上传!");
-    		}
-    	}catch(Exception e){
-    		messages.add("解析失败!");
-    	}finally{
-    		try{
-    			if(wb!=null){
-    				wb.close();
-    			}
-    			if(inputStream!=null){
-    				inputStream.close();
-    			}
-    		}catch(Exception e){
-    		}
-    	}
-    	
-    	addTagRetrievalVOList.forEach(i->{
-    		addTagRetrieval(i);
-    	});
-    	
-    	RetrievalExcelImDTO retrievalExcelImDTO = new RetrievalExcelImDTO();
-    	retrievalExcelImDTO.setMessages(messages);
-    	return null;
+            } catch (Exception e) {
+            }
+        }
+
+        addTagRetrievalVOList.forEach(i -> {
+            addTagRetrieval(i);
+        });
+
+        RetrievalExcelImDTO retrievalExcelImDTO = new RetrievalExcelImDTO();
+        retrievalExcelImDTO.setMessages(messages);
+        return null;
     }
-    
+
     @SuppressWarnings("deprecation")
-	private String getValue(Cell cell) {
+    private String getValue(Cell cell) {
         try {
             Object obj = null;
             switch (cell.getCellTypeEnum()) {

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

@@ -71,7 +71,7 @@ public class VersionInfoFacade extends VersionInfoServiceImpl {
         modifierid = versionInfos.stream().map(ac -> ac.getModifier()).collect(Collectors.toList());
         // 根据操作人的id获取操作人信息
         Map<String, String> userNames = new HashMap<>();
-        if (modifierid.size() > 0) {
+        if (ListUtil.isNotEmpty(modifierid)) {
             RespDTO<Map<String, String>> userNamesDTO = userServiceClient.getUserInfoByIds(modifierid);
             if (userNamesDTO == null || !CommonErrorCode.OK.getCode().equals(userNamesDTO.code)) {
                 throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "获取所有用户信息失败");

+ 2 - 0
icssman-service/src/main/java/com/diagbot/vo/AddModuleDetailVO.java

@@ -17,4 +17,6 @@ public class AddModuleDetailVO {
     private int flag;
     //特殊符号,例如逗号,句号
     private String text;
+    //子模板id
+    private Long relationModule;
 }

+ 1 - 1
icssman-service/src/main/java/com/diagbot/vo/AddModuleInfoVO.java

@@ -20,4 +20,4 @@ public class AddModuleInfoVO {
     private int type;
     //标签id
     private List<AddModuleDetailVO> modelDetils;
-}
+}

+ 18 - 0
icssman-service/src/main/java/com/diagbot/vo/GetModuleInfoOneVO.java

@@ -0,0 +1,18 @@
+package com.diagbot.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @author: wangyu
+ * @time: 2018/12/28 17:03
+ */
+@Getter
+@Setter
+public class GetModuleInfoOneVO {
+    /**
+     * 模板id
+     */
+    private Long moduleId;
+}

+ 8 - 8
icssman-service/src/main/java/com/diagbot/web/DisclaimerInformationController.java

@@ -4,7 +4,7 @@ package com.diagbot.web;
 import com.diagbot.annotation.SysLogger;
 import com.diagbot.dto.DisclaimerInformationDTO;
 import com.diagbot.dto.RespDTO;
-import com.diagbot.facade.DisclaimerInformationFacaed;
+import com.diagbot.facade.DisclaimerInformationFacade;
 import com.diagbot.vo.DisclaimerInformationAllVO;
 import com.diagbot.vo.DisclaimerInformationIdVO;
 import com.diagbot.vo.DisclaimerInformationTitleVO;
@@ -34,7 +34,7 @@ import java.util.List;
 public class DisclaimerInformationController {
 
     @Autowired
-    DisclaimerInformationFacaed disclaimerInformationFacaed;
+    DisclaimerInformationFacade disclaimerInformationFacade;
 
     @ApiOperation(value = "获取免责申明详情[by:wangfeng]", notes = "获取免责申明详情")
     @PostMapping("/getDisclaimerInformations")
@@ -42,7 +42,7 @@ public class DisclaimerInformationController {
     @Transactional
     public RespDTO<List<DisclaimerInformationDTO>> getDisclaimerInformations(@RequestBody DisclaimerInformationTitleVO disclaimerInformationTitleVO) {
 
-        List<DisclaimerInformationDTO> data = disclaimerInformationFacaed.getDisclaimerInformation(disclaimerInformationTitleVO, disclaimerInformationTitleVO.getTitle());
+        List<DisclaimerInformationDTO> data = disclaimerInformationFacade.getDisclaimerInformation(disclaimerInformationTitleVO, disclaimerInformationTitleVO.getTitle());
 
         return RespDTO.onSuc(data);
     }
@@ -53,7 +53,7 @@ public class DisclaimerInformationController {
     @Transactional
     public RespDTO<Boolean> addDisclaimerInformations(@Valid @RequestBody DisclaimerInformationVO disclaimerInformationVO) {
 
-        boolean res = disclaimerInformationFacaed.addDisclaimerInformation(disclaimerInformationVO);
+        boolean res = disclaimerInformationFacade.addDisclaimerInformation(disclaimerInformationVO);
 
         return RespDTO.onSuc(res);
     }
@@ -64,7 +64,7 @@ public class DisclaimerInformationController {
     @Transactional
     public RespDTO<Boolean> updateDisclaimerInformations(@Valid @RequestBody DisclaimerInformationAllVO disclaimerInformationAllVO) {
 
-        boolean res = disclaimerInformationFacaed.updateDisclaimerInformation(disclaimerInformationAllVO);
+        boolean res = disclaimerInformationFacade.updateDisclaimerInformation(disclaimerInformationAllVO);
 
         return RespDTO.onSuc(res);
     }
@@ -75,7 +75,7 @@ public class DisclaimerInformationController {
     @Transactional
     public RespDTO<Boolean> cancelDisclaimerInformations(@Valid @RequestBody DisclaimerInformationIdVO disclaimerInformationIdVO) {
 
-        boolean res = disclaimerInformationFacaed.cancelDisclaimerInformation(disclaimerInformationIdVO);
+        boolean res = disclaimerInformationFacade.cancelDisclaimerInformation(disclaimerInformationIdVO);
 
         return RespDTO.onSuc(res);
     }
@@ -86,7 +86,7 @@ public class DisclaimerInformationController {
     @Transactional
     public RespDTO<Boolean> startDisclaimerInformations(@Valid @RequestBody DisclaimerInformationIdVO disclaimerInformationIdVO) {
 
-        boolean res = disclaimerInformationFacaed.startDisclaimerInformations(disclaimerInformationIdVO);
+        boolean res = disclaimerInformationFacade.startDisclaimerInformations(disclaimerInformationIdVO);
 
         return RespDTO.onSuc(res);
     }
@@ -97,7 +97,7 @@ public class DisclaimerInformationController {
     @Transactional
     public RespDTO<Boolean> endDisclaimerInformations(@Valid @RequestBody DisclaimerInformationIdVO disclaimerInformationIdVO) {
 
-        boolean res = disclaimerInformationFacaed.endDisclaimerInformations(disclaimerInformationIdVO);
+        boolean res = disclaimerInformationFacade.endDisclaimerInformations(disclaimerInformationIdVO);
 
         return RespDTO.onSuc(res);
     }

+ 4 - 2
icssman-service/src/main/java/com/diagbot/web/IntroduceInfoController.java

@@ -19,6 +19,7 @@ import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
+import springfox.documentation.annotations.ApiIgnore;
 
 import javax.validation.Valid;
 import java.util.List;
@@ -80,12 +81,12 @@ public class IntroduceInfoController {
     }
 
     /**
-     * 分页查询提示信息,可带等于条件
+     * 分页查询提示信息,可带条件
      *
      * @param introducePageVO
      * @return
      */
-    @ApiOperation(value = "分页查询提示信息,可带等于条件[by:zhaops]",
+    @ApiOperation(value = "分页查询提示信息,可带条件[by:zhaops]",
             notes = "current:页码,必填<br>" +
                     "size:每页显示条数,必填<br>" +
                     "name:提示信息名称<br>" +
@@ -107,6 +108,7 @@ public class IntroduceInfoController {
             notes = "map:查询条件(=),key为数据库字段名<br>")
     @PostMapping("/getByMap")
     @SysLogger("getByMap")
+    @ApiIgnore
     public RespDTO<IntroduceInfo> getByMap(@RequestBody Map<String, Object> map) {
         List<IntroduceInfo> data = introduceInfoFacade.getByMap(map);
         return RespDTO.onSuc(data);

+ 22 - 6
icssman-service/src/main/java/com/diagbot/web/ModuleInfoController.java

@@ -3,6 +3,8 @@ package com.diagbot.web;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.diagbot.annotation.SysLogger;
+import com.diagbot.dto.GetModuleDetailInfoDTO;
+import com.diagbot.dto.GetModuleInfoOneDTO;
 import com.diagbot.dto.GetQuestionInfoDTO;
 import com.diagbot.dto.ModuleInfoDTO;
 import com.diagbot.dto.ModuleInfoListDTO;
@@ -10,6 +12,7 @@ import com.diagbot.dto.RespDTO;
 import com.diagbot.facade.ModuleInfoFacade;
 import com.diagbot.vo.AddModuleInfoVO;
 import com.diagbot.vo.GetModuleDetailInfoVO;
+import com.diagbot.vo.GetModuleInfoOneVO;
 import com.diagbot.vo.GetModuleInfoVO;
 import com.diagbot.vo.ModuleGetQuestionInfoVO;
 import com.diagbot.vo.UpdateModuleInfoVO;
@@ -47,7 +50,8 @@ public class ModuleInfoController {
             notes = "name: 模板名称,必填<br>" +
                     "type: 模板类型,必填<br>" +
                     "questionId: 标签id,必填<br>" +
-                    "flag: 特殊标示类型")
+                    "flag: 特殊标示类型<br>" +
+                    "relationModule: 关联模板id")
     @PostMapping("/saveModuleInfo")
     @SysLogger("saveModuleInfo")
     @Transactional
@@ -61,7 +65,8 @@ public class ModuleInfoController {
                     "name: 模板名称,必填<br>" +
                     "type: 模板类型,必填<br>" +
                     "questionId: 标签id,必填<br>" +
-                    "flag: 特殊标示类型")
+                    "flag: 特殊标示类型<br>" +
+                    "relationModule: 关联模板id")
     @PostMapping("/updateModuleInfo")
     @SysLogger("updateModuleInfo")
     @Transactional
@@ -113,10 +118,21 @@ public class ModuleInfoController {
     @ApiOperation(value = "获取模板明细信息——修改获取已添加过的标签[by:wangyu]",
             notes = "moduleId: 模板id<br>" +
                     "<br>")
-    @PostMapping("/getModuleInfoList")
-    @SysLogger("getModuleInfoList")
-    public RespDTO<List<GetQuestionInfoDTO>> getModuleDetailInfo(@Valid @RequestBody GetModuleDetailInfoVO getModuleDetailInfoVO) {
-        List<GetQuestionInfoDTO> date= moduleInfoFacade.getModuleDetailInfo(getModuleDetailInfoVO);
+    @PostMapping("/getModuleDetailInfo")
+    @SysLogger("getModuleDetailInfo")
+    public RespDTO<List<GetModuleDetailInfoDTO>> getModuleDetailInfo(@Valid @RequestBody GetModuleDetailInfoVO getModuleDetailInfoVO) {
+        List<GetModuleDetailInfoDTO> date= moduleInfoFacade.getModuleDetailInfo(getModuleDetailInfoVO);
+        return RespDTO.onSuc(date);
+    }
+
+    @ApiOperation(value = "获取单个模板信息(修改用)[by:wangyu]",
+            notes = "" +
+                    "moduleId: 模板id<br>")
+    @PostMapping("/getModuleInfoOne")
+    @SysLogger("getModuleInfoOne")
+    public RespDTO<GetModuleInfoOneDTO> getModuleInfoOne(@Valid @RequestBody GetModuleInfoOneVO getModuleInfoVO) {
+        GetModuleInfoOneDTO date = moduleInfoFacade.getModuleInfoOne(getModuleInfoVO);
         return RespDTO.onSuc(date);
     }
+
 }

+ 3 - 5
icssman-service/src/main/java/com/diagbot/web/UploadController.java

@@ -5,24 +5,22 @@ import com.diagbot.dto.RespDTO;
 import com.diagbot.facade.UploadFacade;
 import io.swagger.annotations.Api;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.multipart.MultipartFile;
 
-import java.util.Map;
-
 @RestController
 @Api(value = "文件上传API", tags = { "文件上传API" })
-@RequestMapping(value = "/file", method = RequestMethod.GET)
+@RequestMapping(value = "/file")
 @SuppressWarnings("unchecked")
 public class UploadController {
     @Autowired
     private UploadFacade uploadFacade;
 
-    @PostMapping("/uploadImage")
+    @GetMapping("/uploadImage")
     public RespDTO<FileDTO> singleFileUpload(@RequestParam("upfile") MultipartFile file) {
         return RespDTO.onSuc(uploadFacade.singleFileUpload(file));
     }

+ 6 - 2
icssman-service/src/main/resources/mapper/IntroduceInfoMapper.xml

@@ -29,7 +29,7 @@
 
     <!-- 分页查询 -->
     <select id="getIntroducePage" resultMap="BaseResultMapDTO">
-    SELECT info.*, t.tag_name FROM icss_introduce_info info,
+    SELECT info.*, t.tag_name FROM icss_introduce_info info left join
 	    (SELECT tt.introduce_id,GROUP_CONCAT(tt.tag_name) AS tag_name
 		    FROM
 			(
@@ -43,15 +43,19 @@
 				WHERE
 					a.question_id = b.id
 				AND a.type = b.type
+                and a.is_deleted='N'
+                and b.is_deleted='N'
 			) tt
 		    GROUP BY tt.introduce_id
 	    ) t
-    WHERE info.id = t.introduce_id
+    on info.id = t.introduce_id
+    where info.is_deleted='N'
 	<if test="introducePageVO.name != null and introducePageVO.name != '' ">
 	    and info.name like concat('%',#{introducePageVO.name},'%')
     </if>
     <if test="introducePageVO.tagName != null and introducePageVO.tagName != '' ">
         and t.tag_name like concat('%',#{introducePageVO.tagName},'%')
     </if>
+    order by info.gmt_modified desc
     </select>
 </mapper>