luodangjia
2024-08-31 2e43d137c7832e149f3df4145aa7fcca2153ef9c
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TChargingOrderController.java
@@ -1,4 +1,6 @@
package com.ruoyi.order.controller;
import com.google.common.collect.Lists;
import java.math.BigDecimal;
import java.time.DayOfWeek;
import java.time.LocalDate;
@@ -35,6 +37,7 @@
import com.ruoyi.order.api.model.*;
import com.ruoyi.order.api.query.ChargingOrderQuery;
import com.ruoyi.order.api.query.TChargingCountQuery;
import com.ruoyi.order.api.vo.ChargingOrderInfoVO;
import com.ruoyi.order.api.vo.ChargingOrderVO;
import com.ruoyi.order.api.vo.TCharingOrderVO;
import com.ruoyi.order.dto.GetMyChargingOrderList;
@@ -64,6 +67,7 @@
import java.time.YearMonth;
import java.time.temporal.ChronoUnit;
import java.time.temporal.TemporalAdjusters;
import java.util.*;
import java.util.*;
import java.util.List;
import java.util.stream.Collectors;
@@ -99,8 +103,6 @@
    @Resource
    private TShoppingOrderService shoppingOrderService;
    @Autowired
    private AppUserClient appUserClient;
    @Resource
    private TVipOrderService vipOrderService;
@@ -126,7 +128,8 @@
 
    @Resource
    private TChargingOrderAccountingStrategyService chargingOrderAccountingStrategyService;
    @ResponseBody
    @PostMapping(value = "/pay/order/list")
@@ -186,11 +189,12 @@
//                    payOrderInfoDto3.setRefundAmount(new BigDecimal("0"));
        }
        return R.ok();
    }
    @ResponseBody
    @GetMapping(value = "/pay/order/refund/detail")
    @ApiOperation(value = "退款信息", tags = {"管理后台-支付订单-订单信息"})
@@ -223,8 +227,10 @@
        payOrderChargingInfo.setChargingName(data1.getName());
        TChargingGun data2 = chargingGunClient.getChargingGunById(byId.getChargingGunId()).getData();
        payOrderChargingInfo.setGunName(data2.getName());
        if (byId.getAppUserCarId()!=null) {
        List<TAppUserCar> data3 = appUserCarClient.getCarByIds(Collections.singletonList(byId.getAppUserCarId())).getData();
        payOrderChargingInfo.setCarNum(data3.get(0).getLicensePlate());
        }
        return R.ok();
    }
@@ -237,6 +243,7 @@
    }
    @ResponseBody
    @PostMapping(value = "/pay/order/refund/list")
    @ApiOperation(value = "充电信息", tags = {"管理后台-支付订单-退款订单"})
@@ -244,6 +251,9 @@
        return chargingOrderService.getRefundList(chargingRefundDto);
    }
    @ResponseBody
@@ -259,9 +269,19 @@
    @ResponseBody
    @PostMapping(value = "/chargingOrderInfo")
    @ApiOperation(value = "充电桩订单列表查看详情", tags = {"管理后台-订单管理"})
    public AjaxResult<TCharingOrderVO> chargingOrderInfo(String orderId) {
        return AjaxResult.success();
    public AjaxResult<ChargingOrderInfoVO> chargingOrderInfo(String orderId) {
        ChargingOrderInfoVO chargingOrderInfoVO = new ChargingOrderInfoVO();
        chargingOrderInfoVO.setCdElectronic("");
        chargingOrderInfoVO.setCdVoltage("");
        chargingOrderInfoVO.setSurplus("");
        chargingOrderInfoVO.setTotalPower("");
        chargingOrderInfoVO.setLicensePlate("");
        chargingOrderInfoVO.setVehicleBrand("");
        chargingOrderInfoVO.setVehicleModel("");
        chargingOrderInfoVO.setVehicleUse("");
        List<TChargingOrderAccountingStrategy> tChargingOrderAccountingStrategies = new ArrayList<>();
        chargingOrderInfoVO.setList(tChargingOrderAccountingStrategies);
        return AjaxResult.success(chargingOrderInfoVO);
    }
    @ResponseBody
@@ -272,9 +292,9 @@
        orderEvaluateService.addOrderEvaluate(dto);
        return AjaxResult.success();
    }
    /**
     * 查询用户最近一次充电记录使用的车辆
     *
     * @param
     * @return
     */
@@ -305,7 +325,6 @@
                .between(TChargingOrder::getStartTime, req.getStartTime(), req.getEndTime())).size();
        return R.ok(size);
    }
    //用户订单数量
    @PostMapping(value = "/useOrderCount")
    public R<Long> useOrderCount(@RequestParam("userId") Long userId) {
@@ -313,7 +332,6 @@
        return R.ok(count);
    }
    //订单详情
    @PostMapping(value = "/detail")
    public R<TChargingOrder> detail(@RequestParam("orderId") Long orderId) {
@@ -347,6 +365,8 @@
    }
    @ResponseBody
    @GetMapping(value = "/getMyChargingOrderList")
    @ApiOperation(value = "获取充电记录列表", tags = {"小程序-充电记录"})
@@ -365,6 +385,7 @@
    }
    @ResponseBody
    @GetMapping(value = "/getNoInvoicedOrder")
    @ApiOperation(value = "获取未开票的订单数据", tags = {"小程序-充电发票"})
@@ -372,6 +393,7 @@
        List<MyChargingOrderList> list = chargingOrderService.getNoInvoicedOrder(query);
        return AjaxResult.success(list);
    }
    @ResponseBody
@@ -437,6 +459,7 @@
    }
    @ResponseBody
    @GetMapping(value = "/getChargingDetails/{id}")
    @ApiOperation(value = "获取充电中页面数据", tags = {"小程序-扫一扫"})