Merge remote-tracking branch 'origin/jihan_0920_护理服务、商城、积分兑换、在线问诊功能分支' into jihan_0920_护理服务、商城、积分兑换、在线问诊功能分支
This commit is contained in:
commit
bb69917dc6
@ -258,8 +258,8 @@ fd:
|
|||||||
trtc:
|
trtc:
|
||||||
sdkappid: 1600006944
|
sdkappid: 1600006944
|
||||||
sdksecretkey: 6ddbc3e7e4aa128b52898df27a35f8f3d5acdca6f34ffa17b87ebc33e83314f1
|
sdksecretkey: 6ddbc3e7e4aa128b52898df27a35f8f3d5acdca6f34ffa17b87ebc33e83314f1
|
||||||
secretid: AKIDjKo7GF2g9PQJ7KMBpGUTFrFZP7cw2upY
|
secretid: AKIDYxAAwVrPveKvQuO2zwojOxRpCTflkz9E
|
||||||
secretkey: c1HajkZCdrrhLsDRUL1XotpeUAkAOSM7
|
secretkey: 540sfPH5obKxVxwW4Xt8KTfmS4b2Nfu4
|
||||||
|
|
||||||
# 微信小程序参数配置信息
|
# 微信小程序参数配置信息
|
||||||
applet-chat-config:
|
applet-chat-config:
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
package com.xinelu.applet.controller.consultationInfo;
|
package com.xinelu.applet.controller.consultationInfo;
|
||||||
|
|
||||||
import com.xinelu.applet.dto.consultationInfo.ConsultationInfoDTO;
|
import com.xinelu.manage.dto.consultationInfo.ConsultationInfoDTO;
|
||||||
import com.xinelu.applet.service.consultationInfo.IConsultationInfoService;
|
import com.xinelu.manage.service.consultationInfo.IConsultationInfoService;
|
||||||
import com.xinelu.common.constant.Constants;
|
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;
|
||||||
|
|||||||
@ -51,7 +51,7 @@ public class NurseAppLoginController extends BaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询护理人列表信息(会员小程序和App共用)
|
* 查询护理人列表信息-护理服务查询个人信息使用(会员小程序和App共用)
|
||||||
*
|
*
|
||||||
* @param patientId 用户id
|
* @param patientId 用户id
|
||||||
* @return 护理人列表集合
|
* @return 护理人列表集合
|
||||||
|
|||||||
@ -1,11 +1,7 @@
|
|||||||
package com.xinelu.applet.controller.videoconsultation;
|
package com.xinelu.applet.controller.videoconsultation;
|
||||||
|
|
||||||
import com.xinelu.applet.dto.consultationInfo.ConsultationInfoDTO;
|
import com.xinelu.common.core.domain.AjaxResult;
|
||||||
import com.xinelu.applet.service.consultationInfo.IConsultationInfoService;
|
|
||||||
import com.xinelu.common.core.domain.R;
|
import com.xinelu.common.core.domain.R;
|
||||||
import com.xinelu.common.core.dto.MessageTemplate;
|
|
||||||
import com.xinelu.common.enums.MessageContentType;
|
|
||||||
import com.xinelu.common.socket.WebSocketUtils;
|
|
||||||
import com.xinelu.common.utils.tencentcloudapi.common.Credential;
|
import com.xinelu.common.utils.tencentcloudapi.common.Credential;
|
||||||
import com.xinelu.common.utils.tencentcloudapi.common.exception.TencentCloudSDKException;
|
import com.xinelu.common.utils.tencentcloudapi.common.exception.TencentCloudSDKException;
|
||||||
import com.xinelu.common.utils.tencentcloudapi.common.profile.ClientProfile;
|
import com.xinelu.common.utils.tencentcloudapi.common.profile.ClientProfile;
|
||||||
@ -14,10 +10,9 @@ import com.xinelu.common.utils.tencentcloudapi.trtc.v20190722.TLSSigAPIv2;
|
|||||||
import com.xinelu.common.utils.tencentcloudapi.trtc.v20190722.TrtcClient;
|
import com.xinelu.common.utils.tencentcloudapi.trtc.v20190722.TrtcClient;
|
||||||
import com.xinelu.common.utils.tencentcloudapi.trtc.v20190722.models.DissolveRoomRequest;
|
import com.xinelu.common.utils.tencentcloudapi.trtc.v20190722.models.DissolveRoomRequest;
|
||||||
import com.xinelu.common.utils.tencentcloudapi.trtc.v20190722.models.DissolveRoomResponse;
|
import com.xinelu.common.utils.tencentcloudapi.trtc.v20190722.models.DissolveRoomResponse;
|
||||||
|
import com.xinelu.manage.service.consultationInfo.IConsultationInfoService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import java.util.Date;
|
|
||||||
import java.util.Random;
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
@ -37,6 +32,8 @@ public class VideoConsultationController {
|
|||||||
|
|
||||||
@Value("${trtc.sdkappid}")
|
@Value("${trtc.sdkappid}")
|
||||||
private Long sdkappid;
|
private Long sdkappid;
|
||||||
|
@Value("${trtc.sdksecretkey}")
|
||||||
|
private String sdksecretkey;
|
||||||
@Value("${trtc.secretid}")
|
@Value("${trtc.secretid}")
|
||||||
private String secretid;
|
private String secretid;
|
||||||
@Value("${trtc.secretkey}")
|
@Value("${trtc.secretkey}")
|
||||||
@ -51,33 +48,15 @@ public class VideoConsultationController {
|
|||||||
@ApiOperation("获取userSig")
|
@ApiOperation("获取userSig")
|
||||||
@GetMapping("getUserSig/{userId}")
|
@GetMapping("getUserSig/{userId}")
|
||||||
public R<String> getUserSig(@PathVariable String userId) {
|
public R<String> getUserSig(@PathVariable String userId) {
|
||||||
TLSSigAPIv2 sigAPIv2 = new TLSSigAPIv2(sdkappid, secretkey);
|
TLSSigAPIv2 sigAPIv2 = new TLSSigAPIv2(sdkappid, sdksecretkey);
|
||||||
String userSig = sigAPIv2.genUserSig(userId, 36000);
|
String userSig = sigAPIv2.genUserSig(userId, 36000);
|
||||||
return R.ok(userSig);
|
return R.ok(userSig);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("开始视频")
|
@ApiOperation("开始视频--医生APP")
|
||||||
@GetMapping("start/{consultationInfoId}")
|
@GetMapping("start/{goodsOrderId}")
|
||||||
public R<String> start(@PathVariable Long consultationInfoId) {
|
public AjaxResult start(@PathVariable Long goodsOrderId) {
|
||||||
// 房间号
|
return consultationInfoService.startConsultation(goodsOrderId);
|
||||||
Random random = new Random();
|
|
||||||
int randomNumber = random.nextInt(900000) + 100000; // 限制范围为 100000-999999
|
|
||||||
String roomId = String.valueOf(randomNumber);
|
|
||||||
if (roomId.length() < 6) {
|
|
||||||
roomId = "0" + roomId; // 补零
|
|
||||||
}
|
|
||||||
MessageTemplate msg = new MessageTemplate();
|
|
||||||
// 根据图文咨询申请主键查询居民主键
|
|
||||||
ConsultationInfoDTO consultationInfoDTO = consultationInfoService.selectConsultationInfoById(consultationInfoId);
|
|
||||||
if (consultationInfoDTO == null) {
|
|
||||||
return R.fail("生成房间号失败");
|
|
||||||
}
|
|
||||||
msg.setMessage(roomId);
|
|
||||||
msg.setToKey(String.valueOf(consultationInfoDTO.getPatientId()));
|
|
||||||
msg.setMsgType(MessageContentType.CONSULTATION.name());
|
|
||||||
msg.setSendTime(new Date());
|
|
||||||
WebSocketUtils.sendMessage(String.valueOf(consultationInfoDTO.getPatientId()), msg);
|
|
||||||
return R.ok(roomId);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -95,4 +74,11 @@ public class VideoConsultationController {
|
|||||||
DissolveRoomResponse resp = client.DissolveRoom(req);
|
DissolveRoomResponse resp = client.DissolveRoom(req);
|
||||||
return R.ok(resp.getRequestId());
|
return R.ok(resp.getRequestId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation("小程序通过订单号查询房间号")
|
||||||
|
@GetMapping("getRoomId/{goodsOrderId}")
|
||||||
|
public AjaxResult getAppletRoomId(@PathVariable Long goodsOrderId) {
|
||||||
|
return consultationInfoService.getAppletRoomId(goodsOrderId);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -207,7 +207,6 @@ public class NurseAppLoginServiceImpl implements NurseAppLoginService {
|
|||||||
}
|
}
|
||||||
// 更新签约编号
|
// 更新签约编号
|
||||||
setSignInfo(patientDisease);
|
setSignInfo(patientDisease);
|
||||||
|
|
||||||
//查询所有商品订单
|
//查询所有商品订单
|
||||||
List<GoodsOrder> goodsOrders = nurseAppLoginMapper.selectGoodsOrderListByPatient(patientId);
|
List<GoodsOrder> goodsOrders = nurseAppLoginMapper.selectGoodsOrderListByPatient(patientId);
|
||||||
if (CollectionUtils.isEmpty(goodsOrders)) {
|
if (CollectionUtils.isEmpty(goodsOrders)) {
|
||||||
@ -217,11 +216,9 @@ public class NurseAppLoginServiceImpl implements NurseAppLoginService {
|
|||||||
long waitPayCount = goodsOrders.stream().filter(Objects::nonNull).filter(item -> StringUtils.isNotBlank(item.getOrderStatus())).filter(item -> GooodsOrderStatusEnum.WAIT_PAY.getInfo().equals(item.getOrderStatus())).count();
|
long waitPayCount = goodsOrders.stream().filter(Objects::nonNull).filter(item -> StringUtils.isNotBlank(item.getOrderStatus())).filter(item -> GooodsOrderStatusEnum.WAIT_PAY.getInfo().equals(item.getOrderStatus())).count();
|
||||||
long waitReceivedGoodsCount = goodsOrders.stream().filter(Objects::nonNull).filter(item -> StringUtils.isNotBlank(item.getOrderStatus())).filter(item -> GooodsOrderStatusEnum.WAIT_RECEIVED_GOODS.getInfo().equals(item.getOrderStatus())).count();
|
long waitReceivedGoodsCount = goodsOrders.stream().filter(Objects::nonNull).filter(item -> StringUtils.isNotBlank(item.getOrderStatus())).filter(item -> GooodsOrderStatusEnum.WAIT_RECEIVED_GOODS.getInfo().equals(item.getOrderStatus())).count();
|
||||||
long receivedGoodsCount = goodsOrders.stream().filter(Objects::nonNull).filter(item -> StringUtils.isNotBlank(item.getOrderStatus())).filter(item -> GooodsOrderStatusEnum.RECEIVED_GOODS.getInfo().equals(item.getOrderStatus())).count();
|
long receivedGoodsCount = goodsOrders.stream().filter(Objects::nonNull).filter(item -> StringUtils.isNotBlank(item.getOrderStatus())).filter(item -> GooodsOrderStatusEnum.RECEIVED_GOODS.getInfo().equals(item.getOrderStatus())).count();
|
||||||
long evaluatedCount = goodsOrders.stream().filter(Objects::nonNull).filter(item -> StringUtils.isNotBlank(item.getOrderStatus())).filter(item -> GooodsOrderStatusEnum.EVALUATED.getInfo().equals(item.getOrderStatus())).count();
|
|
||||||
patientDisease.setWaitPayCount(waitPayCount);
|
patientDisease.setWaitPayCount(waitPayCount);
|
||||||
patientDisease.setWaitReceivedGoodsCount(waitReceivedGoodsCount);
|
patientDisease.setWaitReceivedGoodsCount(waitReceivedGoodsCount);
|
||||||
patientDisease.setReceivedGoodsCount(receivedGoodsCount);
|
patientDisease.setReceivedGoodsCount(receivedGoodsCount);
|
||||||
patientDisease.setEvaluatedCount(evaluatedCount);
|
|
||||||
return AjaxResult.success(patientDisease);
|
return AjaxResult.success(patientDisease);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -205,4 +205,18 @@ public class NurseStationController extends BaseController {
|
|||||||
public AjaxResult nurseStationByUserId(NurseStationSysUserVO sysUser) {
|
public AjaxResult nurseStationByUserId(NurseStationSysUserVO sysUser) {
|
||||||
return nurseStationService.getNurseStationByUserId(sysUser);
|
return nurseStationService.getNurseStationByUserId(sysUser);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 护理站生成二维码
|
||||||
|
*
|
||||||
|
* @param nurseStationId 护理站id
|
||||||
|
* @return 邀请码图片地址
|
||||||
|
*/
|
||||||
|
@PostMapping("/nurseStationCode")
|
||||||
|
public AjaxResult nurseStationCode(Long nurseStationId) {
|
||||||
|
if (Objects.isNull(nurseStationId)) {
|
||||||
|
return AjaxResult.error("护理站id不能为空!");
|
||||||
|
}
|
||||||
|
return nurseStationService.nurseStationCode(nurseStationId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -159,7 +159,6 @@ public class ConsultationInfo extends BaseEntity implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private Integer delFlag;
|
private Integer delFlag;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
|||||||
@ -185,6 +185,11 @@ public class GoodsOrder extends BaseDomain implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private Long consultationInfoId;
|
private Long consultationInfoId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 房间号--视频问诊用
|
||||||
|
*/
|
||||||
|
private String roomId;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||||
@ -207,6 +212,7 @@ public class GoodsOrder extends BaseDomain implements Serializable {
|
|||||||
.append("createTime", getCreateTime())
|
.append("createTime", getCreateTime())
|
||||||
.append("updateBy", getUpdateBy())
|
.append("updateBy", getUpdateBy())
|
||||||
.append("updateTime", getUpdateTime())
|
.append("updateTime", getUpdateTime())
|
||||||
|
.append("roomId", getRoomId())
|
||||||
.toString();
|
.toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -84,6 +84,11 @@ public class ChatRecordDTO extends BaseEntity implements Serializable {
|
|||||||
@Length(max = 400, message = "消息内容不能超过18位", groups = {Insert.class, Update.class})
|
@Length(max = 400, message = "消息内容不能超过18位", groups = {Insert.class, Update.class})
|
||||||
private String content;
|
private String content;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 消息内容业务主键,用于点击跳转
|
||||||
|
*/
|
||||||
|
private String contentId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 标题
|
* 标题
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
package com.xinelu.applet.dto.consultationInfo;
|
package com.xinelu.manage.dto.consultationInfo;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.xinelu.common.core.domain.BaseEntity;
|
import com.xinelu.common.core.domain.BaseEntity;
|
||||||
@ -1,6 +1,6 @@
|
|||||||
package com.xinelu.applet.mapper.consultationInfo;
|
package com.xinelu.manage.mapper.consultationInfo;
|
||||||
|
|
||||||
import com.xinelu.applet.dto.consultationInfo.ConsultationInfoDTO;
|
import com.xinelu.manage.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 org.apache.ibatis.annotations.Param;
|
||||||
@ -1,14 +1,13 @@
|
|||||||
package com.xinelu.applet.service.consultationInfo;
|
package com.xinelu.manage.service.consultationInfo;
|
||||||
|
|
||||||
import com.xinelu.applet.dto.consultationInfo.ConsultationInfoDTO;
|
|
||||||
import com.xinelu.common.core.domain.AjaxResult;
|
import com.xinelu.common.core.domain.AjaxResult;
|
||||||
import com.xinelu.common.exception.file.InvalidExtensionException;
|
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.dto.consultationInfo.ConsultationInfoDTO;
|
||||||
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.io.IOException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -74,4 +73,8 @@ public interface IConsultationInfoService {
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public AjaxResult uploadConsultationFile(MultipartFile multipartFile) throws IOException, InvalidExtensionException;
|
public AjaxResult uploadConsultationFile(MultipartFile multipartFile) throws IOException, InvalidExtensionException;
|
||||||
|
|
||||||
|
AjaxResult startConsultation(Long consultationInfoId);
|
||||||
|
|
||||||
|
AjaxResult getAppletRoomId(Long goodsOrderId);
|
||||||
}
|
}
|
||||||
@ -1,8 +1,6 @@
|
|||||||
package com.xinelu.applet.service.consultationInfo.impl;
|
package com.xinelu.manage.service.consultationInfo.impl;
|
||||||
|
|
||||||
import com.xinelu.applet.dto.consultationInfo.ConsultationInfoDTO;
|
import com.alibaba.fastjson2.JSONObject;
|
||||||
import com.xinelu.applet.mapper.consultationInfo.ConsultationInfoMapper;
|
|
||||||
import com.xinelu.applet.service.consultationInfo.IConsultationInfoService;
|
|
||||||
import com.xinelu.common.config.XinELuConfig;
|
import com.xinelu.common.config.XinELuConfig;
|
||||||
import com.xinelu.common.core.domain.AjaxResult;
|
import com.xinelu.common.core.domain.AjaxResult;
|
||||||
import com.xinelu.common.exception.ServiceException;
|
import com.xinelu.common.exception.ServiceException;
|
||||||
@ -12,17 +10,26 @@ import com.xinelu.common.utils.bean.BeanUtils;
|
|||||||
import com.xinelu.common.utils.file.FileUploadUtils;
|
import com.xinelu.common.utils.file.FileUploadUtils;
|
||||||
import com.xinelu.common.utils.file.MimeTypeUtils;
|
import com.xinelu.common.utils.file.MimeTypeUtils;
|
||||||
import com.xinelu.manage.domain.consultationInfo.ConsultationInfo;
|
import com.xinelu.manage.domain.consultationInfo.ConsultationInfo;
|
||||||
|
import com.xinelu.manage.domain.goodsOrder.GoodsOrder;
|
||||||
|
import com.xinelu.manage.dto.consultationInfo.ConsultationInfoDTO;
|
||||||
|
import com.xinelu.manage.mapper.consultationInfo.ConsultationInfoMapper;
|
||||||
|
import com.xinelu.manage.mapper.goodsOrder.GoodsOrderMapper;
|
||||||
|
import com.xinelu.manage.mapper.patientinfo.PatientInfoMapper;
|
||||||
|
import com.xinelu.manage.service.consultationInfo.IConsultationInfoService;
|
||||||
|
import com.xinelu.manage.service.messagepush.MessagePushService;
|
||||||
import com.xinelu.manage.vo.consultationInfo.ConsultationInfoVO;
|
import com.xinelu.manage.vo.consultationInfo.ConsultationInfoVO;
|
||||||
|
import com.xinelu.manage.vo.patientinfo.PatientInfoVO;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Random;
|
||||||
|
import javax.annotation.Resource;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 在线问诊-问诊信息(图文和视频问诊基本信息)Service业务层处理
|
* 在线问诊-问诊信息(图文和视频问诊基本信息)Service业务层处理
|
||||||
@ -38,6 +45,15 @@ public class ConsultationInfoServiceImpl implements IConsultationInfoService {
|
|||||||
@Resource
|
@Resource
|
||||||
private XinELuConfig xinYiLuConfig;
|
private XinELuConfig xinYiLuConfig;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private GoodsOrderMapper goodsOrderMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private MessagePushService messagePushService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private PatientInfoMapper patientInfoMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询在线问诊-问诊信息(图文和视频问诊基本信息)
|
* 查询在线问诊-问诊信息(图文和视频问诊基本信息)
|
||||||
*
|
*
|
||||||
@ -143,4 +159,62 @@ public class ConsultationInfoServiceImpl implements IConsultationInfoService {
|
|||||||
ajax.put("fileUrl", pictureName);
|
ajax.put("fileUrl", pictureName);
|
||||||
return ajax;
|
return ajax;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override public AjaxResult startConsultation(Long goodsOrderId) {
|
||||||
|
GoodsOrder goodOrder = goodsOrderMapper.selectGoodsOrderById(goodsOrderId);
|
||||||
|
if (goodOrder == null) {
|
||||||
|
return AjaxResult.error("未查找到该订单,请联系管理员");
|
||||||
|
}
|
||||||
|
// 根据图文咨询申请主键查询居民主键
|
||||||
|
ConsultationInfoDTO consultationInfo = consultationInfoMapper.selectConsultationInfoById(goodOrder.getConsultationInfoId());
|
||||||
|
if (consultationInfo == null) {
|
||||||
|
return AjaxResult.error("生成房间号失败");
|
||||||
|
}
|
||||||
|
String roomId = "";
|
||||||
|
if(com.xinelu.common.utils.StringUtils.isNotBlank(goodOrder.getRoomId())) {
|
||||||
|
roomId = goodOrder.getRoomId();
|
||||||
|
} else {
|
||||||
|
// 房间号
|
||||||
|
Random random = new Random();
|
||||||
|
int randomNumber = random.nextInt(900000) + 100000; // 限制范围为 100000-999999
|
||||||
|
roomId = String.valueOf(randomNumber);
|
||||||
|
if (roomId.length() < 6) {
|
||||||
|
roomId = "0" + roomId; // 补零
|
||||||
|
}
|
||||||
|
// 保存房间号
|
||||||
|
goodOrder.setRoomId(roomId);
|
||||||
|
goodsOrderMapper.updateGoodsOrder(goodOrder);
|
||||||
|
}
|
||||||
|
PatientInfoVO patient = patientInfoMapper.selectPatientInfoById(goodOrder.getPatientId());
|
||||||
|
if (patient == null) {
|
||||||
|
return AjaxResult.error("未查询到该居民");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 给居民推送消息通知
|
||||||
|
JSONObject result = new JSONObject()
|
||||||
|
.fluentPut("patientId", patient.getId())
|
||||||
|
.fluentPut("openid", patient.getOpenid())
|
||||||
|
.fluentPut("receiveName", patient.getPatientName())
|
||||||
|
.fluentPut("sendTitle", "专家视频问诊")
|
||||||
|
.fluentPut("sendTime", DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss", new Date()))
|
||||||
|
.fluentPut("busType", "")
|
||||||
|
.fluentPut("sendContent", "专家邀请您进行视频问诊,请及时接听")
|
||||||
|
.fluentPut("messageType", "1")
|
||||||
|
.fluentPut("messageCategory", "4")
|
||||||
|
.fluentPut("cardNo", patient.getCardNo())
|
||||||
|
.fluentPut("senderName", consultationInfo.getDoctorName())
|
||||||
|
.fluentPut("contentId", goodOrder.getId())
|
||||||
|
.fluentPut("sourceType", "1");
|
||||||
|
messagePushService.fdApprovePush(result);
|
||||||
|
return AjaxResult.success(roomId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AjaxResult getAppletRoomId(Long goodsOrderId) {
|
||||||
|
GoodsOrder order = goodsOrderMapper.selectGoodsOrderById(goodsOrderId);
|
||||||
|
if (order == null) {
|
||||||
|
return AjaxResult.error("未查询到订单信息");
|
||||||
|
}
|
||||||
|
return AjaxResult.success(order.getRoomId());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -297,6 +297,9 @@ public class MessagePushServiceImpl implements MessagePushService {
|
|||||||
messageValueEntityMap.put("thing1", new MessageValueEntity(body.getString("senderName")));
|
messageValueEntityMap.put("thing1", new MessageValueEntity(body.getString("senderName")));
|
||||||
messageValueEntityMap.put("time2", new MessageValueEntity(body.getString("sendTime")));
|
messageValueEntityMap.put("time2", new MessageValueEntity(body.getString("sendTime")));
|
||||||
messageValueEntityMap.put("thing3", new MessageValueEntity(body.getString("sendContent")));
|
messageValueEntityMap.put("thing3", new MessageValueEntity(body.getString("sendContent")));
|
||||||
|
if (body.containsKey("contentId")) {
|
||||||
|
chatRecord.setContentId(body.getString("contentId"));
|
||||||
|
}
|
||||||
chatRecord.setContent(body.getString("sendContent"));
|
chatRecord.setContent(body.getString("sendContent"));
|
||||||
chatRecord.setRecipientName(body.getString("receiveName"));
|
chatRecord.setRecipientName(body.getString("receiveName"));
|
||||||
chatRecord.setSenderName(body.getString("senderName"));
|
chatRecord.setSenderName(body.getString("senderName"));
|
||||||
@ -306,7 +309,17 @@ public class MessagePushServiceImpl implements MessagePushService {
|
|||||||
Map<String, Object> paramsMap = new HashMap<>();
|
Map<String, Object> paramsMap = new HashMap<>();
|
||||||
paramsMap.put("touser", body.getString("openid"));
|
paramsMap.put("touser", body.getString("openid"));
|
||||||
paramsMap.put("template_id", MessageTemplateType.getFolllowupTypeByCode(body.getString("busType")).getTemplateId());
|
paramsMap.put("template_id", MessageTemplateType.getFolllowupTypeByCode(body.getString("busType")).getTemplateId());
|
||||||
|
|
||||||
|
if (StringUtils.isNotBlank(body.getString("sourceType"))) {
|
||||||
|
switch (body.getString("sourceType")) {
|
||||||
|
case "1": // 1:订单页面
|
||||||
|
paramsMap.put("page", appletPageConfig.getAppointOrderPageUrl());
|
||||||
|
break;
|
||||||
|
default:
|
||||||
paramsMap.put("page", appletPageConfig.getIntegralPageUrl());
|
paramsMap.put("page", appletPageConfig.getIntegralPageUrl());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
paramsMap.put("data", messageValueEntityMap);
|
paramsMap.put("data", messageValueEntityMap);
|
||||||
//发送
|
//发送
|
||||||
this.sendPosts(appletAccessToken, paramsMap);
|
this.sendPosts(appletAccessToken, paramsMap);
|
||||||
|
|||||||
@ -149,4 +149,12 @@ public interface INurseStationService {
|
|||||||
* @return 护理站信息
|
* @return 护理站信息
|
||||||
*/
|
*/
|
||||||
int getNurseStationById(List<Long> idList);
|
int getNurseStationById(List<Long> idList);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 护理站生成二维码
|
||||||
|
*
|
||||||
|
* @param nurseStationId 护理站id
|
||||||
|
* @return 邀请码图片地址
|
||||||
|
*/
|
||||||
|
AjaxResult nurseStationCode(Long nurseStationId);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,6 +6,7 @@ import com.xinelu.common.constant.Constants;
|
|||||||
import com.xinelu.common.core.domain.AjaxResult;
|
import com.xinelu.common.core.domain.AjaxResult;
|
||||||
import com.xinelu.common.enums.NurseClassifyInfoEnum;
|
import com.xinelu.common.enums.NurseClassifyInfoEnum;
|
||||||
import com.xinelu.common.exception.ServiceException;
|
import com.xinelu.common.exception.ServiceException;
|
||||||
|
import com.xinelu.common.utils.AppletChatUtil;
|
||||||
import com.xinelu.common.utils.SecurityUtils;
|
import com.xinelu.common.utils.SecurityUtils;
|
||||||
import com.xinelu.common.utils.bean.BeanUtils;
|
import com.xinelu.common.utils.bean.BeanUtils;
|
||||||
import com.xinelu.common.utils.codes.GenerateSystemCodeUtil;
|
import com.xinelu.common.utils.codes.GenerateSystemCodeUtil;
|
||||||
@ -66,6 +67,8 @@ public class NurseStationServiceImpl implements INurseStationService {
|
|||||||
private NurseStationClassifyRelationMapper stationClassifyRelationMapper;
|
private NurseStationClassifyRelationMapper stationClassifyRelationMapper;
|
||||||
@Resource
|
@Resource
|
||||||
private AppletPageConfig appletPageConfig;
|
private AppletPageConfig appletPageConfig;
|
||||||
|
@Resource
|
||||||
|
private XinELuConfig xinYiLuConfig;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 护理站营业时间默认值
|
* 护理站营业时间默认值
|
||||||
@ -595,6 +598,47 @@ public class NurseStationServiceImpl implements INurseStationService {
|
|||||||
return nurseStationMapper.getNurseStationCount(idList);
|
return nurseStationMapper.getNurseStationCount(idList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 护理站生成二维码
|
||||||
|
*
|
||||||
|
* @param nurseStationId 护理站id
|
||||||
|
* @return 邀请码图片地址
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public AjaxResult nurseStationCode(Long nurseStationId) {
|
||||||
|
//获取微信小程序AccessToken的值
|
||||||
|
NurseStation nurseStationById = nurseStationMapper.getNurseStationById(nurseStationId);
|
||||||
|
if (Objects.isNull(nurseStationById)) {
|
||||||
|
return AjaxResult.error("当前护理机构信息不存在,请联系管理员!");
|
||||||
|
}
|
||||||
|
if (StringUtils.isBlank(nurseStationById.getStationWechatCodeUrl())) {
|
||||||
|
String fileName = String.valueOf(System.nanoTime()) + nurseStationId + ".png";
|
||||||
|
//小程序跳转路径
|
||||||
|
String appletPageUrl = appletPageConfig.getNurseStationDetailsPageUrl();
|
||||||
|
//机构二维码存放路径
|
||||||
|
String filePathWeChatCodeUrl = xinYiLuConfig.getStationWechatCodeUrl();
|
||||||
|
String appletCodePicture = AppletChatUtil.createAppletCode(nurseStationId, false, fileName, appletPageUrl, filePathWeChatCodeUrl);
|
||||||
|
if (StringUtils.isNotBlank(appletCodePicture) && StringUtils.equals(FAIL, appletCodePicture)) {
|
||||||
|
//第一次调用获取小程序二维码信息失败,重新递归调用一次,第二次失败直接返回提示信息
|
||||||
|
appletCodePicture = AppletChatUtil.createAppletCode(nurseStationId, true, fileName, appletPageUrl, filePathWeChatCodeUrl);
|
||||||
|
if (StringUtils.isNotBlank(appletCodePicture) && StringUtils.equals(FAIL, appletCodePicture)) {
|
||||||
|
return AjaxResult.error("获取小程序二维码信息失败,请联系管理员!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
String pictureUrl = "";
|
||||||
|
if (StringUtils.isNotBlank(appletCodePicture)) {
|
||||||
|
pictureUrl = "/profile" + xinYiLuConfig.getStationWechatCodeUrl() + "/" + nurseStationId + "/" + fileName;
|
||||||
|
int updateCount = nurseStationMapper.updateStationWeChatCodeUrl(nurseStationId, pictureUrl);
|
||||||
|
if (updateCount <= 0) {
|
||||||
|
throw new ServiceException("生成机构二维码失败,请联系管理员!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return AjaxResult.success(pictureUrl);
|
||||||
|
}
|
||||||
|
//直接返回二维码图片信息
|
||||||
|
return AjaxResult.success(nurseStationById.getStationWechatCodeUrl());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增护理站标签信息
|
* 新增护理站标签信息
|
||||||
|
|||||||
@ -172,7 +172,6 @@ public class ScreeningRecordServiceImpl implements IScreeningRecordService {
|
|||||||
JSONObject result = new JSONObject();
|
JSONObject result = new JSONObject();
|
||||||
result.put("patientId", body.getPatientId());
|
result.put("patientId", body.getPatientId());
|
||||||
if (flag > 0) {
|
if (flag > 0) {
|
||||||
// TODO 推送提醒
|
|
||||||
// 组装发送消息通知参数
|
// 组装发送消息通知参数
|
||||||
result.put("openid", registerVo.getOpenid());
|
result.put("openid", registerVo.getOpenid());
|
||||||
result.put("receiveName", registerVo.getPatientName());
|
result.put("receiveName", registerVo.getPatientName());
|
||||||
|
|||||||
@ -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.applet.mapper.consultationInfo.ConsultationInfoMapper">
|
<mapper namespace="com.xinelu.manage.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="com.xinelu.applet.dto.consultationInfo.ConsultationInfoDTO" resultType="com.xinelu.manage.vo.consultationInfo.ConsultationInfoVO">
|
<select id="selectConsultationInfoList" parameterType="com.xinelu.manage.dto.consultationInfo.ConsultationInfoDTO" resultType="com.xinelu.manage.vo.consultationInfo.ConsultationInfoVO">
|
||||||
SELECT
|
SELECT
|
||||||
ci.id,
|
ci.id,
|
||||||
ci.patient_id,
|
ci.patient_id,
|
||||||
@ -113,7 +113,7 @@
|
|||||||
ORDER BY ci.create_time DESC
|
ORDER BY ci.create_time DESC
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectConsultationInfoById" parameterType="Long" resultType="com.xinelu.applet.dto.consultationInfo.ConsultationInfoDTO">
|
<select id="selectConsultationInfoById" parameterType="Long" resultType="com.xinelu.manage.dto.consultationInfo.ConsultationInfoDTO">
|
||||||
select id,
|
select id,
|
||||||
patient_id,
|
patient_id,
|
||||||
patient_name,
|
patient_name,
|
||||||
@ -35,6 +35,7 @@
|
|||||||
<result property="healthAppointDate" column="health_appoint_date"/>
|
<result property="healthAppointDate" column="health_appoint_date"/>
|
||||||
<result property="hospitalPersonName" column="hospital_person_name"/>
|
<result property="hospitalPersonName" column="hospital_person_name"/>
|
||||||
<result property="consultationInfoId" column="consultation_info_id"/>
|
<result property="consultationInfoId" column="consultation_info_id"/>
|
||||||
|
<result property="roomId" column="room_id"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<!--商品订单信息及评价-->
|
<!--商品订单信息及评价-->
|
||||||
@ -119,7 +120,8 @@
|
|||||||
health_consultation_content,
|
health_consultation_content,
|
||||||
health_appoint_date,
|
health_appoint_date,
|
||||||
hospital_person_name,
|
hospital_person_name,
|
||||||
consultation_info_id
|
consultation_info_id,
|
||||||
|
room_id
|
||||||
from goods_order
|
from goods_order
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
@ -277,6 +279,8 @@
|
|||||||
</if>
|
</if>
|
||||||
<if test="consultationInfoId != null">consultation_info_id,
|
<if test="consultationInfoId != null">consultation_info_id,
|
||||||
</if>
|
</if>
|
||||||
|
<if test="roomId != null">room_id,
|
||||||
|
</if>
|
||||||
</trim>
|
</trim>
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
<if test="nurseStationId != null">#{nurseStationId},
|
<if test="nurseStationId != null">#{nurseStationId},
|
||||||
@ -337,6 +341,8 @@
|
|||||||
</if>
|
</if>
|
||||||
<if test="consultationInfoId != null">#{consultationInfoId},
|
<if test="consultationInfoId != null">#{consultationInfoId},
|
||||||
</if>
|
</if>
|
||||||
|
<if test="roomId != null">#{roomId},
|
||||||
|
</if>
|
||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
@ -430,6 +436,9 @@
|
|||||||
<if test="consultationInfoId != null">consultation_info_id =
|
<if test="consultationInfoId != null">consultation_info_id =
|
||||||
#{consultationInfoId},
|
#{consultationInfoId},
|
||||||
</if>
|
</if>
|
||||||
|
<if test="roomId != null">room_id =
|
||||||
|
#{roomId},
|
||||||
|
</if>
|
||||||
</trim>
|
</trim>
|
||||||
where id = #{id}
|
where id = #{id}
|
||||||
</update>
|
</update>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user