提交 2d9033a4 authored 作者: 杨凯's avatar 杨凯

Merge branch 'test'

......@@ -43,6 +43,11 @@ public class MessageInfo {
*/
private String actionType;
/**
* 【选填】消息类型:TIMTextElem,TIMLocationElem,TIMFaceElem,TIMCustomElem,TIMSoundElem,TIMImageElem,TIMFileElem, TIMVideoFileElem
*/
private String msgType;
public List<AccountVO> getReceiveAccounts() {
return receiveAccounts;
}
......@@ -91,6 +96,14 @@ public class MessageInfo {
this.actionType = actionType;
}
public String getMsgType() {
return msgType;
}
public void setMsgType(String msgType) {
this.msgType = msgType;
}
@Override
public String toString() {
return "MessageInfo{" +
......@@ -99,7 +112,8 @@ public class MessageInfo {
", selfAccount=" + selfAccount +
", message=" + message +
", syncFlag=" + syncFlag +
", actionType='" + actionType + '\'' +
", actionType='" + actionType +
", msgType='" + msgType + '\'' +
'}';
}
}
package com.ebaiyihui.family.doctor.common.bo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
......@@ -43,7 +42,7 @@ public class PatientSignInfo {
* 患者名字
*/
private String patientName;
/**
* 患者手机号码
*/
......@@ -65,4 +64,19 @@ public class PatientSignInfo {
* 团队成员信息(个人这个值为null)
*/
private List<MemberInfo> memberInfos;
/**
* 医生头像图片地址
*/
private String doctorHeadPortrait;
/**
* 医生职称
*/
private String doctorProfessional;
/**
* 签约id
*/
private Long signedId;
}
package com.ebaiyihui.family.doctor.common.dto;
import lombok.Data;
/**
* @ClassName: ImNoReadMsgDTO
* @Author:yanliang
* @Date:2024/3/27 13:46
* @Description
*/
@Data
public class ImNoReadMsgDTO {
private String phone;
private String doctorId;
}
package com.ebaiyihui.family.doctor.common.dto;
import lombok.Data;
/**
* @ClassName: MasterUrlDTO
* @Author:yanliang
* @Date:2024/3/27 13:55
* @Description
*/
@Data
public class MasterUrlDTO {
private String phone;
private String signSeqId;
private String type;
}
package com.ebaiyihui.family.doctor.common.dto;
import lombok.Data;
/**
* @ClassName: ReportDetailDTO
* @Author:yanliang
* @Date:2024/3/27 14:14
* @Description
*/
@Data
public class ReportDetailDTO {
private String thirdId;
}
......@@ -30,4 +30,6 @@ public class SendImMsgDTO {
private String abnormalId;
private String intention;
private String thirdId;
}
package com.ebaiyihui.family.doctor.common.vo;
import lombok.Data;
/**
* @ClassName: ImNoReadMsgVo
* @Author:yanliang
* @Date:2024/3/27 13:47
* @Description
*/
@Data
public class ImNoReadMsgVo {
private String userName;
private String messageNum;
private String groupId;
private String timestamp;
}
......@@ -36,4 +36,8 @@ public class RegisterPatientVo {
private String intention;
private String doctorId;
private String thirdId;
private String userId;
}
package com.ebaiyihui.family.doctor.common.vo;
import lombok.Data;
/**
* @ClassName: ReportDetailItemVo
* @Author:yanliang
* @Date:2024/3/27 14:17
* @Description
*/
@Data
public class ReportDetailItemVo {
private String fileUrl;
private Integer fileType;
}
package com.ebaiyihui.family.doctor.common.vo;
import lombok.Data;
import java.util.List;
/**
* @ClassName: ReportDetailVo
* @Author:yanliang
* @Date:2024/3/27 14:15
* @Description
*/
@Data
public class ReportDetailVo {
private String reportName;
private String institution;
private String department;
private String diagnosis;
private Integer reportType;
private String createTime;
private String examinationTime;
private List<ReportDetailItemVo> reportFileList;
}
......@@ -144,4 +144,8 @@ public class CommonConstants {
public static final String SUPPLIER_CODE = "ZhongKang";
public static final String SUPPLIER_CODE_JTYS = "zhongkang_mfd";
public static final String USER_ACTION ="2000";
public static final String MSG_TYPE = "PICTURE";
}
......@@ -65,4 +65,14 @@ public class UrlConstants {
* 查询用户基础指标信息
*/
public static final String USER_BASIC_IND_URL = "/auth/v1.0.0/userBasicIndicators";
/**
* 查询资源落地页
*/
public static final String MASTER_URL = "/auth/v1.0.0/family_doctor_master_url";
/**
* 查询用户报告详情
*/
public static final String REPORT_DETAIL_URL = "/auth/v1.0.0/report_detail";
}
......@@ -15,15 +15,15 @@ public enum MsgTempTypeEnum {
HP_INQ_DOCTOR("家庭主页问医生", 3),
HP_INQ_DUTY_DOCTOR("家庭主页问联系值班医生", 4),
HP_INQ_DUTY_DOCTOR("家庭主页问联系值班医生", 8),
HEAL_DIS_CON("健康/疾病咨询", 5),
HEAL_DIS_CON("健康/疾病咨询", 4),
MED_GUD("用药指导", 6),
MED_GUD("用药指导", 5),
REP_INTER("报告解读", 7),
REP_INTER("报告解读", 6),
PRES_MED("处方开药", 8),
PRES_MED("处方开药", 7),
REP_ANO("报告异常", 9),
......
package com.ebaiyihui.family.doctor.server.common.enums;
import org.apache.commons.lang.StringUtils;
/**
* @ClassName: ReportTypeEnum
* @Author:yanliang
* @Date:2024/3/27 15:10
* @Description
*/
public enum ReportTypeEnum {
// 报告类型,1检查检验, 2就诊病历
INSPECTION("检查检验", 1),
CONSULTATION("就诊病历", 2);
private String desc;
private Integer value;
private ReportTypeEnum(String desc, Integer value) {
this.desc = desc;
this.value = value;
}
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
public Integer getValue() {
return value;
}
public void setValue(Integer value) {
this.value = value;
}
public static String getDesc(Integer value) {
if (value == null || value < 0) {
return null;
}
for (ReportTypeEnum reportTypeEnum : ReportTypeEnum.values()) {
if (value.equals(reportTypeEnum.getValue())) {
return reportTypeEnum.getDesc();
}
}
return null;
}
public static Integer getValue(String desc) {
if (StringUtils.isBlank(desc)) {
return null;
}
for (ReportTypeEnum reportTypeEnum : ReportTypeEnum.values()) {
if (reportTypeEnum.getDesc().equals(desc)) {
return reportTypeEnum.getValue();
}
}
return null;
}
}
package com.ebaiyihui.family.doctor.server.controller;
import com.ebaiyihui.family.doctor.common.dto.ImNoReadMsgDTO;
import com.ebaiyihui.family.doctor.common.dto.SendImMsgDTO;
import com.ebaiyihui.family.doctor.common.vo.ImNoReadMsgVo;
import com.ebaiyihui.family.doctor.server.service.ImMsgTemplateService;
import com.ebaiyihui.framework.response.BaseResponse;
import io.swagger.annotations.Api;
......@@ -39,4 +41,16 @@ public class ImMsgTemplateController {
}
return BaseResponse.success("消息推送成功");
}
@RequestMapping(value = "/queryImNoReadMsg", method = RequestMethod.POST)
public BaseResponse<ImNoReadMsgVo> queryImNoReadMsg(@RequestBody ImNoReadMsgDTO reqVo,
BindingResult bindingResult) {
BaseResponse<ImNoReadMsgVo> response = null;
try {
response = imMsgTemplateService.queryImNoReadMsg(reqVo);
} catch (Exception e) {
return BaseResponse.error(e.getMessage());
}
return response;
}
}
......@@ -113,4 +113,17 @@ public class PatientSignController {
public BaseResponse<IMQueryUserLoginRspVO> querySdkLogin(@RequestBody IMQueryUserLoginReqVO reqVO) {
return patientSignService.querySdkLogin(reqVO);
}
@RequestMapping(value = "/queryMasterUrl", method = RequestMethod.POST)
public BaseResponse<String> queryMasterUrl(@RequestBody MasterUrlDTO reqVo,
BindingResult bindingResult) {
BaseResponse<String> response = null;
try {
response = patientSignService.queryMasterUrl(reqVo);
} catch (Exception e) {
return BaseResponse.error(e.getMessage());
}
return response;
}
}
......@@ -17,7 +17,7 @@ public interface MobileBenefitPackageMapper {
void insert(MobileBenefitPackageEntity entity);
MobileBenefitPackageEntity queryByPhone(@Param("mobile") String mobile, @Param("activateOrderId") String activateOrderId);
MobileBenefitPackageEntity queryByPhone(@Param("mobile") String mobile, @Param("activateOrderId") String activateOrderId, @Param("flag") String flag);
void updateUsed(MobileBenefitPackageEntity entity);
......
package com.ebaiyihui.family.doctor.server.rabbitmq;
import com.ebaiyihui.family.doctor.common.dto.NotifyConsultDataDTO;
import com.ebaiyihui.family.doctor.server.common.constants.CommonConstants;
import com.ebaiyihui.family.doctor.server.common.enums.StatusEnum;
import com.ebaiyihui.family.doctor.server.config.RabbitMqConfig;
import com.ebaiyihui.family.doctor.server.entity.MobileBenefitPackageEntity;
import com.ebaiyihui.family.doctor.server.entity.PatientSignEntity;
import com.ebaiyihui.family.doctor.server.mapper.MobileBenefitPackageMapper;
import com.ebaiyihui.family.doctor.server.mapper.PatientSignMapper;
import com.ebaiyihui.family.doctor.server.util.DateUtils;
import com.ebaiyihui.family.doctor.server.util.ThirdOrderPushUtil;
import com.ebaiyihui.family.doctor.server.vo.OrderTaskVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.messaging.handler.annotation.Payload;
import org.springframework.stereotype.Component;
import org.springframework.util.ObjectUtils;
import java.util.Date;
......@@ -26,6 +33,12 @@ public class RabbitConsumer {
@Autowired
private PatientSignMapper patientSignMapper;
@Autowired
private MobileBenefitPackageMapper mobileBenefitPackageMapper;
@Autowired
private ThirdOrderPushUtil thirdOrderPushUtil;
@RabbitListener(queues = RabbitMqConfig.ORDER_DELAY_QUEUE_1)
public void orderDelayQueue1(@Payload OrderTaskVo orderTaskVo) {
log.info("定时任务监听结果:{}", orderTaskVo.toString());
......@@ -41,6 +54,22 @@ public class RabbitConsumer {
if (StatusEnum.IN_CONSULTATION.getValue().equals(patientSignEntity.getStatus())) {
patientSignEntity.setStatus(StatusEnum.FINISH_APPLY.getValue());
patientSignMapper.updateById(patientSignEntity);
MobileBenefitPackageEntity entity = mobileBenefitPackageMapper.queryByPhone(patientSignEntity.getPatientPhone(),
patientSignEntity.getPackageOrderId(), "1");
if (!ObjectUtils.isEmpty(entity)) {
// 推送第三方权益使用
NotifyConsultDataDTO notifyConsultDataDTO = new NotifyConsultDataDTO();
notifyConsultDataDTO.setActivateOrderId(patientSignEntity.getPackageOrderId());
notifyConsultDataDTO.setConsultOrderNo(patientSignEntity.getAdmId());
notifyConsultDataDTO.setStatus(String.valueOf(StatusEnum.FINISH_APPLY.getValue()));
notifyConsultDataDTO.setProductId(entity.getProductId());
notifyConsultDataDTO.setPatientId(entity.getUserId());
notifyConsultDataDTO.setExpertName(patientSignEntity.getDoctorName());
notifyConsultDataDTO.setOrderDate(DateUtils.dateToFullString(patientSignEntity.getCreateTime()));
notifyConsultDataDTO.setSupplierCode(CommonConstants.SUPPLIER_CODE_JTYS);
thirdOrderPushUtil.syncBenefitUsedOrder(notifyConsultDataDTO, null);
}
}
} catch (Exception e) {
log.info("orderDelayQueue监听异常", e);
......
package com.ebaiyihui.family.doctor.server.service;
import com.ebaiyihui.family.doctor.common.dto.ImNoReadMsgDTO;
import com.ebaiyihui.family.doctor.common.dto.SendImMsgDTO;
import com.ebaiyihui.family.doctor.common.vo.ImNoReadMsgVo;
import com.ebaiyihui.framework.response.BaseResponse;
/**
......@@ -13,4 +15,6 @@ import com.ebaiyihui.framework.response.BaseResponse;
public interface ImMsgTemplateService {
BaseResponse<String> sendImMsg(SendImMsgDTO reqVo);
BaseResponse<ImNoReadMsgVo> queryImNoReadMsg(ImNoReadMsgDTO reqVo);
}
......@@ -3,6 +3,7 @@ package com.ebaiyihui.family.doctor.server.service;
import com.ebaiyihui.family.doctor.common.dto.ImAccountReqDTO;
import com.ebaiyihui.family.doctor.common.dto.ImInfoDetailDocReqDTO;
import com.ebaiyihui.family.doctor.common.dto.ImInfoListDocReqDTO;
import com.ebaiyihui.family.doctor.common.dto.MasterUrlDTO;
import com.ebaiyihui.family.doctor.common.vo.ImAccountVo;
import com.ebaiyihui.family.doctor.common.vo.ImInfoDetailDocResVo;
import com.ebaiyihui.family.doctor.common.vo.ImInfoListResVo;
......@@ -50,4 +51,6 @@ public interface PatientSignService {
PatientSignEntity getOneByPhone(String phone);
int updateById(PatientSignEntity patientSignEntity);
BaseResponse<String> queryMasterUrl(MasterUrlDTO reqVo);
}
......@@ -13,11 +13,13 @@ import com.ebaiyihui.family.doctor.common.dto.*;
import com.ebaiyihui.family.doctor.common.vo.*;
import com.ebaiyihui.family.doctor.server.common.constants.ImConstants;
import com.ebaiyihui.family.doctor.server.common.enums.SignStatus;
import com.ebaiyihui.family.doctor.server.entity.PatientEntity;
import com.ebaiyihui.family.doctor.server.entity.PatientSignEntity;
import com.ebaiyihui.family.doctor.server.entity.ServiceConfigEntity;
import com.ebaiyihui.family.doctor.server.feign.DepartmentFeignClient;
import com.ebaiyihui.family.doctor.server.feign.DoctorInfofeignClient;
import com.ebaiyihui.family.doctor.server.feign.DoctorWorkingServiceClient;
import com.ebaiyihui.family.doctor.server.mapper.PatientMapper;
import com.ebaiyihui.family.doctor.server.mapper.PatientSignMapper;
import com.ebaiyihui.family.doctor.server.mapper.ServiceConfigMapper;
import com.ebaiyihui.family.doctor.server.service.DoctorService;
......@@ -33,6 +35,7 @@ import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
/**
......@@ -48,6 +51,9 @@ public class DoctorServiceImpl implements DoctorService {
@Autowired
private PatientSignMapper patientSignMapper;
@Autowired
private PatientMapper patientMapper;
@Autowired
private ServiceConfigMapper serviceConfigMapper;
......@@ -78,6 +84,15 @@ public class DoctorServiceImpl implements DoctorService {
patientSignEntity.setPatientId(reqVo.getPatientId());
patientSignEntity.setOrganId(reqVo.getOrganId());
patientSignEntity.setSignStatus(SignStatus.SIGNED.getValue());
QueryWrapper<PatientEntity> pWrapper = new QueryWrapper<>();
PatientEntity patient = new PatientEntity();
patient.setId(reqVo.getPatientId());
pWrapper.setEntity(patient);
PatientEntity patientEntity = patientMapper.selectOne(pWrapper);
if (Objects.nonNull(patientEntity)) {
patientSignEntity.setPatientPhone(patientEntity.getPhone());
}
wrapper.setEntity(patientSignEntity);
wrapper.orderByDesc("create_time");
wrapper.last("limit 1");
......
......@@ -4,7 +4,9 @@ import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ebaiyihui.family.doctor.common.bo.Components;
import com.ebaiyihui.family.doctor.common.bo.MsgContent;
import com.ebaiyihui.family.doctor.common.dto.ImNoReadMsgDTO;
import com.ebaiyihui.family.doctor.common.dto.SendImMsgDTO;
import com.ebaiyihui.family.doctor.common.vo.ImNoReadMsgVo;
import com.ebaiyihui.family.doctor.server.entity.ImMsgTemplateEntity;
import com.ebaiyihui.family.doctor.server.exception.BusinessException;
import com.ebaiyihui.family.doctor.server.mapper.ImMsgTemplateMapper;
......@@ -54,4 +56,9 @@ public class ImMsgTemplateServiceImpl implements ImMsgTemplateService {
}
return BaseResponse.success("消息推送成功");
}
@Override
public BaseResponse<ImNoReadMsgVo> queryImNoReadMsg(ImNoReadMsgDTO reqVo) {
return null;
}
}
......@@ -11,6 +11,8 @@ import com.ebaiyihui.family.doctor.common.bo.Result;
import com.ebaiyihui.family.doctor.common.dto.MobileBenefitPackageDTO;
import com.ebaiyihui.family.doctor.common.vo.RegisterPatientVo;
import com.ebaiyihui.family.doctor.server.common.constants.CommonConstants;
import com.ebaiyihui.family.doctor.server.common.enums.SignStatus;
import com.ebaiyihui.family.doctor.server.common.enums.StatusEnum;
import com.ebaiyihui.family.doctor.server.entity.MobileBenefitPackageEntity;
import com.ebaiyihui.family.doctor.server.entity.PatientEntity;
import com.ebaiyihui.family.doctor.server.entity.PatientSignEntity;
......@@ -61,7 +63,7 @@ public class MobileBenefitPackageServiceImpl implements MobileBenefitPackageServ
RegisterPatientVo registerPatientVo = new RegisterPatientVo();
MobileBenefitPackageEntity entity = new MobileBenefitPackageEntity();
if (Objects.nonNull(map.get("activateOrderId"))) {
entity = mobileBenefitPackageMapper.queryByPhone(map.get("mobile"), map.get("activateOrderId"));
entity = mobileBenefitPackageMapper.queryByPhone(map.get("mobile"), map.get("activateOrderId"), null);
if (ObjectUtils.isEmpty(entity)) {
return BaseResponse.error("没有查询到有关权益");
}
......@@ -124,10 +126,26 @@ public class MobileBenefitPackageServiceImpl implements MobileBenefitPackageServ
registerPatientVo.setDoctorId(map.get("doctorId"));
}
if (Objects.nonNull(map.get("thirdId"))) {
registerPatientVo.setThirdId(map.get("thirdId"));
}
if (Objects.nonNull(map.get("signSeqId"))) {
registerPatientVo.setSignSeqId(map.get("signSeqId"));
PatientSignEntity patientSignEntity = patientSignMapper.selectById(Long.valueOf(map.get("signSeqId")));
registerPatientVo.setAdmId(patientSignEntity.getAdmId());
if (StatusEnum.FINISH_APPLY.getValue().equals(patientSignEntity.getStatus())
&& SignStatus.CANCEL.getValue().equals(patientSignEntity.getSignStatus())) {
QueryWrapper<PatientSignEntity> psWrapper = new QueryWrapper<>();
PatientSignEntity patientSign = new PatientSignEntity();
patientSign.setSignId(patientSignEntity.getId());
patientSign.setStatus(StatusEnum.IN_CONSULTATION.getValue());
patientSign.setSignStatus(SignStatus.SIGNED.getValue());
psWrapper.setEntity(patientSign);
patientSignEntity = patientSignMapper.selectOne(psWrapper);
registerPatientVo.setAdmId(patientSignEntity.getAdmId());
}
// 更新权益医生id
if (Objects.nonNull(patientSignEntity)) {
entity.setDoctorId(String.valueOf(patientSignEntity.getDoctorId()));
......@@ -156,13 +174,18 @@ public class MobileBenefitPackageServiceImpl implements MobileBenefitPackageServ
patientEntity.setUserId(entity.getUserId());
log.info("数据库不存在添加患者: {}", JSON.toJSONString(patientEntity));
patientMapper.insert(patientEntity);
} else {
if (!map.get("mobile").equals(patientEntity.getPhone())) {
patientEntity.setPhone(map.get("mobile"));
patientMapper.updateById(patientEntity);
}
}
//保存就诊人id
entity.setUserId(map.get("patient_id"));
mobileBenefitPackageMapper.update(entity);
}
registerPatientVo.setUserId(entity.getUserId());
return BaseResponse.success(registerPatientVo);
}
......
......@@ -77,7 +77,7 @@ public class PatientServiceImpl implements PatientService {
@Override
public BaseResponse<String> signedDoctor(SignedDoctorDTO reqVo) {
MobileBenefitPackageEntity entity = mobileBenefitPackageMapper.queryByPhone(reqVo.getPhone(), reqVo.getPackageOrderId());
MobileBenefitPackageEntity entity = mobileBenefitPackageMapper.queryByPhone(reqVo.getPhone(), reqVo.getPackageOrderId(), null);
if (ObjectUtils.isEmpty(entity)) {
return BaseResponse.error("没有查询到有关权益");
}
......@@ -110,20 +110,22 @@ public class PatientServiceImpl implements PatientService {
}
if (!SignStatus.NORMAL.getValue().equals(reqVo.getSignStatus())) {
Integer signStatus = SignStatus.SIGNED.getValue();
Integer status = StatusEnum.IN_CONSULTATION.getValue();
if (SignStatus.CANCEL.getValue().equals(reqVo.getSignStatus())) {
signStatus = SignStatus.CANCEL.getValue();
status = StatusEnum.FINISH_APPLY.getValue();
}
List<PatientSignEntity> patientSignEntities = getPatientSignList(reqVo.getPhone(), reqVo.getPackageOrderId(),
reqVo.getSignStatus(), StatusEnum.IN_CONSULTATION.getValue());
signStatus, status);
if (!patientSignEntities.isEmpty()) {
return BaseResponse.error("已经有进行中的签约或者改签医生,不能再进行签约或者改签!!!");
}
} else {
QueryWrapper<PatientSignEntity> psWrapper = new QueryWrapper<>();
PatientSignEntity patientSign = new PatientSignEntity();
if (Objects.nonNull(reqVo.getAdmId())) {
patientSign.setAdmId(reqVo.getAdmId());
}
if (Objects.nonNull(reqVo.getSignSeqId())) {
patientSign.setId(Long.valueOf(reqVo.getSignSeqId()));
}
patientSign.setSignId(oldPatientSignEntity.getId());
patientSign.setStatus(StatusEnum.IN_CONSULTATION.getValue());
patientSign.setSignStatus(SignStatus.NORMAL.getValue());
psWrapper.setEntity(patientSign);
PatientSignEntity patientSignEntity = patientSignMapper.selectOne(psWrapper);
......@@ -207,25 +209,6 @@ public class PatientServiceImpl implements PatientService {
SignStatus.CANCEL.getValue().equals(reqVo.getSignStatus()) ? ImSignStatus.REISSUE_SUC.getValue() :
ImSignStatus.INQUIRY_SCH_DOC.getValue());
if (!SignStatus.NORMAL.getValue().equals(reqVo.getSignStatus())) {
// 推送第三方权益使用
NotifyConsultDataDTO notifyConsultDataDTO = new NotifyConsultDataDTO();
notifyConsultDataDTO.setActivateOrderId(reqVo.getPackageOrderId());
notifyConsultDataDTO.setConsultOrderNo(admId);
notifyConsultDataDTO.setStatus(String.valueOf(reqVo.getSignStatus()));
notifyConsultDataDTO.setProductId(entity.getProductId());
notifyConsultDataDTO.setPatientId(entity.getUserId());
notifyConsultDataDTO.setExpertName(reqVo.getDoctorName());
notifyConsultDataDTO.setOrderDate(DateUtils.dateToFullString(patientSignEntity.getCreateTime()));
notifyConsultDataDTO.setSupplierCode(CommonConstants.SUPPLIER_CODE_JTYS);
thirdOrderPushUtil.syncBenefitUsedOrder(notifyConsultDataDTO);
} else {
if (Objects.nonNull(oldPatientSignEntity)) {
sendImMsgDTO.setOldAdmId(oldPatientSignEntity.getAdmId());
}
}
//放入MQ任务,处理订单到时结束
if ("0".equals(entity.getIsRenew()) || SignStatus.NORMAL.getValue().equals(reqVo.getSignStatus())) {
OrderTaskVo orderTaskVo = new OrderTaskVo();
......@@ -245,6 +228,39 @@ public class PatientServiceImpl implements PatientService {
imMsgTemplateService.sendImMsg(sendImMsgDTO);
if (!SignStatus.NORMAL.getValue().equals(reqVo.getSignStatus())) {
// 推送第三方权益使用
NotifyConsultDataDTO notifyConsultDataDTO = new NotifyConsultDataDTO();
notifyConsultDataDTO.setActivateOrderId(reqVo.getPackageOrderId());
notifyConsultDataDTO.setConsultOrderNo(admId);
notifyConsultDataDTO.setStatus(String.valueOf(StatusEnum.IN_CONSULTATION.getValue()));
notifyConsultDataDTO.setProductId(entity.getProductId());
notifyConsultDataDTO.setPatientId(entity.getUserId());
notifyConsultDataDTO.setExpertName(reqVo.getDoctorName());
notifyConsultDataDTO.setOrderDate(DateUtils.dateToFullString(patientSignEntity.getCreateTime()));
notifyConsultDataDTO.setSupplierCode(CommonConstants.SUPPLIER_CODE_JTYS);
thirdOrderPushUtil.syncBenefitUsedOrder(notifyConsultDataDTO, 10000L);
if (SignStatus.CANCEL.getValue().equals(reqVo.getSignStatus())) {
// 推送第三方权益使用
NotifyConsultDataDTO notifyConsultDataDTO2 = new NotifyConsultDataDTO();
notifyConsultDataDTO2.setActivateOrderId(reqVo.getPackageOrderId());
notifyConsultDataDTO2.setConsultOrderNo(oldPatientSignEntity.getAdmId());
notifyConsultDataDTO2.setStatus(String.valueOf(StatusEnum.FINISH_APPLY.getValue()));
notifyConsultDataDTO2.setProductId(entity.getProductId());
notifyConsultDataDTO2.setPatientId(entity.getUserId());
notifyConsultDataDTO2.setExpertName(reqVo.getDoctorName());
notifyConsultDataDTO2.setOrderDate(DateUtils.dateToFullString(patientSignEntity.getCreateTime()));
notifyConsultDataDTO2.setSupplierCode(CommonConstants.SUPPLIER_CODE_JTYS);
thirdOrderPushUtil.syncBenefitUsedOrder(notifyConsultDataDTO2, 10000L);
}
} else {
if (Objects.nonNull(oldPatientSignEntity)) {
sendImMsgDTO.setOldAdmId(oldPatientSignEntity.getAdmId());
}
}
// 推送app提示语
goEasyPushService.newOrderToReceive(admId);
......@@ -298,12 +314,12 @@ public class PatientServiceImpl implements PatientService {
List<ScheduleRecordEntity> scheduleRecordEntities = scheduleRecordMapper.selectByDate(String.valueOf(CommonConstants.ORGAN_CODE), 5, date, 1, hourAndSecond);
log.info("当前排班医生:{}", JSON.toJSONString(scheduleRecordEntities));
if (!CollectionUtils.isEmpty(scheduleRecordEntities)){
if (!CollectionUtils.isEmpty(scheduleRecordEntities)) {
scheduleRecordEntities.stream().filter(scheduleRecordEntity -> !scheduleRecordEntity.getDoctorId().equals(doctorId)).collect(Collectors.toList());
}
if (CollectionUtils.isEmpty(scheduleRecordEntities)) {
throw new BusinessException("暂无排班医生,请稍后重试");
throw new BusinessException("服务时间为08:00-20:00,您发起的咨询暂时没有医生回答,医生上班后会第一时间回复您。");
}
ScheduleRecordEntity scheduleRecordEntity = new ScheduleRecordEntity();
......
......@@ -5,9 +5,8 @@ import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.doctoruser.api.pojo.base.dto.doctor.QueryPersonnelInfoReq;
import com.doctoruser.api.pojo.base.vo.doctor.PersonnelInfo;
import com.ebaiyihui.family.doctor.common.dto.ImAccountReqDTO;
import com.ebaiyihui.family.doctor.common.dto.ImInfoDetailDocReqDTO;
import com.ebaiyihui.family.doctor.common.dto.ImInfoListDocReqDTO;
import com.ebaiyihui.family.doctor.common.bo.Result;
import com.ebaiyihui.family.doctor.common.dto.*;
import com.ebaiyihui.family.doctor.common.vo.*;
import com.ebaiyihui.family.doctor.server.common.constants.IMInformConstants;
import com.ebaiyihui.family.doctor.server.common.constants.ImConstants;
......@@ -24,6 +23,7 @@ import com.ebaiyihui.family.doctor.server.service.ImChatTemplate;
import com.ebaiyihui.family.doctor.server.service.PatientSignService;
import com.ebaiyihui.family.doctor.server.util.IDCardUtil;
import com.ebaiyihui.family.doctor.server.util.PageUtil;
import com.ebaiyihui.family.doctor.server.util.ThirdOrderPushUtil;
import com.ebaiyihui.framework.response.BaseResponse;
import com.ebaiyihui.imforward.client.vo.*;
import lombok.extern.slf4j.Slf4j;
......@@ -63,6 +63,9 @@ public class PatientSignServiceImpl implements PatientSignService {
@Autowired
private ImChatTemplate imChatTemplate;
@Autowired
private ThirdOrderPushUtil thirdOrderPushUtil;
@Override
public BaseResponse<List<IMSingleMsgResultVO>> getAllMsgContent(IMQueryMsgReqVO reqVO) {
......@@ -131,7 +134,18 @@ public class PatientSignServiceImpl implements PatientSignService {
.build();
// 患者信息
resVo.setPatientName(patientSignEntity.getPatientName());
// 查询患者头像
resVo.setPatientPortrait("");
UserInfoDTO userInfoDTO = new UserInfoDTO();
userInfoDTO.setPhone(patientSignEntity.getPatientPhone());
String userPicResult = thirdOrderPushUtil.getUserPic(userInfoDTO);
if (StringUtils.isNotEmpty(userPicResult)) {
Result<String> upResult = JSON.parseObject(userPicResult, Result.class);
if (upResult.isSuccess()) {
resVo.setPatientPortrait(upResult.getData());
}
}
resVo.setDoctorId(patientSignEntity.getDoctorId());
......@@ -234,6 +248,15 @@ public class PatientSignServiceImpl implements PatientSignService {
patientInfoVo.setCredNo(patientEntity.getCredNo());
patientInfoVo.setPatientUserId(patientSignEntity.getPatientUserId());
patientInfoVo.setPortrait("");
UserInfoDTO userInfoDTO = new UserInfoDTO();
userInfoDTO.setPhone(patientSignEntity.getPatientPhone());
String userPicResult = thirdOrderPushUtil.getUserPic(userInfoDTO);
if (StringUtils.isNotEmpty(userPicResult)) {
Result<String> upResult = JSON.parseObject(userPicResult, Result.class);
if (upResult.isSuccess()) {
patientInfoVo.setPortrait(upResult.getData());
}
}
resVo.setPatientInfo(patientInfoVo);
// 获取医生基本信息
......@@ -311,6 +334,19 @@ public class PatientSignServiceImpl implements PatientSignService {
return patientSignMapper.updateById(patientSignEntity);
}
@Override
public BaseResponse<String> queryMasterUrl(MasterUrlDTO reqVo) {
String resulStr = "";
String result = thirdOrderPushUtil.getMasterUrl(reqVo);
if (StringUtils.isNotEmpty(result)) {
Result<String> muResult = JSON.parseObject(result, Result.class);
if (muResult.isSuccess()) {
resulStr = muResult.getData();
}
}
return BaseResponse.success(resulStr);
}
public ImAccountVo getImAccounts(PatientSignEntity patientSignEntity, String admId, String imAppCode, String doctorId) {
ImAccountVo admission = new ImAccountVo();
......
......@@ -3,6 +3,7 @@ package com.ebaiyihui.family.doctor.server.task;
import com.alibaba.fastjson.JSONObject;
import com.ebaiyihui.family.doctor.common.bo.Result;
import com.ebaiyihui.family.doctor.common.dto.HealthInfoDTO;
import com.ebaiyihui.family.doctor.common.dto.NotifyConsultDataDTO;
import com.ebaiyihui.family.doctor.common.dto.SendImMsgDTO;
import com.ebaiyihui.family.doctor.server.common.constants.CommonConstants;
import com.ebaiyihui.family.doctor.server.common.constants.ImConstants;
......@@ -24,6 +25,7 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.util.ObjectUtils;
import java.util.ArrayList;
import java.util.Date;
......@@ -195,6 +197,21 @@ public class SignedTask {
patientSignEntity.setSignEndTime(endTime);
} else {
patientSignEntity.setStatus(StatusEnum.FINISH_APPLY.getValue());
MobileBenefitPackageEntity entity = mobileBenefitPackageMapper.queryByPhone(patientSignEntity.getPatientPhone(),
patientSignEntity.getPackageOrderId(), "1");
if (!ObjectUtils.isEmpty(entity)) {
// 推送第三方权益使用
NotifyConsultDataDTO notifyConsultDataDTO = new NotifyConsultDataDTO();
notifyConsultDataDTO.setActivateOrderId(patientSignEntity.getPackageOrderId());
notifyConsultDataDTO.setConsultOrderNo(patientSignEntity.getAdmId());
notifyConsultDataDTO.setStatus(String.valueOf(StatusEnum.FINISH_APPLY.getValue()));
notifyConsultDataDTO.setProductId(entity.getProductId());
notifyConsultDataDTO.setPatientId(entity.getUserId());
notifyConsultDataDTO.setExpertName(patientSignEntity.getDoctorName());
notifyConsultDataDTO.setOrderDate(DateUtils.dateToFullString(patientSignEntity.getCreateTime()));
notifyConsultDataDTO.setSupplierCode(CommonConstants.SUPPLIER_CODE_JTYS);
thirdOrderPushUtil.syncBenefitUsedOrder(notifyConsultDataDTO, null);
}
}
patientSignSevice.updateById(patientSignEntity);
mobileBenefitPackageMapper.updateVersion(mbp);
......
......@@ -16,6 +16,7 @@ import org.springframework.stereotype.Component;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
/**
* @ClassName: ThirdOrderPushUtil
......@@ -97,8 +98,11 @@ public class ThirdOrderPushUtil {
}
@Async
public void syncBenefitUsedOrder(NotifyConsultDataDTO notifyConsultDataDTO) {
public void syncBenefitUsedOrder(NotifyConsultDataDTO notifyConsultDataDTO, Long sleepTime) {
try {
if (Objects.nonNull(sleepTime)) {
Thread.sleep(10000);
}
String param = JSONObject.toJSONString(notifyConsultDataDTO);
log.info("syncBenefitUsedOrder请求入参{}", param);
String result = HttpKit.jsonPost(projProperties.getFamilyDoctorThirdUrl() + UrlConstants.PUSH_DATA_URL, param, getThirdHead(notifyConsultDataDTO));
......@@ -216,16 +220,17 @@ public class ThirdOrderPushUtil {
*
* @param userInfoDTO
*/
public void getUserPic(UserInfoDTO userInfoDTO) {
public String getUserPic(UserInfoDTO userInfoDTO) {
String result = "";
try {
String param = JSONObject.toJSONString(userInfoDTO);
log.info("getUserPic请求入参{}", param);
String result = HttpKit.jsonPost(projProperties.getFamilyDoctorThirdUrl() + UrlConstants.USER_PIC_URL, param, getThirdHead(userInfoDTO));
result = HttpKit.jsonPost(projProperties.getFamilyDoctorThirdUrl() + UrlConstants.USER_PIC_URL, param, getThirdHead(userInfoDTO));
log.info("getUserPic请求返参{}", param);
} catch (Exception e) {
log.error("getUserPic请求失败:{}", e);
}
return result;
}
/**
......@@ -261,4 +266,41 @@ public class ThirdOrderPushUtil {
}
}
/**
* 查询资源落地页
*
* @param masterUrlDTO
*/
public String getMasterUrl(MasterUrlDTO masterUrlDTO) {
String result = "";
try {
String param = JSONObject.toJSONString(masterUrlDTO);
log.info("getMasterUrl请求入参{}", param);
result = HttpKit.jsonPost(projProperties.getFamilyDoctorThirdUrl() + UrlConstants.MASTER_URL, param, getThirdHead(masterUrlDTO));
log.info("getMasterUrl请求返参{}", param);
} catch (Exception e) {
log.error("getMasterUrl请求失败:{}", e);
}
return result;
}
/**
* 查询用户报告详情
*
* @param reportDetailDTO
*/
public String getReportDetail(ReportDetailDTO reportDetailDTO) {
String result = "";
try {
String param = JSONObject.toJSONString(reportDetailDTO);
log.info("getReportDetail请求入参{}", param);
result = HttpKit.jsonPost(projProperties.getFamilyDoctorThirdUrl() + UrlConstants.REPORT_DETAIL_URL, param, getThirdHead(reportDetailDTO));
log.info("getReportDetail请求返参{}", param);
} catch (Exception e) {
log.error("getReportDetail请求失败:{}", e);
}
return result;
}
}
......@@ -59,7 +59,9 @@
mobile_benefit_package
WHERE
phone = #{mobile} and activateOrderId = #{activateOrderId}
<if test="flag!=null and flag!=''">
and NOW() BETWEEN STR_TO_DATE(benefitsStartTime, '%Y-%m-%d %H:%i:%s') AND STR_TO_DATE(benefitsEndTime, '%Y-%m-%d %H:%i:%s')
</if>
ORDER BY
x_create_time DESC
LIMIT 0,1
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论