Commit 97454b25a5b368849a51a7120cc89d9b0d565a51
1 parent
dbf057ba46
Exists in
master
and in
6 other branches
新增诸城妇幼更换就诊卡方法
Showing 2 changed files with 88 additions and 88 deletions
platform-operate-api/src/main/java/com/lyms/hospitalapi/zcfy/DzfyHisService.java
View file @
97454b2
1 | -package com.lyms.hospitalapi.zcfy; | |
2 | - | |
3 | -import com.lyms.hospitalapi.pojo.DzReplace; | |
4 | -import com.lyms.platform.common.utils.ExceptionUtils; | |
5 | -import org.apache.commons.collections.CollectionUtils; | |
6 | -import org.apache.commons.dbutils.DbUtils; | |
7 | -import org.apache.commons.dbutils.QueryRunner; | |
8 | -import org.apache.commons.dbutils.handlers.BeanListHandler; | |
9 | -import org.apache.commons.lang.StringUtils; | |
10 | -import org.springframework.stereotype.Service; | |
11 | - | |
12 | -import java.sql.Connection; | |
13 | -import java.util.ArrayList; | |
14 | -import java.util.List; | |
15 | - | |
16 | -/** | |
17 | - * Created by Administrator on 2017/12/18. | |
18 | - */ | |
19 | -@Service("zcfyHisService") | |
20 | -public class DzfyHisService { | |
21 | - | |
22 | - | |
23 | - /** | |
24 | - * 查询病人的换卡记录 | |
25 | - * @param vcCardNo | |
26 | - * @return | |
27 | - */ | |
28 | - public List<DzReplace> findAllVcCarddNo(String vcCardNo){ | |
29 | - | |
30 | - List<DzReplace> allCardNoList = new ArrayList<DzReplace>(); | |
31 | - if (StringUtils.isNotBlank(vcCardNo)) | |
32 | - { | |
33 | - System.out.println("vcCardNo = " + vcCardNo); | |
34 | - Connection conn = com.lyms.hospitalapi.zcfy.ConnTools.makeHisConnection(); | |
35 | - QueryRunner queryRunner = new QueryRunner(true); | |
36 | - String sql = "select ID as id from userzcfy.lyms_v_patientinfo where CARDNO = '"+vcCardNo+"'"; | |
37 | - try | |
38 | - { | |
39 | - List<DzReplace> hisDzReplaceList = queryRunner.query(conn,sql,new BeanListHandler<DzReplace>(DzReplace.class)); | |
40 | - if (CollectionUtils.isNotEmpty(hisDzReplaceList)) | |
41 | - { | |
42 | - String jzkSql = "select ID as id,VCCARDNO as cardNo from userzcfy.lyms_jiuzhenka where ID = '"+hisDzReplaceList.get(0).getId()+"'"; | |
43 | - allCardNoList = queryRunner.query(conn,jzkSql,new BeanListHandler<DzReplace>(DzReplace.class)); | |
44 | - System.out.println("vcCardNo list " + allCardNoList); | |
45 | - } | |
46 | - } | |
47 | - catch (Exception e) | |
48 | - { | |
49 | - DbUtils.closeQuietly(conn); | |
50 | - ExceptionUtils.catchException(e, "zc his exception "); | |
51 | - } | |
52 | - finally | |
53 | - { | |
54 | - DbUtils.closeQuietly(conn); | |
55 | - } | |
56 | - } | |
57 | - return allCardNoList; | |
58 | - } | |
59 | - | |
60 | - | |
61 | - /** | |
62 | - * 返回病人使用过的所有就诊卡 | |
63 | - * @param vcCardNo | |
64 | - * @return | |
65 | - */ | |
66 | - public List<String> getDzVcCardNos(String vcCardNo) | |
67 | - { | |
68 | - List<String> vcCardNos = new ArrayList<>(); | |
69 | - List<DzReplace> list = findAllVcCarddNo(vcCardNo); | |
70 | - | |
71 | - if (CollectionUtils.isNotEmpty(list)) | |
72 | - { | |
73 | - for (DzReplace zc : list) | |
74 | - { | |
75 | - if (zc != null && StringUtils.isNotEmpty(zc.getCardNo())) | |
76 | - { | |
77 | - vcCardNos.add(zc.getCardNo()); | |
78 | - } | |
79 | - } | |
80 | - } | |
81 | - else | |
82 | - { | |
83 | - vcCardNos.add(vcCardNo); | |
84 | - } | |
85 | - return vcCardNos; | |
86 | - } | |
87 | - | |
88 | -} |
platform-operate-api/src/main/java/com/lyms/hospitalapi/zcfy/ZcfyHisService.java
View file @
97454b2
1 | +package com.lyms.hospitalapi.zcfy; | |
2 | + | |
3 | +import com.lyms.hospitalapi.pojo.DzReplace; | |
4 | +import com.lyms.platform.common.utils.ExceptionUtils; | |
5 | +import org.apache.commons.collections.CollectionUtils; | |
6 | +import org.apache.commons.dbutils.DbUtils; | |
7 | +import org.apache.commons.dbutils.QueryRunner; | |
8 | +import org.apache.commons.dbutils.handlers.BeanListHandler; | |
9 | +import org.apache.commons.lang.StringUtils; | |
10 | +import org.springframework.stereotype.Service; | |
11 | + | |
12 | +import java.sql.Connection; | |
13 | +import java.util.ArrayList; | |
14 | +import java.util.List; | |
15 | + | |
16 | +/** | |
17 | + * Created by Administrator on 2017/12/18. | |
18 | + */ | |
19 | +@Service("zcfyHisService") | |
20 | +public class ZcfyHisService { | |
21 | + | |
22 | + | |
23 | + /** | |
24 | + * 查询病人的换卡记录 | |
25 | + * @param vcCardNo | |
26 | + * @return | |
27 | + */ | |
28 | + public List<DzReplace> findAllVcCarddNo(String vcCardNo){ | |
29 | + | |
30 | + List<DzReplace> allCardNoList = new ArrayList<DzReplace>(); | |
31 | + if (StringUtils.isNotBlank(vcCardNo)) | |
32 | + { | |
33 | + System.out.println("vcCardNo = " + vcCardNo); | |
34 | + Connection conn = com.lyms.hospitalapi.zcfy.ConnTools.makeHisConnection(); | |
35 | + QueryRunner queryRunner = new QueryRunner(true); | |
36 | + String sql = "select ID as id from userzcfy.lyms_v_patientinfo where CARDNO = '"+vcCardNo+"'"; | |
37 | + try | |
38 | + { | |
39 | + List<DzReplace> hisDzReplaceList = queryRunner.query(conn,sql,new BeanListHandler<DzReplace>(DzReplace.class)); | |
40 | + if (CollectionUtils.isNotEmpty(hisDzReplaceList)) | |
41 | + { | |
42 | + String jzkSql = "select ID as id,VCCARDNO as cardNo from userzcfy.lyms_jiuzhenka where ID = '"+hisDzReplaceList.get(0).getId()+"'"; | |
43 | + allCardNoList = queryRunner.query(conn,jzkSql,new BeanListHandler<DzReplace>(DzReplace.class)); | |
44 | + System.out.println("vcCardNo list " + allCardNoList); | |
45 | + } | |
46 | + } | |
47 | + catch (Exception e) | |
48 | + { | |
49 | + DbUtils.closeQuietly(conn); | |
50 | + ExceptionUtils.catchException(e, "zc his exception "); | |
51 | + } | |
52 | + finally | |
53 | + { | |
54 | + DbUtils.closeQuietly(conn); | |
55 | + } | |
56 | + } | |
57 | + return allCardNoList; | |
58 | + } | |
59 | + | |
60 | + | |
61 | + /** | |
62 | + * 返回病人使用过的所有就诊卡 | |
63 | + * @param vcCardNo | |
64 | + * @return | |
65 | + */ | |
66 | + public List<String> getDzVcCardNos(String vcCardNo) | |
67 | + { | |
68 | + List<String> vcCardNos = new ArrayList<>(); | |
69 | + List<DzReplace> list = findAllVcCarddNo(vcCardNo); | |
70 | + | |
71 | + if (CollectionUtils.isNotEmpty(list)) | |
72 | + { | |
73 | + for (DzReplace zc : list) | |
74 | + { | |
75 | + if (zc != null && StringUtils.isNotEmpty(zc.getCardNo())) | |
76 | + { | |
77 | + vcCardNos.add(zc.getCardNo()); | |
78 | + } | |
79 | + } | |
80 | + } | |
81 | + else | |
82 | + { | |
83 | + vcCardNos.add(vcCardNo); | |
84 | + } | |
85 | + return vcCardNos; | |
86 | + } | |
87 | + | |
88 | +} |