feat:兑换优惠券列表
This commit is contained in:
1 parent
468414617d
commit
66f407f864
14 files changed
+153
-17
No files matched your search
-7
@@ -60,13 +60,6 @@ public class AdRecordController {
|
||||
return R.ok(adRecordService.reportAdView(dto));
|
||||
}
|
||||
|
||||
// @Operation(summary = "个人积分广告统计", description = "个人积分广告统计")
|
||||
// @PostMapping("/app/integral-total")
|
||||
// public R<AdIntegralTotalVo> integralTotal() {
|
||||
// PjcloudUser user = SecurityUtils.getUser();
|
||||
// return R.ok(adRecordService.integralTotal(user.getId()));
|
||||
// }
|
||||
|
||||
@Operation(summary = "个人积分广告分页", description = "个人积分广告分页")
|
||||
@GetMapping("/app/integral-page")
|
||||
public R<Page<AdRecordVo>> integralPage(@ParameterObject Page page, @ParameterObject AdRecordDto dto) {
|
||||
|
||||
+10
@@ -91,6 +91,16 @@ public class WalletSettingEntity extends Model<WalletSettingEntity> {
|
||||
*/
|
||||
private Long topupUserId;
|
||||
|
||||
/**
|
||||
* 看一个激励视频可以获取多少积分
|
||||
*/
|
||||
private Integer rewardedAdIntegral;
|
||||
|
||||
/**
|
||||
* 一天可以看多少个激励视频
|
||||
*/
|
||||
private Integer todayViewRewardedAdLimit;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
|
||||
+6
@@ -27,6 +27,12 @@ public class ActCouponEntity extends Model<ActCouponEntity> {
|
||||
@Schema(description = "优惠券ID")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 优惠券封面图
|
||||
*/
|
||||
@Schema(description = "优惠券封面图")
|
||||
private String coveImage;
|
||||
|
||||
/**
|
||||
* 父活动id
|
||||
*/
|
||||
|
||||
-6
@@ -32,12 +32,6 @@ public class IntegralManageEntity extends Model<IntegralManageEntity> {
|
||||
@Schema(description = "用户id")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 部门id
|
||||
*/
|
||||
@Schema(description = "部门id")
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 积分总数
|
||||
*/
|
||||
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
package com.bsd.pjcloud.wallet.api.vo.integral;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class IntegralMakeMoneyTotalVo {
|
||||
|
||||
@Schema(description = "积分总数")
|
||||
private Integer integralNum = 0;
|
||||
|
||||
@Schema(description = "今日已看激励广告")
|
||||
private Integer todayViewAdNum = 0;
|
||||
|
||||
@Schema(description = "今日可看激励广告的上限")
|
||||
private Integer todayViewAdLimitNum = 0;
|
||||
|
||||
@Schema(description = "看一个激励广告可获得积分")
|
||||
private Integer viewAdIntegralNum = 0;
|
||||
|
||||
}
|
||||
+21
@@ -7,8 +7,11 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.common.log.annotation.SysLog;
|
||||
import com.bsd.pjcloud.common.security.service.PjcloudUser;
|
||||
import com.bsd.pjcloud.common.security.util.SecurityUtils;
|
||||
import com.bsd.pjcloud.wallet.api.dto.integral.IntegralManageDto;
|
||||
import com.bsd.pjcloud.wallet.api.entity.integral.IntegralManageEntity;
|
||||
import com.bsd.pjcloud.wallet.api.vo.integral.IntegralMakeMoneyTotalVo;
|
||||
import com.bsd.pjcloud.wallet.api.vo.integral.IntegralManageVo;
|
||||
import com.bsd.pjcloud.wallet.service.IntegralManageService;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
@@ -36,6 +39,24 @@ public class IntegralManageController {
|
||||
|
||||
private final IntegralManageService integralManageService;
|
||||
|
||||
/* ************************************* start app start ************************************* */
|
||||
|
||||
@Operation(summary = "创建或获取用户积分", description = "创建或获取用户积分")
|
||||
@GetMapping("/app/get-or-create")
|
||||
public R<IntegralManageEntity> getOrCreate() {
|
||||
PjcloudUser user = SecurityUtils.getUser();
|
||||
return R.ok(integralManageService.getOrCreateIntegral(user.getId()));
|
||||
}
|
||||
|
||||
@Operation(summary = "我要赚钱面板统计", description = "我要赚钱面板统计")
|
||||
@GetMapping("/app/make-money-total")
|
||||
public R<IntegralMakeMoneyTotalVo> makeMoneyTotal() {
|
||||
PjcloudUser user = SecurityUtils.getUser();
|
||||
return R.ok(integralManageService.makeMoneyTotal(user.getId()));
|
||||
}
|
||||
|
||||
/* ************************************* end app end ************************************* */
|
||||
|
||||
/**
|
||||
* 查询分页页面
|
||||
*/
|
||||
|
||||
+11
@@ -9,6 +9,7 @@ import com.bsd.pjcloud.common.log.annotation.SysLog;
|
||||
import com.bsd.pjcloud.wallet.api.dto.act.ActAdDto;
|
||||
import com.bsd.pjcloud.wallet.api.entity.act.ActAdEntity;
|
||||
import com.bsd.pjcloud.wallet.api.vo.act.ActAdVo;
|
||||
import com.bsd.pjcloud.wallet.api.vo.act.ActCouponVo;
|
||||
import com.bsd.pjcloud.wallet.service.ActAdService;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import com.bsd.pjcloud.common.excel.annotation.ResponseExcel;
|
||||
@@ -34,6 +35,16 @@ public class ActAdController {
|
||||
|
||||
private final ActAdService actAdService;
|
||||
|
||||
/* ************************************* start app start ************************************* */
|
||||
|
||||
@Operation(summary = "激励广告兑换券分页", description = "激励广告兑换券分页")
|
||||
@GetMapping("/app/rewarded-ad-coupon-page")
|
||||
public R<Page<ActCouponVo>> rewardedAdCouponPage(@ParameterObject Page page) {
|
||||
return R.ok(actAdService.rewardedAdCouponPage(page));
|
||||
}
|
||||
|
||||
/* ************************************* end app end ************************************* */
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
|
||||
+6
@@ -7,6 +7,7 @@ import com.bsd.pjcloud.common.data.datascope.DataScope;
|
||||
import com.bsd.pjcloud.wallet.api.dto.act.ActAdDto;
|
||||
import com.bsd.pjcloud.wallet.api.entity.act.ActAdEntity;
|
||||
import com.bsd.pjcloud.wallet.api.vo.act.ActAdVo;
|
||||
import com.bsd.pjcloud.wallet.api.vo.act.ActCouponVo;
|
||||
|
||||
public interface ActAdService extends IService<ActAdEntity> {
|
||||
|
||||
@@ -15,4 +16,9 @@ public interface ActAdService extends IService<ActAdEntity> {
|
||||
Long create(ActAdDto dto);
|
||||
|
||||
ActAdEntity edit(ActAdDto dto);
|
||||
|
||||
/**
|
||||
* 激励广告兑换券分页
|
||||
*/
|
||||
Page<ActCouponVo> rewardedAdCouponPage(Page page);
|
||||
}
|
||||
+11
-1
@@ -5,13 +5,23 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.bsd.pjcloud.common.data.datascope.DataScope;
|
||||
import com.bsd.pjcloud.wallet.api.dto.integral.IntegralManageDto;
|
||||
import com.bsd.pjcloud.wallet.api.entity.integral.IntegralManageEntity;
|
||||
import com.bsd.pjcloud.wallet.api.vo.integral.IntegralMakeMoneyTotalVo;
|
||||
import com.bsd.pjcloud.wallet.api.vo.integral.IntegralManageVo;
|
||||
|
||||
public interface IntegralManageService extends IService<IntegralManageEntity> {
|
||||
|
||||
/**
|
||||
* 创建或获取用户积分
|
||||
*/
|
||||
IntegralManageEntity getOrCreateIntegral(Long userId);
|
||||
|
||||
/**
|
||||
* 我要赚钱面板统计
|
||||
*/
|
||||
IntegralMakeMoneyTotalVo makeMoneyTotal(Long userId);
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
Page<IntegralManageVo> scopePageList(Page page, IntegralManageDto dto, DataScope dataScope);
|
||||
|
||||
}
|
||||
-2
@@ -9,8 +9,6 @@ import com.bsd.pjcloud.wallet.api.dto.WalletSettingDto;
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletSettingEntity;
|
||||
import com.bsd.pjcloud.wallet.api.vo.WalletSettingVo;
|
||||
import com.bsd.pjcloud.wallet.mapper.WalletSettingMapper;
|
||||
import com.bsd.pjcloud.wallet.service.MchRuleJoinService;
|
||||
import com.bsd.pjcloud.wallet.service.WalletRuleJoinService;
|
||||
import com.bsd.pjcloud.wallet.service.WalletSettingService;
|
||||
import lombok.Data;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
+16
@@ -9,10 +9,12 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.bsd.pjcloud.common.data.datascope.DataScope;
|
||||
import com.bsd.pjcloud.wallet.api.constant.act.*;
|
||||
import com.bsd.pjcloud.wallet.api.dto.act.ActAdDto;
|
||||
import com.bsd.pjcloud.wallet.api.dto.act.ActCouponDto;
|
||||
import com.bsd.pjcloud.wallet.api.dto.act.ActCreateAdCouponDto;
|
||||
import com.bsd.pjcloud.wallet.api.entity.act.ActAdEntity;
|
||||
import com.bsd.pjcloud.wallet.api.entity.act.ActCouponEntity;
|
||||
import com.bsd.pjcloud.wallet.api.vo.act.ActAdVo;
|
||||
import com.bsd.pjcloud.wallet.api.vo.act.ActCouponVo;
|
||||
import com.bsd.pjcloud.wallet.mapper.act.ActAdMapper;
|
||||
import com.bsd.pjcloud.wallet.service.ActAdService;
|
||||
import com.bsd.pjcloud.wallet.service.ActCouponService;
|
||||
@@ -66,6 +68,20 @@ public class ActAdServiceImpl extends ServiceImpl<ActAdMapper, ActAdEntity> impl
|
||||
return baseMapper.selectById(entity.getId());
|
||||
}
|
||||
|
||||
/**
|
||||
* 激励广告兑换券分页
|
||||
*/
|
||||
@Override
|
||||
public Page<ActCouponVo> rewardedAdCouponPage(Page page) {
|
||||
ActAdEntity actAd = baseMapper.selectOne(new LambdaQueryWrapper<ActAdEntity>().eq(ActAdEntity::getUniqueCode, "wbcHjM"));
|
||||
if (ObjectUtil.isEmpty(actAd)) {
|
||||
return new Page<>();
|
||||
}
|
||||
ActCouponDto queryDto = new ActCouponDto();
|
||||
queryDto.setParentActId(actAd.getId());
|
||||
return actCouponService.pageJoin(page, queryDto);
|
||||
}
|
||||
|
||||
private void generateDefaultAct(ActAdEntity actAd) {
|
||||
if (ObjectUtil.isEmpty(actAd.getTypeList())) {
|
||||
return;
|
||||
|
||||
+50
@@ -1,13 +1,19 @@
|
||||
package com.bsd.pjcloud.wallet.service.impl.integral;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.extra.spring.SpringUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.bsd.pjcloud.common.data.datascope.DataScope;
|
||||
import com.bsd.pjcloud.wallet.api.dto.integral.IntegralManageDto;
|
||||
import com.bsd.pjcloud.wallet.api.entity.integral.IntegralManageEntity;
|
||||
import com.bsd.pjcloud.wallet.api.vo.WalletSettingVo;
|
||||
import com.bsd.pjcloud.wallet.api.vo.integral.IntegralMakeMoneyTotalVo;
|
||||
import com.bsd.pjcloud.wallet.api.vo.integral.IntegralManageVo;
|
||||
import com.bsd.pjcloud.wallet.mapper.integral.IntegralManageMapper;
|
||||
import com.bsd.pjcloud.wallet.service.IntegralManageService;
|
||||
import com.bsd.pjcloud.wallet.service.WalletSettingService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -22,6 +28,46 @@ import org.springframework.validation.annotation.Validated;
|
||||
@Service
|
||||
public class IntegralManageServiceImpl extends ServiceImpl<IntegralManageMapper, IntegralManageEntity> implements IntegralManageService {
|
||||
|
||||
private final WalletSettingService walletSettingService;
|
||||
|
||||
/**
|
||||
* 创建或获取用户积分
|
||||
*/
|
||||
@Override
|
||||
public IntegralManageEntity getOrCreateIntegral(Long userId) {
|
||||
IntegralManageEntity integral = baseMapper.selectOne(new LambdaQueryWrapper<IntegralManageEntity>().eq(IntegralManageEntity::getUserId, userId));
|
||||
if (ObjectUtil.isNotEmpty(integral)) {
|
||||
return integral;
|
||||
}
|
||||
// 创建用户积分
|
||||
IntegralManageEntity saveObj = new IntegralManageEntity();
|
||||
saveObj.setUserId(userId);
|
||||
baseMapper.insert(saveObj);
|
||||
return baseMapper.selectById(saveObj.getId());
|
||||
}
|
||||
|
||||
/**
|
||||
* 我要赚钱面板统计
|
||||
*/
|
||||
@Override
|
||||
public IntegralMakeMoneyTotalVo makeMoneyTotal(Long userId) {
|
||||
IntegralMakeMoneyTotalVo result = new IntegralMakeMoneyTotalVo();
|
||||
// 积分
|
||||
IntegralManageEntity integral = getSelf().getOrCreateIntegral(userId);
|
||||
if (ObjectUtil.isNotEmpty(integral)) {
|
||||
result.setIntegralNum(integral.getIntegralNum());
|
||||
}
|
||||
// 激励视频配置
|
||||
WalletSettingVo setting = walletSettingService.getSetting();
|
||||
if (ObjectUtil.isNotEmpty(setting)) {
|
||||
result.setTodayViewAdLimitNum(setting.getTodayViewRewardedAdLimit());
|
||||
result.setViewAdIntegralNum(setting.getRewardedAdIntegral());
|
||||
}
|
||||
// 今日已看视频
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
@@ -30,4 +76,8 @@ public class IntegralManageServiceImpl extends ServiceImpl<IntegralManageMapper,
|
||||
return baseMapper.scopePageList(page, dto, dataScope);
|
||||
}
|
||||
|
||||
private IntegralManageServiceImpl getSelf() {
|
||||
return SpringUtil.getBean(getClass());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -5,6 +5,7 @@
|
||||
<sql id="selectA">
|
||||
select a.id,
|
||||
a.unique_code,
|
||||
a.cove_image,
|
||||
a.parent_act_id,
|
||||
a.bind_notify_id,
|
||||
a.name,
|
||||
|
||||
-1
@@ -6,7 +6,6 @@
|
||||
<sql id="selectA">
|
||||
select a.id,
|
||||
a.user_id,
|
||||
a.dept_id,
|
||||
a.integral_num,
|
||||
a.total_expense,
|
||||
a.total_recharge,
|
||||
|
||||
Reference in new issue
Block a user