فهرست منبع

add
队列名称不能重复

lifang 1 ماه پیش
والد
کامیت
e5a957d8a6

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

@@ -151,6 +151,17 @@ public class BizReasearchQueueServiceImpl implements IBizReasearchQueueService {
                 throw new ServiceException(TRExcCode.SYSTEM_ERROR_B0001,"时间点格式错误");
             }
         }
+        String name = source.getName();
+        String currentUserId = LoginUserStrategy.tr.getCurrentUserId();
+        BizReasearchQueuePO bizReasearchQueuePO = baseRepository.selectOne(new LambdaQueryWrapper<BizReasearchQueuePO>()
+                .ne(StrUtil.isNotBlank(source.getId()), BizReasearchQueuePO::getId, source.getId())
+                .eq(BizReasearchQueuePO::getName, name)
+                .eq(BizReasearchQueuePO::getOwner, currentUserId)
+                .last("limit 1")
+        );
+        if(bizReasearchQueuePO != null){
+            throw new ServiceException(TRExcCode.SYSTEM_ERROR_B0001,"队列名称不能重复");
+        }
     }
 
     /**