Commit e394475011cf0267b5d1533255502e8e97105769

Authored by shiyang
1 parent e64dfead45
Exists in master

修改环信配置,修改登录逻辑

Showing 3 changed files with 55 additions and 16 deletions

talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/PatientController.java View file @ e394475
... ... @@ -293,21 +293,41 @@
293 293 baseResponse.setErrorcode(1);
294 294 LymsPatient patient2=null;
295 295  
  296 + //是否有病例
  297 + int pcaseSize=0;
  298 + LymsPcase pcase=new LymsPcase();
  299 + pcase.setMobile(patient.getIdno());
  300 + List<LymsPcase> cLst =lymsPcaseService.list(Wrappers.query(pcase));
  301 + pcaseSize=cLst.size();
296 302 if(dLst.size() < 1 ){//手机号登录
297   - LymsPcase pcase=new LymsPcase();
298   - pcase.setMobile(patient.getIdno());
299   - List<LymsPcase> cLst =lymsPcaseService.list(Wrappers.query(pcase));
300   - if(cLst.size()>0){
  303 + if(pcaseSize>0){
301 304 Map<String,Object> param=new HashMap<>();
302 305 param.put("id",cLst.get(0).getPid());
303 306 param.put("ppasswd",patient.getPpasswd());
304 307 dLst=lymsPatientService.listByMap(param);
305   - }else {
  308 + }else {//没有病例
306 309 //小程序自主注册用手机号登录验证
307 310 Map<String,Object> paramQuery=new HashMap<>();
308 311 paramQuery.put("enrolment_phone",patient.getIdno());
309 312 paramQuery.put("ppasswd",patient.getPpasswd());
310   - dLst =lymsPatientService.listByMap(paramQuery);
  313 + if(patient.getId()!=null) {
  314 + paramQuery.put("id", patient.getId());
  315 + }
  316 + List<LymsPatient> patients = lymsPatientService.listByMap(paramQuery);
  317 + if(patients.size()==1) {
  318 + dLst= patients;
  319 + }
  320 + if(patients.size()>1){//一个手机号码注册多个身份证
  321 + List<Map> listMap=new ArrayList<>();
  322 + for (LymsPatient lymsPatient : patients) {
  323 + Map map=new HashMap();
  324 + map.put("name", lymsPatient.getPname());
  325 + map.put("id", lymsPatient.getId());
  326 + listMap.add(map);
  327 + }
  328 + baseResponse.setErrorcode(2);
  329 + baseResponse.setObject(listMap);
  330 + }
311 331 }
312 332  
313 333 }
... ... @@ -339,6 +359,7 @@
339 359 patient.setPpasswd(null);
340 360 map.put("patient", patient2);
341 361 map.put("token", jwt);
  362 + map.put("pcaseSize", pcaseSize);
342 363 baseResponse.setErrorcode(0);
343 364 baseResponse.setObject(map);
344 365 }
talkonlineweb/src/main/resources/application-dev.yml View file @ e394475
... ... @@ -12,12 +12,21 @@
12 12 #imgUrlPre: http://192.168.2.26:9090/art/showPic/
13 13  
14 14  
  15 +##环信配置(原始开发环境,不用了)
  16 +#hx.APPKEY: 1135210903239178#demo
  17 +#hx.ClientID: YXA65kqQUy4pQaqHb3pwXwfnrA
  18 +#hx.ClientSecret: YXA6RZaIr68MPPLcvqUnYxpqEkAEj6w
  19 +#hx.org_name: 1135210903239178
  20 +#hx.app_name: demo
  21 +#hx.hxuser: test
  22 +#hx.hxpasswd: passwd
  23 +
15 24 #环信配置
16   -hx.APPKEY: 1135210903239178#demo
17   -hx.ClientID: YXA65kqQUy4pQaqHb3pwXwfnrA
18   -hx.ClientSecret: YXA6RZaIr68MPPLcvqUnYxpqEkAEj6w
19   -hx.org_name: 1135210903239178
20   -hx.app_name: demo
  25 +hx.APPKEY: 1123170414115195#talkonline
  26 +hx.ClientID: YXA63Zp2DnLaTuyE0px-g4_8Cw
  27 +hx.ClientSecret: YXA6Ml0jgv7w9PaN0WmTc8irMWX4dNg
  28 +hx.org_name: 1123170414115195
  29 +hx.app_name: talkonline
21 30 hx.hxuser: test
22 31 hx.hxpasswd: passwd
23 32  
talkonlineweb/src/main/resources/application-prod.yml View file @ e394475
... ... @@ -9,12 +9,21 @@
9 9 uploadPath: /data/talkonline/upload/
10 10 imgUrlPre: https://talk-api.healthbaby.com.cn/art/showPic/
11 11  
  12 +##环信配置(原始开发环境,不用了)
  13 +#hx.APPKEY: 1135210903239178#demo
  14 +#hx.ClientID: YXA65kqQUy4pQaqHb3pwXwfnrA
  15 +#hx.ClientSecret: YXA6RZaIr68MPPLcvqUnYxpqEkAEj6w
  16 +#hx.org_name: 1135210903239178
  17 +#hx.app_name: demo
  18 +#hx.hxuser: test
  19 +#hx.hxpasswd: passwd
  20 +
12 21 #环信配置
13   -hx.APPKEY: 1135210903239178#demo
14   -hx.ClientID: YXA65kqQUy4pQaqHb3pwXwfnrA
15   -hx.ClientSecret: YXA6RZaIr68MPPLcvqUnYxpqEkAEj6w
16   -hx.org_name: 1135210903239178
17   -hx.app_name: demo
  22 +hx.APPKEY: 1123170414115195#talkonline
  23 +hx.ClientID: YXA63Zp2DnLaTuyE0px-g4_8Cw
  24 +hx.ClientSecret: YXA6Ml0jgv7w9PaN0WmTc8irMWX4dNg
  25 +hx.org_name: 1123170414115195
  26 +hx.app_name: talkonline
18 27 hx.hxuser: test
19 28 hx.hxpasswd: passwd
20 29