Переглянути джерело

监管平台数据上报服务

hill9868 5 роки тому
батько
коміт
179ad7a4a6
26 змінених файлів з 4479 додано та 0 видалено
  1. 2 0
      business/base-service/src/main/java/com/yihu/jw/doctor/dao/BaseDoctorHospitalDao.java
  2. 4 0
      business/base-service/src/main/java/com/yihu/jw/doctor/service/BaseDoctorHosService.java
  3. 2 0
      business/base-service/src/main/java/com/yihu/jw/hospital/httplog/dao/WlyyHttpLogDao.java
  4. 13 0
      business/base-service/src/main/java/com/yihu/jw/internet/dao/IntUpErrorLogDao.java
  5. 43 0
      business/base-service/src/main/java/com/yihu/jw/internet/entity/InternetUpErrorLogDO.java
  6. 942 0
      business/base-service/src/main/java/com/yihu/jw/internet/service/InternetService.java
  7. 14 0
      business/base-service/src/main/java/com/yihu/jw/internet/service/InternetUpErrorLogService.java
  8. 127 0
      business/base-service/src/main/java/com/yihu/jw/internet/wsapi/BadPaddingException.java
  9. 191 0
      business/base-service/src/main/java/com/yihu/jw/internet/wsapi/ControllerException.java
  10. 127 0
      business/base-service/src/main/java/com/yihu/jw/internet/wsapi/IllegalBlockSizeException.java
  11. 127 0
      business/base-service/src/main/java/com/yihu/jw/internet/wsapi/InvalidKeyException.java
  12. 127 0
      business/base-service/src/main/java/com/yihu/jw/internet/wsapi/NoSuchAlgorithmException.java
  13. 127 0
      business/base-service/src/main/java/com/yihu/jw/internet/wsapi/NoSuchPaddingException.java
  14. 127 0
      business/base-service/src/main/java/com/yihu/jw/internet/wsapi/UnsupportedEncodingException.java
  15. 8 0
      business/base-service/src/main/java/com/yihu/jw/internet/wsapi/Wsapi.java
  16. 343 0
      business/base-service/src/main/java/com/yihu/jw/internet/wsapi/WsapiPortBindingStub.java
  17. 62 0
      business/base-service/src/main/java/com/yihu/jw/internet/wsapi/WsapiProxy.java
  18. 9 0
      business/base-service/src/main/java/com/yihu/jw/internet/wsapi/WsapiService.java
  19. 135 0
      business/base-service/src/main/java/com/yihu/jw/internet/wsapi/WsapiServiceLocator.java
  20. 4 0
      business/base-service/src/main/java/com/yihu/jw/org/service/BaseOrgInfoService.java
  21. 167 0
      business/base-service/src/main/java/com/yihu/jw/utils/JSONUtils.java
  22. 1440 0
      business/base-service/src/main/java/com/yihu/jw/utils/StringUtil.java
  23. 111 0
      business/base-service/src/main/java/com/yihu/jw/utils/encode/AESUtils.java
  24. 132 0
      business/base-service/src/main/java/com/yihu/jw/utils/encode/Base64.java
  25. 26 0
      business/base-service/src/main/java/com/yihu/jw/utils/encode/HexEncode.java
  26. 69 0
      business/base-service/src/main/java/com/yihu/jw/utils/encode/MD5.java

+ 2 - 0
business/base-service/src/main/java/com/yihu/jw/doctor/dao/BaseDoctorHospitalDao.java

@ -21,6 +21,8 @@ public interface BaseDoctorHospitalDao extends PagingAndSortingRepository<BaseDo
    List<BaseDoctorHospitalDO> findByDoctorCode(String doctorCode);
    List<BaseDoctorHospitalDO> findByOrgCode(String orgCode);
    List<BaseDoctorHospitalDO> findByOrgCodeAndDeptCode(String orgCode,String deptCode);

+ 4 - 0
business/base-service/src/main/java/com/yihu/jw/doctor/service/BaseDoctorHosService.java

@ -18,5 +18,9 @@ public class BaseDoctorHosService extends BaseJpaService<BaseDoctorHospitalDO, B
        return baseDoctorHospitalDao.findByOrgCodeAndDeptCode(orgCode,deptCode);
    }
    public List<BaseDoctorHospitalDO> getDoctorByOrg(String orgCode) {
        return baseDoctorHospitalDao.findByOrgCode(orgCode);
    }
}

+ 2 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/httplog/dao/WlyyHttpLogDao.java

@ -9,4 +9,6 @@ import org.springframework.data.repository.PagingAndSortingRepository;
 */
public interface WlyyHttpLogDao extends PagingAndSortingRepository<WlyyHttpLogDO, String>, JpaSpecificationExecutor<WlyyHttpLogDO> {
}

+ 13 - 0
business/base-service/src/main/java/com/yihu/jw/internet/dao/IntUpErrorLogDao.java

@ -0,0 +1,13 @@
package com.yihu.jw.internet.dao;
import com.yihu.jw.internet.entity.InternetUpErrorLogDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * Created by cws on 2019/5/23.
 */
public interface IntUpErrorLogDao extends PagingAndSortingRepository<InternetUpErrorLogDO, String>, JpaSpecificationExecutor<InternetUpErrorLogDO> {
}

+ 43 - 0
business/base-service/src/main/java/com/yihu/jw/internet/entity/InternetUpErrorLogDO.java

@ -0,0 +1,43 @@
package com.yihu.jw.internet.entity;
import com.yihu.jw.entity.UuidIdentityEntityWithOperator;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;
@Entity
@Table(name = "internet_up_error_log")
public class InternetUpErrorLogDO extends UuidIdentityEntityWithOperator implements Serializable {
    private String type;       // 上传数据类型, 5预约 7医生评估 8网络咨询10处方 11处方药品',
    private String keyId;      // 各类型关键字ID值用于补传,唯一定位要上传的数据行',
    private String errorInfo ;// 上传失败回参
    @Column(name = "type")
    public String getType() {
        return type;
    }
    public void setType(String type) {
        this.type = type;
    }
    @Column(name = "key_id")
    public String getKeyId() {
        return keyId;
    }
    public void setKeyId(String keyId) {
        this.keyId = keyId;
    }
    @Column(name = "error_info")
    public String getErrorInfo() {
        return errorInfo;
    }
    public void setErrorInfo(String errorInfo) {
        this.errorInfo = errorInfo;
    }
}

Різницю між файлами не показано, бо вона завелика
+ 942 - 0
business/base-service/src/main/java/com/yihu/jw/internet/service/InternetService.java


+ 14 - 0
business/base-service/src/main/java/com/yihu/jw/internet/service/InternetUpErrorLogService.java

@ -0,0 +1,14 @@
package com.yihu.jw.internet.service;
import com.yihu.jw.internet.dao.IntUpErrorLogDao;
import com.yihu.jw.internet.entity.InternetUpErrorLogDO;
import com.yihu.mysql.query.BaseJpaService;
import org.springframework.stereotype.Service;
@Service
public class InternetUpErrorLogService extends BaseJpaService<InternetUpErrorLogDO, IntUpErrorLogDao> {
}

+ 127 - 0
business/base-service/src/main/java/com/yihu/jw/internet/wsapi/BadPaddingException.java

@ -0,0 +1,127 @@
/**
 * BadPaddingException.java
 *
 * This file was auto-generated from WSDL
 * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.
 */
package com.yihu.jw.internet.wsapi;
public class BadPaddingException  extends org.apache.axis.AxisFault  implements java.io.Serializable {
    private String message1;
    public BadPaddingException() {
    }
    public BadPaddingException(
           String message1) {
        this.message1 = message1;
    }
    /**
     * Gets the message1 value for this BadPaddingException.
     *
     * @return message1
     */
    public String getMessage1() {
        return message1;
    }
    /**
     * Sets the message1 value for this BadPaddingException.
     *
     * @param message1
     */
    public void setMessage1(String message1) {
        this.message1 = message1;
    }
    private Object __equalsCalc = null;
    public synchronized boolean equals(Object obj) {
        if (!(obj instanceof BadPaddingException)) return false;
        BadPaddingException other = (BadPaddingException) obj;
        if (obj == null) return false;
        if (this == obj) return true;
        if (__equalsCalc != null) {
            return (__equalsCalc == obj);
        }
        __equalsCalc = obj;
        boolean _equals;
        _equals = true &&
            ((this.message1==null && other.getMessage1()==null) ||
             (this.message1!=null &&
              this.message1.equals(other.getMessage1())));
        __equalsCalc = null;
        return _equals;
    }
    private boolean __hashCodeCalc = false;
    public synchronized int hashCode() {
        if (__hashCodeCalc) {
            return 0;
        }
        __hashCodeCalc = true;
        int _hashCode = 1;
        if (getMessage1() != null) {
            _hashCode += getMessage1().hashCode();
        }
        __hashCodeCalc = false;
        return _hashCode;
    }
    // Type metadata
    private static org.apache.axis.description.TypeDesc typeDesc =
        new org.apache.axis.description.TypeDesc(BadPaddingException.class, true);
    static {
        typeDesc.setXmlType(new javax.xml.namespace.QName("http://entry.ws.ctd/", "BadPaddingException"));
        org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("message1");
        elemField.setXmlName(new javax.xml.namespace.QName("", "message"));
        elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
        elemField.setMinOccurs(0);
        elemField.setNillable(false);
        typeDesc.addFieldDesc(elemField);
    }
    /**
     * Return type metadata object
     */
    public static org.apache.axis.description.TypeDesc getTypeDesc() {
        return typeDesc;
    }
    /**
     * Get Custom Serializer
     */
    public static org.apache.axis.encoding.Serializer getSerializer(
           String mechType,
           Class _javaType,
           javax.xml.namespace.QName _xmlType) {
        return
          new  org.apache.axis.encoding.ser.BeanSerializer(
            _javaType, _xmlType, typeDesc);
    }
    /**
     * Get Custom Deserializer
     */
    public static org.apache.axis.encoding.Deserializer getDeserializer(
           String mechType,
           Class _javaType,
           javax.xml.namespace.QName _xmlType) {
        return 
          new  org.apache.axis.encoding.ser.BeanDeserializer(
            _javaType, _xmlType, typeDesc);
    }
    /**
     * Writes the exception data to the faultDetails
     */
    public void writeDetails(javax.xml.namespace.QName qname, org.apache.axis.encoding.SerializationContext context) throws java.io.IOException {
        context.serialize(qname, null, this);
    }
}

+ 191 - 0
business/base-service/src/main/java/com/yihu/jw/internet/wsapi/ControllerException.java

@ -0,0 +1,191 @@
/**
 * ControllerException.java
 *
 * This file was auto-generated from WSDL
 * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.
 */
package com.yihu.jw.internet.wsapi;
public class ControllerException  extends org.apache.axis.AxisFault  implements java.io.Serializable {
    private int code;
    private boolean instanceNotFound;
    private String message1;
    public ControllerException() {
    }
    public ControllerException(
           int code,
           boolean instanceNotFound,
           String message1) {
        this.code = code;
        this.instanceNotFound = instanceNotFound;
        this.message1 = message1;
    }
    /**
     * Gets the code value for this ControllerException.
     *
     * @return code
     */
    public int getCode() {
        return code;
    }
    /**
     * Sets the code value for this ControllerException.
     *
     * @param code
     */
    public void setCode(int code) {
        this.code = code;
    }
    /**
     * Gets the instanceNotFound value for this ControllerException.
     *
     * @return instanceNotFound
     */
    public boolean isInstanceNotFound() {
        return instanceNotFound;
    }
    /**
     * Sets the instanceNotFound value for this ControllerException.
     *
     * @param instanceNotFound
     */
    public void setInstanceNotFound(boolean instanceNotFound) {
        this.instanceNotFound = instanceNotFound;
    }
    /**
     * Gets the message1 value for this ControllerException.
     *
     * @return message1
     */
    public String getMessage1() {
        return message1;
    }
    /**
     * Sets the message1 value for this ControllerException.
     *
     * @param message1
     */
    public void setMessage1(String message1) {
        this.message1 = message1;
    }
    private Object __equalsCalc = null;
    public synchronized boolean equals(Object obj) {
        if (!(obj instanceof ControllerException)) return false;
        ControllerException other = (ControllerException) obj;
        if (obj == null) return false;
        if (this == obj) return true;
        if (__equalsCalc != null) {
            return (__equalsCalc == obj);
        }
        __equalsCalc = obj;
        boolean _equals;
        _equals = true &&
            this.code == other.getCode() &&
            this.instanceNotFound == other.isInstanceNotFound() &&
            ((this.message1==null && other.getMessage1()==null) ||
             (this.message1!=null &&
              this.message1.equals(other.getMessage1())));
        __equalsCalc = null;
        return _equals;
    }
    private boolean __hashCodeCalc = false;
    public synchronized int hashCode() {
        if (__hashCodeCalc) {
            return 0;
        }
        __hashCodeCalc = true;
        int _hashCode = 1;
        _hashCode += getCode();
        _hashCode += (isInstanceNotFound() ? Boolean.TRUE : Boolean.FALSE).hashCode();
        if (getMessage1() != null) {
            _hashCode += getMessage1().hashCode();
        }
        __hashCodeCalc = false;
        return _hashCode;
    }
    // Type metadata
    private static org.apache.axis.description.TypeDesc typeDesc =
        new org.apache.axis.description.TypeDesc(ControllerException.class, true);
    static {
        typeDesc.setXmlType(new javax.xml.namespace.QName("http://entry.ws.ctd/", "ControllerException"));
        org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("code");
        elemField.setXmlName(new javax.xml.namespace.QName("", "code"));
        elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "int"));
        elemField.setNillable(false);
        typeDesc.addFieldDesc(elemField);
        elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("instanceNotFound");
        elemField.setXmlName(new javax.xml.namespace.QName("", "instanceNotFound"));
        elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "boolean"));
        elemField.setNillable(false);
        typeDesc.addFieldDesc(elemField);
        elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("message1");
        elemField.setXmlName(new javax.xml.namespace.QName("", "message"));
        elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
        elemField.setMinOccurs(0);
        elemField.setNillable(false);
        typeDesc.addFieldDesc(elemField);
    }
    /**
     * Return type metadata object
     */
    public static org.apache.axis.description.TypeDesc getTypeDesc() {
        return typeDesc;
    }
    /**
     * Get Custom Serializer
     */
    public static org.apache.axis.encoding.Serializer getSerializer(
           String mechType,
           Class _javaType,
           javax.xml.namespace.QName _xmlType) {
        return
          new  org.apache.axis.encoding.ser.BeanSerializer(
            _javaType, _xmlType, typeDesc);
    }
    /**
     * Get Custom Deserializer
     */
    public static org.apache.axis.encoding.Deserializer getDeserializer(
           String mechType,
           Class _javaType,
           javax.xml.namespace.QName _xmlType) {
        return 
          new  org.apache.axis.encoding.ser.BeanDeserializer(
            _javaType, _xmlType, typeDesc);
    }
    /**
     * Writes the exception data to the faultDetails
     */
    public void writeDetails(javax.xml.namespace.QName qname, org.apache.axis.encoding.SerializationContext context) throws java.io.IOException {
        context.serialize(qname, null, this);
    }
}

+ 127 - 0
business/base-service/src/main/java/com/yihu/jw/internet/wsapi/IllegalBlockSizeException.java

@ -0,0 +1,127 @@
/**
 * IllegalBlockSizeException.java
 *
 * This file was auto-generated from WSDL
 * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.
 */
package com.yihu.jw.internet.wsapi;
public class IllegalBlockSizeException  extends org.apache.axis.AxisFault  implements java.io.Serializable {
    private String message1;
    public IllegalBlockSizeException() {
    }
    public IllegalBlockSizeException(
           String message1) {
        this.message1 = message1;
    }
    /**
     * Gets the message1 value for this IllegalBlockSizeException.
     *
     * @return message1
     */
    public String getMessage1() {
        return message1;
    }
    /**
     * Sets the message1 value for this IllegalBlockSizeException.
     *
     * @param message1
     */
    public void setMessage1(String message1) {
        this.message1 = message1;
    }
    private Object __equalsCalc = null;
    public synchronized boolean equals(Object obj) {
        if (!(obj instanceof IllegalBlockSizeException)) return false;
        IllegalBlockSizeException other = (IllegalBlockSizeException) obj;
        if (obj == null) return false;
        if (this == obj) return true;
        if (__equalsCalc != null) {
            return (__equalsCalc == obj);
        }
        __equalsCalc = obj;
        boolean _equals;
        _equals = true &&
            ((this.message1==null && other.getMessage1()==null) ||
             (this.message1!=null &&
              this.message1.equals(other.getMessage1())));
        __equalsCalc = null;
        return _equals;
    }
    private boolean __hashCodeCalc = false;
    public synchronized int hashCode() {
        if (__hashCodeCalc) {
            return 0;
        }
        __hashCodeCalc = true;
        int _hashCode = 1;
        if (getMessage1() != null) {
            _hashCode += getMessage1().hashCode();
        }
        __hashCodeCalc = false;
        return _hashCode;
    }
    // Type metadata
    private static org.apache.axis.description.TypeDesc typeDesc =
        new org.apache.axis.description.TypeDesc(IllegalBlockSizeException.class, true);
    static {
        typeDesc.setXmlType(new javax.xml.namespace.QName("http://entry.ws.ctd/", "IllegalBlockSizeException"));
        org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("message1");
        elemField.setXmlName(new javax.xml.namespace.QName("", "message"));
        elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
        elemField.setMinOccurs(0);
        elemField.setNillable(false);
        typeDesc.addFieldDesc(elemField);
    }
    /**
     * Return type metadata object
     */
    public static org.apache.axis.description.TypeDesc getTypeDesc() {
        return typeDesc;
    }
    /**
     * Get Custom Serializer
     */
    public static org.apache.axis.encoding.Serializer getSerializer(
           String mechType,
           Class _javaType,
           javax.xml.namespace.QName _xmlType) {
        return
          new  org.apache.axis.encoding.ser.BeanSerializer(
            _javaType, _xmlType, typeDesc);
    }
    /**
     * Get Custom Deserializer
     */
    public static org.apache.axis.encoding.Deserializer getDeserializer(
           String mechType,
           Class _javaType,
           javax.xml.namespace.QName _xmlType) {
        return 
          new  org.apache.axis.encoding.ser.BeanDeserializer(
            _javaType, _xmlType, typeDesc);
    }
    /**
     * Writes the exception data to the faultDetails
     */
    public void writeDetails(javax.xml.namespace.QName qname, org.apache.axis.encoding.SerializationContext context) throws java.io.IOException {
        context.serialize(qname, null, this);
    }
}

+ 127 - 0
business/base-service/src/main/java/com/yihu/jw/internet/wsapi/InvalidKeyException.java

@ -0,0 +1,127 @@
/**
 * InvalidKeyException.java
 *
 * This file was auto-generated from WSDL
 * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.
 */
package com.yihu.jw.internet.wsapi;
public class InvalidKeyException  extends org.apache.axis.AxisFault  implements java.io.Serializable {
    private String message1;
    public InvalidKeyException() {
    }
    public InvalidKeyException(
           String message1) {
        this.message1 = message1;
    }
    /**
     * Gets the message1 value for this InvalidKeyException.
     *
     * @return message1
     */
    public String getMessage1() {
        return message1;
    }
    /**
     * Sets the message1 value for this InvalidKeyException.
     *
     * @param message1
     */
    public void setMessage1(String message1) {
        this.message1 = message1;
    }
    private Object __equalsCalc = null;
    public synchronized boolean equals(Object obj) {
        if (!(obj instanceof InvalidKeyException)) return false;
        InvalidKeyException other = (InvalidKeyException) obj;
        if (obj == null) return false;
        if (this == obj) return true;
        if (__equalsCalc != null) {
            return (__equalsCalc == obj);
        }
        __equalsCalc = obj;
        boolean _equals;
        _equals = true &&
            ((this.message1==null && other.getMessage1()==null) ||
             (this.message1!=null &&
              this.message1.equals(other.getMessage1())));
        __equalsCalc = null;
        return _equals;
    }
    private boolean __hashCodeCalc = false;
    public synchronized int hashCode() {
        if (__hashCodeCalc) {
            return 0;
        }
        __hashCodeCalc = true;
        int _hashCode = 1;
        if (getMessage1() != null) {
            _hashCode += getMessage1().hashCode();
        }
        __hashCodeCalc = false;
        return _hashCode;
    }
    // Type metadata
    private static org.apache.axis.description.TypeDesc typeDesc =
        new org.apache.axis.description.TypeDesc(InvalidKeyException.class, true);
    static {
        typeDesc.setXmlType(new javax.xml.namespace.QName("http://entry.ws.ctd/", "InvalidKeyException"));
        org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("message1");
        elemField.setXmlName(new javax.xml.namespace.QName("", "message"));
        elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
        elemField.setMinOccurs(0);
        elemField.setNillable(false);
        typeDesc.addFieldDesc(elemField);
    }
    /**
     * Return type metadata object
     */
    public static org.apache.axis.description.TypeDesc getTypeDesc() {
        return typeDesc;
    }
    /**
     * Get Custom Serializer
     */
    public static org.apache.axis.encoding.Serializer getSerializer(
           String mechType,
           Class _javaType,
           javax.xml.namespace.QName _xmlType) {
        return
          new  org.apache.axis.encoding.ser.BeanSerializer(
            _javaType, _xmlType, typeDesc);
    }
    /**
     * Get Custom Deserializer
     */
    public static org.apache.axis.encoding.Deserializer getDeserializer(
           String mechType,
           Class _javaType,
           javax.xml.namespace.QName _xmlType) {
        return 
          new  org.apache.axis.encoding.ser.BeanDeserializer(
            _javaType, _xmlType, typeDesc);
    }
    /**
     * Writes the exception data to the faultDetails
     */
    public void writeDetails(javax.xml.namespace.QName qname, org.apache.axis.encoding.SerializationContext context) throws java.io.IOException {
        context.serialize(qname, null, this);
    }
}

+ 127 - 0
business/base-service/src/main/java/com/yihu/jw/internet/wsapi/NoSuchAlgorithmException.java

@ -0,0 +1,127 @@
/**
 * NoSuchAlgorithmException.java
 *
 * This file was auto-generated from WSDL
 * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.
 */
package com.yihu.jw.internet.wsapi;
public class NoSuchAlgorithmException  extends org.apache.axis.AxisFault  implements java.io.Serializable {
    private String message1;
    public NoSuchAlgorithmException() {
    }
    public NoSuchAlgorithmException(
           String message1) {
        this.message1 = message1;
    }
    /**
     * Gets the message1 value for this NoSuchAlgorithmException.
     *
     * @return message1
     */
    public String getMessage1() {
        return message1;
    }
    /**
     * Sets the message1 value for this NoSuchAlgorithmException.
     *
     * @param message1
     */
    public void setMessage1(String message1) {
        this.message1 = message1;
    }
    private Object __equalsCalc = null;
    public synchronized boolean equals(Object obj) {
        if (!(obj instanceof NoSuchAlgorithmException)) return false;
        NoSuchAlgorithmException other = (NoSuchAlgorithmException) obj;
        if (obj == null) return false;
        if (this == obj) return true;
        if (__equalsCalc != null) {
            return (__equalsCalc == obj);
        }
        __equalsCalc = obj;
        boolean _equals;
        _equals = true &&
            ((this.message1==null && other.getMessage1()==null) ||
             (this.message1!=null &&
              this.message1.equals(other.getMessage1())));
        __equalsCalc = null;
        return _equals;
    }
    private boolean __hashCodeCalc = false;
    public synchronized int hashCode() {
        if (__hashCodeCalc) {
            return 0;
        }
        __hashCodeCalc = true;
        int _hashCode = 1;
        if (getMessage1() != null) {
            _hashCode += getMessage1().hashCode();
        }
        __hashCodeCalc = false;
        return _hashCode;
    }
    // Type metadata
    private static org.apache.axis.description.TypeDesc typeDesc =
        new org.apache.axis.description.TypeDesc(NoSuchAlgorithmException.class, true);
    static {
        typeDesc.setXmlType(new javax.xml.namespace.QName("http://entry.ws.ctd/", "NoSuchAlgorithmException"));
        org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("message1");
        elemField.setXmlName(new javax.xml.namespace.QName("", "message"));
        elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
        elemField.setMinOccurs(0);
        elemField.setNillable(false);
        typeDesc.addFieldDesc(elemField);
    }
    /**
     * Return type metadata object
     */
    public static org.apache.axis.description.TypeDesc getTypeDesc() {
        return typeDesc;
    }
    /**
     * Get Custom Serializer
     */
    public static org.apache.axis.encoding.Serializer getSerializer(
           String mechType,
           Class _javaType,
           javax.xml.namespace.QName _xmlType) {
        return
          new  org.apache.axis.encoding.ser.BeanSerializer(
            _javaType, _xmlType, typeDesc);
    }
    /**
     * Get Custom Deserializer
     */
    public static org.apache.axis.encoding.Deserializer getDeserializer(
           String mechType,
           Class _javaType,
           javax.xml.namespace.QName _xmlType) {
        return 
          new  org.apache.axis.encoding.ser.BeanDeserializer(
            _javaType, _xmlType, typeDesc);
    }
    /**
     * Writes the exception data to the faultDetails
     */
    public void writeDetails(javax.xml.namespace.QName qname, org.apache.axis.encoding.SerializationContext context) throws java.io.IOException {
        context.serialize(qname, null, this);
    }
}

+ 127 - 0
business/base-service/src/main/java/com/yihu/jw/internet/wsapi/NoSuchPaddingException.java

@ -0,0 +1,127 @@
/**
 * NoSuchPaddingException.java
 *
 * This file was auto-generated from WSDL
 * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.
 */
package com.yihu.jw.internet.wsapi;
public class NoSuchPaddingException  extends org.apache.axis.AxisFault  implements java.io.Serializable {
    private String message1;
    public NoSuchPaddingException() {
    }
    public NoSuchPaddingException(
           String message1) {
        this.message1 = message1;
    }
    /**
     * Gets the message1 value for this NoSuchPaddingException.
     *
     * @return message1
     */
    public String getMessage1() {
        return message1;
    }
    /**
     * Sets the message1 value for this NoSuchPaddingException.
     *
     * @param message1
     */
    public void setMessage1(String message1) {
        this.message1 = message1;
    }
    private Object __equalsCalc = null;
    public synchronized boolean equals(Object obj) {
        if (!(obj instanceof NoSuchPaddingException)) return false;
        NoSuchPaddingException other = (NoSuchPaddingException) obj;
        if (obj == null) return false;
        if (this == obj) return true;
        if (__equalsCalc != null) {
            return (__equalsCalc == obj);
        }
        __equalsCalc = obj;
        boolean _equals;
        _equals = true &&
            ((this.message1==null && other.getMessage1()==null) ||
             (this.message1!=null &&
              this.message1.equals(other.getMessage1())));
        __equalsCalc = null;
        return _equals;
    }
    private boolean __hashCodeCalc = false;
    public synchronized int hashCode() {
        if (__hashCodeCalc) {
            return 0;
        }
        __hashCodeCalc = true;
        int _hashCode = 1;
        if (getMessage1() != null) {
            _hashCode += getMessage1().hashCode();
        }
        __hashCodeCalc = false;
        return _hashCode;
    }
    // Type metadata
    private static org.apache.axis.description.TypeDesc typeDesc =
        new org.apache.axis.description.TypeDesc(NoSuchPaddingException.class, true);
    static {
        typeDesc.setXmlType(new javax.xml.namespace.QName("http://entry.ws.ctd/", "NoSuchPaddingException"));
        org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("message1");
        elemField.setXmlName(new javax.xml.namespace.QName("", "message"));
        elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
        elemField.setMinOccurs(0);
        elemField.setNillable(false);
        typeDesc.addFieldDesc(elemField);
    }
    /**
     * Return type metadata object
     */
    public static org.apache.axis.description.TypeDesc getTypeDesc() {
        return typeDesc;
    }
    /**
     * Get Custom Serializer
     */
    public static org.apache.axis.encoding.Serializer getSerializer(
           String mechType,
           Class _javaType,
           javax.xml.namespace.QName _xmlType) {
        return
          new  org.apache.axis.encoding.ser.BeanSerializer(
            _javaType, _xmlType, typeDesc);
    }
    /**
     * Get Custom Deserializer
     */
    public static org.apache.axis.encoding.Deserializer getDeserializer(
           String mechType,
           Class _javaType,
           javax.xml.namespace.QName _xmlType) {
        return 
          new  org.apache.axis.encoding.ser.BeanDeserializer(
            _javaType, _xmlType, typeDesc);
    }
    /**
     * Writes the exception data to the faultDetails
     */
    public void writeDetails(javax.xml.namespace.QName qname, org.apache.axis.encoding.SerializationContext context) throws java.io.IOException {
        context.serialize(qname, null, this);
    }
}

+ 127 - 0
business/base-service/src/main/java/com/yihu/jw/internet/wsapi/UnsupportedEncodingException.java

@ -0,0 +1,127 @@
/**
 * UnsupportedEncodingException.java
 *
 * This file was auto-generated from WSDL
 * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.
 */
package com.yihu.jw.internet.wsapi;
public class UnsupportedEncodingException  extends org.apache.axis.AxisFault  implements java.io.Serializable {
    private String message1;
    public UnsupportedEncodingException() {
    }
    public UnsupportedEncodingException(
           String message1) {
        this.message1 = message1;
    }
    /**
     * Gets the message1 value for this UnsupportedEncodingException.
     *
     * @return message1
     */
    public String getMessage1() {
        return message1;
    }
    /**
     * Sets the message1 value for this UnsupportedEncodingException.
     *
     * @param message1
     */
    public void setMessage1(String message1) {
        this.message1 = message1;
    }
    private Object __equalsCalc = null;
    public synchronized boolean equals(Object obj) {
        if (!(obj instanceof UnsupportedEncodingException)) return false;
        UnsupportedEncodingException other = (UnsupportedEncodingException) obj;
        if (obj == null) return false;
        if (this == obj) return true;
        if (__equalsCalc != null) {
            return (__equalsCalc == obj);
        }
        __equalsCalc = obj;
        boolean _equals;
        _equals = true &&
            ((this.message1==null && other.getMessage1()==null) ||
             (this.message1!=null &&
              this.message1.equals(other.getMessage1())));
        __equalsCalc = null;
        return _equals;
    }
    private boolean __hashCodeCalc = false;
    public synchronized int hashCode() {
        if (__hashCodeCalc) {
            return 0;
        }
        __hashCodeCalc = true;
        int _hashCode = 1;
        if (getMessage1() != null) {
            _hashCode += getMessage1().hashCode();
        }
        __hashCodeCalc = false;
        return _hashCode;
    }
    // Type metadata
    private static org.apache.axis.description.TypeDesc typeDesc =
        new org.apache.axis.description.TypeDesc(UnsupportedEncodingException.class, true);
    static {
        typeDesc.setXmlType(new javax.xml.namespace.QName("http://entry.ws.ctd/", "UnsupportedEncodingException"));
        org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("message1");
        elemField.setXmlName(new javax.xml.namespace.QName("", "message"));
        elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
        elemField.setMinOccurs(0);
        elemField.setNillable(false);
        typeDesc.addFieldDesc(elemField);
    }
    /**
     * Return type metadata object
     */
    public static org.apache.axis.description.TypeDesc getTypeDesc() {
        return typeDesc;
    }
    /**
     * Get Custom Serializer
     */
    public static org.apache.axis.encoding.Serializer getSerializer(
           String mechType,
           Class _javaType,
           javax.xml.namespace.QName _xmlType) {
        return
          new  org.apache.axis.encoding.ser.BeanSerializer(
            _javaType, _xmlType, typeDesc);
    }
    /**
     * Get Custom Deserializer
     */
    public static org.apache.axis.encoding.Deserializer getDeserializer(
           String mechType,
           Class _javaType,
           javax.xml.namespace.QName _xmlType) {
        return 
          new  org.apache.axis.encoding.ser.BeanDeserializer(
            _javaType, _xmlType, typeDesc);
    }
    /**
     * Writes the exception data to the faultDetails
     */
    public void writeDetails(javax.xml.namespace.QName qname, org.apache.axis.encoding.SerializationContext context) throws java.io.IOException {
        context.serialize(qname, null, this);
    }
}

+ 8 - 0
business/base-service/src/main/java/com/yihu/jw/internet/wsapi/Wsapi.java

@ -0,0 +1,8 @@
package com.yihu.jw.internet.wsapi;
import java.rmi.Remote;
public interface Wsapi extends Remote {
    public String invoke(String arg0, String arg1, String arg2, String arg3, String arg4) throws java.rmi.RemoteException;
    public boolean vaildTokenPass(String arg0, String arg1) throws java.rmi.RemoteException, ControllerException, NoSuchPaddingException, UnsupportedEncodingException, IllegalBlockSizeException, BadPaddingException, NoSuchAlgorithmException, InvalidKeyException;
}

+ 343 - 0
business/base-service/src/main/java/com/yihu/jw/internet/wsapi/WsapiPortBindingStub.java

@ -0,0 +1,343 @@
package com.yihu.jw.internet.wsapi;
public class WsapiPortBindingStub extends org.apache.axis.client.Stub implements Wsapi {
    private java.util.Vector cachedSerClasses = new java.util.Vector();
    private java.util.Vector cachedSerQNames = new java.util.Vector();
    private java.util.Vector cachedSerFactories = new java.util.Vector();
    private java.util.Vector cachedDeserFactories = new java.util.Vector();
    static org.apache.axis.description.OperationDesc [] _operations;
    static {
        _operations = new org.apache.axis.description.OperationDesc[2];
        _initOperationDesc1();
    }
    private static void _initOperationDesc1(){
        org.apache.axis.description.OperationDesc oper;
        org.apache.axis.description.ParameterDesc param;
        oper = new org.apache.axis.description.OperationDesc();
        oper.setName("invoke");
        param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "arg0"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), String.class, false, false);
        oper.addParameter(param);
        param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "arg1"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), String.class, false, false);
        oper.addParameter(param);
        param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "arg2"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), String.class, false, false);
        oper.addParameter(param);
        param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "arg3"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), String.class, false, false);
        oper.addParameter(param);
        param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "arg4"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://jaxb.dev.java.net/array", "stringArray"), String[].class, false, false);
        param.setItemQName(new javax.xml.namespace.QName("", "item"));
        oper.addParameter(param);
        oper.setReturnType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
        oper.setReturnClass(String.class);
        oper.setReturnQName(new javax.xml.namespace.QName("", "return"));
        oper.setStyle(org.apache.axis.constants.Style.RPC);
        oper.setUse(org.apache.axis.constants.Use.LITERAL);
        _operations[0] = oper;
        oper = new org.apache.axis.description.OperationDesc();
        oper.setName("VaildTokenPass");
        param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "arg0"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), String.class, false, false);
        oper.addParameter(param);
        param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "arg1"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), String.class, false, false);
        oper.addParameter(param);
        oper.setReturnType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "boolean"));
        oper.setReturnClass(boolean.class);
        oper.setReturnQName(new javax.xml.namespace.QName("", "return"));
        oper.setStyle(org.apache.axis.constants.Style.RPC);
        oper.setUse(org.apache.axis.constants.Use.LITERAL);
        oper.addFault(new org.apache.axis.description.FaultDesc(
                      new javax.xml.namespace.QName("http://entry.ws.ctd/", "ControllerException"),
                      "ctd.ws.entry.ControllerException",
                      new javax.xml.namespace.QName("http://entry.ws.ctd/", "ControllerException"),
                      true
                     ));
        oper.addFault(new org.apache.axis.description.FaultDesc(
                      new javax.xml.namespace.QName("http://entry.ws.ctd/", "NoSuchPaddingException"),
                      "ctd.ws.entry.NoSuchPaddingException",
                      new javax.xml.namespace.QName("http://entry.ws.ctd/", "NoSuchPaddingException"),
                      true
                     ));
        oper.addFault(new org.apache.axis.description.FaultDesc(
                      new javax.xml.namespace.QName("http://entry.ws.ctd/", "UnsupportedEncodingException"),
                      "ctd.ws.entry.UnsupportedEncodingException",
                      new javax.xml.namespace.QName("http://entry.ws.ctd/", "UnsupportedEncodingException"),
                      true
                     ));
        oper.addFault(new org.apache.axis.description.FaultDesc(
                      new javax.xml.namespace.QName("http://entry.ws.ctd/", "IllegalBlockSizeException"),
                      "ctd.ws.entry.IllegalBlockSizeException",
                      new javax.xml.namespace.QName("http://entry.ws.ctd/", "IllegalBlockSizeException"),
                      true
                     ));
        oper.addFault(new org.apache.axis.description.FaultDesc(
                      new javax.xml.namespace.QName("http://entry.ws.ctd/", "BadPaddingException"),
                      "ctd.ws.entry.BadPaddingException",
                      new javax.xml.namespace.QName("http://entry.ws.ctd/", "BadPaddingException"),
                      true
                     ));
        oper.addFault(new org.apache.axis.description.FaultDesc(
                      new javax.xml.namespace.QName("http://entry.ws.ctd/", "NoSuchAlgorithmException"),
                      "ctd.ws.entry.NoSuchAlgorithmException",
                      new javax.xml.namespace.QName("http://entry.ws.ctd/", "NoSuchAlgorithmException"),
                      true
                     ));
        oper.addFault(new org.apache.axis.description.FaultDesc(
                      new javax.xml.namespace.QName("http://entry.ws.ctd/", "InvalidKeyException"),
                      "ctd.ws.entry.InvalidKeyException",
                      new javax.xml.namespace.QName("http://entry.ws.ctd/", "InvalidKeyException"),
                      true
                     ));
        _operations[1] = oper;
    }
    public WsapiPortBindingStub() throws org.apache.axis.AxisFault {
         this(null);
    }
    public WsapiPortBindingStub(java.net.URL endpointURL, javax.xml.rpc.Service service) throws org.apache.axis.AxisFault {
         this(service);
         super.cachedEndpoint = endpointURL;
    }
    public WsapiPortBindingStub(javax.xml.rpc.Service service) throws org.apache.axis.AxisFault {
        if (service == null) {
            super.service = new org.apache.axis.client.Service();
        } else {
            super.service = service;
        }
        ((org.apache.axis.client.Service)super.service).setTypeMappingVersion("1.2");
            Class cls;
            javax.xml.namespace.QName qName;
            javax.xml.namespace.QName qName2;
            Class beansf = org.apache.axis.encoding.ser.BeanSerializerFactory.class;
            Class beandf = org.apache.axis.encoding.ser.BeanDeserializerFactory.class;
            Class enumsf = org.apache.axis.encoding.ser.EnumSerializerFactory.class;
            Class enumdf = org.apache.axis.encoding.ser.EnumDeserializerFactory.class;
            Class arraysf = org.apache.axis.encoding.ser.ArraySerializerFactory.class;
            Class arraydf = org.apache.axis.encoding.ser.ArrayDeserializerFactory.class;
            Class simplesf = org.apache.axis.encoding.ser.SimpleSerializerFactory.class;
            Class simpledf = org.apache.axis.encoding.ser.SimpleDeserializerFactory.class;
            Class simplelistsf = org.apache.axis.encoding.ser.SimpleListSerializerFactory.class;
            Class simplelistdf = org.apache.axis.encoding.ser.SimpleListDeserializerFactory.class;
            qName = new javax.xml.namespace.QName("http://entry.ws.ctd/", "BadPaddingException");
            cachedSerQNames.add(qName);
            cls = BadPaddingException.class;
            cachedSerClasses.add(cls);
            cachedSerFactories.add(beansf);
            cachedDeserFactories.add(beandf);
            qName = new javax.xml.namespace.QName("http://entry.ws.ctd/", "ControllerException");
            cachedSerQNames.add(qName);
            cls = ControllerException.class;
            cachedSerClasses.add(cls);
            cachedSerFactories.add(beansf);
            cachedDeserFactories.add(beandf);
            qName = new javax.xml.namespace.QName("http://entry.ws.ctd/", "IllegalBlockSizeException");
            cachedSerQNames.add(qName);
            cls = IllegalBlockSizeException.class;
            cachedSerClasses.add(cls);
            cachedSerFactories.add(beansf);
            cachedDeserFactories.add(beandf);
            qName = new javax.xml.namespace.QName("http://entry.ws.ctd/", "InvalidKeyException");
            cachedSerQNames.add(qName);
            cls = InvalidKeyException.class;
            cachedSerClasses.add(cls);
            cachedSerFactories.add(beansf);
            cachedDeserFactories.add(beandf);
            qName = new javax.xml.namespace.QName("http://entry.ws.ctd/", "NoSuchAlgorithmException");
            cachedSerQNames.add(qName);
            cls = NoSuchAlgorithmException.class;
            cachedSerClasses.add(cls);
            cachedSerFactories.add(beansf);
            cachedDeserFactories.add(beandf);
            qName = new javax.xml.namespace.QName("http://entry.ws.ctd/", "NoSuchPaddingException");
            cachedSerQNames.add(qName);
            cls = NoSuchPaddingException.class;
            cachedSerClasses.add(cls);
            cachedSerFactories.add(beansf);
            cachedDeserFactories.add(beandf);
            qName = new javax.xml.namespace.QName("http://entry.ws.ctd/", "UnsupportedEncodingException");
            cachedSerQNames.add(qName);
            cls = UnsupportedEncodingException.class;
            cachedSerClasses.add(cls);
            cachedSerFactories.add(beansf);
            cachedDeserFactories.add(beandf);
            qName = new javax.xml.namespace.QName("http://jaxb.dev.java.net/array", "stringArray");
            cachedSerQNames.add(qName);
            cls = String[].class;
            cachedSerClasses.add(cls);
            qName = new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string");
            qName2 = new javax.xml.namespace.QName("", "item");
            cachedSerFactories.add(new org.apache.axis.encoding.ser.ArraySerializerFactory(qName, qName2));
            cachedDeserFactories.add(new org.apache.axis.encoding.ser.ArrayDeserializerFactory());
    }
    protected org.apache.axis.client.Call createCall() throws java.rmi.RemoteException {
        try {
            org.apache.axis.client.Call _call = super._createCall();
            if (super.maintainSessionSet) {
                _call.setMaintainSession(super.maintainSession);
            }
            if (super.cachedUsername != null) {
                _call.setUsername(super.cachedUsername);
            }
            if (super.cachedPassword != null) {
                _call.setPassword(super.cachedPassword);
            }
            if (super.cachedEndpoint != null) {
                _call.setTargetEndpointAddress(super.cachedEndpoint);
            }
            if (super.cachedTimeout != null) {
                _call.setTimeout(super.cachedTimeout);
            }
            if (super.cachedPortName != null) {
                _call.setPortName(super.cachedPortName);
            }
            java.util.Enumeration keys = super.cachedProperties.keys();
            while (keys.hasMoreElements()) {
                String key = (String) keys.nextElement();
                _call.setProperty(key, super.cachedProperties.get(key));
            }
            // All the type mapping information is registered
            // when the first call is made.
            // The type mapping information is actually registered in
            // the TypeMappingRegistry of the service, which
            // is the reason why registration is only needed for the first call.
            synchronized (this) {
                if (firstCall()) {
                    // must set encoding style before registering serializers
                    _call.setEncodingStyle(null);
                    for (int i = 0; i < cachedSerFactories.size(); ++i) {
                        Class cls = (Class) cachedSerClasses.get(i);
                        javax.xml.namespace.QName qName =
                                (javax.xml.namespace.QName) cachedSerQNames.get(i);
                        Object x = cachedSerFactories.get(i);
                        if (x instanceof Class) {
                            Class sf = (Class)
                                 cachedSerFactories.get(i);
                            Class df = (Class)
                                 cachedDeserFactories.get(i);
                            _call.registerTypeMapping(cls, qName, sf, df, false);
                        }
                        else if (x instanceof javax.xml.rpc.encoding.SerializerFactory) {
                            org.apache.axis.encoding.SerializerFactory sf = (org.apache.axis.encoding.SerializerFactory)
                                 cachedSerFactories.get(i);
                            org.apache.axis.encoding.DeserializerFactory df = (org.apache.axis.encoding.DeserializerFactory)
                                 cachedDeserFactories.get(i);
                            _call.registerTypeMapping(cls, qName, sf, df, false);
                        }
                    }
                }
            }
            return _call;
        }
        catch (Throwable _t) {
            throw new org.apache.axis.AxisFault("Failure trying to get the Call object", _t);
        }
    }
    public String invoke(String arg0, String arg1, String arg2, String arg3, String arg4) throws java.rmi.RemoteException {
        if (super.cachedEndpoint == null) {
            throw new org.apache.axis.NoEndPointException();
        }
        org.apache.axis.client.Call _call = createCall();
        _call.setOperation(_operations[0]);
        _call.setUseSOAPAction(true);
        _call.setSOAPActionURI("");
        _call.setEncodingStyle(null);
        _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE);
        _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE);
        _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
        _call.setOperationName(new javax.xml.namespace.QName("http://entry.ws.ctd/", "invoke"));
        setRequestHeaders(_call);
        setAttachments(_call);
 try {        Object _resp = _call.invoke(new Object[] {arg0, arg1, arg2, arg3, arg4});
        if (_resp instanceof java.rmi.RemoteException) {
            throw (java.rmi.RemoteException)_resp;
        }
        else {
            extractAttachments(_call);
            try {
                return (String) _resp;
            } catch (Exception _exception) {
                return (String) org.apache.axis.utils.JavaUtils.convert(_resp, String.class);
            }
        }
  } catch (org.apache.axis.AxisFault axisFaultException) {
  throw axisFaultException;
}
    }
    public boolean vaildTokenPass(String arg0, String arg1) throws java.rmi.RemoteException, ControllerException, NoSuchPaddingException, UnsupportedEncodingException, IllegalBlockSizeException, BadPaddingException, NoSuchAlgorithmException, InvalidKeyException {
        if (super.cachedEndpoint == null) {
            throw new org.apache.axis.NoEndPointException();
        }
        org.apache.axis.client.Call _call = createCall();
        _call.setOperation(_operations[1]);
        _call.setUseSOAPAction(true);
        _call.setSOAPActionURI("");
        _call.setEncodingStyle(null);
        _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE);
        _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE);
        _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
        _call.setOperationName(new javax.xml.namespace.QName("http://entry.ws.ctd/", "VaildTokenPass"));
        setRequestHeaders(_call);
        setAttachments(_call);
 try {        Object _resp = _call.invoke(new Object[] {arg0, arg1});
        if (_resp instanceof java.rmi.RemoteException) {
            throw (java.rmi.RemoteException)_resp;
        }
        else {
            extractAttachments(_call);
            try {
                return ((Boolean) _resp).booleanValue();
            } catch (Exception _exception) {
                return ((Boolean) org.apache.axis.utils.JavaUtils.convert(_resp, boolean.class)).booleanValue();
            }
        }
  } catch (org.apache.axis.AxisFault axisFaultException) {
    if (axisFaultException.detail != null) {
        if (axisFaultException.detail instanceof java.rmi.RemoteException) {
              throw (java.rmi.RemoteException) axisFaultException.detail;
         }
        if (axisFaultException.detail instanceof ControllerException) {
              throw (ControllerException) axisFaultException.detail;
         }
        if (axisFaultException.detail instanceof NoSuchPaddingException) {
              throw (NoSuchPaddingException) axisFaultException.detail;
         }
        if (axisFaultException.detail instanceof UnsupportedEncodingException) {
              throw (UnsupportedEncodingException) axisFaultException.detail;
         }
        if (axisFaultException.detail instanceof IllegalBlockSizeException) {
              throw (IllegalBlockSizeException) axisFaultException.detail;
         }
        if (axisFaultException.detail instanceof BadPaddingException) {
              throw (BadPaddingException) axisFaultException.detail;
         }
        if (axisFaultException.detail instanceof NoSuchAlgorithmException) {
              throw (NoSuchAlgorithmException) axisFaultException.detail;
         }
        if (axisFaultException.detail instanceof InvalidKeyException) {
              throw (InvalidKeyException) axisFaultException.detail;
         }
   }
  throw axisFaultException;
}
    }
}

+ 62 - 0
business/base-service/src/main/java/com/yihu/jw/internet/wsapi/WsapiProxy.java

@ -0,0 +1,62 @@
package com.yihu.jw.internet.wsapi;
import java.rmi.RemoteException;
public class WsapiProxy implements Wsapi {
  private String _endpoint = null;
  private Wsapi wsapi = null;
  
  public WsapiProxy() {
    _initWsapiProxy();
  }
  
  public WsapiProxy(String endpoint) {
    _endpoint = endpoint;
    _initWsapiProxy();
  }
  
  private void _initWsapiProxy() {
    try {
      wsapi = (new WsapiServiceLocator()).getwsapiPort();
      if (wsapi != null) {
        if (_endpoint != null)
          ((javax.xml.rpc.Stub)wsapi)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint);
        else
          _endpoint = (String)((javax.xml.rpc.Stub)wsapi)._getProperty("javax.xml.rpc.service.endpoint.address");
      }
      
    }
    catch (javax.xml.rpc.ServiceException serviceException) {}
  }
  
  public String getEndpoint() {
    return _endpoint;
  }
  
  public void setEndpoint(String endpoint) {
    _endpoint = endpoint;
    if (wsapi != null)
      ((javax.xml.rpc.Stub)wsapi)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint);
    
  }
  
  public Wsapi getWsapi() {
    if (wsapi == null)
      _initWsapiProxy();
    return wsapi;
  }
  
  public String invoke(String arg0, String arg1, String arg2, String arg3, String arg4) throws RemoteException {
    if (wsapi == null)
      _initWsapiProxy();
    return wsapi.invoke(arg0, arg1, arg2, arg3, arg4);
  }
  public boolean vaildTokenPass(String arg0, String arg1) throws RemoteException, ControllerException, NoSuchPaddingException, UnsupportedEncodingException, IllegalBlockSizeException, BadPaddingException, NoSuchAlgorithmException, InvalidKeyException{
    if (wsapi == null)
      _initWsapiProxy();
    return wsapi.vaildTokenPass(arg0, arg1);
  }
}

+ 9 - 0
business/base-service/src/main/java/com/yihu/jw/internet/wsapi/WsapiService.java

@ -0,0 +1,9 @@
package com.yihu.jw.internet.wsapi;
public interface WsapiService extends javax.xml.rpc.Service {
    public String getwsapiPortAddress();
    public Wsapi getwsapiPort() throws javax.xml.rpc.ServiceException;
    public Wsapi getwsapiPort(java.net.URL portAddress) throws javax.xml.rpc.ServiceException;
}

+ 135 - 0
business/base-service/src/main/java/com/yihu/jw/internet/wsapi/WsapiServiceLocator.java

@ -0,0 +1,135 @@
package com.yihu.jw.internet.wsapi;
public class WsapiServiceLocator extends org.apache.axis.client.Service implements WsapiService {
    public WsapiServiceLocator() {
    }
    public WsapiServiceLocator(org.apache.axis.EngineConfiguration config) {
        super(config);
    }
    public WsapiServiceLocator(String wsdlLoc, javax.xml.namespace.QName sName) throws javax.xml.rpc.ServiceException {
        super(wsdlLoc, sName);
    }
    // Use to get a proxy class for wsapiPort
//    private java.lang.String wsapiPort_address = "http://10.32.0.158:18081/micc/wsapi/1.0";
    private String wsapiPort_address = "http://fjhlw.bsoft.com.cn:18081/micc/wsapi/1.0";
    public String getwsapiPortAddress() {
        return wsapiPort_address;
    }
    // The WSDD service name defaults to the port name.
    private String wsapiPortWSDDServiceName = "wsapiPort";
    public String getwsapiPortWSDDServiceName() {
        return wsapiPortWSDDServiceName;
    }
    public void setwsapiPortWSDDServiceName(String name) {
        wsapiPortWSDDServiceName = name;
    }
    public Wsapi getwsapiPort() throws javax.xml.rpc.ServiceException {
       java.net.URL endpoint;
        try {
            endpoint = new java.net.URL(wsapiPort_address);
        }
        catch (java.net.MalformedURLException e) {
            throw new javax.xml.rpc.ServiceException(e);
        }
        return getwsapiPort(endpoint);
    }
    public Wsapi getwsapiPort(java.net.URL portAddress) throws javax.xml.rpc.ServiceException {
        try {
            WsapiPortBindingStub _stub = new WsapiPortBindingStub(portAddress, this);
            _stub.setPortName(getwsapiPortWSDDServiceName());
            return _stub;
        }
        catch (org.apache.axis.AxisFault e) {
            return null;
        }
    }
    public void setwsapiPortEndpointAddress(String address) {
        wsapiPort_address = address;
    }
    /**
     * For the given interface, get the stub implementation.
     * If this service has no port for the given interface,
     * then ServiceException is thrown.
     */
    public java.rmi.Remote getPort(Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException {
        try {
            if (Wsapi.class.isAssignableFrom(serviceEndpointInterface)) {
                WsapiPortBindingStub _stub = new WsapiPortBindingStub(new java.net.URL(wsapiPort_address), this);
                _stub.setPortName(getwsapiPortWSDDServiceName());
                return _stub;
            }
        }
        catch (Throwable t) {
            throw new javax.xml.rpc.ServiceException(t);
        }
        throw new javax.xml.rpc.ServiceException("There is no stub implementation for the interface:  " + (serviceEndpointInterface == null ? "null" : serviceEndpointInterface.getName()));
    }
    /**
     * For the given interface, get the stub implementation.
     * If this service has no port for the given interface,
     * then ServiceException is thrown.
     */
    public java.rmi.Remote getPort(javax.xml.namespace.QName portName, Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException {
        if (portName == null) {
            return getPort(serviceEndpointInterface);
        }
        String inputPortName = portName.getLocalPart();
        if ("wsapiPort".equals(inputPortName)) {
            return getwsapiPort();
        }
        else  {
            java.rmi.Remote _stub = getPort(serviceEndpointInterface);
            ((org.apache.axis.client.Stub) _stub).setPortName(portName);
            return _stub;
        }
    }
    public javax.xml.namespace.QName getServiceName() {
        return new javax.xml.namespace.QName("http://entry.ws.ctd/", "wsapiService");
    }
    private java.util.HashSet ports = null;
    public java.util.Iterator getPorts() {
        if (ports == null) {
            ports = new java.util.HashSet();
            ports.add(new javax.xml.namespace.QName("http://entry.ws.ctd/", "wsapiPort"));
        }
        return ports.iterator();
    }
    /**
    * Set the endpoint address for the specified port name.
    */
    public void setEndpointAddress(String portName, String address) throws javax.xml.rpc.ServiceException {
if ("wsapiPort".equals(portName)) {
            setwsapiPortEndpointAddress(address);
        }
        else
{ // Unknown Port Name
            throw new javax.xml.rpc.ServiceException(" Cannot set Endpoint Address for Unknown Port" + portName);
        }
    }
    /**
    * Set the endpoint address for the specified port name.
    */
    public void setEndpointAddress(javax.xml.namespace.QName portName, String address) throws javax.xml.rpc.ServiceException {
        setEndpointAddress(portName.getLocalPart(), address);
    }
}

+ 4 - 0
business/base-service/src/main/java/com/yihu/jw/org/service/BaseOrgInfoService.java

@ -18,4 +18,8 @@ public class BaseOrgInfoService extends BaseJpaService<BaseOrgDO, BaseOrgDao> {
        return baseOrgDao.findByCityCode(cityCode);
    }
    public BaseOrgDO getBaseOrgByCode(String orgCode){
        return baseOrgDao.findByCode(orgCode);
    }
}

+ 167 - 0
business/base-service/src/main/java/com/yihu/jw/utils/JSONUtils.java

@ -0,0 +1,167 @@
package com.yihu.jw.utils;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.core.JsonParser.Feature;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import org.apache.commons.lang3.StringUtils;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.Reader;
import java.io.Writer;
import java.text.SimpleDateFormat;
public class JSONUtils
{
  private static ObjectMapper mapper = new ObjectMapper();
  
  static
  {
    mapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false);
    mapper.configure(Feature.ALLOW_SINGLE_QUOTES, true);
    mapper.configure(Feature.ALLOW_UNQUOTED_FIELD_NAMES, true);
    
    mapper.configure(SerializationFeature.WRITE_ENUMS_USING_TO_STRING, true);
    mapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false);
    mapper.setDateFormat(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"));
    mapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);
    mapper.setSerializationInclusion(Include.NON_NULL);
  }
  
  public static <T> T parse(String value, Class<T> clz)
  {
    if (StringUtils.isEmpty(value)) {
      return null;
    }
    try
    {
      return (T)mapper.readValue(value, clz);
    }
    catch (Exception e)
    {
      throw new IllegalStateException(e);
    }
  }
  
  public static <T> T parse(byte[] bytes, Class<T> clz)
  {
    try
    {
      return (T)mapper.readValue(bytes, clz);
    }
    catch (Exception e)
    {
      throw new IllegalStateException(e);
    }
  }
  
  public static <T> T parse(InputStream ins, Class<T> clz)
  {
    try
    {
      return (T)mapper.readValue(ins, clz);
    }
    catch (Exception e)
    {
      throw new IllegalStateException(e);
    }
  }
  
  public static <T> T parse(Reader reader, Class<T> clz)
  {
    try
    {
      return (T)mapper.readValue(reader, clz);
    }
    catch (Exception e)
    {
      throw new IllegalStateException(e);
    }
  }
  
  public static <T> T update(String value, T object)
  {
    try
    {
      return (T)mapper.readerForUpdating(object).readValue(value);
    }
    catch (Exception e)
    {
      throw new IllegalStateException(e);
    }
  }
  
  public static String writeValueAsString(Object o)
  {
    try
    {
      return mapper.writeValueAsString(o);
    }
    catch (Exception e)
    {
      throw new IllegalStateException(e);
    }
  }
  
  public static void write(OutputStream outs, Object o)
  {
    try
    {
      mapper.writeValue(outs, o);
    }
    catch (Exception e)
    {
      throw new IllegalStateException(e);
    }
  }
  
  public static void write(Writer writer, Object o)
  {
    try
    {
      mapper.writeValue(writer, o);
    }
    catch (Exception e)
    {
      throw new IllegalStateException(e);
    }
  }
  
  public static String toString(Object o)
  {
    try
    {
      return mapper.writeValueAsString(o);
    }
    catch (Exception e)
    {
      throw new IllegalStateException(e);
    }
  }
  
  public static String toString(Object o, Class<?> clz)
  {
    try
    {
      return mapper.writerFor(clz).writeValueAsString(o);
    }
    catch (Exception e)
    {
      throw new IllegalStateException(e);
    }
  }
  
  public static byte[] toBytes(Object o)
  {
    try
    {
      return mapper.writeValueAsBytes(o);
    }
    catch (Exception e)
    {
      throw new IllegalStateException(e);
    }
  }
}

+ 1440 - 0
business/base-service/src/main/java/com/yihu/jw/utils/StringUtil.java

@ -0,0 +1,1440 @@
package com.yihu.jw.utils;
import org.apache.commons.lang3.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.Matcher;
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:????????? ????????? ?? ???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:????????? ????????? ??
     * ???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:?????????�A??
     * ????????? ?? ???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;
            }
        }
    }
    /**
     * ***************************************************** ?? ????????????�I????
     * ????????param strSource ???�I?????????param strFrom ????????param strTo ???????? ????????? ??
     * ????�I???????? <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;
    }
    /**
     * ***************************************************** ?? ?????????????��???�I???????
     * ????????param String strTarget, String strNew ????????? ?? ???return String
     * ????????�I????? <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;
    }
    /**
     * ***************************************************** ??
     * ????????????��????????????????????...???? ????????param src ???????????,param len ?????�� ????????? ??
     * ???return String ??��????????????????????...??????????? <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;
        }
        // ???????????????????�I??????????????????????????????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 ex) {
            //LogService.getLogger(StringUtil.class).error(ex.getMessage());
            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) { // ?��?????????
            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) {
            System.out.println("????????????????" + ex.getMessage());
        }
        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;
            Matcher m_script;
            Pattern p_href;
            Matcher m_href;
            Pattern p_a;
            Matcher m_a;
            Pattern p_on;
            Matcher m_on;
            Pattern p_iframe;
            Matcher m_iframe;
            Pattern p_frameset;
            Matcher m_frameset;
            Pattern p_img;
            Matcher m_img;
            Pattern p_p1;
            Matcher m_p1;
            Pattern p_p2;
            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;
    }
    /**
     * ***************************************************** ??
     * ??????��??????????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;
        }
    }
    /**
     * 去除换行符
     * @param str
     * @return
     */
    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;
    }
}

+ 111 - 0
business/base-service/src/main/java/com/yihu/jw/utils/encode/AESUtils.java

@ -0,0 +1,111 @@
package com.yihu.jw.utils.encode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.jw.utils.JSONUtils;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.codec.digest.DigestUtils;
import javax.crypto.Cipher;
import javax.crypto.KeyGenerator;
import javax.crypto.SecretKey;
import javax.crypto.spec.SecretKeySpec;
import java.security.Key;
public class AESUtils {
    private static final String KEY_ALGORITHM = "AES";
    private static final String DEFAULT_CIPHER_ALGORITHM = "AES/ECB/PKCS5Padding";
    public AESUtils() {
    }
    public static byte[] initSecretKey() throws Exception {
        KeyGenerator kg = KeyGenerator.getInstance("AES");
        kg.init(128);
        SecretKey secretKey = kg.generateKey();
        return secretKey.getEncoded();
    }
    public static String generatorSecretKey() throws Exception {
        return DigestUtils.md5Hex(initSecretKey()).substring(8, 24);
    }
    public static Key toKey(byte[] key) {
        return new SecretKeySpec(key, "AES");
    }
    public static String encrypt(String data, String key) throws Exception {
        return Base64.encodeBase64String(encrypt(data.getBytes("utf-8"), toKey(key.getBytes("utf-8")), "AES/ECB/PKCS5Padding"));
    }
    public static String decrypt(String data, String key) throws Exception {
        return new String(decrypt(Base64.decodeBase64(data.getBytes("utf-8")), toKey(key.getBytes("utf-8")), "AES/ECB/PKCS5Padding"),"utf-8");
    }
    public static byte[] encrypt(byte[] data, Key key) throws Exception {
        return encrypt(data, key, "AES/ECB/PKCS5Padding");
    }
    public static byte[] encrypt(byte[] data, byte[] key) throws Exception {
        return encrypt(data, toKey(key), "AES/ECB/PKCS5Padding");
    }
    public static byte[] encrypt(byte[] data, Key key, String cipherAlgorithm) throws Exception {
        Cipher cipher = Cipher.getInstance(cipherAlgorithm);
        cipher.init(1, key);
        return cipher.doFinal(data);
    }
    public static byte[] decrypt(byte[] data, byte[] key) throws Exception {
        return decrypt(data, key, "AES/ECB/PKCS5Padding");
    }
    public static byte[] decrypt(byte[] data, Key key) throws Exception {
        return decrypt(data, key, "AES/ECB/PKCS5Padding");
    }
    public static byte[] decrypt(byte[] data, byte[] key, String cipherAlgorithm) throws Exception {
        Key k = toKey(key);
        return decrypt(data, k, cipherAlgorithm);
    }
    public static byte[] decrypt(byte[] data, Key key, String cipherAlgorithm) throws Exception {
        Cipher cipher = Cipher.getInstance(cipherAlgorithm);
        cipher.init(2, key);
        return cipher.doFinal(data);
    }
    private static String showByteArray(byte[] data) {
        if(null == data) {
            return null;
        } else {
            StringBuilder sb = new StringBuilder("{");
            byte[] arr$ = data;
            int len$ = data.length;
            for(int i$ = 0; i$ < len$; ++i$) {
                byte b = arr$[i$];
                sb.append(b).append(",");
            }
            sb.deleteCharAt(sb.length() - 1);
            sb.append("}");
            return sb.toString();
        }
    }
    public static void main(String[] args) throws Exception {
        String key = generatorSecretKey();
        System.out.println("key: " + key);
        String[] original = new String[]{"hello  world!"};
        try {
            String encrypt = encrypt((new ObjectMapper()).writeValueAsString(original), key);
            System.out.println("encrypt: " + encrypt);
            String decrypt = decrypt(encrypt, key);
            System.out.println("decrypt: " + decrypt);
            System.out.println("original: " + JSONUtils.parse(decrypt.getBytes(), String[].class));
        } catch (Exception var5) {
            throw new IllegalStateException(var5);
        }
    }
}

+ 132 - 0
business/base-service/src/main/java/com/yihu/jw/utils/encode/Base64.java

@ -0,0 +1,132 @@
package com.yihu.jw.utils.encode;
/**
 * 标准Base64编解码,具体规范请参见相关文档。
 */
public class Base64 {
    /**
     * Base64编码表。
     */
    private static char Base64Code[] = {
            'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P',
            'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f',
            'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v',
            'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '/',
    };
    /**
     * Base64解码表。
     */
    private static byte Base64Decode[] = {
            -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
            -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,  //注意两个63,为兼容SMP,
            -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, 63, -1, 63,  //“/”和“-”都翻译成63。
            52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, 0, -1, -1,
            -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,  //注意两个0:
            15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1,  //“A”和“=”都翻译成0。
            -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
            41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1,
    };
    /**
     * 构造方法私有化,防止实例化。
     */
    private Base64() {
    }
    /**
     * Base64编码。将字节数组中字节3个一组编码成4个可见字符。
     *
     * @param b 需要被编码的字节数据。
     * @return 编码后的Base64字符串。
     */
    public static String encode(byte[] b) {
        int code = 0;
        //按实际编码后长度开辟内存,加快速度
        StringBuffer sb = new StringBuffer(((b.length - 1) / 3) << 2 + 4);
        //进行编码
        for (int i = 0; i < b.length; i++) {
            code |= (b[i] << (16 - i % 3 * 8)) & (0xff << (16 - i % 3 * 8));
            if (i % 3 == 2 || i == b.length - 1) {
                sb.append(Base64Code[(code & 0xfc0000) >>> 18]);
                sb.append(Base64Code[(code & 0x3f000) >>> 12]);
                sb.append(Base64Code[(code & 0xfc0) >>> 6]);
                sb.append(Base64Code[code & 0x3f]);
                code = 0;
            }
        }
        //对于长度非3的整数倍的字节数组,编码前先补0,编码后结尾处编码用=代替,
        //=的个数和短缺的长度一致,以此来标识出数据实际长度
        if (b.length % 3 > 0) {
            sb.setCharAt(sb.length() - 1, '=');
        }
        if (b.length % 3 == 1) {
            sb.setCharAt(sb.length() - 2, '=');
        }
        return sb.toString();
    }
    /**
     * Base64解码。
     *
     * @param code 用Base64编码的ASCII字符串
     * @return 解码后的字节数据
     */
    public static byte[] decode(String code) {
        //检查参数合法性
        if (code == null) {
            return null;
        }
        int len = code.length();
        if (len % 4 != 0) {
            throw new IllegalArgumentException("Base64 string length must be 4*n");
        }
        if (code.length() == 0) {
            return new byte[0];
        }
        //统计填充的等号个数
        int pad = 0;
        if (code.charAt(len - 1) == '=') {
            pad++;
        }
        if (code.charAt(len - 2) == '=') {
            pad++;
        }
        int retLen = len / 4 * 3 - pad;
        byte[] ret = new byte[retLen];
        char ch1, ch2, ch3, ch4;
        int i;
        for (i = 0; i < len; i += 4) {
            int j = i / 4 * 3;
            ch1 = code.charAt(i);
            ch2 = code.charAt(i + 1);
            ch3 = code.charAt(i + 2);
            ch4 = code.charAt(i + 3);
            int tmp = (Base64Decode[ch1] << 18) | (Base64Decode[ch2] << 12)
                    | (Base64Decode[ch3] << 6) | (Base64Decode[ch4]);
            ret[j] = (byte) ((tmp & 0xff0000) >> 16);
            if (i < len - 4) {
                ret[j + 1] = (byte) ((tmp & 0x00ff00) >> 8);
                ret[j + 2] = (byte) ((tmp & 0x0000ff));
            } else {
                if (j + 1 < retLen) {
                    ret[j + 1] = (byte) ((tmp & 0x00ff00) >> 8);
                }
                if (j + 2 < retLen) {
                    ret[j + 2] = (byte) ((tmp & 0x0000ff));
                }
            }
        }
        return ret;
    }
}

+ 26 - 0
business/base-service/src/main/java/com/yihu/jw/utils/encode/HexEncode.java

@ -0,0 +1,26 @@
package com.yihu.jw.utils.encode;
public class HexEncode {
    static public String toHexString(byte[] bytes) {
        StringBuilder stringBuffer = new StringBuilder();
        for (byte aByte : bytes) {
            if (Integer.toHexString(0xFF & aByte).length() == 1) {
                stringBuffer.append("0").append(Integer.toHexString(0xFF & aByte));
            } else {
                stringBuffer.append(Integer.toHexString(0xFF & aByte));
            }
        }
        return stringBuffer.toString();
    }
    static public byte[] toBytes(String hexString) {
        byte[] bytes;
        bytes = new byte[hexString.length() / 2];
        for (int i = 0; i < bytes.length; i++) {
            bytes[i] = (byte) Integer.parseInt(hexString.substring(2 * i, 2 * i + 2), 16);
        }
        return bytes;
    }
}

+ 69 - 0
business/base-service/src/main/java/com/yihu/jw/utils/encode/MD5.java

@ -0,0 +1,69 @@
package com.yihu.jw.utils.encode;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.lang.reflect.Method;
import java.nio.MappedByteBuffer;
import java.nio.channels.FileChannel;
import java.security.AccessController;
import java.security.MessageDigest;
import java.security.PrivilegedAction;
public class MD5 {
    static public String hash(String str) throws Exception {
        MessageDigest messageDigest = null;
        messageDigest = MessageDigest.getInstance("MD5");
        messageDigest.reset();
        messageDigest.update(str.getBytes());
        return HexEncode.toHexString(messageDigest.digest());
    }
    public static String getMd5ByFile(File file) throws FileNotFoundException {
        String value = null;
        FileInputStream in = new FileInputStream(file);
        MappedByteBuffer byteBuffer =null;
        try {
            byteBuffer = in.getChannel().map(FileChannel.MapMode.READ_ONLY, 0, file.length());
            MessageDigest md5 = MessageDigest.getInstance("MD5");
            md5.update(byteBuffer);
//            BigInteger bi = new BigInteger(1, md5.digest());
//            value = bi.toString(16);
            value= HexEncode.toHexString(md5.digest());
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if(null != in) {
                try {
                    in.close();
                    clean(byteBuffer);
                } catch (IOException e) {
                    e.printStackTrace();
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        }
        return value;
    }
    public static void clean(final Object buffer) throws Exception {
        AccessController.doPrivileged(new PrivilegedAction() {
            public Object run() {
                try {
                    Method getCleanerMethod = buffer.getClass().getMethod("cleaner", new Class[0]);
                    getCleanerMethod.setAccessible(true);
                    sun.misc.Cleaner cleaner = (sun.misc.Cleaner) getCleanerMethod.invoke(buffer, new Object[0]);
                    cleaner.clean();
                } catch (Exception e) {
                    e.printStackTrace();
                }
                return null;
            }
        });
    }
}