|
@@ -54,8 +54,8 @@ public class TemplateQuoteFacade extends TemplateQuoteServiceImpl {
|
|
|
= tranServiceClient.getDoctorInfoById(templateQuoteVO.getDoctorId());
|
|
|
RespDTOUtil.respNGDeal(res, "该医生不存在!");
|
|
|
//逻辑验证
|
|
|
- if (templateInfo.getTemplateType().equals(TemplateTypeEnum.PersonalTemplate.getKey())){
|
|
|
- if (!templateInfo.getDoctorId().equals(templateQuoteVO.getDoctorId())){
|
|
|
+ if (templateInfo.getTemplateType().equals(TemplateTypeEnum.PersonalTemplate.getKey())) {
|
|
|
+ if (!templateInfo.getDoctorId().equals(templateQuoteVO.getDoctorId())) {
|
|
|
throw new CommonException(CommonErrorCode.NO_PERMISSION, "无权引用该模板!");
|
|
|
}
|
|
|
}
|
|
@@ -69,6 +69,11 @@ public class TemplateQuoteFacade extends TemplateQuoteServiceImpl {
|
|
|
templateQuote.setGmtCreate(now);
|
|
|
templateQuote.setGmtModified(now);
|
|
|
|
|
|
- return this.save(templateQuote);
|
|
|
+ boolean resSave = this.save(templateQuote);
|
|
|
+ if (!resSave) {
|
|
|
+ throw new CommonException(CommonErrorCode.INSERT_DATA_FAILED, "引用模板记录失败!");
|
|
|
+ }
|
|
|
+
|
|
|
+ return resSave;
|
|
|
}
|
|
|
}
|