() { });
+ }
+ bufferedReader.close();
+ }
+
+ return dto;
+ }
+ catch (Exception ex){
+ ex.printStackTrace();
+ return null;
+ }
+ }
+ /**
+ * 取得当前jar路径
+ * @return
+ */
+ public static String CurrentPath(){
+ File dir = new File(".");
+ String currentpath ="";
+ try {
+ currentpath = dir.getCanonicalPath();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ return currentpath;
+ }
+
+ /**
+ * 取得当前jar路径
+ * @return
+ */
+ public static String currentPath(String dir){
+ String path = CurrentPath() + File.separator + dir;
+ File file = new File(path);
+ if (!file.exists()) {
+ file.mkdirs();
+ }
+ return path;
+ }
+
+ public static void main(String[] args) {
+ TableJsonRead tableJsonRead = new TableJsonRead();
+ JSONObject config = tableJsonRead.Read("dataConfig", "EmrPushConf.json", JSONObject.class);
+ System.out.println(config);
+ }
+
+ /**
+ * 读取文件内容
+ * @param path
+ * @param fileName
+ * @return
+ */
+ public String ReadContent(String path,String fileName){
+ String currentPath=CurrentPath();
+ path = currentPath+"\\"+path;
+ StringBuilder sb = new StringBuilder();
+ File file = new File(path+"\\"+fileName);
+ try {
+ if (!file.getParentFile().exists()) {
+ file.getParentFile().mkdirs();
+ }
+ if (!file.exists()) {
+ try {
+ file.createNewFile();
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ } else {
+ BufferedReader bufferedReader = null;
+ bufferedReader = new BufferedReader(new InputStreamReader(new FileInputStream(file)));
+ String line;
+ while (!StringUtils.isEmpty(line = bufferedReader.readLine())) {
+ sb.append(line);
+ }
+
+ bufferedReader.close();
+ }
+
+ return sb.toString();
+ }
+ catch (Exception ex){
+ ex.printStackTrace();
+ return null;
+ }
+ }
+
+ /**
+ * 保存json至文件
+ * @param path 路径后缀
+ * @param fileName 文件名称
+ * @param data json信息
+ * @return
+ */
+ public void Save(String path,String fileName,String data){
+ String currentPath=CurrentPath();
+ path = currentPath+"\\"+path;
+ FileWriter fwriter = null;
+ try {
+ File file = new File(path);
+ if (!file.getParentFile().exists()) {
+ file.getParentFile().mkdirs();
+ }
+ fwriter = new FileWriter(path+"\\"+fileName);
+ fwriter.write(data);
+ } catch (IOException ex) {
+ ex.printStackTrace();
+ } finally {
+ try {
+ fwriter.flush();
+ fwriter.close();
+ } catch (IOException ex) {
+ ex.printStackTrace();
+ }
+ }
+ }
+
+}
diff --git a/src/main/java/com/docus/bgts/utils/XmlUtil.java b/src/main/java/com/docus/bgts/utils/XmlUtil.java
new file mode 100644
index 0000000..7231457
--- /dev/null
+++ b/src/main/java/com/docus/bgts/utils/XmlUtil.java
@@ -0,0 +1,315 @@
+/*
+ * Copyright (c) 2018-2028, DreamLu All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * Neither the name of the dreamlu.net developer nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * Author: DreamLu 卢春梦 (596392912@qq.com)
+ */
+package com.docus.bgts.utils;
+
+import com.docus.core.util.Exceptions;
+import com.docus.core.util.IoUtil;
+import com.docus.core.util.StringUtil;
+import org.springframework.lang.Nullable;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+
+import javax.xml.namespace.QName;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.xpath.XPath;
+import javax.xml.xpath.XPathConstants;
+import javax.xml.xpath.XPathExpressionException;
+import javax.xml.xpath.XPathFactory;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.StringReader;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * xpath解析xml
+ *
+ *
+ * 文档地址:
+ * http://www.w3school.com.cn/xpath/index.asp
+ *
+ *
+ * @author L.cm
+ */
+public class XmlUtil {
+ private final XPath path;
+ private final Document doc;
+
+ private XmlUtil(InputSource inputSource) throws ParserConfigurationException, SAXException, IOException {
+ DocumentBuilderFactory dbf = getDocumentBuilderFactory();
+ DocumentBuilder db = dbf.newDocumentBuilder();
+ doc = db.parse(inputSource);
+ path = getXPathFactory().newXPath();
+ }
+
+ /**
+ * 创建工具类
+ *
+ * @param inputSource inputSource
+ * @return XmlUtil
+ */
+ private static XmlUtil create(InputSource inputSource) {
+ try {
+ return new XmlUtil(inputSource);
+ } catch (ParserConfigurationException | SAXException | IOException e) {
+ throw Exceptions.unchecked(e);
+ }
+ }
+
+ /**
+ * 转换工具类
+ *
+ * @param inputStream inputStream
+ * @return XmlUtil
+ */
+ public static XmlUtil of(InputStream inputStream) {
+ InputSource inputSource = new InputSource(inputStream);
+ return create(inputSource);
+ }
+
+ /**
+ * xml遇到的特殊字符替换
+ */
+ public static String specialCharacterSubstitution(String str){
+ str = StringUtil.replace(str, "\u00A0", " ");
+ return str;
+ }
+
+ /**
+ * 转换工具类
+ *
+ * @param xmlStr xmlStr
+ * @return XmlUtil
+ */
+ public static XmlUtil of(String xmlStr) {
+ xmlStr=specialCharacterSubstitution(xmlStr);
+ StringReader sr = new StringReader(xmlStr.trim());
+ InputSource inputSource = new InputSource(sr);
+ XmlUtil xmlUtil = create(inputSource);
+ IoUtil.closeQuietly(sr);
+ return xmlUtil;
+ }
+
+ /**
+ * 转换路径
+ *
+ * @param expression 表达式
+ * @param item 实体
+ * @param returnType 返回类型
+ * @return Object
+ */
+ private Object evalXPath(String expression, @Nullable Object item, QName returnType) {
+ item = null == item ? doc : item;
+ try {
+ return path.evaluate(expression, item, returnType);
+ } catch (XPathExpressionException e) {
+ throw Exceptions.unchecked(e);
+ }
+ }
+
+ /**
+ * 获取String
+ *
+ * @param expression 路径
+ * @return {String}
+ */
+ public String getString(String expression) {
+ return (String) evalXPath(expression, null, XPathConstants.STRING);
+ }
+
+ /**
+ * 获取Boolean
+ *
+ * @param expression 路径
+ * @return {String}
+ */
+ public Boolean getBoolean(String expression) {
+ return (Boolean) evalXPath(expression, null, XPathConstants.BOOLEAN);
+ }
+
+ /**
+ * 获取Number
+ *
+ * @param expression 路径
+ * @return {Number}
+ */
+ public Number getNumber(String expression) {
+ return (Number) evalXPath(expression, null, XPathConstants.NUMBER);
+ }
+
+ /**
+ * 获取某个节点
+ *
+ * @param expression 路径
+ * @return {Node}
+ */
+ public Node getNode(String expression) {
+ return (Node) evalXPath(expression, null, XPathConstants.NODE);
+ }
+
+ /**
+ * 获取子节点
+ *
+ * @param expression 路径
+ * @return NodeList
+ */
+ public NodeList getNodeList(String expression) {
+ return (NodeList) evalXPath(expression, null, XPathConstants.NODESET);
+ }
+
+
+ /**
+ * 获取String
+ *
+ * @param node 节点
+ * @param expression 相对于node的路径
+ * @return {String}
+ */
+ public String getString(Object node, String expression) {
+ return (String) evalXPath(expression, node, XPathConstants.STRING);
+ }
+
+ /**
+ * 获取
+ *
+ * @param node 节点
+ * @param expression 相对于node的路径
+ * @return {String}
+ */
+ public Boolean getBoolean(Object node, String expression) {
+ return (Boolean) evalXPath(expression, node, XPathConstants.BOOLEAN);
+ }
+
+ /**
+ * 获取
+ *
+ * @param node 节点
+ * @param expression 相对于node的路径
+ * @return {Number}
+ */
+ public Number getNumber(Object node, String expression) {
+ return (Number) evalXPath(expression, node, XPathConstants.NUMBER);
+ }
+
+ /**
+ * 获取某个节点
+ *
+ * @param node 节点
+ * @param expression 路径
+ * @return {Node}
+ */
+ public Node getNode(Object node, String expression) {
+ return (Node) evalXPath(expression, node, XPathConstants.NODE);
+ }
+
+ /**
+ * 获取子节点
+ *
+ * @param node 节点
+ * @param expression 相对于node的路径
+ * @return NodeList
+ */
+ public NodeList getNodeList(Object node, String expression) {
+ return (NodeList) evalXPath(expression, node, XPathConstants.NODESET);
+ }
+
+ /**
+ * 针对没有嵌套节点的简单处理
+ *
+ * @return map集合
+ */
+ public Map toMap() {
+ Element root = doc.getDocumentElement();
+ Map params = new HashMap<>(16);
+
+ // 将节点封装成map形式
+ NodeList list = root.getChildNodes();
+ for (int i = 0; i < list.getLength(); i++) {
+ Node node = list.item(i);
+ if (node instanceof Element) {
+ params.put(node.getNodeName(), node.getTextContent());
+ }
+ }
+ return params;
+ }
+
+ private static volatile boolean preventedXXE = false;
+
+ private static DocumentBuilderFactory getDocumentBuilderFactory() throws ParserConfigurationException {
+ DocumentBuilderFactory dbf = XmlHelperHolder.documentBuilderFactory;
+ if (!preventedXXE) {
+ synchronized (XmlUtil.class) {
+ if (!preventedXXE) {
+ preventXXE(dbf);
+ }
+ }
+ }
+ return dbf;
+ }
+
+ /**
+ * preventXXE
+ *
+ * @param dbf
+ * @throws ParserConfigurationException
+ */
+ private static void preventXXE(DocumentBuilderFactory dbf) throws ParserConfigurationException {
+ // This is the PRIMARY defense. If DTDs (doctypes) are disallowed, almost all XML entity attacks are prevented
+ // Xerces 2 only - http://xerces.apache.org/xerces2-j/features.html#disallow-doctype-decl
+ dbf.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
+
+ // If you can't completely disable DTDs, then at least do the following:
+ // Xerces 1 - http://xerces.apache.org/xerces-j/features.html#external-general-entities
+ // Xerces 2 - http://xerces.apache.org/xerces2-j/features.html#external-general-entities
+
+ // JDK7+ - http://xml.org/sax/features/external-general-entities
+ dbf.setFeature("http://xml.org/sax/features/external-general-entities", false);
+
+ // Xerces 1 - http://xerces.apache.org/xerces-j/features.html#external-parameter-entities
+ // Xerces 2 - http://xerces.apache.org/xerces2-j/features.html#external-parameter-entities
+
+ // JDK7+ - http://xml.org/sax/features/external-parameter-entities
+ dbf.setFeature("http://xml.org/sax/features/external-parameter-entities", false);
+
+ // Disable external DTDs as well
+ dbf.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);
+
+ // and these as well, per Timothy Morgan's 2014 paper: "XML Schema, DTD, and Entity Attacks"
+ dbf.setXIncludeAware(false);
+ dbf.setExpandEntityReferences(false);
+ preventedXXE = true;
+ }
+
+ private static XPathFactory getXPathFactory() {
+ return XmlHelperHolder.xPathFactory;
+ }
+
+ /**
+ * 内部类单例
+ */
+ private static class XmlHelperHolder {
+ private static DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
+ private static XPathFactory xPathFactory = XPathFactory.newInstance();
+ }
+
+}
diff --git a/src/main/java/com/docus/bgts/utils/XmlUtils.java b/src/main/java/com/docus/bgts/utils/XmlUtils.java
new file mode 100644
index 0000000..3d5c287
--- /dev/null
+++ b/src/main/java/com/docus/bgts/utils/XmlUtils.java
@@ -0,0 +1,104 @@
+//
+// Source code recreated from a .class file by IntelliJ IDEA
+// (powered by FernFlower decompiler)
+//
+
+package com.docus.bgts.utils;
+
+import com.alibaba.fastjson.JSON;
+import com.docus.bgts.emr.enums.Codes;
+import org.dom4j.Document;
+import org.dom4j.DocumentException;
+import org.dom4j.Element;
+import org.dom4j.io.SAXReader;
+
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+public class XmlUtils {
+ private SAXReader saxReader = new SAXReader();
+ private Document document;
+
+ public Document getDocument() {
+ return this.document;
+ }
+
+ public XmlUtils(String path) {
+ try {
+ this.document = this.saxReader.read(path);
+ } catch (DocumentException e) {
+ e.printStackTrace();
+ }
+
+ }
+
+ public XmlUtils(InputStream path) {
+ try {
+ this.document = this.saxReader.read(path);
+ } catch (DocumentException e) {
+ e.printStackTrace();
+ }
+
+ }
+
+
+
+ public Element getElement(List directory) {
+ Element root = this.document.getRootElement();
+ Element current = root;
+
+ for(String dire : directory) {
+ current = current.element(dire);
+ }
+
+ if (current == null) {
+ throw new RuntimeException("未找到对应节点");
+ } else {
+ return current;
+ }
+ }
+
+ public List getJsonByName(Element root) {
+ String path = FileUtils.currentPath();
+ String json = JsonUtils.readJsonFile(path + Codes.JSON_ADDRESS.getMessage());
+ Map jsonMap = (Map)JSON.parseObject(json, Map.class);
+ List basicArr = (List)jsonMap.get("doubleBasic");
+ List elements = null;
+
+ for(String basic : basicArr) {
+ elements = root.elements(basic);
+ if (elements != null && elements.size() > 0) {
+ break;
+ }
+ }
+
+ if (elements == null || elements.size() == 0) {
+ elements = new ArrayList();
+ elements.add(root);
+ }
+
+ return elements;
+ }
+
+ public Element getMsgElement() {
+ String path = FileUtils.currentPath();
+ String json = JsonUtils.readJsonFile(path + Codes.JSON_ADDRESS.getMessage());
+ Map jsonMap = (Map)JSON.parseObject(json, Map.class);
+ List directory = (List)jsonMap.get("directory");
+ Element root = this.getElement(directory);
+ return root;
+ }
+
+ public String getElementText(String name) {
+ Element root = this.document.getRootElement();
+ Element msg = root.element(Codes.MSG.getMessage());
+ if (msg == null) {
+ throw new RuntimeException("没有" + Codes.MSG.getMessage() + "节点");
+ } else {
+ Element element = msg.element(name);
+ return element == null ? null : element.getText();
+ }
+ }
+}
diff --git a/src/main/java/com/docus/bgts/wzh/entity/AfCollectTask.java b/src/main/java/com/docus/bgts/wzh/entity/AfCollectTask.java
new file mode 100644
index 0000000..12a92a3
--- /dev/null
+++ b/src/main/java/com/docus/bgts/wzh/entity/AfCollectTask.java
@@ -0,0 +1,56 @@
+//
+// Source code recreated from a .class file by IntelliJ IDEA
+// (powered by FernFlower decompiler)
+//
+
+package com.docus.bgts.wzh.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+@ApiModel(
+ value = "AfCollectTask对象",
+ description = "病案采集任务"
+)
+@Data
+public class AfCollectTask implements Serializable {
+ private static final long serialVersionUID = 1L;
+ @ApiModelProperty("id 雪花算法")
+ @TableId(
+ value = "id",
+ type = IdType.ASSIGN_ID
+ )
+ private Long id;
+ @ApiModelProperty("病案主键")
+ private String patientId;
+ @ApiModelProperty("af_archive_detail表id")
+ private Long afArchiveDetailId;
+ @ApiModelProperty("来源 1护理文书,2 电子病历,3 Pacs检查,4心电图,5手麻系统,6 Lis检验,7病案首页,8长临医嘱")
+ private String sysflag;
+ @ApiModelProperty("开始时间")
+ private Date startTime;
+ @ApiModelProperty("结束时间")
+ private Date endTime;
+ @ApiModelProperty("任务状态 0:未开始,1:完成,2:重新采集")
+ private String state;
+ @ApiModelProperty("同步时间")
+ private Date syncTime;
+ @ApiModelProperty("最新重新采集时间")
+ private Date recollectTime;
+ @ApiModelProperty("最新重新采集人")
+ private String recollectName;
+ @ApiModelProperty("备注")
+ private String remark;
+ @ApiModelProperty("报告唯一单号")
+ private String c1;
+ @ApiModelProperty("文件标题")
+ private String c2;
+ @ApiModelProperty("记账号")
+ private String c3;
+}
diff --git a/src/main/java/com/docus/bgts/wzh/entity/AfInterfaceCollect.java b/src/main/java/com/docus/bgts/wzh/entity/AfInterfaceCollect.java
new file mode 100644
index 0000000..abce1b8
--- /dev/null
+++ b/src/main/java/com/docus/bgts/wzh/entity/AfInterfaceCollect.java
@@ -0,0 +1,30 @@
+//
+// Source code recreated from a .class file by IntelliJ IDEA
+// (powered by FernFlower decompiler)
+//
+
+package com.docus.bgts.wzh.entity;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+@ApiModel("文件库中的省中医病案采集表")
+@Data
+public class AfInterfaceCollect implements Serializable {
+ private Long id;
+ @ApiModelProperty("任务流水号")
+ private String serialnum;
+ @ApiModelProperty("记账号")
+ private String jzh;
+ @ApiModelProperty("任务数")
+ private Integer taskCount;
+ @ApiModelProperty("完成数")
+ private Integer completeCount;
+ @ApiModelProperty("创建时间")
+ private Date createTime;
+
+}
diff --git a/src/main/java/com/docus/bgts/wzh/entity/AfInterfaceCollectSub.java b/src/main/java/com/docus/bgts/wzh/entity/AfInterfaceCollectSub.java
new file mode 100644
index 0000000..1f344a9
--- /dev/null
+++ b/src/main/java/com/docus/bgts/wzh/entity/AfInterfaceCollectSub.java
@@ -0,0 +1,33 @@
+//
+// Source code recreated from a .class file by IntelliJ IDEA
+// (powered by FernFlower decompiler)
+//
+
+package com.docus.bgts.wzh.entity;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+@ApiModel("文件库中的省中医病案采集-子任务表")
+@Data
+public class AfInterfaceCollectSub implements Serializable {
+ private Long id;
+ @ApiModelProperty("af_interface_collect表id")
+ private Long afInterfaceCollectId;
+ @ApiModelProperty("采集器id")
+ private String collectsysCode;
+ @ApiModelProperty("子任务流水号 同一份文件子任务需一致")
+ private String serialnumSub;
+ @ApiModelProperty("记账号")
+ private String jzh;
+ @ApiModelProperty("分类名称")
+ private String assortName;
+ @ApiModelProperty("状态 0:未发起,1:成功,2:失败")
+ private Integer state;
+ @ApiModelProperty("请求信息")
+ private String requestMessage;
+
+}
diff --git a/src/main/java/com/docus/bgts/wzh/entity/CanlcelDto.java b/src/main/java/com/docus/bgts/wzh/entity/CanlcelDto.java
new file mode 100644
index 0000000..6964d9a
--- /dev/null
+++ b/src/main/java/com/docus/bgts/wzh/entity/CanlcelDto.java
@@ -0,0 +1,18 @@
+//
+// Source code recreated from a .class file by IntelliJ IDEA
+// (powered by FernFlower decompiler)
+//
+
+package com.docus.bgts.wzh.entity;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+@ApiModel("撤销文件类")
+@Data
+public class CanlcelDto {
+ @ApiModelProperty("采集流水号")
+ private String serialnum;
+
+}
diff --git a/src/main/java/com/docus/bgts/wzh/entity/CqcSubmitState.java b/src/main/java/com/docus/bgts/wzh/entity/CqcSubmitState.java
new file mode 100644
index 0000000..f823fe9
--- /dev/null
+++ b/src/main/java/com/docus/bgts/wzh/entity/CqcSubmitState.java
@@ -0,0 +1,17 @@
+//
+// Source code recreated from a .class file by IntelliJ IDEA
+// (powered by FernFlower decompiler)
+//
+
+package com.docus.bgts.wzh.entity;
+
+import lombok.Data;
+
+@Data
+public class CqcSubmitState {
+ private static final long serialVersionUID = 1L;
+ private String patientId;
+ private Integer doctorState;
+ private Integer nurseState;
+
+}
diff --git a/src/main/java/com/docus/bgts/wzh/entity/MrReportError.java b/src/main/java/com/docus/bgts/wzh/entity/MrReportError.java
new file mode 100644
index 0000000..5688382
--- /dev/null
+++ b/src/main/java/com/docus/bgts/wzh/entity/MrReportError.java
@@ -0,0 +1,25 @@
+//
+// Source code recreated from a .class file by IntelliJ IDEA
+// (powered by FernFlower decompiler)
+//
+
+package com.docus.bgts.wzh.entity;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Date;
+
+@ApiModel("错误日志表")
+@Data
+public class MrReportError {
+ private Long id;
+ @ApiModelProperty("上报信息")
+ private String xml;
+ @ApiModelProperty("上报类型")
+ private Integer reportType;
+ @ApiModelProperty("上报时间")
+ private Date createTime;
+
+}
diff --git a/src/main/java/com/docus/bgts/wzh/entity/TBasic.java b/src/main/java/com/docus/bgts/wzh/entity/TBasic.java
new file mode 100644
index 0000000..7d32d0b
--- /dev/null
+++ b/src/main/java/com/docus/bgts/wzh/entity/TBasic.java
@@ -0,0 +1,173 @@
+//
+// Source code recreated from a .class file by IntelliJ IDEA
+// (powered by FernFlower decompiler)
+//
+
+package com.docus.bgts.wzh.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+@ApiModel(
+ value = "TBasic对象",
+ description = "病案基本信息"
+)
+@Data
+public class TBasic implements Serializable {
+ private static final long serialVersionUID = 1L;
+ @ApiModelProperty("病案主键")
+ @TableId(
+ value = "patient_id",
+ type = IdType.ASSIGN_ID
+ )
+ private String patientId;
+ @ApiModelProperty("住院次数")
+ private Integer admissTimes;
+ @ApiModelProperty("病案号")
+ private String inpatientNo;
+ @ApiModelProperty("住院id号")
+ private String admissId;
+ @ApiModelProperty("患者姓名")
+ private String name;
+ @ApiModelProperty("盘号")
+ private String ph;
+ @ApiModelProperty("患者姓名首拼")
+ private String nameSpell;
+ @ApiModelProperty("性别")
+ private String sex;
+ @ApiModelProperty("年龄_岁")
+ private Integer age;
+ @ApiModelProperty("年龄_月")
+ private Integer ageMonth;
+ @ApiModelProperty("年龄_天")
+ private Integer ageDay;
+ @ApiModelProperty("身份证")
+ private String idCard;
+ @ApiModelProperty("手机号码")
+ private String telphone;
+ @ApiModelProperty("住院日期")
+ private Date admissDate;
+ @ApiModelProperty("住院科室")
+ private String admissDept;
+ @ApiModelProperty("住院科室名称")
+ private String admissDeptName;
+ @ApiModelProperty("出院日期")
+ private Date disDate;
+ @ApiModelProperty("出院科室")
+ private String disDept;
+ @ApiModelProperty("出院科室名称")
+ private String disDeptName;
+ @ApiModelProperty("实际住院天数")
+ private Integer admissDays;
+ @ApiModelProperty("主管医生")
+ private String attending;
+ @ApiModelProperty("主管医生名称")
+ private String attendingName;
+ @ApiModelProperty("主要诊断编码")
+ private String mainDiagCode;
+ @ApiModelProperty("主要诊断名称")
+ private String mainDiagName;
+ @ApiModelProperty("主要手术编码")
+ private String mainOperateCode;
+ @ApiModelProperty("主要手术名称")
+ private String mainOperateName;
+ @ApiModelProperty("是否死亡")
+ private Integer isDead;
+ @ApiModelProperty("是否作废(0:否,1:是)")
+ private Integer isCancel;
+ @ApiModelProperty("签收时间")
+ private Date signTime;
+ @ApiModelProperty("创建时间")
+ private Date createTime;
+ @ApiModelProperty("修改时间")
+ private Date updateTime;
+ @ApiModelProperty("是否归档 1:已归档,0:未归档")
+ private Integer isArchive;
+ @ApiModelProperty("归档时间")
+ private Date archiveTime;
+ @ApiModelProperty("1 归档采集(pdf),2 异地扫描(图片),3 现场扫描(pdf),4 其他来源")
+ private Integer fileSource;
+ @ApiModelProperty("完整性描述")
+ private String integrityDesc;
+ @ApiModelProperty("扫描生产软件-视频脑电图号")
+ private String bColumn1;
+ @ApiModelProperty("扫描生产软件-ep号")
+ private String bColumn2;
+ @ApiModelProperty("茂名流水号")
+ private String bColumn3;
+ @ApiModelProperty("扫描生产软件-门诊号")
+ private String bColumn4;
+ @ApiModelProperty("b_column5")
+ private String bColumn5;
+ @ApiModelProperty("b_column6")
+ private Integer bColumn6;
+ @ApiModelProperty("b_column7")
+ private Integer bColumn7;
+ @ApiModelProperty("b_column8")
+ private Integer bColumn8;
+ @ApiModelProperty("b_column9")
+ private Integer bColumn9;
+ @ApiModelProperty("b_column10")
+ private Integer bColumn10;
+ @ApiModelProperty("性别名称")
+ private String sexName;
+ @ApiModelProperty("记账号(省中医患者主索引id)")
+ private String jzh;
+ @ApiModelProperty("患者主索引号(省中医记账号)")
+ private String empId;
+ @ApiModelProperty("visit_type_code")
+ private String visitTypeCode;
+ @ApiModelProperty("visit_type_name")
+ private String visitTypeName;
+ @ApiModelProperty("tcm_diag_code")
+ private String tcmDiagCode;
+ @ApiModelProperty("tcm_diag_name")
+ private String tcmDiagName;
+ @ApiModelProperty("ward_palce")
+ private String wardPalce;
+ @ApiModelProperty("床号位")
+ private String bedNum;
+ @ApiModelProperty("接收时间,目前澄海人医 使用")
+ private Date receiveTime;
+ @ApiModelProperty("状态 1:封存,3:锁定")
+ private Integer state;
+ @ApiModelProperty("是否扫描 2否 1是")
+ private String scanSource;
+ @ApiModelProperty("暂缓审核配置id ,隔开")
+ private String cqcDeferAuditConfigId;
+ @ApiModelProperty("病案是否批注 0:没有批注 1:有批注")
+ private Integer commentStatus;
+ @ApiModelProperty("医生提交状态(0:未提交,1:已提交)")
+ private Integer doctorState;
+ @ApiModelProperty("护士提交状态")
+ private Integer nurseState;
+ @ApiModelProperty("纸质签收 0:未签收 1:已签收")
+ private Integer cqcSigninfo;
+ @ApiModelProperty("责任护士")
+ private String dutyNurse;
+ @ApiModelProperty("审核状态 0:否 1:是")
+ private Integer tagState;
+ @ApiModelProperty("是否手术")
+ private String isOper;
+ @ApiModelProperty("现住址")
+ private String homeAddr;
+ @ApiModelProperty("损伤中毒")
+ private String poisoningName;
+ @ApiModelProperty("病理诊断")
+ private String pathologyName;
+ @ApiModelProperty("其他诊断")
+ private String otherDiagName;
+ @ApiModelProperty("联系方式")
+ private String homeTel;
+
+ public void setIsDead(String isDead) {
+ this.isDead = isDead != null && isDead.toLowerCase().equals("y") ? 1 : 0;
+ }
+
+}
diff --git a/src/main/java/com/docus/bgts/wzh/entity/TBasicExtend.java b/src/main/java/com/docus/bgts/wzh/entity/TBasicExtend.java
new file mode 100644
index 0000000..c444630
--- /dev/null
+++ b/src/main/java/com/docus/bgts/wzh/entity/TBasicExtend.java
@@ -0,0 +1,45 @@
+//
+// Source code recreated from a .class file by IntelliJ IDEA
+// (powered by FernFlower decompiler)
+//
+
+package com.docus.bgts.wzh.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Date;
+
+@ApiModel(
+ value = "TBasicExtend对象",
+ description = "病案基本信息扩展表"
+)
+@Data
+public class TBasicExtend {
+ @ApiModelProperty("病案主键")
+ @TableId(
+ value = "patient_id",
+ type = IdType.ASSIGN_ID
+ )
+ private String patientId;
+ @ApiModelProperty("报销政策代码")
+ private String claimPolicyCode;
+ @ApiModelProperty("报销政策名称")
+ private String claimPolicyName;
+ @ApiModelProperty("医保结算类型代码")
+ private String mioSettleTypeCode;
+ @ApiModelProperty("医保结算类型名称")
+ private String mioSettleTypeName;
+ @ApiModelProperty("医生提交时间")
+ private Date doctorSubmitTime;
+ @ApiModelProperty("护理提交时间")
+ private Date nurseSubmitTime;
+ @ApiModelProperty("责任护士")
+ private String dutyNurse;
+ @ApiModelProperty("预住院流水号")
+ private String preJzh;
+
+}
diff --git a/src/main/java/com/docus/bgts/wzh/entity/ZdAssort.java b/src/main/java/com/docus/bgts/wzh/entity/ZdAssort.java
new file mode 100644
index 0000000..4a66e7a
--- /dev/null
+++ b/src/main/java/com/docus/bgts/wzh/entity/ZdAssort.java
@@ -0,0 +1,36 @@
+//
+// Source code recreated from a .class file by IntelliJ IDEA
+// (powered by FernFlower decompiler)
+//
+
+package com.docus.bgts.wzh.entity;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+@ApiModel(
+ value = "ZdAssort对象",
+ description = "病案分类"
+)
+@Data
+public class ZdAssort implements Serializable {
+ private static final long serialVersionUID = 1L;
+ @ApiModelProperty("分类id")
+ private String assortId;
+ @ApiModelProperty("分类名称")
+ private String assortName;
+ @ApiModelProperty("分类排序")
+ private Integer assortSort;
+ @ApiModelProperty("是否启用 1是,0否")
+ private Integer effective;
+ @ApiModelProperty("是否校验 1是,0否")
+ private Integer isCheck;
+ @ApiModelProperty("代码分类")
+ private String assortCode;
+ @ApiModelProperty("等级")
+ private Integer level;
+
+}
diff --git a/src/main/java/com/docus/bgts/wzh/facade/IAfCollectTaskService.java b/src/main/java/com/docus/bgts/wzh/facade/IAfCollectTaskService.java
new file mode 100644
index 0000000..b929467
--- /dev/null
+++ b/src/main/java/com/docus/bgts/wzh/facade/IAfCollectTaskService.java
@@ -0,0 +1,58 @@
+//
+// Source code recreated from a .class file by IntelliJ IDEA
+// (powered by FernFlower decompiler)
+//
+
+package com.docus.bgts.wzh.facade;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.docus.bgts.rpc.dto.ReportDownDto;
+import com.docus.bgts.wzh.entity.AfCollectTask;
+import com.docus.bgts.wzh.entity.CanlcelDto;
+import com.docus.bgts.wzh.entity.TBasic;
+import com.docus.bgts.wzh.entity.ZdAssort;
+
+import java.util.List;
+
+public interface IAfCollectTaskService extends IService {
+ String getpatientIdByJzh(String jzh);
+
+ String getpatientIdBysealId(String sealId);
+
+ String getNameByPatientId(String patientId);
+
+ String getOutpatientIdByJzhel(String jzh);
+
+ void insertTask(ReportDownDto reportDownDto);
+
+ void insertSeal(ReportDownDto reportDownDto);
+
+ void updateInterfaceCollect(String collectSubId, int state);
+
+ List listJZHByDate(String date1, String date2);
+
+ void invokeRepoalFile(CanlcelDto canlcelDto) throws Exception;
+
+ String selectJzh(String inPatientNo, String examApplyDate);
+
+ String getAssortIdByAssortId(String assortId);
+
+ String getAssortIdByAssortName(String assortId);
+
+ void insertZdAssort(ZdAssort zdAssort);
+
+ int cancelTsaByPatientIdAndSource(String patientId, String assortId);
+
+
+ int updateNurseSubmitTime(ReportDownDto reportDownDto, String nurseSubmitTime, String nurseSubmitName);
+
+ int updateDoctorSubmitTime(ReportDownDto reportDownDto, String doctorSubmitTime, String doctorSubmitName);
+
+ void insertNurseState(ReportDownDto reportDownDto, String nurseSubmitTime);
+
+ void insertDoctorState(ReportDownDto reportDownDto, String doctorSubmitTime);
+
+ TBasic selectDisDateIsNull(String inPatientNo);
+
+ String selectDisDateIsNullJzh(String inPatientNo, String examApplyDate);
+}
diff --git a/src/main/java/com/docus/bgts/wzh/facade/IMrReportErrorService.java b/src/main/java/com/docus/bgts/wzh/facade/IMrReportErrorService.java
new file mode 100644
index 0000000..d3a9053
--- /dev/null
+++ b/src/main/java/com/docus/bgts/wzh/facade/IMrReportErrorService.java
@@ -0,0 +1,10 @@
+//
+// Source code recreated from a .class file by IntelliJ IDEA
+// (powered by FernFlower decompiler)
+//
+
+package com.docus.bgts.wzh.facade;
+
+public interface IMrReportErrorService {
+ void insert(String xml);
+}
diff --git a/src/main/java/com/docus/bgts/wzh/mapper/AfCollectTaskMapper.java b/src/main/java/com/docus/bgts/wzh/mapper/AfCollectTaskMapper.java
new file mode 100644
index 0000000..090cc15
--- /dev/null
+++ b/src/main/java/com/docus/bgts/wzh/mapper/AfCollectTaskMapper.java
@@ -0,0 +1,49 @@
+//
+// Source code recreated from a .class file by IntelliJ IDEA
+// (powered by FernFlower decompiler)
+//
+
+package com.docus.bgts.wzh.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.docus.bgts.wzh.entity.AfCollectTask;
+import com.docus.bgts.wzh.entity.CqcSubmitState;
+import com.docus.bgts.wzh.entity.TBasic;
+import com.docus.bgts.wzh.entity.ZdAssort;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+public interface AfCollectTaskMapper extends BaseMapper {
+ List listJZHByDate(@Param("date1") String date1, @Param("date2") String date2);
+
+ String getpatientIdByJzh(@Param("jzh") String jzh);
+
+ String getPatientIdBysealId(@Param("sealId") String sealId);
+
+ String selectJzh(@Param("inPatientNo") String inPatientNo, @Param("examApplyDate") String examApplyDate);
+
+ TBasic selectDisDateIsNull(@Param("inPatientNo") String inPatientNo);
+
+ String selectDisDateIsNullJzh(@Param("inPatientNo") String inPatientNo, @Param("examApplyDate") String examApplyDate);
+
+ String getAssortIdByAssortId(@Param("assortId") String assortId);
+
+ String getAssortIdByAssortName(@Param("assortName") String assortName);
+
+ void insertZdAssort(@Param("zdAssort") ZdAssort zdAssort);
+
+
+ int cancelTsaByPatientIdAndSource(@Param("patientId") String patientId, @Param("source") String source);
+
+
+ int insertDoctorState(CqcSubmitState cqcSubmitState);
+
+ int updateDoctorState(CqcSubmitState cqcSubmitState);
+
+ CqcSubmitState selectByPatientId(String patientId);
+
+ String selectPatientByjzh(String jzh);
+
+ String selectNameByPatientId(String patientId);
+}
diff --git a/src/main/java/com/docus/bgts/wzh/mapper/AfInterfaceCollectMapper.java b/src/main/java/com/docus/bgts/wzh/mapper/AfInterfaceCollectMapper.java
new file mode 100644
index 0000000..afb0595
--- /dev/null
+++ b/src/main/java/com/docus/bgts/wzh/mapper/AfInterfaceCollectMapper.java
@@ -0,0 +1,12 @@
+//
+// Source code recreated from a .class file by IntelliJ IDEA
+// (powered by FernFlower decompiler)
+//
+
+package com.docus.bgts.wzh.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.docus.bgts.wzh.entity.AfInterfaceCollect;
+
+public interface AfInterfaceCollectMapper extends BaseMapper {
+}
diff --git a/src/main/java/com/docus/bgts/wzh/mapper/AfInterfaceCollectSubMapper.java b/src/main/java/com/docus/bgts/wzh/mapper/AfInterfaceCollectSubMapper.java
new file mode 100644
index 0000000..cfb99f2
--- /dev/null
+++ b/src/main/java/com/docus/bgts/wzh/mapper/AfInterfaceCollectSubMapper.java
@@ -0,0 +1,12 @@
+//
+// Source code recreated from a .class file by IntelliJ IDEA
+// (powered by FernFlower decompiler)
+//
+
+package com.docus.bgts.wzh.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.docus.bgts.wzh.entity.AfInterfaceCollectSub;
+
+public interface AfInterfaceCollectSubMapper extends BaseMapper {
+}
diff --git a/src/main/java/com/docus/bgts/wzh/mapper/MrReportErrorMapper.java b/src/main/java/com/docus/bgts/wzh/mapper/MrReportErrorMapper.java
new file mode 100644
index 0000000..159c1a3
--- /dev/null
+++ b/src/main/java/com/docus/bgts/wzh/mapper/MrReportErrorMapper.java
@@ -0,0 +1,13 @@
+//
+// Source code recreated from a .class file by IntelliJ IDEA
+// (powered by FernFlower decompiler)
+//
+
+package com.docus.bgts.wzh.mapper;
+
+import com.docus.bgts.wzh.entity.MrReportError;
+import org.apache.ibatis.annotations.Param;
+
+public interface MrReportErrorMapper {
+ void save(@Param("mrReportError") MrReportError mrReportError);
+}
diff --git a/src/main/java/com/docus/bgts/wzh/mapper/TBasicExtendMapper.java b/src/main/java/com/docus/bgts/wzh/mapper/TBasicExtendMapper.java
new file mode 100644
index 0000000..ac985e7
--- /dev/null
+++ b/src/main/java/com/docus/bgts/wzh/mapper/TBasicExtendMapper.java
@@ -0,0 +1,17 @@
+//
+// Source code recreated from a .class file by IntelliJ IDEA
+// (powered by FernFlower decompiler)
+//
+
+package com.docus.bgts.wzh.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.docus.bgts.wzh.entity.TBasicExtend;
+
+public interface TBasicExtendMapper extends BaseMapper {
+ TBasicExtend selectByPatientId(String patientId);
+
+ int updatenurseSubmitTime(TBasicExtend tBasicExtend);
+
+ int updateDoctorSubmitTime(TBasicExtend tBasicExtend);
+}
diff --git a/src/main/java/com/docus/bgts/wzh/mapper/TBasicMapper.java b/src/main/java/com/docus/bgts/wzh/mapper/TBasicMapper.java
new file mode 100644
index 0000000..681bad0
--- /dev/null
+++ b/src/main/java/com/docus/bgts/wzh/mapper/TBasicMapper.java
@@ -0,0 +1,17 @@
+//
+// Source code recreated from a .class file by IntelliJ IDEA
+// (powered by FernFlower decompiler)
+//
+
+package com.docus.bgts.wzh.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.docus.bgts.wzh.entity.TBasic;
+
+public interface TBasicMapper extends BaseMapper {
+ TBasic selectByjzh(String jzh);
+
+ TBasic selectByPatientId(String patientId);
+
+ int update(TBasic tbasic);
+}
diff --git a/src/main/java/com/docus/bgts/wzh/mapper/TScanAssortMapper.java b/src/main/java/com/docus/bgts/wzh/mapper/TScanAssortMapper.java
new file mode 100644
index 0000000..016404f
--- /dev/null
+++ b/src/main/java/com/docus/bgts/wzh/mapper/TScanAssortMapper.java
@@ -0,0 +1,14 @@
+//
+// Source code recreated from a .class file by IntelliJ IDEA
+// (powered by FernFlower decompiler)
+//
+
+package com.docus.bgts.wzh.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.docus.bgts.wzh.entity.TBasic;
+import org.apache.ibatis.annotations.Param;
+
+public interface TScanAssortMapper extends BaseMapper {
+ int updateByPatientId(@Param("patientId") String PatientId, @Param("PrePatientId") String PrePatientId);
+}
diff --git a/src/main/java/com/docus/bgts/wzh/service/AfCollectTaskServiceImpl.java b/src/main/java/com/docus/bgts/wzh/service/AfCollectTaskServiceImpl.java
new file mode 100644
index 0000000..d61f431
--- /dev/null
+++ b/src/main/java/com/docus/bgts/wzh/service/AfCollectTaskServiceImpl.java
@@ -0,0 +1,401 @@
+//
+// Source code recreated from a .class file by IntelliJ IDEA
+// (powered by FernFlower decompiler)
+//
+
+package com.docus.bgts.wzh.service;
+
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.conditions.Wrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.docus.bgts.emr.enums.Codes;
+import com.docus.bgts.rpc.dto.ReportDownDto;
+import com.docus.bgts.rpc.dto.ReportDownScanFileDto;
+import com.docus.bgts.utils.FileUtils;
+import com.docus.bgts.utils.HttpUtils;
+import com.docus.bgts.wzh.entity.AfCollectTask;
+import com.docus.bgts.wzh.entity.AfInterfaceCollect;
+import com.docus.bgts.wzh.entity.AfInterfaceCollectSub;
+import com.docus.bgts.wzh.entity.CanlcelDto;
+import com.docus.bgts.wzh.entity.TBasic;
+import com.docus.bgts.wzh.entity.TBasicExtend;
+import com.docus.bgts.wzh.entity.ZdAssort;
+import com.docus.bgts.wzh.facade.IAfCollectTaskService;
+import com.docus.bgts.wzh.mapper.AfCollectTaskMapper;
+import com.docus.bgts.wzh.mapper.AfInterfaceCollectMapper;
+import com.docus.bgts.wzh.mapper.AfInterfaceCollectSubMapper;
+import com.docus.bgts.wzh.mapper.TBasicExtendMapper;
+import com.docus.bgts.wzh.mapper.TBasicMapper;
+import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.function.Function;
+import java.util.stream.Collectors;
+
+@Service
+public class AfCollectTaskServiceImpl extends ServiceImpl implements IAfCollectTaskService {
+ private final Logger log = LoggerFactory.getLogger(this.getClass());
+ @Autowired
+ AfCollectTaskMapper afCollectTaskMapper;
+ @Autowired
+ AfInterfaceCollectMapper afInterfaceCollectMapper;
+ @Autowired
+ AfInterfaceCollectSubMapper afInterfaceCollectSubMapper;
+ @Autowired
+ TBasicExtendMapper tBasicExtendMapper;
+ @Autowired
+ TBasicMapper tBasicMapper;
+
+ @Override
+ public String getpatientIdByJzh(String jzh) {
+ String patientId = this.afCollectTaskMapper.getpatientIdByJzh(jzh);
+ return patientId;
+ }
+
+ @Override
+ public String getpatientIdBysealId(String sealId) {
+ return this.afCollectTaskMapper.getPatientIdBysealId(sealId);
+ }
+
+ @Override
+ public String getNameByPatientId(String patientId) {
+ return this.afCollectTaskMapper.selectNameByPatientId(patientId);
+ }
+
+ @Override
+ public String getOutpatientIdByJzhel(String jzh) {
+ return this.afCollectTaskMapper.selectPatientByjzh(jzh);
+ }
+
+ @Override
+ @Transactional
+ public void insertTask(ReportDownDto reportDownDto) {
+ Date date = new Date();
+ String collectorid = reportDownDto.getCollectorid();
+ String patientId = reportDownDto.getPatient().getPatientid();
+ List scanfiles = reportDownDto.getScanfiles();
+ QueryWrapper patientTaskWrapper = new QueryWrapper().eq("patient_id", patientId).eq("sysflag", collectorid);
+ List collectTaskList = afCollectTaskMapper.selectList(patientTaskWrapper);
+ Map collectTaskMap = collectTaskList.stream()
+ .collect(Collectors.toMap(AfCollectTask::getC1, Function.identity()));
+
+ for (ReportDownScanFileDto scanfile : scanfiles) {
+ AfCollectTask afCollectTask;
+ if (collectTaskMap.containsKey(scanfile.getSerialnum())) {
+ afCollectTask = collectTaskMap.get(scanfile.getSerialnum());
+ afCollectTask.setState("0");
+ afCollectTask.setSyncTime(date);
+ afCollectTask.setC1(scanfile.getSerialnum());
+ afCollectTask.setC2(scanfile.getFiletitle());
+ afCollectTaskMapper.updateById(afCollectTask);
+ } else {
+ afCollectTask = new AfCollectTask();
+ afCollectTask.setPatientId(patientId);
+ afCollectTask.setSysflag(collectorid);
+ afCollectTask.setState("0");
+ afCollectTask.setSyncTime(date);
+ afCollectTask.setC1(scanfile.getSerialnum());
+ afCollectTask.setC2(scanfile.getFiletitle());
+ afCollectTask.setC3(reportDownDto.getPatient().getJzh());
+ afCollectTaskMapper.insert(afCollectTask);
+ }
+ scanfile.setTaskid(afCollectTask.getId());
+ }
+ }
+
+ @Override
+ public void insertSeal(ReportDownDto reportDownDto) {
+ if (((ReportDownScanFileDto) reportDownDto.getScanfiles().get(0)).getFiletype() == 1) {
+ this.log.info("新增封存任务表初始数据:" + reportDownDto);
+ }
+
+ String patientId = this.getpatientIdBysealId(reportDownDto.getPatient().getSealId());
+ if (StringUtils.isBlank(patientId)) {
+ throw new RuntimeException("操作的病案信息不存在");
+ } else {
+ reportDownDto.getPatient().setPatientid(patientId);
+ Date date = new Date();
+ Integer save = null;
+ List scanfiles = reportDownDto.getScanfiles();
+
+ for (ReportDownScanFileDto scanfile : scanfiles) {
+ long l = System.currentTimeMillis();
+ AfCollectTask afCollectTask = (AfCollectTask) this.afCollectTaskMapper.selectOne((Wrapper) ((QueryWrapper) (new QueryWrapper()).eq("C1", scanfile.getSerialnum())).eq("sysflag", reportDownDto.getCollectorid()));
+ if (afCollectTask != null && afCollectTask.getId() != null) {
+ afCollectTask.setPatientId(patientId);
+ afCollectTask.setSysflag(reportDownDto.getCollectorid());
+ afCollectTask.setState("0");
+ afCollectTask.setSyncTime(date);
+ afCollectTask.setC1(scanfile.getSerialnum());
+ afCollectTask.setC2(scanfile.getFiletitle());
+ afCollectTask.setC3(reportDownDto.getPatient().getJzh());
+ save = this.afCollectTaskMapper.updateById(afCollectTask);
+ } else {
+ afCollectTask = new AfCollectTask();
+ afCollectTask.setPatientId(patientId);
+ afCollectTask.setSysflag(reportDownDto.getCollectorid());
+ afCollectTask.setState("0");
+ afCollectTask.setSyncTime(date);
+ afCollectTask.setC1(scanfile.getSerialnum());
+ afCollectTask.setC2(scanfile.getFiletitle());
+ afCollectTask.setC3(reportDownDto.getPatient().getJzh());
+ save = this.afCollectTaskMapper.insert(afCollectTask);
+ }
+
+ if (save <= 0) {
+ this.log.info("封存任务表操作出错");
+ throw new RuntimeException("封存插入病案任务表数据出错");
+ }
+
+ if (afCollectTask.getId() == null) {
+ this.log.info("封存插入任务id为空!");
+ throw new RuntimeException("封存插入任务id为空");
+ }
+
+ scanfile.setTaskid(afCollectTask.getId());
+ }
+
+ reportDownDto.setScanfiles(scanfiles);
+ }
+ }
+
+ @Override
+ public void updateInterfaceCollect(String collectSubId, int state) {
+ AfInterfaceCollectSub afInterfaceCollectSub = (AfInterfaceCollectSub) this.afInterfaceCollectSubMapper.selectById(collectSubId);
+ if (afInterfaceCollectSub == null) {
+ throw new RuntimeException("afInterfaceCollectSub表数据为空");
+ } else {
+ afInterfaceCollectSub.setState(state);
+ int i = this.afInterfaceCollectSubMapper.updateById(afInterfaceCollectSub);
+ if (i <= 0) {
+ throw new RuntimeException("记录任务数时出错");
+ } else {
+ if (state == 1) {
+ AfInterfaceCollect afInterfaceCollect = (AfInterfaceCollect) this.afInterfaceCollectMapper.selectById(afInterfaceCollectSub.getAfInterfaceCollectId());
+ afInterfaceCollect.setCompleteCount(afInterfaceCollect.getCompleteCount() + 1);
+ i = this.afInterfaceCollectMapper.updateById(afInterfaceCollect);
+ if (i <= 0) {
+ throw new RuntimeException("记录任务数时出错");
+ }
+ }
+
+ }
+ }
+ }
+
+ @Override
+ public List listJZHByDate(String date1, String date2) {
+ return this.afCollectTaskMapper.listJZHByDate(date1, date2);
+ }
+
+ @Override
+ public void invokeRepoalFile(CanlcelDto canlcelDto) throws Exception {
+ Map headMap = new HashMap();
+ headMap.put("Content-Type", "application/json");
+ this.log.info("开始文件撤回操作:" + canlcelDto);
+ String post = HttpUtils.post(String.valueOf(FileUtils.getJsonByName(Codes.REPOAL.getMessage())), headMap, (Map) JSON.parseObject(JSON.toJSONString(canlcelDto), Map.class));
+ Map resMap = (Map) JSON.parseObject(post, Map.class);
+ if (String.valueOf(resMap.get("code")).equals("500")) {
+ this.log.error(String.valueOf(resMap.get("msg")));
+ throw new RuntimeException(String.valueOf(resMap.get("msg")));
+ }
+ }
+
+ @Override
+ public String selectJzh(String inPatientNo, String examApplyDate) {
+ return this.afCollectTaskMapper.selectJzh(inPatientNo, examApplyDate);
+ }
+
+ @Override
+ public String getAssortIdByAssortId(String assortId) {
+ return this.afCollectTaskMapper.getAssortIdByAssortId(assortId);
+ }
+
+ @Override
+ public String getAssortIdByAssortName(String assortId) {
+ return this.afCollectTaskMapper.getAssortIdByAssortName(assortId);
+ }
+
+ @Override
+ public void insertZdAssort(ZdAssort zdAssort) {
+ this.afCollectTaskMapper.insertZdAssort(zdAssort);
+ }
+
+ @Override
+ public int cancelTsaByPatientIdAndSource(String patientId, String assortId) {
+ return this.afCollectTaskMapper.cancelTsaByPatientIdAndSource(patientId, assortId);
+ }
+
+ @Override
+ public int updateNurseSubmitTime(ReportDownDto reportDownDto, String nurseSubmitTime, String nurseSubmitName) {
+ String patientId = this.getpatientIdByJzh(reportDownDto.getPatient().getJzh());
+ TBasicExtend tBasicExtend = this.tBasicExtendMapper.selectByPatientId(patientId);
+ int update = 0;
+
+ try {
+ if (null != tBasicExtend) {
+ tBasicExtend.setNurseSubmitTime(new Date());
+ update = this.tBasicExtendMapper.updatenurseSubmitTime(tBasicExtend);
+ if (null != patientId && null != tBasicExtend.getNurseSubmitTime()) {
+ Map headMap = new HashMap();
+ headMap.put("Content-Type", "application/json");
+ Map> params = new HashMap();
+ List list = new ArrayList();
+ list.add("护士");
+ list.add((new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")).format(tBasicExtend.getNurseSubmitTime()));
+ params.put(patientId, list);
+ params = (Map) JSON.parseObject(JSON.toJSONString(params), Map.class);
+ String post = HttpUtils.postSubmit("http://192.9.100.171:9102/basic/tlog/saveLog?nodeCode=again_submit&userName=" + nurseSubmitName + "&name=" + nurseSubmitName, headMap, params);
+ Map resMap = (Map) JSON.parseObject(post, Map.class);
+ long l7 = System.currentTimeMillis();
+ if (String.valueOf(resMap.get("code")).equals("500")) {
+ this.log.info("调用示踪接口出错!" + String.valueOf(resMap.get("msg")));
+ } else {
+ this.log.info("调用示踪接口返回值为--" + resMap);
+ }
+ }
+ } else {
+ TBasicExtend tBasicExtend1 = new TBasicExtend();
+ tBasicExtend1.setPatientId(patientId);
+ tBasicExtend1.setNurseSubmitTime((new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")).parse(nurseSubmitTime));
+ update = this.tBasicExtendMapper.insert(tBasicExtend1);
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ this.log.error(e.getMessage());
+ }
+
+ return update;
+ }
+
+ @Override
+ public int updateDoctorSubmitTime(ReportDownDto reportDownDto, String doctorSubmitTime, String doctorSubmitName) {
+ String patientId = this.getpatientIdByJzh(reportDownDto.getPatient().getJzh());
+ TBasicExtend tBasicExtend = this.tBasicExtendMapper.selectByPatientId(patientId);
+ int update = 0;
+ this.log.info("医生提交方法------");
+
+ try {
+ SimpleDateFormat simple = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+ Date submitTime = simple.parse(doctorSubmitTime);
+ if (null != tBasicExtend) {
+ tBasicExtend.setDoctorSubmitTime(submitTime);
+ update = this.tBasicExtendMapper.updateDoctorSubmitTime(tBasicExtend);
+
+ try {
+ if (null != patientId && null != tBasicExtend.getDoctorSubmitTime()) {
+ Map headMap = new HashMap();
+ headMap.put("Content-Type", "application/json");
+ Map> params = new HashMap();
+ List list = new ArrayList();
+ list.add("医生");
+ list.add((new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")).format(tBasicExtend.getDoctorSubmitTime()));
+ params.put(patientId, list);
+ params = (Map) JSON.parseObject(JSON.toJSONString(params), Map.class);
+ long l = System.currentTimeMillis();
+ String post = HttpUtils.postSubmit("http://192.9.100.171:9102/basic/tlog/saveLog?nodeCode=again_submit&userName=" + doctorSubmitName + "&name=" + doctorSubmitName, headMap, params);
+ long l1 = System.currentTimeMillis();
+ this.log.info("调用示踪接口耗时{}", l1 - l);
+ Map resMap = (Map) JSON.parseObject(post, Map.class);
+ long l7 = System.currentTimeMillis();
+ if (String.valueOf(resMap.get("code")).equals("500")) {
+ this.log.info("调用示踪接口出错!" + resMap);
+ throw new RuntimeException(String.valueOf(resMap.get("msg")));
+ }
+
+ this.log.info("调用示踪接口返回----" + resMap);
+ } else {
+ this.log.info("未调用示踪接口-----");
+ }
+ } catch (Exception e) {
+ this.log.error(e.getMessage());
+ }
+ } else {
+ TBasicExtend tBasicExtend1 = new TBasicExtend();
+ tBasicExtend1.setPatientId(patientId);
+ tBasicExtend1.setDoctorSubmitTime(submitTime);
+ update = this.tBasicExtendMapper.insert(tBasicExtend1);
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ this.log.error(e.getMessage());
+ }
+
+ return update;
+ }
+
+ @Override
+ public void insertNurseState(ReportDownDto reportDownDto, String nurseSubmitTime) {
+ TBasic tBasic = this.tBasicMapper.selectByjzh(reportDownDto.getPatient().getJzh());
+ if (null == tBasic) {
+ throw new RuntimeException("操作的病案信息不存在");
+ } else {
+ if (null != nurseSubmitTime && !"".equals(nurseSubmitTime)) {
+ tBasic.setNurseState(1);
+ int update = this.tBasicMapper.update(tBasic);
+ if (update > 0) {
+ this.log.info("护士提交状态修改成功!");
+ } else {
+ this.log.info("护士提交状态修改失败!");
+ }
+ } else {
+ tBasic.setNurseState(0);
+ int update = this.tBasicMapper.update(tBasic);
+ if (update > 0) {
+ this.log.info("护士提交状态修改成功!");
+ } else {
+ this.log.info("护士提交状态修改失败!");
+ }
+ }
+
+ }
+ }
+
+ @Override
+ public void insertDoctorState(ReportDownDto reportDownDto, String doctorSubmitTime) {
+ TBasic tBasic = this.tBasicMapper.selectByjzh(reportDownDto.getPatient().getJzh());
+ if (null == tBasic) {
+ throw new RuntimeException("操作的病案信息不存在");
+ } else {
+ if (null != doctorSubmitTime && !"".equals(doctorSubmitTime)) {
+ tBasic.setDoctorState(1);
+ int update = this.tBasicMapper.update(tBasic);
+ if (update > 0) {
+ this.log.info("医生提交状态修改成功!");
+ } else {
+ this.log.info("医生提交状态修改失败!");
+ }
+ } else {
+ tBasic.setDoctorState(0);
+ int update = this.tBasicMapper.update(tBasic);
+ if (update > 0) {
+ this.log.info("医生提交状态修改成功!");
+ } else {
+ this.log.info("医生提交状态修改失败!");
+ }
+ }
+
+ }
+ }
+
+ @Override
+ public TBasic selectDisDateIsNull(String inPatientNo) {
+ return this.afCollectTaskMapper.selectDisDateIsNull(inPatientNo);
+ }
+
+ @Override
+ public String selectDisDateIsNullJzh(String inPatientNo, String examApplyDate) {
+ return this.afCollectTaskMapper.selectDisDateIsNullJzh(inPatientNo, examApplyDate);
+ }
+}
diff --git a/src/main/java/com/docus/bgts/wzh/service/MrReportErrorServiceImpl.java b/src/main/java/com/docus/bgts/wzh/service/MrReportErrorServiceImpl.java
new file mode 100644
index 0000000..ce24b62
--- /dev/null
+++ b/src/main/java/com/docus/bgts/wzh/service/MrReportErrorServiceImpl.java
@@ -0,0 +1,35 @@
+//
+// Source code recreated from a .class file by IntelliJ IDEA
+// (powered by FernFlower decompiler)
+//
+
+package com.docus.bgts.wzh.service;
+
+import com.docus.bgts.utils.FileUtils;
+import com.docus.bgts.wzh.entity.MrReportError;
+import com.docus.bgts.wzh.facade.IMrReportErrorService;
+import com.docus.bgts.wzh.mapper.MrReportErrorMapper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.Date;
+
+@Service
+public class MrReportErrorServiceImpl implements IMrReportErrorService {
+ private static final Logger log = LoggerFactory.getLogger(MrReportErrorServiceImpl.class);
+ @Autowired
+ MrReportErrorMapper mrReportErrorMapper;
+ @Override
+ public void insert(String xml) {
+ log.info("------发送错误:并记录日志------");
+ MrReportError mrReportError = new MrReportError();
+ mrReportError.setXml(xml);
+ mrReportError.setCreateTime(new Date());
+ Integer collectorid = Integer.valueOf(String.valueOf(FileUtils.getJsonByName("collectorid")));
+ mrReportError.setReportType(collectorid);
+ this.mrReportErrorMapper.save(mrReportError);
+ log.info("--------日志记录完成------");
+ }
+}
diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml
new file mode 100644
index 0000000..bf1a00b
--- /dev/null
+++ b/src/main/resources/application.yml
@@ -0,0 +1,34 @@
+server:
+ port: 9205
+# http
+
+mybatis-plus:
+ configuration:
+ map-underscore-to-camel-case: true
+ call-setters-on-nulls: true
+ log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
+ global-config:
+ db-config:
+ field-strategy: NOT_EMPTY
+ db-type: MYSQL
+beat:
+ url: http://localhost:9399/beat
+
+system:
+ # 发布的webserver类型 电子病历 EMR,护理 NURSING
+ type: "emr"
+ code: "empcllect"
+ prop: 9405
+# web service
+
+docus:
+ url:
+ # 报告上报地址
+ downploadlatform-server: http://localhost:9291/
+
+spring:
+ datasource:
+ driver-class-name: com.mysql.cj.jdbc.Driver
+ username: docus
+ password: docus702
+ url: jdbc:mysql://db.docus.cn:3306/docus_archivefile?characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&rewriteBatchedStatements=true&allowMultiQueries=true
\ No newline at end of file
diff --git a/src/main/resources/logback-spring.xml b/src/main/resources/logback-spring.xml
new file mode 100644
index 0000000..8eaaca4
--- /dev/null
+++ b/src/main/resources/logback-spring.xml
@@ -0,0 +1,51 @@
+
+
+
+
+
+
+
+ [%d{yyyy-MM-dd' 'HH:mm:ss.sss}] [%contextName] [%thread] [%X{traceId}] %-5level %logger{36} - %msg%n
+
+ UTF-8
+
+
+
+
+
+
+ configLog/log.log
+
+
+
+
+
+ log/demo.%d.%i.log
+
+ 180
+
+
+ 10MB
+
+
+
+
+
+ [%d{yyyy-MM-dd' 'HH:mm:ss.sss}] [%C] [%t] [%X{traceId}] [%L] [%-5p] %m%n
+
+ utf-8
+
+ UTF-8
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main/resources/mapper/AfCollectTaskMapper.xml b/src/main/resources/mapper/AfCollectTaskMapper.xml
new file mode 100644
index 0000000..28d606e
--- /dev/null
+++ b/src/main/resources/mapper/AfCollectTaskMapper.xml
@@ -0,0 +1,112 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ insert into zd_assort(assort_id,assort_name,effective) values(#{zdAssort.assortId},#{zdAssort.assortName},#{zdAssort.effective})
+
+
+
+
+
+
+
+ update t_scan_assort
+ set is_del = 1
+ where
+ patient_id= #{patientId} and source= #{source}
+
+
+
+ insert into docus_medicalrecord.cqc_submit_state(patient_id,doctor_state,nurse_state) values(#{patientId},#{doctorState},#{nurseState})
+
+
+
+ update docus_medicalrecord.cqc_submit_state
+
+
+ doctor_state=#{doctorState},
+
+
+
+ nurse_state=#{nurseState},
+
+
+ where patient_id=#{patientId}
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main/resources/mapper/MrReportErrorMapper.xml b/src/main/resources/mapper/MrReportErrorMapper.xml
new file mode 100644
index 0000000..30716a3
--- /dev/null
+++ b/src/main/resources/mapper/MrReportErrorMapper.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+ insert into docus_medicalrecord.mr_report_error(xml,report_type,create_time)
+ values(#{mrReportError.xml},#{mrReportError.reportType},#{mrReportError.createTime})
+
+
+
\ No newline at end of file
diff --git a/src/main/resources/mapper/TBasicExtendMapper.xml b/src/main/resources/mapper/TBasicExtendMapper.xml
new file mode 100644
index 0000000..1e66a18
--- /dev/null
+++ b/src/main/resources/mapper/TBasicExtendMapper.xml
@@ -0,0 +1,27 @@
+
+
+
+
+ update docus_medicalrecord.t_basic_extend
+ set nurse_submit_time=#{nurseSubmitTime}
+ where patient_id=#{patientId}
+
+
+ update docus_medicalrecord.t_basic_extend
+ set doctor_submit_time=#{doctorSubmitTime}
+ where patient_id=#{patientId}
+
+
+
+ insert into docus_medicalrecord.t_basic_extend (patient_id,claim_policy_code,claim_policy_name,mio_settle_type_code,mio_settle_type_name,doctor_submit_time,nurse_submit_time,duty_nurse)
+ values (#{patientId},#{claimPolicyCode},#{claimPolicyName},#{mioSettleTypeCode},#{mioSettleTypeName},#{doctorSubmitTime},#{nurseSubmitTime},#{dutyNurse})
+
+
\ No newline at end of file
diff --git a/src/main/resources/mapper/TBasicMapper.xml b/src/main/resources/mapper/TBasicMapper.xml
new file mode 100644
index 0000000..71a3bea
--- /dev/null
+++ b/src/main/resources/mapper/TBasicMapper.xml
@@ -0,0 +1,76 @@
+
+
+
+
+ update docus_medicalrecord.t_basic
+
+
+ IPAddress=#{pcmachine.ipaddress},
+
+
+ LastOnline=#{pcmachine.lastonline},
+
+
+ PCStatus=#{pcmachine.pcstatus}
+
+
+ IPAddress=#{pcmachine.ipaddress},
+
+
+ LastOnline=#{pcmachine.lastonline},
+
+
+ PCStatus=#{pcmachine.pcstatus}
+
+
+ IPAddress=#{pcmachine.ipaddress},
+
+
+ LastOnline=#{pcmachine.lastonline},
+
+
+ PCStatus=#{pcmachine.pcstatus}
+
+
+ IPAddress=#{pcmachine.ipaddress},
+
+
+ LastOnline=#{pcmachine.lastonline},
+
+
+ PCStatus=#{pcmachine.pcstatus}
+
+
+ IPAddress=#{pcmachine.ipaddress},
+
+
+ LastOnline=#{pcmachine.lastonline},
+
+
+ PCStatus=#{pcmachine.pcstatus}
+
+
+ where id=#{pcmachine.id}
+
+
+
+ UPDATE docus_medicalrecord.t_basic
+
+ doctor_state = #{doctorState},
+ nurse_state = #{nurseState},
+
+ WHERE patient_id = #{patientId}
+
+
+
+
\ No newline at end of file
diff --git a/src/main/resources/mapper/TScanAssortMapper.xml b/src/main/resources/mapper/TScanAssortMapper.xml
new file mode 100644
index 0000000..34dda40
--- /dev/null
+++ b/src/main/resources/mapper/TScanAssortMapper.xml
@@ -0,0 +1,10 @@
+
+
+
+
+update docus_archivefile.t_scan_assort set patient_id=#{patientId},assort_id='Wiw213woq412awqe42' where patient_id=#{PrePatientId}
+
+
+
\ No newline at end of file