EAS_常用技巧汇总
1、金额大写函数:
GlUtils.getChineseFormat(amount, true)
2、获取 datacenters.xml中的密码:
String passwd = com.kingdee.bos.sql.KSqlUtil.decodePassword("ksqle:J8CQQm9M5Q4UaPELUb1V8EXq+ObMhjzN");
3、Client执行SQL:
SQLExecutorFactory.getRemoteInstance(sql.toString()).executeSQL();
4、app执行SQL:
DbUtil.execute(ctx, sql, new Object[] { map.get("remain"), map.get("id") });
5、获取当前会计期间:
CompanyOrgUnitInfo currentFIUnit = ContextUtil.getCurrentFIUnit(ctx);
PeriodInfo currentPeriod = SystemStatusCtrolUtils.getCurrentPeriod(ctx, SystemEnum.GENERALLEDGER, currentFIUnit);
6、获取当前期间上一期间
//获取上一期间 PeriodInfo prePeriodInfo = PeriodUtils.getPrePeriodInfo(ctx, new ObjectUuidPK(periodPk));
7、根据bosType获取对应的表:
String tableName = FMIsqlFacadeFactory.getLocalInstance(ctx).getTableNameByBosType(bosType);
8、组织隔离:
FilterInfo otherFilter = com.kingdee.eas.framework.FrameWorkUtils.getF7FilterInfoByAuthorizedOrg(com.kingdee.eas.basedata.org.OrgType.getEnum("Admin"),"OrgUnit.id",true);
8、查询数据库所有表:
String sql = "SELECT * FROM KSQL_USERTABLES"; try { IRowSet rs = SQLExecutorFactory.getRemoteInstance(sql).executeSQL(); while (rs.next()) { System.out.println(rs.getString("table_name")); } } catch (BOSException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); }
10.EASEdit界面关闭提交以后继续新增(提交并新增、提交并打印)
protected boolean isSubmitLoad() { //true 代表提交后自动新增, false,代表提交后显示提交单据,不自动新增 return false; } protected boolean isContinueAddNew() { return false; } chkMenuItemSubmitAndAddNew.setSelected(false); chkMenuItemSubmitAndPrint.setSelected(false);
linux下的docker操作命令及异常