Browse Source

公表导出和上次文件大小配置

gaodm 4 năm trước cách đây
mục cha
commit
2f5f387cbd

+ 33 - 0
src/main/java/com/diagbot/config/MultipartConfigurer.java

@@ -0,0 +1,33 @@
+package com.diagbot.config;
+
+import org.springframework.boot.web.servlet.MultipartConfigFactory;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.util.unit.DataSize;
+
+import javax.servlet.MultipartConfigElement;
+
+/**
+ * @Description: 配置上传文件大小的配置
+ * @author: gaodm
+ * @time: 2019/5/9 11:18
+ */
+@Configuration
+public class MultipartConfigurer {
+    /**
+     * 配置上传文件大小的配置
+     *
+     * @return
+     */
+    @Bean
+    public MultipartConfigElement multipartConfigElement() {
+        MultipartConfigFactory factory = new MultipartConfigFactory();
+        //  上传文件临时文件夹
+        factory.setLocation(System.getProperty("/data/tmp"));
+        //  单个数据大小
+        factory.setMaxFileSize(DataSize.ofMegabytes(600));
+        /// 总上传数据大小
+        factory.setMaxRequestSize(DataSize.ofMegabytes(600));
+        return factory.createMultipartConfig();
+    }
+}

+ 5 - 0
src/main/java/com/diagbot/config/ResourceServerConfigurer.java

@@ -49,6 +49,7 @@ public class ResourceServerConfigurer extends ResourceServerConfigurerAdapter {
                 .antMatchers("/tran/lisConfig/deleteRecords").permitAll()
                 .antMatchers("/tran/lisConfig/getPage").permitAll()
                 .antMatchers("/tran/lisConfig/importExcel").permitAll()
+                .antMatchers("/tran/lisConfig/exportExcel").permitAll()
                 .antMatchers("/tran/pacsConfig/isExistRecord").permitAll()
                 .antMatchers("/tran/pacsConfig/saveOrUpdateRecord").permitAll()
                 .antMatchers("/tran/pacsConfig/saveOrUpdateRecords").permitAll()
@@ -56,6 +57,7 @@ public class ResourceServerConfigurer extends ResourceServerConfigurerAdapter {
                 .antMatchers("/tran/pacsConfig/deleteRecords").permitAll()
                 .antMatchers("/tran/pacsConfig/getPage").permitAll()
                 .antMatchers("/tran/pacsConfig/importExcel").permitAll()
+                .antMatchers("/tran/pacsConfig/exportExcel").permitAll()
                 .antMatchers("/tran/diseaseConfig/isExistRecord").permitAll()
                 .antMatchers("/tran/diseaseConfig/saveOrUpdateRecord").permitAll()
                 .antMatchers("/tran/diseaseConfig/saveOrUpdateRecords").permitAll()
@@ -63,6 +65,7 @@ public class ResourceServerConfigurer extends ResourceServerConfigurerAdapter {
                 .antMatchers("/tran/diseaseConfig/deleteRecords").permitAll()
                 .antMatchers("/tran/diseaseConfig/getPage").permitAll()
                 .antMatchers("/tran/diseaseConfig/importExcel").permitAll()
+                .antMatchers("/tran/diseaseConfig/exportExcel").permitAll()
                 .antMatchers("/tran/drugConfig/isExistRecord").permitAll()
                 .antMatchers("/tran/drugConfig/saveOrUpdateRecord").permitAll()
                 .antMatchers("/tran/drugConfig/saveOrUpdateRecords").permitAll()
@@ -70,6 +73,7 @@ public class ResourceServerConfigurer extends ResourceServerConfigurerAdapter {
                 .antMatchers("/tran/drugConfig/deleteRecords").permitAll()
                 .antMatchers("/tran/drugConfig/getPage").permitAll()
                 .antMatchers("/tran/drugConfig/importExcel").permitAll()
+                .antMatchers("/tran/drugConfig/exportExcel").permitAll()
                 .antMatchers("/tran/operationConfig/isExistRecord").permitAll()
                 .antMatchers("/tran/operationConfig/saveOrUpdateRecord").permitAll()
                 .antMatchers("/tran/operationConfig/saveOrUpdateRecords").permitAll()
@@ -77,6 +81,7 @@ public class ResourceServerConfigurer extends ResourceServerConfigurerAdapter {
                 .antMatchers("/tran/operationConfig/deleteRecords").permitAll()
                 .antMatchers("/tran/operationConfig/getPage").permitAll()
                 .antMatchers("/tran/operationConfig/importExcel").permitAll()
+                .antMatchers("/tran/operationConfig/exportExcel").permitAll()
                 .antMatchers("/sys/versionInfo/getVersionInfoAlls").permitAll()
                 .antMatchers("/sys/disclaimerInfo/getDisclaimerInfo").permitAll()
                 .antMatchers("/sys/mr/createMr").permitAll()

+ 5 - 0
src/main/java/com/diagbot/config/security/UrlAccessDecisionManager.java

@@ -92,6 +92,7 @@ public class UrlAccessDecisionManager implements AccessDecisionManager {
                 || matchers("/tran/lisConfig/deleteRecords", request)
                 || matchers("/tran/lisConfig/getPage", request)
                 || matchers("/tran/lisConfig/importExcel", request)
+                || matchers("/tran/lisConfig/exportExcel", request)
                 || matchers("/tran/pacsConfig/isExistRecord", request)
                 || matchers("/tran/pacsConfig/saveOrUpdateRecord", request)
                 || matchers("/tran/pacsConfig/saveOrUpdateRecords", request)
@@ -99,6 +100,7 @@ public class UrlAccessDecisionManager implements AccessDecisionManager {
                 || matchers("/tran/pacsConfig/deleteRecords", request)
                 || matchers("/tran/pacsConfig/getPage", request)
                 || matchers("/tran/pacsConfig/importExcel", request)
+                || matchers("/tran/pacsConfig/exportExcel", request)
                 || matchers("/tran/diseaseConfig/isExistRecord", request)
                 || matchers("/tran/diseaseConfig/saveOrUpdateRecord", request)
                 || matchers("/tran/diseaseConfig/saveOrUpdateRecords", request)
@@ -106,6 +108,7 @@ public class UrlAccessDecisionManager implements AccessDecisionManager {
                 || matchers("/tran/diseaseConfig/deleteRecords", request)
                 || matchers("/tran/diseaseConfig/getPage", request)
                 || matchers("/tran/diseaseConfig/importExcel", request)
+                || matchers("/tran/diseaseConfig/exportExcel", request)
                 || matchers("/tran/drugConfig/isExistRecord", request)
                 || matchers("/tran/drugConfig/saveOrUpdateRecord", request)
                 || matchers("/tran/drugConfig/saveOrUpdateRecords", request)
@@ -113,6 +116,7 @@ public class UrlAccessDecisionManager implements AccessDecisionManager {
                 || matchers("/tran/drugConfig/deleteRecords", request)
                 || matchers("/tran/drugConfig/getPage", request)
                 || matchers("/tran/drugConfig/importExcel", request)
+                || matchers("/tran/drugConfig/exportExcel", request)
                 || matchers("/tran/operationConfig/isExistRecord", request)
                 || matchers("/tran/operationConfig/saveOrUpdateRecord", request)
                 || matchers("/tran/operationConfig/saveOrUpdateRecords", request)
@@ -120,6 +124,7 @@ public class UrlAccessDecisionManager implements AccessDecisionManager {
                 || matchers("/tran/operationConfig/deleteRecords", request)
                 || matchers("/tran/operationConfig/getPage", request)
                 || matchers("/tran/operationConfig/importExcel", request)
+                || matchers("/tran/operationConfig/exportExcel", request)
                 || matchers("/sys/versionInfo/getVersionInfoAlls", request)
                 || matchers("/sys/disclaimerInfo/getDisclaimerInfo", request)
                 || matchers("/sys/mr/createMr", request)

+ 3 - 3
src/main/java/com/diagbot/entity/DiseaseConfig.java

@@ -60,19 +60,19 @@ public class DiseaseConfig implements Serializable {
     /**
      * his名称
      */
-    @Excel(name="HIS名称")
+    @Excel(name="HIS名称", width = 40)
     private String hisName;
 
     /**
      * 标准名
      */
-    @Excel(name = "标准名称")
+    @Excel(name = "标准名称", width = 40)
     private String uniqueName;
 
     /**
      * ICD编码
      */
-    @Excel(name="ICD编码")
+    @Excel(name="ICD编码", width = 40)
     private String icdCode;
 
     public Long getId() {

+ 3 - 3
src/main/java/com/diagbot/entity/DrugConfig.java

@@ -60,19 +60,19 @@ public class DrugConfig implements Serializable {
     /**
      * his名称
      */
-    @Excel(name="HIS名称")
+    @Excel(name="HIS名称", width = 40)
     private String hisName;
 
     /**
      * 标准名
      */
-    @Excel(name = "标准名称")
+    @Excel(name = "标准名称", width = 40)
     private String uniqueName;
 
     /**
      * 标准编码
      */
-    @Excel(name="标准编码")
+    @Excel(name="标准编码", width = 40)
     private String uniqueCode;
 
     public Long getId() {

+ 4 - 4
src/main/java/com/diagbot/entity/LisConfig.java

@@ -63,27 +63,27 @@ public class LisConfig implements Serializable {
     /**
      * his大项名称
      */
-    @Excel(name = "his大项名称")
+    @Excel(name = "his大项名称", width = 40)
     @NotBlank(message = "请输入大项名称")
     private String hisName;
 
     /**
      * his小项名称
      */
-    @Excel(name = "his小项名称")
+    @Excel(name = "his小项名称", width = 40)
     private String hisDetailName;
 
     /**
      * 标准名
      */
-    @Excel(name = "标准名")
+    @Excel(name = "标准名", width = 40)
     @NotBlank(message = "请输入公表名称")
     private String uniqueName;
 
     /**
      * 标准编码
      */
-    @Excel(name = "标准编码")
+    @Excel(name = "标准编码", width = 40)
     private String uniqueCode;
 
     public Long getId() {

+ 3 - 3
src/main/java/com/diagbot/entity/OperationConfig.java

@@ -60,19 +60,19 @@ public class OperationConfig implements Serializable {
     /**
      * his名称
      */
-    @Excel(name="HIS名称")
+    @Excel(name="HIS名称", width = 40)
     private String hisName;
 
     /**
      * 标准名
      */
-    @Excel(name = "标准名称")
+    @Excel(name = "标准名称", width = 40)
     private String uniqueName;
 
     /**
      * 标准编码
      */
-    @Excel(name="标准编码")
+    @Excel(name="标准编码", width = 40)
     private String uniqueCode;
 
     public Long getId() {

+ 3 - 3
src/main/java/com/diagbot/entity/PacsConfig.java

@@ -60,19 +60,19 @@ public class PacsConfig implements Serializable {
     /**
      * his名称
      */
-    @Excel(name="HIS名称")
+    @Excel(name="HIS名称", width = 40)
     private String hisName;
 
     /**
      * 标准名
      */
-    @Excel(name = "标准名称")
+    @Excel(name = "标准名称", width = 40)
     private String uniqueName;
 
     /**
      * 标准编码
      */
-    @Excel(name="标准编码")
+    @Excel(name="标准编码", width = 40)
     private String uniqueCode;
 
     public Long getId() {

+ 15 - 0
src/main/java/com/diagbot/facade/DiseaseConfigFacade.java

@@ -21,6 +21,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 import org.springframework.web.multipart.MultipartFile;
 
+import javax.servlet.http.HttpServletResponse;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
@@ -259,4 +260,18 @@ public class DiseaseConfigFacade {
         }
         return retMap;
     }
+
+    /**
+     * 数据导出
+     *
+     * @param response
+     */
+    public void exportExcel(HttpServletResponse response) {
+        QueryWrapper<DiseaseConfig> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", SysUserUtils.getCurrentHospitalID());
+        List<DiseaseConfig> records = diseaseConfigService.list(queryWrapper);
+        String fileName = "疾病映射.xls";
+        ExcelUtils.exportExcel(records, null, "sheet1", DiseaseConfig.class, fileName, response, 12.8f);
+    }
 }

+ 15 - 0
src/main/java/com/diagbot/facade/DrugConfigFacade.java

@@ -21,6 +21,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 import org.springframework.web.multipart.MultipartFile;
 
+import javax.servlet.http.HttpServletResponse;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
@@ -258,4 +259,18 @@ public class DrugConfigFacade {
         }
         return retMap;
     }
+
+    /**
+     * 数据导出
+     *
+     * @param response
+     */
+    public void exportExcel(HttpServletResponse response) {
+        QueryWrapper<DrugConfig> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", SysUserUtils.getCurrentHospitalID());
+        List<DrugConfig> records = drugConfigService.list(queryWrapper);
+        String fileName = "药品映射.xls";
+        ExcelUtils.exportExcel(records, null, "sheet1", DrugConfig.class, fileName, response, 12.8f);
+    }
 }

+ 18 - 2
src/main/java/com/diagbot/facade/LisConfigFacade.java

@@ -23,6 +23,7 @@ import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.stereotype.Component;
 import org.springframework.web.multipart.MultipartFile;
 
+import javax.servlet.http.HttpServletResponse;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
@@ -117,6 +118,7 @@ public class LisConfigFacade extends LisConfigServiceImpl {
 
     /**
      * 批量保存
+     *
      * @param lisConfigList
      * @return
      */
@@ -234,16 +236,16 @@ public class LisConfigFacade extends LisConfigServiceImpl {
     }
 
 
-
     /**
      * 获取映射关系-id
      * Map<hisName,Map<hisDetailName,Map<uniqueName,id>>>
+     *
      * @param hospitalId
      * @param hisNames
      * @param uniqueNames
      * @return
      */
-    public Map<String, Map<String,Map<String, Long>>> getConfigMap(Long hospitalId, List<String> hisNames, List<String> uniqueNames) {
+    public Map<String, Map<String, Map<String, Long>>> getConfigMap(Long hospitalId, List<String> hisNames, List<String> uniqueNames) {
         Map<String, Map<String, Map<String, Long>>> retMap = new HashMap<>();
         QueryWrapper<LisConfig> queryWrapper = new QueryWrapper<>();
         queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
@@ -283,4 +285,18 @@ public class LisConfigFacade extends LisConfigServiceImpl {
         }
         return retMap;
     }
+
+    /**
+     * 数据导出
+     *
+     * @param response
+     */
+    public void exportExcel(HttpServletResponse response) {
+        QueryWrapper<LisConfig> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", SysUserUtils.getCurrentHospitalID());
+        List<LisConfig> records = lisConfigService.list(queryWrapper);
+        String fileName = "检验映射.xls";
+        ExcelUtils.exportExcel(records, null, "sheet1", LisConfig.class, fileName, response, 12.8f);
+    }
 }

+ 15 - 0
src/main/java/com/diagbot/facade/OperationConfigFacade.java

@@ -21,6 +21,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 import org.springframework.web.multipart.MultipartFile;
 
+import javax.servlet.http.HttpServletResponse;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
@@ -258,4 +259,18 @@ public class OperationConfigFacade {
         }
         return retMap;
     }
+
+    /**
+     * 数据导出
+     *
+     * @param response
+     */
+    public void exportExcel(HttpServletResponse response) {
+        QueryWrapper<OperationConfig> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", SysUserUtils.getCurrentHospitalID());
+        List<OperationConfig> records = operationConfigService.list(queryWrapper);
+        String fileName = "手术映射.xls";
+        ExcelUtils.exportExcel(records, null, "sheet1", OperationConfig.class, fileName, response, 12.8f);
+    }
 }

+ 17 - 2
src/main/java/com/diagbot/facade/PacsConfigFacade.java

@@ -21,6 +21,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 import org.springframework.web.multipart.MultipartFile;
 
+import javax.servlet.http.HttpServletResponse;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
@@ -33,7 +34,7 @@ import java.util.stream.Collectors;
  * @time: 2020/7/29 15:03
  */
 @Component
-public class PacsConfigFacade{
+public class PacsConfigFacade {
     @Autowired
     private PacsConfigService pacsConfigService;
 
@@ -235,7 +236,7 @@ public class PacsConfigFacade{
      * @param uniqueNames
      * @return
      */
-    public Map<String, Map<String,Long>> getConfigMap(Long hospitalId, List<String> hisNames, List<String> uniqueNames) {
+    public Map<String, Map<String, Long>> getConfigMap(Long hospitalId, List<String> hisNames, List<String> uniqueNames) {
         Map<String, Map<String, Long>> retMap = new HashMap<>();
         QueryWrapper<PacsConfig> queryWrapper = new QueryWrapper<>();
         queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
@@ -258,4 +259,18 @@ public class PacsConfigFacade{
         }
         return retMap;
     }
+
+    /**
+     * 数据导出
+     *
+     * @param response
+     */
+    public void exportExcel(HttpServletResponse response) {
+        QueryWrapper<PacsConfig> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", SysUserUtils.getCurrentHospitalID());
+        List<PacsConfig> records = pacsConfigService.list(queryWrapper);
+        String fileName = "检查映射.xls";
+        ExcelUtils.exportExcel(records, null, "sheet1", PacsConfig.class, fileName, response, 12.8f);
+    }
 }

+ 14 - 0
src/main/java/com/diagbot/web/DiseaseConfigController.java

@@ -20,6 +20,7 @@ import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.multipart.MultipartFile;
 
+import javax.servlet.http.HttpServletResponse;
 import javax.validation.Valid;
 
 /**
@@ -135,4 +136,17 @@ public class DiseaseConfigController {
     public void importExcel(@RequestParam("file") MultipartFile file) {
         diseaseConfigFacade.importExcel(file);
     }
+
+    /**
+     * 数据导出
+     *
+     * @return
+     */
+    @ApiOperation(value = "数据导出[by:gaodm]",
+            notes = "")
+    @PostMapping("/exportExcel")
+    @SysLogger("exportExcel")
+    public void exportExcel(HttpServletResponse response) {
+        diseaseConfigFacade.exportExcel(response);
+    }
 }

+ 14 - 0
src/main/java/com/diagbot/web/DrugConfigController.java

@@ -20,6 +20,7 @@ import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.multipart.MultipartFile;
 
+import javax.servlet.http.HttpServletResponse;
 import javax.validation.Valid;
 
 /**
@@ -135,4 +136,17 @@ public class DrugConfigController {
     public void importExcel(@RequestParam("file") MultipartFile file) {
         drugConfigFacade.importExcel(file);
     }
+
+    /**
+     * 数据导出
+     *
+     * @return
+     */
+    @ApiOperation(value = "数据导出[by:gaodm]",
+            notes = "")
+    @PostMapping("/exportExcel")
+    @SysLogger("exportExcel")
+    public void exportExcel(HttpServletResponse response) {
+        drugConfigFacade.exportExcel(response);
+    }
 }

+ 14 - 0
src/main/java/com/diagbot/web/LisConfigController.java

@@ -20,6 +20,7 @@ import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.multipart.MultipartFile;
 
+import javax.servlet.http.HttpServletResponse;
 import javax.validation.Valid;
 
 /**
@@ -133,4 +134,17 @@ public class LisConfigController {
     public void importExcel(@RequestParam("file") MultipartFile file) {
         lisConfigFacade.importExcel(file);
     }
+
+    /**
+     * 数据导出
+     *
+     * @return
+     */
+    @ApiOperation(value = "数据导出[by:gaodm]",
+            notes = "")
+    @PostMapping("/exportExcel")
+    @SysLogger("exportExcel")
+    public void exportExcel(HttpServletResponse response) {
+        lisConfigFacade.exportExcel(response);
+    }
 }

+ 14 - 0
src/main/java/com/diagbot/web/OperationConfigController.java

@@ -20,6 +20,7 @@ import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.multipart.MultipartFile;
 
+import javax.servlet.http.HttpServletResponse;
 import javax.validation.Valid;
 
 /**
@@ -135,4 +136,17 @@ public class OperationConfigController {
     public void importExcel(@RequestParam("file") MultipartFile file) {
         operationConfigFacade.importExcel(file);
     }
+
+    /**
+     * 数据导出
+     *
+     * @return
+     */
+    @ApiOperation(value = "数据导出[by:gaodm]",
+            notes = "")
+    @PostMapping("/exportExcel")
+    @SysLogger("exportExcel")
+    public void exportExcel(HttpServletResponse response) {
+        operationConfigFacade.exportExcel(response);
+    }
 }

+ 14 - 0
src/main/java/com/diagbot/web/PacsConfigController.java

@@ -20,6 +20,7 @@ import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.multipart.MultipartFile;
 
+import javax.servlet.http.HttpServletResponse;
 import javax.validation.Valid;
 
 /**
@@ -136,4 +137,17 @@ public class PacsConfigController {
     public void importExcel(@RequestParam("file") MultipartFile file) {
         pacsConfigFacade.importExcel(file);
     }
+
+    /**
+     * 数据导出
+     *
+     * @return
+     */
+    @ApiOperation(value = "数据导出[by:gaodm]",
+            notes = "")
+    @PostMapping("/exportExcel")
+    @SysLogger("exportExcel")
+    public void exportExcel(HttpServletResponse response) {
+        pacsConfigFacade.exportExcel(response);
+    }
 }