|
@@ -72,14 +72,17 @@ public class ListenerAnnualLeave implements TaskListener, JavaDelegate {
|
|
|
// String unit = delegateExecution.getVariableInstances().get(field_unit).getTextValue();
|
|
|
String category = delegateExecution.getVariableInstances().get(field_category).getTextValue();
|
|
|
String practical_leave = delegateExecution.getVariableInstances().get(field_practical).getTextValue();
|
|
|
- String employe_name = delegateExecution.getVariableInstances().get(field_name).getTextValue();
|
|
|
+ String employe_name = "";//delegateExecution.getVariableInstances().get(field_name).getTextValue();
|
|
|
String id = delegateExecution.getVariableInstances().get("id").getTextValue();
|
|
|
+
|
|
|
+ Map<String,String> map = tbTableInfoMapper.getColumnValueList("employee_leave",id);
|
|
|
+ if(map == null){
|
|
|
+ throw new RuntimeException("请假单数据存在异常情况,请联系管理员"+id);
|
|
|
+ }
|
|
|
if(StringUtils.isBlank(practical_leave)){
|
|
|
- Map<String,String> map = tbTableInfoMapper.getColumnValueList("employee_leave",id);
|
|
|
practical_leave = map.get(field_practical);
|
|
|
- employe_name = map.get("create_by");
|
|
|
}
|
|
|
-
|
|
|
+ employe_name = map.get("create_by");
|
|
|
if(StringUtils.isBlank(practical_leave)){
|
|
|
return;
|
|
|
}
|
|
@@ -87,6 +90,9 @@ public class ListenerAnnualLeave implements TaskListener, JavaDelegate {
|
|
|
if(category.equals("年假")){
|
|
|
|
|
|
SysUser sys = sysUserMapper.getUserByName(employe_name);
|
|
|
+ if(sys == null){
|
|
|
+ throw new RuntimeException("该用户不存在"+employe_name);
|
|
|
+ }
|
|
|
Double nAnnualNowNum = sys.getNAnnualNowNum();
|
|
|
if(nAnnualNowNum < Double.valueOf(practical_leave)){
|
|
|
throw new RuntimeException("员工"+sys.getRealname()+"剩余年假不足,剩余年假天数"+nAnnualNowNum);
|