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

📄 jkyjckyjxxmbean.java

📁 以前做的一个j2ee的项目
💻 JAVA
字号:
package gov.gdlt.ssgly.taxweb.mbean.jkyj;

import java.math.BigDecimal;
import java.util.*;

import javax.faces.context.FacesContext;

import gov.gdlt.ssgly.taxcore.comm.bizdelegate.SsglyDelegate;
import gov.gdlt.ssgly.taxcore.comm.bizinterface.ISsglyService;
import gov.gdlt.ssgly.taxcore.comm.event.ResponseEvent;
import gov.gdlt.ssgly.taxcore.comm.log.LogWritter;
import gov.gdlt.ssgly.taxcore.taxevent.flgl.FLGLflxxVO;
import gov.gdlt.ssgly.taxcore.taxevent.jkyj.*;
import gov.gdlt.ssgly.taxweb.comm.util.WebUtil;
import gov.gdlt.ssgly.taxweb.tag.PagedBaseBean;

/**
 * <p>Title: 查看预警信息mBean</p>
 *
 * <p>Description: 广东地税税收管理员工作平台</p>
 *
 * <p>Copyright: Copyright (c) 2005 广东省地方税务局,广州市地方税务局</p>
 *
 * <p>Company: 广州地税</p>
 *
 * @author 郑毅晖
 * @version 1.0
 */
public class JKYJckyjxxMBean extends PagedBaseBean {
    private ArrayList yjlbList = null;
    private ArrayList yjlbHeader; //2005.10.14由HashMap改为ArrayList
    private boolean hasYjjl; //是否有预警记录标记
    private String fl_mc; //分类名称
    private String flmcInpage;
    private String flxhInpage;
    private JKYJckyjxxResEvent ssglyRes;
    private static final int PAGE_SIZE = 17; //每页显示记录数
    private String fl_xh; //分类序号

    public JKYJckyjxxMBean() throws Exception {
        getYjlb();
    }

    public void setYjlbList(ArrayList yjlbList) {
        this.yjlbList = yjlbList;
    }

    public void setYjlbHeader(ArrayList yjlbHeader) {
        this.yjlbHeader = yjlbHeader;
    }

    public void setHasYjjl(boolean hasYjjl) {
        this.hasYjjl = hasYjjl;
    }

    public void setFl_mc(String fl_mc) {
        this.fl_mc = fl_mc;
    }

    public void setFlmcInpage(String flmcInpage) {
        this.flmcInpage = flmcInpage;
    }

    public void setFlxhInpage(String flxhInpage) {
        this.flxhInpage = flxhInpage;
    }

    public void setFl_xh(String fl_xh) {
        this.fl_xh = fl_xh;
    }


    public ArrayList getYjlbList() {
        return yjlbList;
    }

    public ArrayList getYjlbHeader() {
        return yjlbHeader;
    }

    public boolean isHasYjjl() {
        return hasYjjl;
    }

    public String getFl_mc() {
        return fl_mc;
    }

    public String getFlmcInpage() {
        return flmcInpage;
    }

    public String getFlxhInpage() {
        return flxhInpage;
    }

    public String getFl_xh() {
        return fl_xh;
    }


    /**
     * 重置是否有预警记录标记
     * @param lbList:ArrayList 用于验证是否有预警记录的列表
     */
    public void resetHasYjjl(ArrayList lbList) {
        JKYJyjlbVO yjlbVO = null;

        hasYjjl = false; //初始化为没有预警记录
        for (int i = 0; i < lbList.size(); i++) {
            yjlbVO = (JKYJyjlbVO) lbList.get(i);
            if (yjlbVO.isHasYjjl()) {
                hasYjjl = true; //设置为有预警记录
                break;
            }
        }
//        FacesContext context = FacesContext.getCurrentInstance();
//        ValueBinding binding = context.getApplication().createValueBinding("#{user.hasYjjl}");
//        Boolean tmp = new Boolean(hasYjjl);
//        binding.setValue(context,tmp);
    }

    public String getYjlb() throws Exception {
        boolean default_fl = false;
        String fl_xh = WebUtil.getParameterFromContextMap("fl_xh");
        String cxtj = WebUtil.getParameterFromContextMap("cxtj");
        BigDecimal fl_idx;
        if (fl_xh == null) {
            flxhInpage = WebUtil.getParameterFromContextMap(
                    "jktForm:flxhInpage");
            fl_xh = flxhInpage;
        }
        FacesContext fc = FacesContext.getCurrentInstance();
        Map map = fc.getExternalContext().getSessionMap();
        if (fl_xh == null) {
            //return "fail"; //参数为空
            ArrayList flxxList = (ArrayList) WebUtil.eval("#{user.flxxList}");
//            FacesContext context = FacesContext.getCurrentInstance();
//            ValueBinding binding = context.getApplication().createValueBinding("#{user.flxxList}");
//            ArrayList flxxList = (ArrayList)binding.getValue(context);
            FLGLflxxVO flxxVO = null;
            if (flxxList == null || flxxList.size() == 0) { //没有任何分类信息
                this.fl_mc = "未找到分类信息";
                this.fl_xh = "0";
                return "index";
            }
            flxxVO = (FLGLflxxVO) flxxList.get(0);
            fl_xh = flxxVO.getFl_xh().toString();
            this.fl_mc = flxxVO.getFl_mc() + "(" + flxxVO.getLrry_mc() + ")";
            this.fl_xh = fl_xh;
            default_fl = true;
            //fl_xh = "1000000010"; //暂时默认一个分类
            LogWritter.sysDebug("default fl_xh=" + fl_xh); //for debug
            fl_idx = new BigDecimal(0);
        } else {
            LogWritter.sysDebug("fl_xh=" + fl_xh); //for debug
            this.fl_mc = WebUtil.getParameterFromContextMap("fl_mc");
            this.fl_xh = WebUtil.getParameterFromContextMap("fl_xh");
            if (fl_mc == null || "".equals(fl_mc)) {
                fl_mc = WebUtil.getParameterFromContextMap("jktForm:flmcInpage");
            }
           fl_idx = new BigDecimal((WebUtil.getParameterFromContextMap("fl_idx")==null || "".equals(WebUtil.getParameterFromContextMap("fl_idx")))?((BigDecimal)WebUtil.eval("#{user.curFl_idx}")).toString():WebUtil.getParameterFromContextMap("fl_idx"));
        }
        if (!fl_mc.equals(WebUtil.getParameterFromContextMap(
                "jktForm:flmcInpage")) ||
            !cxtj.equals(WebUtil.eval("#{user.jktcxtj}"))) {
            JKYJckyjxxReqEvent req = new JKYJckyjxxReqEvent();
            req.setFl_xh(new BigDecimal(fl_xh));
            req.setSt_dm("JKT");
            req.setCxtj(cxtj);
            req.setDealMethod("getYjlb");
            //调用代理方法
            ISsglyService service = new SsglyDelegate();
            ResponseEvent res = service.invokeTask(req);
            //处理ResponseEvent
            ssglyRes = (JKYJckyjxxResEvent) res;
//            if (default_fl) {
//                WebUtil.setExprValue("#{user.nsrCount}",
//                                     new BigDecimal(ssglyRes.getYjlbList().size())); //设置管户数
//            }
            sortHasYjjl(ssglyRes.getYjlbList());
            resetHasYjjl(ssglyRes.getYjlbList());
            map.put("jkpt", ssglyRes);
        } else {
            ssglyRes = (JKYJckyjxxResEvent) map.get("jkpt");
        }
        //setYjlbList(getSession(ssglyRes.getYjlbList(),10,2,"jkpt"));
        setYjlbHeader(ssglyRes.getYjlbHeader());
        //设置分页数据
        flmcInpage = fl_mc;
        flxhInpage = fl_xh;
        WebUtil.setExprValue("#{user.jktcxtj}", cxtj);
//        WebUtil.setExprValue("#{user.curFl_xh}", new BigDecimal(this.fl_xh)); //设置当前分类序号
//        WebUtil.setExprValue("#{user.curFl_mc}", this.fl_mc); //设置当前分类名称
        WebUtil.setExprValue("#{user.curFl_idx}", fl_idx); //设置当前分类序号
        //返回调用页面
        return "index";
    }

    /**
     * 对预警列表数据按照是否有预警记录和企业代码排序
     * @param lbList:ArrayList 用于进行排序的列表
     */
    protected void sortHasYjjl(ArrayList lbList) {
        Comparator comparator = new Comparator() {
            public int compare(Object o1, Object o2) {
                JKYJyjlbVO yjlbVO1 = (JKYJyjlbVO) o1;
                JKYJyjlbVO yjlbVO2 = (JKYJyjlbVO) o2;
                int flag = 0;
                if (yjlbVO1.isHasYjjl() && !yjlbVO2.isHasYjjl()) {
                    flag = -1;
                } else if (yjlbVO2.isHasYjjl() && !yjlbVO1.isHasYjjl()) {
                    flag = 1;
                } else {
                    flag = ((JKYJyjjlVO) yjlbVO1.getYjzbData().get(0)).
                           getZbz().
                           compareTo(((JKYJyjjlVO) yjlbVO2.getYjzbData().get(0)).
                                     getZbz());
                }
                return flag;
            }
        };
        Collections.sort(lbList, comparator);
    }

    protected void sort(final String column, final boolean ascending) {
        Comparator comparator = new Comparator() {
            public int compare(Object o1, Object o2) {
                JKYJyjlbVO c1 = (JKYJyjlbVO) o1;
                JKYJyjlbVO c2 = (JKYJyjlbVO) o2;
                if (column == null) {
                    return 0;
                }
                if (column.equals("nsrbm")) {

                    return ascending ?
                            ((JKYJyjjlVO) c1.getYjzbData().get(0)).getZbz().
                            compareTo(((JKYJyjjlVO) c2.getYjzbData().get(0)).
                                      getZbz()) :
                            ((JKYJyjjlVO) c2.getYjzbData().get(0)).getZbz().
                            compareTo(((JKYJyjjlVO) c1.getYjzbData().get(0)).
                                      getZbz());
                } else {
                    return 0;
                }
            }
        };
        Collections.sort(objectList, comparator);
    }

    //实现抽象方法
    protected void refreshObjectList(int currentPage) throws Exception {
        objectList = getSession(ssglyRes.getYjlbList(), this.PAGE_SIZE,
                                currentPage);
        yjlbList = (ArrayList) objectList;
    }

    //实现抽象方法
    protected void getTotalPage() throws Exception {
        MathTotalInSeesion(ssglyRes.getYjlbList(), this.PAGE_SIZE);
    }

    protected void isTrue() {
    }

    //实现抽象方法
    protected void runExtraRoutine() {};

}

⌨️ 快捷键说明

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