| | |
| | | @ApiOperation(value = "下载-已出账", tags = {"管理后台-充电算账单"}) |
| | | @PutMapping("/downloadBill") |
| | | @Log(title = "【充电算账单】下载算账单", businessType = BusinessType.EXPORT) |
| | | public R downloadBill(@RequestBody String uid, HttpServletResponse response) |
| | | public R downloadBill(@RequestBody ExportUidDto uid, HttpServletResponse response) |
| | | { |
| | | ChargingListQuery chargingListQuery = new ChargingListQuery(); |
| | | chargingListQuery.setUid(uid); |
| | | chargingListQuery.setUid(uid.getUid()); |
| | | chargingListQuery.setPageCurr(1); |
| | | chargingListQuery.setPageSize(99999); |
| | | ChargingBillVO data = chargingOrderClient.chargingBillListR(chargingListQuery).getData(); |
| | |
| | | response.setContentType("application/vnd.ms-excel"); |
| | | response.setHeader("Access-Control-Expose-Headers", "Content-disposition"); |
| | | response.setHeader("Content-Disposition", "attachment;filename=" + |
| | | URLEncoder.encode("月账单-"+data.getCategory()+"-"+data.getBillWeek()+"-"+data.getSiteName(), CharEncoding.UTF_8) + ".xlsx"); |
| | | // URLEncoder.encode("月账单-"+data.getCategory()+"-"+data.getBillWeek()+"-"+data.getSiteName(), CharEncoding.UTF_8) + ".xlsx"); |
| | | URLEncoder.encode("月账单", CharEncoding.UTF_8) + ".xlsx"); |
| | | } catch (UnsupportedEncodingException e) { |
| | | return R.fail("excel导出失败!"); |
| | | } |
| | |
| | | BigDecimal bigDecimal = new BigDecimal("0"); |
| | | |
| | | for (TChargingOrder chargingOrder : collect) { |
| | | bigDecimal = bigDecimal.add(chargingOrder.getPaymentAmount()); |
| | | bigDecimal = bigDecimal.add(chargingOrder.getRefundAmount()); |
| | | if (chargingOrder.getRechargePaymentType()!=null){ |
| | | switch (chargingOrder.getRechargePaymentType()){ |
| | | case 1: |
| | |
| | | @ApiOperation(value = "下载-未出账", tags = {"管理后台-充电算账单"}) |
| | | @PutMapping("/download") |
| | | @Log(title = "【充电算账单】下载算账单", businessType = BusinessType.EXPORT) |
| | | public R download(String uid,HttpServletResponse response) |
| | | public R download(@RequestBody ExportUidDto uid,HttpServletResponse response) |
| | | { |
| | | ChargingListQuery chargingListQuery = new ChargingListQuery(); |
| | | chargingListQuery.setUid(uid); |
| | | chargingListQuery.setUid(uid.getUid()); |
| | | chargingListQuery.setPageCurr(1); |
| | | chargingListQuery.setPageSize(99999); |
| | | ChargingBillVO data = chargingOrderClient.chargingBillListR(chargingListQuery).getData(); |
| | |
| | | response.setContentType("application/vnd.ms-excel"); |
| | | response.setHeader("Access-Control-Expose-Headers", "Content-disposition"); |
| | | response.setHeader("Content-Disposition", "attachment;filename=" + |
| | | URLEncoder.encode("月账单-"+data.getCategory()+data.getBillWeek()+data.getSiteName(), CharEncoding.UTF_8) + ".xlsx"); |
| | | // URLEncoder.encode("月账单-"+data.getCategory()+data.getBillWeek()+data.getSiteName(), CharEncoding.UTF_8) + ".xlsx"); |
| | | URLEncoder.encode("月账单", CharEncoding.UTF_8) + ".xlsx"); |
| | | } catch (UnsupportedEncodingException e) { |
| | | return R.fail("excel导出失败!"); |
| | | } |