zhoutg 4 éve
szülő
commit
dd2909feb2

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

@@ -20,6 +20,7 @@ import com.diagbot.vo.IndicationPushVO;
 import com.diagbot.vo.ItemExt;
 import com.diagbot.vo.StandConvertCrfVO;
 import com.diagbot.vo.TestAllVO;
+import com.diagbot.vo.TestExport;
 import com.diagbot.vo.TestIndicationVO;
 import com.diagbot.vo.TestLineVO;
 import io.github.lvyahui8.spring.facade.DataFacade;
@@ -31,6 +32,7 @@ import org.springframework.stereotype.Component;
 import org.springframework.web.multipart.MultipartFile;
 import org.springframework.web.multipart.commons.CommonsMultipartFile;
 
+import javax.servlet.http.HttpServletResponse;
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.IOException;
@@ -62,6 +64,19 @@ public class TestFacade {
     @Autowired
     CacheFacade cacheFacade;
 
+    /**
+     * 测试导出
+     *
+     */
+    public static void exportExcel(HttpServletResponse response) {
+        List<Lis> lisList = new ArrayList<>();
+        Lis lis1 = new Lis();
+        lis1.setName("血常规");
+        lisList.add(lis1);
+        ExcelUtils.exportExcel(lisList, null, "sheet1", TestExport.class, "名称.xls", response, 12.8f);
+        // ExcelUtils.exportExcel(lisList, "化验导出名称", "导出", TestExport.class, "名称", response);
+    }
+
     /**
      * 开单项数据测试
      *

+ 9 - 1
src/main/java/com/diagbot/rule/GroupRule.java

@@ -42,7 +42,7 @@ public class GroupRule {
                                 "妊娠", type, billNeoMaxDTO.getType());
                         billMsgList.add(commonBillMsg);
                     }
-                    // 诊断里包含“妊娠”
+                    // 诊断里包含“妊娠” 或者 包含“孕几周”
                     List<Item> diag = wordCrfDTO.getDiag();
                     for (Item item : diag) {
                         if (item.getUniqueName().contains("妊娠")) {
@@ -50,6 +50,14 @@ public class GroupRule {
                                     billNeoMaxDTO.getOrderName(), billNeoMaxDTO.getOrderStandName(),
                                     item.getUniqueName(), type, billNeoMaxDTO.getType());
                             billMsgList.add(commonBillMsg);
+                        } else {
+                            String regex = "孕.{1,4}周.*"; // 孕xx周
+                            if (item.getUniqueName().matches(regex)) {
+                                BillMsg commonBillMsg = MsgUtil.getCommonBillMsg(
+                                        billNeoMaxDTO.getOrderName(), billNeoMaxDTO.getOrderStandName(),
+                                        item.getUniqueName(), type, billNeoMaxDTO.getType());
+                                billMsgList.add(commonBillMsg);
+                            }
                         }
                     }
                     break;

+ 23 - 0
src/main/java/com/diagbot/vo/TestExport.java

@@ -0,0 +1,23 @@
+package com.diagbot.vo;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * <p>
+ * 测试导出
+ * </p>
+ *
+ * @author zhaops
+ * @since 2020-07-28
+ */
+@Data
+public class TestExport implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @Excel(name="名称", width = 40, orderNum = "1", isImportField = "true")
+    private String name;
+}

+ 9 - 0
src/main/java/com/diagbot/web/TestController.java

@@ -17,6 +17,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 java.util.List;
 import java.util.Map;
 
@@ -42,6 +43,14 @@ public class TestController {
         return RespDTO.onSuc(testFacade.importExcel(file, testLineVO));
     }
 
+    @ApiOperation(value = "导出[zhoutg]",
+            notes = "导出")
+    @PostMapping("/testExport")
+    public RespDTO<Map<String, Object>> testExport(HttpServletResponse response) {
+        testFacade.exportExcel(response);
+        return RespDTO.onSuc(null);
+    }
+
     @ApiOperation(value = "开单合理性【输血】测试API[zhoutg]",
             notes = "idNum:指定行测试<br>" +
                     "sheetIndex:sheet的下标,默认为0,表示第一个sheet")