| | |
| | | package com.ruoyi.account.controller; |
| | | |
| | | |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.ruoyi.account.api.dto.CouponListDto; |
| | | import com.ruoyi.account.api.dto.GrantCouponDto; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | |
| | | public class TAppCouponController { |
| | | @Autowired |
| | | private TAppCouponService tAppCouponService; |
| | | @Resource |
| | | private OtherClient otherClient; |
| | | |
| | | @Autowired |
| | | private TAppUserCarService appUserCarService; |
| | |
| | | private ChargingPileClient chargingPileClient; |
| | | @Autowired |
| | | private ChargingOrderClient chargingOrderClient; |
| | | |
| | | |
| | | @Resource |
| | | private ChargingGunClient chargingGunClient; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 小程序扫一扫 添加车辆 |
| | | * @param dto |
| | |
| | | * 管理后台远程调用 根据优惠券ids 查询对应的发放数量 |
| | | * @return 优惠券ids 查询每个优惠券的发放数量 |
| | | */ |
| | | @PostMapping("/getCountByCouponIds") |
| | | public R<List<Integer>> getCountByCouponIds( String couponIds) { |
| | | @PostMapping("/getCountByCouponIds/{couponIds}") |
| | | public R<List<Integer>> getCountByCouponIds(@PathVariable("couponIds")String couponIds) { |
| | | // 最终结果 和优惠券id一一对应 |
| | | List<Integer> res = new ArrayList<>(); |
| | | String[] split = couponIds.split(","); |
| | |
| | | * @param couponId |
| | | * @return |
| | | */ |
| | | @PostMapping("/getUseCountByCouponId") |
| | | public R<Integer> getUseCountByCouponId(Integer couponId){ |
| | | @PostMapping("/getUseCountByCouponId/{couponId}") |
| | | public R<Integer> getUseCountByCouponId(@PathVariable("couponId") Integer couponId){ |
| | | return R.ok(tAppCouponService.list(new QueryWrapper<TAppCoupon>() |
| | | .eq("coupon_id", couponId) |
| | | .eq("status",2)).size()); |
| | |
| | | tAppCoupon.setEndTime(dto.getEndTime()); |
| | | tAppCoupon.setWaysToObtain(dto.getWaysToObtain()); |
| | | tAppCoupon.setStatus(1); |
| | | R<TCoupon> couponById = otherClient.getCouponById(Integer.valueOf(s)); |
| | | tAppCoupon.setCouponJson(JSON.toJSONString(couponById.getData())); |
| | | res.add(tAppCoupon); |
| | | } |
| | | tAppCouponService.saveBatch(res); |