Browse Source

[CMT]后台管理系统新功能开发

wangzhinan 7 năm trước cách đây
mục cha
commit
80c219d1c4

+ 3 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/message/MessageDao.java

@ -60,7 +60,7 @@ public interface MessageDao extends PagingAndSortingRepository<Message, Long>, J
    @Query("update Message a set a.read = 0 where a.receiver = ?1 and a.sender=?2 and a.tzType=?3")
    int updateHealthIndexMessageByPatient(String doctor, String patient, String type);
    @Query("select a from Message a where a.read= 1 and a.receiver = ?1 and a.type not in (1,2,6,7,12,101,14,15,16,17,18) order by a.czrq desc")
    @Query("select a from Message a where a.read= 1 and a.receiver = ?1 and a.type not in (1,2,6,7,12,101,14,15,16,17,18,19,20,21,22) order by a.czrq desc")
    List<Message> getSystemMessageUnread(String doctor);
    @Query("select a from Message a where a.receiver = ?1 and a.prescriptionStatus=?2 and a.type in (6,7) order by a.createTime desc")
@ -147,4 +147,6 @@ public interface MessageDao extends PagingAndSortingRepository<Message, Long>, J
    @Query("select a from Message a where a.code = ?1")
    Message findByCode(String code);
    @Query("select a from Message a where a.read = 1 and a.receiver = ?1 and a.state = 1 and a.type in (19,20,21,22) order by a.czrq desc")
    List<Message> getSpecialistUnRead(String receiver);
}

+ 21 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/message/MessageService.java

@ -243,6 +243,24 @@ public class MessageService extends BaseService {
            familyMesJson.put("amount", 0);
        }
        //专科消息
        List<Message> specialistList = messageDao.getSpecialistUnRead(doctor);
        JSONObject specialistMesJson = new JSONObject();
        JSONArray jsonArray = new JSONArray();
        if (specialistList != null && specialistList.size() > 0) {
            specialistMesJson.put("amount", specialistList.size());
            JSONObject  specialistJson = new JSONObject();
            specialistJson.put("title", specialistList.get(0).getTitle());
            specialistJson.put("type", specialistList.get(0).getType());
            specialistJson.put("msg", "您有"+specialistList.size()+"个专科服务消息,请查看!");
            specialistJson.put("msgTime", DateUtil.dateToStrLong(specialistList.get(0).getCreateTime()));
            specialistJson.put("relationCode",specialistList.get(0).getRelationCode());
            specialistJson.put("reason",specialistList.get(0).getReason());
            specialistMesJson.put("lastMessage", specialistJson);
        }else{
            specialistMesJson.put("amount", 0);
        }
        JSONObject json = new JSONObject();
        json.put("imMsgCount", getImMsgAmount(doctor));//IM消息数量
@ -254,6 +272,7 @@ public class MessageService extends BaseService {
        json.put("articleCheck", articleMesJson);//健康文章审核消息
        json.put("deviceUnbind",deviceMesJson);//设备解绑消息
        json.put("familyList",familyMesJson);//居民签约申请
        json.put("specialistList",specialistMesJson);//专科服务消息
        return json;
    }
@ -596,7 +615,7 @@ public class MessageService extends BaseService {
        }
        buffer.deleteCharAt(buffer.length()-1);
        buffer.append(")");
        String sql = " update wlyy_message a set a.has_read = 0,a.over = '0' where a.receiver = ?1 and "+buffer;
        String sql = " update wlyy_message a set a.has_read = 0,a.over = '0' where a.receiver = '"+doctor+"' and "+buffer;
        int i = jdbcTemplate.update(sql);
        return Integer.toString(i);
@ -922,4 +941,5 @@ public class MessageService extends BaseService {
}

+ 3 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/message/DoctorMessageController.java

@ -615,6 +615,7 @@ public class DoctorMessageController extends BaseController {
            message1.setSender(object.getString("sender"));
            message1.setType(object.getInteger("type"));
            message1.setReceiver(object.getString("receiver"));
            message1.setRelationCode(object.getString("relationCode"));
            return write(200, "获取消息成功!","data",specialistEvaluateSevice.sendMessage(message1,hospital,patient,time));
        } catch (Exception e) {
            error(e);
@ -629,9 +630,9 @@ public class DoctorMessageController extends BaseController {
     * @param types
     * @return
     */
    @RequestMapping(value = "setMessageReads",method = RequestMethod.GET)
    @RequestMapping(value = "setMessageReads",method = RequestMethod.POST)
    @ResponseBody
    @ApiOperation("专科医生待处理消息")
    @ApiOperation("一键已读" )
    public String setMessageRead(@ApiParam(name = "types",value = "消息集合")
                                     @RequestParam(value = "types")String types) {
        try {