1. 去除强制的业务字段 insert 非空校验

2. 修复同步用户错误
3. 同步日志支持接口重跑
4. 新增部门树加载效果优化接口
5. 修复部分 post API 参数注解错误的问题
This commit is contained in:
chenbowen
2025-09-17 16:36:35 +08:00
parent 073c45ff3a
commit c9233e7053
17 changed files with 342 additions and 18 deletions

View File

@@ -5,6 +5,7 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils;
import java.util.List;
import java.util.Set;
import java.util.function.Consumer;
/**
@@ -44,6 +45,21 @@ public class BeanUtils {
return list;
}
public static <S, T> Set<T> toBean(Set<S> source, Class<T> targetType) {
if (source == null) {
return null;
}
return CollectionUtils.convertSet(source, s -> toBean(s, targetType));
}
public static <S, T> Set<T> toBean(Set<S> source, Class<T> targetType, Consumer<T> peek) {
Set<T> set = toBean(source, targetType);
if (set != null) {
set.forEach(peek);
}
return set;
}
public static <S, T> PageResult<T> toBean(PageResult<S> source, Class<T> targetType) {
return toBean(source, targetType, null);
}

View File

@@ -20,8 +20,6 @@ import java.lang.reflect.Field;
import java.time.LocalDateTime;
import java.util.*;
import static cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstants.USER_NOT_SET_DEPT;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUser;
/**
@@ -160,10 +158,11 @@ public class DefaultDBFieldHandler implements MetaObjectHandler {
Set<Long> postIds = new HashSet<>(JSONUtil.parseArray(
loginUser.getInfo().getOrDefault(LoginUser.INFO_KEY_POST_IDS, "[]")
).toList(Long.class));
// 阻碍部分场景的使用,不强制校验
// 如果 visitCompanyId 不存在,不能进行业务办理
if (Objects.isNull(visitCompanyId) || Objects.isNull(visitDeptId)) {
throw exception(USER_NOT_SET_DEPT);
}
// if (Objects.isNull(visitCompanyId) || Objects.isNull(visitDeptId)) {
// throw exception(USER_NOT_SET_DEPT);
// }
businessBaseDO.setCompanyId(visitCompanyId);
businessBaseDO.setCompanyName(loginUser.getVisitCompanyName());
businessBaseDO.setDeptId(visitDeptId);