Commit 8798fe3adc4ad240e7a2e2ed8999d919adab67bb
1 parent
558f9c95b2
Exists in
master
and in
1 other branch
更新医生和患者的环信登录信息
Showing 2 changed files with 29 additions and 0 deletions
talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/DoctorController.java
View file @
8798fe3
1 | 1 | package com.lyms.talkonlineweb.controller; |
2 | 2 | |
3 | +import com.alibaba.fastjson.JSONArray; | |
4 | +import com.alibaba.fastjson.JSONObject; | |
3 | 5 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
4 | 6 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
5 | 7 | import com.lyms.talkonlineweb.domain.LymsDict; |
... | ... | @@ -9,6 +11,7 @@ |
9 | 11 | import com.lyms.talkonlineweb.result.BaseResponse; |
10 | 12 | import com.lyms.talkonlineweb.service.*; |
11 | 13 | import com.lyms.talkonlineweb.util.Constant; |
14 | +import com.lyms.talkonlineweb.util.HXService; | |
12 | 15 | import com.lyms.talkonlineweb.util.JwtUtils; |
13 | 16 | import org.springframework.beans.factory.annotation.Autowired; |
14 | 17 | import org.springframework.validation.BindingResult; |
... | ... | @@ -40,6 +43,8 @@ |
40 | 43 | @Autowired |
41 | 44 | private LymsLogsCrudService lymsLogsCrudService; |
42 | 45 | |
46 | + @Autowired | |
47 | + private HXService hxService; | |
43 | 48 | |
44 | 49 | /** |
45 | 50 | * 获取医生列表 |
... | ... | @@ -150,6 +155,15 @@ |
150 | 155 | baseResponse.setErrorcode(1); |
151 | 156 | if (dLst.size()>0) { |
152 | 157 | doctor=dLst.get(0); |
158 | + | |
159 | + if(doctor.getHxid()==null ){ | |
160 | + JSONObject json=hxService.addUser(doctor.getDlogin(),Constant.COMMON_PASSWD); | |
161 | + JSONArray rArr=json.getJSONArray("entities"); | |
162 | + if(rArr.size()>0){ | |
163 | + doctor.setHxid(rArr.getJSONObject(0).getString("uuid")); | |
164 | + } | |
165 | + } | |
166 | + lymsDoctorService.update().update(doctor); | |
153 | 167 | doctor.setDpasswd(null); |
154 | 168 | baseResponse.setObject(doctor); |
155 | 169 | String jwt = JwtUtils.createJWT("1", doctor.getDlogin(), Constant.JWT_TTL); |
talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/PatientController.java
View file @
8798fe3
1 | 1 | package com.lyms.talkonlineweb.controller; |
2 | 2 | |
3 | +import com.alibaba.fastjson.JSONArray; | |
4 | +import com.alibaba.fastjson.JSONObject; | |
3 | 5 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
4 | 6 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
5 | 7 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
... | ... | @@ -7,6 +9,7 @@ |
7 | 9 | import com.lyms.talkonlineweb.result.BaseResponse; |
8 | 10 | import com.lyms.talkonlineweb.service.*; |
9 | 11 | import com.lyms.talkonlineweb.util.Constant; |
12 | +import com.lyms.talkonlineweb.util.HXService; | |
10 | 13 | import com.lyms.talkonlineweb.util.JwtUtils; |
11 | 14 | import lombok.extern.log4j.Log4j2; |
12 | 15 | import lombok.extern.slf4j.Slf4j; |
13 | 16 | |
... | ... | @@ -44,7 +47,10 @@ |
44 | 47 | @Autowired |
45 | 48 | private LymsLogsService lymsLogsService;//日志记录 |
46 | 49 | |
50 | + @Autowired | |
51 | + private HXService hxService; | |
47 | 52 | |
53 | + | |
48 | 54 | /** |
49 | 55 | * 获取患者列表 |
50 | 56 | * @param patientInfo |
... | ... | @@ -208,6 +214,15 @@ |
208 | 214 | map.put("patient",patient); |
209 | 215 | map.put("token",jwt); |
210 | 216 | patient.setIslogin(1); |
217 | + | |
218 | + if(patient.getHxid()==null ){ | |
219 | + JSONObject json=hxService.addUser(patient.getIdno(),Constant.COMMON_PASSWD); | |
220 | + JSONArray rArr=json.getJSONArray("entities"); | |
221 | + if(rArr.size()>0){ | |
222 | + patient.setHxid(rArr.getJSONObject(0).getString("uuid")); | |
223 | + } | |
224 | + } | |
225 | + | |
211 | 226 | lymsPatientService.update().update(patient); |
212 | 227 | baseResponse.setErrorcode(0); |
213 | 228 | baseResponse.setObject(map); |