无关风月
2024-09-09 d44d34d20bf71d8b9736608a691189aa844ec11d
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TChargingOrderController.java
@@ -1,4 +1,5 @@
package com.ruoyi.order.controller;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.google.common.collect.Lists;
import java.math.BigDecimal;
@@ -41,6 +42,7 @@
import com.ruoyi.order.api.query.UploadRealTimeMonitoringDataQuery;
import com.ruoyi.order.api.vo.ChargingOrderInfoVO;
import com.ruoyi.order.api.vo.ChargingOrderVO;
import com.ruoyi.order.api.vo.GetChargingOrderByLicensePlate;
import com.ruoyi.order.api.vo.TCharingOrderVO;
import com.ruoyi.order.dto.GetMyChargingOrderList;
import com.ruoyi.order.dto.GetNoInvoicedOrder;
@@ -256,8 +258,15 @@
    @ResponseBody
    @PostMapping(value = "/pay/order/refund/list")
    @ApiOperation(value = "充电信息", tags = {"管理后台-支付订单-退款订单"})
    @ApiOperation(value = "列表", tags = {"管理后台-支付订单-退款订单"})
    public R<PageInfo<TChargingOrderRefund>> refundList(@RequestBody ChargingRefundDto chargingRefundDto) {
        return chargingOrderService.getRefundList(chargingRefundDto);
    }
    @ResponseBody
    @PostMapping(value = "/pay/order/refund/list1")
    @ApiOperation(value = "列表1", tags = {"管理后台-支付订单-退款订单"})
    public R<PageInfo<TChargingOrderRefund>> refundList1(@RequestBody ChargingRefundDto chargingRefundDto) {
        return chargingOrderService.getRefundList(chargingRefundDto);
    }
@@ -457,7 +466,24 @@
    }
    
    
    /**
     * 远程启动失败后退款回调
     * @param request
     */
    @ResponseBody
    @PostMapping(value = "/chargingOrderStartupFailureWxRefund")
    public void chargingOrderStartupFailureWxRefund(HttpServletRequest request){
        WxRefundNotifyResp data = wxPaymentClient.refundNotify(request).getData();
        if(null != data){
            String out_refund_no = data.getOut_refund_no();
            String refund_id = data.getRefund_id();
            String tradeState = data.getTradeState();
            String success_time = data.getSuccess_time();
            chargingOrderService.chargingOrderStartupFailureWxRefund(out_refund_no, refund_id, tradeState, success_time);
        }
    }
    
@@ -627,7 +653,17 @@
    public void chargeMonitoring(@RequestBody UploadRealTimeMonitoringDataQuery query){
        chargingOrderService.chargeMonitoring(query);
    }
    /**
     * 通过流水号查询订单
     * @param code
     * @return
     */
    @PostMapping(value = "/getOrderByCode/{code}")
    public R<TChargingOrder> getOrderByCode(@PathVariable("code") String code){
        return R.ok(chargingOrderService.getOne(Wrappers.lambdaQuery(TChargingOrder.class)
                .eq(TChargingOrder::getCode,code)));
    }
@@ -760,4 +796,34 @@
        return resultList;
    }
    /**
     * 硬件充电结束后的处理逻辑
     * @param code
     */
    @PostMapping("/endCharge")
    public void endCharge(@RequestParam("code") String code){
        chargingOrderService.endCharge(code, 2);
    }
    /**
     * 硬件异常结束充电后的处理逻辑
     * @param code
     */
    @PostMapping("/excelEndCharge")
    public void excelEndCharge(@RequestParam("code") String code){
        chargingOrderService.excelEndCharge(code);
    }
    /**
     * 根据车牌号和时间查询有效的充电数据
     * @param query
     * @return
     */
    @PostMapping("/getChargingOrderByLicensePlate")
    public R<TChargingOrder> getChargingOrderByLicensePlate(@RequestBody GetChargingOrderByLicensePlate query){
        TChargingOrder chargingOrder = chargingOrderService.getChargingOrderByLicensePlate(query);
        return R.ok(chargingOrder);
    }
}