| | |
| | | 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; |
| | |
| | | @Resource |
| | | private AppUserCarClient appUserCarClient; |
| | | |
| | | |
| | | @Autowired |
| | | public TApplyChargingPileController(TApplyChargingPileService applyChargingPileService, TokenService tokenService, RedisService redisService) { |
| | | this.applyChargingPileService = applyChargingPileService; |
| | |
| | | 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") |
| | |
| | | |
| | | 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) { |
| | |
| | | .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) |
| | |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/chargeBill/download"}, logical = Logical.OR) |
| | | @ApiOperation(value = "下载-已出账", tags = {"管理后台-充电算账单"}) |
| | | @PutMapping("/downloadBill") |
| | | @Log(title = "【充电算账单】下载算账单", businessType = BusinessType.EXPORT) |
| | |
| | | ChargingListQuery chargingListQuery = new ChargingListQuery(); |
| | | chargingListQuery.setUid(uid.getUid()); |
| | | chargingListQuery.setPageCurr(1); |
| | | chargingListQuery.setPageSize(99999); |
| | | chargingListQuery.setPageSize(9999999); |
| | | ChargingBillVO data = chargingOrderClient.chargingBillListR(chargingListQuery).getData(); |
| | | |
| | | List<ChargingBillVO> chargingBillVOS = new ArrayList<>(); |
| | |
| | | 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导出失败!"); |
| | | } |
| | |
| | | try (ExcelWriter excelWriter = excelWriterBuilder.withTemplate(stream).build()) { |
| | | WriteSheet writeSheet = EasyExcel.writerSheet().build(); |
| | | FillConfig fillConfig = FillConfig.builder().direction(WriteDirectionEnum.HORIZONTAL).build(); |
| | | FillConfig fillConfig2 = FillConfig.builder().direction(WriteDirectionEnum.VERTICAL).build(); |
| | | excelWriter.fill(new FillWrapper("data1", chargingBillVOS), fillConfig, writeSheet); |
| | | excelWriter.fill(new FillWrapper("data2", data.getExportList()), fillConfig, writeSheet); |
| | | excelWriter.fill(new FillWrapper("data2", data.getExportList()), fillConfig2, writeSheet); |
| | | excelWriter.finish(); |
| | | } catch (Exception e) { |
| | | return R.fail("excel导出失败!"); |
| | |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/accountSettlementStatement/download"}, logical = Logical.OR) |
| | | @ApiOperation(value = "下载", tags = {"管理后台-账户结算账单"}) |
| | | @PutMapping("/downloadAccount") |
| | | @Log(title = "【账户结算账单】下载账单", businessType = BusinessType.EXPORT) |
| | |
| | | { dto.setPageCurr(1); |
| | | dto.setPageSize(99999999); |
| | | AccountListVO data = orderClient.accountBillList(dto).getData(); |
| | | List<TChargingOrder> collect = data.getOrderList().stream().distinct().collect(Collectors.toList()); |
| | | int i = 1; |
| | | BigDecimal bigDecimal = new BigDecimal("0"); |
| | | |
| | | for (TChargingOrder chargingOrder : collect) { |
| | | bigDecimal = bigDecimal.add(chargingOrder.getRefundAmount()); |
| | | if (chargingOrder.getRechargePaymentType()!=null){ |
| | | switch (chargingOrder.getRechargePaymentType()){ |
| | | case 1: |
| | | chargingOrder.setPayPlatform("微信"); |
| | | chargingOrder.setRechargePaymentType1("微信小程序支付"); |
| | | break; |
| | | case 2: |
| | | chargingOrder.setPayPlatform("支付宝"); |
| | | chargingOrder.setRechargePaymentType1("支付宝小程序支付"); |
| | | break; |
| | | } |
| | | } |
| | | chargingOrder.setXuhao(i); |
| | | i++; |
| | | } |
| | | collect.get(0).setTotal(bigDecimal); |
| | | try { |
| | | response.setCharacterEncoding(Constants.UTF8); |
| | | response.setContentType("application/vnd.ms-excel"); |
| | |
| | | try (ExcelWriter excelWriter = excelWriterBuilder.withTemplate(stream).build()) { |
| | | WriteSheet writeSheet = EasyExcel.writerSheet().build(); |
| | | FillConfig fillConfig = FillConfig.builder().direction(WriteDirectionEnum.VERTICAL).build(); |
| | | excelWriter.fill(new FillWrapper("data1", data.getList().getRecords()), fillConfig, writeSheet); |
| | | excelWriter.fill(new FillWrapper("data1", collect), fillConfig, writeSheet); |
| | | excelWriter.finish(); |
| | | } catch (Exception e) { |
| | | return R.fail("excel导出失败!"); |
| | |
| | | } |
| | | 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"); |
| | |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | |
| | | @Resource |
| | | private OtherClient otherClient; |
| | | @Resource |
| | |
| | | settlementExportVO.setVehicleBrand(data5.get(0).getVehicleBrand()); |
| | | } |
| | | |
| | | }else{ |
| | | settlementExportVO.setLicensePlate(chargingOrder.getPlateNum()); |
| | | } |
| | | settlementExportVO.setSiteCode(data3.get(0).getCode()); |
| | | settlementExportVO.setSiteName(data3.get(0).getName()); |
| | |
| | | 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("否"); |
| | |
| | | @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); |
| | | chargingListQuery.setPageSize(9999999); |
| | | ChargingBillVO data = chargingOrderClient.chargingBillListR(chargingListQuery).getData(); |
| | | |
| | | List<ChargingBillVO> chargingBillVOS = new ArrayList<>(); |
| | |
| | | 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导出失败!"); |
| | | } |
| | |
| | | ); |
| | | 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) |
| | |
| | | applyChargingPileService.updateById(byId); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | @RequiresPermissions(value = {"/pileApplication/del"}, logical = Logical.OR) |
| | | @ApiOperation(tags = {"后台-申请表单-申请建桩"},value = "删除") |
| | | @DeleteMapping(value = "/remark") |
| | | @Log(title = "【申请建桩】删除建桩申请", businessType = BusinessType.DELETE) |