commit
40082c9b49
|
@ -101,9 +101,8 @@ public class BpmApprovalDetailRespVO {
|
||||||
@Schema(description = "审批意见", example = "同意")
|
@Schema(description = "审批意见", example = "同意")
|
||||||
private String reason;
|
private String reason;
|
||||||
|
|
||||||
// TODO @lesan:改成 signPicUrl 会好点
|
|
||||||
@Schema(description = "签名", example = "https://www.iocoder.cn/sign.png")
|
@Schema(description = "签名", example = "https://www.iocoder.cn/sign.png")
|
||||||
private String sign;
|
private String signPicUrl;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,9 +18,8 @@ public class BpmTaskApproveReqVO {
|
||||||
@NotEmpty(message = "审批意见不能为空")
|
@NotEmpty(message = "审批意见不能为空")
|
||||||
private String reason;
|
private String reason;
|
||||||
|
|
||||||
// TODO @lesan:改成 signPicUrl 会好点
|
|
||||||
@Schema(description = "签名", example = "https://www.iocoder.cn/sign.png")
|
@Schema(description = "签名", example = "https://www.iocoder.cn/sign.png")
|
||||||
private String sign;
|
private String signPicUrl;
|
||||||
|
|
||||||
@Schema(description = "变量实例(动态表单)", requiredMode = Schema.RequiredMode.REQUIRED)
|
@Schema(description = "变量实例(动态表单)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
private Map<String, Object> variables;
|
private Map<String, Object> variables;
|
||||||
|
|
|
@ -187,7 +187,7 @@ public interface BpmProcessInstanceConvert {
|
||||||
}
|
}
|
||||||
return BeanUtils.toBean(task, BpmApprovalDetailRespVO.ActivityNodeTask.class)
|
return BeanUtils.toBean(task, BpmApprovalDetailRespVO.ActivityNodeTask.class)
|
||||||
.setStatus(FlowableUtils.getTaskStatus(task)).setReason(FlowableUtils.getTaskReason(task))
|
.setStatus(FlowableUtils.getTaskStatus(task)).setReason(FlowableUtils.getTaskReason(task))
|
||||||
.setSign(FlowableUtils.getTaskSign(task));
|
.setSignPicUrl(FlowableUtils.getTaskSignPicUrl(task));
|
||||||
}
|
}
|
||||||
|
|
||||||
default Set<Long> parseUserIds(HistoricProcessInstance processInstance,
|
default Set<Long> parseUserIds(HistoricProcessInstance processInstance,
|
||||||
|
|
|
@ -59,7 +59,6 @@ public class BpmnVariableConstants {
|
||||||
*/
|
*/
|
||||||
public static final String TASK_VARIABLE_REASON = "TASK_REASON";
|
public static final String TASK_VARIABLE_REASON = "TASK_REASON";
|
||||||
|
|
||||||
// TODO @lesan:TASK_SIGN_PIC_URL 。。。虽然长一点,嘿嘿
|
public static final String TASK_SIGN_PIC_URL = "TASK_SIGN_PIC_URL";
|
||||||
public static final String TASK_VARIABLE_SIGN = "TASK_SIGN";
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -213,9 +213,8 @@ public class FlowableUtils {
|
||||||
return (String) task.getTaskLocalVariables().get(BpmnVariableConstants.TASK_VARIABLE_REASON);
|
return (String) task.getTaskLocalVariables().get(BpmnVariableConstants.TASK_VARIABLE_REASON);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO @lesan:这个方法名,也改咧
|
public static String getTaskSignPicUrl(TaskInfo task) {
|
||||||
public static String getTaskSign(TaskInfo task) {
|
return (String) task.getTaskLocalVariables().get(BpmnVariableConstants.TASK_SIGN_PIC_URL);
|
||||||
return (String) task.getTaskLocalVariables().get(BpmnVariableConstants.TASK_VARIABLE_SIGN);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -485,7 +485,7 @@ public class BpmTaskServiceImpl implements BpmTaskService {
|
||||||
// 1.3 校验签名
|
// 1.3 校验签名
|
||||||
BpmnModel bpmnModel = modelService.getBpmnModelByDefinitionId(task.getProcessDefinitionId());
|
BpmnModel bpmnModel = modelService.getBpmnModelByDefinitionId(task.getProcessDefinitionId());
|
||||||
Boolean signEnable = parseSignEnable(bpmnModel, task.getTaskDefinitionKey());
|
Boolean signEnable = parseSignEnable(bpmnModel, task.getTaskDefinitionKey());
|
||||||
if (signEnable && StrUtil.isEmpty(reqVO.getSign())) {
|
if (signEnable && StrUtil.isEmpty(reqVO.getSignPicUrl())) {
|
||||||
throw exception(TASK_SIGNATURE_NOT_EXISTS);
|
throw exception(TASK_SIGNATURE_NOT_EXISTS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -505,7 +505,7 @@ public class BpmTaskServiceImpl implements BpmTaskService {
|
||||||
// 2.1 更新 task 状态、原因、签字
|
// 2.1 更新 task 状态、原因、签字
|
||||||
updateTaskStatusAndReason(task.getId(), BpmTaskStatusEnum.APPROVE.getStatus(), reqVO.getReason());
|
updateTaskStatusAndReason(task.getId(), BpmTaskStatusEnum.APPROVE.getStatus(), reqVO.getReason());
|
||||||
if (signEnable) {
|
if (signEnable) {
|
||||||
taskService.setVariableLocal(task.getId(), BpmnVariableConstants.TASK_VARIABLE_SIGN, reqVO.getSign());
|
taskService.setVariableLocal(task.getId(), BpmnVariableConstants.TASK_SIGN_PIC_URL, reqVO.getSignPicUrl());
|
||||||
}
|
}
|
||||||
// 2.2 添加评论
|
// 2.2 添加评论
|
||||||
taskService.addComment(task.getId(), task.getProcessInstanceId(), BpmCommentTypeEnum.APPROVE.getType(),
|
taskService.addComment(task.getId(), task.getProcessInstanceId(), BpmCommentTypeEnum.APPROVE.getType(),
|
||||||
|
|
Loading…
Reference in New Issue