|
@@ -426,50 +426,72 @@ public class InquiryInfoFacade extends InquiryInfoServiceImpl {
|
|
if (!inquiryInfo.getHospitalCode().equals(inquiryQuoteVO.getHospitalCode())) {
|
|
if (!inquiryInfo.getHospitalCode().equals(inquiryQuoteVO.getHospitalCode())) {
|
|
throw new CommonException(CommonErrorCode.RPC_ERROR, "医院不一致");
|
|
throw new CommonException(CommonErrorCode.RPC_ERROR, "医院不一致");
|
|
}
|
|
}
|
|
- if (inquiryInfo.getIsQuoted() == 1) {
|
|
|
|
|
|
+
|
|
|
|
+ Date now = DateUtil.now();
|
|
|
|
+ InquiryQuote inquiryQuote = null;
|
|
|
|
+ if (inquiryInfo.getIsQuoted() == 0) {
|
|
|
|
+ inquiryInfo.setGmtModified(now);
|
|
|
|
+ inquiryInfo.setIsQuoted(1);
|
|
|
|
+ if (StringUtil.isBlank(inquiryInfo.getInquiryCode())) {
|
|
|
|
+ inquiryInfo.setInquiryCode(inquiryQuoteVO.getInquiryCode());
|
|
|
|
+ }
|
|
|
|
+ inquiryInfo.setPatientCode(inquiryQuoteVO.getPatientInfo().getCode());
|
|
|
|
+ inquiryInfo.setPatientName(inquiryQuoteVO.getPatientInfo().getName());
|
|
|
|
+ inquiryInfo.setPatientIdNo(inquiryQuoteVO.getPatientInfo().getIdentityNum());
|
|
|
|
+ inquiryInfo.setPatientBirthday(inquiryQuoteVO.getPatientInfo().getBirthday());
|
|
|
|
+ inquiryInfo.setPatientPhone(inquiryQuoteVO.getPatientInfo().getPhone());
|
|
|
|
+ inquiryInfo.setPatientSex(inquiryQuoteVO.getPatientInfo().getSex());
|
|
|
|
+ } else if (sysSetFacade.isQuoteShow(inquiryQuoteVO.getHospitalCode())) {
|
|
|
|
+ QueryWrapper<InquiryQuote> inquiryQuoteQe = new QueryWrapper<>();
|
|
|
|
+ inquiryQuoteQe.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
|
+ .eq("inquiry_id", inquiryQuoteVO.getInquiryId())
|
|
|
|
+ .eq("hospital_code", inquiryQuoteVO.getHospitalCode())
|
|
|
|
+ .eq("hospital_dept_code", inquiryQuoteVO.getDeptInfo().getCode())
|
|
|
|
+ .eq("doctor_code", inquiryQuoteVO.getDoctorInfo().getCode())
|
|
|
|
+ .eq("patient_code", inquiryQuoteVO.getPatientInfo().getCode())
|
|
|
|
+ .eq("inquiry_code", inquiryQuoteVO.getInquiryCode())
|
|
|
|
+ .eq(StringUtil.isNotBlank(inquiryQuoteVO.getSonHospitalCode()),
|
|
|
|
+ "son_hospital_code", inquiryQuoteVO.getSonHospitalCode());
|
|
|
|
+ inquiryQuote = inquiryQuoteFacade.getOne(inquiryQuoteQe, false);
|
|
|
|
+ } else {
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
|
|
|
|
- RespDTO<InquiryQuoteVO> respDTO = tranServiceClient.inquiryQuote(inquiryQuoteVO);
|
|
|
|
- RespDTOUtil.respNGDealCover(respDTO, "病历引用失败");
|
|
|
|
- inquiryQuoteVO = respDTO.data;
|
|
|
|
|
|
+ if (inquiryInfo.getIsQuoted() == 0 || inquiryQuote == null) {
|
|
|
|
+ RespDTO<InquiryQuoteVO> respDTO = tranServiceClient.inquiryQuote(inquiryQuoteVO);
|
|
|
|
+ RespDTOUtil.respNGDealCover(respDTO, "病历引用失败");
|
|
|
|
+ inquiryQuoteVO = respDTO.data;
|
|
|
|
+ }
|
|
|
|
|
|
- Date now = DateUtil.now();
|
|
|
|
- inquiryInfo.setGmtModified(now);
|
|
|
|
- inquiryInfo.setIsQuoted(1);
|
|
|
|
- inquiryInfo.setInquiryCode(inquiryQuoteVO.getInquiryCode());
|
|
|
|
- inquiryInfo.setPatientId(inquiryQuoteVO.getPatientInfo().getId());
|
|
|
|
- inquiryInfo.setPatientCode(inquiryQuoteVO.getPatientInfo().getCode());
|
|
|
|
- inquiryInfo.setPatientName(inquiryQuoteVO.getPatientInfo().getName());
|
|
|
|
- inquiryInfo.setPatientIdNo(inquiryQuoteVO.getPatientInfo().getIdentityNum());
|
|
|
|
- inquiryInfo.setPatientBirthday(inquiryQuoteVO.getPatientInfo().getBirthday());
|
|
|
|
- inquiryInfo.setPatientPhone(inquiryQuoteVO.getPatientInfo().getPhone());
|
|
|
|
- inquiryInfo.setPatientSex(inquiryQuoteVO.getPatientInfo().getSex());
|
|
|
|
- updateById(inquiryInfo);
|
|
|
|
|
|
+ if (inquiryInfo.getIsQuoted() == 0) {
|
|
|
|
+ inquiryInfo.setPatientId(inquiryQuoteVO.getPatientInfo().getId());
|
|
|
|
+ updateById(inquiryInfo);
|
|
|
|
+ }
|
|
|
|
|
|
//插入引用表信息
|
|
//插入引用表信息
|
|
- InquiryQuote inquiryQuote = new InquiryQuote();
|
|
|
|
- BeanUtil.copyProperties(inquiryQuoteVO, inquiryQuote);
|
|
|
|
- inquiryQuote.setGmtCreate(now);
|
|
|
|
|
|
+ if (inquiryQuote == null) {
|
|
|
|
+ inquiryQuote = new InquiryQuote();
|
|
|
|
+ BeanUtil.copyProperties(inquiryQuoteVO, inquiryQuote);
|
|
|
|
+ inquiryQuote.setGmtCreate(now);
|
|
|
|
+ inquiryQuote.setHospitalDeptId(inquiryQuoteVO.getDeptInfo().getId());
|
|
|
|
+ inquiryQuote.setHospitalDeptCode(inquiryQuoteVO.getDeptInfo().getCode());
|
|
|
|
+ inquiryQuote.setHospitalDeptName(inquiryQuoteVO.getDeptInfo().getName());
|
|
|
|
+ inquiryQuote.setDoctorId(inquiryQuoteVO.getDoctorInfo().getId());
|
|
|
|
+ inquiryQuote.setDoctorCode(inquiryQuoteVO.getDoctorInfo().getCode());
|
|
|
|
+ inquiryQuote.setDoctorName(inquiryQuoteVO.getDoctorInfo().getName());
|
|
|
|
+ inquiryQuote.setPatientId(inquiryQuoteVO.getPatientInfo().getId());
|
|
|
|
+ inquiryQuote.setPatientCode(inquiryQuoteVO.getPatientInfo().getCode());
|
|
|
|
+ inquiryQuote.setPatientName(inquiryQuoteVO.getPatientInfo().getName());
|
|
|
|
+ inquiryQuote.setPatientIdNo(inquiryQuoteVO.getPatientInfo().getIdentityNum());
|
|
|
|
+ inquiryQuote.setPatientBirthday(inquiryQuoteVO.getPatientInfo().getBirthday());
|
|
|
|
+ inquiryQuote.setPatientPhone(inquiryQuoteVO.getPatientInfo().getPhone());
|
|
|
|
+ inquiryQuote.setPatientSex(inquiryQuoteVO.getPatientInfo().getSex());
|
|
|
|
+ inquiryQuote.setRegVisitedState(inquiryInfo.getRegVisitedState());
|
|
|
|
+ inquiryQuote.setType(inquiryInfo.getType());
|
|
|
|
+ inquiryQuote.setDataJson(inquiryInfo.getDataJson());
|
|
|
|
+ }
|
|
inquiryQuote.setGmtModified(now);
|
|
inquiryQuote.setGmtModified(now);
|
|
- inquiryQuote.setHospitalDeptId(inquiryQuoteVO.getDeptInfo().getId());
|
|
|
|
- inquiryQuote.setHospitalDeptCode(inquiryQuoteVO.getDeptInfo().getCode());
|
|
|
|
- inquiryQuote.setHospitalDeptName(inquiryQuoteVO.getDeptInfo().getName());
|
|
|
|
- inquiryQuote.setDoctorId(inquiryQuoteVO.getDoctorInfo().getId());
|
|
|
|
- inquiryQuote.setDoctorCode(inquiryQuoteVO.getDoctorInfo().getCode());
|
|
|
|
- inquiryQuote.setDoctorName(inquiryQuoteVO.getDoctorInfo().getName());
|
|
|
|
- inquiryQuote.setPatientId(inquiryQuoteVO.getPatientInfo().getId());
|
|
|
|
- inquiryQuote.setPatientCode(inquiryQuoteVO.getPatientInfo().getCode());
|
|
|
|
- inquiryQuote.setPatientName(inquiryQuoteVO.getPatientInfo().getName());
|
|
|
|
- inquiryQuote.setPatientIdNo(inquiryQuoteVO.getPatientInfo().getIdentityNum());
|
|
|
|
- inquiryQuote.setPatientBirthday(inquiryQuoteVO.getPatientInfo().getBirthday());
|
|
|
|
- inquiryQuote.setPatientPhone(inquiryQuoteVO.getPatientInfo().getPhone());
|
|
|
|
- inquiryQuote.setPatientSex(inquiryQuoteVO.getPatientInfo().getSex());
|
|
|
|
- inquiryQuote.setRegVisitedState(inquiryInfo.getRegVisitedState());
|
|
|
|
- inquiryQuote.setType(inquiryInfo.getType());
|
|
|
|
- inquiryQuote.setDataJson(inquiryInfo.getDataJson());
|
|
|
|
-
|
|
|
|
- inquiryQuoteFacade.save(inquiryQuote);
|
|
|
|
|
|
+ inquiryQuoteFacade.saveOrUpdate(inquiryQuote);
|
|
|
|
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
@@ -520,7 +542,7 @@ public class InquiryInfoFacade extends InquiryInfoServiceImpl {
|
|
.eq("inquiry_code", inquiryQuoteForIcssVO.getInquiryCode())
|
|
.eq("inquiry_code", inquiryQuoteForIcssVO.getInquiryCode())
|
|
.eq(StringUtil.isNotBlank(inquiryQuoteForIcssVO.getSonHospitalCode()),
|
|
.eq(StringUtil.isNotBlank(inquiryQuoteForIcssVO.getSonHospitalCode()),
|
|
"son_hospital_code", inquiryQuoteForIcssVO.getSonHospitalCode());
|
|
"son_hospital_code", inquiryQuoteForIcssVO.getSonHospitalCode());
|
|
- inquiryQuote = inquiryQuoteFacade.getOne(inquiryQuoteQe);
|
|
|
|
|
|
+ inquiryQuote = inquiryQuoteFacade.getOne(inquiryQuoteQe, false);
|
|
} else {
|
|
} else {
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|