|
@@ -18,25 +18,30 @@ 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;
|
|
|
import com.diagbot.dto.DiagnosticBasisExportDTO;
|
|
|
import com.diagbot.dto.EquationDTO;
|
|
|
import com.diagbot.dto.FeatureDTO;
|
|
|
import com.diagbot.dto.RespDTO;
|
|
|
+import com.diagbot.entity.DiagnoseDetail;
|
|
|
import com.diagbot.entity.DiagnoseQuestion;
|
|
|
import com.diagbot.enums.DiagnoseFeatureTypeEnum;
|
|
|
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.util.ExportBeanExcelUtil;
|
|
|
import com.diagbot.util.GsonUtil;
|
|
|
import com.diagbot.util.StringUtil;
|
|
|
+import com.diagbot.vo.DiagnosticAllExportVO;
|
|
|
import com.diagbot.vo.DiagnosticBasisExportVO;
|
|
|
|
|
|
/**
|
|
@@ -50,6 +55,9 @@ public class DiagnoseImportFacade {
|
|
|
|
|
|
@Autowired
|
|
|
DiagnoseQuestionService diagnoseQuestionService;
|
|
|
+ @Autowired
|
|
|
+ @Qualifier("diagnoseDetailServiceImpl")
|
|
|
+ DiagnoseDetailService diagnoseDetailService;
|
|
|
|
|
|
@SuppressWarnings("null")
|
|
|
public RespDTO<DiagnoseImportDTO> importDiagnosticBasisAll(MultipartFile file, HttpServletRequest request) {
|
|
@@ -211,7 +219,8 @@ public class DiagnoseImportFacade {
|
|
|
|
|
|
public void exportDiagnosticBasis(DiagnosticBasisExportVO diaExportVO, HttpServletResponse response) {
|
|
|
QueryWrapper<DiagnoseQuestion> diaQuery = new QueryWrapper<>();
|
|
|
- diaQuery.like("dis_name",diaExportVO.getDisName()).like("question_name",diaExportVO.getQuestion()).like("type",diaExportVO.getType()).eq("is_deleted",IsDeleteEnum.N.getKey());
|
|
|
+ diaQuery.like("dis_name", diaExportVO.getDisName()).like("question_name", diaExportVO.getQuestion())
|
|
|
+ .like("type", diaExportVO.getType()).eq("is_deleted", IsDeleteEnum.N.getKey());
|
|
|
List<DiagnoseQuestion> datas = diagnoseQuestionService.list(diaQuery);
|
|
|
|
|
|
GsonUtil.toJson(datas);
|
|
@@ -251,15 +260,61 @@ public class DiagnoseImportFacade {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ *
|
|
|
+ * @param diaAllExportVO
|
|
|
+ * @param response
|
|
|
+ */
|
|
|
+ public void exportDiagnosticAll(DiagnosticAllExportVO diaAllExportVO, HttpServletResponse response) {
|
|
|
+ QueryWrapper<DiagnoseDetail> diaQuery = new QueryWrapper<>();
|
|
|
+ diaQuery.eq("diagnose_id", diaAllExportVO.getDisId()).eq("is_deleted", IsDeleteEnum.N.getKey());
|
|
|
+ List<DiagnoseDetail> datas = diagnoseDetailService.list(diaQuery);
|
|
|
+
|
|
|
+ GsonUtil.toJson(datas);
|
|
|
+ System.out.println(GsonUtil.toJson(datas));
|
|
|
+ List<String> listName = new ArrayList<>();
|
|
|
+
|
|
|
+ listName.add("类型");
|
|
|
+ listName.add("序号");
|
|
|
+ listName.add("标准词*");
|
|
|
+ listName.add("是否需要病史采集");
|
|
|
+ listName.add("关联词");
|
|
|
+ listName.add("结果");
|
|
|
+
|
|
|
+ List<String> listId = new ArrayList<>();
|
|
|
+ listId.add("type");
|
|
|
+ listId.add("code");
|
|
|
+ listId.add("standard");
|
|
|
+ listId.add("historyTaking");
|
|
|
+ listId.add("relation");
|
|
|
+ listId.add("result");
|
|
|
+
|
|
|
+
|
|
|
+ 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(DiagnoseFeatureTypeEnum.getName(diagnose.getType()), diagnose.getCode(),
|
|
|
+ diagnose.getStandard(), "", diagnose.getRelation(), diagnose.getResult()));
|
|
|
+
|
|
|
+ }
|
|
|
+ response.setContentType("text/html;charset=UTF-8");
|
|
|
+ ExportBeanExcelUtil ex = new ExportBeanExcelUtil();
|
|
|
+ ex.exportExcelNew(disName, listName, listId, list, response);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 导出类型转换
|
|
|
+ *
|
|
|
* @param type
|
|
|
* @param questionType
|
|
|
* @return
|
|
|
*/
|
|
|
public String getType(Integer type, Integer questionType) {
|
|
|
String typeName = "";
|
|
|
- if (type == DiagnoseFeatureTypeEnum.Dis.getKey()){
|
|
|
+ if (type == DiagnoseFeatureTypeEnum.Dis.getKey()) {
|
|
|
typeName = TermEnum.getName(0);
|
|
|
} else if (type == DiagnoseFeatureTypeEnum.Symptom.getKey()) {
|
|
|
typeName = TermEnum.getName(1);
|
|
@@ -296,4 +351,5 @@ public class DiagnoseImportFacade {
|
|
|
|
|
|
return typeName;
|
|
|
}
|
|
|
+
|
|
|
}
|