工作流取实时的申请人未还款金额
问题:需要使用申请人未还款金额来做判断流程走向,需要判断之前取到实时的申请人未还款金额。
解决方案:
(1)新增2个流程变量。浮点数类型的FAMOUNTBALANCE,内码(BOID)类型的FAPPLIERID
(2)在单据提交节点给applierid取值,单据申请人id
(3)在需要判断流程走向的前一个节点后置脚本写以下脚本即可:
java . sql . Connection con = com . kingdee . bos . framework . ejb . EJBFactory . getConnection ( __bosContext ) ;
java . sql . Statement st = con . createStatement ( ) ;
java . sql . ResultSet rs = null ;
String sql ="select sum(FAMOUNTBALANCE) as sumFamount from t_bc_dailyloanbill where FAPPLIERID ='"+FAPPLIERID+"'" ;
rs = st . executeQuery ( sql ) ;
if ( rs . next ) { FAMOUNTBALANCE = rs . getFloat ( "sumFamount" ) ; }
com . kingdee . util . db . SQLUtils . cleanup ( st , con ) ;
com . kingdee . util . db . SQLUtils . cleanup ( con ) ;
扩展补充:如果想同时获取借款和出差借款金额总计,按下面脚本配置FAMOUNTBALANCETotal是合计金额
java . sql . Connection con = com . kingdee . bos . framework . ejb . EJBFactory . getConnection ( __bosContext ) ;
java . sql . Statement st = con . createStatement ( ) ;
java . sql . ResultSet rs = null ;
String sql ="select sum(FAMOUNTBALANCE) as sumFamount from t_bc_dailyloanbill where FAPPLIERID ='"+applierid+"'" ;
rs = st . executeQuery ( sql ) ;
if ( rs . next ) { FAMOUNTBALANCE = rs . getFloat ( "sumFamount" ) ; }
String sql2 ="select sum(FAMOUNTBALANCE) as sumFamount from T_BC_EVECTIONLOANBILL where FAPPLIERID ='"+applierid+"'" ;
rs = st . executeQuery ( sql2 ) ;
if ( rs . next ) { FAMOUNTBALANCE1 = rs . getFloat ( "sumFamount" ) ; }
FAMOUNTBALANCETotal=FAMOUNTBALANCE+FAMOUNTBALANCE1;
com . kingdee . util . db . SQLUtils . cleanup ( st , con ) ;
com . kingdee . util . db . SQLUtils . cleanup ( con ) ;
工作流取实时的申请人未还款金额
本文2024-09-16 22:12:47发表“eas cloud知识”栏目。
本文链接:https://wenku.my7c.com/article/kingdee-eas-46657.html