Commit f529e418bcef9c95f8a975e9f225ce7b9e6e5997
1 parent
1e4cfb5460
Exists in
master
更新会话信息
Showing 1 changed file with 25 additions and 14 deletions
talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/ChatGroupController.java
View file @
f529e41
... | ... | @@ -206,21 +206,9 @@ |
206 | 206 | if(row.getJSONObject("meta").size()>0){ |
207 | 207 | JSONObject payload=row.getJSONObject("meta").getJSONObject("payload"); |
208 | 208 | System.out.println(payload); |
209 | - String from =payload.getString("from"); | |
210 | - Map<String,Object> param=new HashMap<>(); | |
211 | - param.put("idno",from); | |
212 | - List<LymsPatient> pLst=lymsPatientService.listByMap(param); | |
213 | - if(pLst.size()>0){ | |
214 | - payload.put("pat",pLst.get(0)); | |
215 | - } | |
216 | - param.clear(); | |
217 | - param.put("dlogin",from); | |
218 | - List<LymsDoctor> dLst=lymsDoctorService.listByMap(param); | |
219 | - if(dLst.size()>0){ | |
220 | - payload.put("doc",dLst.get(0)); | |
221 | - } | |
209 | + | |
222 | 210 | payload.put("unread_num",row.get("unread_num")); |
223 | - rs.add(payload); | |
211 | + | |
224 | 212 | String to=payload.getString("to"); |
225 | 213 | LymsTkrecord tkrecord=new LymsTkrecord(); |
226 | 214 | tkrecord.setHxgroupid(to); |
... | ... | @@ -229,6 +217,29 @@ |
229 | 217 | if(rLst.size()>0){ |
230 | 218 | payload.put("stat",rLst.get(0).getStat()); |
231 | 219 | } |
220 | + | |
221 | + LymsChatgroup chatgroup=new LymsChatgroup(); | |
222 | + chatgroup.setHxgroupid(to); | |
223 | + List<LymsChatgroup> cLst=lymsChatgroupService.list(Wrappers.query(chatgroup)); | |
224 | + | |
225 | + if(cLst.size()>0){ | |
226 | + chatgroup=cLst.get(0); | |
227 | + Map<String,Object> param=new HashMap<>(); | |
228 | + param.put("idno",chatgroup.getFromp()); | |
229 | + List<LymsPatient> pLst=lymsPatientService.listByMap(param); | |
230 | + if(pLst.size()>0){ | |
231 | + payload.put("pat",pLst.get(0)); | |
232 | + } | |
233 | + param.clear(); | |
234 | + param.put("dlogin",chatgroup.getTarget()); | |
235 | + List<LymsDoctor> dLst=lymsDoctorService.listByMap(param); | |
236 | + if(dLst.size()>0){ | |
237 | + payload.put("doc",dLst.get(0)); | |
238 | + } | |
239 | + } | |
240 | + | |
241 | + payload.put("timestamp",row.getJSONObject("meta").get("timestamp")); | |
242 | + rs.add(payload); | |
232 | 243 | } |
233 | 244 | |
234 | 245 | } |