Merge remote-tracking branch 'origin/jihan_0920_护理服务、商城、积分兑换、在线问诊功能分支' into jihan_0920_护理服务、商城、积分兑换、在线问诊功能分支

This commit is contained in:
HaoWang 2023-10-24 16:07:41 +08:00
commit 6558870cde
27 changed files with 624 additions and 52 deletions

View File

@ -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<String> 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();
}
}

View File

@ -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<String> 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();
}
}

View File

@ -1,23 +1,34 @@
package com.xinelu.applet.controller.chatrecord;
import com.xinelu.applet.dto.chatrecord.ChatRecordDTO;
import com.xinelu.applet.dto.chatrecord.MarkReadDto;
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.util.CollectionUtils;
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;
/**
* 图文咨询-聊天记录表
*
@ -53,7 +64,8 @@ public class ChatRecordController extends BaseController {
@PostMapping("/sendMessage")
@Transactional
public AjaxResult sendMessage(@RequestBody ChatRecordDTO chatRecordDTO) {
if (chatRecordService.insertChatRecord(chatRecordDTO) > 0) {
chatRecordDTO.setMessageCategory("3");
if (chatRecordService.insertChatRecord(chatRecordDTO) > 0) {
// 判断接收人是否在线
if (WebSocketUtils.clients.get(chatRecordDTO.getRecipientId().toString()) == null) {
return AjaxResult.success();
@ -78,4 +90,28 @@ public class ChatRecordController extends BaseController {
}
return chatRecordService.uploadChatRecordFile(multipartFile, consultationId);
}
@ApiOperation("消息中心")
@GetMapping("/getMegVoList")
public R<List<MessageCenterVo>> getMegVoList(MessageSearchDto messageDto) {
if (messageDto.getRecipientId() == null) {
return R.fail("请先绑定账号!");
}
return R.ok(chatRecordService.getMegVoList(messageDto));
}
@ApiOperation("标记为已读")
@GetMapping("/markRead")
public R<String> markRead(MarkReadDto markReadDto) {
return chatRecordService.markRead(markReadDto) < 0 ? R.fail() : R.ok();
}
@ApiOperation("删除消息")
@GetMapping("/deleteMegs")
public R<String> deleteMegs(@RequestBody List<Long> ids) {
if (CollectionUtils.isEmpty(ids)) {
return R.fail("请选择要删除的消息!");
}
return chatRecordService.deleteMegs(ids) > 0 ? R.ok("删除成功") : R.fail("删除失败");
}
}

View File

@ -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 {
@ -46,9 +56,10 @@ public class ConsultationInfoController extends BaseController {
/**
* 获取在线问诊-问诊信息详细信息
*/
@ApiOperation(value = "获取在线问诊-问诊信息详细信息")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return AjaxResult.success(consultationInfoService.selectConsultationInfoById(id));
public R<ConsultationInfoDTO> getInfo(@PathVariable("id") Long id) {
return R.ok(consultationInfoService.selectConsultationInfoById(id));
}
/**

View File

@ -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);

View File

@ -2,6 +2,7 @@ package com.xinelu.applet.dto.chatrecord;
import com.xinelu.common.core.domain.BaseEntity;
import com.xinelu.common.custominterface.Insert;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import net.sf.jsqlparser.statement.update.Update;
import org.hibernate.validator.constraints.Length;
@ -21,6 +22,9 @@ public class ChatRecordDTO extends BaseEntity implements Serializable {
private static final long serialVersionUID = -3911806583514536587L;
@ApiModelProperty("消息类别 1通知公告2健康推送3在线咨询 4消息通知")
private String messageCategory;
/**
* 聊天记录业务主键(问诊表id)
*/

View File

@ -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<String> messageNos;
}

View File

@ -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<String> crowdNoList;
}

View File

@ -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<String> fileUrls;
}

View File

@ -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;
}

View File

@ -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<MessageVo> selectMegVoList(MessageSearchDto messageDto);
MessageCenterVo selectOneChatRecord(@Param("bindingNo")Long bindingNo, @Param("doctorNo")Long doctorNo);
/**
* 查询图文咨询-聊天记录
*
@ -59,4 +66,8 @@ public interface ChatRecordMapper {
* @return 结果
*/
public int deleteChatRecordByIds(Long[] ids);
Integer updateReadStatus(MarkReadDto markReadDto);
int deleteMegs(@Param("ids") List<Long> ids);
}

View File

@ -1,13 +1,15 @@
package com.xinelu.applet.service.chatRecord;
import com.xinelu.applet.dto.chatrecord.ChatRecordDTO;
import com.xinelu.applet.dto.chatrecord.MarkReadDto;
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;
/**
@ -23,7 +25,7 @@ public interface IChatRecordService {
* @param id 图文咨询-聊天记录主键
* @return 图文咨询-聊天记录
*/
public ChatRecord selectChatRecordById(Long id);
ChatRecord selectChatRecordById(Long id);
/**
* 查询图文咨询-聊天记录列表
@ -31,7 +33,7 @@ public interface IChatRecordService {
* @param chatRecord 图文咨询-聊天记录
* @return 图文咨询-聊天记录集合
*/
public List<ChatRecord> selectChatRecordList(ChatRecord chatRecord);
List<ChatRecord> selectChatRecordList(ChatRecord chatRecord);
/**
* 新增图文咨询-聊天记录
@ -39,7 +41,7 @@ public interface IChatRecordService {
* @param chatRecordDTO 图文咨询-聊天记录
* @return 结果
*/
public int insertChatRecord(ChatRecordDTO chatRecordDTO);
int insertChatRecord(ChatRecordDTO chatRecordDTO);
Boolean sendMessage(ChatRecordDTO chatRecordDTO);
@ -49,7 +51,7 @@ public interface IChatRecordService {
* @param chatRecord 图文咨询-聊天记录
* @return 结果
*/
public int updateChatRecord(ChatRecord chatRecord);
int updateChatRecord(ChatRecord chatRecord);
/**
* 批量删除图文咨询-聊天记录
@ -57,7 +59,7 @@ public interface IChatRecordService {
* @param ids 需要删除的图文咨询-聊天记录主键集合
* @return 结果
*/
public int deleteChatRecordByIds(Long[] ids);
int deleteChatRecordByIds(Long[] ids);
/**
* 删除图文咨询-聊天记录信息
@ -65,7 +67,7 @@ public interface IChatRecordService {
* @param id 图文咨询-聊天记录主键
* @return 结果
*/
public int deleteChatRecordById(Long id);
int deleteChatRecordById(Long id);
/**
@ -74,5 +76,11 @@ public interface IChatRecordService {
* @param multipartFile,consultationId 文件,问诊id
* @return 结果
*/
public AjaxResult uploadChatRecordFile(MultipartFile multipartFile, Long consultationId) throws IOException, InvalidExtensionException;
AjaxResult uploadChatRecordFile(MultipartFile multipartFile, Long consultationId) throws IOException, InvalidExtensionException;
List<MessageCenterVo> getMegVoList(MessageSearchDto messageDto);
Integer markRead(MarkReadDto markReadDto);
Integer deleteMegs(List<Long> ids);
}

View File

@ -1,8 +1,12 @@
package com.xinelu.applet.service.chatRecord.impl;
import com.xinelu.applet.dto.chatrecord.ChatRecordDTO;
import com.xinelu.applet.dto.chatrecord.MarkReadDto;
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 +19,19 @@ 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.Date;
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业务层处理
*
@ -69,6 +78,9 @@ public class ChatRecordServiceImpl implements IChatRecordService {
chatRecord.setCreateTime(DateUtils.getNowDate());
ChatRecord record = new ChatRecord();
BeanUtils.copyBeanProp(record, chatRecord);
record.setReadStatus("0");
record.setSendTime(new Date());
record.setDelFlag(0);
return chatRecordMapper.insertChatRecord(record);
}
@ -144,4 +156,74 @@ public class ChatRecordServiceImpl implements IChatRecordService {
ajax.put("fileUrl", pictureName);
return ajax;
}
@Override
public List<MessageCenterVo> getMegVoList(MessageSearchDto messageDto) {
List<MessageCenterVo> messageCenterVos = new ArrayList<>();
List<MessageVo> messageList = chatRecordMapper.selectMegVoList(messageDto);
if (!CollectionUtils.isEmpty(messageList)) {
Map<String, List<MessageVo>> 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<MessageVo> chatList = groupByCategory.get(key);
if (chatList != null && chatList.size() > 0) {
Map<Long, List<MessageVo>> groupByReceive = chatList.stream().collect(Collectors.groupingBy(MessageVo::getRecipientId));
// 统计未读条数
Map<Long, Integer> unReadMap = new HashMap<>();
if (groupByReceive.get(messageDto.getRecipientId()) != null && groupByReceive.get(messageDto.getRecipientId()).size() > 0) {
Map<Long, List<MessageVo>> 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;
}
@Override public Integer markRead(MarkReadDto markReadDto) {
if (StringUtils.isBlank(markReadDto.getBindingNo())) {
return -1;
}
return chatRecordMapper.updateReadStatus(markReadDto);
}
@Override public Integer deleteMegs(List<Long> ids) {
return chatRecordMapper.deleteMegs(ids);
}
}

View File

@ -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;
}

View File

@ -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());
}
});

View File

@ -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;
}

View File

@ -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;
}

View File

@ -6,7 +6,11 @@
<resultMap type="ChatRecord" id="ChatRecordResult">
<result property="id" column="id"/>
<result property="messageNo" column="message_no"/>
<result property="messageCategory" column="message_category"/>
<result property="consultationId" column="consultation_id"/>
<result property="crowds" column="crowds"/>
<result property="crowdsName" column="crowds_name"/>
<result property="senderId" column="sender_id"/>
<result property="senderName" column="sender_name"/>
<result property="sendTime" column="send_time"/>
@ -27,6 +31,8 @@
<sql id="selectChatRecordVo">
select id,
message_no,
message_category,
consultation_id,
sender_id,
sender_name,
@ -47,9 +53,52 @@
from chat_record
</sql>
<sql id="Message_Vo_List">
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
</sql>
<select id="selectMegVoList" parameterType="com.xinelu.applet.dto.chatrecord.MessageSearchDto"
resultType="com.xinelu.applet.vo.chatrecord.MessageVo">
select
<include refid="Message_Vo_List"/>
from chat_record
where del_flag = 0 and (recipient_id = #{recipientId} or sender_id = #{recipientId})
<if test="messageCategory != null">
and message_category = #{messageCategory}
</if>
<if test="readStatus != null">
and read_status = #{readStatus}
</if>
order by send_time desc
</select>
<select id="selectOneChatRecord" parameterType="java.lang.String"
resultType="com.xinelu.applet.vo.chatrecord.MessageCenterVo">
select message_category,
crowds,
crowds_name,
sender_id,
sender_name,
send_time,
message_type,
content,
recipient_id,
recipient_name
from chat_record
where del_flag = 0
and message_category = '3'
and ((sender_id = #{bindingNo} and recipient_id = #{doctorNo})
or (sender_id = #{doctorNo} and recipient_id = #{bindingNo}))
ORDER BY send_time desc limit 1
</select>
<select id="selectChatRecordList" parameterType="ChatRecord" resultMap="ChatRecordResult">
<include refid="selectChatRecordVo"/>
where del_flag = '0'
where del_flag = 0
and consultation_id = #{consultationId}
and (
(sender_id = #{senderId} and recipient_id = #{recipientId})
@ -72,8 +121,14 @@
keyProperty="id">
insert into chat_record
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="messageCategory != null">message_category,
</if>
<if test="consultationId != null">consultation_id,
</if>
<if test="crowds != null">crowds,
</if>
<if test="crowdsName != null">crowds_name,
</if>
<if test="senderId != null">sender_id,
</if>
<if test="senderName != null and senderName != ''">sender_name,
@ -108,8 +163,14 @@
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="messageCategory != null">#{messageCategory},
</if>
<if test="consultationId != null">#{consultationId},
</if>
<if test="crowds != null">#{crowds},
</if>
<if test="crowdsName != null">#{crowdsName},
</if>
<if test="senderId != null">#{senderId},
</if>
<if test="senderName != null and senderName != ''">#{senderName},
@ -148,9 +209,18 @@
<update id="updateChatRecord" parameterType="ChatRecord">
update chat_record
<trim prefix="SET" suffixOverrides=",">
<if test="messageCategory != null">message_category =
#{messageCategory},
</if>
<if test="consultationId != null">consultation_id =
#{consultationId},
</if>
<if test="crowds != null">crowds =
#{crowds},
</if>
<if test="crowdsName != null">crowds_name =
#{crowdsName},
</if>
<if test="senderId != null">sender_id =
#{senderId},
</if>
@ -203,9 +273,8 @@
where id = #{id}
</update>
<update id="updateReadStatus" parameterType="ChatRecord">
<update id="updateReadStatus" parameterType="com.xinelu.applet.dto.chatrecord.MarkReadDto">
update chat_record
<trim prefix="SET" suffixOverrides=",">
<if test="readStatus != null and readStatus != ''">
read_status = =#{readStatus},
@ -214,8 +283,7 @@
read_time = #{readTime},
</if>
</trim>
where del_flag = '0' and read_status = '0' and recipient_id = #{recipientId}
where del_flag = 0 and read_status = '0' and recipient_id = #{recipientId}
</update>
<delete id="deleteChatRecordById" parameterType="Long">
@ -230,4 +298,16 @@
#{id}
</foreach>
</delete>
<update id="deleteMegs">
update chat_record set del_flag = 1
<where>
<if test="messageNos != null">
id in
<foreach collection="ids" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</if>
</where>
</update>
</mapper>

View File

@ -34,6 +34,21 @@ public class ChatRecord extends BaseEntity implements Serializable {
*/
private Long id;
/**
* 消息类别 1通知公告2健康推送3在线咨询 4消息通知
*/
private String messageCategory;
/**
* 通知适用人群0全部人群
*/
private String crowds;
/**
* 通知适用人群名称
*/
private String crowdsName;
/**
* 聊天记录业务主键(问诊表id)
*/

View File

@ -1,6 +1,5 @@
package com.xinelu.manage.dto.goodsorder;
import com.xinelu.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -12,7 +11,10 @@ import lombok.Data;
**/
@ApiModel("工单查询传输对象")
@Data
public class GoodsOrderDTO extends BaseEntity {
public class GoodsOrderDTO {
@ApiModelProperty("订单id")
private Long goodsOrderId;
@ApiModelProperty("医生主键id")
private Long hospitalPersonId;
@ -23,11 +25,17 @@ public class GoodsOrderDTO extends BaseEntity {
/**
* 订单状态待付款WAIT_PAY已付款PAY已取消CANCEL待收货WAIT_RECEIVED已收货RECEIVED待退款WAIT_REFUND已退款REFUNDED待退货WAIT_RETURNED已退货RETURNED
*/
@ApiModelProperty("订单状态待付款WAIT_PAY已付款PAY已取消CANCEL"
+ "待收货WAIT_RECEIVED_GOODS专家咨询订单为待接单"
+ "已收货RECEIVED_GOODS商品订单为待评价专家咨询订单为待服务"
+ "退款中WAIT_REFUND已退款REFUNDED待退货WAIT_RETURNED_GOODS"
+ "已退货RETURNED_GOODS已评价EVALUATED已完成COMPLETED专家咨询订单使用")
@ApiModelProperty("订单状态WAIT_PAY:待付款,"
+ "PAY:已付款,"
+ "CANCEL:已取消,"
+ "WAIT_RECEIVED_GOODS专家咨询订单为待接单"
+ "RECEIVED_GOODS商品订单为待评价专家咨询订单为待服务"
+ "WAIT_REFUND退款中"
+ "REFUNDED已退款"
+ "WAIT_RETURNED_GOODS待退货"
+ "RETURNED_GOODS已退货"
+ "EVALUATED已评价"
+ "COMPLETED:已完成(专家咨询订单使用)")
private String orderStatus;
/**
@ -36,4 +44,16 @@ public class GoodsOrderDTO extends BaseEntity {
@ApiModelProperty("订单类型积分兑换INTEGRAL_EXCHANGE直接购买DIRECT_BUY健康咨询HEALTH_CONSULTATION")
private String orderType;
/**
* 页码
*/
@ApiModelProperty("页码")
private Integer pageNum;
/**
* 页面大小
*/
@ApiModelProperty("页面大小")
private Integer pageSize;
}

View File

@ -8,7 +8,7 @@ import com.xinelu.manage.vo.goodsorder.GoodsOrderDetailsVO;
import com.xinelu.manage.vo.goodsorder.GoodsOrderRefundVO;
import com.xinelu.manage.vo.goodsorder.GoodsOrderVO;
import java.util.List;
import org.springframework.web.bind.annotation.RequestBody;
/**
* 商品订单Service接口
@ -105,4 +105,11 @@ public interface IGoodsOrderService {
* @return
*/
List<AppGoodsOrderVO> getConsultationOrders(GoodsOrderDTO goodsOrderDTO);
/**
* 修改订单状态
* @param goodsOrderDTO
* @return
*/
int updateStatus(@RequestBody GoodsOrderDTO goodsOrderDTO);
}

View File

@ -1,6 +1,5 @@
package com.xinelu.manage.service.goodsOrder.impl;
import com.xinelu.common.enums.ConfirmRefundStatusEnum;
import com.xinelu.common.enums.GooodsOrderStatusEnum;
import com.xinelu.common.utils.SecurityUtils;
@ -13,11 +12,10 @@ import com.xinelu.manage.vo.goodsorder.GoodsInfoOrderVO;
import com.xinelu.manage.vo.goodsorder.GoodsOrderDetailsVO;
import com.xinelu.manage.vo.goodsorder.GoodsOrderRefundVO;
import com.xinelu.manage.vo.goodsorder.GoodsOrderVO;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
/**
@ -143,6 +141,13 @@ public class GoodsOrderServiceImpl implements IGoodsOrderService {
return goodsOrderMapper.getConsultationOrders(goodsOrderDTO);
}
@Override public int updateStatus(GoodsOrderDTO goodsOrderDTO) {
GoodsOrder goodsOrder = new GoodsOrder();
goodsOrder.setId(goodsOrderDTO.getGoodsOrderId());
goodsOrder.setOrderStatus(goodsOrderDTO.getOrderStatus());
return goodsOrderMapper.updateGoodsOrder(goodsOrder);
}
/**
* 查询订单信息具体明细
*

View File

@ -14,4 +14,5 @@ public interface ISchedulePlanDetailService {
List<SchedulePlanDetail> getList(SchedulePlanDetail planDetail);
int update(SchedulePlanDetail planDetail);
}

View File

@ -25,6 +25,10 @@ public class SchedulePlanDetailServiceImpl implements ISchedulePlanDetailService
@Override public List<SchedulePlanDetail> getList(SchedulePlanDetail planDetail) {
return planDetailMapper.getList(planDetail);
}
@Override public int update(SchedulePlanDetail planDetail) {
return planDetailMapper.updateByPrimaryKeySelective(planDetail);
}
}

View File

@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
import com.xinelu.common.annotation.Excel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.math.BigDecimal;
import java.time.LocalTime;
import java.util.Date;
import lombok.Data;
@ -79,6 +80,14 @@ public class AppGoodsOrderVO {
@JsonFormat(pattern = "HH:mm")
private LocalTime appointmentEndTime;
@ApiModelProperty(value = "问题简述")
private String problemDescription;
/**
* 订单id
*/
@ApiModelProperty(value = "订单id")
private Long goodsOrderId;
/**
* 订单编号
*/
@ -88,6 +97,9 @@ public class AppGoodsOrderVO {
@ApiModelProperty(value = "订单状态待付款WAIT_PAY已付款PAY已取消CANCEL待收货WAIT_RECEIVED已收货RECEIVED待退款WAIT_REFUND已退款REFUNDED待退货WAIT_RETURNED已退货RETURNED")
private String orderStatus;
@ApiModelProperty(value = "订单总金额")
private BigDecimal totalPrice;
/**
* 健康咨询内容健康咨询类型的订单使用
**/

View File

@ -19,6 +19,9 @@ import lombok.NoArgsConstructor;
@NoArgsConstructor
public class SchedulePlanDetailVO {
@ApiModelProperty("医生排班计划明细表id")
private Long schedulePlanDetailId;
@ApiModelProperty("预约时间段")
private String scheduleTimeSlot;

View File

@ -760,11 +760,10 @@
select
c.patient_id as patientId, c.id as consultationInfoId,
c.patient_name as patientName, c.card_no as cardNo,
c.phone, c.address,c.appointment_date, c.appointment_start_time, c.appointment_end_time,
gr.order_no, gr.order_status, gr.health_consultation_content
c.phone, c.address,c.appointment_date, c.appointment_start_time, c.appointment_end_time,c.problem_description,
gr.id as goodsOrderId,gr.order_no, gr.order_status, gr.total_price, gr.health_consultation_content
from goods_order gr left join consultation_info c on gr.consultation_info_id = c.id
where gr.del_flag = 0 and c.consultation_type = 'VIDEO_CONSULTATION'
hospitalPersonId
<if test="hospitalPersonId != null">
and gr.hospital_person_id = #{hospitalPersonId}
</if>