From 9ab954365c7504bb4c69e9fe26b2b0e770ec0a1a Mon Sep 17 00:00:00 2001 From: haown <454902499@qq.com> Date: Tue, 24 Oct 2023 14:30:52 +0800 Subject: [PATCH 1/2] =?UTF-8?q?add=3D=3D=3D>:=E5=A2=9E=E5=8A=A0=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E5=B7=A5=E5=8D=95=E7=8A=B6=E6=80=81=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=EF=BC=8C=E6=B6=88=E6=81=AF=E4=B8=AD=E5=BF=83=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E7=A7=BB=E6=A4=8D=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AppGoodsOrderController.java | 13 ++++ .../AppletSchedulePlanController.java | 17 +++++ .../chatrecord/ChatRecordController.java | 24 +++++- .../ConsultationInfoController.java | 23 ++++-- .../WeChatPaymentController.java | 4 + .../applet/dto/chatrecord/MarkReadDto.java | 28 +++++++ .../dto/chatrecord/MessageSearchDto.java | 52 +++++++++++++ .../consultationInfo/ConsultationInfoDTO.java | 29 +++++++- .../scheduleplan/SchedulePlanDetailDTO.java | 21 ++++++ .../mapper/chatrecord/ChatRecordMapper.java | 13 +++- .../chatRecord/IChatRecordService.java | 7 +- .../impl/ChatRecordServiceImpl.java | 74 ++++++++++++++++++- .../impl/ConsultationInfoServiceImpl.java | 4 +- .../impl/AppletSchedulePlanServiceImpl.java | 6 +- .../applet/vo/chatrecord/MessageCenterVo.java | 54 ++++++++++++++ .../applet/vo/chatrecord/MessageVo.java | 60 +++++++++++++++ .../applet/chatrecord/ChatRecordMapper.xml | 74 ++++++++++++++++++- .../manage/domain/chatRecord/ChatRecord.java | 15 ++++ .../manage/dto/goodsorder/GoodsOrderDTO.java | 34 +++++++-- .../goodsOrder/IGoodsOrderService.java | 9 ++- .../impl/GoodsOrderServiceImpl.java | 13 +++- .../ISchedulePlanDetailService.java | 1 + .../impl/SchedulePlanDetailServiceImpl.java | 4 + .../manage/vo/goodsorder/AppGoodsOrderVO.java | 12 +++ .../SchedulePlanDetailVO.java | 3 + .../manage/goodsOrder/GoodsOrderMapper.xml | 5 +- 26 files changed, 557 insertions(+), 42 deletions(-) create mode 100644 xinelu-nurse-applet/src/main/java/com/xinelu/applet/dto/chatrecord/MarkReadDto.java create mode 100644 xinelu-nurse-applet/src/main/java/com/xinelu/applet/dto/chatrecord/MessageSearchDto.java create mode 100644 xinelu-nurse-applet/src/main/java/com/xinelu/applet/dto/scheduleplan/SchedulePlanDetailDTO.java create mode 100644 xinelu-nurse-applet/src/main/java/com/xinelu/applet/vo/chatrecord/MessageCenterVo.java create mode 100644 xinelu-nurse-applet/src/main/java/com/xinelu/applet/vo/chatrecord/MessageVo.java diff --git a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/controller/appgoodsorder/AppGoodsOrderController.java b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/controller/appgoodsorder/AppGoodsOrderController.java index 92052a2..fb5b289 100644 --- a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/controller/appgoodsorder/AppGoodsOrderController.java +++ b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/controller/appgoodsorder/AppGoodsOrderController.java @@ -1,6 +1,7 @@ package com.xinelu.applet.controller.appgoodsorder; import com.xinelu.common.core.controller.BaseController; +import com.xinelu.common.core.domain.R; import com.xinelu.common.core.page.TableDataInfo; import com.xinelu.manage.dto.goodsorder.GoodsOrderDTO; import com.xinelu.manage.service.goodsOrder.IGoodsOrderService; @@ -8,6 +9,8 @@ import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import javax.annotation.Resource; import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @@ -33,4 +36,14 @@ public class AppGoodsOrderController extends BaseController { startPage(); return getDataTable(goodsOrderService.getConsultationOrders(goodsOrderDTO)); } + + @PostMapping("/updateStatus") + @ApiOperation(value = "修改订单状态") + public R updateStatus(@RequestBody GoodsOrderDTO goodsOrderDTO) { + if(goodsOrderDTO.getGoodsOrderId() == null || goodsOrderDTO.getGoodsOrderId() == 0) { + return R.fail("数据不正确"); + } + int flag = goodsOrderService.updateStatus(goodsOrderDTO); + return flag < 0 ? R.fail() : R.ok(); + } } diff --git a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/controller/appletscheduleplan/AppletSchedulePlanController.java b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/controller/appletscheduleplan/AppletSchedulePlanController.java index 1612dea..5c6005e 100644 --- a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/controller/appletscheduleplan/AppletSchedulePlanController.java +++ b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/controller/appletscheduleplan/AppletSchedulePlanController.java @@ -1,11 +1,14 @@ package com.xinelu.applet.controller.appletscheduleplan; import com.xinelu.applet.dto.scheduleplan.SchedulePlanDTO; +import com.xinelu.applet.dto.scheduleplan.SchedulePlanDetailDTO; import com.xinelu.applet.service.scheduleplan.IAppletSchedulePlanService; import com.xinelu.applet.utils.AppointmentTimeUtil; import com.xinelu.applet.vo.specialdisease.WeekDaysVO; import com.xinelu.common.core.controller.BaseController; import com.xinelu.common.core.domain.R; +import com.xinelu.manage.domain.scheduleplandetail.SchedulePlanDetail; +import com.xinelu.manage.service.scheduleplandetail.ISchedulePlanDetailService; import com.xinelu.manage.vo.scheduleplan.SchedulePlanVO; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -14,6 +17,8 @@ import java.util.List; import javax.annotation.Resource; import org.apache.commons.compress.utils.Lists; import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @@ -30,6 +35,9 @@ public class AppletSchedulePlanController extends BaseController { @Resource private IAppletSchedulePlanService appletPlanService; + @Resource + private ISchedulePlanDetailService schedulePlanDetailService; + @Resource private AppointmentTimeUtil appointmentTimeUtil; @@ -44,4 +52,13 @@ public class AppletSchedulePlanController extends BaseController { return R.ok(list); } + @PostMapping("/updateStatus") + @ApiOperation(value = "医生修改排班时间段的可预约状态") + public R updateStatus(@RequestBody SchedulePlanDetailDTO schedulePlanDetailDTO) { + SchedulePlanDetail planDetail = new SchedulePlanDetail(); + planDetail.setId(schedulePlanDetailDTO.getSchedulePlanDetailId()); + planDetail.setStatus(schedulePlanDetailDTO.getStatus()); + int flag = schedulePlanDetailService.update(planDetail); + return flag < 0 ? R.fail() : R.ok(); + } } diff --git a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/controller/chatrecord/ChatRecordController.java b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/controller/chatrecord/ChatRecordController.java index 5b6099d..c6ddbea 100644 --- a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/controller/chatrecord/ChatRecordController.java +++ b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/controller/chatrecord/ChatRecordController.java @@ -1,23 +1,32 @@ package com.xinelu.applet.controller.chatrecord; import com.xinelu.applet.dto.chatrecord.ChatRecordDTO; +import com.xinelu.applet.dto.chatrecord.MessageSearchDto; import com.xinelu.applet.service.chatRecord.IChatRecordService; +import com.xinelu.applet.vo.chatrecord.MessageCenterVo; import com.xinelu.common.annotation.Log; import com.xinelu.common.constant.Constants; import com.xinelu.common.core.controller.BaseController; import com.xinelu.common.core.domain.AjaxResult; +import com.xinelu.common.core.domain.R; import com.xinelu.common.enums.BusinessType; import com.xinelu.common.socket.WebSocketUtils; import com.xinelu.manage.domain.chatRecord.ChatRecord; import io.swagger.annotations.ApiOperation; +import java.util.List; +import java.util.Objects; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.transaction.annotation.Transactional; -import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; import org.springframework.web.multipart.MultipartFile; -import java.util.Objects; - /** * 图文咨询-聊天记录表 * @@ -78,4 +87,13 @@ public class ChatRecordController extends BaseController { } return chatRecordService.uploadChatRecordFile(multipartFile, consultationId); } + + @ApiOperation("消息中心") + @GetMapping("/getMegVoList") + public R> getMegVoList(MessageSearchDto messageDto) { + if (messageDto.getRecipientId() == null) { + return R.fail("请先绑定账号!"); + } + return R.ok(chatRecordService.getMegVoList(messageDto)); + } } diff --git a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/controller/consultationInfo/ConsultationInfoController.java b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/controller/consultationInfo/ConsultationInfoController.java index 2ea91d9..6111db8 100644 --- a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/controller/consultationInfo/ConsultationInfoController.java +++ b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/controller/consultationInfo/ConsultationInfoController.java @@ -6,26 +6,36 @@ import com.xinelu.common.annotation.Log; import com.xinelu.common.constant.Constants; import com.xinelu.common.core.controller.BaseController; import com.xinelu.common.core.domain.AjaxResult; +import com.xinelu.common.core.domain.R; import com.xinelu.common.core.page.TableDataInfo; import com.xinelu.common.custominterface.Insert; import com.xinelu.common.enums.BusinessType; import com.xinelu.manage.domain.consultationInfo.ConsultationInfo; import com.xinelu.manage.vo.consultationInfo.ConsultationInfoVO; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import java.util.List; +import java.util.Objects; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; import org.springframework.web.multipart.MultipartFile; -import java.util.List; -import java.util.Objects; - /** * 在线问诊-问诊信息Controller * * @author xinelu * @date 2023-09-25 */ +@Api(tags = "在线问诊控制器") @RestController @RequestMapping("/nurseApplet/consultationInfo") public class ConsultationInfoController extends BaseController { @@ -49,9 +59,10 @@ public class ConsultationInfoController extends BaseController { * 获取在线问诊-问诊信息详细信息 */ //@PreAuthorize("@ss.hasPermi('system:info:query')") + @ApiOperation(value = "获取在线问诊-问诊信息详细信息") @GetMapping(value = "/{id}") - public AjaxResult getInfo(@PathVariable("id") Long id) { - return AjaxResult.success(consultationInfoService.selectConsultationInfoById(id)); + public R getInfo(@PathVariable("id") Long id) { + return R.ok(consultationInfoService.selectConsultationInfoById(id)); } /** diff --git a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/controller/wechatpaymentinfo/WeChatPaymentController.java b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/controller/wechatpaymentinfo/WeChatPaymentController.java index 2d9b8a0..d95bed6 100644 --- a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/controller/wechatpaymentinfo/WeChatPaymentController.java +++ b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/controller/wechatpaymentinfo/WeChatPaymentController.java @@ -12,6 +12,8 @@ import com.xinelu.common.core.domain.AjaxResult; import com.xinelu.common.custominterface.Insert; import com.xinelu.common.enums.BuySourceEnum; import com.xinelu.common.exception.ServiceException; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; import org.apache.commons.lang3.StringUtils; import org.springframework.validation.BindingResult; import org.springframework.validation.annotation.Validated; @@ -32,6 +34,7 @@ import java.util.Objects; * @Date 2022-10-18 14:47:11 * @Version 1.0 */ +@Api(tags = "微信小程序和App支付控制器") @RestController @RequestMapping("/nurseApp/weChatPayment") public class WeChatPaymentController extends BaseController { @@ -136,6 +139,7 @@ public class WeChatPaymentController extends BaseController { * @param closeOrderDTO 订单关闭参数 * @return 退款申请结果 */ + @ApiOperation("专家咨询订单-医生端App拒单接口") @PostMapping("/closeHealthConsultationOrder") public AjaxResult closeHealthConsultationOrder(@Validated(Insert.class) @RequestBody CloseOrderDTO closeOrderDTO) { return weChatRefundService.closeHealthConsultationOrder(closeOrderDTO); diff --git a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/dto/chatrecord/MarkReadDto.java b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/dto/chatrecord/MarkReadDto.java new file mode 100644 index 0000000..a56809c --- /dev/null +++ b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/dto/chatrecord/MarkReadDto.java @@ -0,0 +1,28 @@ +package com.xinelu.applet.dto.chatrecord; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.List; +import lombok.Data; + +/** + * @description: 标记为已读传输对象 + * @author: haown + * @create: 2022-12-01 17:30 + **/ +@Data +@ApiModel("标记为已读传输对象") +public class MarkReadDto { + + @ApiModelProperty("消息类别 1:通知公告,2:健康推送,3:在线咨询") + private String messageCategory; + + @ApiModelProperty("绑定编号") + private String bindingNo; + + @ApiModelProperty("发送人编号") + private Long senderId; + + @ApiModelProperty("消息业务主键列表") + private List messageNos; +} diff --git a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/dto/chatrecord/MessageSearchDto.java b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/dto/chatrecord/MessageSearchDto.java new file mode 100644 index 0000000..f585b5b --- /dev/null +++ b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/dto/chatrecord/MessageSearchDto.java @@ -0,0 +1,52 @@ +package com.xinelu.applet.dto.chatrecord; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; +import java.util.Date; +import java.util.List; +import lombok.Data; + +/** + * @description: 消息列表查询传输对象 + * @author: haown + * @create: 2022-12-01 21:17 + **/ +@Data +public class MessageSearchDto { + + @ApiModelProperty("消息类别 1:通知公告,2:健康推送,3:在线咨询") + private String messageCategory; + + @ApiModelProperty("通知适用人群(0:全部人群)") + private String crowds; + + @ApiModelProperty(value = "居民注册业务主键") + private String bindingNo; + + @ApiModelProperty("发送人编号") + private Long senderId; + + @ApiModelProperty("接收人编号") + private Long recipientId; + + @ApiModelProperty("已读状态,0:未读,1:已读") + private String readStatus; + + @ApiModelProperty("用户类型,0:小程序,1:医生") + private String userType; + + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + @ApiModelProperty(value = "开始日期") + private Date startDate; + + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + @ApiModelProperty(value = "结束日期") + private Date endDate; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @ApiModelProperty(value = "居民绑定时间", hidden = true) + private Date bindingTime; + + @ApiModelProperty(value = "通知适用人群编号集合", hidden = true) + private List crowdNoList; +} diff --git a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/dto/consultationInfo/ConsultationInfoDTO.java b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/dto/consultationInfo/ConsultationInfoDTO.java index 88b658b..d2455e2 100644 --- a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/dto/consultationInfo/ConsultationInfoDTO.java +++ b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/dto/consultationInfo/ConsultationInfoDTO.java @@ -3,14 +3,16 @@ package com.xinelu.applet.dto.consultationInfo; import com.fasterxml.jackson.annotation.JsonFormat; import com.xinelu.common.core.domain.BaseEntity; import com.xinelu.common.custominterface.Insert; -import lombok.Data; -import net.sf.jsqlparser.statement.update.Update; -import org.hibernate.validator.constraints.Length; -import javax.validation.constraints.NotNull; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import java.io.Serializable; import java.time.LocalTime; import java.util.Date; import java.util.List; +import javax.validation.constraints.NotNull; +import lombok.Data; +import net.sf.jsqlparser.statement.update.Update; +import org.hibernate.validator.constraints.Length; /** * 在线问诊-问诊信息(图文和视频问诊基本信息)对象 consultation_info @@ -18,6 +20,7 @@ import java.util.List; * @author xinelu * @date 2023-09-25 */ +@ApiModel("在线问诊-问诊信息(图文和视频问诊基本信息)对象") @Data public class ConsultationInfoDTO extends BaseEntity implements Serializable { @@ -30,17 +33,20 @@ public class ConsultationInfoDTO extends BaseEntity implements Serializable { /** * 患者id */ + @ApiModelProperty("患者id") @NotNull(message = "患者信息不能为空", groups = {Insert.class}) private Long patientId; /** * 患者名称 */ + @ApiModelProperty("患者姓名") private String patientName; /** * 患者身份证号 */ + @ApiModelProperty("患者身份证号") @NotNull(message = "患者身份证号不能为空", groups = {Insert.class, Update.class}) @Length(max = 18, message = "身份证号不能超过18位", groups = {Insert.class, Update.class}) private String cardNo; @@ -48,6 +54,7 @@ public class ConsultationInfoDTO extends BaseEntity implements Serializable { /** * 患者联系方式 */ + @ApiModelProperty("患者联系方式") @NotNull(message = "患者联系方式不能为空", groups = {Insert.class, Update.class}) @Length(max = 11, message = "联系方式不能超过11位", groups = {Insert.class, Update.class}) private String phone; @@ -55,6 +62,7 @@ public class ConsultationInfoDTO extends BaseEntity implements Serializable { /** * 现住址所在地区 */ + @ApiModelProperty("现住址所在地区") @NotNull(message = "患者信息不能为空", groups = {Insert.class, Update.class}) @Length(max = 100, message = "现住址所在地区不能超过100位", groups = {Insert.class, Update.class}) private String address; @@ -62,17 +70,20 @@ public class ConsultationInfoDTO extends BaseEntity implements Serializable { /** * 医生id(签约医生/专家) */ + @ApiModelProperty("医生id(签约医生/专家)") @NotNull(message = "医生信息不能为空", groups = {Insert.class, Update.class}) private String doctorId; /** * 医生名称 */ + @ApiModelProperty("医生名称") private String doctorName; /** * 问诊类型,图文问诊:IMAGE_TEXT_CONSULTATION,视频问诊:VIDEO_CONSULTATION */ + @ApiModelProperty("问诊类型,图文问诊:IMAGE_TEXT_CONSULTATION,视频问诊:VIDEO_CONSULTATION") @NotNull(message = "问诊类型不能为空", groups = {Insert.class, Update.class}) private String consultationType; @@ -80,29 +91,34 @@ public class ConsultationInfoDTO extends BaseEntity implements Serializable { /** * 预约日期(视频问诊预约),时间格式:yyyy-MM-dd */ + @ApiModelProperty("预约日期(视频问诊预约),时间格式:yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") private Date appointmentDate; /** * 预约开始时间点(视频问诊预约),时间格式:HH:mm */ + @ApiModelProperty("预约开始时间点(视频问诊预约),时间格式:HH:mm") @JsonFormat(pattern = "HH:mm") private LocalTime appointmentStartTime; /** * 预约结束时间点(视频问诊预约),时间格式:HH:mm */ + @ApiModelProperty("预约结束时间点(视频问诊预约),时间格式:HH:mm") @JsonFormat(pattern = "HH:mm") private LocalTime appointmentEndTime; /** * 视频问诊地址 */ + @ApiModelProperty("视频问诊地址") private String videoUrl; /** * 问题简述 */ + @ApiModelProperty("问题简述") @NotNull(message = "问题简述不能为空", groups = {Insert.class, Update.class}) @Length(max = 5, message = "问题简述不能超过5位", groups = {Insert.class, Update.class}) private String problemDescription; @@ -110,6 +126,7 @@ public class ConsultationInfoDTO extends BaseEntity implements Serializable { /** * 患者个体情况说明 */ + @ApiModelProperty("患者个体情况说明") @NotNull(message = "患者个体情况说明不能为空", groups = {Insert.class, Update.class}) @Length(max = 100, message = "患者个体情况说明不能超过100位", groups = {Insert.class, Update.class}) private String situationDescription; @@ -117,6 +134,7 @@ public class ConsultationInfoDTO extends BaseEntity implements Serializable { /** * 问题描述 */ + @ApiModelProperty("问题描述") @NotNull(message = "问题描述不能为空", groups = {Insert.class, Update.class}) @Length(max = 500, message = "问题描述不能超过500位", groups = {Insert.class, Update.class}) private String problemStatement; @@ -124,6 +142,7 @@ public class ConsultationInfoDTO extends BaseEntity implements Serializable { /** * 病历 */ + @ApiModelProperty("病历") @NotNull(message = "病历不能为空", groups = {Insert.class, Update.class}) @Length(max = 100, message = "病历不能超过100位", groups = {Insert.class, Update.class}) private String medicalRecord; @@ -131,10 +150,12 @@ public class ConsultationInfoDTO extends BaseEntity implements Serializable { /** * 状态 */ + @ApiModelProperty("状态") private Integer status; /** * 问诊资料文件 */ + @ApiModelProperty("问诊资料文件") private List fileUrls; } diff --git a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/dto/scheduleplan/SchedulePlanDetailDTO.java b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/dto/scheduleplan/SchedulePlanDetailDTO.java new file mode 100644 index 0000000..69a20df --- /dev/null +++ b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/dto/scheduleplan/SchedulePlanDetailDTO.java @@ -0,0 +1,21 @@ +package com.xinelu.applet.dto.scheduleplan; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @description: 预约时间端状态修改传输对象 + * @author: haown + * @create: 2023-10-23 15:36 + **/ +@ApiModel("预约时间端状态修改传输对象") +@Data +public class SchedulePlanDetailDTO { + + @ApiModelProperty("医生排班计划明细表id") + private Long schedulePlanDetailId; + + @ApiModelProperty("启用状态(0:可预约 1:不可预约)") + private String status; +} diff --git a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/mapper/chatrecord/ChatRecordMapper.java b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/mapper/chatrecord/ChatRecordMapper.java index 7c0bfd1..ecee67c 100644 --- a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/mapper/chatrecord/ChatRecordMapper.java +++ b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/mapper/chatrecord/ChatRecordMapper.java @@ -1,9 +1,12 @@ package com.xinelu.applet.mapper.chatrecord; +import com.xinelu.applet.dto.chatrecord.MarkReadDto; +import com.xinelu.applet.dto.chatrecord.MessageSearchDto; +import com.xinelu.applet.vo.chatrecord.MessageCenterVo; +import com.xinelu.applet.vo.chatrecord.MessageVo; import com.xinelu.manage.domain.chatRecord.ChatRecord; - import java.util.List; - +import org.apache.ibatis.annotations.Param; /** * 图文咨询-聊天记录Mapper接口 @@ -12,6 +15,10 @@ import java.util.List; * @date 2023-09-25 */ public interface ChatRecordMapper { + + List selectMegVoList(MessageSearchDto messageDto); + + MessageCenterVo selectOneChatRecord(@Param("bindingNo")Long bindingNo, @Param("doctorNo")Long doctorNo); /** * 查询图文咨询-聊天记录 * @@ -59,4 +66,6 @@ public interface ChatRecordMapper { * @return 结果 */ public int deleteChatRecordByIds(Long[] ids); + + Integer updateReadStatus(MarkReadDto markReadDto); } diff --git a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/chatRecord/IChatRecordService.java b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/chatRecord/IChatRecordService.java index d3223be..4d2d1c0 100644 --- a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/chatRecord/IChatRecordService.java +++ b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/chatRecord/IChatRecordService.java @@ -1,13 +1,14 @@ package com.xinelu.applet.service.chatRecord; import com.xinelu.applet.dto.chatrecord.ChatRecordDTO; +import com.xinelu.applet.dto.chatrecord.MessageSearchDto; +import com.xinelu.applet.vo.chatrecord.MessageCenterVo; import com.xinelu.common.core.domain.AjaxResult; import com.xinelu.common.exception.file.InvalidExtensionException; import com.xinelu.manage.domain.chatRecord.ChatRecord; -import org.springframework.web.multipart.MultipartFile; - import java.io.IOException; import java.util.List; +import org.springframework.web.multipart.MultipartFile; /** @@ -75,4 +76,6 @@ public interface IChatRecordService { * @return 结果 */ public AjaxResult uploadChatRecordFile(MultipartFile multipartFile, Long consultationId) throws IOException, InvalidExtensionException; + + List getMegVoList(MessageSearchDto messageDto); } diff --git a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/chatRecord/impl/ChatRecordServiceImpl.java b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/chatRecord/impl/ChatRecordServiceImpl.java index 9103f9c..489826a 100644 --- a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/chatRecord/impl/ChatRecordServiceImpl.java +++ b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/chatRecord/impl/ChatRecordServiceImpl.java @@ -1,8 +1,11 @@ package com.xinelu.applet.service.chatRecord.impl; import com.xinelu.applet.dto.chatrecord.ChatRecordDTO; +import com.xinelu.applet.dto.chatrecord.MessageSearchDto; import com.xinelu.applet.mapper.chatrecord.ChatRecordMapper; import com.xinelu.applet.service.chatRecord.IChatRecordService; +import com.xinelu.applet.vo.chatrecord.MessageCenterVo; +import com.xinelu.applet.vo.chatrecord.MessageVo; import com.xinelu.common.config.XinELuConfig; import com.xinelu.common.core.domain.AjaxResult; import com.xinelu.common.core.dto.MessageTemplate; @@ -15,14 +18,18 @@ import com.xinelu.common.utils.bean.BeanUtils; import com.xinelu.common.utils.file.FileUploadUtils; import com.xinelu.common.utils.file.MimeTypeUtils; import com.xinelu.manage.domain.chatRecord.ChatRecord; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; +import javax.annotation.Resource; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; import org.springframework.web.multipart.MultipartFile; -import javax.annotation.Resource; -import java.io.IOException; -import java.util.List; - /** * 图文咨询-聊天记录Service业务层处理 * @@ -143,4 +150,63 @@ public class ChatRecordServiceImpl implements IChatRecordService { ajax.put("fileUrl", pictureName); return ajax; } + + @Override + public List getMegVoList(MessageSearchDto messageDto) { + List messageCenterVos = new ArrayList<>(); + List messageList = chatRecordMapper.selectMegVoList(messageDto); + if (!CollectionUtils.isEmpty(messageList)) { + Map> groupByCategory = messageList.stream().collect(Collectors.groupingBy(MessageVo::getMessageCategory)); + + groupByCategory.keySet().forEach(key -> { + MessageCenterVo megCenter = new MessageCenterVo(); + if (!StringUtils.equals("3", key)) { + if (groupByCategory.get(key) != null && groupByCategory.get(key).size() > 0) { + org.springframework.beans.BeanUtils.copyProperties(groupByCategory.get(key).get(0), megCenter); + Long unreadCount = groupByCategory.get(key).stream().collect(Collectors.groupingBy(MessageVo::getReadStatus, Collectors.counting())).get("0"); + megCenter.setUnreadCount(unreadCount == null ? 0 : unreadCount.intValue()); + messageCenterVos.add(megCenter); + } + } else { + // 在线咨询 + List chatList = groupByCategory.get(key); + if (chatList != null && chatList.size() > 0) { + Map> groupByReceive = chatList.stream().collect(Collectors.groupingBy(MessageVo::getRecipientId)); + // 统计未读条数 + Map unReadMap = new HashMap<>(); + if (groupByReceive.get(messageDto.getRecipientId()) != null && groupByReceive.get(messageDto.getRecipientId()).size() > 0) { + Map> groupBySender = groupByReceive.get(messageDto.getRecipientId()).stream().collect(Collectors.groupingBy(MessageVo::getSenderId)); + groupBySender.keySet().forEach(sender -> { + unReadMap.put(sender, (int) groupBySender.get(sender).stream().filter(meg -> meg.getReadStatus().equals("0")).count()); + }); + } + if (StringUtils.equals("1", messageDto.getUserType())) { + // 医生端消息,根据发送者分组 + groupByReceive = chatList.stream().collect(Collectors.groupingBy(MessageVo::getSenderId)); + } + + groupByReceive.keySet().forEach(receive -> { + if (!receive.equals(messageDto.getRecipientId())) { + // 查询doctor与当前登录用户最新一条聊天记录 + MessageCenterVo chat = chatRecordMapper.selectOneChatRecord(messageDto.getRecipientId(), receive); + if (chat.getSenderId().equals(messageDto.getRecipientId())) { + // 如果发送人是当前登录用户,则把发送人与接收人颠倒 + Long recipientNo = chat.getSenderId(); + String recipientName = chat.getSenderName(); + chat.setSenderId(chat.getRecipientId()); + chat.setSenderName(chat.getRecipientName()); + chat.setRecipientId(recipientNo); + chat.setRecipientName(recipientName); + } + chat.setUnreadCount(unReadMap.get(receive) == null ? 0 : unReadMap.get(receive)); + messageCenterVos.add(chat); + } + }); + } + } + }); + } + + return messageCenterVos; + } } diff --git a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/consultationInfo/impl/ConsultationInfoServiceImpl.java b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/consultationInfo/impl/ConsultationInfoServiceImpl.java index 8f0fbb0..79568a2 100644 --- a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/consultationInfo/impl/ConsultationInfoServiceImpl.java +++ b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/consultationInfo/impl/ConsultationInfoServiceImpl.java @@ -46,7 +46,9 @@ public class ConsultationInfoServiceImpl implements IConsultationInfoService { @Override public ConsultationInfoDTO selectConsultationInfoById(Long id) { ConsultationInfoDTO consultationInfoDTO = consultationInfoMapper.selectConsultationInfoById(id); - consultationInfoDTO.setFileUrls(consultationInfoMapper.getConsultationFiles(id)); + if (consultationInfoDTO != null) { + consultationInfoDTO.setFileUrls(consultationInfoMapper.getConsultationFiles(id)); + } return consultationInfoDTO; } diff --git a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/scheduleplan/impl/AppletSchedulePlanServiceImpl.java b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/scheduleplan/impl/AppletSchedulePlanServiceImpl.java index ce349e5..422b503 100644 --- a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/scheduleplan/impl/AppletSchedulePlanServiceImpl.java +++ b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/scheduleplan/impl/AppletSchedulePlanServiceImpl.java @@ -44,11 +44,13 @@ public class AppletSchedulePlanServiceImpl implements IAppletSchedulePlanService detailList.forEach(detail -> { DateTimeFormatter formatter = DateTimeFormatter.ofPattern("HH:mm"); if (StringUtils.equals("1", detail.getType())) { - morningList.add(SchedulePlanDetailVO.builder().scheduleTimeSlot(detail.getScheduleStartTime().format(formatter) + "~" + detail.getScheduleEndTime().format(formatter)) + morningList.add(SchedulePlanDetailVO.builder().schedulePlanDetailId(detail.getId()) + .scheduleTimeSlot(detail.getScheduleStartTime().format(formatter) + "~" + detail.getScheduleEndTime().format(formatter)) .status(StringUtils.equals("0", detail.getStatus()) && StringUtils.equals("0", detail.getApplyState())).build()); } if (StringUtils.equals("2", detail.getType())) { - afternoonList.add(SchedulePlanDetailVO.builder().scheduleTimeSlot(detail.getScheduleStartTime().format(formatter) + "~" + detail.getScheduleEndTime().format(formatter)) + afternoonList.add(SchedulePlanDetailVO.builder().schedulePlanDetailId(detail.getId()) + .scheduleTimeSlot(detail.getScheduleStartTime().format(formatter) + "~" + detail.getScheduleEndTime().format(formatter)) .status(StringUtils.equals("0", detail.getStatus()) && StringUtils.equals("0", detail.getApplyState())).build()); } }); diff --git a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/vo/chatrecord/MessageCenterVo.java b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/vo/chatrecord/MessageCenterVo.java new file mode 100644 index 0000000..4cdbb0f --- /dev/null +++ b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/vo/chatrecord/MessageCenterVo.java @@ -0,0 +1,54 @@ +package com.xinelu.applet.vo.chatrecord; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Date; +import lombok.Data; + +/** + * @description: 消息中心返回视图类 + * @author: haown + * @create: 2022-12-04 20:15 + **/ +@ApiModel("消息中心返回视图类") +@Data +public class MessageCenterVo { + + @ApiModelProperty("消息类别 1:通知公告,2:健康推送,3:在线咨询") + private String messageCategory; + + @ApiModelProperty("通知适用人群(0:全部人群)") + private String crowds; + + @ApiModelProperty("发送人编号") + private Long senderId; + + @ApiModelProperty("发送人姓名") + private String senderName; + + @ApiModelProperty("发送时间") + @JsonFormat(pattern ="yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date sendTime; + + @ApiModelProperty("消息类型,1:文字,2:图片") + private String messageType; + + @ApiModelProperty("标题") + private String title; + + @ApiModelProperty("消息内容") + private String content; + + @ApiModelProperty("接收人编号") + private Long recipientId; + + @ApiModelProperty("接收人姓名") + private String recipientName; + + @ApiModelProperty("已读状态,0:未读,1:已读") + private String readStatus; + + @ApiModelProperty("未读条数") + private Integer unreadCount; +} diff --git a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/vo/chatrecord/MessageVo.java b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/vo/chatrecord/MessageVo.java new file mode 100644 index 0000000..b01cca9 --- /dev/null +++ b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/vo/chatrecord/MessageVo.java @@ -0,0 +1,60 @@ +package com.xinelu.applet.vo.chatrecord; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Date; +import lombok.Data; + +/** + * @description: 消息列表查询返回视图类 + * @author: haown + * @create: 2022-12-01 21:24 + **/ +@Data +@ApiModel("消息列表查询返回视图类") +public class MessageVo { + + @ApiModelProperty("业务主键") + private String messageNo; + + @ApiModelProperty("消息类别 1:通知公告,2:健康推送,3:在线咨询") + private String messageCategory; + + @ApiModelProperty("通知适用人群(0:全部人群)") + private String crowds; + + @ApiModelProperty("通知适用人群名称") + private String crowdsName; + + @ApiModelProperty("发送人编号") + private Long senderId; + + @ApiModelProperty("发送人姓名") + private String senderName; + + @ApiModelProperty("发送时间") + @JsonFormat(pattern ="yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date sendTime; + + @ApiModelProperty("接收人编号") + private Long recipientId; + + @ApiModelProperty("接收人姓名") + private String recipientName; + + @ApiModelProperty("消息类型,1:健康推送,2:日常提醒, 3:风险评估完成, 4:推送筛查项目,5:预约筛查成功, 6:筛查完成,7:康复处方,8:随访提醒,9:纳入管理,10:申请转诊,11:转诊申请通过,12:申请会诊,13:会诊申请通过,14:处理异常") + private String messageType; + + @ApiModelProperty("标题") + private String title; + + @ApiModelProperty("消息内容") + private String content; + + @ApiModelProperty("消息内容业务主键") + private String contentId; + + @ApiModelProperty("已读状态,0:未读,1:已读") + private String readStatus; +} diff --git a/xinelu-nurse-applet/src/main/resources/mapper/applet/chatrecord/ChatRecordMapper.xml b/xinelu-nurse-applet/src/main/resources/mapper/applet/chatrecord/ChatRecordMapper.xml index 5bd5fec..e5172b4 100644 --- a/xinelu-nurse-applet/src/main/resources/mapper/applet/chatrecord/ChatRecordMapper.xml +++ b/xinelu-nurse-applet/src/main/resources/mapper/applet/chatrecord/ChatRecordMapper.xml @@ -6,7 +6,11 @@ + + + + @@ -27,6 +31,8 @@ select id, + message_no, + message_category, consultation_id, sender_id, sender_name, @@ -47,6 +53,49 @@ from chat_record + + message_no + ,message_category,crowds,crowds_name,sender_id, + sender_name,send_time,recipient_id, + recipient_name,message_type,title,content,content_id, + read_status + + + + + + - where del_flag = '0' + where del_flag = 0 and consultation_id = #{consultationId} and ( (sender_id = #{senderId} and recipient_id = #{recipientId}) @@ -218,7 +218,7 @@ crowds = #{crowds}, - crowds_name + crowds_name = #{crowdsName}, sender_id = @@ -283,7 +283,7 @@ read_time = #{readTime}, - where del_flag = '0' and read_status = '0' and recipient_id = #{recipientId} + where del_flag = 0 and read_status = '0' and recipient_id = #{recipientId} @@ -298,4 +298,16 @@ #{id} + + + update chat_record set del_flag = 1 + + + id in + + #{id} + + + +