CLIENT_MAP = new ConcurrentHashMap<>();
+ private static final Logger logger = LoggerFactory.getLogger(JaxWsDynamicClientUtil.class);
+
+ public static String send(String wsdlUrl, String namespaceUri, String operationName, Object[] params) {
+ logger.debug("wsdlUrl:" + wsdlUrl + " ,namespaceUri: " + namespaceUri + " ,operationName:" + operationName + ",param:" + Arrays.toString(params));
+ try {
+ Client client = getClient(wsdlUrl);
+ Object[] result;
+ if (namespaceUri == null || namespaceUri.isEmpty()) {
+ result = client.invoke(operationName, params);
+ } else {
+ QName qName = new QName(namespaceUri, operationName);
+ result = client.invoke(qName, params);
+ }
+ if (result == null || result[0] == null) {
+ return null;
+ }
+ return String.valueOf(result[0]);
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ logger.error("wsdlUrl:" + wsdlUrl + ",namespaceUri: " + namespaceUri + " ,operationName:" + operationName + ",param:" + Arrays.toString(params) + " 调用失败了!", ex);
+ return null;
+ }
+ }
+
+ public static Client getClient(String wsdlUrl) {
+ if (CLIENT_MAP.get(wsdlUrl) == null) {
+ synchronized (JaxWsDynamicClientUtil.class) {
+ if (CLIENT_MAP.get(wsdlUrl) == null) {
+ Client client = CLIENT_FACTORY.createClient(wsdlUrl);
+ setClientParam(client);
+ CLIENT_MAP.put(wsdlUrl, client);
+ }
+ }
+ }
+ return CLIENT_MAP.get(wsdlUrl);
+ }
+
+ private static void setClientParam(Client client) {
+ HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy();
+ httpClientPolicy.setConnectionTimeout(30000);
+ httpClientPolicy.setAllowChunking(false);
+ httpClientPolicy.setReceiveTimeout(30000);
+ HTTPConduit clientConduit = (HTTPConduit) client.getConduit();
+ clientConduit.setClient(httpClientPolicy);
+ }
+}
diff --git a/src/main/java/com/docus/collect/util/XmlUtil.java b/src/main/java/com/docus/collect/util/XmlUtil.java
new file mode 100644
index 0000000..b3f066f
--- /dev/null
+++ b/src/main/java/com/docus/collect/util/XmlUtil.java
@@ -0,0 +1,859 @@
+/*
+ * 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.collect.util;
+
+import com.docus.core.util.Exceptions;
+import com.docus.core.util.IoUtil;
+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);
+ }
+
+ /**
+ * 转换工具类
+ *
+ * @param xmlStr xmlStr
+ * @return XmlUtil
+ */
+ public static XmlUtil of(String 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();
+ }
+
+ private static String str;
+
+ static {
+ str = " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " - \n" +
+ "
\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " - \n" +
+ "
\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ "
\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " - \n" +
+ "
\n" +
+ " \n" +
+ " - \n" +
+ " \n" +
+ "
\n" +
+ " \n" +
+ "
\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " - \n" +
+ "
\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " - \n" +
+ "
\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " - \n" +
+ " \n" +
+ "
\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " - \n" +
+ "
\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " - \n" +
+ " \n" +
+ "
\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " 59 \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " 205室 \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " 耳鼻咽喉头颈外科 \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " 2号楼16楼西区 \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " 南方医科大学顺德医院 \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " 突发特发性听觉丧失 \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ "
\n" +
+ " \n" +
+ "
\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " 无 \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ "
\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ "
\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ "
\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ "
\n" +
+ " \n" +
+ "
\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ "
\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ "
\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ "
\n" +
+ " \n" +
+ "
\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " 常规 \n" +
+ "
\n" +
+ " \n" +
+ "
\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ "
\n" +
+ " \n" +
+ "
\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ "
\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ "
\n" +
+ " \n" +
+ "
\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " 治愈 \n" +
+ "
\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ "
\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " 张存良 \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " 耳鼻咽喉头颈外科 \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " 突发特发性听觉丧失 \n" +
+ "
\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " 文本 \n" +
+ "
\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ "
\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ "
\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ "
\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ "
\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ "
\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ "
\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " 无 \n" +
+ "
\n" +
+ " \n" +
+ "
\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ "
\n" +
+ " \n" +
+ " 乳房病类 \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ "
\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ "
\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ "
\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ "
\n" +
+ " \n" +
+ "
\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ "
\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ "
\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ "
\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " 治愈 \n" +
+ " \n" +
+ " O \n" +
+ " \n" +
+ " 0 \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " 01 \n" +
+ " \n" +
+ " 出院医嘱 \n" +
+ " \n" +
+ "\n";
+ }
+
+ public static void main(String[] args) {
+ XmlUtil a = XmlUtil.of(str);
+ Node node = null;
+ //id-消息流水号
+ node = a.getNode("/PRPA_HIP0032/id/@extension");
+ String serialId = node.toString();
+ System.out.println(serialId);
+ //住院流水号
+ node = a.getNode("/PRPA_HIP0032/controlActProcess/subject/encounterEvent/item/@extension");
+ String jzh = node.toString();
+ System.out.println(jzh);
+ //住院号标识
+ node = a.getNode("/PRPA_HIP0032/controlActProcess/subject/encounterEvent/id/item/@extension");
+ String inpatientNo = node.toString();
+ System.out.println(inpatientNo);
+ //住院次数[]
+ node = a.getNode("/PRPA_HIP0032/controlActProcess/subject/encounterEvent/lengthOfStayQuantity[@unit='次']/@value");
+ String admissTimes = node.toString();
+ System.out.println(admissTimes);
+ //姓名
+ node = a.getNode("/PRPA_HIP0032/controlActProcess/subject/encounterEvent/subject/patient/patientPerson/name/item/part/@value");
+ String name = node.toString();
+ System.out.println(name);
+ //入院日期时间
+ node = a.getNode("/PRPA_HIP0032/controlActProcess/subject/encounterEvent/effectiveTime/low/@value");
+ String admissDate = node.toString();
+ System.out.println(admissDate);
+ //出院日期时间
+ node = a.getNode("/PRPA_HIP0032/controlActProcess/subject/encounterEvent/effectiveTime/high/@value");
+ String disDate = node.toString();
+ System.out.println(disDate);
+ //入院诊断科室名称[]
+ node = a.getNode("/PRPA_HIP0032/controlActProcess/subject/encounterEvent/component[@displayName='入院诊断']/section/entry[@displayName='入院诊断-西医条目']/observation/performer/assignedEntity/representedOrganization/name");
+ String admissDeptName = node.getTextContent();
+ System.out.println(admissDeptName);
+ //出院诊断科室名称[]
+ node = a.getNode("/PRPA_HIP0032/controlActProcess/subject/encounterEvent/component[@displayName='出院诊断']/section/entry[@displayName='出院诊断-西医条目']/observation/performer/assignedEntity/representedOrganization/name");
+ String disDeptName = node.getTextContent();
+ System.out.println(disDeptName);
+ //主治医师[]
+ node = a.getNode("/PRPA_HIP0032/controlActProcess/subject/encounterEvent/authenticator[@displayName='主治医师']/assignedEntity/assignedPerson/name");
+ String attendingName = node.getTextContent();
+ System.out.println(attendingName);
+ }
+}
diff --git a/src/main/resources/bin/install.bat b/src/main/resources/bin/install.bat
new file mode 100644
index 0000000..7a651bc
--- /dev/null
+++ b/src/main/resources/bin/install.bat
@@ -0,0 +1,33 @@
+@echo off
+
+for /f "delims=" %%t in ('winsw.exe status') do set str=%%t
+echo %str%
+
+
+
+if %str%==Started (
+echo "restart....."
+winsw stop
+PING 127.0.0.1 -n 10 -w 30000 >NUL
+winsw start
+)
+
+
+
+if %str%==Stopped (
+echo "start....."
+winsw start
+)
+
+
+if %str%==NonExistent (
+echo "deploy and start....."
+winsw install
+winsw start
+echo c
+)
+
+
+
+
+
diff --git a/src/main/resources/bin/start.bat b/src/main/resources/bin/start.bat
new file mode 100644
index 0000000..58c25cb
--- /dev/null
+++ b/src/main/resources/bin/start.bat
@@ -0,0 +1,21 @@
+set java_opts=-Xms512m -Xmx512m
+set key="java_opts"
+
+
+rem 文件不存在,就跳过
+if not exist java-ops.ini goto end
+
+for /f "tokens=1,2 delims==" %%i in (java-ops.ini) do (
+ if "%%i"==%key% set java_opts=%%j)
+echo java_opts is : %java_opts%
+
+:end
+
+rem 启动java
+
+java %java_opts% -Dfile.encoding=utf-8 -jar -Dspring.profiles.active=@profile.name@ -Dloader.path=config,lib @project.build.finalName@.jar
+
+
+
+
+
diff --git a/src/main/resources/bin/stop.bat b/src/main/resources/bin/stop.bat
new file mode 100644
index 0000000..98468a0
--- /dev/null
+++ b/src/main/resources/bin/stop.bat
@@ -0,0 +1,13 @@
+@echo off
+
+for /f "delims=" %%t in ('winsw.exe status') do set str=%%t
+echo %str%
+
+
+
+if %str%==Started (
+winsw stop
+@echo wait program stop .....
+PING 127.0.0.1 -n 30 -w 10000 >NUL
+)
+
diff --git a/src/main/resources/bin/update.bat b/src/main/resources/bin/update.bat
new file mode 100644
index 0000000..74e4a9b
--- /dev/null
+++ b/src/main/resources/bin/update.bat
@@ -0,0 +1,19 @@
+@echo off
+
+set deployDir=%1\docus-webservice-gdszy
+if %deployDir%=="" set deployDir=d:\webroot\docus-webservice-gdszy
+
+set curr_file=%cd%
+cd /d %deployDir%
+call stop.bat
+cd %curr_file%
+sc query docus-backup-sys |Find "RUNNING" && ping 127.0.0.1 -n 10 >nul
+rd/s/q %deployDir%\lib
+rd/s/q %deployDir%\dataConfig
+rd/s/q %deployDir%\config
+del /s/q %deployDir%\*.jar
+xcopy /Y/E/I * %deployDir%
+
+cd /d %deployDir%
+call install.bat
+
diff --git a/src/main/resources/bin/winsw.xml b/src/main/resources/bin/winsw.xml
new file mode 100644
index 0000000..0504619
--- /dev/null
+++ b/src/main/resources/bin/winsw.xml
@@ -0,0 +1,8 @@
+
+ docus-webservice-gdszy
+ 生产-嘉时病案采集-广东省中医
+ 生产-嘉时病案采集-广东省中医
+ Automatic
+ %BASE%\start.bat
+
+
\ No newline at end of file
diff --git a/src/main/resources/bootstrap.yml b/src/main/resources/bootstrap.yml
new file mode 100644
index 0000000..4f0d21e
--- /dev/null
+++ b/src/main/resources/bootstrap.yml
@@ -0,0 +1,70 @@
+server:
+ port: 9311
+spring:
+ application:
+ name: @artifactId@
+ datasource:
+ url: jdbc:log4jdbc:mysql://db.docus.cn:3306/docus_medicalrecord?autoReconnect=true&allowMultiQueries=true&useSSL=false&useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai
+ username: docus
+ password: docus702
+ driver-class-name: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
+ type: com.alibaba.druid.pool.DruidDataSource
+ # 初始化配置
+ initial-size: 3
+ # 最小连接数
+ min-idle: 3
+ # 最大连接数
+ max-active: 15
+ # 获取连接超 时时间
+ max-wait: 5000
+ # 连接有效性检测时间
+ time-between-eviction-runs-millis: 90000
+ # 最大空闲时间
+ min-evictable-idle-time-millis: 1800000
+ test-while-idle: true
+ test-on-borrow: false
+ test-on-return: false
+ validation-query: select 1
+
+ redis:
+ host: redis.docus.cn
+ password: JSdocus@702
+ cloud:
+ nacos:
+ discovery:
+ server-addr: nacos.docus.cn
+ namespace: 34acdf7a-9fc6-4bbd-8aea-9a47c8007ad5
+ config:
+ server-addr: ${spring.cloud.nacos.discovery.server-addr}
+ namespace: 34acdf7a-9fc6-4bbd-8aea-9a47c8007ad5
+ file-extension: yml
+ shared-configs:
+ - comm.${spring.cloud.nacos.config.file-extension}
+ profiles:
+ active: dev
+
+
+docus:
+ dbtype: mysql
+
+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
+xxl:
+ job:
+ accessToken:
+ admin:
+ addresses: http://job.docus.cn:8180/xxl-job-admin
+ executor:
+ appname: docus-collect-gdszy
+ address:
+ ip:
+ port: 19311
+ logretentiondays: 30
+ logpath: D:/xxl-job/docus-collect-gdszy
diff --git a/src/main/resources/log4jdbc.log4j2.properties b/src/main/resources/log4jdbc.log4j2.properties
new file mode 100644
index 0000000..5cb6f99
--- /dev/null
+++ b/src/main/resources/log4jdbc.log4j2.properties
@@ -0,0 +1,2 @@
+# If you use SLF4J. First, you need to tell log4jdbc-log4j2 that you want to use the SLF4J logger
+log4jdbc.spylogdelegator.name=net.sf.log4jdbc.log.slf4j.Slf4jSpyLogDelegator
\ No newline at end of file
diff --git a/src/main/resources/logback.xml b/src/main/resources/logback.xml
new file mode 100644
index 0000000..2c982f3
--- /dev/null
+++ b/src/main/resources/logback.xml
@@ -0,0 +1,95 @@
+
+
+ docus-server-fistpage
+
+
+
+
+ [%d{yyyy-MM-dd' 'HH:mm:ss.sss}] [%contextName] [%thread] [%X{traceId}] %-5level %logger{36} - %msg%n
+
+
+
+
+
+
+ [%d{yyyy-MM-dd' 'HH:mm:ss.sss}] [%C] [%t] [%X{traceId}] [%L] [%-5p] %m%n
+ utf-8
+
+
+
+
+ ${log.path}%d.%i.log
+
+ 500MB
+
+ 30
+
+
+
+
+
+ [%d{yyyy-MM-dd' 'HH:mm:ss.sss}] [%C] [%t] [%X{traceId}] [%L] [%-5p] %m%n
+ utf-8
+
+
+
+
+ ${log.path}external%d.%i.log
+
+ 500MB
+
+ 30
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+