BOS开发工具类

来源:互联网 发布:ftp命令linux 编辑:程序博客网 时间:2024/06/06 12:36

(1)获取服务器时间

可在客户端调用FDCDateHelper.getServerTimeStamp()

(2)转换大写金额

GlUtils.getChineseFormat(new BigDecimal("111111"), true);

(3)数字控件不需要显示千位分隔符

调用数字控件setGroupingUsed(false)。

(4)将ID集合转化为sql中需要的字符串

String sqlStr=ToolUtils.aryToStr(colletion);

(5)获取资源文件中的信息方法

Public static String getResource(String key){

   return EASResource.getString(“com.kingdee.eas.cdcfdc.hs.common.HSResource”key);

}

(6)设置表格列宽自适应

public static void autoFitColumnWidth(KDTable table){

 int columnCount=table.getColumnCount();

 for(int i=0;i<columnCount;i++){

     KDTableHelper.autoFitColumnWidth(table,i);

}

}

(7)工作流更新状态

java.lang.String sql = "update CT_BIM_BillStorage set CFState=3 where fid='" + BillStroage.id + "'" ;

java.sql.Connection con = com.kingdee.bos.framework.ejb.EJBFactory .getConnection(__bosContext ) ;

java.sql.Statement batchStatement = con.createStatement ( ) ;

batchStatement.execute(sql) ;

com.kingdee.util.db.SQLUtils.cleanup(batchStatement,con) ;

原创粉丝点击