工作流中如何取加班日期所在周的汇总时长
[适用版本]
通用
[解决方案]
//流程变量说明:
//输入变量:personid是职员id , OverDate 加班日期
//输出变量: Wlength 周加班时长,Dlength 当天加班时长
//其他tsql 执行的语句
SimpleDateFormat sdf = new java.text.SimpleDateFormat(yyyy-MM-dd);
String od = sdf.format(OverDate);
java . sql . Connection con = com . kingdee . bos . framework . ejb . EJBFactory . getConnection ( __bosContext ) ;
java . sql . Statement st = con . createStatement ( ) ;
java . sql . ResultSet rs = null ;
tsql=select sum(FApplyOTTime) fwapllh ,sum(case when FOTDATE ={ts '+ od +'} then FAPPLYOTTIME else 0 end) Fdapllh
+from t_hr_ats_overtimebillentry
+where FPERSONID ='+ personid +'
+and FBILLID in(select fid from t_hr_ats_overtimebill where FBILLSTATE =2 or FBILLSTATE =3 or FBILLSTATE =1 )
+and FOTDATE >=DATEADD(week,DATEDIFF(week,0,'+ od +'),0)
+and fotdate<=DATEADD(week,DATEDIFF(week,0,'+ od +'),6) ;
rs = st . executeQuery ( tsql ) ;
if ( rs . next ) {
Wlength= rs . getDouble ( fwapllh ) ;
Dlength= rs . getDouble ( fdapllh ) ;
}
com . kingdee . util . db . SQLUtils . cleanup ( st , con ) ;
com . kingdee . util . db . SQLUtils . cleanup ( con ) ;
工作流中如何取加班日期所在周的汇总时长
本文2024-09-22 21:51:11发表“s-hr cloud知识”栏目。
本文链接:https://wenku.my7c.com/article/kingdee-shr-122755.html