diff --git a/src/main/java/neatlogic/module/process/api/process/GetProcessFormAttributeListApi.java b/src/main/java/neatlogic/module/process/api/process/GetProcessFormAttributeListApi.java
new file mode 100644
index 0000000000000000000000000000000000000000..27ddb6bc5f9b0cd38139301bbf47e29ba67d4da5
--- /dev/null
+++ b/src/main/java/neatlogic/module/process/api/process/GetProcessFormAttributeListApi.java
@@ -0,0 +1,82 @@
+/*
+ * Copyright (C) 2024 深圳极向量科技有限公司 All Rights Reserved.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see .
+ */
+
+package neatlogic.module.process.api.process;
+
+import com.alibaba.fastjson.JSONObject;
+import neatlogic.framework.common.constvalue.ApiParamType;
+import neatlogic.framework.crossover.CrossoverServiceFactory;
+import neatlogic.framework.form.dao.mapper.FormMapper;
+import neatlogic.framework.form.dto.FormAttributeVo;
+import neatlogic.framework.form.dto.FormVo;
+import neatlogic.framework.form.exception.FormNotFoundException;
+import neatlogic.framework.form.service.IFormCrossoverService;
+import neatlogic.framework.restful.annotation.*;
+import neatlogic.framework.restful.constvalue.OperationTypeEnum;
+import neatlogic.framework.restful.core.privateapi.PrivateApiComponentBase;
+import neatlogic.module.process.service.ProcessTaskService;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+
+@Service
+
+@OperationType(type = OperationTypeEnum.SEARCH)
+public class GetProcessFormAttributeListApi extends PrivateApiComponentBase {
+
+ @Resource
+ private FormMapper formMapper;
+
+ @Resource
+ private ProcessTaskService processTaskService;
+
+ @Override
+ public String getName() {
+ return "nmtaf.getformattributelistapi.getname";
+ }
+
+ @Input({
+ @Param(name = "processTaskId", type = ApiParamType.STRING, desc = "term.itsm.processtaskid"),
+ @Param(name = "formUuid", type = ApiParamType.STRING, desc = "term.framework.formuuid"),
+ @Param(name = "tag", type = ApiParamType.STRING, desc = "common.tag")
+ })
+ @Output({
+ @Param(name = "tbodyList", explode = FormAttributeVo[].class, desc = "common.tbodylist")
+ })
+ @Description(desc = "nmtaf.getformattributelistapi.getname")
+ @Override
+ public Object myDoService(JSONObject paramObj) throws Exception {
+ String tag = paramObj.getString("tag");
+ Long processTaskId = paramObj.getLong("processTaskId");
+ if (processTaskId != null) {
+ return processTaskService.getFormAttributeListByProcessTaskIdAngTagNew(processTaskId, tag);
+ } else {
+ String formUuid = paramObj.getString("formUuid");
+ FormVo form = formMapper.getFormByUuid(formUuid);
+ if (form == null) {
+ throw new FormNotFoundException(formUuid);
+ }
+ IFormCrossoverService formCrossoverService = CrossoverServiceFactory.getApi(IFormCrossoverService.class);
+ return formCrossoverService.getFormAttributeListNew(formUuid, form.getName(), tag);
+ }
+ }
+
+ @Override
+ public String getToken() {
+ return "process/form/attribute/list";
+ }
+}
diff --git a/src/main/java/neatlogic/module/process/api/process/ListProcessFormTagApi.java b/src/main/java/neatlogic/module/process/api/process/ListProcessFormTagApi.java
new file mode 100644
index 0000000000000000000000000000000000000000..9683df9f9da128621f7999e539ae528d80ed0287
--- /dev/null
+++ b/src/main/java/neatlogic/module/process/api/process/ListProcessFormTagApi.java
@@ -0,0 +1,109 @@
+/*Copyright (C) 2024 深圳极向量科技有限公司 All Rights Reserved.
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU Affero General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU Affero General Public License for more details.
+
+You should have received a copy of the GNU Affero General Public License
+along with this program. If not, see .*/
+
+package neatlogic.module.process.api.process;
+
+import com.alibaba.fastjson.JSONObject;
+import neatlogic.framework.common.constvalue.ApiParamType;
+import neatlogic.framework.form.dao.mapper.FormMapper;
+import neatlogic.framework.form.dto.FormAttributeVo;
+import neatlogic.framework.form.dto.FormVersionVo;
+import neatlogic.framework.form.dto.FormVo;
+import neatlogic.framework.form.exception.FormActiveVersionNotFoundExcepiton;
+import neatlogic.framework.form.exception.FormNotFoundException;
+import neatlogic.framework.process.dto.ProcessTaskFormVo;
+import neatlogic.framework.restful.annotation.*;
+import neatlogic.framework.restful.constvalue.OperationTypeEnum;
+import neatlogic.framework.restful.core.privateapi.PrivateApiComponentBase;
+import neatlogic.framework.util.TableResultUtil;
+import neatlogic.module.process.dao.mapper.processtask.ProcessTaskMapper;
+import org.apache.commons.collections4.CollectionUtils;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+@Service
+@OperationType(type = OperationTypeEnum.SEARCH)
+public class ListProcessFormTagApi extends PrivateApiComponentBase {
+
+ @Resource
+ private FormMapper formMapper;
+
+ @Resource
+ private ProcessTaskMapper processTaskMapper;
+
+ @Override
+ public String getToken() {
+ return "process/form/tag/list";
+ }
+
+ @Override
+ public String getName() {
+ return "nmtaf.listformtagapi.getname";
+ }
+
+ @Override
+ public String getConfig() {
+ return null;
+ }
+
+ @Input({
+ @Param(name = "processTaskId", type = ApiParamType.STRING, desc = "term.itsm.processtaskid"),
+ @Param(name = "formUuid", type = ApiParamType.STRING, desc = "term.framework.formuuid")
+ })
+ @Output({
+ @Param(name = "tbodyList", explode = String[].class, desc = "common.tbodylist")
+ })
+ @Description(desc = "nmtaf.listformtagapi.getname")
+ @Override
+ public Object myDoService(JSONObject jsonObj) throws Exception {
+ FormVersionVo formVersionVo = null;
+ Long processTaskId = jsonObj.getLong("processTaskId");
+ if (processTaskId != null) {
+ ProcessTaskFormVo processTaskForm = processTaskMapper.getProcessTaskFormByProcessTaskId(processTaskId);
+ if (processTaskForm != null) {
+ formVersionVo = new FormVersionVo();
+ formVersionVo.setFormUuid(processTaskForm.getFormUuid());
+ formVersionVo.setFormName(processTaskForm.getFormName());
+ formVersionVo.setFormConfigStr(processTaskForm.getFormContent());
+ }
+ } else {
+ String formUuid = jsonObj.getString("formUuid");
+ FormVo form = formMapper.getFormByUuid(formUuid);
+ if (form == null) {
+ throw new FormNotFoundException(formUuid);
+ }
+ formVersionVo = formMapper.getActionFormVersionByFormUuid(formUuid);
+ if (formVersionVo == null) {
+ throw new FormActiveVersionNotFoundExcepiton(form.getName());
+ }
+ }
+ Set tagSet = new HashSet<>();
+ if (formVersionVo != null) {
+ List formCustomExtendAttributeList = formVersionVo.getFormCustomExtendAttributeList();
+ if (CollectionUtils.isNotEmpty(formCustomExtendAttributeList)) {
+ for (FormAttributeVo formAttributeVo : formCustomExtendAttributeList) {
+ tagSet.add(formAttributeVo.getTag());
+ }
+ }
+ }
+ return TableResultUtil.getResult(new ArrayList<>(tagSet));
+ }
+
+}
diff --git a/src/main/java/neatlogic/module/process/api/process/ProcessConditionList.java b/src/main/java/neatlogic/module/process/api/process/ProcessConditionList.java
index aa49601b67c7f6ce144979e99b4341fa0a3f3841..4aba5eaa0226207867093286cb583ccd6cc9fa0f 100644
--- a/src/main/java/neatlogic/module/process/api/process/ProcessConditionList.java
+++ b/src/main/java/neatlogic/module/process/api/process/ProcessConditionList.java
@@ -24,6 +24,7 @@ import neatlogic.framework.process.constvalue.ConditionProcessTaskOptions;
import neatlogic.framework.restful.annotation.*;
import neatlogic.framework.restful.constvalue.OperationTypeEnum;
import neatlogic.framework.restful.core.privateapi.PrivateApiComponentBase;
+import neatlogic.module.process.service.ProcessTaskService;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
@@ -39,6 +40,9 @@ public class ProcessConditionList extends PrivateApiComponentBase {
@Resource
private FormMapper formMapper;
+ @Resource
+ private ProcessTaskService processTaskService;
+
@Override
public String getToken() {
return "process/condition/list";
@@ -54,10 +58,15 @@ public class ProcessConditionList extends PrivateApiComponentBase {
return null;
}
- @Input({@Param(name = "formUuid", type = ApiParamType.STRING, desc = "term.framework.formuuid"),
+ @Input({
+ @Param(name = "processTaskId", type = ApiParamType.STRING, desc = "term.itsm.processtaskid"),
+ @Param(name = "formUuid", type = ApiParamType.STRING, desc = "term.framework.formuuid"),
@Param(name = "tag", type = ApiParamType.STRING, desc = "common.tag"),
- @Param(name = "isAll", type = ApiParamType.INTEGER, rule = "0,1", desc = "term.process.isreturnallattr")})
- @Output({@Param(explode = ConditionParamVo[].class, desc = "nmpap.processconditionlist.getname")})
+ @Param(name = "isAll", type = ApiParamType.INTEGER, rule = "0,1", desc = "term.process.isreturnallattr")
+ })
+ @Output({
+ @Param(explode = ConditionParamVo[].class, desc = "nmpap.processconditionlist.getname")
+ })
@Description(desc = "nmpap.processconditionlist.getname")
@Override
public Object myDoService(JSONObject jsonObj) throws Exception {
@@ -95,20 +104,26 @@ public class ProcessConditionList extends PrivateApiComponentBase {
resultArray.add(conditionParamVo);
}
}
+ List formAttributeList = null;
+ String tag = jsonObj.getString("tag");
+ Long processTaskId = jsonObj.getLong("processTaskId");
+ if (processTaskId != null) {
+ formAttributeList = processTaskService.getFormAttributeListByProcessTaskIdAngTagNew(processTaskId, tag);
+ } else {
+ // 表单条件
+ String formUuid = jsonObj.getString("formUuid");
+ if (StringUtils.isNotBlank(formUuid)) {
+ FormVo form = formMapper.getFormByUuid(formUuid);
+ if (form == null) {
+ throw new FormNotFoundException(formUuid);
+ }
+ IFormCrossoverService formCrossoverService = CrossoverServiceFactory.getApi(IFormCrossoverService.class);
+ formAttributeList = formCrossoverService.getFormAttributeListNew(formUuid, form.getName(), tag);
- // 表单条件
- String formUuid = jsonObj.getString("formUuid");
- if (StringUtils.isNotBlank(formUuid)) {
- FormVo form = formMapper.getFormByUuid(formUuid);
- if (form == null) {
- throw new FormNotFoundException(formUuid);
}
-
- String tag = jsonObj.getString("tag");
- IFormCrossoverService formCrossoverService = CrossoverServiceFactory.getApi(IFormCrossoverService.class);
-// List formAttrList = formCrossoverService.getFormAttributeList(formUuid, form.getName(), ConditionProcessComponent.FORM_EXTEND_ATTRIBUTE_TAG);
- List formAttrList = formCrossoverService.getFormAttributeListNew(formUuid, form.getName(), tag);
- for (FormAttributeVo formAttributeVo : formAttrList) {
+ }
+ if (CollectionUtils.isNotEmpty(formAttributeList)) {
+ for (FormAttributeVo formAttributeVo : formAttributeList) {
IFormAttributeHandler formHandler = FormAttributeHandlerFactory.getHandler(formAttributeVo.getHandler());
if (formHandler == null) {
continue;
diff --git a/src/main/java/neatlogic/module/process/api/process/ProcessFormGetApi.java b/src/main/java/neatlogic/module/process/api/process/ProcessFormGetApi.java
new file mode 100644
index 0000000000000000000000000000000000000000..bec876f1bcb69fcb4bd37120439fd0dedf5b2ea7
--- /dev/null
+++ b/src/main/java/neatlogic/module/process/api/process/ProcessFormGetApi.java
@@ -0,0 +1,129 @@
+/*Copyright (C) 2024 深圳极向量科技有限公司 All Rights Reserved.
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU Affero General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU Affero General Public License for more details.
+
+You should have received a copy of the GNU Affero General Public License
+along with this program. If not, see .*/
+
+package neatlogic.module.process.api.process;
+
+import com.alibaba.fastjson.JSONObject;
+import neatlogic.framework.common.constvalue.ApiParamType;
+import neatlogic.framework.dependency.constvalue.FrameworkFromType;
+import neatlogic.framework.dependency.core.DependencyManager;
+import neatlogic.framework.exception.type.ParamNotExistsException;
+import neatlogic.framework.form.dao.mapper.FormMapper;
+import neatlogic.framework.form.dto.FormVersionVo;
+import neatlogic.framework.form.dto.FormVo;
+import neatlogic.framework.form.exception.FormActiveVersionNotFoundExcepiton;
+import neatlogic.framework.form.exception.FormNotFoundException;
+import neatlogic.framework.form.exception.FormVersionNotFoundException;
+import neatlogic.framework.process.dto.ProcessTaskFormVo;
+import neatlogic.framework.restful.annotation.*;
+import neatlogic.framework.restful.constvalue.OperationTypeEnum;
+import neatlogic.framework.restful.core.privateapi.PrivateApiComponentBase;
+import neatlogic.module.process.dao.mapper.processtask.ProcessTaskMapper;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+@Service
+
+@OperationType(type = OperationTypeEnum.SEARCH)
+public class ProcessFormGetApi extends PrivateApiComponentBase {
+
+ @Resource
+ private FormMapper formMapper;
+
+ @Resource
+ private ProcessTaskMapper processTaskMapper;
+
+ @Override
+ public String getToken() {
+ return "process/form/get";
+ }
+
+ @Override
+ public String getName() {
+ return "获取表单信息";
+ }
+
+ @Override
+ public String getConfig() {
+ return null;
+ }
+
+ @Override
+ @Input({
+ @Param(name = "processTaskId", type = ApiParamType.STRING, desc = "term.itsm.processtaskid"),
+ @Param(name = "uuid", type = ApiParamType.STRING, desc = "表单uuid"),
+ @Param(name = "currentVersionUuid", type = ApiParamType.STRING, desc = "选择表单版本uuid"),
+ })
+ @Output({@Param(explode = FormVo.class)})
+ @Description(desc = "获取表单信息")
+ public Object myDoService(JSONObject jsonObj) throws Exception {
+ Long processTaskId = jsonObj.getLong("processTaskId");
+ if (processTaskId != null) {
+ ProcessTaskFormVo processTaskForm = processTaskMapper.getProcessTaskFormByProcessTaskId(processTaskId);
+ if (processTaskForm != null) {
+ FormVo formVo = new FormVo();
+ formVo.setUuid(processTaskForm.getFormUuid());
+ formVo.setName(processTaskForm.getFormName());
+ formVo.setIsActive(1);
+ formVo.setReferenceCount(1);
+ formVo.setFormConfig(JSONObject.parseObject(processTaskForm.getFormContent()));
+ return formVo;
+ }
+ return null;
+ } else {
+ String currentVersionUuid = jsonObj.getString("currentVersionUuid");
+ String uuid = jsonObj.getString("uuid");
+ if (StringUtils.isNotBlank(currentVersionUuid)) {
+ FormVersionVo formVersion = formMapper.getFormVersionByUuid(currentVersionUuid);
+ if (formVersion == null) {
+ throw new FormVersionNotFoundException(currentVersionUuid);
+ }
+ FormVo formVo = formMapper.getFormByUuid(formVersion.getFormUuid());
+ if (formVo == null) {
+ throw new FormNotFoundException(formVersion.getFormUuid());
+ }
+ formVo.setCurrentVersionUuid(currentVersionUuid);
+ formVo.setFormConfig(formVersion.getFormConfig());
+ List formVersionList = formMapper.getFormVersionSimpleByFormUuid(formVersion.getFormUuid());
+ formVo.setVersionList(formVersionList);
+ int count = DependencyManager.getDependencyCount(FrameworkFromType.FORM, formVo.getUuid());
+ formVo.setReferenceCount(count);
+ return formVo;
+ } else if (StringUtils.isNotBlank(uuid)) {
+ FormVo formVo = formMapper.getFormByUuid(uuid);
+ if (formVo == null) {
+ throw new FormNotFoundException(uuid);
+ }
+ FormVersionVo formVersion = formMapper.getActionFormVersionByFormUuid(uuid);
+ if (formVersion == null) {
+ throw new FormActiveVersionNotFoundExcepiton(uuid);
+ }
+ formVo.setCurrentVersionUuid(formVersion.getUuid());
+ formVo.setFormConfig(formVersion.getFormConfig());
+ List formVersionList = formMapper.getFormVersionSimpleByFormUuid(uuid);
+ formVo.setVersionList(formVersionList);
+ int count = DependencyManager.getDependencyCount(FrameworkFromType.FORM, formVo.getUuid());
+ formVo.setReferenceCount(count);
+ return formVo;
+ } else {
+ throw new ParamNotExistsException("uuid", "currentVersionUuid");
+ }
+ }
+ }
+
+}
diff --git a/src/main/java/neatlogic/module/process/api/process/ProcessGetApi.java b/src/main/java/neatlogic/module/process/api/process/ProcessGetApi.java
index 42d52bbdbfb3f448a16c11aeeb19fc09752d894b..f83fe676a9b5ca5261ea3d9708b45f1faadda38c 100644
--- a/src/main/java/neatlogic/module/process/api/process/ProcessGetApi.java
+++ b/src/main/java/neatlogic/module/process/api/process/ProcessGetApi.java
@@ -1,22 +1,23 @@
package neatlogic.module.process.api.process;
+import com.alibaba.fastjson.JSONObject;
+import neatlogic.framework.auth.core.AuthAction;
+import neatlogic.framework.common.constvalue.ApiParamType;
+import neatlogic.framework.process.auth.PROCESS_MODIFY;
+import neatlogic.framework.process.dto.ProcessTaskVo;
+import neatlogic.framework.process.dto.ProcessVo;
+import neatlogic.framework.process.exception.process.ProcessNotFoundEditTargetException;
import neatlogic.framework.process.stephandler.core.ProcessMessageManager;
import neatlogic.framework.process.util.ProcessConfigUtil;
-import neatlogic.framework.restful.constvalue.OperationTypeEnum;
import neatlogic.framework.restful.annotation.*;
+import neatlogic.framework.restful.constvalue.OperationTypeEnum;
import neatlogic.framework.restful.core.privateapi.PrivateApiComponentBase;
-import neatlogic.framework.process.auth.PROCESS_MODIFY;
-
+import neatlogic.module.process.dao.mapper.SelectContentByHashMapper;
import neatlogic.module.process.dao.mapper.process.ProcessMapper;
+import neatlogic.module.process.dao.mapper.processtask.ProcessTaskMapper;
+import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
-import com.alibaba.fastjson.JSONObject;
-
-import neatlogic.framework.auth.core.AuthAction;
-import neatlogic.framework.common.constvalue.ApiParamType;
-import neatlogic.framework.process.dto.ProcessVo;
-import neatlogic.framework.process.exception.process.ProcessNotFoundEditTargetException;
-
import javax.annotation.Resource;
@Service
@@ -27,6 +28,12 @@ public class ProcessGetApi extends PrivateApiComponentBase {
@Resource
private ProcessMapper processMapper;
+ @Resource
+ private ProcessTaskMapper processTaskMapper;
+
+ @Resource
+ private SelectContentByHashMapper selectContentByHashMapper;
+
@Override
public String getToken() {
return "process/get";
@@ -43,7 +50,8 @@ public class ProcessGetApi extends PrivateApiComponentBase {
}
@Input({
- @Param(name = "uuid", type = ApiParamType.STRING, isRequired = true, desc = "term.itsm.processuuid")
+ @Param(name = "uuid", type = ApiParamType.STRING, desc = "term.itsm.processuuid"),
+ @Param(name = "processTaskId", type = ApiParamType.LONG, desc = "term.itsm.processtaskid")
})
@Output({
@Param(explode = ProcessVo.class)
@@ -51,15 +59,39 @@ public class ProcessGetApi extends PrivateApiComponentBase {
@Description(desc = "nmpap.processgetapi.getname")
@Override
public Object myDoService(JSONObject jsonObj) throws Exception {
- String uuid = jsonObj.getString("uuid");
- ProcessVo processVo = processMapper.getProcessByUuid(uuid);
- if (processVo == null) {
- throw new ProcessNotFoundEditTargetException(uuid);
+ Long processTaskId = jsonObj.getLong("processTaskId");
+ if (processTaskId != null) {
+ ProcessTaskVo processTaskVo = processTaskMapper.getProcessTaskBaseInfoByIdIncludeIsDeleted(processTaskId);
+ if (processTaskVo != null) {
+ String configStr = selectContentByHashMapper.getProcessTaskConfigStringByHash(processTaskVo.getConfigHash());
+ ProcessVo processVo = processMapper.getProcessByUuid(processTaskVo.getProcessUuid());
+ if (processVo == null) {
+ processVo = new ProcessVo();
+ processVo.setUuid(processTaskVo.getProcessUuid());
+ processVo.setName("");
+ processVo.setIsActive(1);
+ }
+ processVo.setName(processVo.getName() + "【工单:" + processTaskVo.getTitle()+ "】");
+ processVo.setConfig(configStr);
+ ProcessMessageManager.setOperationType(OperationTypeEnum.SEARCH);
+ processVo.setConfig(ProcessConfigUtil.regulateProcessConfig(processVo.getConfig()));
+ processVo.setReferenceCount(1);
+ return processVo;
+ }
+ } else {
+ String uuid = jsonObj.getString("uuid");
+ if (StringUtils.isNotBlank(uuid)) {
+ ProcessVo processVo = processMapper.getProcessByUuid(uuid);
+ if (processVo == null) {
+ throw new ProcessNotFoundEditTargetException(uuid);
+ }
+ ProcessMessageManager.setOperationType(OperationTypeEnum.SEARCH);
+ processVo.setConfig(ProcessConfigUtil.regulateProcessConfig(processVo.getConfig()));
+ int count = processMapper.getProcessReferenceCount(uuid);
+ processVo.setReferenceCount(count);
+ return processVo;
+ }
}
- ProcessMessageManager.setOperationType(OperationTypeEnum.SEARCH);
- processVo.setConfig(ProcessConfigUtil.regulateProcessConfig(processVo.getConfig()));
- int count = processMapper.getProcessReferenceCount(uuid);
- processVo.setReferenceCount(count);
- return processVo;
+ return null;
}
}
diff --git a/src/main/java/neatlogic/module/process/api/process/ProcessParamList.java b/src/main/java/neatlogic/module/process/api/process/ProcessParamList.java
index 9d15e17e7f132aea572adfc5ec3646f8ae4edef4..6f59c65cf6364aae239d0bf23c1796489d504849 100644
--- a/src/main/java/neatlogic/module/process/api/process/ProcessParamList.java
+++ b/src/main/java/neatlogic/module/process/api/process/ProcessParamList.java
@@ -5,23 +5,25 @@ import com.alibaba.fastjson.JSONObject;
import neatlogic.framework.auth.core.AuthAction;
import neatlogic.framework.common.constvalue.ApiParamType;
import neatlogic.framework.common.constvalue.ParamType;
-import neatlogic.framework.crossover.CrossoverServiceFactory;
-import neatlogic.framework.form.dto.FormVo;
-import neatlogic.framework.form.exception.FormNotFoundException;
-import neatlogic.framework.form.service.IFormCrossoverService;
-import neatlogic.framework.process.condition.core.ProcessTaskConditionFactory;
import neatlogic.framework.condition.core.IConditionHandler;
+import neatlogic.framework.crossover.CrossoverServiceFactory;
import neatlogic.framework.dto.ConditionParamVo;
import neatlogic.framework.form.attribute.core.FormAttributeHandlerFactory;
import neatlogic.framework.form.attribute.core.IFormAttributeHandler;
import neatlogic.framework.form.dao.mapper.FormMapper;
import neatlogic.framework.form.dto.FormAttributeVo;
+import neatlogic.framework.form.dto.FormVo;
+import neatlogic.framework.form.exception.FormNotFoundException;
+import neatlogic.framework.form.service.IFormCrossoverService;
import neatlogic.framework.process.auth.PROCESS_BASE;
+import neatlogic.framework.process.condition.core.ProcessTaskConditionFactory;
import neatlogic.framework.process.constvalue.ProcessFieldType;
import neatlogic.framework.process.constvalue.ProcessTaskParams;
import neatlogic.framework.restful.annotation.*;
import neatlogic.framework.restful.constvalue.OperationTypeEnum;
import neatlogic.framework.restful.core.privateapi.PrivateApiComponentBase;
+import neatlogic.module.process.service.ProcessTaskService;
+import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
@@ -36,6 +38,9 @@ public class ProcessParamList extends PrivateApiComponentBase {
@Resource
private FormMapper formMapper;
+ @Resource
+ private ProcessTaskService processTaskService;
+
@Override
public String getToken() {
return "process/param/list";
@@ -52,6 +57,7 @@ public class ProcessParamList extends PrivateApiComponentBase {
}
@Input({
+ @Param(name = "processTaskId", type = ApiParamType.STRING, desc = "term.itsm.processtaskid"),
@Param(name = "formUuid", type = ApiParamType.STRING, desc = "term.framework.formuuid"),
@Param(name = "tag", type = ApiParamType.STRING, desc = "common.tag"),
@Param(name = "isAll", type = ApiParamType.INTEGER, rule = "0,1", desc = "term.process.isreturnallattr")
@@ -91,19 +97,26 @@ public class ProcessParamList extends PrivateApiComponentBase {
// param.setType("common");
// resultArray.add(param);
- // 表单条件
- String formUuid = jsonObj.getString("formUuid");
- if (StringUtils.isNotBlank(formUuid)) {
- FormVo form = formMapper.getFormByUuid(formUuid);
- if (form == null) {
- throw new FormNotFoundException(formUuid);
+ List formAttributeList = null;
+ String tag = jsonObj.getString("tag");
+ Long processTaskId = jsonObj.getLong("processTaskId");
+ if (processTaskId != null) {
+ formAttributeList = processTaskService.getFormAttributeListByProcessTaskIdAngTagNew(processTaskId, tag);
+ } else {
+ // 表单条件
+ String formUuid = jsonObj.getString("formUuid");
+ if (StringUtils.isNotBlank(formUuid)) {
+ FormVo form = formMapper.getFormByUuid(formUuid);
+ if (form == null) {
+ throw new FormNotFoundException(formUuid);
+ }
+ IFormCrossoverService formCrossoverService = CrossoverServiceFactory.getApi(IFormCrossoverService.class);
+ formAttributeList = formCrossoverService.getFormAttributeListNew(formUuid, form.getName(), tag);
}
+ }
+ if (CollectionUtils.isNotEmpty(formAttributeList)) {
Integer isAll = jsonObj.getInteger("isAll");
- String tag = jsonObj.getString("tag");
- IFormCrossoverService formCrossoverService = CrossoverServiceFactory.getApi(IFormCrossoverService.class);
- List formAttrList = formCrossoverService.getFormAttributeListNew(formUuid, form.getName(), tag);
-// List formAttrList = formMapper.getFormAttributeList(new FormAttributeVo(formUuid));
- for (FormAttributeVo formAttributeVo : formAttrList) {
+ for (FormAttributeVo formAttributeVo : formAttributeList) {
IFormAttributeHandler formHandler = FormAttributeHandlerFactory.getHandler(formAttributeVo.getHandler());
if(formHandler == null){
continue;