| | |
| | | package com.ruoyi.order.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.order.api.model.TChargingOrder; |
| | | import com.ruoyi.order.api.query.TChargingCountQuery; |
| | | import com.ruoyi.order.service.TChargingOrderService; |
| | | import io.swagger.annotations.Api; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | |
| | | |
| | | @Resource |
| | | private TChargingOrderService chargingOrderService; |
| | | |
| | | /** |
| | | * 查询会员在本月有多少次享受了充电折扣 |
| | | * @param req |
| | | * @return |
| | | */ |
| | | @PostMapping(value = "/getChargingCount") |
| | | public R<Integer> getChargingCount(@RequestBody TChargingCountQuery req) { |
| | | int size = chargingOrderService.list(new LambdaQueryWrapper<TChargingOrder>() |
| | | .eq(TChargingOrder::getAppUserId, req.getUserId()) |
| | | .eq(TChargingOrder::getRechargePaymentStatus,2) |
| | | .between(TChargingOrder::getStartTime, req.getStartTime(), req.getEndTime())).size(); |
| | | return R.ok(size); |
| | | } |
| | | //用户订单数量 |
| | | @PostMapping(value = "/useOrderCount") |
| | | public R<Long> useOrderCount(@RequestParam Long userId) { |