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

📄 rwglstatisicdao.java

📁 以前做的一个j2ee的项目
💻 JAVA
字号:
package gov.gdlt.ssgly.taxcore.taxdao.rwgl;

import java.text.*;
import java.util.*;

import gov.gdlt.ssgly.taxcore.comm.dao.*;
import gov.gdlt.ssgly.taxcore.comm.exception.*;
import java.sql.Connection;
import java.sql.Statement;
import java.sql.ResultSet;

/**
 * <p>Title: </p>
 *
 * <p>Description: 广东地税税收管理员工作平台</p>
 *
 * <p>Copyright: Copyright (c) 2005 广东省地方税务局,广州市地方税务局</p>
 *
 * <p>Company: 广州地税</p>
 *
 * @author 张承华
 * @version 1.0
 */
public class RWGLstatisicDAO extends BaseDataAccessObject {
    public RWGLstatisicDAO() {
        try {
            jbInit();
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }
    //统计条件
    private String SWJG_DM, BLRY_DM, NSRBM, NSRNBM;//税务机关代码,办理人员代码
    private Date SQQ, SQZ;//时期起、止

    //任务统计
    private long RWZS;//任务总数
    private long YWCRWS;//已完成任务数
    private long WWCRWS;//未完成任务数
    private long AQWCRWS;//按期完成任务数
    private long WAQWCRWS;//未按期完成任务数

    //任务明细
    private long RW_XH;//任务序号
    private String RWMS;//任务描述即任务标题
    private String RWXL_DM, RWXL_MC;//任务小类、名称
    private String RWYX_JB, RWYX_JB_MC;//任务优先级别、名称
    private Date XD_SJ, WC_SJ;//任务下达时间、完成时间
    private int CQTS;//超期天数

    private String strSqq, strSqz, strXdsj, strWcsj;//和SQQ,SQZ一样,不过一个是DATE一个是STRING




    public long getAQWCRWS() {
        return AQWCRWS;
    }

    public String getBLRY_DM() {
        if (BLRY_DM == null) BLRY_DM = "";
        return BLRY_DM;
    }

    public int getCQTS() {
        return CQTS;
    }

    public long getRW_XH() {
        return RW_XH;
    }

    public String getRWMS() {
        return RWMS;
    }

    public String getRWXL_DM() {
        return RWXL_DM;
    }

    public String getRWXL_MC() {
        return RWXL_MC;
    }

    public String getRWYX_JB() {
        return RWYX_JB;
    }

    public String getRWYX_JB_MC() {
        if ("1".equals(RWYX_JB)) {
           RWYX_JB_MC = "重要";
       } else if ("2".equals(RWYX_JB)){
           RWYX_JB_MC = "一般";
       }

        return RWYX_JB_MC;
    }

    public long getRWZS() {
        return RWZS;
    }

    public String getSWJG_DM() {
        if (SWJG_DM == null) SWJG_DM = "";
        return SWJG_DM;
    }

    public long getWAQWCRWS() {
        return WAQWCRWS;
    }

    public Date getWC_SJ() {
        return WC_SJ;
    }

    public long getWWCRWS() {
        return WWCRWS;
    }

    public Date getXD_SJ() {
        return XD_SJ;
    }

    public long getYWCRWS() {
        return YWCRWS;
    }

    public void setAQWCRWS(long AQWCRWS) {
        this.AQWCRWS = AQWCRWS;
    }

    public void setBLRY_DM(String BLRY_DM) {
        if (BLRY_DM == null) BLRY_DM = "";
        this.BLRY_DM = BLRY_DM;
    }

    public void setCQTS(int CQTS) {
        this.CQTS = CQTS;
    }

    public void setRW_XH(long RW_XH) {
        this.RW_XH = RW_XH;
    }

    public void setRWMS(String RWMS) {
        this.RWMS = RWMS;
    }

    public void setRWXL_DM(String RWXL_DM) {
        this.RWXL_DM = RWXL_DM;
    }

    public void setRWXL_MC(String RWXL_MC) {
        this.RWXL_MC = RWXL_MC;
    }

    public void setRWYX_JB(String RWYX_JB) {
        this.RWYX_JB = RWYX_JB;
    }

    public void setRWYX_JB_MC(String RWYX_JB_MC) {
        this.RWYX_JB_MC = RWYX_JB_MC;
    }

    public void setRWZS(long RWZS) {
        this.RWZS = RWZS;
    }

    public void setSWJG_DM(String SWJG_DM) {
        if (SWJG_DM == null) SWJG_DM = "";
        this.SWJG_DM = SWJG_DM;
    }

    public void setWAQWCRWS(long WAQWCRWS) {
        this.WAQWCRWS = WAQWCRWS;
    }

    public void setWC_SJ(Date WC_SJ) {
        this.WC_SJ = WC_SJ;
    }

    public void setWWCRWS(long WWCRWS) {
        this.WWCRWS = WWCRWS;
    }

    public void setXD_SJ(Date XD_SJ) {
        this.XD_SJ = XD_SJ;
    }

    public void setYWCRWS(long YWCRWS) {
        this.YWCRWS = YWCRWS;
    }




    public Date getSQQ() {
        return SQQ;
    }

    public Date getSQZ() {
        return SQZ;
    }

    public void setSQQ(Date SQQ) {
        this.SQQ = SQQ;
    }

    public void setSQZ(Date SQZ) {
        this.SQZ = SQZ;
    }




    /////////////////////////////////////////////////////////////////////////////

    //获得统计汇总
    public RWGLstatisicDAO getStatisicCollect () throws TaxBLHException {
        String blry = "", blbm = "", nsrnbm = "";//办理人员,办理部门

        try {
            blry = this.getBLRY_DM();
            blbm = this.getSWJG_DM();
            nsrnbm = this.getNSRNBM();
            if (blbm.equals("")) {
                return this;
            }
            String fun = "";
            if (blry.equals("")) {
                //部门统计汇总
                if (nsrnbm.equals("")) {
                    fun = "RWGL_TJ.selectRwglBmTjHz";
                } else {//通过纳税人内部码
                    fun = "RWGL_TJ.selectRwglBmTjHzByNsrnbm";
                }
            } else {
                //个人统计汇总
                if (nsrnbm.equals("")) {
                    fun = "RWGL_TJ.selectRwglGrTjHz";
                } else {//通过纳税人内部码
                    fun = "RWGL_TJ.selectRwglGrTjHzByNsrnbm";
                }
            }
            this.select(fun, this);
        } catch(Exception e) {
            e.printStackTrace();
            throw new TaxBLHException("获取统计汇总信息失败(办理人员:" + blry + ",办理部门:" + blbm + "。\n错误信息:" + e.getMessage());
        }
        return this;
    }

    //获得统计明细
    public List getStatisicList () throws TaxBLHException {
        List list = null;
        String blry = "", blbm = "", nsrnbm = "";//办理人员,办理部门
        try {
            blry = this.getBLRY_DM();
            blbm = this.getSWJG_DM();
            nsrnbm = this.getNSRNBM();
            if (blbm.equals("")) {
                return list;
            }
            String fun = "";
            if (blry.equals("")) {
                //部门统计明细
                if (nsrnbm.equals("")) {
                    fun = "RWGL_TJ.selectRwglBmTjMx";
                } else {//通过纳税人内部码
                    fun = "RWGL_TJ.selectRwglBmTjMxByNsrnbm";
                }
            } else {
                //个人统计明细
                if (nsrnbm.equals("")) {
                    fun = "RWGL_TJ.selectRwglGrTjMx";
                } else {//通过纳税人内部码
                    fun = "RWGL_TJ.selectRwglGrTjMxByNsrnbm";
                }
            }
            list = this.selectAll(fun, this);
        } catch(Exception e) {
            e.printStackTrace();
            throw new TaxBLHException("获取统计明细信息失败(办理人员:" + blry + ",办理部门:" + blbm + "。\n错误信息:" + e.getMessage());
        }
        return list;
    }

////////////////////////////////////////////////////////////////////////////////

    public static void main(String[] args) throws TaxBLHException, Exception {
        RWGLstatisicDAO rwglstatisicdao = new RWGLstatisicDAO();

        try {
            SimpleDateFormat formatter
                    = new SimpleDateFormat ("yyyy-MM-dd HH:mm:ss");
            ParsePosition pos = new ParsePosition(0);
            Date sqq = formatter.parse("2005-8-09 00:00:00", pos);
            pos.setIndex(0);
            Date sqz = formatter.parse("2005-08-12 00:00:00", pos);

            StringBuffer strBuf = new StringBuffer();
            FieldPosition fPos = new FieldPosition(0);
            StringBuffer newStr = formatter.format(sqq, strBuf, fPos);


            System.out.println(strBuf);

            //rwglstatisicdao.setBLRY_DM("24401020322");
            rwglstatisicdao.setSWJG_DM("24401020014");
            rwglstatisicdao.setSQQ(sqq);
            rwglstatisicdao.setSQZ(sqz);

            //获得统计汇总
            rwglstatisicdao.getStatisicCollect();

            //获得统计明细
            List list = rwglstatisicdao.getStatisicList();

            rwglstatisicdao.getRWZS();
            rwglstatisicdao.getYWCRWS();
            rwglstatisicdao.getWWCRWS();

        }catch(Exception e) {
            e.printStackTrace();
            throw new Exception(e.getMessage());
        }
    }

    public String getStrSqq() {
        strSqq = DateToString(SQQ);
        return strSqq;
    }

    public String getStrSqz() {
        strSqz = DateToString(SQZ);
        return strSqz;
    }

    public String getStrWcsj() {
        strWcsj = DateToString(WC_SJ);
        return strWcsj;
    }

    public String getStrXdsj() {
        strXdsj = DateToString(XD_SJ);
        return strXdsj;
    }

    public String getNSRNBM() {
        return NSRNBM;
    }

    public String getNSRBM() {
        return NSRBM;
    }

    public void setStrSqq(String strSqq) {
        this.strSqq = strSqq;
    }

    public void setStrSqz(String strSqz) {
        this.strSqz = strSqz;
    }

    public void setStrWcsj(String strWcsj) {
        this.strWcsj = strWcsj;
    }

    public void setStrXdsj(String strXdsj) {
        this.strXdsj = strXdsj;
    }

    public void setNSRNBM(String NSRNBM) {
        this.NSRNBM = NSRNBM;
    }

    public void setNSRBM(String NSRBM) {
        this.NSRBM = NSRBM;
    }


    //将时间转化成字符串
    public String DateToString(Date date) {
        try {
            SimpleDateFormat formatter
                    = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
            StringBuffer strBuf = new StringBuffer();
            FieldPosition fPos = new FieldPosition(0);
            StringBuffer newStr = formatter.format(date, strBuf, fPos);
            return newStr.toString();
        } catch (Exception e) {
            return "";
        }
    }
    //将时间转化成字符串
    public String DateToString(Date date, String format) {
        try {
            SimpleDateFormat formatter
                    = new SimpleDateFormat(format);
            StringBuffer strBuf = new StringBuffer();
            FieldPosition fPos = new FieldPosition(0);
            StringBuffer newStr = formatter.format(date, strBuf, fPos);
            return newStr.toString();
        } catch (Exception e) {
            return "";
        }
    }


    //将字符串转化为时间
    public Date StringToDate(String str) {
        Date date = null;
        try {
            SimpleDateFormat formatter
                    = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
            ParsePosition pos = new ParsePosition(0);
            date = formatter.parse(str, pos);
        } catch(Exception e) {
            return date;
        }
        return date;
    }

    //将字符串转化为时间
    public Date StringToDate(String str, String format) {
        Date date = null;
        try {
            SimpleDateFormat formatter
                    = new SimpleDateFormat(format);
            ParsePosition pos = new ParsePosition(0);
            date = formatter.parse(str, pos);
        } catch(Exception e) {
            return date;
        }
        return date;
    }

    private void jbInit() throws Exception {
    }


}

⌨️ 快捷键说明

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