Merge branch 'feature/REQ-5369' into test
# Conflicts: # workflow-engine-common/src/main/java/cn/axzo/workflow/common/enums/PrintFieldCategoryEnum.java
This commit is contained in:
commit
07e45bd76a
@ -3,16 +3,17 @@ package cn.axzo.workflow.client.feign.manage;
|
|||||||
import cn.axzo.workflow.client.annotation.WorkflowEngineFeignClient;
|
import cn.axzo.workflow.client.annotation.WorkflowEngineFeignClient;
|
||||||
import cn.axzo.workflow.common.annotation.InvokeMode;
|
import cn.axzo.workflow.common.annotation.InvokeMode;
|
||||||
import cn.axzo.workflow.common.annotation.Manageable;
|
import cn.axzo.workflow.common.annotation.Manageable;
|
||||||
|
import cn.axzo.workflow.common.model.dto.print.PrintFieldDTO;
|
||||||
import cn.axzo.workflow.common.model.request.form.definition.StartFormSearchDTO;
|
import cn.axzo.workflow.common.model.request.form.definition.StartFormSearchDTO;
|
||||||
import cn.axzo.workflow.common.model.request.form.instance.FormDetailDTO;
|
import cn.axzo.workflow.common.model.request.form.instance.FormDetailDTO;
|
||||||
import cn.axzo.workflow.common.model.request.form.instance.FormSearchDTO;
|
import cn.axzo.workflow.common.model.request.form.instance.FormSearchDTO;
|
||||||
import cn.axzo.workflow.common.model.request.form.instance.FromDataSearchDTO;
|
import cn.axzo.workflow.common.model.request.form.instance.FromDataSearchDTO;
|
||||||
|
import cn.axzo.workflow.common.model.request.form.model.WpsFileConfigVariableDTO;
|
||||||
import cn.axzo.workflow.common.model.response.form.FormVO;
|
import cn.axzo.workflow.common.model.response.form.FormVO;
|
||||||
import cn.axzo.workflow.common.model.response.form.definition.FormDefinitionVO;
|
import cn.axzo.workflow.common.model.response.form.definition.FormDefinitionVO;
|
||||||
import cn.axzo.workflow.common.model.response.form.instance.FormDataVO;
|
import cn.axzo.workflow.common.model.response.form.instance.FormDataVO;
|
||||||
import cn.axzo.workflow.common.model.response.form.instance.FormInstanceVO;
|
import cn.axzo.workflow.common.model.response.form.instance.FormInstanceVO;
|
||||||
import cn.azxo.framework.common.model.CommonResponse;
|
import cn.azxo.framework.common.model.CommonResponse;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
@ -69,4 +70,14 @@ public interface FormAdminApi {
|
|||||||
@PostMapping("/api/form/admin/instance/form/data")
|
@PostMapping("/api/form/admin/instance/form/data")
|
||||||
@InvokeMode(SYNC)
|
@InvokeMode(SYNC)
|
||||||
CommonResponse<List<FormDataVO>> getFormData(@Validated @RequestBody FromDataSearchDTO dto);
|
CommonResponse<List<FormDataVO>> getFormData(@Validated @RequestBody FromDataSearchDTO dto);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取 WPS 文档中所有可配置的流程相关变量
|
||||||
|
*
|
||||||
|
* @param dto
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/api/form/admin/wps/file/config/variables")
|
||||||
|
@InvokeMode(SYNC)
|
||||||
|
CommonResponse<List<PrintFieldDTO>> getWpsFileConfigVariables(@Validated @RequestBody WpsFileConfigVariableDTO dto);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -23,6 +23,8 @@ public enum PrintFieldCategoryEnum {
|
|||||||
signature,
|
signature,
|
||||||
// 签署业务自定义变量
|
// 签署业务自定义变量
|
||||||
sign,
|
sign,
|
||||||
|
// 审批业务的变量
|
||||||
|
biz_variable,
|
||||||
@JsonEnumDefaultValue
|
@JsonEnumDefaultValue
|
||||||
unknown,
|
unknown,
|
||||||
;
|
;
|
||||||
|
|||||||
@ -0,0 +1,39 @@
|
|||||||
|
package cn.axzo.workflow.common.model.request.form.model;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询用于 WPS 左侧变量列表的集合
|
||||||
|
*
|
||||||
|
* @author wangli
|
||||||
|
* @since 2025-09-15 10:07
|
||||||
|
*/
|
||||||
|
@ApiModel("查询用于 WPS 左侧变量列表的集合")
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
public class WpsFileConfigVariableDTO {
|
||||||
|
/**
|
||||||
|
* 模板定义 KEY
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "流程模板 KEY")
|
||||||
|
@NotBlank(message = "流程模板 KEY 不能为空")
|
||||||
|
private String processDefinitionKey;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 租户 ID
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "租户 ID")
|
||||||
|
private String tenantId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否抛出内部异常
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "是否报错内部异常")
|
||||||
|
@Builder.Default
|
||||||
|
private Boolean throwException = true;
|
||||||
|
}
|
||||||
@ -1,20 +1,30 @@
|
|||||||
package cn.axzo.workflow.server.controller.web.form;
|
package cn.axzo.workflow.server.controller.web.form;
|
||||||
|
|
||||||
import cn.axzo.workflow.client.feign.manage.FormAdminApi;
|
import cn.axzo.workflow.client.feign.manage.FormAdminApi;
|
||||||
|
import cn.axzo.workflow.common.enums.PrintFieldCategoryEnum;
|
||||||
import cn.axzo.workflow.common.model.dto.BpmnFormRelationSearchDTO;
|
import cn.axzo.workflow.common.model.dto.BpmnFormRelationSearchDTO;
|
||||||
|
import cn.axzo.workflow.common.model.dto.print.FieldAttributeDTO;
|
||||||
|
import cn.axzo.workflow.common.model.dto.print.PrintFieldDTO;
|
||||||
|
import cn.axzo.workflow.common.model.request.bpmn.print.PrintFieldQueryDTO;
|
||||||
|
import cn.axzo.workflow.common.model.request.category.CategoryGroupVarSearchDto;
|
||||||
import cn.axzo.workflow.common.model.request.form.definition.StartFormSearchDTO;
|
import cn.axzo.workflow.common.model.request.form.definition.StartFormSearchDTO;
|
||||||
import cn.axzo.workflow.common.model.request.form.instance.FormDetailDTO;
|
import cn.axzo.workflow.common.model.request.form.instance.FormDetailDTO;
|
||||||
import cn.axzo.workflow.common.model.request.form.instance.FormSearchDTO;
|
import cn.axzo.workflow.common.model.request.form.instance.FormSearchDTO;
|
||||||
import cn.axzo.workflow.common.model.request.form.instance.FromDataSearchDTO;
|
import cn.axzo.workflow.common.model.request.form.instance.FromDataSearchDTO;
|
||||||
|
import cn.axzo.workflow.common.model.request.form.model.WpsFileConfigVariableDTO;
|
||||||
|
import cn.axzo.workflow.common.model.response.category.CategoryGroupVarItemVo;
|
||||||
import cn.axzo.workflow.common.model.response.form.FormVO;
|
import cn.axzo.workflow.common.model.response.form.FormVO;
|
||||||
import cn.axzo.workflow.common.model.response.form.definition.FormDefinitionVO;
|
import cn.axzo.workflow.common.model.response.form.definition.FormDefinitionVO;
|
||||||
import cn.axzo.workflow.common.model.response.form.instance.FormDataVO;
|
import cn.axzo.workflow.common.model.response.form.instance.FormDataVO;
|
||||||
import cn.axzo.workflow.common.model.response.form.instance.FormInstanceVO;
|
import cn.axzo.workflow.common.model.response.form.instance.FormInstanceVO;
|
||||||
|
import cn.axzo.workflow.core.service.CategoryGroupService;
|
||||||
import cn.axzo.workflow.core.service.FormCoreService;
|
import cn.axzo.workflow.core.service.FormCoreService;
|
||||||
import cn.axzo.workflow.server.common.annotation.ErrorReporter;
|
import cn.axzo.workflow.server.common.annotation.ErrorReporter;
|
||||||
|
import cn.axzo.workflow.server.controller.web.manage.PrintAdminController;
|
||||||
import cn.azxo.framework.common.model.CommonResponse;
|
import cn.azxo.framework.common.model.CommonResponse;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.util.CollectionUtils;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
@ -22,6 +32,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import static cn.azxo.framework.common.model.CommonResponse.success;
|
import static cn.azxo.framework.common.model.CommonResponse.success;
|
||||||
@ -41,6 +52,10 @@ public class FormAdminController implements FormAdminApi {
|
|||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private FormCoreService formCoreService;
|
private FormCoreService formCoreService;
|
||||||
|
@Resource
|
||||||
|
private PrintAdminController printAdminController;
|
||||||
|
@Resource
|
||||||
|
private CategoryGroupService categoryGroupService;
|
||||||
|
|
||||||
@Operation(summary = "表单列表")
|
@Operation(summary = "表单列表")
|
||||||
@PostMapping("/form/page")
|
@PostMapping("/form/page")
|
||||||
@ -68,4 +83,48 @@ public class FormAdminController implements FormAdminApi {
|
|||||||
public CommonResponse<List<FormDataVO>> getFormData(@Validated @RequestBody FromDataSearchDTO dto) {
|
public CommonResponse<List<FormDataVO>> getFormData(@Validated @RequestBody FromDataSearchDTO dto) {
|
||||||
return success(formCoreService.getFormData(dto));
|
return success(formCoreService.getFormData(dto));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取 WPS 文档中所有可配置的流程相关变量
|
||||||
|
*
|
||||||
|
* @param dto
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/wps/file/config/variables")
|
||||||
|
@Override
|
||||||
|
public CommonResponse<List<PrintFieldDTO>> getWpsFileConfigVariables(@Validated @RequestBody WpsFileConfigVariableDTO dto) {
|
||||||
|
CommonResponse<List<PrintFieldDTO>> printFieldResponse = printAdminController.getPrintFields(PrintFieldQueryDTO.builder()
|
||||||
|
.processDefinitionKey(dto.getProcessDefinitionKey())
|
||||||
|
.tenantId(dto.getTenantId())
|
||||||
|
.throwException(dto.getThrowException())
|
||||||
|
.build());
|
||||||
|
List<PrintFieldDTO> result = printFieldResponse.getData();
|
||||||
|
|
||||||
|
List<CategoryGroupVarItemVo> categoryGroupVarItemVos = categoryGroupService.searchGroupAndVarList(CategoryGroupVarSearchDto.builder()
|
||||||
|
.category(dto.getProcessDefinitionKey())
|
||||||
|
.build());
|
||||||
|
|
||||||
|
if (CollectionUtils.isEmpty(categoryGroupVarItemVos)) {
|
||||||
|
return printFieldResponse;
|
||||||
|
}
|
||||||
|
|
||||||
|
categoryGroupVarItemVos.forEach(i -> {
|
||||||
|
PrintFieldDTO field = new PrintFieldDTO();
|
||||||
|
field.setName(i.getGroupName());
|
||||||
|
field.setFieldCategoryType(PrintFieldCategoryEnum.biz_variable);
|
||||||
|
field.setCode("");
|
||||||
|
field.setFieldFormType("");
|
||||||
|
List<FieldAttributeDTO> attributes = new ArrayList<>();
|
||||||
|
i.getVars().forEach(e -> {
|
||||||
|
FieldAttributeDTO attribute = new FieldAttributeDTO();
|
||||||
|
attribute.setCode(e.getCode());
|
||||||
|
attribute.setName(e.getName());
|
||||||
|
attribute.setFieldFormType(e.getType().getType());
|
||||||
|
attributes.add(attribute);
|
||||||
|
});
|
||||||
|
field.setAttributes(attributes);
|
||||||
|
result.add(field);
|
||||||
|
});
|
||||||
|
return success(result);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user