fix(flowable): 处理请假天数变量为空的情况
当leaveDays变量为空时,从数据库查询并设置正确的请假天数值
This commit is contained in:
@@ -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
|
||||||
// 报错信息
|
// 报错信息
|
||||||
|
|||||||
@@ -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();
|
||||||
|
|||||||
Reference in New Issue
Block a user