mirror of
				https://gitee.com/hhyykk/ipms-sjy.git
				synced 2025-10-31 02:08:43 +08:00 
			
		
		
		
	!200 修复导出 Excel 时,报结果码不能为空的错误
Merge pull request !200 from 李树桐/result_code_pr
This commit is contained in:
		| @@ -44,7 +44,7 @@ import static cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeC | |||||||
|  * 满足如下任一条件,则会进行记录: |  * 满足如下任一条件,则会进行记录: | ||||||
|  * 1. 使用 @ApiOperation + 非 @GetMapping |  * 1. 使用 @ApiOperation + 非 @GetMapping | ||||||
|  * 2. 使用 @OperateLog 注解 |  * 2. 使用 @OperateLog 注解 | ||||||
|  * |  * <p> | ||||||
|  * 但是,如果声明 @OperateLog 注解时,将 enable 属性设置为 false 时,强制不记录。 |  * 但是,如果声明 @OperateLog 注解时,将 enable 属性设置为 false 时,强制不记录。 | ||||||
|  * |  * | ||||||
|  * @author 芋道源码 |  * @author 芋道源码 | ||||||
| @@ -77,7 +77,8 @@ public class OperateLogAspect { | |||||||
|         return around0(joinPoint, operateLog, apiOperation); |         return around0(joinPoint, operateLog, apiOperation); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     @Around("!@annotation(io.swagger.annotations.ApiOperation) && @annotation(operateLog)") // 兼容处理,只添加 @OperateLog 注解的情况 |     @Around("!@annotation(io.swagger.annotations.ApiOperation) && @annotation(operateLog)") | ||||||
|  |     // 兼容处理,只添加 @OperateLog 注解的情况 | ||||||
|     public Object around(ProceedingJoinPoint joinPoint, |     public Object around(ProceedingJoinPoint joinPoint, | ||||||
|                          cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog operateLog) throws Throwable { |                          cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog operateLog) throws Throwable { | ||||||
|         return around0(joinPoint, operateLog, null); |         return around0(joinPoint, operateLog, null); | ||||||
| @@ -236,7 +237,6 @@ public class OperateLogAspect { | |||||||
|         } |         } | ||||||
|         operateLogObj.setDuration((int) (System.currentTimeMillis() - startTime.getTime())); |         operateLogObj.setDuration((int) (System.currentTimeMillis() - startTime.getTime())); | ||||||
|         // (正常)处理 resultCode 和 resultMsg 字段 |         // (正常)处理 resultCode 和 resultMsg 字段 | ||||||
|         if (result != null) { |  | ||||||
|         if (result instanceof CommonResult) { |         if (result instanceof CommonResult) { | ||||||
|             CommonResult<?> commonResult = (CommonResult<?>) result; |             CommonResult<?> commonResult = (CommonResult<?>) result; | ||||||
|             operateLogObj.setResultCode(commonResult.getCode()); |             operateLogObj.setResultCode(commonResult.getCode()); | ||||||
| @@ -244,7 +244,6 @@ public class OperateLogAspect { | |||||||
|         } else { |         } else { | ||||||
|             operateLogObj.setResultCode(SUCCESS.getCode()); |             operateLogObj.setResultCode(SUCCESS.getCode()); | ||||||
|         } |         } | ||||||
|         } |  | ||||||
|         // (异常)处理 resultCode 和 resultMsg 字段 |         // (异常)处理 resultCode 和 resultMsg 字段 | ||||||
|         if (exception != null) { |         if (exception != null) { | ||||||
|             operateLogObj.setResultCode(INTERNAL_SERVER_ERROR.getCode()); |             operateLogObj.setResultCode(INTERNAL_SERVER_ERROR.getCode()); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 芋道源码
					芋道源码