Commit 472707160517c0ea04a479e3dd5a9b9540cff000

Authored by liquanyu

Merge remote-tracking branch 'origin/master'

Showing 5 changed files

platform-biz-service/src/main/resources/mainOrm/Permissions.xml View file @ 4727071
... ... @@ -191,7 +191,7 @@
191 191 <select id="queryPermissionByRoleIds1" parameterType="int" resultMap="PermissionsResultMap">
192 192 select b.* from role_permission_maps a, permissions b where a.role_id=
193 193 #{weight,jdbcType=INTEGER}
194   - and b.yn=1 and a.yn=1
  194 + and b.yn=1 and a.yn=1 and a.permission_id=b.id;
195 195 </select>
196 196 </mapper>
platform-common/src/main/java/com/lyms/platform/common/utils/LoginUtil.java View file @ 4727071
... ... @@ -5,20 +5,15 @@
5 5 import org.apache.commons.httpclient.NameValuePair;
6 6 import org.apache.commons.httpclient.methods.GetMethod;
7 7 import org.apache.commons.httpclient.methods.PostMethod;
8   -import org.apache.commons.lang.*;
9 8 import org.slf4j.Logger;
10 9 import org.slf4j.LoggerFactory;
11 10 import org.springframework.util.StopWatch;
12 11  
13   -import java.security.MessageDigest;
14   -import java.security.NoSuchAlgorithmException;
15   -
16 12 public class LoginUtil {
17 13 private static Logger logger = LoggerFactory.getLogger("HTTP-INVOKE");
18 14  
19 15  
20   -
21   - public static LoginContext register(String userId, String phone,String account, String pwd, String token, String typeId) {
  16 + public static LoginContext register(String userId, String phone, String account, String pwd, String token, String typeId) {
22 17 StopWatch stopWatch = new StopWatch("aouHospitalUser");
23 18 stopWatch.start("init http client");
24 19 HttpClient client = new HttpClient();
25 20  
26 21  
... ... @@ -38,20 +33,18 @@
38 33 client.executeMethod(post);
39 34 int statusCode = post.getStatusCode();
40 35 String result = new String(post.getResponseBodyAsString());
41   -
  36 + logger.info("register result : "+result);
42 37 post.releaseConnection();
43 38 stopWatch.stop();
44 39 if (200 == statusCode) {
45 40 stopWatch.start("parse json");
46 41 LoginContext loginState = JsonUtil.str2Obj(result, LoginContext.class);
47 42 stopWatch.stop();
48   - if (0 == loginState.getErrorcode()) {
49   - return loginState;
50   - }
  43 + return loginState;
51 44 }
52 45 } catch (Exception e) {
53   - e.printStackTrace();
54   - }finally {
  46 + ExceptionUtils.catchException(e, "register error , " + e.getMessage());
  47 + } finally {
55 48 logger.info(stopWatch.toString());
56 49 }
57 50 return null;
... ... @@ -65,7 +58,7 @@
65 58 NameValuePair[] data = {
66 59 new NameValuePair("account", account),
67 60 new NameValuePair("typeId", typeId),
68   - new NameValuePair("password", org.apache.commons.lang.StringUtils.isBlank(pwd)?"p":MD5Utils.md5(pwd).toUpperCase())
  61 + new NameValuePair("password", org.apache.commons.lang.StringUtils.isBlank(pwd) ? "p" : MD5Utils.md5(pwd).toUpperCase())
69 62 };
70 63 post.setRequestBody(data);
71 64 post.setRequestHeader("Authorization", token);
... ... @@ -75,7 +68,7 @@
75 68 client.executeMethod(post);
76 69 int statusCode = post.getStatusCode();
77 70 String result = new String(post.getResponseBodyAsString());
78   -
  71 + logger.info("loginByAccount result : "+result);
79 72 post.releaseConnection();
80 73 stopWatch.stop();
81 74 LoginContext loginState = new LoginContext();
... ... @@ -86,7 +79,7 @@
86 79 return loginState;
87 80 }
88 81 } catch (Exception e) {
89   - e.printStackTrace();
  82 + ExceptionUtils.catchException(e, "loginByAccount error , " + e.getMessage());
90 83 } finally {
91 84 logger.info(stopWatch.toString());
92 85 }
... ... @@ -112,7 +105,7 @@
112 105 client.executeMethod(post);
113 106 int statusCode = post.getStatusCode();
114 107 String result = new String(post.getResponseBodyAsString());
115   -
  108 + logger.info("aouHospitalUser result : "+result);
116 109 post.releaseConnection();
117 110 stopWatch.stop();
118 111 if (200 == statusCode) {
... ... @@ -124,8 +117,8 @@
124 117 }
125 118 }
126 119 } catch (Exception e) {
127   - e.printStackTrace();
128   - }finally {
  120 + ExceptionUtils.catchException(e, "aouHospitalUser error , " + e.getMessage());
  121 + } finally {
129 122 logger.info(stopWatch.toString());
130 123 }
131 124 return null;
... ... @@ -139,7 +132,7 @@
139 132 NameValuePair[] data = {
140 133 new NameValuePair("account", account),
141 134 new NameValuePair("typeId", typeId),
142   - new NameValuePair("password", org.apache.commons.lang.StringUtils.isBlank(pwd)?"p":MD5Utils.md5(pwd).toUpperCase())
  135 + new NameValuePair("password", org.apache.commons.lang.StringUtils.isBlank(pwd) ? "p" : MD5Utils.md5(pwd).toUpperCase())
143 136 };
144 137 post.setRequestBody(data);
145 138 post.setRequestHeader("Authorization", token);
... ... @@ -149,7 +142,7 @@
149 142 client.executeMethod(post);
150 143 int statusCode = post.getStatusCode();
151 144 String result = new String(post.getResponseBodyAsString());
152   -
  145 + logger.info("loginHospitalUser result : "+result);
153 146 post.releaseConnection();
154 147 stopWatch.stop();
155 148 LoginContext loginState = new LoginContext();
... ... @@ -160,8 +153,8 @@
160 153 return loginState;
161 154 }
162 155 } catch (Exception e) {
163   - e.printStackTrace();
164   - }finally {
  156 + ExceptionUtils.catchException(e, "loginHospitalUser error , " + e.getMessage());
  157 + } finally {
165 158 logger.info(stopWatch.toString());
166 159 }
167 160 return null;
168 161  
... ... @@ -185,9 +178,10 @@
185 178 client.executeMethod(post);
186 179 int statusCode = post.getStatusCode();
187 180 String result = new String(post.getResponseBodyAsString());
  181 + logger.info("loginByPhone result : "+result);
  182 + post.releaseConnection();
  183 + stopWatch.stop();
188 184  
189   - post.releaseConnection();stopWatch.stop();
190   -
191 185 LoginContext loginState = new LoginContext();
192 186 if (200 == statusCode) {
193 187 stopWatch.start("parse json");
... ... @@ -196,8 +190,8 @@
196 190 return loginState;
197 191 }
198 192 } catch (Exception e) {
199   - e.printStackTrace();
200   - }finally {
  193 + ExceptionUtils.catchException(e, "loginByPhone error , " + e.getMessage());
  194 + } finally {
201 195 logger.info(stopWatch.toString());
202 196 }
203 197 return null;
... ... @@ -237,8 +231,8 @@
237 231 return loginState;
238 232 }
239 233 } catch (Exception e) {
240   - e.printStackTrace();
241   - }finally {
  234 + ExceptionUtils.catchException(e, "sendVerCode error.");
  235 + } finally {
242 236 logger.info(stopWatch.toString());
243 237 }
244 238 return null;
245 239  
... ... @@ -268,29 +262,11 @@
268 262 return loginState;
269 263 }
270 264 } catch (Exception e) {
271   - e.printStackTrace();
272   - }finally {
  265 + ExceptionUtils.catchException(e,"checkLoginState error.");
  266 + } finally {
273 267 logger.info(stopWatch.toString());
274 268 }
275 269 return loginState;
276 270 }
277   -
278   -//
279   -// public static void main(String[] args) {
280   -// System.out.println(md5("123789456"));
281   -// String a = "{\"id\":20,\"token\":\"ucefac93386a4c70a8a570da5bbfc24ad0\",\"errormsg\":\"成功\",\"errorcode\":3}";
282   -//
283   -//
284   -// System.out.println(a.matches(".*errorcode\":0.*"));
285   -//
286   -// Pattern pattern = Pattern.compile("token\":\"(.*?)\"");
287   -// Matcher matcher = pattern.matcher(a);
288   -// while(matcher.find()) {
289   -// System.out.println(matcher.group(1));
290   -// }
291   -//
292   -// //3949ba59abbe56e057f20f88
293   -// }
294   -
295 271 }
platform-dal/src/main/java/com/lyms/platform/query/PatientsQuery.java View file @ 4727071
... ... @@ -92,6 +92,10 @@
92 92 * 生日
93 93 */
94 94 private Date birthStart;
  95 + /**
  96 + * 就诊卡号
  97 + */
  98 + private String vcCardNo;
95 99  
96 100 /**
97 101 * 生日
... ... @@ -235,6 +239,9 @@
235 239 }
236 240 if(null!=id){
237 241 condition= condition.and("id", id, MongoOper.IS);
  242 + }
  243 + if(null!=vcCardNo){
  244 + condition= condition.and("vcCardNo", vcCardNo, MongoOper.IS);
238 245 }
239 246 if(null!=cardNo){
240 247 condition=condition.and("cardno", cardNo, MongoOper.IS);
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/UsersController.java View file @ 4727071
... ... @@ -716,8 +716,9 @@
716 716 users.setLastLoginTime(new Date());
717 717 // users.setPwd(LoginUtil.md5(NumberUtils.getRandomString(6)));
718 718  
719   - LoginContext loginContext = null;
720   -
  719 + LoginContext loginContext = new LoginContext();
  720 + loginContext.setErrorcode(ErrorCodeConstants.PARAMETER_ERROR);
  721 + loginContext.setErrormsg("系统错误");
721 722 //关联登录中心ID
722 723 if(StringUtils.isNotBlank(phone) || StringUtils.isNotBlank(account)) {
723 724 /**/ String pwd = null;
platform-operate-api/src/main/java/com/lyms/platform/operate/web/session/strategy/LocalCacheSessionStrategy.java View file @ 4727071
... ... @@ -96,6 +96,7 @@
96 96 @Override
97 97 public LoginContext register(String userId, String phone, String account, String pwd) {
98 98 LoginContext loginContext = new LoginContext();
  99 + loginContext.setErrorcode(0);
99 100 return loginContext;
100 101 }
101 102 }