diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/common/BaseConstants.java b/dl-module-base/src/main/java/cn/iocoder/yudao/common/BaseConstants.java index ef0b5aa2..5f51b8fa 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/common/BaseConstants.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/common/BaseConstants.java @@ -55,4 +55,23 @@ public class BaseConstants { public static final String ARCHIVES_TYPE = "archives_type"; /**卡片关联关系主表*/ public static final String ACTIVE_RULE_COUPON_ACTIVE = "dl_active_main"; + /**卡券积分变更记录-充值*/ + public static final String BALANCE_CHANGE_TYPE_CZ = "cz"; + /**卡券积分变更记录-退款*/ + public static final String BALANCE_CHANGE_TYPE_TK = "tk"; + /**卡券积分变更记录-消费*/ + public static final String BALANCE_CHANGE_TYPE_XF = "xf"; + /**卡券积分变更记录-赠送*/ + public static final String BALANCE_CHANGE_TYPE_ZS = "zs"; + /**卡券积分变更记录-卡券核销*/ + public static final String BALANCE_CHANGE_TYPE_KQHX = "kqhx"; + /**卡券积分变更主体-余额*/ + public static final String BALANCE_CHANGE_MAIN_YE = "ye"; + /**卡券积分变更主体-卡券*/ + public static final String BALANCE_CHANGE_MAIN_KQ = "kq"; + /**卡券积分变更核销规则-计次*/ + public static final String BALANCE_CHANGE_RULE_JC = "jc"; + /**卡券积分变更核销规则-金额*/ + public static final String BALANCE_CHANGE_RULE_ME = "je"; + } diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/controller/admin/CustomerBalanceChangeController.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/controller/admin/CustomerBalanceChangeController.java index 25a187c1..2772fc11 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/controller/admin/CustomerBalanceChangeController.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/controller/admin/CustomerBalanceChangeController.java @@ -1,22 +1,22 @@ package cn.iocoder.yudao.module.custom.controller.admin; import cn.iocoder.yudao.framework.common.pojo.CommonResult; -import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.util.object.BeanUtils; -import cn.iocoder.yudao.module.custom.entity.CustomerBalanceChange; import cn.iocoder.yudao.module.custom.service.CustomerBalanceChangeService; import cn.iocoder.yudao.module.custom.vo.CustomerBalanceChangePageReqVO; import cn.iocoder.yudao.module.custom.vo.CustomerBalanceChangeRespVO; -import cn.iocoder.yudao.module.custom.vo.CustomerBalanceChangeSaveReqVO; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; -import javax.validation.Valid; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; @@ -29,45 +29,24 @@ public class CustomerBalanceChangeController { @Resource private CustomerBalanceChangeService customerBalanceChangeService; - @PostMapping("/create") - @Operation(summary = "创建用户积分(余额)、卡券变动记录") - @PreAuthorize("@ss.hasPermission('base:customer-balance-change:create')") - public CommonResult createCustomerBalanceChange(@Valid @RequestBody CustomerBalanceChangeSaveReqVO createReqVO) { - return success(customerBalanceChangeService.createCustomerBalanceChange(createReqVO)); - } - - @PutMapping("/update") - @Operation(summary = "更新用户积分(余额)、卡券变动记录") - @PreAuthorize("@ss.hasPermission('base:customer-balance-change:update')") - public CommonResult updateCustomerBalanceChange(@Valid @RequestBody CustomerBalanceChangeSaveReqVO updateReqVO) { - customerBalanceChangeService.updateCustomerBalanceChange(updateReqVO); - return success(true); - } - - @DeleteMapping("/delete") - @Operation(summary = "删除用户积分(余额)、卡券变动记录") - @Parameter(name = "id", description = "编号", required = true) - @PreAuthorize("@ss.hasPermission('base:customer-balance-change:delete')") - public CommonResult deleteCustomerBalanceChange(@RequestParam("id") String id) { - customerBalanceChangeService.deleteCustomerBalanceChange(id); - return success(true); - } - - @GetMapping("/get") - @Operation(summary = "获得用户积分(余额)、卡券变动记录") - @Parameter(name = "id", description = "编号", required = true, example = "1024") - @PreAuthorize("@ss.hasPermission('base:customer-balance-change:query')") - public CommonResult getCustomerBalanceChange(@RequestParam("id") String id) { - CustomerBalanceChange customerBalanceChange = customerBalanceChangeService.getCustomerBalanceChange(id); - return success(BeanUtils.toBean(customerBalanceChange, CustomerBalanceChangeRespVO.class)); - } - + /** + * 分页查询变更记录 + * + * @param pageReqVO CustomerBalanceChangePageReqVO实体 + * @param pageNo 分页参数 + * @param pageSize 分页参数 + * @return cn.iocoder.yudao.framework.common.pojo.CommonResult> + * @author PQZ + * @date 22:37 2024/9/20 + **/ @GetMapping("/page") @Operation(summary = "获得用户积分(余额)、卡券变动记录分页") @PreAuthorize("@ss.hasPermission('base:customer-balance-change:query')") - public CommonResult> getCustomerBalanceChangePage(@Valid CustomerBalanceChangePageReqVO pageReqVO) { - PageResult pageResult = customerBalanceChangeService.getCustomerBalanceChangePage(pageReqVO); - return success(BeanUtils.toBean(pageResult, CustomerBalanceChangeRespVO.class)); + public CommonResult> getCustomerBalanceChangePage(CustomerBalanceChangePageReqVO pageReqVO, + @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { + Page page = new Page<>(pageNo, pageSize); + return success(customerBalanceChangeService.queryListPage(pageReqVO,page)); } diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/controller/admin/CustomerBalanceController.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/controller/admin/CustomerBalanceController.java index aec8e64e..f941226c 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/controller/admin/CustomerBalanceController.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/controller/admin/CustomerBalanceController.java @@ -3,7 +3,9 @@ package cn.iocoder.yudao.module.custom.controller.admin; import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.module.custom.service.CustomerBalanceService; import cn.iocoder.yudao.module.custom.vo.CustomerBalanceSaveReqVO; +import cn.iocoder.yudao.module.custom.vo.CustomerMainRespVO; import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/controller/admin/CustomerCouponController.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/controller/admin/CustomerCouponController.java index de5ddfd8..a657960b 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/controller/admin/CustomerCouponController.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/controller/admin/CustomerCouponController.java @@ -44,6 +44,13 @@ public class CustomerCouponController { return success(true); } + /** + * 删除用户卡券 + * @author PQZ + * @date 22:57 2024/9/20 + * @param id TODO + * @return cn.iocoder.yudao.framework.common.pojo.CommonResult + **/ @DeleteMapping("/delete") @Operation(summary = "删除用户卡券") @Parameter(name = "id", description = "编号", required = true) @@ -53,13 +60,19 @@ public class CustomerCouponController { return success(true); } + /** + * 获取卡券信息及当前消费记录 + * @author PQZ + * @date 22:56 2024/9/20 + * @param id 用户卡券id + * @return cn.iocoder.yudao.framework.common.pojo.CommonResult + **/ @GetMapping("/get") @Operation(summary = "获得用户卡券") @Parameter(name = "id", description = "编号", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('base:customer-coupon:query')") public CommonResult getCustomerCoupon(@RequestParam("id") String id) { - CustomerCoupon customerCoupon = customerCouponService.getCustomerCoupon(id); - return success(BeanUtils.toBean(customerCoupon, CustomerCouponRespVO.class)); + return success(customerCouponService.getCustomerCoupon(id)); } @GetMapping("/page") diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/entity/CustomerBalanceChange.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/entity/CustomerBalanceChange.java index 6fa1904b..66ffac95 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/entity/CustomerBalanceChange.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/entity/CustomerBalanceChange.java @@ -55,18 +55,10 @@ public class CustomerBalanceChange extends TenantBaseDO { * 变动金额 */ private BigDecimal changeBalance; - /** - * 变动次数 - */ - private Integer changeNum; /** * 变动后剩余积分 */ private BigDecimal remBalance; - /** - * 变动后剩余次数 - */ - private Integer remNum; /** * 变动原因 */ diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/mapper/CustomerBalanceChangeMapper.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/mapper/CustomerBalanceChangeMapper.java index f4d04b3a..fd8a49e1 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/mapper/CustomerBalanceChangeMapper.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/mapper/CustomerBalanceChangeMapper.java @@ -1,8 +1,13 @@ package cn.iocoder.yudao.module.custom.mapper; import cn.iocoder.yudao.module.custom.entity.CustomerBalanceChange; +import cn.iocoder.yudao.module.custom.vo.CustomerBalanceChangePageReqVO; +import cn.iocoder.yudao.module.custom.vo.CustomerBalanceChangeRespVO; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; /** * 用户积分(余额)、卡券变动记录 Mapper @@ -12,6 +17,14 @@ import org.apache.ibatis.annotations.Mapper; @Mapper public interface CustomerBalanceChangeMapper extends BaseMapper { + /** + * @param entity CustomerBalanceChangePageReqVO实体 + * @param page 分页参数 + * @return com.baomidou.mybatisplus.core.metadata.IPage + * @author PQZ + * @date 22:40 2024/9/20 + **/ + IPage queryListPage(@Param("entity") CustomerBalanceChangePageReqVO entity, Page page); } \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/mapper/CustomerCouponMapper.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/mapper/CustomerCouponMapper.java index 83dfb1dd..f677411e 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/mapper/CustomerCouponMapper.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/mapper/CustomerCouponMapper.java @@ -1,8 +1,12 @@ package cn.iocoder.yudao.module.custom.mapper; import cn.iocoder.yudao.module.custom.entity.CustomerCoupon; +import cn.iocoder.yudao.module.custom.vo.CustomerCouponRespVO; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 用户积分(余额) Mapper @@ -12,6 +16,14 @@ import org.apache.ibatis.annotations.Mapper; @Mapper public interface CustomerCouponMapper extends BaseMapper { - + /** + * 根据用户id获取卡券信息 + * + * @param cusId 用户id + * @return java.util.List + * @author PQZ + * @date 20:44 2024/9/20 + **/ + List listByCusId(@Param("cusId") String cusId); } \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/CustomerBalanceChangeService.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/CustomerBalanceChangeService.java index a9702b22..120636f8 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/CustomerBalanceChangeService.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/CustomerBalanceChangeService.java @@ -1,12 +1,14 @@ package cn.iocoder.yudao.module.custom.service; -import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.module.custom.entity.CustomerBalanceChange; import cn.iocoder.yudao.module.custom.vo.CustomerBalanceChangePageReqVO; -import cn.iocoder.yudao.module.custom.vo.CustomerBalanceChangeSaveReqVO; +import cn.iocoder.yudao.module.custom.vo.CustomerBalanceChangeRespVO; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.IService; -import javax.validation.Valid; +import java.math.BigDecimal; +import java.util.List; /** * 用户积分(余额)、卡券变动记录 Service 接口 @@ -16,34 +18,20 @@ import javax.validation.Valid; public interface CustomerBalanceChangeService extends IService { /** - * 创建用户积分(余额)、卡券变动记录 - * - * @param createReqVO 创建信息 - * @return 编号 - */ - String createCustomerBalanceChange(@Valid CustomerBalanceChangeSaveReqVO createReqVO); + * @param cusId 客户id + * @param userId 用户id + * @param couponId 关联卡券id + * @param changeType 变动类型 + * @param changeMain 变动主体 + * @param changeRule 变动规则 + * @param changeBalance 变动积分/次数 + * @param remBalance 变动后剩余积分/次数 + * @param reason 变动原因 + * @author PQZ + * @date 21:54 2024/9/20 + **/ + void saveChange(String cusId, Integer userId, String couponId, String changeType, String changeMain, String changeRule, BigDecimal changeBalance, BigDecimal remBalance, String reason); - /** - * 更新用户积分(余额)、卡券变动记录 - * - * @param updateReqVO 更新信息 - */ - void updateCustomerBalanceChange(@Valid CustomerBalanceChangeSaveReqVO updateReqVO); - - /** - * 删除用户积分(余额)、卡券变动记录 - * - * @param id 编号 - */ - void deleteCustomerBalanceChange(String id); - - /** - * 获得用户积分(余额)、卡券变动记录 - * - * @param id 编号 - * @return 用户积分(余额)、卡券变动记录 - */ - CustomerBalanceChange getCustomerBalanceChange(String id); /** * 获得用户积分(余额)、卡券变动记录分页 @@ -51,6 +39,17 @@ public interface CustomerBalanceChangeService extends IService getCustomerBalanceChangePage(CustomerBalanceChangePageReqVO pageReqVO); + IPage queryListPage(CustomerBalanceChangePageReqVO pageReqVO, Page page); + + /** + * 通过用户id和卡券id查询积分、卡券的变动记录 + * + * @param cusId 用户id + * @param couponId 卡券id + * @return java.util.List + * @author PQZ + * @date 22:48 2024/9/20 + **/ + List getCouponChange(String cusId, String couponId); } \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/CustomerCouponService.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/CustomerCouponService.java index c43b49bc..8836048f 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/CustomerCouponService.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/CustomerCouponService.java @@ -3,10 +3,12 @@ package cn.iocoder.yudao.module.custom.service; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.module.custom.entity.CustomerCoupon; import cn.iocoder.yudao.module.custom.vo.CustomerCouponPageReqVO; +import cn.iocoder.yudao.module.custom.vo.CustomerCouponRespVO; import cn.iocoder.yudao.module.custom.vo.CustomerCouponSaveReqVO; import com.baomidou.mybatisplus.extension.service.IService; import javax.validation.Valid; +import java.util.List; /** * 用户卡券 Service 接口 @@ -38,12 +40,13 @@ public interface CustomerCouponService extends IService { void deleteCustomerCoupon(String id); /** - * 获得用户卡券 - * - * @param id 编号 - * @return 用户卡券 - */ - CustomerCoupon getCustomerCoupon(String id); + * 获取用户卡券信息及卡券变动信息 + * @author PQZ + * @date 22:51 2024/9/20 + * @param id 用户卡券id + * @return cn.iocoder.yudao.module.custom.vo.CustomerCouponRespVO + **/ + CustomerCouponRespVO getCustomerCoupon(String id); /** * 获得用户卡券分页 @@ -53,4 +56,13 @@ public interface CustomerCouponService extends IService { */ PageResult getCustomerCouponPage(CustomerCouponPageReqVO pageReqVO); + /** + * 根据用户id获取卡券信息 + * @author PQZ + * @date 20:43 2024/9/20 + * @param cusId 用户id + * @return java.util.List + **/ + List listByCusId(String cusId); + } \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/CustomerBalanceChangeServiceImpl.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/CustomerBalanceChangeServiceImpl.java index 986e8b9d..29835c9f 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/CustomerBalanceChangeServiceImpl.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/CustomerBalanceChangeServiceImpl.java @@ -2,16 +2,23 @@ package cn.iocoder.yudao.module.custom.service.impl; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.util.object.BeanUtils; +import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; import cn.iocoder.yudao.module.custom.entity.CustomerBalanceChange; import cn.iocoder.yudao.module.custom.mapper.CustomerBalanceChangeMapper; import cn.iocoder.yudao.module.custom.service.CustomerBalanceChangeService; import cn.iocoder.yudao.module.custom.vo.CustomerBalanceChangePageReqVO; +import cn.iocoder.yudao.module.custom.vo.CustomerBalanceChangeRespVO; import cn.iocoder.yudao.module.custom.vo.CustomerBalanceChangeSaveReqVO; +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 org.springframework.stereotype.Service; import org.springframework.validation.annotation.Validated; import javax.annotation.Resource; +import java.math.BigDecimal; +import java.util.List; /** * 用户积分(余额)、卡券变动记录 Service 实现类 @@ -25,38 +32,64 @@ public class CustomerBalanceChangeServiceImpl extends ServiceImpl queryListPage(CustomerBalanceChangePageReqVO pageReqVO, Page page) { + return customerBalanceChangeMapper.queryListPage(pageReqVO, page); } + /** + * 通过用户id和卡券id查询积分、卡券的变动记录 + * + * @param cusId 用户id + * @param couponId 卡券id + * @return java.util.List + * @author PQZ + * @date 22:48 2024/9/20 + **/ @Override - public void deleteCustomerBalanceChange(String id) { - // 删除 - customerBalanceChangeMapper.deleteById(id); + public List getCouponChange(String cusId, String couponId) { + LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); + lambdaQueryWrapper.eq(CustomerBalanceChange::getCusId,cusId) + .eq(CustomerBalanceChange::getCouponId,couponId) + .eq(BaseDO::getDeleted,'0'); + return list(lambdaQueryWrapper); } - - @Override - public CustomerBalanceChange getCustomerBalanceChange(String id) { - return customerBalanceChangeMapper.selectById(id); - } - - @Override - public PageResult getCustomerBalanceChangePage(CustomerBalanceChangePageReqVO pageReqVO) { - return null; - } - } \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/CustomerCouponServiceImpl.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/CustomerCouponServiceImpl.java index 6d60c711..26aaf0a0 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/CustomerCouponServiceImpl.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/CustomerCouponServiceImpl.java @@ -2,16 +2,20 @@ package cn.iocoder.yudao.module.custom.service.impl; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.util.object.BeanUtils; +import cn.iocoder.yudao.module.custom.entity.CustomerBalanceChange; import cn.iocoder.yudao.module.custom.entity.CustomerCoupon; import cn.iocoder.yudao.module.custom.mapper.CustomerCouponMapper; +import cn.iocoder.yudao.module.custom.service.CustomerBalanceChangeService; import cn.iocoder.yudao.module.custom.service.CustomerCouponService; import cn.iocoder.yudao.module.custom.vo.CustomerCouponPageReqVO; +import cn.iocoder.yudao.module.custom.vo.CustomerCouponRespVO; import cn.iocoder.yudao.module.custom.vo.CustomerCouponSaveReqVO; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.stereotype.Service; import org.springframework.validation.annotation.Validated; import javax.annotation.Resource; +import java.util.List; /** * 用户卡券 Service 实现类 @@ -24,6 +28,8 @@ public class CustomerCouponServiceImpl extends ServiceImpl changeList = changeService.getCouponChange(coupon.getCusId(),coupon.getCouponId()); + result.setChangeList(changeList); + return result; } @Override @@ -59,4 +75,17 @@ public class CustomerCouponServiceImpl extends ServiceImpl + * @author PQZ + * @date 20:43 2024/9/20 + **/ + @Override + public List listByCusId(String cusId) { + return customerCouponMapper.listByCusId(cusId); + } + } \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/CustomerMainServiceImpl.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/CustomerMainServiceImpl.java index 5ca16194..e2ae719d 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/CustomerMainServiceImpl.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/CustomerMainServiceImpl.java @@ -12,6 +12,7 @@ import cn.iocoder.yudao.module.custom.entity.CustomerMain; import cn.iocoder.yudao.module.custom.mapper.CustomerCarMapper; import cn.iocoder.yudao.module.custom.mapper.CustomerMainMapper; import cn.iocoder.yudao.module.custom.service.CustomerCarService; +import cn.iocoder.yudao.module.custom.service.CustomerCouponService; import cn.iocoder.yudao.module.custom.service.CustomerItemService; import cn.iocoder.yudao.module.custom.service.CustomerMainService; import cn.iocoder.yudao.module.custom.vo.*; @@ -70,6 +71,8 @@ public class CustomerMainServiceImpl extends ServiceImpl labelList = busiLabelService.listByMainId(id); result.setLabelList(labelList); + /*5、卡券信息*/ + List couponList = customerCouponService.listByCusId(id); + result.setCouponList(couponList); return result; } diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CustomerCouponPageReqVO.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CustomerCouponPageReqVO.java index f74f48b8..2b703b3e 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CustomerCouponPageReqVO.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CustomerCouponPageReqVO.java @@ -18,5 +18,4 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_ public class CustomerCouponPageReqVO extends CustomerCoupon { - } \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CustomerCouponRespVO.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CustomerCouponRespVO.java index b4997238..d14ef1d2 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CustomerCouponRespVO.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CustomerCouponRespVO.java @@ -1,5 +1,6 @@ package cn.iocoder.yudao.module.custom.vo; +import cn.iocoder.yudao.module.custom.entity.CustomerBalanceChange; import cn.iocoder.yudao.module.custom.entity.CustomerCoupon; import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; @@ -13,6 +14,35 @@ import com.alibaba.excel.annotation.*; @Data @ExcelIgnoreUnannotated public class CustomerCouponRespVO extends CustomerCoupon { + /** + * 卡券名称 + */ + private String couponName; + /** + * 卡券类型(保养卡、服务券、礼包券) + */ + private String couponType; + /** + * 适用车型(数据字典) + */ + private String carModel; + /** + * 开始有效期 + */ + private LocalDateTime beginTime; + /** + * 结束有效期 + */ + private LocalDateTime endTime; + /** + * 效果图片 + */ + private String image; + /** + * 来源活动名称 + */ + private String activeName; + private List changeList; } \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CustomerCouponSaveReqVO.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CustomerCouponSaveReqVO.java index 5559d89e..63ea2969 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CustomerCouponSaveReqVO.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CustomerCouponSaveReqVO.java @@ -12,5 +12,4 @@ import java.math.BigDecimal; public class CustomerCouponSaveReqVO extends CustomerCoupon { - } \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CustomerMainRespVO.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CustomerMainRespVO.java index 267ff7a0..13ef1dac 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CustomerMainRespVO.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CustomerMainRespVO.java @@ -29,6 +29,8 @@ public class CustomerMainRespVO extends CustomerMain { List labelList; /**车辆品牌型号数组*/ List brandAndModel; + /**关联卡券信息*/ + List couponList; /**会员名称 */ private String levelName; /**是否车主(0否1是)*/ diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/member/vo/ActiveMainPageReqVO.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/member/vo/ActiveMainPageReqVO.java index d6477f07..bc45aee2 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/member/vo/ActiveMainPageReqVO.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/member/vo/ActiveMainPageReqVO.java @@ -15,5 +15,6 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_ @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class ActiveMainPageReqVO extends ActiveMain { - + /**用于判断是否查询当前时间段可参与的活动*/ + private String isNow; } \ No newline at end of file diff --git a/dl-module-base/src/main/resources/mapper/custom/CustomerBalanceChangeMapper.xml b/dl-module-base/src/main/resources/mapper/custom/CustomerBalanceChangeMapper.xml index 0b6e412c..36992a75 100644 --- a/dl-module-base/src/main/resources/mapper/custom/CustomerBalanceChangeMapper.xml +++ b/dl-module-base/src/main/resources/mapper/custom/CustomerBalanceChangeMapper.xml @@ -9,4 +9,23 @@ 文档可见:https://www.iocoder.cn/MyBatis/x-plugins/ --> + \ No newline at end of file diff --git a/dl-module-base/src/main/resources/mapper/custom/CustomerCouponMapper.xml b/dl-module-base/src/main/resources/mapper/custom/CustomerCouponMapper.xml index 944035d2..d35a7c11 100644 --- a/dl-module-base/src/main/resources/mapper/custom/CustomerCouponMapper.xml +++ b/dl-module-base/src/main/resources/mapper/custom/CustomerCouponMapper.xml @@ -9,4 +9,24 @@ 文档可见:https://www.iocoder.cn/MyBatis/x-plugins/ --> + \ No newline at end of file diff --git a/dl-module-base/src/main/resources/mapper/member/ActiveMainMapper.xml b/dl-module-base/src/main/resources/mapper/member/ActiveMainMapper.xml index 6b150b2d..344c0455 100644 --- a/dl-module-base/src/main/resources/mapper/member/ActiveMainMapper.xml +++ b/dl-module-base/src/main/resources/mapper/member/ActiveMainMapper.xml @@ -16,6 +16,10 @@ dl_active_main dam dam.deleted = 0 + + AND begin_time <= NOW() + AND end_time >= NOW() + and dam.name like concat('%', #{entity.name}, '%')