From 730f9b0c25a6c111dab1ea4a1ac5e1da9a48f765 Mon Sep 17 00:00:00 2001
From: xiaoyi <908147524@qq.com>
Date: 星期二, 03 十一月 2026 19:58:35 +0800
Subject: [PATCH] fix: 修复全量接口扫描发现的 500(29 个降至 0,member 模块按要求跳过)

---
 yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/CrmReceivableController.java                       |    6 +
 yudao-module-system/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/PermissionController.java                    |    5 +
 yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/excel/core/convert/ListJsonStringConverter.java  |   39 +++++++++++++
 yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/CrmReceivablePlanController.java                   |    6 +
 yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/excel/core/convert/LocalTimeStringConverter.java |   41 +++++++++++++
 yudao-module-bpm/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/BpmProcessDefinitionController.java                |    9 ++
 yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/contact/CrmContactController.java                             |   10 ++
 yudao-module-im/src/main/java/cn/iocoder/yudao/module/im/controller/admin/group/ImGroupMemberController.java                              |    7 +
 yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/translate/core/TranslateUtils.java             |    6 +
 yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/contract/CrmContractController.java                           |   10 ++
 yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/dal/mysql/contract/CrmContractMapper.java                                      |    8 ++
 yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/core/handler/GlobalExceptionHandler.java       |    6 ++
 yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/service/contract/CrmContractServiceImpl.java                                   |   10 +++
 yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/excel/core/util/ExcelUtils.java                  |    6 ++
 yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/invoice/CrmInvoiceController.java                             |    6 +
 15 files changed, 161 insertions(+), 14 deletions(-)

diff --git a/yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/excel/core/convert/ListJsonStringConverter.java b/yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/excel/core/convert/ListJsonStringConverter.java
new file mode 100644
index 0000000..37a5ebf
--- /dev/null
+++ b/yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/excel/core/convert/ListJsonStringConverter.java
@@ -0,0 +1,39 @@
+package cn.iocoder.yudao.framework.excel.core.convert;
+
+import cn.hutool.json.JSONUtil;
+import cn.idev.excel.converters.Converter;
+import cn.idev.excel.enums.CellDataTypeEnum;
+import cn.idev.excel.metadata.GlobalConfiguration;
+import cn.idev.excel.metadata.data.WriteCellData;
+import cn.idev.excel.metadata.property.ExcelContentProperty;
+
+import java.util.List;
+
+/**
+ * List 鍐欏嚭涓� JSON 鏂囨湰鐨勮浆鎹㈠櫒
+ *
+ * <p>FastExcel 鍐呯疆娌℃湁 List 鐨勮浆鎹㈠櫒锛屽鍑哄惈 List 瀛楁鐨� VO 鏃�
+ * 浼氭姏 {@code Can not find 'Converter' support class List}锛屾帴鍙g洿鎺� 500銆�
+ * 鏈浆鎹㈠櫒鎶婇泦鍚堝簭鍒楀寲鎴� JSON 鏂囨湰鍐欏叆鍗曞厓鏍硷紝淇濊瘉瀵煎嚭鍙敤銆�</p>
+ *
+ * @author 瓒呯骇绠$悊鍛�
+ */
+public class ListJsonStringConverter implements Converter<List> {
+
+    @Override
+    public Class<List> supportJavaTypeKey() {
+        return List.class;
+    }
+
+    @Override
+    public CellDataTypeEnum supportExcelTypeKey() {
+        return CellDataTypeEnum.STRING;
+    }
+
+    @Override
+    public WriteCellData<?> convertToExcelData(List value, ExcelContentProperty contentProperty,
+                                               GlobalConfiguration globalConfiguration) {
+        return new WriteCellData<>(JSONUtil.toJsonStr(value));
+    }
+
+}
diff --git a/yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/excel/core/convert/LocalTimeStringConverter.java b/yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/excel/core/convert/LocalTimeStringConverter.java
new file mode 100644
index 0000000..413971f
--- /dev/null
+++ b/yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/excel/core/convert/LocalTimeStringConverter.java
@@ -0,0 +1,41 @@
+package cn.iocoder.yudao.framework.excel.core.convert;
+
+import cn.idev.excel.converters.Converter;
+import cn.idev.excel.enums.CellDataTypeEnum;
+import cn.idev.excel.metadata.GlobalConfiguration;
+import cn.idev.excel.metadata.data.WriteCellData;
+import cn.idev.excel.metadata.property.ExcelContentProperty;
+
+import java.time.LocalTime;
+import java.time.format.DateTimeFormatter;
+
+/**
+ * LocalTime 鍐欏嚭涓虹函鏂囨湰锛圚H:mm:ss锛夌殑杞崲鍣�
+ *
+ * <p>FastExcel 鍐呯疆娌℃湁 LocalTime 鐨勮浆鎹㈠櫒锛屽鍑哄惈 LocalTime 瀛楁鐨� VO 鏃�
+ * 浼氭姏 {@code Can not find 'Converter' support class LocalTime}锛屾帴鍙g洿鎺� 500銆�
+ * 娉ㄥ唽鏈浆鎹㈠櫒鍚庡彲姝e父瀵煎嚭銆�</p>
+ *
+ * @author 瓒呯骇绠$悊鍛�
+ */
+public class LocalTimeStringConverter implements Converter<LocalTime> {
+
+    private static final DateTimeFormatter FORMATTER = DateTimeFormatter.ofPattern("HH:mm:ss");
+
+    @Override
+    public Class<LocalTime> supportJavaTypeKey() {
+        return LocalTime.class;
+    }
+
+    @Override
+    public CellDataTypeEnum supportExcelTypeKey() {
+        return CellDataTypeEnum.STRING;
+    }
+
+    @Override
+    public WriteCellData<?> convertToExcelData(LocalTime value, ExcelContentProperty contentProperty,
+                                               GlobalConfiguration globalConfiguration) {
+        return new WriteCellData<>(value.format(FORMATTER));
+    }
+
+}
diff --git a/yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/excel/core/util/ExcelUtils.java b/yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/excel/core/util/ExcelUtils.java
index e27d523..91e88c2 100644
--- a/yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/excel/core/util/ExcelUtils.java
+++ b/yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/excel/core/util/ExcelUtils.java
@@ -10,6 +10,8 @@
 import cn.idev.excel.exception.ExcelCommonException;
 import cn.idev.excel.exception.ExcelDataConvertException;
 import cn.iocoder.yudao.framework.common.util.http.HttpUtils;
+import cn.iocoder.yudao.framework.excel.core.convert.ListJsonStringConverter;
+import cn.iocoder.yudao.framework.excel.core.convert.LocalTimeStringConverter;
 import lombok.extern.slf4j.Slf4j;
 import cn.iocoder.yudao.framework.excel.core.handler.ColumnWidthMatchStyleStrategy;
 import cn.iocoder.yudao.framework.excel.core.handler.DateAsTextCellWriteHandler;
@@ -51,6 +53,8 @@
                 .registerWriteHandler(new ColumnWidthMatchStyleStrategy()) // 鍩轰簬 column 闀垮害锛岃嚜鍔ㄩ�傞厤銆傛渶澶� 255 瀹藉害
                 .registerWriteHandler(new SelectSheetWriteHandler(head)) // 鍩轰簬鍥哄畾 sheet 瀹炵幇涓嬫媺妗�
                 .registerConverter(new LongStringConverter()) // 閬垮厤 Long 绫诲瀷涓㈠け绮惧害
+                .registerConverter(new LocalTimeStringConverter()) // FastExcel 鍐呯疆鏃� LocalTime锛岀己灏戞椂浼氭姏 Can not find 'Converter'
+                .registerConverter(new ListJsonStringConverter()) // FastExcel 鍐呯疆鏃� List锛岀己灏戞椂浼氭姏 Can not find 'Converter'
                 .build();
         try {
             excelWriter.write(data, FastExcelFactory.writerSheet(sheetName).build());
@@ -82,6 +86,8 @@
                 .registerWriteHandler(new SelectSheetWriteHandler(head))
                 .registerWriteHandler(new DateAsTextCellWriteHandler())
                 .registerConverter(new LongStringConverter())
+                .registerConverter(new LocalTimeStringConverter())
+                .registerConverter(new ListJsonStringConverter())
                 .build();
         try {
             excelWriter.write(data, FastExcelFactory.writerSheet(sheetName).build());
diff --git a/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/translate/core/TranslateUtils.java b/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/translate/core/TranslateUtils.java
index 127e7c4..959b587 100644
--- a/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/translate/core/TranslateUtils.java
+++ b/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/translate/core/TranslateUtils.java
@@ -28,7 +28,11 @@
      * @return 缈昏瘧缁撴灉
      */
     public static <T extends VO> List<T> translate(List<T> data) {
-        if (CollUtil.isNotEmpty((data))) {
+        // transService 鐢� TranslateConfig 鍦� easy-trans 鍙敤鏃舵敞鍏ワ紱
+        // Spring Boot 4 涓� easy-trans 鑷姩閰嶇疆琚鐢紙瑙佸悇 profile 鐨� spring.autoconfigure.exclude锛夛紝
+        // 姝ゆ椂 transService 涓� null銆傜炕璇戝彧鏄寮哄睍绀猴紝缂哄け鏃剁洿鎺ヨ繑鍥炲師鏁版嵁锛�
+        // 涓嶈兘璁╁鍑虹被鎺ュ彛鍥犱负缈昏瘧缁勪欢涓嶅彲鐢ㄨ�屾姏 NPE 鍙樻垚 500銆�
+        if (transService != null && CollUtil.isNotEmpty((data))) {
             transService.transBatch(data);
         }
         return data;
diff --git a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/core/handler/GlobalExceptionHandler.java b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/core/handler/GlobalExceptionHandler.java
index cfd1cad..ab16966 100644
--- a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/core/handler/GlobalExceptionHandler.java
+++ b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/core/handler/GlobalExceptionHandler.java
@@ -39,6 +39,7 @@
 import org.springframework.web.multipart.MultipartException;
 import org.springframework.web.servlet.NoHandlerFoundException;
 import org.springframework.web.servlet.resource.NoResourceFoundException;
+import org.springdoc.api.OpenApiResourceNotFoundException;
 import tools.jackson.databind.exc.InvalidFormatException;
 
 import java.time.LocalDateTime;
@@ -108,6 +109,11 @@
         if (ex instanceof NoResourceFoundException) {
             return noResourceFoundExceptionHandler(request, (NoResourceFoundException) ex);
         }
+        // /v3/api-docs/{group} 浼犲叆涓嶅瓨鍦ㄧ殑鍒嗙粍锛氬睘浜庤祫婧愪笉瀛樺湪锛屽簲杩斿洖 404 鑰屼笉鏄� 500
+        if (ex instanceof OpenApiResourceNotFoundException) {
+            log.warn("[openApiResourceNotFoundExceptionHandler][{}]", ex.getMessage());
+            return CommonResult.error(NOT_FOUND.getCode(), "鎺ュ彛鍒嗙粍涓嶅瓨鍦�: " + ex.getMessage());
+        }
         if (ex instanceof HttpRequestMethodNotSupportedException) {
             return httpRequestMethodNotSupportedExceptionHandler((HttpRequestMethodNotSupportedException) ex);
         }
diff --git a/yudao-module-bpm/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/BpmProcessDefinitionController.java b/yudao-module-bpm/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/BpmProcessDefinitionController.java
index 88717e5..b514168 100644
--- a/yudao-module-bpm/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/BpmProcessDefinitionController.java
+++ b/yudao-module-bpm/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/BpmProcessDefinitionController.java
@@ -1,6 +1,7 @@
 package cn.iocoder.yudao.module.bpm.controller.admin.definition;
 
 import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.util.StrUtil;
 import cn.iocoder.yudao.framework.common.pojo.CommonResult;
 import cn.iocoder.yudao.framework.common.pojo.PageResult;
 import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.process.BpmProcessDefinitionPageReqVO;
@@ -117,7 +118,13 @@
     public CommonResult<BpmProcessDefinitionRespVO> getProcessDefinition(
             @RequestParam(value = "id", required = false) String id,
             @RequestParam(value = "key", required = false) String key) {
-        ProcessDefinition processDefinition = id != null ? processDefinitionService.getProcessDefinition(id)
+        // id 涓� key 閮戒负绌烘椂鐩存帴杩斿洖 null锛氬惁鍒欎細璋冪敤 getActiveProcessDefinition(null)锛�
+        // 鐢� Flowable 鎶� "key is null" 鐨� IllegalArgumentException 鍙樻垚 500
+        if (StrUtil.isBlank(id) && StrUtil.isBlank(key)) {
+            return success(null);
+        }
+        ProcessDefinition processDefinition = StrUtil.isNotBlank(id)
+                ? processDefinitionService.getProcessDefinition(id)
                 : processDefinitionService.getActiveProcessDefinition(key);
         if (processDefinition == null) {
             return success(null);
diff --git a/yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/contact/CrmContactController.java b/yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/contact/CrmContactController.java
index 9054253..c64f0b0 100644
--- a/yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/contact/CrmContactController.java
+++ b/yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/contact/CrmContactController.java
@@ -40,6 +40,8 @@
 
 import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
 import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
+import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception0;
+import static cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstants.BAD_REQUEST;
 import static cn.iocoder.yudao.framework.common.pojo.PageParam.PAGE_SIZE_NONE;
 import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.*;
 import static cn.iocoder.yudao.framework.common.util.collection.MapUtils.findAndThen;
@@ -133,7 +135,9 @@
     @GetMapping("/page-by-customer")
     @Operation(summary = "鑾峰緱鑱旂郴浜哄垎椤碉紝鍩轰簬鎸囧畾瀹㈡埛")
     public CommonResult<PageResult<CrmContactRespVO>> getContactPageByCustomer(@Valid CrmContactPageReqVO pageVO) {
-        Assert.notNull(pageVO.getCustomerId(), "瀹㈡埛缂栧彿涓嶈兘涓虹┖");
+        if (pageVO.getCustomerId() == null) {
+            throw exception0(BAD_REQUEST.getCode(), "瀹㈡埛缂栧彿涓嶈兘涓虹┖");
+        }
         PageResult<CrmContactDO> pageResult = contactService.getContactPageByCustomerId(pageVO);
         return success(new PageResult<>(buildContactDetailList(pageResult.getList()), pageResult.getTotal()));
     }
@@ -141,7 +145,9 @@
     @GetMapping("/page-by-business")
     @Operation(summary = "鑾峰緱鑱旂郴浜哄垎椤碉紝鍩轰簬鎸囧畾鍟嗘満")
     public CommonResult<PageResult<CrmContactRespVO>> getContactPageByBusiness(@Valid CrmContactPageReqVO pageVO) {
-        Assert.notNull(pageVO.getBusinessId(), "鍟嗘満缂栧彿涓嶈兘涓虹┖");
+        if (pageVO.getBusinessId() == null) {
+            throw exception0(BAD_REQUEST.getCode(), "鍟嗘満缂栧彿涓嶈兘涓虹┖");
+        }
         PageResult<CrmContactDO> pageResult = contactService.getContactPageByBusinessId(pageVO);
         return success(new PageResult<>(buildContactDetailList(pageResult.getList()), pageResult.getTotal()));
     }
diff --git a/yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/contract/CrmContractController.java b/yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/contract/CrmContractController.java
index 385af86..cdfab75 100644
--- a/yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/contract/CrmContractController.java
+++ b/yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/contract/CrmContractController.java
@@ -58,6 +58,8 @@
 
 import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
 import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
+import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception0;
+import static cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstants.BAD_REQUEST;
 import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.*;
 import static cn.iocoder.yudao.framework.common.util.collection.MapUtils.findAndThen;
 import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
@@ -150,7 +152,9 @@
     @GetMapping("/page-by-customer")
     @Operation(summary = "鑾峰緱鍚堝悓鍒嗛〉锛屽熀浜庢寚瀹氬鎴�")
     public CommonResult<PageResult<CrmContractRespVO>> getContractPageByCustomer(@Valid CrmContractPageReqVO pageVO) {
-        Assert.notNull(pageVO.getCustomerId(), "瀹㈡埛缂栧彿涓嶈兘涓虹┖");
+        if (pageVO.getCustomerId() == null) {
+            throw exception0(BAD_REQUEST.getCode(), "瀹㈡埛缂栧彿涓嶈兘涓虹┖");
+        }
         PageResult<CrmContractDO> pageResult = contractService.getContractPageByCustomerId(pageVO);
         return success(BeanUtils.toBean(pageResult, CrmContractRespVO.class).setList(buildContractDetailList(pageResult.getList())));
     }
@@ -158,7 +162,9 @@
     @GetMapping("/page-by-business")
     @Operation(summary = "鑾峰緱鍚堝悓鍒嗛〉锛屽熀浜庢寚瀹氬晢鏈�")
     public CommonResult<PageResult<CrmContractRespVO>> getContractPageByBusiness(@Valid CrmContractPageReqVO pageVO) {
-        Assert.notNull(pageVO.getBusinessId(), "鍟嗘満缂栧彿涓嶈兘涓虹┖");
+        if (pageVO.getBusinessId() == null) {
+            throw exception0(BAD_REQUEST.getCode(), "鍟嗘満缂栧彿涓嶈兘涓虹┖");
+        }
         PageResult<CrmContractDO> pageResult = contractService.getContractPageByBusinessId(pageVO);
         return success(BeanUtils.toBean(pageResult, CrmContractRespVO.class).setList(buildContractDetailList(pageResult.getList())));
     }
diff --git a/yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/invoice/CrmInvoiceController.java b/yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/invoice/CrmInvoiceController.java
index 886dad1..91c4f6d 100644
--- a/yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/invoice/CrmInvoiceController.java
+++ b/yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/invoice/CrmInvoiceController.java
@@ -49,6 +49,8 @@
 
 import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
 import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
+import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception0;
+import static cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstants.BAD_REQUEST;
 import static cn.iocoder.yudao.framework.common.pojo.PageParam.PAGE_SIZE_NONE;
 import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertListByFlatMap;
 import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertSet;
@@ -126,7 +128,9 @@
     @GetMapping("/page-by-customer")
     @Operation(summary = "鑾峰緱寮�绁ㄥ垎椤碉紝鍩轰簬鎸囧畾瀹㈡埛")
     public CommonResult<PageResult<CrmInvoiceRespVO>> getInvoicePageByCustomer(@Valid CrmInvoicePageReqVO pageReqVO) {
-        Assert.notNull(pageReqVO.getCustomerId(), "瀹㈡埛缂栧彿涓嶈兘涓虹┖");
+        if (pageReqVO.getCustomerId() == null) {
+            throw exception0(BAD_REQUEST.getCode(), "瀹㈡埛缂栧彿涓嶈兘涓虹┖");
+        }
         PageResult<CrmInvoiceDO> pageResult = invoiceService.getInvoicePageByCustomerId(pageReqVO);
         return success(new PageResult<>(buildInvoiceDetailList(pageResult.getList()), pageResult.getTotal()));
     }
diff --git a/yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/CrmReceivableController.java b/yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/CrmReceivableController.java
index 3c6a398..3148550 100644
--- a/yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/CrmReceivableController.java
+++ b/yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/CrmReceivableController.java
@@ -44,6 +44,8 @@
 
 import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
 import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
+import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception0;
+import static cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstants.BAD_REQUEST;
 import static cn.iocoder.yudao.framework.common.pojo.PageParam.PAGE_SIZE_NONE;
 import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertListByFlatMap;
 import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertSet;
@@ -119,7 +121,9 @@
     @GetMapping("/page-by-customer")
     @Operation(summary = "鑾峰緱鍥炴鍒嗛〉锛屽熀浜庢寚瀹氬鎴�")
     public CommonResult<PageResult<CrmReceivableRespVO>> getReceivablePageByCustomer(@Valid CrmReceivablePageReqVO pageReqVO) {
-        Assert.notNull(pageReqVO.getCustomerId(), "瀹㈡埛缂栧彿涓嶈兘涓虹┖");
+        if (pageReqVO.getCustomerId() == null) {
+            throw exception0(BAD_REQUEST.getCode(), "瀹㈡埛缂栧彿涓嶈兘涓虹┖");
+        }
         PageResult<CrmReceivableDO> pageResult = receivableService.getReceivablePageByCustomerId(pageReqVO);
         return success(new PageResult<>(buildReceivableDetailList(pageResult.getList()), pageResult.getTotal()));
     }
diff --git a/yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/CrmReceivablePlanController.java b/yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/CrmReceivablePlanController.java
index d67d74b..28f8e59 100644
--- a/yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/CrmReceivablePlanController.java
+++ b/yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/CrmReceivablePlanController.java
@@ -41,6 +41,8 @@
 
 import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
 import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
+import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception0;
+import static cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstants.BAD_REQUEST;
 import static cn.iocoder.yudao.framework.common.pojo.PageParam.PAGE_SIZE_NONE;
 import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.*;
 import static cn.iocoder.yudao.framework.common.util.collection.MapUtils.findAndThen;
@@ -113,7 +115,9 @@
     @GetMapping("/page-by-customer")
     @Operation(summary = "鑾峰緱鍥炴璁″垝鍒嗛〉锛屽熀浜庢寚瀹氬鎴�")
     public CommonResult<PageResult<CrmReceivablePlanRespVO>> getReceivablePlanPageByCustomer(@Valid CrmReceivablePlanPageReqVO pageReqVO) {
-        Assert.notNull(pageReqVO.getCustomerId(), "瀹㈡埛缂栧彿涓嶈兘涓虹┖");
+        if (pageReqVO.getCustomerId() == null) {
+            throw exception0(BAD_REQUEST.getCode(), "瀹㈡埛缂栧彿涓嶈兘涓虹┖");
+        }
         PageResult<CrmReceivablePlanDO> pageResult = receivablePlanService.getReceivablePlanPageByCustomerId(pageReqVO);
         return success(new PageResult<>(buildReceivableDetailList(pageResult.getList()), pageResult.getTotal()));
     }
diff --git a/yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/dal/mysql/contract/CrmContractMapper.java b/yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/dal/mysql/contract/CrmContractMapper.java
index 03098d9..c5b2327 100644
--- a/yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/dal/mysql/contract/CrmContractMapper.java
+++ b/yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/dal/mysql/contract/CrmContractMapper.java
@@ -164,7 +164,9 @@
         LocalDateTime endOfToday = LocalDateTimeUtil.endOfDay(LocalDateTime.now());
         if (CrmContractPageReqVO.EXPIRY_TYPE_ABOUT_TO_EXPIRE.equals(pageReqVO.getExpiryType())) { // 鍗冲皢鍒版湡
             query.eq(CrmContractDO::getAuditStatus, CrmAuditStatusEnum.APPROVE.getStatus())
-                    .between(CrmContractDO::getEndTime, beginOfToday, endOfToday.plusDays(config.getNotifyDays()));
+                    // notifyDays 鍙兘涓� null锛堝巻鍙查厤缃湭濉級锛屼负 null 鏃舵寜 0 澶╁鐞嗭紝閬垮厤鎷嗙 NPE
+                .between(CrmContractDO::getEndTime, beginOfToday,
+                        endOfToday.plusDays(config.getNotifyDays() != null ? config.getNotifyDays() : 0));
         } else if (CrmContractPageReqVO.EXPIRY_TYPE_EXPIRED.equals(pageReqVO.getExpiryType())) { // 宸插埌鏈�
             query.eq(CrmContractDO::getAuditStatus, CrmAuditStatusEnum.APPROVE.getStatus())
                     .lt(CrmContractDO::getEndTime, endOfToday);
@@ -199,7 +201,9 @@
         LocalDateTime beginOfToday = LocalDateTimeUtil.beginOfDay(LocalDateTime.now());
         LocalDateTime endOfToday = LocalDateTimeUtil.endOfDay(LocalDateTime.now());
         query.eq(CrmContractDO::getAuditStatus, CrmAuditStatusEnum.APPROVE.getStatus()) // 蹇呴』瀹℃壒閫氳繃锛�
-                .between(CrmContractDO::getEndTime, beginOfToday, endOfToday.plusDays(config.getNotifyDays()));
+                // notifyDays 鍙兘涓� null锛堝巻鍙查厤缃湭濉級锛屼负 null 鏃舵寜 0 澶╁鐞嗭紝閬垮厤鎷嗙 NPE
+                .between(CrmContractDO::getEndTime, beginOfToday,
+                        endOfToday.plusDays(config.getNotifyDays() != null ? config.getNotifyDays() : 0));
         return selectCount(query);
     }
 
diff --git a/yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/service/contract/CrmContractServiceImpl.java b/yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/service/contract/CrmContractServiceImpl.java
index dbc812e..a0c3b54 100644
--- a/yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/service/contract/CrmContractServiceImpl.java
+++ b/yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/service/contract/CrmContractServiceImpl.java
@@ -530,9 +530,19 @@
         if (config == null || Boolean.FALSE.equals(config.getNotifyEnabled())) {
             return 0L;
         }
+        // 鎻愰啋澶╂暟鏈厤缃椂鎸夐粯璁� 7 澶╁鐞嗭紝閬垮厤 config.getNotifyDays() 涓� null 鏃舵媶绠辨姏 NPE 瀵艰嚧鎺ュ彛 500
+        if (config.getNotifyDays() == null) {
+            config = BeanUtils.toBean(config, CrmContractConfigDO.class);
+            config.setNotifyDays(DEFAULT_NOTIFY_DAYS);
+        }
         return contractMapper.selectCountByRemind(userId, config);
     }
 
+    /**
+     * 鍚堝悓鍒版湡鎻愰啋鐨勯粯璁ゆ彁鍓嶅ぉ鏁帮細鍚堝悓鎻愰啋鏈厤缃� notifyDays 鏃朵娇鐢�
+     */
+    private static final Integer DEFAULT_NOTIFY_DAYS = 7;
+
     @Override
     public List<CrmContractDO> getContractListByCustomerIdOwnerUserId(Long customerId, Long ownerUserId) {
         return contractMapper.selectListByCustomerIdOwnerUserId(customerId, ownerUserId);
diff --git a/yudao-module-im/src/main/java/cn/iocoder/yudao/module/im/controller/admin/group/ImGroupMemberController.java b/yudao-module-im/src/main/java/cn/iocoder/yudao/module/im/controller/admin/group/ImGroupMemberController.java
index c752eeb..de42f52 100644
--- a/yudao-module-im/src/main/java/cn/iocoder/yudao/module/im/controller/admin/group/ImGroupMemberController.java
+++ b/yudao-module-im/src/main/java/cn/iocoder/yudao/module/im/controller/admin/group/ImGroupMemberController.java
@@ -27,6 +27,8 @@
 
 import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
 import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
+import static cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstants.BAD_REQUEST;
+import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception0;
 import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList;
 import static cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils.getLoginUserId;
 import static cn.iocoder.yudao.module.im.enums.ErrorCodeConstants.GROUP_MEMBER_NOT_IN_GROUP;
@@ -67,8 +69,9 @@
         } else if (groupId != null && userId != null) {
             member = groupMemberService.getGroupMember(groupId, userId);
         } else {
-            // 閬垮厤 selectByGroupIdAndUserId 鏀跺埌 null 鍙傛暟璧板叏琛ㄦ壂 / 鎶� SQL 寮傚父
-            throw new IllegalArgumentException("鍙傛暟缂哄け锛氶渶浼� id 鎴� (groupId, userId)");
+            // 閬垮厤 selectByGroupIdAndUserId 鏀跺埌 null 鍙傛暟璧板叏琛ㄦ壂 / 鎶� SQL 寮傚父銆�
+            // 杩欓噷灞炰簬瀹㈡埛绔弬鏁伴棶棰橈紝鎶涗笟鍔″紓甯歌繑鍥� 400锛屼笉瑕佺敤 IllegalArgumentException 鍙樻垚 500
+            throw exception0(BAD_REQUEST.getCode(), "鍙傛暟缂哄け锛氶渶浼� id 鎴� (groupId, userId)");
         }
         if (member == null) {
             return success(null);
diff --git a/yudao-module-system/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/PermissionController.java b/yudao-module-system/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/PermissionController.java
index 147ce82..0232e40 100644
--- a/yudao-module-system/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/PermissionController.java
+++ b/yudao-module-system/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/PermissionController.java
@@ -34,7 +34,10 @@
     @Parameter(name = "roleId", description = "瑙掕壊缂栧彿", required = true)
     @GetMapping("/list-role-menus")
     @PreAuthorize("@ss.hasPermission('system:permission:assign-role-menu')")
-    public CommonResult<Set<Long>> getRoleMenuList(Long roleId) {
+    public CommonResult<Set<Long>> getRoleMenuList(@RequestParam("roleId") Long roleId) {
+        // 鏄惧紡澹版槑蹇呭~锛歳oleId 缂哄け鏃剁敱 Spring 杩斿洖 400銆岃姹傚弬鏁颁笉姝g‘銆嶏紝
+        // 鑰屼笉鏄紶鍒� RoleServiceImpl 鐢� null 浣滀负缂撳瓨 key锛屾姏
+        // IllegalArgumentException: Null key returned for cache operation 鍙樻垚 500
         return success(permissionService.getRoleMenuListByRoleId(roleId));
     }
 

--
Gitblit v1.9.3