Commit feb5bfe5b8429b69d5c2ddccc59a10f3f6e245e9
1 parent
97b2b9fdb9
Exists in
master
and in
6 other branches
虚拟叫号
Showing 3 changed files with 117 additions and 71 deletions
platform-operate-api/src/main/java/com/lyms/hospitalapi/lcdcf/LcdcfHisService.java
View file @
feb5bfe
| ... | ... | @@ -50,12 +50,12 @@ |
| 50 | 50 | * @param vcCardNo |
| 51 | 51 | * @return |
| 52 | 52 | */ |
| 53 | - public List<HisCheckItems> getPatientCheckLisItems(String vcCardNo,String time) | |
| 53 | + public List<HisCheckItems> getPatientCheckLisItems(String vcCardNo) | |
| 54 | 54 | { |
| 55 | - | |
| 56 | - String sql = "select ID as id,就诊卡号 as vcCardNo,医嘱内容 as content,开嘱时间 as time,诊疗项目ID as itemId from v_check_items where 就诊卡号='"+vcCardNo+"' and 开嘱时间 like '"+time+"%'"; | |
| 55 | + String time = DateUtil.getyyyy_MM_dd(new Date()); | |
| 57 | 56 | Connection connection = null; |
| 58 | 57 | try { |
| 58 | + String sql = "select ID as id,就诊卡号 as vcCardNo,医嘱内容 as content,开嘱时间 as time,诊疗项目ID as itemId from v_check_items where 就诊卡号='"+vcCardNo+"' and 开嘱时间 like '"+time+"%'"; | |
| 59 | 59 | connection = ConnTools.makeHisConnection(); |
| 60 | 60 | QueryRunner queryRunner = new QueryRunner(true); |
| 61 | 61 | List<HisCheckItems> hisCheckItems = queryRunner.query(connection,sql,new BeanListHandler<HisCheckItems>(HisCheckItems.class)); |
platform-operate-api/src/main/java/com/lyms/hospitalapi/whfy/VirtualCallService.java
View file @
feb5bfe
| ... | ... | @@ -20,11 +20,9 @@ |
| 20 | 20 | import java.io.LineNumberReader; |
| 21 | 21 | import java.net.InetAddress; |
| 22 | 22 | import java.net.NetworkInterface; |
| 23 | -import java.sql.CallableStatement; | |
| 24 | -import java.sql.Connection; | |
| 25 | -import java.sql.ResultSet; | |
| 26 | -import java.sql.SQLException; | |
| 23 | +import java.sql.*; | |
| 27 | 24 | import java.util.*; |
| 25 | +import java.util.Date; | |
| 28 | 26 | |
| 29 | 27 | import static com.lyms.hospitalapi.whfy.ConnTools.makeHisConnection; |
| 30 | 28 | |
| ... | ... | @@ -71,7 +69,7 @@ |
| 71 | 69 | CallableStatement cs = null; |
| 72 | 70 | try { |
| 73 | 71 | conn = makeHisConnection(); |
| 74 | - //1.1 普通登录 | |
| 72 | + //1.1 普通登录 '1','200.200.3.164','05030101','产二门诊','10018','滕振娟' | |
| 75 | 73 | //exec usp_mzhs_hsfzinterface '1','192.168.1.219','2052','儿科门诊','00','supervisor','D8-9E-F3-13-A5-86','0',@sex='男' |
| 76 | 74 | cs = conn.prepareCall("{call usp_mzhs_hsfzinterface(?,?,?,?,?,?)}"); |
| 77 | 75 | cs.setString(1, "1"); |
| 78 | 76 | |
| 79 | 77 | |
| ... | ... | @@ -80,23 +78,24 @@ |
| 80 | 78 | cs.setString(4, deptName); |
| 81 | 79 | cs.setString(5, doctorAccount); |
| 82 | 80 | cs.setString(6, doctorName); |
| 83 | - ResultSet rs = cs.executeQuery(); | |
| 81 | + cs.execute(); | |
| 82 | + ResultSet rs = cs.getResultSet(); | |
| 84 | 83 | |
| 85 | 84 | int count = rs.getMetaData().getColumnCount(); |
| 86 | 85 | while (rs.next()) { |
| 87 | 86 | for (int i = 1; i <= count; i++) |
| 88 | 87 | { |
| 89 | 88 | String columnName = rs.getMetaData().getColumnName(i); |
| 90 | - Object obj = rs.getObject(columnName); | |
| 91 | - System.out.println("callLogin columName=" + columnName+ ";value="+obj); | |
| 89 | + Object value = rs.getObject(columnName); | |
| 90 | + System.out.println(ip+";callLogin columName=" + columnName+ ";value="+value); | |
| 91 | + if (value != null && "T".equals(String.valueOf(value))) | |
| 92 | + { | |
| 93 | + result.setErrorcode(ErrorCodeConstants.SUCCESS); | |
| 94 | + result.setErrormsg("登陆成功"); | |
| 95 | + return result; | |
| 96 | + } | |
| 92 | 97 | } |
| 93 | - String isSuccess = rs.getString("STATUS"); | |
| 94 | - if (StringUtils.isNotEmpty(isSuccess) && "T".equals(isSuccess)) | |
| 95 | - { | |
| 96 | - result.setErrorcode(ErrorCodeConstants.SUCCESS); | |
| 97 | - result.setErrormsg("登陆成功"); | |
| 98 | - return result; | |
| 99 | - } | |
| 98 | + | |
| 100 | 99 | } |
| 101 | 100 | } |
| 102 | 101 | catch (Exception e) |
| 103 | 102 | |
| 104 | 103 | |
| 105 | 104 | |
| ... | ... | @@ -127,25 +126,26 @@ |
| 127 | 126 | cs = conn.prepareCall("{call usp_mzhs_hsfzinterface(?,?)}"); |
| 128 | 127 | cs.setString(1, "5"); |
| 129 | 128 | cs.setString(2, ip); |
| 130 | - ResultSet rs = cs.executeQuery(); | |
| 129 | + cs.execute(); | |
| 130 | + ResultSet rs = cs.getResultSet(); | |
| 131 | 131 | |
| 132 | 132 | int count = rs.getMetaData().getColumnCount(); |
| 133 | 133 | while (rs.next()) { |
| 134 | 134 | for (int i = 1; i <= count; i++) |
| 135 | 135 | { |
| 136 | 136 | String columnName = rs.getMetaData().getColumnName(i); |
| 137 | - Object obj = rs.getObject(columnName); | |
| 138 | - System.out.println("callLoginOut columName=" + columnName+ ";value="+obj); | |
| 137 | + Object value = rs.getObject(columnName); | |
| 138 | + System.out.println(ip+" ;callLoginOut columName=" + columnName+ ";value="+value); | |
| 139 | + | |
| 140 | + if (value != null && "T".equals(String.valueOf(value))) | |
| 141 | + { | |
| 142 | + result.setErrorcode(ErrorCodeConstants.SUCCESS); | |
| 143 | + result.setErrormsg("登陆成功"); | |
| 144 | + return result; | |
| 145 | + } | |
| 146 | + | |
| 139 | 147 | } |
| 140 | - String isSuccess = rs.getString("STATUS"); | |
| 141 | - if (StringUtils.isNotEmpty(isSuccess) && "T".equals(isSuccess)) | |
| 142 | - { | |
| 143 | - result.setErrorcode(ErrorCodeConstants.SUCCESS); | |
| 144 | - result.setErrormsg("登出成功"); | |
| 145 | - return result; | |
| 146 | - } | |
| 147 | 148 | } |
| 148 | - | |
| 149 | 149 | } |
| 150 | 150 | catch (Exception e) |
| 151 | 151 | { |
| 152 | 152 | |
| ... | ... | @@ -183,16 +183,15 @@ |
| 183 | 183 | for (int i = 1; i <= count; i++) |
| 184 | 184 | { |
| 185 | 185 | String columnName = rs.getMetaData().getColumnName(i); |
| 186 | - Object obj = rs.getObject(columnName); | |
| 187 | - System.out.println("doWorkStatusChange columName=" + columnName+ ";value="+obj); | |
| 186 | + Object value = rs.getObject(columnName); | |
| 187 | + System.out.println(ip+";doWorkStatusChange columName=" + columnName+ ";value="+value); | |
| 188 | + if (value != null && "T".equals(String.valueOf(value))) | |
| 189 | + { | |
| 190 | + result.setErrorcode(ErrorCodeConstants.SUCCESS); | |
| 191 | + result.setErrormsg("登陆成功"); | |
| 192 | + return result; | |
| 193 | + } | |
| 188 | 194 | } |
| 189 | - String isSuccess = rs.getString("STATUS"); | |
| 190 | - if (StringUtils.isNotEmpty(isSuccess) && "T".equals(isSuccess)) | |
| 191 | - { | |
| 192 | - result.setErrorcode(ErrorCodeConstants.SUCCESS); | |
| 193 | - result.setErrormsg("工作状态修改成功"); | |
| 194 | - return result; | |
| 195 | - } | |
| 196 | 195 | } |
| 197 | 196 | } |
| 198 | 197 | catch (Exception e) |
| 199 | 198 | |
| 200 | 199 | |
| ... | ... | @@ -223,23 +222,24 @@ |
| 223 | 222 | cs.setString(1, "7"); |
| 224 | 223 | cs.setString(2, ip); |
| 225 | 224 | cs.setString(3, "@ghxh=" + patientId); |
| 226 | - ResultSet rs = cs.executeQuery(); | |
| 225 | + cs.execute(); | |
| 226 | + ResultSet rs = cs.getResultSet(); | |
| 227 | 227 | |
| 228 | 228 | int count = rs.getMetaData().getColumnCount(); |
| 229 | 229 | while (rs.next()) { |
| 230 | 230 | for (int i = 1; i <= count; i++) |
| 231 | 231 | { |
| 232 | 232 | String columnName = rs.getMetaData().getColumnName(i); |
| 233 | - Object obj = rs.getObject(columnName); | |
| 234 | - System.out.println("rebackCall columName=" + columnName+ ";value="+obj); | |
| 233 | + Object value = rs.getObject(columnName); | |
| 234 | + System.out.println(ip+";rebackCall columName=" + columnName+ ";value="+value); | |
| 235 | + if (value != null && "T".equals(String.valueOf(value))) | |
| 236 | + { | |
| 237 | + result.setErrorcode(ErrorCodeConstants.SUCCESS); | |
| 238 | + result.setErrormsg("登陆成功"); | |
| 239 | + return result; | |
| 240 | + } | |
| 241 | + | |
| 235 | 242 | } |
| 236 | - String isSuccess = rs.getString("STATUS"); | |
| 237 | - if (StringUtils.isNotEmpty(isSuccess) && "T".equals(isSuccess)) | |
| 238 | - { | |
| 239 | - result.setErrorcode(ErrorCodeConstants.SUCCESS); | |
| 240 | - result.setErrormsg("复呼成功"); | |
| 241 | - return result; | |
| 242 | - } | |
| 243 | 243 | } |
| 244 | 244 | } |
| 245 | 245 | catch (Exception e) |
| ... | ... | @@ -267,7 +267,7 @@ |
| 267 | 267 | String doctorAccount = user.getAccount(); |
| 268 | 268 | |
| 269 | 269 | String ip = getIp(request); |
| 270 | - System.out.println("waitPatientList time="+ DateUtil.getyyyy_MM_dd_hms(new Date())+";ip="+ip); | |
| 270 | + System.out.println("waitPatientList time=" + DateUtil.getyyyy_MM_dd_hms(new Date()) + ";ip=" + ip); | |
| 271 | 271 | |
| 272 | 272 | List<Map<String,String>> datas = new ArrayList<>(); |
| 273 | 273 | |
| 274 | 274 | |
| 275 | 275 | |
| ... | ... | @@ -282,15 +282,22 @@ |
| 282 | 282 | cs.setString(2, ip); |
| 283 | 283 | cs.setString(3, "@ksdm="+code); |
| 284 | 284 | cs.setString(4, "@ysdm=" + doctorAccount); |
| 285 | - ResultSet rs = cs.executeQuery(); | |
| 285 | + cs.execute(); | |
| 286 | + ResultSet rs = cs.getResultSet(); | |
| 286 | 287 | |
| 287 | 288 | int count = rs.getMetaData().getColumnCount(); |
| 289 | + boolean isSuccess = false; | |
| 288 | 290 | while (rs.next()) { |
| 289 | 291 | for (int i = 1; i <= count; i++) |
| 290 | 292 | { |
| 291 | 293 | String columnName = rs.getMetaData().getColumnName(i); |
| 292 | - Object obj = rs.getObject(columnName); | |
| 293 | - System.out.println("waitPatientList columName=" + columnName+ ";value="+obj); | |
| 294 | + Object value = rs.getObject(columnName); | |
| 295 | + System.out.println(ip+"waitPatientList columName=" + columnName+ ";value="+value); | |
| 296 | + if (value != null && "T".equals(String.valueOf(value))) | |
| 297 | + { | |
| 298 | + isSuccess = true; | |
| 299 | + } | |
| 300 | + | |
| 294 | 301 | } |
| 295 | 302 | Map<String,String> map = new HashMap<>(); |
| 296 | 303 | map.put("patientId",rs.getString("GHXH")); |
| 297 | 304 | |
| 298 | 305 | |
| 299 | 306 | |
| ... | ... | @@ -300,23 +307,29 @@ |
| 300 | 307 | map.put("gender", ""); |
| 301 | 308 | datas.add(map); |
| 302 | 309 | } |
| 310 | + | |
| 311 | + if (isSuccess) | |
| 312 | + { | |
| 313 | + result.setErrorcode(ErrorCodeConstants.SUCCESS); | |
| 314 | + result.setErrormsg("获取候诊队列成功"); | |
| 315 | + result.setData(datas); | |
| 316 | + return result; | |
| 317 | + } | |
| 303 | 318 | } |
| 304 | 319 | catch (Exception e) |
| 305 | 320 | { |
| 306 | 321 | ExceptionUtils.catchException(e, "waitPatientList exception"); |
| 307 | - result.setErrorcode(ErrorCodeConstants.SYSTEM_ERROR); | |
| 308 | - result.setErrormsg("获取候诊队列失败"); | |
| 309 | - return result; | |
| 322 | + | |
| 310 | 323 | } |
| 311 | 324 | finally |
| 312 | 325 | { |
| 313 | 326 | ConnTools.close(conn,cs); |
| 314 | 327 | } |
| 315 | - | |
| 316 | - result.setErrorcode(ErrorCodeConstants.SUCCESS); | |
| 317 | - result.setErrormsg("复呼成功"); | |
| 318 | - result.setData(datas); | |
| 328 | + result.setErrorcode(ErrorCodeConstants.SYSTEM_ERROR); | |
| 329 | + result.setErrormsg("获取候诊队列失败"); | |
| 319 | 330 | return result; |
| 331 | + | |
| 332 | + | |
| 320 | 333 | } |
| 321 | 334 | |
| 322 | 335 | |
| 323 | 336 | |
| 324 | 337 | |
| ... | ... | @@ -340,15 +353,23 @@ |
| 340 | 353 | cs = conn.prepareCall("{call usp_mzhs_hsfzinterface(?,?)}"); |
| 341 | 354 | cs.setString(1, "16"); |
| 342 | 355 | cs.setString(2, ip); |
| 343 | - ResultSet rs = cs.executeQuery(); | |
| 356 | + cs.execute(); | |
| 357 | + ResultSet rs = cs.getResultSet(); | |
| 344 | 358 | |
| 345 | 359 | int count = rs.getMetaData().getColumnCount(); |
| 360 | + boolean isSuccess = false; | |
| 346 | 361 | while (rs.next()) { |
| 347 | 362 | for (int i = 1; i <= count; i++) |
| 348 | 363 | { |
| 349 | 364 | String columnName = rs.getMetaData().getColumnName(i); |
| 350 | - Object obj = rs.getObject(columnName); | |
| 351 | - System.out.println("callPatients columName=" + columnName+ ";value="+obj); | |
| 365 | + Object value = rs.getObject(columnName); | |
| 366 | + System.out.println("callPatients columName=" + columnName+ ";value="+value); | |
| 367 | + | |
| 368 | + if (value != null && "T".equals(String.valueOf(value))) | |
| 369 | + { | |
| 370 | + isSuccess = true; | |
| 371 | + } | |
| 372 | + | |
| 352 | 373 | } |
| 353 | 374 | Map<String,String> map = new HashMap<>(); |
| 354 | 375 | map.put("patientId",rs.getString("GHXH")); |
| 355 | 376 | |
| 356 | 377 | |
| 357 | 378 | |
| ... | ... | @@ -358,23 +379,29 @@ |
| 358 | 379 | map.put("gender", ""); |
| 359 | 380 | datas.add(map); |
| 360 | 381 | } |
| 382 | + | |
| 383 | + if (isSuccess) | |
| 384 | + { | |
| 385 | + result.setErrorcode(ErrorCodeConstants.SUCCESS); | |
| 386 | + result.setErrormsg("呼叫成功"); | |
| 387 | + result.setData(datas); | |
| 388 | + return result; | |
| 389 | + } | |
| 390 | + | |
| 361 | 391 | } |
| 362 | 392 | catch (Exception e) |
| 363 | 393 | { |
| 364 | 394 | ExceptionUtils.catchException(e, "callPatients exception"); |
| 365 | - result.setErrorcode(ErrorCodeConstants.SYSTEM_ERROR); | |
| 366 | - result.setErrormsg("获取候诊队列失败"); | |
| 367 | - return result; | |
| 395 | + | |
| 368 | 396 | } |
| 369 | 397 | finally |
| 370 | 398 | { |
| 371 | 399 | ConnTools.close(conn,cs); |
| 372 | 400 | } |
| 373 | - | |
| 374 | - result.setErrorcode(ErrorCodeConstants.SUCCESS); | |
| 375 | - result.setErrormsg("复呼成功"); | |
| 376 | - result.setData(datas); | |
| 401 | + result.setErrorcode(ErrorCodeConstants.SYSTEM_ERROR); | |
| 402 | + result.setErrormsg("呼叫失败"); | |
| 377 | 403 | return result; |
| 404 | + | |
| 378 | 405 | } |
| 379 | 406 | |
| 380 | 407 | |
| ... | ... | @@ -389,7 +416,7 @@ |
| 389 | 416 | cs = conn.prepareCall("{call usp_mzhs_hsfzinterface(?,?)}"); |
| 390 | 417 | cs.setString(1, "2"); |
| 391 | 418 | cs.setString(2, ip); |
| 392 | - cs.executeQuery(); | |
| 419 | + cs.execute(); | |
| 393 | 420 | return true; |
| 394 | 421 | } |
| 395 | 422 | catch (Exception e) |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/LisController.java
View file @
feb5bfe
| 1 | 1 | package com.lyms.platform.operate.web.controller; |
| 2 | 2 | |
| 3 | +import com.lyms.hospitalapi.lcdcf.LcdcfHisService; | |
| 3 | 4 | import com.lyms.platform.common.annotation.TokenRequired; |
| 4 | 5 | import com.lyms.platform.common.base.BaseController; |
| 5 | 6 | import com.lyms.platform.common.base.LoginContext; |
| ... | ... | @@ -44,6 +45,9 @@ |
| 44 | 45 | @Autowired |
| 45 | 46 | private LisFacade lisFacade; |
| 46 | 47 | |
| 48 | + @Autowired | |
| 49 | + private LcdcfHisService lcdcfHisService; | |
| 50 | + | |
| 47 | 51 | /** |
| 48 | 52 | * 保存各个医院上传上来的lis数据,该数据保存在mysql数据库 |
| 49 | 53 | * 每条lis数据中保存了属于那个医院的id |
| ... | ... | @@ -238,7 +242,22 @@ |
| 238 | 242 | @RequestParam(required = true) String checkTime, |
| 239 | 243 | HttpServletRequest request) { |
| 240 | 244 | LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); |
| 241 | - return lisFacade.getBabyLisAssistCheckInfo(vcCardNo, phone,checkTime,loginState.getId()); | |
| 245 | + return lisFacade.getBabyLisAssistCheckInfo(vcCardNo, phone, checkTime, loginState.getId()); | |
| 246 | + } | |
| 247 | + | |
| 248 | + | |
| 249 | + /** | |
| 250 | + * 聊城东昌妇幼保健院 获取孕妇当天检查了那些项 | |
| 251 | + * @param vcCardNo | |
| 252 | + * @return | |
| 253 | + */ | |
| 254 | + @RequestMapping(method = RequestMethod.GET, value = "/getDcfyLisCheck") | |
| 255 | + @ResponseBody | |
| 256 | + @TokenRequired | |
| 257 | + public BaseResponse getDcfyLisCheck(@RequestParam(required = true) String vcCardNo, | |
| 258 | + HttpServletRequest request) { | |
| 259 | + return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.SUCCESS). | |
| 260 | + setErrormsg(ErrorCodeConstants.SUCCESS_DESCRIPTION).setData(lcdcfHisService.getPatientCheckLisItems(vcCardNo)); | |
| 242 | 261 | } |
| 243 | 262 | } |