Merge branch 'jihan_0920_护理服务、商城、积分兑换、在线问诊功能分支' of http://182.92.166.109:3000/jihan/xinelu-api into jihan_0920_护理服务、商城、积分兑换、在线问诊功能分支
This commit is contained in:
commit
73533c2655
@ -68,6 +68,10 @@ xinelu:
|
|||||||
person-certificate-check-url: /personCertificateCheckUrl
|
person-certificate-check-url: /personCertificateCheckUrl
|
||||||
# 护理站二维码存放地址
|
# 护理站二维码存放地址
|
||||||
station-wechat-code-url: /stationWechatCodeUrl
|
station-wechat-code-url: /stationWechatCodeUrl
|
||||||
|
#问诊文件地址
|
||||||
|
consultation-file-url: /consultationFileUrl
|
||||||
|
#聊天图片地址
|
||||||
|
chat-record-file-url: /chatRecordFileUrl
|
||||||
|
|
||||||
# 开发环境配置
|
# 开发环境配置
|
||||||
server:
|
server:
|
||||||
|
|||||||
@ -207,6 +207,32 @@ public class XinELuConfig {
|
|||||||
*/
|
*/
|
||||||
private String stationWechatCodeUrl;
|
private String stationWechatCodeUrl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 问诊文件地址
|
||||||
|
*/
|
||||||
|
private String consultationFileUrl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 聊天图片地址
|
||||||
|
*/
|
||||||
|
private String chatRecordFileUrl;
|
||||||
|
|
||||||
|
public String getConsultationFileUrl() {
|
||||||
|
return consultationFileUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setConsultationFileUrl(String consultationFileUrl) {
|
||||||
|
this.consultationFileUrl = consultationFileUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getChatRecordFileUrl() {
|
||||||
|
return chatRecordFileUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setChatRecordFileUrl(String chatRecordFileUrl) {
|
||||||
|
this.chatRecordFileUrl = chatRecordFileUrl;
|
||||||
|
}
|
||||||
|
|
||||||
public String getStationWechatCodeUrl() {
|
public String getStationWechatCodeUrl() {
|
||||||
return stationWechatCodeUrl;
|
return stationWechatCodeUrl;
|
||||||
}
|
}
|
||||||
@ -550,4 +576,4 @@ public class XinELuConfig {
|
|||||||
public void setItemDirectoryUrl(String itemDirectoryUrl) {
|
public void setItemDirectoryUrl(String itemDirectoryUrl) {
|
||||||
this.itemDirectoryUrl = itemDirectoryUrl;
|
this.itemDirectoryUrl = itemDirectoryUrl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,14 +5,13 @@ import com.xinelu.applet.dto.appletlogin.StationItemInfoDTO;
|
|||||||
import com.xinelu.applet.service.appletlogin.AppletLoginService;
|
import com.xinelu.applet.service.appletlogin.AppletLoginService;
|
||||||
import com.xinelu.common.annotation.MobileRequestAuthorization;
|
import com.xinelu.common.annotation.MobileRequestAuthorization;
|
||||||
import com.xinelu.common.annotation.RepeatSubmit;
|
import com.xinelu.common.annotation.RepeatSubmit;
|
||||||
import com.xinelu.common.config.XinELuConfig;
|
|
||||||
import com.xinelu.common.core.controller.BaseController;
|
import com.xinelu.common.core.controller.BaseController;
|
||||||
|
|
||||||
import com.xinelu.common.core.domain.AjaxResult;
|
import com.xinelu.common.core.domain.AjaxResult;
|
||||||
import com.xinelu.common.custominterface.Insert;
|
import com.xinelu.common.custominterface.Insert;
|
||||||
import com.xinelu.common.custominterface.Query;
|
import com.xinelu.common.custominterface.Query;
|
||||||
import com.xinelu.common.exception.ServiceException;
|
import com.xinelu.common.exception.ServiceException;
|
||||||
import com.xinelu.common.utils.regex.RegexUtil;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
import org.springframework.validation.BindingResult;
|
import org.springframework.validation.BindingResult;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
@ -34,6 +33,25 @@ public class AppletLoginController extends BaseController {
|
|||||||
@Resource
|
@Resource
|
||||||
private AppletLoginService appletLoginService;
|
private AppletLoginService appletLoginService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据登录凭证获取用户的登录信息
|
||||||
|
*
|
||||||
|
* @param loginCode 登录凭证
|
||||||
|
* @param phoneCode 获取手机号登录凭证
|
||||||
|
* @return 微信用户登录信息
|
||||||
|
*/
|
||||||
|
@MobileRequestAuthorization
|
||||||
|
@GetMapping("/getWeChatUserInfo")
|
||||||
|
public AjaxResult appletLogin(@RequestParam("loginCode") String loginCode, @Param("phoneCode") String phoneCode) {
|
||||||
|
if (StringUtils.isBlank(loginCode)) {
|
||||||
|
return AjaxResult.error("登录凭证编码不能为空!");
|
||||||
|
}
|
||||||
|
if (StringUtils.isBlank(phoneCode)) {
|
||||||
|
return AjaxResult.error("获取手机号凭证不存在");
|
||||||
|
}
|
||||||
|
return appletLoginService.appletLogin(loginCode, phoneCode);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据用户Id获取用户的登录信息
|
* 根据用户Id获取用户的登录信息
|
||||||
*
|
*
|
||||||
|
|||||||
@ -0,0 +1,81 @@
|
|||||||
|
package com.xinelu.applet.controller.chatrecord;
|
||||||
|
|
||||||
|
import com.xinelu.applet.dto.chatrecord.ChatRecordDTO;
|
||||||
|
import com.xinelu.applet.service.chatRecord.IChatRecordService;
|
||||||
|
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.enums.BusinessType;
|
||||||
|
import com.xinelu.common.socket.WebSocketUtils;
|
||||||
|
import com.xinelu.manage.domain.chatRecord.ChatRecord;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
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.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 图文咨询-聊天记录表
|
||||||
|
*
|
||||||
|
* @author wanghao
|
||||||
|
* @create 2023/9/26 0026
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/nurseApplet/chatRecord")
|
||||||
|
public class ChatRecordController extends BaseController {
|
||||||
|
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IChatRecordService chatRecordService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询聊天记录
|
||||||
|
*/
|
||||||
|
@GetMapping("/getChatRecord")
|
||||||
|
public AjaxResult getChatRecord(ChatRecord chatRecord) {
|
||||||
|
return AjaxResult.success(chatRecordService.selectChatRecordList(chatRecord));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改已读状态
|
||||||
|
*/
|
||||||
|
@Log(title = "图文咨询-聊天记录", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping(value = "updateReadStatus")
|
||||||
|
public AjaxResult updateReadStatus(@RequestBody ChatRecord chatRecord) {
|
||||||
|
return toAjax(chatRecordService.updateChatRecord(chatRecord));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "发送即时消息", notes = "向接收方发送即时消息")
|
||||||
|
@PostMapping("/sendMessage")
|
||||||
|
@Transactional
|
||||||
|
public AjaxResult sendMessage(@RequestBody ChatRecordDTO chatRecordDTO) {
|
||||||
|
if (chatRecordService.insertChatRecord(chatRecordDTO) > 0) {
|
||||||
|
// 判断接收人是否在线
|
||||||
|
if (WebSocketUtils.clients.get(chatRecordDTO.getRecipientId().toString()) == null) {
|
||||||
|
return AjaxResult.success();
|
||||||
|
} else {
|
||||||
|
return chatRecordService.sendMessage(chatRecordDTO) ? AjaxResult.success() : AjaxResult.error();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 问诊聊天上传文件接口
|
||||||
|
*/
|
||||||
|
@PostMapping("/uploadChatRecordFile")
|
||||||
|
public AjaxResult uploadChatRecordFile(@RequestParam("file") MultipartFile multipartFile, @RequestParam(value = "consultationId") Long consultationId) throws Exception {
|
||||||
|
if (Objects.isNull(multipartFile) || StringUtils.isBlank(multipartFile.getOriginalFilename())) {
|
||||||
|
return AjaxResult.error("当前文件不存在,无法上传!");
|
||||||
|
}
|
||||||
|
if (multipartFile.getOriginalFilename().contains(Constants.EMPTY)) {
|
||||||
|
return AjaxResult.error("当前文件名含有空格,请先去除空格在上传!");
|
||||||
|
}
|
||||||
|
return chatRecordService.uploadChatRecordFile(multipartFile, consultationId);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,22 +1,24 @@
|
|||||||
package com.xinelu.manage.controller.consultationInfo;
|
package com.xinelu.applet.controller.consultationInfo;
|
||||||
|
|
||||||
|
import com.xinelu.applet.dto.consultationInfo.ConsultationInfoDTO;
|
||||||
|
import com.xinelu.applet.service.consultationInfo.IConsultationInfoService;
|
||||||
import com.xinelu.common.annotation.Log;
|
import com.xinelu.common.annotation.Log;
|
||||||
|
import com.xinelu.common.constant.Constants;
|
||||||
import com.xinelu.common.core.controller.BaseController;
|
import com.xinelu.common.core.controller.BaseController;
|
||||||
import com.xinelu.common.core.domain.AjaxResult;
|
import com.xinelu.common.core.domain.AjaxResult;
|
||||||
import com.xinelu.common.core.page.TableDataInfo;
|
import com.xinelu.common.core.page.TableDataInfo;
|
||||||
|
import com.xinelu.common.custominterface.Insert;
|
||||||
import com.xinelu.common.enums.BusinessType;
|
import com.xinelu.common.enums.BusinessType;
|
||||||
import com.xinelu.common.socket.WebSocketUtils;
|
|
||||||
import com.xinelu.manage.domain.chatRecord.ChatRecord;
|
|
||||||
import com.xinelu.manage.domain.consultationInfo.ConsultationInfo;
|
import com.xinelu.manage.domain.consultationInfo.ConsultationInfo;
|
||||||
import com.xinelu.manage.service.chatRecord.IChatRecordService;
|
|
||||||
import com.xinelu.manage.service.consultationInfo.IConsultationInfoService;
|
|
||||||
import com.xinelu.manage.vo.consultationInfo.ConsultationInfoVO;
|
import com.xinelu.manage.vo.consultationInfo.ConsultationInfoVO;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 在线问诊-问诊信息Controller
|
* 在线问诊-问诊信息Controller
|
||||||
@ -25,22 +27,20 @@ import java.util.List;
|
|||||||
* @date 2023-09-25
|
* @date 2023-09-25
|
||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/system/consultationInfo")
|
@RequestMapping("/nurseApplet/consultationInfo")
|
||||||
public class ConsultationInfoController extends BaseController {
|
public class ConsultationInfoController extends BaseController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private IConsultationInfoService consultationInfoService;
|
private IConsultationInfoService consultationInfoService;
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private IChatRecordService chatRecordService;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询在线问诊-问诊信息列表
|
* 查询在线问诊-问诊信息列表
|
||||||
*/
|
*/
|
||||||
//@PreAuthorize("@ss.hasPermi('system:info:list')")
|
//@PreAuthorize("@ss.hasPermi('system:info:list')")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public TableDataInfo list(ConsultationInfo consultationInfo) {
|
public TableDataInfo list(ConsultationInfoDTO consultationInfoDTO) {
|
||||||
startPage();
|
startPage();
|
||||||
List<ConsultationInfoVO> list = consultationInfoService.selectConsultationInfoList(consultationInfo);
|
List<ConsultationInfoVO> list = consultationInfoService.selectConsultationInfoList(consultationInfoDTO);
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -60,8 +60,8 @@ public class ConsultationInfoController extends BaseController {
|
|||||||
// @PreAuthorize("@ss.hasPermi('system:info:add')")
|
// @PreAuthorize("@ss.hasPermi('system:info:add')")
|
||||||
@Log(title = "在线问诊-问诊信息", businessType = BusinessType.INSERT)
|
@Log(title = "在线问诊-问诊信息", businessType = BusinessType.INSERT)
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public AjaxResult add(@RequestBody ConsultationInfo consultationInfo) {
|
public AjaxResult add(@Validated(Insert.class) @RequestBody ConsultationInfoDTO consultationInfoDTO) {
|
||||||
return toAjax(consultationInfoService.insertConsultationInfo(consultationInfo));
|
return toAjax(consultationInfoService.insertConsultationInfo(consultationInfoDTO));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -74,37 +74,19 @@ public class ConsultationInfoController extends BaseController {
|
|||||||
return toAjax(consultationInfoService.updateConsultationInfo(consultationInfo));
|
return toAjax(consultationInfoService.updateConsultationInfo(consultationInfo));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询聊天记录
|
|
||||||
*/
|
|
||||||
@GetMapping("/getChatRecord")
|
|
||||||
public AjaxResult getChatRecord(ChatRecord chatRecord) {
|
|
||||||
return AjaxResult.success(chatRecordService.selectChatRecordList(chatRecord));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改已读状态
|
* 问诊资料上传接口
|
||||||
*/
|
*/
|
||||||
@Log(title = "图文咨询-聊天记录", businessType = BusinessType.UPDATE)
|
@PostMapping("/uploadConsultationFile")
|
||||||
@PutMapping(value = "updateReadStatus")
|
public AjaxResult uploadConsultationFile(@RequestParam("file") MultipartFile multipartFile) throws Exception {
|
||||||
public AjaxResult updateReadStatus(@RequestBody ChatRecord chatRecord) {
|
if (Objects.isNull(multipartFile) || StringUtils.isBlank(multipartFile.getOriginalFilename())) {
|
||||||
return toAjax(chatRecordService.updateChatRecord(chatRecord));
|
return AjaxResult.error("当前文件不存在,无法上传!");
|
||||||
}
|
|
||||||
|
|
||||||
@ApiOperation(value = "发送即时消息", notes = "向接收方发送即时消息")
|
|
||||||
@PostMapping("/sendMessage")
|
|
||||||
@Transactional
|
|
||||||
public AjaxResult sendMessage(@RequestBody ChatRecord chatRecord) {
|
|
||||||
if (chatRecordService.insertChatRecord(chatRecord) > 0) {
|
|
||||||
// 判断接收人是否在线
|
|
||||||
if (WebSocketUtils.clients.get(chatRecord.getRecipientId().toString()) == null) {
|
|
||||||
return AjaxResult.success();
|
|
||||||
} else {
|
|
||||||
return chatRecordService.sendMessage(chatRecord) ? AjaxResult.success() : AjaxResult.error();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
return AjaxResult.success();
|
|
||||||
}
|
}
|
||||||
|
if (multipartFile.getOriginalFilename().contains(Constants.EMPTY)) {
|
||||||
|
return AjaxResult.error("当前文件名含有空格,请先去除空格在上传!");
|
||||||
|
}
|
||||||
|
return consultationInfoService.uploadConsultationFile(multipartFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -0,0 +1,73 @@
|
|||||||
|
package com.xinelu.applet.dto.chatrecord;
|
||||||
|
|
||||||
|
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 java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 图文咨询-聊天记录对象 chat_record
|
||||||
|
*
|
||||||
|
* @author xinelu
|
||||||
|
* @date 2023-09-25
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class ChatRecordDTO extends BaseEntity implements Serializable {
|
||||||
|
|
||||||
|
|
||||||
|
private static final long serialVersionUID = -3911806583514536587L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 聊天记录业务主键(问诊表id)
|
||||||
|
*/
|
||||||
|
|
||||||
|
@NotNull(message = "聊天记录业务主键不能为空", groups = {Insert.class})
|
||||||
|
private Long consultationId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发送人
|
||||||
|
*/
|
||||||
|
@NotNull(message = "发送人信息不能为空", groups = {Insert.class})
|
||||||
|
private Long senderId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发送人姓名
|
||||||
|
*/
|
||||||
|
private String senderName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发送时间,时间格式:yyyy-MM-dd HH:mm:ss
|
||||||
|
*/
|
||||||
|
private Date sendTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 接收人
|
||||||
|
*/
|
||||||
|
@NotNull(message = "接收人信息不能为空", groups = {Insert.class})
|
||||||
|
private Long recipientId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 接收人姓名
|
||||||
|
*/
|
||||||
|
private String recipientName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 消息类型(0:其他 1:文字,2:图片 3:表情 4:视频 5:文件 6:链接)
|
||||||
|
*/
|
||||||
|
@NotNull(message = "消息类型不能为空", groups = {Insert.class})
|
||||||
|
private String messageType;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 消息内容,图片内容时内容为:图片路径
|
||||||
|
*/
|
||||||
|
@NotNull(message = "消息内容不能为空", groups = {Insert.class})
|
||||||
|
@Length(max = 400, message = "消息内容不能超过18位", groups = {Insert.class, Update.class})
|
||||||
|
private String content;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,136 @@
|
|||||||
|
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 java.io.Serializable;
|
||||||
|
import java.time.LocalTime;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 在线问诊-问诊信息(图文和视频问诊基本信息)对象 consultation_info
|
||||||
|
*
|
||||||
|
* @author xinelu
|
||||||
|
* @date 2023-09-25
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class ConsultationInfoDTO extends BaseEntity implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 84160236235012933L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 患者id
|
||||||
|
*/
|
||||||
|
@NotNull(message = "患者信息不能为空", groups = {Insert.class})
|
||||||
|
private Long patientId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 患者名称
|
||||||
|
*/
|
||||||
|
private String patientName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 患者身份证号
|
||||||
|
*/
|
||||||
|
@NotNull(message = "患者身份证号不能为空", groups = {Insert.class, Update.class})
|
||||||
|
@Length(max = 18, message = "身份证号不能超过18位", groups = {Insert.class, Update.class})
|
||||||
|
private String cardNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 患者联系方式
|
||||||
|
*/
|
||||||
|
@NotNull(message = "患者联系方式不能为空", groups = {Insert.class, Update.class})
|
||||||
|
@Length(max = 11, message = "联系方式不能超过11位", groups = {Insert.class, Update.class})
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 现住址所在地区
|
||||||
|
*/
|
||||||
|
@NotNull(message = "患者信息不能为空", groups = {Insert.class, Update.class})
|
||||||
|
@Length(max = 100, message = "现住址所在地区不能超过100位", groups = {Insert.class, Update.class})
|
||||||
|
private String address;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 医生id(签约医生/专家)
|
||||||
|
*/
|
||||||
|
@NotNull(message = "医生信息不能为空", groups = {Insert.class, Update.class})
|
||||||
|
private String doctorId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 医生名称
|
||||||
|
*/
|
||||||
|
private String doctorName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 问诊类型,图文问诊:IMAGE_TEXT_CONSULTATION,视频问诊:VIDEO_CONSULTATION
|
||||||
|
*/
|
||||||
|
@NotNull(message = "问诊类型不能为空", groups = {Insert.class, Update.class})
|
||||||
|
private String consultationType;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预约日期(视频问诊预约),时间格式:yyyy-MM-dd
|
||||||
|
*/
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
private Date appointmentDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预约开始时间点(视频问诊预约),时间格式:HH:mm
|
||||||
|
*/
|
||||||
|
@JsonFormat(pattern = "HH:mm")
|
||||||
|
private LocalTime appointmentStartTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预约结束时间点(视频问诊预约),时间格式:HH:mm
|
||||||
|
*/
|
||||||
|
@JsonFormat(pattern = "HH:mm")
|
||||||
|
private LocalTime appointmentEndTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 视频问诊地址
|
||||||
|
*/
|
||||||
|
private String videoUrl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 问题简述
|
||||||
|
*/
|
||||||
|
@NotNull(message = "问题简述不能为空", groups = {Insert.class, Update.class})
|
||||||
|
@Length(max = 5, message = "问题简述不能超过5位", groups = {Insert.class, Update.class})
|
||||||
|
private String problemDescription;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 患者个体情况说明
|
||||||
|
*/
|
||||||
|
@NotNull(message = "患者个体情况说明不能为空", groups = {Insert.class, Update.class})
|
||||||
|
@Length(max = 100, message = "患者个体情况说明不能超过100位", groups = {Insert.class, Update.class})
|
||||||
|
private String situationDescription;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 问题描述
|
||||||
|
*/
|
||||||
|
@NotNull(message = "问题描述不能为空", groups = {Insert.class, Update.class})
|
||||||
|
@Length(max = 500, message = "问题描述不能超过500位", groups = {Insert.class, Update.class})
|
||||||
|
private String problemStatement;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 病历
|
||||||
|
*/
|
||||||
|
@NotNull(message = "病历不能为空", groups = {Insert.class, Update.class})
|
||||||
|
@Length(max = 100, message = "病历不能超过100位", groups = {Insert.class, Update.class})
|
||||||
|
private String medicalRecord;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 问诊资料文件
|
||||||
|
*/
|
||||||
|
private List<String> fileUrls;
|
||||||
|
}
|
||||||
@ -1,4 +1,4 @@
|
|||||||
package com.xinelu.manage.mapper.chatRecord;
|
package com.xinelu.applet.mapper.chatrecord;
|
||||||
|
|
||||||
import com.xinelu.manage.domain.chatRecord.ChatRecord;
|
import com.xinelu.manage.domain.chatRecord.ChatRecord;
|
||||||
|
|
||||||
@ -1,7 +1,9 @@
|
|||||||
package com.xinelu.manage.mapper.consultationInfo;
|
package com.xinelu.applet.mapper.consultationInfo;
|
||||||
|
|
||||||
|
import com.xinelu.applet.dto.consultationInfo.ConsultationInfoDTO;
|
||||||
import com.xinelu.manage.domain.consultationInfo.ConsultationInfo;
|
import com.xinelu.manage.domain.consultationInfo.ConsultationInfo;
|
||||||
import com.xinelu.manage.vo.consultationInfo.ConsultationInfoVO;
|
import com.xinelu.manage.vo.consultationInfo.ConsultationInfoVO;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -19,15 +21,23 @@ public interface ConsultationInfoMapper {
|
|||||||
* @param id 在线问诊-问诊信息(图文和视频问诊基本信息)主键
|
* @param id 在线问诊-问诊信息(图文和视频问诊基本信息)主键
|
||||||
* @return 在线问诊-问诊信息(图文和视频问诊基本信息)
|
* @return 在线问诊-问诊信息(图文和视频问诊基本信息)
|
||||||
*/
|
*/
|
||||||
public ConsultationInfo selectConsultationInfoById(Long id);
|
public ConsultationInfoDTO selectConsultationInfoById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取问诊信息绑定文件路径
|
||||||
|
*
|
||||||
|
* @param id 在线问诊-问诊信息(图文和视频问诊基本信息)主键
|
||||||
|
* @return 文件路径
|
||||||
|
*/
|
||||||
|
public List<String> getConsultationFiles(Long id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询在线问诊-问诊信息(图文和视频问诊基本信息)列表
|
* 查询在线问诊-问诊信息(图文和视频问诊基本信息)列表
|
||||||
*
|
*
|
||||||
* @param consultationInfo 在线问诊-问诊信息(图文和视频问诊基本信息)
|
* @param consultationInfoDTO 在线问诊-问诊信息(图文和视频问诊基本信息)
|
||||||
* @return 在线问诊-问诊信息(图文和视频问诊基本信息)集合
|
* @return 在线问诊-问诊信息(图文和视频问诊基本信息)集合
|
||||||
*/
|
*/
|
||||||
public List<ConsultationInfoVO> selectConsultationInfoList(ConsultationInfo consultationInfo);
|
public List<ConsultationInfoVO> selectConsultationInfoList(ConsultationInfoDTO consultationInfoDTO);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增在线问诊-问诊信息(图文和视频问诊基本信息)
|
* 新增在线问诊-问诊信息(图文和视频问诊基本信息)
|
||||||
@ -37,6 +47,14 @@ public interface ConsultationInfoMapper {
|
|||||||
*/
|
*/
|
||||||
public int insertConsultationInfo(ConsultationInfo consultationInfo);
|
public int insertConsultationInfo(ConsultationInfo consultationInfo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增问诊信息附件表
|
||||||
|
*
|
||||||
|
* @param consultationId ,fileUrls
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertConsultationFile(@Param("consultationId") Long consultationId, @Param("fileUrls") List<String> fileUrls);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改在线问诊-问诊信息(图文和视频问诊基本信息)
|
* 修改在线问诊-问诊信息(图文和视频问诊基本信息)
|
||||||
*
|
*
|
||||||
@ -12,6 +12,15 @@ import com.xinelu.common.core.domain.AjaxResult;
|
|||||||
*/
|
*/
|
||||||
public interface AppletLoginService {
|
public interface AppletLoginService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据登录凭证获取用户的登录信息
|
||||||
|
*
|
||||||
|
* @param loginCode 登录凭证
|
||||||
|
* @param phoneCode 获取手机号登录凭证
|
||||||
|
* @return 微信用户登录信息
|
||||||
|
*/
|
||||||
|
AjaxResult appletLogin(String loginCode, String phoneCode);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据用户的patientId查询用户是否注册
|
* 根据用户的patientId查询用户是否注册
|
||||||
*
|
*
|
||||||
|
|||||||
@ -6,13 +6,19 @@ import com.xinelu.applet.dto.appletlogin.AppointmentInfoDTO;
|
|||||||
import com.xinelu.applet.dto.appletlogin.StationItemInfoDTO;
|
import com.xinelu.applet.dto.appletlogin.StationItemInfoDTO;
|
||||||
import com.xinelu.applet.mapper.appletlogin.AppletLoginMapper;
|
import com.xinelu.applet.mapper.appletlogin.AppletLoginMapper;
|
||||||
import com.xinelu.applet.service.appletlogin.AppletLoginService;
|
import com.xinelu.applet.service.appletlogin.AppletLoginService;
|
||||||
|
import com.xinelu.applet.utils.AppletAccessTokenUtil;
|
||||||
import com.xinelu.applet.vo.appletlogin.NurserStationItemConsumableVO;
|
import com.xinelu.applet.vo.appletlogin.NurserStationItemConsumableVO;
|
||||||
import com.xinelu.applet.vo.appletlogin.NurserStationItemInfoVO;
|
import com.xinelu.applet.vo.appletlogin.NurserStationItemInfoVO;
|
||||||
|
import com.xinelu.applet.vo.appletlogin.PatientAndPersonFlagVO;
|
||||||
import com.xinelu.applet.vo.nearbynursingstation.PoserInfoHomeVO;
|
import com.xinelu.applet.vo.nearbynursingstation.PoserInfoHomeVO;
|
||||||
|
import com.xinelu.common.config.AppletChatConfig;
|
||||||
import com.xinelu.common.constant.Constants;
|
import com.xinelu.common.constant.Constants;
|
||||||
import com.xinelu.common.core.domain.AjaxResult;
|
import com.xinelu.common.core.domain.AjaxResult;
|
||||||
|
import com.xinelu.common.entity.AppletLoginVO;
|
||||||
|
import com.xinelu.common.entity.AppletPhoneVO;
|
||||||
import com.xinelu.common.enums.*;
|
import com.xinelu.common.enums.*;
|
||||||
import com.xinelu.common.exception.ServiceException;
|
import com.xinelu.common.exception.ServiceException;
|
||||||
|
import com.xinelu.common.utils.AppletChatUtil;
|
||||||
import com.xinelu.common.utils.DateUtils;
|
import com.xinelu.common.utils.DateUtils;
|
||||||
import com.xinelu.common.utils.StringUtils;
|
import com.xinelu.common.utils.StringUtils;
|
||||||
import com.xinelu.common.utils.bean.BeanUtils;
|
import com.xinelu.common.utils.bean.BeanUtils;
|
||||||
@ -28,7 +34,6 @@ import com.xinelu.manage.vo.patientinfo.PatientInfoVO;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.apache.commons.lang3.BooleanUtils;
|
import org.apache.commons.lang3.BooleanUtils;
|
||||||
|
|
||||||
import org.springframework.data.redis.core.RedisTemplate;
|
import org.springframework.data.redis.core.RedisTemplate;
|
||||||
import org.springframework.data.redis.support.atomic.RedisAtomicLong;
|
import org.springframework.data.redis.support.atomic.RedisAtomicLong;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@ -55,19 +60,34 @@ import java.util.stream.Collectors;
|
|||||||
@Slf4j
|
@Slf4j
|
||||||
public class AppletLoginServiceImpl implements AppletLoginService {
|
public class AppletLoginServiceImpl implements AppletLoginService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private RedisTemplate<String, Object> redisTemplate;
|
||||||
|
@Resource
|
||||||
|
private AppletChatConfig appletChatConfig;
|
||||||
@Resource
|
@Resource
|
||||||
private AppletLoginMapper appletLoginMapper;
|
private AppletLoginMapper appletLoginMapper;
|
||||||
@Resource
|
@Resource
|
||||||
private PatientInfoMapper patientInfoMapper;
|
private PatientInfoMapper patientInfoMapper;
|
||||||
@Resource
|
@Resource
|
||||||
private RedisTemplate<String, Object> redisTemplate;
|
|
||||||
@Resource
|
|
||||||
private AppointmentOrderMapper appointmentOrderMapper;
|
private AppointmentOrderMapper appointmentOrderMapper;
|
||||||
@Resource
|
@Resource
|
||||||
private AppointmentOrderDetailsMapper appointmentOrderDetailsMapper;
|
private AppointmentOrderDetailsMapper appointmentOrderDetailsMapper;
|
||||||
@Resource
|
@Resource
|
||||||
|
private AppletAccessTokenUtil appletAccessTokenUtil;
|
||||||
|
@Resource
|
||||||
private AppointmentOrderProcessRecordMapper appointmentOrderProcessRecordMapper;
|
private AppointmentOrderProcessRecordMapper appointmentOrderProcessRecordMapper;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 返回成功状态码
|
||||||
|
*/
|
||||||
|
private static final int SUCCESS_CODE = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 返回成功状态码
|
||||||
|
*/
|
||||||
|
private static final String OK = "ok";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 提前预约时间半天标识
|
* 提前预约时间半天标识
|
||||||
*/
|
*/
|
||||||
@ -78,6 +98,93 @@ public class AppletLoginServiceImpl implements AppletLoginService {
|
|||||||
*/
|
*/
|
||||||
private static final String ONE_DAY = "ONE_DAY";
|
private static final String ONE_DAY = "ONE_DAY";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取微信小程序access_token错误码
|
||||||
|
*/
|
||||||
|
private static final int ERROR_ACCESS_CODE = 40001;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据登录凭证获取用户的登录信息
|
||||||
|
*
|
||||||
|
* @param loginCode 登录凭证
|
||||||
|
* @param phoneCode 获取手机号登录凭证
|
||||||
|
* @return 微信用户登录信息
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public AjaxResult appletLogin(String loginCode, String phoneCode) {
|
||||||
|
//根据code获取用户的微信unionId以及openId等信息
|
||||||
|
AppletLoginVO appletLoginInfo = AppletChatUtil.getAppletLoginInfo(appletChatConfig.getAppletId(), appletChatConfig.getSecret(), loginCode, appletChatConfig.getGrantType());
|
||||||
|
if (Objects.isNull(appletLoginInfo)) {
|
||||||
|
return AjaxResult.error("获取微信小程序用户信息失败");
|
||||||
|
}
|
||||||
|
if (Objects.nonNull(appletLoginInfo.getErrcode()) && appletLoginInfo.getErrcode() != SUCCESS_CODE) {
|
||||||
|
return AjaxResult.error("获取微信小程序用户信息失败,失败信息为:" + appletLoginInfo.getErrmsg());
|
||||||
|
}
|
||||||
|
//获取微信accessToken
|
||||||
|
String accessToken;
|
||||||
|
String accessTokenKey = Constants.NURSE_STATION_APPLET_ACCESS_TOKEN + "accessToken";
|
||||||
|
//从Redis中取出accessToken
|
||||||
|
Object object = redisTemplate.opsForValue().get(accessTokenKey);
|
||||||
|
if (Objects.isNull(object)) {
|
||||||
|
//没有,获取accessToken
|
||||||
|
accessToken = appletAccessTokenUtil.getAppletAccessToken();
|
||||||
|
} else {
|
||||||
|
accessToken = (String) object;
|
||||||
|
}
|
||||||
|
//获取用户手机号
|
||||||
|
AppletPhoneVO appletPhoneInfo = AppletChatUtil.getAppletPhoneInfo(phoneCode, accessToken);
|
||||||
|
if (Objects.isNull(appletPhoneInfo)) {
|
||||||
|
return AjaxResult.error("获取用户手机号失败");
|
||||||
|
}
|
||||||
|
if (Objects.nonNull(appletPhoneInfo.getErrcode()) && appletPhoneInfo.getErrcode() == ERROR_ACCESS_CODE) {
|
||||||
|
//当前Redis缓存中的access_token无效直接删除
|
||||||
|
if (Objects.nonNull(object)) {
|
||||||
|
redisTemplate.delete(accessTokenKey);
|
||||||
|
//删除之后重新获取获取accessToken
|
||||||
|
accessToken = appletAccessTokenUtil.getAppletAccessToken();
|
||||||
|
appletPhoneInfo = AppletChatUtil.getAppletPhoneInfo(phoneCode, accessToken);
|
||||||
|
if (Objects.isNull(appletPhoneInfo)) {
|
||||||
|
return AjaxResult.error("获取用户手机号失败");
|
||||||
|
}
|
||||||
|
if (Objects.nonNull(appletPhoneInfo.getErrcode()) && appletPhoneInfo.getErrcode() == ERROR_ACCESS_CODE) {
|
||||||
|
return AjaxResult.error("登录失败!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotBlank(appletPhoneInfo.getErrmsg()) && !OK.equals(appletPhoneInfo.getErrmsg())) {
|
||||||
|
return AjaxResult.error("获取用户手机号失败,失败信息为:" + appletPhoneInfo.getErrmsg());
|
||||||
|
}
|
||||||
|
//根据手机号和openid判断当前用户是否存在
|
||||||
|
String phone = StringUtils.isBlank(appletPhoneInfo.getPhoneInfo().getPhoneNumber()) ? "" : appletPhoneInfo.getPhoneInfo().getPhoneNumber();
|
||||||
|
String openId = StringUtils.isBlank(appletLoginInfo.getOpenid()) ? "" : appletLoginInfo.getOpenid();
|
||||||
|
PatientInfoVO patientInfoByPhone = appletLoginMapper.getPatientInfoByPhone(phone, openId);
|
||||||
|
PatientAndPersonFlagVO appletParent = new PatientAndPersonFlagVO();
|
||||||
|
//判断首页是否显示“护理员小程序”跳转的链接,非护理员用户不显示跳转链接
|
||||||
|
if (Objects.nonNull(patientInfoByPhone) && Objects.nonNull(patientInfoByPhone.getPersonCount()) && patientInfoByPhone.getPersonCount() > 0) {
|
||||||
|
appletParent.setPersonLoginFlag(Boolean.TRUE);
|
||||||
|
} else {
|
||||||
|
appletParent.setPersonLoginFlag(Boolean.FALSE);
|
||||||
|
}
|
||||||
|
//会员信息为空新增个人信息
|
||||||
|
if (Objects.isNull(patientInfoByPhone)) {
|
||||||
|
appletParent.setOpenid(openId);
|
||||||
|
appletParent.setPhone(phone);
|
||||||
|
appletParent.setCreateTime(LocalDateTime.now());
|
||||||
|
appletParent.setAreaCode("");
|
||||||
|
patientInfoMapper.insertAppletLoginPatientInfo(appletParent);
|
||||||
|
appletParent.setId(appletParent.getId());
|
||||||
|
return AjaxResult.success(appletParent);
|
||||||
|
}
|
||||||
|
//更新用户的openid等微信标识信息
|
||||||
|
appletParent.setId(patientInfoByPhone.getId());
|
||||||
|
appletParent.setOpenid(openId);
|
||||||
|
appletParent.setPhone(StringUtils.isBlank(patientInfoByPhone.getPhone()) ? "" : patientInfoByPhone.getPhone());
|
||||||
|
appletParent.setUpdateTime(LocalDateTime.now());
|
||||||
|
patientInfoMapper.updatePatientInfo(appletParent);
|
||||||
|
return AjaxResult.success(appletParent);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据微信用户的patientId查询用户是否注册
|
* 根据微信用户的patientId查询用户是否注册
|
||||||
*
|
*
|
||||||
@ -348,5 +455,4 @@ public class AppletLoginServiceImpl implements AppletLoginService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,7 +1,12 @@
|
|||||||
package com.xinelu.manage.service.chatRecord;
|
package com.xinelu.applet.service.chatRecord;
|
||||||
|
|
||||||
|
import com.xinelu.applet.dto.chatrecord.ChatRecordDTO;
|
||||||
|
import com.xinelu.common.core.domain.AjaxResult;
|
||||||
|
import com.xinelu.common.exception.file.InvalidExtensionException;
|
||||||
import com.xinelu.manage.domain.chatRecord.ChatRecord;
|
import com.xinelu.manage.domain.chatRecord.ChatRecord;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
@ -31,12 +36,12 @@ public interface IChatRecordService {
|
|||||||
/**
|
/**
|
||||||
* 新增图文咨询-聊天记录
|
* 新增图文咨询-聊天记录
|
||||||
*
|
*
|
||||||
* @param chatRecord 图文咨询-聊天记录
|
* @param chatRecordDTO 图文咨询-聊天记录
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int insertChatRecord(ChatRecord chatRecord);
|
public int insertChatRecord(ChatRecordDTO chatRecordDTO);
|
||||||
|
|
||||||
Boolean sendMessage(ChatRecord chatRecord);
|
Boolean sendMessage(ChatRecordDTO chatRecordDTO);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改图文咨询-聊天记录
|
* 修改图文咨询-聊天记录
|
||||||
@ -61,4 +66,13 @@ public interface IChatRecordService {
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteChatRecordById(Long id);
|
public int deleteChatRecordById(Long id);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 问诊聊天-文件上传
|
||||||
|
*
|
||||||
|
* @param multipartFile,consultationId 文件,问诊id
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public AjaxResult uploadChatRecordFile(MultipartFile multipartFile, Long consultationId) throws IOException, InvalidExtensionException;
|
||||||
}
|
}
|
||||||
@ -1,16 +1,26 @@
|
|||||||
package com.xinelu.manage.service.chatRecord.impl;
|
package com.xinelu.applet.service.chatRecord.impl;
|
||||||
|
|
||||||
|
import com.xinelu.applet.dto.chatrecord.ChatRecordDTO;
|
||||||
|
import com.xinelu.applet.mapper.chatrecord.ChatRecordMapper;
|
||||||
|
import com.xinelu.applet.service.chatRecord.IChatRecordService;
|
||||||
|
import com.xinelu.common.config.XinELuConfig;
|
||||||
|
import com.xinelu.common.core.domain.AjaxResult;
|
||||||
import com.xinelu.common.core.dto.MessageTemplate;
|
import com.xinelu.common.core.dto.MessageTemplate;
|
||||||
import com.xinelu.common.enums.MessageContentType;
|
import com.xinelu.common.enums.MessageContentType;
|
||||||
|
import com.xinelu.common.exception.ServiceException;
|
||||||
|
import com.xinelu.common.exception.file.InvalidExtensionException;
|
||||||
import com.xinelu.common.socket.WebSocketUtils;
|
import com.xinelu.common.socket.WebSocketUtils;
|
||||||
import com.xinelu.common.utils.DateUtils;
|
import com.xinelu.common.utils.DateUtils;
|
||||||
|
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 com.xinelu.manage.domain.chatRecord.ChatRecord;
|
||||||
import com.xinelu.manage.mapper.chatRecord.ChatRecordMapper;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import com.xinelu.manage.service.chatRecord.IChatRecordService;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import java.io.IOException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -23,6 +33,8 @@ import java.util.List;
|
|||||||
public class ChatRecordServiceImpl implements IChatRecordService {
|
public class ChatRecordServiceImpl implements IChatRecordService {
|
||||||
@Resource
|
@Resource
|
||||||
private ChatRecordMapper chatRecordMapper;
|
private ChatRecordMapper chatRecordMapper;
|
||||||
|
@Resource
|
||||||
|
private XinELuConfig xinYiLuConfig;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询图文咨询-聊天记录
|
* 查询图文咨询-聊天记录
|
||||||
@ -53,13 +65,15 @@ public class ChatRecordServiceImpl implements IChatRecordService {
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int insertChatRecord(ChatRecord chatRecord) {
|
public int insertChatRecord(ChatRecordDTO chatRecord) {
|
||||||
chatRecord.setCreateTime(DateUtils.getNowDate());
|
chatRecord.setCreateTime(DateUtils.getNowDate());
|
||||||
return chatRecordMapper.insertChatRecord(chatRecord);
|
ChatRecord record = new ChatRecord();
|
||||||
|
BeanUtils.copyBeanProp(record, chatRecord);
|
||||||
|
return chatRecordMapper.insertChatRecord(record);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Boolean sendMessage(ChatRecord chatRecord) {
|
public Boolean sendMessage(ChatRecordDTO chatRecord) {
|
||||||
// 构建消息结构
|
// 构建消息结构
|
||||||
MessageTemplate msg = new MessageTemplate();
|
MessageTemplate msg = new MessageTemplate();
|
||||||
msg.setMessage(chatRecord.getContent());
|
msg.setMessage(chatRecord.getContent());
|
||||||
@ -105,4 +119,28 @@ public class ChatRecordServiceImpl implements IChatRecordService {
|
|||||||
public int deleteChatRecordById(Long id) {
|
public int deleteChatRecordById(Long id) {
|
||||||
return chatRecordMapper.deleteChatRecordById(id);
|
return chatRecordMapper.deleteChatRecordById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 聊天记录-文件上传
|
||||||
|
*
|
||||||
|
* @param multipartFile 文件
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public AjaxResult uploadChatRecordFile(MultipartFile multipartFile, Long consultationId) throws IOException, InvalidExtensionException {
|
||||||
|
//获取不同的文件路径
|
||||||
|
String uploadPathUrl = XinELuConfig.getProfile() + xinYiLuConfig.getChatRecordFileUrl() + "/" + consultationId;
|
||||||
|
if (StringUtils.isBlank(uploadPathUrl)) {
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
|
//上传
|
||||||
|
String pictureName = FileUploadUtils.uploadNurseStationPath(uploadPathUrl, multipartFile, MimeTypeUtils.DEFAULT_ALLOWED_EXTENSION);
|
||||||
|
if (StringUtils.isBlank(pictureName)) {
|
||||||
|
throw new ServiceException("文件上传失败,请联系管理员!");
|
||||||
|
}
|
||||||
|
AjaxResult ajax = AjaxResult.success("上传成功!");
|
||||||
|
ajax.put("fileUrl", pictureName);
|
||||||
|
return ajax;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -1,8 +1,13 @@
|
|||||||
package com.xinelu.manage.service.consultationInfo;
|
package com.xinelu.applet.service.consultationInfo;
|
||||||
|
|
||||||
|
import com.xinelu.applet.dto.consultationInfo.ConsultationInfoDTO;
|
||||||
|
import com.xinelu.common.core.domain.AjaxResult;
|
||||||
|
import com.xinelu.common.exception.file.InvalidExtensionException;
|
||||||
import com.xinelu.manage.domain.consultationInfo.ConsultationInfo;
|
import com.xinelu.manage.domain.consultationInfo.ConsultationInfo;
|
||||||
import com.xinelu.manage.vo.consultationInfo.ConsultationInfoVO;
|
import com.xinelu.manage.vo.consultationInfo.ConsultationInfoVO;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
@ -19,23 +24,23 @@ public interface IConsultationInfoService {
|
|||||||
* @param id 在线问诊-问诊信息(图文和视频问诊基本信息)主键
|
* @param id 在线问诊-问诊信息(图文和视频问诊基本信息)主键
|
||||||
* @return 在线问诊-问诊信息(图文和视频问诊基本信息)
|
* @return 在线问诊-问诊信息(图文和视频问诊基本信息)
|
||||||
*/
|
*/
|
||||||
public ConsultationInfo selectConsultationInfoById(Long id);
|
public ConsultationInfoDTO selectConsultationInfoById(Long id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询在线问诊-问诊信息(图文和视频问诊基本信息)列表
|
* 查询在线问诊-问诊信息(图文和视频问诊基本信息)列表
|
||||||
*
|
*
|
||||||
* @param consultationInfo 在线问诊-问诊信息(图文和视频问诊基本信息)
|
* @param consultationInfoDTO 在线问诊-问诊信息(图文和视频问诊基本信息)
|
||||||
* @return 在线问诊-问诊信息(图文和视频问诊基本信息)集合
|
* @return 在线问诊-问诊信息(图文和视频问诊基本信息)集合
|
||||||
*/
|
*/
|
||||||
public List<ConsultationInfoVO> selectConsultationInfoList(ConsultationInfo consultationInfo);
|
public List<ConsultationInfoVO> selectConsultationInfoList(ConsultationInfoDTO consultationInfoDTO);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增在线问诊-问诊信息(图文和视频问诊基本信息)
|
* 新增在线问诊-问诊信息(图文和视频问诊基本信息)
|
||||||
*
|
*
|
||||||
* @param consultationInfo 在线问诊-问诊信息(图文和视频问诊基本信息)
|
* @param consultationInfoDTO 在线问诊-问诊信息(图文和视频问诊基本信息)
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int insertConsultationInfo(ConsultationInfo consultationInfo);
|
public int insertConsultationInfo(ConsultationInfoDTO consultationInfoDTO);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改在线问诊-问诊信息(图文和视频问诊基本信息)
|
* 修改在线问诊-问诊信息(图文和视频问诊基本信息)
|
||||||
@ -60,4 +65,13 @@ public interface IConsultationInfoService {
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteConsultationInfoById(Long id);
|
public int deleteConsultationInfoById(Long id);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 图文和视频问诊基本信息-文件上传
|
||||||
|
*
|
||||||
|
* @param multipartFile 文件
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public AjaxResult uploadConsultationFile(MultipartFile multipartFile) throws IOException, InvalidExtensionException;
|
||||||
}
|
}
|
||||||
@ -0,0 +1,141 @@
|
|||||||
|
package com.xinelu.applet.service.consultationInfo.impl;
|
||||||
|
|
||||||
|
import com.xinelu.applet.dto.consultationInfo.ConsultationInfoDTO;
|
||||||
|
import com.xinelu.applet.mapper.consultationInfo.ConsultationInfoMapper;
|
||||||
|
import com.xinelu.applet.service.consultationInfo.IConsultationInfoService;
|
||||||
|
import com.xinelu.common.config.XinELuConfig;
|
||||||
|
import com.xinelu.common.core.domain.AjaxResult;
|
||||||
|
import com.xinelu.common.exception.ServiceException;
|
||||||
|
import com.xinelu.common.exception.file.InvalidExtensionException;
|
||||||
|
import com.xinelu.common.utils.DateUtils;
|
||||||
|
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.consultationInfo.ConsultationInfo;
|
||||||
|
import com.xinelu.manage.vo.consultationInfo.ConsultationInfoVO;
|
||||||
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 在线问诊-问诊信息(图文和视频问诊基本信息)Service业务层处理
|
||||||
|
*
|
||||||
|
* @author xinelu
|
||||||
|
* @date 2023-09-25
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class ConsultationInfoServiceImpl implements IConsultationInfoService {
|
||||||
|
@Resource
|
||||||
|
private ConsultationInfoMapper consultationInfoMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private XinELuConfig xinYiLuConfig;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询在线问诊-问诊信息(图文和视频问诊基本信息)
|
||||||
|
*
|
||||||
|
* @param id 在线问诊-问诊信息(图文和视频问诊基本信息)主键
|
||||||
|
* @return 在线问诊-问诊信息(图文和视频问诊基本信息)
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public ConsultationInfoDTO selectConsultationInfoById(Long id) {
|
||||||
|
ConsultationInfoDTO consultationInfoDTO = consultationInfoMapper.selectConsultationInfoById(id);
|
||||||
|
consultationInfoDTO.setFileUrls(consultationInfoMapper.getConsultationFiles(id));
|
||||||
|
return consultationInfoDTO;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询在线问诊-问诊信息(图文和视频问诊基本信息)列表
|
||||||
|
*
|
||||||
|
* @param consultationInfoDTO 在线问诊-问诊信息(图文和视频问诊基本信息)
|
||||||
|
* @return 在线问诊-问诊信息(图文和视频问诊基本信息)
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<ConsultationInfoVO> selectConsultationInfoList(ConsultationInfoDTO consultationInfoDTO) {
|
||||||
|
return consultationInfoMapper.selectConsultationInfoList(consultationInfoDTO);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增在线问诊-问诊信息(图文和视频问诊基本信息)
|
||||||
|
*
|
||||||
|
* @param consultationInfoDTO 在线问诊-问诊信息(图文和视频问诊基本信息)
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertConsultationInfo(ConsultationInfoDTO consultationInfoDTO) {
|
||||||
|
consultationInfoDTO.setCreateTime(DateUtils.getNowDate());
|
||||||
|
ConsultationInfo consultationInfo = new ConsultationInfo();
|
||||||
|
BeanUtils.copyBeanProp(consultationInfo, consultationInfoDTO);
|
||||||
|
int count = consultationInfoMapper.insertConsultationInfo(consultationInfo);
|
||||||
|
if (count > 0) {
|
||||||
|
if (CollectionUtils.isNotEmpty(consultationInfoDTO.getFileUrls())) {
|
||||||
|
consultationInfoMapper.insertConsultationFile(consultationInfo.getId(), consultationInfoDTO.getFileUrls());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return count;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改在线问诊-问诊信息(图文和视频问诊基本信息)
|
||||||
|
*
|
||||||
|
* @param consultationInfo 在线问诊-问诊信息(图文和视频问诊基本信息)
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateConsultationInfo(ConsultationInfo consultationInfo) {
|
||||||
|
consultationInfo.setUpdateTime(DateUtils.getNowDate());
|
||||||
|
return consultationInfoMapper.updateConsultationInfo(consultationInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除在线问诊-问诊信息(图文和视频问诊基本信息)
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的在线问诊-问诊信息(图文和视频问诊基本信息)主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteConsultationInfoByIds(Long[] ids) {
|
||||||
|
return consultationInfoMapper.deleteConsultationInfoByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除在线问诊-问诊信息(图文和视频问诊基本信息)信息
|
||||||
|
*
|
||||||
|
* @param id 在线问诊-问诊信息(图文和视频问诊基本信息)主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteConsultationInfoById(Long id) {
|
||||||
|
return consultationInfoMapper.deleteConsultationInfoById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 图文和视频问诊基本信息-文件上传
|
||||||
|
*
|
||||||
|
* @param multipartFile 文件
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public AjaxResult uploadConsultationFile(MultipartFile multipartFile) throws IOException, InvalidExtensionException {
|
||||||
|
//获取不同的文件路径
|
||||||
|
String uploadPathUrl = XinELuConfig.getProfile() + xinYiLuConfig.getConsultationFileUrl();
|
||||||
|
if (StringUtils.isBlank(uploadPathUrl)) {
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
|
//上传
|
||||||
|
String pictureName = FileUploadUtils.uploadNurseStationPath(uploadPathUrl, multipartFile, MimeTypeUtils.DEFAULT_ALLOWED_EXTENSION);
|
||||||
|
if (StringUtils.isBlank(pictureName)) {
|
||||||
|
throw new ServiceException("文件上传失败,请联系管理员!");
|
||||||
|
}
|
||||||
|
AjaxResult ajax = AjaxResult.success("上传成功!");
|
||||||
|
ajax.put("fileUrl", pictureName);
|
||||||
|
return ajax;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -2,7 +2,7 @@
|
|||||||
<!DOCTYPE mapper
|
<!DOCTYPE mapper
|
||||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.xinelu.manage.mapper.chatRecord.ChatRecordMapper">
|
<mapper namespace="com.xinelu.applet.mapper.chatrecord.ChatRecordMapper">
|
||||||
|
|
||||||
<resultMap type="ChatRecord" id="ChatRecordResult">
|
<resultMap type="ChatRecord" id="ChatRecordResult">
|
||||||
<result property="id" column="id"/>
|
<result property="id" column="id"/>
|
||||||
@ -2,7 +2,7 @@
|
|||||||
<!DOCTYPE mapper
|
<!DOCTYPE mapper
|
||||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.xinelu.manage.mapper.consultationInfo.ConsultationInfoMapper">
|
<mapper namespace="com.xinelu.applet.mapper.consultationInfo.ConsultationInfoMapper">
|
||||||
|
|
||||||
<resultMap type="ConsultationInfo" id="ConsultationInfoResult">
|
<resultMap type="ConsultationInfo" id="ConsultationInfoResult">
|
||||||
<result property="id" column="id"/>
|
<result property="id" column="id"/>
|
||||||
@ -57,7 +57,7 @@
|
|||||||
from consultation_info
|
from consultation_info
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectConsultationInfoList" parameterType="ConsultationInfo" resultType="com.xinelu.manage.vo.consultationInfo.ConsultationInfoVO">
|
<select id="selectConsultationInfoList" parameterType="com.xinelu.applet.dto.consultationInfo.ConsultationInfoDTO" resultType="com.xinelu.manage.vo.consultationInfo.ConsultationInfoVO">
|
||||||
SELECT
|
SELECT
|
||||||
ci.id,
|
ci.id,
|
||||||
ci.patient_id,
|
ci.patient_id,
|
||||||
@ -71,7 +71,7 @@
|
|||||||
COUNT(cr.id) as messageCount
|
COUNT(cr.id) as messageCount
|
||||||
FROM
|
FROM
|
||||||
consultation_info ci
|
consultation_info ci
|
||||||
LEFT JOIN chat_record cr ON cr.consultation_id=ci.id AND read_status='0'
|
LEFT JOIN chat_record cr ON cr.consultation_id=ci.id AND read_status='0'
|
||||||
<if test="patientId != null ">
|
<if test="patientId != null ">
|
||||||
and sender_id= ci.doctor_id
|
and sender_id= ci.doctor_id
|
||||||
</if>
|
</if>
|
||||||
@ -111,12 +111,38 @@
|
|||||||
ORDER BY ci.create_time DESC
|
ORDER BY ci.create_time DESC
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectConsultationInfoById" parameterType="Long"
|
<select id="selectConsultationInfoById" parameterType="Long" resultType="com.xinelu.applet.dto.consultationInfo.ConsultationInfoDTO">
|
||||||
resultMap="ConsultationInfoResult">
|
select id,
|
||||||
<include refid="selectConsultationInfoVo"/>
|
patient_id,
|
||||||
|
patient_name,
|
||||||
|
card_no,
|
||||||
|
phone,
|
||||||
|
address,
|
||||||
|
doctor_id,
|
||||||
|
doctor_name,
|
||||||
|
consultation_type,
|
||||||
|
status,
|
||||||
|
appointment_date,
|
||||||
|
appointment_start_time,
|
||||||
|
appointment_end_time,
|
||||||
|
video_url,
|
||||||
|
problem_description,
|
||||||
|
situation_description,
|
||||||
|
problem_statement,
|
||||||
|
medical_record,
|
||||||
|
del_flag,
|
||||||
|
create_by,
|
||||||
|
create_time,
|
||||||
|
update_by,
|
||||||
|
update_time
|
||||||
|
from consultation_info
|
||||||
where id = #{id}
|
where id = #{id}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getConsultationFiles" parameterType="Long" resultType="string">
|
||||||
|
SELECT file_url FROM consultation_file WHERE del_flag='0' AND consultation_id=#{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
<insert id="insertConsultationInfo" parameterType="ConsultationInfo">
|
<insert id="insertConsultationInfo" parameterType="ConsultationInfo">
|
||||||
insert into consultation_info
|
insert into consultation_info
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
@ -217,6 +243,13 @@
|
|||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
|
<insert id="insertConsultationFile">
|
||||||
|
insert into consultation_file(consultation_id, file_url) values
|
||||||
|
<foreach item="item" index="index" collection="fileUrls" separator=",">
|
||||||
|
(#{consultationId},#{item.fileUrl})
|
||||||
|
</foreach>
|
||||||
|
</insert>
|
||||||
|
|
||||||
<update id="updateConsultationInfo" parameterType="ConsultationInfo">
|
<update id="updateConsultationInfo" parameterType="ConsultationInfo">
|
||||||
update consultation_info
|
update consultation_info
|
||||||
<trim prefix="SET" suffixOverrides=",">
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
@ -12,6 +12,7 @@ import lombok.NoArgsConstructor;
|
|||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -25,9 +26,9 @@ import java.util.Date;
|
|||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@ApiModel(value = "图文咨询-聊天记录对象", description = "chat_record")
|
@ApiModel(value = "图文咨询-聊天记录对象", description = "chat_record")
|
||||||
public class ChatRecord extends BaseEntity {
|
public class ChatRecord extends BaseEntity implements Serializable {
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 2101522181273918239L;
|
||||||
/**
|
/**
|
||||||
* 自增主键
|
* 自增主键
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -11,7 +11,8 @@ import lombok.EqualsAndHashCode;
|
|||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalTime;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -25,9 +26,9 @@ import java.util.Date;
|
|||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@ApiModel(value = "在线问诊-问诊信息(图文和视频问诊基本信息)对象", description = "consultation_info")
|
@ApiModel(value = "在线问诊-问诊信息(图文和视频问诊基本信息)对象", description = "consultation_info")
|
||||||
public class ConsultationInfo extends BaseEntity {
|
public class ConsultationInfo extends BaseEntity implements Serializable {
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
|
private static final long serialVersionUID = -8367271791868621123L;
|
||||||
/**
|
/**
|
||||||
* id
|
* id
|
||||||
*/
|
*/
|
||||||
@ -108,17 +109,15 @@ public class ConsultationInfo extends BaseEntity {
|
|||||||
* 预约开始时间点(视频问诊预约),时间格式:HH:mm
|
* 预约开始时间点(视频问诊预约),时间格式:HH:mm
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "预约开始时间点(视频问诊预约),时间格式:HH:mm")
|
@ApiModelProperty(value = "预约开始时间点(视频问诊预约),时间格式:HH:mm")
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
@JsonFormat(pattern = "HH:mm")
|
||||||
@Excel(name = "预约开始时间点(视频问诊预约),时间格式:HH:mm", width = 30, dateFormat = "yyyy-MM-dd")
|
private LocalTime appointmentStartTime;
|
||||||
private Date appointmentStartTime;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 预约结束时间点(视频问诊预约),时间格式:HH:mm
|
* 预约结束时间点(视频问诊预约),时间格式:HH:mm
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "预约结束时间点(视频问诊预约),时间格式:HH:mm")
|
@ApiModelProperty(value = "预约结束时间点(视频问诊预约),时间格式:HH:mm")
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
@JsonFormat(pattern = "HH:mm")
|
||||||
@Excel(name = "预约结束时间点(视频问诊预约),时间格式:HH:mm", width = 30, dateFormat = "yyyy-MM-dd")
|
private LocalTime appointmentEndTime;
|
||||||
private Date appointmentEndTime;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 视频问诊地址
|
* 视频问诊地址
|
||||||
|
|||||||
@ -1,92 +0,0 @@
|
|||||||
package com.xinelu.manage.service.consultationInfo.impl;
|
|
||||||
|
|
||||||
import com.xinelu.common.utils.DateUtils;
|
|
||||||
import com.xinelu.manage.domain.consultationInfo.ConsultationInfo;
|
|
||||||
import com.xinelu.manage.mapper.consultationInfo.ConsultationInfoMapper;
|
|
||||||
import com.xinelu.manage.service.consultationInfo.IConsultationInfoService;
|
|
||||||
import com.xinelu.manage.vo.consultationInfo.ConsultationInfoVO;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 在线问诊-问诊信息(图文和视频问诊基本信息)Service业务层处理
|
|
||||||
*
|
|
||||||
* @author xinelu
|
|
||||||
* @date 2023-09-25
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class ConsultationInfoServiceImpl implements IConsultationInfoService {
|
|
||||||
@Resource
|
|
||||||
private ConsultationInfoMapper consultationInfoMapper;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询在线问诊-问诊信息(图文和视频问诊基本信息)
|
|
||||||
*
|
|
||||||
* @param id 在线问诊-问诊信息(图文和视频问诊基本信息)主键
|
|
||||||
* @return 在线问诊-问诊信息(图文和视频问诊基本信息)
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public ConsultationInfo selectConsultationInfoById(Long id) {
|
|
||||||
return consultationInfoMapper.selectConsultationInfoById(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询在线问诊-问诊信息(图文和视频问诊基本信息)列表
|
|
||||||
*
|
|
||||||
* @param consultationInfo 在线问诊-问诊信息(图文和视频问诊基本信息)
|
|
||||||
* @return 在线问诊-问诊信息(图文和视频问诊基本信息)
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public List<ConsultationInfoVO> selectConsultationInfoList(ConsultationInfo consultationInfo) {
|
|
||||||
return consultationInfoMapper.selectConsultationInfoList(consultationInfo);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增在线问诊-问诊信息(图文和视频问诊基本信息)
|
|
||||||
*
|
|
||||||
* @param consultationInfo 在线问诊-问诊信息(图文和视频问诊基本信息)
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public int insertConsultationInfo(ConsultationInfo consultationInfo) {
|
|
||||||
consultationInfo.setCreateTime(DateUtils.getNowDate());
|
|
||||||
return consultationInfoMapper.insertConsultationInfo(consultationInfo);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改在线问诊-问诊信息(图文和视频问诊基本信息)
|
|
||||||
*
|
|
||||||
* @param consultationInfo 在线问诊-问诊信息(图文和视频问诊基本信息)
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public int updateConsultationInfo(ConsultationInfo consultationInfo) {
|
|
||||||
consultationInfo.setUpdateTime(DateUtils.getNowDate());
|
|
||||||
return consultationInfoMapper.updateConsultationInfo(consultationInfo);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除在线问诊-问诊信息(图文和视频问诊基本信息)
|
|
||||||
*
|
|
||||||
* @param ids 需要删除的在线问诊-问诊信息(图文和视频问诊基本信息)主键
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public int deleteConsultationInfoByIds(Long[] ids) {
|
|
||||||
return consultationInfoMapper.deleteConsultationInfoByIds(ids);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除在线问诊-问诊信息(图文和视频问诊基本信息)信息
|
|
||||||
*
|
|
||||||
* @param id 在线问诊-问诊信息(图文和视频问诊基本信息)主键
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public int deleteConsultationInfoById(Long id) {
|
|
||||||
return consultationInfoMapper.deleteConsultationInfoById(id);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Loading…
Reference in New Issue
Block a user