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

feat:家庭医生初始化

上级 ee138f31
...@@ -68,7 +68,7 @@ public class RabbitConsumer { ...@@ -68,7 +68,7 @@ public class RabbitConsumer {
notifyConsultDataDTO.setExpertName(patientSignEntity.getDoctorName()); notifyConsultDataDTO.setExpertName(patientSignEntity.getDoctorName());
notifyConsultDataDTO.setOrderDate(DateUtils.dateToFullString(patientSignEntity.getCreateTime())); notifyConsultDataDTO.setOrderDate(DateUtils.dateToFullString(patientSignEntity.getCreateTime()));
notifyConsultDataDTO.setSupplierCode(CommonConstants.SUPPLIER_CODE_JTYS); notifyConsultDataDTO.setSupplierCode(CommonConstants.SUPPLIER_CODE_JTYS);
thirdOrderPushUtil.syncBenefitUsedOrder(notifyConsultDataDTO); thirdOrderPushUtil.syncBenefitUsedOrder(notifyConsultDataDTO, null);
} }
} }
} catch (Exception e) { } catch (Exception e) {
......
...@@ -209,6 +209,25 @@ public class PatientServiceImpl implements PatientService { ...@@ -209,6 +209,25 @@ public class PatientServiceImpl implements PatientService {
SignStatus.CANCEL.getValue().equals(reqVo.getSignStatus()) ? ImSignStatus.REISSUE_SUC.getValue() : SignStatus.CANCEL.getValue().equals(reqVo.getSignStatus()) ? ImSignStatus.REISSUE_SUC.getValue() :
ImSignStatus.INQUIRY_SCH_DOC.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())) { if (!SignStatus.NORMAL.getValue().equals(reqVo.getSignStatus())) {
// 推送第三方权益使用 // 推送第三方权益使用
NotifyConsultDataDTO notifyConsultDataDTO = new NotifyConsultDataDTO(); NotifyConsultDataDTO notifyConsultDataDTO = new NotifyConsultDataDTO();
...@@ -220,7 +239,7 @@ public class PatientServiceImpl implements PatientService { ...@@ -220,7 +239,7 @@ public class PatientServiceImpl implements PatientService {
notifyConsultDataDTO.setExpertName(reqVo.getDoctorName()); notifyConsultDataDTO.setExpertName(reqVo.getDoctorName());
notifyConsultDataDTO.setOrderDate(DateUtils.dateToFullString(patientSignEntity.getCreateTime())); notifyConsultDataDTO.setOrderDate(DateUtils.dateToFullString(patientSignEntity.getCreateTime()));
notifyConsultDataDTO.setSupplierCode(CommonConstants.SUPPLIER_CODE_JTYS); notifyConsultDataDTO.setSupplierCode(CommonConstants.SUPPLIER_CODE_JTYS);
thirdOrderPushUtil.syncBenefitUsedOrder(notifyConsultDataDTO); thirdOrderPushUtil.syncBenefitUsedOrder(notifyConsultDataDTO, 10000L);
if (SignStatus.CANCEL.getValue().equals(reqVo.getSignStatus())) { if (SignStatus.CANCEL.getValue().equals(reqVo.getSignStatus())) {
// 推送第三方权益使用 // 推送第三方权益使用
...@@ -233,7 +252,7 @@ public class PatientServiceImpl implements PatientService { ...@@ -233,7 +252,7 @@ public class PatientServiceImpl implements PatientService {
notifyConsultDataDTO2.setExpertName(reqVo.getDoctorName()); notifyConsultDataDTO2.setExpertName(reqVo.getDoctorName());
notifyConsultDataDTO2.setOrderDate(DateUtils.dateToFullString(patientSignEntity.getCreateTime())); notifyConsultDataDTO2.setOrderDate(DateUtils.dateToFullString(patientSignEntity.getCreateTime()));
notifyConsultDataDTO2.setSupplierCode(CommonConstants.SUPPLIER_CODE_JTYS); notifyConsultDataDTO2.setSupplierCode(CommonConstants.SUPPLIER_CODE_JTYS);
thirdOrderPushUtil.syncBenefitUsedOrder(notifyConsultDataDTO2); thirdOrderPushUtil.syncBenefitUsedOrder(notifyConsultDataDTO2, 10000L);
} }
} else { } else {
if (Objects.nonNull(oldPatientSignEntity)) { if (Objects.nonNull(oldPatientSignEntity)) {
...@@ -242,25 +261,6 @@ public class PatientServiceImpl implements PatientService { ...@@ -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提示语 // 推送app提示语
goEasyPushService.newOrderToReceive(admId); goEasyPushService.newOrderToReceive(admId);
......
...@@ -210,7 +210,7 @@ public class SignedTask { ...@@ -210,7 +210,7 @@ public class SignedTask {
notifyConsultDataDTO.setExpertName(patientSignEntity.getDoctorName()); notifyConsultDataDTO.setExpertName(patientSignEntity.getDoctorName());
notifyConsultDataDTO.setOrderDate(DateUtils.dateToFullString(patientSignEntity.getCreateTime())); notifyConsultDataDTO.setOrderDate(DateUtils.dateToFullString(patientSignEntity.getCreateTime()));
notifyConsultDataDTO.setSupplierCode(CommonConstants.SUPPLIER_CODE_JTYS); notifyConsultDataDTO.setSupplierCode(CommonConstants.SUPPLIER_CODE_JTYS);
thirdOrderPushUtil.syncBenefitUsedOrder(notifyConsultDataDTO); thirdOrderPushUtil.syncBenefitUsedOrder(notifyConsultDataDTO, null);
} }
} }
patientSignSevice.updateById(patientSignEntity); patientSignSevice.updateById(patientSignEntity);
......
...@@ -16,6 +16,7 @@ import org.springframework.stereotype.Component; ...@@ -16,6 +16,7 @@ import org.springframework.stereotype.Component;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.Objects;
/** /**
* @ClassName: ThirdOrderPushUtil * @ClassName: ThirdOrderPushUtil
...@@ -97,8 +98,11 @@ public class ThirdOrderPushUtil { ...@@ -97,8 +98,11 @@ public class ThirdOrderPushUtil {
} }
@Async @Async
public void syncBenefitUsedOrder(NotifyConsultDataDTO notifyConsultDataDTO) { public void syncBenefitUsedOrder(NotifyConsultDataDTO notifyConsultDataDTO, Long sleepTime) {
try { try {
if (Objects.nonNull(sleepTime)) {
Thread.sleep(10000);
}
String param = JSONObject.toJSONString(notifyConsultDataDTO); String param = JSONObject.toJSONString(notifyConsultDataDTO);
log.info("syncBenefitUsedOrder请求入参{}", param); log.info("syncBenefitUsedOrder请求入参{}", param);
String result = HttpKit.jsonPost(projProperties.getFamilyDoctorThirdUrl() + UrlConstants.PUSH_DATA_URL, param, getThirdHead(notifyConsultDataDTO)); String result = HttpKit.jsonPost(projProperties.getFamilyDoctorThirdUrl() + UrlConstants.PUSH_DATA_URL, param, getThirdHead(notifyConsultDataDTO));
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论