|
@@ -1,9 +1,6 @@
|
|
|
package com.aizuda.boot.modules.flw.service.impl;
|
|
|
|
|
|
-import com.aizuda.boot.modules.flw.entity.ApprovalContent;
|
|
|
-import com.aizuda.boot.modules.flw.entity.FlwProcessApproval;
|
|
|
-import com.aizuda.boot.modules.flw.entity.FlwProcessConfigure;
|
|
|
-import com.aizuda.boot.modules.flw.entity.FlwProcessForm;
|
|
|
+import com.aizuda.boot.modules.flw.entity.*;
|
|
|
import com.aizuda.boot.modules.flw.entity.dto.*;
|
|
|
import com.aizuda.boot.modules.flw.entity.vo.*;
|
|
|
import com.aizuda.boot.modules.flw.flow.FlowForm;
|
|
@@ -135,25 +132,27 @@ public class ProcessTaskServiceImpl implements IProcessTaskService {
|
|
|
|
|
|
FlwProcessConfigure configure = flwProcessConfigureService.getByProcessId(hisInstance.getProcessId());
|
|
|
if (null != configure) {
|
|
|
+ boolean searchFormContent = true;
|
|
|
+
|
|
|
// 流程设置
|
|
|
vo.setProcessSetting(configure.getProcessSetting());
|
|
|
|
|
|
// 表单设置
|
|
|
if (ProcessType.business.eq(extInstance.getProcessType())) {
|
|
|
// 业务流程,加载表单模板内容
|
|
|
- vo.setFormTemplate(flwFormTemplateService.getByConfigure(configure.getProcessForm()));
|
|
|
- } else {
|
|
|
- // 普通流程,表单填写内容,子流程需要获取主流程表单
|
|
|
- FlwProcessForm flwProcessForm;
|
|
|
- if (null != hisInstance.getParentInstanceId()) {
|
|
|
- flwProcessForm = flwProcessFormService.getByInstanceId(hisInstance.getParentInstanceId());
|
|
|
- } else {
|
|
|
- flwProcessForm = flwProcessFormService.getByInstanceId(instanceId);
|
|
|
- }
|
|
|
- if (null != flwProcessForm) {
|
|
|
- vo.setFormContent(flwProcessForm.getContent());
|
|
|
+ FlwFormTemplate formTemplate = flwFormTemplateService.getByConfigure(configure.getProcessForm());
|
|
|
+ ApiAssert.fail(null == formTemplate, "未发现指定业务流程表单模板");
|
|
|
+ vo.setFormTemplate(formTemplate);
|
|
|
+ if (Objects.equals(formTemplate.getType(), 1)) {
|
|
|
+ // 系统表单情况
|
|
|
+ searchFormContent = false;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ // 表单内容
|
|
|
+ if (searchFormContent) {
|
|
|
+ vo.setFormContent(this.formContent(instanceId, hisInstance.getParentInstanceId()));
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
|
|
@@ -211,6 +210,23 @@ public class ProcessTaskServiceImpl implements IProcessTaskService {
|
|
|
return vo;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 查询流程表单内容
|
|
|
+ * <p>
|
|
|
+ * 普通流程,表单填写内容,子流程需要获取主流程表单
|
|
|
+ * </p>
|
|
|
+ */
|
|
|
+ private String formContent(Long instanceId, Long parentInstanceId) {
|
|
|
+ // 普通流程,表单填写内容,子流程需要获取主流程表单
|
|
|
+ FlwProcessForm flwProcessForm;
|
|
|
+ if (null != parentInstanceId) {
|
|
|
+ flwProcessForm = flwProcessFormService.getByInstanceId(parentInstanceId);
|
|
|
+ } else {
|
|
|
+ flwProcessForm = flwProcessFormService.getByInstanceId(instanceId);
|
|
|
+ }
|
|
|
+ return null == flwProcessForm ? null :flwProcessForm.getContent();
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public List<Map<String, String>> listPreviousNodes(Long taskId) {
|
|
|
FlwTask flwTask = this.getFlwTask(taskId);
|