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

  • 相关阅读:
    c# base knowledge
    Asp.net life cycle introduction
    Build a excel which contains downlist.
    using Assembly to create object
    Build a endtoend log to record system performance.
    转帖 饱含人生哲理的真情嘱咐
    Using nunit in website and class project.
    updatepanel summary
    我的项目 系统性能优化
    service数据改变时发广播给前端activity供显示
  • 原文地址:https://www.cnblogs.com/luojiabao/p/11338366.html
Copyright © 2011-2022 走看看