浏览代码

代码整理

gaodm 5 年之前
父节点
当前提交
830f22ca3e

+ 1 - 1
precman-service/src/main/java/com/diagbot/facade/DictionaryFacade.java

@@ -26,7 +26,7 @@ public class DictionaryFacade extends DictionaryInfoServiceImpl {
      */
     public Map<Long, List<DictionaryInfo>> getList() {
         List<DictionaryInfo> list = this.list(new QueryWrapper<DictionaryInfo>()
-                .in("return_type", ListUtil.arrayToList(new Long[]{0L, 1L}))
+                .in("return_type", ListUtil.arrayToList(new Long[] { 0L, 1L }))
                 .eq("is_deleted", IsDeleteEnum.N.getKey())
                 .orderByAsc("group_type", "order_no"));
         return EntityUtil.makeEntityListMap(list, "groupType");

+ 49 - 48
precman-service/src/main/java/com/diagbot/facade/ModuleInfoFacade.java

@@ -53,7 +53,6 @@ import java.util.stream.Collectors;
 @Component
 public class ModuleInfoFacade extends ModuleInfoServiceImpl {
 
-
     @Autowired
     ModuleDetailFacade moduleDetailFacade;
     @Autowired
@@ -64,6 +63,7 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
     DictionaryFacade dictionaryFacade;
     @Autowired
     KnowledgemanServiceClient knowledgemanServiceClient;
+
     /**
      * 根据id删除标签模板
      *
@@ -73,22 +73,22 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
     public Boolean deleteByIdsFac(String ids) {
         //如果是子模板,删除该子模板与其他模板的关联
         QueryWrapper<ModuleInfo> moduleInfoQueryWrapper = new QueryWrapper<>();
-        moduleInfoQueryWrapper.eq("is_deleted",IsDeleteEnum.N.getKey())
-                .eq("id",ids);
+        moduleInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("id", ids);
         ModuleInfo moduleInfo = this.getOne(moduleInfoQueryWrapper, false);
         String userId = UserUtils.getCurrentPrincipleID();
         Date date = DateUtil.now();
-        if(null != moduleInfo){
-            if("31".equals(moduleInfo.getType())
+        if (null != moduleInfo) {
+            if ("31".equals(moduleInfo.getType())
                     || "32".equals(moduleInfo.getType())
-                    || "322".equals(moduleInfo.getType())){
+                    || "322".equals(moduleInfo.getType())) {
                 UpdateWrapper<ModuleDetail> moduleDetailUpdateWrapper = new UpdateWrapper<>();
                 moduleDetailUpdateWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
                         .eq("relation_module", moduleInfo.getId())
                         .set("is_deleted", IsDeleteEnum.Y.getKey())
                         .set("modifier", userId)
-                        .set("gmt_modified",date );
-                moduleDetailFacade.update(new ModuleDetail(),moduleDetailUpdateWrapper);
+                        .set("gmt_modified", date);
+                moduleDetailFacade.update(new ModuleDetail(), moduleDetailUpdateWrapper);
             }
         }
         if (StringUtil.isEmpty(ids)) {
@@ -117,7 +117,7 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
     public Boolean saveOrUpdateModuleInfo(AddModuleInfoVO addModulInfoVO) {
         Long moduleId = null;
         Boolean bac = false;
-        if(addModulInfoVO.getId() == null){
+        if (addModulInfoVO.getId() == null) {
             String userId = UserUtils.getCurrentPrincipleID();
             Date now = DateUtil.now();
             ModuleInfo moduleInfo = new ModuleInfo();
@@ -129,15 +129,15 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
             moduleInfo.setType(addModulInfoVO.getType());
             moduleInfo.setModuleType(addModulInfoVO.getModuleType());
             //当添加为科室专用模板时添加关联id
-            if(addModulInfoVO.getModuleType().intValue() == 1){
+            if (addModulInfoVO.getModuleType().intValue() == 1) {
                 moduleInfo.setRelationId(addModulInfoVO.getRelationId());
             }
             this.save(moduleInfo);
             moduleId = moduleInfo.getId();
             bac = moduleDetailFacade.saveOrUpdateInfos(addModulInfoVO, moduleId);
-        }else {
+        } else {
             UpdateModuleInfoVO updateModuleInfoVO = new UpdateModuleInfoVO();
-            BeanUtil.copyProperties(addModulInfoVO,updateModuleInfoVO);
+            BeanUtil.copyProperties(addModulInfoVO, updateModuleInfoVO);
             bac = this.updateModuleInfo(updateModuleInfoVO);
         }
         return bac;
@@ -156,11 +156,11 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
                 .eq("id", updateModuleInfoVO.getId())
                 .set("name", updateModuleInfoVO.getName())
                 .set("type", updateModuleInfoVO.getType())
-                .set("module_type",updateModuleInfoVO.getModuleType())
+                .set("module_type", updateModuleInfoVO.getModuleType())
                 .set("modifier", userId)
                 .set("gmt_modified", DateUtil.now())
-                .set("remark",updateModuleInfoVO.getRemark());
-        if(updateModuleInfoVO.getRelationId() != null){
+                .set("remark", updateModuleInfoVO.getRemark());
+        if (updateModuleInfoVO.getRelationId() != null) {
             moduleInfoUpdateWrapper.set("relation_id", updateModuleInfoVO.getRelationId());
         }
         this.update(new ModuleInfo(), moduleInfoUpdateWrapper);
@@ -183,7 +183,7 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
         List<Long> deptId = new ArrayList<>();
         for (ModuleInfoListDTO moduleInfoListDTO : moduleInfoDTOIPage.getRecords()) {
             ids.add(moduleInfoListDTO.getModifier());
-            if(moduleInfoListDTO.getModuleType().intValue() == 1){
+            if (moduleInfoListDTO.getModuleType().intValue() == 1) {
                 deptId.add(moduleInfoListDTO.getRelationId());
             }
         }
@@ -191,32 +191,33 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
         ConceptTypeVO conceptTypeVO = new ConceptTypeVO();
         conceptTypeVO.setType(1);
         RespDTO<List<ConceptBaseDTO>> deptInfoList = knowledgemanServiceClient.getConceptListByType(conceptTypeVO);
-        RespDTOUtil.respNGDeal(deptInfoList,"获取科室信息失败");
-        Map<Long, ConceptBaseDTO> deptInfoMap = deptInfoList.data.stream().collect(Collectors.toMap(ConceptBaseDTO::getConceptId,conceptBaseDTO -> conceptBaseDTO));
+        RespDTOUtil.respNGDeal(deptInfoList, "获取科室信息失败");
+        Map<Long, ConceptBaseDTO> deptInfoMap = deptInfoList.data.stream().collect(Collectors.toMap(ConceptBaseDTO::getConceptId, conceptBaseDTO -> conceptBaseDTO));
         //获取模板类型名称
         QueryWrapper<DictionaryInfo> dictionaryInfoQueryWrapper = new QueryWrapper<>();
-        dictionaryInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+        dictionaryInfoQueryWrapper
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
                 .eq("group_type", 1)
                 .eq("return_type", 1)
                 .orderByDesc("order_no");
         List<DictionaryInfo> dictionaryInfoList = dictionaryFacade.list(dictionaryInfoQueryWrapper);
-        Map<String, DictionaryInfo> dictionaryInfoMap = dictionaryInfoList.stream().collect(Collectors.toMap(DictionaryInfo::getVal,dictionaryInfo -> dictionaryInfo));
-        if(ListUtil.isNotEmpty(moduleInfoDTOIPage.getRecords())){
+        Map<String, DictionaryInfo> dictionaryInfoMap = dictionaryInfoList.stream().collect(Collectors.toMap(DictionaryInfo::getVal, dictionaryInfo -> dictionaryInfo));
+        if (ListUtil.isNotEmpty(moduleInfoDTOIPage.getRecords())) {
             //获取用户信息
             RespDTO<Map<String, String>> respDTO = userServiceClient.getUserInfoByIds(ids);
-            RespDTOUtil.respNGDeal(respDTO,"获取用户信息失败");
+            RespDTOUtil.respNGDeal(respDTO, "获取用户信息失败");
             //将用户信息放入实体
             for (ModuleInfoListDTO moduleInfoListDTO : moduleInfoDTOIPage.getRecords()) {
                 moduleInfoListDTO.setUserName(respDTO.data.get(moduleInfoListDTO.getModifier()));
-                if(null != dictionaryInfoMap.get(moduleInfoListDTO.getType())){
+                if (null != dictionaryInfoMap.get(moduleInfoListDTO.getType())) {
                     moduleInfoListDTO.setAscriptionName(dictionaryInfoMap.get(moduleInfoListDTO.getType()).getName());
                 }
-                if(moduleInfoListDTO.getModuleType().intValue() == 1){//根据科室
-                    if(moduleInfoListDTO.getRelationId().intValue() != -1){//判断是不是科室通用子模板
-                        if(null != deptInfoMap.get(moduleInfoListDTO.getRelationId())){
+                if (moduleInfoListDTO.getModuleType().intValue() == 1) {//根据科室
+                    if (moduleInfoListDTO.getRelationId().intValue() != -1) {//判断是不是科室通用子模板
+                        if (null != deptInfoMap.get(moduleInfoListDTO.getRelationId())) {
                             moduleInfoListDTO.setRelationName(deptInfoMap.get(moduleInfoListDTO.getRelationId()).getName());
                         }
-                    }else {
+                    } else {
                         moduleInfoListDTO.setRelationName(ModuleInfoTypeEnum.Common.getName());
                     }
                 }
@@ -240,17 +241,17 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
         moduleInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
                 .eq("id", getModuleInfoOneVO.getModuleId());
         ModuleInfo moduleInfo = this.getOne(moduleInfoQueryWrapper, false);
-        if(null != moduleInfo){
+        if (null != moduleInfo) {
             //获取模板类型名称
-            if(moduleInfo.getModuleType().intValue() == 1){
+            if (moduleInfo.getModuleType().intValue() == 1) {
                 deptId.add(moduleInfo.getRelationId());
             }
             //获取科室名称
             ConceptTypeVO conceptTypeVO = new ConceptTypeVO();
             conceptTypeVO.setType(1);
             RespDTO<List<ConceptBaseDTO>> deptInfoList = knowledgemanServiceClient.getConceptListByType(conceptTypeVO);
-            RespDTOUtil.respNGDeal(deptInfoList,"获取科室信息失败");
-            Map<Long, ConceptBaseDTO> deptInfoMap = deptInfoList.data.stream().collect(Collectors.toMap(ConceptBaseDTO::getConceptId,conceptBaseDTO -> conceptBaseDTO));
+            RespDTOUtil.respNGDeal(deptInfoList, "获取科室信息失败");
+            Map<Long, ConceptBaseDTO> deptInfoMap = deptInfoList.data.stream().collect(Collectors.toMap(ConceptBaseDTO::getConceptId, conceptBaseDTO -> conceptBaseDTO));
             //获取模板类型
             BeanUtil.copyProperties(moduleInfo, getModuleInfoOneDTO);
             //获取模板类型名称
@@ -260,13 +261,13 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
                     .eq("return_type", 1)
                     .orderByDesc("order_no");
             List<DictionaryInfo> dictionaryInfoList = dictionaryFacade.list(dictionaryInfoQueryWrapper);
-            Map<String, DictionaryInfo> dictionaryInfoMap = dictionaryInfoList.stream().collect(Collectors.toMap(DictionaryInfo::getVal,dictionaryInfo -> dictionaryInfo));
+            Map<String, DictionaryInfo> dictionaryInfoMap = dictionaryInfoList.stream().collect(Collectors.toMap(DictionaryInfo::getVal, dictionaryInfo -> dictionaryInfo));
             if (null != dictionaryInfoMap.get(getModuleInfoOneDTO.getType())) {
                 getModuleInfoOneDTO.setAscriptionName(dictionaryInfoMap.get(getModuleInfoOneDTO.getType()).getName());
             }
             getModuleInfoOneDTO.setModuleTypeName(ModuleInfoTypeEnum.getName(getModuleInfoOneDTO.getModuleType().intValue()));
-            if(getModuleInfoOneDTO.getModuleType().intValue() == 1){
-                if(null != deptInfoMap.get(getModuleInfoOneDTO.getRelationId())){
+            if (getModuleInfoOneDTO.getModuleType().intValue() == 1) {
+                if (null != deptInfoMap.get(getModuleInfoOneDTO.getRelationId())) {
                     getModuleInfoOneDTO.setRelationName(deptInfoMap.get(getModuleInfoOneDTO.getRelationId()).getName());
                 }
             }
@@ -318,11 +319,11 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
      * @param getModuleTypeVO
      * @return
      */
-    public List<GetModuleTypeDTO> getModuleType(GetModuleTypeVO getModuleTypeVO){
+    public List<GetModuleTypeDTO> getModuleType(GetModuleTypeVO getModuleTypeVO) {
         QueryWrapper<ModuleInfo> moduleInfoQueryWrapper = new QueryWrapper<>();
         moduleInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
                 .eq("module_Type", getModuleTypeVO.getModuleType());
-        if(getModuleTypeVO.getRelationId() != null){
+        if (getModuleTypeVO.getRelationId() != null) {
             moduleInfoQueryWrapper.eq("relation_id", getModuleTypeVO.getRelationId());
         }
         List<ModuleInfo> moduleInfos = this.list(moduleInfoQueryWrapper);
@@ -333,7 +334,7 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
                 .eq("group_type", 1)
                 .eq("return_type", 1)
                 .orderByAsc("order_no")
-                .notIn("val",types);
+                .notIn("val", types);
         List<DictionaryInfo> dictionaryInfoList = dictionaryFacade.list(dictionaryInfoQueryWrapper);
         List<GetModuleTypeDTO> getModuleTypeDTOS = new ArrayList<>();
         for (DictionaryInfo dictionaryInfo : dictionaryInfoList) {
@@ -350,26 +351,26 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
      *
      * @return
      */
-    public GetAllDeptAndDisInfoDTO getAllDeptAndDisInfo(GetAllDeptAndDisInfoVO getAllDeptAndDisInfoVO){
+    public GetAllDeptAndDisInfoDTO getAllDeptAndDisInfo(GetAllDeptAndDisInfoVO getAllDeptAndDisInfoVO) {
         //获取所有科室
         ConceptTypeVO deptType = new ConceptTypeVO();
         deptType.setType(1);
         RespDTO<List<ConceptBaseDTO>> deptInfoList = knowledgemanServiceClient.getConceptListByType(deptType);
-        RespDTOUtil.respNGDeal(deptInfoList,"获取科室信息失败");
-        if(getAllDeptAndDisInfoVO.getModuleType() != null && getAllDeptAndDisInfoVO.getModuleType().intValue() == 1){//过滤添加过得科室
-            List<ModuleInfo> moduleInfoList = getModuleInfos(getAllDeptAndDisInfoVO.getModuleType(),getAllDeptAndDisInfoVO.getType());
+        RespDTOUtil.respNGDeal(deptInfoList, "获取科室信息失败");
+        if (getAllDeptAndDisInfoVO.getModuleType() != null && getAllDeptAndDisInfoVO.getModuleType().intValue() == 1) {//过滤添加过得科室
+            List<ModuleInfo> moduleInfoList = getModuleInfos(getAllDeptAndDisInfoVO.getModuleType(), getAllDeptAndDisInfoVO.getType());
             List<Long> deptIds = moduleInfoList.stream().map(ModuleInfo::getRelationId).collect(Collectors.toList());
             Iterator<ConceptBaseDTO> deptIterator = deptInfoList.data.iterator();
             for (Long deptId : deptIds) {
-                while (deptIterator.hasNext()){
+                while (deptIterator.hasNext()) {
                     Long deptConceptId = deptIterator.next().getConceptId();
-                    if(deptId.intValue() == deptConceptId.intValue()){
+                    if (deptId.intValue() == deptConceptId.intValue()) {
                         deptIterator.remove();
                     }
                 }
             }
         }
-        List<DeptDTO> deptDTOS = BeanUtil.listCopyTo(deptInfoList.data,DeptDTO.class);
+        List<DeptDTO> deptDTOS = BeanUtil.listCopyTo(deptInfoList.data, DeptDTO.class);
         GetAllDeptAndDisInfoDTO getAllDeptAndDisInfoDTO = new GetAllDeptAndDisInfoDTO();
         getAllDeptAndDisInfoDTO.setDeptDTOS(deptDTOS);
         return getAllDeptAndDisInfoDTO;
@@ -382,11 +383,11 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
      * @param type
      * @return
      */
-    public List<ModuleInfo> getModuleInfos(Long moduleType,String type){
+    public List<ModuleInfo> getModuleInfos(Long moduleType, String type) {
         QueryWrapper<ModuleInfo> moduleInfoQueryWrapper = new QueryWrapper<>();
-        moduleInfoQueryWrapper.eq("is_deleted",IsDeleteEnum.N.getKey())
-                .eq("module_type",moduleType)
-                .eq("type",type);
+        moduleInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("module_type", moduleType)
+                .eq("type", type);
         return this.list(moduleInfoQueryWrapper);
     }
 }

+ 0 - 1
precman-service/src/main/java/com/diagbot/facade/QuestionDetailFacade.java

@@ -63,7 +63,6 @@ public class QuestionDetailFacade extends QuestionDetailServiceImpl {
     }
 
 
-
     /**
      * 根据id获取标签明细
      *

+ 5 - 4
precman-service/src/main/java/com/diagbot/facade/QuestionFacade.java

@@ -77,6 +77,7 @@ public class QuestionFacade extends QuestionInfoServiceImpl {
     ModuleDetailFacade moduleDetailFacade;
     @Autowired
     ModuleInfoFacade moduleInfoFacade;
+
     /**
      * 标签保存
      *
@@ -316,11 +317,11 @@ public class QuestionFacade extends QuestionInfoServiceImpl {
                 List<String> moduleNames = moduleInfoFacade.list(new QueryWrapper<ModuleInfo>()
                         .eq("is_deleted", IsDeleteEnum.N.getKey())
                         .in("id", moduleIds))
-                        .stream().map(row ->  row.getName()).collect(Collectors.toList());
-                for (String mouduleName: moduleNames) {
-                    if(moduleNames.get(moduleNames.size()-1).equals(mouduleName)){//如果当前元素是最后一个,不追加顿号
+                        .stream().map(row -> row.getName()).collect(Collectors.toList());
+                for (String mouduleName : moduleNames) {
+                    if (moduleNames.get(moduleNames.size() - 1).equals(mouduleName)) {//如果当前元素是最后一个,不追加顿号
                         errMsg.append("【" + mouduleName + "】");
-                    }else {
+                    } else {
                         errMsg.append("【" + mouduleName + "】").append("、");
                     }
                 }

+ 0 - 5
precman-service/src/main/java/com/diagbot/web/UploadController.java

@@ -3,8 +3,6 @@ package com.diagbot.web;
 import com.diagbot.dto.FileDTO;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.facade.UploadFacade;
-import com.diagbot.util.FastJsonUtils;
-import com.diagbot.util.StringUtil;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -17,9 +15,6 @@ import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.multipart.MultipartFile;
 
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
 @RestController
 @Api(value = "文件上传API", tags = { "文件上传API" })
 @RequestMapping(value = "/file_prec")