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

📄 flglnsrflxxmbean.java

📁 以前做的一个j2ee的项目
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
package gov.gdlt.ssgly.taxweb.mbean.flgl;

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

import javax.faces.context.*;
import javax.faces.event.*;
import javax.faces.model.*;

import gov.gdlt.ssgly.taxcore.comm.bizdelegate.*;
import gov.gdlt.ssgly.taxcore.comm.bizinterface.*;
import gov.gdlt.ssgly.taxcore.comm.event.*;
import gov.gdlt.ssgly.taxcore.comm.log.*;
import gov.gdlt.ssgly.taxcore.taxevent.flgl.*;
import gov.gdlt.ssgly.taxweb.comm.mbean.*;
import gov.gdlt.ssgly.taxweb.comm.util.*;
import gov.gdlt.ssgly.taxcore.comm.exception.TaxBaseSystemException;
import gov.gdlt.ssgly.taxcore.comm.exception.TaxBaseBizException;

public class FLGLnsrFlxxMBean extends BaseManagedBean {
    private List nsrList; //待处理纳税人分类列表
    private List flList; //分类下拉列表
    private BigDecimal fl_xh; //
    private BigDecimal nsrnbm;
    private String outcome;
    private String fl_mc;
    private List allNsr; //所有纳税人列表
    private List editFlList; //待编辑分类列表
    private BigDecimal editfl_xh; //待编辑分类序号
    private String fl_ms; //新增分类的分类描述
    private String lrry_dm;
    private String newfl_mc = ""; //新分类名称
    private List selectedNsr;
    private String selectedNsrnbm;
    private String delTips;

    public FLGLnsrFlxxMBean() {
        this.lrry_dm = (String) WebUtil.eval("#{user.userID}");
        nsrList = new ArrayList();
    }

    public List getEditFlList() throws Exception {
        this.editFlList = new ArrayList();
        this.editFlList = allFlList();
        return editFlList;
    }

    public String upSort() throws Exception {
//        System.out.println("-----------mbean : start upSort ----------");
        //SelectItem flxx1 = new SelectItem();
        // if (this.editfl_xh!=null){
        // flxx1.setValue(editfl_xh);
        HashMap hm = new HashMap();
        // BigDecimal selectFl_xh = new BigDecimal( -1);
        int index = 0;
        for (int i = 0; i < editFlList.size(); i++) {
            SelectItem flxx = (SelectItem) editFlList.get(i);
            hm.put(flxx.getValue(), flxx.getDescription());
            if (editfl_xh.equals(flxx.getValue())) {
                index = i;
            }
        }
        if (index > 0) {
            FLGLflxxVO upflxx = new FLGLflxxVO();
            FLGLflxxVO downflxx = new FLGLflxxVO();
            upflxx.setFl_xh(editfl_xh);
            String temppl_xh = (String) hm.get(editfl_xh);
            Integer upPlxh = new Integer(temppl_xh);
            upflxx.setPl_xh(upPlxh.intValue());
            SelectItem down = (SelectItem) editFlList.get(index - 1);
            downflxx.setFl_xh((BigDecimal) down.getValue());
            String tempdownpl_xh = (String) hm.get((BigDecimal) down.getValue());
            Integer downPlxh = new Integer(tempdownpl_xh);
            downflxx.setPl_xh(downPlxh.intValue());
            FLGLszflReqEvent sortReq = new FLGLszflReqEvent();
            sortReq.setDownFl(downflxx);
            sortReq.setFlxx(upflxx);
            sortReq.setDealMethod("sortFl");
            //调用代理方法
            try {
                ISsglyService service = new SsglyDelegate();
                ResponseEvent resp = service.invokeTask(sortReq);
                FLGLszflResEvent sortResp = (FLGLszflResEvent) resp;
                int i = sortResp.getFlag();
                if (i == 1) {
                    outcome = "success";
                } else {
                    outcome = "failure";
                }
            } catch (Exception e) {
                outcome = "failure";
                throw new Exception("YCFLGL02018:分类排序异常!");
            }
        }
        return outcome;
    }

    public String downSort() throws Exception {
//        System.out.println("-----------mbean : start downSort ----------");
        HashMap hm = new HashMap();
        int index = 0;
        for (int i = 0; i < editFlList.size(); i++) {
            SelectItem flxx = (SelectItem) editFlList.get(i);
            hm.put(flxx.getValue(), flxx.getDescription());
            if (editfl_xh.equals(flxx.getValue())) {
                index = i;
            }
        }
        if (index < editFlList.size() - 1) {
            FLGLflxxVO upflxx = new FLGLflxxVO();
            FLGLflxxVO downflxx = new FLGLflxxVO();
            upflxx.setFl_xh(editfl_xh);
            String temppl_xh = (String) hm.get(editfl_xh);
            Integer upPlxh = new Integer(temppl_xh);
            upflxx.setPl_xh(upPlxh.intValue());
            SelectItem down = (SelectItem) editFlList.get(index + 1);
            downflxx.setFl_xh((BigDecimal) down.getValue());
            String tempdownpl_xh = (String) hm.get((BigDecimal) down.getValue());
            Integer downPlxh = new Integer(tempdownpl_xh);
            downflxx.setPl_xh(downPlxh.intValue());
            FLGLszflReqEvent sortReq = new FLGLszflReqEvent();
            sortReq.setDownFl(downflxx);
            sortReq.setFlxx(upflxx);
            sortReq.setDealMethod("sortFl");
            //调用代理方法
            try {
                ISsglyService service = new SsglyDelegate();
                ResponseEvent resp = service.invokeTask(sortReq);
                FLGLszflResEvent sortResp = (FLGLszflResEvent) resp;
                int i = sortResp.getFlag();
                if (i == 1) {
                    outcome = "success";
                } else {
                    outcome = "failure";
                }
            } catch (Exception e) {
                outcome = "failure";
                throw new Exception("YCFLGL02018:分类排序异常!");
            }
        }
        return outcome;
    }

    public void setNsrList(List nsrList) {
        this.nsrList = nsrList;
    }

    public void setFlList(List flList) {
        this.flList = flList;
    }

    public void setAllNsr(List allNsr) {
        this.allNsr = allNsr;
    }

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

    public void setNsrnbm(BigDecimal nsrnbm) {
        this.nsrnbm = nsrnbm;
    }

    public void setOutcome(String outcome) {
        this.outcome = outcome;
    }

    public void setEditfl_xh(BigDecimal editfl_xh) {
        this.editfl_xh = editfl_xh;
    }

    public void setFl_mc(String fl_mc) {
        FacesContext context = FacesContext.getCurrentInstance();
        context.getExternalContext().getRequestMap().put("renameFl", fl_mc);
        this.fl_mc = fl_mc;
    }

    public void setEditFlList(List editFlList) {
        this.editFlList = editFlList;
    }

    public void setFl_ms(String fl_ms) {
        this.fl_ms = fl_ms;
    }

    public void setLrry_dm(String lrry_dm) {
        this.lrry_dm = lrry_dm;
    }

    public void setNewfl_mc(String newfl_mc) {
        this.newfl_mc = newfl_mc;
    }

    public void setSelectedNsr(List selectedNsr) {
        this.selectedNsr = selectedNsr;
    }

    public void setDelTips(String delTips) {
        this.delTips = delTips;
    }

    public void selectListener(ValueChangeEvent ve) {
        outcome = "success";
    }


    public void listener(ValueChangeEvent ve) throws Exception {
        outcome = "success";
        this.fl_xh = (BigDecimal) ve.getNewValue();
        refreshFlList();
    }

    /**
     * 查询某一分类的纳税人
     *
     */
    private void refreshFlList() throws Exception {
        this.nsrList.clear();
        if (this.fl_xh != null) {
            //LogWritter.testDebug("--test: exception -refreshFlList------");
            FLGLcxflxxReqEvent req = new FLGLcxflxxReqEvent();
            req.setFl_xh(fl_xh);
            req.setDealMethod("cxNsrFlxx");
            List tempList = new ArrayList();
            StringBuffer sb = new StringBuffer();
            //调用代理方法
            //LogWritter.testDebug("--test: exception -before service------");
            try {
                ISsglyService service = new SsglyDelegate();
                //LogWritter.testDebug("--test: exception -resp------");
                ResponseEvent resp = service.invokeTask(req);
                // LogWritter.testDebug("--test: exception -cxflResp------");
                FLGLcxflxxResEvent cxflResp = (FLGLcxflxxResEvent) resp;
                // LogWritter.testDebug("--test: exception -before  getflList------");
                tempList = cxflResp.getNsrflxxList();
                // LogWritter.testDebug("--test: exception -getflList------");
                for (int i = 0; i < tempList.size(); i++) {
                    FLGLnsrflxxVO nsrflxx = (FLGLnsrflxxVO) tempList.get(i);
                    String nsrmc =nsrflxx.getNsrbm()+"  "+nsrflxx.getNsr_mc();
                    nsrList.add(new SelectItem(nsrflxx.getNsrnbm(),
                                               nsrmc,
                                               new Integer(i).toString(), false));
                    sb.append(nsrflxx.getNsrnbm())
                            .append(",");
                }
                if (sb.length() > 0) {
                    sb.setLength(sb.length() - 1);
                }
                this.selectedNsrnbm = sb.toString();
            } catch (Exception e) {
                e.printStackTrace();
                //throw new TaxBaseBizException("YCFLGL");
            }
        }

    }

    public String action() {
        return outcome;
    }

    public String submitAction() throws Exception {
//        System.out.println(
//                "---------------start submitAction--1--------------\n");
        this.selectedNsrnbm = WebUtil.getParameterFromContextMap(
                "form1:selectedNsrnbm");
        String initialSelectedNsrnbm = WebUtil.getParameterFromContextMap(
                "initialSelectedNsrnbm");

        String[] tempSelected = selectedNsrnbm.split(",");
        String[] tempInitial = initialSelectedNsrnbm.split(",");
        List addList = new ArrayList();
        List delList = new ArrayList();

        for (int i = 0; i < tempSelected.length; i++) {
            boolean exist = false;
            for (int j = 0; j < tempInitial.length; j++) {
                if (tempSelected[i].equals(tempInitial[j])) {
                    exist = true;
                    break;
                }
            }
            if (!exist) {
                if (!"".equals(tempSelected[i])) {
                    addList.add(tempSelected[i]);
                }
                //  System.out.println("addList: " + addList + "----\r\n");
            }
        }

        for (int j = 0; j < tempInitial.length; j++) {
            boolean delExist = false;
            for (int i = 0; i < tempSelected.length; i++) {
                if (tempInitial[j].equals(tempSelected[i])) {
                    delExist = true;
                    break;
                }
            }
            if (!delExist) {
                if (!"".equals(tempInitial[j])) {
                    delList.add(tempInitial[j]);
                }
                //   System.out.println("delList: " + delList + "----\r\n");
            }
        }
//        System.out.println("----addList-------" + addList.size());
//        System.out.println("----delList-------" + delList.size());
        if (addList.size() > 0) {
            FLGLszflReqEvent req = new FLGLszflReqEvent();
            List tempList = new ArrayList();
            for (int i = 0; i < addList.size(); i++) {
                FLGLnsrflxxVO nsrflxx = new FLGLnsrflxxVO();
                BigDecimal tempNsrnbm = new BigDecimal((String) addList.get(i));
                nsrflxx.setLrry_dm(lrry_dm);
                nsrflxx.setYx_bj("1");
                nsrflxx.setFl_xh(fl_xh);
                nsrflxx.setNsrnbm(tempNsrnbm);
                tempList.add(nsrflxx);
//                System.out.println("----------addList  " + i + " = " +
//                                   nsrflxx.toString());
            }
            req.setNsrList(tempList);
            req.setDealMethod("setNsrfl"); //设置纳税人分类
            //调用代理方法
            try {
                ISsglyService service = new SsglyDelegate();

⌨️ 快捷键说明

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