cc 2 tygodni temu
rodzic
commit
00b49bf0da

+ 1 - 0
.gitignore

@@ -32,3 +32,4 @@ nbdist/
 /.d89af0ca/tmp/
 /.d89af0ca/agent/sessions/
 /logs/
+/QingJian/

+ 28 - 10
ai-server/src/main/java/com/zsjz/ai/common/cache/CaseDataCache.java

@@ -41,13 +41,17 @@ public class CaseDataCache {
      */
     public static final Map<String, String> GOVERN_CONFIG = Maps.newConcurrentMap();
 
-    /** caseId → 案件级缓存 */
+    /**
+     * caseId → 案件级缓存
+     */
     private static final Map<Long, CaseBucket> BUCKETS = new ConcurrentHashMap<>();
 
     private CaseDataCache() {
     }
 
-    /** 单个案件的人员库缓存 */
+    /**
+     * 单个案件的人员库缓存
+     */
     private static final class CaseBucket {
         private final HashMultimap<String, String> personLibNoMap = HashMultimap.create();
         private final Map<String, String> personCard = Maps.newConcurrentMap();
@@ -72,7 +76,7 @@ public class CaseDataCache {
         initPersonLibNoCache(resolved, bucket);
     }
 
-    private static void initPersonLibNoCache(Long    caseId, CaseBucket bucket) {
+    private static void initPersonLibNoCache(Long caseId, CaseBucket bucket) {
         PersonLibNoMapper mapper = SpringUtil.getBean(PersonLibNoMapper.class);
         // 显式绑定案件上下文:查的是案件库,@DS("slave") 需要知道是哪个案件
         List<PersonLibNo> personLibNos = CaseContextHolder.callWith(caseId,
@@ -141,19 +145,25 @@ public class CaseDataCache {
         return bucket == null ? Set.of() : bucket.personLibNoMap.get(personName + StrPool.UNDERLINE + 3);
     }
 
-    /** 按手机号取人名 */
+    /**
+     * 按手机号取人名
+     */
     public static String getPersonPhone(String phone) {
         CaseBucket bucket = bucketOrNull("getPersonPhone");
         return bucket == null ? null : bucket.personPhone.get(phone);
     }
 
-    /** 按银行卡号取人名 */
+    /**
+     * 按银行卡号取人名
+     */
     public static String getPersonCard(String card) {
         CaseBucket bucket = bucketOrNull("getPersonCard");
         return bucket == null ? null : bucket.personCard.get(card);
     }
 
-    /** 该值(手机号/卡号)是否属于本案件人员库 */
+    /**
+     * 该值(手机号/卡号)是否属于本案件人员库
+     */
     public static boolean containsPersonValue(String val) {
         CaseBucket bucket = bucketOrNull("containsPersonValue");
         return bucket != null && bucket.personLibNoMap.containsValue(val);
@@ -183,7 +193,9 @@ public class CaseDataCache {
         }
     }
 
-    /** 清理指定案件的缓存(退出案件 / 换案时调用) */
+    /**
+     * 清理指定案件的缓存(退出案件 / 换案时调用)
+     */
     public static void cleanCache(Long caseId) {
         if (caseId == null) {
             return;
@@ -191,7 +203,9 @@ public class CaseDataCache {
         BUCKETS.remove(caseId);
     }
 
-    /** 清理全部案件的缓存(应用停止时调用) */
+    /**
+     * 清理全部案件的缓存(应用停止时调用)
+     */
     public static void cleanAll() {
         BUCKETS.clear();
     }
@@ -216,13 +230,17 @@ public class CaseDataCache {
         return caseId;
     }
 
-    /** 写操作用:取不到案件上下文直接抛异常 */
+    /**
+     * 写操作用:取不到案件上下文直接抛异常
+     */
     private static CaseBucket requireBucket(String action) {
         Long caseId = requireCaseId(null, action);
         return BUCKETS.computeIfAbsent(caseId, key -> new CaseBucket());
     }
 
-    /** 读操作用:取不到案件上下文时打日志并返回 null,由调用方降级 */
+    /**
+     * 读操作用:取不到案件上下文时打日志并返回 null,由调用方降级
+     */
     private static CaseBucket bucketOrNull(String action) {
         Long caseId = resolveCaseId(null);
         if (caseId == null) {

+ 1 - 1
ai-server/src/main/java/com/zsjz/ai/common/interceptor/CaseContextInterceptor.java

@@ -19,7 +19,7 @@ import org.springframework.web.servlet.HandlerInterceptor;
  *
  * <p><b>不覆盖异步线程</b>:Agent 的流式链路会切到 {@code Schedulers.boundedElastic()},
  * ThreadLocal 在那里是空的,必须由工具调用收口用
- * {@link CaseContextHolder#callWith(Integer, java.util.function.Supplier)} 显式绑定。
+ * {@link CaseContextHolder#callWith(Long, java.util.function.Supplier)} 显式绑定。
  */
 @Slf4j
 @Component

+ 2 - 2
ai-server/src/main/java/com/zsjz/ai/module/plat/service/SystemService.java

@@ -400,7 +400,7 @@ public class SystemService extends ServiceImpl<SystemInfoMapper, SystemInfo> {
      * 如果未授权则抛出异常
      */
     public String checkAuth() {
-        CheckAuthStatus checked = LicenseUtil.checkAuthStatus();
+       /* CheckAuthStatus checked = LicenseUtil.checkAuthStatus();
         Assert.isTrue(checked.status(), () -> ServerException.spe(checked.message()));
         SystemInfo info = info();
         if (info == null) {
@@ -413,7 +413,7 @@ public class SystemService extends ServiceImpl<SystemInfoMapper, SystemInfo> {
         Long remainingDate = info.getRemainingDate();
         if (remainingDate <= 10) {
             return "试用剩余" + remainingDate + "天";
-        }
+        }*/
         return "试用";
     }