//流程变量说明://输入变量:personid是职员id,OverDate加班日期//输出变量:Wlength当月加班时长,Dlength当天加班时长//其他tsql执行的语句SimpleDateFormatsdf=newjava.text.SimpleDateFormat("yyyy-MM-dd");Stringod=sdf.format(OverDate);java.sql.Connectioncon=com.kingdee.bos.framework.ejb.EJBFactory.getConnection(__bosContext);java.sql.Statementst=con.createStatement();java.sql.ResultSetrs=null;tsql="selectsum(FApplyOTTime)fwapllh,sum(casewhenFOTDATE={ts'"+od+"'}thenFAPPLYOTTIMEelse0end)Fdapllh"+"fromt_hr_ats_overtimebillentrya"+"innerjoint_hr_ats_attendancefilebona.FPERSONID=b.fproposeridanda.FPERSONID='"+personid+"'"+"innerjoint_hr_AtS_attencepolicyconb.FATTENCEPOLICYID=c.fid"+"innerjoint_ats_attencecycledonc.FATTENCECYCLEID=d.fid"+"innerjoint_hr_ats_attendanceperiodeond.fid=e.fgroupidande.fstartdate<={ts'"+od+"'}ande.fenddate>={Ts'"+od+"'}"+"whereFBILLIDin(selectfidfromt_hr_ats_overtimebillwhereFBILLSTATE=2orFBILLSTATE=3orFBILLSTATE=1);"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);sql脚本selectsum(FApplyOTTime)fwapllh,sum(casewhenFOTDATE={ts'2020-07-10'}thenFAPPLYOTTIMEelse0end)Fdapllhfromt_hr_ats_overtimebillentryainnerjoint_hr_ats_attendancefilebona.FPERSONID=b.fproposeridanda.FPERSONID='yFrzAzZMSESvwMSB3IQbGoDvfe0='innerjoint_hr_AtS_attencepolicyconb.FATTENCEPOLICYID=c.fidinnerjoint_ats_attencecycledonc.FATTENCECYCLEID=d.fidinnerjoint_hr_ats_attendanceperiodeond.fid=e.fgroupidande.fstartdate<={ts'2020-07-10'}ande.fenddate>={Ts'2020-07-10'}whereFBILLIDin(selectfidfromt_hr_ats_overtimebillwhereFBILLSTATE=2orFBILLSTATE=3orFBILLSTATE=1)工作流网页设计器脚本//流程变量说明://输入变量:bizObj.entries.person.id是职员id,bizObj.entries.otDate加班日期//输出变量:Wlength当月加班时长,Dlength当天加班时长//其他tsql执行的语句SimpleDateFormatsdf=newjava.text.SimpleDateFormat("yyyy-MM-dd");Stringod=sdf.format(bizObj.entries.otDate);java.sql.Connectioncon=com.kingdee.bos.framework.ejb.EJBFactory.getConnection(__bosContext);java.sql.Statementst=con.createStatement();java.sql.ResultSetrs=null;tsql="selectsum(FApplyOTTime)fwapllh,sum(casewhenFOTDATE={ts'"+od+"'}thenFAPPLYOTTIMEelse0end)Fdapllh"+"fromt_hr_ats_overtimebillentrya"+"innerjoint_hr_ats_attendancefilebona.FPERSONID=b.fproposeridanda.FPERSONID='"+bizObj.entries.person.id+"'"+"innerjoint_hr_AtS_attencepolicyconb.FATTENCEPOLICYID=c.fid"+"innerjoint_ats_attencecycledonc.FATTENCECYCLEID=d.fid"+"innerjoint_hr_ats_attendanceperiodeond.fid=e.fgroupidande.fstartdate<={ts'"+od+"'}ande.fenddate>={Ts'"+od+"'}"+"whereFBILLIDin(selectfidfromt_hr_ats_overtimebillwhereFBILLSTATE=2orFBILLSTATE=3orFBILLSTATE=1);"rs=st.executeQuery(tsql);if(rs.next){Wlength=rs.getDouble("fwapllh");Dlength=rs.getDouble("fdapllh");}