列表导出到excel

    /**
     * @方法名称 exportFncapply
     * @功能描述
     * 
     *         <pre>
     *       融资汇总导出
     *       </pre>
     * 
     * @作者 wrf
     * @创建时间 2019年2月21日 09:45:41
     * @param params
     * @return
     * @throws IOException
     */
    @RequestMapping(value = "/exportFncapply")
    public void exportExcel(QueryFncVO queryVo, HttpServletResponse response, HttpServletRequest request,String receiptCollectId) {
        String date = DateUtil.dateToString(new Date(), "yyyy-MM-dd");
        String fileName = "付款申请数据列表" + date + ".xls";
        try {
            response.reset();
            response.setContentType("application/octet-stream");
            response.setHeader("Content-Disposition",
                    "attachment; filename=" + (request.getHeader("User-Agent").toLowerCase().indexOf("firefox") > 0
                            ? new String(fileName.getBytes("utf-8"), "iso8859-1")
                            : URLEncoder.encode(fileName, "UTF-8")));
            List<List<Object>> allData = new ArrayList<List<Object>>();
            List<Object> head = new LinkedList<Object>();
            String[] heads = { "付款申请编号", "采购合同编号","项目名称", "验证单汇总编号", "供应商", "施工单位", "本次付款金额(元)", "申请日期", "服务费金额", "付款状态",
                    "供应商收款账户", "是否已回款", "回款金额","收款账户开户行" };
            head.addAll(Arrays.asList(heads));
            allData.add(head);
            List<Object> rowMeta;
            // 批量导出的数据中,仅包含平台审核通过,待放款的融资支付申请信息; 5 平台审核通过 FncStCd
            List<String> stList = new ArrayList<String>();
            stList.add("6");
            queryVo.setFnsStCdList(stList);
            PageInfo<FncResultVO> pg = fncApplyApi.findFncPage(queryVo, null);
            List<FncResultVO> pglist = pg.getList();
            for (FncResultVO fncResult : pglist) {
                rowMeta = new LinkedList<Object>();
                rowMeta.add(fncResult.getFncJrnlId());
                rowMeta.add(fncResult.getCtrId());
                rowMeta.add(fncResult.getProNm());
                rowMeta.add(fncResult.getReceiptCollectId());
                rowMeta.add(fncResult.getCstNm());
                rowMeta.add(fncResult.getPayCstNm());
                rowMeta.add(fncResult.getThsPayAmt());
                rowMeta.add(fncResult.getAplyDt());
                rowMeta.add(fncResult.getFee());
                String m_fncStCd = "";
                if (fncStCdArrCode[0].equals(fncResult.getFncStCd())) {
                    m_fncStCd = fncStCdArr[0];
                } else if (fncStCdArrCode[1].equals(fncResult.getFncStCd())) {
                    m_fncStCd = fncStCdArr[1];
                } else if (fncStCdArrCode[2].equals(fncResult.getFncStCd())) {
                    m_fncStCd = fncStCdArr[2];
                }else{
                    m_fncStCd = fncStCdArr[0];
                }
                
                rowMeta.add(m_fncStCd);
                rowMeta.add(fncResult.getReceivedFundNumber());
                String m_isPayment = "";

                if (isPaymentArrCode[0].equals(fncResult.getIsPayment())) {
                    m_isPayment = isPaymentArr[0];
                } else if (isPaymentArrCode[1].equals(fncResult.getIsPayment())) {
                    m_isPayment = isPaymentArr[1];
                }else{
                    m_isPayment = isPaymentArr[0];
                }
                
                rowMeta.add(m_isPayment);
                rowMeta.add(fncResult.getPaymentMoney());
                rowMeta.add(fncResult.getAccDepBnk());
                allData.add(rowMeta);
            }
            ExcelUtil_jxl.writeExcel(response.getOutputStream(), allData, "融资数据表");
            response.flushBuffer();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值