Browse Source

1、术语关联维护

zhaops 4 years ago
parent
commit
a67f1de0bb

+ 10 - 1
src/main/java/com/diagbot/config/ResourceServerConfigurer.java

@@ -142,8 +142,17 @@ public class ResourceServerConfigurer extends ResourceServerConfigurerAdapter {
                 //.antMatchers("/tran/tcmsyndromeConfig/importExcel").permitAll()
                 //.antMatchers("/tran/tcmsyndromeConfig/exportExcel").permitAll()
                 .antMatchers("/tran/tcmsyndromeConfig/exportExcelModule").permitAll()
-                .antMatchers("/tran/mappingConfig/getPage").permitAll()
+                .antMatchers("/tran/mappingConfig/exportExcelModule").permitAll()
                 .antMatchers("/tran/mappingConfig/precDataMatch").permitAll()
+                .antMatchers("/tran/mappingConfig/importExcel").permitAll()
+                .antMatchers("/tran/mappingConfig/exportExcel").permitAll()
+                .antMatchers("/tran/mappingConfig/getPage").permitAll()
+                .antMatchers("/tran/mappingConfig/getRecord").permitAll()
+                .antMatchers("/tran/mappingConfig/getRelatedMapping").permitAll()
+                .antMatchers("/tran/mappingConfig/isExistRecord").permitAll()
+                .antMatchers("/tran/mappingConfig/saveOrUpdateRecord").permitAll()
+                .antMatchers("/tran/mappingConfig/deleteRecord").permitAll()
+                .antMatchers("/tran/mappingConfig/deleteRecords").permitAll()
                 //.antMatchers("/tran/hospitalInfo/saveRecord").permitAll()
                 .antMatchers("/tran/hospitalInfo/getHospitalInfo").permitAll()
                 .antMatchers("/tran/hospitalInfo/getAllHospitalInfo").permitAll()

+ 10 - 2
src/main/java/com/diagbot/config/security/UrlAccessDecisionManager.java

@@ -184,9 +184,17 @@ public class UrlAccessDecisionManager implements AccessDecisionManager {
                 || matchers("/tran/tcmsyndromeConfig/getPage", request)
                 // || matchers("/tran/tcmsyndromeConfig/importExcel", request)
                 // || matchers("/tran/tcmsyndromeConfig/exportExcel", request)
-                || matchers("/tran/tcmsyndromeConfig/exportExcelModule", request)
-                || matchers("/tran/mappingConfig/getPage", request)
+                || matchers("/tran/mappingConfig/exportExcelModule", request)
                 || matchers("/tran/mappingConfig/precDataMatch", request)
+                || matchers("/tran/mappingConfig/importExcel", request)
+                || matchers("/tran/mappingConfig/exportExcel", request)
+                || matchers("/tran/mappingConfig/getPage", request)
+                || matchers("/tran/mappingConfig/getRecord", request)
+                || matchers("/tran/mappingConfig/getRelatedMapping", request)
+                || matchers("/tran/mappingConfig/isExistRecord", request)
+                || matchers("/tran/mappingConfig/saveOrUpdateRecord", request)
+                || matchers("/tran/mappingConfig/deleteRecord", request)
+                || matchers("/tran/mappingConfig/deleteRecords", request)
                 //|| matchers("/tran/hospitalInfo/saveRecord", request)
                 || matchers("/tran/hospitalInfo/getHospitalInfo", request)
                 || matchers("/tran/hospitalInfo/getAllHospitalInfo", request)

+ 2 - 3
src/main/java/com/diagbot/entity/wrapper/MappingConfigWrapper.java

@@ -43,8 +43,7 @@ public class MappingConfigWrapper extends MappingConfig {
         return !(o == null
                 || (StringUtil.isBlank(o.uniqueName)
                 && StringUtil.isBlank(o.form)
-                && StringUtil.isBlank(o.code)
-                || MappingConfig.nonNull(o)
-        ));
+                && StringUtil.isBlank(o.code)))
+                || MappingConfig.nonNull(o);
     }
 }

+ 41 - 0
src/main/java/com/diagbot/facade/MappingConfigFacade.java

@@ -614,6 +614,9 @@ public class MappingConfigFacade extends MappingConfigServiceImpl {
         if (StringUtil.isBlank(userId)) {
             userId = SysUserUtils.getCurrentPrincipleID();
         }
+        if (StringUtil.isBlank(userId)) {
+            userId = "0";
+        }
         List<MappingConfigWrapper> originList = readImportData(file, type);
         if (ListUtil.isEmpty(originList)) {
             throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "校验失败,导入数据不能为空");
@@ -896,6 +899,8 @@ public class MappingConfigFacade extends MappingConfigServiceImpl {
                     .collect(Collectors.toList());
 
             for (MappingConfigWrapper item : tempList) {
+                item.setHospitalId(hospitalId);
+                item.setType(type);
                 item.setCreator(userId);
                 item.setGmtCreate(now);
                 item.setModifier(userId);
@@ -960,6 +965,38 @@ public class MappingConfigFacade extends MappingConfigServiceImpl {
         return retList.get(0);
     }
 
+    /**
+     * 查询已关联关系
+     *
+     * @param mappingConfigVO
+     * @return
+     */
+    public List<MappingConfigWrapper> getRelatedMapping(MappingConfigVO mappingConfigVO) {
+        List<MappingConfigWrapper> retList = Lists.newLinkedList();
+        if (mappingConfigVO.getHospitalId() == null) {
+            mappingConfigVO.setHospitalId(Long.valueOf(SysUserUtils.getCurrentHospitalID()));
+        }
+        QueryWrapper<MappingConfig> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", mappingConfigVO.getHospitalId())
+                .eq("type", mappingConfigVO.getType())
+                .eq("his_name", mappingConfigVO.getHisName());
+        if (StringUtil.isNotBlank(mappingConfigVO.getHisDetailName())) {
+            queryWrapper.eq("his_detail_name", mappingConfigVO.getHisDetailName());
+        }
+
+        List<MappingConfig> list = this.list(queryWrapper);
+
+        if (ListUtil.isEmpty(list)) {
+            return retList;
+        }
+
+        retList = BeanUtil.listCopyTo(list, MappingConfigWrapper.class);
+
+        addNames(retList);
+        return retList;
+    }
+
     /**
      * 判断是否已存在
      *
@@ -1020,6 +1057,9 @@ public class MappingConfigFacade extends MappingConfigServiceImpl {
         if (StringUtil.isBlank(mappingConfig.getModifier())) {
             userId = SysUserUtils.getCurrentPrincipleID();
         }
+        if (StringUtil.isBlank(userId)) {
+            userId = "0";
+        }
         Date now = DateUtil.now();
         mappingConfig.setModifier(userId);
         mappingConfig.setGmtModified(now);
@@ -1071,6 +1111,7 @@ public class MappingConfigFacade extends MappingConfigServiceImpl {
         }
         this.remove(qwUnMaptch);
 
+        mappingConfig.setIsMatch(1);
         this.saveOrUpdate(mappingConfig);
         return true;
     }

+ 2 - 2
src/main/java/com/diagbot/vo/ConceptVO.java

@@ -16,11 +16,11 @@ import java.util.List;
 public class ConceptVO {
     private List<Long> ids;
     private List<String> names;
-    @NotNull(message = "请输入术语类型")
+    //@NotNull(message = "请输入术语类型")
     private Integer type;
     /**
      * 数据来源(1-标准词、2-同义词、3-编码、4-历史数据、5-相似词、99-数据迁移)
      */
-    @NotNull(message = "请指定数据来源(1-标准词、2-同义词、3-编码、4-历史数据、5-相似词、99-数据迁移)")
+    //@NotNull(message = "请指定数据来源(1-标准词、2-同义词、3-编码、4-历史数据、5-相似词、99-数据迁移)")
     private Integer source;
 }

+ 2 - 0
src/main/java/com/diagbot/vo/MappingConfigVO.java

@@ -16,4 +16,6 @@ public class MappingConfigVO {
     private Long hospitalId;
     @NotNull(message = "请输入术语类型:1-化验、3-辅检、4-诊断、5-药品、6-手术和操作、7-科室、8-输血、10-量表、11-护理、12-中医诊断、13-中医证候、14-麻醉")
     private Integer type;
+    private String hisName;
+    private String hisDetailName;
 }

+ 10 - 0
src/main/java/com/diagbot/web/MappingConfigController.java

@@ -23,6 +23,7 @@ import org.springframework.web.multipart.MultipartFile;
 
 import javax.servlet.http.HttpServletResponse;
 import javax.validation.Valid;
+import java.util.List;
 
 /**
  * @Description:
@@ -104,6 +105,15 @@ public class MappingConfigController {
         return RespDTO.onSuc(data);
     }
 
+    @ApiOperation(value = "查询已映射关系[by:zhaops]", notes = "")
+    @PostMapping("/getRelatedMapping")
+    @SysLogger("getRelatedMapping")
+    public RespDTO<List<MappingConfigWrapper>> getRelatedMapping(@RequestBody @Valid MappingConfigVO mappingConfigVO) {
+        List<MappingConfigWrapper> data = mappingConfigFacade.getRelatedMapping(mappingConfigVO);
+        return RespDTO.onSuc(data);
+    }
+
+
     @ApiOperation(value = "保存或修改映射关系[by:zhaops]", notes = "")
     @PostMapping("/saveOrUpdateRecord")
     @SysLogger("saveOrUpdateRecord")