工作流中如何获取请假时间段生效的剩余额度总和
问题:工作流中如何获取请假时间段生效的剩余额度总和
处理方案:
1、定义流程变量“syed”,如下图所示
2、在提交节点,添加后置脚本,如下图所示
//输出参数:syed 请假时间段生效的剩余额度总和
SimpleDateFormat sdf = new java . text . SimpleDateFormat ( "yyyy-MM-dd" ) ;
String sd = sdf . format ( bizObj.entries.beginTime ) ;
String ed = sdf . format ( bizObj.entries.endTime ) ;
java . sql . Connection con = com . kingdee . bos . framework . ejb . EJBFactory . getConnection ( __bosContext ) ;
java . sql . Statement st = con . createStatement ( ) ;
java . sql . ResultSet rs = null ;
String tsql = "select sum(FRemainLimit) ed " ;
tsql = tsql + "from t_hr_Ats_holidaylimit " ;
tsql = tsql + "where ((FDelayDate >={ts '"+sd+"'} and FEffectDate <= {ts '"+sd+"'} ) " ;
tsql = tsql + " or (FDelayDate >={ts '"+ed+"'} and FEffectDate <= {ts '"+ed+"'} )) " ;
tsql = tsql + "and FPROPOSERID ='" + bizObj.entries.person.id + "' " ;
tsql = tsql + "and fholidaypolicyid in (select fid from t_hr_AtS_holidaypolicy where FHOLIDAYTYPEID ='" +bizObj.entries.policy.holidayType.id+"') " ;
fsql=tsql;
rs = st . executeQuery ( tsql ) ;
if ( rs . next ) { syed = rs . getDouble ( "ed" ) ; }
com . kingdee . util . db . SQLUtils . cleanup ( st , con ) ;
com . kingdee . util . db . SQLUtils . cleanup ( con ) ;
截图如下:
3、取值效果如下
工作流中如何获取请假时间段生效的剩余额度总和
本文2024-09-22 21:36:13发表“s-hr cloud知识”栏目。
本文链接:https://wenku.my7c.com/article/kingdee-shr-121136.html