|
|
@ -1,6 +1,7 @@ |
|
|
|
package com.epmet.commons.tools.aspect; |
|
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil; |
|
|
|
import cn.hutool.core.bean.copier.CopyOptions; |
|
|
|
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|
|
|
import com.epmet.commons.tools.exception.EpmetException; |
|
|
|
import com.epmet.commons.tools.redis.RedisUtils; |
|
|
@ -71,13 +72,13 @@ public class ReportRequestAspect { |
|
|
|
private void fillArgsToRequestBody(Object[] args, Map<String, Object> storedParams, Parameter[] parameters) { |
|
|
|
for (int i = 0; i < args.length; i++) { |
|
|
|
Object arg = args[i]; |
|
|
|
//Class<?> argClazz = arg.getClass();
|
|
|
|
RequestBody requestBodyAnno = parameters[i].getAnnotation(RequestBody.class); |
|
|
|
if (arg != null && requestBodyAnno != null) { |
|
|
|
Object argBean = BeanUtil.mapToBean(storedParams, arg.getClass(), true); |
|
|
|
|
|
|
|
// 分页参数需要从
|
|
|
|
BeanUtil.copyProperties(argBean, arg, "pageSize", "pageNo", "isPage"); |
|
|
|
// "pageSize", "pageNo", "isPage"三个属性不从redis拷贝,而是取传递雇来的
|
|
|
|
// redis里面的字段如果是null,则不会赋值给arg
|
|
|
|
BeanUtil.copyProperties(argBean, arg, new CopyOptions(null, true, "pageSize", "pageNo", "isPage")); |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|