⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 statisticsrankbean.java

📁 HR系统模拟企业对内部职员的管理
💻 JAVA
字号:
/*$Id: StatisticsRankBean.java,v 1.1 2008/07/15 03:38:23 liqi Exp $ *-------------------------------------- * Apusic (Kingdee Middleware) *--------------------------------------- * Copyright By Apusic ,All right Reserved * author   date   comment * chenhongxin  2008-4-14  Created*/package org.operamasks.example.ejb.hr.litebean.module;import java.util.ArrayList;import java.util.List;import org.operamasks.example.ejb.hr.entity.Rank;import org.operamasks.example.ejb.hr.service.ServiceBean;import org.operamasks.faces.annotation.ManagedBean;import org.operamasks.faces.annotation.ManagedBeanScope;import org.operamasks.faces.annotation.ManagedProperty;/** * 技术职级培训统计页面的托管Bean * @author chenhongxin */@ManagedBean(name="module.statisticsRankBean", scope=ManagedBeanScope.SESSION)public class StatisticsRankBean extends BeforeRenderBaseBean {	/**	 * 注入服务提供Bean,该Bean提供各种的业务操作对象	 */	@ManagedProperty("#{serviceBean}")	private ServiceBean service;		/**	 * 合计数据	 */	private Total total;		/**	 * 获取技术职级培训统计的数据结果集	 * @return 技术职级培训统计的数据结果集	 */	public List<ReportData> getData() {        List<Object[]> result = service.getTrainService().getRankReport();        return transResult(result);    }	/**     * 将“技术职级统计的基础数据”进行转换封装成“技术职级培训统计的数据结果集”     * @param result 技术职级统计的基础数据     * @return 技术职级培训统计的数据结果集     */    private List<ReportData> transResult(List<Object[]> result) {    	total = new Total();        List<ReportData> datas = new ArrayList<ReportData>();        for(Object[] rec : result) {        	Rank rank = (Rank)rec[0];            ReportData data = new ReportData();            data.setName(rank.getName()); // 部门名称            data.setTotalEmployee(Integer.valueOf(rec[1].toString())); // 部门总培训员工人次            total.setTotalEmployee(total.getTotalEmployee() + data.getTotalEmployee()); // 合计所有部门总培训员工人次            data.setTotalPeriod(Integer.valueOf(rec[2].toString())); // 部门总培训课时            total.setTotalPeriod(total.getTotalPeriod() + data.getTotalPeriod()); // 合计所有部门总培训课时            data.setDistinctEmployee(Integer.valueOf(rec[3].toString())); // 部门总培训员工人数            total.setDistinctEmployee(total.getDistinctEmployee() + data.getDistinctEmployee()); // 合计所有部门总培训员工人数            data.setCurEmployee(rank.getEmployees().size()); // 部门总员工数            total.setCurEmployee(total.getCurEmployee() + data.getCurEmployee()); // 合计所有部门总员工数            datas.add(data);        }        return datas;    }        /**     * 获取合计数据     * @return 合计数据     */    public Total getTotal() {    	if(total == null) return new Total();    	return total;    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -