Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
hewencai
2025-11-25 19:09:13 +08:00
27 changed files with 2545 additions and 164 deletions

View File

@@ -13,7 +13,8 @@ import lombok.Getter;
public enum DeptSourceEnum {
EXTERNAL(1, "外部部门"), // 系统创建的部门
SYNC(2, "同步部门"); // 通过 OrgSyncService 同步的部门
SYNC(2, "同步部门"), // 通过 OrgSyncService 同步的部门
IWORK(3, "iWork 同步"); // 通过 iWork 同步的部门
/**
* 类型

View File

@@ -13,7 +13,8 @@ import lombok.Getter;
public enum UserSourceEnum {
EXTERNAL(1, "外部用户"), // 系统创建、注册等方式产生的用户
SYNC(2, "同步用户"); // 通过 UserSyncService 同步的用户
SYNC(2, "同步用户"), // 通过 UserSyncService 同步的用户
IWORK(3, "iWork 用户"); // 通过 iWork 全量/单条同步产生的用户
/**
* 类型

View File

@@ -0,0 +1,53 @@
package com.zt.plat.module.system.controller.admin.integration.iwork.vo;
import com.zt.plat.module.system.enums.integration.IWorkSyncEntityTypeEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Max;
import jakarta.validation.constraints.Min;
import lombok.Data;
import java.util.EnumSet;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
/**
* iWork 全量同步请求
*/
@Data
public class IWorkFullSyncReqVO {
@Schema(description = "起始页码,从 1 开始", example = "1")
@Min(1)
private Integer startPage = 1;
@Schema(description = "最大处理页数null 表示处理至 iWork 返回的末页", example = "10")
@Min(1)
private Integer maxPages;
@Schema(description = "每次分页从 iWork 拉取的记录数", example = "100")
@Min(1)
@Max(500)
private Integer pageSize = 100;
@Schema(description = "同步范围列表默认同步全部。可选subcompany、department、jobTitle、user")
private List<String> scopes;
@Schema(description = "是否包含已失效canceled=1的记录", example = "false")
private Boolean includeCanceled = Boolean.FALSE;
public Set<IWorkSyncEntityTypeEnum> resolveScopes() {
EnumSet<IWorkSyncEntityTypeEnum> defaults = EnumSet.allOf(IWorkSyncEntityTypeEnum.class);
if (scopes == null || scopes.isEmpty()) {
return defaults;
}
Set<IWorkSyncEntityTypeEnum> resolved = scopes.stream()
.map(IWorkSyncEntityTypeEnum::fromCode)
.filter(java.util.Objects::nonNull)
.collect(Collectors.toCollection(() -> EnumSet.noneOf(IWorkSyncEntityTypeEnum.class)));
if (resolved.isEmpty()) {
return defaults;
}
return resolved;
}
}

View File

@@ -0,0 +1,34 @@
package com.zt.plat.module.system.controller.admin.integration.iwork.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.util.List;
/**
* iWork 全量同步响应
*/
@Data
public class IWorkFullSyncRespVO {
@Schema(description = "本次处理的总页数")
private Integer processedPages;
@Schema(description = "每次分页请求的条数")
private Integer pageSize;
@Schema(description = "分部统计信息")
private IWorkSyncEntityStatVO subcompanyStat = new IWorkSyncEntityStatVO();
@Schema(description = "部门统计信息")
private IWorkSyncEntityStatVO departmentStat = new IWorkSyncEntityStatVO();
@Schema(description = "岗位统计信息")
private IWorkSyncEntityStatVO jobTitleStat = new IWorkSyncEntityStatVO();
@Schema(description = "人员统计信息")
private IWorkSyncEntityStatVO userStat = new IWorkSyncEntityStatVO();
@Schema(description = "每个批次的详细统计")
private List<IWorkSyncBatchStatVO> batches;
}

View File

@@ -0,0 +1,74 @@
package com.zt.plat.module.system.controller.admin.integration.iwork.vo;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
/**
* iWork 人力同步响应。
*/
@Data
@Schema(description = "iWork 人力同步响应")
public class IWorkHrSyncRespVO {
@Schema(description = "响应码")
private String code;
@Schema(description = "提示信息")
private String message;
@Schema(description = "是否成功")
private boolean success;
@Schema(description = "同步结果明细")
private List<SyncResult> result;
@Data
@Schema(description = "同步结果项")
public static class SyncResult {
@Schema(description = "操作动作 add/update/delete")
@JsonProperty("@action")
private String action;
@Schema(description = "外部编码")
@JsonProperty("code")
private String code;
@Schema(description = "执行结果 success/fail")
@JsonProperty("result")
private String result;
@Schema(description = "是否成功")
@JsonProperty("success")
private Boolean success;
@Schema(description = "失败描述")
@JsonProperty("message")
private String message;
@JsonIgnore
private Map<String, Object> attributes;
@JsonAnySetter
public void putAttribute(String key, Object value) {
if (attributes == null) {
attributes = new LinkedHashMap<>();
}
attributes.put(key, value);
}
@JsonAnyGetter
public Map<String, Object> any() {
return attributes == null ? Collections.emptyMap() : attributes;
}
}
}

Some files were not shown because too many files have changed in this diff Show More