|
@@ -1,31 +1,5 @@
|
|
|
package com.diagbot.facade;
|
|
|
|
|
|
-import java.io.InputStream;
|
|
|
-import java.text.DecimalFormat;
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.Date;
|
|
|
-import java.util.List;
|
|
|
-
|
|
|
-import javax.servlet.http.HttpServletRequest;
|
|
|
-import javax.servlet.http.HttpServletResponse;
|
|
|
-
|
|
|
-import com.diagbot.entity.Diagnose;
|
|
|
-import com.diagbot.entity.VersionInfo;
|
|
|
-import com.diagbot.enums.HasQuestionEnum;
|
|
|
-import com.diagbot.service.DiagnoseService;
|
|
|
-import org.apache.commons.lang.time.DateFormatUtils;
|
|
|
-import org.apache.poi.hssf.usermodel.HSSFDateUtil;
|
|
|
-import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
|
|
-import org.apache.poi.ss.usermodel.Cell;
|
|
|
-import org.apache.poi.ss.usermodel.Row;
|
|
|
-import org.apache.poi.ss.usermodel.Sheet;
|
|
|
-import org.apache.poi.ss.usermodel.Workbook;
|
|
|
-import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.beans.factory.annotation.Qualifier;
|
|
|
-import org.springframework.stereotype.Component;
|
|
|
-import org.springframework.web.multipart.MultipartFile;
|
|
|
-
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.diagbot.dto.DiagnoseImportDTO;
|
|
|
import com.diagbot.dto.DiagnosticAllExportDTO;
|
|
@@ -33,21 +7,44 @@ import com.diagbot.dto.DiagnosticBasisExportDTO;
|
|
|
import com.diagbot.dto.EquationDTO;
|
|
|
import com.diagbot.dto.FeatureDTO;
|
|
|
import com.diagbot.dto.RespDTO;
|
|
|
+import com.diagbot.entity.Diagnose;
|
|
|
import com.diagbot.entity.DiagnoseDetail;
|
|
|
import com.diagbot.entity.DiagnoseQuestion;
|
|
|
import com.diagbot.enums.DiagnoseFeatureTypeEnum;
|
|
|
import com.diagbot.enums.DiagnoseTypeEnum;
|
|
|
+import com.diagbot.enums.HasQuestionEnum;
|
|
|
import com.diagbot.enums.IsDeleteEnum;
|
|
|
import com.diagbot.enums.TermEnum;
|
|
|
import com.diagbot.exception.CommonErrorCode;
|
|
|
import com.diagbot.exception.CommonException;
|
|
|
import com.diagbot.service.DiagnoseDetailService;
|
|
|
import com.diagbot.service.DiagnoseQuestionService;
|
|
|
+import com.diagbot.service.DiagnoseService;
|
|
|
import com.diagbot.util.ExportBeanExcelUtil;
|
|
|
import com.diagbot.util.GsonUtil;
|
|
|
import com.diagbot.util.StringUtil;
|
|
|
import com.diagbot.vo.DiagnosticAllExportVO;
|
|
|
import com.diagbot.vo.DiagnosticBasisExportVO;
|
|
|
+import org.apache.commons.lang.time.DateFormatUtils;
|
|
|
+import org.apache.poi.hssf.usermodel.HSSFDateUtil;
|
|
|
+import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
|
|
+import org.apache.poi.ss.usermodel.Cell;
|
|
|
+import org.apache.poi.ss.usermodel.Row;
|
|
|
+import org.apache.poi.ss.usermodel.Sheet;
|
|
|
+import org.apache.poi.ss.usermodel.Workbook;
|
|
|
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.beans.factory.annotation.Qualifier;
|
|
|
+import org.springframework.stereotype.Component;
|
|
|
+import org.springframework.web.multipart.MultipartFile;
|
|
|
+
|
|
|
+import javax.servlet.http.HttpServletRequest;
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
+import java.io.InputStream;
|
|
|
+import java.text.DecimalFormat;
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.Date;
|
|
|
+import java.util.List;
|
|
|
|
|
|
/**
|
|
|
* @author wangfeng
|
|
@@ -261,18 +258,16 @@ public class DiagnoseImportFacade {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- *
|
|
|
* @param diaAllExportVO
|
|
|
* @param response
|
|
|
*/
|
|
|
public void exportDiagnosticAll(DiagnosticAllExportVO diaAllExportVO, HttpServletResponse response) {
|
|
|
//判断是否无问题词
|
|
|
QueryWrapper<Diagnose> diagnoseQuery = new QueryWrapper<>();
|
|
|
- diagnoseQuery.eq("is_deleted",IsDeleteEnum.N.getKey())
|
|
|
- .eq("has_question",HasQuestionEnum.NO_QUESTION.getKey())
|
|
|
- .eq("id", diaAllExportVO.getDiagnoseId());
|
|
|
- Diagnose diagnoseData = diagnoseService.getOne(diagnoseQuery, false);
|
|
|
- if (diagnoseData == null ) {
|
|
|
+ diagnoseQuery.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
+ .eq("has_question", HasQuestionEnum.NO_QUESTION.getKey())
|
|
|
+ .eq("id", diaAllExportVO.getDiagnoseId());
|
|
|
+ if (0 == diagnoseService.count(diagnoseQuery)) {
|
|
|
throw new CommonException(CommonErrorCode.NOT_EXISTS, "该诊断依据存在问题!");
|
|
|
}
|
|
|
|
|
@@ -300,13 +295,13 @@ public class DiagnoseImportFacade {
|
|
|
listId.add("result");
|
|
|
|
|
|
|
|
|
- String disName =(datas.size()>0)?datas.get(0).getDisName():" ";
|
|
|
+ String disName = (datas.size() > 0) ? datas.get(0).getDisName() : " ";
|
|
|
List<DiagnosticAllExportDTO> list = new ArrayList<>();
|
|
|
for (int i = 0; i < datas.size(); i++) {
|
|
|
DiagnoseDetail diagnose = datas.get(i);
|
|
|
disName = diagnose.getDisName();
|
|
|
list.add(new DiagnosticAllExportDTO(getDisType(diagnose.getType()), diagnose.getCode(),
|
|
|
- diagnose.getStandard(), "", getRelation(diagnose.getType(),diagnose), diagnose.getResult()));
|
|
|
+ diagnose.getStandard(), "", getRelation(diagnose.getType(), diagnose), diagnose.getResult()));
|
|
|
|
|
|
}
|
|
|
response.setContentType("text/html;charset=UTF-8");
|
|
@@ -360,30 +355,30 @@ public class DiagnoseImportFacade {
|
|
|
}
|
|
|
return typeName;
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
* 导出公式类型转换
|
|
|
- *
|
|
|
*/
|
|
|
public String getDisType(Integer type) {
|
|
|
String typeName = "";
|
|
|
|
|
|
typeName = DiagnoseFeatureTypeEnum.getName(type);
|
|
|
- if(typeName == null){
|
|
|
+ if (typeName == null) {
|
|
|
typeName = DiagnoseTypeEnum.getName(type);
|
|
|
}
|
|
|
return typeName;
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
* 导出公式和标准词切换
|
|
|
- *
|
|
|
*/
|
|
|
- public String getRelation(Integer type, DiagnoseDetail diagnose ) {
|
|
|
+ public String getRelation(Integer type, DiagnoseDetail diagnose) {
|
|
|
String typeName = "";
|
|
|
String relation = "";
|
|
|
typeName = DiagnoseFeatureTypeEnum.getName(type);
|
|
|
- relation = diagnose.getRelation();
|
|
|
- if(typeName == null ){
|
|
|
- relation = diagnose.getFormula();
|
|
|
+ relation = diagnose.getRelation();
|
|
|
+ if (typeName == null) {
|
|
|
+ relation = diagnose.getFormula();
|
|
|
}
|
|
|
return relation;
|
|
|
}
|