Commit 9747a1cdfdf23f5ec9b7385a2d61ce32085ee23d
1 parent
37763c71e0
Exists in
master
and in
8 other branches
hahahah
Showing 5 changed files with 131 additions and 1 deletions
- platform-operate-api/src/main/java/com/lyms/hospitalapi/fnfy/ConnTools.java
- platform-operate-api/src/main/java/com/lyms/hospitalapi/fnfy/FnfyHisService.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BookbuildingFacade.java
- platform-operate-api/src/main/resources/config.properties
platform-operate-api/src/main/java/com/lyms/hospitalapi/fnfy/ConnTools.java
View file @
9747a1c
| 1 | +package com.lyms.hospitalapi.fnfy; | |
| 2 | + | |
| 3 | +import java.sql.Connection; | |
| 4 | +import java.sql.DriverManager; | |
| 5 | +import java.sql.SQLException; | |
| 6 | + | |
| 7 | +/** | |
| 8 | + * Created by Administrator on 2016/9/9 0009. | |
| 9 | + * 抚宁妇幼 | |
| 10 | + * <add name="HisConnString" connectionString="Data Source=192.168.0.105\SQL2008;Initial Catalog=his_oltp_db;User ID=sa;pwd=fnfyHIS@2014;" providerName="System.Data.SqlClient"/> | |
| 11 | + */ | |
| 12 | +public class ConnTools { | |
| 13 | + private static String hisDirverClassName = "com.microsoft.sqlserver.jdbc.SQLServerDriver"; | |
| 14 | + private static String hisUrl = "jdbc:sqlserver://192.168.0.105\\SQL2008; DatabaseName=his_oltp_db"; | |
| 15 | + private static String hisUser = "sa"; | |
| 16 | + private static String hisPassword = "fnfyHIS@2014"; | |
| 17 | + | |
| 18 | + public static Connection makeHisConnection() { | |
| 19 | + Connection conn = null; | |
| 20 | + try { | |
| 21 | + Class.forName(hisDirverClassName); | |
| 22 | + } catch (ClassNotFoundException e) { | |
| 23 | + e.printStackTrace(); | |
| 24 | + } | |
| 25 | + try { | |
| 26 | + conn = DriverManager.getConnection(hisUrl, hisUser, hisPassword); | |
| 27 | + } catch (SQLException e) { | |
| 28 | + e.printStackTrace(); | |
| 29 | + } | |
| 30 | + return conn; | |
| 31 | + } | |
| 32 | +} |
platform-operate-api/src/main/java/com/lyms/hospitalapi/fnfy/FnfyHisService.java
View file @
9747a1c
| 1 | +package com.lyms.hospitalapi.fnfy; | |
| 2 | + | |
| 3 | +import com.lyms.hospitalapi.pojo.*; | |
| 4 | +import com.lyms.platform.common.utils.DateUtil; | |
| 5 | +import org.apache.commons.dbutils.DbUtils; | |
| 6 | +import org.apache.commons.dbutils.QueryRunner; | |
| 7 | +import org.apache.commons.dbutils.handlers.BeanListHandler; | |
| 8 | +import org.apache.commons.lang.StringUtils; | |
| 9 | +import org.springframework.stereotype.Service; | |
| 10 | + | |
| 11 | +import java.sql.Connection; | |
| 12 | +import java.sql.SQLException; | |
| 13 | +import java.util.*; | |
| 14 | + | |
| 15 | +/** | |
| 16 | + * Created by Administrator on 2016/9/9 0009. | |
| 17 | + */ | |
| 18 | +@Service("fnfyHisService") | |
| 19 | +public class FnfyHisService { | |
| 20 | + | |
| 21 | + public Map<String,Object> getPatientInfo(String cardNo){ | |
| 22 | + Map<String,Object> map = new HashMap<>(); | |
| 23 | + if (StringUtils.isNotBlank(cardNo)) { | |
| 24 | + Connection conn = ConnTools.makeHisConnection(); | |
| 25 | + QueryRunner queryRunner = new QueryRunner(); | |
| 26 | + try { | |
| 27 | + List<PregPatientinfo> list = queryRunner.query(conn, "select top 1 brid as P_ID,jzkh as P_CARDNO,hzxm as P_NAME, hzxb as P_SEX, hzcsrq as P_BIRTHDAY, sfzhm as P_IDNUM, hz_lxdh as P_MOBILEPHONE from ykt_cmain_hzjbxx where jzkh= '"+cardNo+"'", new BeanListHandler<PregPatientinfo>(PregPatientinfo.class)); | |
| 28 | + if (list.size() > 0) { | |
| 29 | + PregPatientinfo info = list.get(0); | |
| 30 | + map.put("sickType", info.getSICKTYPE()); | |
| 31 | + map.put("bhnum", info.getP_BHNUM()); | |
| 32 | + if ("1".equals(info.getP_SEX())) { | |
| 33 | + map.put("sex", "男"); | |
| 34 | + } else if ("2".equals(info.getP_SEX())) { | |
| 35 | + map.put("sex", "女"); | |
| 36 | + } | |
| 37 | + map.put("name", info.getP_NAME()); | |
| 38 | + map.put("cardNo", info.getP_CARDNO()); | |
| 39 | + map.put("phone", info.getP_MOBILEPHONE()); | |
| 40 | + map.put("birth", DateUtil.getyyyy_MM_dd(info.getP_BIRTHDAY())); | |
| 41 | + } | |
| 42 | + DbUtils.closeQuietly(conn); | |
| 43 | + } catch (SQLException e) { | |
| 44 | + DbUtils.closeQuietly(conn); | |
| 45 | + e.printStackTrace(); | |
| 46 | + } | |
| 47 | + } | |
| 48 | + return map; | |
| 49 | + } | |
| 50 | + | |
| 51 | + public List<Map<String,Object>> getPatientInfoList(String cardNo){ | |
| 52 | + List<Map<String,Object>> result = new ArrayList<>(); | |
| 53 | + if (StringUtils.isNotBlank(cardNo)) { | |
| 54 | + Connection conn = ConnTools.makeHisConnection(); | |
| 55 | + QueryRunner queryRunner = new QueryRunner(); | |
| 56 | + try { | |
| 57 | + List<PregPatientinfo> list = queryRunner.query(conn, "select top 1 brid as P_ID,jzkh as P_CARDNO,hzxm as P_NAME, hzxb as P_SEX, hzcsrq as P_BIRTHDAY, sfzhm as P_IDNUM, hz_lxdh as P_MOBILEPHONE from ykt_cmain_hzjbxx where jzkh= '"+cardNo+"'", new BeanListHandler<PregPatientinfo>(PregPatientinfo.class)); | |
| 58 | + if (list.size() > 0) { | |
| 59 | + for (PregPatientinfo info:list) { | |
| 60 | + Map<String,Object> map = new HashMap<>(); | |
| 61 | + map.put("sickType", info.getSICKTYPE()); | |
| 62 | + map.put("bhnum", info.getP_BHNUM()); | |
| 63 | + if ("1".equals(info.getP_SEX())) { | |
| 64 | + map.put("sex", "男"); | |
| 65 | + } else if ("2".equals(info.getP_SEX())) { | |
| 66 | + map.put("sex", "女"); | |
| 67 | + } | |
| 68 | + map.put("name", info.getP_NAME()); | |
| 69 | + map.put("cardNo", info.getP_CARDNO()); | |
| 70 | + map.put("phone", info.getP_MOBILEPHONE()); | |
| 71 | + map.put("birth", DateUtil.getyyyy_MM_dd(info.getP_BIRTHDAY())); | |
| 72 | + result.add(map); | |
| 73 | + } | |
| 74 | + } | |
| 75 | + DbUtils.closeQuietly(conn); | |
| 76 | + } catch (SQLException e) { | |
| 77 | + DbUtils.closeQuietly(conn); | |
| 78 | + e.printStackTrace(); | |
| 79 | + } | |
| 80 | + } | |
| 81 | + return result; | |
| 82 | + } | |
| 83 | + | |
| 84 | +} |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java
View file @
9747a1c
| 1 | 1 | package com.lyms.platform.operate.web.facade; |
| 2 | 2 | |
| 3 | +import com.lyms.hospitalapi.fnfy.FnfyHisService; | |
| 3 | 4 | import com.lyms.hospitalapi.qinglongxian.QingLongXianHisService; |
| 4 | 5 | import com.lyms.hospitalapi.v2.HisService; |
| 5 | 6 | import com.lyms.platform.biz.service.*; |
| 6 | 7 | |
| ... | ... | @@ -45,7 +46,10 @@ |
| 45 | 46 | @Autowired |
| 46 | 47 | private QingLongXianHisService qingLongXianHisService; |
| 47 | 48 | |
| 49 | + @Autowired | |
| 50 | + private FnfyHisService fnfyHisService; | |
| 48 | 51 | |
| 52 | + | |
| 49 | 53 | @Autowired |
| 50 | 54 | private BabyBookbuildingService babyBookbuildingService; |
| 51 | 55 | |
| ... | ... | @@ -1273,6 +1277,8 @@ |
| 1273 | 1277 | map.put("hisPatient", hisServiceV2.getPatientInfoList(param.getVcCardNo())); |
| 1274 | 1278 | } else if ("3".equals(HIS_VERSION)) { |
| 1275 | 1279 | map.put("hisPatient", qingLongXianHisService.getPatientInfoList(param.getVcCardNo())); |
| 1280 | + } else if ("5".equals(HIS_VERSION)) { | |
| 1281 | + map.put("hisPatient", fnfyHisService.getPatientInfoList(param.getVcCardNo())); | |
| 1276 | 1282 | } |
| 1277 | 1283 | } |
| 1278 | 1284 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BookbuildingFacade.java
View file @
9747a1c
| 1 | 1 | package com.lyms.platform.operate.web.facade; |
| 2 | 2 | |
| 3 | +import com.lyms.hospitalapi.fnfy.FnfyHisService; | |
| 3 | 4 | import com.lyms.hospitalapi.qinglongxian.QingLongXianHisService; |
| 4 | 5 | import com.lyms.hospitalapi.v2.HisService; |
| 5 | 6 | import com.lyms.platform.biz.dal.IPersonDao; |
| 6 | 7 | |
| ... | ... | @@ -89,7 +90,12 @@ |
| 89 | 90 | |
| 90 | 91 | @Autowired |
| 91 | 92 | private QingLongXianHisService qingLongXianHisService; |
| 93 | + | |
| 92 | 94 | @Autowired |
| 95 | + private FnfyHisService fnfyHisService; | |
| 96 | + | |
| 97 | + | |
| 98 | + @Autowired | |
| 93 | 99 | private DeleteProcessHandler deleteProcessHandler; |
| 94 | 100 | |
| 95 | 101 | @Autowired |
| ... | ... | @@ -558,6 +564,8 @@ |
| 558 | 564 | typeMap.put("hisPatient", hisServiceV2.getPatientInfoList(bookbuildingQueryRequest.getVcCardNo())); |
| 559 | 565 | } else if ("3".equals(HIS_VERSION)) { |
| 560 | 566 | typeMap.put("hisPatient", qingLongXianHisService.getPatientInfoList(bookbuildingQueryRequest.getVcCardNo())); |
| 567 | + } else if ("5".equals(HIS_VERSION)) { | |
| 568 | + typeMap.put("hisPatient", fnfyHisService.getPatientInfoList(bookbuildingQueryRequest.getVcCardNo())); | |
| 561 | 569 | } |
| 562 | 570 | } |
| 563 | 571 | } |