Sfoglia il codice sorgente

病历批量测试接口

gaodm 4 anni fa
parent
commit
dfa31b6806

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

@@ -158,6 +158,7 @@ public class ResourceServerConfigurer extends ResourceServerConfigurerAdapter {
                 .antMatchers("/sys/mrqc/caseWritingPrompt").permitAll()
                 .antMatchers("/demo/testcaseInfo/testcaseProcess").permitAll()
                 .antMatchers("/demo/mrtestInfo/importExcel").permitAll()
+                .antMatchers("/demo/mrtestInfo/exportExcel").permitAll()
                 .antMatchers("/demo/mrtestInfo/mrTestProcess").permitAll()
                 .antMatchers("/**").authenticated();
         //                .antMatchers("/**").permitAll();

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

@@ -200,6 +200,7 @@ public class UrlAccessDecisionManager implements AccessDecisionManager {
                 || matchers("/sys/mrqc/caseWritingPrompt", request)
                 || matchers("/demo/testcaseInfo/testcaseProcess", request)
                 || matchers("/demo/mrtestInfo/importExcel", request)
+                || matchers("/demo/mrtestInfo/exportExcel", request)
                 || matchers("/demo/mrtestInfo/mrTestProcess", request)
                 || matchers("/", request)) {
             return true;

+ 12 - 9
src/main/java/com/diagbot/entity/MrtestInfo.java

@@ -55,7 +55,7 @@ public class MrtestInfo implements Serializable {
     /**
      * 医院id
      */
-    @Excel(name = "医院id", isImportField = "true")
+    @Excel(name = "医院id", orderNum = "1", isImportField = "true")
     private Long hospitalId;
 
     /**
@@ -66,64 +66,67 @@ public class MrtestInfo implements Serializable {
     /**
      * 病历号
      */
-    @Excel(name = "病历号", isImportField = "true")
+    @Excel(name = "病历号", orderNum = "2", isImportField = "true")
     private String mrCode;
 
     /**
      * 字段来源
      */
-    @Excel(name = "字段来源", isImportField = "true")
+    @Excel(name = "字段来源", orderNum = "3", isImportField = "true")
     private String textSource;
 
     /**
      * 原始文本
      */
-    @Excel(name = "原始文本", isImportField = "true")
+    @Excel(name = "原始文本", orderNum = "4", isImportField = "true")
     private String text;
 
     /**
      * 原始词
      */
-    @Excel(name = "原始词", isImportField = "true")
+    @Excel(name = "原始词", orderNum = "5", isImportField = "true")
     private String word;
 
     /**
      * 替换后文本
      */
-    @Excel(name = "替换后文本", isImportField = "true")
+    @Excel(name = "替换后文本", orderNum = "6", isImportField = "true")
     private String replaceText;
 
     /**
      * 替换词
      */
-    @Excel(name = "替换词", isImportField = "true")
+    @Excel(name = "替换词", orderNum = "7", isImportField = "true")
     private String replaceWord;
 
     /**
      * 开单项类型
      */
-    @Excel(name = "开单项类型", isImportField = "true")
+    @Excel(name = "开单项类型", orderNum = "8", isImportField = "true")
     private String billType;
 
     /**
      * 开单项
      */
-    @Excel(name = "开单项", isImportField = "true")
+    @Excel(name = "开单项", orderNum = "9", isImportField = "true")
     private String billName;
 
     /**
      * 结果
      */
+    @Excel(name = "结果", orderNum = "10")
     private String result;
 
     /**
      * 是否通过 0:未通过,1:未通过
      */
+    @Excel(name = "是否通过", orderNum = "11")
     private Integer pass;
 
     /**
      * 备注
      */
+    @Excel(name = "备注", orderNum = "12")
     private String remark;
 
     public Long getId() {

+ 21 - 0
src/main/java/com/diagbot/facade/MrtestInfoFacade.java

@@ -25,6 +25,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.ArrayList;
 import java.util.Date;
 import java.util.List;
@@ -53,6 +54,26 @@ public class MrtestInfoFacade extends MrtestInfoServiceImpl {
         }
     }
 
+    /**
+     * 数据导出
+     *
+     * @param response
+     */
+    public void exportExcel(HttpServletResponse response, MrtestInfoVO mrtestInfoVO) {
+        List<MrtestInfo> mrtestInfoList
+                = mrtestInfoService.list(
+                new QueryWrapper<MrtestInfo>()
+                        .eq("is_deleted", IsDeleteEnum.N.getKey())
+                        .eq((null != mrtestInfoVO && null != mrtestInfoVO.getHospitalId()),
+                                "hospital_id", mrtestInfoVO.getHospitalId())
+                        .eq((null != mrtestInfoVO && null != mrtestInfoVO.getPass()),
+                                "pass", mrtestInfoVO.getPass())
+                        .in(ListUtil.isNotEmpty(mrtestInfoVO.getIds()), "id", mrtestInfoVO.getIds())
+        );
+        String fileName = "mrtest.xls";
+        ExcelUtils.exportExcel(mrtestInfoList, null, "sheet1", MrtestInfo.class, fileName, response, 12.8f);
+    }
+
     public Boolean mrTestProcess(MrtestInfoVO mrtestInfoVO) {
         List<MrtestInfo> mrtestInfoList
                 = mrtestInfoService.list(

+ 15 - 0
src/main/java/com/diagbot/web/MrtestInfoController.java

@@ -15,6 +15,8 @@ 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;
+
 /**
  * <p>
  * 病历测试表 前端控制器
@@ -46,6 +48,19 @@ public class MrtestInfoController {
         mrtestInfoFacade.importExcel(file);
     }
 
+    /**
+     * 数据导出
+     *
+     * @return
+     */
+    @ApiOperation(value = "数据导出[by:gaodm]",
+            notes = "")
+    @PostMapping("/exportExcel")
+    @SysLogger("exportExcel")
+    public void exportExcel(HttpServletResponse response, @RequestBody MrtestInfoVO mrtestInfoVO) {
+        mrtestInfoFacade.exportExcel(response, mrtestInfoVO);
+    }
+
     @ApiOperation(value = "执行病历测试[by:gaodm]",
             notes = "hospitalId:医院id(可不填);<br>" +
                     "ids: ID列表(可不填)<br>" +