Prechádzať zdrojové kódy

新增续方咨询消息列表

yeshijie 8 rokov pred
rodič
commit
6229360f9c

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

@ -61,7 +61,8 @@ public interface MessageDao extends PagingAndSortingRepository<Message, Long>, J
    @Query("select a from Message a where a.receiver = ?1 and a.type not in (1,2,6)")
    List<Message> getSystemMessage(String doctor,Pageable pageRequest);
    @Query("select a from Message a where a.receiver = ?1 and a.type=6")
    List<Message> getPrescriptionMessage(String doctor,Pageable pageRequest);
    @Query("select count(a) from Message a where a.read = 0 and a.over ='0'  and a.receiver=?1 and a.type=?2 ")
    int findMessageNum(String doctor, Integer type);

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

@ -445,6 +445,18 @@ public class MessageService extends BaseService {
        return messageDao.getSystemMessage(doctor, pageRequest);
    }
    /**
     * 获取续方消息
     */
    public List<Message> getPrescriptionMessage(String doctor, Integer page, Integer pagesize) throws Exception {
        // 排序
        Sort sort = new Sort(Sort.Direction.DESC, "czrq");
        // 分页信息
        Pageable pageRequest = new PageRequest(page - 1, pagesize, sort);
        return messageDao.getPrescriptionMessage(doctor, pageRequest);
    }
    /**
     * 设置某类消息已读
     *

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

@ -181,6 +181,25 @@ public class DoctorMessageController extends BaseController {
        }
    }
    /**
     * 续方
     */
    @RequestMapping(value = "getPrescriptionMessage", method = RequestMethod.GET)
    @ResponseBody
    @ApiOperation("获取续方消息")
    public String getPrescriptionMessage(@ApiParam(value = "第几页", defaultValue = "1")
                                   @RequestParam Integer page,
                                   @ApiParam(value = "每页几行", defaultValue = "10")
                                   @RequestParam Integer pagesize) {
        try {
            List<Message> list = messageService.getPrescriptionMessage(getUID(), page, pagesize);
            return write(200, "获取消息成功!", "list", list);
        } catch (Exception e) {
            error(e);
            return error(-1, "获取消息失败!");
        }
    }
    @RequestMapping(value = "getHealthIndexMessage", method = RequestMethod.GET)
    @ResponseBody
    @ApiOperation("获取超标指标消息--根据患者分组")