diff --git a/platform-operate-api/src/main/java/com/lyms/hospitalapi/lcdcf/ConnTools.java b/platform-operate-api/src/main/java/com/lyms/hospitalapi/lcdcf/ConnTools.java new file mode 100644 index 0000000..c9abcd2 --- /dev/null +++ b/platform-operate-api/src/main/java/com/lyms/hospitalapi/lcdcf/ConnTools.java @@ -0,0 +1,30 @@ +package com.lyms.hospitalapi.lcdcf; + +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.SQLException; + +/** + * 聊城东昌府 + */ +public class ConnTools { + private static String hisDirverClassName = "oracle.jdbc.driver.OracleDriver"; + private static String hisUrl = "jdbc:oracle:thin:@10.2.7.17:1521:ORCL"; + private static String hisUser = "U_LYMS"; + private static String hisPassword = "LYMS_123"; + + public static Connection makeHisConnection() { + Connection conn = null; + try { + Class.forName(hisDirverClassName); + } catch (ClassNotFoundException e) { + e.printStackTrace(); + } + try { + conn = DriverManager.getConnection(hisUrl, hisUser, hisPassword); + } catch (SQLException e) { + e.printStackTrace(); + } + return conn; + } +} diff --git a/platform-operate-api/src/main/java/com/lyms/hospitalapi/lcdcf/HisCheckItems.java b/platform-operate-api/src/main/java/com/lyms/hospitalapi/lcdcf/HisCheckItems.java new file mode 100644 index 0000000..9254fe0 --- /dev/null +++ b/platform-operate-api/src/main/java/com/lyms/hospitalapi/lcdcf/HisCheckItems.java @@ -0,0 +1,44 @@ +package com.lyms.hospitalapi.lcdcf; + +/** + * Created by Administrator on 2017-12-08. + */ +public class HisCheckItems { + + private String id; + private String vcCardNo; + private String time; + private String itemId; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getVcCardNo() { + return vcCardNo; + } + + public void setVcCardNo(String vcCardNo) { + this.vcCardNo = vcCardNo; + } + + public String getTime() { + return time; + } + + public void setTime(String time) { + this.time = time; + } + + public String getItemId() { + return itemId; + } + + public void setItemId(String itemId) { + this.itemId = itemId; + } +} diff --git a/platform-operate-api/src/main/java/com/lyms/hospitalapi/lcdcf/LcdcfHisModel.java b/platform-operate-api/src/main/java/com/lyms/hospitalapi/lcdcf/LcdcfHisModel.java new file mode 100644 index 0000000..7dbf869 --- /dev/null +++ b/platform-operate-api/src/main/java/com/lyms/hospitalapi/lcdcf/LcdcfHisModel.java @@ -0,0 +1,44 @@ +package com.lyms.hospitalapi.lcdcf; + +/** + * Created by Administrator on 2017-12-08. + */ +public class LcdcfHisModel { + + private String id; + private String idCard; + private String phone; + private String bhnum; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getIdCard() { + return idCard; + } + + public void setIdCard(String idCard) { + this.idCard = idCard; + } + + public String getPhone() { + return phone; + } + + public void setPhone(String phone) { + this.phone = phone; + } + + public String getBhnum() { + return bhnum; + } + + public void setBhnum(String bhnum) { + this.bhnum = bhnum; + } +} diff --git a/platform-operate-api/src/main/java/com/lyms/hospitalapi/lcdcf/LcdcfHisService.java b/platform-operate-api/src/main/java/com/lyms/hospitalapi/lcdcf/LcdcfHisService.java new file mode 100644 index 0000000..2f8d2ab --- /dev/null +++ b/platform-operate-api/src/main/java/com/lyms/hospitalapi/lcdcf/LcdcfHisService.java @@ -0,0 +1,79 @@ +package com.lyms.hospitalapi.lcdcf; + +import com.lyms.platform.common.utils.DateUtil; +import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.dbutils.DbUtils; +import org.apache.commons.dbutils.QueryRunner; +import org.apache.commons.dbutils.handlers.BeanListHandler; +import org.springframework.stereotype.Service; + +import java.sql.Connection; +import java.sql.SQLException; +import java.util.*; + +/** + * Created by Administrator on 2017-12-05. + */ + +@Service("lcdcfHisService") +public class LcdcfHisService { + + /** + * 通过住院号查询孕妇手机号码和身份证号码 + * @return + */ + public LcdcfHisModel getHisPatientByZyh(String zyNo) + { + String sql = "select id, idcard as idCard , bhnum, phone from v_patientinfo where bhnum='"+zyNo+"'"; + Connection connection = null; + try { + connection = ConnTools.makeHisConnection(); + QueryRunner queryRunner = new QueryRunner(true); + List LcdcfHisModels = queryRunner.query(connection,sql,new BeanListHandler(LcdcfHisModel.class)); + if(CollectionUtils.isNotEmpty(LcdcfHisModels)) + { + return LcdcfHisModels.get(0); + } + } catch (SQLException e) { + e.printStackTrace(); + } + finally + { + DbUtils.closeQuietly(connection); + } + return null; + } + + + /** + * 获取孕妇当天的lis检查项目 + * @param vcCardNo + * @return + */ + public List getPatientCheckLisItems(String vcCardNo,String time) + { + + String sql = "select ID as id,就诊卡号 as vcCardNo,医嘱内容 as content,开嘱时间 as time,诊疗项目ID as itemId from v_check_items where 就诊卡号='"+vcCardNo+"' and 开嘱时间 like '"+time+"%'"; + Connection connection = null; + try { + connection = ConnTools.makeHisConnection(); + QueryRunner queryRunner = new QueryRunner(true); + List hisCheckItems = queryRunner.query(connection,sql,new BeanListHandler(HisCheckItems.class)); + if(CollectionUtils.isNotEmpty(hisCheckItems)) + { + return hisCheckItems; + } + } catch (SQLException e) { + e.printStackTrace(); + } + finally + { + DbUtils.closeQuietly(connection); + } + return null; + } + +} + + + diff --git a/platform-operate-api/src/main/java/com/lyms/hospitalapi/whfy/ConnTools.java b/platform-operate-api/src/main/java/com/lyms/hospitalapi/whfy/ConnTools.java index bcf70dc..71a0db7 100644 --- a/platform-operate-api/src/main/java/com/lyms/hospitalapi/whfy/ConnTools.java +++ b/platform-operate-api/src/main/java/com/lyms/hospitalapi/whfy/ConnTools.java @@ -14,8 +14,8 @@ public class ConnTools { //分诊叫号 private static String dirverClassName = "com.microsoft.sqlserver.jdbc.SQLServerDriver"; private static String url = "jdbc:sqlserver://200.200.200.53:1433; DatabaseName=MZHSZ"; - private static String user = "123qwe!@#"; - private static String password = "sa"; + private static String user = "sa"; + private static String password = "123qwe!@#"; public static Connection makeHisConnection() { Connection conn = null; diff --git a/platform-operate-api/src/main/java/com/lyms/hospitalapi/whfy/VirtualCallService.java b/platform-operate-api/src/main/java/com/lyms/hospitalapi/whfy/VirtualCallService.java index 3f2d284..db1ae73 100644 --- a/platform-operate-api/src/main/java/com/lyms/hospitalapi/whfy/VirtualCallService.java +++ b/platform-operate-api/src/main/java/com/lyms/hospitalapi/whfy/VirtualCallService.java @@ -5,6 +5,7 @@ import com.lyms.platform.common.result.BaseObjectResponse; import com.lyms.platform.common.result.BaseResponse; import com.lyms.platform.common.utils.DateUtil; import com.lyms.platform.common.utils.ExceptionUtils; +import com.lyms.platform.common.utils.StringUtils; import com.lyms.platform.permission.model.Departments; import com.lyms.platform.permission.model.Users; import com.lyms.platform.permission.service.DepartmentsService; @@ -51,163 +52,207 @@ public class VirtualCallService { String doctorAccount = user.getAccount(); String doctorName = user.getName(); -// -// Enumeration e = request.getHeaderNames(); -// while(e.hasMoreElements()){ -// String headerName = e.nextElement(); -// Enumeration headerValues = request.getHeaders(headerName); -// while(headerValues.hasMoreElements()){ -// System.out.println(headerName+":"+headerValues.nextElement()); -// } -// } - - String ip = request.getHeader("x-real-ip"); - String mac = getMACAddress(ip); + //打印头信息 + Enumeration enumeration = request.getHeaderNames(); + while(enumeration.hasMoreElements()){ + String headerName = enumeration.nextElement(); + Enumeration headerValues = request.getHeaders(headerName); + while(headerValues.hasMoreElements()){ + System.out.println(headerName+":"+headerValues.nextElement()); + } + } + + String ip = getIp(request); System.out.println("time="+ DateUtil.getyyyy_MM_dd_hms(new Date())+";code="+code+";deptName="+deptName+";doctorAccount="+doctorAccount+";doctorName="+doctorName - +";ip="+ip+";mac="+mac); - -// Connection conn = null; -// CallableStatement cs = null; -// try { -// conn = makeHisConnection(); -// //1.1 普通登录 -// //exec usp_mzhs_hsfzinterface '1','192.168.1.219','2052','儿科门诊','00','supervisor','D8-9E-F3-13-A5-86','0',@sex='男' -// cs = conn.prepareCall("{call usp_mzhs_hsfzinterface(?,?,?,?,?,?,?)}"); -// cs.setString(1, "1"); -// cs.setString(2, ip); -// cs.setString(3, code); -// cs.setString(4, deptName); -// cs.setString(5, doctorAccount); -// cs.setString(6, doctorName); -// cs.setString(7, mac); -// ResultSet rs = cs.executeQuery(); -// -// int count = rs.getMetaData().getColumnCount(); -// while (rs.next()) { -// for (int i = 1; i <= count; i++) -// { -// String columnName = rs.getMetaData().getColumnName(i); -// Object obj = rs.getObject(columnName); -// System.out.println("columName=" + columnName+ ";value="+obj); -// } -// } -// -// } -// catch (SQLException e) -// { -// ExceptionUtils.catchException(e, "callLogin exception"); -// result.setErrorcode(ErrorCodeConstants.SYSTEM_ERROR); -// result.setErrormsg("登陆异常"); -// return result; -// } -// finally { -// ConnTools.close(conn,cs); -// } + +";ip="+ip); - result.setErrorcode(ErrorCodeConstants.SUCCESS); - result.setErrormsg("登陆成功"); + Connection conn = null; + CallableStatement cs = null; + try { + conn = makeHisConnection(); + //1.1 普通登录 + //exec usp_mzhs_hsfzinterface '1','192.168.1.219','2052','儿科门诊','00','supervisor','D8-9E-F3-13-A5-86','0',@sex='男' + cs = conn.prepareCall("{call usp_mzhs_hsfzinterface(?,?,?,?,?,?)}"); + cs.setString(1, "1"); + cs.setString(2, ip); + cs.setString(3, code); + cs.setString(4, deptName); + cs.setString(5, doctorAccount); + cs.setString(6, doctorName); + ResultSet rs = cs.executeQuery(); + + int count = rs.getMetaData().getColumnCount(); + while (rs.next()) { + for (int i = 1; i <= count; i++) + { + String columnName = rs.getMetaData().getColumnName(i); + Object obj = rs.getObject(columnName); + System.out.println("callLogin columName=" + columnName+ ";value="+obj); + } + String isSuccess = rs.getString("STATUS"); + if (StringUtils.isNotEmpty(isSuccess) && "T".equals(isSuccess)) + { + result.setErrorcode(ErrorCodeConstants.SUCCESS); + result.setErrormsg("登陆成功"); + return result; + } + } + } + catch (Exception e) + { + ExceptionUtils.catchException(e, "callLogin exception"); + + } + finally { + ConnTools.close(conn,cs); + } + result.setErrorcode(ErrorCodeConstants.SYSTEM_ERROR); + result.setErrormsg("登陆异常"); return result; } public BaseResponse callLoginOut(HttpServletRequest request, Integer userId) { BaseResponse result = new BaseResponse(); - String ip = request.getHeader("X-Real-IP"); + String ip = getIp(request); System.out.println("time="+ DateUtil.getyyyy_MM_dd_hms(new Date())+";ip="+ip); -// Connection conn = null; -// CallableStatement cs = null; -// try { -// conn = makeHisConnection(); -// //5 退出登录 -// //exec usp_mzhs_hsfzinterface 5,'192.168.1.219' -// cs = conn.prepareCall("{call usp_mzhs_hsfzinterface(?,?)}"); -// cs.setString(1, "5"); -// cs.setString(2, ip); -// ResultSet rs = cs.executeQuery(); -// } -// catch (SQLException e) -// { -// ExceptionUtils.catchException(e, "callLoginOut exception"); -// result.setErrorcode(ErrorCodeConstants.SYSTEM_ERROR); -// result.setErrormsg("登出异常"); -// return result; -// } -// finally { -// ConnTools.close(conn,cs); -// } - result.setErrorcode(ErrorCodeConstants.SUCCESS); - result.setErrormsg("登出成功"); - return result; + Connection conn = null; + CallableStatement cs = null; + try { + conn = makeHisConnection(); + //5 退出登录 + //exec usp_mzhs_hsfzinterface 5,'192.168.1.219' + cs = conn.prepareCall("{call usp_mzhs_hsfzinterface(?,?)}"); + cs.setString(1, "5"); + cs.setString(2, ip); + ResultSet rs = cs.executeQuery(); + + int count = rs.getMetaData().getColumnCount(); + while (rs.next()) { + for (int i = 1; i <= count; i++) + { + String columnName = rs.getMetaData().getColumnName(i); + Object obj = rs.getObject(columnName); + System.out.println("callLoginOut columName=" + columnName+ ";value="+obj); + } + String isSuccess = rs.getString("STATUS"); + if (StringUtils.isNotEmpty(isSuccess) && "T".equals(isSuccess)) + { + result.setErrorcode(ErrorCodeConstants.SUCCESS); + result.setErrormsg("登出成功"); + return result; + } + } + } + catch (Exception e) + { + ExceptionUtils.catchException(e, "callLoginOut exception"); + } + finally + { + ConnTools.close(conn,cs); + } + result.setErrorcode(ErrorCodeConstants.SYSTEM_ERROR); + result.setErrormsg("登出异常"); + return result; } public BaseResponse doWorkStatusChange(HttpServletRequest request, Integer userId, String status) { BaseResponse result = new BaseResponse(); - String ip = request.getRemoteAddr(); + String ip = getIp(request); System.out.println("time="+ DateUtil.getyyyy_MM_dd_hms(new Date())+";ip="+ip); -// Connection conn = null; -// CallableStatement cs = null; -// try { -// conn = makeHisConnection(); -// //14 更改诊间状态 --0 修改当前诊间为停诊,1 修改当前诊间为开诊,2 获取当前诊间状态(0 停诊 1 开诊) -// //exec usp_mzhs_hsfzinterface_km 14,'192.16.1.111',@zjzt=2 -// cs = conn.prepareCall("{call usp_mzhs_hsfzinterface_km(?,?,?)}"); -// cs.setString(1, "14"); -// cs.setString(2, ip); -// cs.setString(3, "@zjzt=" + status); -// ResultSet rs = cs.executeQuery(); -// } -// catch (SQLException e) -// { -// ExceptionUtils.catchException(e, "doWorkStatusChange exception"); -// result.setErrorcode(ErrorCodeConstants.SYSTEM_ERROR); -// result.setErrormsg("工作状态修改异常"); -// return result; -// } -// finally { -// ConnTools.close(conn,cs); -// } - result.setErrorcode(ErrorCodeConstants.SUCCESS); - result.setErrormsg("工作状态修改成功"); - return result; + Connection conn = null; + CallableStatement cs = null; + try { + conn = makeHisConnection(); + //14 更改诊间状态 --0 修改当前诊间为停诊,1 修改当前诊间为开诊,2 获取当前诊间状态(0 停诊 1 开诊) + //exec usp_mzhs_hsfzinterface_km 14,'192.16.1.111',@zjzt=2 + cs = conn.prepareCall("{call usp_mzhs_hsfzinterface_km(?,?,?)}"); + cs.setString(1, "14"); + cs.setString(2, ip); + cs.setString(3, "@zjzt=" + status); + ResultSet rs = cs.executeQuery(); + + int count = rs.getMetaData().getColumnCount(); + while (rs.next()) { + for (int i = 1; i <= count; i++) + { + String columnName = rs.getMetaData().getColumnName(i); + Object obj = rs.getObject(columnName); + System.out.println("doWorkStatusChange columName=" + columnName+ ";value="+obj); + } + String isSuccess = rs.getString("STATUS"); + if (StringUtils.isNotEmpty(isSuccess) && "T".equals(isSuccess)) + { + result.setErrorcode(ErrorCodeConstants.SUCCESS); + result.setErrormsg("工作状态修改成功"); + return result; + } + } + } + catch (Exception e) + { + ExceptionUtils.catchException(e, "doWorkStatusChange exception"); + } + finally { + ConnTools.close(conn,cs); + } + result.setErrorcode(ErrorCodeConstants.SYSTEM_ERROR); + result.setErrormsg("工作状态修改异常"); + return result; } public BaseResponse rebackCall(HttpServletRequest request, Integer userId,String patientId) { BaseResponse result = new BaseResponse(); - String ip = request.getRemoteAddr(); + String ip = getIp(request); System.out.println("time="+ DateUtil.getyyyy_MM_dd_hms(new Date())+";ip="+ip); -// Connection conn = null; -// CallableStatement cs = null; -// try { -// conn = makeHisConnection(); -// // 7 复呼 -// // exec usp_mzhs_hsfzinterface 7,'10.58.99.246',@ghxh=2795541 -// cs = conn.prepareCall("{call usp_mzhs_hsfzinterface(?,?,?)}"); -// cs.setString(1, "7"); -// cs.setString(2, ip); -// cs.setString(3, "@ghxh=" + patientId); -// ResultSet rs = cs.executeQuery(); -// } -// catch (SQLException e) -// { -// ExceptionUtils.catchException(e, "rebackCall exception"); -// result.setErrorcode(ErrorCodeConstants.SYSTEM_ERROR); -// result.setErrormsg("复呼异常"); -// return result; -// } -// finally -// { -// ConnTools.close(conn,cs); -// } - result.setErrorcode(ErrorCodeConstants.SUCCESS); - result.setErrormsg("复呼成功"); - return result; + Connection conn = null; + CallableStatement cs = null; + try { + conn = makeHisConnection(); + // 7 复呼 + // exec usp_mzhs_hsfzinterface 7,'10.58.99.246',@ghxh=2795541 + cs = conn.prepareCall("{call usp_mzhs_hsfzinterface(?,?,?)}"); + cs.setString(1, "7"); + cs.setString(2, ip); + cs.setString(3, "@ghxh=" + patientId); + ResultSet rs = cs.executeQuery(); + + int count = rs.getMetaData().getColumnCount(); + while (rs.next()) { + for (int i = 1; i <= count; i++) + { + String columnName = rs.getMetaData().getColumnName(i); + Object obj = rs.getObject(columnName); + System.out.println("rebackCall columName=" + columnName+ ";value="+obj); + } + String isSuccess = rs.getString("STATUS"); + if (StringUtils.isNotEmpty(isSuccess) && "T".equals(isSuccess)) + { + result.setErrorcode(ErrorCodeConstants.SUCCESS); + result.setErrormsg("复呼成功"); + return result; + } + } + } + catch (Exception e) + { + ExceptionUtils.catchException(e, "rebackCall exception"); + } + finally + { + ConnTools.close(conn,cs); + } + result.setErrorcode(ErrorCodeConstants.SYSTEM_ERROR); + result.setErrormsg("复呼异常"); + return result; } @@ -221,61 +266,52 @@ public class VirtualCallService { String code = departments.getShortCode(); String doctorAccount = user.getAccount(); - String ip = request.getRemoteAddr(); - System.out.println("time="+ DateUtil.getyyyy_MM_dd_hms(new Date())+";ip="+ip); + String ip = getIp(request); + System.out.println("waitPatientList time="+ DateUtil.getyyyy_MM_dd_hms(new Date())+";ip="+ip); List> datas = new ArrayList<>(); - Map map = new HashMap<>(); - map.put("patientId","11111"); - map.put("vcCardNo","1234123"); - map.put("name", "张啊"); - map.put("time", "11/21 10:22:21"); - map.put("gender", "男"); - - - Map map1 = new HashMap<>(); - map1.put("patientId","22222"); - map1.put("vcCardNo","2341234"); - map1.put("name", "王丹"); - map1.put("time", "11/21 10:22:21"); - map1.put("gender", "女"); - - datas.add(map); - datas.add(map1); - - - -// Connection conn = null; -// CallableStatement cs = null; -// try { -// conn = makeHisConnection(); -// //6 获取队列列表 -// //exec usp_mzhs_hsfzinterface 6,'192.168.1.219',@ksdm='2052',@ysdm='00' -// cs = conn.prepareCall("{call usp_mzhs_hsfzinterface_km(?,?,?,?)}"); -// cs.setString(1, "6"); -// cs.setString(2, ip); -// cs.setString(3, "@ksdm="+code); -// cs.setString(4, "@ysdm=" + doctorAccount); -// ResultSet rs = cs.executeQuery(); -// Map map = new HashMap<>(); -// map.put("卡号",""); -// map.put("姓名", ""); -// map.put("挂号时间", ""); -// map.put("性别", ""); -// datas.add(map); -// } -// catch (SQLException e) -// { -// ExceptionUtils.catchException(e, "waitPatientList exception"); -// result.setErrorcode(ErrorCodeConstants.SYSTEM_ERROR); -// result.setErrormsg("获取候诊队列失败"); -// result.setData(datas); -// return result; -// } -// finally -// { -// ConnTools.close(conn,cs); -// } + + Connection conn = null; + CallableStatement cs = null; + try { + conn = makeHisConnection(); + //6 获取队列列表 + //exec usp_mzhs_hsfzinterface 6,'192.168.1.219',@ksdm='2052',@ysdm='00' + cs = conn.prepareCall("{call usp_mzhs_hsfzinterface_km(?,?,?,?)}"); + cs.setString(1, "6"); + cs.setString(2, ip); + cs.setString(3, "@ksdm="+code); + cs.setString(4, "@ysdm=" + doctorAccount); + ResultSet rs = cs.executeQuery(); + + int count = rs.getMetaData().getColumnCount(); + while (rs.next()) { + for (int i = 1; i <= count; i++) + { + String columnName = rs.getMetaData().getColumnName(i); + Object obj = rs.getObject(columnName); + System.out.println("waitPatientList columName=" + columnName+ ";value="+obj); + } + Map map = new HashMap<>(); + map.put("patientId",rs.getString("GHXH")); + map.put("vcCardNo",rs.getString("CARDNO")); + map.put("name", rs.getString("HZXM")); + map.put("time", rs.getString("JLRQ")); + map.put("gender", ""); + datas.add(map); + } + } + catch (Exception e) + { + ExceptionUtils.catchException(e, "waitPatientList exception"); + result.setErrorcode(ErrorCodeConstants.SYSTEM_ERROR); + result.setErrormsg("获取候诊队列失败"); + return result; + } + finally + { + ConnTools.close(conn,cs); + } result.setErrorcode(ErrorCodeConstants.SUCCESS); result.setErrormsg("复呼成功"); @@ -288,59 +324,52 @@ public class VirtualCallService { BaseObjectResponse result = new BaseObjectResponse(); - String ip = request.getRemoteAddr(); + String ip = getIp(request); System.out.println("time="+ DateUtil.getyyyy_MM_dd_hms(new Date())+";ip="+ip); nextPatient(ip); List> datas = new ArrayList<>(); - Map map = new HashMap<>(); - map.put("patientId","11111"); - map.put("vcCardNo","1234123"); - map.put("name", "张啊"); - map.put("time", "11/21 10:22:21"); - map.put("gender", "男"); - - - Map map1 = new HashMap<>(); - map1.put("patientId","22222"); - map1.put("vcCardNo","2341234"); - map1.put("name", "王丹"); - map1.put("time", "11/21 10:22:21"); - map1.put("gender", "女"); - - datas.add(map); - datas.add(map1); - -// Connection conn = null; -// CallableStatement cs = null; -// try { -// conn = makeHisConnection(); -// //16 已叫号病人列表 -// //exec usp_mzhs_hsfzinterface 16,'192.168.1.219' -// cs = conn.prepareCall("{call usp_mzhs_hsfzinterface(?,?)}"); -// cs.setString(1, "16"); -// cs.setString(2, ip); -// ResultSet rs = cs.executeQuery(); -// Map map = new HashMap<>(); -// map.put("卡号",""); -// map.put("姓名", ""); -// map.put("叫号时间", ""); -// map.put("性别", ""); -// datas.add(map); -// } -// catch (SQLException e) -// { -// ExceptionUtils.catchException(e, "callPatients exception"); -// result.setErrorcode(ErrorCodeConstants.SYSTEM_ERROR); -// result.setErrormsg("获取候诊队列失败"); -// result.setData(datas); -// return result; -// } -// finally -// { -// ConnTools.close(conn,cs); -// } + + Connection conn = null; + CallableStatement cs = null; + try { + conn = makeHisConnection(); + //16 已叫号病人列表 + //exec usp_mzhs_hsfzinterface 16,'192.168.1.219' + cs = conn.prepareCall("{call usp_mzhs_hsfzinterface(?,?)}"); + cs.setString(1, "16"); + cs.setString(2, ip); + ResultSet rs = cs.executeQuery(); + + int count = rs.getMetaData().getColumnCount(); + while (rs.next()) { + for (int i = 1; i <= count; i++) + { + String columnName = rs.getMetaData().getColumnName(i); + Object obj = rs.getObject(columnName); + System.out.println("callPatients columName=" + columnName+ ";value="+obj); + } + Map map = new HashMap<>(); + map.put("patientId",rs.getString("GHXH")); + map.put("vcCardNo",rs.getString("CARDNO")); + map.put("name", rs.getString("HZXM")); + map.put("time", rs.getString("JLRQ")); + map.put("gender", ""); + datas.add(map); + } + } + catch (Exception e) + { + ExceptionUtils.catchException(e, "callPatients exception"); + result.setErrorcode(ErrorCodeConstants.SYSTEM_ERROR); + result.setErrormsg("获取候诊队列失败"); + return result; + } + finally + { + ConnTools.close(conn,cs); + } result.setErrorcode(ErrorCodeConstants.SUCCESS); result.setErrormsg("复呼成功"); @@ -351,30 +380,35 @@ public class VirtualCallService { private boolean nextPatient(String ip) { -// Connection conn = null; -// CallableStatement cs = null; -// try { -// conn = makeHisConnection(); -// //2 取下一个病人 -// //exec usp_mzhs_hsfzinterface '2','192.168.1.219' -// cs = conn.prepareCall("{call usp_mzhs_hsfzinterface(?,?)}"); -// cs.setString(1, "2"); -// cs.setString(2, ip); -// cs.executeQuery(); -// return true; -// } -// catch (SQLException e) -// { -// ExceptionUtils.catchException(e, "nextPatient exception"); -// } -// finally -// { -// ConnTools.close(conn,cs); -// } + Connection conn = null; + CallableStatement cs = null; + try { + conn = makeHisConnection(); + //2 取下一个病人 + //exec usp_mzhs_hsfzinterface '2','192.168.1.219' + cs = conn.prepareCall("{call usp_mzhs_hsfzinterface(?,?)}"); + cs.setString(1, "2"); + cs.setString(2, ip); + cs.executeQuery(); + return true; + } + catch (Exception e) + { + ExceptionUtils.catchException(e, "nextPatient exception"); + } + finally + { + ConnTools.close(conn,cs); + } return false; } + private String getIp(HttpServletRequest request) + { + return request.getHeader("x-real-ip"); + } + public String getMACAddress(String ip) { String line = ""; String macAddress = ""; diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/UsersController.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/UsersController.java index dc24432..da6a7b7 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/UsersController.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/UsersController.java @@ -1,6 +1,7 @@ package com.lyms.platform.operate.web.controller; +import com.lyms.hospitalapi.whfy.VirtualCallService; import com.lyms.platform.biz.service.BasicConfigService; import com.lyms.platform.biz.service.OrganizationGroupsService; import com.lyms.platform.common.annotation.TokenRequired; @@ -74,6 +75,10 @@ public class UsersController extends BaseController { private SessionProvider iSessionProvider; @Autowired private AutoMatchFacade autoMatchFacade; + + @Autowired + private VirtualCallService virtualCallService; + @Autowired private BasicConfigService basicConfigService; @Autowired @@ -1304,6 +1309,11 @@ public class UsersController extends BaseController { operateLogFacade.addAddOptLog(getUserId(request), Integer.parseInt(hospitalId), param, OptActionEnums.ADD.getId(), "用户登出"); } + if ("2100001635".equals(hospitalId)) + { + System.out.println("威海医生登出,登出虚拟叫号!"); + virtualCallService.callLoginOut(request,getUserId(request)); + } } Map result = new HashMap<>(); result.put("errorcode", ConstantInterface.SUCCESS); diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java index 4e86c5c..9cc68db 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java @@ -1,5 +1,7 @@ package com.lyms.platform.operate.web.facade; +import com.lyms.hospitalapi.lcdcf.LcdcfHisModel; +import com.lyms.hospitalapi.lcdcf.LcdcfHisService; import com.lyms.platform.biz.RemoteService; import com.lyms.platform.biz.service.*; import com.lyms.platform.common.constants.ErrorCodeConstants; @@ -57,6 +59,9 @@ public class MatDeliverFacade { @Autowired private SieveService sieveService; @Autowired + private LcdcfHisService lcdcfHisService; + + @Autowired private AutoMatchFacade autoMatchFacade; @Autowired private PersonService personService; @@ -663,6 +668,21 @@ public class MatDeliverFacade { public BaseResponse queryMatDeliver(MatDeliverQueryRequest deliverQueryRequest, Integer userId) { String hospital = autoMatchFacade.getHospitalId(userId); + + //聊城东昌府分娩界面通过住院号从his中查询到孕妇的身份号码,然后用身份证号码作为院内系统的查询条件查询孕妇信息 + if ("2100001305".equals(hospital) && StringUtils.isNotEmpty(deliverQueryRequest.getZhuYuanNo())) + { + LcdcfHisModel lcdcfHisModel = lcdcfHisService.getHisPatientByZyh(deliverQueryRequest.getZhuYuanNo()); + if (lcdcfHisModel != null && StringUtils.isNotEmpty(lcdcfHisModel.getIdCard())) + { + deliverQueryRequest.setCardNo(lcdcfHisModel.getIdCard()); + } + else + { + return new BaseResponse().setErrormsg("该孕妇还未在本院建档不能进行分娩").setErrorcode(ErrorCodeConstants.NO_DATA); + } + } + //获取 /* Patients patients = antenatalExaminationFacade.findOnePatient(deliverQueryRequest.getCardNo(), deliverQueryRequest.getVcCardNo(), null, hospital, -1); if (null == patients) { diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ViewFacade.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ViewFacade.java index c254a3b..b4641be 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ViewFacade.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ViewFacade.java @@ -3773,9 +3773,9 @@ public class ViewFacade { map.put("dueTimeHour", time.substring(9, 10)); map.put("dueTimeMinute",time.substring(11, 12)); //体重 - map.put("babyWeight", temp.getBabyWeight() == null? "" : UnitUtils.unitSplice(temp.getBabyWeight(), UnitConstants.G)); + map.put("babyWeight", temp.getBabyWeight() == null? "" : temp.getBabyWeight()); //身高 - map.put("babyHeight", temp.getBabyHeight() == null ? "" : UnitUtils.unitSplice(temp.getBabyHeight(), UnitConstants.CM)); + map.put("babyHeight", temp.getBabyHeight() == null ? "" : temp.getBabyHeight()); //健康状态 map.put("babyHealthy", temp.getBabyHealthy()); } @@ -3798,7 +3798,6 @@ public class ViewFacade { tc = chuModel.getProdTime() == null ? "" : String.valueOf(chuModel.getProdTime()); } - map.put("baby", babyList); //胎次 map.put("tc", tc); //产次 @@ -3807,7 +3806,7 @@ public class ViewFacade { //双胎 map.put("tireNumber",data.getTireNumber()); - String deliveryMode = "2"; //为2的时候剖宫产,其他的不选 + String deliveryMode = ""; //为2的时候剖宫产,1为顺产 其他的不选 if (StringUtils.isNotEmpty(data.getDeliveryMode())) { Map m = JsonUtil.str2Obj(data.getDeliveryMode(), Map.class); String fmfs = null; @@ -3816,9 +3815,7 @@ public class ViewFacade { if (b != null) { fmfs = b.toString(); if (fmfs != null) { - if (fmfs.equals("2")) { - - } + deliveryMode = fmfs; } } } @@ -3837,7 +3834,7 @@ public class ViewFacade { map.put("motherName", patients.getUsername()); //母亲年龄 - map.put("motheAge", UnitUtils.unitSplice(DateUtil.getAge(patients.getBirth()), UnitConstants.SUI)); + map.put("motheAge", DateUtil.getAge(patients.getBirth())); // String addressRegister = CommonsHelper.getResidence(patients.getProvinceRegisterId(), patients.getCityRegisterId(), // patients.getAreaRegisterId(), patients.getStreetRegisterId(), patients.getAddressRegister(), basicConfigService); @@ -3849,7 +3846,7 @@ public class ViewFacade { //父亲姓名 map.put("fatherName",patients.getHusbandName() == null ? "" : patients.getHusbandName()); //父亲年龄 - map.put("fatherAge",patients.getHusbandBirth() == null ? "" : UnitUtils.unitSplice(DateUtil.getAge(patients.getHusbandBirth()), UnitConstants.SUI)); + map.put("fatherAge",patients.getHusbandBirth() == null ? "" : DateUtil.getAge(patients.getHusbandBirth())); //父亲工作单位 map.put("fatherWorkUnit", patients.getHworkUnit() == null ? "" : patients.getHworkUnit()); diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/MatDeliverQueryRequest.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/MatDeliverQueryRequest.java index d69471f..4f9e7c2 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/MatDeliverQueryRequest.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/MatDeliverQueryRequest.java @@ -24,6 +24,17 @@ public class MatDeliverQueryRequest { @FormParam private String pid; + //聊城东昌府住院号 + private String zhuYuanNo; + + public String getZhuYuanNo() { + return zhuYuanNo; + } + + public void setZhuYuanNo(String zhuYuanNo) { + this.zhuYuanNo = zhuYuanNo; + } + public String getPid() { return pid; }