Prechádzať zdrojové kódy

1、权限
2、云平台转调

zhaops 4 rokov pred
rodič
commit
5be060c636

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

@@ -43,107 +43,9 @@ public class ResourceServerConfigurer extends ResourceServerConfigurerAdapter {
                 //.antMatchers("/sys/user/getUserOrgMenu").permitAll()
                 .antMatchers("/oauth/token").permitAll()
                 .antMatchers("/oauth/check_token").permitAll()
-                //.antMatchers("/tran/lisConfig/isExistRecord").permitAll()
-                //.antMatchers("/tran/lisConfig/saveOrUpdateRecord").permitAll()
-                //.antMatchers("/tran/lisConfig/saveOrUpdateRecords").permitAll()
-                //.antMatchers("/tran/lisConfig/deleteRecord").permitAll()
-                //.antMatchers("/tran/lisConfig/deleteRecords").permitAll()
-                .antMatchers("/tran/lisConfig/getPage").permitAll()
-                //.antMatchers("/tran/lisConfig/importExcel").permitAll()
-                //.antMatchers("/tran/lisConfig/exportExcel").permitAll()
-                .antMatchers("/tran/lisConfig/exportExcelModule").permitAll()
-                //.antMatchers("/tran/pacsConfig/isExistRecord").permitAll()
-                //.antMatchers("/tran/pacsConfig/saveOrUpdateRecord").permitAll()
-                //.antMatchers("/tran/pacsConfig/saveOrUpdateRecords").permitAll()
-                //.antMatchers("/tran/pacsConfig/deleteRecord").permitAll()
-                //.antMatchers("/tran/pacsConfig/deleteRecords").permitAll()
-                .antMatchers("/tran/pacsConfig/getPage").permitAll()
-                //.antMatchers("/tran/pacsConfig/importExcel").permitAll()
-                //.antMatchers("/tran/pacsConfig/exportExcel").permitAll()
-                .antMatchers("/tran/pacsConfig/exportExcelModule").permitAll()
-                //.antMatchers("/tran/diseaseConfig/isExistRecord").permitAll()
-                //.antMatchers("/tran/diseaseConfig/saveOrUpdateRecord").permitAll()
-                //.antMatchers("/tran/diseaseConfig/saveOrUpdateRecords").permitAll()
-                //.antMatchers("/tran/diseaseConfig/deleteRecord").permitAll()
-                //.antMatchers("/tran/diseaseConfig/deleteRecords").permitAll()
-                .antMatchers("/tran/diseaseConfig/getPage").permitAll()
-                //.antMatchers("/tran/diseaseConfig/importExcel").permitAll()
-                //.antMatchers("/tran/diseaseConfig/exportExcel").permitAll()
-                .antMatchers("/tran/diseaseConfig/exportExcelModule").permitAll()
-                //.antMatchers("/tran/drugConfig/isExistRecord").permitAll()
-                //.antMatchers("/tran/drugConfig/saveOrUpdateRecord").permitAll()
-                //.antMatchers("/tran/drugConfig/saveOrUpdateRecords").permitAll()
-                //.antMatchers("/tran/drugConfig/deleteRecord").permitAll()
-                // .antMatchers("/tran/drugConfig/deleteRecords").permitAll()
-                .antMatchers("/tran/drugConfig/getPage").permitAll()
-                //.antMatchers("/tran/drugConfig/importExcel").permitAll()
-                // .antMatchers("/tran/drugConfig/exportExcel").permitAll()
-                .antMatchers("/tran/drugConfig/exportExcelModule").permitAll()
-                //.antMatchers("/tran/operationConfig/isExistRecord").permitAll()
-                //.antMatchers("/tran/operationConfig/saveOrUpdateRecord").permitAll()
-                //.antMatchers("/tran/operationConfig/saveOrUpdateRecords").permitAll()
-                //.antMatchers("/tran/operationConfig/deleteRecord").permitAll()
-                //.antMatchers("/tran/operationConfig/deleteRecords").permitAll()
-                .antMatchers("/tran/operationConfig/getPage").permitAll()
-                //.antMatchers("/tran/operationConfig/importExcel").permitAll()
-                //.antMatchers("/tran/operationConfig/exportExcel").permitAll()
-                .antMatchers("/tran/operationConfig/exportExcelModule").permitAll()
-                //.antMatchers("/tran/deptConfig/isExistRecord").permitAll()
-                //.antMatchers("/tran/deptConfig/saveOrUpdateRecord").permitAll()
-                //.antMatchers("/tran/deptConfig/saveOrUpdateRecords").permitAll()
-                //.antMatchers("/tran/deptConfig/deleteRecord").permitAll()
-                //.antMatchers("/tran/deptConfig/deleteRecords").permitAll()
-                .antMatchers("/tran/deptConfig/getPage").permitAll()
-                //.antMatchers("/tran/deptConfig/importExcel").permitAll()
-                //.antMatchers("/tran/deptConfig/exportExcel").permitAll()
-                .antMatchers("/tran/deptConfig/exportExcelModule").permitAll()
-                //.antMatchers("/tran/transfusionConfig/isExistRecord").permitAll()
-                //.antMatchers("/tran/transfusionConfig/saveOrUpdateRecord").permitAll()
-                //.antMatchers("/tran/transfusionConfig/saveOrUpdateRecords").permitAll()
-                //.antMatchers("/tran/transfusionConfig/deleteRecord").permitAll()
-                //.antMatchers("/tran/transfusionConfig/deleteRecords").permitAll()
-                .antMatchers("/tran/transfusionConfig/getPage").permitAll()
-                //.antMatchers("/tran/transfusionConfig/importExcel").permitAll()
-                //.antMatchers("/tran/transfusionConfig/exportExcel").permitAll()
-                .antMatchers("/tran/transfusionConfig/exportExcelModule").permitAll()
-                //.antMatchers("/tran/scaleConfig/isExistRecord").permitAll()
-                //.antMatchers("/tran/scaleConfig/saveOrUpdateRecord").permitAll()
-                //.antMatchers("/tran/scaleConfig/saveOrUpdateRecords").permitAll()
-                //.antMatchers("/tran/scaleConfig/deleteRecord").permitAll()
-                //.antMatchers("/tran/scaleConfig/deleteRecords").permitAll()
-                .antMatchers("/tran/scaleConfig/getPage").permitAll()
-                //.antMatchers("/tran/scaleConfig/importExcel").permitAll()
-                //.antMatchers("/tran/scaleConfig/exportExcel").permitAll()
-                .antMatchers("/tran/scaleConfig/exportExcelModule").permitAll()
-                //.antMatchers("/tran/nurseConfig/isExistRecord").permitAll()
-                //.antMatchers("/tran/nurseConfig/saveOrUpdateRecord").permitAll()
-                //.antMatchers("/tran/nurseConfig/saveOrUpdateRecords").permitAll()
-                //.antMatchers("/tran/nurseConfig/deleteRecord").permitAll()
-                //.antMatchers("/tran/nurseConfig/deleteRecords").permitAll()
-                .antMatchers("/tran/nurseConfig/getPage").permitAll()
-                //.antMatchers("/tran/nurseConfig/importExcel").permitAll()
-                //.antMatchers("/tran/nurseConfig/exportExcel").permitAll()
-                .antMatchers("/tran/nurseConfig/exportExcelModule").permitAll()
-                //.antMatchers("/tran/tcmdiseaseConfig/isExistRecord").permitAll()
-                //.antMatchers("/tran/tcmdiseaseConfig/saveOrUpdateRecord").permitAll()
-                //.antMatchers("/tran/tcmdiseaseConfig/saveOrUpdateRecords").permitAll()
-                //.antMatchers("/tran/tcmdiseaseConfig/deleteRecord").permitAll()
-                //.antMatchers("/tran/tcmdiseaseConfig/deleteRecords").permitAll()
-                .antMatchers("/tran/tcmdiseaseConfig/getPage").permitAll()
-                //.antMatchers("/tran/tcmdiseaseConfig/importExcel").permitAll()
-                //.antMatchers("/tran/tcmdiseaseConfig/exportExcel").permitAll()
-                .antMatchers("/tran/tcmdiseaseConfig/exportExcelModule").permitAll()
-                //.antMatchers("/tran/tcmsyndromeConfig/isExistRecord").permitAll()
-                //.antMatchers("/tran/tcmsyndromeConfig/saveOrUpdateRecord").permitAll()
-                //.antMatchers("/tran/tcmsyndromeConfig/saveOrUpdateRecords").permitAll()
-                //.antMatchers("/tran/tcmsyndromeConfig/deleteRecord").permitAll()
-                //.antMatchers("/tran/tcmsyndromeConfig/deleteRecords").permitAll()
-                .antMatchers("/tran/tcmsyndromeConfig/getPage").permitAll()
-                //.antMatchers("/tran/tcmsyndromeConfig/importExcel").permitAll()
-                //.antMatchers("/tran/tcmsyndromeConfig/exportExcel").permitAll()
-                .antMatchers("/tran/tcmsyndromeConfig/exportExcelModule").permitAll()
                 .antMatchers("/tran/mappingConfig/exportExcelModule").permitAll()
                 .antMatchers("/tran/mappingConfig/precDataMatch").permitAll()
+                .antMatchers("/tran/mappingConfig/precDataMatch_remote").permitAll()
                 .antMatchers("/tran/mappingConfig/importExcel").permitAll()
                 .antMatchers("/tran/mappingConfig/exportExcel").permitAll()
                 .antMatchers("/tran/mappingConfig/getPage").permitAll()

+ 1 - 98
src/main/java/com/diagbot/config/security/UrlAccessDecisionManager.java

@@ -86,106 +86,9 @@ public class UrlAccessDecisionManager implements AccessDecisionManager {
                 //|| matchers("/sys/user/getUserOrgMenu", request)
                 || matchers("/oauth/token", request)
                 || matchers("/oauth/check_token", request)
-                //|| matchers("/tran/lisConfig/isExistRecord", request)
-                //|| matchers("/tran/lisConfig/saveOrUpdateRecord", request)
-                //|| matchers("/tran/lisConfig/saveOrUpdateRecords", request)
-                // || matchers("/tran/lisConfig/deleteRecord", request)
-                //|| matchers("/tran/lisConfig/deleteRecords", request)
-                || matchers("/tran/lisConfig/getPage", request)
-                // || matchers("/tran/lisConfig/importExcel", request)
-                // || matchers("/tran/lisConfig/exportExcel", request)
-                || matchers("/tran/lisConfig/exportExcelModule", request)
-                // || matchers("/tran/pacsConfig/isExistRecord", request)
-                //|| matchers("/tran/pacsConfig/saveOrUpdateRecord", request)
-                // || matchers("/tran/pacsConfig/saveOrUpdateRecords", request)
-                // || matchers("/tran/pacsConfig/deleteRecord", request)
-                //|| matchers("/tran/pacsConfig/deleteRecords", request)
-                || matchers("/tran/pacsConfig/getPage", request)
-                // || matchers("/tran/pacsConfig/importExcel", request)
-                //|| matchers("/tran/pacsConfig/exportExcel", request)
-                || matchers("/tran/pacsConfig/exportExcelModule", request)
-                //|| matchers("/tran/diseaseConfig/isExistRecord", request)
-                //|| matchers("/tran/diseaseConfig/saveOrUpdateRecord", request)
-                //|| matchers("/tran/diseaseConfig/saveOrUpdateRecords", request)
-                //|| matchers("/tran/diseaseConfig/deleteRecord", request)
-                //|| matchers("/tran/diseaseConfig/deleteRecords", request)
-                || matchers("/tran/diseaseConfig/getPage", request)
-                //|| matchers("/tran/diseaseConfig/importExcel", request)
-                //|| matchers("/tran/diseaseConfig/exportExcel", request)
-                || matchers("/tran/diseaseConfig/exportExcelModule", request)
-                //|| matchers("/tran/drugConfig/isExistRecord", request)
-                //|| matchers("/tran/drugConfig/saveOrUpdateRecord", request)
-                //|| matchers("/tran/drugConfig/saveOrUpdateRecords", request)
-                // || matchers("/tran/drugConfig/deleteRecord", request)
-                //|| matchers("/tran/drugConfig/deleteRecords", request)
-                || matchers("/tran/drugConfig/getPage", request)
-                //|| matchers("/tran/drugConfig/importExcel", request)
-                //|| matchers("/tran/drugConfig/exportExcel", request)
-                || matchers("/tran/drugConfig/exportExcelModule", request)
-                // || matchers("/tran/operationConfig/isExistRecord", request)
-                // || matchers("/tran/operationConfig/saveOrUpdateRecord", request)
-                //|| matchers("/tran/operationConfig/saveOrUpdateRecords", request)
-                // || matchers("/tran/operationConfig/deleteRecord", request)
-                //|| matchers("/tran/operationConfig/deleteRecords", request)
-                || matchers("/tran/operationConfig/getPage", request)
-                //|| matchers("/tran/operationConfig/importExcel", request)
-                //|| matchers("/tran/operationConfig/exportExcel", request)
-                || matchers("/tran/operationConfig/exportExcelModule", request)
-                // || matchers("/tran/deptConfig/isExistRecord", request)
-                // || matchers("/tran/deptConfig/saveOrUpdateRecord", request)
-                //|| matchers("/tran/deptConfig/saveOrUpdateRecords", request)
-                // || matchers("/tran/deptConfig/deleteRecord", request)
-                //|| matchers("/tran/deptConfig/deleteRecords", request)
-                || matchers("/tran/deptConfig/getPage", request)
-                // || matchers("/tran/deptConfig/importExcel", request)
-                // || matchers("/tran/deptConfig/exportExcel", request)
-                || matchers("/tran/deptConfig/exportExcelModule", request)
-                // || matchers("/tran/transfusionConfig/isExistRecord", request)
-                // || matchers("/tran/transfusionConfig/saveOrUpdateRecord", request)
-                //|| matchers("/tran/transfusionConfig/saveOrUpdateRecords", request)
-                // || matchers("/tran/transfusionConfig/deleteRecord", request)
-                //|| matchers("/tran/transfusionConfig/deleteRecords", request)
-                || matchers("/tran/transfusionConfig/getPage", request)
-                // || matchers("/tran/transfusionConfig/importExcel", request)
-                // || matchers("/tran/transfusionConfig/exportExcel", request)
-                || matchers("/tran/transfusionConfig/exportExcelModule", request)
-                //|| matchers("/tran/scaleConfig/isExistRecord", request)
-                //|| matchers("/tran/scaleConfig/saveOrUpdateRecord", request)
-                //|| matchers("/tran/scaleConfig/saveOrUpdateRecords", request)
-                // || matchers("/tran/scaleConfig/deleteRecord", request)
-                //|| matchers("/tran/scaleConfig/deleteRecords", request)
-                || matchers("/tran/scaleConfig/getPage", request)
-                // || matchers("/tran/scaleConfig/importExcel", request)
-                // || matchers("/tran/scaleConfig/exportExcel", request)
-                || matchers("/tran/scaleConfig/exportExcelModule", request)
-                //|| matchers("/tran/nurseConfig/isExistRecord", request)
-                //|| matchers("/tran/nurseConfig/saveOrUpdateRecord", request)
-                //|| matchers("/tran/nurseConfig/saveOrUpdateRecords", request)
-                // || matchers("/tran/nurseConfig/deleteRecord", request)
-                //|| matchers("/tran/nurseConfig/deleteRecords", request)
-                || matchers("/tran/nurseConfig/getPage", request)
-                // || matchers("/tran/nurseConfig/importExcel", request)
-                // || matchers("/tran/nurseConfig/exportExcel", request)
-                || matchers("/tran/nurseConfig/exportExcelModule", request)
-                //|| matchers("/tran/tcmdiseaseConfig/isExistRecord", request)
-                //|| matchers("/tran/tcmdiseaseConfig/saveOrUpdateRecord", request)
-                //|| matchers("/tran/tcmdiseaseConfig/saveOrUpdateRecords", request)
-                // || matchers("/tran/tcmdiseaseConfig/deleteRecord", request)
-                //|| matchers("/tran/tcmdiseaseConfig/deleteRecords", request)
-                || matchers("/tran/tcmdiseaseConfig/getPage", request)
-                // || matchers("/tran/tcmdiseaseConfig/importExcel", request)
-                // || matchers("/tran/tcmdiseaseConfig/exportExcel", request)
-                || matchers("/tran/tcmdiseaseConfig/exportExcelModule", request)
-                //|| matchers("/tran/tcmsyndromeConfig/isExistRecord", request)
-                //|| matchers("/tran/tcmsyndromeConfig/saveOrUpdateRecord", request)
-                //|| matchers("/tran/tcmsyndromeConfig/saveOrUpdateRecords", request)
-                // || matchers("/tran/tcmsyndromeConfig/deleteRecord", request)
-                //|| matchers("/tran/tcmsyndromeConfig/deleteRecords", request)
-                || matchers("/tran/tcmsyndromeConfig/getPage", request)
-                // || matchers("/tran/tcmsyndromeConfig/importExcel", request)
-                // || matchers("/tran/tcmsyndromeConfig/exportExcel", request)
                 || matchers("/tran/mappingConfig/exportExcelModule", request)
                 || matchers("/tran/mappingConfig/precDataMatch", request)
+                || matchers("/tran/mappingConfig/precDataMatch_remote", request)
                 || matchers("/tran/mappingConfig/importExcel", request)
                 || matchers("/tran/mappingConfig/exportExcel", request)
                 || matchers("/tran/mappingConfig/getPage", request)

+ 26 - 7
src/main/java/com/diagbot/facade/MappingConfigFacade.java

@@ -343,6 +343,18 @@ public class MappingConfigFacade extends MappingConfigServiceImpl {
         exportExcel(response, retList, type, "关联数据(预匹配)");
     }
 
+    /**
+     * 远程调用预匹配接口
+     * @param file
+     * @param type
+     * @return
+     */
+    public List<MappingConfigWrapper> precDataMatch_remote(MultipartFile file, Integer type) {
+        List<MappingConfigWrapper> originList = readImportData(file, type);
+        List<MappingConfigWrapper> retList = precDataProcess(originList, type);
+        return retList;
+    }
+
     /**
      * 预匹配数据处理
      *
@@ -1213,7 +1225,9 @@ public class MappingConfigFacade extends MappingConfigServiceImpl {
                     List<String> uniqueNames = Lists.newArrayList();
                     List<String> forms = Lists.newArrayList();
                     for (Long conceptId : subEntry.getValue().keySet()) {
-                        uniqueNames.addAll(indexMap.get(conceptId).stream().map(IndexBatchDTO::getName).collect(Collectors.toList()));
+                        if (indexMap.containsKey(conceptId)) {
+                            uniqueNames.addAll(indexMap.get(conceptId).stream().map(IndexBatchDTO::getName).collect(Collectors.toList()));
+                        }
                     }
                     List<Long> formConceptIds = subEntry.getValue().values()
                             .stream()
@@ -1224,17 +1238,22 @@ public class MappingConfigFacade extends MappingConfigServiceImpl {
                         if (formConceptId == null) {
                             forms.add("");
                         } else {
-                            forms.addAll(indexMap.get(formConceptId).stream().map(IndexBatchDTO::getName).collect(Collectors.toList()));
+                            if (indexMap.containsKey(formConceptId)) {
+                                forms.addAll(indexMap.get(formConceptId).stream().map(IndexBatchDTO::getName).collect(Collectors.toList()));
+                            }
                         }
                     }
                     forms = forms.stream().distinct().collect(Collectors.toList());
-                    for (String uniqueName : uniqueNames) {
-                        thirdMap.put(uniqueName, forms);
+                    if (ListUtil.isNotEmpty(uniqueNames)) {
+                        for (String uniqueName : uniqueNames) {
+                            thirdMap.put(uniqueName, forms);
+                        }
+                        subMap.put(subEntry.getKey(), thirdMap);
                     }
-
-                    subMap.put(subEntry.getKey(), thirdMap);
                 }
-                retMap.put(entry.getKey(), subMap);
+                if (subMap != null && subMap.size() > 0) {
+                    retMap.put(entry.getKey(), subMap);
+                }
             }
         }
         return retMap;

+ 14 - 2
src/main/java/com/diagbot/web/MappingConfigController.java

@@ -15,6 +15,7 @@ import com.diagbot.vo.MappingConfigVO;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.MediaType;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
@@ -22,6 +23,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.multipart.MultipartFile;
+import springfox.documentation.annotations.ApiIgnore;
 
 import javax.servlet.http.HttpServletResponse;
 import javax.validation.Valid;
@@ -51,7 +53,7 @@ public class MappingConfigController {
 
 
     @ApiOperation(value = "预匹配[by:zhaops]", notes = "")
-    @PostMapping("/precDataMatch")
+    @PostMapping(value = "/precDataMatch", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
     @SysLogger("precDataMatch")
     public void precDataMatch(@RequestParam("file") MultipartFile file,
                               HttpServletResponse response,
@@ -59,10 +61,20 @@ public class MappingConfigController {
         mappingConfigFacade.precDataMatch(file, type, response);
     }
 
+    @ApiOperation(value = "预匹配_远程调用[by:zhaops]", notes = "")
+    @PostMapping(value = "/precDataMatch_remote", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
+    @SysLogger("precDataMatch_remote")
+    @ApiIgnore
+    public RespDTO<List<MappingConfigWrapper>> precDataMatch_remote(@RequestParam("file") MultipartFile file,
+                                                                    @RequestParam("type") Integer type) {
+        List<MappingConfigWrapper> data = mappingConfigFacade.precDataMatch_remote(file, type);
+        return RespDTO.onSuc(data);
+    }
+
 
     @ApiOperation(value = "数据导入[by:zhaops]",
             notes = "")
-    @PostMapping("/importExcel")
+    @PostMapping(value = "/importExcel", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
     @SysLogger("importExcel")
     @Transactional
     public void importExcel(@RequestParam("file") MultipartFile file,