浏览代码

测试开单性数据

zhoutg 4 年之前
父节点
当前提交
d115400c1a

+ 9 - 9
src/main/java/com/diagbot/dto/WordCrfDTO.java

@@ -36,23 +36,23 @@ public class WordCrfDTO {
     // 辅检项目和结果
     private List<Pacs> pacs = new ArrayList<>();
     // 主诉
-    private ChiefLabel chiefLabel;
+    private ChiefLabel chiefLabel = new ChiefLabel();
     // 现病史
-    private PresentLabel presentLabel;
+    private PresentLabel presentLabel = new PresentLabel();
     // 既往史 (如:疾病史、外伤史、传染病史、过敏史、食物过敏史、药物过敏史、输血史、手术史、预防接种史)
-    private PastLabel pastLabel;
+    private PastLabel pastLabel = new PastLabel();
     // 个人史(如:吸烟史、饮酒史、冶游)
-    private PersonalLabel personalLabel;
+    private PersonalLabel personalLabel = new PersonalLabel();
     // 家族史(如:家族遗传病)
-    private FamilyLabel familyLabel;
+    private FamilyLabel familyLabel = new FamilyLabel();
     // 婚育史
-    private MaritalLabel maritalLabel;
+    private MaritalLabel maritalLabel = new MaritalLabel();
     // 月经史
-    private MenstrualLabel menstrualLabel;
+    private MenstrualLabel menstrualLabel = new MenstrualLabel();
     // 体格
-    private VitalLabel vitalLabel;
+    private VitalLabel vitalLabel = new VitalLabel();
     // 诊断
-    private DiagLabel diagLabel;
+    private DiagLabel diagLabel = new DiagLabel();
 
     /*******************************************入参数据拷贝开始******************************/
     // 当前化验开单项

+ 10 - 10
src/main/java/com/diagbot/facade/CommonFacade.java

@@ -125,22 +125,22 @@ public class CommonFacade {
         VitalLabel vitalLabel = wordCrfDTO.getVitalLabel();
 
         //症状回填
-        CoreUtil.setPropertyList(chiefLabel.getClinicals(),map.get(StandConvertEnum.clinical.getKey()));
-        CoreUtil.setPropertyList(presentLabel.getClinicals(),map.get(StandConvertEnum.clinical.getKey()));
+        CoreUtil.setPropertyList(chiefLabel.getClinicals(),map.get(StandConvertEnum.clinical.getName()));
+        CoreUtil.setPropertyList(presentLabel.getClinicals(),map.get(StandConvertEnum.clinical.getName()));
         //诊断回填
-        CoreUtil.setPropertyList(diagLabel.getDiags(),map.get(StandConvertEnum.disease.getKey()));
+        CoreUtil.setPropertyList(diagLabel.getDiags(),map.get(StandConvertEnum.disease.getName()));
         //药品回填
-        CoreUtil.setPropertyList(presentLabel.getMedicines(),map.get(StandConvertEnum.drug.getKey()));
-        CoreUtil.setPropertyList(pastLabel.getAllergyMedicines(),map.get(StandConvertEnum.drug.getKey()));
+        CoreUtil.setPropertyList(presentLabel.getMedicines(),map.get(StandConvertEnum.drug.getName()));
+        CoreUtil.setPropertyList(pastLabel.getAllergyMedicines(),map.get(StandConvertEnum.drug.getName()));
         // TODO: 2020/8/5 化验回填
-        CoreUtil.setPropertyList(lis,"name","detailName","uniqueName",map.get(StandConvertEnum.lis.getKey()));
+        CoreUtil.setPropertyList(lis,"name","detailName","uniqueName",map.get(StandConvertEnum.lis.getName()));
         // TODO: 2020/8/5 辅助检查回填
-        CoreUtil.setPropertyList(pacs,"name","uniqueName",map.get(StandConvertEnum.pacs.getKey()));
+        CoreUtil.setPropertyList(pacs,"name","uniqueName",map.get(StandConvertEnum.pacs.getName()));
         //体征回填
-        CoreUtil.setPropertyList(vitalLabel.getVitals(),map.get(StandConvertEnum.vital.getKey()));
+        CoreUtil.setPropertyList(vitalLabel.getVitals(),map.get(StandConvertEnum.vital.getName()));
         //手术回填
-        CoreUtil.setPropertyList(presentLabel.getOperations(),map.get(StandConvertEnum.operation.getKey()));
-        CoreUtil.setPropertyList(pastLabel.getOperations(),map.get(StandConvertEnum.operation.getKey()));
+        CoreUtil.setPropertyList(presentLabel.getOperations(),map.get(StandConvertEnum.operation.getName()));
+        CoreUtil.setPropertyList(pastLabel.getOperations(),map.get(StandConvertEnum.operation.getName()));
     }
 
 }

+ 4 - 4
src/main/java/com/diagbot/facade/NeoFacade.java

@@ -132,9 +132,9 @@ public class NeoFacade {
         billNeoDTOs.addAll(getLisDetailBill(billNeoVO.getLisDetailList()));
         billNeoDTOs.addAll(getLisBill(billNeoVO.getLisList()));
 
-        for (BillNeoDTO billNeoDTO:billNeoDTOs) {
-            System.out.println(billNeoDTO);
-        }
+        // for (BillNeoDTO billNeoDTO:billNeoDTOs) {
+        //     System.out.println(billNeoDTO);
+        // }
         return billNeoDTOs;
     }
 
@@ -455,7 +455,7 @@ public class NeoFacade {
         map.put(StandConvertEnum.vital.getName(), vitalMap);
 
         Map<String, String> diseaseMap = new LinkedHashMap<>();
-        List<String> diseaseList = standConvert.getDrugList();
+        List<String> diseaseList = standConvert.getDiaglList();
         for (String s : diseaseList) {
             StandConvertCrfVO standConvertCrfVO = new StandConvertCrfVO();
             standConvertCrfVO.setWord_type("disease");

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

@@ -0,0 +1,134 @@
+package com.diagbot.facade;
+
+import com.diagbot.biz.push.entity.Pacs;
+import com.diagbot.dto.IndicationDTO;
+import com.diagbot.util.ExcelUtils;
+import com.diagbot.util.ListUtil;
+import com.diagbot.util.StringUtil;
+import com.diagbot.vo.IndicationPushVO;
+import com.diagbot.vo.TestIndicationVO;
+import com.diagbot.vo.TestLineVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Description: 测试facade
+ * @author: zhoutg
+ * @time: 2018/8/6 9:11
+ */
+@Component
+public class TestFacade {
+
+    @Autowired
+    IndicationFacade indicationFacade;
+
+    /**
+     * 开单项数据测试
+     *
+     * @param file
+     */
+    public Map<String, Object> importExcel(MultipartFile file, TestLineVO testLineVO) {
+        List<IndicationPushVO> indicationPushVOList = new ArrayList<>();
+        List<TestIndicationVO> data = ExcelUtils.importExcel(file, 0, 1, TestIndicationVO.class);
+        for (TestIndicationVO bean : data) {
+            if (StringUtil.isNotEmpty(testLineVO.getIdNum()) && !testLineVO.getIdNum().equals(bean.getIdNum())) {
+                continue;
+            }
+            IndicationPushVO indicationPushVO = new IndicationPushVO();
+            indicationPushVO.setRuleType("2");
+            indicationPushVO.setIdNum(bean.getIdNum());
+            if (StringUtil.isNotBlank(bean.getOrderType())) {
+                switch (bean.getOrderType()) {
+                    // case "实验室检查" : // 细项
+                    //     List<Lis> lisDetailOrder = new ArrayList<>();
+                    //     Lis lisDetailBean = new Lis();
+                    //     lisDetailBean.setName(bean.getStandName());
+                    //     lisDetailBean.setDetailName(bean.getStandName());
+                    //     lisDetailBean.setUniqueName(bean.getStandName());
+                    //     lisDetailOrder.add(lisDetailBean);
+                    //     indicationPushVO.setLisOrder(lisDetailOrder);
+                    //     break;
+                    case "辅助检查" :
+                        List<Pacs> pacsOrder = new ArrayList<>();
+                        Pacs pacsBean = new Pacs();
+                        pacsBean.setName(bean.getStandName());
+                        pacsBean.setUniqueName(bean.getStandName());
+                        pacsOrder.add(pacsBean);
+                        indicationPushVO.setPacsOrder(pacsOrder);
+                        break;
+                    // case "实验室检查套餐" :
+                    //     List<Lis> lisOrder = new ArrayList<>();
+                    //     Lis lisBean = new Lis();
+                    //     lisBean.setName(bean.getStandName());
+                    //     lisBean.setUniqueName(bean.getStandName());
+                    //     lisOrder.add(lisBean);
+                    //     indicationPushVO.setLisOrder(lisOrder);
+                    //     break;
+                    case "手术和操作" :
+                        continue;
+                    default:
+                        continue;
+                }
+            }
+
+            if (StringUtil.isNotEmpty(bean.getNeoType())) {
+                switch (bean.getNeoType()) {
+                    // case "1" : // 性别
+                    //     if ("男性".equals(bean.getNeoName())) {
+                    //         indicationPushVO.setSex(1);
+                    //     } else if ("女性".equals(bean.getNeoName())) {
+                    //         indicationPushVO.setSex(2);
+                    //     }
+                    //     break;
+                    // case "2" : // 化验, 示例:血小板计数,<,50,*10~9L
+                    //     String lisStr = bean.getNeoName();
+                    //     String[] lisArr = lisStr.split(",");
+                    //
+                    //     List<Lis> lisList = new ArrayList<>();
+                    //     Lis lisBean = new Lis();
+                    //     lisBean.setUniqueName(lisArr[0]);
+                    //     lisBean.setName(lisArr[0]);
+                    //     lisBean.setDetailName(lisArr[0]);
+                    //     if ("<".equals(lisArr[1])) {
+                    //         lisBean.setValue(Double.parseDouble(lisArr[2]) - 1);
+                    //     } else if (">".equals(lisArr[1])) {
+                    //         lisBean.setValue(Double.parseDouble(lisArr[2]) + 1);
+                    //     }
+                    //     lisList.add(lisBean);
+                    //     indicationPushVO.setLis(lisList);
+                    //     break;
+                    // case "3" : // 临床表现
+                    //     indicationPushVO.setChief(bean.getNeoName());
+                    //     break;
+                    case "5" : // 诊断
+                        indicationPushVO.setDiagString(bean.getNeoName());
+                        break;
+                    default:
+                        continue;
+                }
+            }
+            indicationPushVOList.add(indicationPushVO);
+        }
+
+        Map<String, Object> map = new LinkedHashMap<>();
+
+        List<String> msg = new ArrayList<>();
+        for (IndicationPushVO indicationPushVO : indicationPushVOList) {
+            IndicationDTO indicationDTO = indicationFacade.indicationFac(indicationPushVO);
+            if (ListUtil.isEmpty(indicationDTO.getBillMsgList())) {
+                msg.add("第【" + indicationPushVO.getIdNum() + "】行未匹配");
+            }
+        }
+        map.put("出错信息", msg);
+        map.put("总条数", indicationPushVOList.size() + "条");
+        map.put("出错条数", msg.size() + "条");
+        return map;
+    }
+
+}

+ 4 - 4
src/main/java/com/diagbot/rule/SexRule.java

@@ -29,16 +29,16 @@ public class SexRule {
             String sex = nodeNeoDTO.getName();
             String sexStr = "";
             if (1 == wordCrfDTO.getSex()) {
-                sexStr = "男";
+                sexStr = "男";
             } else if (2 == wordCrfDTO.getSex()) {
-                sexStr = "女";
+                sexStr = "女";
             }
             if (sex.equals(sexStr)) {
-                if ("男".equals(sexStr)) {
+                if ("男".equals(sexStr)) {
                     BillMsg billMsg = CoreUtil.getCommonBillMsg(billNeoMaxDTO.getOrderName(), billNeoMaxDTO.getOrderStandName(),
                             "男性", "男性", type);
                     billMsgList.add(billMsg);
-                } else if ("女".equals(sexStr)) {
+                } else if ("女".equals(sexStr)) {
                     BillMsg billMsg = CoreUtil.getCommonBillMsg(billNeoMaxDTO.getOrderName(), billNeoMaxDTO.getOrderStandName(),
                             "女性", "女性", type);
                     billMsgList.add(billMsg);

+ 178 - 178
src/main/java/com/diagbot/util/ExcelUtils.java

@@ -1,178 +1,178 @@
-// package com.diagbot.util;
-//
-//
-// import cn.afterturn.easypoi.excel.ExcelExportUtil;
-// import cn.afterturn.easypoi.excel.ExcelImportUtil;
-// import cn.afterturn.easypoi.excel.entity.ExportParams;
-// import cn.afterturn.easypoi.excel.entity.ImportParams;
-// import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
-// import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
-// import com.diagbot.exception.CommonErrorCode;
-// import com.diagbot.exception.CommonException;
-// import org.apache.commons.lang3.StringUtils;
-// import org.apache.poi.ss.usermodel.Row;
-// import org.apache.poi.ss.usermodel.Sheet;
-// import org.apache.poi.ss.usermodel.Workbook;
-// import org.springframework.web.multipart.MultipartFile;
-//
-// import javax.servlet.http.HttpServletResponse;
-// import java.io.File;
-// import java.io.IOException;
-// import java.net.URLEncoder;
-// import java.util.Collection;
-// import java.util.List;
-// import java.util.Map;
-// import java.util.NoSuchElementException;
-//
-// /**
-//  * @Description: excel 导入导出工具类
-//  * @author: gaodm
-//  * @time: 2020/6/2 19:18
-//  */
-// public class ExcelUtils {
-//     public static void exportExcel(List<?> list, String title, String sheetName, Class<?> pojoClass, String fileName,
-//                                    boolean isCreateHeader, HttpServletResponse response) {
-//         ExportParams exportParams = new ExportParams(title, sheetName);
-//         exportParams.setCreateHeadRows(isCreateHeader);
-//         defaultExport(list, pojoClass, fileName, response, exportParams);
-//     }
-//
-//     public static void exportExcelDynamicCol(List<ExcelExportEntity> entityList, Collection<?> dataSet, String title, String sheetName, String fileName,
-//                                     HttpServletResponse response) {
-//         ExportParams exportParams = new ExportParams(title, sheetName);
-//         dynamicColExport(entityList, dataSet, fileName, response, exportParams);
-//     }
-//
-//     public static void exportExcel(List<?> list, String title, String sheetName, Class<?> pojoClass, String fileName,
-//                                    HttpServletResponse response, float height) {
-//         Boolean havTitle = false;
-//         if (StringUtil.isNotBlank(title)) {
-//             havTitle = true;
-//         }
-//         userExport2(list, pojoClass, fileName, response, new ExportParams(title, sheetName), height, havTitle);
-//     }
-//
-//     public static void exportExcel(List<?> list, String title, String sheetName, Class<?> pojoClass, String fileName,
-//                                    HttpServletResponse response) {
-//         defaultExport(list, pojoClass, fileName, response, new ExportParams(title, sheetName));
-//     }
-//
-//     public static void exportExcel(List<Map<String, Object>> list, String fileName, HttpServletResponse response) {
-//         defaultExport(list, fileName, response);
-//     }
-//
-//     private static void defaultExport(List<?> list, Class<?> pojoClass, String fileName, HttpServletResponse response,
-//                                       ExportParams exportParams) {
-//         Workbook workbook = ExcelExportUtil.exportExcel(exportParams, pojoClass, list);
-//         if (workbook != null) {
-//             ;
-//         }
-//         downLoadExcel(fileName, response, workbook);
-//     }
-//
-//     private static void dynamicColExport(List<ExcelExportEntity> entityList, Collection<?> dataSet, String fileName, HttpServletResponse response,
-//                                          ExportParams exportParams) {
-//         Workbook workbook = ExcelExportUtil.exportExcel(exportParams,entityList,dataSet);
-//         if (workbook != null) {
-//             ;
-//         }
-//         downLoadExcel(fileName, response, workbook);
-//     }
-//
-//     private static void userExport(List<?> list, Class<?> pojoClass, String fileName, HttpServletResponse response,
-//                                    ExportParams exportParams) {
-//         Workbook workbook = ExcelExportUtil.exportExcel(exportParams, pojoClass, list);
-//         if (workbook != null) {
-//             Sheet sheet = workbook.getSheetAt(0);
-//             //列宽设置
-//             sheet.setColumnWidth(8, 256 * 20);
-//             sheet.setColumnWidth(9, 256 * 50);
-//             int rowNum = sheet.getLastRowNum();
-//             Row row = sheet.getRow(0);
-//             for (int i = 1; i <= rowNum; i++) {
-//                 row = sheet.getRow(i);
-//                 row.setHeightInPoints(12.8f);
-//             }
-//         }
-//         downLoadExcel(fileName, response, workbook);
-//     }
-//
-//     private static void userExport2(List<?> list, Class<?> pojoClass, String fileName, HttpServletResponse response,
-//                                     ExportParams exportParams, float height, Boolean havTitle) {
-//         Workbook workbook = ExcelExportUtil.exportExcel(exportParams, pojoClass, list);
-//         if (workbook != null) {
-//             Sheet sheet = workbook.getSheetAt(0);
-//             int rowNum = sheet.getLastRowNum();
-//             Row row = sheet.getRow(0);
-//             int startRowNum = 1;
-//             if (havTitle) {
-//                 startRowNum = 2;
-//             }
-//             for (int i = startRowNum; i <= rowNum; i++) {
-//                 row = sheet.getRow(i);
-//                 row.setHeightInPoints(height);
-//             }
-//         }
-//         downLoadExcel(fileName, response, workbook);
-//     }
-//
-//     private static void downLoadExcel(String fileName, HttpServletResponse response, Workbook workbook) {
-//         try {
-//             response.setCharacterEncoding("UTF-8");
-//             response.setHeader("content-Type", "application/vnd.ms-excel");
-//             response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName, "UTF-8"));
-//             workbook.write(response.getOutputStream());
-//         } catch (IOException e) {
-//             // throw new NormalException(e.getMessage());
-//             throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "导出Excel异常");
-//         }
-//     }
-//
-//     private static void defaultExport(List<Map<String, Object>> list, String fileName, HttpServletResponse response) {
-//         Workbook workbook = ExcelExportUtil.exportExcel(list, ExcelType.HSSF);
-//         if (workbook != null) {
-//             ;
-//         }
-//         downLoadExcel(fileName, response, workbook);
-//     }
-//
-//     public static <T> List<T> importExcel(String filePath, Integer titleRows, Integer headerRows, Class<T> pojoClass) {
-//         if (StringUtils.isBlank(filePath)) {
-//             return null;
-//         }
-//         ImportParams params = new ImportParams();
-//         params.setTitleRows(titleRows);
-//         params.setHeadRows(headerRows);
-//         List<T> list = null;
-//         try {
-//             list = ExcelImportUtil.importExcel(new File(filePath), pojoClass, params);
-//         } catch (NoSuchElementException e) {
-//             // throw new NormalException("模板不能为空");
-//         } catch (Exception e) {
-//             e.printStackTrace();
-//             // throw new NormalException(e.getMessage());
-//         }
-//         return list;
-//     }
-//
-//     public static <T> List<T> importExcel(MultipartFile file, Integer titleRows, Integer headerRows,
-//                                           Class<T> pojoClass) {
-//         if (file == null) {
-//             return null;
-//         }
-//         ImportParams params = new ImportParams();
-//         params.setTitleRows(titleRows);
-//         params.setHeadRows(headerRows);
-//         List<T> list = null;
-//         try {
-//             list = ExcelImportUtil.importExcel(file.getInputStream(), pojoClass, params);
-//         } catch (NoSuchElementException e) {
-//             // throw new NormalException("excel文件不能为空");
-//         } catch (Exception e) {
-//             // throw new NormalException(e.getMessage());
-//             System.out.println(e.getMessage());
-//         }
-//         return list;
-//     }
-//
-// }
+package com.diagbot.util;
+
+
+import cn.afterturn.easypoi.excel.ExcelExportUtil;
+import cn.afterturn.easypoi.excel.ExcelImportUtil;
+import cn.afterturn.easypoi.excel.entity.ExportParams;
+import cn.afterturn.easypoi.excel.entity.ImportParams;
+import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
+import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
+import com.diagbot.exception.CommonErrorCode;
+import com.diagbot.exception.CommonException;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.poi.ss.usermodel.Row;
+import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.ss.usermodel.Workbook;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletResponse;
+import java.io.File;
+import java.io.IOException;
+import java.net.URLEncoder;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.NoSuchElementException;
+
+/**
+ * @Description: excel 导入导出工具类
+ * @author: gaodm
+ * @time: 2020/6/2 19:18
+ */
+public class ExcelUtils {
+    public static void exportExcel(List<?> list, String title, String sheetName, Class<?> pojoClass, String fileName,
+                                   boolean isCreateHeader, HttpServletResponse response) {
+        ExportParams exportParams = new ExportParams(title, sheetName);
+        exportParams.setCreateHeadRows(isCreateHeader);
+        defaultExport(list, pojoClass, fileName, response, exportParams);
+    }
+
+    public static void exportExcelDynamicCol(List<ExcelExportEntity> entityList, Collection<?> dataSet, String title, String sheetName, String fileName,
+                                    HttpServletResponse response) {
+        ExportParams exportParams = new ExportParams(title, sheetName);
+        dynamicColExport(entityList, dataSet, fileName, response, exportParams);
+    }
+
+    public static void exportExcel(List<?> list, String title, String sheetName, Class<?> pojoClass, String fileName,
+                                   HttpServletResponse response, float height) {
+        Boolean havTitle = false;
+        if (StringUtil.isNotBlank(title)) {
+            havTitle = true;
+        }
+        userExport2(list, pojoClass, fileName, response, new ExportParams(title, sheetName), height, havTitle);
+    }
+
+    public static void exportExcel(List<?> list, String title, String sheetName, Class<?> pojoClass, String fileName,
+                                   HttpServletResponse response) {
+        defaultExport(list, pojoClass, fileName, response, new ExportParams(title, sheetName));
+    }
+
+    public static void exportExcel(List<Map<String, Object>> list, String fileName, HttpServletResponse response) {
+        defaultExport(list, fileName, response);
+    }
+
+    private static void defaultExport(List<?> list, Class<?> pojoClass, String fileName, HttpServletResponse response,
+                                      ExportParams exportParams) {
+        Workbook workbook = ExcelExportUtil.exportExcel(exportParams, pojoClass, list);
+        if (workbook != null) {
+            ;
+        }
+        downLoadExcel(fileName, response, workbook);
+    }
+
+    private static void dynamicColExport(List<ExcelExportEntity> entityList, Collection<?> dataSet, String fileName, HttpServletResponse response,
+                                         ExportParams exportParams) {
+        Workbook workbook = ExcelExportUtil.exportExcel(exportParams,entityList,dataSet);
+        if (workbook != null) {
+            ;
+        }
+        downLoadExcel(fileName, response, workbook);
+    }
+
+    private static void userExport(List<?> list, Class<?> pojoClass, String fileName, HttpServletResponse response,
+                                   ExportParams exportParams) {
+        Workbook workbook = ExcelExportUtil.exportExcel(exportParams, pojoClass, list);
+        if (workbook != null) {
+            Sheet sheet = workbook.getSheetAt(0);
+            //列宽设置
+            sheet.setColumnWidth(8, 256 * 20);
+            sheet.setColumnWidth(9, 256 * 50);
+            int rowNum = sheet.getLastRowNum();
+            Row row = sheet.getRow(0);
+            for (int i = 1; i <= rowNum; i++) {
+                row = sheet.getRow(i);
+                row.setHeightInPoints(12.8f);
+            }
+        }
+        downLoadExcel(fileName, response, workbook);
+    }
+
+    private static void userExport2(List<?> list, Class<?> pojoClass, String fileName, HttpServletResponse response,
+                                    ExportParams exportParams, float height, Boolean havTitle) {
+        Workbook workbook = ExcelExportUtil.exportExcel(exportParams, pojoClass, list);
+        if (workbook != null) {
+            Sheet sheet = workbook.getSheetAt(0);
+            int rowNum = sheet.getLastRowNum();
+            Row row = sheet.getRow(0);
+            int startRowNum = 1;
+            if (havTitle) {
+                startRowNum = 2;
+            }
+            for (int i = startRowNum; i <= rowNum; i++) {
+                row = sheet.getRow(i);
+                row.setHeightInPoints(height);
+            }
+        }
+        downLoadExcel(fileName, response, workbook);
+    }
+
+    private static void downLoadExcel(String fileName, HttpServletResponse response, Workbook workbook) {
+        try {
+            response.setCharacterEncoding("UTF-8");
+            response.setHeader("content-Type", "application/vnd.ms-excel");
+            response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName, "UTF-8"));
+            workbook.write(response.getOutputStream());
+        } catch (IOException e) {
+            // throw new NormalException(e.getMessage());
+            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "导出Excel异常");
+        }
+    }
+
+    private static void defaultExport(List<Map<String, Object>> list, String fileName, HttpServletResponse response) {
+        Workbook workbook = ExcelExportUtil.exportExcel(list, ExcelType.HSSF);
+        if (workbook != null) {
+            ;
+        }
+        downLoadExcel(fileName, response, workbook);
+    }
+
+    public static <T> List<T> importExcel(String filePath, Integer titleRows, Integer headerRows, Class<T> pojoClass) {
+        if (StringUtils.isBlank(filePath)) {
+            return null;
+        }
+        ImportParams params = new ImportParams();
+        params.setTitleRows(titleRows);
+        params.setHeadRows(headerRows);
+        List<T> list = null;
+        try {
+            list = ExcelImportUtil.importExcel(new File(filePath), pojoClass, params);
+        } catch (NoSuchElementException e) {
+            // throw new NormalException("模板不能为空");
+        } catch (Exception e) {
+            e.printStackTrace();
+            // throw new NormalException(e.getMessage());
+        }
+        return list;
+    }
+
+    public static <T> List<T> importExcel(MultipartFile file, Integer titleRows, Integer headerRows,
+                                          Class<T> pojoClass) {
+        if (file == null) {
+            return null;
+        }
+        ImportParams params = new ImportParams();
+        params.setTitleRows(titleRows);
+        params.setHeadRows(headerRows);
+        List<T> list = null;
+        try {
+            list = ExcelImportUtil.importExcel(file.getInputStream(), pojoClass, params);
+        } catch (NoSuchElementException e) {
+            // throw new NormalException("excel文件不能为空");
+        } catch (Exception e) {
+            // throw new NormalException(e.getMessage());
+            System.out.println(e.getMessage());
+        }
+        return list;
+    }
+
+}

+ 3 - 0
src/main/java/com/diagbot/vo/IndicationPushVO.java

@@ -18,4 +18,7 @@ public class IndicationPushVO extends SearchData {
      */
     @NotBlank(message = "ruleType不能为空")
     private String ruleType = "";
+
+    // 文件的行号,测试文件数据用
+    private String idNum;
 }

+ 184 - 0
src/main/java/com/diagbot/vo/TestIndicationVO.java

@@ -0,0 +1,184 @@
+package com.diagbot.vo;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.diagbot.biz.push.entity.Item;
+import com.diagbot.biz.push.entity.Lis;
+import com.diagbot.biz.push.entity.Pacs;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * <p>
+ * 测试开单合理性
+ * </p>
+ *
+ * @author zhaops
+ * @since 2020-07-28
+ */
+@Data
+public class TestIndicationVO implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 规则类型(1:危急值提醒,2:开单合理项,3:管理评估,4:不良反应,5:药物推荐,6:异常值)
+     */
+    @NotBlank(message = "ruleType不能为空")
+    private String ruleType = "";
+
+    /**
+     * 大数据返回内容截取长度
+     */
+    private Integer length = 10;
+    /**
+     * 年龄
+     */
+    @Excel(name="年龄")
+    private Integer age;
+    /**
+     * 性别(1:男,2:女,3:通用)
+     */
+    private Integer sex;
+    /**
+     * 婚姻
+     */
+    private String marriage = "";
+    /**
+     * 主诉
+     */
+    @Excel(name="主诉")
+    private String chief = "";
+    /**
+     * 现病史
+     */
+    @Excel(name="现病史")
+    private String symptom = "";
+    /**
+     * 查体
+     */
+    private String vital = "";
+    /**
+     * 既往史
+     */
+    @Excel(name="既往史")
+    private String pasts = "";
+    /**
+     * 传染病史
+     */
+    private String infectious = "";
+    /**
+     * 手术外伤史
+     */
+    private String operation = "";
+    /**
+     * 过敏史
+     */
+    private String allergy = "";
+    /**
+     * 接种史
+     */
+    private String vaccination = "";
+    /**
+     * 个人史
+     */
+    private String personal = "";
+    /**
+     * 婚育史
+     */
+    private String marital = "";
+    /**
+     * 家族史
+     */
+    private String family = "";
+    /**
+     * 月经史
+     */
+    private String menstrual = "";
+    /**
+     * 其他史
+     */
+    private String other = "";
+    /**
+     * 化验文本数据
+     */
+    private String lisString = "";
+    /**
+     * 辅检文本数据
+     */
+    private String pacsString = "";
+    /**
+     * 诊断文本数据
+     */
+    private String diagString = "";
+    /**
+     * 药品文本数据
+     */
+    private String drugString = "";
+    /**
+     * 科室
+     */
+    private List<Item> dept = new ArrayList<>();
+    /**
+     * 化验项目和结果
+     */
+    private List<Lis> lis = new ArrayList<>();
+    /**
+     * 辅检项目和结果
+     */
+    private List<Pacs> pacs = new ArrayList<>();
+    /**
+     * 诊断
+     */
+    private List<Item> diag = new ArrayList<>();
+    /**
+     * 药品
+     */
+    private List<Item> drug = new ArrayList<>();
+    /**
+     * 当前化验开单项
+     */
+    private List<Lis> lisOrder = new ArrayList<>();
+    /**
+     * 当前辅检开单项
+     */
+    private List<Pacs> pacsOrder = new ArrayList<>();
+    /**
+     * 当前诊断开单项
+     */
+    private List<Item> diagOrder = new ArrayList<>();
+    /**
+     * 当前药品开单项
+     */
+    private List<Item> drugOrder = new ArrayList<>();
+    /**
+     * 当前手术开单项
+     */
+    private List<Item> operationOrder = new ArrayList<>();
+    /**
+     * 其他开单项
+     */
+    private List<Item> otherOrder = new ArrayList<>();
+    /**
+     * 选中诊断
+     */
+    private Item diseaseName;
+
+
+
+    /************************************************扩展字段开始***********************/
+    @Excel(name="类型")
+    private String orderType;
+    @Excel(name="标准名称")
+    private String standName;
+    @Excel(name="图谱标准名称")
+    private String neoName;
+    @Excel(name="图谱类型")
+    private String neoType;
+    @Excel(name="序号")
+    private String idNum;
+    /************************************************扩展字段结束***********************/
+}

+ 21 - 0
src/main/java/com/diagbot/vo/TestLineVO.java

@@ -0,0 +1,21 @@
+package com.diagbot.vo;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * <p>
+ * 测试开单合理性
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2020-07-28
+ */
+@Data
+public class TestLineVO implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    private String idNum;
+}

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

@@ -0,0 +1,38 @@
+package com.diagbot.web;
+
+import com.diagbot.dto.RespDTO;
+import com.diagbot.facade.TestFacade;
+import com.diagbot.vo.TestLineVO;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+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 java.util.Map;
+
+/**
+ * @Description: CDSS核心测试API控制层
+ * @author: zhoutg
+ * @time: 2018/8/30 10:12
+ */
+@RestController
+@RequestMapping("/test")
+@Api(value = "测试API", tags = { "测试API" })
+@SuppressWarnings("unchecked")
+public class TestController {
+
+    @Autowired
+    private TestFacade testFacade;
+
+    @ApiOperation(value = "开单合理性测试API[zhoutg]", notes = "ruleType(1:危急值提醒,2:开单合理项,3:管理评估,4:不良反应,5:药物推荐,6:异常值)")
+    @PostMapping("/testIndication")
+    public RespDTO<Map<String, Object>> testIndication(@RequestParam("file") MultipartFile file, TestLineVO testLineVO) {
+        return RespDTO.onSuc(testFacade.importExcel(file, testLineVO));
+    }
+
+}
+