Przeglądaj źródła

修改AI生成问卷组内容术前问卷无法添加问题

zhouzeyu 3 miesięcy temu
rodzic
commit
e99db754e7

+ 0 - 2
tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/dto/BizQuestionGroupAiDTO.java

@@ -30,11 +30,9 @@ public class BizQuestionGroupAiDTO implements Serializable {
     private String type;
 
     @ApiModelProperty(value = "术后推送间隔(小时)",position = 4)
-    @NotNull(message = "术后推送间隔(小时)不能为空")
     private Integer interval;
 
     @ApiModelProperty(value = "术后推送频率(次)",position = 5)
-    @NotNull(message = "术后推送频率(次)不能为空")
     private Integer frequency;
 
 

+ 3 - 0
tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/service/impl/BizQuestionGroupServiceImpl.java

@@ -323,6 +323,9 @@ public class BizQuestionGroupServiceImpl implements IBizQuestionGroupService {
     @Override
     @Cacheable(value = "aiQuestionnaire", key = "#source.toString()")
     public List<BizQuestionDTO> generateAi(BizQuestionGroupAiDTO source) throws NoApiKeyException, InputRequiredException {
+        if (QuestionGroupTypeEnums.AFTER.equals(source.getType()) && source.getInterval() == null && source.getFrequency() == null){
+            throw new ServiceException(TRExcCode.SYSTEM_ERROR_B0001, "请填写问卷推送间隔和推送频率");
+        }
         Generation gen = new Generation();
         Message systemMsg = Message.builder()
                 .role(Role.SYSTEM.getValue())