From e14e4217b3f53a5cad511b4331cd7c0a40a40db2 Mon Sep 17 00:00:00 2001
From: zjh <1084500556@qq.com>
Date: 星期四, 19 十二月 2024 13:52:03 +0800
Subject: [PATCH] zjh202412019

---
 ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjRulesController.java |   18 +++++++++++++++---
 1 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjRulesController.java b/ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjRulesController.java
index 0418744..f5331c7 100644
--- a/ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjRulesController.java
+++ b/ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjRulesController.java
@@ -15,7 +15,6 @@
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
-import org.checkerframework.checker.units.qual.A;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
@@ -214,14 +213,27 @@
                                   @ApiParam(value = "瀹㈡埛") @RequestParam String cusId,
                                   @ApiParam(value = "鍏抽敭瀛�") @RequestParam(required = false) String keyWord,
                                   @ApiParam(value = "缁撴灉鍊�") @RequestParam(required = false) BigDecimal keyNum) {
+
         List<TjRules> res = new ArrayList<>();
+        if (proId==null){
+            return AjaxResult.success(res);
+        }
+        if (cusId==null){
+            return AjaxResult.success(res);
+        }
         TjCustomer byId = customerService.getById(cusId);
+        if(byId==null){
+            return AjaxResult.success(res);
+        }
         LambdaQueryWrapper<TjRules> wq = new LambdaQueryWrapper<>();
         wq.eq(TjRules::getProId, proId);
         wq.lt(TjRules::getAgeLt, MatchUtils.getAgeByIdCard(byId.getCusIdcard()));
         wq.gt(TjRules::getAgeGt, MatchUtils.getAgeByIdCard(byId.getCusIdcard()));
-        wq.in(TjRules::getSex, 0, byId.getCusSex());
+//        wq.in(TjRules::getSex, 0, byId.getCusSex());
         final List<TjRules> list = tjRulesService.list(wq);
+        if (list==null){
+            return AjaxResult.success(res);
+        }
         for (TjRules tjRules : list) {
             //鍒ゆ柇瑙勫垯绫诲瀷:鏁板��/鏂囧瓧
             if ("2".equals(tjRules.getRuleType())) {
@@ -244,7 +256,7 @@
 
             }
         }
-        if (res.size() > 0) {
+        if (!res.isEmpty()) {
             //寤鸿璧嬪��
             for (TjRules re : res) {
                 LambdaQueryWrapper<TjRuleAdvice> wq1 = new LambdaQueryWrapper<>();

--
Gitblit v1.8.0