Browse Source

模板引用记录

gaodm 5 years ago
parent
commit
dce27b60fc

+ 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());
                 = tranServiceClient.getDoctorInfoById(templateQuoteVO.getDoctorId());
         RespDTOUtil.respNGDeal(res, "该医生不存在!");
         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, "无权引用该模板!");
                 throw new CommonException(CommonErrorCode.NO_PERMISSION, "无权引用该模板!");
             }
             }
         }
         }
@@ -69,6 +69,11 @@ public class TemplateQuoteFacade extends TemplateQuoteServiceImpl {
         templateQuote.setGmtCreate(now);
         templateQuote.setGmtCreate(now);
         templateQuote.setGmtModified(now);
         templateQuote.setGmtModified(now);
 
 
-        return this.save(templateQuote);
+        boolean resSave = this.save(templateQuote);
+        if (!resSave) {
+            throw new CommonException(CommonErrorCode.INSERT_DATA_FAILED, "引用模板记录失败!");
+        }
+
+        return resSave;
     }
     }
 }
 }