Index: ssts-datasync-default-impl/src/main/java/com/forgon/disinfectsystem/datasynchronization/dao/fsfy/WebServiceClientHelper.java =================================================================== diff -u --- ssts-datasync-default-impl/src/main/java/com/forgon/disinfectsystem/datasynchronization/dao/fsfy/WebServiceClientHelper.java (revision 0) +++ ssts-datasync-default-impl/src/main/java/com/forgon/disinfectsystem/datasynchronization/dao/fsfy/WebServiceClientHelper.java (revision 19645) @@ -0,0 +1,119 @@ +package com.forgon.disinfectsystem.datasynchronization.dao.fsfy; + + +import org.apache.log4j.Logger; + +/** + * 佛山妇幼webservice帮助类 + * @author shuyongfu + * @since 2017-08-22 + */ +public class WebServiceClientHelper { + + private final static Logger logger = Logger.getLogger(WebServiceClientHelper.class); + + /** + * 构造接口输入参数 + * @param transIdName + * @param arg + * @return + */ + public static String buildInputXml(String transIdName , String... args){ + String inputXml = ""; + //门诊病人 + if (DatasyncConstant.TransId_ClinicNumber.equals(transIdName)) { + inputXml = "" + + "" + + "" + + "" + + "CSSD201808081111111234"+ DatasyncConstant.AppId +"" + transIdName + ""+ args[0] +""+ args[0] +"]]>" + + "" + + "" + + ""; + } else if (DatasyncConstant.TransId_HospitalNumber.equals(transIdName)) { + //住院病人 + inputXml = "" + + "" + + "" + + "" + + "CSSD201808081111111234"+ DatasyncConstant.AppId +"" + transIdName + ""+ args[0] +""+ args[0] +"]]>" + + "" + + "" + + ""; + } else if (DatasyncConstant.TransId_Department.equals(transIdName)) { + //科室 + inputXml = "" + + "" + + "" + + "" + + "CSSD201708081112345678"+ DatasyncConstant.AppId +"" + transIdName + "]]>" + + "" + + "" + + ""; + } else if (DatasyncConstant.TransId_User.equals(transIdName)) { + //人员 + inputXml = "" + + "" + + "" + + "" + + "CSSD201708081112345678"+ DatasyncConstant.AppId +"" + transIdName + "]]>" + + "" + + "" + + ""; + } else if (DatasyncConstant.TransId_MaterialEntry.equals(transIdName)) { + //入库单 + inputXml = "" + + "" + + "" + + "" + + "CSSD201708081112345678"+ DatasyncConstant.AppId +"" + transIdName + ""+ args[0] +""+ args[1] +"]]>" + + "" + + "" + + ""; + } else if (DatasyncConstant.TransId_GodownEntry.equals(transIdName)) { + //退库单 + inputXml = "" + + "" + + "" + + "" + + "CSSD201708081112345678"+ DatasyncConstant.AppId +"" + transIdName + ""+ args[0] +""+ args[1] +"]]>" + + "" + + "" + + ""; + } else if (DatasyncConstant.TransId_MaterialEntryItem.equals(transIdName)) { + //入库明细 + inputXml = "" + + "" + + "" + + "" + + "CSSD201708081112345678"+ DatasyncConstant.AppId +"" + transIdName + ""+ args[0] +"]]>" + + "" + + "" + + ""; + } else if (DatasyncConstant.TransId_GodownEntryItem.equals(transIdName)) { + //退库明细 + inputXml = "" + + "" + + "" + + "" + + "CSSD201708081112345678"+ DatasyncConstant.AppId +"" + transIdName + ""+ args[0] +"]]>" + + "" + + "" + + ""; + } else if (DatasyncConstant.TransId_MaterialDefinition.equals(transIdName)) { + //物品基础信息 + inputXml = "" + + "" + + "" + + "" + + "CSSD201708081112345678"+ DatasyncConstant.AppId +"" + transIdName + ""+ args[0] +""+ args[0] +"]]>" + + "" + + "" + + ""; + } else { + throw new RuntimeException("不存在此transIdName:" + transIdName); + } + return inputXml; + } + +} Index: ssts-datasync-default-impl/src/main/java/com/forgon/disinfectsystem/datasynchronization/dao/fsfy/FindPatientInfoByHospitalNumDaoImpl.java =================================================================== diff -u --- ssts-datasync-default-impl/src/main/java/com/forgon/disinfectsystem/datasynchronization/dao/fsfy/FindPatientInfoByHospitalNumDaoImpl.java (revision 0) +++ ssts-datasync-default-impl/src/main/java/com/forgon/disinfectsystem/datasynchronization/dao/fsfy/FindPatientInfoByHospitalNumDaoImpl.java (revision 19645) @@ -0,0 +1,91 @@ +package com.forgon.disinfectsystem.datasynchronization.dao.fsfy; + +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 + * @since 2017-08-22 + */ +public class FindPatientInfoByHospitalNumDaoImpl implements + FindPatientInfoByHospitalNumDao { + + Logger logger = Logger.getLogger(FindPatientInfoByHospitalNumDaoImpl.class); + + /** + * 根据住院号查询病人信息 + */ + @Override + public PatientInfoVO[] findPatientInfoByHospitalNum(String hospitalNum) { + PatientInfoVO[] patientInfoVOArray = null; + try{ + //测试数据,建议代码保留往后可以本地调试 + //String xml = "CSSD201808081111111234CSSDHospitalNumber0000success3494841281234梁峻豪9岁1440608200711050015李春景外科住院W+23"; + String xml = CssdUtils.callWebService(DatasyncConstant.WebserviceAddress, + WebServiceClientHelper.buildInputXml(DatasyncConstant.TransId_HospitalNumber, hospitalNum), Constants.CHARSET_UTF8); + JSONObject json = (JSONObject)CssdUtils.xml2JsonCommon(xml); + if(json!=null){ + JSONObject headJsonObject = json.optJSONObject("head"); + String code = headJsonObject.optString("result"); + if(DatasyncConstant.RESULT_OK.equals(code)){ + JSONObject patientInfo = json.optJSONObject("body").optJSONObject("rows"); + if(patientInfo == null){ + return null; + } + 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 operationTime = patientInfo.opt("operationTime"); + Object patientArea = patientInfo.opt("patientArea"); + Object bedNumber = patientInfo.opt("bedNumber"); + Object roomNumber = patientInfo.opt("roomNumber"); + Object remark = patientInfo.opt("remark"); + + Object washHandNurse = patientInfo.opt("washHandNurse"); + Object circuitNurse = patientInfo.opt("circuitNurse"); + + 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.setOperationTime(operationTime instanceof String ? (String)operationTime : ""); + 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 : ""); + + vo.setWashHandNurse(washHandNurse instanceof String ? (String)washHandNurse : ""); + vo.setCircuitNurse(circuitNurse instanceof String ? (String)circuitNurse : ""); + patientInfoVOArray = new PatientInfoVO[] { vo }; + }else{ + throw new RuntimeException(headJsonObject.optString("resultMsg")); + } + } + }catch(Exception e){ + logger.error("根据住院号查询病人信息失败" + e); + } + + return patientInfoVOArray; + } + + @Override + public PatientInfoVO[] findPatientInfoByHospitalNumBeforeOperation( + String hospitalNum) { + return findPatientInfoByHospitalNum(hospitalNum); + } +} Index: ssts-datasync-default-impl/src/main/java/com/forgon/disinfectsystem/datasynchronization/dao/fsfy/FindPatientInfoByTreatmentNumDaoImpl.java =================================================================== diff -u --- ssts-datasync-default-impl/src/main/java/com/forgon/disinfectsystem/datasynchronization/dao/fsfy/FindPatientInfoByTreatmentNumDaoImpl.java (revision 0) +++ ssts-datasync-default-impl/src/main/java/com/forgon/disinfectsystem/datasynchronization/dao/fsfy/FindPatientInfoByTreatmentNumDaoImpl.java (revision 19645) @@ -0,0 +1,82 @@ +package com.forgon.disinfectsystem.datasynchronization.dao.fsfy; + +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 + * @since 2017-08-22 + */ +public class FindPatientInfoByTreatmentNumDaoImpl implements + FindPatientInfoByTreatmentNumDao { + + Logger logger = Logger.getLogger(FindPatientInfoByTreatmentNumDaoImpl.class); + + /** + * 根据诊疗号查询病人信息 + */ + @Override + public PatientInfoVO[] findPatientInfoByTreatmentNum(String treatmentNum) { + //String xml = "CSSD201808081111111234CSSDClinicNumber0000success100008328581708076342杨玉萍24Y2441826199211091725傅瑶产科门诊"; + PatientInfoVO[] patientInfoVOArray = null; + try{ + String xml = CssdUtils.callWebService(DatasyncConstant.WebserviceAddress, + WebServiceClientHelper.buildInputXml(DatasyncConstant.TransId_ClinicNumber, treatmentNum), Constants.CHARSET_UTF8); + JSONObject json = (JSONObject)CssdUtils.xml2JsonCommon(xml); + if(json!=null){ + JSONObject headJsonObject = json.optJSONObject("head"); + String code = headJsonObject.optString("result"); + if(DatasyncConstant.RESULT_OK.equals(code)){ + JSONObject patientInfo = json.optJSONObject("body").optJSONObject("rows"); + if(patientInfo == null){ + return null; + } + 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 operationTime = patientInfo.opt("operationTime"); + Object patientArea = patientInfo.opt("patientArea"); + Object opRoomId = patientInfo.opt("op_room_id"); + 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.setOperationTime(operationTime instanceof String ? (String)operationTime : ""); + vo.setPatientArea(patientArea instanceof String ? (String)patientArea : ""); + vo.setOpRoomId(opRoomId instanceof String ? (String)opRoomId : ""); + 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(headJsonObject.optString("resultMsg")); + } + } + }catch(Exception e){ + logger.error("根据诊疗号查询病人信息失败" + e); + } + + return patientInfoVOArray; + } + +} Index: ssts-web/src/main/resources/spring/projects/fsfy/applicationContext-his-fsfy.xml =================================================================== diff -u -r18228 -r19645 --- ssts-web/src/main/resources/spring/projects/fsfy/applicationContext-his-fsfy.xml (.../applicationContext-his-fsfy.xml) (revision 18228) +++ ssts-web/src/main/resources/spring/projects/fsfy/applicationContext-his-fsfy.xml (.../applicationContext-his-fsfy.xml) (revision 19645) @@ -41,49 +41,9 @@ 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/fsfy/SyncOrgUnitAndUserDaoImpl.java =================================================================== diff -u --- ssts-datasync-default-impl/src/main/java/com/forgon/disinfectsystem/datasynchronization/dao/fsfy/SyncOrgUnitAndUserDaoImpl.java (revision 0) +++ ssts-datasync-default-impl/src/main/java/com/forgon/disinfectsystem/datasynchronization/dao/fsfy/SyncOrgUnitAndUserDaoImpl.java (revision 19645) @@ -0,0 +1,135 @@ +package com.forgon.disinfectsystem.datasynchronization.dao.fsfy; + +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 + * @since 2017-08-22 + */ +public class SyncOrgUnitAndUserDaoImpl implements SyncOrgUnitAndUserDao { + + Logger logger = Logger.getLogger(SyncOrgUnitAndUserDaoImpl.class); + + /** + * 查询his系统人员信息 + */ + @Override + public UserVo[] getAllUser() { + //String xml = "CSSD201708081112345678CSSDUser0000success李元玖80728104张卓玲6498105"; + UserVo[] userVoArray = null; + List userVoList = new ArrayList(); + try{ + String xml = CssdUtils.callWebService(DatasyncConstant.WebserviceAddress, + WebServiceClientHelper.buildInputXml(DatasyncConstant.TransId_User), Constants.CHARSET_UTF8); + JSONObject json = (JSONObject)CssdUtils.xml2JsonCommon(xml); + if(json!=null){ + JSONObject headJsonObject = json.optJSONObject("head"); + String code = headJsonObject.optString("result"); + if(DatasyncConstant.RESULT_OK.equals(code)){ + Object dataTableObj = json.opt("body"); + 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(headJsonObject.optString("resultMsg")); + } + } + }catch(Exception e){ + logger.error("查询his人员信息失败:" + e); + } + + return userVoArray; + } + + /** + * 查询his系统科室信息 + */ + @Override + public OrgUnitVo[] getAllOrgUnit() { + String xml = "CSSD201708081112345678CSSDDepartment0000success打字室8105图书室8104"; + OrgUnitVo[] orgUnitVoArray = null; + List orgUnitVoList = new ArrayList(); + try{ + /*String xml = CssdUtils.callWebService(DatasyncConstant.WebserviceAddress, + WebServiceClientHelper.buildInputXml(DatasyncConstant.TransId_Department), Constants.CHARSET_UTF8);*/ + JSONObject json = (JSONObject)CssdUtils.xml2JsonCommon(xml); + if(json!=null){ + JSONObject headJsonObject = json.optJSONObject("head"); + String code = headJsonObject.optString("result"); + if(DatasyncConstant.RESULT_OK.equals(code)){ + Object dataTableObj = json.opt("body"); + 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(headJsonObject.optString("resultMsg")); + } + } + }catch(Exception e){ + logger.error("查询his科室信息失败" + e); + } + + return orgUnitVoArray; + } + +} Index: ssts-datasync-default-impl/src/main/java/com/forgon/disinfectsystem/datasynchronization/dao/fsfy/DatasyncConstant.java =================================================================== diff -u --- ssts-datasync-default-impl/src/main/java/com/forgon/disinfectsystem/datasynchronization/dao/fsfy/DatasyncConstant.java (revision 0) +++ ssts-datasync-default-impl/src/main/java/com/forgon/disinfectsystem/datasynchronization/dao/fsfy/DatasyncConstant.java (revision 19645) @@ -0,0 +1,70 @@ +package com.forgon.disinfectsystem.datasynchronization.dao.fsfy; + +/** + * 佛山妇幼接口相关常量 + * @author shuyongfu + * @since 2017-08-22 + */ +public class DatasyncConstant { + /** + * Webservice地址 + */ + public final static String WebserviceAddress = "http://192.168.10.44:7001/fsfyservice/Proxy_Services/gysbaseIntf"; + + /** + * app代码(即消毒供应系统的id) + */ + public final static String AppId = "CSSD"; + + /** + * 按诊疗号查询病人信息的接口方法名(作为输入参数) + */ + public final static String TransId_ClinicNumber = "ClinicNumber"; + + /** + * 按住院号查询病人信息的接口方法名(作为输入参数) + */ + public final static String TransId_HospitalNumber = "HospitalNumber"; + + /** + * 科室信息的接口方法名(作为输入参数) + */ + public final static String TransId_Department = "Department"; + + /** + * 人员信息的接口方法名(作为输入参数) + */ + public final static String TransId_User = "User"; + + /** + * 物品基础信息信息的接口方法名(作为输入参数) + */ + public final static String TransId_MaterialDefinition = "MaterialDefinition"; + + + /** + * 供应室入库信息的接口方法名(作为输入参数) + */ + public final static String TransId_MaterialEntry = "MaterialEntry"; + + /** + * 供应室退库信息的接口方法名(作为输入参数) + */ + public final static String TransId_GodownEntry = "GodownEntry"; + + /** + * 材料入库单明细信息的接口方法名(作为输入参数) + */ + public final static String TransId_MaterialEntryItem = "MaterialEntryItem"; + + /** + * 一次性物品出库信息的接口方法名(作为输入参数) + */ + public final static String TransId_GodownEntryItem = "GodownEntryItem"; + + /** + * 接口返回成功的代码 + */ + public final static String RESULT_OK = "0000"; + +} Fisheye: Tag 19645 refers to a dead (removed) revision in file `ssts-web/src/main/resources/spring/projects/fsfy/timer.xml'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 19645 refers to a dead (removed) revision in file `ssts-web/src/main/resources/config/fsfy/mybatis/FindPatientInfoByTreatmentNumMapper.xml'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 19645 refers to a dead (removed) revision in file `ssts-web/src/main/resources/config/fsfy/mybatis/FindPatientInfoByHospitalNumMapper.xml'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 19645 refers to a dead (removed) revision in file `ssts-web/src/main/resources/config/fsfy/mybatis/SyncOrgUnitAndUserMapper.xml'. Fisheye: No comparison available. Pass `N' to diff?