public void query(HttpServletRequest req, HttpServletResponse resp, String name) throws ServletException, IOException { int page = Integer.parseInt(req.getParameter("page")); int rows = Integer.parseInt(req.getParameter("rows")); int count = wlcs.getWTMD_Count(name); JSONObject jsonObj = new JSONObject(); JSONArray jsonArray = new JSONArray(); JSONObject json_Obj = null; List<SYJK_CCS_QGCLWTMDXX_TEMP> list_w = wlcs.getWTMD_W(page, rows, name); for (int i = 0; i < list_w.size(); i++) { json_Obj = new JSONObject(); SYJK_CCS_QGCLWTMDXX_TEMP wtmd = list_w.get(i); wtmd = WhiteList_Tool.Hanization(wtmd); json_Obj.put("R", i + 1); json_Obj.put("ID", wtmd.getID()); json_Obj.put("CLSBDM", wtmd.getCLSBDM()); json_Obj.put("SKSSSQ", DateUtil.getStringDate(wtmd.getSKSSSQ(), null)); json_Obj.put("SKSSZQ", DateUtil.getStringDate(wtmd.getSKSSZQ(), null)); json_Obj.put("DQYNSE", wtmd.getDQYNSE()); json_Obj.put("REVENUECODE", wtmd.getREVENUECODE()); json_Obj.put("WS", wtmd.getWSPZ()); json_Obj.put("YCYYDM", wtmd.getYCYYDM()); jsonArray.add(json_Obj); } jsonObj.put("total", count); jsonObj.put("rows", jsonArray); ResponseUtil.write(resp, jsonObj); System.out.println(jsonArray); }
/** 封装问题名单临时表数据 */ public SYJK_CCS_QGCLWTMDXX_TEMP getWDMI(Map<String, String> map) { SYJK_CCS_QGCLWTMDXX_TEMP wtmd = new SYJK_CCS_QGCLWTMDXX_TEMP(); // String name = req.getParameter("img"); // System.out.println(name); wtmd.setCLSBDM(map.get("CLSBDM")); String ycyy = map.get("ycyy") == null ? "W" : map.get("ycyy"); String jc1 = map.get("jc1") == null ? "" : map.get("jc1"); String jc2 = map.get("jc2") == null ? "" : map.get("jc2"); String cphm = map.get("cphm") == null ? "" : map.get("cphm"); String hphm = ""; if (jc1 != null && !"".equals(jc1) && jc2 != null && !"".equals(jc2) && cphm != null && !"".equals(cphm)) { hphm = jc1 + jc2 + cphm; } wtmd.setYCYYDM(ycyy); wtmd.setHPHM(hphm); wtmd.setHPZL(map.get("HPZL").trim()); wtmd.setCLZL(map.get("CLZL").trim()); wtmd.setFDJH(map.get("FDJH").trim()); wtmd.setZCCMC(map.get("ZCCMC").trim()); String syxz = map.get("SYXZ") == null ? "" : map.get("SYXZ"); wtmd.setSYXZ(syxz); wtmd.setCLXH(map.get("CLXH").trim()); // String CLCSDJRQ = req.getParameter("CLCSDJRQ").trim(); Date CLCSDJRQ = null; if (map.get("CLCSDJRQ") != null && !"".equals(map.get("CLCSDJRQ"))) { CLCSDJRQ = DateUtil.getStringDate(WhiteList_Tool.Date_format(map.get("CLCSDJRQ")), null); } wtmd.setCLCSDJRQ(CLCSDJRQ); wtmd.setJGCLLX(map.get("JGCLLX").trim()); String HDZKS = map.get("HDZKS").trim(); if ("".equals(HDZKS)) { wtmd.setHDZKS(null); } else { wtmd.setHDZKS(Double.valueOf(HDZKS)); } String HDZZL = map.get("HDZZL").trim(); if ("".equals(HDZZL)) { wtmd.setHDZZL(null); } else { wtmd.setHDZZL(Double.valueOf(HDZZL)); } String ZBZL = map.get("ZBZL").trim(); if ("".equals(ZBZL)) { wtmd.setZBZL(null); } else { wtmd.setZBZL(Double.valueOf(ZBZL)); } String PL = map.get("PL").trim(); if ("".equals(PL)) { wtmd.setPL(null); } else { wtmd.setPL(Double.valueOf(PL)); } String GL = map.get("GL").trim(); if ("".equals(GL)) { wtmd.setGL(null); } else { wtmd.setGL(Double.valueOf(GL)); } Date SKSSSQ = null; Date SKSSZQ = null; String DQYNSE = null; if (!ycyy.equals("W")) { // 非白名单的处理 SKSSSQ = DateUtil.getStringDate(WhiteList_Tool.Date_format(map.get("SKSSSQ_W")), null); SKSSZQ = DateUtil.getStringDate( WhiteList_Tool.Date_format(map.get("SKSSSQ_W")).substring(0, 4) + "-12-31", null); DQYNSE = map.get("DQYNSE_W"); if (DQYNSE != null && !"".equals(DQYNSE)) { wtmd.setDQYNSE(Double.valueOf(DQYNSE)); wtmd.setDWJSJE(Double.valueOf(DQYNSE)); wtmd.setDQNDWSE(Double.valueOf(DQYNSE)); wtmd.setHEJE(Double.valueOf(DQYNSE)); } else { wtmd.setDQYNSE(0.0); } } else { // 白名单的处理 if (map.get("SKSSSQ") != null && !"".equals((map.get("SKSSSQ")))) { SKSSSQ = DateUtil.getStringDate(WhiteList_Tool.Date_format(map.get("SKSSSQ")), null); } if (map.get("SKSSZQ") != null && !"".equals((map.get("SKSSZQ")))) { SKSSZQ = DateUtil.getStringDate(WhiteList_Tool.Date_format(map.get("SKSSZQ")), null); } DQYNSE = map.get("DQYNSE"); if (DQYNSE != null && !"".equals(DQYNSE)) { wtmd.setDQYNSE(Double.valueOf(DQYNSE)); } else { wtmd.setDQYNSE(0.0); } } wtmd.setSKSSSQ(SKSSSQ); wtmd.setSKSSZQ(SKSSZQ); wtmd.setREVENUECODE(map.get("REVENUECODE")); wtmd.setWSPZ(map.get("WSPZ")); String WSPZNO = map.get("WSPZNO") == null ? "" : map.get("WSPZNO"); wtmd.setWSPZNO(WSPZNO); return wtmd; }
// 看有没有欠税信息 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; }