Commit 877ba46d07dedd68ff525969039526a9d23e3a93
1 parent
c7e8c83052
Exists in
master
and in
1 other branch
update
Showing 1 changed file with 13 additions and 9 deletions
talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/ChatGroupController.java
View file @
877ba46
... | ... | @@ -690,10 +690,11 @@ |
690 | 690 | * @param jsonObject 参数集合 |
691 | 691 | */ |
692 | 692 | public void getChatRecord(JSONArray rs,JSONObject jsonObject){ |
693 | + JSONArray rsrjson=new JSONArray(); | |
693 | 694 | //登录账号 |
694 | - String user_name=jsonObject.getJSONObject("user_name").toString(); | |
695 | + String user_name=jsonObject.get("user_name").toString(); | |
695 | 696 | //1 环信管理员 2 医生 3 患者 |
696 | - String type=jsonObject.getJSONObject("type").toString(); | |
697 | + String type=jsonObject.get("type").toString(); | |
697 | 698 | LymsChatgroup queryChatgroup=new LymsChatgroup(); |
698 | 699 | switch (type){ |
699 | 700 | case "1": |
... | ... | @@ -714,7 +715,7 @@ |
714 | 715 | reusltJsonObject.put("stat",lymsChatgroup.getStat()); |
715 | 716 | //患者信息 |
716 | 717 | LambdaQueryWrapper<LymsPatient> patientQueryWrapper=new QueryWrapper().lambda(); |
717 | - patientQueryWrapper.ge(LymsPatient::getIdno, lymsChatgroup.getFromp()); | |
718 | + patientQueryWrapper.eq(LymsPatient::getIdno, lymsChatgroup.getFromp()); | |
718 | 719 | LymsPatient patient = lymsPatientService.getOne(patientQueryWrapper); |
719 | 720 | if (null==patient) { |
720 | 721 | continue; |
... | ... | @@ -722,7 +723,7 @@ |
722 | 723 | reusltJsonObject.put("pat",patient); |
723 | 724 | //聊天记录 |
724 | 725 | LambdaQueryWrapper<LymsMessage> messageQueryWrapper=new QueryWrapper().lambda(); |
725 | - messageQueryWrapper.ge(LymsMessage::getTargetid, lymsChatgroup.getHxgroupid()); | |
726 | + messageQueryWrapper.eq(LymsMessage::getTargetid, lymsChatgroup.getHxgroupid()); | |
726 | 727 | messageQueryWrapper.orderByDesc(LymsMessage::getSendtime); |
727 | 728 | final List<LymsMessage> lymsMessageList = lymsMessageService.list(messageQueryWrapper); |
728 | 729 | Map map=new HashMap(); |
... | ... | @@ -730,9 +731,9 @@ |
730 | 731 | map.put("type","txt"); |
731 | 732 | reusltJsonObject.put("bodies",Arrays.asList(map)); |
732 | 733 | //医生信息 |
733 | - map.clear(); | |
734 | - map.put("dlogin", lymsChatgroup.getTarget()); | |
735 | - List<AppgetdoctorlistInfo> dLst = appgetdoctorlistInfoService.listByMap(map); | |
734 | + LambdaQueryWrapper<AppgetdoctorlistInfo> appgetdoctorlistInfoQueryWrapper=new QueryWrapper().lambda(); | |
735 | + appgetdoctorlistInfoQueryWrapper.eq(AppgetdoctorlistInfo::getDlogin, lymsChatgroup.getTarget()); | |
736 | + List<AppgetdoctorlistInfo> dLst = appgetdoctorlistInfoService.list(appgetdoctorlistInfoQueryWrapper); | |
736 | 737 | if (dLst.size()==0) { |
737 | 738 | continue; |
738 | 739 | } |
739 | 740 | |
... | ... | @@ -744,11 +745,14 @@ |
744 | 745 | for (Object r : rs) { |
745 | 746 | JSONObject rjson= (JSONObject) JSON.toJSON(r); |
746 | 747 | if (! rjson.get("to").toString().equals(lymsChatgroup.getHxgroupid())) { |
747 | - rs.add(reusltJsonObject); | |
748 | + rsrjson.add(reusltJsonObject); | |
748 | 749 | } |
749 | 750 | } |
750 | 751 | } |
751 | - | |
752 | + //结果集中添加 | |
753 | + for (Object o : rsrjson) { | |
754 | + rs.add(o); | |
755 | + } | |
752 | 756 | } |
753 | 757 | } |