Browse Source

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

huangwenjie 7 years ago
parent
commit
29072887c7

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

@ -133,14 +133,14 @@ public interface MessageDao extends PagingAndSortingRepository<Message, Long>, J
    @Query("select a from Message a where a.read = 1 and a.receiver = ?1 and a.state = 1 and a.type = 18 order by a.czrq desc")
    List<Message> getFamilySign(String receiver);
    @Query("select a from Message a where a.receiver = ?1 and a.state = 1 and a.type = 18 and a.read = 1")
    @Query("select a from Message a where a.receiver = ?1 and a.state = 1 and a.type in(18,19,20,21,22) and a.read = 1")
    List<Message> selectFamilySign(String receiver,Pageable pageableRequest);
    @Query("select a from Message a where a.read= ?2 and a.receiver = ?1 and a.state = 1 and a.over = ?3 and a.type = 17 order by a.czrq desc")
    List<Message> getFamilyTransferReadAndOver(String receiver,Integer read,String over);
    @Query("select a from Message a where a.read= ?2 and a.receiver = ?1 and a.state = 1 and a.over = ?3 and a.type = ?4 order by a.czrq desc")
    List<Message> getSpecialistUntreated(String receiver,Integer read,String over,Pageable pageable,Integer type);
    @Query("select a from Message a where a.read= ?2 and a.receiver = ?1 and a.state = 1 and a.over = ?3 and a.type in (16,19,20,21,22) order by a.czrq desc")
    List<Message> getSpecialistUntreated(String receiver,Integer read,String over,Pageable pageable);
    @Query("select a from Message a where a.code = ?1")
    Message findByCode(String code);

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

@ -897,7 +897,7 @@ public class MessageService extends BaseService {
        // 分页信息
        Pageable pageRequest = new PageRequest(page - 1, size, sort);
        return messageDao.getSpecialistUntreated(message.getReceiver(),message.getRead(),message.getOver(),pageRequest,message.getType());
        return messageDao.getSpecialistUntreated(message.getReceiver(),message.getRead(),message.getOver(),pageRequest);
    }

+ 4 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/specialist/SpecialistEvaluateSevice.java

@ -113,12 +113,13 @@ public class SpecialistEvaluateSevice extends BaseService {
    /**
     * 发送消息 type:19 受理提醒,20 待办工作提醒 21 服务进展提醒-已完成 22 服务进展提醒-未完成
     */
    public JSONObject sendMessage(Message message,String hospital,String patient){
    public JSONObject sendMessage(Message message,String hospital,String patient,Integer time){
        JSONObject object = new JSONObject();
        try {
            Patient patient1 = patientDao.findByCode(patient);
            Hospital hospital1 = hospitalDao.findByCode(hospital);
            Doctor doctor = doctorDao.findByCode(message.getSender());
            Doctor doctor1 = doctorDao.findByCode(message.getReceiver());
            if (message.getType() == 19 && StringUtils.isNoneBlank(hospital)){
                message.setType(19);
                message.setTitle("康复计划-受理提醒");
@ -126,7 +127,7 @@ public class SpecialistEvaluateSevice extends BaseService {
            }else if (message.getType() == 20){
                message.setType(20);
                message.setTitle("康复计划-待办工作提醒");
                message.setContent("您的"+patient1.getName()+"签约居民10天后计划到"+hospital1.getName()+"复诊,请查看");
                message.setContent("您的"+patient1.getName()+"签约居民"+time+"天后计划到"+hospital1.getName()+"复诊,请查看");
            }else if (message.getType() == 21){
                message.setType(21);
                message.setTitle("康复计划-服务进展提醒");
@ -145,6 +146,7 @@ public class SpecialistEvaluateSevice extends BaseService {
            message.setDel("1");
            message.setState(1);
            message.setCzrq(new Date());
            message.setReceiverName(doctor1.getName());
            messageDao.save(message);
        }catch (Exception e){
            e.printStackTrace();

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

@ -576,7 +576,6 @@ public class DoctorMessageController extends BaseController {
        }
        Message message1 = new Message();
        com.alibaba.fastjson.JSONObject object = JSON.parseObject(message);
        message1.setType(object.getInteger("type"));
        message1.setOver(object.getString("over"));
        message1.setRead(object.getInteger("read"));
        message1.setReceiver(getUID());
@ -589,6 +588,15 @@ public class DoctorMessageController extends BaseController {
    }
    /**
     * 发送消息 type:19 受理提醒,20 待办工作提醒 21 服务进展提醒-已完成 22 服务进展提醒-未完成
     *  message{sender:"",receiver:"",relationCode:""}
     * @param message
     * @param hospital
     * @param patient
     * @param time
     * @return
     */
    @RequestMapping(value = "sendMessage", method = RequestMethod.GET)
    @ResponseBody
    @ApiOperation("发送消息")
@ -597,14 +605,16 @@ public class DoctorMessageController extends BaseController {
                              @ApiParam(name = "hospital",value = "医院code")
                              @RequestParam(value = "hospital")String hospital,
                              @ApiParam(name = "patient",value = "居民code")
                              @RequestParam(value = "patient")String patient) {
                              @RequestParam(value = "patient")String patient,
                              @ApiParam(name = "time",value = "时间")
                              @RequestParam(value = "time",required = false)Integer time) {
        try {
            com.alibaba.fastjson.JSONObject object = com.alibaba.fastjson.JSONObject.parseObject(message);
            Message message1 = new Message();
            message1.setSender(object.getString("sender"));
            message1.setType(object.getInteger("type"));
            message1.setReceiver(object.getString("receiver"));
            return write(200, "获取消息成功!","data",specialistEvaluateSevice.sendMessage(message1,hospital,patient));
            return write(200, "获取消息成功!","data",specialistEvaluateSevice.sendMessage(message1,hospital,patient,time));
        } catch (Exception e) {
            error(e);
            return error(-1, "获取消息失败!");