banner添加财富等级限制

This commit is contained in:
2025-06-24 18:26:37 +08:00
parent 2004b00589
commit 6d76351775
9 changed files with 48 additions and 125 deletions

View File

@@ -53,10 +53,10 @@ public class FirstPageBannerAdminService {
*/
public IPage<FirstPageBannerAdminVo> getFirstPageBannerList(Integer pageNumber, Integer pageSize, Byte skipType,
Byte bannerStatus, Byte bannerType, String beginTime,
String endTime, String appId, Integer partitionId, Integer regionId) {
String endTime, String appId, Integer partitionId, Integer regionId, String bannerName) {
QueryWrapper<FirstPageBanner> wrapper = new QueryWrapper<>();
LambdaQueryWrapper<FirstPageBanner> lambdaQueryWrapper = wrapper.lambda();
lambdaQueryWrapper.eq(skipType != null && skipType != 0, FirstPageBanner::getSkipType, skipType)
lambdaQueryWrapper.eq(skipType != null && skipType != -1, FirstPageBanner::getSkipType, skipType)
.eq(bannerStatus != null && bannerStatus != 0, FirstPageBanner::getBannerStatus, bannerStatus)
.eq(!StringUtils.isEmpty(appId), FirstPageBanner::getAppId, appId);
@@ -65,12 +65,15 @@ public class FirstPageBannerAdminService {
} else {
lambdaQueryWrapper.ne(FirstPageBanner::getBannerType, Constant.BannerType.BANNER_ACTIVITY);
}
if (StringUtils.isNotEmpty(bannerName)) {
lambdaQueryWrapper.like(FirstPageBanner::getBannerName, bannerName);
}
if (regionId != null && regionId != regionInfoService.ALL_REGION) {
lambdaQueryWrapper.eq(FirstPageBanner::getRegionId, regionId);
}
lambdaQueryWrapper.ge(!StringUtils.isEmpty(beginTime), FirstPageBanner::getStartTime, DateTimeUtil.convertStrToDate(beginTime))
.le(!StringUtils.isEmpty(endTime), FirstPageBanner::getEndTime, DateTimeUtil.convertStrToDate(endTime))
.like(partitionId != null, FirstPageBanner::getPartitionIds, partitionId)
.apply(partitionId != null && partitionId != 0, "JSON_CONTAINS(partition_ids, '"+ partitionId+"')")
.orderByAsc(FirstPageBanner::getSeqNo)
.orderByDesc(FirstPageBanner::getUpdateTime);
IPage<FirstPageBanner> iPage = new Page<>(pageNumber, pageSize);

View File

@@ -55,9 +55,10 @@ public class SecondPageBannerAdminService {
* @return
*/
public IPage<SecondPageBannerAdminVo> getSecondPageBannerList(Integer pageNumber, Integer pageSize, Byte skipType,
Byte bannerStatus, Byte bannerType, Integer timeStatus, String appId, Integer partitionId, Integer regionId) {
Byte bannerStatus, Byte bannerType, Integer timeStatus,
String appId, Integer partitionId, Integer regionId, String bannerName) {
LambdaQueryWrapper<SecondPageBanner> lambdaQueryWrapper = Wrappers.lambdaQuery();
lambdaQueryWrapper.eq(skipType != null && skipType != 0, SecondPageBanner::getSkipType, skipType)
lambdaQueryWrapper.eq(skipType != null && skipType != -1, SecondPageBanner::getSkipType, skipType)
.eq(bannerStatus != null && bannerStatus != 0, SecondPageBanner::getBannerStatus, bannerStatus)
.eq(!StringUtils.isEmpty(appId), SecondPageBanner::getAppId, appId);
@@ -74,11 +75,14 @@ public class SecondPageBannerAdminService {
} else if (timeStatus == 3) {//已过期
lambdaQueryWrapper.lt(SecondPageBanner::getEndTime, new Date());
}
if (StringUtils.isNotEmpty(bannerName)) {
lambdaQueryWrapper.like(SecondPageBanner::getBannerName, bannerName);
}
if (regionId != null && regionId != regionInfoService.ALL_REGION) {
lambdaQueryWrapper.eq(SecondPageBanner::getRegionId, regionId);
}
lambdaQueryWrapper.eq(SecondPageBanner::getDelTag, Constant.BannerDel.NO_DEL)
.like(partitionId != null, SecondPageBanner::getPartitionIds, partitionId)
.apply(partitionId != null && partitionId != 0, "JSON_CONTAINS(partition_ids, '"+ partitionId+"')")
.orderByAsc(SecondPageBanner::getSeqNo)
.orderByDesc(SecondPageBanner::getUpdateTime);
IPage<SecondPageBanner> iPage = new Page<>(pageNumber, pageSize);

View File

@@ -5,7 +5,6 @@ import com.accompany.admin.service.firstpage.SecondPageBannerAdminService;
import com.accompany.admin.service.system.AdminUserService;
import com.accompany.admin.service.userevent.vo.UserEventAdminVO;
import com.accompany.business.dto.DomainConfigDto;
import com.accompany.business.model.firstpage.FirstPageBanner;
import com.accompany.business.model.firstpage.SecondPageBanner;
import com.accompany.business.model.userevent.UserEvent;
import com.accompany.business.model.userevent.constant.UserEventConstant;
@@ -159,7 +158,7 @@ public class UserEventAdminService {
Long uid = userEvent.getUid();
if (eventStatus == UserEventConstant.EventStatus.PASS) {
baseSendService.sendSystemMsg(uid.toString(), I18NMessageSourceUtil.getMessage(I18nAlertEnum.USER_EVENT_PASS, uid));
this.addFirstBanner(userEvent, uid);
this.addSecondBanner(userEvent, uid);
} else if (eventStatus == UserEventConstant.EventStatus.REJECT) {
if (userEvent.getPayBanner() == UserEventConstant.PayBanner.YES) {
//扣钱
@@ -172,7 +171,7 @@ public class UserEventAdminService {
return BusiResult.success();
}
private void addFirstBanner(UserEvent userEvent, Long uid) {
private void addSecondBanner(UserEvent userEvent, Long uid) {
if (userEvent.getPayBanner() != UserEventConstant.PayBanner.YES) {
return;
}

View File

@@ -71,9 +71,9 @@ public class FirstPageBannerAdminController extends BaseController {
@GetMapping(value = "/list")
public Pagination<FirstPageBannerAdminVo> getFirstPageBannerList(Byte skipType, Byte bannerStatus, Byte bannerType,
String beginTime, String endTime, String appId,
Integer partitionId, Integer regionId) {
Integer partitionId, Integer regionId, String bannerName) {
IPage<FirstPageBannerAdminVo> pageInfo = firstPageBannerAdminService.getFirstPageBannerList(getPageNumber(), getPageSize(),
skipType, bannerStatus, bannerType,beginTime,endTime,appId, partitionId, regionId);
skipType, bannerStatus, bannerType,beginTime,endTime,appId, partitionId, regionId, bannerName);
return new Pagination<>(pageInfo);
}

View File

@@ -65,10 +65,10 @@ public class SecondPageBannerAdminController extends BaseController {
@GetMapping(value = "/list")
public Pagination<SecondPageBannerAdminVo> getSecondPageBannerList(Byte skipType, @RequestParam(defaultValue = "0") Byte bannerStatus,
Byte bannerType, @RequestParam(defaultValue = "0") Integer timeStatus,
String appId, Integer partitionId,
@RequestParam(defaultValue = "1") Integer pageNo, @RequestParam(defaultValue = "20") Integer pageSize, Integer regionId) {
String appId, Integer partitionId, @RequestParam(defaultValue = "1") Integer pageNo,
@RequestParam(defaultValue = "20") Integer pageSize, Integer regionId, String bannerName) {
IPage<SecondPageBannerAdminVo> pageInfo = secondPageBannerAdminService.getSecondPageBannerList(pageNo, pageSize,
skipType, bannerStatus, bannerType, timeStatus,appId, partitionId, regionId);
skipType, bannerStatus, bannerType, timeStatus,appId, partitionId, regionId, bannerName);
return new Pagination<>(pageInfo);
}