xuhy
2024-11-01 11acaaf1e2e5e71dff57a788fb26b263bcd117b7
ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TApplyChargingPileController.java
@@ -101,6 +101,7 @@
    @Resource
    private AppUserCarClient appUserCarClient;
    @Autowired
    public TApplyChargingPileController(TApplyChargingPileService applyChargingPileService, TokenService tokenService, RedisService redisService) {
        this.applyChargingPileService = applyChargingPileService;
@@ -314,6 +315,28 @@
    {   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.getPaymentAmount());
            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");
@@ -331,7 +354,7 @@
            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导出失败!");