Merge remote-tracking branch 'base-version/main' into dev

This commit is contained in:
chenbowen
2025-12-15 19:26:14 +08:00
13 changed files with 442 additions and 54 deletions

View File

@@ -23,6 +23,15 @@ public class DeptSaveReqVO {
@Size(max = 50, message = "部门编码长度不能超过 50 个字符")
private String code;
@Schema(description = "外部系统标识,用于建立编码映射", example = "ERP")
private String externalSystemCode;
@Schema(description = "外部系统组织编码,用于建立映射", example = "ERP-001")
private String externalDeptCode;
@Schema(description = "外部系统组织名称", example = "ERP总部")
private String externalDeptName;
@Schema(description = "部门名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "ZT")
@NotBlank(message = "部门名称不能为空")
@Size(max = 30, message = "部门名称长度不能超过 30 个字符")

View File

@@ -37,6 +37,10 @@ public interface DeptExternalCodeMapper extends BaseMapperX<DeptExternalCodeDO>
return selectList(DeptExternalCodeDO::getDeptId, deptId);
}
default int deleteByDeptId(Long deptId) {
return delete(DeptExternalCodeDO::getDeptId, deptId);
}
default List<DeptExternalCodeDO> selectListBySystemCode(String systemCode) {
return selectList(DeptExternalCodeDO::getSystemCode, systemCode);
}

View File

@@ -17,6 +17,14 @@ public interface RedisKeyConstants {
*/
String DEPT_CHILDREN_ID_LIST = "dept_children_ids";
/**
* 指定部门的外部组织编码映射列表缓存
* <p>
* KEY 格式dept_external_code_list:{deptId}
* VALUE 数据类型String 映射列表
*/
String DEPT_EXTERNAL_CODE_LIST = "dept_external_code_list";
/**
* 角色的缓存
* <p>

View File

@@ -49,6 +49,26 @@ public interface DeptExternalCodeService {
*/
List<DeptExternalCodeDO> getDeptExternalCodeListByDeptId(Long deptId);
/**
* 根据部门与外部系统保存/更新映射(存在则更新,不存在则创建)
*
* @param deptId 本系统部门 ID
* @param systemCode 外部系统标识
* @param externalDeptCode 外部系统组织编码
* @param externalDeptName 外部系统组织名称(可选)
* @param status 状态,默认启用
* @return 映射记录 ID
*/
Long saveOrUpdateDeptExternalCode(Long deptId, String systemCode, String externalDeptCode, String externalDeptName,
Integer status);
/**
* 根据部门删除全部外部编码映射
*
* @param deptId 部门编号
*/
void deleteDeptExternalCodesByDeptId(Long deptId);
/**
* 根据外部系统与外部组织编码查询映射
*/