流程中心:发起
This commit is contained in:
@ -0,0 +1,33 @@
|
||||
package com.chinaunicom.mall.ebtp.common.workflow.client;
|
||||
|
||||
import com.chinaunicom.mall.ebtp.common.base.entity.BaseResponse;
|
||||
import com.chinaunicom.mall.ebtp.common.constant.ServiceNameConstants;
|
||||
import com.chinaunicom.mall.ebtp.common.workflow.entity.WorkflowCreateResponse;
|
||||
import com.chinaunicom.mall.ebtp.common.workflow.fallback.WorkflowFeignClientFallback;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
@FeignClient(name = ServiceNameConstants.EXTEND_SERVICE, fallback = WorkflowFeignClientFallback.class)
|
||||
public interface WorkflowFeignClient {
|
||||
|
||||
/**
|
||||
* @param userEmail 发起人邮箱
|
||||
* @param userName 发起人用户名
|
||||
* @param userOrgId 发起人所在部门id
|
||||
* @param modelId 流程模型ID
|
||||
* @param businessKey 节点标识
|
||||
* @param url 流程审批详情页面URL(urlencode)
|
||||
* @return 流程创建结果 获取processInstanceId与业务数据ID进行关联,为了后续回调处理后续业务
|
||||
*/
|
||||
@GetMapping("/workflow/create")
|
||||
BaseResponse<WorkflowCreateResponse> create(
|
||||
@RequestParam String userEmail,
|
||||
@RequestParam String userName,
|
||||
@RequestParam String userOrgId,
|
||||
@RequestParam String modelId,
|
||||
@RequestParam String businessKey,
|
||||
@RequestParam String url
|
||||
);
|
||||
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
package com.chinaunicom.mall.ebtp.common.workflow.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
*
|
||||
{
|
||||
"resultCode": "0",
|
||||
"resultMsg": "成功",
|
||||
"resultObject": {
|
||||
"token": "5f50b59a-faf8-4ea2-b7e9-2e4fa04c46fa",
|
||||
"id": 7000458,
|
||||
"userId": 7180012,
|
||||
"loginName": "dingx23",
|
||||
"loginPassword": null,
|
||||
"userName": "丁侠",
|
||||
"userMail": "dingx23@chinaunicom.cn",
|
||||
"userPhone": "",
|
||||
"userStatus": "1",
|
||||
"userType": "1",
|
||||
"createId": "0",
|
||||
"createTime": "2023-07-18T16:23:28",
|
||||
"updateId": "0",
|
||||
"updateTime": "2025-05-07T19:07:19",
|
||||
"attributes": {
|
||||
"oaOrgInfo": null,
|
||||
"oaEmpCode": "0958168",
|
||||
"siteInfo": "4,999,1,联通软件研究院-公共平台与架构研发事业部,主岗,"
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
@Data
|
||||
public class WorkflowBaseResponse<T> {
|
||||
|
||||
private String resultCode;
|
||||
private String resultMsg;
|
||||
private T resultObject;
|
||||
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
package com.chinaunicom.mall.ebtp.common.workflow.entity;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
*
|
||||
{
|
||||
"modelId": "1953018896810274817",
|
||||
"businessKey":"10002",
|
||||
"variables": [{
|
||||
"name":"internal_app_env_key",
|
||||
"value":"env_test"
|
||||
},{
|
||||
"name":"url",
|
||||
"value":"http://10.0.0.125:3000/index"
|
||||
}
|
||||
]
|
||||
}
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class WorkflowCreateRequest {
|
||||
private String modelId;
|
||||
private String businessKey;
|
||||
private WorkflowVariable[] variables;
|
||||
}
|
@ -0,0 +1,81 @@
|
||||
package com.chinaunicom.mall.ebtp.common.workflow.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* {
|
||||
"id": "69f4b176-7335-11f0-ad9f-a2843e06dd7d",
|
||||
"processDefId": "Process_2p4rq5b:1:2ba9b30c-72a4-11f0-ad9f-a2843e06dd7d",
|
||||
"orgId": "ce7d12dd8bcd416aafe3bea5a4e96edd",
|
||||
"appId": "580470127",
|
||||
"envType": "env_test",
|
||||
"startUserName": "丁侠",
|
||||
"startDepartmentId": null,
|
||||
"customInfoAttr": null,
|
||||
"memo": null,
|
||||
"processCode": "cslc",
|
||||
"formKey": "10002",
|
||||
"appInfo": "{\"appId\":580470127,\"appCode\":\"clc1752747475234\",\"appName\":\"ceshi07\",\"appUseType\":\"1001\",\"appType\":\"0\",\"appEnv\":\"env_dev,env_test\",\"orgId\":\"ce7d12dd8bcd416aafe3bea5a4e96edd\",\"orgName\":\"中国远洋海运集团有限公司\",\"statusCd\":\"00A\"}",
|
||||
"startUserId": "7180012",
|
||||
"processName": "测试流程",
|
||||
"processAttr": "{}",
|
||||
"startTime": "2025-08-07 10:22:49",
|
||||
"businessKey": "10002",
|
||||
"processType": "Main",
|
||||
"businessStatus": null,
|
||||
"processInstanceId": "69f4b176-7335-11f0-ad9f-a2843e06dd7d",
|
||||
"processInstanceName": "测试流程",
|
||||
"createTime": "2025-08-07 10:22:49",
|
||||
"endTime": null,
|
||||
"startUser": {
|
||||
"userId": "7180012",
|
||||
"loginName": "dingx23",
|
||||
"userName": "丁侠",
|
||||
"userMail": "dingx23@chinaunicom.cn",
|
||||
"userPhone": "",
|
||||
"oaOrgInfo": "联通软件研究院-公共平台与架构研发事业部"
|
||||
},
|
||||
"tenantId": "580470127",
|
||||
"processVariables": {
|
||||
"processInstanceId": "69f4b176-7335-11f0-ad9f-a2843e06dd7d",
|
||||
"internal_app_env_key": "env_test",
|
||||
"internal_app_id": 580470127,
|
||||
"internal_process_attr": "{}",
|
||||
"internal_app_org_key": "ce7d12dd8bcd416aafe3bea5a4e96edd",
|
||||
"internal_start_user_name": "丁侠",
|
||||
"internal_start_user_id": "7180012",
|
||||
"internal_app_info_key": "{\"appId\":580470127,\"appCode\":\"clc1752747475234\",\"appName\":\"ceshi07\",\"appUseType\":\"1001\",\"appType\":\"0\",\"appEnv\":\"env_dev,env_test\",\"orgId\":\"ce7d12dd8bcd416aafe3bea5a4e96edd\",\"orgName\":\"中国远洋海运集团有限公司\",\"statusCd\":\"00A\"}",
|
||||
"url": "http://10.0.0.125:3000/index",
|
||||
"internal_process_code_": "cslc",
|
||||
"internal_start_form_key": "10002"
|
||||
}
|
||||
*/
|
||||
@Data
|
||||
public class WorkflowCreateResponse {
|
||||
private String id;
|
||||
private String processDefId;
|
||||
private String orgId;
|
||||
private String appId;
|
||||
private String envType;
|
||||
private String startUserName;
|
||||
private String startDepartmentId;
|
||||
private String customInfoAttr;
|
||||
private String memo;
|
||||
private String processCode;
|
||||
private String formKey;
|
||||
private String appInfo;
|
||||
private String startUserId;
|
||||
private String processName;
|
||||
private String processAttr;
|
||||
private String startTime;
|
||||
private String businessKey;
|
||||
private String processType;
|
||||
private String businessStatus;
|
||||
private String processInstanceId;
|
||||
private String processInstanceName;
|
||||
private String createTime;
|
||||
private String endTime;
|
||||
private WorkflowUser startUser;
|
||||
private String tenantId;
|
||||
// private WorkflowProcessVariables processVariables;
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package com.chinaunicom.mall.ebtp.common.workflow.entity;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class WorkflowExchange {
|
||||
private String dateTime;
|
||||
private Boolean createUserWhenNotExist;
|
||||
private String userOrgId;
|
||||
private WorkflowUser userVo;
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package com.chinaunicom.mall.ebtp.common.workflow.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
*
|
||||
"clientId":"zhongyuan-haiyun",
|
||||
"exchangeRequest":"zAW5fhAo3z078qTBd8jGkXqkmeivlYs1U4yslBoqYCgjDMIq33OJidLsP5WQhQDsZAq6h0kOJnBorg6dZFsAOI9grEOGSoqe22-WNzi6s03hFR0FbGtM1FPJYVh1rzGkOSFNhsS4ju_B5bJxyw204LegGIsPmQFCQxglz6WDB3zX2dZ9eWcr5zoDLbNoouZdv7wTw9iymvUH3uCofyp5aqjT4JNHniWh3BlQFngB57ss5T-aIxrRjHJbFJqDOT8T1Niiu11limSjv3uQlGTj_r12NpPoyKnrhgL8N8SJP70WrnzN5G6r8KPpG68V4A_Q"
|
||||
*/
|
||||
@Data
|
||||
public class WorkflowTokenRequest {
|
||||
private String clientId;
|
||||
private String exchangeRequest;
|
||||
}
|
@ -0,0 +1,50 @@
|
||||
package com.chinaunicom.mall.ebtp.common.workflow.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
*
|
||||
"token": "5f50b59a-faf8-4ea2-b7e9-2e4fa04c46fa",
|
||||
"id": 7000458,
|
||||
"userId": 7180012,
|
||||
"loginName": "dingx23",
|
||||
"loginPassword": null,
|
||||
"userName": "丁侠",
|
||||
"userMail": "dingx23@chinaunicom.cn",
|
||||
"userPhone": "",
|
||||
"userStatus": "1",
|
||||
"userType": "1",
|
||||
"createId": "0",
|
||||
"createTime": "2023-07-18T16:23:28",
|
||||
"updateId": "0",
|
||||
"updateTime": "2025-05-07T19:07:19",
|
||||
"attributes": {
|
||||
"oaOrgInfo": null,
|
||||
"oaEmpCode": "0958168",
|
||||
"siteInfo": "4,999,1,联通软件研究院-公共平台与架构研发事业部,主岗,"
|
||||
*/
|
||||
@Data
|
||||
public class WorkflowTokenResponse {
|
||||
private String token;
|
||||
private Long id;
|
||||
private Long userId;
|
||||
private String loginName;
|
||||
private String loginPassword;
|
||||
private String userName;
|
||||
private String userMail;
|
||||
private String userPhone;
|
||||
private String userStatus;
|
||||
private String userType;
|
||||
private String createId;
|
||||
private String createTime;
|
||||
private String updateId;
|
||||
private String updateTime;
|
||||
private Attributes attributes;
|
||||
|
||||
@Data
|
||||
public static class Attributes {
|
||||
private String oaOrgInfo;
|
||||
private String oaEmpCode;
|
||||
private String siteInfo;
|
||||
}
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package com.chinaunicom.mall.ebtp.common.workflow.entity;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class WorkflowUser {
|
||||
private String loginName;
|
||||
private String loginPassword;
|
||||
private String userName;
|
||||
private String userMail;
|
||||
private String userPhone;
|
||||
private String oaOrgInfo;
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package com.chinaunicom.mall.ebtp.common.workflow.entity;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class WorkflowVariable {
|
||||
private String name;
|
||||
private String value;
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package com.chinaunicom.mall.ebtp.common.workflow.fallback;
|
||||
|
||||
import com.chinaunicom.mall.ebtp.common.base.entity.BaseResponse;
|
||||
import com.chinaunicom.mall.ebtp.common.workflow.client.WorkflowFeignClient;
|
||||
import com.chinaunicom.mall.ebtp.common.workflow.entity.WorkflowCreateResponse;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class WorkflowFeignClientFallback implements WorkflowFeignClient {
|
||||
|
||||
@Override
|
||||
public BaseResponse<WorkflowCreateResponse> create(String userEmail, String userName, String userOrgId, String modelId, String businessKey, String url) {
|
||||
return null;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user