工作流中如何取请假开始时间所处年度的当年病假总时长、当年事假总时长、当月事假总时长、工龄和职务族

问题:如何取请假开始时间所处年度的当年病假总时长、当年事假总时长、当月事假总时长、工龄和职务族
处理方案:工作流脚本处理
操作步骤如下:
1、定义流程变量

2、在提交节点后置脚本,贴入如下脚本
//输出参数:bjzsc 当年病假总时长
//输出参数:sjzsc 当年事假总时长
//输出参数:dysjzsc 当月事假总时长
SimpleDateFormat sdf = new java . text . SimpleDateFormat ( "yyyy-MM-dd" ) ;
String sd = sdf . format ( bizObj.entries.beginTime) ; //基准日期为请假开始时间
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(case when b.fname_l2='病假' then a.FLEAVELENGTH else 0 end ) bjzsc, " ;
tsql = tsql + "sum(case when b.fname_l2='事假' then a.FLEAVELENGTH else 0 end ) sjzsc, " ;
tsql = tsql + "sum(case when b.fname_l2='事假' and (month(a.FBeginTIME)=month({ts '"+sd+"'}) or month(a.FEndTIME)=month({ts '"+sd+"'})) then a.FLEAVELENGTH else 0 end ) dysjzsc " ;
tsql = tsql + "from t_hr_Ats_leavebillentry a " ;
tsql = tsql + "inner join t_hr_atS_holidaypolicy b on a.fpolicyid=b.fid and a.fpersonid='" + bizObj.entries.person.id+ "' " ;
tsql = tsql + "inner join t_hr_AtS_leavebill c on a.fbillid=c.fid and fbillstate in(1,2,3) " ;
tsql = tsql + "where year(a.FBeginTIME)=year({ts '"+sd+"'}) or year(a.FEndTIME)=year({ts '"+sd+"'}) " ;
工作流中如何取请假开始时间所处年度的当年病假总时长、当年事假总时长、当月事假总时长、工龄和职务族
声明:除非特别标注,否则均为本站原创文章,转载时请以链接形式注明文章出处。如若本站内容侵犯了原著者的合法权益,可联系本站删除。



