Merge branch 'dev' into test
This commit is contained in:
BIN
docs/iwork 人力资源组织机构RESTFUL接口说明.pdf
Normal file
BIN
docs/iwork 人力资源组织机构RESTFUL接口说明.pdf
Normal file
Binary file not shown.
152
docs/附件上传注解使用说明.md
Normal file
152
docs/附件上传注解使用说明.md
Normal file
@@ -0,0 +1,152 @@
|
|||||||
|
# @FileUploadController 注解使用说明
|
||||||
|
|
||||||
|
本文档说明 `@FileUploadController` 的使用方式、调用流程、以及报文结构示例。适用范围为业务创建接口在请求体中携带附件列表的场景,并在业务创建成功后自动建立“业务-附件”的关联关系。
|
||||||
|
|
||||||
|
## 1. 适用前提
|
||||||
|
|
||||||
|
- **附件列表在业务创建请求体中传入**。
|
||||||
|
- **业务创建返回结构统一为**:`{ code, data: { id, code } }`。
|
||||||
|
- 不涉及二次请求与补充请求头流程(文档不包含相关内容)。
|
||||||
|
|
||||||
|
## 2. 注解字段说明
|
||||||
|
|
||||||
|
位置:`com.zt.plat.framework.business.annotation.FileUploadController`
|
||||||
|
|
||||||
|
| 字段 | 说明 | 默认值 | 备注 |
|
||||||
|
|---|---|---|---|
|
||||||
|
| `filesKey` | 请求体中附件数组的路径 | `files` | 支持多层级路径,如 `data.files` |
|
||||||
|
| `fileNameKey` | 附件名称字段 | `name` | 解析附件名称使用 |
|
||||||
|
| `fileIdKey` | 附件ID字段 | `id` | 解析附件ID使用 |
|
||||||
|
| `source` | 业务来源标识 | `default` | 例如 `bpm` / `oa` / `hr` 等 |
|
||||||
|
| `primaryKey` | 响应中业务主键路径 | `data.id` | 支持多层级路径 |
|
||||||
|
| `codeKey` | 响应中业务编码路径 | `data.code` | 支持多层级路径 |
|
||||||
|
|
||||||
|
## 3. 关联处理机制(简述)
|
||||||
|
|
||||||
|
当 Controller 标注 `@FileUploadController` 后:
|
||||||
|
|
||||||
|
1. 请求进入时会读取注解配置并写入 request attribute。
|
||||||
|
2. 请求处理完成后,过滤器会读取:
|
||||||
|
- 请求体中的附件数组
|
||||||
|
- 响应体中的业务主键与业务编码
|
||||||
|
3. 当响应 `code == 0` 时,自动调用 `BusinessFileApi.batchCreateBusinessFile(...)` 建立附件关联。
|
||||||
|
|
||||||
|
> 注意:如果请求体中未包含附件数组,或响应中未返回业务主键,则不会产生关联。
|
||||||
|
|
||||||
|
## 4. 标准调用流程
|
||||||
|
|
||||||
|
### 步骤 1:业务 Controller 标注注解
|
||||||
|
|
||||||
|
```java
|
||||||
|
@FileUploadController(source = "template.contract")
|
||||||
|
public class DemoContractController extends AbstractFileUploadController implements BusinessControllerMarker {
|
||||||
|
static {
|
||||||
|
FileUploadController annotation = DemoContractController.class.getAnnotation(FileUploadController.class);
|
||||||
|
if (annotation != null) {
|
||||||
|
setFileUploadInfo(annotation);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### 步骤 2:可选获取 source 信息
|
||||||
|
|
||||||
|
请求:
|
||||||
|
|
||||||
|
```
|
||||||
|
GET /template/demo-contract/upload-info
|
||||||
|
```
|
||||||
|
|
||||||
|
响应:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"code": 0,
|
||||||
|
"data": { "source": "template.contract" },
|
||||||
|
"msg": "成功"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### 步骤 3:业务创建请求携带附件列表
|
||||||
|
|
||||||
|
请求体示例(默认字段):
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"name": "测试合同",
|
||||||
|
"amount": 2000,
|
||||||
|
"files": [
|
||||||
|
{ "id": 10125, "name": "合同附件.pdf" },
|
||||||
|
{ "id": 10126, "name": "补充材料.docx" }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### 步骤 4:业务创建成功返回
|
||||||
|
|
||||||
|
响应体示例(统一结构):
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"code": 0,
|
||||||
|
"data": {
|
||||||
|
"id": 90001,
|
||||||
|
"code": "HT-2026-0001"
|
||||||
|
},
|
||||||
|
"msg": "成功"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
系统会自动读取:
|
||||||
|
|
||||||
|
- `files` 中的 `id/name`
|
||||||
|
- `data.id` 和 `data.code`
|
||||||
|
|
||||||
|
并建立业务附件关联。
|
||||||
|
|
||||||
|
## 5. 多层级字段示例(可选配置)
|
||||||
|
|
||||||
|
如果业务请求体与响应体存在嵌套结构,可通过注解自定义路径:
|
||||||
|
|
||||||
|
```java
|
||||||
|
@FileUploadController(
|
||||||
|
source = "template.contract",
|
||||||
|
filesKey = "data.files",
|
||||||
|
fileIdKey = "fileId",
|
||||||
|
fileNameKey = "fileName",
|
||||||
|
primaryKey = "data.businessId",
|
||||||
|
codeKey = "data.businessCode"
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
||||||
|
对应请求体示例:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"data": {
|
||||||
|
"files": [
|
||||||
|
{ "fileId": 1001, "fileName": "合同.pdf" }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
对应响应体示例:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"code": 0,
|
||||||
|
"data": {
|
||||||
|
"businessId": 90001,
|
||||||
|
"businessCode": "HT-2026-0001"
|
||||||
|
},
|
||||||
|
"msg": "成功"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## 6. 常见注意事项
|
||||||
|
|
||||||
|
- 响应 `code != 0` 时不会执行附件关联。
|
||||||
|
- `files` 必须是数组,否则会被忽略。
|
||||||
|
- 若业务返回未包含 `primaryKey` 对应的字段,附件不会关联。
|
||||||
|
- `source` 建议以业务模块唯一标识命名,便于后续查询与归档。
|
||||||
@@ -218,6 +218,7 @@ CREATE TABLE databus_api_client_credential (
|
|||||||
create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,
|
create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,
|
||||||
updater VARCHAR(64) DEFAULT '' NOT NULL,
|
updater VARCHAR(64) DEFAULT '' NOT NULL,
|
||||||
update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,
|
update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,
|
||||||
|
enable_encryption BIT DEFAULT '1' NOT NULL,
|
||||||
deleted BIT DEFAULT '0' NOT NULL
|
deleted BIT DEFAULT '0' NOT NULL
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -46,18 +46,18 @@ public interface IWorkIntegrationApi {
|
|||||||
|
|
||||||
@PostMapping(PREFIX + "/hr/subcompany/page")
|
@PostMapping(PREFIX + "/hr/subcompany/page")
|
||||||
@Operation(summary = "获取 iWork 分部列表")
|
@Operation(summary = "获取 iWork 分部列表")
|
||||||
CommonResult<IWorkHrSubcompanyPageRespDTO> listSubcompanies(@RequestBody IWorkOrgPageReqDTO reqDTO);
|
CommonResult<IWorkHrSubcompanyPageRespDTO> listSubcompanies(@RequestBody IWorkSubcompanyQueryReqDTO reqDTO);
|
||||||
|
|
||||||
@PostMapping(PREFIX + "/hr/department/page")
|
@PostMapping(PREFIX + "/hr/department/page")
|
||||||
@Operation(summary = "获取 iWork 部门列表")
|
@Operation(summary = "获取 iWork 部门列表")
|
||||||
CommonResult<IWorkHrDepartmentPageRespDTO> listDepartments(@RequestBody IWorkOrgPageReqDTO reqDTO);
|
CommonResult<IWorkHrDepartmentPageRespDTO> listDepartments(@RequestBody IWorkDepartmentQueryReqDTO reqDTO);
|
||||||
|
|
||||||
@PostMapping(PREFIX + "/hr/job-title/page")
|
@PostMapping(PREFIX + "/hr/job-title/page")
|
||||||
@Operation(summary = "获取 iWork 岗位列表")
|
@Operation(summary = "获取 iWork 岗位列表")
|
||||||
CommonResult<IWorkHrJobTitlePageRespDTO> listJobTitles(@RequestBody IWorkOrgPageReqDTO reqDTO);
|
CommonResult<IWorkHrJobTitlePageRespDTO> listJobTitles(@RequestBody IWorkJobTitleQueryReqDTO reqDTO);
|
||||||
|
|
||||||
@PostMapping(PREFIX + "/hr/user/page")
|
@PostMapping(PREFIX + "/hr/user/page")
|
||||||
@Operation(summary = "获取 iWork 人员列表")
|
@Operation(summary = "获取 iWork 人员列表")
|
||||||
CommonResult<IWorkHrUserPageRespDTO> listUsers(@RequestBody IWorkOrgPageReqDTO reqDTO);
|
CommonResult<IWorkHrUserPageRespDTO> listUsers(@RequestBody IWorkUserQueryReqDTO reqDTO);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,48 @@
|
|||||||
|
package com.zt.plat.module.system.api.iwork.dto;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.ToString;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* iWork 部门查询参数。
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
public class IWorkDepartmentQueryReqDTO extends IWorkOrgBaseQueryReqDTO {
|
||||||
|
|
||||||
|
@JsonProperty("departmentcode")
|
||||||
|
@Schema(description = "部门编号")
|
||||||
|
private String departmentCode;
|
||||||
|
|
||||||
|
@JsonProperty("departmentname")
|
||||||
|
@Schema(description = "部门名称")
|
||||||
|
private String departmentName;
|
||||||
|
|
||||||
|
@JsonProperty("subcompanyid1")
|
||||||
|
@Schema(description = "分部 ID")
|
||||||
|
private String subcompanyId1;
|
||||||
|
|
||||||
|
@JsonProperty("created")
|
||||||
|
@Schema(description = "创建时间戳(>=)")
|
||||||
|
private String created;
|
||||||
|
|
||||||
|
@JsonProperty("modified")
|
||||||
|
@Schema(description = "修改时间戳(>=)")
|
||||||
|
private String modified;
|
||||||
|
|
||||||
|
@JsonProperty("canceled")
|
||||||
|
@Schema(description = "封存标志,默认查询非封存数据。1:封存")
|
||||||
|
private String canceled;
|
||||||
|
|
||||||
|
@JsonProperty("custom_data")
|
||||||
|
@Schema(description = "自定义字段列表(逗号分隔)")
|
||||||
|
private String customData;
|
||||||
|
|
||||||
|
@JsonProperty("id")
|
||||||
|
@Schema(description = "OA 部门 ID")
|
||||||
|
private String id;
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
package com.zt.plat.module.system.api.iwork.dto;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.ToString;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* iWork 岗位查询参数。
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
public class IWorkJobTitleQueryReqDTO extends IWorkOrgBaseQueryReqDTO {
|
||||||
|
|
||||||
|
@JsonProperty("jobtitlename")
|
||||||
|
@Schema(description = "岗位名称")
|
||||||
|
private String jobTitleName;
|
||||||
|
|
||||||
|
@JsonProperty("created")
|
||||||
|
@Schema(description = "创建时间戳(>=)")
|
||||||
|
private String created;
|
||||||
|
|
||||||
|
@JsonProperty("modified")
|
||||||
|
@Schema(description = "修改时间戳(>=)")
|
||||||
|
private String modified;
|
||||||
|
|
||||||
|
@JsonProperty("id")
|
||||||
|
@Schema(description = "岗位 ID")
|
||||||
|
private String id;
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package com.zt.plat.module.system.api.iwork.dto;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* iWork 人力组织查询基础参数。
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class IWorkOrgBaseQueryReqDTO {
|
||||||
|
|
||||||
|
@Schema(description = "当前页码", example = "1")
|
||||||
|
private Integer curpage;
|
||||||
|
|
||||||
|
@Schema(description = "每页条数", example = "20")
|
||||||
|
private Integer pagesize;
|
||||||
|
}
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
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 IWorkOrgPageReqDTO {
|
|
||||||
|
|
||||||
@Schema(description = "页码", example = "1", requiredMode = Schema.RequiredMode.REQUIRED)
|
|
||||||
private Integer pageNo;
|
|
||||||
|
|
||||||
@Schema(description = "每页大小", example = "20", requiredMode = Schema.RequiredMode.REQUIRED)
|
|
||||||
private Integer pageSize;
|
|
||||||
|
|
||||||
@Schema(description = "关键字过滤")
|
|
||||||
private String keyword;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
package com.zt.plat.module.system.api.iwork.dto;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.ToString;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* iWork 分部查询参数。
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
public class IWorkSubcompanyQueryReqDTO extends IWorkOrgBaseQueryReqDTO {
|
||||||
|
|
||||||
|
@JsonProperty("subcompanycode")
|
||||||
|
@Schema(description = "分部编号")
|
||||||
|
private String subcompanyCode;
|
||||||
|
|
||||||
|
@JsonProperty("subcompanyname")
|
||||||
|
@Schema(description = "分部名称")
|
||||||
|
private String subcompanyName;
|
||||||
|
|
||||||
|
@JsonProperty("modified")
|
||||||
|
@Schema(description = "修改时间戳(>=)")
|
||||||
|
private String modified;
|
||||||
|
|
||||||
|
@JsonProperty("canceled")
|
||||||
|
@Schema(description = "封存标志,默认查询非封存数据。1:封存")
|
||||||
|
private String canceled;
|
||||||
|
|
||||||
|
@JsonProperty("custom_data")
|
||||||
|
@Schema(description = "自定义字段列表(逗号分隔)")
|
||||||
|
private String customData;
|
||||||
|
|
||||||
|
@JsonProperty("id")
|
||||||
|
@Schema(description = "OA 分部 ID")
|
||||||
|
private String id;
|
||||||
|
}
|
||||||
@@ -0,0 +1,60 @@
|
|||||||
|
package com.zt.plat.module.system.api.iwork.dto;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.ToString;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* iWork 人员查询参数。
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
public class IWorkUserQueryReqDTO extends IWorkOrgBaseQueryReqDTO {
|
||||||
|
|
||||||
|
@JsonProperty("workcode")
|
||||||
|
@Schema(description = "人员编号")
|
||||||
|
private String workCode;
|
||||||
|
|
||||||
|
@JsonProperty("subcompanyid1")
|
||||||
|
@Schema(description = "分部 ID")
|
||||||
|
private String subcompanyId1;
|
||||||
|
|
||||||
|
@JsonProperty("departmentid")
|
||||||
|
@Schema(description = "部门 ID")
|
||||||
|
private String departmentId;
|
||||||
|
|
||||||
|
@JsonProperty("jobtitleid")
|
||||||
|
@Schema(description = "岗位 ID")
|
||||||
|
private String jobTitleId;
|
||||||
|
|
||||||
|
@JsonProperty("id")
|
||||||
|
@Schema(description = "人员 ID")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
@JsonProperty("loginid")
|
||||||
|
@Schema(description = "登录名")
|
||||||
|
private String loginId;
|
||||||
|
|
||||||
|
@JsonProperty("created")
|
||||||
|
@Schema(description = "创建时间戳(>=)")
|
||||||
|
private String created;
|
||||||
|
|
||||||
|
@JsonProperty("modified")
|
||||||
|
@Schema(description = "修改时间戳(>=)")
|
||||||
|
private String modified;
|
||||||
|
|
||||||
|
@JsonProperty("base_custom_data")
|
||||||
|
@Schema(description = "基本信息自定义字段列表(逗号分隔)")
|
||||||
|
private String baseCustomData;
|
||||||
|
|
||||||
|
@JsonProperty("person_custom_data")
|
||||||
|
@Schema(description = "个人信息自定义字段列表(逗号分隔)")
|
||||||
|
private String personCustomData;
|
||||||
|
|
||||||
|
@JsonProperty("work_custom_data")
|
||||||
|
@Schema(description = "工作信息自定义字段列表(逗号分隔)")
|
||||||
|
private String workCustomData;
|
||||||
|
}
|
||||||
@@ -77,7 +77,7 @@ public class IWorkIntegrationApiImpl implements IWorkIntegrationApi {
|
|||||||
// ----------------- 人力组织分页接口 -----------------
|
// ----------------- 人力组织分页接口 -----------------
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CommonResult<IWorkHrSubcompanyPageRespDTO> listSubcompanies(IWorkOrgPageReqDTO reqDTO) {
|
public CommonResult<IWorkHrSubcompanyPageRespDTO> listSubcompanies(IWorkSubcompanyQueryReqDTO reqDTO) {
|
||||||
IWorkSubcompanyQueryReqVO reqVO = BeanUtils.toBean(reqDTO, IWorkSubcompanyQueryReqVO.class);
|
IWorkSubcompanyQueryReqVO reqVO = BeanUtils.toBean(reqDTO, IWorkSubcompanyQueryReqVO.class);
|
||||||
IWorkHrSubcompanyPageRespVO respVO = orgRestService.listSubcompanies(reqVO);
|
IWorkHrSubcompanyPageRespVO respVO = orgRestService.listSubcompanies(reqVO);
|
||||||
IWorkHrSubcompanyPageRespDTO respDTO = BeanUtils.toBean(respVO, IWorkHrSubcompanyPageRespDTO.class);
|
IWorkHrSubcompanyPageRespDTO respDTO = BeanUtils.toBean(respVO, IWorkHrSubcompanyPageRespDTO.class);
|
||||||
@@ -85,7 +85,7 @@ public class IWorkIntegrationApiImpl implements IWorkIntegrationApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CommonResult<IWorkHrDepartmentPageRespDTO> listDepartments(IWorkOrgPageReqDTO reqDTO) {
|
public CommonResult<IWorkHrDepartmentPageRespDTO> listDepartments(IWorkDepartmentQueryReqDTO reqDTO) {
|
||||||
IWorkDepartmentQueryReqVO reqVO = BeanUtils.toBean(reqDTO, IWorkDepartmentQueryReqVO.class);
|
IWorkDepartmentQueryReqVO reqVO = BeanUtils.toBean(reqDTO, IWorkDepartmentQueryReqVO.class);
|
||||||
IWorkHrDepartmentPageRespVO respVO = orgRestService.listDepartments(reqVO);
|
IWorkHrDepartmentPageRespVO respVO = orgRestService.listDepartments(reqVO);
|
||||||
IWorkHrDepartmentPageRespDTO respDTO = BeanUtils.toBean(respVO, IWorkHrDepartmentPageRespDTO.class);
|
IWorkHrDepartmentPageRespDTO respDTO = BeanUtils.toBean(respVO, IWorkHrDepartmentPageRespDTO.class);
|
||||||
@@ -93,7 +93,7 @@ public class IWorkIntegrationApiImpl implements IWorkIntegrationApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CommonResult<IWorkHrJobTitlePageRespDTO> listJobTitles(IWorkOrgPageReqDTO reqDTO) {
|
public CommonResult<IWorkHrJobTitlePageRespDTO> listJobTitles(IWorkJobTitleQueryReqDTO reqDTO) {
|
||||||
IWorkJobTitleQueryReqVO reqVO = BeanUtils.toBean(reqDTO, IWorkJobTitleQueryReqVO.class);
|
IWorkJobTitleQueryReqVO reqVO = BeanUtils.toBean(reqDTO, IWorkJobTitleQueryReqVO.class);
|
||||||
IWorkHrJobTitlePageRespVO respVO = orgRestService.listJobTitles(reqVO);
|
IWorkHrJobTitlePageRespVO respVO = orgRestService.listJobTitles(reqVO);
|
||||||
IWorkHrJobTitlePageRespDTO respDTO = BeanUtils.toBean(respVO, IWorkHrJobTitlePageRespDTO.class);
|
IWorkHrJobTitlePageRespDTO respDTO = BeanUtils.toBean(respVO, IWorkHrJobTitlePageRespDTO.class);
|
||||||
@@ -101,7 +101,7 @@ public class IWorkIntegrationApiImpl implements IWorkIntegrationApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CommonResult<IWorkHrUserPageRespDTO> listUsers(IWorkOrgPageReqDTO reqDTO) {
|
public CommonResult<IWorkHrUserPageRespDTO> listUsers(IWorkUserQueryReqDTO reqDTO) {
|
||||||
IWorkUserQueryReqVO reqVO = BeanUtils.toBean(reqDTO, IWorkUserQueryReqVO.class);
|
IWorkUserQueryReqVO reqVO = BeanUtils.toBean(reqDTO, IWorkUserQueryReqVO.class);
|
||||||
IWorkHrUserPageRespVO respVO = orgRestService.listUsers(reqVO);
|
IWorkHrUserPageRespVO respVO = orgRestService.listUsers(reqVO);
|
||||||
IWorkHrUserPageRespDTO respDTO = BeanUtils.toBean(respVO, IWorkHrUserPageRespDTO.class);
|
IWorkHrUserPageRespDTO respDTO = BeanUtils.toBean(respVO, IWorkHrUserPageRespDTO.class);
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.zt.plat.module.system.controller.admin.integration.iwork.vo;
|
package com.zt.plat.module.system.controller.admin.integration.iwork.vo;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
@@ -13,12 +14,35 @@ import lombok.ToString;
|
|||||||
@ToString(callSuper = true)
|
@ToString(callSuper = true)
|
||||||
public class IWorkDepartmentQueryReqVO extends IWorkOrgBaseQueryReqVO {
|
public class IWorkDepartmentQueryReqVO extends IWorkOrgBaseQueryReqVO {
|
||||||
|
|
||||||
@Schema(description = "部门编码")
|
@JsonProperty("departmentcode")
|
||||||
|
@Schema(description = "部门编号")
|
||||||
private String departmentCode;
|
private String departmentCode;
|
||||||
|
|
||||||
|
@JsonProperty("departmentname")
|
||||||
@Schema(description = "部门名称")
|
@Schema(description = "部门名称")
|
||||||
private String departmentName;
|
private String departmentName;
|
||||||
|
|
||||||
@Schema(description = "所属分部ID")
|
@JsonProperty("subcompanyid1")
|
||||||
private String subcompanyId;
|
@Schema(description = "分部 ID")
|
||||||
|
private String subcompanyId1;
|
||||||
|
|
||||||
|
@JsonProperty("created")
|
||||||
|
@Schema(description = "创建时间戳(>=)")
|
||||||
|
private String created;
|
||||||
|
|
||||||
|
@JsonProperty("modified")
|
||||||
|
@Schema(description = "修改时间戳(>=)")
|
||||||
|
private String modified;
|
||||||
|
|
||||||
|
@JsonProperty("canceled")
|
||||||
|
@Schema(description = "封存标志,默认查询非封存数据。1:封存")
|
||||||
|
private String canceled;
|
||||||
|
|
||||||
|
@JsonProperty("custom_data")
|
||||||
|
@Schema(description = "自定义字段列表(逗号分隔)")
|
||||||
|
private String customData;
|
||||||
|
|
||||||
|
@JsonProperty("id")
|
||||||
|
@Schema(description = "OA 部门 ID")
|
||||||
|
private String id;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.zt.plat.module.system.controller.admin.integration.iwork.vo;
|
package com.zt.plat.module.system.controller.admin.integration.iwork.vo;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
@@ -13,9 +14,19 @@ import lombok.ToString;
|
|||||||
@ToString(callSuper = true)
|
@ToString(callSuper = true)
|
||||||
public class IWorkJobTitleQueryReqVO extends IWorkOrgBaseQueryReqVO {
|
public class IWorkJobTitleQueryReqVO extends IWorkOrgBaseQueryReqVO {
|
||||||
|
|
||||||
@Schema(description = "岗位编码")
|
@JsonProperty("jobtitlename")
|
||||||
private String jobTitleCode;
|
|
||||||
|
|
||||||
@Schema(description = "岗位名称")
|
@Schema(description = "岗位名称")
|
||||||
private String jobTitleName;
|
private String jobTitleName;
|
||||||
|
|
||||||
|
@JsonProperty("created")
|
||||||
|
@Schema(description = "创建时间戳(>=)")
|
||||||
|
private String created;
|
||||||
|
|
||||||
|
@JsonProperty("modified")
|
||||||
|
@Schema(description = "修改时间戳(>=)")
|
||||||
|
private String modified;
|
||||||
|
|
||||||
|
@JsonProperty("id")
|
||||||
|
@Schema(description = "岗位 ID")
|
||||||
|
private String id;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ package com.zt.plat.module.system.controller.admin.integration.iwork.vo;
|
|||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* iWork 组织查询基础参数。
|
* iWork 组织查询基础参数。
|
||||||
@@ -16,7 +15,4 @@ public class IWorkOrgBaseQueryReqVO {
|
|||||||
|
|
||||||
@Schema(description = "每页条数", example = "10")
|
@Schema(description = "每页条数", example = "10")
|
||||||
private Integer pagesize;
|
private Integer pagesize;
|
||||||
|
|
||||||
@Schema(description = "查询参数(扩展用),将被序列化为 params 传给 iWork")
|
|
||||||
private Map<String, Object> params;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.zt.plat.module.system.controller.admin.integration.iwork.vo;
|
package com.zt.plat.module.system.controller.admin.integration.iwork.vo;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
@@ -13,9 +14,27 @@ import lombok.ToString;
|
|||||||
@ToString(callSuper = true)
|
@ToString(callSuper = true)
|
||||||
public class IWorkSubcompanyQueryReqVO extends IWorkOrgBaseQueryReqVO {
|
public class IWorkSubcompanyQueryReqVO extends IWorkOrgBaseQueryReqVO {
|
||||||
|
|
||||||
@Schema(description = "分部编码")
|
@JsonProperty("subcompanycode")
|
||||||
|
@Schema(description = "分部编号")
|
||||||
private String subcompanyCode;
|
private String subcompanyCode;
|
||||||
|
|
||||||
|
@JsonProperty("subcompanyname")
|
||||||
@Schema(description = "分部名称")
|
@Schema(description = "分部名称")
|
||||||
private String subcompanyName;
|
private String subcompanyName;
|
||||||
|
|
||||||
|
@JsonProperty("modified")
|
||||||
|
@Schema(description = "修改时间戳(>=)")
|
||||||
|
private String modified;
|
||||||
|
|
||||||
|
@JsonProperty("canceled")
|
||||||
|
@Schema(description = "封存标志,默认查询非封存数据。1:封存")
|
||||||
|
private String canceled;
|
||||||
|
|
||||||
|
@JsonProperty("custom_data")
|
||||||
|
@Schema(description = "自定义字段列表(逗号分隔)")
|
||||||
|
private String customData;
|
||||||
|
|
||||||
|
@JsonProperty("id")
|
||||||
|
@Schema(description = "OA 分部 ID")
|
||||||
|
private String id;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.zt.plat.module.system.controller.admin.integration.iwork.vo;
|
package com.zt.plat.module.system.controller.admin.integration.iwork.vo;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
@@ -13,27 +14,47 @@ import lombok.ToString;
|
|||||||
@ToString(callSuper = true)
|
@ToString(callSuper = true)
|
||||||
public class IWorkUserQueryReqVO extends IWorkOrgBaseQueryReqVO {
|
public class IWorkUserQueryReqVO extends IWorkOrgBaseQueryReqVO {
|
||||||
|
|
||||||
@Schema(description = "人员工号")
|
@JsonProperty("workcode")
|
||||||
|
@Schema(description = "人员编号")
|
||||||
private String workCode;
|
private String workCode;
|
||||||
|
|
||||||
@Schema(description = "人员姓名")
|
@JsonProperty("subcompanyid1")
|
||||||
private String lastName;
|
@Schema(description = "分部 ID")
|
||||||
|
private String subcompanyId1;
|
||||||
|
|
||||||
@Schema(description = "所属部门ID")
|
@JsonProperty("departmentid")
|
||||||
|
@Schema(description = "部门 ID")
|
||||||
private String departmentId;
|
private String departmentId;
|
||||||
|
|
||||||
@Schema(description = "所属分部ID")
|
@JsonProperty("jobtitleid")
|
||||||
private String subcompanyId;
|
@Schema(description = "岗位 ID")
|
||||||
|
|
||||||
@Schema(description = "所属岗位ID")
|
|
||||||
private String jobTitleId;
|
private String jobTitleId;
|
||||||
|
|
||||||
@Schema(description = "人员状态 (0:试用, 1:正式, 2:临时, 3:试用延期, 4:解聘, 5:离职, 6:退休, 7:无效)")
|
@JsonProperty("id")
|
||||||
private String status;
|
@Schema(description = "人员 ID")
|
||||||
|
private String id;
|
||||||
|
|
||||||
@Schema(description = "手机号")
|
@JsonProperty("loginid")
|
||||||
private String mobile;
|
@Schema(description = "登录名")
|
||||||
|
private String loginId;
|
||||||
|
|
||||||
@Schema(description = "邮箱")
|
@JsonProperty("created")
|
||||||
private String email;
|
@Schema(description = "创建时间戳(>=)")
|
||||||
|
private String created;
|
||||||
|
|
||||||
|
@JsonProperty("modified")
|
||||||
|
@Schema(description = "修改时间戳(>=)")
|
||||||
|
private String modified;
|
||||||
|
|
||||||
|
@JsonProperty("base_custom_data")
|
||||||
|
@Schema(description = "基本信息自定义字段列表(逗号分隔)")
|
||||||
|
private String baseCustomData;
|
||||||
|
|
||||||
|
@JsonProperty("person_custom_data")
|
||||||
|
@Schema(description = "个人信息自定义字段列表(逗号分隔)")
|
||||||
|
private String personCustomData;
|
||||||
|
|
||||||
|
@JsonProperty("work_custom_data")
|
||||||
|
@Schema(description = "工作信息自定义字段列表(逗号分隔)")
|
||||||
|
private String workCustomData;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -92,6 +92,18 @@ public class IWorkOrgRestServiceImpl implements IWorkOrgRestService {
|
|||||||
if (StringUtils.hasText(reqVO.getSubcompanyName())) {
|
if (StringUtils.hasText(reqVO.getSubcompanyName())) {
|
||||||
params.put("subcompanyname", reqVO.getSubcompanyName());
|
params.put("subcompanyname", reqVO.getSubcompanyName());
|
||||||
}
|
}
|
||||||
|
if (StringUtils.hasText(reqVO.getModified())) {
|
||||||
|
params.put("modified", reqVO.getModified());
|
||||||
|
}
|
||||||
|
if (StringUtils.hasText(reqVO.getCanceled())) {
|
||||||
|
params.put("canceled", reqVO.getCanceled());
|
||||||
|
}
|
||||||
|
if (StringUtils.hasText(reqVO.getCustomData())) {
|
||||||
|
params.put("custom_data", reqVO.getCustomData());
|
||||||
|
}
|
||||||
|
if (StringUtils.hasText(reqVO.getId())) {
|
||||||
|
params.put("id", reqVO.getId());
|
||||||
|
}
|
||||||
JsonNode node = invokeParamsEndpoint(path, params);
|
JsonNode node = invokeParamsEndpoint(path, params);
|
||||||
return buildSubcompanyPageResp(node);
|
return buildSubcompanyPageResp(node);
|
||||||
}
|
}
|
||||||
@@ -106,8 +118,23 @@ public class IWorkOrgRestServiceImpl implements IWorkOrgRestService {
|
|||||||
if (StringUtils.hasText(reqVO.getDepartmentName())) {
|
if (StringUtils.hasText(reqVO.getDepartmentName())) {
|
||||||
params.put("departmentname", reqVO.getDepartmentName());
|
params.put("departmentname", reqVO.getDepartmentName());
|
||||||
}
|
}
|
||||||
if (StringUtils.hasText(reqVO.getSubcompanyId())) {
|
if (StringUtils.hasText(reqVO.getSubcompanyId1())) {
|
||||||
params.put("subcompanyid", reqVO.getSubcompanyId());
|
params.put("subcompanyid1", reqVO.getSubcompanyId1());
|
||||||
|
}
|
||||||
|
if (StringUtils.hasText(reqVO.getCreated())) {
|
||||||
|
params.put("created", reqVO.getCreated());
|
||||||
|
}
|
||||||
|
if (StringUtils.hasText(reqVO.getModified())) {
|
||||||
|
params.put("modified", reqVO.getModified());
|
||||||
|
}
|
||||||
|
if (StringUtils.hasText(reqVO.getCanceled())) {
|
||||||
|
params.put("canceled", reqVO.getCanceled());
|
||||||
|
}
|
||||||
|
if (StringUtils.hasText(reqVO.getCustomData())) {
|
||||||
|
params.put("custom_data", reqVO.getCustomData());
|
||||||
|
}
|
||||||
|
if (StringUtils.hasText(reqVO.getId())) {
|
||||||
|
params.put("id", reqVO.getId());
|
||||||
}
|
}
|
||||||
JsonNode node = invokeParamsEndpoint(path, params);
|
JsonNode node = invokeParamsEndpoint(path, params);
|
||||||
return buildDepartmentPageResp(node);
|
return buildDepartmentPageResp(node);
|
||||||
@@ -117,12 +144,18 @@ public class IWorkOrgRestServiceImpl implements IWorkOrgRestService {
|
|||||||
public IWorkHrJobTitlePageRespVO listJobTitles(IWorkJobTitleQueryReqVO reqVO) {
|
public IWorkHrJobTitlePageRespVO listJobTitles(IWorkJobTitleQueryReqVO reqVO) {
|
||||||
String path = orgPaths().getJobTitlePage();
|
String path = orgPaths().getJobTitlePage();
|
||||||
Map<String, Object> params = buildBaseParams(reqVO);
|
Map<String, Object> params = buildBaseParams(reqVO);
|
||||||
if (StringUtils.hasText(reqVO.getJobTitleCode())) {
|
|
||||||
params.put("jobtitlecode", reqVO.getJobTitleCode());
|
|
||||||
}
|
|
||||||
if (StringUtils.hasText(reqVO.getJobTitleName())) {
|
if (StringUtils.hasText(reqVO.getJobTitleName())) {
|
||||||
params.put("jobtitlename", reqVO.getJobTitleName());
|
params.put("jobtitlename", reqVO.getJobTitleName());
|
||||||
}
|
}
|
||||||
|
if (StringUtils.hasText(reqVO.getCreated())) {
|
||||||
|
params.put("created", reqVO.getCreated());
|
||||||
|
}
|
||||||
|
if (StringUtils.hasText(reqVO.getModified())) {
|
||||||
|
params.put("modified", reqVO.getModified());
|
||||||
|
}
|
||||||
|
if (StringUtils.hasText(reqVO.getId())) {
|
||||||
|
params.put("id", reqVO.getId());
|
||||||
|
}
|
||||||
JsonNode node = invokeParamsEndpoint(path, params);
|
JsonNode node = invokeParamsEndpoint(path, params);
|
||||||
return buildJobTitlePageResp(node);
|
return buildJobTitlePageResp(node);
|
||||||
}
|
}
|
||||||
@@ -134,11 +167,8 @@ public class IWorkOrgRestServiceImpl implements IWorkOrgRestService {
|
|||||||
if (StringUtils.hasText(reqVO.getWorkCode())) {
|
if (StringUtils.hasText(reqVO.getWorkCode())) {
|
||||||
params.put("workcode", reqVO.getWorkCode());
|
params.put("workcode", reqVO.getWorkCode());
|
||||||
}
|
}
|
||||||
if (StringUtils.hasText(reqVO.getLastName())) {
|
if (StringUtils.hasText(reqVO.getSubcompanyId1())) {
|
||||||
params.put("lastname", reqVO.getLastName());
|
params.put("subcompanyid1", reqVO.getSubcompanyId1());
|
||||||
}
|
|
||||||
if (StringUtils.hasText(reqVO.getSubcompanyId())) {
|
|
||||||
params.put("subcompanyid", reqVO.getSubcompanyId());
|
|
||||||
}
|
}
|
||||||
if (StringUtils.hasText(reqVO.getDepartmentId())) {
|
if (StringUtils.hasText(reqVO.getDepartmentId())) {
|
||||||
params.put("departmentid", reqVO.getDepartmentId());
|
params.put("departmentid", reqVO.getDepartmentId());
|
||||||
@@ -146,14 +176,26 @@ public class IWorkOrgRestServiceImpl implements IWorkOrgRestService {
|
|||||||
if (StringUtils.hasText(reqVO.getJobTitleId())) {
|
if (StringUtils.hasText(reqVO.getJobTitleId())) {
|
||||||
params.put("jobtitleid", reqVO.getJobTitleId());
|
params.put("jobtitleid", reqVO.getJobTitleId());
|
||||||
}
|
}
|
||||||
if (StringUtils.hasText(reqVO.getStatus())) {
|
if (StringUtils.hasText(reqVO.getId())) {
|
||||||
params.put("status", reqVO.getStatus());
|
params.put("id", reqVO.getId());
|
||||||
}
|
}
|
||||||
if (StringUtils.hasText(reqVO.getMobile())) {
|
if (StringUtils.hasText(reqVO.getLoginId())) {
|
||||||
params.put("mobile", reqVO.getMobile());
|
params.put("loginid", reqVO.getLoginId());
|
||||||
}
|
}
|
||||||
if (StringUtils.hasText(reqVO.getEmail())) {
|
if (StringUtils.hasText(reqVO.getCreated())) {
|
||||||
params.put("email", reqVO.getEmail());
|
params.put("created", reqVO.getCreated());
|
||||||
|
}
|
||||||
|
if (StringUtils.hasText(reqVO.getModified())) {
|
||||||
|
params.put("modified", reqVO.getModified());
|
||||||
|
}
|
||||||
|
if (StringUtils.hasText(reqVO.getBaseCustomData())) {
|
||||||
|
params.put("base_custom_data", reqVO.getBaseCustomData());
|
||||||
|
}
|
||||||
|
if (StringUtils.hasText(reqVO.getPersonCustomData())) {
|
||||||
|
params.put("person_custom_data", reqVO.getPersonCustomData());
|
||||||
|
}
|
||||||
|
if (StringUtils.hasText(reqVO.getWorkCustomData())) {
|
||||||
|
params.put("work_custom_data", reqVO.getWorkCustomData());
|
||||||
}
|
}
|
||||||
JsonNode node = invokeParamsEndpoint(path, params);
|
JsonNode node = invokeParamsEndpoint(path, params);
|
||||||
return buildUserPageResp(node);
|
return buildUserPageResp(node);
|
||||||
@@ -161,9 +203,6 @@ public class IWorkOrgRestServiceImpl implements IWorkOrgRestService {
|
|||||||
|
|
||||||
private Map<String, Object> buildBaseParams(IWorkOrgBaseQueryReqVO reqVO) {
|
private Map<String, Object> buildBaseParams(IWorkOrgBaseQueryReqVO reqVO) {
|
||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
if (reqVO.getParams() != null) {
|
|
||||||
params.putAll(reqVO.getParams());
|
|
||||||
}
|
|
||||||
if (reqVO.getCurpage() != null) {
|
if (reqVO.getCurpage() != null) {
|
||||||
params.put("curpage", reqVO.getCurpage());
|
params.put("curpage", reqVO.getCurpage());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user