Commit cbd78ff93ecce0ebf3a19814c488f66915c9f4df

Authored by liquanyu
1 parent e957eae280

update code

Showing 1 changed file with 18 additions and 8 deletions

platform-operate-api/src/main/java/com/lyms/hospitalapi/dzfy/DzfyHisService.java View file @ cbd78ff
... ... @@ -454,22 +454,32 @@
454 454 * @param vcCardNo 就诊卡号
455 455 * @return
456 456 */
457   - public List<DzReplace> findAllVcCarddNo(String vcCardNo){
  457 + public List<DzReplace> findAllVcCarddNo(String vcCardNo)
  458 + {
458 459 List<DzReplace> allCardNoList = new ArrayList<DzReplace>();
459   - if (StringUtils.isNotBlank(vcCardNo)) {
  460 + if (StringUtils.isNotBlank(vcCardNo))
  461 + {
460 462 System.out.println("vcCardNo = " + vcCardNo);
461 463 Connection conn = com.lyms.hospitalapi.dzfy.ConnTools.makeHisConnection();
462 464 QueryRunner queryRunner = new QueryRunner(true);
463 465 String sql = "select id as id from zlhis.v_patientinfo where cardno = '"+vcCardNo+"'";
464   - try{
  466 + try
  467 + {
465 468 List<DzReplace> hisDzReplaceList = queryRunner.query(conn,sql,new BeanListHandler<DzReplace>(DzReplace.class));
466   - String jzkSql = "select 病人ID as id,卡号 as cardNo,登记记录 as combTime from zlhis.jzkghjl where 病人ID = '"+hisDzReplaceList.get(0).getId()+"'";
467   - allCardNoList = queryRunner.query(conn,jzkSql,new BeanListHandler<DzReplace>(DzReplace.class));
468   - System.out.println("vcCardNo list " + allCardNoList);
469   - }catch (Exception e){
  469 + if (CollectionUtils.isNotEmpty(hisDzReplaceList))
  470 + {
  471 + String jzkSql = "select 病人ID as id,卡号 as cardNo,登记记录 as combTime from zlhis.jzkghjl where 病人ID = '"+hisDzReplaceList.get(0).getId()+"'";
  472 + allCardNoList = queryRunner.query(conn,jzkSql,new BeanListHandler<DzReplace>(DzReplace.class));
  473 + System.out.println("vcCardNo list " + allCardNoList);
  474 + }
  475 + }
  476 + catch (Exception e)
  477 + {
470 478 DbUtils.closeQuietly(conn);
471 479 ExceptionUtils.catchException(e, "dz his exception ");
472   - }finally {
  480 + }
  481 + finally
  482 + {
473 483 DbUtils.closeQuietly(conn);
474 484 }
475 485 }