zoukankan      html  css  js  c++  java
  • S-HR常用源码

    1.public static String getUserId(Context ctx) {
            UserInfo userInfo = ContextUtil.getCurrentUserInfo(ctx);
            String userId = (userInfo != null) ? userInfo.getId().toString()
                    : (String) ctx.get("userID");
            return userId;
        }

    重点关注ContextUtil

    2.重点关注HRManagerUtil

    public static String getLocal(Context ctx) {String local = (ctx.getLocale() != null) ? ctx.getLocale().toString(): "l2";return local;}

    -----

    参考HREmpFacadeControllerBean中的getEmpTopicStructure

         public static String rate(double d1, double d2) {
            if (d2 != 0.0D) {
                BigDecimal b1 = new BigDecimal(d1);
                BigDecimal b2 = new BigDecimal(d2);
                double result = b1.divide(b2, 4, 4).doubleValue();
                return round(mul(result, 100.0D), 2) + "%";
            }
            return "0%";
        }

        public static void getPercent(List<Map> list, int headcount) {
            getPercent(list, headcount, "count");
        }

        public static void getPercent(List<Map> list, int headcount,
                String calculateName) {
            int i = 0;
            for (int size = list.size(); i < size; ++i) {
                Map map = (Map) list.get(i);
                int count = ((Integer) map.get(calculateName)).intValue();
                String percent = rate(count, headcount);
                map.put("percent", percent);
            }
        }

    阅读即可

    ------

    3.临时表名

    public static String getTempTableName(Context ctx) throws Exception {
            TempTablePool pool = TempTablePool.getInstance(ctx);
            String tempTableName = pool.createTempTableName();
            return tempTableName;
        }

    Context ctx=ContextUtils.getConextfromSession()

    动态列表设置:select * from t_bd_dynamiclistsetting

    视图配置的表 select * from s_bs_uiview

  • 相关阅读:
    Oracle11g字典表
    python操作excel
    Linux基础
    Mysql的DML基本操作
    Mysq基本操作--DDL
    上传验证码
    验证码
    添加图像
    用cmd 添加 修改 删除数据库
    cmd命令提示符命令
  • 原文地址:https://www.cnblogs.com/luojiabao/p/11338366.html
Copyright © 2011-2022 走看看