From ae6c9ef8671e8378b09eb3a2f44ea36de4a8dfdc Mon Sep 17 00:00:00 2001 From: cun-nan <19819293608@163.com> Date: Tue, 24 Sep 2024 15:14:23 +0800 Subject: [PATCH 1/3] 9.24 --- .../controller/CardCouponUserController.java | 9 ++ .../mapper/CardCouponUserMapper.java | 11 +++ .../mapper/xml/CardCouponUserMapper.xml | 13 +++ .../service/CardCouponUserService.java | 11 +++ .../impl/CardCouponUserServiceImpl.java | 89 +++++++++++++++++-- .../cardCoupon/vo/CardCouponUserVo.java | 26 ++++++ gasStation-uni/pagesHome/Address/Address.vue | 56 +++++++----- .../pagesHome/PointsMall/PointsMall.vue | 13 +-- .../pagesHome/PointsRedemption/index.vue | 70 +++++++++++++-- .../pagesHome/goodsDetails/goodsDetails.vue | 16 +++- gasStation-uni/pagesHome/order/order.vue | 1 + 11 files changed, 268 insertions(+), 47 deletions(-) create mode 100644 fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardCoupon/vo/CardCouponUserVo.java diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardCoupon/controller/CardCouponUserController.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardCoupon/controller/CardCouponUserController.java index 742b85f66..c50768f31 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardCoupon/controller/CardCouponUserController.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardCoupon/controller/CardCouponUserController.java @@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.extension.api.R; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.fuint.business.marketingActivity.cardCoupon.entity.CardCouponUser; import com.fuint.business.marketingActivity.cardCoupon.service.CardCouponUserService; +import com.fuint.business.marketingActivity.cardCoupon.vo.CardCouponUserVo; import com.fuint.framework.web.BaseController; import com.fuint.framework.web.ResponseObject; import org.springframework.web.bind.annotation.*; @@ -88,5 +89,13 @@ public class CardCouponUserController extends BaseController { public ResponseObject delete(@RequestParam("idList") List idList) { return getSuccessResult(this.cardCouponUserService.removeByIds(idList)); } + + @GetMapping("queryPage") + public ResponseObject queryPage(CardCouponUserVo cardCouponUserVo, + @RequestParam(value = "page",defaultValue = "1") Integer pageNo, + @RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize) { + Page page =new Page(pageNo,pageSize); + return getSuccessResult(cardCouponUserService.queryPage(page, cardCouponUserVo)); + } } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardCoupon/mapper/CardCouponUserMapper.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardCoupon/mapper/CardCouponUserMapper.java index ac9616b1a..d2a92c445 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardCoupon/mapper/CardCouponUserMapper.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardCoupon/mapper/CardCouponUserMapper.java @@ -1,7 +1,10 @@ package com.fuint.business.marketingActivity.cardCoupon.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.fuint.business.marketingActivity.cardCoupon.entity.CardCouponUser; +import com.fuint.business.marketingActivity.cardCoupon.vo.CardCouponUserVo; import com.fuint.business.marketingActivity.cardCoupon.vo.CardCouponVO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -27,5 +30,13 @@ public interface CardCouponUserMapper extends BaseMapper { * @return java.util.List **/ List selectAllList(@Param("storeId") Integer storeId,@Param("userId") Integer userId,@Param("nowDate") String nowDate); + + /** + * 小程序查询优惠券列表信息 + * @param page + * @param cardCouponUserVo + * @return + */ + IPage queryPage(Page page,@Param("entity") CardCouponUserVo cardCouponUserVo); } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardCoupon/mapper/xml/CardCouponUserMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardCoupon/mapper/xml/CardCouponUserMapper.xml index 76a791502..6550b31ef 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardCoupon/mapper/xml/CardCouponUserMapper.xml +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardCoupon/mapper/xml/CardCouponUserMapper.xml @@ -16,4 +16,17 @@ AND cc.`type` != '2' AND main.start_time <= #{nowDate} AND main.end_time >= #{nowDate} + diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardCoupon/service/CardCouponUserService.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardCoupon/service/CardCouponUserService.java index b6a668174..dc104a17e 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardCoupon/service/CardCouponUserService.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardCoupon/service/CardCouponUserService.java @@ -1,7 +1,10 @@ package com.fuint.business.marketingActivity.cardCoupon.service; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.IService; import com.fuint.business.marketingActivity.cardCoupon.entity.CardCouponUser; +import com.fuint.business.marketingActivity.cardCoupon.vo.CardCouponUserVo; import com.fuint.business.marketingActivity.cardCoupon.vo.CardCouponVO; import io.swagger.models.auth.In; @@ -33,5 +36,13 @@ public interface CardCouponUserService extends IService { * @return java.util.List **/ List selectAllList(Integer storeId, Integer userId, Date nowDate); + + /** + * 小程序分页查询优惠券信息列表 + * @param page + * @param cardCouponUserVo + * @return + */ + IPage queryPage(Page page,CardCouponUserVo cardCouponUserVo); } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardCoupon/service/impl/CardCouponUserServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardCoupon/service/impl/CardCouponUserServiceImpl.java index 7e60c3e60..b73932e9b 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardCoupon/service/impl/CardCouponUserServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardCoupon/service/impl/CardCouponUserServiceImpl.java @@ -3,13 +3,18 @@ package com.fuint.business.marketingActivity.cardCoupon.service.impl; import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.date.DateUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.fuint.business.marketingActivity.cardCoupon.entity.CardCoupon; import com.fuint.business.marketingActivity.cardCoupon.mapper.CardCouponUserMapper; import com.fuint.business.marketingActivity.cardCoupon.entity.CardCouponUser; import com.fuint.business.marketingActivity.cardCoupon.service.CardCouponService; import com.fuint.business.marketingActivity.cardCoupon.service.CardCouponUserService; +import com.fuint.business.marketingActivity.cardCoupon.vo.CardCouponUserVo; import com.fuint.business.marketingActivity.cardCoupon.vo.CardCouponVO; +import com.fuint.common.dto.AccountInfo; +import com.fuint.common.util.TokenUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -29,27 +34,29 @@ public class CardCouponUserServiceImpl extends ServiceImpl queryWrapper =new LambdaQueryWrapper<>(); - queryWrapper.eq(CardCouponUser::getCardCouponId,couponId).eq(CardCouponUser::getMtUserId,userId); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(CardCouponUser::getCardCouponId, couponId).eq(CardCouponUser::getMtUserId, userId); List list = this.list(queryWrapper); - if (CollectionUtil.isEmpty(list)){ - list =new ArrayList<>(); + if (CollectionUtil.isEmpty(list)) { + list = new ArrayList<>(); } - if (list.size()>=cardCoupon.getGetNumLimit()){ + if (list.size() >= cardCoupon.getGetNumLimit()) { //当前用户领取已到达上限 return false; } @@ -72,7 +79,71 @@ public class CardCouponUserServiceImpl extends ServiceImpl selectAllList(Integer storeId, Integer userId, Date nowDate) { - return cardCouponUserMapper.selectAllList(storeId,userId, DateUtil.formatDate(nowDate)); + return cardCouponUserMapper.selectAllList(storeId, userId, DateUtil.formatDate(nowDate)); + } + + @Override + public IPage queryPage(Page page, CardCouponUserVo cardCouponUserVo) { + AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); + cardCouponUserVo.setMtUserId(nowAccountInfo.getId()); + IPage cardCouponUserVoIPage = baseMapper.queryPage(page, cardCouponUserVo); + for (CardCouponUserVo record : cardCouponUserVoIPage.getRecords()) { + // 未使用 + if (record.getStatus().equals("0")) { + if (record.getType().equals("1")) { + record.setBgImg("http://47.94.122.58:83/coup1.png"); + } + if (record.getType().equals("2")) { + record.setBgImg("http://47.94.122.58:83/coup5.png"); + } + if (record.getType().equals("3")) { + record.setBgImg("http://47.94.122.58:83/coup2.png"); + } + if (record.getType().equals("4")) { + record.setBgImg("http://47.94.122.58:83/coup3.png"); + } + if (record.getType().equals("5")) { + record.setBgImg("http://47.94.122.58:83/coup4.png"); + } + } + // 已核销 + if (record.getStatus().equals("1")) { + if (record.getType().equals("1")) { + record.setBgImg("http://47.94.122.58:83/youp1.png"); + } + if (record.getType().equals("2")) { + record.setBgImg("http://47.94.122.58:83/youp5.png"); + } + if (record.getType().equals("3")) { + record.setBgImg("http://47.94.122.58:83/youp2.png"); + } + if (record.getType().equals("4")) { + record.setBgImg("http://47.94.122.58:83/youp3.png"); + } + if (record.getType().equals("5")) { + record.setBgImg("http://47.94.122.58:83/youp4.png"); + } + } + // 已过期 + if (record.getStatus().equals("2")) { + if (record.getType().equals("1")) { + record.setBgImg("http://47.94.122.58:83/qoup1.png"); + } + if (record.getType().equals("2")) { + record.setBgImg("http://47.94.122.58:83/qoup5.png"); + } + if (record.getType().equals("3")) { + record.setBgImg("http://47.94.122.58:83/qoup2.png"); + } + if (record.getType().equals("4")) { + record.setBgImg("http://47.94.122.58:83/qoup3.png"); + } + if (record.getType().equals("5")) { + record.setBgImg("http://47.94.122.58:83/qoup4.png"); + } + } + } + return cardCouponUserVoIPage; } } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardCoupon/vo/CardCouponUserVo.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardCoupon/vo/CardCouponUserVo.java new file mode 100644 index 000000000..35330311b --- /dev/null +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardCoupon/vo/CardCouponUserVo.java @@ -0,0 +1,26 @@ +package com.fuint.business.marketingActivity.cardCoupon.vo; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.fuint.business.marketingActivity.cardCoupon.entity.CardCouponUser; +import lombok.Data; + +@Data +public class CardCouponUserVo extends CardCouponUser { + /** + * 优惠券名称 + */ + private String couponName; + /** + * 卡券类型 1代金券、2兑换券、3折扣券、4油品立减券、5单品代金券 + */ + private String type; + /** + * 使用条件 + */ + private String useCondition; + /** + * 背景图 + */ + @TableField(exist = false) + private String bgImg; +} diff --git a/gasStation-uni/pagesHome/Address/Address.vue b/gasStation-uni/pagesHome/Address/Address.vue index cf538b1a7..7d6e83a14 100644 --- a/gasStation-uni/pagesHome/Address/Address.vue +++ b/gasStation-uni/pagesHome/Address/Address.vue @@ -7,24 +7,29 @@ - - + + - 默认 - {{item.address}} - - - {{item.name}} - {{item.mobile}} + {{item.address || '地址'}} + {{item.name || '名称'}} + {{item.mobile || '手机号'}} - - + + + + + + + 编辑 + + 删除 + - 新增收货地址 + 新增预留信息 @@ -40,7 +45,7 @@ return { title: '', dataList: '', - + checked: false, } }, onShow() { @@ -122,18 +127,18 @@ .bottom-anniu { width: 90%; - height: 50px; + height: 40px; display: flex; align-items: center; - background: #1678ff; + background: #FF9655; color: white; justify-content: center; position: fixed; - bottom: 15px; + bottom: 40px; left: 50%; transform: translateX(-50%); - border-radius: 8px; + border-radius: 50px; } @@ -143,20 +148,17 @@ margin: 10px auto; padding: 10px; box-sizing: border-box; - display: flex; - justify-content: space-between; } - .box-left { - width: 85%; - } + .box-left {} .box-right { - width: 15px; + width: 60%; display: flex; align-items: center; - justify-content: center; - + justify-content: space-between; + font-size: 14px; + color: #333333; } .tapl { @@ -170,4 +172,10 @@ border: 1px solid #1678ff; font-size: 14px; } + + .box-xia { + display: flex; + justify-content: space-between; + margin-top: 20px; + } \ No newline at end of file diff --git a/gasStation-uni/pagesHome/PointsMall/PointsMall.vue b/gasStation-uni/pagesHome/PointsMall/PointsMall.vue index 53b029ef0..877a69f29 100644 --- a/gasStation-uni/pagesHome/PointsMall/PointsMall.vue +++ b/gasStation-uni/pagesHome/PointsMall/PointsMall.vue @@ -34,18 +34,18 @@ {{item.exchangePoints}} + v-if="item.exchangeMethod == '积分' || item.exchangeMethod == '积分+金额' || item.exchangeMethod == '积分+加钱购'">{{item.exchangePoints}}积分 + ¥{{item.exchangeAmount}} - 积分 + - ¥3.5 + ¥{{item.market || 0}} { if (res.code == 200) { this.integralGiftList = res.data.records + console.log(res.data, 142); + }else{ + this.integralGiftList = [] } }) }, @@ -493,4 +496,4 @@ color: #999; text-decoration: line-through } - + \ No newline at end of file diff --git a/gasStation-uni/pagesHome/PointsRedemption/index.vue b/gasStation-uni/pagesHome/PointsRedemption/index.vue index 6156c3d45..2d48e6901 100644 --- a/gasStation-uni/pagesHome/PointsRedemption/index.vue +++ b/gasStation-uni/pagesHome/PointsRedemption/index.vue @@ -6,13 +6,14 @@ 积分余额 {{cardBalance.points || 0}} - - 中建锦绣二期站可用 + + {{item.storeName}}可用 - + + - 虚拟 + {{item.giftName}} 300ml瓶装 兑换券 @@ -26,15 +27,21 @@ + + +