// 在入库明细表中查询不等于变更类型4的记录
  public List<Map<String, String>> getNoFour(String confrimNo) {
    List<Map<String, String>> listMap = null;
    Map<String, String> map = null;
    PreparedStatement pre = null;
    ResultSet rs = null;
    Connection conn = null;
    String sql = SqlText.R_08_RKMX_004;
    try {
      conn = DBConnPool.getConnection();
      pre = conn.prepareStatement(sql);
      pre.setString(1, confrimNo);
      rs = pre.executeQuery();
      if (rs.next()) {
        listMap = new ArrayList<Map<String, String>>();
        map = new HashMap<String, String>();
        map.put("TAXQUERYNO", rs.getString("TAXQUERYNO")); // 交易码
        map.put("TAXCONFIRMNO", rs.getString("TAXCONFIRMNO")); // 确认码
        map.put("DECLAREDSTATUS", rs.getString("PLATFORMSTATE")); // 平台状态
        map.put("TAXAMOUNT_FLAG", rs.getString("TAXAMOUNT_FLAG")); // 合计金额标志
        map.put("ANNUALTAXDUE", String.valueOf(rs.getDouble("ANNUALTAXDUE"))); // 本年车船税金额
        map.put("SUMTAXDEFAULT", String.valueOf(rs.getDouble("SUMTAXDEFAULT"))); // 合计欠税
        map.put("SUMOVERDUE", String.valueOf(rs.getDouble("SUMOVERDUE"))); // 合计滞纳金
        map.put("SUMTAX", String.valueOf(rs.getDouble("SUMTAX"))); // 合计
        map.put("CALCTAXFLAG", rs.getString("COUNTTAXTYPE")); // 算税标志
        map.put("CHANGETYPE", rs.getString("CHANGETYPE")); // 变更类型
        map.put("TOTALAMOUNT", String.valueOf(rs.getDouble("TOTALAMOUNT"))); // 合计金额
        map.put("TAXDUE", String.valueOf(rs.getDouble("TAXDUE"))); // 当期应交
        map.put("TSBZ", rs.getString("TSBZ")); // 退税标志
        listMap.add(map);
      }
    } catch (SQLException e) {
      e.printStackTrace();
    } catch (NoFreeConnectionException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    } finally {
      try {
        if (rs != null) {
          rs.close();
        }
        if (pre != null) {
          pre.close();
        }
        ConnectDBBean.closeConnection(
            ReadWriteDBPool.readPool, conn); //  因关闭方式有问题  需要原来的关闭方式进行连接的关闭  mili 2015-3-20 16:34:57
        //				if (conn != null) {
        //					conn.close();
        //				}

      } catch (SQLException e) {
        e.printStackTrace();
      } catch (NoFreeConnectionException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      }
    }

    return listMap;
  }
  // 从入库明细获取车船税信息
  public Tax_Type getTaxInfo(String confirmNo) {
    PreparedStatement pre = null;
    Tax_Type TaxInfo = null;
    ResultSet rs = null;
    Connection conn = null;
    String sql = SqlText.R_08_RKMX_006;
    ;
    try {
      conn = DBConnPool.getConnection();
      pre = conn.prepareStatement(sql);
      pre.setString(1, confirmNo);
      rs = pre.executeQuery();
      if (rs.next()) {
        TaxInfo = new Tax_Type();
        TaxInfo.setTaxTermTypeCode("08"); // // 税种类型代码,Y
        TaxInfo.setTaxConditionCode(rs.getString("taxConditionCode")); // 纳税类型代码,Y
        TaxInfo.setTaxPayerIdentificationCode(rs.getString("TAXPAYERIDENTIFICATIONCODE")); // 纳税人识别号
        TaxInfo.setTaxPayerName(rs.getString("TAXPAYERNAME")); // 纳税人名称
        TaxInfo.setTaxRegistryNumber(rs.getString("TAXREGISTRYNUMBER")); // 税务登记证号
        TaxInfo.setPayCompanyCode(rs.getString("PAYCOMPANYCODE")); // 代收公司
        TaxInfo.setCurrentTaxDue(getAnnualTaxType(conn, confirmNo)); // 本年的纳税对象
        AnnualTax_Type[] delinquent = new AnnualTax_Type[0]; // 欠税信息对象
        TaxInfo.setDelinquentTaxDue(delinquent); // 欠税信息数组
      }
    } catch (SQLException e) {
      e.printStackTrace();
    } catch (NoFreeConnectionException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    } finally {
      try {
        if (rs != null) {
          rs.close();
        }
        if (pre != null) {
          pre.close();
        }
        ConnectDBBean.closeConnection(
            ReadWriteDBPool.readPool, conn); //  因关闭方式有问题  需要原来的关闭方式进行连接的关闭  mili 2015-3-20 16:34:57
        //				if (conn != null) {
        //					conn.close();
        //				}

      } catch (SQLException e) {
        e.printStackTrace();
      } catch (NoFreeConnectionException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      }
    }

    return TaxInfo;
  }
Example #3
0
  // 验证登录用户是否存在
  public User ChkUser(String userName, String passWord) {

    PreparedStatement pstmt = null;
    ResultSet rs = null;
    Connection conn = null;
    try {
      conn = DBConnPool.getConnection();
    } catch (NoFreeConnectionException e1) {
      // TODO Auto-generated catch block
      e1.printStackTrace();
    }
    User user = null;
    String sql = "select t.*, t.rowid from syjk_ccs_user t where t.username=? and t.password=?";

    try {
      pstmt = conn.prepareStatement(sql);
      pstmt.setString(1, userName);
      pstmt.setString(2, passWord);
      rs = pstmt.executeQuery();
      if (rs.next()) {
        user = new User();
        user.setUserName(rs.getString("userName"));
        user.setPassWord(rs.getString("passWord"));
        user.setMenujson(rs.getString("menujson"));
      }
    } catch (Exception e) {
      e.printStackTrace();
    } finally {
      try {
        if (rs != null) {
          rs.close();
        }
        if (pstmt != null) {
          pstmt.close();
        }
        ConnectDBBean.closeConnection(
            ReadWriteDBPool.readPool, conn); //  因关闭方式有问题  需要原来的关闭方式进行连接的关闭  mili 2015-3-20 16:34:57
        //				if(conn != null){
        //					conn.close();
        //				}
      } catch (Exception e) {
        e.printStackTrace();
      }
    }

    return user;
  }
  // 从入库明细中获取合计欠税金额
  public Map<String, String> getSUMTAXDEFAULT(String confirmNo) {
    Map<String, String> map = null;
    PreparedStatement pre = null;
    ResultSet rs = null;
    Connection conn = null;
    try {
      conn = DBConnPool.getConnection();
      String sql = SqlText.R_08_RKMX_008;
      pre = conn.prepareStatement(sql);
      pre.setString(1, confirmNo);
      rs = pre.executeQuery();
      while (rs.next()) {
        map = new HashMap<String, String>();
        map.put("SUMTAXDEFAULT", String.valueOf(rs.getDouble("SUMTAXDEFAULT")));
        map.put("SUMOVERDUE", String.valueOf(rs.getDouble("SUMOVERDUE")));
      }
    } catch (SQLException e) {
      e.printStackTrace();
    } catch (NoFreeConnectionException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    } finally {
      try {
        if (rs != null) {
          rs.close();
        }
        if (pre != null) {
          pre.close();
        }
        ConnectDBBean.closeConnection(
            ReadWriteDBPool.readPool, conn); //  因关闭方式有问题  需要原来的关闭方式进行连接的关闭  mili 2015-3-20 16:34:57
        //				if (conn != null) {
        //					conn.close();
        //				}

      } catch (SQLException e) {
        e.printStackTrace();
      } catch (NoFreeConnectionException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      }
    }
    return map;
  }
  // 看有没有欠税信息
  public List<AnnualTax_Type> getQS(String taxConfirmNo) {

    PreparedStatement pre = null;
    ResultSet rs = null;
    Connection conn = null;
    List<AnnualTax_Type> list = new ArrayList<AnnualTax_Type>();
    AnnualTax_Type delinquentTaxDue = null;

    try {
      conn = DBConnPool.getConnection();
      String sql = SqlText.C_08_rkmx_qs_001;
      pre = conn.prepareStatement(sql);
      pre.setString(1, taxConfirmNo);
      rs = pre.executeQuery();
      while (rs.next()) {
        delinquentTaxDue = new AnnualTax_Type();
        delinquentTaxDue.setAnnualTaxAmount(rs.getDouble("ANNUALTAXAMOUNT")); // 当期年单位税额
        delinquentTaxDue.setTaxLocationCode(rs.getString("TAXLOCATIONCODE")); // 纳税地区代码
        delinquentTaxDue.setTaxStartDate(
            DateUtil.getStringDate(rs.getDate("TAXSTARTDATE"), "yyyy-MM-dd")); // 税款所属始期
        delinquentTaxDue.setTaxEndDate(
            DateUtil.getStringDate(rs.getDate("TAXENDDATE"), "yyyy-MM-dd")); // 税款所属止期
        delinquentTaxDue.setTaxUnitTypeCode(rs.getString("TAXUNITTYPECODE")); // 计税单位代码
        delinquentTaxDue.setUnitRate(rs.getDouble("UNITRATE")); // 单位计税金额
        delinquentTaxDue.setTaxDue(rs.getDouble("TAXDUE")); // 当期应纳税额
        delinquentTaxDue.setExceedDate(
            DateUtil.getStringDate(rs.getDate("EXCEEDDATE"), "yyyy-MM-dd")); // 逾期时间
        delinquentTaxDue.setExceedDaysCount(rs.getInt("EXCEEDDAYSCOUNT")); // 逾期天数
        delinquentTaxDue.setOverDue(rs.getDouble("OVERDUE")); // 滞纳金
        delinquentTaxDue.setTotalAmount(rs.getDouble("TOTALAMOUNT")); // 合计金额
        Derate_Type derate = new Derate_Type();
        ; // 适用减免税对象
        derate.setDeduction(rs.getDouble("DEDUCTION")); // 减免金额
        derate.setDeductionDueProportion(rs.getDouble("DEDUCTIONDUEPROPORTION")); // 减免比例
        derate.setDeductionDocumentNumber(rs.getString("DEDUCTIONDOCUMENTNUMBER")); // 减免税凭证号
        if ("C".equals(rs.getString("TAXCONDITIONCODE"))
            || "E".equals(rs.getString("TAXCONDITIONCODE"))) {
          derate.setDeduction(rs.getDouble("DEDUCTION")); // 减免金额
          derate.setDeductionDueProportion(rs.getDouble("DEDUCTIONDUEPROPORTION")); // 减免比例
          derate.setDeductionDocumentNumber(rs.getString("DEDUCTIONDOCUMENTNUMBER")); // 减免税凭证号
          derate.setDeductionDueCode(rs.getString("DEDUCTIONDUECODE")); // 减免税原因代码,Y
          derate.setDeductionDueType(rs.getString("DEDUCTIONDUETYPE")); // 减免税方案代码,Y
          derate.setTaxDepartmentCode(
              rs.getString("DEDUCTIONDEPARTMENTCODE")); // 开具减免(完)税凭证的税务机关代码,Y
          derate.setTaxDepartment(rs.getString("DEDUCTIONDEPARTMENT")); // 开具减免(完)税凭证的税务机关名称,Y
        }
        list.add(delinquentTaxDue);
      }
    } catch (SQLException e) {
      e.printStackTrace();
    } catch (NoFreeConnectionException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    } finally {
      try {
        if (rs != null) {
          rs.close();
        }
        if (pre != null) {
          pre.close();
        }
        ConnectDBBean.closeConnection(
            ReadWriteDBPool.readPool, conn); //  因关闭方式有问题  需要原来的关闭方式进行连接的关闭  mili 2015-3-20 16:34:57
        //				if (conn != null) {
        //					conn.close();
        //				}
      } catch (SQLException e) {
        e.printStackTrace();
      } catch (NoFreeConnectionException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      }
    }

    return list;
  }
  // 取得纳税信息
  public List<Map<Object, Object>> getRKMX(
      TaxPayQueryReqInfo taxPayQueryReqInfo, String sql, String falg) {
    List<Map<Object, Object>> list_map = new ArrayList<Map<Object, Object>>();
    PreparedStatement pre = null;
    ResultSet rs = null;
    Connection conn = null;
    Map<Object, Object> map = null;
    try {
      conn = DBConnPool.getConnection();
      pre = conn.prepareStatement(sql);
      if ("1".equals(falg)) {
        pre.setString(1, taxPayQueryReqInfo.getVehicleInfo().getVIN());
        pre.setString(2, taxPayQueryReqInfo.getVehicleInfo().getLicensePlateNo());
        pre.setString(3, taxPayQueryReqInfo.getVehicleInfo().getEngineNo());
      } else if ("2".equals(falg)) {
        pre.setString(1, taxPayQueryReqInfo.getVehicleInfo().getVIN());
        pre.setString(2, taxPayQueryReqInfo.getVehicleInfo().getLicensePlateNo());
        pre.setString(3, taxPayQueryReqInfo.getVehicleInfo().getLicensePlateType());

      } else if ("3".equals(falg)) {
        pre.setString(1, taxPayQueryReqInfo.getVehicleInfo().getVIN());
        pre.setString(2, taxPayQueryReqInfo.getVehicleInfo().getEngineNo());
      } else {
        pre.setString(1, taxPayQueryReqInfo.getVehicleInfo().getVIN());
      }

      rs = pre.executeQuery();
      while (rs.next()) {
        map = new HashMap<Object, Object>();
        map.put("DECLAREDSTATUS", rs.getString("PLATFORMSTATE")); // 纳税状态/ 0=代收// 1=申报(完税)4=拒缴
        map.put("CALCTAXFLAG", rs.getString("COUNTTAXTYPE")); // 算税标志
        map.put("TaxTermTypeCode", "08"); // 税种类型代码
        map.put("TAXCONDITIONCODE", rs.getString("TAXCONDITIONCODE")); // 纳税类型代码
        map.put("TAXREGISTRYNUMBER", rs.getString("TAXREGISTRYNUMBER")); // 税务登记证号
        map.put("TAXPAYERNAME", rs.getString("TAXPAYERNAME")); // 纳税人名称
        map.put("TAXPAYERIDENTIFICATIONCODE", rs.getString("TAXPAYERIDENTIFICATIONCODE")); // 纳税人识别号
        map.put(
            "SJCJRQ",
            rs.getDate("SJCJRQ")); // 代收日期     mili 2014-12-23 16:11:16  代收日期 给 数据采集日期 中科软 截取时不正确
        map.put("PAYCOMPANYCODE", rs.getString("PAYCOMPANYCODE")); // 代收公司
        map.put("TAXLOCATIONCODE", rs.getString("TAXLOCATIONCODE")); // 纳税地区代码
        map.put("TAXSTARTDATE", rs.getString("TAXSTARTDATE").substring(0, 10)); // 税款所属始期
        map.put("TAXENDDATE", rs.getString("TAXENDDATE").substring(0, 10)); // 税款所属止期
        map.put("TAXUNITTYPECODE", rs.getString("TAXUNITTYPECODE")); // 计税单位代码
        map.put("UNITRATE", rs.getDouble("UNITRATE")); // 单位计税金额
        map.put("ANNUALTAXAMOUNT", rs.getDouble("ANNUALTAXAMOUNT")); // 当期年单位税额
        map.put("TAXDUE", rs.getDouble("TAXDUE")); // 当期应纳税额
        map.put("EXCEEDDATE", rs.getString("EXCEEDDATE")); // 逾期时间
        map.put("EXCEEDDAYSCOUNT", rs.getInt("EXCEEDDAYSCOUNT")); // 逾期天数
        map.put("OVERDUE", rs.getDouble("OVERDUE")); // 滞纳金
        map.put("TOTALAMOUNT", rs.getDouble("TOTALAMOUNT")); // 合计金额
        map.put("SPECIALCARTYPE", rs.getString("SPECIALCARTYPE")); // 特殊车标志
        // 适用完税对象 Paid
        if ("P".equals(rs.getString("TAXCONDITIONCODE")) == true) {
          map.put("TAXDEPARTMENT", rs.getString("TAXDEPARTMENT")); // 开具减免(完)税凭证的税务机关名称,Y
          map.put("TAXDEPARTMENTCODE", rs.getString("TAXDEPARTMENTCODE")); // 开具减免(完)税凭证的税务机关代码,Y
          map.put("TAXDOCUMENTNUMBER", rs.getString("TAXDOCUMENTNUMBER")); // 完税凭证号码
        } else {
          map.put("TAXDEPARTMENT", ""); // 开具减免(完)税凭证的税务机关名称,Y
          map.put("TAXDEPARTMENTCODE", ""); // 开具减免(完)税凭证的税务机关代码,Y
          map.put("TAXDOCUMENTNUMBER", ""); // 完税凭证号码
        }
        // ***************适用减免税对像*****************

        map.put("DEDUCTION", rs.getDouble("DEDUCTION")); // 减免金额
        map.put("DEDUCTIONDUEPROPORTION", rs.getDouble("DEDUCTIONDUEPROPORTION")); // 减免比例
        if ("C".equals(rs.getString("TAXCONDITIONCODE"))
            || "E".equals(rs.getString("TAXCONDITIONCODE"))) {
          map.put("DEDUCTIONDUECODE", rs.getString("DEDUCTIONDUECODE")); // 减免税原因代码,Y
          map.put("DEDUCTIONDUETYPE", rs.getString("DEDUCTIONDUETYPE")); // 减免税方案代码,Y
          map.put("DEDUCTIONDOCUMENTNUMBER", rs.getString("DEDUCTIONDOCUMENTNUMBER")); // 减免税凭证号
          map.put(
              "DEDUCTIONDEPARTMENT", rs.getString("DEDUCTIONDEPARTMENT")); // 开具减免(完)税凭证的税务机关名称,Y
          map.put(
              "DEDUCTIONDEPARTMENTCODE",
              rs.getString("DEDUCTIONDEPARTMENTCODE")); // 开具减免(完)税凭证的税务机关代码,Y
        } else {
          map.put("DEDUCTIONDOCUMENTNUMBER", ""); // 减免税凭证号
          map.put("DEDUCTIONDEPARTMENT", ""); // 开具减免(完)税凭证的税务机关名称,Y
          map.put("DEDUCTIONDEPARTMENTCODE", ""); // 开具减免(完)税凭证的税务机关代码,Y
        }
        // 车船税合计金额 TaxAmount
        // 车船税交易码,用于对账服务
        map.put("TAXDEALCODE", rs.getString("TAXQUERYNO")); // 交易码
        map.put("TAXCONFIRMNO", rs.getString("TAXCONFIRMNO")); // 确认码
        map.put("TAXAMOUNT_FLAG", rs.getString("TAXAMOUNT_FLAG")); // 合计金额标志
        map.put("ANNUALTAXDUE", rs.getDouble("ANNUALTAXDUE")); // 本年车船税金额
        map.put("SUMTAXDEFAULT", rs.getDouble("SUMTAXDEFAULT")); // 合计欠税
        map.put("SUMOVERDUE", rs.getDouble("SUMOVERDUE")); // 合计滞纳金
        map.put("SumTax", rs.getDouble("SumTax")); // 合计金额
        map.put("PAYDATE", rs.getString("PAYDATE")); // 所属年度
        list_map.add(map);
      }
    } catch (SQLException e) {
      e.printStackTrace();
    } catch (NoFreeConnectionException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    } finally {
      try {
        if (rs != null) {
          rs.close();
        }
        if (pre != null) {
          pre.close();
        }
        ConnectDBBean.closeConnection(
            ReadWriteDBPool.readPool, conn); //  因关闭方式有问题  需要原来的关闭方式进行连接的关闭  mili 2015-3-20 16:34:57
        //				if (conn != null) {
        //					conn.close();
        //				}
      } catch (SQLException e) {
        e.printStackTrace();
      } catch (NoFreeConnectionException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      }
    }

    return list_map;
  }
  // 根据单一条件到入库明细表中查询纳税信息
  public List<Map<String, String>> getCondition(
      TaxPayQueryReqInfo taxPayQueryReqInfo, String sql, String flag) {
    List<Map<String, String>> listMap = null;
    PreparedStatement pre = null;
    ResultSet rs = null;
    Connection conn = null;
    Map<String, String> map = null;
    try {
      conn = DBConnPool.getConnection();
      pre = conn.prepareStatement(sql);
      pre.setString(1, taxPayQueryReqInfo.getVehicleInfo().getVIN());
      if (flag.equals("2")) {
        pre.setString(2, taxPayQueryReqInfo.getVehicleInfo().getLicensePlateNo());
        pre.setString(3, taxPayQueryReqInfo.getVehicleInfo().getLicensePlateType());
      }
      rs = pre.executeQuery();
      while (rs.next()) {
        if (listMap == null) {
          listMap = new ArrayList<Map<String, String>>();
        }
        map = new HashMap<String, String>();
        map.put("TAXQUERYNO", rs.getString("TAXQUERYNO")); // 车船税交易码
        map.put("TAXCONFIRMNO", rs.getString("TAXCONFIRMNO")); // 确认码
        map.put("DECLAREDSTATUS", rs.getString("PLATFORMSTATE")); // 平台状态/ 0=代收// 1=申报(完税)4=拒缴
        map.put("TAXAMOUNT_FLAG", rs.getString("TAXAMOUNT_FLAG")); // 合计金额标志码
        map.put("ANNUALTAXDUE", String.valueOf(rs.getDouble("ANNUALTAXDUE"))); // 本年车船税金额
        map.put("SUMTAXDEFAULT", String.valueOf(rs.getDouble("SUMTAXDEFAULT"))); // 合计欠税金额
        map.put("SUMOVERDUE", String.valueOf(rs.getDouble("SUMOVERDUE"))); // 合计滞纳金
        map.put("SUMTAX", String.valueOf(rs.getDouble("SUMTAX"))); // 合计金额
        map.put("CALCTAXFLAG", rs.getString("COUNTTAXTYPE")); // 变更类型// 0=确认// 4=退保,2=批改
        map.put("CHANGETYPE", rs.getString("CHANGETYPE")); // 变更类型 0=确认// 4=退保,2=批改
        map.put("TSBZ", rs.getString("TSBZ")); // 退税标志
        listMap.add(map);
      }
    } catch (SQLException e) {
      e.printStackTrace();
    } catch (NoFreeConnectionException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    } finally {
      try {
        if (rs != null) {
          rs.close();
        }
        if (pre != null) {
          pre.close();
        }
        ConnectDBBean.closeConnection(
            ReadWriteDBPool.readPool, conn); //  因关闭方式有问题  需要原来的关闭方式进行连接的关闭  mili 2015-3-20 16:34:57
        //				if (conn != null) {
        //					conn.close();
        //				}
      } catch (SQLException e) {
        e.printStackTrace();
      } catch (NoFreeConnectionException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      }
    }

    return listMap;
  }