fix(flowable): 处理请假天数变量为空的情况

当leaveDays变量为空时,从数据库查询并设置正确的请假天数值
This commit is contained in:
2026-04-03 14:10:20 +08:00
parent 68bddd68a8
commit 2953a1ba87
2 changed files with 20 additions and 0 deletions

View File

@@ -37,6 +37,16 @@ public class LeaveApproveListener implements ExecutionListener {
// 获取请假天数 // 获取请假天数
BigDecimal leaveDays = (BigDecimal) delegateExecution.getVariable("leaveDays"); BigDecimal leaveDays = (BigDecimal) delegateExecution.getVariable("leaveDays");
if (leaveDays == null) {
String leaveAppId = delegateExecution.getVariable("leaveApplicationId").toString();
if (leaveAppId != null) {
StuLeaveApplication stu = leaveMapper.selectRtStuLeaveApplicationByLeaveApplicationId(leaveAppId);
if (stu != null && stu.getLeaveDays() != null) {
leaveDays = new BigDecimal(stu.getLeaveDays().toString());
delegateExecution.setVariable("leaveDays", leaveDays);
}
}
}
// 请假单id // 请假单id
// 报错信息 // 报错信息

View File

@@ -30,6 +30,16 @@ public class LeaveStartApproveListener implements ExecutionListener {
// 获取请假天数 // 获取请假天数
BigDecimal leaveDays = (BigDecimal) delegateExecution.getVariable("leaveDays"); BigDecimal leaveDays = (BigDecimal) delegateExecution.getVariable("leaveDays");
if (leaveDays == null) {
String leaveAppId = delegateExecution.getVariable("leaveApplicationId").toString();
if (leaveAppId != null) {
StuLeaveApplication stu = leaveMapper.selectRtStuLeaveApplicationByLeaveApplicationId(leaveAppId);
if (stu != null && stu.getLeaveDays() != null) {
leaveDays = new BigDecimal(stu.getLeaveDays().toString());
delegateExecution.setVariable("leaveDays", leaveDays);
}
}
}
// 辅导员审批结果 // 辅导员审批结果
String approval = delegateExecution.getVariable("approval").toString(); String approval = delegateExecution.getVariable("approval").toString();