|
@@ -3,14 +3,17 @@ package com.diagbot.facade;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
+import com.diagbot.dto.DefaultExportDTO;
|
|
|
import com.diagbot.dto.IndicationExportDTO;
|
|
|
import com.diagbot.dto.KlRuleByIdDTO;
|
|
|
import com.diagbot.dto.KlRuleByIdParDTO;
|
|
|
import com.diagbot.dto.KlRuleByIdSubDTO;
|
|
|
import com.diagbot.dto.KlRuleInfoDTO;
|
|
|
+import com.diagbot.dto.OtherExportDTO;
|
|
|
import com.diagbot.entity.KlRule;
|
|
|
import com.diagbot.entity.KlRuleBase;
|
|
|
import com.diagbot.entity.KlRuleCondition;
|
|
|
+import com.diagbot.enums.CommonEnum;
|
|
|
import com.diagbot.enums.IsDeleteEnum;
|
|
|
import com.diagbot.exception.CommonErrorCode;
|
|
|
import com.diagbot.exception.CommonException;
|
|
@@ -18,14 +21,17 @@ import com.diagbot.service.impl.KlRuleServiceImpl;
|
|
|
import com.diagbot.util.BeanUtil;
|
|
|
import com.diagbot.util.DateUtil;
|
|
|
import com.diagbot.util.ExcelUtils;
|
|
|
+import com.diagbot.util.ExtUtil;
|
|
|
import com.diagbot.util.ListUtil;
|
|
|
import com.diagbot.util.StringUtil;
|
|
|
+import com.diagbot.vo.ExportDafaultVO;
|
|
|
import com.diagbot.vo.KlRuleByIdVO;
|
|
|
import com.diagbot.vo.KlRuleInfoClearVO;
|
|
|
import com.diagbot.vo.KlRuleInfoSaveSubVO;
|
|
|
import com.diagbot.vo.KlRuleInfoSaveVO;
|
|
|
import com.diagbot.vo.KlRuleInfoVO;
|
|
|
import com.diagbot.vo.KlRuleSatartOrdisaVO;
|
|
|
+import com.google.common.collect.Lists;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
@@ -33,6 +39,7 @@ import javax.servlet.http.HttpServletResponse;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
|
|
|
/**
|
|
|
* @Description:
|
|
@@ -250,4 +257,115 @@ public class KlRuleFacade extends KlRuleServiceImpl {
|
|
|
ExcelUtils.exportExcel(indicationExportDTOS, null, "开单合理性", IndicationExportDTO.class, "indication.xlsx",
|
|
|
response, 12.8f);
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 其他值提醒化验导出
|
|
|
+ *
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public void exportOtherLis(HttpServletResponse response) {
|
|
|
+ ExportDafaultVO exportDafaultVO = new ExportDafaultVO();
|
|
|
+ exportDafaultVO.setRuleType(4);
|
|
|
+ exportDafaultVO.setLibTypeList(Lists.newArrayList(108L));
|
|
|
+ List<OtherExportDTO> otherExportDTOList = generateExport(exportDafaultVO);
|
|
|
+ ExcelUtils.exportExcel(otherExportDTOList, null, "其他值提醒化验", OtherExportDTO.class, "otherLis.xlsx",
|
|
|
+ response, 12.8F);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 其他值提醒辅检导出
|
|
|
+ *
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public void exportOtherPacs(HttpServletResponse response) {
|
|
|
+ ExportDafaultVO exportDafaultVO = new ExportDafaultVO();
|
|
|
+ exportDafaultVO.setRuleType(4);
|
|
|
+ exportDafaultVO.setLibTypeList(Lists.newArrayList(112L));
|
|
|
+ List<OtherExportDTO> otherExportDTOList = generateExport(exportDafaultVO);
|
|
|
+ ExcelUtils.exportExcel(otherExportDTOList, null, "其他值提醒辅检", OtherExportDTO.class, "otherPacs.xlsx",
|
|
|
+ response, 12.8F);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 其他值提醒输血导出
|
|
|
+ *
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public void exportOtherTransfusion(HttpServletResponse response) {
|
|
|
+ ExportDafaultVO exportDafaultVO = new ExportDafaultVO();
|
|
|
+ exportDafaultVO.setRuleType(5);
|
|
|
+ exportDafaultVO.setLibTypeList(Lists.newArrayList(108L));
|
|
|
+ List<OtherExportDTO> otherExportDTOList = generateExport(exportDafaultVO);
|
|
|
+ ExcelUtils.exportExcel(otherExportDTOList, null, "其他值提醒输血", OtherExportDTO.class, "otherTransfusion.xlsx",
|
|
|
+ response, 12.8F);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 其他值提醒输血导出
|
|
|
+ *
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public void exportCriticalLis(HttpServletResponse response) {
|
|
|
+ ExportDafaultVO exportDafaultVO = new ExportDafaultVO();
|
|
|
+ exportDafaultVO.setRuleType(3);
|
|
|
+ exportDafaultVO.setLibTypeList(Lists.newArrayList(108L));
|
|
|
+ List<OtherExportDTO> otherExportDTOList = generateExport(exportDafaultVO);
|
|
|
+ ExcelUtils.exportExcel(otherExportDTOList, null, "危急值化验", OtherExportDTO.class, "criticalLis.xlsx",
|
|
|
+ response, 12.8F);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 其他值提醒输血导出
|
|
|
+ *
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public void exportCriticalPacs(HttpServletResponse response) {
|
|
|
+ ExportDafaultVO exportDafaultVO = new ExportDafaultVO();
|
|
|
+ exportDafaultVO.setRuleType(3);
|
|
|
+ exportDafaultVO.setLibTypeList(Lists.newArrayList(112L));
|
|
|
+ List<OtherExportDTO> otherExportDTOList = generateExport(exportDafaultVO);
|
|
|
+ ExcelUtils.exportExcel(otherExportDTOList, null, "危急值辅检", OtherExportDTO.class, "criticalPacs.xlsx",
|
|
|
+ response, 12.8F);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 生成导出类
|
|
|
+ *
|
|
|
+ * @param exportDafaultVO
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public List<OtherExportDTO> generateExport(ExportDafaultVO exportDafaultVO) {
|
|
|
+ // 导出类
|
|
|
+ List<OtherExportDTO> otherExportDTOList = new ArrayList<>();
|
|
|
+ List<DefaultExportDTO> defaultExportDTOS = exportOther(exportDafaultVO);
|
|
|
+ Map<String, List<DefaultExportDTO>> multiKeyList = ExtUtil.getMultiKeyList(defaultExportDTOS, CommonEnum.splitSymbol.getName(), "ruleId", "groupType");
|
|
|
+ for (String key : multiKeyList.keySet()) {
|
|
|
+ List<DefaultExportDTO> defaultList = multiKeyList.get(key);
|
|
|
+ DefaultExportDTO defaultExportDTO = defaultList.get(0);
|
|
|
+ // rule中conceptId也是规则匹配的一部分,手动添加,判断依据是conceptId和baseConcept如果不一样的,就添加一条
|
|
|
+ if (!defaultExportDTO.getConceptId().equals(defaultExportDTO.getBaseConcept())) {
|
|
|
+ DefaultExportDTO addDefault = new DefaultExportDTO();
|
|
|
+ BeanUtil.copyProperties(defaultExportDTO, addDefault);
|
|
|
+ addDefault.setBaseConcept(defaultExportDTO.getConceptId());
|
|
|
+ addDefault.setBaseName(defaultExportDTO.getLibName());
|
|
|
+ addDefault.setBaseTypeCn(defaultExportDTO.getLibTypeCn());
|
|
|
+ addDefault.setMinValue("");
|
|
|
+ addDefault.setMinOperator("");
|
|
|
+ addDefault.setMaxValue("");
|
|
|
+ addDefault.setMaxOperator("");
|
|
|
+ addDefault.setEqValue("");
|
|
|
+ List<DefaultExportDTO> newDefaultList = Lists.newArrayList();
|
|
|
+ newDefaultList.add(addDefault);
|
|
|
+ newDefaultList.addAll(defaultList);
|
|
|
+ multiKeyList.put(key, newDefaultList);
|
|
|
+ defaultList = newDefaultList;
|
|
|
+ }
|
|
|
+ OtherExportDTO otherExportDTO = new OtherExportDTO();
|
|
|
+ otherExportDTO.setRuleGroup(defaultExportDTO.getRuleGroup());
|
|
|
+ otherExportDTO.setMsg(defaultExportDTO.getMsg());
|
|
|
+ otherExportDTO.setDefaultExportDTOList(defaultList);
|
|
|
+ otherExportDTOList.add(otherExportDTO);
|
|
|
+ }
|
|
|
+ return otherExportDTOList;
|
|
|
+ }
|
|
|
}
|