Commit 60db7272661289af504a8b05625669c2cdb943f6

Authored by liquanyu
1 parent a2766d0609

虚拟叫号

Showing 3 changed files with 55 additions and 49 deletions

platform-operate-api/src/main/java/com/lyms/hospitalapi/whfy/VirtualCallService.java View file @ 60db727
... ... @@ -48,7 +48,7 @@
48 48 String code = departments.getShortCode();
49 49 String deptName = departments.getName();
50 50  
51   - String doctorAccount = user.getAccount();
  51 + String doctorAccount = user.getRemarks();
52 52 String doctorName = user.getName();
53 53  
54 54 //打印头信息
55 55  
... ... @@ -74,10 +74,10 @@
74 74 cs = conn.prepareCall("{call usp_mzhs_hsfzinterface(?,?,?,?,?,?)}");
75 75 cs.setString(1, "1");
76 76 cs.setString(2, "200.200.3.53");
77   - cs.setString(3, "050301");
  77 + cs.setString(3, "0501");
78 78 cs.setString(4, "产二门诊");
79   - cs.setString(5, "0258");
80   - cs.setString(6, "宋晓辉");
  79 + cs.setString(5, "10120");
  80 + cs.setString(6, "李文学");
81 81 //
82 82 // cs.setString(2, ip);
83 83 // cs.setString(3, code);
... ... @@ -146,7 +146,7 @@
146 146 if (value != null && "T".equals(String.valueOf(value)))
147 147 {
148 148 result.setErrorcode(ErrorCodeConstants.SUCCESS);
149   - result.setErrormsg("登成功");
  149 + result.setErrormsg("登成功");
150 150 return result;
151 151 }
152 152  
153 153  
... ... @@ -228,10 +228,9 @@
228 228 cs = conn.prepareCall("{call usp_mzhs_hsfzinterface(?,?,?)}");
229 229 cs.setString(1, "7");
230 230 cs.setString(2, "200.200.3.53");
231   - cs.setString(3, "@ghxh=" + patientId);
  231 + cs.setString(3, "@ghxh=18441");
232 232 cs.execute();
233 233 ResultSet rs = cs.getResultSet();
234   -
235 234 int count = rs.getMetaData().getColumnCount();
236 235 while (rs.next()) {
237 236 for (int i = 1; i <= count; i++)
... ... @@ -239,7 +238,7 @@
239 238 String columnName = rs.getMetaData().getColumnName(i);
240 239 Object value = rs.getObject(columnName);
241 240 System.out.println(ip+";rebackCall columName=" + columnName+ ";value="+value);
242   - if (value != null && "T".equals(String.valueOf(value)))
  241 + if (columnName != null && "GHXH".equals(String.valueOf(columnName)))
243 242 {
244 243 result.setErrorcode(ErrorCodeConstants.SUCCESS);
245 244 result.setErrormsg("登陆成功");
246 245  
247 246  
248 247  
249 248  
250 249  
251 250  
... ... @@ -287,43 +286,35 @@
287 286 cs = conn.prepareCall("{call usp_mzhs_hsfzinterface_km(?,?,?,?)}");
288 287 cs.setString(1, "6");
289 288 cs.setString(2, "200.200.3.53");
290   - cs.setString(3, "@ksdm=050301");
291   - cs.setString(4, "@ysdm=0258");
  289 + cs.setString(3, "@ksdm=0501");
  290 + cs.setString(4, "@ysdm=10120");
292 291 cs.execute();
293 292 ResultSet rs = cs.getResultSet();
294 293  
295 294 int count = rs.getMetaData().getColumnCount();
296   - boolean isSuccess = true;
297 295 while (rs.next()) {
298 296 for (int i = 1; i <= count; i++)
299 297 {
300   - isSuccess = false;
301 298 String columnName = rs.getMetaData().getColumnName(i);
302 299 Object value = rs.getObject(columnName);
303 300 System.out.println(ip+"waitPatientList columName=" + columnName+ ";value="+value);
304   - if (value != null && "T".equals(String.valueOf(value)))
305   - {
306   - isSuccess = true;
307   - }
  301 +
308 302 }
309 303 if (isExistColumn(rs,"GHXH"))
310 304 {
311 305 Map<String,String> map = new HashMap<>();
312 306 map.put("patientId",rs.getString("GHXH"));
313   - map.put("vcCardNo",rs.getString("CARDNO"));
  307 + map.put("vcCardNo",rs.getString("GHHX"));
314 308 map.put("name", rs.getString("HZXM"));
315   - map.put("time", rs.getString("JLRQ"));
  309 + map.put("time", rs.getString("ZJDLXH"));
316 310 datas.add(map);
317 311 }
318 312 }
319 313  
320   - if (isSuccess)
321   - {
322   - result.setErrorcode(ErrorCodeConstants.SUCCESS);
323   - result.setErrormsg("获取候诊队列成功");
324   - result.setData(datas);
325   - return result;
326   - }
  314 + result.setErrorcode(ErrorCodeConstants.SUCCESS);
  315 + result.setErrormsg("获取候诊队列成功");
  316 + result.setData(datas);
  317 + return result;
327 318 }
328 319 catch (Exception e)
329 320 {
330 321  
331 322  
... ... @@ -355,14 +346,17 @@
355 346 return false;
356 347 }
357 348  
358   - public BaseResponse callPatients(HttpServletRequest request, Integer userId, String patientId) {
  349 + public BaseResponse callPatients(HttpServletRequest request,boolean isCall) {
359 350  
360 351 BaseObjectResponse result = new BaseObjectResponse();
361 352  
362 353 String ip = getIp(request);
363   - System.out.println("time="+ DateUtil.getyyyy_MM_dd_hms(new Date())+";ip="+ip);
  354 + System.out.println("time=" + DateUtil.getyyyy_MM_dd_hms(new Date()) + ";ip=" + ip);
364 355  
365   - nextPatient(ip);
  356 + if (isCall)
  357 + {
  358 + nextPatient(ip);
  359 + }
366 360  
367 361 List<Map<String,String>> datas = new ArrayList<>();
368 362  
369 363  
370 364  
371 365  
372 366  
373 367  
... ... @@ -379,39 +373,26 @@
379 373 ResultSet rs = cs.getResultSet();
380 374  
381 375 int count = rs.getMetaData().getColumnCount();
382   - boolean isSuccess = true;
383 376 while (rs.next()) {
384 377 for (int i = 1; i <= count; i++)
385 378 {
386   - isSuccess = false;
387 379 String columnName = rs.getMetaData().getColumnName(i);
388 380 Object value = rs.getObject(columnName);
389 381 System.out.println("callPatients columName=" + columnName+ ";value="+value);
390   -
391   - if (value != null && "T".equals(String.valueOf(value)))
392   - {
393   - isSuccess = true;
394   - }
395   -
396 382 }
397 383 if (isExistColumn(rs,"GHXH")) {
398 384 Map<String, String> map = new HashMap<>();
399 385 map.put("patientId", rs.getString("GHXH"));
400   - map.put("vcCardNo", rs.getString("CARDNO"));
  386 + map.put("vcCardNo", rs.getString("GHHX"));
401 387 map.put("name", rs.getString("HZXM"));
402   - map.put("time", rs.getString("JLRQ"));
  388 + map.put("time", rs.getString("ZJDLXH"));
403 389 datas.add(map);
404 390 }
405 391 }
406   -
407   - if (isSuccess)
408   - {
409   - result.setErrorcode(ErrorCodeConstants.SUCCESS);
410   - result.setErrormsg("呼叫成功");
411   - result.setData(datas);
412   - return result;
413   - }
414   -
  392 + result.setErrorcode(ErrorCodeConstants.SUCCESS);
  393 + result.setErrormsg("呼叫成功");
  394 + result.setData(datas);
  395 + return result;
415 396 }
416 397 catch (Exception e)
417 398 {
... ... @@ -441,6 +422,16 @@
441 422 cs.setString(1, "2");
442 423 cs.setString(2, "200.200.3.53");
443 424 cs.execute();
  425 + ResultSet rs = cs.getResultSet();
  426 + int count = rs.getMetaData().getColumnCount();
  427 + while (rs.next()) {
  428 + for (int i = 1; i <= count; i++) {
  429 + String columnName = rs.getMetaData().getColumnName(i);
  430 + Object value = rs.getObject(columnName);
  431 + System.out.println("nextPatient columName=" + columnName + ";value=" + value);
  432 + }
  433 + }
  434 +
444 435 return true;
445 436 }
446 437 catch (Exception e)
... ... @@ -503,6 +494,7 @@
503 494 }
504 495 return macAddress;
505 496 }
  497 +
506 498  
507 499 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/VirtualCallController.java View file @ 60db727
... ... @@ -91,7 +91,20 @@
91 91 }
92 92  
93 93  
  94 + /**
  95 + * 已呼号队列
  96 + * @param httpServletRequest
  97 + * @return
  98 + */
  99 + @RequestMapping(method = RequestMethod.GET, value = "/calledPatientList")
  100 + @ResponseBody
  101 + @TokenRequired
  102 + public BaseResponse calledPatientList(HttpServletRequest httpServletRequest) {
  103 + return virtualCallService.callPatients(httpServletRequest, false);
  104 + }
94 105  
  106 +
  107 +
95 108 /**
96 109 * 叫号
97 110 * 点击叫号同时修改传入的患者状态,并且返回已呼号队列
... ... @@ -103,7 +116,7 @@
103 116 @ResponseBody
104 117 @TokenRequired
105 118 public BaseResponse callPatients(@RequestParam("patientId") String patientId,HttpServletRequest httpServletRequest) {
106   - return virtualCallService.callPatients(httpServletRequest, getUserId(httpServletRequest),patientId);
  119 + return virtualCallService.callPatients(httpServletRequest, true);
107 120 }
108 121  
109 122  
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ViewFacade.java View file @ 60db727
... ... @@ -3923,7 +3923,8 @@
3923 3923 map.put("fatherNation", getBasicConfig(patients.getHnationId()));
3924 3924  
3925 3925 String fage = "";
3926   - if (StringUtils.isNotEmpty(patients.getHcertificateTypeId()) && patients.getHcertificateNum().length() == 18 &&
  3926 + if (StringUtils.isNotEmpty(patients.getHcertificateTypeId()) && StringUtils.isNotEmpty(patients.getHcertificateNum()) &&
  3927 + patients.getHcertificateNum().length() == 18 &&
3927 3928 "70ae1d93-2964-46bc-83fa-bec9ff605b1c".equals(patients.getHcertificateTypeId()))
3928 3929 {
3929 3930 String cardNo = patients.getHcertificateNum().substring(6, 14);