1.规范增量 SQL 文件命名
2.新增数据总线模块(未完成) 3.新增规则模块(未完成) 4.新增组织编码与外部系统组织编码映射关系表 5.补全 e 办单点登录回调逻辑
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
package com.zt.plat.module.system.api.dept;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
import com.zt.plat.module.system.api.dept.dto.DeptExternalCodeRespDTO;
|
||||
import com.zt.plat.module.system.enums.ApiConstants;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@FeignClient(name = ApiConstants.NAME)
|
||||
@Tag(name = "RPC 服务 - 部门外部组织编码映射")
|
||||
@RequestMapping(ApiConstants.PREFIX + "/dept-external-code")
|
||||
public interface DeptExternalCodeApi {
|
||||
|
||||
@GetMapping("/get-by-system-and-external")
|
||||
@Operation(summary = "根据外部系统与外部组织编码查询映射")
|
||||
CommonResult<DeptExternalCodeRespDTO> getBySystemCodeAndExternalCode(
|
||||
@RequestParam("systemCode") @Parameter(description = "外部系统标识", required = true) String systemCode,
|
||||
@RequestParam("externalDeptCode") @Parameter(description = "外部组织编码", required = true) String externalDeptCode);
|
||||
|
||||
@GetMapping("/get-by-system-and-dept")
|
||||
@Operation(summary = "根据外部系统与部门编号查询映射")
|
||||
CommonResult<DeptExternalCodeRespDTO> getBySystemCodeAndDeptId(
|
||||
@RequestParam("systemCode") @Parameter(description = "外部系统标识", required = true) String systemCode,
|
||||
@RequestParam("deptId") @Parameter(description = "部门编号", required = true) Long deptId);
|
||||
|
||||
@GetMapping("/list-by-dept")
|
||||
@Operation(summary = "根据部门编号查询映射列表")
|
||||
CommonResult<List<DeptExternalCodeRespDTO>> getListByDeptId(
|
||||
@RequestParam("deptId") @Parameter(description = "部门编号", required = true) Long deptId);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.zt.plat.module.system.api.dept.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "RPC - 部门外部组织编码映射 Response DTO")
|
||||
@Data
|
||||
public class DeptExternalCodeRespDTO {
|
||||
|
||||
@Schema(description = "映射编号", example = "1024")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "部门编号", example = "2048")
|
||||
private Long deptId;
|
||||
|
||||
@Schema(description = "部门名称", example = "技术部")
|
||||
private String deptName;
|
||||
|
||||
@Schema(description = "部门编码", example = "DEPT_001")
|
||||
private String deptCode;
|
||||
|
||||
@Schema(description = "外部系统标识", example = "ERP")
|
||||
private String systemCode;
|
||||
|
||||
@Schema(description = "外部组织编码", example = "100200")
|
||||
private String externalDeptCode;
|
||||
|
||||
@Schema(description = "外部组织名称", example = "总部-华东区")
|
||||
private String externalDeptName;
|
||||
|
||||
@Schema(description = "状态", example = "0")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "最后更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
@@ -20,6 +20,8 @@ public interface ErrorCodeConstants {
|
||||
ErrorCode AUTH_TEST_LOGIN_NOT_ALLOWED = new ErrorCode(1_002_000_009, "测试登录接口仅在测试环境和本地开发环境下可用");
|
||||
ErrorCode AUTH_OAUTH2_CALLBACK_ERROR = new ErrorCode(1_002_000_010, "OAuth2回调处理失败:{}");
|
||||
ErrorCode AUTH_LOGIN_INTERNAL_USER_PASSWORD_NOT_ALLOWED = new ErrorCode(1_002_000_011, "内部用户不允许使用账号密码登录,请通过e办进行统一登录");
|
||||
ErrorCode AUTH_LOGIN_EBAN_TOKEN_INVALID = new ErrorCode(1_002_000_012, "token 无效");
|
||||
ErrorCode AUTH_LOGIN_EBAN_USER_NOT_SYNC = new ErrorCode(1_002_000_013, "用户未同步到此应用,请联系管理员进行同步");
|
||||
|
||||
// ========== 菜单模块 1-002-001-000 ==========
|
||||
ErrorCode MENU_NAME_DUPLICATE = new ErrorCode(1_002_001_000, "已经存在该名字的菜单");
|
||||
@@ -65,6 +67,9 @@ public interface ErrorCodeConstants {
|
||||
ErrorCode DEPT_TENANT_RELATION_EXISTS = new ErrorCode(1_002_004_008, "当前租户已经关联组织机构");
|
||||
ErrorCode DEPT_CODE_NOT_NULL = new ErrorCode(1_002_004_009, "部门编码不能为空");
|
||||
ErrorCode DEPT_CODE_DUPLICATE = new ErrorCode(1_002_004_010, "已经存在该编码的部门");
|
||||
ErrorCode DEPT_EXTERNAL_RELATION_EXISTS = new ErrorCode(1_002_004_011, "已经存在该部门在外部系统({})的编码映射");
|
||||
ErrorCode DEPT_EXTERNAL_CODE_DUPLICATE = new ErrorCode(1_002_004_012, "已经存在该外部系统({})的外部组织编码({})");
|
||||
ErrorCode DEPT_EXTERNAL_RELATION_NOT_EXISTS = new ErrorCode(1_002_004_013, "组织外部编码映射不存在");
|
||||
|
||||
|
||||
// ========== 岗位模块 1-002-005-000 ==========
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
package com.zt.plat.module.system.api.dept;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
import com.zt.plat.framework.common.util.collection.CollectionUtils;
|
||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
import com.zt.plat.module.system.api.dept.dto.DeptExternalCodeRespDTO;
|
||||
import com.zt.plat.module.system.dal.dataobject.dept.DeptDO;
|
||||
import com.zt.plat.module.system.dal.dataobject.dept.DeptExternalCodeDO;
|
||||
import com.zt.plat.module.system.service.dept.DeptExternalCodeService;
|
||||
import com.zt.plat.module.system.service.dept.DeptService;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@RestController
|
||||
@Validated
|
||||
public class DeptExternalCodeApiImpl implements DeptExternalCodeApi {
|
||||
|
||||
@Resource
|
||||
private DeptExternalCodeService deptExternalCodeService;
|
||||
@Resource
|
||||
private DeptService deptService;
|
||||
|
||||
@Override
|
||||
public CommonResult<DeptExternalCodeRespDTO> getBySystemCodeAndExternalCode(String systemCode, String externalDeptCode) {
|
||||
DeptExternalCodeDO entity = deptExternalCodeService.getBySystemCodeAndExternalCode(systemCode, externalDeptCode);
|
||||
if (entity == null) {
|
||||
return success(null);
|
||||
}
|
||||
return success(buildResp(entity));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<DeptExternalCodeRespDTO> getBySystemCodeAndDeptId(String systemCode, Long deptId) {
|
||||
DeptExternalCodeDO entity = deptExternalCodeService.getBySystemCodeAndDeptId(systemCode, deptId);
|
||||
if (entity == null) {
|
||||
return success(null);
|
||||
}
|
||||
return success(buildResp(entity));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<List<DeptExternalCodeRespDTO>> getListByDeptId(Long deptId) {
|
||||
List<DeptExternalCodeDO> list = deptExternalCodeService.getDeptExternalCodeListByDeptId(deptId);
|
||||
List<DeptExternalCodeRespDTO> respList = BeanUtils.toBean(list, DeptExternalCodeRespDTO.class);
|
||||
fillDeptInfo(respList);
|
||||
return success(respList);
|
||||
}
|
||||
|
||||
private DeptExternalCodeRespDTO buildResp(DeptExternalCodeDO entity) {
|
||||
DeptExternalCodeRespDTO respDTO = BeanUtils.toBean(entity, DeptExternalCodeRespDTO.class);
|
||||
fillDeptInfo(List.of(respDTO));
|
||||
return respDTO;
|
||||
}
|
||||
|
||||
private void fillDeptInfo(List<DeptExternalCodeRespDTO> list) {
|
||||
if (list == null || list.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
Set<Long> deptIds = CollectionUtils.convertSet(list, DeptExternalCodeRespDTO::getDeptId);
|
||||
if (deptIds == null || deptIds.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
Map<Long, DeptDO> deptMap = CollectionUtils.convertMap(deptService.getDeptList(deptIds), DeptDO::getId);
|
||||
list.forEach(item -> {
|
||||
DeptDO dept = deptMap.get(item.getDeptId());
|
||||
if (dept != null) {
|
||||
item.setDeptName(dept.getName());
|
||||
item.setDeptCode(dept.getCode());
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -99,6 +99,13 @@ public class AuthController {
|
||||
return success(authService.refreshToken(refreshToken));
|
||||
}
|
||||
|
||||
@PostMapping("/verify-password")
|
||||
@Operation(summary = "校验当前密码是否正确")
|
||||
public CommonResult<Boolean> verifyPassword(@RequestBody @Valid AuthVerifyPasswordReqVO reqVO) {
|
||||
authService.verifyPassword(getLoginUserId(), reqVO.getPassword());
|
||||
return success(Boolean.TRUE);
|
||||
}
|
||||
|
||||
@GetMapping("/get-permission-info")
|
||||
@Operation(summary = "获取登录用户的权限信息")
|
||||
public CommonResult<AuthPermissionInfoRespVO> getPermissionInfo() {
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.zt.plat.module.system.controller.admin.auth.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
@Schema(description = "管理后台 - 校验当前登录密码 Request VO")
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class AuthVerifyPasswordReqVO {
|
||||
|
||||
@Schema(description = "密码", requiredMode = Schema.RequiredMode.REQUIRED, example = "buzhidao")
|
||||
@NotEmpty(message = "密码不能为空")
|
||||
@Length(min = 4, max = 16, message = "密码长度为 4-16 位")
|
||||
private String password;
|
||||
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,41 @@
|
||||
package com.zt.plat.module.system.controller.admin.dept.vo.depexternalcode;
|
||||
|
||||
import com.zt.plat.framework.common.enums.CommonStatusEnum;
|
||||
import com.zt.plat.framework.common.validation.InEnum;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "管理后台 - 部门外部组织编码映射基础信息")
|
||||
@Data
|
||||
public class DeptExternalCodeBaseVO {
|
||||
|
||||
@Schema(description = "部门编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
||||
@NotNull(message = "部门不能为空")
|
||||
private Long deptId;
|
||||
|
||||
@Schema(description = "外部系统标识", requiredMode = Schema.RequiredMode.REQUIRED, example = "ERP")
|
||||
@NotBlank(message = "外部系统标识不能为空")
|
||||
@Size(max = 64, message = "外部系统标识长度不能超过 64 个字符")
|
||||
private String systemCode;
|
||||
|
||||
@Schema(description = "外部组织编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "100200")
|
||||
@NotBlank(message = "外部组织编码不能为空")
|
||||
@Size(max = 128, message = "外部组织编码长度不能超过 128 个字符")
|
||||
private String externalDeptCode;
|
||||
|
||||
@Schema(description = "外部组织名称", example = "总部-华东区")
|
||||
@Size(max = 255, message = "外部组织名称长度不能超过 255 个字符")
|
||||
private String externalDeptName;
|
||||
|
||||
@Schema(description = "状态", example = "0", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@InEnum(value = CommonStatusEnum.class, message = "状态必须是 {value}")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "备注", example = "用于 ERP 同步")
|
||||
@Size(max = 512, message = "备注长度不能超过 512 个字符")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.zt.plat.module.system.controller.admin.dept.vo.depexternalcode;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@Schema(description = "管理后台 - 部门外部组织编码映射分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class DeptExternalCodePageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "部门编号", example = "1024")
|
||||
private Long deptId;
|
||||
|
||||
@Schema(description = "外部系统标识", example = "ERP")
|
||||
private String systemCode;
|
||||
|
||||
@Schema(description = "外部组织编码", example = "100200")
|
||||
private String externalDeptCode;
|
||||
|
||||
@Schema(description = "状态", example = "0")
|
||||
private Integer status;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.zt.plat.module.system.controller.admin.dept.vo.depexternalcode;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 部门外部组织编码映射 Response VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class DeptExternalCodeRespVO extends DeptExternalCodeBaseVO {
|
||||
|
||||
@Schema(description = "映射编号", example = "1024")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "所属部门名称", example = "技术部")
|
||||
private String deptName;
|
||||
|
||||
@Schema(description = "所属部门编码", example = "DEPT_001")
|
||||
private String deptCode;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "最后更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user