Merge remote-tracking branch 'base-version/main' into dev
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
package com.zt.plat.framework.tenant.core.db;
|
||||
|
||||
import com.zt.plat.framework.tenant.config.TenantProperties;
|
||||
import com.zt.plat.framework.tenant.core.aop.TenantIgnore;
|
||||
import com.zt.plat.framework.tenant.core.context.TenantContextHolder;
|
||||
import com.baomidou.mybatisplus.core.metadata.TableInfo;
|
||||
import com.baomidou.mybatisplus.core.metadata.TableInfoHelper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.handler.TenantLineHandler;
|
||||
import com.baomidou.mybatisplus.extension.toolkit.SqlParserUtils;
|
||||
import com.zt.plat.framework.tenant.config.TenantProperties;
|
||||
import com.zt.plat.framework.tenant.core.aop.TenantIgnore;
|
||||
import com.zt.plat.framework.tenant.core.context.TenantContextHolder;
|
||||
import net.sf.jsqlparser.expression.Expression;
|
||||
import net.sf.jsqlparser.expression.LongValue;
|
||||
|
||||
@@ -69,7 +69,12 @@ public class TenantDatabaseInterceptor implements TenantLineHandler {
|
||||
// 找不到的表,说明不是 zt 项目里的,不进行拦截(忽略租户)
|
||||
TableInfo tableInfo = TableInfoHelper.getTableInfo(tableName);
|
||||
if (tableInfo == null) {
|
||||
return true;
|
||||
tableName = tableName.toLowerCase();
|
||||
tableInfo = TableInfoHelper.getTableInfo(tableName);
|
||||
}
|
||||
if (tableInfo == null) {
|
||||
tableName = tableName.toLowerCase();
|
||||
tableInfo = TableInfoHelper.getTableInfo(tableName);
|
||||
}
|
||||
// 如果继承了 TenantBaseDO 基类,显然不忽略租户
|
||||
if (TenantBaseDO.class.isAssignableFrom(tableInfo.getEntityType())) {
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
package com.zt.plat.module.system.api.iwork;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
import com.zt.plat.module.system.api.iwork.dto.*;
|
||||
import com.zt.plat.module.system.enums.ApiConstants;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
/**
|
||||
* RPC 服务 - iWork 集成
|
||||
*/
|
||||
@FeignClient(name = ApiConstants.NAME, contextId = "iWorkIntegrationApi")
|
||||
@Tag(name = "RPC 服务 - iWork 集成")
|
||||
public interface IWorkIntegrationApi {
|
||||
|
||||
String PREFIX = ApiConstants.PREFIX + "/integration/iwork";
|
||||
|
||||
// ----------------- 认证 / 会话 -----------------
|
||||
|
||||
@PostMapping(PREFIX + "/auth/register")
|
||||
@Operation(summary = "注册 iWork 凭证,获取服务端公钥与 secret")
|
||||
CommonResult<IWorkAuthRegisterRespDTO> register(@RequestBody IWorkAuthRegisterReqDTO reqDTO);
|
||||
|
||||
@PostMapping(PREFIX + "/auth/token")
|
||||
@Operation(summary = "申请 iWork Token(独立接口)")
|
||||
CommonResult<IWorkAuthTokenRespDTO> acquireToken(@RequestBody IWorkAuthTokenReqDTO reqDTO);
|
||||
|
||||
// ----------------- 流程类能力 -----------------
|
||||
|
||||
@PostMapping(PREFIX + "/user/resolve")
|
||||
@Operation(summary = "根据外部标识获取 iWork 用户编号")
|
||||
CommonResult<IWorkUserInfoRespDTO> resolveUser(@RequestBody IWorkUserInfoReqDTO reqDTO);
|
||||
|
||||
@PostMapping(PREFIX + "/workflow/create")
|
||||
@Operation(summary = "发起 iWork 流程")
|
||||
CommonResult<IWorkOperationRespDTO> createWorkflow(@RequestBody IWorkWorkflowCreateReqDTO reqDTO);
|
||||
|
||||
@PostMapping(PREFIX + "/workflow/void")
|
||||
@Operation(summary = "作废 / 干预 iWork 流程")
|
||||
CommonResult<IWorkOperationRespDTO> voidWorkflow(@RequestBody IWorkWorkflowVoidReqDTO reqDTO);
|
||||
|
||||
// ----------------- 人力组织分页接口 -----------------
|
||||
|
||||
@PostMapping(PREFIX + "/hr/subcompany/page")
|
||||
@Operation(summary = "获取 iWork 分部列表")
|
||||
CommonResult<IWorkHrSubcompanyPageRespDTO> listSubcompanies(@RequestBody IWorkOrgPageReqDTO reqDTO);
|
||||
|
||||
@PostMapping(PREFIX + "/hr/department/page")
|
||||
@Operation(summary = "获取 iWork 部门列表")
|
||||
CommonResult<IWorkHrDepartmentPageRespDTO> listDepartments(@RequestBody IWorkOrgPageReqDTO reqDTO);
|
||||
|
||||
@PostMapping(PREFIX + "/hr/job-title/page")
|
||||
@Operation(summary = "获取 iWork 岗位列表")
|
||||
CommonResult<IWorkHrJobTitlePageRespDTO> listJobTitles(@RequestBody IWorkOrgPageReqDTO reqDTO);
|
||||
|
||||
@PostMapping(PREFIX + "/hr/user/page")
|
||||
@Operation(summary = "获取 iWork 人员列表")
|
||||
CommonResult<IWorkHrUserPageRespDTO> listUsers(@RequestBody IWorkOrgPageReqDTO reqDTO);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.zt.plat.module.system.api.iwork.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* iWork 注册授权请求 DTO(供其他模块通过 Feign 调用 system-server 时使用)
|
||||
*/
|
||||
@Data
|
||||
public class IWorkAuthRegisterReqDTO {
|
||||
|
||||
@Schema(description = "iWork 应用编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String appCode;
|
||||
|
||||
@Schema(description = "iWork 网关地址", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
private String baseUrl;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.zt.plat.module.system.api.iwork.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* iWork 注册授权响应 DTO
|
||||
*/
|
||||
@Data
|
||||
public class IWorkAuthRegisterRespDTO {
|
||||
|
||||
@Schema(description = "服务端公钥(Base64)")
|
||||
private String publicKey;
|
||||
|
||||
@Schema(description = "服务端下发的 secret")
|
||||
private String secret;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.zt.plat.module.system.api.iwork.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* iWork Token 申请请求 DTO
|
||||
*/
|
||||
@Data
|
||||
public class IWorkAuthTokenReqDTO {
|
||||
|
||||
@Schema(description = "应用编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String appCode;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.zt.plat.module.system.api.iwork.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* iWork Token 响应 DTO
|
||||
*/
|
||||
@Data
|
||||
public class IWorkAuthTokenRespDTO {
|
||||
|
||||
@Schema(description = "访问令牌")
|
||||
private String accessToken;
|
||||
|
||||
@Schema(description = "过期时间(秒)")
|
||||
private Long expiresIn;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.zt.plat.module.system.api.iwork.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* iWork 部门分页响应 DTO
|
||||
*/
|
||||
@Data
|
||||
public class IWorkHrDepartmentPageRespDTO {
|
||||
|
||||
@Schema(description = "总条数")
|
||||
private Long total;
|
||||
|
||||
@Schema(description = "当前页数据")
|
||||
private List<Item> list;
|
||||
|
||||
@Data
|
||||
public static class Item {
|
||||
|
||||
@Schema(description = "部门编号")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "部门名称")
|
||||
private String name;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.zt.plat.module.system.api.iwork.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* iWork 岗位分页响应 DTO
|
||||
*/
|
||||
@Data
|
||||
public class IWorkHrJobTitlePageRespDTO {
|
||||
|
||||
@Schema(description = "总条数")
|
||||
private Long total;
|
||||
|
||||
@Schema(description = "当前页数据")
|
||||
private List<Item> list;
|
||||
|
||||
@Data
|
||||
public static class Item {
|
||||
|
||||
@Schema(description = "岗位编号")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "岗位名称")
|
||||
private String name;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.zt.plat.module.system.api.iwork.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* iWork 分部分页响应 DTO
|
||||
*/
|
||||
@Data
|
||||
public class IWorkHrSubcompanyPageRespDTO {
|
||||
|
||||
@Schema(description = "总条数")
|
||||
private Long total;
|
||||
|
||||
@Schema(description = "当前页数据")
|
||||
private List<Item> list;
|
||||
|
||||
@Data
|
||||
public static class Item {
|
||||
|
||||
@Schema(description = "分部编号")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "分部名称")
|
||||
private String name;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.zt.plat.module.system.api.iwork.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* iWork 人员分页响应 DTO
|
||||
*/
|
||||
@Data
|
||||
public class IWorkHrUserPageRespDTO {
|
||||
|
||||
@Schema(description = "总条数")
|
||||
private Long total;
|
||||
|
||||
@Schema(description = "当前页数据")
|
||||
private List<Item> list;
|
||||
|
||||
@Data
|
||||
public static class Item {
|
||||
|
||||
@Schema(description = "人员编号")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "人员名称")
|
||||
private String name;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user