esb 9 년 전
부모
커밋
8f657d2bd5
36개의 변경된 파일2493개의 추가작업 그리고 249개의 파일을 삭제
  1. 18 4
      Hos-Framework-dependencies/Hos-Framework-dependencies.iml
  2. 8 2
      Hos-Framework-dependencies/pom.xml
  3. 1 1
      Hos-Framework/Hos-Framework.iml
  4. 2 2
      Hos-Framework/pom.xml
  5. 118 2
      Hos-Framework/src/main/java/com/yihu/ehr/framework/util/httpclient/HttpHelper.java
  6. 14 1
      Hos-Resource-Mini/src/main/java/com.yihu.ehr/common/ApplicationStart.java
  7. 5 4
      Hos-Resource-Mini/src/main/resources/config/http.properties
  8. BIN
      Hos-Resource-Mini/src/main/resources/ssl/tomcat.keystore
  9. 29 19
      Hos-Resource-Rest/pom.xml
  10. 21 30
      Hos-Resource-Rest/resource-rest.iml
  11. 54 0
      Hos-Resource-Rest/src/main/java/com/yihu/hos/config/CxfConfig.java
  12. 1 4
      Hos-Resource-Rest/src/main/java/com/yihu/hos/gateway/control/GatewayControl.java
  13. 38 78
      Hos-Resource-Rest/src/main/java/com/yihu/hos/gateway/util/RPCUtil.java
  14. 35 0
      Hos-Resource-Rest/src/main/java/com/yihu/hos/qlc/controller/PushReturnModel.java
  15. 88 0
      Hos-Resource-Rest/src/main/java/com/yihu/hos/qlc/controller/QLCPushInfo.java
  16. 1428 0
      Hos-Resource-Rest/src/main/java/com/yihu/hos/resource/util/StringUtil.java
  17. 154 0
      Hos-Resource-Rest/src/main/java/com/yihu/hos/ws/model/WSReturnModel.java
  18. 88 0
      Hos-Resource-Rest/src/main/java/com/yihu/hos/ws/service/ServiceGateWay.java
  19. 30 0
      Hos-Resource-Rest/src/main/java/com/yihu/hos/ws/service/ServiceGateWayPortType.java
  20. 36 0
      Hos-Resource-Rest/src/main/java/com/yihu/hos/ws/thread/QLCThread.java
  21. 19 7
      Hos-Resource-WS/Hos-Resource-WS.iml
  22. 2 2
      Hos-resource/Hos-Resource.iml
  23. 1 1
      Hos-resource/pom.xml
  24. 4 0
      Hos-resource/src/main/java/com/yihu/ehr/common/CommonPageController.java
  25. 6 7
      Hos-resource/src/main/java/com/yihu/ehr/job/service/ArchiveUploadJob.java
  26. 5 22
      Hos-resource/src/main/java/com/yihu/ehr/resource/controller/RsCategoryController.java
  27. 14 11
      Hos-resource/src/main/java/com/yihu/ehr/resource/controller/RsResourceController.java
  28. 2 2
      Hos-resource/src/main/java/com/yihu/ehr/resource/service/IRsResourceService.java
  29. 202 29
      Hos-resource/src/main/java/com/yihu/ehr/resource/service/impl/RsResourceServiceImpl.java
  30. 2 2
      Hos-resource/src/main/resources/config/http.properties
  31. 5 4
      Hos-resource/src/main/webapp/WEB-INF/ehr/jsp/datacollect/repeatDatacollectJs.jsp
  32. 10 9
      Hos-resource/src/main/webapp/WEB-INF/ehr/jsp/datacollect/trackJobJs.jsp
  33. 10 4
      Hos-resource/src/main/webapp/WEB-INF/ehr/jsp/resource/resourcebrowse/resourceJs.jsp
  34. 2 0
      Hos-resource/src/main/webapp/WEB-INF/ehr/jsp/resource/resourceregister/rsResourceImportDatasetDialogJs.jsp
  35. 22 2
      Hos-resource/src/main/webapp/WEB-INF/ehr/jsp/resource/resourceregister/rsResourceManageJs.jsp
  36. 19 0
      Hos-resource/src/main/webapp/develop/lib/ligerui/custom/ligerOverwrite.js

+ 18 - 4
Hos-Framework-dependencies/Hos-Framework-dependencies.iml

@ -47,7 +47,6 @@
    <orderEntry type="library" name="Maven: ca.juliusdavies:not-yet-commons-ssl:0.3.9" level="project" />
    <orderEntry type="library" name="Maven: velocity:velocity:1.5" level="project" />
    <orderEntry type="library" name="Maven: org.owasp.esapi:esapi:2.0GA" level="project" />
    <orderEntry type="library" scope="RUNTIME" name="Maven: xml-resolver:xml-resolver:1.2" level="project" />
    <orderEntry type="library" scope="RUNTIME" name="Maven: xalan:xalan:2.7.1" level="project" />
    <orderEntry type="library" scope="RUNTIME" name="Maven: xalan:serializer:2.7.1" level="project" />
    <orderEntry type="library" name="Maven: org.springframework.security:spring-security-config:4.0.2.RELEASE" level="project" />
@ -100,13 +99,12 @@
    <orderEntry type="library" name="Maven: org.apache.james:apache-mime4j-core:0.7.2" level="project" />
    <orderEntry type="library" name="Maven: org.apache.ws.commons.axiom:axiom-compat:1.2.14" level="project" />
    <orderEntry type="library" scope="RUNTIME" name="Maven: org.apache.ws.commons.axiom:axiom-impl:1.2.14" level="project" />
    <orderEntry type="library" scope="RUNTIME" name="Maven: org.codehaus.woodstox:woodstox-core-asl:4.1.4" level="project" />
    <orderEntry type="library" name="Maven: org.codehaus.woodstox:woodstox-core-asl:4.1.4" level="project" />
    <orderEntry type="library" name="Maven: org.apache.geronimo.specs:geronimo-ws-metadata_2.0_spec:1.1.2" level="project" />
    <orderEntry type="library" name="Maven: org.apache.geronimo.specs:geronimo-jta_1.1_spec:1.1" level="project" />
    <orderEntry type="library" name="Maven: javax.servlet:servlet-api:2.3" level="project" />
    <orderEntry type="library" name="Maven: commons-httpclient:commons-httpclient:3.1" level="project" />
    <orderEntry type="library" name="Maven: wsdl4j:wsdl4j:1.6.2" level="project" />
    <orderEntry type="library" name="Maven: org.apache.ws.commons.schema:XmlSchema:1.4.7" level="project" />
    <orderEntry type="library" name="Maven: org.apache.neethi:neethi:3.0.2" level="project" />
    <orderEntry type="library" name="Maven: org.apache.woden:woden-api:1.0M9" level="project" />
    <orderEntry type="library" name="Maven: org.apache.woden:woden-impl-dom:1.0M9" level="project" />
@ -183,6 +181,7 @@
    <orderEntry type="library" name="Maven: aopalliance:aopalliance:1.0" level="project" />
    <orderEntry type="library" name="Maven: org.json:json:20151123" level="project" />
    <orderEntry type="library" name="Maven: javax.servlet:javax.servlet-api:3.1.0" level="project" />
    <orderEntry type="library" name="Maven: javax.transaction:javax.transaction-api:1.2" level="project" />
    <orderEntry type="library" name="Maven: dom4j:dom4j:1.6.1" level="project" />
    <orderEntry type="library" name="Maven: xml-apis:xml-apis:1.4.01" level="project" />
    <orderEntry type="library" name="Maven: javax.xml:jaxrpc-api:1.1" level="project" />
@ -195,7 +194,6 @@
    <orderEntry type="library" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
    <orderEntry type="library" name="Maven: org.jboss:jandex:1.1.0.Final" level="project" />
    <orderEntry type="library" name="Maven: org.javassist:javassist:3.18.1-GA" level="project" />
    <orderEntry type="library" name="Maven: javax.persistence:persistence-api:1.0.2" level="project" />
    <orderEntry type="library" name="Maven: jaxen:jaxen:1.1.6" level="project" />
    <orderEntry type="library" name="Maven: jstl:jstl:1.2" level="project" />
    <orderEntry type="library" name="Maven: com.belerweb:pinyin4j:2.5.0" level="project" />
@ -210,5 +208,21 @@
    <orderEntry type="library" name="Maven: com.yihu.core:core-rpc:2.2.0" level="project" />
    <orderEntry type="library" name="Maven: com.yihu.core:ehr-dbhelper:1.1.7" level="project" />
    <orderEntry type="library" name="Maven: commons-net:commons-net:3.3" level="project" />
    <orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-frontend-jaxws:3.0.0" level="project" />
    <orderEntry type="library" name="Maven: xml-resolver:xml-resolver:1.2" level="project" />
    <orderEntry type="library" name="Maven: org.apache.cxf:cxf-core:3.0.0" level="project" />
    <orderEntry type="library" name="Maven: org.apache.ws.xmlschema:xmlschema-core:2.1.0" level="project" />
    <orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-bindings-xml:3.0.0" level="project" />
    <orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-frontend-simple:3.0.0" level="project" />
    <orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-ws-addr:3.0.0" level="project" />
    <orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-ws-policy:3.0.0" level="project" />
    <orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-transports-http:3.0.0" level="project" />
    <orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-bindings-soap:3.0.0" level="project" />
    <orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-wsdl:3.0.0" level="project" />
    <orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-databinding-jaxb:3.0.0" level="project" />
    <orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-impl:2.2.7" level="project" />
    <orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-core:2.2.7" level="project" />
    <orderEntry type="library" name="Maven: com.sun.istack:istack-commons-runtime:2.16" level="project" />
    <orderEntry type="library" name="Maven: com.sun.xml.fastinfoset:FastInfoset:1.2.12" level="project" />
  </component>
</module>

+ 8 - 2
Hos-Framework-dependencies/pom.xml

@ -6,7 +6,7 @@
    <groupId>com.yihu.core</groupId>
    <artifactId>Hos-Framework-dependencies</artifactId>
    <version>1.0-SNAPSHOT</version>
    <version>1.0.1</version>
    <packaging>pom</packaging>
    <build>
        <plugins>
@ -578,6 +578,11 @@
            <artifactId>javax.servlet-api</artifactId>
            <version>3.1.0</version>
        </dependency>
        <dependency>
            <groupId>javax.transaction</groupId>
            <artifactId>javax.transaction-api</artifactId>
            <version>1.2</version>
        </dependency>
        <dependency>
            <groupId>dom4j</groupId>
            <artifactId>dom4j</artifactId>
@ -619,11 +624,12 @@
            <artifactId>javassist</artifactId>
            <version>3.18.1-GA</version>
        </dependency>
        <!--
        <dependency>
            <groupId>javax.persistence</groupId>
            <artifactId>persistence-api</artifactId>
            <version>1.0.2</version>
        </dependency>
        </dependency>-->
        <dependency>
            <groupId>jaxen</groupId>
            <artifactId>jaxen</artifactId>

+ 1 - 1
Hos-Framework/Hos-Framework.iml

@ -182,6 +182,7 @@
    <orderEntry type="library" name="Maven: aopalliance:aopalliance:1.0" level="project" />
    <orderEntry type="library" name="Maven: org.json:json:20151123" level="project" />
    <orderEntry type="library" name="Maven: javax.servlet:javax.servlet-api:3.1.0" level="project" />
    <orderEntry type="library" name="Maven: javax.transaction:javax.transaction-api:1.2" level="project" />
    <orderEntry type="library" name="Maven: dom4j:dom4j:1.6.1" level="project" />
    <orderEntry type="library" name="Maven: xml-apis:xml-apis:1.4.01" level="project" />
    <orderEntry type="library" name="Maven: javax.xml:jaxrpc-api:1.1" level="project" />
@ -194,7 +195,6 @@
    <orderEntry type="library" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
    <orderEntry type="library" name="Maven: org.jboss:jandex:1.1.0.Final" level="project" />
    <orderEntry type="library" name="Maven: org.javassist:javassist:3.18.1-GA" level="project" />
    <orderEntry type="library" name="Maven: javax.persistence:persistence-api:1.0.2" level="project" />
    <orderEntry type="library" name="Maven: jaxen:jaxen:1.1.6" level="project" />
    <orderEntry type="library" name="Maven: jstl:jstl:1.2" level="project" />
    <orderEntry type="library" name="Maven: com.belerweb:pinyin4j:2.5.0" level="project" />

+ 2 - 2
Hos-Framework/pom.xml

@ -5,12 +5,12 @@
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.yihu.hos.resource</groupId>
    <artifactId>Hos-Framework</artifactId>
    <artifactId>Hos-Framework-noQuartz</artifactId>
    <version>1.0.7</version>
    <parent>
        <groupId>com.yihu.core</groupId>
        <artifactId>Hos-Framework-dependencies</artifactId>
        <version>1.0-SNAPSHOT</version>
        <version>1.0.1</version>
        <relativePath>../Hos-Framework-dependencies</relativePath>
    </parent>

+ 118 - 2
Hos-Framework/src/main/java/com/yihu/ehr/framework/util/httpclient/HttpHelper.java

@ -1,21 +1,38 @@
package com.yihu.ehr.framework.util.httpclient;
import com.yihu.ehr.framework.util.operator.StringUtil;
import org.apache.http.Header;
import org.apache.http.HttpEntity;
import org.apache.http.NameValuePair;
import org.apache.http.client.CredentialsProvider;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.entity.GzipDecompressingEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.methods.HttpRequestBase;
import org.apache.http.client.protocol.HttpClientContext;
import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
import org.apache.http.conn.ssl.TrustSelfSignedStrategy;
import org.apache.http.entity.ContentType;
import org.apache.http.impl.client.BasicCredentialsProvider;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.ssl.SSLContexts;
import org.apache.http.util.EntityUtils;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
import org.springframework.core.io.support.EncodedResource;
import org.springframework.core.io.support.PropertiesLoaderUtils;
import org.springframework.util.StringUtils;
import javax.net.ssl.SSLContext;
import java.io.File;
import java.io.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.zip.GZIPInputStream;
public class HttpHelper {
    private static String defaultPropertiesPath = "config/http.properties";
@ -45,7 +62,8 @@ public class HttpHelper {
            if (StringUtil.isEmpty(sslKeystore)) {
                String home = System.getProperty("catalina.home").replace('\\','/');
                String homeUrl = home.substring(0,home.lastIndexOf('/')+1);
                sslKeystore = homeUrl + "tomcat.keystore";
               // sslKeystore = homeUrl + "tomcat.keystore";
                sslKeystore ="E://tomcat.keystore";
            }
            if(sslKeystore!=null && sslKeystore.length()>0 && sslPassword!=null &&sslPassword.length()>0)
            {
@ -270,4 +288,102 @@ public class HttpHelper {
        return HttpClientUtil.request("GET",httpGateway,params,null,null,null,null);
    }
    public static String getWebPage(String url){
        String returnString="";
        HttpResponse re = new HttpResponse();
        CloseableHttpResponse response = null;
        CloseableHttpClient httpclient = HttpClients.custom()
                .setSSLSocketFactory(defaultSSL)
                .build();
        //设置请求信息
        try {
            HttpGet httpGet = new HttpGet(url);
            response = httpclient.execute(httpGet);
            String line;
            // 读取输入流的数据,并显示
            HttpEntity httpEntity= response.getEntity();
            Header header = response.getEntity().getContentEncoding();
            if(httpEntity.getContentLength() < 2147483647L){            //EntityUtils无法处理ContentLength超过2147483647L的Entity
                if(header != null && "gzip".equals(header.getValue())){
                    returnString = EntityUtils.toString(new GzipDecompressingEntity(httpEntity));
                } else {
                    returnString = EntityUtils.toString(httpEntity);
                }
            } else {
                InputStream in = httpEntity.getContent();
                if(header != null && "gzip".equals(header.getValue())){
                    returnString = unZip(in, ContentType.getOrDefault(httpEntity).getCharset().toString());
                } else {
                    returnString = readInStreamToString(in, ContentType.getOrDefault(httpEntity).getCharset().toString());
                }
                if(in != null){
                    in.close();
                }
            }
        } catch (Exception e) {
            re.setStatusCode(201);
            re.setBody(e.getMessage());
            e.printStackTrace();
        } finally {
            try {
                httpclient.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        System.out.println(returnString);
        return returnString;
    }
    /**
     * 解压服务器返回的gzip流
     * @param in 抓取返回的InputStream流
     * @param charSet 页面内容编码
     * @return 页面内容的String格式
     * @throws IOException
     */
    private static String unZip(InputStream in, String charSet) throws IOException {
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        GZIPInputStream gis = null;
        try {
            gis = new GZIPInputStream(in);
            byte[] _byte = new byte[1024];
            int len = 0;
            while ((len = gis.read(_byte)) != -1) {
                baos.write(_byte, 0, len);
            }
            String unzipString = new String(baos.toByteArray(), charSet);
            return unzipString;
        } finally {
            if (gis != null) {
                gis.close();
            }
            if(baos != null){
                baos.close();
            }
        }
    }
    /**
     * 读取InputStream流
     * @param in InputStream流
     * @return 从流中读取的String
     * @throws IOException
     */
    private static String readInStreamToString(InputStream in, String charSet) throws IOException {
        StringBuilder str = new StringBuilder();
        String line;
        BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(in, charSet));
        while((line = bufferedReader.readLine()) != null){
            str.append(line);
            str.append("\n");
        }
        if(bufferedReader != null) {
            bufferedReader.close();
        }
        return str.toString();
    }
}

+ 14 - 1
Hos-Resource-Mini/src/main/java/com.yihu.ehr/common/ApplicationStart.java

@ -8,6 +8,10 @@ import com.yihu.ehr.service.thread.CrawlerThread;
import com.yihu.ehr.service.thread.StandardUpdateThread;
import com.yihu.ehr.service.thread.ThreadManage;
import com.yihu.ehr.util.log.LogUtil;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
import org.springframework.core.io.support.EncodedResource;
import org.springframework.core.io.support.PropertiesLoaderUtils;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
@ -50,7 +54,16 @@ public class ApplicationStart implements ServletContextListener {
        prop.load(in);
        String configPath = this.getClass().getClassLoader().getResource("/").getPath()+ "config/http.properties";
        OutputStream fos = new FileOutputStream(configPath);
        String url = homeUrl+"ssl/tomcat.keystore";
        prop.getProperty("sslKeystore");
        String url="";
        if(prop.getProperty("sslKeystore")!=null&& prop.getProperty("sslKeystore").length()>0){
             url= this.getClass().getClassLoader().getResource("/").getPath() + "ssl/tomcat.keystore";
        }
        else {
             url = homeUrl + "ssl/tomcat.keystore";
        }
        prop.setProperty("sslKeystore",url);
        prop.store(fos,"last update");
        in.close();

+ 5 - 4
Hos-Resource-Mini/src/main/resources/config/http.properties

@ -3,9 +3,10 @@ httpUrl = https://172.19.103.73:443/api/v1.0
#ÖÒhttps://192.168.131.15:4432/api/v1.0
  #https://172.19.103.73:443/api/v1.0
clientId=kHAbVppx44
#sslKeystore=/ssl/tomcat.keystore
clientKey=a0hBYlZwcHg0NDpCZDJoOHJkWWhlcDZOS09P
#sslPassword=123456
sslKeystore = I:/ssl/tomcat.keystore
sslPassword = 123456
clientId = kHAbVppx44
clientKey = a0hBYlZwcHg0NDpCZDJoOHJkWWhlcDZOS09P

BIN
Hos-Resource-Mini/src/main/resources/ssl/tomcat.keystore


+ 29 - 19
Hos-Resource-Rest/pom.xml

@ -206,30 +206,40 @@
            <artifactId>xom</artifactId>
            <version>1.1</version>
        </dependency>
        <!--<dependency>-->
            <!--<groupId>org.apache.axis2</groupId>-->
            <!--<artifactId>axis2</artifactId>-->
            <!--<version>1.6.3</version>-->
        <!--</dependency>-->
        <!--<dependency>-->
            <!--<groupId>org.apache.axis2</groupId>-->
            <!--<artifactId>axis2-adb</artifactId>-->
            <!--<version>1.6.3</version>-->
        <!--</dependency>-->
        <!--<dependency>-->
            <!--<groupId>org.apache.axis2</groupId>-->
            <!--<artifactId>axis2-kernel</artifactId>-->
            <!--<version>1.6.3</version>-->
        <!--</dependency>-->
        <!--<dependency>-->
            <!--<groupId>org.apache.axis2</groupId>-->
            <!--<artifactId>org.apache.axis2.osgi</artifactId>-->
            <!--<version>1.6.3</version>-->
        <!--</dependency>-->
        <dependency>
            <groupId>org.apache.axis2</groupId>
            <artifactId>axis2</artifactId>
            <version>1.6.3</version>
        </dependency>
        <dependency>
            <groupId>org.apache.axis2</groupId>
            <artifactId>axis2-adb</artifactId>
            <version>1.6.3</version>
        </dependency>
        <dependency>
            <groupId>org.apache.axis2</groupId>
            <artifactId>axis2-kernel</artifactId>
            <version>1.6.3</version>
            <groupId>org.json</groupId>
            <artifactId>json</artifactId>
            <version>20151123</version>
        </dependency>
        <dependency>
            <groupId>org.apache.axis2</groupId>
            <artifactId>org.apache.axis2.osgi</artifactId>
            <version>1.6.3</version>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-frontend-jaxws</artifactId>
            <version>3.1.6</version>
        </dependency>
        <dependency>
            <groupId>org.json</groupId>
            <artifactId>json</artifactId>
            <version>20151123</version>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-transports-http</artifactId>
            <version>3.1.6</version>
        </dependency>
    </dependencies>

+ 21 - 30
Hos-Resource-Rest/resource-rest.iml

@ -20,8 +20,7 @@
    </content>
    <orderEntry type="inheritedJdk" />
    <orderEntry type="sourceFolder" forTests="false" />
    <orderEntry type="library" name="Maven: com.yihu.core:core-rpc:2.0.0" level="project" />
    <orderEntry type="library" name="Maven: com.yihu.core:ehr-dbhelper:1.1.4" level="project" />
    <orderEntry type="library" name="api-dict-1.6" level="project" />
    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-web:1.2.7.RELEASE" level="project" />
    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter:1.2.7.RELEASE" level="project" />
    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot:1.2.7.RELEASE" level="project" />
@ -92,7 +91,7 @@
    <orderEntry type="library" name="Maven: org.quartz-scheduler:quartz:2.2.2" level="project" />
    <orderEntry type="library" name="Maven: c3p0:c3p0:0.9.1.1" level="project" />
    <orderEntry type="library" name="Maven: org.springframework:spring-context-support:4.1.1.RELEASE" level="project" />
    <orderEntry type="library" name="Maven: com.yihu.core:ehr-dbhelper:1.1.8" level="project" />
    <orderEntry type="library" name="Maven: com.yihu.core:ehr-dbhelper:1.1.9" level="project" />
    <orderEntry type="library" name="Maven: org.apache.httpcomponents:httpclient:4.5.1" level="project" />
    <orderEntry type="library" name="Maven: org.apache.httpcomponents:httpmime:4.5.1" level="project" />
    <orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore:4.4.3" level="project" />
@ -128,34 +127,26 @@
    <orderEntry type="library" name="Maven: xalan:xalan:2.7.0" level="project" />
    <orderEntry type="library" name="Maven: xml-apis:xml-apis:1.0.b2" level="project" />
    <orderEntry type="library" name="Maven: jaxen:jaxen:1.1.6" level="project" />
    <orderEntry type="library" name="Maven: org.apache.axis2:axis2:1.6.3" level="project" />
    <orderEntry type="library" name="Maven: org.apache.axis2:axis2-adb:1.6.3" level="project" />
    <orderEntry type="library" name="Maven: org.apache.geronimo.specs:geronimo-activation_1.1_spec:1.0.2" level="project" />
    <orderEntry type="library" name="Maven: org.apache.axis2:axis2-kernel:1.6.3" level="project" />
    <orderEntry type="library" name="Maven: org.apache.ws.commons.axiom:axiom-api:1.2.14" level="project" />
    <orderEntry type="library" name="Maven: org.apache.geronimo.specs:geronimo-javamail_1.4_spec:1.7.1" level="project" />
    <orderEntry type="library" name="Maven: org.apache.geronimo.specs:geronimo-stax-api_1.0_spec:1.0.1" level="project" />
    <orderEntry type="library" name="Maven: org.apache.james:apache-mime4j-core:0.7.2" level="project" />
    <orderEntry type="library" name="Maven: org.apache.ws.commons.axiom:axiom-compat:1.2.14" level="project" />
    <orderEntry type="library" scope="RUNTIME" name="Maven: org.apache.ws.commons.axiom:axiom-impl:1.2.14" level="project" />
    <orderEntry type="library" scope="RUNTIME" name="Maven: org.codehaus.woodstox:woodstox-core-asl:4.1.4" level="project" />
    <orderEntry type="library" scope="RUNTIME" name="Maven: org.codehaus.woodstox:stax2-api:3.1.1" level="project" />
    <orderEntry type="library" name="Maven: org.apache.geronimo.specs:geronimo-ws-metadata_2.0_spec:1.1.2" level="project" />
    <orderEntry type="library" name="Maven: org.apache.geronimo.specs:geronimo-jta_1.1_spec:1.1" level="project" />
    <orderEntry type="library" name="Maven: javax.servlet:servlet-api:2.3" level="project" />
    <orderEntry type="library" name="Maven: commons-httpclient:commons-httpclient:3.1" level="project" />
    <orderEntry type="library" name="Maven: commons-fileupload:commons-fileupload:1.2" level="project" />
    <orderEntry type="library" name="Maven: wsdl4j:wsdl4j:1.6.3" level="project" />
    <orderEntry type="library" name="Maven: org.apache.ws.commons.schema:XmlSchema:1.4.7" level="project" />
    <orderEntry type="library" name="Maven: org.apache.neethi:neethi:3.0.2" level="project" />
    <orderEntry type="library" name="Maven: org.apache.woden:woden-api:1.0M9" level="project" />
    <orderEntry type="library" name="Maven: org.apache.woden:woden-impl-dom:1.0M9" level="project" />
    <orderEntry type="library" name="Maven: org.apache.woden:woden-impl-commons:1.0M9" level="project" />
    <orderEntry type="library" name="Maven: javax.ws.rs:jsr311-api:1.1.1" level="project" />
    <orderEntry type="library" name="Maven: org.apache.axis2:org.apache.axis2.osgi:1.6.3" level="project" />
    <orderEntry type="library" name="Maven: org.apache.axis2:axis2-transport-http:1.6.3" level="project" />
    <orderEntry type="library" name="Maven: org.apache.axis2:axis2-transport-local:1.6.3" level="project" />
    <orderEntry type="library" name="Maven: org.json:json:20151123" level="project" />
    <orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-frontend-jaxws:3.1.6" level="project" />
    <orderEntry type="library" name="Maven: xml-resolver:xml-resolver:1.2" level="project" />
    <orderEntry type="library" name="Maven: org.ow2.asm:asm:5.0.4" level="project" />
    <orderEntry type="library" name="Maven: org.apache.cxf:cxf-core:3.1.6" level="project" />
    <orderEntry type="library" name="Maven: org.codehaus.woodstox:woodstox-core-asl:4.4.1" level="project" />
    <orderEntry type="library" name="Maven: org.codehaus.woodstox:stax2-api:3.1.4" level="project" />
    <orderEntry type="library" name="Maven: org.apache.ws.xmlschema:xmlschema-core:2.2.1" level="project" />
    <orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-bindings-soap:3.1.6" level="project" />
    <orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-wsdl:3.1.6" level="project" />
    <orderEntry type="library" name="Maven: wsdl4j:wsdl4j:1.6.3" level="project" />
    <orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-databinding-jaxb:3.1.6" level="project" />
    <orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-impl:2.2.11" level="project" />
    <orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-core:2.2.11" level="project" />
    <orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-bindings-xml:3.1.6" level="project" />
    <orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-frontend-simple:3.1.6" level="project" />
    <orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-ws-addr:3.1.6" level="project" />
    <orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-ws-policy:3.1.6" level="project" />
    <orderEntry type="library" name="Maven: org.apache.neethi:neethi:3.0.3" level="project" />
    <orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-transports-http:3.1.6" level="project" />
  </component>
  <component name="org.twodividedbyzero.idea.findbugs">
    <option name="_basePreferences">

+ 54 - 0
Hos-Resource-Rest/src/main/java/com/yihu/hos/config/CxfConfig.java

@ -0,0 +1,54 @@
package com.yihu.hos.config;
import com.yihu.hos.ws.service.ServiceGateWay;
import com.yihu.hos.ws.service.ServiceGateWayPortType;
import org.apache.cxf.Bus;
import org.apache.cxf.bus.spring.SpringBus;
import org.apache.cxf.jaxws.EndpointImpl;
import org.apache.cxf.transport.servlet.CXFServlet;
import org.springframework.boot.autoconfigure.web.DispatcherServletAutoConfiguration;
import org.springframework.boot.context.embedded.ServletRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.DispatcherServlet;
import javax.xml.ws.Endpoint;
@Configuration
public class CxfConfig {
    @Bean
    public ServletRegistrationBean dispatcherRegistration() {
        ServletRegistrationBean registration = new ServletRegistrationBean(dispatcherServlet(), "/*");
        return registration;
    }
    @Bean(name = DispatcherServletAutoConfiguration.DEFAULT_DISPATCHER_SERVLET_REGISTRATION_BEAN_NAME)
    public DispatcherServlet dispatcherServlet() {
        return new DispatcherServlet();
    }
    @Bean
    public ServletRegistrationBean cxfRegistration() {
        return new ServletRegistrationBean(new CXFServlet(), "/service/*");
    }
    @Bean(name = Bus.DEFAULT_BUS_ID)
    public SpringBus springBus() {
        return new SpringBus();
    }
    @Bean
    public ServiceGateWayPortType serviceGateWayPortType() {
        return new ServiceGateWay();
    }
    @Bean
    public Endpoint endpoint() {
        EndpointImpl endpoint = new EndpointImpl(springBus(), serviceGateWayPortType());
        endpoint.publish("/ServiceGateWay");
        return endpoint;
    }
}

+ 1 - 4
Hos-Resource-Rest/src/main/java/com/yihu/hos/gateway/control/GatewayControl.java

@ -1,11 +1,11 @@
package com.yihu.hos.gateway.control;
import com.yihu.hos.gateway.thread.ResponseThread;
import com.yihu.hos.gateway.exception.EHRException;
import com.yihu.hos.gateway.exception.EHRExceptionConstant;
import com.yihu.hos.gateway.model.rest.RestRequsetResult;
import com.yihu.hos.gateway.model.rest.RestResponseResult;
import com.yihu.hos.gateway.service.intf.IGatewayService;
import com.yihu.hos.gateway.thread.ResponseThread;
import com.yihu.hos.resource.util.httpclient.HttpClientUtil;
import com.yihu.hos.resource.viewModel.ResourceRestDetailModel;
import com.yihu.hos.resource.viewModel.SQLResponResult;
@ -16,12 +16,9 @@ import org.springframework.stereotype.Controller;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.OutputStream;
import java.io.UnsupportedEncodingException;
import java.io.Writer;
/**

+ 38 - 78
Hos-Resource-Rest/src/main/java/com/yihu/hos/gateway/util/RPCUtil.java

@ -2,20 +2,9 @@ package com.yihu.hos.gateway.util;
import com.yihu.hos.config.Config;
import com.yihu.hos.resource.util.httpclient.HttpClientUtil;
import com.yihu.openplatform.service.AppKeyService;
import com.yihu.wsgw.api.ServiceBus;
import net.sf.json.JSONObject;
import org.apache.axis2.addressing.EndpointReference;
import org.apache.axis2.client.Options;
import org.apache.axis2.rpc.client.RPCServiceClient;
import javax.xml.namespace.QName;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
/**
 * Created by Administrator on 2016/4/18.
 */
@ -38,26 +27,26 @@ public class RPCUtil {
     * @param inputValuetype
     * @return
     */
    public static String getObjectByAxis2CallClient(String webServiceAddr, String webserviceNamespace, String webServiceMethod,
                                                    Object[] inputValues, Class[] inputValuetype) {
        try {
            //新建RPC服务客户端
            RPCServiceClient serviceClient = new RPCServiceClient();
            Options options = serviceClient.getOptions();
            //设置URL
            EndpointReference targetEPR = new EndpointReference(webServiceAddr);
            options.setTo(targetEPR);
            //设置参数的类型
            //设置namespace和方法名
            QName opAddEntry = new QName(webserviceNamespace, webServiceMethod);
            //数组的第一个值为返回值
            return (String) (serviceClient.invokeBlocking(opAddEntry, inputValues, inputValuetype))[0];
        } catch (Exception e) {
            e.printStackTrace();
        }
        return "";
    }
//    public static String getObjectByAxis2CallClient(String webServiceAddr, String webserviceNamespace, String webServiceMethod,
//                                                    Object[] inputValues, Class[] inputValuetype) {
//
//        try {
//            //新建RPC服务客户端
//            RPCServiceClient serviceClient = new RPCServiceClient();
//            Options options = serviceClient.getOptions();
//            //设置URL
//            EndpointReference targetEPR = new EndpointReference(webServiceAddr);
//            options.setTo(targetEPR);
//            //设置参数的类型
//            //设置namespace和方法名
//            QName opAddEntry = new QName(webserviceNamespace, webServiceMethod);
//            //数组的第一个值为返回值
//            return (String) (serviceClient.invokeBlocking(opAddEntry, inputValues, inputValuetype))[0];
//        } catch (Exception e) {
//            e.printStackTrace();
//        }
//        return "";
//    }
    /*
    public static void main(String[] args) throws Exception {
        String apiName = "report.ReportWs.GetReportList";
@ -103,8 +92,8 @@ public class RPCUtil {
        //		apiName = "ZEUS.HosHOPWs.QueryUserInfo";
       //		param = "<Req><TransactionCode>5003</TransactionCode><Data><CardType>1</CardType><CardNo>000021341249</CardNo><Mobile></Mobile><PatientId></PatientId></Data></Req>";
       //apiName = "ZEUS.HosHOPWs.QueryRegInfo";
       //param = "<Req><TransactionCode>5003</TransactionCode><Data><CardType>1</CardType><CardNo>6001</CardNo><IdCardNo>123123</IdCardNo><OrderId>订单号</OrderId><ClinicCard>就诊卡号</ClinicCard><TimeSlice>就诊时段</TimeSlice><StartTime>就诊日期开始</StartTime><EndTime>就诊日期结束</EndTime><RegFlag>1-预约 2-当天挂号</RegFlag></Data></Req>" ;
       apiName = "ZEUS.HosHOPWs.QueryRegInfo";
       param = "<Req><TransactionCode>5003</TransactionCode><Data><CardType>1</CardType><CardNo>6001</CardNo><IdCardNo>123123</IdCardNo><OrderId>订单号</OrderId><ClinicCard>就诊卡号</ClinicCard><TimeSlice>就诊时段</TimeSlice><StartTime>就诊日期开始</StartTime><EndTime>就诊日期结束</EndTime><RegFlag>1-预约 2-当天挂号</RegFlag></Data></Req>" ;
       // param = "<Req><TransactionCode>5003</TransactionCode><Data><StartTime>2016-04-08</StartTime></Data></Req>" ;
        //挂号事件推送
@ -118,51 +107,22 @@ public class RPCUtil {
        //		apiName = "ZEUS.HosHOPWs.QueryHospital";
        //		param = "<Req><TransactionCode></TransactionCode><Data><HosId>944</HosId></Data></Req>";
        //处方审阅成功推送
//        apiName = "ZEUS.HosHOPWs.PushReport";
//        param = "<Req><TransactionCode></TransactionCode><Data><orgCode>orgCode</orgCode><eventNo>eventNo</eventNo><patientId>patientId</patientId></Data></Req>";
//
//
//        String apiparam = "{\"ChannelId\"=\"100123\"," + "\"ParamType\"=1,"
//                    + "\"Params\"=\"" + param + "\"," + "\"Guid\"=\""
//                    + "00000001111111" + "\"," + "\"V\"=\"3.0.0\","
//                    + "\"OutType\"=1," + "\"HospitalId\"=\"1026333\"}";
//            String result = null;
//
//            try {
//                result = ServiceBus.getInstance(
//                        "172.18.20.21:2181",
//                       "EsbCloud")
//                        .call(apiName, apiparam);
//            } catch (Exception e) {
//                // TODO Auto-generated catch block
//                e.printStackTrace();
//            }
//            System.out.println("result=" + result);
        AppKeyService.init(null,3);
        AppKeyService.setDebug(true);
        HashMap<String, String> paramMap=new HashMap();
        paramMap.put("type","35");//表示属于咨询的推送
       // paramMap.put("appId","EsbCloud");//表示属于咨询的推送
        paramMap.put("timestamp",new Date().getTime()+"");//表示属于咨询的推送
        JSONObject jsonData=new JSONObject();//构造推送的数据
        jsonData.put("operation", "1");
        jsonData.put("uniqueId", "11113");
        jsonData.put("org_code", "1026333");
        jsonData.put("event_no", "11113");
        jsonData.put("patientId", "11113");
        paramMap.put("data", jsonData.toString());
        Map result;
        try {
            result = AppKeyService.postToAllThirdParty(paramMap,"EsbCloud");  //paramMap为需要推送的参数,myt为调用者的appId
            System.out.println(result);
        } catch (Exception e) {
            e.printStackTrace();
            String apiparam = "{\"ChannelId\"=\"100123\"," + "\"ParamType\"=1,"
                    + "\"Params\"=\"" + param + "\"," + "\"Guid\"=\""
                    + "00000001111111" + "\"," + "\"V\"=\"3.0.0\","
                    + "\"OutType\"=1," + "\"HospitalId\"=\"1026333\"}";
            String result = null;
            try {
                result = ServiceBus.getInstance(
                        "172.18.20.21:2181",
                       "EsbCloud")
                        .call(apiName, apiparam);
            } catch (Exception e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
            System.out.println("result=" + result);
        }
    }
}

+ 35 - 0
Hos-Resource-Rest/src/main/java/com/yihu/hos/qlc/controller/PushReturnModel.java

@ -0,0 +1,35 @@
package com.yihu.hos.qlc.controller;
/**
 * Created by Administrator on 2016/6/28.
 */
public class PushReturnModel {
    private String status = "0";
    private String statusInfo = "请求成功";
    private String data;
    public String getStatus() {
        return status;
    }
    public void setStatus(String status) {
        this.status = status;
    }
    public String getStatusInfo() {
        return statusInfo;
    }
    public void setStatusInfo(String statusInfo) {
        this.statusInfo = statusInfo;
    }
    public String getData() {
        return data;
    }
    public void setData(String data) {
        this.data = data;
    }
}

+ 88 - 0
Hos-Resource-Rest/src/main/java/com/yihu/hos/qlc/controller/QLCPushInfo.java

@ -0,0 +1,88 @@
package com.yihu.hos.qlc.controller;
import com.yihu.openplatform.service.AppKeyService;
import com.yihu.openplatform.vo.DictWayOperator;
import io.swagger.annotations.ApiParam;
import net.sf.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Controller;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.annotation.PostConstruct;
/**
 * Created by Administrator on 2016/6/28.
 */
@RequestMapping("/")
@Controller
public class QLCPushInfo {
    @Autowired
    private QLCController controller;
    /**
     * 類生成的時候調用此方法
     *
     * @return
     */
    @RequestMapping("/pushUpInfo")
    @ResponseBody
    public PushReturnModel pushInfo(
            @RequestParam(value = "type") String type,//时间类别
            @RequestParam(value = "appId") String appId,//第三方的渠道号
            @RequestParam(value = "timestamp") String timestamp,//时间戳(相对余1970-1-1的毫秒数)
            @RequestParam(value = "sign") String sign,//根据分配给第三方的秘钥对参数进行的签名,第三方可以根据此签名校验(避免非法调用)
            @RequestParam(value = "data") String data//string(json array)
    ) {
        PushReturnModel pushReturnModel = new PushReturnModel();
        try {
            JSONObject jo = JSONObject.fromObject(data);
            switch (type) {
                case "17": {
                    String EventType = isNull(jo.get("EventType"));
                    String EventNo= isNull(jo.get("EventNo"));
                    String CardType= isNull(jo.get("CardType"));
                    String CardNo= isNull(jo.get("CardNo"));
                    String PatientId= isNull(jo.get("PatientId"));
                    String HospitalId= isNull(jo.get("HospitalId"));
                    controller.queryUserInfo(EventType,EventNo,CardType,CardNo,PatientId,HospitalId);
                    break;
                }
                case "18": {
                    String CardType = isNull(jo.get("CardType"));
                    String CardNo= isNull(jo.get("CardNo"));
                    String ReportType= isNull(jo.get("ReportType"));
                    String ReportId= isNull(jo.get("ReportId"));
                    String State= isNull(jo.get("State"));
                    String HospitalId= isNull(jo.get("HospitalId"));
                    controller.patientInformation(CardType,CardNo,ReportType,ReportId,State,HospitalId);
                    break;
                }
                case "35": {
                    break;
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
            pushReturnModel.setStatus("1");
            pushReturnModel.setStatusInfo(e.getMessage());
            return pushReturnModel;
        }
        return pushReturnModel;
    }
    private String isNull(Object param) throws Exception {
        if (StringUtils.isEmpty(param)) {
            throw new Exception("参数为空");
        } else {
            return param.toString();
        }
    }
}

+ 1428 - 0
Hos-Resource-Rest/src/main/java/com/yihu/hos/resource/util/StringUtil.java

@ -0,0 +1,1428 @@
package com.yihu.hos.resource.util;
import org.apache.commons.lang.StringUtils;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.io.StringWriter;
import java.io.UnsupportedEncodingException;
import java.io.Writer;
import java.sql.Clob;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.regex.Pattern;
public class StringUtil {
    public static String substring(String str, int start) {
        return StringUtils.substring(str, start);
    }
    public static String substring(String str, int start, int end) {
        return StringUtils.substring(str, start, end);
    }
    public static boolean isBlank(String str) {
        return StringUtils.isBlank(str);
    }
    public static String toString(Object obj) {
        if (obj == null) {
            return null;
        }
        return obj.toString();
    }
    public static String trimLeft(String value) {
        if (value == null)
            return "";
        String result = value;
        char ch[] = result.toCharArray();
        int index = -1;
        for (int i = 0; i < ch.length; i++) {
            if (Character.isWhitespace(ch[i])) {
                index = i;
            } else {
                break;
            }
        }
        if (index != -1) {
            result = result.substring(index + 1);
        }
        return result;
    }
    /**
     * �ù���ѹ���ַ������ұ߿ո�
     *
     * @param value ��Դ��
     * @return String src����ַ���
     */
    public static String trimRight(String value) {
        if (value == null)
            return "";
        String result = value;
        char ch[] = result.toCharArray();
        int endIndex = -1;
        for (int i = ch.length - 1; i > -1; i--) {
            if (Character.isWhitespace(ch[i])) {
                endIndex = i;
            } else {
                break;
            }
        }
        if (endIndex != -1) {
            result = result.substring(0, endIndex);
        }
        return result;
    }
    /**
     * ***************************************************** ��
     * �ܣ����ַ���ǰ����Ӷ��"0",���ع̶����� ��ڲ�����param str:��������ַ��� param len�����ع̶����� �� �أ�Stirng
     * <p/> ��д���ڣ� �޸ı�ע�� ******************************************************
     */
    public static String fillHeadCharsLen(String strOri, int len) {
        return fillHeadCharsLen(strOri, "0", len);
    }
    /**
     * ***************************************************** ��
     * �ܣ����ַ���������Ӷ��"0",���ع̶����� ��ڲ�����param str:��������ַ��� param len�����ع̶����� �� �أ�Stirng
     * <p/> ��д���ڣ� �޸ı�ע�� ******************************************************
     */
    public static String fillBackCharsLen(String strOri, int len) {
        return fillBackCharsLen(strOri, "0", len);
    }
    /**
     * ***************************************************** ��
     * �ܣ����ַ���ǰ����Ӷ���ظ��ַ���,���ع̶����� ��ڲ�����param str:��������ַ��� param subStr:�ظ������ַ���
     * param len�����ع̶����� �� �أ�Stirng <p/> ��д���ڣ� �޸ı�ע��
     * ******************************************************
     */
    public static String fillHeadCharsLen(String strOri, String subStr, int len) {
        if (strOri == null || strOri.trim().length() == 0) {
            strOri = "";
        }
        if (subStr == null) {
            subStr = " ";
        }
        String fillStr = "";
        for (int i = 0; i < len; i++) {
            fillStr = fillStr + subStr;
        }
        subStr = fillStr + strOri;
        return (subStr.substring(subStr.length() - len, subStr.length()));
    }
    /**
     * ***************************************************** ��
     * �ܣ����ַ���������Ӷ���ظ��ַ���,���ع̶����� ��ڲ�����param str:��������ַ��� param subStr:�ظ������ַ���
     * param len�����ع̶����� �� �أ�Stirng <p/> ��д���ڣ� �޸ı�ע��
     * ******************************************************
     */
    public static String fillBackCharsLen(String strOri, String subStr, int len) {
        if (strOri == null || strOri.trim().length() == 0) {
            strOri = "";
        }
        if (subStr == null) {
            subStr = " ";
        }
        String fillStr = "";
        for (int i = 0; i < len; i++) {
            fillStr = fillStr + subStr;
        }
        subStr = strOri + fillStr;
        return (subStr.substring(0, len));
    }
    /**
     * ***************************************************** �� �ܣ����ַ���ǰ����Ӷ��"0"
     * ��ڲ�����param str:��������ַ��� param counter���ظ������� �� �أ�Stirng <p/> ��д���ڣ� �޸ı�ע��
     * ******************************************************
     */
    public static String fillHeadChars(String strOri, int counter) {
        return fillHeadChars(strOri, "0", counter);
    }
    /**
     * ***************************************************** �� �ܣ����ַ���������Ӷ��"0"
     * ��ڲ�����param str:��������ַ��� param counter���ظ������� �� �أ�Stirng <p/> ��д���ڣ� �޸ı�ע��
     * ******************************************************
     */
    public static String fillBackChars(String strOri, int counter) {
        return fillBackChars(strOri, "0", counter);
    }
    /**
     * ***************************************************** �� �ܣ����ַ���ǰ����Ӷ���ظ��ַ���
     * ��ڲ�����param str:��������ַ��� param subStr:�ظ������ַ��� param counter���ظ������� ��
     * �أ�Stirng <p/> ��д���ڣ� �޸ı�ע��
     * ******************************************************
     */
    public static String fillHeadChars(String strOri, String subStr, int counter) {
        if (strOri == null || strOri.trim().length() == 0) {
            strOri = "";
        }
        if (counter <= 0 || subStr == null) {
            return strOri;
        }
        String fillStr = "";
        for (int i = 0; i < counter; i++) {
            fillStr = fillStr + subStr;
        }
        return (fillStr + strOri);
    }
    /**
     * ***************************************************** �� �ܣ����ַ���������Ӷ���ظ��ַ���
     * ��ڲ�����param str:��������ַ��� param subStr:�ظ������ַ��� param counter���ظ������� ��
     * �أ�Stirng <p/> ��д���ڣ� �޸ı�ע��
     * ******************************************************
     */
    public static String fillBackChars(String strOri, String subStr, int counter) {
        if (strOri == null || strOri.trim().length() == 0) {
            strOri = "";
        }
        if (counter <= 0 || subStr == null) {
            return strOri;
        }
        String fillStr = "";
        for (int i = 0; i < counter; i++) {
            fillStr = fillStr + subStr;
        }
        return (strOri + fillStr);
    }
    /**
     * ***************************************************** ��
     * �ܣ��ж��ַ����Ƿ�Ϊ�ջ���null(ѹ���ո��) ��ڲ�����param str:��������ַ��� ���ڲ����� �� �أ��գ�null��true;
     * ���գ�false <p/> ��д���ڣ�20051220 �޸ı�ע��
     * ******************************************************
     */
    public static boolean isEmpty(Object strObj) {
        if (strObj == null || strObj.toString().trim().length() < 1) {
            return true;
        } else {
            return false;
        }
    }
    /**
     * ***************************************************** ��
     * �ܣ��ж�һ���ַ����Ƿ�Ϊ��ֵ��null����(ѹ���ո��)�� ��ڲ�����param str:���жϵ��ַ��� ���ڲ����� ��
     * �أ�true���գ�false���ǿ� <p/> ��д���ڣ�20051220 �޸ı�ע��
     * ******************************************************
     */
    public static boolean isStrEmpty(String str) {
        if ((str == null) || (str.trim().length() < 1) || "null".endsWith(str.toLowerCase())) {
            return true;
        } else {
            return false;
        }
    }
    /**
     * ***************************************************** ��
     * �ܣ�����һ���ַ���ȥ���ұ߿ո���ֵ�����Ϊnull�򷵻ؿմ� ��ڲ�����param str:��������ַ��� ���ڲ����� ��
     * �أ�ȥ���ұ߿ո����ַ������߿մ� <p/> ��д���ڣ�20051220 �޸ı�ע��
     * ******************************************************
     */
    public static String getValue(String str) {
        if (str == null) {
            return "";
        }
        if (str.trim().length() <= 0)
            return "";
        str = "H" + str;
        str = str.trim();
        str = str.substring(1);
        return str;
    }
    /**
     * ***************************************************** �� �ܣ��ж�һ���ַ����Ƿ񳬳���������
     * ��ڲ�����param text:���жϵ��ַ�����param len:�����ij��� ���ڲ����� �� �أ�return
     * true��δ������false��Ϊ�ջ��߳��� <p/> ��д���ڣ�20051220 �޸ı�ע��
     * ******************************************************
     */
    public static boolean chkTextLen(String text, int len) {
        if (text == null || text.length() > len) {
            return false;
        } else {
            return true;
        }
    }
    /**
     * ***************************************************** ��
     * �ܣ��ж�һ���ַ���ȥ���ո��Ƿ񳬳��������� ��ڲ�����param text:���жϵ��ַ�����param len:�����ij��� ���ڲ����� ��
     * �أ�return true��δ������false��Ϊ�ջ��߳��� <p/> ��д���ڣ�20051220 �޸ı�ע��
     * ******************************************************
     */
    public static boolean chkTextTrimLen(String text, int len) {
        if (text == null || text.trim().length() > len) {
            return false;
        } else {
            return true;
        }
    }
    /**
     * ***************************************************** ��
     * �ܣ��ж�һ���ַ����Ƿ�ֻ��english ��ڲ�����param text:���жϵ��ַ����� ���ڲ����� �� �أ�return
     * true���Ϸ���false:�������Ļ��������Ƿ��ַ� <p/> ��д���ڣ�20051220 �޸ı�ע��
     * ******************************************************
     */
    public static boolean isStrEn(String text) {
        for (int i = 0; i < text.length(); i++) {
            if (text.charAt(i) > 127) {
                return false;
            }
        }
        return true;
    }
    /**
     * ***************************************************** �� �ܣ��ж�һ���ַ����Ƿ�����
     * ��ڲ�����param ch:���жϵ��ַ� ���ڲ����� �� �أ�return true�����֣�false:������ <p/>
     * ��д���ڣ�20051220 �޸ı�ע��
     * ******************************************************
     */
    public static boolean isCharNum(char ch) {
        if (ch > 47 && ch < 58) {
            return true;
        } else {
            return false;
        }
    }
    /**
     * ***************************************************** ��
     * �ܣ��ж�һ���ַ����Ƿ��з����ֵ��ַ� ��ڲ�����param str:���жϵ��ַ��� ���ڲ����� �� �أ�return
     * true��Null���߲�ȫ�����֣�false:ȫ������ <p/> ��д���ڣ�20051220 �޸ı�ע��
     * ******************************************************
     */
    public static boolean isStrNum(String str) {
        if (isStrEmpty(str)) {
            return true;
        }
        boolean notNum = false;
        for (int i = 0; i < str.length(); i++) {
            if (!isCharNum(str.charAt(i))) {
                notNum = true;
            }
        }
        return !notNum;
    }
    /**
     * ***************************************************** ��
     * �ܣ��ж�һ���ַ����Ƿ��з����ֵ��ַ� ��ڲ�����param strSrc:���жϵ��ַ��� ���ڲ����� �� �أ�return
     * true��ȫ�����֣�false:��ȫ������ <p/> ��д���ڣ�20051220 �޸ı�ע��
     * ******************************************************
     */
    public static boolean isNum(String strSrc) throws Exception {
        for (int i = 0; i < strSrc.length(); i++) {
            if (!isCharNum(strSrc.charAt(i)))
                return false;
        }
        return true;
    }
    /**
     * ***************************************************** �� �ܣ��ж�һ���ַ��Ƿ���Ӣ����ĸ
     * ��ڲ�����param ch:���жϵ��ַ� ���ڲ����� �� �أ�return true����Ӣ����ĸ��false:����Ӣ����ĸ <p/>
     * ��д���ڣ�20051220 �޸ı�ע��
     * ******************************************************
     */
    public static boolean isCharLetter(char ch) {
        if ((ch >= 65 && ch <= 90) && (ch >= 97 && ch <= 122)) {
            return true;
        } else {
            return false;
        }
    }
    /**
     * ***************************************************** �� �ܣ��ж�һ���ַ����Ƿ�ȫ��Ӣ����ĸ
     * ��ڲ�����param str:���жϵ��ַ��� ���ڲ����� �� �أ�return true��NULL���з�Ӣ����ĸ��false:ȫ��Ӣ����ĸ
     * <p/> ��д���ڣ�20051220 �޸ı�ע��
     * ******************************************************
     */
    public static boolean isStrLetter(String str) {
        if (isStrEmpty(str))
            return true;
        boolean notLetter = false;
        for (int i = 0; i < str.length(); i++) {
            if (!isCharLetter(str.charAt(i))) {
                notLetter = true;
            }
        }
        return !notLetter;
    }
    /**
     * ***************************************************** ��
     * �ܣ���������ַ���ȡ����һ���ַ����� ��ڲ�����param src:������ַ��� ���ڲ����� �� �أ�return
     * ��������ַ���ȡ����һ���ַ����� <p/> ��д���ڣ�20051220 �޸ı�ע��
     * ******************************************************
     */
    public static char strToChar(String src) {
        src = src.trim();
        char result = src.charAt(0);
        return result;
    }
    /**
     * ***************************************************** ��
     * �ܣ���������ַ���ת�ɶ�Ӧ��ASCII�봮 ��ڲ�����param sql:�������sql������ ���ڲ����� �� �أ��������ַ��� <p/>
     * ��д���ڣ�20051220 �޸ı�ע��
     * ******************************************************
     */
    public static String encodeSQL(String sql) {
        StringBuffer tempBuff = new StringBuffer();
        for (int i = 0; i < sql.length(); i++) {
            tempBuff.append(Integer.toHexString(sql.charAt(i)));
        }
        return tempBuff.toString();
    }
    /**
     * ***************************************************** ��
     * �ܣ��������ASCII�봮����Ϊ��Ӧ���ַ��� ��ڲ�����param encoded:��������ַ��� ���ڲ����� �� �أ��������ַ��� <p/>
     * ��д���ڣ�20051220 �޸ı�ע��
     * ******************************************************
     */
    public static String decodeSQL(String encoded) {
        StringBuffer tempBuff = new StringBuffer();
        for (int i = 0; i < encoded.length(); i += 2) {
            tempBuff.append((char) Integer.parseInt(
                    encoded.substring(i, i + 2), 16));
        }
        return tempBuff.toString();
    }
    /**
     * ***************************************************** �� �ܣ���ȡ���·��
     * ��ڲ�����param path1:����·����param context1:������ ���ڲ����� �� �أ�return ���·�� <p/>
     * ��д���ڣ�20051220 �޸ı�ע��
     * ******************************************************
     */
    public static String getAbsolutePath(String path1, String context1) {
        int i1 = path1.indexOf(context1);
        if (i1 < 0) {
            return path1;
        } else {
            return path1.substring(path1.indexOf(context1) + context1.length());
        }
    }
    /**
     * ***************************************************** �� �ܣ���ȡ�Ӵ� ��ڲ�����param
     * str1:��ȡ�Ӵ����ַ�����param sindex:��ʼλ�ã�param eindex:����λ�� ���ڲ����� ��
     * �أ����ش���ʼλ�ÿ�ʼ����λ�ý������Ӵ����������λ��С��0���򷵻ش���ʼλ�ÿ�ʼ���Ӵ� <p/> ��д���ڣ�20051220 �޸ı�ע��
     * ******************************************************
     */
    public static String getSubString(String str1, int sindex, int eindex) {
        if (str1 == null) {
            return "";
        }
        if (str1.trim().length() <= 0)
            return "";
        if (str1.length() > sindex) {
            if (eindex >= 0)
                return str1.substring(sindex, eindex);
            else if (eindex < 0)
                return str1.substring(sindex);
        }
        return "";
    }
    /**
     * ***************************************************** ��
     * �ܣ����ַ����������䵽ָ���Ĵ�С��������ÿմ����� ��ڲ�����param strs:��������ַ������飬param size1:���������鳤��
     * ���ڲ����� �� �أ�return �������ַ������� <p/> ��д���ڣ�20051220 �޸ı�ע��
     * ******************************************************
     */
    public static String[] getValues(String[] strs, int size1) {
        String[] strs1 = new String[size1];
        for (int i = 0; i < size1; i++) {
            strs1[i] = "";
        }
        if (strs == null) {
            return strs1;
        } else {
            if (strs.length < size1) {
                for (int i = 0; i < strs.length; i++) {
                    strs1[i] = strs[i];
                }
                return strs1;
            } else {
                return strs;
            }
        }
    }
    /**
     * ***************************************************** �� �ܣ��ַ���ȫ���滻����
     * ��ڲ�����param strSource ���滻���ַ�����param strFrom Դ�ַ�����param strTo Ŀ���ַ��� ���ڲ����� ��
     * �أ��滻����ַ��� <p/> ��д���ڣ�20051220 �޸ı�ע��
     * ******************************************************
     */
    public static String replaceStrAll(String strSource, String strFrom,
                                       String strTo) {
        String strDest = "";
        int intFromLen = strFrom.length();
        int intPos;
        while ((intPos = strSource.indexOf(strFrom)) != -1) {
            strDest = strDest + strSource.substring(0, intPos);
            strDest = strDest + strTo;
            strSource = strSource.substring(intPos + intFromLen);
        }
        strDest = strDest + strSource;
        return strDest;
    }
    public static String replaceStr(String strTarget, String strNew) {
        int iIndex = -1;
        while (true) {
            iIndex = strTarget.indexOf('\n');
            if (iIndex < 0) {
                break;
            }
            String strTemp = null;
            strTemp = strTarget.substring(0, iIndex);
            strTarget = strTemp + strNew + strTarget.substring(iIndex + 1);
        }
        return strTarget;
    }
    /**
     * ***************************************************** ��
     * �ܣ��ж��ַ����������Ƿ��и��ַ��� ��ڲ�����param str1 ��Ѱ�ҵ��ַ�����param strarray ��Ѱ�ҵ��ַ������飬
     * ���ڲ����� �� �أ�return true������;false��δ���� <p/> ��д���ڣ�20051220 �޸ı�ע��
     * ******************************************************
     */
    public static boolean includestr(String str1, String[] strarray) {
        if (strarray == null || strarray.length <= 0)
            return false;
        for (int i = 0; i < strarray.length; i++) {
            if (strarray[i] == null) {
                if (str1 == null)
                    return true;
                else
                    continue;
            }
            if (strarray[i].trim().equals(str1)) {
                return true;
            }
        }
        return false;
    }
    /**
     * ***************************************************** ��
     * �ܣ���\n��Ϊ�ָ��������ַ����ָ������飬��ȥ��\r ��ڲ�����param fvalue ��ת�����ַ��� ���ڲ����� �� �أ�return
     * ת��������� <p/> ��д���ڣ�20051220 �޸ı�ע��
     * ******************************************************
     */
    public static String[] getAreaValues(String fvalue) {
        String tmpstr = fvalue;
        int i = 0;
        if (tmpstr == null)
            return null;
        if (tmpstr.trim().equals(""))
            return null;
        while (tmpstr.indexOf("\n") >= 0) {
            i++;
            tmpstr = tmpstr.substring(tmpstr.indexOf("\n") + 1);
        }
        if (tmpstr.trim().equals("")) {
            i--;
        }
        String[] fvalues = new String[i + 1];
        tmpstr = fvalue;
        i = 0;
        while (tmpstr.indexOf("\n") >= 0) {
            fvalues[i] = tmpstr.substring(0, tmpstr.indexOf("\n"));
            if (fvalues[i].indexOf("\r") >= 0)
                fvalues[i] = fvalues[i].substring(0, fvalues[i].indexOf("\r"));
            i++;
            tmpstr = tmpstr.substring(tmpstr.indexOf("\n") + 1);
        }
        if (!tmpstr.trim().equals(""))
            fvalues[i] = tmpstr;
        return fvalues;
    }
    /**
     * ***************************************************** �� �ܣ����ַ����е�|ת�ɴ�\n
     * ��ڲ�����param fvalue ��ת�����ַ��� ���ڲ����� �� �أ�ת������ַ��� <p/> ��д���ڣ�20051220 �޸ı�ע��
     * ******************************************************
     */
    public static String getrealAreaValues(String fvalue) {
        String tmpstr = fvalue;
        String returnstr = "";
        if (tmpstr == null)
            return null;
        if (tmpstr.trim().equals(""))
            return "";
        while (tmpstr.indexOf("|") > 0) {
            returnstr += tmpstr.substring(0, tmpstr.indexOf("|")) + "\n";
            tmpstr = tmpstr.substring(tmpstr.indexOf("|") + 1);
        }
        return returnstr;
    }
    /**
     * ***************************************************** ��
     * �ܣ������ַ����к��е�ָ���ַ��ĸ��� ��ڲ�����param strInput ��������ַ�����param chr ��Ѱ�ҵ��ַ� ���ڲ����� ��
     * �أ�return ������ַ����� <p/> ��д���ڣ�20051220 �޸ı�ע��
     * ******************************************************
     */
    public static int countChar(String strInput, char chr) {
        int iCount = 0;
        char chrTmp = ' ';
        if (strInput.trim().length() == 0)
            return 0;
        // ����ָ�����ٸ��ַ���
        for (int i = 0; i < strInput.length(); i++) {
            chrTmp = strInput.charAt(i);
            if (chrTmp == chr) {
                iCount++;
            }
        }
        return iCount;
    }
    /**
     * ***************************************************** �� �ܣ�����ά����ת��һ���ַ����ͳ�
     * ��ڲ�����param strs ��ת�����ַ������� ���ڲ����� �� �أ��� <p/> ��д���ڣ�20051220 �޸ı�ע��
     * ******************************************************
     */
    public static String strArrayToStr(String[] strs) {
        return strArrayToStr(strs, null);
    }
    /**
     * ***************************************************** �� �ܣ����еĴ�ӡ���ַ������������
     * ��ڲ�����param strs ����ӡ���ַ������� ���ڲ����� �� �أ��� <p/> ��д���ڣ�20051220 �޸ı�ע��
     * ******************************************************
     */
    public static void printStrs(String[] strs) {
        for (int i = 0; i < strs.length; i++) {
            System.out.println(strs[i]);
        }
    }
    /**
     * ***************************************************** ��
     * �ܣ���ά�����У�һά���еĴ�ӡ���ַ������������ ��ڲ�����param strs ����ӡ�Ķ�ά�ַ������� ���ڲ����� �� �أ��� <p/>
     * ��д���ڣ�20051220 �޸ı�ע��
     * ******************************************************
     */
    public static void printDualStr(String[][] dualStr) {
        for (int i = 0; i < dualStr.length; i++) {
            for (int j = 0; j < dualStr[i].length; j++) {
                System.out.print(dualStr[i][j] + " ");
            }
            System.out.println();
        }
    }
    /**
     * ***************************************************** ��
     * �ܣ�����ά��������ߵ������б�Ϊ�У����б�Ϊ�� ��ڲ�����param dualStr ����Ķ�ά���� ���ڲ����� �� �أ�return
     * �ߵ���Ķ�ά���� <p/> ��д���ڣ�20051220 �޸ı�ע��
     * ******************************************************
     */
    public static String[][] rowToColumn(String[][] dualStr) {
        String[][] returnDualStr = null;
        if (dualStr != null) {
            returnDualStr = new String[dualStr[0].length][dualStr.length];
            for (int i = 0; i < dualStr.length; i++)
                for (int j = 0; j < dualStr[0].length; j++)
                    returnDualStr[j][i] = dualStr[i][j];
        }
        return returnDualStr;
    }
    /**
     * ***************************************************** ��
     * �ܣ���Ҫ��ֵ��ҳ����ʾ���String�����е������ַ�����ת��� ��ڲ�����param inStr ������ַ��� ���ڲ����� �� �أ�return
     * ���ת�������ַ��� <p/> ��д���ڣ�20051220 �޸ı�ע��
     * ******************************************************
     */
    public static String latinString(String inStr) {
        String res = inStr;
        if (null == res)
            return null;
        res = replaceStrAll(res, "\"", "\\\"");
        res = replaceStrAll(res, "'", "\\'");
        return res;
    }
    /**
     * ***************************************************** �� �ܣ����ַ������пո��滻��ָ����
     * ��ڲ�����param String strTarget, String strNew ���ڲ����� �� �أ�return String
     * �����ѱ��滻���ִ� <p/> ��д���ڣ�20051220 �޸ı�ע��
     * ******************************************************
     */
    public static String replaceWhiteSpace(String strTarget, String strNew) {
        int iIndex = -1;
        while (true) {
            char cRep = 32;
            iIndex = strTarget.indexOf(cRep);
            if (iIndex < 0) {
                break;
            }
            String strTemp = null;
            strTemp = strTarget.substring(0, iIndex);
            strTarget = strTemp + strNew + strTarget.substring(iIndex + 1);
        }
        return strTarget;
    }
    /**
     * ***************************************************** ��
     * �ܣ�������д�ɷ���Ҫ���С����λ����ֻȥ�������С����λ��������չλ���� ��ڲ�����param amount ����Ľ��, param
     * length ָ����С��λ���� ���ڲ����� �� �أ�return ���ת�������ַ��� <p/> ��д���ڣ�20051220 �޸ı�ע��
     * ******************************************************
     */
    public static String double2str(double amount, int length) {
        String strAmt = Double.toString(amount);
        int pos = strAmt.indexOf('.');
        if (pos != -1 && strAmt.length() > length + pos + 1)
            strAmt = strAmt.substring(0, pos + length + 1);
        return strAmt;
    }
    /**
     * ***************************************************** ��
     * �ܣ�����chr�ָ��ַ�������ΪString���Դ���split��֧����"|"Ϊ�ָ���� ��ڲ�����param str ��Ҫ���ָ�Ĵ�,param
     * chr �ָ���� ���ڲ����� �� �أ�return String[] �ָ����ַ�������,���������һ��|������ַ��� <p/>
     * ��д���ڣ�20051220 �޸ı�ע��
     * ******************************************************
     */
    public static String[] doSplit(String str, char chr) {
        int iCount = 0;
        char chrTmp = ' ';
        // ����ָ�����ٸ��ַ���
        for (int i = 0; i < str.length(); i++) {
            chrTmp = str.charAt(i);
            if (chrTmp == chr) {
                iCount++;
            }
        }
        String[] strArray = new String[iCount];
        for (int i = 0; i < iCount; i++) {
            int iPos = str.indexOf(chr);
            if (iPos == 0) {
                strArray[i] = "";
            } else {
                strArray[i] = str.substring(0, iPos);
            }
            str = str.substring(iPos + 1); // ��iPos+1������,str��������С
        }
        return strArray;
    }
    /**
     * ***************************************************** ��
     * �ܣ�����s�ָ��ַ�������ΪString���Դ���split��֧����"|"Ϊ�ָ���� ��ڲ�����param str ��Ҫ���ָ�Ĵ�,param s
     * �ָ��ַ��� ���ڲ����� �� �أ�return String[] �ָ����ַ�������,�������һ��|������ַ��� <p/>
     * ��д���ڣ�20051220 �޸ı�ע��
     * ******************************************************
     */
    public static String[] strSplit(String src, String splitchar) {
        int resultSize = 0;
        int len = src.length();
        int idx = 0;
        String strTemp = "";
        for (int i = 0; i < len; i++) {
            if (src.substring(i, i + 1).equals(splitchar)) {
                resultSize++;
            }
        }
        if ((len > 1) & (!src.substring(len - 1, len).equals(splitchar))) {
            resultSize++;
        }
        String result[] = new String[resultSize];
        for (int i = 0; i < len; i++) {
            if (src.substring(i, i + 1).equals(splitchar)) {
                result[idx] = strTemp;
                idx++;
                strTemp = "";
            } else {
                strTemp = String.valueOf(strTemp)
                        + String.valueOf(src.charAt(i));
            }
        }
        if (!strTemp.equals("")) {
            result[idx] = strTemp;
        }
        return result;
    }
    /**
     * ***************************************************** ��
     * �ܣ�����strSeparator�ָ��ַ�����ֻ�ָ���ָ����С���ַ��� ��ڲ�����param strToSplit ��Ҫ���ָ�Ĵ�,param
     * strSeparator �ָ��ַ���,param iLimit ָ����С ���ڲ����� �� �أ�return String[] �ָ����ַ�������
     * <p/> ��д���ڣ�20051220 �޸ı�ע��
     * ******************************************************
     */
    public static String[] split(String strToSplit, String strSeparator,
                                 int iLimit) {
        ArrayList tmpList = new ArrayList();
        int iFromIndex = 0;
        int iCurIndex = strToSplit.length();
        String strUnitInfo = "";
        int iCurCounts = 0;
        while ((iCurIndex != -1) && (iFromIndex < strToSplit.length())
                && (iCurCounts < iLimit)) {
            iCurIndex = strToSplit.indexOf(strSeparator, iFromIndex);
            if (iCurIndex == -1) {
                strUnitInfo = strToSplit.substring(iFromIndex, strToSplit
                        .length());
            } else {
                strUnitInfo = strToSplit.substring(iFromIndex, iCurIndex);
                iFromIndex = iCurIndex + 1;
            }
            tmpList.add(strUnitInfo);
            iCurCounts++;
        }
        int iCounts = tmpList.size();
        String tmpArray[] = new String[iCounts];
        for (int i = 0; i < iCounts; i++) {
            tmpArray[i] = (String) tmpList.get(i);
        }
        return tmpArray;
    }
    /**
     * ***************************************************** ��
     * �ܣ����ַ�����С��ָ�����ȣ�����IJ�����...���� ��ڲ�����param src ��Ҫ������Ĵ�,param len ָ����С ���ڲ����� ��
     * �أ�return String ��С��ָ�����ȣ�����IJ�����...�������ַ��� <p/> ��д���ڣ�20051220 �޸ı�ע��
     * ******************************************************
     */
    public static String strIntercept(String src, int len) {
        if (src == null) {
            return "";
        }
        if (src.length() > len) {
            src = String.valueOf(String.valueOf(src.substring(0, len))).concat(
                    "...");
        }
        return src;
    }
    /**
     * ***************************************************** ��
     * �ܣ����ַ���ת��ISO8859_1���� ��ڲ�����param str_in Ҫ��������ַ����� ���ڲ����� �� �أ�return String
     * ת������ַ����� <p/> ��д���ڣ�20051220 �޸ı�ע��
     * ******************************************************
     */
    public static String strtochn(String str_in) {
        try {
            String temp_p = str_in;
            if (temp_p == null) {
                temp_p = "";
            }
            String temp = "";
            if (!temp_p.equals("")) {
                byte[] byte1 = temp_p.getBytes("ISO8859_1");
                temp = new String(byte1);
            }
            return temp;
        } catch (Exception e) {
        }
        return "null";
    }
    /**
     * ***************************************************** ��
     * �ܣ���ISO8859_1�ַ���ת��GBK���� ��ڲ�����param strvalue Ҫ��������ַ����� ���ڲ����� �� �أ�return
     * String ת������ַ����� �޸ı�ע��
     * ******************************************************
     */
    public static String ISO2GBK(String strvalue) {
        try {
            if (strvalue == null)
                return null;
            else {
                strvalue = new String(strvalue.getBytes("ISO8859_1"), "GBK");
                return strvalue;
            }
        } catch (Exception e) {
            return null;
        }
    }
    /**
     * ***************************************************** ��
     * �ܣ���ҳ��Ҫ��ʾ���Ķ�����б���ת�� ��ڲ�����param str Ҫ��������ַ����� ���ڲ����� �� �أ�return String
     * ת������ַ����� �޸ı�ע�� ******************************************************
     */
    public static String cnCodeTrans(String str) {
        String s = "";
        try {
            s = new String(str.getBytes("GB2312"), "8859_1");
        } catch (UnsupportedEncodingException a) {
            System.out.print("chinese thansform exception");
        }
        return s;
    }
    /**
     * ***************************************************** ��
     * �ܣ��ж�Դ���Ƿ���Ϲ�������STaaaa����ST****** ��ڲ�����param strSourceҪ��������ַ�����param
     * strRule���� ���ڲ����� �� �أ�return false:Դ����ƥ�����true:Դ��ƥ����� �޸ı�ע��
     * ******************************************************
     */
    public static boolean judgeMatch(String strSource, String strRule) {
        int i = 0;
        // Դ�������ж�
        if ((null == strSource) || (strSource.length() == 0))
            return false;
        // ���򴮳����ж�
        if ((null == strRule) || (strRule.length() == 0))
            return false;
        // ���Ȳ��ɳ���
        if (strSource.length() > strRule.length())
            return false;
        // ÿһλ���ж�
        for (i = 0; i < strRule.length(); i++) {
            // Դ���ȹ��򴮶�
            if (strSource.length() < i + 1) {
                break;
            }
            if ((strRule.charAt(i) != '*')
                    && (strSource.charAt(i) != strRule.charAt(i))) {
                return false;
            }
        }
        // ����Դ���ȹ��򴮶̵�����������򴮺��Ǿ�Ϊ'*'����ƥ�䲻��
        for (; i < strRule.length(); i++) {
            if (strRule.charAt(i) != '*')
                return false;
        }
        return true;
    }
    public static String column2Property(String column) {
        column = column.toLowerCase();
        int i = column.indexOf("_");
        while (i != -1) {
            if (i != column.length() - 1) {
                char temp = column.charAt(i + 1);
                String strTemp = String.valueOf(temp);
                column = column.replaceFirst("_" + strTemp, strTemp
                        .toUpperCase());
                i = column.indexOf("_");
            } else {
                break;
            }
        }
        return column;
    }
    public static String strArrayToStr(String[] strs, String separator) {
        StringBuffer returnstr = new StringBuffer("");
        if (strs == null)
            return "";
        if (separator == null)
            separator = "";
        for (int i = 0; i < strs.length; i++) {
            returnstr.append(strs[i]);
            if (i < strs.length - 1)
                returnstr.append(separator);
        }
        return returnstr.toString();
    }
    public static String objectArrayToStr(Object[] objects, String separator) {
        StringBuffer returnstr = new StringBuffer("");
        if (objects == null)
            return "";
        if (separator == null)
            separator = "";
        for (int i = 0; i < objects.length; i++) {
            returnstr.append(String.valueOf(objects[i]));
            if (i < objects.length - 1)
                returnstr.append(separator);
        }
        return returnstr.toString();
    }
    public static String listToStr(List element, String separator) {
        StringBuffer returnstr = new StringBuffer("");
        if (element == null)
            return "";
        if (separator == null)
            separator = "";
        Iterator it = element.iterator();
        while (it.hasNext()) {
            returnstr.append(String.valueOf(it.next()));
            if (it.hasNext())
                returnstr.append(separator);
        }
        return returnstr.toString();
    }
    public static String[] listToStrArray(List element) {
        if (element == null || element.size() == 0)
            return null;
        Iterator it = element.iterator();
        String[] strArray = new String[element.size()];
        int i = 0;
        while (it.hasNext()) {
            strArray[i] = String.valueOf(it.next());
            i++;
        }
        return strArray;
    }
    public static List strToList(String str, String separator) {
        if (str == null || str.equals(""))
            return null;
        if (separator == null)
            separator = "";
        String[] strArr = str.split(separator);
        int size = strArr.length;
        List list = new ArrayList();
        for (int i = 0; i < size; i++) {
            list.add(strArr[i]);
        }
        return list;
    }
    public static StringBuffer populate(StringBuffer bf, String value,
                                        boolean isNotLast) {
        if (value == null) {
            return bf;
        }
        // ���ַ�����ÿ���������滻�����������ţ�ע�⣺����˫���ţ�����SQL����ѯ������
        System.out.println(value.replaceAll("'", "''"));
        bf.append("'").append(value.replaceAll("'", "''")).append("'");
        if (isNotLast)
            bf.append(",");
        return bf;
    }
    public static boolean isExist(String str, String substr, String sepatator) {
        if (str == null || str.trim().equals(""))
            return false;
        if (substr == null || substr.trim().equals(""))
            return false;
        String[] strArr = str.split(sepatator);
        int size = strArr.length;
        for (int i = 0; i < size; i++) {
            if (strArr[i].equals(substr))
                return true;
        }
        return false;
    }
    public static boolean isExist(String str, String substr) {
        return isExist(str, substr, ",");
    }
    public static String leftInclude(String str) {
        if (str == null || str.equals(""))
            return str;
        return str + "%";
    }
    public static String rightInclude(String str) {
        if (str == null || str.equals(""))
            return str;
        return "%" + str;
    }
    public static String include(String str) {
        if (str == null || str.equals(""))
            return str;
        return "%" + str + "%";
    }
    /**
     * ���һ���ַ���Ϊ�գ���ת��Ϊָ�����ַ���
     *
     * @param source String ԭ����
     * @param target String ת�������
     * @return String ���
     */
    public static String nvl(Object source, Object target) {
        return source != null ? String.valueOf(source)
                : (target != null ? String.valueOf(target) : null);
    }
    /**
     * ��clob�ֶ�ֵ����Ϊ�ַ���
     *
     * @param clobValue
     * @return
     * @throws SQLException
     */
    public static String clob2Str(Object clobValue) throws SQLException {
        return ((Clob) clobValue).getSubString(1, (int) ((Clob) clobValue)
                .length());
    }
    /**
     * ��ȡweb�ͻ�����ʵIp
     *
     * @param request
     * @return
     */
    public static String getRemoteAddr(HttpServletRequest request) {
        String ip = request.getHeader("x-forwarded-for");
        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
            ip = request.getHeader("Proxy-Client-IP");
        }
        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
            ip = request.getHeader("WL-Proxy-Client-IP");
        }
        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
            ip = request.getRemoteAddr();
        }
        return ip;
    }
    public static String hideFlowStr(String str, int maxLen) {
        if (str == null || maxLen == 0) {
            return "";
        }
        if (str.length() > maxLen) {
            str = str.substring(0, maxLen) + "...";
        }
        return str;
    }
    /**
     * ���������Ƿ�����
     *
     * @param str
     * @return
     */
    public static String escapeLuceneSpecialCharacters(String str) {
        if (str == null) {
            return null;
        }
        try {
            StringWriter writer = new StringWriter(str.length() * 2);
            escapeLuceneSpecialCharacterString(writer, str);
            return writer.toString();
        } catch (IOException ioe) {
            // this should never ever happen while writing to a StringWriter
            ioe.printStackTrace();
            return null;
        }
    }
    private static void escapeLuceneSpecialCharacterString(Writer out,
                                                           String str) throws IOException {
        if (str == null) {
            return;
        }
        int sz = str.length();
        for (int i = 0; i < sz; i++) {
            char ch = str.charAt(i);
            /*
             * Reference link:
			 * http://lucene.apache.org/java/docs/queryparsersyntax.html Lucene
			 * supports escaping special characters that are part of the query
			 * syntax. The current list special characters are: + - && || ! ( ) { } [ ] ^ " ~ * ? : \
			 * To escape these character use the \ before the character.
			 */
            switch (ch) {
                case '+':
                case '-':
                case '!':
                case '(':
                case ')':
                case '{':
                case '}':
                case '[':
                case ']':
                case '^':
                case '\"':
                case '~':
                case '*':
                case '?':
                case ':':
                case '\\':
                    out.write('\\');
                    out.write(ch);
                    break;
                case '&':
                case '|':
                    // check if it is '&&' or '||' ~ check if the next char is '&'
                    // or '|'
                    if ((i + 1) < sz && str.charAt(i + 1) == ch) {
                        out.write('\\');
                        out.write(ch);
                        i++;
                    }
                    out.write(ch);
                    break;
                default:
                    out.write(ch);
                    break;
            }
        }
    }
    /**
     * ȡ�ø������ֵ�����ĸ������ĸ
     */
    public static String getFirstLetter(String chinese) {
        /**
         * ��ĸ
         */
        final int[] li_SecPosValue = {1601, 1637, 1833, 2078, 2274, 2302,
                2433, 2594, 2787, 3106, 3212, 3472, 3635, 3722, 3730, 3858,
                4027, 4086, 4390, 4558, 4684, 4925, 5249, 5590};
        final String[] lc_FirstLetter = {"A", "B", "C", "D", "E", "F", "G",
                "H", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T",
                "W", "X", "Y", "Z"};
        if (chinese == null || chinese.trim().length() == 0) {
            return "";
        }
        chinese = conversionStr(chinese, "GB2312", "ISO8859-1");
        if (chinese.length() > 1) { // �ж��Dz��Ǻ���
            int li_SectorCode = (int) chinese.charAt(0); // ��������
            int li_PositionCode = (int) chinese.charAt(1); // �����
            li_SectorCode = li_SectorCode - 160;
            li_PositionCode = li_PositionCode - 160;
            int li_SecPosCode = li_SectorCode * 100 + li_PositionCode;// �������
            if (li_SecPosCode > 1600 && li_SecPosCode < 5590) {
                for (int i = 0; i < 23; i++) {
                    if (li_SecPosCode >= li_SecPosValue[i]
                            && li_SecPosCode < li_SecPosValue[i + 1]) {
                        chinese = lc_FirstLetter[i];
                        break;
                    }
                }
            } else {
                chinese = conversionStr(chinese, "ISO8859-1", "GB2312");
                chinese = chinese.substring(0, 1);
            }
        }
        return chinese;
    }
    private static String conversionStr(String str, String charsetName,
                                        String toCharsetName) {
        try {
            str = new String(str.getBytes(charsetName), toCharsetName);
        } catch (UnsupportedEncodingException ex) {
            ex.printStackTrace();
        }
        return str;
    }
    /**
     * �ı��༭���˷���
     *
     * @param html
     * @return
     */
    public static String checkStr(String html) {
        try {
            html = html.replaceAll("\r", "");
            html = html.replaceAll("\n", "");
            html = html.replaceAll("\"", "'");
            html = html.replaceAll("\t", " ");
            Pattern p_script;
            java.util.regex.Matcher m_script;
            Pattern p_href;
            java.util.regex.Matcher m_href;
            Pattern p_a;
            java.util.regex.Matcher m_a;
            Pattern p_on;
            java.util.regex.Matcher m_on;
            Pattern p_iframe;
            java.util.regex.Matcher m_iframe;
            Pattern p_frameset;
            java.util.regex.Matcher m_frameset;
            Pattern p_img;
            java.util.regex.Matcher m_img;
            Pattern p_p1;
            java.util.regex.Matcher m_p1;
            Pattern p_p2;
            java.util.regex.Matcher m_p2;
            String stript_str = "<script[\\s\\S]+</script *>";
            String href_str = " href *= *[\\s\\S]*script *:";
            String on_str = " on[\\s\\S]*=";
            String iframe_str = "<iframe[\\s\\S]+</iframe *>";
            String frameset_str = "<frameset[\\s\\S]+</frameset *>";
            String a_str = "<a ([^>])*>.*?</a([^>])*>";
            //String img_str = "\\<img[^\\>]+\\>";
            String p_str1 = "</p>";
            String p_str2 = "<p>";
            p_script = Pattern.compile(stript_str, Pattern.CASE_INSENSITIVE);
            m_script = p_script.matcher(html);
            html = m_script.replaceAll(""); // ����script��ǩ
            p_href = Pattern.compile(href_str, Pattern.CASE_INSENSITIVE);
            m_href = p_href.matcher(html);
            html = m_href.replaceAll(""); // ����script��ǩ
            p_a = Pattern.compile(a_str, Pattern.CASE_INSENSITIVE);
            m_a = p_a.matcher(html);
            html = m_a.replaceAll(""); // ����script��ǩ
            p_on = Pattern.compile(on_str, Pattern.CASE_INSENSITIVE);
            m_on = p_on.matcher(html);
            html = m_on.replaceAll(""); // ����script��ǩ
            p_iframe = Pattern.compile(iframe_str, Pattern.CASE_INSENSITIVE);
            m_iframe = p_iframe.matcher(html);
            html = m_iframe.replaceAll(""); // ����script��ǩ
            p_frameset = Pattern
                    .compile(frameset_str, Pattern.CASE_INSENSITIVE);
            m_frameset = p_frameset.matcher(html);
            html = m_frameset.replaceAll(""); // ����script��ǩ
            // p_img = Pattern.compile(img_str, Pattern.CASE_INSENSITIVE);
            // m_img = p_img.matcher(html);
            // html = m_img.replaceAll(""); // ����script��ǩ
            p_p1 = Pattern.compile(p_str1, Pattern.CASE_INSENSITIVE);
            m_p1 = p_p1.matcher(html);
            html = m_p1.replaceAll(""); // ����script��ǩ
            p_p2 = Pattern.compile(p_str2, Pattern.CASE_INSENSITIVE);
            m_p2 = p_p2.matcher(html);
            html = m_p2.replaceAll(""); // ����script��ǩ
        } catch (Exception e) {
            System.err.println("Html2Text: " + e.getMessage());
        }
        return html;
    }
    public static String substr(String value, int maxlength, String postfix) {
        int k = 0;
        int l = 0;
        for (int i = 0; i < value.length() && maxlength > l * 2 + k; i++) {
            if (value.charAt(i) > '\200') {
                l++;
            } else {
                k++;
            }
        }
        // value����������Ϊ�����ַ���
        if (l + k >= value.length()) {
            return value;
        } else if (maxlength >= l * 2 + k && l + k > 0) {
            value = value.substring(0, l + k);
        } else if (l + k > 0) {
            value = value.substring(0, (l + k) - 1);
        } else {
            return value;
        }
        // ��ָ���޶���ʾ����ʱ����ȡָ�����ȵ��ַ�����Ϊ���
        if (!StringUtils.isEmpty(postfix)) {
            value += postfix;
        }
        return value;
    }
    public static void main(String[] args) {
        String str = "���!";
    }
    /**
     * ***************************************************** ��
     * �ܣ����紫����ַ�����null��ת�ɿմ������򷵻�ԭ�ַ��� ��ڲ�����param Content:��ת�����ַ��� ���ڲ����� ��
     * �أ�����ַ�����null��ת�ɿմ������򷵻�ԭ�ַ��� <p/> ��д���ڣ�20051220 �޸ı�ע��
     * ******************************************************
     */
    public String nullToSpace(String Content) {
        if (Content == null) {
            Content = "";
        }
        return Content;
    }
    /**
     * ***************************************************** ��
     * �ܣ���GBK�ַ���ת��ISO8859_1���� ��ڲ�����param strvalue Ҫ��������ַ����� ���ڲ����� �� �أ�return
     * String ת������ַ����� �޸ı�ע��
     * ******************************************************
     */
    public String GBK2ISO(String strvalue) throws Exception {
        try {
            if (strvalue == null)
                return null;
            else {
                strvalue = new String(strvalue.getBytes("GBK"), "ISO8859_1");
                return strvalue;
            }
        } catch (Exception e) {
            return null;
        }
    }
}

+ 154 - 0
Hos-Resource-Rest/src/main/java/com/yihu/hos/ws/model/WSReturnModel.java

@ -0,0 +1,154 @@
package com.yihu.hos.ws.model;
import org.dom4j.Document;
import org.dom4j.DocumentHelper;
import org.dom4j.Element;
import org.springframework.util.StringUtils;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
 * Created by Administrator on 2016/5/23.
 */
public class WSReturnModel {
    private String TransactionCode;
    private List<Map<String, Object>> Data = new ArrayList<Map<String, Object>>();
    private String RespCode = "10000";
    private String RespMessage = "成功";
    public String getTransactionCode() {
        return TransactionCode;
    }
    public void setTransactionCode(String transactionCode) {
        TransactionCode = transactionCode;
    }
    public List<Map<String, Object>> getData() {
        return Data;
    }
    public void setData(List<Map<String, Object>> data) {
        Data = data;
    }
    public String getRespMessage() {
        return RespMessage;
    }
    public void setRespMessage(String respMessage) {
        RespMessage = respMessage;
    }
    public static String toXml(WSReturnModel wsReturnModel) {
        String root = "Resg";
        String transactionCode = "TransactionCode";
        String respMessage = "RespMessage";
        String data = "Data";
        String respCode = "RespCode";
        Document document = DocumentHelper.createDocument();
        Element rootElement = DocumentHelper.createElement(root);
        //添加TransactionCode
        Element transactionCodeElement = DocumentHelper.createElement(transactionCode);
        transactionCodeElement.addText(wsReturnModel.getTransactionCode());
        rootElement.add(transactionCodeElement);
        //添加RespMessage
        Element respMessageElement = DocumentHelper.createElement(respMessage);
        respMessageElement.addText(wsReturnModel.getRespMessage());
        rootElement.add(respMessageElement);
        //respCode
        Element respCodeElement = DocumentHelper.createElement(respCode);
        respCodeElement.addText(wsReturnModel.getRespCode());
        rootElement.add(respCodeElement);
        //添加Data
        for (Map<String, Object> map : wsReturnModel.getData()) {
            Element dataElement = DocumentHelper.createElement(data);
            for (Map.Entry<String, Object> e : map.entrySet()) {
                if ("data_1".equals(e.getKey().toLowerCase())) {
                    //判断是否是data1
                    Element elemenData1Temp = DocumentHelper.createElement("Data_1");
                    List<Map<String,Object>> list= (List<Map<String, Object>>) e.getValue();
                    for(Map<String,Object> one:list){
                        for (Map.Entry<String, Object> dataE : one.entrySet()) {
                            Element elemenData1TempElement = DocumentHelper.createElement(toUpperCaseFirstOne(dataE.getKey()));
                            if (!StringUtils.isEmpty(e.getValue())) {
                                elemenData1TempElement.addText(dataE.getValue().toString());
                            }
                            elemenData1Temp.add(elemenData1TempElement);
                        }
                    }
                    dataElement.add(elemenData1Temp);
                } else {
                    // Element elemenTemp = DocumentHelper.createElement(toUpperCaseFirstOne(e.getKey()));
                    Element elemenTemp = DocumentHelper.createElement(toUpperCaseFirstOne(e.getKey()));
                    if (!StringUtils.isEmpty(e.getValue())) {
                        elemenTemp.addText(e.getValue().toString());
                    }
                    dataElement.add(elemenTemp);
                }
            }
            rootElement.add(dataElement);
        }
        document.setRootElement(rootElement);
        System.out.println(document.asXML());
        return document.asXML();
    }
    public static String toUpperCaseFirstOne(String name) {
        char[] ch = name.toCharArray();
        for (int i = 0; i < ch.length; i++) {
            if (i == 0) {
                ch[0] = Character.toUpperCase(ch[0]);
            } else {
                ch[i] = Character.toLowerCase(ch[i]);
            }
        }
        StringBuffer a = new StringBuffer();
        a.append(ch);
        return underlineToCamel(a.toString());
    }
    public static String underlineToCamel(String param) {
        if (param == null || "".equals(param.trim())) {
            return "";
        }
        int len = param.length();
        StringBuilder sb = new StringBuilder(len);
        for (int i = 0; i < len; i++) {
            char c = param.charAt(i);
            if (c=='_') {
                if (++i < len) {
                    sb.append(Character.toUpperCase(param.charAt(i)));
                }
            } else {
                sb.append(c);
            }
        }
        return sb.toString();
    }
    public static void main(String[] args) {
        System.out.println(underlineToCamel("asd_a"));
    }
    public String getRespCode() {
        return RespCode;
    }
    public void setRespCode(String respCode) {
        RespCode = respCode;
    }
    @Override
    public String toString() {
        return "WSReturnModel{" +
                "TransactionCode='" + TransactionCode + '\'' +
                ", Data=" + Data +
                ", RespCode='" + RespCode + '\'' +
                ", RespMessage='" + RespMessage + '\'' +
                '}';
    }
}

+ 88 - 0
Hos-Resource-Rest/src/main/java/com/yihu/hos/ws/service/ServiceGateWay.java

@ -0,0 +1,88 @@
package com.yihu.hos.ws.service;
import com.yihu.hos.resource.util.StringUtil;
import com.yihu.hos.ws.model.WSReturnModel;
import com.yihu.hos.ws.thread.QLCThread;
import org.dom4j.Document;
import org.dom4j.DocumentHelper;
import org.dom4j.Element;
import org.springframework.stereotype.Service;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
 * Created by Administrator on 2016/5/19.
 */
@javax.jws.WebService(endpointInterface = "com.yihu.hos.ws.service.ServiceGateWayPortType",
        targetNamespace = "http://com.yihu.wsgw/ServiceGateWay",
        serviceName = "ServiceGateWay",
        portName = "ServiceGateWayHttpPort")
public class ServiceGateWay implements ServiceGateWayPortType {
    public static String replaceBlank(String str) {
        String dest = "";
        if (str != null) {
            Pattern p = Pattern.compile("\\s*|\t|\r|\n");
            Matcher m = p.matcher(str);
            dest = m.replaceAll("");
        }
        return dest;
    }
    public String service(String authInfo, String sequenceNo, String api, String param, int paramType, int outType, String v) {
        System.out.println("authInfo:" + authInfo);
        System.out.println("sequenceNo:" + sequenceNo);
        System.out.println("api,:" + api);
        System.out.println("param:" + param);
        System.out.println("paramType:" + paramType);
        System.out.println("outType:" + outType);
        System.out.println("v:" + v);
        WSReturnModel wsReturnModel = new WSReturnModel();
        String xml;
        try {
            switch (api) {
                case "yy.yygh.PushPrescribeCheckedEvent": {
                    Document document = DocumentHelper.parseText(param.trim());
                    Element root = document.getRootElement();
                    Element data = root.element("Data");
                    Thread thread = new QLCThread(data);
                    thread.run();
                    wsReturnModel.setTransactionCode("10000");
                    wsReturnModel.setRespMessage("成功");
                    xml = WSReturnModel.toXml(wsReturnModel);
                    break;
                }
                default: {
                    wsReturnModel.setTransactionCode("-10000");
                    wsReturnModel.setRespMessage("没有对应的API");
                    xml = WSReturnModel.toXml(wsReturnModel);
                }
            }
        } catch (Throwable e) {
            e.printStackTrace();
            wsReturnModel.setTransactionCode("-10000");
            wsReturnModel.setRespMessage("请检查参数是否有问题,");
            xml = WSReturnModel.toXml(wsReturnModel);
        }
        return xml;
    }
//    public static void main(String[] args) throws Exception {
        /*
        JaxWsDynamicClientFactory factory = JaxWsDynamicClientFactory.newInstance();
        Client client = factory.createClient("http://172.19.103.71:8080/service/sql?wsdl");
        //Client client = factory.createClient("http://localhost:8080/service/sql?wsdl");
        try {
            Object[] result = client.invoke("ExcuteSQL", "10000", "select count(1) as COUNT,max(to_number(HDSD03_01_031)) as MAX_KEYVALUE from HDSC01_02 where 1=1 order by to_number(HDSD03_01_031)"); // 按照方法的参数来提供值
            if (result != null && result.length > 0) {
                System.out.println(result[0]); // 通过getUsername来获取对象的username属性
            }
        } catch (Exception e) {
            e.printStackTrace();
        }*/
//    }
}

+ 30 - 0
Hos-Resource-Rest/src/main/java/com/yihu/hos/ws/service/ServiceGateWayPortType.java

@ -0,0 +1,30 @@
package com.yihu.hos.ws.service;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebResult;
import javax.jws.WebService;
import javax.xml.ws.RequestWrapper;
import javax.xml.ws.ResponseWrapper;
/**
 * Created by Administrator on 2016/5/19.
 */
@WebService(name = "ServiceGateWayPortType", targetNamespace = "http://com.yihu.wsgw/ServiceGateWay")
public interface ServiceGateWayPortType {
    @WebMethod(operationName = "service")
    @WebResult(name = "out", targetNamespace = "http://com.yihu.wsgw/ServiceGateWay")
    @RequestWrapper(localName = "service", targetNamespace = "http://com.yihu.wsgw/ServiceGateWay", className = "com.yihu.yuyue.service.client.screnmingyy.servicegateway.Service")
    @ResponseWrapper(localName = "serviceResponse", targetNamespace = "http://com.yihu.wsgw/ServiceGateWay", className = "com.yihu.yuyue.service.client.screnmingyy.servicegateway.ServiceResponse")
    String service(
            @WebParam(name = "authInfo", targetNamespace = "http://com.yihu.wsgw/ServiceGateWay") String authInfo,
            @WebParam(name = "sequenceNo", targetNamespace = "http://com.yihu.wsgw/ServiceGateWay") String sequenceNo,
            @WebParam(name = "api", targetNamespace = "http://com.yihu.wsgw/ServiceGateWay") String api,
            @WebParam(name = "param", targetNamespace = "http://com.yihu.wsgw/ServiceGateWay") String param,
            @WebParam(name = "paramType", targetNamespace = "http://com.yihu.wsgw/ServiceGateWay") int paramType,
            @WebParam(name = "outType", targetNamespace = "http://com.yihu.wsgw/ServiceGateWay") int outType,
            @WebParam(name = "v", targetNamespace = "http://com.yihu.wsgw/ServiceGateWay") String v
    );
}

+ 36 - 0
Hos-Resource-Rest/src/main/java/com/yihu/hos/ws/thread/QLCThread.java

@ -0,0 +1,36 @@
package com.yihu.hos.ws.thread;
import com.yihu.hos.resource.util.httpclient.HttpClientUtil;
import org.dom4j.Element;
import java.util.HashMap;
import java.util.Map;
/**
 * Created by lingfeng on 2016/6/23.
 */
public class QLCThread extends Thread{
    private HttpClientUtil httpClientUtil = new HttpClientUtil();
    private Element data;
    public QLCThread(Element data){
        this.data = data;
    }
    public void run() {
        Map<String, Object> paramsMap = new HashMap<>();
        Map<String, Object> params = new HashMap<>();
        params.put("EventType", data.element("EventType").getText());
        params.put("EventNo", data.element("EventNo").getText());
        params.put("CardType", data.element("CardType").getText());
        params.put("CardNo", data.element("CardNo").getText());
        params.put("PatientId", data.element("PatientId").getText());
        params.put("HospitalId", data.element("OrgCode").getText());
        paramsMap.put("api", "17");
        paramsMap.put("param", params.toString());
        try {
            String res = httpClientUtil.doPost("http://127.0.0.1:8081/gateway/transfer", paramsMap, null, null);
            System.out.println(res);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

+ 19 - 7
Hos-Resource-WS/Hos-Resource-WS.iml

@ -22,13 +22,6 @@
    </content>
    <orderEntry type="jdk" jdkName="1.8" jdkType="JavaSDK" />
    <orderEntry type="sourceFolder" forTests="false" />
    <orderEntry type="library" name="Maven: com.google.guava:guava:12.0.1" level="project" />
    <orderEntry type="library" name="Maven: com.google.code.findbugs:jsr305:1.3.9" level="project" />
    <orderEntry type="library" name="Maven: asm:asm:3.3.1" level="project" />
    <orderEntry type="library" name="Maven: org.apache.neethi:neethi:3.0.3" level="project" />
    <orderEntry type="library" name="Maven: com.thoughtworks.xstream:xstream:1.4.8" level="project" />
    <orderEntry type="library" name="Maven: xmlpull:xmlpull:1.1.3.1" level="project" />
    <orderEntry type="library" name="Maven: xpp3:xpp3_min:1.1.4c" level="project" />
    <orderEntry type="library" name="Maven: com.yihu.core:ehr-dbhelper:1.1.8" level="project" />
    <orderEntry type="library" name="Maven: mysql:mysql-connector-java:5.1.38" level="project" />
    <orderEntry type="library" name="Maven: com.oracle:ojdbc6:11.2.0.3.0" level="project" />
@ -138,5 +131,24 @@
    <orderEntry type="library" name="Maven: com.thoughtworks.xstream:xstream:1.4.8" level="project" />
    <orderEntry type="library" name="Maven: xmlpull:xmlpull:1.1.3.1" level="project" />
    <orderEntry type="library" name="Maven: xpp3:xpp3_min:1.1.4c" level="project" />
    <orderEntry type="library" name="api-dict-1.6" level="project" />
    <orderEntry type="module-library">
      <library>
        <CLASSES>
          <root url="jar://F:/公司/健康之路/RPC/core-db-1.3.jar!/" />
        </CLASSES>
        <JAVADOC />
        <SOURCES />
      </library>
    </orderEntry>
    <orderEntry type="module-library">
      <library>
        <CLASSES>
          <root url="jar://F:/公司/健康之路/RPC/commons-codec-1.9.jar!/" />
        </CLASSES>
        <JAVADOC />
        <SOURCES />
      </library>
    </orderEntry>
  </component>
</module>

+ 2 - 2
Hos-resource/Hos-Resource.iml

@ -23,7 +23,7 @@
    <orderEntry type="jdk" jdkName="1.8" jdkType="JavaSDK" />
    <orderEntry type="sourceFolder" forTests="false" />
    <orderEntry type="library" name="Maven: org.mongodb:mongo-java-driver:3.1.0" level="project" />
    <orderEntry type="module" module-name="Hos-Framework" />
    <orderEntry type="library" name="Maven: com.yihu.hos.resource:Hos-Framework:1.0.7" level="project" />
    <orderEntry type="library" name="Maven: com.yihu.core:ehr-redishelper:1.0.0" level="project" />
    <orderEntry type="library" name="Maven: com.yihu.core:html2image:0.9" level="project" />
    <orderEntry type="library" name="Maven: com.oracle:ojdbc6:11.2.0.3.0" level="project" />
@ -218,6 +218,7 @@
    <orderEntry type="library" name="Maven: aopalliance:aopalliance:1.0" level="project" />
    <orderEntry type="library" name="Maven: org.json:json:20151123" level="project" />
    <orderEntry type="library" name="Maven: javax.servlet:javax.servlet-api:3.1.0" level="project" />
    <orderEntry type="library" name="Maven: javax.transaction:javax.transaction-api:1.2" level="project" />
    <orderEntry type="library" name="Maven: dom4j:dom4j:1.6.1" level="project" />
    <orderEntry type="library" name="Maven: xml-apis:xml-apis:1.4.01" level="project" />
    <orderEntry type="library" name="Maven: javax.xml:jaxrpc-api:1.1" level="project" />
@ -230,7 +231,6 @@
    <orderEntry type="library" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
    <orderEntry type="library" name="Maven: org.jboss:jandex:1.1.0.Final" level="project" />
    <orderEntry type="library" name="Maven: org.javassist:javassist:3.18.1-GA" level="project" />
    <orderEntry type="library" name="Maven: javax.persistence:persistence-api:1.0.2" level="project" />
    <orderEntry type="library" name="Maven: jaxen:jaxen:1.1.6" level="project" />
    <orderEntry type="library" name="Maven: jstl:jstl:1.2" level="project" />
    <orderEntry type="library" name="Maven: com.belerweb:pinyin4j:2.5.0" level="project" />

+ 1 - 1
Hos-resource/pom.xml

@ -6,7 +6,7 @@
    <parent>
        <groupId>com.yihu.core</groupId>
        <artifactId>Hos-Framework-dependencies</artifactId>
        <version>1.0-SNAPSHOT</version>
        <version>1.0.1</version>
        <relativePath>../Hos-Framework-dependencies</relativePath>
    </parent>

+ 4 - 0
Hos-resource/src/main/java/com/yihu/ehr/common/CommonPageController.java

@ -1,5 +1,6 @@
package com.yihu.ehr.common;
import com.yihu.ehr.framework.util.PKUtil;
import com.yihu.ehr.framework.util.controller.BaseController;
import com.yihu.ehr.system.model.SystemUser;
import org.springframework.stereotype.Controller;
@ -23,6 +24,9 @@ public class CommonPageController extends BaseController {
     */
    @RequestMapping("loginPage")
    public String login(Model model) {
        System.out.println("=================登录成功===============");
        PKUtil.getUuid();
        System.out.println("=================登录结束===============");
        model.addAttribute("contentPage","/common/login");
        return "pageView";
    }

+ 6 - 7
Hos-resource/src/main/java/com/yihu/ehr/job/service/ArchiveUploadJob.java

@ -4,14 +4,16 @@ import com.yihu.ehr.common.Services;
import com.yihu.ehr.crawler.service.CrawlerManager;
import com.yihu.ehr.datacollect.model.RsJobConfig;
import com.yihu.ehr.datacollect.service.intf.IDatacollectManager;
import com.yihu.ehr.framework.constrant.DateConvert;
import com.yihu.ehr.framework.model.DataGridResult;
import com.yihu.ehr.framework.util.DateUtil;
import com.yihu.ehr.framework.util.springutil.SpringBeanUtil;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.util.*;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
/**
 * Created by hzp on 2016/5/11.
@ -30,11 +32,8 @@ public class ArchiveUploadJob implements IBaseJob {
        Date begin = job.getRepeatStartTime();
        Date end = job.getRepeatEndTime();
        if (!job.getJobType().equals("0")) {
            if (end == null) {
                //调整截止时间,当前时间-偏移量
                end = DateUtil.addDate(-job.getDelayTime(), DateUtil.getSysDateTime());
            }
            //调整截止时间,当前时间-偏移量
            end = DateUtil.addDate(-job.getDelayTime(), DateUtil.getSysDateTime());
            if ((end.getTime() - begin.getTime()) <= 0) {
                return; //结束时间小于开始时间时,不获取
            }

+ 5 - 22
Hos-resource/src/main/java/com/yihu/ehr/resource/controller/RsCategoryController.java

@ -2,6 +2,7 @@ package com.yihu.ehr.resource.controller;
import com.yihu.ehr.framework.model.Result;
import com.yihu.ehr.framework.util.controller.BaseController;
import com.yihu.ehr.framework.util.http.HttpsClient;
import com.yihu.ehr.resource.model.RsResourceCategory;
import com.yihu.ehr.resource.service.IRsCategoryService;
import gui.ava.html.image.generator.HtmlImageGenerator;
@ -12,10 +13,13 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.annotation.Resource;
import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSocketFactory;
import javax.net.ssl.TrustManager;
import javax.servlet.http.HttpServletRequest;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.HashMap;
import java.util.Map;
@ -145,25 +149,4 @@ public class RsCategoryController extends BaseController {
    }
    public static void main(String[] args) throws Exception {
        //生成一个URL对象
        URL url = new URL("http://localhost:8080/test.jsp");
        //打开URL
        HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection();
        //得到输入流,即获得了网页的内容
        BufferedReader reader = new BufferedReader(new InputStreamReader(urlConnection
                .getInputStream()));
        String line;
        String aa = "";
        // 读取输入流的数据,并显示
        while ((line = reader.readLine()) != null) {
            aa += line;
        }
        System.out.println(aa);
        HtmlImageGenerator imageGenerator = new HtmlImageGenerator();
        imageGenerator.loadHtml(aa);
        imageGenerator.getBufferedImage();
        imageGenerator.saveAsImage("d:/hello-world3.png");
        imageGenerator.saveAsHtmlWithMap("hello-world.html", "hello-world.png");
    }
}

+ 14 - 11
Hos-resource/src/main/java/com/yihu/ehr/resource/controller/RsResourceController.java

@ -71,11 +71,11 @@ public class RsResourceController extends BaseController {
     */
    @RequestMapping("/resourceTreeList")
    @ResponseBody
    public Result resourceTreeList() {
    public Result resourceTreeList(String name) {
        try {
            ActionResult actionResult = new ActionResult();
            actionResult.setData(resourceService.getResourceTreeList());
            actionResult.setData(resourceService.getResourceTreeList(name));
            return actionResult;
        } catch (Exception e) {
            e.printStackTrace();
@ -85,10 +85,10 @@ public class RsResourceController extends BaseController {
    @RequestMapping("/resourceCategoryTreeList")
    @ResponseBody
    public Result resourceCategoryTreeList() {
    public Result resourceCategoryTreeList(String name) {
        try {
            ActionResult actionResult = new ActionResult();
            actionResult.setData(resourceService.resourceCategoryTreeList());
            actionResult.setData(resourceService.resourceCategoryTreeList(name));
            return actionResult;
        } catch (Exception e) {
            e.printStackTrace();
@ -267,6 +267,7 @@ public class RsResourceController extends BaseController {
            return result;
        }
        try {
            //现在最多导出五十条数据
            String pageSize = StringUtils.isEmpty(request.getParameter("rows")) ? "10" : request.getParameter("rows");
            String currPage = StringUtils.isEmpty(request.getParameter("page")) ? "1" : request.getParameter("page");
@ -277,6 +278,7 @@ public class RsResourceController extends BaseController {
            Map<String, Object> params = new HashMap<String, Object>();
            params.put("rows", Integer.valueOf(pageSize));
            params.put("page", Integer.valueOf(currPage));
            if (!StringUtils.isEmpty(resource.getDatasetCode())) {
                RsResourceRestDetail rrd = resourceRestService.getResourceRestDetailByCode(resource.getCode());
                if ("resource.getMongoDBData".equals(rrd.getNamespace())) {
@ -317,8 +319,10 @@ public class RsResourceController extends BaseController {
                result.setCurrPage(Integer.valueOf(currPage));
                result.setPageSize(Integer.valueOf(pageSize));
                result.setSuccessFlg(true);
            } else {
                result.setSuccessFlg(false);
                result.setMessage("获取数据失败");
            }
        } catch (Exception e) {
            e.printStackTrace();
            result.setSuccessFlg(false);
@ -602,10 +606,10 @@ public class RsResourceController extends BaseController {
    @ResponseBody
    public Result createMetaData(HttpServletRequest request) {
        try {
            if(StringUtils.isEmpty(request.getParameter("inp_field_is_PK"))){
            if (StringUtils.isEmpty(request.getParameter("inp_field_is_PK"))) {
                throw new Exception("请选择是否为主键");
            }
            if(StringUtils.isEmpty(request.getParameter("inp_field_is_null"))){
            if (StringUtils.isEmpty(request.getParameter("inp_field_is_null"))) {
                throw new Exception("请选择是否为空");
            }
            RsResourceMetadata rmd = new RsResourceMetadata();
@ -639,10 +643,10 @@ public class RsResourceController extends BaseController {
            rmd.setColumnLength(request.getParameter("columnLength"));
            rmd.setColumnType(request.getParameter("columnType"));
            rmd.setDefinition(request.getParameter("definition"));
            if(StringUtils.isEmpty(request.getParameter("inp_field_is_PK"))){
            if (StringUtils.isEmpty(request.getParameter("inp_field_is_PK"))) {
                throw new Exception("请选择是否为主键");
            }
            if(StringUtils.isEmpty(request.getParameter("inp_field_is_null"))){
            if (StringUtils.isEmpty(request.getParameter("inp_field_is_null"))) {
                throw new Exception("请选择是否为空");
            }
            rmd.setNullable(Integer.valueOf(request.getParameter("inp_field_is_null")));
@ -663,7 +667,7 @@ public class RsResourceController extends BaseController {
    public Result getMetaDataByDatasetId(HttpServletRequest request) {
        try {
            String datasetCode = request.getParameter("datasetCode");
                String datasetId = request.getParameter("datasetId");
            String datasetId = request.getParameter("datasetId");
            return resourceService.getMetaDataByDatasetId(datasetCode, datasetId);
        } catch (Exception e) {
            e.printStackTrace();
@ -794,7 +798,6 @@ public class RsResourceController extends BaseController {
                fieldMap.put(String.valueOf(jo.get("key")), String.valueOf(jo.get("value")));
            }
            request.setAttribute("rows", "1000");
            Result e = this.searchRomoteResourceList(request);
            JXLUtil.listMapToExcel(((DataGridResult) e).getDetailModelList(), fieldMap, name, response);
        } catch (Exception e) {

+ 2 - 2
Hos-resource/src/main/java/com/yihu/ehr/resource/service/IRsResourceService.java

@ -18,7 +18,7 @@ import java.util.Map;
 * Created by chenweida on 2015/12/15.
 */
public interface IRsResourceService {
    List<TreeResult> getResourceTreeList() throws Exception;
    List<TreeResult> getResourceTreeList(String name) throws Exception;
    DataGridResult getResourceList(Map<String, Object> conditionMap, Integer page, Integer rows) throws Exception;
@ -34,7 +34,7 @@ public interface IRsResourceService {
    DataGridResult getResourceFiled(Map<String, Object> conditionMap, Integer page, Integer rows) throws Exception;
    List<TreeResult> resourceCategoryTreeList() throws Exception;
    List<TreeResult> resourceCategoryTreeList(String name) throws Exception;
    String searchRomoteResourceList(String code, Map<String, Object> params) throws Exception;

+ 202 - 29
Hos-resource/src/main/java/com/yihu/ehr/resource/service/impl/RsResourceServiceImpl.java

@ -53,43 +53,213 @@ public class RsResourceServiceImpl implements IRsResourceService {
    @Override
    public List<TreeResult> getResourceTreeList() throws Exception {
    public List<TreeResult> getResourceTreeList(String name) throws Exception {
        List<TreeResult> treeVOs = new ArrayList<TreeResult>();
        List<String> pidList = new ArrayList<>();
        List<String> pidList1 = new ArrayList<>();
        List<String> idList = new ArrayList<>();
        List<String> idList1 = new ArrayList<>();
        List<RsResourceCategory> rsCategorya = rsResourceCategoryDao.getAllRsResourceCategory();
        for (RsResourceCategory r : rsCategorya) {
            TreeResult treeVO = new TreeResult();
            treeVO.setId(r.getId());
            treeVO.setPid(r.getPid());
            treeVO.setText(r.getName());
            treeVO.setType("1");
            treeVOs.add(treeVO);
        if (name != null && name.length() > 0) {
            for (int i = 0; i < rsCategorya.size(); i++) {
                RsResourceCategory r = rsCategorya.get(i);
                TreeResult treeVO = new TreeResult();
                if (r.getName().contains(name)) {
                    treeVO.setId(r.getId());
                    treeVO.setPid(r.getPid());
                    pidList.add(r.getPid());
                    idList.add(r.getId());
                    treeVO.setText(r.getName());
                    treeVO.setType("1");
                    treeVOs.add(treeVO);
                    rsCategorya.remove(r);
                    i--;
                }
            }
        }
        return treeVOs;
        else {
            for (RsResourceCategory r : rsCategorya) {
                TreeResult treeVO = new TreeResult();
                treeVO.setId(r.getId());
                treeVO.setPid(r.getPid());
                treeVO.setText(r.getName());
                treeVO.setType("1");
                treeVOs.add(treeVO);
            }
        }
        while (pidList.size() > 0 || idList.size() > 0) {
            for (int i = 0; i < rsCategorya.size(); i++) {
                RsResourceCategory r1=rsCategorya.get(i);
                TreeResult treeVO = new TreeResult();
                if (pidList.contains(r1.getId())) {
                    treeVO.setId(r1.getId());
                    treeVO.setPid(r1.getPid());
                    pidList1.add(r1.getPid());
                    treeVO.setText(r1.getName());
                    treeVO.setType("1");
                    treeVOs.add(treeVO);
                    rsCategorya.remove(r1);
                    i--;
                }
                else if (idList.contains(r1.getPid())) {
                    treeVO.setId(r1.getId());
                    treeVO.setPid(r1.getPid());
                    idList1.add(r1.getId());
                    treeVO.setText(r1.getName());
                    treeVO.setType("1");
                    treeVOs.add(treeVO);
                    rsCategorya.remove(r1);
                    i--;
                }
            }
            pidList.clear();
            idList.clear();
            pidList.addAll(pidList1);
            idList.addAll(idList1);
            pidList1.clear();
            idList1.clear();
        }
            return treeVOs;
    }
    @Override
    public List<TreeResult> resourceCategoryTreeList() throws Exception {
    public List<TreeResult> resourceCategoryTreeList(String name) throws Exception {
        List<TreeResult> treeVOs = new ArrayList<TreeResult>();
        List<RsResourceCategory> rsCategorya = rsResourceCategoryDao.getAllRsResourceCategory();
        for (RsResourceCategory r : rsCategorya) {
            TreeResult treeVO = new TreeResult();
            treeVO.setId(r.getId());
            treeVO.setPid(r.getPid());
            treeVO.setText(r.getName());
            treeVO.setType("1");
            treeVO.setIcon("../develop/lib/ligerui/skins/Aqua/images/tree/folder.gif");
            treeVOs.add(treeVO);
        List<String > pidList=new ArrayList<>();
        List<String > pidList1=new ArrayList<>();
        List<String > idList=new ArrayList<>();
        List<String > idList1=new ArrayList<>();
        if(name!=null&&name.length()>0) {
            for (int i=0;i<rsCategorya.size();i++) {
                RsResourceCategory  r=rsCategorya.get(i);
                TreeResult treeVO = new TreeResult();
                if(r.getName().contains(name)) {
                    treeVO.setId(r.getId());
                    treeVO.setPid(r.getPid());
                    pidList.add(r.getPid());
                    idList.add(r.getId());
                    treeVO.setText(r.getName());
                    treeVO.setType("1");
                    treeVO.setIcon("../develop/lib/ligerui/skins/Aqua/images/tree/folder.gif");
                    treeVOs.add(treeVO);
                    rsCategorya.remove(r);
                    i--;
                }
            }
        }
        else{
            for (RsResourceCategory r : rsCategorya) {
                TreeResult treeVO = new TreeResult();
                treeVO.setId(r.getId());
                treeVO.setPid(r.getPid());
                treeVO.setText(r.getName());
                treeVO.setType("1");
                treeVO.setIcon("../develop/lib/ligerui/skins/Aqua/images/tree/folder.gif");
                treeVOs.add(treeVO);
            }
        }
        List<RsResource> rsResources = rsResourceDao.getAllRsResource();
        for (RsResource r : rsResources) {
            TreeResult treeVO = new TreeResult();
            treeVO.setId(r.getId());
            treeVO.setPid(r.getCategory());
            treeVO.setText(r.getName());
            treeVO.setType("2");
            treeVO.setIcon("../develop/lib/ligerui/skins/Aqua/images/tree/tree-leaf.gif");
            treeVOs.add(treeVO);
        if(name!=null&&name.length()>0) {
            for (int i=0;i<rsResources.size();i++) {
                RsResource r =rsResources.get(i);
                TreeResult treeVO = new TreeResult();
                if(r.getName().contains(name)) {
                    treeVO.setId(r.getId());
                    treeVO.setPid(r.getCategory());
                    pidList.add(r.getCategory());
                    idList.add(r.getId());
                    treeVO.setText(r.getName());
                    treeVO.setType("2");
                    treeVO.setIcon("../develop/lib/ligerui/skins/Aqua/images/tree/tree-leaf.gif");
                    treeVOs.add(treeVO);
                    rsResources.remove(r);
                    i--;
                }
            }
        }
        else {
            for (RsResource r : rsResources) {
                TreeResult treeVO = new TreeResult();
                treeVO.setId(r.getId());
                treeVO.setPid(r.getCategory());
                treeVO.setText(r.getName());
                treeVO.setType("2");
                treeVO.setIcon("../develop/lib/ligerui/skins/Aqua/images/tree/tree-leaf.gif");
                treeVOs.add(treeVO);
            }
        }
        while (pidList.size()>0 || idList.size()>0) {
            for (int i=0,j=0;i<rsCategorya.size()||j<rsResources.size();i++,j++) {
                RsResourceCategory r1=new RsResourceCategory();
                RsResource r=new RsResource();
                if(i<rsCategorya.size()) {
                   r1 = rsCategorya.get(i);
                }
                if(j<rsResources.size()) {
                   r = rsResources.get(j);
                }
                TreeResult treeVO = new TreeResult();
                if(pidList.contains(r.getId()) ){
                    treeVO.setId(r.getId());
                    treeVO.setPid(r.getCategory());
                    pidList1.add(r.getCategory());
                    treeVO.setText(r.getName());
                    treeVO.setType("2");
                    treeVO.setIcon("../develop/lib/ligerui/skins/Aqua/images/tree/tree-leaf.gif");
                    treeVOs.add(treeVO);
                    rsResources.remove(r);
                    j--;
                }
                else if(idList.contains(r.getCategory())){
                    treeVO.setId(r.getId());
                    treeVO.setPid(r.getCategory());
                    idList1.add(r.getId());
                    treeVO.setText(r.getName());
                    treeVO.setType("2");
                    treeVO.setIcon("../develop/lib/ligerui/skins/Aqua/images/tree/tree-leaf.gif");
                    treeVOs.add(treeVO);
                    rsResources.remove(r);
                    j--;
                }
                else if(pidList.contains(r1.getId())){
                    treeVO.setId(r1.getId());
                    treeVO.setPid(r1.getPid());
                    pidList1.add(r1.getPid());
                    treeVO.setText(r1.getName());
                    treeVO.setType("1");
                    treeVO.setIcon("../develop/lib/ligerui/skins/Aqua/images/tree/folder.gif");
                    treeVOs.add(treeVO);
                    rsCategorya.remove(r1);
                    i--;
                }
                else if( idList.contains(r1.getPid())){
                    treeVO.setId(r1.getId());
                    treeVO.setPid(r1.getPid());
                    idList1.add(r1.getId());
                    treeVO.setText(r1.getName());
                    treeVO.setType("1");
                    treeVO.setIcon("../develop/lib/ligerui/skins/Aqua/images/tree/folder.gif");
                    treeVOs.add(treeVO);
                    rsCategorya.remove(r1);
                    i--;
                }
            }
            pidList.clear();
            idList.clear();
            pidList.addAll(pidList1);
            idList.addAll(idList1);
            pidList1.clear();
            idList1.clear();
        }
        return treeVOs;
    }
@ -158,8 +328,11 @@ public class RsResourceServiceImpl implements IRsResourceService {
    public String searchRomoteResourceList(String code, Map<String, Object> params) throws Exception {
        String result = HttpHelper.getByGateway(code, params).getBody();
        JSONObject jsonobject = JSONObject.fromObject(result);
        String response_params = (String) jsonobject.get("responseResult");
        return response_params;
        Object response_params = jsonobject.get("responseResult");
        if (response_params.equals("null")) {
            return "";
        }
        return (String) response_params;
    }
    @Override

+ 2 - 2
Hos-resource/src/main/resources/config/http.properties

@ -1,6 +1,6 @@
httpUrl = https://172.19.103.73:443/api/v1.0
#ÖŇhttps://192.168.131.15:4432/api/v1.0
httpUrl = http://172.19.103.73:1443/api/v1.0
#\uFFFD\uFFFDhttps://192.168.131.15:4432/api/v1.0
  #https://172.19.103.73:443/api/v1.0

+ 5 - 4
Hos-resource/src/main/webapp/WEB-INF/ehr/jsp/datacollect/repeatDatacollectJs.jsp

@ -37,13 +37,13 @@
                selectRowButtonOnly:true,
                height:'100%',
                columns: [
                    {display:'任务名称',name:'jobId', width: '20%',dict:true,dictName:'RS_JOB_CONFIG'},
                    {display:'任务名称',name:'jobId', width: '15%',dict:true,dictName:'RS_JOB_CONFIG'},
                    {display:'数据集名称',name:'jobDatasetName', width: '15%'},
                    {display:'采集开始时间',name:'startTime', width: '15%'},
                    {display:'采集结束时间',name:'endTime', width: '15%'},
                    {display:'采集状态',name:'jobStatus', width: '15%',dict:true,dictName:'JOB_STATUS'},
                    {display:'采集状态',name:'jobStatus', width: '10%',dict:true,dictName:'JOB_STATUS'},
                    {
                        display:'操作',name:'id',width: '20%',render:function(row){
                        display:'操作',name:'id',width: '10%',render:function(row){
                            var html = '<div class="m-inline-buttons" style="width:40px;">';
                        if(row.jobStatus == '0'){
                                html += '<a href="javascript:void(0)" onclick="javascript:repeatDatacollect.repeat(\''+row.id+'\')">补采</a>';
@ -53,7 +53,8 @@
                            return html;
                        }
                    }
                    },
                    {display:'信息',name:'jobContent', width: '20%'},
                ]
            });

+ 10 - 9
Hos-resource/src/main/webapp/WEB-INF/ehr/jsp/datacollect/trackJobJs.jsp

@ -41,18 +41,19 @@
                selectRowButtonOnly:true,
                delayLoad:true,//初始化不加载
                columns: [
                    {display:'采集开始时间',name:'jobStartTime', width: '12%'},
                    {display:'采集结束时间',name:'jobEndTime', width: '12%'},
                    {display:'采集数据集数',name:'jobDatasetCount', width: '12%'},
                    {display:'成功数据集数',name:'jobDatasetSuccess', width: '12%'},
                    {display:'数据总数',name:'count', width: '12%'},
                    {display:'成功数据',name:'success', width: '12%'},
                    {display:'补采数据',name:'repeatNum', width: '12%'},
                    {display:'采集开始时间',name:'jobStartTime', width: '10%'},
                    {display:'采集结束时间',name:'jobEndTime', width: '10%'},
                    {display:'采集数据集数',name:'jobDatasetCount', width: '10%'},
                    {display:'成功数据集数',name:'jobDatasetSuccess', width: '10%'},
                    {display:'数据总数',name:'count', width: '10%'},
                    {display:'成功数据',name:'success', width: '10%'},
                    {display:'补采数据',name:'repeatNum', width: '10%'},
                    {
                        display:'操作',name:'id',width: '16%',render:function(row){
                        display:'操作',name:'id',width: '12%',render:function(row){
                            return '<a href="javascript:void(0)" onclick="javascript:trackJob.repeat()">补采</a>';
                        }
                    }
                    },
                    {display:'信息',name:'jobContent', width: '18%'}
                ],
                onSuccess:function(data)
                {

+ 10 - 4
Hos-resource/src/main/webapp/WEB-INF/ehr/jsp/resource/resourcebrowse/resourceJs.jsp

@ -1,6 +1,7 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="utf-8" %>
<%@include file="/WEB-INF/ehr/commons/jsp/commonInclude.jsp" %>
<script>
    var totalRows = 0;
    var resource = {
        $resourcelayout: null,//layout对象
        $resourcelayoutRight: null,//layout对象
@ -22,7 +23,8 @@
            resource.$searchBox = $("#div_wrapper_left_inp_search").ligerSearch({
                width: 180,onClick: function (value) {
                    if (value != "" && value != null && value != undefined && value.length > 0)
                        $.ligerui.get('ul_tree1').queryByText(value);
                        resource.treeInit(value);
                       //$.ligerui.get('ul_tree1').queryByText(value);
                }
            });
            resource.$condition = $('#resourceCondition').ligerCondition({
@ -65,13 +67,13 @@
                //拼凑表头
                for (var i = 0; i < columns.length; i++) {
                    if (columns[i].columnindex > 1) {
                        field[i - 2] = {key: columns[i].columnname, value: columns[i].display,};
                        field[i - 2] = {key: columns[i].columnname, value: columns[i].display};
                    }
                }
                $.fileDownload("${contextRoot}/resource/exportAllExcel", {
                    httpMethod: 'POST',
                    data: {field: JSON.stringify(field), name: resource.tablename,id: resource.currentSelectID,
                        queryParams: resource.$condition.getValue()},
                        queryParams: resource.$condition.getValue(),rows:totalRows},
                    prepareCallback: function (url) {
                        // intervalCode = setInterval("exportProcess('#exportProcess')", 500);//1000为1秒钟
                    },
@ -113,10 +115,11 @@
            $("#div_wrapper_right .l-layout-center").css({"border": "0px"});
            $("#div_wrapper_right .l-layout-top").css({"border": "0px"});
        },
        treeInit: function () {
        treeInit: function (name) {
            $.ajax({
                type: "POST",
                url: "${contextRoot}/resource/resourceCategoryTreeList",
                data:{name:name},
                success: function (msg) {
                    // 初始化树形菜单
                    $resourceTree = $('#ul_tree1').ligerTree({
@ -159,6 +162,9 @@
                allowAdjustColWidth: true,
                onSuccess: function (msg) {
                    // resource.hideOverlay();
                    if(msg.totalCount != 0) {
                        totalRows = msg.totalCount;
                    }
                }
            });
        },

+ 2 - 0
Hos-resource/src/main/webapp/WEB-INF/ehr/jsp/resource/resourceregister/rsResourceImportDatasetDialogJs.jsp

@ -200,6 +200,8 @@
                    for (var rowid in this.records)
                        this.unselect(rowid);
                    this.select(rowindex);
                },onAfterShowData: function () {
                    this.select(0);
                }
            });

+ 22 - 2
Hos-resource/src/main/webapp/WEB-INF/ehr/jsp/resource/resourceregister/rsResourceManageJs.jsp

@ -37,7 +37,6 @@
            $.ajax({
                type: "POST",
                url: "${contextRoot}/resource/resourceTreeList",
                data: "name=John&location=Boston",
                success: function (msg) {
                    // 初始化树形菜单
                    resourceTree = resourceTree.ligerTree({
@ -61,7 +60,28 @@
            this.$searchTreeBox.ligerSearch({
                width: 180,onClick: function (value) {
                    if (value != "" && value != null && value != undefined && value.length > 0)
                        $.ligerui.get('div_wrapper_left_ul_resourcetree').queryByText(value);
                        $.ajax({
                            type: "POST",
                            url: "${contextRoot}/resource/resourceTreeList",
                            data: {name:value},
                            success: function (msg) {
                                // 初始化树形菜单
                                resourceTree = $('#div_wrapper_left_ul_resourcetree').ligerTree({
                                    data: msg.data,
                                    idFieldName: 'id',
                                    nodeWidth: 200,
                                    parentIDFieldName: 'pid',
                                    isExpand: false,
                                    onClick: function (obj) {
                                        rsResoureManege.reloadGridTree(obj.data.id, rsResoureManege.$searchresourceName.val());
                                        rsResoureManege.$resourceTreeId=obj.data.id;
                                    },
                                    onSuccess: function (data) {
                                    }
                                });
                            }
                        });
                }
            });
            this.$searchresourceName.ligerSearch({onClick:function(value){

+ 19 - 0
Hos-resource/src/main/webapp/develop/lib/ligerui/custom/ligerOverwrite.js

@ -587,6 +587,25 @@
                }
            }
        },
        queryByTextInRe: function (text) {
            var $g = this, p = this.options;
            //先清除颜色
            var nodeText = $("span", $g.tree);
            for (var j = 0; j < nodeText.length;j++) {
                $(nodeText[j]).removeAttr('style');
                $(nodeText[j]).closest("div").removeClass("l-selected");
            }
            for (var i = 0; i < nodeText.length; i++) {
                if ($(nodeText[i]).text().indexOf(text) >= 0) {
                    var id = $(nodeText[i]).closest("li").attr("id");
                    $g.expandNode(id);
                    // $g.selectNode(id);
                    $(nodeText[i]).attr('style','color:#3194d5');
                }
            }
        },
        /**
         * expandNode:根据id打开节点
         * @param id