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
最新文章
- python限定类属性的类属性:__slots__
- C#传递参数
- windows 下rabbitmq 安装---转载
- shell获取系统时间
- Coursera课程 Programming Languages, Part B 总结
- 小白的Python之路 day5 logging模块
- 如何使用 libqr 库生成二维码?
- 常见爬虫/BOT对抗技术介绍(一)
- LeetCode - 503. Next Greater Element II
- python之类与类之间的关系
- 安装fastdfs文件系统
- 20155325 Exp4 恶意代码分析
- [转]uboot中SPI Flash Booting配置
- android 使用lint + studio ,排查客户端无用string,drawable,layout资源
- html和css入门 (二)
- Machine Learning In Action
- Go的接口总结
- kotlin语法
- HDU 1029 Ignatius and the Princess IV (map的使用)
- ab工具测试 swoole 和 ngixn+php-fpm 的并发对比