| | |
| | | package com.ruoyi.order.controller; |
| | | import com.google.common.collect.Lists; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.DayOfWeek; |
| | | import java.time.LocalDate; |
| | |
| | | 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; |
| | |
| | | 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; |
| | | |
| | |
| | | private TokenService tokenService; |
| | | @Autowired |
| | | private TOrderEvaluateService orderEvaluateService; |
| | | |
| | | |
| | | @Resource |
| | | private WxPaymentClient wxPaymentClient; |
| | | |
| | | |
| | | @Resource |
| | | private RedisService redisService; |
| | | |
| | | |
| | | @Resource |
| | | private AliPaymentClient aliPaymentClient; |
| | | @Resource |
| | | private TShoppingOrderService shoppingOrderService; |
| | | |
| | | @Autowired |
| | | private AppUserClient appUserClient; |
| | | |
| | | |
| | | @Resource |
| | | private TVipOrderService vipOrderService; |
| | |
| | | @Resource |
| | | private TChargingOrderAccountingStrategyService chargingOrderAccountingStrategyService; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @Resource |
| | | private TChargingOrderAccountingStrategyService chargingOrderAccountingStrategyService; |
| | | |
| | | @ResponseBody |
| | | @PostMapping(value = "/pay/order/list") |
| | |
| | | // payOrderInfoDto3.setRefundAmount(new BigDecimal("0")); |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | | return R.ok(); |
| | | |
| | | } |
| | | |
| | | @ResponseBody |
| | | @GetMapping(value = "/pay/order/refund/detail") |
| | | @ApiOperation(value = "退款信息", tags = {"管理后台-支付订单-订单信息"}) |
| | |
| | | payOrderChargingInfo.setChargingName(data1.getName()); |
| | | TChargingGun data2 = chargingGunClient.getChargingGunById(byId.getChargingGunId()).getData(); |
| | | payOrderChargingInfo.setGunName(data2.getName()); |
| | | List<TAppUserCar> data3 = appUserCarClient.getCarByIds(Collections.singletonList(byId.getAppUserCarId())).getData(); |
| | | payOrderChargingInfo.setCarNum(data3.get(0).getLicensePlate()); |
| | | if (byId.getAppUserCarId()!=null) { |
| | | List<TAppUserCar> data3 = appUserCarClient.getCarByIds(Collections.singletonList(byId.getAppUserCarId())).getData(); |
| | | payOrderChargingInfo.setCarNum(data3.get(0).getLicensePlate()); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping(value = "/pay/order/refund/list") |
| | | @ApiOperation(value = "充电信息", tags = {"管理后台-支付订单-退款订单"}) |
| | |
| | | return chargingOrderService.getRefundList(chargingRefundDto); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | |
| | | @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 |
| | |
| | | orderEvaluateService.addOrderEvaluate(dto); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | /** |
| | | * 查询用户最近一次充电记录使用的车辆 |
| | | * |
| | | * @param |
| | | * @return |
| | | */ |
| | |
| | | List<TChargingOrder> list = chargingOrderService.list(new LambdaQueryWrapper<TChargingOrder>() |
| | | .eq(TChargingOrder::getAppUserId, tokenService.getLoginUserApplet().getUserId()) |
| | | .isNotNull(TChargingOrder::getAppUserCarId)); |
| | | if (!list.isEmpty()) { |
| | | if (!list.isEmpty()){ |
| | | // 最近使用的车辆id |
| | | Long size = list.get(0).getAppUserCarId(); |
| | | return R.ok(size); |
| | | } else { |
| | | }else{ |
| | | return R.ok(-1L); |
| | | } |
| | | } |
| | |
| | | .between(TChargingOrder::getStartTime, req.getStartTime(), req.getEndTime())).size(); |
| | | return R.ok(size); |
| | | } |
| | | |
| | | //用户订单数量 |
| | | @PostMapping(value = "/useOrderCount") |
| | | public R<Long> useOrderCount(@RequestParam("userId") Long userId) { |
| | |
| | | |
| | | return R.ok(count); |
| | | } |
| | | |
| | | //订单详情 |
| | | @PostMapping(value = "/detail") |
| | | public R<TChargingOrder> detail(@RequestParam("orderId") Long orderId) { |
| | |
| | | .eq(TChargingOrder::getDelFlag, 0).eq(TChargingOrder::getStatus, 3)); |
| | | return R.ok(one); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @GetMapping(value = "/getMyChargingOrderList") |
| | | @ApiOperation(value = "获取充电记录列表", tags = {"小程序-充电记录"}) |
| | |
| | | Map<String, Object> orderList = chargingOrderService.getMyChargingOrderList(query); |
| | | return AjaxResult.success(orderList); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @GetMapping(value = "/getMyChargingOrderInfo") |
| | | @ApiOperation(value = "获取充电记订单明细", tags = {"小程序-充电记录"}) |
| | |
| | | MyChargingOrderInfo myChargingOrderInfo = chargingOrderService.getMyChargingOrderInfo(id); |
| | | return AjaxResult.success(myChargingOrderInfo); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @GetMapping(value = "/getNoInvoicedOrder") |
| | | @ApiOperation(value = "获取未开票的订单数据", tags = {"小程序-充电发票"}) |
| | |
| | | List<MyChargingOrderList> list = chargingOrderService.getNoInvoicedOrder(query); |
| | | return AjaxResult.success(list); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping(value = "/paymentChargingOrder") |
| | | @ApiOperation(value = "支付充电充值费用", tags = {"小程序-扫一扫"}) |
| | | public AjaxResult paymentChargingOrder(@RequestBody AddChargingOrder addChargingOrder) { |
| | | return chargingOrderService.paymentChargingOrder(addChargingOrder); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 充电充值支付回调 |
| | | * @param request |
| | |
| | | Object cacheObject = redisService.getCacheObject(key); |
| | | return AjaxResult.success(cacheObject); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @GetMapping(value = "/getChargingDetails/{id}") |
| | | @ApiOperation(value = "获取充电中页面数据", tags = {"小程序-扫一扫"}) |