Sfoglia il codice sorgente

Merge branch 'dev' of lyr/patient-co-management into dev

lyr 8 anni fa
parent
commit
5e9c4101eb

+ 5 - 5
src/main/java/com/yihu/wlyy/service/app/talk/TalkGroupService.java

@ -349,9 +349,9 @@ public class TalkGroupService extends BaseService {
        if (result != null && result.length() > 0) {
            for (int i = 0; i < result.length(); i++) {
                JSONObject obj = result.getJSONObject(i);
                if (obj.getInt("msg_type") == 1) {
                if (obj.getInt("msg_type") == 1 && obj.get("peer_uid") != null) {
                    JSONObject objRe = new JSONObject();
                    Doctor fromDoctor = doctorDao.findByCode(obj.getString("peer_uid"));
                    Doctor fromDoctor = doctorDao.findByCode(obj.get("peer_uid").toString());
                    if(fromDoctor == null){
                        continue;
@ -363,14 +363,14 @@ public class TalkGroupService extends BaseService {
                        }
                    }
                    objRe.put("uid",obj.getString("uid") != null ? obj.getString("uid") :"");
                    objRe.put("fromUid",obj.getString("peer_uid") != null ? obj.getString("peer_uid") : "");
                    objRe.put("uid",obj.get("uid") != null ? obj.getString("uid") :"");
                    objRe.put("fromUid",obj.get("peer_uid") != null ? obj.get("peer_uid").toString() : "");
                    objRe.put("fromName",fromDoctor.getName());
                    objRe.put("fromLevel",fromDoctor.getLevel());
                    objRe.put("photo",StringUtils.isEmpty(fromDoctor.getPhoto())?"":fromDoctor.getPhoto());
                    objRe.put("sex",fromDoctor.getSex());
                    objRe.put("lastContentType",obj.getInt("last_content_type"));
                    objRe.put("lastContent",new String(obj.getString("last_content").getBytes(),"utf-8"));
                    objRe.put("lastContent",obj.get("last_content") != null?new String(obj.getString("last_content").getBytes(),"utf-8"):"");
                    objRe.put("newMsgCount",obj.getInt("new_msg_count"));
                    objRe.put("lastMsgTime",obj.getLong("timestamp"));

+ 18 - 2
src/main/java/com/yihu/wlyy/web/doctor/discussion/DoctorDiscussionGroupController.java

@ -670,11 +670,27 @@ public class DoctorDiscussionGroupController extends BaseController {
	 */
	@RequestMapping(value = "/one_to_one_im")
	@ResponseBody
	public String getOneToOneIm(@RequestParam(required = false) String doctorName){
	public String getOneToOneIm(@RequestParam(required = false) String doctorName
			,@RequestParam(required = false) Integer page
			,@RequestParam(required = false) Integer pagesize){
		try{
			JSONArray result = talkGroupService.getOneToOneIm(getUID(),doctorName);
			return write(200,"查询成功","data",result);
			if(page != null && pagesize != null){
				int from = (page - 1)*pagesize;
				int end = from + pagesize;
				JSONArray pageResult = new JSONArray();
				if(result != null){
					for(int i = from; i < result.length(); i++){
						if(i < end){
							pageResult.put(result.getJSONObject(i));
						}
					}
				}
				return write(200,"查询成功","data",pageResult);
			}else{
				return write(200,"查询成功","data",result);
			}
		}catch (Exception e){
			e.printStackTrace();
			return error(-1,"查询失败");