修改日期 | 修改人 | 备注 |
2020-04-29 11:27:10[当前版本] | 魏漫漫 | 格式调整 |
2020-04-29 11:25:50 | 魏漫漫 | 格式调整 |
2020-04-29 11:13:30 | 魏漫漫 | 格式调整 |
2020-04-28 16:36:26 | 魏漫漫 | 创建版本 |
近期在参与质量监督系统功能开发,涉及到工作流的使用操作,技术方案采用本部门已研究的第三方OA工作流。
具体开发过程中的总结记录如下:以质量监督申报流程举例
整个流程环节:质量监督申报--->窗口审核--->领导审核
当窗口审核通过则继续下一步流程操作,如果窗口审核未通过,则通知申报人,重新进行申报。
质量监督申报流程图如下:
质量监督申报流程图如下:
1、流程关联表(实体):
Application:应用(阶段)管理表
Process:流程管理表
Instance:工作(实例)管理表
Activity:活动管理表
2、业务主表(实体):
QualityProject:质量监督工程记录
QualitySupervisionApply:质量监督申报记录
1、质量监督申请
接口输入参数如下:
public class StartQualitySupervisionWFDto { /// <summary> /// 质量监督申报实体 /// </summary> public QualitySupervisionApplyDto QuaSuperInput { get; set; } /// <summary> /// 流程输入数据 /// </summary> public WFProcessDto ProcessInput { get; set; } /// <summary> /// 启动工作流数据传入对象 /// </summary> public StartWorkFlowInDto WFInParam { get; set; } /// <summary> /// 工作流流转数据传入对象 /// </summary> public TaskActionInDto TaskActionInParam { get; set; } }接口输出参数:申报唯一标识
2、获取当前流程信息
输入参数:
/// <param name="WorkOrWorkCompleted">workid</param>
/// <param name="identity">当前登陆用户标识</param>
/// <param name="ProjectGuid">工程唯一标识</param>
输出参数实体格式:
public class CurrentWFOutput { /// <summary> /// TaskID 下一步任务唯一标识 /// </summary> public string TaskID { get; set; } /// <summary> /// 上一步操作名称 /// </summary> public string LastStepName { get; set; } /// <summary> /// 上一步操作人 /// </summary> public string LastStepOperateUser { get; set; } /// <summary> /// 上一步操作时间 /// </summary> public DateTime LastStepOperateTime { get; set; } /// <summary> /// 当前操作名称 /// </summary> public string CurrentStepName { get; set; } /// <summary> /// 当前操作路由 /// </summary> public string[] RouteNameList { get; set; } /// <summary> /// 当前操作是否有权限 /// </summary> public bool Jurisdiction { get; set; } /// <summary> /// 待办任务 /// </summary> public WFOutTaskListDto NextTask { get; set; } /// <summary> /// 业务表唯一标识(质监申报表、监督检查表) /// </summary> public string BusinessID { get; set; } }
3、执行下一步流程
输入参数实体类:
public class NextWFInputDto { /// <summary> /// 阶段信息 /// </summary> public StageInput stage { get; set; } /// <summary> /// 监督小组信息 /// </summary> public QualityGroupInput group { get; set; } /// <summary> /// 待执行任务 /// </summary> public WFOutTaskListDto NextTask { get; set; } /// <summary> /// 工程名称 /// </summary> public string ProjectName { get; set; } /// <summary> /// 工作唯一标识 /// </summary> public string WorkID { get; set; } /// <summary> /// 当前操作人 /// </summary> public string OperatorName { get; set; } /// <summary> /// 业务表唯一标识 /// </summary> public string BusinessID { get; set; } }输出参数:bool类型,执行成功或失败。
4、质量监督重新申请
输入参数实体类:
public class AgainQualityApplyWFDto { /// <summary> /// 质量监督重新申报实体 /// </summary> public AgainQualityApplyDto ApplyInput { get; set; } /// <summary> /// 下一步任务 /// </summary> public WFOutTaskListDto NextTask { get; set; } /// <summary> /// 阶段信息 /// </summary> public StageInput stage { get; set; } }输出数据:申报唯一标识
5、获取工程阶段审批意见
输入参数:
/// <param name="projectguid">工程唯一标识</param>
/// <param name="processguid">流程唯一标识</param>
输出参数实体类格式:输出数据为List集合
public class ApprovalInfoOutput { public string StepName { get; set; }// StepName: "步骤名称", public string Remark { get; set; }// Remark: "意见详情", public DateTime OperateTime { get; set; }// OperateTime: "提交时间", public string OperateDisplayName { get; set; }// OperateDisplayName: "提交人", /// <summary> /// 申请业务表唯一标识 /// </summary> public string BusinessID { get; set; } }
6、获取审批意见
输入参数:
/// <param name="projectguid">工程唯一标识</param>
/// <param name="processguid">流程唯一标识</param>
输出参数实体类格式如下:输出为List集合
public class AuditOpinionOutput { /// <summary> /// 步骤名称 /// </summary> public string StepName { get; set; } /// <summary> /// 唯一标识 /// </summary> public string RowGuid { get; set; } /// <summary> /// 是否开始节点 /// </summary> public int IsStartNode { get; set; }// "IsStartNode":1, /// <summary> /// 操作人唯一标识 /// </summary> public string OperateUserName { get; set; }// "OperateUserName":"1958fd7769054a9aa34e62972f80dc63", /// <summary> /// 审批意见 /// </summary> public string Remark { get; set; }// "Remark":"【测试工程-地下室-墙体】", public string InstanceGuid { get; set; }// "InstanceGuid":"ccfd2e3b-f052-48bd-b9d7-63f4648376da", public string ApplicationId { get; set; }// "ApplicationId":"c8d6aa1b-9503-4397-82ef-0506cc240798", /// <summary> /// 操作时间 /// </summary> public DateTime OperateTime { get; set; }// "OperateTime":"2020-03-24T11:48:50.037", /// <summary> /// 操作人 /// </summary> public string OperateDisplayName { get; set; }// "OperateDisplayName":"贵阳江河建设工程管理有限公司", /// <summary> /// 路由的名称 /// </summary> public string ResultText { get; set; }// "ResultText":"企业申请" /// <summary> /// 申请业务表唯一标识 /// </summary> public string BusinessID { get; set; } }
1、启动工作流
接口调用:
var workProcessData = _o2OAHttpClient.PostDataSynch<List<WorkProcessOutDto>>(_applicationClient, $"/x_processplatform_assemble_surface/jaxrs/work/process/{ProcessFlag}", WFInParam);
输入参数:
ProcessFlag:流程标识
WFInParam:实体类格式如下:
public class StartWorkFlowInDto { /// <summary> /// 直接打开指定人员已经有的草稿,草稿判断:工作没有已办,只有一条此人的待办 /// </summary> public string latest { get; set; } /// <summary> /// 标题 /// </summary> public string title { get; set; } /// <summary> /// 启动人员身份. /// </summary> public string identity { get; set; } /// <summary> /// 工作数据 /// </summary> public string data { get; set; } }输出参数:实体类格式如下:
public class CreateWorkOutput { /// <summary> /// 下一步任务对象 /// </summary> public WFOutTaskListDto Task { get; set; } /// <summary> /// 实例唯一标识 /// </summary> public string InstanceId { get; set; } }任务对象实体类:
public class WFOutTaskListDto { public string id { get; set; } //"id": "fd92768f-e15a-4d85-824d-0deb90ecb77b", public string job { get; set; } // "job": "445eb760-e127-4f51-8c47-8c18ee663d1a", public string title { get; set; } //"title": "1745测试质量监督申报", public DateTime startTime { get; set; } //"startTime": "2020-04-01 17:45:58", public string startTimeMonth { get; set; } //"startTimeMonth": "2020-04", public string work { get; set; } //"work": "06e014b9-d3cc-4f60-9413-d0215284b9e6", public string application { get; set; } //"application": "43677d33-c7c0-4cd8-8e65-ad014f035352", public string applicationName { get; set; } //"applicationName": "质量监督申报", public string applicationAlias { get; set; } //"applicationAlias": "zhiliangjiandushenbao", public string process { get; set; } // "process": "2e7ae62d-97b6-4291-a115-b74b53e8c7eb", public string processName { get; set; } // "processName": "质量监督申报流程", public string processAlias { get; set; } // "processAlias": "", public string serial { get; set; } // "serial": "", public string person { get; set; } // "person": "xwb@9ebb0f95-efa3-41e6-baf5-76d07004559c@P", public string identity { get; set; } // "identity": "xwb@9daa7349-5355-47b5-a680-787ef2efbb67@I", public string unit { get; set; } // "unit": "二连@A6DC9E18-0362-42A2-A6F9-136A275E7E68", public string activity { get; set; } // "activity": "2a6d99cf-8455-4b16-8758-2a566fed3b71", public string activityName { get; set; } //"activityName": "质量监督申请", public string activityAlias { get; set; } //"activityAlias": "", public string activityDescription { get; set; } // "activityDescription": "", public string activityType { get; set; } //"activityType": "manual", public string activityToken { get; set; } // "activityToken": "d9b70027-538c-4eca-8099-0038d8c69f4a", public string creatorPerson { get; set; } // "creatorPerson": "xwb@9ebb0f95-efa3-41e6-baf5-76d07004559c@P", public string creatorIdentity { get; set; } // "creatorIdentity": "xwb@9daa7349-5355-47b5-a680-787ef2efbb67@I", public string creatorUnit { get; set; } // "creatorUnit": "二连@A6DC9E18-0362-42A2-A6F9-136A275E7E68", public bool expired { get; set; } // "expired": false, public bool urged { get; set; } // "urged": false, public string[] routeList { get; set; } // "routeList": ["5329bab4-4728-4a37-a6ac-ca4903e9876b"], public string[] routeNameList { get; set; } // "routeNameList": ["发起申请"], public string[] routeOpinionList { get; set; } // "routeOpinionList": [""], public string[] routeDecisionOpinionList { get; set; } //"routeDecisionOpinionList": [""], public string routeName { get; set; }// "routeName": "", public string opinion { get; set; }// "opinion": "", public bool modified { get; set; }// "modified": false, public bool viewed { get; set; }// "viewed": false, public bool allowRapid { get; set; } //"allowRapid": false, public bool first { get; set; } // "first": true, public Properties properties { get; set; } // "properties": {}, public string series { get; set; } //"series": "4fcb3693-299c-4039-bd2f-b56fa74b17ba", public string workCreateType { get; set; } //"workCreateType": "surface", public DateTime createTime { get; set; } // "createTime": "2020-04-01 17:45:58", public DateTime updateTime { get; set; } // "updateTime": "2020-04-01 17:45:58" }
2、执行下一步
接口调用:
var actionRes = _o2OAHttpClient.PostDataSynch<TaskActionOutDto>(_applicationClient, $"/x_processplatform_assemble_surface/jaxrs/task/{input.Task.id}/processing", input.Task);
输入参数:
/// <param name="input">任务输入数据</param>
/// <param name="instance">实例数据</param>
/// <param name="operatorname">操作人姓名</param>
/// <param name="applyId">申请表唯一标识</param>
输出参数实体类:
public class ActiveOutput { /// <summary> /// 活动表唯一标识 /// </summary> public string Id { get; set; } /// <summary> /// 活动名称 /// </summary> public string fromActivityName { get; set; } }
3、获取当前流程
接口调用:
//获取当前流程(根据Work Id获取基本的work内容)
var WorkLogDataOutput = _o2OAHttpClient.GetDataSynch<WorkLogDataOutputDto>(_applicationClient, $"/x_processplatform_assemble_surface/jaxrs/work/{WorkOrWorkCompleted}", "");
/// <param name="WorkOrWorkCompleted">workid</param>
输出参数
public class WorkLogDataOutputDto { public List<WorkLog> workLogList { get; set; }// 工作日志对象 public List<WFOutTaskListDto> taskList { get; set; }// 待办对象 }
public class WorkLog { /// <summary> /// 待办任务数据 /// </summary> public List<WFOutTaskListDto> TaskList { get; set; } /// <summary> /// 已完成任务 /// </summary> public List<TaskCompleted> TaskCompletedList { get; set; } //public int ReadList { get; set; } //public int ReadCompleteList { get; set; } public string id { get; set; } // "id": "fd88f4af-f71f-4195-afa8-a62af6ecd1be", public string job { get; set; } // "job": "a7217f6a-6a69-43ae-a59f-00b3b0f0ecae", public string work { get; set; } // "work": "0afd6d76-e96f-41fe-90d9-38b5a4f7f14a", public bool completed { get; set; } // "completed": false, public string fromActivity { get; set; } // "fromActivity": "1e3803ea-d7c0-4191-8ed2-9c62d2092ef6", public string fromActivityType { get; set; } // "fromActivityType": "begin", public string fromActivityName { get; set; } // "fromActivityName": "开始", public string fromActivityAlias { get; set; } // "fromActivityAlias": "", public string fromActivityToken { get; set; } // "fromActivityToken": "7ca692b9-69e4-49c9-ac82-a646331a69e4", public DateTime fromTime { get; set; } // "fromTime": "2020-04-15 20:31:29", public string arrivedActivity { get; set; } // "arrivedActivity": "780ac1f6-7c48-4df8-80de-dd1b0bfd7ffc", public string arrivedActivityType { get; set; } // "arrivedActivityType": "manual", public string arrivedActivityName { get; set; } // "arrivedActivityName": "企业申请", public string arrivedActivityToken { get; set; } // "arrivedActivityToken": "9c8c6c6b-40ba-4dc6-98e6-7de282f113ac", public string arrivedGroup { get; set; } // "arrivedGroup": "", public string arrivedOpinionGroup { get; set; } // "arrivedOpinionGroup": "", public DateTime arrivedTime { get; set; } // "arrivedTime": "2020-04-15 20:31:31", public string application { get; set; } // "application": "539eb557-4d73-480d-bc05-67033ae5602c", public string applicationName { get; set; } // "applicationName": "质量监督申报", public string process { get; set; } // "process": "dd629195-6d6f-438e-8c6d-34957c9adec0", public string processName { get; set; } // "processName": "质量监督申报流程", public string route { get; set; } // "route": "b0842f07-3c42-4297-b8e2-5352a470ad92", public string routeName { get; set; } // "routeName": "开始", public bool connected { get; set; } // "connected": true, public int duration { get; set; } // "duration": 0, public bool splitting { get; set; } // "splitting": false, public DateTime createTime { get; set; } // "createTime": "2020-04-15 20:31:29", public DateTime updateTime { get; set; } // "updateTime": "2020-04-15 20:31:31" }
public class WFOutTaskListDto { public string id { get; set; } //"id": "fd92768f-e15a-4d85-824d-0deb90ecb77b", public string job { get; set; } // "job": "445eb760-e127-4f51-8c47-8c18ee663d1a", public string title { get; set; } //"title": "1745测试质量监督申报", public DateTime startTime { get; set; } //"startTime": "2020-04-01 17:45:58", public string startTimeMonth { get; set; } //"startTimeMonth": "2020-04", public string work { get; set; } //"work": "06e014b9-d3cc-4f60-9413-d0215284b9e6", public string application { get; set; } //"application": "43677d33-c7c0-4cd8-8e65-ad014f035352", public string applicationName { get; set; } //"applicationName": "质量监督申报", public string applicationAlias { get; set; } //"applicationAlias": "zhiliangjiandushenbao", public string process { get; set; } // "process": "2e7ae62d-97b6-4291-a115-b74b53e8c7eb", public string processName { get; set; } // "processName": "质量监督申报流程", public string processAlias { get; set; } // "processAlias": "", public string serial { get; set; } // "serial": "", public string person { get; set; } // "person": "xwb@9ebb0f95-efa3-41e6-baf5-76d07004559c@P", public string identity { get; set; } // "identity": "xwb@9daa7349-5355-47b5-a680-787ef2efbb67@I", public string unit { get; set; } // "unit": "二连@A6DC9E18-0362-42A2-A6F9-136A275E7E68", public string activity { get; set; } // "activity": "2a6d99cf-8455-4b16-8758-2a566fed3b71", public string activityName { get; set; } //"activityName": "质量监督申请", public string activityAlias { get; set; } //"activityAlias": "", public string activityDescription { get; set; } // "activityDescription": "", public string activityType { get; set; } //"activityType": "manual", public string activityToken { get; set; } // "activityToken": "d9b70027-538c-4eca-8099-0038d8c69f4a", public string creatorPerson { get; set; } // "creatorPerson": "xwb@9ebb0f95-efa3-41e6-baf5-76d07004559c@P", public string creatorIdentity { get; set; } // "creatorIdentity": "xwb@9daa7349-5355-47b5-a680-787ef2efbb67@I", public string creatorUnit { get; set; } // "creatorUnit": "二连@A6DC9E18-0362-42A2-A6F9-136A275E7E68", public bool expired { get; set; } // "expired": false, public bool urged { get; set; } // "urged": false, public string[] routeList { get; set; } // "routeList": ["5329bab4-4728-4a37-a6ac-ca4903e9876b"], public string[] routeNameList { get; set; } // "routeNameList": ["发起申请"], public string[] routeOpinionList { get; set; } // "routeOpinionList": [""], public string[] routeDecisionOpinionList { get; set; } //"routeDecisionOpinionList": [""], public string routeName { get; set; }// "routeName": "", public string opinion { get; set; }// "opinion": "", public bool modified { get; set; }// "modified": false, public bool viewed { get; set; }// "viewed": false, public bool allowRapid { get; set; } //"allowRapid": false, public bool first { get; set; } // "first": true, public Properties properties { get; set; } // "properties": {}, public string series { get; set; } //"series": "4fcb3693-299c-4039-bd2f-b56fa74b17ba", public string workCreateType { get; set; } //"workCreateType": "surface", public DateTime createTime { get; set; } // "createTime": "2020-04-01 17:45:58", public DateTime updateTime { get; set; } // "updateTime": "2020-04-01 17:45:58" }
开发中的界面,凑合看下