|  | @ -0,0 +1,889 @@
 | 
	
		
			
				|  |  | package com.yihu.jw.hospital.module.message;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | import com.alibaba.fastjson.JSON;
 | 
	
		
			
				|  |  | import com.fasterxml.jackson.databind.ObjectMapper;
 | 
	
		
			
				|  |  | import com.yihu.jw.entity.hospital.message.SystemMessageDO;
 | 
	
		
			
				|  |  | import com.yihu.jw.hospital.message.dao.SystemMessageDao;
 | 
	
		
			
				|  |  | import com.yihu.jw.hospital.message.service.SystemMessageService;
 | 
	
		
			
				|  |  | import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
 | 
	
		
			
				|  |  | import io.swagger.annotations.Api;
 | 
	
		
			
				|  |  | import io.swagger.annotations.ApiOperation;
 | 
	
		
			
				|  |  | import io.swagger.annotations.ApiParam;
 | 
	
		
			
				|  |  | import org.apache.commons.lang3.StringUtils;
 | 
	
		
			
				|  |  | import org.json.JSONObject;
 | 
	
		
			
				|  |  | import org.springframework.beans.factory.annotation.Autowired;
 | 
	
		
			
				|  |  | import org.springframework.http.MediaType;
 | 
	
		
			
				|  |  | import org.springframework.stereotype.Controller;
 | 
	
		
			
				|  |  | import org.springframework.web.bind.annotation.RequestMapping;
 | 
	
		
			
				|  |  | import org.springframework.web.bind.annotation.RequestMethod;
 | 
	
		
			
				|  |  | import org.springframework.web.bind.annotation.RequestParam;
 | 
	
		
			
				|  |  | import org.springframework.web.bind.annotation.ResponseBody;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | import java.util.ArrayList;
 | 
	
		
			
				|  |  | import java.util.List;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | @Controller
 | 
	
		
			
				|  |  | @RequestMapping(value = "/doctor/message", produces = MediaType.APPLICATION_JSON_UTF8_VALUE, method = {RequestMethod.GET, RequestMethod.POST})
 | 
	
		
			
				|  |  | @Api(description = "医生端-消息")
 | 
	
		
			
				|  |  | public class DoctorMessageController extends EnvelopRestEndpoint {
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     @Autowired
 | 
	
		
			
				|  |  |     private SystemMessageService messageService;
 | 
	
		
			
				|  |  |     private ObjectMapper objectMapper = new ObjectMapper();
 | 
	
		
			
				|  |  |     @Autowired
 | 
	
		
			
				|  |  |     private SystemMessageDao messageDao;
 | 
	
		
			
				|  |  | //    @Autowired
 | 
	
		
			
				|  |  | //    private ThirdJkEduArticleService thirdJkEduArticleService;
 | 
	
		
			
				|  |  | //    @Autowired
 | 
	
		
			
				|  |  | //    private SpecialistEvaluateSevice specialistEvaluateSevice;
 | 
	
		
			
				|  |  | //    @Autowired
 | 
	
		
			
				|  |  | //    ElasticsearchUtil elasticsearchUtil;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     //    @Value("${demo.flag}")
 | 
	
		
			
				|  |  |     private Boolean demoFlag;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     @RequestMapping(value = "getWaitingMessages", method = RequestMethod.GET)
 | 
	
		
			
				|  |  |     @ApiOperation("获取服务工单待接单列表")
 | 
	
		
			
				|  |  |     @ResponseBody
 | 
	
		
			
				|  |  |     public String getWaitingMessages(
 | 
	
		
			
				|  |  |             @ApiParam(name = "message", value = "消息对象") @RequestParam(value = "message") String message,
 | 
	
		
			
				|  |  |             @ApiParam(name = "types", value = "消息类型") @RequestParam(value = "types", required = true) String types,
 | 
	
		
			
				|  |  |             @ApiParam(name = "page", value = "第几页", defaultValue = "1") @RequestParam(value = "page", required = true) String page,
 | 
	
		
			
				|  |  |             @ApiParam(name = "pageSize", value = "", defaultValue = "10") @RequestParam(value = "pageSize", required = true) String pageSize
 | 
	
		
			
				|  |  |     ) {
 | 
	
		
			
				|  |  |         if (StringUtils.isBlank(pageSize)) {
 | 
	
		
			
				|  |  |             pageSize = "10";
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         if (page.equals("0")) {
 | 
	
		
			
				|  |  |             page = "1";
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         String[] split = StringUtils.split(types, ",");
 | 
	
		
			
				|  |  |         List<Integer> typeList = new ArrayList<>();
 | 
	
		
			
				|  |  |         for (String s : split) {
 | 
	
		
			
				|  |  |             typeList.add(Integer.valueOf(s));
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         SystemMessageDO message1 = new SystemMessageDO();
 | 
	
		
			
				|  |  |         com.alibaba.fastjson.JSONObject object = JSON.parseObject(message);
 | 
	
		
			
				|  |  |         message1.setOver(object.getString("over"));
 | 
	
		
			
				|  |  |         message1.setIsRead(object.getInteger("read").toString());
 | 
	
		
			
				|  |  |         message1.setReceiver(getUID());
 | 
	
		
			
				|  |  |         try {
 | 
	
		
			
				|  |  | //            JSONObject waitingMessages = messageService.getWaitingMessages(message1, types, Integer.valueOf(page), Integer.valueOf(pageSize));
 | 
	
		
			
				|  |  |             JSONObject waitingMessages = null;
 | 
	
		
			
				|  |  |             return write(200, "查询成功", "data", waitingMessages);
 | 
	
		
			
				|  |  |         } catch (Exception e) {
 | 
	
		
			
				|  |  |             return e.getMessage();
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | //    @ResponseBody
 | 
	
		
			
				|  |  | //    @RequestMapping(value = "messages")
 | 
	
		
			
				|  |  | //    @ApiOperation("查询医生未读消息和最后消息")
 | 
	
		
			
				|  |  | //    public Envelop messages(
 | 
	
		
			
				|  |  | //            @ApiParam(name = "type", value = "文章审核的时候必传,消息类型,14:提交文章审核,15:审核结果") @RequestParam(value = "type", required = false) Integer type,
 | 
	
		
			
				|  |  | //            @ApiParam(name = "flag", value = "标识家医/专科") @RequestParam(value = "flag", required = false) Integer flag
 | 
	
		
			
				|  |  | //    ) {
 | 
	
		
			
				|  |  | //        try {
 | 
	
		
			
				|  |  | //            JSONObject json = messageService.findDoctorAllMessage(getUID(), type, flag);
 | 
	
		
			
				|  |  | //            return success("获取消息总数成功!", json);
 | 
	
		
			
				|  |  | //        } catch (Exception e) {
 | 
	
		
			
				|  |  | //            return failed(e.getMessage());
 | 
	
		
			
				|  |  | //        }
 | 
	
		
			
				|  |  | //    }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     /**
 | 
	
		
			
				|  |  |      * 医生消息总数统计接口
 | 
	
		
			
				|  |  |      *
 | 
	
		
			
				|  |  |      * @return
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  | //    @RequestMapping(value = "amount")
 | 
	
		
			
				|  |  | //    @ResponseBody
 | 
	
		
			
				|  |  | //    @ApiOperation("医生消息总数统计接口")
 | 
	
		
			
				|  |  | //    public String amount() {
 | 
	
		
			
				|  |  | //        try {
 | 
	
		
			
				|  |  | //            JSONObject json = messageService.findDoctorAllMessageAmount(getUID());
 | 
	
		
			
				|  |  | //            if (json == null) {
 | 
	
		
			
				|  |  | //                return error(-1, "获取消息总数失败!");
 | 
	
		
			
				|  |  | //            } else {
 | 
	
		
			
				|  |  | //                return write(200, "获取消息总数成功!", "data", json);
 | 
	
		
			
				|  |  | //            }
 | 
	
		
			
				|  |  | //        } catch (Exception e) {
 | 
	
		
			
				|  |  | //            return e.getMessage();
 | 
	
		
			
				|  |  | //        }
 | 
	
		
			
				|  |  | //    }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     /**
 | 
	
		
			
				|  |  |      * 健康咨询消息列表查询接口
 | 
	
		
			
				|  |  |      *
 | 
	
		
			
				|  |  |      * @param id
 | 
	
		
			
				|  |  |      * @param pagesize 分页大小
 | 
	
		
			
				|  |  |      * @return
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  | //    @RequestMapping(value = "consults")
 | 
	
		
			
				|  |  | //    @ResponseBody
 | 
	
		
			
				|  |  | //    @ApiOperation("健康咨询消息列表查询接口")
 | 
	
		
			
				|  |  | //    public String consultList(long id, int pagesize) {
 | 
	
		
			
				|  |  | //        try {
 | 
	
		
			
				|  |  | //            JSONArray array = new JSONArray();
 | 
	
		
			
				|  |  | //            Page<ConsultTeamDo> list = messageService.findConsultListByDoctor(getUID(), id, pagesize);
 | 
	
		
			
				|  |  | //            for (ConsultTeamDo consult : list) {
 | 
	
		
			
				|  |  | //                if (consult == null) {
 | 
	
		
			
				|  |  | //                    continue;
 | 
	
		
			
				|  |  | //                }
 | 
	
		
			
				|  |  | //                JSONObject json = new JSONObject();
 | 
	
		
			
				|  |  | //                json.put("id", consult.getId());
 | 
	
		
			
				|  |  | //                // 设置咨询标识
 | 
	
		
			
				|  |  | //                json.put("consult", consult.getConsult());
 | 
	
		
			
				|  |  | //                // 设置患者标识
 | 
	
		
			
				|  |  | //                json.put("patient", consult.getPatient());
 | 
	
		
			
				|  |  | //                // 设置患者头像
 | 
	
		
			
				|  |  | //                json.put("photo", consult.getPhoto());
 | 
	
		
			
				|  |  | //                // 设置主要症状
 | 
	
		
			
				|  |  | //                json.put("symptoms", consult.getSymptoms());
 | 
	
		
			
				|  |  | //                // 设置患者姓名
 | 
	
		
			
				|  |  | //                json.put("name", consult.getName());
 | 
	
		
			
				|  |  | //                // 设置状态(0进行中,1已完成,-1患者取消)
 | 
	
		
			
				|  |  | //                json.put("status", consult.getStatus());
 | 
	
		
			
				|  |  | //                // 设置消息未读数量
 | 
	
		
			
				|  |  | //                json.put("unread", consult.getDoctorRead());
 | 
	
		
			
				|  |  | //                // 设置咨询时间
 | 
	
		
			
				|  |  | //                json.put("time", DateUtil.dateToStr(consult.getCzrq(), DateUtil.YYYY_MM_DD_HH_MM_SS));
 | 
	
		
			
				|  |  | //                array.put(json);
 | 
	
		
			
				|  |  | //            }
 | 
	
		
			
				|  |  | //            return write(200, "获取健康咨询列表成功!", "list", array);
 | 
	
		
			
				|  |  | //        } catch (Exception e) {
 | 
	
		
			
				|  |  | //            return e.getMessage();
 | 
	
		
			
				|  |  | //        }
 | 
	
		
			
				|  |  | //    }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | //    /**
 | 
	
		
			
				|  |  | //     * 更新体征消息为已读
 | 
	
		
			
				|  |  | //     *
 | 
	
		
			
				|  |  | //     * @param msgid
 | 
	
		
			
				|  |  | //     * @return
 | 
	
		
			
				|  |  | //     */
 | 
	
		
			
				|  |  | //    @RequestMapping(value = "read_health")
 | 
	
		
			
				|  |  | //    @ResponseBody
 | 
	
		
			
				|  |  | //    @ApiOperation("消息设置成已读")
 | 
	
		
			
				|  |  | //    public String readHealth(long msgid) {
 | 
	
		
			
				|  |  | //        try {
 | 
	
		
			
				|  |  | //            messageService.readHealth(msgid);
 | 
	
		
			
				|  |  | //            return success("操作成功!");
 | 
	
		
			
				|  |  | //        } catch (Exception e) {
 | 
	
		
			
				|  |  | //            return e.getMessage();
 | 
	
		
			
				|  |  | //        }
 | 
	
		
			
				|  |  | //    }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     /**
 | 
	
		
			
				|  |  |      * 根据参数查询发送给我的消息
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  | //    @RequestMapping(value = "find")
 | 
	
		
			
				|  |  | //    @ResponseBody
 | 
	
		
			
				|  |  | //    @ApiOperation("查询发送给我的消息")
 | 
	
		
			
				|  |  | //    public String findMyMessage(String sender, String signStatus) {
 | 
	
		
			
				|  |  | //        try {
 | 
	
		
			
				|  |  | //            SystemMessageDO msg = messageService.findUnreadSign(sender, getUID(), signStatus);
 | 
	
		
			
				|  |  | //            JSONObject json = null;
 | 
	
		
			
				|  |  | //            if (msg != null) {
 | 
	
		
			
				|  |  | //                json = new JSONObject();
 | 
	
		
			
				|  |  | //                json.put("id", msg.getId());
 | 
	
		
			
				|  |  | //                json.put("sender", msg.getSender());
 | 
	
		
			
				|  |  | //                json.put("senderName", msg.getSenderName());
 | 
	
		
			
				|  |  | //                json.put("type", msg.getType());
 | 
	
		
			
				|  |  | //                json.put("read", msg.getIsRead()); // 是否已读:1未读,0已读
 | 
	
		
			
				|  |  | ////                json.put("signStatus", msg.getSignStatus());
 | 
	
		
			
				|  |  | //                json.put("status", msg.getOver());
 | 
	
		
			
				|  |  | //                json.put("reason", msg.getReason());
 | 
	
		
			
				|  |  | //            }
 | 
	
		
			
				|  |  | //            return write(200, "获取消息成功!", "data", json);
 | 
	
		
			
				|  |  | //        } catch (Exception e) {
 | 
	
		
			
				|  |  | //            return "获取失败=>"+e.getMessage();
 | 
	
		
			
				|  |  | //        }
 | 
	
		
			
				|  |  | //    }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     /**
 | 
	
		
			
				|  |  |      * 系统消息(分配健管师 + 随访计划消息 )
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  | //    @RequestMapping(value = "getSystemMessage", method = RequestMethod.GET)
 | 
	
		
			
				|  |  | //    @ResponseBody
 | 
	
		
			
				|  |  | //    @ApiOperation("获取系统消息")
 | 
	
		
			
				|  |  | //    public String getSystemMessage(@ApiParam(value = "第几页", defaultValue = "1")
 | 
	
		
			
				|  |  | //                                   @RequestParam Integer page,
 | 
	
		
			
				|  |  | //                                   @ApiParam(value = "每页几行", defaultValue = "10")
 | 
	
		
			
				|  |  | //                                   @RequestParam Integer pagesize) {
 | 
	
		
			
				|  |  | //        try {
 | 
	
		
			
				|  |  | //            List<SystemMessageDO> list = messageService.getSystemMessage(getUID(), page, pagesize);
 | 
	
		
			
				|  |  | //            return write(200, "获取消息成功!", "list", list);
 | 
	
		
			
				|  |  | //        } catch (Exception e) {
 | 
	
		
			
				|  |  | //            return e.getMessage();
 | 
	
		
			
				|  |  | //        }
 | 
	
		
			
				|  |  | //    }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     /**
 | 
	
		
			
				|  |  |      * 续方
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  | //    @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,
 | 
	
		
			
				|  |  | //                                         @ApiParam(value = "类型(6团队长待审核,7健管师待取药)", defaultValue = "6")
 | 
	
		
			
				|  |  | //                                         @RequestParam Integer type) {
 | 
	
		
			
				|  |  | //        try {
 | 
	
		
			
				|  |  | //            List<SystemMessageDO> list = messageService.getPrescriptionMessage(getUID(), type, page, pagesize);
 | 
	
		
			
				|  |  | //            return write(200, "获取消息成功!", "list", list);
 | 
	
		
			
				|  |  | //        } catch (Exception e) {
 | 
	
		
			
				|  |  | //            return e.getMessage();
 | 
	
		
			
				|  |  | //        }
 | 
	
		
			
				|  |  | //    }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     /**
 | 
	
		
			
				|  |  |      * 文章审核
 | 
	
		
			
				|  |  |      *
 | 
	
		
			
				|  |  |      * @param page
 | 
	
		
			
				|  |  |      * @param pagesize
 | 
	
		
			
				|  |  |      * @return
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  | //    @RequestMapping(value = "getEduArticleMessage", method = RequestMethod.GET)
 | 
	
		
			
				|  |  | //    @ResponseBody
 | 
	
		
			
				|  |  | //    @ApiOperation("获取文章审核消息")
 | 
	
		
			
				|  |  | //    public String getEduArticleMessage(@ApiParam(name = "type", value = "文章审核的时候必传,消息类型,14:提交文章审核,15:审核结果")
 | 
	
		
			
				|  |  | //                                       @RequestParam(value = "type", required = false) Integer type,
 | 
	
		
			
				|  |  | //                                       @ApiParam(value = "第几页", defaultValue = "1")
 | 
	
		
			
				|  |  | //                                       @RequestParam Integer page,
 | 
	
		
			
				|  |  | //                                       @ApiParam(value = "每页几行", defaultValue = "10")
 | 
	
		
			
				|  |  | //                                       @RequestParam Integer pagesize) {
 | 
	
		
			
				|  |  | //        try {
 | 
	
		
			
				|  |  | //            List<SystemMessageDO> list = messageService.getEduArticleMessage(getUID(), type, page, pagesize);
 | 
	
		
			
				|  |  | //            return write(200, "获取消息成功!", "list", list);
 | 
	
		
			
				|  |  | //        } catch (Exception e) {
 | 
	
		
			
				|  |  | //            return e.getMessage();
 | 
	
		
			
				|  |  | //        }
 | 
	
		
			
				|  |  | //    }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | //    @RequestMapping(value = "getHealthIndexMessage", method = RequestMethod.GET)
 | 
	
		
			
				|  |  | //    @ResponseBody
 | 
	
		
			
				|  |  | //    @ApiOperation("获取超标指标消息--根据患者分组")
 | 
	
		
			
				|  |  | //    public String getHealthIndexMessage() throws Exception {
 | 
	
		
			
				|  |  | //        try {
 | 
	
		
			
				|  |  | //            Map<String, List<Map<String, Object>>> list = messageService.getHealthIndexMessage(getUID());     //"D20161008003"
 | 
	
		
			
				|  |  | //
 | 
	
		
			
				|  |  | //            return write(200, "获取超标指标消息成功", "data", list);
 | 
	
		
			
				|  |  | //        } catch (Exception ex) {
 | 
	
		
			
				|  |  | //            return invalidUserException(ex, -1, ex.getMessage());
 | 
	
		
			
				|  |  | //        }
 | 
	
		
			
				|  |  | //    }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | //    @RequestMapping(value = "getHealthIndexMessageByPatient", method = RequestMethod.GET)
 | 
	
		
			
				|  |  | //    @ResponseBody
 | 
	
		
			
				|  |  | //    @ApiOperation("获取患者超标指标消息")
 | 
	
		
			
				|  |  | //    public String getHealthIndexMessageByPatient(@ApiParam(name = "patient", value = "患者代码", defaultValue = "P20161008001")
 | 
	
		
			
				|  |  | //                                                 @RequestParam(value = "patient", required = true) String patient,
 | 
	
		
			
				|  |  | //                                                 @ApiParam(name = "type", value = "健康指标类型1血糖,2血压,3体重", defaultValue = "1")
 | 
	
		
			
				|  |  | //                                                 @RequestParam(value = "type", required = true) String type,
 | 
	
		
			
				|  |  | //                                                 @ApiParam(name = "page", value = "第几页", defaultValue = "1")
 | 
	
		
			
				|  |  | //                                                 @RequestParam(value = "page", required = true) Integer page,
 | 
	
		
			
				|  |  | //                                                 @ApiParam(name = "pagesize", value = "每页几行", defaultValue = "10")
 | 
	
		
			
				|  |  | //                                                 @RequestParam(value = "pagesize", required = true) Integer pagesize) throws Exception {
 | 
	
		
			
				|  |  | //        try {
 | 
	
		
			
				|  |  | //
 | 
	
		
			
				|  |  | //            List<Map<String, String>> list = messageService.getHealthIndexMessageByPatient(getUID(), patient, type, page, pagesize, getObserverStatus());
 | 
	
		
			
				|  |  | //            Map<Object, Object> map = new HashMap<Object, Object>();
 | 
	
		
			
				|  |  | //            ObjectMapper mapper = new ObjectMapper();
 | 
	
		
			
				|  |  | //            mapper.setDateFormat(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"));
 | 
	
		
			
				|  |  | //            map.put("status", 200);
 | 
	
		
			
				|  |  | //            map.put("msg", "获取超标指标消息成功");
 | 
	
		
			
				|  |  | //            map.put("data", list);
 | 
	
		
			
				|  |  | //            String tzCode = "";
 | 
	
		
			
				|  |  | //            for (Map<String, String> one : list) {
 | 
	
		
			
				|  |  | //                tzCode += "," + one.get("tzCode");
 | 
	
		
			
				|  |  | //            }
 | 
	
		
			
				|  |  | //            map.put("tzCode", StringUtils.isNotEmpty(tzCode) ? tzCode.substring(1) : "");
 | 
	
		
			
				|  |  | //            return mapper.writeValueAsString(map);
 | 
	
		
			
				|  |  | //        } catch (Exception ex) {
 | 
	
		
			
				|  |  | //            return ex.getMessage();
 | 
	
		
			
				|  |  | //        }
 | 
	
		
			
				|  |  | //    }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     /**
 | 
	
		
			
				|  |  |      * 设置某类消息已读
 | 
	
		
			
				|  |  |      *
 | 
	
		
			
				|  |  |      * @param type 消息类型
 | 
	
		
			
				|  |  |      * @return
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  | //    @RequestMapping(value = "setMessageReaded")
 | 
	
		
			
				|  |  | //    @ResponseBody
 | 
	
		
			
				|  |  | //    @ApiOperation("设置某类消息已读")
 | 
	
		
			
				|  |  | //    public Envelop setMessageReaded(@RequestParam @ApiParam(value = "消息类型") Integer type) {
 | 
	
		
			
				|  |  | //        try {
 | 
	
		
			
				|  |  | //            messageService.setMessageReaded(getUID(), type);
 | 
	
		
			
				|  |  | //            return success("设置成功");
 | 
	
		
			
				|  |  | //        } catch (Exception e) {
 | 
	
		
			
				|  |  | //            return failed(e.getMessage());
 | 
	
		
			
				|  |  | //        }
 | 
	
		
			
				|  |  | //    }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     /**
 | 
	
		
			
				|  |  |      * 设置某条消息已读
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  | //    @RequestMapping(value = "setMessageReadedById")
 | 
	
		
			
				|  |  | //    @ResponseBody
 | 
	
		
			
				|  |  | //    @ApiOperation("设置某条消息已读")
 | 
	
		
			
				|  |  | //    public String setMessageReadedById(@RequestParam @ApiParam(value = "消息id") Long id) {
 | 
	
		
			
				|  |  | //        try {
 | 
	
		
			
				|  |  | //            messageService.setMessageReadedById(getUID(), id);
 | 
	
		
			
				|  |  | //            return write(200, "设置成功");
 | 
	
		
			
				|  |  | //        } catch (Exception e) {
 | 
	
		
			
				|  |  | //            return e.getMessage();
 | 
	
		
			
				|  |  | //        }
 | 
	
		
			
				|  |  | //    }
 | 
	
		
			
				|  |  |     @RequestMapping(value = "getMessageNoticeSetting", method = RequestMethod.GET)
 | 
	
		
			
				|  |  |     @ResponseBody
 | 
	
		
			
				|  |  |     @ApiOperation("获取消息设置")
 | 
	
		
			
				|  |  |     public String getMessageNoticeSetting() {
 | 
	
		
			
				|  |  |         try {
 | 
	
		
			
				|  |  |             com.alibaba.fastjson.JSONObject messageNoticeSetting = messageService.getMessageNoticSetting(getUID(), "1");
 | 
	
		
			
				|  |  |             return write(200, "查询成功", "data", messageNoticeSetting);
 | 
	
		
			
				|  |  |         } catch (Exception e) {
 | 
	
		
			
				|  |  |             return e.getMessage();
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | //    @RequestMapping(value = "saveMessageNoticeSetting", method = RequestMethod.POST)
 | 
	
		
			
				|  |  | //    @ResponseBody
 | 
	
		
			
				|  |  | //    @ApiOperation("保存消息提醒设置")
 | 
	
		
			
				|  |  | //    public Envelop saveMessageNoticeSetting(@ApiParam(name = "json", value = "数据json")
 | 
	
		
			
				|  |  | //                                            @RequestParam(value = "json", required = true) String json) {
 | 
	
		
			
				|  |  | //        try {
 | 
	
		
			
				|  |  | //            MessageNoticeSetting messageNoticeSetting = objectMapper.readValue(json, MessageNoticeSetting.class);
 | 
	
		
			
				|  |  | //            if (messageNoticeSetting.getId() == null) {
 | 
	
		
			
				|  |  | //                return failed( "参数错误");
 | 
	
		
			
				|  |  | //            }
 | 
	
		
			
				|  |  | //            messageService.saveMessageNoticeSetting(messageNoticeSetting);
 | 
	
		
			
				|  |  | //            return success("设置成功");
 | 
	
		
			
				|  |  | //        } catch (Exception e) {
 | 
	
		
			
				|  |  | //            return failed(  e.getMessage());;
 | 
	
		
			
				|  |  | //        }
 | 
	
		
			
				|  |  | //    }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | //    /**
 | 
	
		
			
				|  |  | //     * 待处理
 | 
	
		
			
				|  |  | //     */
 | 
	
		
			
				|  |  | //    @RequestMapping(value = "unTreated", method = RequestMethod.GET)
 | 
	
		
			
				|  |  | //    @ResponseBody
 | 
	
		
			
				|  |  | //    @ApiOperation("专科医生待处理消息")
 | 
	
		
			
				|  |  | //    public String selectUntreated() {
 | 
	
		
			
				|  |  | //        try {
 | 
	
		
			
				|  |  | //            JSONObject json = messageService.selectUntreated(getUID());
 | 
	
		
			
				|  |  | //            return write(200, "获取消息总数成功!", "data", json);
 | 
	
		
			
				|  |  | //        } catch (Exception e) {
 | 
	
		
			
				|  |  | //            return e.getMessage();
 | 
	
		
			
				|  |  | //        }
 | 
	
		
			
				|  |  | //    }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | //    /**
 | 
	
		
			
				|  |  | //     * @param message
 | 
	
		
			
				|  |  | //     * @param page
 | 
	
		
			
				|  |  | //     * @param pageSize
 | 
	
		
			
				|  |  | //     * @return
 | 
	
		
			
				|  |  | //     */
 | 
	
		
			
				|  |  | //    @RequestMapping(value = "getSpecialist", method = RequestMethod.GET)
 | 
	
		
			
				|  |  | //    @ApiOperation("专科医生待处理列表")
 | 
	
		
			
				|  |  | //    @ResponseBody
 | 
	
		
			
				|  |  | //    public String getSpecialist(@ApiParam(name = "message", value = "消息对象") @RequestParam(value = "message") String message,
 | 
	
		
			
				|  |  | //                                @ApiParam(name = "page", value = "第几页", defaultValue = "1") @RequestParam(value = "page", required = true) String page,
 | 
	
		
			
				|  |  | //                                @ApiParam(name = "pageSize", value = "", defaultValue = "10") @RequestParam(value = "pageSize", required = true) String pageSize) {
 | 
	
		
			
				|  |  | //        if (StringUtils.isBlank(pageSize)) {
 | 
	
		
			
				|  |  | //            pageSize = "10";
 | 
	
		
			
				|  |  | //        }
 | 
	
		
			
				|  |  | //        if (page.equals("0")) {
 | 
	
		
			
				|  |  | //            page = "1";
 | 
	
		
			
				|  |  | //        }
 | 
	
		
			
				|  |  | //        SystemMessageDO  message1 = new SystemMessageDO();
 | 
	
		
			
				|  |  | //        com.alibaba.fastjson.JSONObject object = JSON.parseObject(message);
 | 
	
		
			
				|  |  | //        message1.setOver(object.getString("over"));
 | 
	
		
			
				|  |  | ////        message1.setRead(object.getInteger("read"));
 | 
	
		
			
				|  |  | //        message1.setReceiver(getUID());
 | 
	
		
			
				|  |  | //        try {
 | 
	
		
			
				|  |  | //            return write(200, "查询成功!", "data", messageService.getSpecialistUnTreated(message1, Integer.valueOf(page), Integer.valueOf(pageSize)));
 | 
	
		
			
				|  |  | //        } catch (Exception e) {
 | 
	
		
			
				|  |  | //            return e.getMessage();
 | 
	
		
			
				|  |  | //        }
 | 
	
		
			
				|  |  | //    }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | //    @RequestMapping(value = "getSpecialistMessages", method = RequestMethod.GET)
 | 
	
		
			
				|  |  | //    @ApiOperation("专科医生待处理列表")
 | 
	
		
			
				|  |  | //    @ResponseBody
 | 
	
		
			
				|  |  | //    public String getSpecialistMessage(@ApiParam(name = "message", value = "消息对象") @RequestParam(value = "message") String message,
 | 
	
		
			
				|  |  | //                                       @ApiParam(name = "page", value = "第几页", defaultValue = "1") @RequestParam(value = "page", required = true) String page,
 | 
	
		
			
				|  |  | //                                       @ApiParam(name = "pageSize", value = "", defaultValue = "10") @RequestParam(value = "pageSize", required = true) String pageSize) {
 | 
	
		
			
				|  |  | //        if (StringUtils.isBlank(pageSize)) {
 | 
	
		
			
				|  |  | //            pageSize = "10";
 | 
	
		
			
				|  |  | //        }
 | 
	
		
			
				|  |  | //        if (page.equals("0")) {
 | 
	
		
			
				|  |  | //            page = "1";
 | 
	
		
			
				|  |  | //        }
 | 
	
		
			
				|  |  | //        SystemMessageDO  message1 = new SystemMessageDO();
 | 
	
		
			
				|  |  | //        com.alibaba.fastjson.JSONObject object = JSON.parseObject(message);
 | 
	
		
			
				|  |  | //        message1.setOver(object.getString("over"));
 | 
	
		
			
				|  |  | //        message1.setRead(object.getInteger("read"));
 | 
	
		
			
				|  |  | //        message1.setReceiver(getUID());
 | 
	
		
			
				|  |  | //        try {
 | 
	
		
			
				|  |  | //            return write(200, "查询成功!", "data", messageService.getSpecialistMessages(message1, Integer.valueOf(page), Integer.valueOf(pageSize)));
 | 
	
		
			
				|  |  | //        } catch (Exception e) {
 | 
	
		
			
				|  |  | //            return e.getMessage();
 | 
	
		
			
				|  |  | //        }
 | 
	
		
			
				|  |  | //    }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     /**
 | 
	
		
			
				|  |  |      * 转诊消息
 | 
	
		
			
				|  |  |      *
 | 
	
		
			
				|  |  |      * @param message
 | 
	
		
			
				|  |  |      * @param page
 | 
	
		
			
				|  |  |      * @param pageSize
 | 
	
		
			
				|  |  |      * @return
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  | //    @RequestMapping(value = "getTransferMessage", method = RequestMethod.GET)
 | 
	
		
			
				|  |  | //    @ApiOperation("转诊消息")
 | 
	
		
			
				|  |  | //    @ResponseBody
 | 
	
		
			
				|  |  | //    public String getTransferMessage(@ApiParam(name = "message", value = "消息对象") @RequestParam(value = "message") String message,
 | 
	
		
			
				|  |  | //                                     @ApiParam(name = "page", value = "第几页", defaultValue = "1") @RequestParam(value = "page", required = true) String page,
 | 
	
		
			
				|  |  | //                                     @ApiParam(name = "pageSize", value = "", defaultValue = "10") @RequestParam(value = "pageSize", required = true) String pageSize) {
 | 
	
		
			
				|  |  | //        if (StringUtils.isBlank(pageSize)) {
 | 
	
		
			
				|  |  | //            pageSize = "10";
 | 
	
		
			
				|  |  | //        }
 | 
	
		
			
				|  |  | //        if (page.equals("0")) {
 | 
	
		
			
				|  |  | //            page = "1";
 | 
	
		
			
				|  |  | //        }
 | 
	
		
			
				|  |  | //        SystemMessageDO  message1 = new SystemMessageDO();
 | 
	
		
			
				|  |  | //        com.alibaba.fastjson.JSONObject object = JSON.parseObject(message);
 | 
	
		
			
				|  |  | //        message1.setOver(object.getString("over"));
 | 
	
		
			
				|  |  | //        message1.setRead(object.getInteger("read"));
 | 
	
		
			
				|  |  | //        message1.setReceiver(getUID());
 | 
	
		
			
				|  |  | //        try {
 | 
	
		
			
				|  |  | //            return write(200, "查询成功!", "data", messageService.getTransferMessage(message1, Integer.valueOf(page), Integer.valueOf(pageSize)));
 | 
	
		
			
				|  |  | //        } catch (Exception e) {
 | 
	
		
			
				|  |  | //            return e.getMessage();
 | 
	
		
			
				|  |  | //        }
 | 
	
		
			
				|  |  | //    }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     /**
 | 
	
		
			
				|  |  |      * 发送消息 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("发送消息")
 | 
	
		
			
				|  |  | //    public String sendMessage(@ApiParam(name = "message", value = "消息对象(如:{'sender':'','receiver':'','relationCode':'','type':19})", required = true)
 | 
	
		
			
				|  |  | //                              @RequestParam(value = "message", required = true) String message,
 | 
	
		
			
				|  |  | //                              @ApiParam(name = "hospital", value = "医院code", required = false)
 | 
	
		
			
				|  |  | //                              @RequestParam(value = "hospital", required = false) String hospital,
 | 
	
		
			
				|  |  | //                              @ApiParam(name = "patient", value = "居民code", required = true)
 | 
	
		
			
				|  |  | //                              @RequestParam(value = "patient", required = true) String patient,
 | 
	
		
			
				|  |  | //                              @ApiParam(name = "time", value = "时间", required = false)
 | 
	
		
			
				|  |  | //                              @RequestParam(value = "time", required = false) Integer time,
 | 
	
		
			
				|  |  | //                              @ApiParam(name = "jsonObject", value = "参数", required = false)
 | 
	
		
			
				|  |  | //                              @RequestParam(value = "jsonObject", required = false) String jsonObject) {
 | 
	
		
			
				|  |  | //        try {
 | 
	
		
			
				|  |  | //            com.alibaba.fastjson.JSONObject object = com.alibaba.fastjson.JSONObject.parseObject(message);
 | 
	
		
			
				|  |  | //            SystemMessageDO message1 = new SystemMessageDO();
 | 
	
		
			
				|  |  | //            message1.setSender(object.getString("sender"));
 | 
	
		
			
				|  |  | //            message1.setType(object.getInteger("type").toString());
 | 
	
		
			
				|  |  | //            message1.setReceiver(object.getString("receiver"));
 | 
	
		
			
				|  |  | //            message1.setRelationCode(object.getString("relationCode"));
 | 
	
		
			
				|  |  | //            com.alibaba.fastjson.JSONObject jsonObject1 = com.alibaba.fastjson.JSONObject.parseObject(jsonObject);
 | 
	
		
			
				|  |  | //            return write(200, "获取消息成功!", "data", specialistEvaluateSevice.sendMessage(message1, hospital, patient, time, jsonObject1));
 | 
	
		
			
				|  |  | //        } catch (Exception e) {
 | 
	
		
			
				|  |  | //            return e.getMessage();
 | 
	
		
			
				|  |  | //        }
 | 
	
		
			
				|  |  | //    }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     /**
 | 
	
		
			
				|  |  |      * 一键已读
 | 
	
		
			
				|  |  |      *
 | 
	
		
			
				|  |  |      * @param types
 | 
	
		
			
				|  |  |      * @return
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  | //    @RequestMapping(value = "setMessageReads", method = RequestMethod.POST)
 | 
	
		
			
				|  |  | //    @ResponseBody
 | 
	
		
			
				|  |  | //    @ApiOperation("一键已读")
 | 
	
		
			
				|  |  | //    public String setMessageRead(
 | 
	
		
			
				|  |  | //            @ApiParam(name = "types", value = "消息集合") @RequestParam(value = "types") String types,
 | 
	
		
			
				|  |  | //            @ApiParam(name = "flag", value = "标识家医/专科") @RequestParam(value = "flag") Integer flag
 | 
	
		
			
				|  |  | //    ) {
 | 
	
		
			
				|  |  | //        try {
 | 
	
		
			
				|  |  | //            com.alibaba.fastjson.JSONArray array = com.alibaba.fastjson.JSONArray.parseArray(types);
 | 
	
		
			
				|  |  | //            List<Integer> typeList = new ArrayList<>();
 | 
	
		
			
				|  |  | //            for (int i = 0; i < array.size(); i++) {
 | 
	
		
			
				|  |  | //                typeList.add(array.getInteger(i));
 | 
	
		
			
				|  |  | //            }
 | 
	
		
			
				|  |  | //            return write(200, "获取消息总数成功!", "data", messageService.setMessageReaded(getUID(), typeList, flag));
 | 
	
		
			
				|  |  | //        } catch (Exception e) {
 | 
	
		
			
				|  |  | //            return e.getMessage();
 | 
	
		
			
				|  |  | //        }
 | 
	
		
			
				|  |  | //    }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     /**
 | 
	
		
			
				|  |  |      * 设置待办消息已处理
 | 
	
		
			
				|  |  |      *
 | 
	
		
			
				|  |  |      * @param id
 | 
	
		
			
				|  |  |      * @param type
 | 
	
		
			
				|  |  |      * @return
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  | //    @RequestMapping(value = "setSpecialistOver", method = RequestMethod.POST)
 | 
	
		
			
				|  |  | //    @ResponseBody
 | 
	
		
			
				|  |  | //    @ApiOperation("设置待办消息已处理")
 | 
	
		
			
				|  |  | //    public String setSpecialistOver(
 | 
	
		
			
				|  |  | //            @ApiParam(name = "id", value = "消息id") @RequestParam(value = "id") Long id,
 | 
	
		
			
				|  |  | //            @ApiParam(name = "type", value = "消息类型") @RequestParam(value = "type") Integer type
 | 
	
		
			
				|  |  | //    ) {
 | 
	
		
			
				|  |  | //        try {
 | 
	
		
			
				|  |  | //
 | 
	
		
			
				|  |  | //            return write(200, "获取消息总数成功!", "data", messageService.setSpecialistOver(id, type));
 | 
	
		
			
				|  |  | //        } catch (Exception e) {
 | 
	
		
			
				|  |  | //            return e.getMessage();
 | 
	
		
			
				|  |  | //        }
 | 
	
		
			
				|  |  | //    }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     /**
 | 
	
		
			
				|  |  |      * 获取协同服务消息列表
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  | //    @RequestMapping(value = "getSynergyMessages", method = RequestMethod.GET)
 | 
	
		
			
				|  |  | //    @ApiOperation("协同服务消息列表")
 | 
	
		
			
				|  |  | //    @ResponseBody
 | 
	
		
			
				|  |  | //    public String getSynergyMessage(@ApiParam(name = "message", value = "消息对象") @RequestParam(value = "message") String message,
 | 
	
		
			
				|  |  | //                                    @ApiParam(name = "page", value = "第几页", defaultValue = "1") @RequestParam(value = "page", required = true) String page,
 | 
	
		
			
				|  |  | //                                    @ApiParam(name = "pageSize", value = "", defaultValue = "10") @RequestParam(value = "pageSize", required = true) String pageSize) {
 | 
	
		
			
				|  |  | //        if (StringUtils.isBlank(pageSize)) {
 | 
	
		
			
				|  |  | //            pageSize = "10";
 | 
	
		
			
				|  |  | //        }
 | 
	
		
			
				|  |  | //        if (page.equals("0")) {
 | 
	
		
			
				|  |  | //            page = "1";
 | 
	
		
			
				|  |  | //        }
 | 
	
		
			
				|  |  | //        SystemMessageDO  message1 = new SystemMessageDO();
 | 
	
		
			
				|  |  | //        com.alibaba.fastjson.JSONObject object = JSON.parseObject(message);
 | 
	
		
			
				|  |  | //        message1.setReceiver(getUID());
 | 
	
		
			
				|  |  | //        try {
 | 
	
		
			
				|  |  | //            List<SystemMessageDO> messageList = messageService.getSynergyMessages(message1, Integer.valueOf(page), Integer.valueOf(pageSize));
 | 
	
		
			
				|  |  | //            return write(200, "查询成功!", "data", messageList);
 | 
	
		
			
				|  |  | //        } catch (Exception e) {
 | 
	
		
			
				|  |  | //            return e.getMessage();
 | 
	
		
			
				|  |  | //        }
 | 
	
		
			
				|  |  | //    }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     /**
 | 
	
		
			
				|  |  |      * 设置协同消息已读
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  | //    @RequestMapping(value = "setSynergyMessagesByRead", method = RequestMethod.GET)
 | 
	
		
			
				|  |  | //    @ResponseBody
 | 
	
		
			
				|  |  | //    @ApiOperation("设置协同消息已读")
 | 
	
		
			
				|  |  | //    public String setSynergyMessagesByRead() {
 | 
	
		
			
				|  |  | //        try {
 | 
	
		
			
				|  |  | //            return write(200, "获取消息总数成功!", "data", messageService.setSynergyMessagesByRead(getUID()));
 | 
	
		
			
				|  |  | //        } catch (Exception e) {
 | 
	
		
			
				|  |  | //            return e.getMessage();
 | 
	
		
			
				|  |  | //        }
 | 
	
		
			
				|  |  | //    }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     /**
 | 
	
		
			
				|  |  |      * PCIM专科服务
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  | //    @RequestMapping(value = "getSpeciaistByType")
 | 
	
		
			
				|  |  | //    @ApiOperation("PCIM专科服务列表")
 | 
	
		
			
				|  |  | //    @ResponseBody
 | 
	
		
			
				|  |  | //    public String getSpeciaistByType(String types,
 | 
	
		
			
				|  |  | //                                     Integer page,
 | 
	
		
			
				|  |  | //                                     Integer pageSize) {
 | 
	
		
			
				|  |  | //        List<Integer> typeList = new ArrayList<>();
 | 
	
		
			
				|  |  | //        String str[] = types.split(",");
 | 
	
		
			
				|  |  | //        for (int i = 0; i < str.length; i++) {
 | 
	
		
			
				|  |  | //            typeList.add(Integer.parseInt(str[i]));
 | 
	
		
			
				|  |  | //        }
 | 
	
		
			
				|  |  | //        try {
 | 
	
		
			
				|  |  | //            return write(200, "查询成功!", "data", messageService.getSpeciaistByType(typeList, getUID(), page, pageSize));
 | 
	
		
			
				|  |  | //        } catch (Exception e) {
 | 
	
		
			
				|  |  | //            return e.getMessage();
 | 
	
		
			
				|  |  | //        }
 | 
	
		
			
				|  |  | //    }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     /**
 | 
	
		
			
				|  |  |      * PCIM专科医生总条数
 | 
	
		
			
				|  |  |      *
 | 
	
		
			
				|  |  |      * @return
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  | //    @RequestMapping(value = "getDoctorBySpecialistAllMessage", method = RequestMethod.GET)
 | 
	
		
			
				|  |  | //    @ApiOperation("PCIM专科医生总条数")
 | 
	
		
			
				|  |  | //    @ResponseBody
 | 
	
		
			
				|  |  | //    public String getDoctorBySpecialistAllMessage() {
 | 
	
		
			
				|  |  | //        try {
 | 
	
		
			
				|  |  | //            return write(200, "查询成功!", "data", messageService.getDoctorBySpecialistAllMessage(getUID()));
 | 
	
		
			
				|  |  | //        } catch (Exception e) {
 | 
	
		
			
				|  |  | //            return e.getMessage();
 | 
	
		
			
				|  |  | //        }
 | 
	
		
			
				|  |  | //    }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     /**
 | 
	
		
			
				|  |  |      * PCIM-转诊消息
 | 
	
		
			
				|  |  |      *
 | 
	
		
			
				|  |  |      * @param page
 | 
	
		
			
				|  |  |      * @param pageSize
 | 
	
		
			
				|  |  |      * @return
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  | //    @RequestMapping(value = "getTransferMessageByPCIM", method = RequestMethod.GET)
 | 
	
		
			
				|  |  | //    @ApiOperation("PCIM-转诊消息")
 | 
	
		
			
				|  |  | //    @ResponseBody
 | 
	
		
			
				|  |  | //    public String getTransferMessageByPCIM(@ApiParam(name = "page", value = "第几页", defaultValue = "1") @RequestParam(value = "page", required = true) String page,
 | 
	
		
			
				|  |  | //                                           @ApiParam(name = "pageSize", value = "", defaultValue = "10") @RequestParam(value = "pageSize", required = true) String pageSize) {
 | 
	
		
			
				|  |  | //        if (StringUtils.isBlank(pageSize)) {
 | 
	
		
			
				|  |  | //            pageSize = "10";
 | 
	
		
			
				|  |  | //        }
 | 
	
		
			
				|  |  | //        if (page.equals("0")) {
 | 
	
		
			
				|  |  | //            page = "1";
 | 
	
		
			
				|  |  | //        }
 | 
	
		
			
				|  |  | //        try {
 | 
	
		
			
				|  |  | //            return write(200, "查询成功!", "data", messageService.getTransferMessageByPCIM(getUID(), Integer.valueOf(page), Integer.valueOf(pageSize)));
 | 
	
		
			
				|  |  | //        } catch (Exception e) {
 | 
	
		
			
				|  |  | //            return e.getMessage();
 | 
	
		
			
				|  |  | //        }
 | 
	
		
			
				|  |  | //    }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     /**
 | 
	
		
			
				|  |  |      * PCIM-签约服务列表
 | 
	
		
			
				|  |  |      *
 | 
	
		
			
				|  |  |      * @param types
 | 
	
		
			
				|  |  |      * @param page
 | 
	
		
			
				|  |  |      * @param pageSize
 | 
	
		
			
				|  |  |      * @return
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  | //    @RequestMapping(value = "getFamilyByType", method = RequestMethod.GET)
 | 
	
		
			
				|  |  | //    @ApiOperation("PCIM-签约服务列表")
 | 
	
		
			
				|  |  | //    @ResponseBody
 | 
	
		
			
				|  |  | //    public String getFamilyByType(@ApiParam(name = "types", value = "消息对象") @RequestParam(value = "types") String types,
 | 
	
		
			
				|  |  | //                                  @ApiParam(name = "page", value = "第几页", defaultValue = "1") @RequestParam(value = "page", required = true) Integer page,
 | 
	
		
			
				|  |  | //                                  @ApiParam(name = "pageSize", value = "", defaultValue = "10") @RequestParam(value = "pageSize", required = true) Integer pageSize) {
 | 
	
		
			
				|  |  | //        List<Integer> typeList = new ArrayList<>();
 | 
	
		
			
				|  |  | //        String str[] = types.split(",");
 | 
	
		
			
				|  |  | //        for (int i = 0; i < str.length; i++) {
 | 
	
		
			
				|  |  | //            typeList.add(Integer.parseInt(str[i]));
 | 
	
		
			
				|  |  | //        }
 | 
	
		
			
				|  |  | //        try {
 | 
	
		
			
				|  |  | //            return write(200, "查询成功!", "data", messageService.getFamilySignByType(typeList, getUID(), page, pageSize));
 | 
	
		
			
				|  |  | //        } catch (Exception e) {
 | 
	
		
			
				|  |  | //            return e.getMessage();
 | 
	
		
			
				|  |  | //        }
 | 
	
		
			
				|  |  | //    }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     /**
 | 
	
		
			
				|  |  |      * 获取pcim家医服务
 | 
	
		
			
				|  |  |      *
 | 
	
		
			
				|  |  |      * @param page
 | 
	
		
			
				|  |  |      * @param pageSize
 | 
	
		
			
				|  |  |      * @return
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  | //    @RequestMapping(value = "getPCIMFamilyServer", method = RequestMethod.GET)
 | 
	
		
			
				|  |  | //    @ApiOperation("PCIM-家医服务")
 | 
	
		
			
				|  |  | //    @ResponseBody
 | 
	
		
			
				|  |  | //    public String getPCIMFamilyServer(@ApiParam(name = "types", value = "消息对象") @RequestParam(value = "types") String types,
 | 
	
		
			
				|  |  | //                                      @ApiParam(name = "page", value = "第几页", defaultValue = "1") @RequestParam(value = "page", required = true) Integer page,
 | 
	
		
			
				|  |  | //                                      @ApiParam(name = "pageSize", value = "", defaultValue = "10") @RequestParam(value = "pageSize", required = true) Integer pageSize) {
 | 
	
		
			
				|  |  | //        try {
 | 
	
		
			
				|  |  | //            List<Integer> typeList = new ArrayList<>();
 | 
	
		
			
				|  |  | //            String str[] = types.split(",");
 | 
	
		
			
				|  |  | //            for (int i = 0; i < str.length; i++) {
 | 
	
		
			
				|  |  | //                typeList.add(Integer.parseInt(str[i]));
 | 
	
		
			
				|  |  | //            }
 | 
	
		
			
				|  |  | //            return write(200, "查询成功!", "data", messageService.getPCIMFamilyServer(getUID(), typeList, page, pageSize));
 | 
	
		
			
				|  |  | //        } catch (Exception e) {
 | 
	
		
			
				|  |  | //            return e.getMessage();
 | 
	
		
			
				|  |  | //        }
 | 
	
		
			
				|  |  | //    }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     /**
 | 
	
		
			
				|  |  |      * PCIM-其他业务
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  | //    @RequestMapping(value = "getOtherService", method = RequestMethod.GET)
 | 
	
		
			
				|  |  | //    @ApiOperation("PCIM-其他业务")
 | 
	
		
			
				|  |  | //    @ResponseBody
 | 
	
		
			
				|  |  | //    public String getOtherService(@ApiParam(name = "types", value = "消息对象") @RequestParam(value = "types") String types,
 | 
	
		
			
				|  |  | //                                  @ApiParam(name = "page", value = "第几页", defaultValue = "1") @RequestParam(value = "page", required = true) Integer page,
 | 
	
		
			
				|  |  | //                                  @ApiParam(name = "pageSize", value = "", defaultValue = "10") @RequestParam(value = "pageSize", required = true) Integer pageSize) {
 | 
	
		
			
				|  |  | //        try {
 | 
	
		
			
				|  |  | //            List<Integer> typeList = new ArrayList<>();
 | 
	
		
			
				|  |  | //            String str[] = types.split(",");
 | 
	
		
			
				|  |  | //            for (int i = 0; i < str.length; i++) {
 | 
	
		
			
				|  |  | //                typeList.add(Integer.parseInt(str[i]));
 | 
	
		
			
				|  |  | //            }
 | 
	
		
			
				|  |  | //            return write(200, "查询成功!", "data", messageService.getOtherService(getUID(), typeList, page, pageSize));
 | 
	
		
			
				|  |  | //        } catch (Exception e) {
 | 
	
		
			
				|  |  | //            return e.getMessage();
 | 
	
		
			
				|  |  | //        }
 | 
	
		
			
				|  |  | //    }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     /**
 | 
	
		
			
				|  |  |      * PCIM--家庭医生消息总条数
 | 
	
		
			
				|  |  |      *
 | 
	
		
			
				|  |  |      * @return
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  | //    @RequestMapping(value = "getDoctorByFamilyAllMessage", method = RequestMethod.GET)
 | 
	
		
			
				|  |  | //    @ApiOperation("PCIM--家庭医生消息总条数")
 | 
	
		
			
				|  |  | //    @ResponseBody
 | 
	
		
			
				|  |  | //    public String getDoctorByFamilyAllMessage() {
 | 
	
		
			
				|  |  | //        try {
 | 
	
		
			
				|  |  | //            return write(200, "查询成功!", "data", messageService.getDoctorByFamilyAllMessage(getUID()));
 | 
	
		
			
				|  |  | //        } catch (Exception e) {
 | 
	
		
			
				|  |  | //            return e.getMessage();
 | 
	
		
			
				|  |  | //        }
 | 
	
		
			
				|  |  | //    }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     /**
 | 
	
		
			
				|  |  |      * PCIM-分析总览
 | 
	
		
			
				|  |  |      *day         天数(3,7,30)
 | 
	
		
			
				|  |  |      *area        父code
 | 
	
		
			
				|  |  |      *level       等级  1 团队,2 机构,3 区,4 市
 | 
	
		
			
				|  |  |      *level2_type 指标代码 例如性别 1 男 2 女  不传就返回男和女的总和
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  | //    @RequestMapping(value = "AnalysisOverview", method = RequestMethod.GET)
 | 
	
		
			
				|  |  | //    @ApiOperation("PCIM-分析总览")
 | 
	
		
			
				|  |  | //    @ResponseBody
 | 
	
		
			
				|  |  | //    public String AnalysisOverview(@ApiParam(name = "day", value = "天数") @RequestParam(value = "day") int day,
 | 
	
		
			
				|  |  | //                                   @RequestParam(required = false) String area,
 | 
	
		
			
				|  |  | //                                   @RequestParam(required = false) Integer level,
 | 
	
		
			
				|  |  | //                                   @RequestParam(required = false) String level2_type) {
 | 
	
		
			
				|  |  | //        try {
 | 
	
		
			
				|  |  | //            if (demoFlag) {
 | 
	
		
			
				|  |  | //                return "{\n" +
 | 
	
		
			
				|  |  | //                        "    \"msg\": \"查询成功!\",\n" +
 | 
	
		
			
				|  |  | //                        "    \"data\": {\n" +
 | 
	
		
			
				|  |  | //                        "        \"weixinBindCount\": 1,\n" +
 | 
	
		
			
				|  |  | //                        "        \"weixinBindCountChange\": 7,\n" +
 | 
	
		
			
				|  |  | //                        "        \"articleCountChange\": \"0.01%\",\n" +
 | 
	
		
			
				|  |  | //                        "        \"consultCount\": 12,\n" +
 | 
	
		
			
				|  |  | //                        "        \"articleCount\": \"0.05%\",\n" +
 | 
	
		
			
				|  |  | //                        "        \"consultCount1\": 24,\n" +
 | 
	
		
			
				|  |  | //                        "        \"reservationCount1\": 24,\n" +
 | 
	
		
			
				|  |  | //                        "        \"articleCount1\": \"0.03%\",\n" +
 | 
	
		
			
				|  |  | //                        "        \"weixinBindCount1\": 8,\n" +
 | 
	
		
			
				|  |  | //                        "        \"reservationCount\": 34,\n" +
 | 
	
		
			
				|  |  | //                        "        \"consultCountChange\": 12,\n" +
 | 
	
		
			
				|  |  | //                        "        \"reservationCountChange\": 10\n" +
 | 
	
		
			
				|  |  | //                        "    },\n" +
 | 
	
		
			
				|  |  | //                        "    \"status\": 200\n" +
 | 
	
		
			
				|  |  | //                        "}";
 | 
	
		
			
				|  |  | //            }
 | 
	
		
			
				|  |  | //            if (level == null) {
 | 
	
		
			
				|  |  | //                level = 5;
 | 
	
		
			
				|  |  | //            }
 | 
	
		
			
				|  |  | //            return write(200, "查询成功!", "data", messageService.AnalysisOverview(getUID(), day, area, level, level2_type));
 | 
	
		
			
				|  |  | //        } catch (Exception e) {
 | 
	
		
			
				|  |  | //            return e.getMessage();
 | 
	
		
			
				|  |  | //        }
 | 
	
		
			
				|  |  | //    }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | //    @RequestMapping(value = "getAllNotOverMessage", method = RequestMethod.GET)
 | 
	
		
			
				|  |  | //    @ApiOperation("PCIM--专科/家医不同type的消息的总数")
 | 
	
		
			
				|  |  | //    @ResponseBody
 | 
	
		
			
				|  |  | //    public String getAllNotOverMessage() {
 | 
	
		
			
				|  |  | //        try {
 | 
	
		
			
				|  |  | //            return write(200, "查询成功!", "data", messageService.getAllNotOverMessage(getUID()));
 | 
	
		
			
				|  |  | //        } catch (Exception e) {
 | 
	
		
			
				|  |  | //            return e.getMessage();
 | 
	
		
			
				|  |  | //        }
 | 
	
		
			
				|  |  | //    }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | //    @RequestMapping(value = "getExaminationMessage", method = RequestMethod.GET)
 | 
	
		
			
				|  |  | //    @ResponseBody
 | 
	
		
			
				|  |  | //    @ApiOperation("获取在线复诊消息")
 | 
	
		
			
				|  |  | //    public String getPrescriptionMessage(@ApiParam(value = "第几页", defaultValue = "1")
 | 
	
		
			
				|  |  | //                                         @RequestParam Integer page,
 | 
	
		
			
				|  |  | //                                         @ApiParam(value = "每页几行", defaultValue = "10")
 | 
	
		
			
				|  |  | //                                         @RequestParam Integer pagesize
 | 
	
		
			
				|  |  | //    ) {
 | 
	
		
			
				|  |  | //        try {
 | 
	
		
			
				|  |  | //            //31 在线复诊咨询待审核提醒
 | 
	
		
			
				|  |  | //            List<SystemMessageDO> list = messageService.getPrescriptionMessage(getUID(), 31, page, pagesize);
 | 
	
		
			
				|  |  | //            return write(200, "获取消息成功!", "list", list);
 | 
	
		
			
				|  |  | //        } catch (Exception e) {
 | 
	
		
			
				|  |  | //            return e.getMessage();
 | 
	
		
			
				|  |  | //        }
 | 
	
		
			
				|  |  | //    }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | //    @RequestMapping(value = "getMessageByType")
 | 
	
		
			
				|  |  | //    @ResponseBody
 | 
	
		
			
				|  |  | //    @ApiOperation("根据类型获取消息")
 | 
	
		
			
				|  |  | //    public String getFollowupMessage(@ApiParam(name = "type", value = "消息类型,4:待随访消息")
 | 
	
		
			
				|  |  | //                                     @RequestParam(value = "type", required = false) Integer type,
 | 
	
		
			
				|  |  | //                                     @ApiParam(value = "第几页", defaultValue = "1")
 | 
	
		
			
				|  |  | //                                     @RequestParam Integer page,
 | 
	
		
			
				|  |  | //                                     @ApiParam(value = "每页几行", defaultValue = "10")
 | 
	
		
			
				|  |  | //                                     @RequestParam Integer pagesize) {
 | 
	
		
			
				|  |  | //        try {
 | 
	
		
			
				|  |  | //            List<SystemMessageDO> list = messageService.getMessageByType(getUID(), type, page, pagesize);
 | 
	
		
			
				|  |  | //            return write(200, "获取消息总数成功!", "data", list);
 | 
	
		
			
				|  |  | //        } catch (Exception e) {
 | 
	
		
			
				|  |  | //            return e.getMessage();
 | 
	
		
			
				|  |  | //        }
 | 
	
		
			
				|  |  | //    }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | //    @RequestMapping(value = "getBingQingMessage")
 | 
	
		
			
				|  |  | //    @ResponseBody
 | 
	
		
			
				|  |  | //    @ApiOperation("获取病情跟踪消息")
 | 
	
		
			
				|  |  | //    public String getBingQingMessage(
 | 
	
		
			
				|  |  | //            @ApiParam(value = "第几页", defaultValue = "1")
 | 
	
		
			
				|  |  | //            @RequestParam Integer page,
 | 
	
		
			
				|  |  | //            @ApiParam(value = "每页几行", defaultValue = "10")
 | 
	
		
			
				|  |  | //            @RequestParam Integer pagesize) {
 | 
	
		
			
				|  |  | //        try {
 | 
	
		
			
				|  |  | //            List<SystemMessageDO> list = messageService.getBingQingMessage(getUID(), page, pagesize);
 | 
	
		
			
				|  |  | //            return write(200, "获取消息总数成功!", "data", list);
 | 
	
		
			
				|  |  | //        } catch (Exception e) {
 | 
	
		
			
				|  |  | //            return e.getMessage();
 | 
	
		
			
				|  |  | //        }
 | 
	
		
			
				|  |  | //    }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | //    @RequestMapping(value = "setMessageOverBySender", method = RequestMethod.POST)
 | 
	
		
			
				|  |  | //    @ResponseBody
 | 
	
		
			
				|  |  | //    @ApiOperation("根据接收者和类型设消息为已处理")
 | 
	
		
			
				|  |  | //    public String setMessageOverBySender(@ApiParam(name = "sender", value = "发送者")
 | 
	
		
			
				|  |  | //                                         @RequestParam(value = "sender") String sender,
 | 
	
		
			
				|  |  | //                                         @ApiParam(name = "type", value = "消息类型")
 | 
	
		
			
				|  |  | //                                         @RequestParam(value = "type") Integer type) {
 | 
	
		
			
				|  |  | //        try {
 | 
	
		
			
				|  |  | //            messageService.setMessageOverBySender(sender, type);
 | 
	
		
			
				|  |  | //            return write(200, "更新成功!");
 | 
	
		
			
				|  |  | //        } catch (Exception e) {
 | 
	
		
			
				|  |  | //            return e.getMessage();
 | 
	
		
			
				|  |  | //        }
 | 
	
		
			
				|  |  | //    }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | }
 |