From ffde30c0425e95bd25a026374598aa02ef41c7a0 Mon Sep 17 00:00:00 2001 From: puzhibing <393733352@qq.com> Date: 星期六, 02 十一月 2024 20:58:16 +0800 Subject: [PATCH] Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/mx_charging_pile --- ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TApplyChargingPileController.java | 26 ++++++++++++++++++-------- 1 files changed, 18 insertions(+), 8 deletions(-) diff --git a/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TApplyChargingPileController.java b/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TApplyChargingPileController.java index 49cbd46..a4ff143 100644 --- a/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TApplyChargingPileController.java +++ b/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TApplyChargingPileController.java @@ -285,7 +285,8 @@ 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导出失败!"); } @@ -320,7 +321,7 @@ 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: @@ -391,7 +392,7 @@ WriteSheet writeSheet = EasyExcel.writerSheet().build(); FillConfig fillConfig = FillConfig.builder().direction(WriteDirectionEnum.VERTICAL).build(); excelWriter.fill(new FillWrapper("data1", data.getList1()), fillConfig, writeSheet); - excelWriter.fill(new FillWrapper("data2", data.getList2()), fillConfig, writeSheet); +// excelWriter.fill(new FillWrapper("data2", data.getList2()), fillConfig, writeSheet); excelWriter.finish(); } catch (Exception e) { return R.fail("excel导出失败!"); @@ -547,9 +548,18 @@ if (chargingOrder.getCode()!=null){ List<UploadRealTimeMonitoringData> data6 = uploadRealTimeMonitoringDataClient.getDataByOrderCode(chargingOrder.getCode()).getData(); if (data6!=null && !data6.isEmpty()){ - // 第一条数据soc为开始 最后一条数据soc为结束soc - settlementExportVO.setStartSoc(data6.get(0).getSoc()+"%"); - settlementExportVO.setEndSoc(data6.get(data6.size()-1).getSoc()+"%"); + int min = 100; + int max = 0; + for (UploadRealTimeMonitoringData uploadRealTimeMonitoringData : data6) { + if (uploadRealTimeMonitoringData.getSoc()>max){ + max = uploadRealTimeMonitoringData.getSoc(); + } + if (uploadRealTimeMonitoringData.getSoc()!=0 &&uploadRealTimeMonitoringData.getSoc()<min){ + min = uploadRealTimeMonitoringData.getSoc(); + } + } + settlementExportVO.setEndSoc(max+""); + settlementExportVO.setStartSoc(min+""); } } settlementExportVO.setIsSoc("否"); @@ -632,10 +642,10 @@ @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(); -- Gitblit v1.7.1