|  | @ -3,27 +3,18 @@ package com.yihu.ehr.ws;
 | 
	
		
			
				|  |  | import com.yihu.ehr.dbhelper.jdbc.DBHelper;
 | 
	
		
			
				|  |  | import com.yihu.ehr.model.DataSource;
 | 
	
		
			
				|  |  | import com.yihu.ehr.model.WSReturnModel;
 | 
	
		
			
				|  |  | import com.yihu.ehr.ws.inf.ISQLWebService;
 | 
	
		
			
				|  |  | import com.yihu.ehr.util.operator.StringUtil;
 | 
	
		
			
				|  |  | import org.apache.commons.dbcp2.BasicDataSource;
 | 
	
		
			
				|  |  | import org.apache.cxf.endpoint.Client;
 | 
	
		
			
				|  |  | import org.apache.cxf.jaxws.endpoint.dynamic.JaxWsDynamicClientFactory;
 | 
	
		
			
				|  |  | import org.springframework.jdbc.core.JdbcTemplate;
 | 
	
		
			
				|  |  | import org.springframework.stereotype.Controller;
 | 
	
		
			
				|  |  | import org.springframework.util.StringUtils;
 | 
	
		
			
				|  |  | import org.springframework.web.bind.annotation.RequestMapping;
 | 
	
		
			
				|  |  | import org.springframework.web.bind.annotation.ResponseBody;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | import javax.jws.WebService;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | /**
 | 
	
		
			
				|  |  |  * Created by Administrator on 2016/5/19.
 | 
	
		
			
				|  |  |  */
 | 
	
		
			
				|  |  | @WebService(endpointInterface = "com.yihu.ehr.ws.inf.ISQLWebService", targetNamespace = "com.yihu.ehr.ws.inf")
 | 
	
		
			
				|  |  | public class SQLWebService implements ISQLWebService {
 | 
	
		
			
				|  |  | public class ExcuteService {
 | 
	
		
			
				|  |  |     public static JdbcTemplate jdbcTemplate = null;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     public void initJDBC() throws Exception{
 | 
	
		
			
				|  |  |     public void initJDBC() throws Exception {
 | 
	
		
			
				|  |  |         if (jdbcTemplate == null) {
 | 
	
		
			
				|  |  |             //jdbc:oracle:thin:hos/hos@//172.19.103.71:1521/orcl
 | 
	
		
			
				|  |  |             //jdbc:mysql://172.19.103.71:1521/orcl?user=hos&password=hos&useUnicode=true&characterEncoding=UTF-8
 | 
	
	
		
			
				|  | @ -95,8 +86,7 @@ public class SQLWebService implements ISQLWebService {
 | 
	
		
			
				|  |  |      * @param reportType
 | 
	
		
			
				|  |  |      * @return
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  |     @Override
 | 
	
		
			
				|  |  |     public String getReportList(
 | 
	
		
			
				|  |  |     public String GetReportList(
 | 
	
		
			
				|  |  |             String TransactionCode,
 | 
	
		
			
				|  |  |             String cardType,
 | 
	
		
			
				|  |  |             String cardNo,
 | 
	
	
		
			
				|  | @ -107,17 +97,17 @@ public class SQLWebService implements ISQLWebService {
 | 
	
		
			
				|  |  |         WSReturnModel wsReturnModel = new WSReturnModel();
 | 
	
		
			
				|  |  |         wsReturnModel.setTransactionCode(TransactionCode);
 | 
	
		
			
				|  |  |         try {
 | 
	
		
			
				|  |  |             initJDBC();
 | 
	
		
			
				|  |  |             StringBuffer sb = new StringBuffer("select * from HDSD01_01 where 1=1 ");
 | 
	
		
			
				|  |  |             if (!StringUtils.isEmpty(endDate)) {
 | 
	
		
			
				|  |  |                 sb.append(" and HDSD00_05_026 < '" + endDate + "'");
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |             if (!StringUtils.isEmpty(startDate)) {
 | 
	
		
			
				|  |  |                 sb.append(" and HDSD00_01_001 > '" + startDate + "'");
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |             //initJDBC();
 | 
	
		
			
				|  |  |             // StringBuffer sb = new StringBuffer("select * from HDSD01_01 where 1=1 ");
 | 
	
		
			
				|  |  |             //if (!StringUtils.isEmpty(endDate)) {
 | 
	
		
			
				|  |  |             //    sb.append(" and HDSD00_05_026 < '" + endDate + "'");
 | 
	
		
			
				|  |  |             // }
 | 
	
		
			
				|  |  |             //if (!StringUtils.isEmpty(startDate)) {
 | 
	
		
			
				|  |  |             //    sb.append(" and HDSD00_01_001 > '" + startDate + "'");
 | 
	
		
			
				|  |  |             // }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |             wsReturnModel.setData(jdbcTemplate.queryForList(sb.toString()));
 | 
	
		
			
				|  |  |            // return WSReturnModel.toXml(wsReturnModel);
 | 
	
		
			
				|  |  |             //wsReturnModel.setData(jdbcTemplate.queryForList(sb.toString()));
 | 
	
		
			
				|  |  |             // return WSReturnModel.toXml(wsReturnModel);
 | 
	
		
			
				|  |  |             return "<Resp> \n" +
 | 
	
		
			
				|  |  |                     "<TransactionCode></TransactionCode> \n" +
 | 
	
		
			
				|  |  |                     "<RespMessage>成功</RespMessage>\n" +
 | 
	
	
		
			
				|  | @ -162,7 +152,6 @@ public class SQLWebService implements ISQLWebService {
 | 
	
		
			
				|  |  |      * @param reportType
 | 
	
		
			
				|  |  |      * @return
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  |     @Override
 | 
	
		
			
				|  |  |     public String getReportInfo(
 | 
	
		
			
				|  |  |             String TransactionCode,
 | 
	
		
			
				|  |  |             String reportId,
 | 
	
	
		
			
				|  | @ -172,14 +161,14 @@ public class SQLWebService implements ISQLWebService {
 | 
	
		
			
				|  |  |         try {
 | 
	
		
			
				|  |  |             initJDBC();
 | 
	
		
			
				|  |  |             StringBuffer sb = new StringBuffer("select * from HDSD01_01 where 1=1 ");
 | 
	
		
			
				|  |  |             if (!StringUtils.isEmpty(reportId)) {
 | 
	
		
			
				|  |  |             if (!StringUtil.isEmpty(reportId)) {
 | 
	
		
			
				|  |  |                 sb.append(" and HDSD00_05_026 < '" + reportId + "'");
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |             if (!StringUtils.isEmpty(reportType)) {
 | 
	
		
			
				|  |  |             if (!StringUtil.isEmpty(reportType)) {
 | 
	
		
			
				|  |  |                 sb.append(" and HDSD00_01_001 > '" + reportType + "'");
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |           //  wsReturnModel.setData(jdbcTemplate.queryForList(sb.toString()));
 | 
	
		
			
				|  |  |             //  wsReturnModel.setData(jdbcTemplate.queryForList(sb.toString()));
 | 
	
		
			
				|  |  |             return "<Resp> \n" +
 | 
	
		
			
				|  |  |                     "<TransactionCode></TransactionCode> \n" +
 | 
	
		
			
				|  |  |                     "<RespMessage>成功</RespMessage>\n" +
 | 
	
	
		
			
				|  | @ -238,8 +227,35 @@ public class SQLWebService implements ISQLWebService {
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     public String QueryUserInfo(String TransactionCode, String CardType, String CardNo, String Mobile, String PatientId) {
 | 
	
		
			
				|  |  |         return "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n" +
 | 
	
		
			
				|  |  |                 "<Resp>\n" +
 | 
	
		
			
				|  |  |                 "<TransactionCode></TransactionCode>\n" +
 | 
	
		
			
				|  |  |                 "<RespMessage>成功</RespMessage>\n" +
 | 
	
		
			
				|  |  |                 "<RespCode>10000</RespCode>\n" +
 | 
	
		
			
				|  |  |                 "<Data>\n" +
 | 
	
		
			
				|  |  |                 "<PatientId>病人id</PatientId>\n" +
 | 
	
		
			
				|  |  |                 "<ClinicCard>就诊卡号</ClinicCard>\n" +
 | 
	
		
			
				|  |  |                 "<Name>用户姓名</Name>\n" +
 | 
	
		
			
				|  |  |                 "<Mobile>手机号码</Mobile>\n" +
 | 
	
		
			
				|  |  |                 "<McardNo>医保卡</McardNo>\n" +
 | 
	
		
			
				|  |  |                 "<Address>家庭住址</Address>\n" +
 | 
	
		
			
				|  |  |                 "<Sex>性别</Sex>\n" +
 | 
	
		
			
				|  |  |                 "<Fee>就诊卡余额</Fee>\n" +
 | 
	
		
			
				|  |  |                 "<BirthDay>出生日期</BirthDay>\n" +
 | 
	
		
			
				|  |  |                 "<Country>国籍</Country>\n" +
 | 
	
		
			
				|  |  |                 "<Nation>民族</Nation>\n" +
 | 
	
		
			
				|  |  |                 "<BloodCode1>血型代码:ABO</BloodCode1>\n" +
 | 
	
		
			
				|  |  |                 "<BloodCode2>HR血型代码</BloodCode2>\n" +
 | 
	
		
			
				|  |  |                 "<Allergens>过敏源</Allergens>\n" +
 | 
	
		
			
				|  |  |                 "<IdCardId>身份证</IdCardId>\n" +
 | 
	
		
			
				|  |  |                 "</Data>\n" +
 | 
	
		
			
				|  |  |                 "</Resp>";
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     public static void main(String[] args) throws Exception {
 | 
	
		
			
				|  |  |         /*
 | 
	
		
			
				|  |  |         JaxWsDynamicClientFactory factory = JaxWsDynamicClientFactory.newInstance();
 | 
	
		
			
				|  |  |         Client client = factory.createClient("http://172.19.103.71:8080/service/sql?wsdl");
 | 
	
		
			
				|  |  |         //Client client = factory.createClient("http://localhost:8080/service/sql?wsdl");
 | 
	
	
		
			
				|  | @ -250,7 +266,7 @@ public class SQLWebService implements ISQLWebService {
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |         } catch (Exception e) {
 | 
	
		
			
				|  |  |             e.printStackTrace();
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         }*/
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 
 |