|
@ -111,7 +111,7 @@ public class MessageService extends BaseService {
|
|
|
/**
|
|
|
* 查询医生未读消息和最后消息
|
|
|
*/
|
|
|
public JSONObject findDoctorAllMessage(String doctor,Integer type) throws Exception {
|
|
|
public JSONObject findDoctorAllMessage(String doctor,Integer type,Integer flag) throws Exception {
|
|
|
// 签约未读消息总数
|
|
|
int sign = messageDao.amountUnreadByReceiver(doctor);
|
|
|
JSONObject signJson = new JSONObject();
|
|
@ -252,8 +252,14 @@ public class MessageService extends BaseService {
|
|
|
familyMesJson.put("amount", 0);
|
|
|
}
|
|
|
|
|
|
|
|
|
//专科消息
|
|
|
List<Message> specialistList = messageDao.getSpecialistUnRead(doctor);
|
|
|
List<Message> specialistList = null;
|
|
|
if (flag == 1){
|
|
|
specialistList = messageDao.getSpecialistUnRead(doctor);
|
|
|
}else if (flag == 2){
|
|
|
specialistList = messageDao.getSpecialistUnRead2(doctor);
|
|
|
}
|
|
|
JSONObject specialistMesJson = new JSONObject();
|
|
|
JSONArray jsonArray = new JSONArray();
|
|
|
if (specialistList != null && specialistList.size() > 0) {
|
|
@ -621,7 +627,7 @@ public class MessageService extends BaseService {
|
|
|
*
|
|
|
* @param doctor
|
|
|
*/
|
|
|
public String setMessageReaded(String doctor,List<Integer> types) {
|
|
|
public String setMessageReaded(String doctor,List<Integer> types,Integer flag) {
|
|
|
StringBuffer buffer = new StringBuffer();
|
|
|
buffer.append("type in (");
|
|
|
for (int i = 0;i<types.size();i++){
|
|
@ -630,14 +636,19 @@ public class MessageService extends BaseService {
|
|
|
buffer.deleteCharAt(buffer.length()-1);
|
|
|
buffer.append(")");
|
|
|
int i = 0;
|
|
|
if (types.contains(19)&&types.contains(21)){
|
|
|
if (flag == 1){
|
|
|
String sql = " update wlyy_message a set a.has_read = 0,a.over = '0' where a.receiver = '"+doctor+"' and "+buffer;
|
|
|
i = jdbcTemplate.update(sql);
|
|
|
}else {
|
|
|
String sql1 = " update wlyy_message a set a.has_read = 0,a.over = '0' where a.receiver = '"+doctor+"' and type = 20";
|
|
|
i=jdbcTemplate.update(sql1);
|
|
|
String sql2 = "update wlyy_message a set a.has_read = 0 where a.receiver = '"+doctor+"' and type IN (22,23)";
|
|
|
i=jdbcTemplate.update(sql2);
|
|
|
}else if (flag == 2){
|
|
|
if (types.contains(19)&&types.contains(21)){
|
|
|
String sql = " update wlyy_message a set a.has_read = 0,a.over = '0' where a.receiver = '"+doctor+"' and "+buffer;
|
|
|
i = jdbcTemplate.update(sql);
|
|
|
}else {
|
|
|
String sql1 = " update wlyy_message a set a.has_read = 0,a.over = '0' where a.receiver = '"+doctor+"' and type = 20";
|
|
|
i=jdbcTemplate.update(sql1);
|
|
|
String sql2 = "update wlyy_message a set a.has_read = 0 where a.receiver = '"+doctor+"' and type IN (22,23)";
|
|
|
i=jdbcTemplate.update(sql2);
|
|
|
}
|
|
|
}
|
|
|
return Integer.toString(i);
|
|
|
|