소스 검색

消息查询修改

lyr 8 년 전
부모
커밋
5283a7124a

+ 14 - 6
src/main/java/com/yihu/wlyy/repository/consult/ConsultTeamDao.java

@ -138,13 +138,21 @@ public interface ConsultTeamDao extends PagingAndSortingRepository<ConsultTeam,
	int updateComment(String commentContent, double commentStar, String consult);
	// 查询医生所有未读的消息总数
	@Query("SELECT SUM(a.doctorRead) FROM ConsultTeam a, ConsultTeamDoctor b WHERE a.consult = b.consult AND b.to = ?1 AND a.del = '1' AND a.status = 0")
	@Query("SELECT SUM(a.doctorRead) FROM ConsultTeam a, ConsultTeamDoctor b WHERE a.consult = b.consult AND b.to = ?1 AND a.del = '1' AND a.status = 0 AND a.type <> 6")
	int amountAllDoctorUnread(String doctor);
	// 查询医生所有未读的消息总数
	@Query("SELECT a.name,b.czrq FROM ConsultTeam a, ConsultTeamDoctor b WHERE a.consult = b.consult AND b.to = ?1 AND a.del = '1' AND a.status = 0 order by b.czrq desc")
	@Query("SELECT SUM(a.doctorRead) FROM ConsultTeam a, ConsultTeamDoctor b WHERE a.consult = b.consult AND b.to = ?1 AND a.del = '1' AND a.status = 0 AND a.type = 6")
	int amountAlFamouslDoctorUnread(String doctor);
	// 查询医生所有未读的消息总数
	@Query("SELECT a.name,b.czrq FROM ConsultTeam a, ConsultTeamDoctor b WHERE a.consult = b.consult AND b.to = ?1 AND a.del = '1' AND a.status = 0 AND a.type <> 6 order by b.czrq desc")
	Page<Object> AllDoctorUnreadLast(String doctor,Pageable pageRequest);
	// 查询医生所有未读的消息总数
	@Query("SELECT a.name,b.czrq FROM ConsultTeam a, ConsultTeamDoctor b WHERE a.consult = b.consult AND b.to = ?1 AND a.del = '1' AND a.status = 0 AND a.type = 6 order by b.czrq desc")
	Page<Object> AllDoctorFamousUnreadLast(String doctor,Pageable pageRequest);
	// 查询带未读数量的所有健康咨询列表
	@Query("SELECT a FROM ConsultTeam a, ConsultTeamDoctor b WHERE a.consult = b.consult AND b.to = ?1 AND a.status = 0 and a.type< 3")
	Page<ConsultTeam> findListByUnreadDoctor(String doctor, Pageable pageRequest);
@ -187,19 +195,19 @@ public interface ConsultTeamDao extends PagingAndSortingRepository<ConsultTeam,
	ConsultTeam findByParientCodeAndSignTypeAndDoctor(String patientCode, String doctor, int s);
	//名医咨询 -全部 带symptoms 未处理、未回复
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and a.type=6 and b.to = ?1 and a.id < ?2 and a.symptoms like ?3 and a.status = 0 and (a.doctorRead > 0 or b.reply != 1) and a.del = '1' and b.del = '1'")
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and a.type=6 and b.to = ?1 and a.id < ?2 and a.symptoms like ?3 and a.status = 0 and (a.doctorRead > 0 or b.reply <> 1) and a.del = '1' and b.del = '1'")
	Page<ConsultTeam> findFamousDoctorUnReplyReadList(String uid, long id,String title, Pageable pageRequest);
	//名医咨询 -全部 带symptoms 处理、未回复
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and a.type=6 and b.to = ?1 and a.symptoms like ?2 and a.status = 0 and (a.doctorRead > 0 or b.reply != 1) and a.del = '1' and b.del = '1'")
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and a.type=6 and b.to = ?1 and a.symptoms like ?2 and a.status = 0 and (a.doctorRead > 0 or b.reply <> 1) and a.del = '1' and b.del = '1'")
	Page<ConsultTeam> findFamousDoctorUnReplyReadList(String uid,String title, Pageable pageRequest);
	//名医咨询 -全部 处理、未回复
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and a.type=6 and b.to = ?1 and a.id < ?2 and a.status = 0 and (a.doctorRead > 0 or b.reply != 1) and a.del = '1' and b.del = '1'")
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and a.type=6 and b.to = ?1 and a.id < ?2 and a.status = 0 and (a.doctorRead > 0 or b.reply <> 1) and a.del = '1' and b.del = '1'")
	Page<ConsultTeam> findFamousDoctorUnReplyReadNoTitleList(String uid, long id, Pageable pageRequest);
	//名医咨询 -全部
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and a.type=6 and b.to = ?1 and a.status = 0 and (a.doctorRead > 0 or b.reply != 1) and a.del = '1' and b.del = '1'")
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and a.type=6 and b.to = ?1 and a.status = 0 and (a.doctorRead > 0 or b.reply <> 1) and a.del = '1' and b.del = '1'")
	Page<ConsultTeam> findFamousDoctorUnReplyReadNoTitleList(String uid, Pageable pageRequest);
	//名医咨询 -全部 带symptoms 进行中

+ 26 - 0
src/main/java/com/yihu/wlyy/service/app/message/MessageService.java

@ -95,6 +95,31 @@ public class MessageService extends BaseService {
			}
		}
		int famousConsult = 0;
		JSONObject famousJson = new JSONObject();
		try {
			famousConsult = consultTeamDao.amountAlFamouslDoctorUnread(doctor);
		} catch (Exception e) {
		}
		famousJson.put("amount",famousConsult);
		if(famousConsult > 0){
			PageRequest pageRequest = new PageRequest(0,1);
			Page<Object> msgs = consultTeamDao.AllDoctorFamousUnreadLast(doctor,pageRequest);
			if(msgs != null && msgs.getSize() > 0){
				for(Object msg : msgs){
					Object[] msgArray = (Object[])msg;
					JSONObject msgJson = new JSONObject();
					msgJson.put("msg",msgArray[0].toString() + "向您发来一个咨询");
					msgJson.put("msgTime",msgArray[1] != null? DateUtil.dateToStr((Date) msgArray[1],DateUtil.YYYY_MM_DD):"");
					consultJson.put("lastMessage",msgJson);
				}
			}
		}
		// 签约未读消息总数
		int sign = messageDao.amountUnreadByReceiver(doctor);
		JSONObject signJson =  new JSONObject();
@ -137,6 +162,7 @@ public class MessageService extends BaseService {
		JSONObject json = new JSONObject();
		json.put("consult", consultJson);
		json.put("famousConsult", famousConsult);
		json.put("sign", signJson);
		json.put("healthIndex", indexJson);
		return json;

+ 2 - 0
src/main/java/com/yihu/wlyy/service/app/sign/FamilyContractService.java

@ -1310,6 +1310,8 @@ public class FamilyContractService extends BaseService {
        // 排序
        Sort sort = new Sort(Direction.DESC, "over");
        sort.and(new Sort(Direction.DESC,"read"));
        sort.and(new Sort(Direction.DESC,"czrq"));
        // 分页信息
        PageRequest pageRequest = new PageRequest(0, pagesize, sort);
        // 设置查询条件

+ 5 - 3
src/main/resources/system.properties

@ -78,7 +78,10 @@ im_list_get=http://172.19.103.76:3000/
##是否签约检查和签约数据上传
#sign_check_upload=http://172.19.103.85:8011/wlyy_service
##im一对一列表获取
#im_list_get=http://172.13.103.88:3000/
#im_list_get=http://172.19.103.88:3000/
#----------------正式环境卫计委签约调用接口地址-------------------#
#sign_check_upload=http://59.61.92.90:8072/wlyy_service
im_group_server=http://120.41.252.108:3031/group/sendgroupmsg.im
msg_push_server=http://120.41.252.108:3031/push/sendmsg.im
@ -173,5 +176,4 @@ guahao_url = http://www.xmsmjk.com/UrpNetService/ReservationNet.asmx
guahao_namespace = http://www.zysoft.com.cn/
# 基卫对接服务地址
jw_url = http://localhost:8011/
jw_url = http://localhost:8011/