diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/controller/CardFavorableController.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/controller/CardFavorableController.java index 48f05e37b..9c18d2138 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/controller/CardFavorableController.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/controller/CardFavorableController.java @@ -2,9 +2,9 @@ package com.fuint.business.marketingActivity.cardFavorable.controller; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.fuint.business.marketingActivity.cardFavorable.dto.CardFavorableDTO; +import com.fuint.business.marketingActivity.cardFavorable.dto.CardFavorableDTOS; import com.fuint.business.marketingActivity.cardFavorable.entity.CardFavorable; import com.fuint.business.marketingActivity.cardFavorable.service.CardFavorableService; import com.fuint.framework.web.BaseController; @@ -60,7 +60,7 @@ public class CardFavorableController extends BaseController { /** * 新增数据 * - * @param cardFavorable 实体对象 + * @param cardFavorableDTO 实体对象 * @return 新增结果 */ @PostMapping @@ -89,5 +89,21 @@ public class CardFavorableController extends BaseController { public ResponseObject delete(@RequestParam("idList") List idList) { return getSuccessResult(this.cardFavorableService.removeByIds(idList)); } + + + /** + *查询优惠券接口(小程序端) + * @param pageNo + * @param pageSize + * @param cardFavorable + * @return + */ + @GetMapping("applet") + public ResponseObject selectAllByCondition(@RequestParam(value = "pageNo",defaultValue = "1") Integer pageNo, + @RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize, + @Param("cardFuelDiesel") CardFavorableDTOS cardFavorableDTOS) { + Page page = new Page(pageNo, pageSize); + return getSuccessResult(this.cardFavorableService.selectAllByCondition(page,cardFavorableDTOS)); + } } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/dto/CardFavorableDTOS.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/dto/CardFavorableDTOS.java new file mode 100644 index 000000000..9227ea969 --- /dev/null +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/dto/CardFavorableDTOS.java @@ -0,0 +1,13 @@ +package com.fuint.business.marketingActivity.cardFavorable.dto; + +import com.fuint.business.marketingActivity.cardFavorable.entity.CardFavorable; +import lombok.Data; + +import java.io.Serializable; + +@Data +public class CardFavorableDTOS extends CardFavorable implements Serializable { + + private String couponType; + private Integer useStatus; +} diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/dto/QueryDTO.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/dto/QueryDTO.java new file mode 100644 index 000000000..b874761ad --- /dev/null +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/dto/QueryDTO.java @@ -0,0 +1,11 @@ +package com.fuint.business.marketingActivity.cardFavorable.dto; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class QueryDTO implements Serializable { + //券名称 + private String couponName; +} diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/mapper/CardFavorableRecordMapper.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/mapper/CardFavorableRecordMapper.java index c8254584e..901cab451 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/mapper/CardFavorableRecordMapper.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/mapper/CardFavorableRecordMapper.java @@ -1,9 +1,14 @@ package com.fuint.business.marketingActivity.cardFavorable.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.cardFavorable.dto.CardFavorableDTOS; import com.fuint.business.marketingActivity.cardFavorable.entity.CardFavorableRecord; +import com.fuint.business.marketingActivity.cardFavorable.vo.CouponVO; import org.apache.ibatis.annotations.Param; import java.util.HashMap; +import java.util.List; /** * (CardFavorableRecord)表数据库访问层 @@ -18,5 +23,11 @@ public interface CardFavorableRecordMapper extends BaseMapper selectTotal(@Param("storeId")Integer storeId,@Param("id")Integer id); + /** + * 查询优惠券接口(小程序) + * @param cardFavorableDTOS + */ + // List selectAllByCondition(Integer id); + IPage selectAllByCondition(@Param("page") Page page, @Param("cardFavorableDTOS") CardFavorableDTOS cardFavorableDTOS); } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/mapper/xml/CardFavorableRecordMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/mapper/xml/CardFavorableRecordMapper.xml index eb676e16b..6c7a57d43 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/mapper/xml/CardFavorableRecordMapper.xml +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/mapper/xml/CardFavorableRecordMapper.xml @@ -22,5 +22,55 @@ where store_id = #{storeId} and card_favorable_id = #{id} + + diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/service/CardFavorableService.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/service/CardFavorableService.java index b40f24d08..6c98b3de8 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/service/CardFavorableService.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/service/CardFavorableService.java @@ -4,6 +4,7 @@ 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.cardFavorable.dto.CardFavorableDTO; +import com.fuint.business.marketingActivity.cardFavorable.dto.CardFavorableDTOS; import com.fuint.business.marketingActivity.cardFavorable.entity.CardFavorable; import com.fuint.business.marketingActivity.cardFavorable.vo.CardFavorableVO; @@ -45,5 +46,13 @@ public interface CardFavorableService extends IService { * @return */ Boolean updateOneById(CardFavorableDTO cardFavorableDTO); + + /** + * 查询优惠券接口(小程序) + * @param page + * @param cardFavorable + * @return + */ + IPage selectAllByCondition(Page page, CardFavorableDTOS cardFavorableDTOS); } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/service/impl/CardFavorableServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/service/impl/CardFavorableServiceImpl.java index 339cd88ce..7c0dace8e 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/service/impl/CardFavorableServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/service/impl/CardFavorableServiceImpl.java @@ -5,11 +5,15 @@ 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.cardFavorable.dto.CardFavorableDTO; +import com.fuint.business.marketingActivity.cardFavorable.dto.CardFavorableDTOS; import com.fuint.business.marketingActivity.cardFavorable.mapper.CardFavorableMapper; import com.fuint.business.marketingActivity.cardFavorable.entity.CardFavorable; +import com.fuint.business.marketingActivity.cardFavorable.mapper.CardFavorableRecordMapper; import com.fuint.business.marketingActivity.cardFavorable.service.CardFavorableService; import com.fuint.business.marketingActivity.cardFavorable.vo.CardFavorableVO; +import com.fuint.business.marketingActivity.cardFavorable.vo.CouponVO; import com.fuint.business.store.service.StoreService; +import com.fuint.common.dto.AccountInfo; import com.fuint.common.util.TokenUtil; import org.apache.commons.lang3.ObjectUtils; import org.springframework.beans.BeanUtils; @@ -17,6 +21,7 @@ import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.io.Serializable; +import java.util.List; /** * (CardFavorable)表服务实现类 @@ -29,6 +34,8 @@ public class CardFavorableServiceImpl extends ServiceImpl couponVOS = cardFavorableRecordMapper.selectAllByCondition(page,cardFavorableDTOS); + return couponVOS; + } } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/vo/CouponVO.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/vo/CouponVO.java new file mode 100644 index 000000000..20c4e3e21 --- /dev/null +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/vo/CouponVO.java @@ -0,0 +1,27 @@ +package com.fuint.business.marketingActivity.cardFavorable.vo; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class CouponVO implements Serializable { + //券id + private Integer id; + //券类型 + private String couponType; + //券金额 + private String couponAmount; + //券名称 + private String couponName; + //券内容 + private String couponContent; + //使用状态 0:未使用 1:已使用 2:已失效 + private String useStatus; + //券有效期 + private String couponTime; + //券开始时间 + private String startTime; + //券结束时间 + private String endTime; +} diff --git a/gasStation-uni/pagesMy/Coupons/Coupons.vue b/gasStation-uni/pagesMy/Coupons/Coupons.vue index 3628d867f..54c52302a 100644 --- a/gasStation-uni/pagesMy/Coupons/Coupons.vue +++ b/gasStation-uni/pagesMy/Coupons/Coupons.vue @@ -16,14 +16,14 @@ {{item.name}} - + - ¥120 - 优惠券 + ¥{{item.couponAmount}} + {{item.couponType}} - 新用户专享5折券 - 部分产品可用、满240可用、此券定期可用... + {{item.couponName}} + {{item.couponContent}} 有效期:2023-11-30 @@ -39,9 +39,18 @@