From 7473e0157c4f687c354ec351c3a22a40d1788ed5 Mon Sep 17 00:00:00 2001 From: xuhy <3313886187@qq.com> Date: 星期三, 28 八月 2024 10:41:31 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TChargingOrderServiceImpl.java | 17 +++-- ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TVipController.java | 25 +++++++- ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/dto/VipInfoDto.java | 10 +++ ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/dto/InfoCouponDto.java | 3 + ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/dto/ListInfoCouponDto.java | 6 + ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TExchangeOrderController.java | 10 -- ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/factory/AppUserFallbackFactory.java | 5 + ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppUserController.java | 24 +++++++- ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TExchangeOrderServiceImpl.java | 4 ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/feignClient/AppUserClient.java | 2 ruoyi-service/ruoyi-other/src/main/resources/mapper/other/TGoodsMapper.xml | 8 +- ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TGoodsController.java | 60 ++++++++++++++++++- 12 files changed, 140 insertions(+), 34 deletions(-) diff --git a/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/dto/InfoCouponDto.java b/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/dto/InfoCouponDto.java index d3bff84..d6fcd90 100644 --- a/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/dto/InfoCouponDto.java +++ b/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/dto/InfoCouponDto.java @@ -3,6 +3,7 @@ import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; +import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -35,8 +36,10 @@ private BigDecimal discount; @ApiModelProperty(value = "结束时间") @TableField("end_time") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") private LocalDateTime endTime; @ApiModelProperty(value = "开始时间") @TableField("start_time") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") private LocalDateTime startTime; } diff --git a/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/dto/ListInfoCouponDto.java b/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/dto/ListInfoCouponDto.java index 6536aa8..65b3bc1 100644 --- a/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/dto/ListInfoCouponDto.java +++ b/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/dto/ListInfoCouponDto.java @@ -12,7 +12,9 @@ @Data public class ListInfoCouponDto { - List<InfoCouponDto> infoCouponDtoList1; - List<InfoCouponDto> infoCouponDtoList2; + List<InfoCouponDto> infoCouponDtoList; + Integer num1; + Integer num2; + } diff --git a/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/factory/AppUserFallbackFactory.java b/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/factory/AppUserFallbackFactory.java index 47eccaf..bb60f76 100644 --- a/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/factory/AppUserFallbackFactory.java +++ b/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/factory/AppUserFallbackFactory.java @@ -54,6 +54,11 @@ } @Override + public R changeDown(PointChangeDto points) { + return null; + } + + @Override public R<TAppUser> selectByPhone(String phone) { return R.fail("积分变化失败:"+throwable.getMessage()); } diff --git a/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/feignClient/AppUserClient.java b/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/feignClient/AppUserClient.java index 0ad197c..f7c1da1 100644 --- a/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/feignClient/AppUserClient.java +++ b/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/feignClient/AppUserClient.java @@ -58,6 +58,8 @@ @PostMapping("/t-app-user/user/points/change") R change(@RequestBody PointChangeDto points); + @PostMapping("/t-app-user/user/points/change/down") + R changeDown(@RequestBody PointChangeDto points); /** * 通过手机号查询用户 diff --git a/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/dto/VipInfoDto.java b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/dto/VipInfoDto.java index 0783c96..86e0ed5 100644 --- a/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/dto/VipInfoDto.java +++ b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/dto/VipInfoDto.java @@ -12,12 +12,19 @@ @ApiModelProperty("月卡价格") private BigDecimal monthlyCard; + @ApiModelProperty(value = "月卡折扣") + private BigDecimal monthlyCardDiscount; @ApiModelProperty("季卡价格") private BigDecimal seasonCard; + @ApiModelProperty(value = "季卡折扣") + private BigDecimal seasonCardDiscount; @ApiModelProperty("年卡价格") private BigDecimal annualCard; + @ApiModelProperty(value = "年卡折扣") + private BigDecimal annualCardDiscount; @ApiModelProperty("最高抵扣价格") private BigDecimal maximumDeduction; + private BigDecimal timeAmount; @ApiModelProperty("抵扣次数") private Integer discountTimes; @@ -32,4 +39,7 @@ @ApiModelProperty(value = "最高总折扣") private BigDecimal totalDiscount; + + @ApiModelProperty(value = "会员名称") + private String name; } diff --git a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppUserController.java b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppUserController.java index 951755c..a106416 100644 --- a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppUserController.java +++ b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppUserController.java @@ -513,7 +513,7 @@ appUserInfoDto.setVipExpireTime(byId.getVipEndTime()); } //判断当天是否签到 - Long count = signService.lambdaQuery().eq(TAppUserSign::getSignDay, LocalDate.now()).count(); + Long count = signService.lambdaQuery().eq(TAppUserSign::getAppUserId,userId).eq(TAppUserSign::getSignDay, LocalDate.now()).count(); appUserInfoDto.setIsSign(count>0?1:0); //获取当前拥有的优惠卷数量 Long coupons = appCouponService.lambdaQuery().eq(TAppCoupon::getAppUserId, userId).eq(TAppCoupon::getStatus, 1).count(); @@ -525,6 +525,7 @@ } appUserInfoDto.setUserCars(list); appUserInfoDto.setFirstAdd(byId.getFirstAdd()!=null?byId.getFirstAdd():0); + appUserInfoDto.setPoints(byId.getPoints()==null?0:byId.getPoints()); return R.ok(appUserInfoDto); @@ -544,6 +545,7 @@ InfoCouponDto infoCouponDto = new InfoCouponDto(); BeanUtils.copyProperties(coupon, infoCouponDto); infoCouponDto.setId(tAppCoupon.getId()); + infoCouponDto.setEndTime(tAppCoupon.getEndTime()); couponDtos1.add(infoCouponDto); } @@ -557,6 +559,7 @@ InfoCouponDto infoCouponDto = new InfoCouponDto(); BeanUtils.copyProperties(coupon, infoCouponDto); infoCouponDto.setId(tAppCoupon.getId()); + infoCouponDto.setEndTime(tAppCoupon.getEndTime()); couponDtos2.add(infoCouponDto); } for (TAppCoupon tAppCoupon : list2) { @@ -564,13 +567,19 @@ InfoCouponDto infoCouponDto = new InfoCouponDto(); BeanUtils.copyProperties(coupon, infoCouponDto); infoCouponDto.setId(tAppCoupon.getId()); + infoCouponDto.setEndTime(tAppCoupon.getEndTime()); couponDtos2.add(infoCouponDto); } ListInfoCouponDto listInfoCouponDto = new ListInfoCouponDto(); - listInfoCouponDto.setInfoCouponDtoList1(couponDtos1); - listInfoCouponDto.setInfoCouponDtoList2(couponDtos2); + if (type==1){ + listInfoCouponDto.setInfoCouponDtoList(couponDtos1); + }else { + listInfoCouponDto.setInfoCouponDtoList(couponDtos2); + } + listInfoCouponDto.setNum1(couponDtos1.size()); + listInfoCouponDto.setNum2(couponDtos2.size()); return R.ok(listInfoCouponDto); } @@ -808,6 +817,15 @@ return R.ok(); } + @PostMapping(value = "/user/points/change/down") + public R changeDown(@RequestBody PointChangeDto points) { + TAppUser byId = appUserService.getById(points.getUserId()); + pointDetailUtil.addDetail(byId.getPoints(),byId.getPoints()-points.getPoints(),points.getType(),points.getUserId(),points.getRemark(),"JF"); + byId.setPoints(byId.getPoints()-points.getPoints()); + appUserService.updateById(byId); + return R.ok(); + } + @ApiOperation(value = "添加编辑车辆", tags = {"小程序-个人中心-车辆"}) @PostMapping(value = "/user/car/addOrUpdate") public R carAdd(@RequestBody TAppUserCar appUserCar) { diff --git a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TExchangeOrderController.java b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TExchangeOrderController.java index 41f6db9..2c79bee 100644 --- a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TExchangeOrderController.java +++ b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TExchangeOrderController.java @@ -202,8 +202,6 @@ for (int i = 0; i < split1.length; i++) { Integer reduce = tShoppingOrderService.list(new QueryWrapper<TShoppingOrder>() .eq("order_type",1) - .eq("goods_id", split[i]) - .eq("payment_status", 2) .ne("refund_status", 2)) .stream().map(TShoppingOrder::getPurchaseQuantity).reduce(0, Integer::sum); res.add(reduce); @@ -211,11 +209,7 @@ break; case 2: for (int i = 0; i < split1.length; i++) { - Integer reduce = exchangeOrderService.list(new QueryWrapper<TExchangeOrder>() - .eq("order_type",1) - .ne("status",4) - .eq("goods_id", split[i]) - ) + Integer reduce = exchangeOrderService.list(new QueryWrapper<TExchangeOrder>().eq("order_type",1).ne("status",4).eq("goods_id", split1[i])) .stream().map(TExchangeOrder::getPurchaseQuantity).reduce(0, Integer::sum); res.add(reduce); } @@ -283,7 +277,7 @@ tExchangeOrder.setCouponId(exchangeDto.getGoodId()); } tExchangeOrder.setPurchaseQuantity(1); - tExchangeOrder.setAppUserAddressId(Long.valueOf(exchangeDto.getAddressId())); + tExchangeOrder.setAppUserAddressId(exchangeDto.getAddressId()==null?null:Long.valueOf(exchangeDto.getAddressId())); tExchangeOrder.setPoints(exchangeDto.getPoint()); tExchangeOrder.setRemark(""); if (exchangeDto.getGoodType()==1){ diff --git a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TChargingOrderServiceImpl.java b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TChargingOrderServiceImpl.java index 5b1b24d..6738631 100644 --- a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TChargingOrderServiceImpl.java +++ b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TChargingOrderServiceImpl.java @@ -519,10 +519,12 @@ time += between; } // 总收入 - if (chargingOrderVO.getRefundStatus() == 2){ + if (chargingOrderVO.getRefundStatus() !=null && chargingOrderVO.getRefundStatus() == 2){ income = income.add(chargingOrderVO.getPaymentAmount().subtract(chargingOrderVO.getRefundAmount())); }else{ - income = income.add(chargingOrderVO.getPaymentAmount()); + if (chargingOrderVO.getPaymentAmount()!=null){ + income = income.add(chargingOrderVO.getPaymentAmount()); + } } for (TChargingOrderAccountingStrategy tChargingOrderAccountingStrategy : chargingOrderId) { // 累计电费 @@ -544,11 +546,14 @@ // 车牌号 chargingOrderVO.setPhone(data.getPhone()); List<Long> longs = new ArrayList<>(); - longs.add(chargingOrderVO.getAppUserCarId()); - List<TAppUserCar> data1 = appUserCarClient.getCarByIds(longs).getData(); - if (!data1.isEmpty()){ - chargingOrderVO.setLicensePlate(data1.get(0).getLicensePlate()); + if (chargingOrderVO.getAppUserCarId()!=null){ + longs.add(chargingOrderVO.getAppUserCarId()); + List<TAppUserCar> data1 = appUserCarClient.getCarByIds(longs).getData(); + if (!data1.isEmpty()){ + chargingOrderVO.setLicensePlate(data1.get(0).getLicensePlate()); + } } + } } tCharingOrderVO.setTotal(total); diff --git a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TExchangeOrderServiceImpl.java b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TExchangeOrderServiceImpl.java index 9b71839..d554e24 100644 --- a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TExchangeOrderServiceImpl.java +++ b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TExchangeOrderServiceImpl.java @@ -86,7 +86,7 @@ name = goods.getName(); imgUrl = goods.getCoverPicture(); }else{ - TCoupon coupon = couponClient.getCouponById1(tExchangeOrder.getGoodsId()).getData(); + TCoupon coupon = couponClient.getCouponById1(tExchangeOrder.getCouponId()).getData(); name = coupon.getName(); imgUrl = coupon.getCoverPicture(); } @@ -122,7 +122,7 @@ name = goods.getName(); imgUrl = goods.getCoverPicture(); }else{ - TCoupon coupon = couponClient.getCouponById1(exchangeOrder.getGoodsId()).getData(); + TCoupon coupon = couponClient.getCouponById1(exchangeOrder.getCouponId()).getData(); info.setCouponType(coupon.getType()); info.setDays(coupon.getDays()); info.setEndTime(coupon.getEndTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TGoodsController.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TGoodsController.java index 004ff33..6021c3a 100644 --- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TGoodsController.java +++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TGoodsController.java @@ -110,10 +110,25 @@ @GetMapping("/getInfo") - @ApiOperation(tags = {"管理后台-商品管理","小程序-兑换商城"},value = "商品查看详情") + @ApiOperation(tags = {"管理后台-商品管理"},value = "商品查看详情") public AjaxResult<TGoods> getInfo(Integer id) { - return AjaxResult.ok(goodsService.getById(id)); + TGoods byId = goodsService.getById(id); + return AjaxResult.ok(byId); } + + + @GetMapping("/getInfoByType") + @ApiOperation(tags = {"小程序-兑换商城"},value = "商品查看详情") + public AjaxResult getInfoByType(Integer goodType,Integer id) { + if (goodType==1){ + TGoods byId = goodsService.getById(id); + return AjaxResult.ok(byId);} + else { + TCoupon byId = couponService.getById(id); + return AjaxResult.ok(byId); + } + } + @@ -130,6 +145,40 @@ return AjaxResult.ok(goodsService.pageList1(appGoodQuery)); } + + + @ApiOperation(tags = {"小程序-兑换商城"},value = "积分兑换商品检查数量") + @PostMapping(value = "/app/shop/check") + public R check(@RequestBody ExchangeDto exchangeDto) { + //检查当前用户积分是否够 + Long userId = tokenService.getLoginUserApplet().getUserId(); + Integer point = 0; + + if (exchangeDto.getGoodType()==1) { + //查询当前商品信息 + TGoods good = goodsService.getById(exchangeDto.getGoodId()); + point = good.getRedeemPoints(); + //检查当前用户是否到达兑换上限 + Long count = orderClient.getExchangeById(exchangeDto.getGoodId(), userId,exchangeDto.getGoodType()).getData(); + if (good.getLimitExchangeTimes() != -1 && count >= good.getLimitExchangeTimes()) { + return R.fail("当前用户已兑换"+count+"张"); + } + TAppUser user = appUserClient.getUserById(userId).getData(); + if (user.getPoints()<good.getRedeemPoints()){ + return R.fail("当前用户积分不足"); + } + }else { + TCoupon coupon = couponService.getById(exchangeDto.getGoodId()); + point = coupon.getRedeemPoints(); + + Long count = orderClient.getExchangeById(exchangeDto.getGoodId(), userId,exchangeDto.getGoodType()).getData(); + if (coupon.getInventoryQuantity() != -1 && count >= coupon.getInventoryQuantity()) { + return R.fail("当前用户已到达兑换"+coupon+"次"); + } + } + return R.ok(); + + } @ApiOperation(tags = {"小程序-兑换商城"},value = "积分兑换商品") @PostMapping(value = "/app/shop") public AjaxResult<PageInfo<TGoods>> shop(@RequestBody ExchangeDto exchangeDto) { @@ -144,7 +193,7 @@ //检查当前用户是否到达兑换上限 Long count = orderClient.getExchangeById(exchangeDto.getGoodId(), userId,exchangeDto.getGoodType()).getData(); if (good.getLimitExchangeTimes() != -1 && count >= good.getLimitExchangeTimes()) { - return AjaxResult.error("当前用户已到达兑换上限"); + return AjaxResult.error("当前用户已兑换"+count+"张"); } TAppUser user = appUserClient.getUserById(userId).getData(); if (user.getPoints()<good.getRedeemPoints()){ @@ -156,10 +205,11 @@ Long count = orderClient.getExchangeById(exchangeDto.getGoodId(), userId,exchangeDto.getGoodType()).getData(); if (coupon.getInventoryQuantity() != -1 && count >= coupon.getInventoryQuantity()) { - return AjaxResult.error("当前用户已到达兑换上限"); + return AjaxResult.error("当前用户已到达兑换"+coupon+"次"); } } exchangeDto.setPoint(point); + exchangeDto.setUserId(userId); //生成积分兑换成功的订单 R<Long> longR = orderClient.exchangeCreate(exchangeDto); if (exchangeDto.getGoodType()==2) { @@ -177,7 +227,7 @@ pointChangeDto.setPoints(point); pointChangeDto.setRemark(longR.getData().toString()); pointChangeDto.setType(6); - appUserClient.change(pointChangeDto); + appUserClient.changeDown(pointChangeDto); return AjaxResult.success(); diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TVipController.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TVipController.java index e0a0fae..b60c3de 100644 --- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TVipController.java +++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TVipController.java @@ -25,6 +25,7 @@ import javax.annotation.Resource; import java.math.BigDecimal; +import java.time.LocalDateTime; import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -143,19 +144,34 @@ @ApiOperation(value = "会员信息", tags = {"小程序-个人中心"}) - @PostMapping("/vipInfo") - public AjaxResult<VipInfoDto> vipInfo() { + @GetMapping("/vipInfo") + public R<List<VipInfoDto>> vipInfo() { List<VipInfoDto> vipInfoDtos = new ArrayList<>(); List<TVip> vips = vipService.lambdaQuery().eq(TVip::getReveal, 1).list(); + LocalDateTime now = LocalDateTime.now(); for (TVip vip : vips) { VipInfoDto vipInfoDto = new VipInfoDto(); vipInfoDto.setMonthlyCard(vip.getMonthlyCardReveal()==1?vip.getMonthlyCard():null); vipInfoDto.setSeasonCard(vip.getSeasonCardReveal()==1?vip.getSeasonCard():null); vipInfoDto.setAnnualCard(vip.getAnnualCardReveal()==1?vip.getAnnualCard():null); + //判断是否在折扣时间内,然后设置折扣价格 + if (vip.getMonthlyCardDiscountStart()!=null&&(now.isAfter(vip.getMonthlyCardDiscountStart())&&now.isBefore(vip.getMonthlyCardDiscountEnd()))){ + vipInfoDto.setMonthlyCardDiscount(vip.getMonthlyCardDiscount()); + } + if (vip.getSeasonCardDiscountStart()!=null&&(now.isAfter(vip.getSeasonCardDiscountStart())&&now.isBefore(vip.getSeasonCardDiscountEnd()))){ + vipInfoDto.setSeasonCardDiscount(vip.getSeasonCardDiscount()); + } + if (vip.getAnnualCardDiscountStart()!=null&&(now.isAfter(vip.getAnnualCardDiscountStart())&&now.isBefore(vip.getAnnualCardDiscountEnd()))){ + vipInfoDto.setAnnualCardDiscount(vip.getAnnualCardDiscount()); + } + + + vipInfoDto.setMaximumDeduction(vip.getMaximumDeduction()); vipInfoDto.setDiscountTimes(vip.getDiscountTimes()); vipInfoDto.setDoubleIntegration(vip.getDoubleIntegration()); vipInfoDto.setMallExclusivePrice(vip.getMallExclusivePrice()); + vipInfoDto.setName(vip.getName()); List<SendCouponDto> javaList = JSON.parseArray(vip.getCoupon()).toJavaList(SendCouponDto.class); List<VipCouponDto> vipCouponDtos = new ArrayList<>(); if (!javaList.isEmpty()){ @@ -175,12 +191,13 @@ total = total.add(vip.getMaximumDeduction().multiply(BigDecimal.valueOf(vip.getDiscountTimes()))); for (VipCouponDto vipCouponDto : vipCouponDtos) { TCoupon tCoupon = vipCouponDto.getTCoupon(); - total.add(tCoupon.getDiscount()); + total.add(tCoupon.getMaximumDiscountAmount()); } vipInfoDto.setTotalDiscount(total); + vipInfoDto.setTimeAmount(vip.getMaximumDeduction().multiply(BigDecimal.valueOf(vip.getDiscountTimes()))); vipInfoDtos.add(vipInfoDto); } - return AjaxResult.success(vipInfoDtos); + return R.ok(vipInfoDtos); } } diff --git a/ruoyi-service/ruoyi-other/src/main/resources/mapper/other/TGoodsMapper.xml b/ruoyi-service/ruoyi-other/src/main/resources/mapper/other/TGoodsMapper.xml index c60fde9..fb2632b 100644 --- a/ruoyi-service/ruoyi-other/src/main/resources/mapper/other/TGoodsMapper.xml +++ b/ruoyi-service/ruoyi-other/src/main/resources/mapper/other/TGoodsMapper.xml @@ -52,23 +52,23 @@ <select id="pageList1" resultType="com.ruoyi.other.api.domain.TGoods"> SELECT - id,name,redeem_points,inventory,original_price,preferential_price,vip_price + id,name,redeem_points as redeemPoints,inventory,original_price as originalPrice ,preferential_price as preferentialPrice,vip_price as vipPrice,1 as goodType,cover_picture as coverPicture FROM t_goods WHERE `status` = 1 and del_flag = 0 and type = #{appGoodQuery.type} UNION ALL SELECT - id,name,redeem_points,inventory_quantity as inventory,payment_amount as original_price,payment_amount as preferential_price,vip_payment_amount as vip_price + id,name,redeem_points as redeemPoints,inventory_quantity as inventory,payment_amount as originalPrice,payment_amount as preferentiaPrice,vip_payment_amount as vipPrice,2 as goodType,cover_picture as coverPicture FROM t_coupon - WHERE `status`= 1 and del_flag = 0 and type = #{appGoodQuery.type} + WHERE `status`= 1 and del_flag = 0 and ways_to_obtain != #{appGoodQuery.type} ORDER BY CASE WHEN `inventory` = 0 THEN 0 ELSE 1 END DESC, - `redeem_points` ASC + `redeemPoints` ASC </select> </mapper> -- Gitblit v1.7.1