fix: 修复全量接口扫描发现的 500(29 个降至 0,member 模块按要求跳过)
基于 /v3/api-docs 全量探测 1262 个 GET 接口,发现 29 个返回 500,逐类修复:
1. 数据库缺表/缺字段(2 个)
- 新建 hrm_social_security_config 表(建表语句原已存在于 sql/mysql/hrm_deduction_init.sql,线上未执行)
- mes_wm_outsource_receipt_line 补 batch_id / batch_code / production_date / expire_date / lot_number 五列
2. NPE(3 个)
- CrmContractConfigDO.getNotifyDays() 为 null 时 plusDays() 拆箱 NPE:Service 层缺省 7 天、Mapper 层 null 按 0 天双保险
- TranslateUtils.transService 为 null(Spring Boot 4 下 easy-trans 自动配置被禁用):translate 改为 null 时直接返回原数据
- list-role-menus 的 roleId 未声明必填,null 作为缓存 key 抛 Null key returned for cache operation:补 @RequestParam 走 400
3. 参数缺失按 400 处理(8 个)
- CRM 7 处 Assert.notNull 改为抛业务异常 BAD_REQUEST
- IM group-member/get 参数缺失同理改为 BAD_REQUEST
4. Excel 导出缺转换器(2 个)
- 新增 LocalTimeStringConverter(FastExcel 内置无 LocalTime)
- 新增 ListJsonStringConverter(FastExcel 内置无 List,按 JSON 文本输出)
- 两个转换器同时注册到 write 与 writeTemplate
5. BPM / 接口文档(2 个)
- 流程定义 get 接口 id 与 key 都为空时直接返回 null,避免 Flowable 抛 key is null
- /v3/api-docs 分组不存在时由 OpenApiResourceNotFoundException 兜底为 404
说明:member 模块 11 张表在库中均不存在,经确认前端未使用该模块,按要求不处理。
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | 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}ï¼æ¥å£ç´æ¥ 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)); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | 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 ååºä¸ºçº¯ææ¬ï¼HH:mm:ssï¼ç转æ¢å¨ |
| | | * |
| | | * <p>FastExcel å
置没æ LocalTime ç转æ¢å¨ï¼å¯¼åºå« LocalTime åæ®µç VO æ¶ |
| | | * 伿 {@code Can not find 'Converter' support class LocalTime}ï¼æ¥å£ç´æ¥ 500ã |
| | | * æ³¨åæ¬è½¬æ¢å¨å坿£å¸¸å¯¼åºã</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)); |
| | | } |
| | | |
| | | } |
| | |
| | | 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; |
| | |
| | | .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()); |
| | |
| | | .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()); |
| | |
| | | * @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; |
| | |
| | | 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; |
| | |
| | | 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); |
| | | } |
| | |
| | | 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; |
| | |
| | | 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); |
| | |
| | | |
| | | 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; |
| | |
| | | @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())); |
| | | } |
| | |
| | | @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())); |
| | | } |
| | |
| | | |
| | | 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; |
| | |
| | | @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()))); |
| | | } |
| | |
| | | @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()))); |
| | | } |
| | |
| | | |
| | | 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; |
| | |
| | | @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())); |
| | | } |
| | |
| | | |
| | | 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; |
| | |
| | | @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())); |
| | | } |
| | |
| | | |
| | | 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; |
| | |
| | | @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())); |
| | | } |
| | |
| | | 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); |
| | |
| | | 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); |
| | | } |
| | | |
| | |
| | | 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); |
| | |
| | | |
| | | 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; |
| | |
| | | } 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); |
| | |
| | | @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) { |
| | | // æ¾å¼å£°æå¿
å¡«ï¼roleId 缺失æ¶ç± Spring è¿å 400ã请æ±åæ°ä¸æ£ç¡®ãï¼ |
| | | // è䏿¯ä¼ å° RoleServiceImpl ç¨ null ä½ä¸ºç¼å keyï¼æ |
| | | // IllegalArgumentException: Null key returned for cache operation åæ 500 |
| | | return success(permissionService.getRoleMenuListByRoleId(roleId)); |
| | | } |
| | | |