longz
2026-07-28 79f1a19bb3344de47dff029cf5498d787e223782
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TChargingOrderController.java
@@ -66,6 +66,7 @@
import com.ruoyi.order.vo.ChargingSimulationVO;
import com.ruoyi.order.vo.IcbcAdminSubOrderVO;
import com.ruoyi.order.vo.StatisticsOfBatteryVO;
import com.ruoyi.order.vo.ReservationRecommendationVO;
import com.ruoyi.order.vo.UpdateOrderPaymentAmountDto;
import com.ruoyi.order.vo.WatchChargingOrderVo;
import com.ruoyi.other.api.feignClient.RoleSiteClient;
@@ -166,6 +167,8 @@
    @Resource
    private TOrderInvoiceService invoiceService;
    @Resource
    private TOrderInvoiceDetailService orderInvoiceDetailService;
    @Resource
    private UploadRealTimeMonitoringDataService uploadRealTimeMonitoringDataService;
    @Resource
    private PartnerClient partnerClient;
@@ -183,6 +186,12 @@
    private OtherClient otherClient;
    @Resource
    private SysUserRoleClient sysUserRoleClient;
    @GetMapping("/reservationRecommendation")
    @ApiOperation(value = "获取站点预约充电推荐时段", tags = {"管理后台-充电桩信息"})
    public R<ReservationRecommendationVO> getReservationRecommendation(@RequestParam Integer siteId) {
        return R.ok(chargingOrderService.getReservationRecommendation(siteId));
    }
    /** 小程序加盟商看板:站点范围始终从登录账号绑定关系解析。 */
    @PostMapping("/app/franchisee/charge-data")
@@ -731,6 +740,7 @@
    @PostMapping(value = "/pay/order/list")
    @ApiOperation(value = "列表", tags = {"管理后台-支付订单-订单信息"})
    public R<PageInfo<PayOrderDto>> payOrderList(@RequestBody PayOrderQueryDto payOrderQueryDto) {
        resolveInvoiceOrderIds(payOrderQueryDto);
        return chargingOrderService.payOrderQuery(payOrderQueryDto);
    }
@@ -740,6 +750,7 @@
    @ApiOperation(value = "导出查看订单列表", tags = {"管理后台-支付订单-订单信息"})
    @Log(title = "发票管理查看订单导出", businessType = BusinessType.EXPORT)
    public void exportPayOrder(@RequestBody PayOrderQueryDto payOrderQueryDto) {
        resolveInvoiceOrderIds(payOrderQueryDto);
        payOrderQueryDto.setPageCurr(1);
        payOrderQueryDto.setPageSize(10000);
        R<PageInfo<PayOrderDto>> result = chargingOrderService.payOrderQuery(payOrderQueryDto);
@@ -761,6 +772,26 @@
        } catch (IOException e) {
            log.error("导出查看订单列表失败", e);
        }
    }
    /**
     * 查看开票订单时以数据库中的开票明细为准,避免前端遗漏或篡改订单 ID。
     */
    private void resolveInvoiceOrderIds(PayOrderQueryDto query) {
        if (query == null || query.getInvoiceId() == null) {
            return;
        }
        LambdaQueryWrapper<TOrderInvoiceDetail> wrapper = new LambdaQueryWrapper<TOrderInvoiceDetail>()
                .eq(TOrderInvoiceDetail::getOrderInvoiceId, query.getInvoiceId());
        if (query.getType() != null) {
            wrapper.eq(TOrderInvoiceDetail::getOrderType, query.getType());
        }
        List<String> orderIds = orderInvoiceDetailService.list(wrapper).stream()
                .map(TOrderInvoiceDetail::getOrderId)
                .filter(Objects::nonNull)
                .map(String::valueOf)
                .collect(Collectors.toList());
        query.setIds(orderIds);
    }
    private PayOrderExport buildPayOrderExport(PayOrderDto dto) {
@@ -1741,7 +1772,9 @@
        }
        boolean platformVisible = !partnerView;
        if(platformVisible){
            BigDecimal data = parkingLotClient.getRecordAmount().getData();
            R<BigDecimal> parkingAmountResult = parkingLotClient.getRecordAmount(siteIds);
            BigDecimal data = parkingAmountResult == null || parkingAmountResult.getData() == null
                    ? BigDecimal.ZERO : parkingAmountResult.getData();
            map.put("parkingAmount",data);
            BigDecimal data1 =   shoppingOrderService.getSumAmount();
            map.put("shopAmount",data1);