gaodm преди 5 години
родител
ревизия
dce27b60fc
променени са 1 файла, в които са добавени 8 реда и са изтрити 3 реда
  1. 8 3
      icss-service/src/main/java/com/diagbot/facade/TemplateQuoteFacade.java

+ 8 - 3
icss-service/src/main/java/com/diagbot/facade/TemplateQuoteFacade.java

@@ -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;
     }
 }