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

feat:家庭医生初始化

上级 1c2240a5
......@@ -17,4 +17,6 @@ public class Components {
private String content;
private Integer conditionFlag;
}
......@@ -10,6 +10,7 @@ import com.doctoruser.api.pojo.vo.UserInfoByUserIdRespVO;
import com.ebaiyihui.family.doctor.common.bo.*;
import com.ebaiyihui.family.doctor.common.dto.AbnormalDataDTO;
import com.ebaiyihui.family.doctor.common.dto.DoctorIdDTO;
import com.ebaiyihui.family.doctor.common.dto.HealthInfoDTO;
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.IMInformConstants;
......@@ -162,6 +163,23 @@ public class ImChatTemplateImpl implements ImChatTemplate {
if (!StringUtils.isEmpty(sendImMsgDTO.getOldAdmId())) {
PatientSignInfo oldPatientSignInfo = getPatientSignInfo(sendImMsgDTO.getOldAdmId());
content = MessageFormat.format(content, oldPatientSignInfo.getDoctorName(), patientSignInfo.getDoctorName());
// 改签的时候判断患者健康计划是否开启,开启则不发送健康计划信息
if (MsgTempTypeEnum.UP_SUC.getValue().equals(sendImMsgDTO.getType())) {
if (!Objects.nonNull(componentsList.get(i).getConditionFlag())
&& CommonConstants.STATUS_VALID.equals(componentsList.get(i).getConditionFlag())) {
// 查询用户健康计划是否开启状态
HealthInfoDTO healthInfoDTO = new HealthInfoDTO();
healthInfoDTO.setPhone(patientSignInfo.getPatientPhone());
String result = thirdOrderPushUtil.getHealthSchStatus(healthInfoDTO);
if (!StringUtils.isEmpty(result)) {
Result<String> hssResult = JSON.parseObject(result, Result.class);
if (hssResult.isSuccess()) {
continue;
}
}
}
}
}
// 报告异常特殊处理
......@@ -170,9 +188,9 @@ public class ImChatTemplateImpl implements ImChatTemplate {
abnormalDataDTO.setPhone(patientSignInfo.getPatientPhone());
abnormalDataDTO.setAbnormalId(sendImMsgDTO.getAbnormalId());
String result = thirdOrderPushUtil.getAbnormalData(abnormalDataDTO);
if (!StringUtils.isEmpty(result)){
if (!StringUtils.isEmpty(result)) {
Result<String> abResult = JSON.parseObject(result, Result.class);
if (abResult.isSuccess()){
if (abResult.isSuccess()) {
content = MessageFormat.format(content, patientSignInfo.getDoctorName(), abResult.getData());
}
}
......
......@@ -164,16 +164,17 @@ public class ThirdOrderPushUtil {
*
* @param healthInfoDTO
*/
public void getHealthSchStatus(HealthInfoDTO healthInfoDTO) {
public String getHealthSchStatus(HealthInfoDTO healthInfoDTO) {
String result = "";
try {
String param = JSONObject.toJSONString(healthInfoDTO);
log.info("getHealthSchStatus请求入参{}", param);
String result = HttpKit.jsonPost(projProperties.getFamilyDoctorThirdUrl() + UrlConstants.HEALTH_SCHEDULE_STATUS_URL, param, getThirdHead(healthInfoDTO));
result = HttpKit.jsonPost(projProperties.getFamilyDoctorThirdUrl() + UrlConstants.HEALTH_SCHEDULE_STATUS_URL, param, getThirdHead(healthInfoDTO));
log.info("getHealthSchStatus请求返参{}", param);
} catch (Exception e) {
log.error("getHealthSchStatus请求失败:{}", e);
}
return result;
}
/**
......@@ -183,7 +184,6 @@ public class ThirdOrderPushUtil {
*/
public String getHealthRecordWhetherUpdate(HealthInfoDTO healthInfoDTO) {
String result = "";
try {
String param = JSONObject.toJSONString(healthInfoDTO);
log.info("getHealthRecordWhetherUpdate请求入参{}", param);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论