提交 51473498 authored 作者: 杨凯's avatar 杨凯

feat:家庭医生初始化

上级 ee138f31
......@@ -68,7 +68,7 @@ public class RabbitConsumer {
notifyConsultDataDTO.setExpertName(patientSignEntity.getDoctorName());
notifyConsultDataDTO.setOrderDate(DateUtils.dateToFullString(patientSignEntity.getCreateTime()));
notifyConsultDataDTO.setSupplierCode(CommonConstants.SUPPLIER_CODE_JTYS);
thirdOrderPushUtil.syncBenefitUsedOrder(notifyConsultDataDTO);
thirdOrderPushUtil.syncBenefitUsedOrder(notifyConsultDataDTO, null);
}
}
} catch (Exception e) {
......
......@@ -209,6 +209,25 @@ public class PatientServiceImpl implements PatientService {
SignStatus.CANCEL.getValue().equals(reqVo.getSignStatus()) ? ImSignStatus.REISSUE_SUC.getValue() :
ImSignStatus.INQUIRY_SCH_DOC.getValue());
//放入MQ任务,处理订单到时结束
if ("0".equals(entity.getIsRenew()) || SignStatus.NORMAL.getValue().equals(reqVo.getSignStatus())) {
OrderTaskVo orderTaskVo = new OrderTaskVo();
orderTaskVo.setType(1);
orderTaskVo.setId(String.valueOf(patientSignEntity.getId()));
if ("0".equals(entity.getIsRenew())) {
orderTaskVo.setExpireTime(DateUtils.secondBetween(signStartTime, signEndTime));
}
rabbitProduct.sendDelay(orderTaskVo);
}
// 推送第三方签名相关订单信息
thirdOrderPushUtil.pushSignedOrder(String.valueOf(reqVo.getDoctorId()), reqVo.getPhone(),
SignStatus.SIGNED.getValue().equals(reqVo.getSignStatus()) ? String.valueOf(patientSignEntity.getId()) :
String.valueOf(patientSignEntity.getSignId()),
reqVo.getPackageOrderId(), reqVo.getSignStatus());
imMsgTemplateService.sendImMsg(sendImMsgDTO);
if (!SignStatus.NORMAL.getValue().equals(reqVo.getSignStatus())) {
// 推送第三方权益使用
NotifyConsultDataDTO notifyConsultDataDTO = new NotifyConsultDataDTO();
......@@ -220,7 +239,7 @@ public class PatientServiceImpl implements PatientService {
notifyConsultDataDTO.setExpertName(reqVo.getDoctorName());
notifyConsultDataDTO.setOrderDate(DateUtils.dateToFullString(patientSignEntity.getCreateTime()));
notifyConsultDataDTO.setSupplierCode(CommonConstants.SUPPLIER_CODE_JTYS);
thirdOrderPushUtil.syncBenefitUsedOrder(notifyConsultDataDTO);
thirdOrderPushUtil.syncBenefitUsedOrder(notifyConsultDataDTO, 10000L);
if (SignStatus.CANCEL.getValue().equals(reqVo.getSignStatus())) {
// 推送第三方权益使用
......@@ -233,7 +252,7 @@ public class PatientServiceImpl implements PatientService {
notifyConsultDataDTO2.setExpertName(reqVo.getDoctorName());
notifyConsultDataDTO2.setOrderDate(DateUtils.dateToFullString(patientSignEntity.getCreateTime()));
notifyConsultDataDTO2.setSupplierCode(CommonConstants.SUPPLIER_CODE_JTYS);
thirdOrderPushUtil.syncBenefitUsedOrder(notifyConsultDataDTO2);
thirdOrderPushUtil.syncBenefitUsedOrder(notifyConsultDataDTO2, 10000L);
}
} else {
if (Objects.nonNull(oldPatientSignEntity)) {
......@@ -242,25 +261,6 @@ public class PatientServiceImpl implements PatientService {
}
//放入MQ任务,处理订单到时结束
if ("0".equals(entity.getIsRenew()) || SignStatus.NORMAL.getValue().equals(reqVo.getSignStatus())) {
OrderTaskVo orderTaskVo = new OrderTaskVo();
orderTaskVo.setType(1);
orderTaskVo.setId(String.valueOf(patientSignEntity.getId()));
if ("0".equals(entity.getIsRenew())) {
orderTaskVo.setExpireTime(DateUtils.secondBetween(signStartTime, signEndTime));
}
rabbitProduct.sendDelay(orderTaskVo);
}
// 推送第三方签名相关订单信息
thirdOrderPushUtil.pushSignedOrder(String.valueOf(reqVo.getDoctorId()), reqVo.getPhone(),
SignStatus.SIGNED.getValue().equals(reqVo.getSignStatus()) ? String.valueOf(patientSignEntity.getId()) :
String.valueOf(patientSignEntity.getSignId()),
reqVo.getPackageOrderId(), reqVo.getSignStatus());
imMsgTemplateService.sendImMsg(sendImMsgDTO);
// 推送app提示语
goEasyPushService.newOrderToReceive(admId);
......
......@@ -210,7 +210,7 @@ public class SignedTask {
notifyConsultDataDTO.setExpertName(patientSignEntity.getDoctorName());
notifyConsultDataDTO.setOrderDate(DateUtils.dateToFullString(patientSignEntity.getCreateTime()));
notifyConsultDataDTO.setSupplierCode(CommonConstants.SUPPLIER_CODE_JTYS);
thirdOrderPushUtil.syncBenefitUsedOrder(notifyConsultDataDTO);
thirdOrderPushUtil.syncBenefitUsedOrder(notifyConsultDataDTO, null);
}
}
patientSignSevice.updateById(patientSignEntity);
......
......@@ -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));
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论