Commit f790cfd98af1231bd550828b2060c07e5ce2d8b5
1 parent
5b92c71f05
Exists in
master
and in
6 other branches
服务开通
Showing 3 changed files with 75 additions and 12 deletions
platform-operate-api/src/main/java/com/lyms/hospitalapi/llfy/ConnTools.java
View file @
f790cfd
1 | +package com.lyms.hospitalapi.llfy; | |
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.25.10; DatabaseName=his08"; | |
15 | + private static String hisUser = "ms"; | |
16 | + private static String hisPassword = "llfyhis123."; | |
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/llfy/LlfyHisService.java
View file @
f790cfd
1 | +package com.lyms.hospitalapi.llfy; | |
2 | + | |
3 | +import com.lyms.hospitalapi.pojo.PregPatientinfo; | |
4 | +import org.apache.commons.dbutils.QueryRunner; | |
5 | +import org.apache.commons.dbutils.handlers.BeanListHandler; | |
6 | +import org.apache.commons.lang.StringUtils; | |
7 | +import org.springframework.stereotype.Service; | |
8 | + | |
9 | +import java.sql.Connection; | |
10 | +import java.util.List; | |
11 | +import java.util.Map; | |
12 | + | |
13 | +/** | |
14 | + * @auther yangfei | |
15 | + * @createTime 2017年09月15日 15时49分 | |
16 | + * @discription | |
17 | + */ | |
18 | +@Service("llfyHisService") | |
19 | +public class LlfyHisService { | |
20 | + public Map<String,Object> getPatientInfo(String cardNo) { | |
21 | + if (StringUtils.isNotBlank(cardNo)) { | |
22 | + Connection conn = com.lyms.hospitalapi.fnfy.ConnTools.makeHisConnection(); | |
23 | + QueryRunner queryRunner = new QueryRunner(); | |
24 | + try { | |
25 | + 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 fvw_住院病人档案 where jzkh= '" + cardNo + "'", new BeanListHandler<PregPatientinfo>(PregPatientinfo.class)); | |
26 | + } catch (Exception e) { | |
27 | + } | |
28 | + } | |
29 | + return null; | |
30 | + } | |
31 | +} |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PatientServiceController.java
View file @
f790cfd
... | ... | @@ -167,27 +167,27 @@ |
167 | 167 | baseResponse.setErrorcode(ErrorCodeConstants.PARAMETER_ERROR); |
168 | 168 | return baseResponse; |
169 | 169 | } |
170 | - //personid | |
171 | - if(StringUtils.isEmpty(ps.getPid())){ | |
172 | - baseResponse.setErrormsg("请传入pid"); | |
170 | + //serType服务类型(1-高危精准指导、2-体重、3-血糖、4-血压、5-专家咨询) | |
171 | + if(ps.getSerType()==null){ | |
172 | + baseResponse.setErrormsg("请传入serType"); | |
173 | 173 | baseResponse.setErrorcode(ErrorCodeConstants.PARAMETER_ERROR); |
174 | 174 | return baseResponse; |
175 | 175 | } |
176 | - //personid | |
177 | - if(StringUtils.isEmpty(ps.getPid())){ | |
178 | - baseResponse.setErrormsg("请传入pid"); | |
176 | + //指定医生 | |
177 | + if(ps.getSerDoct()==null){ | |
178 | + baseResponse.setErrormsg("请传入serDoct"); | |
179 | 179 | baseResponse.setErrorcode(ErrorCodeConstants.PARAMETER_ERROR); |
180 | 180 | return baseResponse; |
181 | 181 | } |
182 | - //serType服务类型(1-高危精准指导、2-体重、3-血糖、4-血压、5-专家咨询) | |
183 | - if(ps.getSerType()==null){ | |
184 | - baseResponse.setErrormsg("请传入serType"); | |
182 | + //开通医生 | |
183 | + if(ps.getCreateUser()==null){ | |
184 | + baseResponse.setErrormsg("请传入createUser"); | |
185 | 185 | baseResponse.setErrorcode(ErrorCodeConstants.PARAMETER_ERROR); |
186 | 186 | return baseResponse; |
187 | 187 | } |
188 | - //开通医生 | |
189 | - if(ps.getSerDoct()==null){ | |
190 | - baseResponse.setErrormsg("请传入serDoct"); | |
188 | + //开通时间 | |
189 | + if(ps.getCreateDate()==null){ | |
190 | + baseResponse.setErrormsg("请传入createDate"); | |
191 | 191 | baseResponse.setErrorcode(ErrorCodeConstants.PARAMETER_ERROR); |
192 | 192 | return baseResponse; |
193 | 193 | } |