Merge branch 'master' of https://gitee.com/y_project/RuoYi-Vue into dev
Conflicts: ruoyi-common/src/main/java/com/ruoyi/common/annotation/Log.java ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/LogAspect.java ruoyi-generator/src/main/resources/vm/java/mapper.java.vm
This commit is contained in:
commit
2b53e9d86a
@ -38,4 +38,9 @@ public @interface Log
|
|||||||
* 是否保存请求的参数
|
* 是否保存请求的参数
|
||||||
*/
|
*/
|
||||||
public boolean isSaveRequestData() default true;
|
public boolean isSaveRequestData() default true;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否保存响应的参数
|
||||||
|
*/
|
||||||
|
public boolean isSaveResponseData() default true;
|
||||||
}
|
}
|
||||||
|
@ -91,9 +91,6 @@ public class LogAspect
|
|||||||
// 请求的地址
|
// 请求的地址
|
||||||
String ip = ServletUtils.getClientIP();
|
String ip = ServletUtils.getClientIP();
|
||||||
operLog.setOperIp(ip);
|
operLog.setOperIp(ip);
|
||||||
// 返回参数
|
|
||||||
operLog.setJsonResult(JsonUtils.toJsonString(jsonResult));
|
|
||||||
|
|
||||||
operLog.setOperUrl(ServletUtils.getRequest().getRequestURI());
|
operLog.setOperUrl(ServletUtils.getRequest().getRequestURI());
|
||||||
if (loginUser != null)
|
if (loginUser != null)
|
||||||
{
|
{
|
||||||
@ -112,7 +109,7 @@ public class LogAspect
|
|||||||
// 设置请求方式
|
// 设置请求方式
|
||||||
operLog.setRequestMethod(ServletUtils.getRequest().getMethod());
|
operLog.setRequestMethod(ServletUtils.getRequest().getMethod());
|
||||||
// 处理设置注解上的参数
|
// 处理设置注解上的参数
|
||||||
getControllerMethodDescription(joinPoint, controllerLog, operLog);
|
getControllerMethodDescription(joinPoint, controllerLog, operLog, jsonResult);
|
||||||
// 保存数据库
|
// 保存数据库
|
||||||
SpringUtils.getBean(AsyncService.class).recordOper(operLog);
|
SpringUtils.getBean(AsyncService.class).recordOper(operLog);
|
||||||
}
|
}
|
||||||
@ -132,7 +129,7 @@ public class LogAspect
|
|||||||
* @param operLog 操作日志
|
* @param operLog 操作日志
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public void getControllerMethodDescription(JoinPoint joinPoint, Log log, SysOperLog operLog) throws Exception
|
public void getControllerMethodDescription(JoinPoint joinPoint, Log log, SysOperLog operLog, Object jsonResult) throws Exception
|
||||||
{
|
{
|
||||||
// 设置action动作
|
// 设置action动作
|
||||||
operLog.setBusinessType(log.businessType().ordinal());
|
operLog.setBusinessType(log.businessType().ordinal());
|
||||||
@ -146,6 +143,11 @@ public class LogAspect
|
|||||||
// 获取参数的信息,传入到数据库中。
|
// 获取参数的信息,传入到数据库中。
|
||||||
setRequestValue(joinPoint, operLog);
|
setRequestValue(joinPoint, operLog);
|
||||||
}
|
}
|
||||||
|
// 是否需要保存response,参数和值
|
||||||
|
if (log.isSaveResponseData() && StringUtils.isNotNull(jsonResult))
|
||||||
|
{
|
||||||
|
operLog.setJsonResult(StringUtils.substring(JsonUtils.toJsonString(jsonResult), 0, 2000));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -13,4 +13,70 @@ import org.apache.ibatis.annotations.CacheNamespace;
|
|||||||
*/
|
*/
|
||||||
public interface ${ClassName}Mapper extends BaseMapperPlus<${ClassName}> {
|
public interface ${ClassName}Mapper extends BaseMapperPlus<${ClassName}> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询${functionName}列表
|
||||||
|
*
|
||||||
|
* @param ${className} ${functionName}
|
||||||
|
* @return ${functionName}集合
|
||||||
|
*/
|
||||||
|
public List<${ClassName}> select${ClassName}List(${ClassName} ${className});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增${functionName}
|
||||||
|
*
|
||||||
|
* @param ${className} ${functionName}
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insert${ClassName}(${ClassName} ${className});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改${functionName}
|
||||||
|
*
|
||||||
|
* @param ${className} ${functionName}
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int update${ClassName}(${ClassName} ${className});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除${functionName}
|
||||||
|
*
|
||||||
|
* @param ${pkColumn.javaField} ${functionName}主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int delete${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaType} ${pkColumn.javaField});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除${functionName}
|
||||||
|
*
|
||||||
|
* @param ${pkColumn.javaField}s 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int delete${ClassName}By${pkColumn.capJavaField}s(${pkColumn.javaType}[] ${pkColumn.javaField}s);
|
||||||
|
#if($table.sub)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除${subTable.functionName}
|
||||||
|
*
|
||||||
|
* @param ${pkColumn.javaField}s 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int delete${subClassName}By${pkColumn.capJavaField}s(${pkColumn.javaType}[] ${pkColumn.javaField}s);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量新增${subTable.functionName}
|
||||||
|
*
|
||||||
|
* @param ${subclassName}List ${subTable.functionName}列表
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int batch${subClassName}(List<${subClassName}> ${subclassName}List);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过${functionName}主键删除${subTable.functionName}信息
|
||||||
|
*
|
||||||
|
* @param ${pkColumn.javaField} ${functionName}ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int delete${subClassName}By${subTableFkClassName}(${pkColumn.javaType} ${pkColumn.javaField});
|
||||||
|
#end
|
||||||
}
|
}
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
>
|
>
|
||||||
<el-tag
|
<el-tag
|
||||||
v-else
|
v-else
|
||||||
|
:disable-transitions="true"
|
||||||
:key="item.dictValue"
|
:key="item.dictValue"
|
||||||
:index="index"
|
:index="index"
|
||||||
:type="item.listClass == 'primary' ? '' : item.listClass"
|
:type="item.listClass == 'primary' ? '' : item.listClass"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user