This commit is contained in:
Ray.Hao
2025-11-15 15:57:14 +08:00
3 changed files with 11 additions and 2 deletions

View File

@@ -138,6 +138,9 @@ public class LogAspect {
log.setBrowser(userAgent.getBrowser().getName()); log.setBrowser(userAgent.getBrowser().getName());
log.setBrowserVersion(userAgent.getBrowser().getVersion(userAgentString)); log.setBrowserVersion(userAgent.getBrowser().getVersion(userAgentString));
} }
//获取方法名
String methodName = joinPoint.getSignature().getName();
log.setMethod(methodName);
// 保存日志到数据库 // 保存日志到数据库
logService.save(log); logService.save(log);
} }

View File

@@ -56,6 +56,11 @@ public class Log implements Serializable {
*/ */
private String requestUri; private String requestUri;
/**
* 请求方法
*/
private String method;
/** /**
* IP 地址 * IP 地址
*/ */

View File

@@ -108,7 +108,7 @@ public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements De
.orderByAsc(Dept::getSort) .orderByAsc(Dept::getSort)
); );
if (CollectionUtil.isEmpty(deptList)) { if (CollectionUtil.isEmpty(deptList)) {
return Collections.EMPTY_LIST; return Collections.emptyList();
} }
Set<Long> deptIds = deptList.stream() Set<Long> deptIds = deptList.stream()
@@ -238,10 +238,11 @@ public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements De
if (StrUtil.isNotBlank(ids)) { if (StrUtil.isNotBlank(ids)) {
String[] menuIds = ids.split(","); String[] menuIds = ids.split(",");
for (String deptId : menuIds) { for (String deptId : menuIds) {
String patten = "%," + deptId + ",%";
this.update(new LambdaUpdateWrapper<Dept>() this.update(new LambdaUpdateWrapper<Dept>()
.eq(Dept::getId, deptId) .eq(Dept::getId, deptId)
.or() .or()
.apply("CONCAT (',',tree_path,',') LIKE CONCAT('%,',{0},',%')", deptId) .apply("CONCAT (',',tree_path,',') LIKE {0}", patten)
.set(Dept::getIsDeleted, 1) .set(Dept::getIsDeleted, 1)
.set(Dept::getUpdateBy, SecurityUtils.getUserId()) .set(Dept::getUpdateBy, SecurityUtils.getUserId())
); );