diff --git a/xinelu-admin/src/main/java/com/xinelu/web/controller/fd/FDController.java b/xinelu-admin/src/main/java/com/xinelu/web/controller/fd/FDController.java index fd1466b..c9a23e4 100644 --- a/xinelu-admin/src/main/java/com/xinelu/web/controller/fd/FDController.java +++ b/xinelu-admin/src/main/java/com/xinelu/web/controller/fd/FDController.java @@ -3,7 +3,10 @@ package com.xinelu.web.controller.fd; import com.alibaba.fastjson2.JSONObject; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; +import com.xinelu.common.core.controller.BaseController; import com.xinelu.common.core.domain.R; +import com.xinelu.common.core.page.TableDataInfo; +import com.xinelu.common.exception.ServiceException; import com.xinelu.familydoctor.applet.pojo.body.ApprovalBody; import com.xinelu.familydoctor.applet.pojo.body.SyncHospitalPersonInfoBody; import com.xinelu.familydoctor.applet.pojo.query.ApplyQuery; @@ -13,8 +16,11 @@ import com.xinelu.familydoctor.applet.pojo.vo.ResidentSignApplyVo; import com.xinelu.familydoctor.applet.service.IResidentRescindApplyService; import com.xinelu.familydoctor.applet.service.IResidentServiceAppletService; import com.xinelu.familydoctor.applet.service.IResidentSignAppletService; +import com.xinelu.manage.domain.chatRecord.ChatRecord; import com.xinelu.manage.domain.hospitalinfo.HospitalInfo; import com.xinelu.manage.domain.hospitalpersoninfo.HospitalPersonInfo; +import com.xinelu.manage.dto.chatrecord.MessageSearchDto; +import com.xinelu.manage.mapper.chatrecord.ChatRecordMapper; import com.xinelu.manage.service.hospitalinfo.IHospitalInfoService; import com.xinelu.manage.service.hospitalpersoninfo.IHospitalPersonInfoService; import com.xinelu.manage.service.patientinfo.IPatientInfoService; @@ -30,7 +36,7 @@ import javax.annotation.Resource; @Api(tags = "家医调用接口") @RestController @RequestMapping("/applet/fd") -public class FDController { +public class FDController extends BaseController { @Resource private IResidentRescindApplyService residentRescindApplyService; @Resource @@ -43,6 +49,8 @@ public class FDController { private IHospitalPersonInfoService hospitalPersonInfoService; @Resource private IHospitalInfoService hospitalInfoService; + @Resource + private ChatRecordMapper chatRecordMapper; @ApiOperation("服务申请列表") @@ -191,4 +199,32 @@ public class FDController { } return R.ok(); } + + @ApiOperation(value = "获取居民消息推送列表", notes = "山东通APP消息通知模块中的消息提醒用") + @GetMapping("/getNotice/{identity}") + public TableDataInfo noticDel(@PathVariable String identity) { + // 获取注册信息 + PatientInfoVO patientInfo = patientInfoService.selectPatientInfoByCardNo(identity); + if (patientInfo == null) { + return null; + } + MessageSearchDto query = new MessageSearchDto(); + query.setRecipientId(patientInfo.getId()); + query.setMessageCategory("4"); + startPage(); + return getDataTable(chatRecordMapper.selectMegList(query)); + } + + @ApiOperation(value = "获取居民消息推送最后一次记录", notes = "山东通APP消息通知模块中的消息提醒用") + @GetMapping("/getLastNotice/{identity}") + public R getLastNotice(@PathVariable String identity) { + PatientInfoVO patientInfo = patientInfoService.selectPatientInfoByCardNo(identity); + if (patientInfo == null) { + return null; + } + MessageSearchDto query = new MessageSearchDto(); + query.setRecipientId(patientInfo.getId()); + query.setMessageCategory("4"); + return R.ok(chatRecordMapper.getLast(query)); + } } diff --git a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/domain/chatRecord/ChatRecord.java b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/domain/chatRecord/ChatRecord.java index 742b347..f53bc16 100644 --- a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/domain/chatRecord/ChatRecord.java +++ b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/domain/chatRecord/ChatRecord.java @@ -86,6 +86,14 @@ public class ChatRecord extends BaseEntity implements Serializable { @Excel(name = "发送时间,时间格式:yyyy-MM-dd HH:mm:ss", width = 30, dateFormat = "yyyy-MM-dd") private Date sendTime; + /** + * 发送时间,时间格式:yyyy-MM-dd HH:mm:ss + */ + @ApiModelProperty(value = "发送时间,时间格式:yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "发送时间,时间格式:yyyy-MM-dd HH:mm:ss", width = 30, dateFormat = "yyyy-MM-dd") + private Date sendTime1; + /** * 接收人 */ diff --git a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/mapper/chatrecord/ChatRecordMapper.java b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/mapper/chatrecord/ChatRecordMapper.java index c7664d3..1b1e19a 100644 --- a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/mapper/chatrecord/ChatRecordMapper.java +++ b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/mapper/chatrecord/ChatRecordMapper.java @@ -118,4 +118,12 @@ public interface ChatRecordMapper { List getList(ChatRecord chatRecord); + /** + * @Author mengkuiliang + * @Description 查询最后一次通知记录 + * @Date 2023-12-06 006 14:53 + * @Param [query] + * @return com.xinelu.manage.domain.chatRecord.ChatRecord + **/ + ChatRecord getLast(MessageSearchDto query); } diff --git a/xinelu-nurse-manage/src/main/resources/mapper/manage/chatrecord/ChatRecordMapper.xml b/xinelu-nurse-manage/src/main/resources/mapper/manage/chatrecord/ChatRecordMapper.xml index 9989c8b..1b0fc52 100644 --- a/xinelu-nurse-manage/src/main/resources/mapper/manage/chatrecord/ChatRecordMapper.xml +++ b/xinelu-nurse-manage/src/main/resources/mapper/manage/chatrecord/ChatRecordMapper.xml @@ -451,4 +451,17 @@ ORDER BY send_time desc + + +