diff --git a/pom.xml b/pom.xml index 5b9eae3..43bc760 100644 --- a/pom.xml +++ b/pom.xml @@ -93,6 +93,12 @@ ${pagehelper.version} + + com.itextpdf + kernel + 7.1.11 + + com.alibaba diff --git a/src/main/java/com/emr/controller/FontController.java b/src/main/java/com/emr/controller/FontController.java index 21bc898..bd7f072 100644 --- a/src/main/java/com/emr/controller/FontController.java +++ b/src/main/java/com/emr/controller/FontController.java @@ -6,6 +6,7 @@ import com.emr.dao.TPrintinfoMapper; import com.emr.entity.*; import com.emr.service.Archive_DetailService; import com.emr.service.Archive_MasterService; +import com.emr.service.BatchExportService; import com.emr.service.ipml.*; import com.emr.util.DateUtil; import com.emr.util.ExceptionPrintUtil; @@ -64,6 +65,8 @@ public class FontController { private ArchiveOtherExtService archiveOtherExtService; @Autowired private TPrintinfoMapper tPrintinfoMapper; + @Autowired + private BatchExportService batchExportService; @RequestMapping("selectIsPrintByPatienId") @ResponseBody @@ -693,4 +696,19 @@ public class FontController { archiveOtherExtService.updateOtherDomForStatusFlag(jzh,detailIds); return Msg.success(); } + + + + /** + * @description: 批量导出病历接口 + * @params: taskid + * @return: String + * @author linjj + * @date: 2024/4/12 13:55 + */ + @ResponseBody + @RequestMapping(value = "BatchExportPdf") + public String batchExportPdf(int taskid) throws Exception { + return batchExportService.batchExportPdf(taskid); + } } diff --git a/src/main/java/com/emr/controller/VCountController.java b/src/main/java/com/emr/controller/VCountController.java index 99cdca2..dba1a11 100644 --- a/src/main/java/com/emr/controller/VCountController.java +++ b/src/main/java/com/emr/controller/VCountController.java @@ -60,6 +60,21 @@ public class VCountController { } } +// @ResponseBody +// @RequestMapping(value = "/vCountNumList") +// public List medicalCountDayList(V_CountVo vCount){ +// try { +// //统计列表 +// return v_countService.selectByCol(vCount); +// } catch (Exception e) { +// ExceptionPrintUtil.printException(e); +// e.printStackTrace(); +// return null; +// } +// } + + + @ResponseBody @RequestMapping(value = "/vCountNumList") public List medicalCountDayList(V_CountVo vCount){ diff --git a/src/main/java/com/emr/dao/BatchExportMapper.java b/src/main/java/com/emr/dao/BatchExportMapper.java new file mode 100644 index 0000000..4576dff --- /dev/null +++ b/src/main/java/com/emr/dao/BatchExportMapper.java @@ -0,0 +1,18 @@ +package com.emr.dao; + +import com.emr.vo.ExportTaskVo; + +import java.util.List; + +/** + * @InterfaceName BatchExportMapper + * @Description 国家病历批量导出接口 + * @Author linjj + * @Date 2024/4/12 11:44 + * @Version 1.0 + */ +public interface BatchExportMapper { + + //查询所有任务 + List selectAll(int taskState); +} diff --git a/src/main/java/com/emr/dao/ExportTaskDetailsMapper.java b/src/main/java/com/emr/dao/ExportTaskDetailsMapper.java new file mode 100644 index 0000000..e714741 --- /dev/null +++ b/src/main/java/com/emr/dao/ExportTaskDetailsMapper.java @@ -0,0 +1,22 @@ +package com.emr.dao; + +import com.emr.vo.ExportTaskDetailsVo; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @InterfaceName ExportTaskDetailsMapper + * @Description 批量导出详情接口 + * @Author linjj + * @Date 2024/4/12 14:03 + * @Version 1.0 + */ +public interface ExportTaskDetailsMapper { + + List selectAllByTaskId(int taskId); + + List getMasterId(@Param("inpNo") String inpNo, @Param("dischargeDateTime") String dischargeDateTime); + + int upStatc(@Param("state") int state,@Param("id") int id); +} diff --git a/src/main/java/com/emr/dao/ExportZdAssortMapper.java b/src/main/java/com/emr/dao/ExportZdAssortMapper.java new file mode 100644 index 0000000..4678703 --- /dev/null +++ b/src/main/java/com/emr/dao/ExportZdAssortMapper.java @@ -0,0 +1,14 @@ +package com.emr.dao; + +import com.emr.vo.ExportPdfVo; +import com.emr.vo.ExportZdAssortVo; + +import java.util.List; + +public interface ExportZdAssortMapper { + + ListgetPdfPath(String masterId); + + ListselectAll(); + +} \ No newline at end of file diff --git a/src/main/java/com/emr/dao/V_CountMapper.java b/src/main/java/com/emr/dao/V_CountMapper.java index d4b7a11..c957b00 100644 --- a/src/main/java/com/emr/dao/V_CountMapper.java +++ b/src/main/java/com/emr/dao/V_CountMapper.java @@ -9,6 +9,16 @@ import java.util.List; public interface V_CountMapper { List selectByCol(V_CountVo record); + List selectByColCount(V_CountVo record); + + List getFileNum(V_CountVo record); + + List getDeathNum(V_CountVo record); + + List getDay2Rate(V_CountVo record); + + List getDay3Rate(V_CountVo record); + // /** // * 根据条件查找统计列表分页 // * diff --git a/src/main/java/com/emr/service/BatchExportService.java b/src/main/java/com/emr/service/BatchExportService.java new file mode 100644 index 0000000..8bbd2f1 --- /dev/null +++ b/src/main/java/com/emr/service/BatchExportService.java @@ -0,0 +1,20 @@ +package com.emr.service; + +import com.emr.vo.ExportTaskVo; + +import java.util.List; + +/** + * @InterfaceName BatchExportService + * @Description 国家病历批量导出接口 + * @Author linjj + * @Date 2024/4/12 11:40 + * @Version 1.0 + */ +public interface BatchExportService { + //查询所有任务 + List selectAll(int taskState); + + //批量导出 + String batchExportPdf(int taskid)throws Exception; +} diff --git a/src/main/java/com/emr/service/ipml/BatchExportServiceImpl.java b/src/main/java/com/emr/service/ipml/BatchExportServiceImpl.java new file mode 100644 index 0000000..0eafa6d --- /dev/null +++ b/src/main/java/com/emr/service/ipml/BatchExportServiceImpl.java @@ -0,0 +1,207 @@ +package com.emr.service.ipml; + +import com.emr.dao.BatchExportMapper; +import com.emr.dao.ExportTaskDetailsMapper; +import com.emr.dao.ExportZdAssortMapper; +import com.emr.service.BatchExportService; +import com.emr.util.Logger; +import com.emr.vo.ExportPdfVo; +import com.emr.vo.ExportTaskDetailsVo; +import com.emr.vo.ExportTaskVo; +import com.itextpdf.kernel.pdf.PdfDocument; +import com.itextpdf.text.Document; +import com.itextpdf.text.pdf.*; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; + +import javax.servlet.http.HttpServletResponse; +import java.io.*; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; + +/** + * @ClassName BatchExportServiceImpl + * @Description 国家病历批量导出实现类 + * @Author linjj + * @Date 2024/4/12 11:41 + * @Version 1.0 + */ +@Service +public class BatchExportServiceImpl implements BatchExportService { + private static Logger logger = new Logger(); + @Autowired + BatchExportMapper batchExportMapper; + @Autowired + ExportTaskDetailsMapper exportTaskDetailsMapper; + @Autowired + private ExportZdAssortMapper exportZdAssortMapper; + @Value("${export_pdf_hospital_info}") + private String flieName; + @Value("${export_pdf_path}") + private String exportPdfPath; + + + @Override + public List selectAll(int taskState) { + return batchExportMapper.selectAll(taskState); + } + + @Override + public String batchExportPdf(int taskid) throws Exception { + //是否存在目录不存在创建 + File file = new File (exportPdfPath); + if(!file.isDirectory ()){ + file.mkdirs (); + } + //导出文件名 + String fileName=null; + //根据taskid查询所有需要导出病历的住院号出院日期 + List taskList = exportTaskDetailsMapper.selectAllByTaskId(taskid); + if (taskList==null) { + return "没有任务"; + } + for (ExportTaskDetailsVo list : taskList) { + //根据住院号出院日期查询需要导出病历路径 + List masterIds = exportTaskDetailsMapper.getMasterId(list.getInpNo(), list.getDischargeDateTime()); + if (masterIds==null) { + logger.log("病案号为:" + list.getInpNo() + "出院时间为:" + list.getDischargeDateTime() + "的病历找不到。"); + continue; + } + for (String masterId : masterIds) { + List pdfPathList = exportZdAssortMapper.getPdfPath(masterId); + if (pdfPathList==null){ + logger.log("病案号为:" + list.getInpNo() + "出院时间为:" + list.getDischargeDateTime() + "的病历查询不到影像"); + continue; + } + try { + //组织导出文件名 + fileName = exportFlieName(list); + } catch (ParseException e) { + throw new RuntimeException(e); + } +// downPdfResponse(fileName,response); + Boolean aBoolean = exportPdf(pdfPathList,fileName,exportPdfPath); + //为true时修改任务状态1完成2失败 + if (aBoolean){ + exportTaskDetailsMapper.upStatc(1,list.getId()); + }else { + exportTaskDetailsMapper.upStatc(2,list.getId()); + } + } + } + return "下载完成"; + } + + + private void downPdfResponse(String pdfName, HttpServletResponse response) { + try { + pdfName = java.net.URLEncoder.encode(pdfName, "UTF-8"); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(e); + } + response.reset(); + response.setContentType("application/pdf"); + response.setHeader("content-disposition", "attachment; filename=" + pdfName + ".pdf"); + } + + + + private static Boolean exportPdf(List pdfPathList,String fileName,String exportPdfPath) { + //上一个目录名称 + String lastOutline = null; + //是否增加标签 + boolean outFlag = true; + //标签顺序 + Integer outNum = 1; + Integer pageNum=1; + Document document = new Document(); + PdfCopy writer = null; + try { + FileOutputStream fileOutputStream = new FileOutputStream(exportPdfPath+fileName+".pdf"); + writer = new PdfCopy(document,fileOutputStream); + document.open(); + PdfContentByte cb = writer.getDirectContent(); + cb.setFontAndSize(BaseFont.createFont(BaseFont.HELVETICA, BaseFont.CP1252, BaseFont.NOT_EMBEDDED), 12); + cb.beginText(); + cb.showTextAligned(PdfContentByte.ALIGN_CENTER, "目录", 300, 780, 0); + cb.endText(); + // 创建目录 + PdfOutline root = cb.getRootOutline(); + for (int i = 0; i < pdfPathList.size(); i++) { + try { + String assortName = pdfPathList.get(i).getAssortName(); + if (StringUtils.isNotBlank(lastOutline) && lastOutline.equals(assortName)) { + outFlag = false; + } + if (StringUtils.isBlank(lastOutline)) { + lastOutline = assortName; + outFlag=true; + } + if (!lastOutline.equals(assortName)){ + lastOutline = assortName; + outFlag=true; + } + PdfReader reader = new PdfReader(pdfPathList.get(i).getPdfPath()); + int n = reader.getNumberOfPages(); + for (int s = 1; s <= n; s++) { + PdfImportedPage page = writer.getImportedPage(reader, s); + writer.addPage(page); + } + if (outFlag) { + //目录跳转页面内容设置。 + PdfAction action = PdfAction.gotoLocalPage(pageNum, new PdfDestination(PdfDestination.FIT), writer); + //标题目录 + String title = outNum+"."+pdfPathList.get(i).getAssortName(); + new PdfOutline(root, action, title, false); + outNum++; + } + pageNum =pageNum+getPageNum(pdfPathList.get(i)); + } catch (Exception e) { + return false; + } + } + return true; + } catch (Exception e) { + e.printStackTrace(); + } finally { + if (document != null) { + document.close(); + } + } + return true; + } + + + //获取pdf页码 + private static int getPageNum(ExportPdfVo obj) { + FileInputStream is; + com.itextpdf.kernel.pdf.PdfReader pdfReader = null; + int pages = 0; + //创建File类 + File file = new File(obj.getPdfPath()); + //判断文件是否存在 + if (file.exists()) { + try { + is = new FileInputStream(file); + pdfReader = new com.itextpdf.kernel.pdf.PdfReader(is); + com.itextpdf.kernel.pdf.PdfDocument redDocument = new com.itextpdf.kernel.pdf.PdfDocument(pdfReader); + pages = redDocument.getNumberOfPages(); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + return pages; + } + //生成文件名 + private String exportFlieName(ExportTaskDetailsVo dto) throws ParseException { + SimpleDateFormat originalFormat = new SimpleDateFormat("yyyy-MM-dd"); + SimpleDateFormat targetFormat = new SimpleDateFormat("yyyyMMdd"); + Date date = originalFormat.parse(dto.getDischargeDateTime()); + String formattedDate = targetFormat.format(date); + return flieName + "_" + dto.getInpNo() + "_" + formattedDate; + } +} diff --git a/src/main/java/com/emr/service/ipml/V_CountServiceImpl.java b/src/main/java/com/emr/service/ipml/V_CountServiceImpl.java index 400091f..29eb1a7 100644 --- a/src/main/java/com/emr/service/ipml/V_CountServiceImpl.java +++ b/src/main/java/com/emr/service/ipml/V_CountServiceImpl.java @@ -8,38 +8,183 @@ package com.emr.service.ipml; import com.emr.dao.V_CountMapper; import com.emr.entity.*; +import com.emr.service.Emr_DictionaryService; import com.emr.service.V_CountService; +import com.emr.util.ListUtil; +import com.emr.util.Setters; import com.emr.vo.V_CountVo; import com.github.pagehelper.Page; import com.github.pagehelper.PageHelper; +import org.apache.commons.lang3.StringUtils; import org.apache.shiro.util.CollectionUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.text.DecimalFormat; import java.util.List; +import java.util.Map; @Service public class V_CountServiceImpl implements V_CountService { @Autowired private V_CountMapper vCountMapper; + @Autowired + private Emr_DictionaryService emrDictionaryService; + +// @Override +// public List selectByCol(V_CountVo record) { +// List counts = vCountMapper.selectByCol(record); +// if(!CollectionUtils.isEmpty(counts)){ +// for(V_Count count :counts){ +// count.setUnfileNum(count.getOutNum() - count.getFileNum()); +// } +// } +// return counts; +// } + @Override public List selectByCol(V_CountVo record) { - List counts = vCountMapper.selectByCol(record); - if(!CollectionUtils.isEmpty(counts)){ - for(V_Count count :counts){ - count.setUnfileNum(count.getOutNum() - count.getFileNum()); + List counts = vCountMapper.selectByColCount(record); + //转换科室方法 + conversion(counts); + //计算各个科室归档数量 + deptFileNum(record, counts); + //计算死亡人数 + deptDeathNum(record, counts); + //2日归档率% + deptDay2Rate(record, counts); + //3日归档率% + deptDay3Rate(record, counts); + //计算未归档、归档率、2日归档率%、3日归档率% + for (V_Count list : counts) { + //归档数、2日归档数、3日归档数为null填充0 + fillNum(list); + list.setUnfileNum(list.getOutNum() - list.getFileNum()); + DecimalFormat df = new DecimalFormat("0.00"); + //归档率百分比 + if (list.getFileNum() == 0) { + list.setFileRate(0 + "%"); + } else { + double fileRate = (double) list.getFileNum() / (double) list.getOutNum(); + list.setFileRate(df.format(fileRate * 100) + "%"); + } + //2日归档率百分比 + if (list.getDay2Rate().equals("0")) { + list.setDay2Rate(0 + "%"); + } else { + double day2Rate = (double) Integer.parseInt(list.getDay2Rate()) / (double) list.getFileNum(); + list.setDay2Rate(df.format(day2Rate * 100) + "%"); + } + //3日归档率百分比 + if (list.getDay3Rate().equals("0")) { + list.setDay3Rate(0 + "%"); + } else { + double day3Rate = (double) Integer.parseInt(list.getDay3Rate()) / (double) list.getFileNum(); + list.setDay3Rate(df.format(day3Rate * 100) + "%"); } } + return counts; } + private static void fillNum(V_Count list) { + if (StringUtils.isBlank(String.valueOf(list.getOutNum()))) { + list.setOutNum(0); + } + if (String.valueOf(list.getFileNum()).equals("null")) { + list.setFileNum(0); + } + if (StringUtils.isBlank(list.getDay2Rate())) { + list.setDay2Rate("0"); + } + if (StringUtils.isBlank(list.getDay3Rate())) { + list.setDay3Rate("0"); + } + } + + private void deptDay2Rate(V_CountVo record, List counts) { + List list = vCountMapper.getDay2Rate(record); + //根据科室遍历出院数量 + Map codeMap = ListUtil.toMap(list, V_Count::getDeptCode); + Setters.instance().list(counts).cycleSetProperties(p -> { + String deptCode = p.getDeptCode(); + if (StringUtils.isNotBlank(deptCode) && codeMap.containsKey(deptCode)) { + String day2Rate = codeMap.get(deptCode).getDay2Rate(); + p.setDay2Rate(day2Rate); + } + }); + } + + + private void deptDay3Rate(V_CountVo record, List counts) { + List list = vCountMapper.getDay3Rate(record); + //根据科室遍历出院数量 + Map codeMap = ListUtil.toMap(list, V_Count::getDeptCode); + Setters.instance().list(counts).cycleSetProperties(p -> { + String deptCode = p.getDeptCode(); + if (StringUtils.isNotBlank(deptCode) && codeMap.containsKey(deptCode)) { + String day3Rate = codeMap.get(deptCode).getDay3Rate(); + p.setDay3Rate(day3Rate); + } + }); + } + + @Override public OffsetLimitPage selectPageByClo(V_CountVo record, Integer offset, Integer limit) { PageHelper.offsetPage(offset, limit); List list = selectByCol(record); return new OffsetLimitPage((Page) list); } + + + //转换科室 + private void conversion(List vCounts) { + //科室名称转换 + Emr_Dictionary dic = new Emr_Dictionary(); + dic.setEffective(1); + dic.setTypecode("dept_code"); + List dicList = emrDictionaryService.dicByTypeCode(dic); + //转换科室 + Map codeMap = ListUtil.toMap(dicList, Emr_Dictionary::getCode); + Setters.instance().list(vCounts).cycleSetProperties(p -> { + String deptCode = p.getDeptCode(); + if (StringUtils.isNotBlank(deptCode) && codeMap.containsKey(deptCode)) { + String deptName = codeMap.get(deptCode).getName(); + p.setDeptName(deptName); + } + }); + } + + //计算回档数量 + private void deptFileNum(V_CountVo record, List counts) { + List fileNumList = vCountMapper.getFileNum(record); + //根据科室遍历出院数量 + Map codeMap = ListUtil.toMap(fileNumList, V_Count::getDeptCode); + Setters.instance().list(counts).cycleSetProperties(p -> { + String deptCode = p.getDeptCode(); + if (StringUtils.isNotBlank(deptCode) && codeMap.containsKey(deptCode)) { + Integer fileNum = codeMap.get(deptCode).getFileNum(); + p.setFileNum(fileNum); + } + }); + } + + + //计算死亡数量 + private void deptDeathNum(V_CountVo record, List counts) { + List fileNumList = vCountMapper.getDeathNum(record); + //根据科室遍历出院数量 + Map codeMap = ListUtil.toMap(fileNumList, V_Count::getDeptCode); + Setters.instance().list(counts).cycleSetProperties(p -> { + String deptCode = p.getDeptCode(); + if (StringUtils.isNotBlank(deptCode) && codeMap.containsKey(deptCode)) { + Integer deathNum = codeMap.get(deptCode).getDeathNum(); + p.setDeathNum(deathNum); + } + }); + } } diff --git a/src/main/java/com/emr/util/FieldSelector.java b/src/main/java/com/emr/util/FieldSelector.java new file mode 100644 index 0000000..077c034 --- /dev/null +++ b/src/main/java/com/emr/util/FieldSelector.java @@ -0,0 +1,12 @@ +package com.emr.util; + +/** + * @InterfaceName FieldSelector + * @Description + * @Author linjj + * @Date 2023/6/29 16:41 + * @Version 1.0 + */ +public interface FieldSelector { + FieldType select(Type type); +} diff --git a/src/main/java/com/emr/util/ListPropertySetter.java b/src/main/java/com/emr/util/ListPropertySetter.java new file mode 100644 index 0000000..20eb1dd --- /dev/null +++ b/src/main/java/com/emr/util/ListPropertySetter.java @@ -0,0 +1,22 @@ +package com.emr.util; + +import java.util.List; + +public class ListPropertySetter { + + private final List values; + + public ListPropertySetter(List values) { + this.values = values; + } + + public List cycleSetProperties(PropertySetter setter) { + + if (null == values) return values; + + for (T value : values) { + setter.apply(value); + } + return values; + } +} diff --git a/src/main/java/com/emr/util/ListUtil.java b/src/main/java/com/emr/util/ListUtil.java new file mode 100644 index 0000000..6c33688 --- /dev/null +++ b/src/main/java/com/emr/util/ListUtil.java @@ -0,0 +1,73 @@ +package com.emr.util; + +import org.springframework.util.CollectionUtils; + +import java.util.*; + +public final class ListUtil { + public static Map toMap(List list, FieldSelector selector) { + if (CollectionUtils.isEmpty(list)) return Collections.emptyMap(); + Map map = new HashMap<>(list.size()); + for (T t : list) { + K key = selector.select(t); + if (key != null) map.put(key, t); + } + return map; + } + + public static Map> groupBy(List list, FieldSelector selector) { + if (CollectionUtils.isEmpty(list)) return Collections.emptyMap(); + Map> map = new HashMap<>(); + for (T t : list) { + K key = selector.select(t); + if (key == null) continue; + if (!map.containsKey(key)) { + map.put(key, new ArrayList()); + } + map.get(key).add(t); + } + return map; + } + + public static List select(List list, FieldSelector selector) { + if (CollectionUtils.isEmpty(list)) return Collections.emptyList(); + List filedList = new ArrayList<>(list.size()); + for (T t : list) { + K key = selector.select(t); + if (key != null) filedList.add(key); + } + return filedList; + } + + public static List distinctSelect(List list, FieldSelector selector) { + if (CollectionUtils.isEmpty(list)) return Collections.emptyList(); + Set filedSet = new HashSet<>(); + for (T t : list) { + K key = selector.select(t); + if (key != null) filedSet.add(key); + } + return new ArrayList<>(filedSet); + } + + @SafeVarargs + public static List unionWithoutDuplicate(List... values) { + if (null == values || values.length <= 0) return Collections.emptyList(); + Set unionFiledSet = new HashSet<>(); + for (List value : values) { + if (!CollectionUtils.isEmpty(value)) { + unionFiledSet.addAll(value); + } + } + return new ArrayList<>(unionFiledSet); + } + + public static List skipDuplicateKey(List list, FieldSelector selector) { + if (CollectionUtils.isEmpty(list)) return Collections.emptyList(); + List filedList = new ArrayList<>(list.size()); + Map map = toMap(list, selector); + for (K key : map.keySet()) { + filedList.add(map.get(key)); + } + return filedList; + } +} diff --git a/src/main/java/com/emr/util/Logger.java b/src/main/java/com/emr/util/Logger.java new file mode 100644 index 0000000..65c7f07 --- /dev/null +++ b/src/main/java/com/emr/util/Logger.java @@ -0,0 +1,44 @@ +package com.emr.util; + +import org.springframework.beans.factory.annotation.Value; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.OutputStream; +import java.text.SimpleDateFormat; +import java.util.Date; + +public class Logger { + + @Value("${export_pdf_path}") + private String exportPdfPath; + + public void log(String info) { + SimpleDateFormat dateFormat = new SimpleDateFormat ("yyyy-MM-dd"); + String format = dateFormat.format (new Date()); + File file = new File (exportPdfPath+format); + if(!file.isDirectory ()){ + file.mkdirs (); + } + OutputStream out = null; + try { + out = getOutputStream(file.getAbsolutePath ()+"\\log.log"); + out.write(info.getBytes("utf-8")); + out.write("\r\n".getBytes()); + out.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + + public OutputStream getOutputStream(String localpath) throws IOException { + File file = new File(localpath); + if (!file.exists()) { + file.createNewFile(); + return new FileOutputStream(file); + } else { + return new FileOutputStream(file, true); + } + } +} diff --git a/src/main/java/com/emr/util/PropertySetter.java b/src/main/java/com/emr/util/PropertySetter.java new file mode 100644 index 0000000..714c4ed --- /dev/null +++ b/src/main/java/com/emr/util/PropertySetter.java @@ -0,0 +1,7 @@ +package com.emr.util; + +public interface PropertySetter { + + void apply(T t); + +} diff --git a/src/main/java/com/emr/util/Setters.java b/src/main/java/com/emr/util/Setters.java new file mode 100644 index 0000000..db1b600 --- /dev/null +++ b/src/main/java/com/emr/util/Setters.java @@ -0,0 +1,14 @@ +package com.emr.util; + +import java.util.List; + +public class Setters { + + public static Setters instance() { + return new Setters<>(); + } + + public ListPropertySetter list(List values) { + return new ListPropertySetter<>(values); + } +} diff --git a/src/main/java/com/emr/vo/ExportPdfVo.java b/src/main/java/com/emr/vo/ExportPdfVo.java new file mode 100644 index 0000000..d41c49f --- /dev/null +++ b/src/main/java/com/emr/vo/ExportPdfVo.java @@ -0,0 +1,19 @@ +package com.emr.vo; + +import lombok.Data; + +/** + * @ClassName ExportPdfVo + * @Description 导出pdf返回 + * @Author linjj + * @Date 2024/4/11 8:47 + * @Version 1.0 + */ +@Data +public class ExportPdfVo { + + private String pdfPath; + private String assortID; + private String assortSort; + private String assortName; +} diff --git a/src/main/java/com/emr/vo/ExportTaskDetailsVo.java b/src/main/java/com/emr/vo/ExportTaskDetailsVo.java new file mode 100644 index 0000000..e2713e7 --- /dev/null +++ b/src/main/java/com/emr/vo/ExportTaskDetailsVo.java @@ -0,0 +1,24 @@ +package com.emr.vo; + +import lombok.Data; + +/** + * @ClassName ExportTaskDetailsVo + * @Description 导出任务详情 + * @Author linjj + * @Date 2024/4/12 14:01 + * @Version 1.0 + */ +@Data +public class ExportTaskDetailsVo { + + private int id; + //任务id + private int taskId; + //住院号 + private String inpNo; + + //出院日期 + private String dischargeDateTime; + +} diff --git a/src/main/java/com/emr/vo/ExportTaskVo.java b/src/main/java/com/emr/vo/ExportTaskVo.java new file mode 100644 index 0000000..a08456f --- /dev/null +++ b/src/main/java/com/emr/vo/ExportTaskVo.java @@ -0,0 +1,26 @@ +package com.emr.vo; + +import lombok.Data; + +/** + * @ClassName ExportTaskVo + * @Description 导出任务主表 + * @Author linjj + * @Date 2024/4/12 11:37 + * @Version 1.0 + */ +@Data +public class ExportTaskVo { + //批次id + private int id; + //开始时间 + private String startTime; + //结束时间 + private String endTime; + //0未开始1正在下载2下载完成 + private int taskState; + //完成数量 + private int completeNum; + //需求数量 + private int needNum; +} diff --git a/src/main/java/com/emr/vo/ExportZdAssortVo.java b/src/main/java/com/emr/vo/ExportZdAssortVo.java new file mode 100644 index 0000000..22942c8 --- /dev/null +++ b/src/main/java/com/emr/vo/ExportZdAssortVo.java @@ -0,0 +1,19 @@ +package com.emr.vo; + +import lombok.Data; + +/** + * @ClassName ExportZdAssortVo + * @Description 导出分段详情 + * @Author linjj + * @Date 2024/4/10 16:52 + * @Version 1.0 + */ +@Data +public class ExportZdAssortVo { + + private String assortId; + private String assortName; + private String assortSort; + private String exportFlag; +} diff --git a/src/main/resources/config/config.properties b/src/main/resources/config/config.properties index cb293a8..1d42bf4 100644 --- a/src/main/resources/config/config.properties +++ b/src/main/resources/config/config.properties @@ -1,9 +1,9 @@ -#power\u6743\u9650\u7CFB\u7EDFIP\u548C\u7AEF\u53E3 -#POWER_IP = localhost -#POWER_PORT = 8081 - +power\u6743\u9650\u7CFB\u7EDFIP\u548C\u7AEF\u53E3 POWER_IP = localhost -POWER_PORT = 8081 +POWER_PORT = 8085 + +#POWER_IP = 172.16.11.90 +#POWER_PORT = 8081 #power\u6743\u9650\u7CFB\u7EDF\u7684\u670D\u52A1\u5668\u5730\u5740\u5934 POWER_URLHEAD = http://${POWER_IP}:${POWER_PORT}/power @@ -57,3 +57,11 @@ overDateSet = 2021-05-01 #\u5404\u5BA1\u6838\u89D2\u8272\u7528\u6237id 1\uFF1A\u533B\u751F\uFF1B2\uFF1A\u62A4\u58EB\uFF1B3\uFF1A\u75C5\u6848\u5BA4\u4EBA\u5458\uFF1B5\uFF1A\u533B\u751F\u8D28\u63A7\u5458\uFF1B6\uFF1A\u79D1\u4E3B\u4EFB\uFF1B7\uFF1A\u62A4\u58EB\u957F\uFF1B8\uFF1A\u62A4\u58EB\u8D28\u63A7\u5458 + + +export_pdf_path=D://export// + + +#\u5bfc\u51fa\u4fe1\u606f\u683c\u5f0f\u9700\u8981\u4e3aunicode\u683c\u5f0f\u4e0d\u7136\u4f1a\u4e71\u7801 +export_pdf_hospital_info = \u5e7f\u4e1c\u7701_\u5e7f\u4e1c\u533b\u79d1\u5927\u5b66\u9644\u5c5e\u533b\u9662 + diff --git a/src/main/resources/config/jdbc.properties b/src/main/resources/config/jdbc.properties index 49f8c6a..067d7aa 100644 --- a/src/main/resources/config/jdbc.properties +++ b/src/main/resources/config/jdbc.properties @@ -1,17 +1,17 @@ -#\u6570\u636E\u5E93IP +##\u6570\u636E\u5E93IP +#dataBaseIp=172.16.11.90 +##\u6570\u636E\u5E93\u540D\u79F0 +#dataBaseName=emr_record +##\u6570\u636E\u5E93\u5BC6\u7801 +#dataBasePassword=docus@702 + +\u6570\u636E\u5E93IP dataBaseIp=localhost #\u6570\u636E\u5E93\u540D\u79F0 dataBaseName=gm_record #\u6570\u636E\u5E93\u5BC6\u7801 dataBasePassword=admin123 -#\u6570\u636E\u5E93IP -#dataBaseIp=200.100.104.40 -##\u6570\u636E\u5E93\u540D\u79F0 -#dataBaseName=emr_record -##\u6570\u636E\u5E93\u5BC6\u7801 -#dataBasePassword=AbcXyz123 - jdbc.driver=com.microsoft.sqlserver.jdbc.SQLServerDriver jdbc.url=jdbc\:sqlserver\://${dataBaseIp}:1433;databaseName=${dataBaseName} jdbc.username=sa diff --git a/src/main/resources/mapper/BatchExpoerMapper.xml b/src/main/resources/mapper/BatchExpoerMapper.xml new file mode 100644 index 0000000..3e447b0 --- /dev/null +++ b/src/main/resources/mapper/BatchExpoerMapper.xml @@ -0,0 +1,14 @@ + + + + + + + \ No newline at end of file diff --git a/src/main/resources/mapper/ExportTaskDetailsMapper.xml b/src/main/resources/mapper/ExportTaskDetailsMapper.xml new file mode 100644 index 0000000..f693122 --- /dev/null +++ b/src/main/resources/mapper/ExportTaskDetailsMapper.xml @@ -0,0 +1,21 @@ + + + + + update Export_Task_Details set state=#{state} where id=#{id} + + + + + + \ No newline at end of file diff --git a/src/main/resources/mapper/ExportZdAssortMapper.xml b/src/main/resources/mapper/ExportZdAssortMapper.xml new file mode 100644 index 0000000..c2b1a7f --- /dev/null +++ b/src/main/resources/mapper/ExportZdAssortMapper.xml @@ -0,0 +1,22 @@ + + + + + + + \ No newline at end of file diff --git a/src/main/resources/mapper/V_CountMapper.xml b/src/main/resources/mapper/V_CountMapper.xml index ff29b58..907274f 100644 --- a/src/main/resources/mapper/V_CountMapper.xml +++ b/src/main/resources/mapper/V_CountMapper.xml @@ -184,10 +184,56 @@ - - - order by deptCode + + + + + + \ No newline at end of file diff --git a/src/main/webapp/static/js/vCount/vCountList.js b/src/main/webapp/static/js/vCount/vCountList.js index 708a29e..90e68e7 100644 --- a/src/main/webapp/static/js/vCount/vCountList.js +++ b/src/main/webapp/static/js/vCount/vCountList.js @@ -661,13 +661,6 @@ function initTable() { field: 'fileRate', align: 'center', valign: 'middle', - formatter: function (value, row, index) { - var val; - if (row.fileRate != null && row.fileRate != '') { - val = Math.round(row.fileRate * 100) + "%"; - } - return val; - } }, { @@ -675,26 +668,12 @@ function initTable() { field: 'day3Rate', align: 'center', valign: 'middle', - formatter: function (value, row, index) { - var val; - if (row.day3Rate != null && row.day3Rate != '') { - val = Math.round(row.day3Rate * 100) + "%"; - } - return val; - } }, { title: '3日归档率%', field: 'day2Rate', align: 'center', valign: 'middle', - formatter: function (value, row, index) { - var val; - if (row.day2Rate != null && row.day2Rate != '') { - val = Math.round(row.day2Rate * 100) + "%"; - } - return val; - } }, // { // title: '5日归档率%',