Fisheye: Tag 13772 refers to a dead (removed) revision in file `ssts-web/src/main/resources/config/dgsdhyy/mybatis/SyncOrgUnitAndUserMapper.xml'. Fisheye: No comparison available. Pass `N' to diff? Index: ssts-datasync-default-impl/src/main/java/com/forgon/disinfectsystem/datasynchronization/dao/dgsdhyy/WebServiceClientHelper.java =================================================================== diff -u --- ssts-datasync-default-impl/src/main/java/com/forgon/disinfectsystem/datasynchronization/dao/dgsdhyy/WebServiceClientHelper.java (revision 0) +++ ssts-datasync-default-impl/src/main/java/com/forgon/disinfectsystem/datasynchronization/dao/dgsdhyy/WebServiceClientHelper.java (revision 13772) @@ -0,0 +1,143 @@ +package com.forgon.disinfectsystem.datasynchronization.dao.dgsdhyy; + + +import net.sf.json.JSON; +import net.sf.json.xml.XMLSerializer; + +import org.apache.commons.lang.StringUtils; +import org.apache.log4j.Logger; + +/** + * 东莞东华医院webservice帮助类 + * @author shuyongfu + * + */ +public class WebServiceClientHelper { + + private final static Logger logger = Logger.getLogger(WebServiceClientHelper.class); + + /** + * 构造接口输入参数 + * @param methodName + * @param arg + * @return + */ + public static String buildInputXml(String methodName , String... arg){ + String inputXml = ""; + if (DatasyncConstant.MethodName_CSSD_ClinicNumber.equals(methodName)) { + inputXml = "" + + "" + DatasyncConstant.Licence + "" + + "" + methodName + "" + + "" + + "" + arg[0] + "" + + "" + + ""; + + } else if (DatasyncConstant.MethodName_CSSD_HospitalNumber.equals(methodName)) { + inputXml = "" + + "" + DatasyncConstant.Licence + "" + + "" + methodName + "" + + "" + + "" + arg[0] + "" + + "" + + ""; + + } else if (DatasyncConstant.MethodName_CSSD_Department.equals(methodName) + || DatasyncConstant.MethodName_CSSD_User.equals(methodName) + || DatasyncConstant.MethodName_CSSD_Supplier.equals(methodName) + || DatasyncConstant.MethodName_CSSD_TYPE.equals(methodName) + || DatasyncConstant.MethodName_CSSD_MaterialDefinition.equals(methodName)) { + inputXml = "" + + "" + DatasyncConstant.Licence + "" + + "" + methodName + "" + + "" + + "" + + ""; + } else if (DatasyncConstant.MethodName_CSSD_MaterialEntry.equals(methodName) + || DatasyncConstant.MethodName_CSSD_GodownEntry.equals(methodName)) { + inputXml = "" + + "" + DatasyncConstant.Licence + "" + + "" + methodName + "" + + "" + + "" + arg[0] + "" + + "" + arg[1] + "" + + "" + + ""; + } else if (DatasyncConstant.MethodName_CSSD_MaterialEntryItem.equals(methodName) + || DatasyncConstant.MethodName_CSSD_GodownEntryItem.equals(methodName)) { + inputXml = "" + + "" + DatasyncConstant.Licence + "" + + "" + methodName + "" + + "" + + "" + arg[0] + "" + + "" + + ""; + } else { + throw new RuntimeException("不存在此方法:" + methodName); + } + return inputXml; + } + /** + * 用户的xml格式转json + * @param result + * @return + */ + public static JSON userXml2Json(String xml){ + try { + //转json + if (StringUtils.isNotBlank(xml)) { + xml = xml.replace("", ""); + XMLSerializer xmlSerializer = new XMLSerializer(); + JSON json = xmlSerializer.read(xml); + return json; + } + } catch (Exception e) { + e.printStackTrace(); + logger.error("用户信息xml转json失败" + e); + } + return null; + } + + /** + * 科室的xml格式转json + * @param result + * @return + */ + public static JSON orgXml2Json(String xml){ + try { + //转json + if (StringUtils.isNotBlank(xml)) { + xml = xml.replace("", ""); + XMLSerializer xmlSerializer = new XMLSerializer(); + JSON json = xmlSerializer.read(xml); + return json; + } + } catch (Exception e) { + e.printStackTrace(); + logger.error("科室信息xml转json失败" + e); + } + return null; + } + + /** + * 病人的xml格式转json + * @param result + * @return + */ + public static JSON patientXml2Json(String xml){ + try { + //转json + if (StringUtils.isNotBlank(xml)) { + xml = xml.replace("", ""); + XMLSerializer xmlSerializer = new XMLSerializer(); + JSON json = xmlSerializer.read(xml); + System.out.println(json); + return json; + } + } catch (Exception e) { + e.printStackTrace(); + logger.error("病人信息xml转json失败" + e); + } + return null; + } +} Index: ssts-cszxyy-misc/src/main/java/com/forgon/disinfectsystem/datasynchronization/cszxyy/dao/FindPatientInfoByHospitalNumDao.java =================================================================== diff -u -r12331 -r13772 --- ssts-cszxyy-misc/src/main/java/com/forgon/disinfectsystem/datasynchronization/cszxyy/dao/FindPatientInfoByHospitalNumDao.java (.../FindPatientInfoByHospitalNumDao.java) (revision 12331) +++ ssts-cszxyy-misc/src/main/java/com/forgon/disinfectsystem/datasynchronization/cszxyy/dao/FindPatientInfoByHospitalNumDao.java (.../FindPatientInfoByHospitalNumDao.java) (revision 13772) @@ -14,6 +14,7 @@ import com.forgon.disinfectsystem.common.CssdUtils; import com.forgon.disinfectsystem.datasynchronization.model.PatientInfoVO; +import com.forgon.tools.Constants; public class FindPatientInfoByHospitalNumDao { @@ -24,7 +25,7 @@ public static PatientInfoVO[] findPatientInfoByHospitalNum(String hospitalNum){ String result; try { - result = CssdUtils.callWebService(wsdl, buildXmlContent(hospitalNum)); + result = CssdUtils.callWebService(wsdl, buildXmlContent(hospitalNum) , Constants.CHARSET_utf8); //Html特殊字符解码 result = HtmlUtils.htmlUnescape(result); // new FindPatientInfoByHospitalNumDao().logger.debug("住院号="+result); Index: ssts-basedata/src/main/java/com/forgon/disinfectsystem/common/CssdUtils.java =================================================================== diff -u -r13689 -r13772 --- ssts-basedata/src/main/java/com/forgon/disinfectsystem/common/CssdUtils.java (.../CssdUtils.java) (revision 13689) +++ ssts-basedata/src/main/java/com/forgon/disinfectsystem/common/CssdUtils.java (.../CssdUtils.java) (revision 13772) @@ -351,8 +351,15 @@ return laststr; } - - public static String callWebService(String wsdl, String soap) + /** + * 调用webservice方法 + * @param wsdl webservice接口地址 + * @param soap 输入参数 + * @param charset 字符编码集 + * @return + * @throws Exception + */ + public static String callWebService(String wsdl, String soap , String charset) throws Exception{ StringBuilder sb = new StringBuilder(); HttpURLConnection conn = null; @@ -364,9 +371,9 @@ conn.setUseCaches(false); //设置缓存 conn.setRequestProperty("Content-Length", String.valueOf(soap.getBytes().length)); - conn.setRequestProperty("Content-Type", "text/xml; charset=utf-8"); - conn.setRequestProperty("Charset", "utf-8"); - conn.setRequestProperty("contentType", "utf-8"); + conn.setRequestProperty("Content-Type", "text/xml; charset=" + charset); + conn.setRequestProperty("Charset", charset); + conn.setRequestProperty("contentType", charset); conn.setDoOutput(true); conn.setDoInput(true); conn.setConnectTimeout(20000); @@ -378,7 +385,7 @@ // 请求返回内容 //TODO 试试gbk InputStreamReader isr = new InputStreamReader( - conn.getInputStream(), "utf-8"); + conn.getInputStream(), charset); BufferedReader br = new BufferedReader(isr); String str = null; while ((str = br.readLine()) != null) { Fisheye: Tag 13772 refers to a dead (removed) revision in file `ssts-web/src/main/resources/config/dgsdhyy/mybatis/FindPatientInfoByHospitalNumMapper.xml'. Fisheye: No comparison available. Pass `N' to diff? Index: ssts-zd5y-misc/src/main/java/com/forgon/disinfectsystem/datasynchronization/zd5y/dao/WebServiceClientHelper.java =================================================================== diff -u -r12331 -r13772 --- ssts-zd5y-misc/src/main/java/com/forgon/disinfectsystem/datasynchronization/zd5y/dao/WebServiceClientHelper.java (.../WebServiceClientHelper.java) (revision 12331) +++ ssts-zd5y-misc/src/main/java/com/forgon/disinfectsystem/datasynchronization/zd5y/dao/WebServiceClientHelper.java (.../WebServiceClientHelper.java) (revision 13772) @@ -6,6 +6,7 @@ import org.springframework.web.util.HtmlUtils; import com.forgon.disinfectsystem.common.CssdUtils; +import com.forgon.tools.Constants; import net.sf.json.JSON; import net.sf.json.xml.XMLSerializer; @@ -87,7 +88,7 @@ try { num = formatNum(num); String soap = buildHospitalNumContent(num); - String result = CssdUtils.callWebService(HOSPITALNUM_ADDRESS, soap); + String result = CssdUtils.callWebService(HOSPITALNUM_ADDRESS, soap , Constants.CHARSET_utf8); new WebServiceClientHelper().logger.debug("住院号="+result); //Html特殊字符解码 result = HtmlUtils.htmlUnescape(result); @@ -115,7 +116,7 @@ try { num = formatNum(num); String soap = buildClinicNumContent(num); - String result = CssdUtils.callWebService(CLINICNUM_ADDRESS, soap); + String result = CssdUtils.callWebService(CLINICNUM_ADDRESS, soap , Constants.CHARSET_utf8); new WebServiceClientHelper().logger.debug("住院号="+result); //Html特殊字符解码 result = HtmlUtils.htmlUnescape(result); Index: ssts-datasync-default-impl/src/main/java/com/forgon/disinfectsystem/datasynchronization/dao/sznsfy/FindPatientInfoByTreatmentNumDaoImpl.java =================================================================== diff -u --- ssts-datasync-default-impl/src/main/java/com/forgon/disinfectsystem/datasynchronization/dao/sznsfy/FindPatientInfoByTreatmentNumDaoImpl.java (revision 0) +++ ssts-datasync-default-impl/src/main/java/com/forgon/disinfectsystem/datasynchronization/dao/sznsfy/FindPatientInfoByTreatmentNumDaoImpl.java (revision 13772) @@ -0,0 +1,66 @@ +package com.forgon.disinfectsystem.datasynchronization.dao.sznsfy; + +import java.sql.CallableStatement; +import java.sql.Connection; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; + +import org.apache.commons.collections.CollectionUtils; +import org.apache.log4j.Logger; + +import com.forgon.disinfectsystem.datasynchronization.dao.FindPatientInfoByTreatmentNumDao; +import com.forgon.disinfectsystem.datasynchronization.model.PatientInfoVO; +import com.forgon.tools.db.DatabaseUtil; +import com.forgon.tools.db.resultset.ResultSetUtil; + +/** + * 根据诊疗号查询病人信息(南山附幼) + * @author shuyongfu + * + */ +public class FindPatientInfoByTreatmentNumDaoImpl implements + FindPatientInfoByTreatmentNumDao { + + Logger logger = Logger.getLogger(FindPatientInfoByTreatmentNumDaoImpl.class); + + /** + * 根据诊疗号查询病人信息 + */ + @Override + public PatientInfoVO[] findPatientInfoByTreatmentNum(String treatmentNum) { + + PatientInfoVO[] patientInfoVOArray = null; + Connection conn = null; + ResultSet rs = null; + List patientInfoVOList = new ArrayList(); + try{ + conn = HisDbConnectionUtil.getConnection(); + CallableStatement cstm = conn.prepareCall("{call web_ZXJ_Query.CSSD_ClinicNumber('"+treatmentNum+"'})}"); + rs = cstm.executeQuery(); + ResultSetUtil.setFieldValueByResultSet(rs , PatientInfoVO.class , patientInfoVOList); + if(CollectionUtils.isNotEmpty(patientInfoVOList)){ + if(CollectionUtils.isNotEmpty(patientInfoVOList)){ + patientInfoVOArray = new PatientInfoVO[patientInfoVOList.size()]; + patientInfoVOList.toArray(patientInfoVOArray); + } + } + }catch(Exception e){ + logger.error("根据诊疗号查询病人信息失败" + e); + }finally{ + DatabaseUtil.closeResultSetAndStatement(rs); + if(conn != null){ + try { + conn.close(); + } catch (SQLException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + } + + return patientInfoVOArray; + } + +} Fisheye: Tag 13772 refers to a dead (removed) revision in file `ssts-web/src/main/resources/config/dgsdhyy/mybatis/FindPatientInfoByTreatmentNumMapper.xml'. Fisheye: No comparison available. Pass `N' to diff? Index: ssts-datasync-default-impl/src/main/java/com/forgon/disinfectsystem/datasynchronization/dao/dgsdhyy/SyncOrgUnitAndUserDaoImpl.java =================================================================== diff -u --- ssts-datasync-default-impl/src/main/java/com/forgon/disinfectsystem/datasynchronization/dao/dgsdhyy/SyncOrgUnitAndUserDaoImpl.java (revision 0) +++ ssts-datasync-default-impl/src/main/java/com/forgon/disinfectsystem/datasynchronization/dao/dgsdhyy/SyncOrgUnitAndUserDaoImpl.java (revision 13772) @@ -0,0 +1,133 @@ +package com.forgon.disinfectsystem.datasynchronization.dao.dgsdhyy; + +import java.util.ArrayList; +import java.util.List; + +import net.sf.json.JSONArray; +import net.sf.json.JSONObject; + +import org.apache.commons.lang.StringUtils; +import org.apache.log4j.Logger; + +import com.forgon.disinfectsystem.common.CssdUtils; +import com.forgon.disinfectsystem.datasynchronization.dao.SyncOrgUnitAndUserDao; +import com.forgon.disinfectsystem.datasynchronization.model.OrgUnitVo; +import com.forgon.disinfectsystem.datasynchronization.model.UserVo; +import com.forgon.tools.Constants; + +/** + * 查询his系统科室与人员信息(东莞东华医院) + * @author shuyongfu + * + */ +public class SyncOrgUnitAndUserDaoImpl implements SyncOrgUnitAndUserDao { + + Logger logger = Logger.getLogger(SyncOrgUnitAndUserDaoImpl.class); + + /** + * 查询his系统人员信息 + */ + @Override + public UserVo[] getAllUser() { + UserVo[] userVoArray = null; + List userVoList = new ArrayList(); + try{ + String xml = CssdUtils.callWebService(DatasyncConstant.WebserviceAddress, + WebServiceClientHelper.buildInputXml(DatasyncConstant.MethodName_CSSD_User, ""), Constants.CHARSET_GBK); + JSONObject json = (JSONObject)WebServiceClientHelper.patientXml2Json(xml); + if(json!=null){ + String code = json.optString("Result"); + if(DatasyncConstant.RESULT_OK.equals(code)){ + Object dataTableObj = json.opt("DataTable"); + if(dataTableObj == null){ + return null; + } + JSONArray userJsonArray = new JSONArray(); + if(dataTableObj instanceof JSONObject){ + JSONObject userInfo = (JSONObject)dataTableObj; + userJsonArray.add(userInfo); + }else if(dataTableObj instanceof JSONArray){ + //拿最近的一次性诊疗记录 + userJsonArray = (JSONArray)dataTableObj; + } + if(userJsonArray.size() > 0){ + for (int i = 0; i < userJsonArray.size(); i++) { + + Object coding = userJsonArray.optJSONObject(i).opt("coding"); + Object name = userJsonArray.optJSONObject(i).opt("name"); + Object orgUnitCoding = userJsonArray.optJSONObject(i).opt("orgUnitCoding"); + UserVo userVo = new UserVo(); + userVo.setCoding(coding instanceof String ? (String)coding : ""); + userVo.setName(name instanceof String ? (String)name : ""); + userVo.setOrgUnitCoding(orgUnitCoding instanceof String ? (String)orgUnitCoding : ""); + userVoList.add(userVo); + } + userVoArray = new UserVo[userJsonArray.size()]; + userVoList.toArray(userVoArray); + } + }else{ + throw new RuntimeException(json.optString("Error")); + } + } + }catch(Exception e){ + logger.error("查询his人员信息失败:" + e); + } + + return userVoArray; + } + + /** + * 查询his系统科室信息 + */ + @Override + public OrgUnitVo[] getAllOrgUnit() { + OrgUnitVo[] orgUnitVoArray = null; + List orgUnitVoList = new ArrayList(); + try{ + String xml = CssdUtils.callWebService(DatasyncConstant.WebserviceAddress, + WebServiceClientHelper.buildInputXml(DatasyncConstant.MethodName_CSSD_Department, ""), Constants.CHARSET_GBK); + JSONObject json = (JSONObject)WebServiceClientHelper.patientXml2Json(xml); + if(json!=null){ + String code = json.optString("Result"); + if(DatasyncConstant.RESULT_OK.equals(code)){ + Object dataTableObj = json.opt("DataTable"); + if(dataTableObj == null){ + return null; + } + JSONArray orgJsonArray = new JSONArray(); + if(dataTableObj instanceof JSONObject){ + JSONObject userInfo = (JSONObject)dataTableObj; + orgJsonArray.add(userInfo); + }else if(dataTableObj instanceof JSONArray){ + //拿最近的一次性诊疗记录 + orgJsonArray = (JSONArray)dataTableObj; + } + if(orgJsonArray.size() > 0){ + for (int i = 0; i < orgJsonArray.size(); i++) { + Object coding = orgJsonArray.optJSONObject(i).opt("coding"); + Object name = orgJsonArray.optJSONObject(i).opt("name"); + Object orgUnitCoding = orgJsonArray.optJSONObject(i).opt("orgUnitCoding"); + OrgUnitVo orgVo = new OrgUnitVo(); + orgVo.setCoding(coding instanceof String ? (String)coding : ""); + orgVo.setName(name instanceof String ? (String)name : ""); + orgVo.setParentCoding(orgUnitCoding instanceof String ? (String)orgUnitCoding : ""); + if(StringUtils.equals(orgVo.getCoding(), orgVo.getParentCoding())){ + orgVo.setParentCoding(null); + } + orgUnitVoList.add(orgVo); + } + orgUnitVoArray = new OrgUnitVo[orgJsonArray.size()]; + orgUnitVoList.toArray(orgUnitVoArray); + } + }else{ + throw new RuntimeException(json.optString("Error")); + } + } + }catch(Exception e){ + logger.error("查询his科室信息失败" + e); + } + + return orgUnitVoArray; + } + +} Index: ssts-datasync-default-impl/src/main/java/com/forgon/disinfectsystem/datasynchronization/dao/sznsfy/FindPatientInfoByHospitalNumDaoImpl.java =================================================================== diff -u --- ssts-datasync-default-impl/src/main/java/com/forgon/disinfectsystem/datasynchronization/dao/sznsfy/FindPatientInfoByHospitalNumDaoImpl.java (revision 0) +++ ssts-datasync-default-impl/src/main/java/com/forgon/disinfectsystem/datasynchronization/dao/sznsfy/FindPatientInfoByHospitalNumDaoImpl.java (revision 13772) @@ -0,0 +1,63 @@ +package com.forgon.disinfectsystem.datasynchronization.dao.sznsfy; + +import java.sql.CallableStatement; +import java.sql.Connection; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; + +import org.apache.commons.collections.CollectionUtils; +import org.apache.log4j.Logger; + +import com.forgon.disinfectsystem.datasynchronization.dao.FindPatientInfoByHospitalNumDao; +import com.forgon.disinfectsystem.datasynchronization.model.PatientInfoVO; +import com.forgon.tools.db.DatabaseUtil; +import com.forgon.tools.db.resultset.ResultSetUtil; + +/** + * 根据住院号查询病人信息(南山附幼) + * @author shuyongfu + * + */ +public class FindPatientInfoByHospitalNumDaoImpl implements + FindPatientInfoByHospitalNumDao { + + Logger logger = Logger.getLogger(FindPatientInfoByHospitalNumDaoImpl.class); + + /** + * 根据住院号查询病人信息 + */ + @Override + public PatientInfoVO[] findPatientInfoByHospitalNum(String hospitalNum) { + PatientInfoVO[] patientInfoVOArray = null; + Connection conn = null; + ResultSet rs = null; + List patientInfoVOList = new ArrayList(); + try{ + conn = HisDbConnectionUtil.getConnection(); + CallableStatement cstm = conn.prepareCall("{call web_ZXJ_Query.CSSD_HospitalNumber('"+hospitalNum+"'})}"); + rs = cstm.executeQuery(); + ResultSetUtil.setFieldValueByResultSet(rs , PatientInfoVO.class , patientInfoVOList); + if(CollectionUtils.isNotEmpty(patientInfoVOList)){ + patientInfoVOArray = new PatientInfoVO[patientInfoVOList.size()]; + patientInfoVOList.toArray(patientInfoVOArray); + } + }catch(Exception e){ + logger.error("根据住院号查询病人信息失败" + e); + }finally{ + DatabaseUtil.closeResultSetAndStatement(rs); + if(conn != null){ + try { + conn.close(); + } catch (SQLException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + } + + return patientInfoVOArray; + } + +} Index: ssts-datasync-default-impl/src/main/java/com/forgon/disinfectsystem/datasynchronization/dao/sznsfy/HisDbConnectionUtil.java =================================================================== diff -u --- ssts-datasync-default-impl/src/main/java/com/forgon/disinfectsystem/datasynchronization/dao/sznsfy/HisDbConnectionUtil.java (revision 0) +++ ssts-datasync-default-impl/src/main/java/com/forgon/disinfectsystem/datasynchronization/dao/sznsfy/HisDbConnectionUtil.java (revision 13772) @@ -0,0 +1,22 @@ +package com.forgon.disinfectsystem.datasynchronization.dao.sznsfy; + +import java.sql.Connection; +import java.sql.Driver; +import java.util.Properties; + +import org.apache.log4j.Logger; + +public class HisDbConnectionUtil { + + static Logger logger = Logger.getLogger(HisDbConnectionUtil.class); + public static Connection getConnection(){ + Connection conn = null; + try{ + Driver driver = (Driver)Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance(); + conn = driver.connect("jdbc:odbc:cache", new Properties()); + }catch(Exception e){ + logger.error("获取his数据库连接失败" + e); + } + return conn; + } +} Index: ssts-datasync-default-impl/src/main/java/com/forgon/disinfectsystem/datasynchronization/dao/dgsdhyy/FindPatientInfoByTreatmentNumDaoImpl.java =================================================================== diff -u --- ssts-datasync-default-impl/src/main/java/com/forgon/disinfectsystem/datasynchronization/dao/dgsdhyy/FindPatientInfoByTreatmentNumDaoImpl.java (revision 0) +++ ssts-datasync-default-impl/src/main/java/com/forgon/disinfectsystem/datasynchronization/dao/dgsdhyy/FindPatientInfoByTreatmentNumDaoImpl.java (revision 13772) @@ -0,0 +1,86 @@ +package com.forgon.disinfectsystem.datasynchronization.dao.dgsdhyy; + +import net.sf.json.JSONArray; +import net.sf.json.JSONObject; + +import org.apache.log4j.Logger; + +import com.forgon.disinfectsystem.common.CssdUtils; +import com.forgon.disinfectsystem.datasynchronization.dao.FindPatientInfoByTreatmentNumDao; +import com.forgon.disinfectsystem.datasynchronization.model.PatientInfoVO; +import com.forgon.tools.Constants; + +/** + * 根据诊疗号查询病人信息(南山附幼) + * @author shuyongfu + * + */ +public class FindPatientInfoByTreatmentNumDaoImpl implements + FindPatientInfoByTreatmentNumDao { + + Logger logger = Logger.getLogger(FindPatientInfoByTreatmentNumDaoImpl.class); + + /** + * 根据诊疗号查询病人信息 + */ + @Override + public PatientInfoVO[] findPatientInfoByTreatmentNum(String treatmentNum) { + + PatientInfoVO[] patientInfoVOArray = null; + try{ + String xml = CssdUtils.callWebService(DatasyncConstant.WebserviceAddress, + WebServiceClientHelper.buildInputXml(DatasyncConstant.MethodName_CSSD_ClinicNumber, treatmentNum), Constants.CHARSET_GBK); + JSONObject json = (JSONObject)WebServiceClientHelper.patientXml2Json(xml); + if(json!=null){ + String code = json.optString("Result"); + if(DatasyncConstant.RESULT_OK.equals(code)){ + Object dataTableObj = json.opt("DataTable"); + if(dataTableObj == null){ + return null; + } + JSONObject patientInfo = null; + if(dataTableObj instanceof JSONObject){ + patientInfo = (JSONObject)dataTableObj; + }else if(dataTableObj instanceof JSONArray){ + //拿最近的一次性诊疗记录 + JSONArray obj = (JSONArray)dataTableObj; + patientInfo = obj.optJSONObject(0); + } + Object tNumber = patientInfo.opt("hospitalNumber"); + Object patientName = patientInfo.opt("patientName"); + Object patientAge = patientInfo.opt("patientAge"); + Object patientSex = patientInfo.opt("patientSex"); + Object patientIDCard = patientInfo.opt("patientIDCard"); + Object doctorName = patientInfo.opt("doctorName"); + Object operation = patientInfo.opt("operation"); + Object patientArea = patientInfo.opt("patientArea"); + Object bedNumber = patientInfo.opt("bedNumber"); + Object roomNumber = patientInfo.opt("roomNumber"); + Object remark = patientInfo.opt("remark"); + + PatientInfoVO vo = new PatientInfoVO(); + vo.setPatientNumber(tNumber instanceof String ? (String)tNumber : ""); + vo.setPatientName(patientName instanceof String ? (String)patientName : ""); + vo.setPatientAge(patientAge instanceof String ? (String)patientAge : ""); + vo.setPatientSex(patientSex instanceof String ? (String)patientSex : ""); + vo.setPatientIDCard(patientIDCard instanceof String ? (String)patientIDCard : ""); + vo.setDoctorName(doctorName instanceof String ? (String)doctorName : ""); + vo.setOperation(operation instanceof String ? (String)operation : ""); + vo.setPatientArea(patientArea instanceof String ? (String)patientArea : ""); + vo.setBedNumber(bedNumber instanceof String ? (String)bedNumber : ""); + vo.setRoomNumber(roomNumber instanceof String ? (String)roomNumber : ""); + vo.setRemark(remark instanceof String ? (String)remark : ""); + patientInfoVOArray = new PatientInfoVO[] { vo }; + }else{ + throw new RuntimeException(json.optString("Error")); + } + } + return null; + }catch(Exception e){ + logger.error("根据诊疗号查询病人信息失败" + e); + } + + return patientInfoVOArray; + } + +} Index: ssts-datasync-default-impl/src/main/java/com/forgon/disinfectsystem/datasynchronization/dao/dgsdhyy/FindPatientInfoByHospitalNumDaoImpl.java =================================================================== diff -u --- ssts-datasync-default-impl/src/main/java/com/forgon/disinfectsystem/datasynchronization/dao/dgsdhyy/FindPatientInfoByHospitalNumDaoImpl.java (revision 0) +++ ssts-datasync-default-impl/src/main/java/com/forgon/disinfectsystem/datasynchronization/dao/dgsdhyy/FindPatientInfoByHospitalNumDaoImpl.java (revision 13772) @@ -0,0 +1,85 @@ +package com.forgon.disinfectsystem.datasynchronization.dao.dgsdhyy; + +import net.sf.json.JSONArray; +import net.sf.json.JSONObject; + +import org.apache.log4j.Logger; + +import com.forgon.disinfectsystem.common.CssdUtils; +import com.forgon.disinfectsystem.datasynchronization.dao.FindPatientInfoByHospitalNumDao; +import com.forgon.disinfectsystem.datasynchronization.model.PatientInfoVO; +import com.forgon.tools.Constants; + +/** + * 根据住院号查询病人信息(东莞东华医院) + * @author shuyongfu + * + */ +public class FindPatientInfoByHospitalNumDaoImpl implements + FindPatientInfoByHospitalNumDao { + + Logger logger = Logger.getLogger(FindPatientInfoByHospitalNumDaoImpl.class); + + /** + * 根据住院号查询病人信息 + */ + @Override + public PatientInfoVO[] findPatientInfoByHospitalNum(String hospitalNum) { + PatientInfoVO[] patientInfoVOArray = null; + try{ + String xml = CssdUtils.callWebService(DatasyncConstant.WebserviceAddress, + WebServiceClientHelper.buildInputXml(DatasyncConstant.MethodName_CSSD_HospitalNumber, hospitalNum), Constants.CHARSET_GBK); + JSONObject json = (JSONObject)WebServiceClientHelper.patientXml2Json(xml); + if(json!=null){ + String code = json.optString("Result"); + if(DatasyncConstant.RESULT_OK.equals(code)){ + Object dataTableObj = json.opt("DataTable"); + if(dataTableObj == null){ + return null; + } + JSONObject patientInfo = null; + if(dataTableObj instanceof JSONObject){ + patientInfo = (JSONObject)dataTableObj; + }else if(dataTableObj instanceof JSONArray){ + //拿最近的一次性诊疗记录 + JSONArray obj = (JSONArray)dataTableObj; + patientInfo = obj.optJSONObject(0); + } + Object tNumber = patientInfo.opt("hospitalNumber"); + Object patientName = patientInfo.opt("patientName"); + Object patientAge = patientInfo.opt("patientAge"); + Object patientSex = patientInfo.opt("patientSex"); + Object patientIDCard = patientInfo.opt("patientIDCard"); + Object doctorName = patientInfo.opt("doctorName"); + Object operation = patientInfo.opt("operation"); + Object patientArea = patientInfo.opt("patientArea"); + Object bedNumber = patientInfo.opt("bedNumber"); + Object roomNumber = patientInfo.opt("roomNumber"); + Object remark = patientInfo.opt("remark"); + + PatientInfoVO vo = new PatientInfoVO(); + vo.setPatientNumber(tNumber instanceof String ? (String)tNumber : ""); + vo.setPatientName(patientName instanceof String ? (String)patientName : ""); + vo.setPatientAge(patientAge instanceof String ? (String)patientAge : ""); + vo.setPatientSex(patientSex instanceof String ? (String)patientSex : ""); + vo.setPatientIDCard(patientIDCard instanceof String ? (String)patientIDCard : ""); + vo.setDoctorName(doctorName instanceof String ? (String)doctorName : ""); + vo.setOperation(operation instanceof String ? (String)operation : ""); + vo.setPatientArea(patientArea instanceof String ? (String)patientArea : ""); + vo.setBedNumber(bedNumber instanceof String ? (String)bedNumber : ""); + vo.setRoomNumber(roomNumber instanceof String ? (String)roomNumber : ""); + vo.setRemark(remark instanceof String ? (String)remark : ""); + patientInfoVOArray = new PatientInfoVO[] { vo }; + }else{ + throw new RuntimeException(json.optString("Error")); + } + } + return null; + }catch(Exception e){ + logger.error("根据住院号查询病人信息失败" + e); + } + + return patientInfoVOArray; + } + +} Index: ssts-datasync-default-impl/src/main/java/com/forgon/disinfectsystem/datasynchronization/dao/dgsdhyy/DatasyncConstant.java =================================================================== diff -u --- ssts-datasync-default-impl/src/main/java/com/forgon/disinfectsystem/datasynchronization/dao/dgsdhyy/DatasyncConstant.java (revision 0) +++ ssts-datasync-default-impl/src/main/java/com/forgon/disinfectsystem/datasynchronization/dao/dgsdhyy/DatasyncConstant.java (revision 13772) @@ -0,0 +1,77 @@ +package com.forgon.disinfectsystem.datasynchronization.dao.dgsdhyy; + +/** + * 东莞东华医院接口相关常量 + * @author shuyongfu + * + */ +public class DatasyncConstant { + /** + * 访问授权码 + */ + public static String Licence = "9D9489F373EB4C392B111E0667DC4B22D70FD07DAD55"; + /** + * Webservice地址 + */ + public static String WebserviceAddress = "http://172.16.100.7:10039/EaiServer"; + + /** + * 按诊疗号查询病人信息的接口方法名(作为输入参数) + */ + public static String MethodName_CSSD_ClinicNumber = "CSSD_ClinicNumber"; + + /** + * 按住院号查询病人信息的接口方法名(作为输入参数) + */ + public static String MethodName_CSSD_HospitalNumber = "CSSD_HospitalNumber"; + + /** + * 科室信息的接口方法名(作为输入参数) + */ + public static String MethodName_CSSD_Department = "CSSD_Department"; + + /** + * 人员信息的接口方法名(作为输入参数) + */ + public static String MethodName_CSSD_User = "CSSD_User"; + + /** + * 物品类型信息的接口方法名(作为输入参数) + */ + public static String MethodName_CSSD_TYPE = "CSSD_TYPE"; + + /** + * 物品基础信息信息的接口方法名(作为输入参数) + */ + public static String MethodName_CSSD_MaterialDefinition = "CSSD_MaterialDefinition"; + + /** + * 供货商基础信息的接口方法名(作为输入参数) + */ + public static String MethodName_CSSD_Supplier = "CSSD_Supplier"; + + /** + * 供应室入库信息的接口方法名(作为输入参数) + */ + public static String MethodName_CSSD_MaterialEntry = "CSSD_MaterialEntry"; + + /** + * 供应室出库信息的接口方法名(作为输入参数) + */ + public static String MethodName_CSSD_GodownEntry = "CSSD_GodownEntry"; + + /** + * 材料入库单明细信息的接口方法名(作为输入参数) + */ + public static String MethodName_CSSD_MaterialEntryItem = "CSSD_MaterialEntryItem"; + + /** + * 一次性物品出库信息的接口方法名(作为输入参数) + */ + public static String MethodName_CSSD_GodownEntryItem = "CSSD_GodownEntryItem"; + + /** + * 返回结果正常的输出 + */ + public static String RESULT_OK = "0"; +} Index: forgon-tools/src/main/java/com/forgon/tools/Constants.java =================================================================== diff -u -r12331 -r13772 --- forgon-tools/src/main/java/com/forgon/tools/Constants.java (.../Constants.java) (revision 12331) +++ forgon-tools/src/main/java/com/forgon/tools/Constants.java (.../Constants.java) (revision 13772) @@ -84,8 +84,14 @@ public static String Session_Register_String = "Register_String"; + /** + * 字符编码集的常量定义 + */ + public static String CHARSET_ISO = "ISO8859-1"; + public static String CHARSET_GBK = "GBK"; + public static String CHARSET_GB2312 = "GB2312"; + public static String CHARSET_UTF8 = "UTF-8"; + public static String CHARSET_utf8 = "utf-8"; - - } Index: ssts-datasync-default-impl/src/main/java/com/forgon/disinfectsystem/datasynchronization/dao/dgsdhyy/SyncSupplierDaoImpl.java =================================================================== diff -u --- ssts-datasync-default-impl/src/main/java/com/forgon/disinfectsystem/datasynchronization/dao/dgsdhyy/SyncSupplierDaoImpl.java (revision 0) +++ ssts-datasync-default-impl/src/main/java/com/forgon/disinfectsystem/datasynchronization/dao/dgsdhyy/SyncSupplierDaoImpl.java (revision 13772) @@ -0,0 +1,7 @@ +package com.forgon.disinfectsystem.datasynchronization.dao.dgsdhyy; + +import com.forgon.disinfectsystem.entity.basedatamanager.supplier.Supplier; + +public interface SyncSupplierDaoImpl { + Supplier[] getAllSupplier(); +} Index: ssts-web/src/main/resources/spring/projects/dgsdhyy/applicationContext-his.xml =================================================================== diff -u -r13466 -r13772 --- ssts-web/src/main/resources/spring/projects/dgsdhyy/applicationContext-his.xml (.../applicationContext-his.xml) (revision 13466) +++ ssts-web/src/main/resources/spring/projects/dgsdhyy/applicationContext-his.xml (.../applicationContext-his.xml) (revision 13772) @@ -41,55 +41,13 @@ class="com.forgon.disinfectsystem.datasynchronization.dwr.DataSynchronizationTableManager"> - - - - - + - - - - - + - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file Index: ssts-datasync-default-impl/src/main/java/com/forgon/disinfectsystem/datasynchronization/dao/sznsfy/SyncOrgUnitAndUserDaoImpl.java =================================================================== diff -u --- ssts-datasync-default-impl/src/main/java/com/forgon/disinfectsystem/datasynchronization/dao/sznsfy/SyncOrgUnitAndUserDaoImpl.java (revision 0) +++ ssts-datasync-default-impl/src/main/java/com/forgon/disinfectsystem/datasynchronization/dao/sznsfy/SyncOrgUnitAndUserDaoImpl.java (revision 13772) @@ -0,0 +1,105 @@ +package com.forgon.disinfectsystem.datasynchronization.dao.sznsfy; + +import java.sql.CallableStatement; +import java.sql.Connection; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; + +import org.apache.commons.collections.CollectionUtils; +import org.apache.log4j.Logger; + +import com.forgon.disinfectsystem.datasynchronization.dao.SyncOrgUnitAndUserDao; +import com.forgon.disinfectsystem.datasynchronization.model.OrgUnitVo; +import com.forgon.disinfectsystem.datasynchronization.model.PatientInfoVO; +import com.forgon.disinfectsystem.datasynchronization.model.UserVo; +import com.forgon.tools.db.DatabaseUtil; +import com.forgon.tools.db.resultset.ResultSetUtil; + +/** + * 查询his系统科室与人员信息(南山附幼) + * @author shuyongfu + * + */ +public class SyncOrgUnitAndUserDaoImpl implements SyncOrgUnitAndUserDao { + + Logger logger = Logger.getLogger(SyncOrgUnitAndUserDaoImpl.class); + + /** + * 查询his系统人员信息 + */ + @Override + public UserVo[] getAllUser() { + UserVo[] userVoArray = null; + Connection conn = null; + ResultSet rs = null; + List userVoList = new ArrayList(); + try{ + conn = HisDbConnectionUtil.getConnection(); + CallableStatement cstm = conn.prepareCall("{call web_ZXJ_Query.CSSD_User(})}"); + rs = cstm.executeQuery(); + ResultSetUtil.setFieldValueByResultSet(rs , UserVo.class , userVoList); + if(CollectionUtils.isNotEmpty(userVoList)){ + userVoArray = (UserVo[])userVoList.toArray(); + if(CollectionUtils.isNotEmpty(userVoList)){ + userVoArray = new UserVo[userVoList.size()]; + userVoList.toArray(userVoArray); + } + } + }catch(Exception e){ + logger.error("查询his人员信息失败:" + e); + }finally{ + DatabaseUtil.closeResultSetAndStatement(rs); + if(conn != null){ + try { + conn.close(); + } catch (SQLException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + } + + return userVoArray; + } + + /** + * 查询his系统科室信息 + */ + @Override + public OrgUnitVo[] getAllOrgUnit() { + OrgUnitVo[] orgUnitVoArray = null; + Connection conn = null; + ResultSet rs = null; + List orgUnitVoList = new ArrayList(); + try{ + conn = HisDbConnectionUtil.getConnection(); + CallableStatement cstm = conn.prepareCall("{call web_ZXJ_Query.CSSD_Department(})}"); + rs = cstm.executeQuery(); + ResultSetUtil.setFieldValueByResultSet(rs , OrgUnitVo.class , orgUnitVoList); + if(CollectionUtils.isNotEmpty(orgUnitVoList)){ + orgUnitVoArray = (OrgUnitVo[])orgUnitVoList.toArray(); + if(CollectionUtils.isNotEmpty(orgUnitVoList)){ + orgUnitVoArray = new OrgUnitVo[orgUnitVoList.size()]; + orgUnitVoList.toArray(orgUnitVoArray); + } + } + }catch(Exception e){ + logger.error("查询his科室信息失败" + e); + }finally{ + DatabaseUtil.closeResultSetAndStatement(rs); + if(conn != null){ + try { + conn.close(); + } catch (SQLException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + } + + return orgUnitVoArray; + } + +} Fisheye: Tag 13772 refers to a dead (removed) revision in file `ssts-datasync/src/main/java/com/forgon/disinfectsystem/datasynchronization/dao/sznsfy/FindPatientInfoByTreatmentNumDaoImpl.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 13772 refers to a dead (removed) revision in file `ssts-datasync/src/main/java/com/forgon/disinfectsystem/datasynchronization/dao/sznsfy/HisDbConnectionUtil.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 13772 refers to a dead (removed) revision in file `ssts-datasync/src/main/java/com/forgon/disinfectsystem/datasynchronization/dao/sznsfy/FindPatientInfoByHospitalNumDaoImpl.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 13772 refers to a dead (removed) revision in file `ssts-datasync/src/main/java/com/forgon/disinfectsystem/datasynchronization/dao/sznsfy/SyncOrgUnitAndUserDaoImpl.java'. Fisheye: No comparison available. Pass `N' to diff?