Merge branch 'feature/countersign_ext' into dev
This commit is contained in:
commit
67a760d083
@ -45,8 +45,12 @@ public interface VariableConstants {
|
|||||||
String PRINT_VAR_PROCESS_INITIATOR_POSITION_DESC = "发起人岗位";
|
String PRINT_VAR_PROCESS_INITIATOR_POSITION_DESC = "发起人岗位";
|
||||||
String PRINT_VAR_PROCESS_INITIATOR_PHONE = "initiatorPhone";
|
String PRINT_VAR_PROCESS_INITIATOR_PHONE = "initiatorPhone";
|
||||||
String PRINT_VAR_PROCESS_INITIATOR_PHONE_DESC = "发起人联系方式";
|
String PRINT_VAR_PROCESS_INITIATOR_PHONE_DESC = "发起人联系方式";
|
||||||
|
String PRINT_VAR_PROCESS_INITIATOR_UNIT = "initiatorUnit";
|
||||||
|
String PRINT_VAR_PROCESS_INITIATOR_UNIT_DESC = "发起人单位";
|
||||||
String PRINT_VAR_PROCESS_LOGS = "processLogs";
|
String PRINT_VAR_PROCESS_LOGS = "processLogs";
|
||||||
String PRINT_VAR_PROCESS_LOGS_DESC = "审批日志";
|
String PRINT_VAR_PROCESS_LOGS_DESC = "审批日志";
|
||||||
|
String PRINT_VAR_PROCESS_LOG_ACTIVITY_NODE_TYPE = "activityNodeType";
|
||||||
|
String PRINT_VAR_PROCESS_LOG_ACTIVITY_NODE_TYPE_DESC = "节点类型";
|
||||||
String PRINT_VAR_PROCESS_LOG_ACTIVITY_NAME = "activityName";
|
String PRINT_VAR_PROCESS_LOG_ACTIVITY_NAME = "activityName";
|
||||||
String PRINT_VAR_PROCESS_LOG_ACTIVITY_NAME_DESC = "节点名称";
|
String PRINT_VAR_PROCESS_LOG_ACTIVITY_NAME_DESC = "节点名称";
|
||||||
String PRINT_VAR_PROCESS_LOG_APPROVER_NAME = "approverName";
|
String PRINT_VAR_PROCESS_LOG_APPROVER_NAME = "approverName";
|
||||||
@ -61,4 +65,8 @@ public interface VariableConstants {
|
|||||||
String PRINT_VAR_PROCESS_LOG_OPERATION_TIME_DESC = "审批时间";
|
String PRINT_VAR_PROCESS_LOG_OPERATION_TIME_DESC = "审批时间";
|
||||||
String PRINT_VAR_PROCESS_LOG_SIGNATURE = "signature";
|
String PRINT_VAR_PROCESS_LOG_SIGNATURE = "signature";
|
||||||
String PRINT_VAR_PROCESS_LOG_SIGNATURE_DESC = "电子签名";
|
String PRINT_VAR_PROCESS_LOG_SIGNATURE_DESC = "电子签名";
|
||||||
|
String PRINT_VAR_PROCESS_LOG_ACTIVITY_RESULT = "activityResult";
|
||||||
|
String PRINT_VAR_PROCESS_LOG_ACTIVITY_RESULT_DESC = "节点状态";
|
||||||
|
String PRINT_VAR_PROCESS_LOG_OPERATION = "operationDesc";
|
||||||
|
String PRINT_VAR_PROCESS_LOG_OPERATION_DESC = "操作描述";
|
||||||
}
|
}
|
||||||
|
|||||||
@ -35,6 +35,11 @@ public class PrintFieldQueryDTO {
|
|||||||
@ApiModelProperty(value = "租户 ID")
|
@ApiModelProperty(value = "租户 ID")
|
||||||
private String tenantId;
|
private String tenantId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否过滤仅支持打印字段
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "是否过滤仅支持打印字段")
|
||||||
|
private Boolean filterEnablePrint;
|
||||||
/**
|
/**
|
||||||
* 是否抛出内部异常
|
* 是否抛出内部异常
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -16,6 +16,7 @@ import javax.validation.Valid;
|
|||||||
import javax.validation.constraints.NotNull;
|
import javax.validation.constraints.NotNull;
|
||||||
import javax.validation.constraints.Size;
|
import javax.validation.constraints.Size;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 审批任务节点的入参模型
|
* 审批任务节点的入参模型
|
||||||
@ -103,4 +104,9 @@ public class BpmnTaskAuditDTO {
|
|||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
private String operationDesc;
|
private String operationDesc;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新或新增流程变量
|
||||||
|
*/
|
||||||
|
private Map<String, Object> variables;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -83,6 +83,7 @@ public class CustomApproveTaskCmd extends AbstractCommand<Void> implements Seria
|
|||||||
* 指定节点类型
|
* 指定节点类型
|
||||||
*/
|
*/
|
||||||
private List<BpmnFlowNodeType> nodeTypes;
|
private List<BpmnFlowNodeType> nodeTypes;
|
||||||
|
private Map<String, Object> variables;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String paramToJsonString() {
|
public String paramToJsonString() {
|
||||||
@ -94,6 +95,7 @@ public class CustomApproveTaskCmd extends AbstractCommand<Void> implements Seria
|
|||||||
params.put("approver", JSON.toJSONString(approver));
|
params.put("approver", JSON.toJSONString(approver));
|
||||||
params.put("nextApprover", JSON.toJSONString(nextApprover));
|
params.put("nextApprover", JSON.toJSONString(nextApprover));
|
||||||
params.put("nodeTypes", JSON.toJSONString(nodeTypes));
|
params.put("nodeTypes", JSON.toJSONString(nodeTypes));
|
||||||
|
params.put("variables", JSON.toJSONString(variables));
|
||||||
return JSON.toJSONString(params);
|
return JSON.toJSONString(params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -117,6 +119,7 @@ public class CustomApproveTaskCmd extends AbstractCommand<Void> implements Seria
|
|||||||
} else {
|
} else {
|
||||||
this.operationDesc = "已同意";
|
this.operationDesc = "已同意";
|
||||||
}
|
}
|
||||||
|
this.variables = dto.getVariables();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -158,6 +161,7 @@ public class CustomApproveTaskCmd extends AbstractCommand<Void> implements Seria
|
|||||||
}
|
}
|
||||||
task.setTransientVariable(TASK_COMPLETE_OPERATION_TYPE + taskId, APPROVED.getStatus());
|
task.setTransientVariable(TASK_COMPLETE_OPERATION_TYPE + taskId, APPROVED.getStatus());
|
||||||
|
|
||||||
|
runtimeService.setVariables(task.getProcessInstanceId(), variables);
|
||||||
// 记录电子签名的图片
|
// 记录电子签名的图片
|
||||||
recordSignature(task, runtimeService);
|
recordSignature(task, runtimeService);
|
||||||
|
|
||||||
|
|||||||
@ -97,6 +97,10 @@ public class CustomApproveTaskWithFormCmd extends AbstractCommand<Void> implemen
|
|||||||
* 表单数据
|
* 表单数据
|
||||||
*/
|
*/
|
||||||
private final Map<String, Object> formVariables;
|
private final Map<String, Object> formVariables;
|
||||||
|
/**
|
||||||
|
* 更新或新增的流程变量
|
||||||
|
*/
|
||||||
|
private final Map<String, Object> variables;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String paramToJsonString() {
|
public String paramToJsonString() {
|
||||||
@ -109,6 +113,7 @@ public class CustomApproveTaskWithFormCmd extends AbstractCommand<Void> implemen
|
|||||||
params.put("nextApprover", JSON.toJSONString(nextApprover));
|
params.put("nextApprover", JSON.toJSONString(nextApprover));
|
||||||
params.put("nodeTypes", JSON.toJSONString(nodeTypes));
|
params.put("nodeTypes", JSON.toJSONString(nodeTypes));
|
||||||
params.put("formVariables", JSON.toJSONString(formVariables));
|
params.put("formVariables", JSON.toJSONString(formVariables));
|
||||||
|
params.put("variables", JSON.toJSONString(variables));
|
||||||
return JSON.toJSONString(params);
|
return JSON.toJSONString(params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -133,6 +138,7 @@ public class CustomApproveTaskWithFormCmd extends AbstractCommand<Void> implemen
|
|||||||
} else {
|
} else {
|
||||||
this.operationDesc = "已同意";
|
this.operationDesc = "已同意";
|
||||||
}
|
}
|
||||||
|
this.variables = dto.getVariables();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -174,7 +180,7 @@ public class CustomApproveTaskWithFormCmd extends AbstractCommand<Void> implemen
|
|||||||
nextApprover);
|
nextApprover);
|
||||||
}
|
}
|
||||||
task.setTransientVariable(TASK_COMPLETE_OPERATION_TYPE + taskId, APPROVED.getStatus());
|
task.setTransientVariable(TASK_COMPLETE_OPERATION_TYPE + taskId, APPROVED.getStatus());
|
||||||
|
runtimeService.setVariables(task.getProcessInstanceId(), variables);
|
||||||
// 记录电子签名的图片
|
// 记录电子签名的图片
|
||||||
recordSignature(task, runtimeService);
|
recordSignature(task, runtimeService);
|
||||||
|
|
||||||
|
|||||||
@ -79,16 +79,20 @@ import static cn.axzo.workflow.common.constant.VariableConstants.PRINT_VAR_PROCE
|
|||||||
import static cn.axzo.workflow.common.constant.VariableConstants.PRINT_VAR_PROCESS_INITIATOR_PHONE_DESC;
|
import static cn.axzo.workflow.common.constant.VariableConstants.PRINT_VAR_PROCESS_INITIATOR_PHONE_DESC;
|
||||||
import static cn.axzo.workflow.common.constant.VariableConstants.PRINT_VAR_PROCESS_INITIATOR_POSITION;
|
import static cn.axzo.workflow.common.constant.VariableConstants.PRINT_VAR_PROCESS_INITIATOR_POSITION;
|
||||||
import static cn.axzo.workflow.common.constant.VariableConstants.PRINT_VAR_PROCESS_INITIATOR_POSITION_DESC;
|
import static cn.axzo.workflow.common.constant.VariableConstants.PRINT_VAR_PROCESS_INITIATOR_POSITION_DESC;
|
||||||
|
import static cn.axzo.workflow.common.constant.VariableConstants.PRINT_VAR_PROCESS_INITIATOR_UNIT;
|
||||||
import static cn.axzo.workflow.common.constant.VariableConstants.PRINT_VAR_PROCESS_INSTANCE_ID;
|
import static cn.axzo.workflow.common.constant.VariableConstants.PRINT_VAR_PROCESS_INSTANCE_ID;
|
||||||
import static cn.axzo.workflow.common.constant.VariableConstants.PRINT_VAR_PROCESS_INSTANCE_ID_DESC;
|
import static cn.axzo.workflow.common.constant.VariableConstants.PRINT_VAR_PROCESS_INSTANCE_ID_DESC;
|
||||||
import static cn.axzo.workflow.common.constant.VariableConstants.PRINT_VAR_PROCESS_LOGS;
|
import static cn.axzo.workflow.common.constant.VariableConstants.PRINT_VAR_PROCESS_LOGS;
|
||||||
import static cn.axzo.workflow.common.constant.VariableConstants.PRINT_VAR_PROCESS_LOGS_DESC;
|
import static cn.axzo.workflow.common.constant.VariableConstants.PRINT_VAR_PROCESS_LOGS_DESC;
|
||||||
import static cn.axzo.workflow.common.constant.VariableConstants.PRINT_VAR_PROCESS_LOG_ACTIVITY_NAME;
|
import static cn.axzo.workflow.common.constant.VariableConstants.PRINT_VAR_PROCESS_LOG_ACTIVITY_NAME;
|
||||||
import static cn.axzo.workflow.common.constant.VariableConstants.PRINT_VAR_PROCESS_LOG_ACTIVITY_NAME_DESC;
|
import static cn.axzo.workflow.common.constant.VariableConstants.PRINT_VAR_PROCESS_LOG_ACTIVITY_NAME_DESC;
|
||||||
|
import static cn.axzo.workflow.common.constant.VariableConstants.PRINT_VAR_PROCESS_LOG_ACTIVITY_NODE_TYPE;
|
||||||
|
import static cn.axzo.workflow.common.constant.VariableConstants.PRINT_VAR_PROCESS_LOG_ACTIVITY_RESULT;
|
||||||
import static cn.axzo.workflow.common.constant.VariableConstants.PRINT_VAR_PROCESS_LOG_ADVICE;
|
import static cn.axzo.workflow.common.constant.VariableConstants.PRINT_VAR_PROCESS_LOG_ADVICE;
|
||||||
import static cn.axzo.workflow.common.constant.VariableConstants.PRINT_VAR_PROCESS_LOG_ADVICE_DESC;
|
import static cn.axzo.workflow.common.constant.VariableConstants.PRINT_VAR_PROCESS_LOG_ADVICE_DESC;
|
||||||
import static cn.axzo.workflow.common.constant.VariableConstants.PRINT_VAR_PROCESS_LOG_APPROVER_NAME;
|
import static cn.axzo.workflow.common.constant.VariableConstants.PRINT_VAR_PROCESS_LOG_APPROVER_NAME;
|
||||||
import static cn.axzo.workflow.common.constant.VariableConstants.PRINT_VAR_PROCESS_LOG_APPROVER_NAME_DESC;
|
import static cn.axzo.workflow.common.constant.VariableConstants.PRINT_VAR_PROCESS_LOG_APPROVER_NAME_DESC;
|
||||||
|
import static cn.axzo.workflow.common.constant.VariableConstants.PRINT_VAR_PROCESS_LOG_OPERATION;
|
||||||
import static cn.axzo.workflow.common.constant.VariableConstants.PRINT_VAR_PROCESS_LOG_OPERATION_TIME;
|
import static cn.axzo.workflow.common.constant.VariableConstants.PRINT_VAR_PROCESS_LOG_OPERATION_TIME;
|
||||||
import static cn.axzo.workflow.common.constant.VariableConstants.PRINT_VAR_PROCESS_LOG_OPERATION_TIME_DESC;
|
import static cn.axzo.workflow.common.constant.VariableConstants.PRINT_VAR_PROCESS_LOG_OPERATION_TIME_DESC;
|
||||||
import static cn.axzo.workflow.common.constant.VariableConstants.PRINT_VAR_PROCESS_LOG_POSITION;
|
import static cn.axzo.workflow.common.constant.VariableConstants.PRINT_VAR_PROCESS_LOG_POSITION;
|
||||||
@ -162,6 +166,7 @@ public class PrintAdminController implements PrintAdminApi {
|
|||||||
bpmnProcessModelService.printTemplateConfig(dto);
|
bpmnProcessModelService.printTemplateConfig(dto);
|
||||||
return success();
|
return success();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取打印模板中可打印的字段, 或者是 WPS 模板中可配置的变量字段
|
* 获取打印模板中可打印的字段, 或者是 WPS 模板中可配置的变量字段
|
||||||
*
|
*
|
||||||
@ -180,17 +185,29 @@ public class PrintAdminController implements PrintAdminApi {
|
|||||||
List<FormField> formFields = ((SimpleFormModel) formModel.getFormModel()).getFields();
|
List<FormField> formFields = ((SimpleFormModel) formModel.getFormModel()).getFields();
|
||||||
formFields.forEach(formField -> {
|
formFields.forEach(formField -> {
|
||||||
FormContainer formContainer = (FormContainer) formField;
|
FormContainer formContainer = (FormContainer) formField;
|
||||||
printFields.addAll(formContainer.getFields().get(0).stream().map(field -> {
|
printFields.addAll(formContainer.getFields().get(0).stream()
|
||||||
PrintFieldDTO printFieldDTO = new PrintFieldDTO()
|
.filter(field -> {
|
||||||
.setName(field.getName())
|
if (Objects.equals(Boolean.TRUE, dto.getFilterEnablePrint())) {
|
||||||
.setCode(field.getId())
|
if (!CollectionUtils.isEmpty(field.getParams())) {
|
||||||
.setFieldCategoryType(form)
|
Optional<Object> optEnablePrint = Optional.ofNullable(field.getParam("enablePrint"));
|
||||||
.setFieldFormType(field.getType());
|
return optEnablePrint.map(obj -> Boolean.parseBoolean(obj.toString())).orElse(Boolean.TRUE);
|
||||||
switchAmount(field, printFieldDTO);
|
}
|
||||||
switchFormContainer(field, printFieldDTO);
|
return true;
|
||||||
return printFieldDTO;
|
} else {
|
||||||
}
|
return false;
|
||||||
).collect(Collectors.toList()));
|
}
|
||||||
|
})
|
||||||
|
.map(field -> {
|
||||||
|
PrintFieldDTO printFieldDTO = new PrintFieldDTO()
|
||||||
|
.setName(field.getName())
|
||||||
|
.setCode(field.getId())
|
||||||
|
.setFieldCategoryType(form)
|
||||||
|
.setFieldFormType(field.getType());
|
||||||
|
switchAmount(field, printFieldDTO);
|
||||||
|
switchFormContainer(field, printFieldDTO);
|
||||||
|
return printFieldDTO;
|
||||||
|
}
|
||||||
|
).collect(Collectors.toList()));
|
||||||
});
|
});
|
||||||
} catch (FlowableObjectNotFoundException e) {
|
} catch (FlowableObjectNotFoundException e) {
|
||||||
log.warn("can't found form model");
|
log.warn("can't found form model");
|
||||||
@ -368,6 +385,7 @@ public class PrintAdminController implements PrintAdminApi {
|
|||||||
variables.put(PRINT_VAR_PROCESS_INITIATOR_NAME, user.isPresent() ? user.get().getRealName() : "");
|
variables.put(PRINT_VAR_PROCESS_INITIATOR_NAME, user.isPresent() ? user.get().getRealName() : "");
|
||||||
variables.put(PRINT_VAR_PROCESS_INITIATOR_POSITION, user.isPresent() && Objects.nonNull(user.get().getJob()) ? user.get().getJob().getName() : "");
|
variables.put(PRINT_VAR_PROCESS_INITIATOR_POSITION, user.isPresent() && Objects.nonNull(user.get().getJob()) ? user.get().getJob().getName() : "");
|
||||||
variables.put(PRINT_VAR_PROCESS_INITIATOR_PHONE, user.isPresent() ? user.get().getProfile().getPhone() : "");
|
variables.put(PRINT_VAR_PROCESS_INITIATOR_PHONE, user.isPresent() ? user.get().getProfile().getPhone() : "");
|
||||||
|
variables.put(PRINT_VAR_PROCESS_INITIATOR_UNIT, user.isPresent() ? user.get().getOrganizationalUnitName() : "");
|
||||||
variables.remove(PRINT_VAR_PROCESS_INITIATOR);
|
variables.remove(PRINT_VAR_PROCESS_INITIATOR);
|
||||||
}
|
}
|
||||||
// 填充审批日志
|
// 填充审批日志
|
||||||
@ -383,11 +401,14 @@ public class PrintAdminController implements PrintAdminApi {
|
|||||||
.forEach(taskLog -> {
|
.forEach(taskLog -> {
|
||||||
Map<String, Object> taskLogMap = new HashMap<>();
|
Map<String, Object> taskLogMap = new HashMap<>();
|
||||||
taskLogMap.put(PRINT_VAR_PROCESS_LOG_ACTIVITY_NAME, taskLog.getName());
|
taskLogMap.put(PRINT_VAR_PROCESS_LOG_ACTIVITY_NAME, taskLog.getName());
|
||||||
|
taskLogMap.put(PRINT_VAR_PROCESS_LOG_ACTIVITY_NODE_TYPE, taskLog.getNodeType().getType());
|
||||||
Optional<OrgNodeUserBriefInfoResp> user = getUserInfo(taskLog.getAssigneeSnapshot());
|
Optional<OrgNodeUserBriefInfoResp> user = getUserInfo(taskLog.getAssigneeSnapshot());
|
||||||
taskLogMap.put(PRINT_VAR_PROCESS_LOG_APPROVER_NAME, user.isPresent() ? user.get().getRealName() : "");
|
taskLogMap.put(PRINT_VAR_PROCESS_LOG_APPROVER_NAME, user.isPresent() ? user.get().getRealName() : "");
|
||||||
taskLogMap.put(PRINT_VAR_PROCESS_LOG_UNIT, user.isPresent() ? user.get().getOrganizationalUnitName() : "");
|
taskLogMap.put(PRINT_VAR_PROCESS_LOG_UNIT, user.isPresent() ? user.get().getOrganizationalUnitName() : "");
|
||||||
taskLogMap.put(PRINT_VAR_PROCESS_LOG_POSITION, user.isPresent() && Objects.nonNull(user.get().getJob()) ? user.get().getJob().getName() : "");
|
taskLogMap.put(PRINT_VAR_PROCESS_LOG_POSITION, user.isPresent() && Objects.nonNull(user.get().getJob()) ? user.get().getJob().getName() : "");
|
||||||
taskLogMap.put(PRINT_VAR_PROCESS_LOG_ADVICE, taskLog.getAdvice());
|
taskLogMap.put(PRINT_VAR_PROCESS_LOG_ADVICE, taskLog.getAdvice());
|
||||||
|
taskLogMap.put(PRINT_VAR_PROCESS_LOG_OPERATION, taskLog.getOperationDesc());
|
||||||
|
taskLogMap.put(PRINT_VAR_PROCESS_LOG_ACTIVITY_RESULT, taskLog.getResult().getStatus());
|
||||||
taskLogMap.put(PRINT_VAR_PROCESS_LOG_OPERATION_TIME, sdf.format(taskLog.getCreateTime()));
|
taskLogMap.put(PRINT_VAR_PROCESS_LOG_OPERATION_TIME, sdf.format(taskLog.getCreateTime()));
|
||||||
taskLogMap.put(PRINT_VAR_PROCESS_LOG_SIGNATURE, taskLog.getSignatureUrl());
|
taskLogMap.put(PRINT_VAR_PROCESS_LOG_SIGNATURE, taskLog.getSignatureUrl());
|
||||||
taskLogs.add(taskLogMap);
|
taskLogs.add(taskLogMap);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user