|
@@ -9,8 +9,10 @@ import com.diagbot.dto.StandConvertCrfBatchDTO;
|
|
import com.diagbot.dto.StandConvertCrfDTO;
|
|
import com.diagbot.dto.StandConvertCrfDTO;
|
|
import com.diagbot.exception.CommonErrorCode;
|
|
import com.diagbot.exception.CommonErrorCode;
|
|
import com.diagbot.exception.CommonException;
|
|
import com.diagbot.exception.CommonException;
|
|
|
|
+import com.diagbot.util.BeanUtil;
|
|
import com.diagbot.util.ExcelUtils;
|
|
import com.diagbot.util.ExcelUtils;
|
|
import com.diagbot.util.ListUtil;
|
|
import com.diagbot.util.ListUtil;
|
|
|
|
+import com.diagbot.util.RedisUtil;
|
|
import com.diagbot.util.StringUtil;
|
|
import com.diagbot.util.StringUtil;
|
|
import com.diagbot.vo.Drug;
|
|
import com.diagbot.vo.Drug;
|
|
import com.diagbot.vo.IndicationPushVO;
|
|
import com.diagbot.vo.IndicationPushVO;
|
|
@@ -24,6 +26,7 @@ import org.apache.commons.fileupload.disk.DiskFileItemFactory;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
+import org.springframework.web.multipart.commons.CommonsMultipartFile;
|
|
|
|
|
|
import java.io.File;
|
|
import java.io.File;
|
|
import java.io.FileInputStream;
|
|
import java.io.FileInputStream;
|
|
@@ -46,6 +49,8 @@ public class TestFacade {
|
|
IndicationFacade indicationFacade;
|
|
IndicationFacade indicationFacade;
|
|
@Autowired
|
|
@Autowired
|
|
StandConvertServiceClient standConvertServiceClient;
|
|
StandConvertServiceClient standConvertServiceClient;
|
|
|
|
+ @Autowired
|
|
|
|
+ RedisUtil redisUtil;
|
|
|
|
|
|
/**
|
|
/**
|
|
* 开单项数据测试
|
|
* 开单项数据测试
|
|
@@ -53,6 +58,7 @@ public class TestFacade {
|
|
* @param file
|
|
* @param file
|
|
*/
|
|
*/
|
|
public Map<String, Object> importExcel(MultipartFile file, TestLineVO testLineVO) {
|
|
public Map<String, Object> importExcel(MultipartFile file, TestLineVO testLineVO) {
|
|
|
|
+ long start = System.currentTimeMillis();
|
|
List<IndicationPushVO> indicationPushVOList = new ArrayList<>();
|
|
List<IndicationPushVO> indicationPushVOList = new ArrayList<>();
|
|
List<TestIndicationVO> data = ExcelUtils.importExcelMultiSheets(file, 0, 1, testLineVO.getSheetIndex(), TestIndicationVO.class);
|
|
List<TestIndicationVO> data = ExcelUtils.importExcelMultiSheets(file, 0, 1, testLineVO.getSheetIndex(), TestIndicationVO.class);
|
|
for (TestIndicationVO bean : data) {
|
|
for (TestIndicationVO bean : data) {
|
|
@@ -104,76 +110,92 @@ public class TestFacade {
|
|
|
|
|
|
if (StringUtil.isNotEmpty(bean.getNeoType())) {
|
|
if (StringUtil.isNotEmpty(bean.getNeoType())) {
|
|
switch (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^9/L
|
|
|
|
- // 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]);
|
|
|
|
- // lisBean.setValue(getValue(lisArr));
|
|
|
|
- // lisList.add(lisBean);
|
|
|
|
- // indicationPushVO.setLis(lisList);
|
|
|
|
- // break;
|
|
|
|
- // case "3": // 临床表现
|
|
|
|
- // indicationPushVO.setChief(bean.getNeoName());
|
|
|
|
- // break;
|
|
|
|
- // case "4": //辅助检查描述
|
|
|
|
- // indicationPushVO.setSymptom("B超:提示" + bean.getNeoName());
|
|
|
|
- // break;
|
|
|
|
- // case "5": // 诊断
|
|
|
|
- // List<Item> diag = new ArrayList<>();
|
|
|
|
- // Item diagItem = new Item();
|
|
|
|
- // diagItem.setName(bean.getNeoName());
|
|
|
|
- // diagItem.setUniqueName(bean.getNeoName());
|
|
|
|
- // diag.add(diagItem);
|
|
|
|
- // indicationPushVO.setDiag(diag);
|
|
|
|
- // break;
|
|
|
|
- // case "6": // 服用药品
|
|
|
|
- // StringBuffer symptom = new StringBuffer("发病来,神志清,精神可,胃纳一般,睡眠可,二便无殊。一直服用");
|
|
|
|
- // symptom.append(bean.getNeoName()).append("。");
|
|
|
|
- // indicationPushVO.setSymptom(symptom.toString());
|
|
|
|
- // break;
|
|
|
|
|
|
+ case "1": // 性别
|
|
|
|
+ if ("男性".equals(bean.getNeoName())) {
|
|
|
|
+ indicationPushVO.setSex(1);
|
|
|
|
+ } else if ("女性".equals(bean.getNeoName())) {
|
|
|
|
+ indicationPushVO.setSex(2);
|
|
|
|
+ }
|
|
|
|
+ break;
|
|
|
|
+ case "2": // 化验, 示例:血小板计数,<,50,10^9/L
|
|
|
|
+ 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]);
|
|
|
|
+ lisBean.setValue(getValue(lisArr));
|
|
|
|
+ lisList.add(lisBean);
|
|
|
|
+ indicationPushVO.setLis(lisList);
|
|
|
|
+ break;
|
|
|
|
+ case "3": // 临床表现
|
|
|
|
+ indicationPushVO.setChief(bean.getNeoName());
|
|
|
|
+ break;
|
|
|
|
+ case "4": //辅助检查描述
|
|
|
|
+ indicationPushVO.setSymptom("B超:提示" + bean.getNeoName());
|
|
|
|
+ break;
|
|
|
|
+ case "5": // 诊断
|
|
|
|
+ List<Item> diag = new ArrayList<>();
|
|
|
|
+ Item diagItem = new Item();
|
|
|
|
+ diagItem.setName(bean.getNeoName());
|
|
|
|
+ diagItem.setUniqueName(bean.getNeoName());
|
|
|
|
+ diag.add(diagItem);
|
|
|
|
+ indicationPushVO.setDiag(diag);
|
|
|
|
+ break;
|
|
|
|
+ case "6": // 服用药品
|
|
|
|
+ StringBuffer symptom = new StringBuffer("发病来,神志清,精神可,胃纳一般,睡眠可,二便无殊。一直服用");
|
|
|
|
+ symptom.append(bean.getNeoName()).append("。");
|
|
|
|
+ indicationPushVO.setSymptom(symptom.toString());
|
|
|
|
+ break;
|
|
case "7" : // 药品过敏原
|
|
case "7" : // 药品过敏原
|
|
StringBuffer pastStr = new StringBuffer("");
|
|
StringBuffer pastStr = new StringBuffer("");
|
|
- pastStr.append("有“").append(bean.getNeoName()).append("”过敏。");
|
|
|
|
- indicationPushVO.setPasts(pastStr.toString());
|
|
|
|
|
|
+ if ("药品通用名称".equals(bean.getDrugType())) {
|
|
|
|
+ pastStr.append("有“").append(bean.getNeoName()).append("”过敏。");
|
|
|
|
+ indicationPushVO.setPasts(pastStr.toString());
|
|
|
|
+ } else if ("药品类别".equals(bean.getDrugType())) {
|
|
|
|
+ List<String> drugList = (List<String>)redisUtil.get("药品分类_" + bean.getNeoName());
|
|
|
|
+ if (ListUtil.isNotEmpty(drugList)) {
|
|
|
|
+ for (String s : drugList) {
|
|
|
|
+ pastStr = new StringBuffer("");
|
|
|
|
+ IndicationPushVO indicationPushCopy = new IndicationPushVO();
|
|
|
|
+ BeanUtil.copyProperties(indicationPushVO, indicationPushCopy);
|
|
|
|
+ pastStr.append("有“").append(s).append("”过敏。");
|
|
|
|
+ indicationPushCopy.setPasts(pastStr.toString());
|
|
|
|
+ indicationPushCopy.setMsg("过敏药品【" + s + "】");
|
|
|
|
+ indicationPushVOList.add(indicationPushCopy);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ break;
|
|
|
|
+ case "12": // 体征
|
|
|
|
+ StringBuffer sbVital = new StringBuffer();
|
|
|
|
+ String[] vitalArr = bean.getNeoName().split(",");
|
|
|
|
+ if (vitalArr.length > 1) {
|
|
|
|
+ if ("收缩压".equals(vitalArr[0]) || "舒张压".equals(vitalArr[0])) {
|
|
|
|
+ if ("收缩压".equals(vitalArr[0])) {
|
|
|
|
+ sbVital.append("血压");
|
|
|
|
+ sbVital.append(getValue(vitalArr) + "/100mmHg");
|
|
|
|
+ indicationPushVO.setVital(sbVital.toString());
|
|
|
|
+ } else if ("舒张压".equals(vitalArr[0])) {
|
|
|
|
+ sbVital.append("血压");
|
|
|
|
+ sbVital.append("100/" + getValue(vitalArr) + "mmHg");
|
|
|
|
+ indicationPushVO.setVital(sbVital.toString());
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ // 其他数值类型
|
|
|
|
+ sbVital.append(vitalArr[0]);
|
|
|
|
+ sbVital.append(getValue(vitalArr));
|
|
|
|
+ sbVital.append(vitalArr[3]);
|
|
|
|
+ indicationPushVO.setVital(sbVital.toString());
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ sbVital.append(vitalArr[0]);
|
|
|
|
+ indicationPushVO.setVital(sbVital.toString());
|
|
|
|
+ }
|
|
break;
|
|
break;
|
|
- // case "12": // 体征
|
|
|
|
- // StringBuffer sbVital = new StringBuffer();
|
|
|
|
- // String[] vitalArr = bean.getNeoName().split(",");
|
|
|
|
- // if (vitalArr.length > 1) {
|
|
|
|
- // if ("收缩压".equals(vitalArr[0]) || "舒张压".equals(vitalArr[0])) {
|
|
|
|
- // if ("收缩压".equals(vitalArr[0])) {
|
|
|
|
- // sbVital.append("血压");
|
|
|
|
- // sbVital.append(getValue(vitalArr) + "/100mmHg");
|
|
|
|
- // indicationPushVO.setVital(sbVital.toString());
|
|
|
|
- // } else if ("舒张压".equals(vitalArr[0])) {
|
|
|
|
- // sbVital.append("血压");
|
|
|
|
- // sbVital.append("100/" + getValue(vitalArr) + "mmHg");
|
|
|
|
- // indicationPushVO.setVital(sbVital.toString());
|
|
|
|
- // }
|
|
|
|
- // } else {
|
|
|
|
- // // 其他数值类型
|
|
|
|
- // sbVital.append(vitalArr[0]);
|
|
|
|
- // sbVital.append(getValue(vitalArr));
|
|
|
|
- // sbVital.append(vitalArr[3]);
|
|
|
|
- // indicationPushVO.setVital(sbVital.toString());
|
|
|
|
- // }
|
|
|
|
- // } else {
|
|
|
|
- // sbVital.append(vitalArr[0]);
|
|
|
|
- // indicationPushVO.setVital(sbVital.toString());
|
|
|
|
- // }
|
|
|
|
- // break;
|
|
|
|
default:
|
|
default:
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
@@ -181,7 +203,7 @@ public class TestFacade {
|
|
indicationPushVOList.add(indicationPushVO);
|
|
indicationPushVOList.add(indicationPushVO);
|
|
}
|
|
}
|
|
|
|
|
|
- Map<String, Object> map = getDebugMap(indicationPushVOList, "2");
|
|
|
|
|
|
+ Map<String, Object> map = getDebugMap(indicationPushVOList, "2", start);
|
|
return map;
|
|
return map;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -191,6 +213,7 @@ public class TestFacade {
|
|
* @param file
|
|
* @param file
|
|
*/
|
|
*/
|
|
public Map<String, Object> testIndicationTransfusion(MultipartFile file, TestLineVO testLineVO) {
|
|
public Map<String, Object> testIndicationTransfusion(MultipartFile file, TestLineVO testLineVO) {
|
|
|
|
+ long start = System.currentTimeMillis();
|
|
List<IndicationPushVO> indicationPushVOList = new ArrayList<>();
|
|
List<IndicationPushVO> indicationPushVOList = new ArrayList<>();
|
|
List<TestIndicationVO> data = ExcelUtils.importExcelMultiSheets(file, 0, 1, testLineVO.getSheetIndex(), TestIndicationVO.class);
|
|
List<TestIndicationVO> data = ExcelUtils.importExcelMultiSheets(file, 0, 1, testLineVO.getSheetIndex(), TestIndicationVO.class);
|
|
for (TestIndicationVO bean : data) {
|
|
for (TestIndicationVO bean : data) {
|
|
@@ -247,7 +270,7 @@ public class TestFacade {
|
|
indicationPushVOList.add(indicationPushVO);
|
|
indicationPushVOList.add(indicationPushVO);
|
|
}
|
|
}
|
|
|
|
|
|
- Map<String, Object> map = getDebugMap(indicationPushVOList, "2");
|
|
|
|
|
|
+ Map<String, Object> map = getDebugMap(indicationPushVOList, "2", start);
|
|
return map;
|
|
return map;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -257,6 +280,7 @@ public class TestFacade {
|
|
* @param file
|
|
* @param file
|
|
*/
|
|
*/
|
|
public Map<String, Object> testHighRiskOperationExcel(MultipartFile file, TestLineVO testLineVO) {
|
|
public Map<String, Object> testHighRiskOperationExcel(MultipartFile file, TestLineVO testLineVO) {
|
|
|
|
+ long start = System.currentTimeMillis();
|
|
List<IndicationPushVO> indicationPushVOList = new ArrayList<>();
|
|
List<IndicationPushVO> indicationPushVOList = new ArrayList<>();
|
|
List<TestIndicationVO> data = ExcelUtils.importExcelMultiSheets(file, 0, 1, testLineVO.getSheetIndex(), TestIndicationVO.class);
|
|
List<TestIndicationVO> data = ExcelUtils.importExcelMultiSheets(file, 0, 1, testLineVO.getSheetIndex(), TestIndicationVO.class);
|
|
for (TestIndicationVO bean : data) {
|
|
for (TestIndicationVO bean : data) {
|
|
@@ -279,7 +303,7 @@ public class TestFacade {
|
|
indicationPushVOList.add(indicationPushVO);
|
|
indicationPushVOList.add(indicationPushVO);
|
|
}
|
|
}
|
|
|
|
|
|
- Map<String, Object> map = getDebugMap(indicationPushVOList, "3");
|
|
|
|
|
|
+ Map<String, Object> map = getDebugMap(indicationPushVOList, "3", start);
|
|
return map;
|
|
return map;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -289,6 +313,7 @@ public class TestFacade {
|
|
* @param file
|
|
* @param file
|
|
*/
|
|
*/
|
|
public Map<String, Object> testOtherTipLis(MultipartFile file, TestLineVO testLineVO) {
|
|
public Map<String, Object> testOtherTipLis(MultipartFile file, TestLineVO testLineVO) {
|
|
|
|
+ long start = System.currentTimeMillis();
|
|
List<IndicationPushVO> indicationPushVOList = new ArrayList<>();
|
|
List<IndicationPushVO> indicationPushVOList = new ArrayList<>();
|
|
List<TestIndicationVO> data = ExcelUtils.importExcelMultiSheets(file, 0, 1, testLineVO.getSheetIndex(), TestIndicationVO.class);
|
|
List<TestIndicationVO> data = ExcelUtils.importExcelMultiSheets(file, 0, 1, testLineVO.getSheetIndex(), TestIndicationVO.class);
|
|
for (TestIndicationVO bean : data) {
|
|
for (TestIndicationVO bean : data) {
|
|
@@ -325,7 +350,7 @@ public class TestFacade {
|
|
indicationPushVOList.add(indicationPushVO);
|
|
indicationPushVOList.add(indicationPushVO);
|
|
}
|
|
}
|
|
|
|
|
|
- Map<String, Object> map = getDebugMap(indicationPushVOList, "4");
|
|
|
|
|
|
+ Map<String, Object> map = getDebugMap(indicationPushVOList, "4", start);
|
|
return map;
|
|
return map;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -335,6 +360,7 @@ public class TestFacade {
|
|
* @param file
|
|
* @param file
|
|
*/
|
|
*/
|
|
public Map<String, Object> testOtherTipPacs(MultipartFile file, TestLineVO testLineVO) {
|
|
public Map<String, Object> testOtherTipPacs(MultipartFile file, TestLineVO testLineVO) {
|
|
|
|
+ long start = System.currentTimeMillis();
|
|
List<IndicationPushVO> indicationPushVOList = new ArrayList<>();
|
|
List<IndicationPushVO> indicationPushVOList = new ArrayList<>();
|
|
List<TestIndicationVO> data = ExcelUtils.importExcelMultiSheets(file, 0, 1, testLineVO.getSheetIndex(), TestIndicationVO.class);
|
|
List<TestIndicationVO> data = ExcelUtils.importExcelMultiSheets(file, 0, 1, testLineVO.getSheetIndex(), TestIndicationVO.class);
|
|
for (TestIndicationVO bean : data) {
|
|
for (TestIndicationVO bean : data) {
|
|
@@ -392,7 +418,7 @@ public class TestFacade {
|
|
indicationPushVOList.add(indicationPushVO);
|
|
indicationPushVOList.add(indicationPushVO);
|
|
}
|
|
}
|
|
|
|
|
|
- Map<String, Object> map = getDebugMap(indicationPushVOList, "4");
|
|
|
|
|
|
+ Map<String, Object> map = getDebugMap(indicationPushVOList, "4", start);
|
|
return map;
|
|
return map;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -402,6 +428,7 @@ public class TestFacade {
|
|
* @param file
|
|
* @param file
|
|
*/
|
|
*/
|
|
public Map<String, Object> testOtherTipTransfusion(MultipartFile file, TestLineVO testLineVO) {
|
|
public Map<String, Object> testOtherTipTransfusion(MultipartFile file, TestLineVO testLineVO) {
|
|
|
|
+ long start = System.currentTimeMillis();
|
|
List<IndicationPushVO> indicationPushVOList = new ArrayList<>();
|
|
List<IndicationPushVO> indicationPushVOList = new ArrayList<>();
|
|
List<TestIndicationVO> data = ExcelUtils.importExcelMultiSheets(file, 0, 1, testLineVO.getSheetIndex(), TestIndicationVO.class);
|
|
List<TestIndicationVO> data = ExcelUtils.importExcelMultiSheets(file, 0, 1, testLineVO.getSheetIndex(), TestIndicationVO.class);
|
|
for (TestIndicationVO bean : data) {
|
|
for (TestIndicationVO bean : data) {
|
|
@@ -441,7 +468,7 @@ public class TestFacade {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- Map<String, Object> map = getDebugMap(indicationPushVOList, "4");
|
|
|
|
|
|
+ Map<String, Object> map = getDebugMap(indicationPushVOList, "4", start);
|
|
return map;
|
|
return map;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -451,6 +478,7 @@ public class TestFacade {
|
|
* @param file
|
|
* @param file
|
|
*/
|
|
*/
|
|
public Map<String, Object> testHighRiskDrugExcel(MultipartFile file, TestLineVO testLineVO) {
|
|
public Map<String, Object> testHighRiskDrugExcel(MultipartFile file, TestLineVO testLineVO) {
|
|
|
|
+ long start = System.currentTimeMillis();
|
|
List<IndicationPushVO> indicationPushVOList = new ArrayList<>();
|
|
List<IndicationPushVO> indicationPushVOList = new ArrayList<>();
|
|
List<TestIndicationVO> data = ExcelUtils.importExcelMultiSheets(file, 0, 1, testLineVO.getSheetIndex(), TestIndicationVO.class);
|
|
List<TestIndicationVO> data = ExcelUtils.importExcelMultiSheets(file, 0, 1, testLineVO.getSheetIndex(), TestIndicationVO.class);
|
|
for (TestIndicationVO bean : data) {
|
|
for (TestIndicationVO bean : data) {
|
|
@@ -473,7 +501,7 @@ public class TestFacade {
|
|
indicationPushVOList.add(indicationPushVO);
|
|
indicationPushVOList.add(indicationPushVO);
|
|
}
|
|
}
|
|
|
|
|
|
- Map<String, Object> map = getDebugMap(indicationPushVOList, "3");
|
|
|
|
|
|
+ Map<String, Object> map = getDebugMap(indicationPushVOList, "3", start);
|
|
return map;
|
|
return map;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -483,6 +511,7 @@ public class TestFacade {
|
|
* @param file
|
|
* @param file
|
|
*/
|
|
*/
|
|
public Map<String, Object> importCriticalLisExcel(MultipartFile file, TestLineVO testLineVO) {
|
|
public Map<String, Object> importCriticalLisExcel(MultipartFile file, TestLineVO testLineVO) {
|
|
|
|
+ long start = System.currentTimeMillis();
|
|
List<IndicationPushVO> indicationPushVOList = new ArrayList<>();
|
|
List<IndicationPushVO> indicationPushVOList = new ArrayList<>();
|
|
List<TestIndicationVO> data = ExcelUtils.importExcelMultiSheets(file, 0, 1, testLineVO.getSheetIndex(), TestIndicationVO.class);
|
|
List<TestIndicationVO> data = ExcelUtils.importExcelMultiSheets(file, 0, 1, testLineVO.getSheetIndex(), TestIndicationVO.class);
|
|
for (TestIndicationVO bean : data) {
|
|
for (TestIndicationVO bean : data) {
|
|
@@ -522,7 +551,7 @@ public class TestFacade {
|
|
indicationPushVOList.add(indicationPushVO);
|
|
indicationPushVOList.add(indicationPushVO);
|
|
}
|
|
}
|
|
|
|
|
|
- Map<String, Object> map = getDebugMap(indicationPushVOList, "1");
|
|
|
|
|
|
+ Map<String, Object> map = getDebugMap(indicationPushVOList, "1", start);
|
|
return map;
|
|
return map;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -532,6 +561,7 @@ public class TestFacade {
|
|
* @param file
|
|
* @param file
|
|
*/
|
|
*/
|
|
public Map<String, Object> importCriticalPacsExcel(MultipartFile file, TestLineVO testLineVO) {
|
|
public Map<String, Object> importCriticalPacsExcel(MultipartFile file, TestLineVO testLineVO) {
|
|
|
|
+ long start = System.currentTimeMillis();
|
|
List<IndicationPushVO> indicationPushVOList = new ArrayList<>();
|
|
List<IndicationPushVO> indicationPushVOList = new ArrayList<>();
|
|
List<TestIndicationVO> data = ExcelUtils.importExcelMultiSheets(file, 0, 1, testLineVO.getSheetIndex(), TestIndicationVO.class);
|
|
List<TestIndicationVO> data = ExcelUtils.importExcelMultiSheets(file, 0, 1, testLineVO.getSheetIndex(), TestIndicationVO.class);
|
|
for (TestIndicationVO bean : data) {
|
|
for (TestIndicationVO bean : data) {
|
|
@@ -553,7 +583,7 @@ public class TestFacade {
|
|
indicationPushVOList.add(indicationPushVO);
|
|
indicationPushVOList.add(indicationPushVO);
|
|
}
|
|
}
|
|
|
|
|
|
- Map<String, Object> map = getDebugMap(indicationPushVOList, "1");
|
|
|
|
|
|
+ Map<String, Object> map = getDebugMap(indicationPushVOList, "1", start);
|
|
return map;
|
|
return map;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -632,6 +662,7 @@ public class TestFacade {
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
public Map<String, Object> testHighRiskProcess(MultipartFile file, TestLineVO testLineVO) {
|
|
public Map<String, Object> testHighRiskProcess(MultipartFile file, TestLineVO testLineVO) {
|
|
|
|
+ long start = System.currentTimeMillis();
|
|
List<IndicationPushVO> indicationPushVOList = new ArrayList<>();
|
|
List<IndicationPushVO> indicationPushVOList = new ArrayList<>();
|
|
List<TestIndicationVO> data = ExcelUtils.importExcelMultiSheets(file, 0, 1, testLineVO.getSheetIndex(), TestIndicationVO.class);
|
|
List<TestIndicationVO> data = ExcelUtils.importExcelMultiSheets(file, 0, 1, testLineVO.getSheetIndex(), TestIndicationVO.class);
|
|
for (TestIndicationVO bean : data) {
|
|
for (TestIndicationVO bean : data) {
|
|
@@ -798,25 +829,7 @@ public class TestFacade {
|
|
// indicationPushVOList.add(indicationPushVO);
|
|
// indicationPushVOList.add(indicationPushVO);
|
|
}
|
|
}
|
|
|
|
|
|
- Map<String, Object> map = new LinkedHashMap<>();
|
|
|
|
- List<String> msg = new ArrayList<>();
|
|
|
|
- List<String> errMsg = new ArrayList<>();
|
|
|
|
- for (IndicationPushVO indicationPushVO : indicationPushVOList) {
|
|
|
|
- try {
|
|
|
|
- IndicationDTO indicationDTO = indicationFacade.indicationFac(indicationPushVO);
|
|
|
|
- if (ListUtil.isEmpty(indicationDTO.getHighRiskList())) {
|
|
|
|
- msg.add("第【" + indicationPushVO.getIdNum() + "】行未匹配" + indicationPushVO.getMsg());
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- System.out.println(e.getMessage());
|
|
|
|
- errMsg.add(indicationPushVO.getIdNum() + "行出错了");
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- map.put("总条数", indicationPushVOList.size() + "条");
|
|
|
|
- map.put("出错条数", msg.size() + "条");
|
|
|
|
- map.put("出错信息", msg);
|
|
|
|
- map.put("程序报错", errMsg);
|
|
|
|
|
|
+ Map<String, Object> map = getDebugMap(indicationPushVOList, "3", start);
|
|
return map;
|
|
return map;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -827,7 +840,7 @@ public class TestFacade {
|
|
* @param ruleType
|
|
* @param ruleType
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
- public Map getDebugMap(List<IndicationPushVO> indicationPushVOList, String ruleType) {
|
|
|
|
|
|
+ public Map getDebugMap(List<IndicationPushVO> indicationPushVOList, String ruleType, long start) {
|
|
Map<String, Object> map = new LinkedHashMap<>();
|
|
Map<String, Object> map = new LinkedHashMap<>();
|
|
List<String> msg = new ArrayList<>();
|
|
List<String> msg = new ArrayList<>();
|
|
List<String> errMsg = new ArrayList<>();
|
|
List<String> errMsg = new ArrayList<>();
|
|
@@ -837,22 +850,26 @@ public class TestFacade {
|
|
switch (ruleType) {
|
|
switch (ruleType) {
|
|
case "1":
|
|
case "1":
|
|
if (ListUtil.isEmpty(indicationDTO.getCriticalValList())) {
|
|
if (ListUtil.isEmpty(indicationDTO.getCriticalValList())) {
|
|
- msg.add("第【" + indicationPushVO.getIdNum() + "】行未匹配");
|
|
|
|
|
|
+ msg.add("第【" + indicationPushVO.getIdNum() + "】行未匹配,"
|
|
|
|
+ + (StringUtil.isNotBlank(indicationPushVO.getMsg()) ? indicationPushVO.getMsg() : ""));
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
case "2":
|
|
case "2":
|
|
if (ListUtil.isEmpty(indicationDTO.getBillMsgList())) {
|
|
if (ListUtil.isEmpty(indicationDTO.getBillMsgList())) {
|
|
- msg.add("第【" + indicationPushVO.getIdNum() + "】行未匹配");
|
|
|
|
|
|
+ msg.add("第【" + indicationPushVO.getIdNum() + "】行未匹配。"
|
|
|
|
+ + (StringUtil.isNotBlank(indicationPushVO.getMsg()) ? indicationPushVO.getMsg() : ""));
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
case "3":
|
|
case "3":
|
|
if (ListUtil.isEmpty(indicationDTO.getHighRiskList())) {
|
|
if (ListUtil.isEmpty(indicationDTO.getHighRiskList())) {
|
|
- msg.add("第【" + indicationPushVO.getIdNum() + "】行未匹配");
|
|
|
|
|
|
+ msg.add("第【" + indicationPushVO.getIdNum() + "】行未匹配。"
|
|
|
|
+ + (StringUtil.isNotBlank(indicationPushVO.getMsg()) ? indicationPushVO.getMsg() : ""));
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
case "4":
|
|
case "4":
|
|
if (ListUtil.isEmpty(indicationDTO.getOtherList())) {
|
|
if (ListUtil.isEmpty(indicationDTO.getOtherList())) {
|
|
- msg.add("第【" + indicationPushVO.getIdNum() + "】行未匹配");
|
|
|
|
|
|
+ msg.add("第【" + indicationPushVO.getIdNum() + "】行未匹配。"
|
|
|
|
+ + (StringUtil.isNotBlank(indicationPushVO.getMsg()) ? indicationPushVO.getMsg() : ""));
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
default:
|
|
default:
|
|
@@ -867,6 +884,7 @@ public class TestFacade {
|
|
map.put("出错条数", msg.size() + "条");
|
|
map.put("出错条数", msg.size() + "条");
|
|
map.put("出错信息", msg);
|
|
map.put("出错信息", msg);
|
|
map.put("程序报错", errMsg);
|
|
map.put("程序报错", errMsg);
|
|
|
|
+ map.put("执行时间", (System.currentTimeMillis() - start) / 1000.0 + "秒");
|
|
return map;
|
|
return map;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -879,21 +897,52 @@ public class TestFacade {
|
|
indicationPushVO.setOperationOrder(operationOrder);
|
|
indicationPushVO.setOperationOrder(operationOrder);
|
|
}
|
|
}
|
|
|
|
|
|
- private FileItem createFileItem(File file) {
|
|
|
|
- String fieldName = "textField";
|
|
|
|
|
|
+ public Map testAll() {
|
|
|
|
+ Map<String, Object> map = new LinkedHashMap<>();
|
|
|
|
+ String picPathLis ="D:\\newSVN\\2020新版CDSS\\05.其他资料\\数据\\【危急值_化验】.xlsx";
|
|
|
|
+ String picPathPacs ="D:\\newSVN\\2020新版CDSS\\05.其他资料\\数据\\【危急值_辅检】.xls";
|
|
|
|
+ MultipartFile file = null;
|
|
|
|
+
|
|
|
|
+ file = getMulFileByPath(picPathLis);
|
|
|
|
+ Map<String, Object> criticalMapLis = importCriticalLisExcel(file, new TestLineVO());
|
|
|
|
+ map.put("【危急值_化验】",criticalMapLis);
|
|
|
|
+
|
|
|
|
+ file = getMulFileByPath(picPathPacs);
|
|
|
|
+ Map<String, Object> criticalMapPacs = importCriticalPacsExcel(file, new TestLineVO());
|
|
|
|
+ map.put("【危急值_辅检】",criticalMapPacs);
|
|
|
|
+ return map;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private MultipartFile getMulFileByPath(String picPath) {
|
|
|
|
+ FileItem fileItem = createFileItem(picPath);
|
|
|
|
+ MultipartFile mfile = new CommonsMultipartFile(fileItem);
|
|
|
|
+ return mfile;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private FileItem createFileItem(String filePath) {
|
|
FileItemFactory factory = new DiskFileItemFactory(16, null);
|
|
FileItemFactory factory = new DiskFileItemFactory(16, null);
|
|
- FileItem item = factory.createItem(fieldName, "text/plain", true, file.getName());
|
|
|
|
|
|
+ String textFieldName = "textField";
|
|
|
|
+ int num = filePath.lastIndexOf(".");
|
|
|
|
+ String extFile = filePath.substring(num);
|
|
|
|
+ FileItem item = factory.createItem(textFieldName, "text/plain", true,
|
|
|
|
+ "MyFileName" + extFile);
|
|
|
|
+ File newfile = new File(filePath);
|
|
int bytesRead = 0;
|
|
int bytesRead = 0;
|
|
byte[] buffer = new byte[8192];
|
|
byte[] buffer = new byte[8192];
|
|
- try {
|
|
|
|
- FileInputStream fis = new FileInputStream(file);
|
|
|
|
|
|
+ try
|
|
|
|
+ {
|
|
|
|
+ FileInputStream fis = new FileInputStream(newfile);
|
|
OutputStream os = item.getOutputStream();
|
|
OutputStream os = item.getOutputStream();
|
|
- while ((bytesRead = fis.read(buffer, 0, 8192)) != -1) {
|
|
|
|
|
|
+ while ((bytesRead = fis.read(buffer, 0, 8192))
|
|
|
|
+ != -1)
|
|
|
|
+ {
|
|
os.write(buffer, 0, bytesRead);
|
|
os.write(buffer, 0, bytesRead);
|
|
}
|
|
}
|
|
os.close();
|
|
os.close();
|
|
fis.close();
|
|
fis.close();
|
|
- } catch (IOException e) {
|
|
|
|
|
|
+ }
|
|
|
|
+ catch (IOException e)
|
|
|
|
+ {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
}
|
|
}
|
|
return item;
|
|
return item;
|