From c80c0184b6e560d41d5aa5691874e07b681fa18f Mon Sep 17 00:00:00 2001 From: Pu Zhibing <393733352@qq.com> Date: 星期五, 17 一月 2025 18:41:24 +0800 Subject: [PATCH] 修改bug --- ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TApplyChargingPileController.java | 55 ++++++++++++++++++++++++++++++++++++++++--------------- 1 files changed, 40 insertions(+), 15 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 f7461e9..ecf60cb 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 @@ -14,6 +14,9 @@ import com.ruoyi.common.core.utils.WebUtils; import com.ruoyi.common.core.web.domain.BasePojo; import com.ruoyi.common.core.web.page.PageInfo; +import com.ruoyi.common.security.utils.SecurityUtils; +import com.ruoyi.common.security.annotation.Logical; +import com.ruoyi.common.security.annotation.RequiresPermissions; import com.ruoyi.integration.api.feignClient.UploadRealTimeMonitoringDataClient; import com.ruoyi.integration.api.model.UploadRealTimeMonitoringData; import com.ruoyi.order.api.model.ExportUidDto; @@ -133,7 +136,9 @@ dto.setAppUserId(userId); return AjaxResult.ok(applyChargingPileService.save(dto)); } - + + + @RequiresPermissions(value = {"/pileApplication/add"}, logical = Logical.OR) @Log(title = "【申请建桩】添加建桩申请", businessType = BusinessType.INSERT) @ApiOperation(tags = {"后台-申请表单-申请建桩"},value = "建桩申请") @PostMapping(value = "/manage/add") @@ -141,7 +146,9 @@ return AjaxResult.ok(applyChargingPileService.save(dto)); } - + + + @RequiresPermissions(value = {"/pileApplication"}, logical = Logical.OR) @ApiOperation(tags = {"后台-申请表单-申请建桩"},value = "列表") @PostMapping(value = "/page") public AjaxResult<Page<TApplyChargingPile>> page(@RequestBody ApplyChargingQuery applyChargingQuery) { @@ -151,8 +158,9 @@ .page(Page.of(applyChargingQuery.getPageCurr(), applyChargingQuery.getPageSize())); return AjaxResult.ok(page); } - - + + + @RequiresPermissions(value = {"/pileApplication/export"}, logical = Logical.OR) @ApiOperation(tags = {"后台-申请表单-申请建桩"},value = "导出") @PutMapping(value = "/export") @Log(title = "【申请建桩】导出建桩申请列表", businessType = BusinessType.EXPORT) @@ -266,7 +274,9 @@ } return R.ok(); } - + + + @RequiresPermissions(value = {"/chargeBill/download"}, logical = Logical.OR) @ApiOperation(value = "下载-已出账", tags = {"管理后台-充电算账单"}) @PutMapping("/downloadBill") @Log(title = "【充电算账单】下载算账单", businessType = BusinessType.EXPORT) @@ -285,7 +295,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导出失败!"); } @@ -308,6 +319,10 @@ } return R.ok(); } + + + + @RequiresPermissions(value = {"/accountSettlementStatement/download"}, logical = Logical.OR) @ApiOperation(value = "下载", tags = {"管理后台-账户结算账单"}) @PutMapping("/downloadAccount") @Log(title = "【账户结算账单】下载账单", businessType = BusinessType.EXPORT) @@ -320,7 +335,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: @@ -364,15 +379,17 @@ } return R.ok(); } - + + + + @RequiresPermissions(value = {"/summarySettlement/export", "/balanceSheetRecord/download"}, logical = Logical.OR) @ApiOperation(value = "导出", tags = {"管理后台-结算汇总表"}) @PutMapping("/downloadSettlementTotal") @Log(title = "【结算汇总表】下载汇总表", businessType = BusinessType.EXPORT) public R downloadSettlementTotal(@RequestBody ExportUidDto uid,HttpServletResponse response) { - SettlementTotalVO data = chargingOrderClient.settlementTotalR(uid.getTime()).getData(); - - + Long userId = tokenService.getLoginUser().getUserid(); + SettlementTotalVO data = chargingOrderClient.settlementTotalR(uid.getTime(),userId).getData(); try { response.setCharacterEncoding(Constants.UTF8); response.setContentType("application/vnd.ms-excel"); @@ -391,7 +408,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导出失败!"); @@ -401,6 +418,9 @@ } return R.ok(); } + + + @Resource private OtherClient otherClient; @Resource @@ -656,7 +676,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导出失败!"); } @@ -687,14 +708,16 @@ ); return pattern.matcher(url).matches(); } - + + @RequiresPermissions(value = {"/pileApplication/select"}, logical = Logical.OR) @ApiOperation(tags = {"后台-申请表单-申请建桩"},value = "详情") @PostMapping(value = "/detail/{id}") public AjaxResult<TApplyChargingPile> detail(@PathVariable Integer id) { return AjaxResult.ok(applyChargingPileService.getById(id)); } - + + @RequiresPermissions(value = {"/pileApplication/remark"}, logical = Logical.OR) @ApiOperation(tags = {"后台-申请表单-申请建桩"},value = "修改备注") @PostMapping(value = "/remark") @Log(title = "【申请建桩】修改备注", businessType = BusinessType.UPDATE) @@ -704,6 +727,8 @@ applyChargingPileService.updateById(byId); return AjaxResult.success(); } + + @RequiresPermissions(value = {"/pileApplication/del"}, logical = Logical.OR) @ApiOperation(tags = {"后台-申请表单-申请建桩"},value = "删除") @DeleteMapping(value = "/remark") @Log(title = "【申请建桩】删除建桩申请", businessType = BusinessType.DELETE) -- Gitblit v1.7.1