123
This commit is contained in:
@@ -16,7 +16,7 @@ public class EveryDaysJob {
|
|||||||
public void run() {
|
public void run() {
|
||||||
try {
|
try {
|
||||||
log.info("执行用户VIP状态码回转-开始");
|
log.info("执行用户VIP状态码回转-开始");
|
||||||
busOp.refreshUserVipStatus();
|
// busOp.refreshUserVipStatus();
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
log.error("执行用户VIP状态码回转-失败!",e);
|
log.error("执行用户VIP状态码回转-失败!",e);
|
||||||
}finally {
|
}finally {
|
||||||
|
|||||||
@@ -39,41 +39,59 @@ public class RankJob {
|
|||||||
LocalDate now = LocalDate.now();
|
LocalDate now = LocalDate.now();
|
||||||
LocalDate date = now.plusDays(-1);
|
LocalDate date = now.plusDays(-1);
|
||||||
try {
|
try {
|
||||||
|
log.info("保存魅力 日榜开始执行");
|
||||||
rankService.saveDayRank(date,1);
|
rankService.saveDayRank(date,1);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("保存魅力 日榜失败", e);
|
log.error("保存魅力 日榜失败", e);
|
||||||
|
} finally {
|
||||||
|
log.info("保存魅力 日榜结束执行");
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
log.info("保存邀请 日榜开始执行");
|
||||||
rankService.saveDayRank(date,2);
|
rankService.saveDayRank(date,2);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("保存邀请 日榜失败", e);
|
log.error("保存邀请 日榜失败", e);
|
||||||
|
} finally {
|
||||||
|
log.info("保存邀请 日榜结束执行");
|
||||||
}
|
}
|
||||||
DayOfWeek week = now.getDayOfWeek();
|
DayOfWeek week = now.getDayOfWeek();
|
||||||
if (week.getValue() == 1) { // 今天是周一 做一下持久化
|
if (week.getValue() == 1) { // 今天是周一 做一下持久化
|
||||||
LocalDate lastWeekDate = now.plusDays(-7);
|
LocalDate lastWeekDate = now.plusDays(-7);
|
||||||
try {
|
try {
|
||||||
|
log.info("保存魅力 周榜开始执行");
|
||||||
rankService.saveWeekRank(lastWeekDate,1);
|
rankService.saveWeekRank(lastWeekDate,1);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("保存魅力 周榜失败", e);
|
log.error("保存魅力 周榜失败", e);
|
||||||
|
} finally {
|
||||||
|
log.info("保存魅力 周榜结束执行");
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
log.info("保存邀请 周榜开始执行");
|
||||||
rankService.saveWeekRank(lastWeekDate,2);
|
rankService.saveWeekRank(lastWeekDate,2);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("保存邀请 周榜失败", e);
|
log.error("保存邀请 周榜失败", e);
|
||||||
|
} finally {
|
||||||
|
log.info("保存邀请 周榜结束执行");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int month = now.getDayOfMonth();
|
int month = now.getDayOfMonth();
|
||||||
if (month == 1) { // 昨天是1号
|
if (month == 1) { // 昨天是1号
|
||||||
LocalDate lastMonthDate = now.plusMonths(-1);
|
LocalDate lastMonthDate = now.plusMonths(-1);
|
||||||
try {
|
try {
|
||||||
|
log.info("保存魅力 月榜开始执行");
|
||||||
rankService.saveMonthRank(lastMonthDate,1);
|
rankService.saveMonthRank(lastMonthDate,1);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("保存魅力 月榜失败", e);
|
log.error("保存魅力 月榜失败", e);
|
||||||
|
} finally {
|
||||||
|
log.info("保存魅力 月榜结束执行");
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
log.info("保存邀请 月榜开始执行");
|
||||||
rankService.saveMonthRank(lastMonthDate,2);
|
rankService.saveMonthRank(lastMonthDate,2);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("保存邀请 月榜失败", e);
|
log.error("保存邀请 月榜失败", e);
|
||||||
|
} finally {
|
||||||
|
log.info("保存邀请 月榜结束执行");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
@@ -83,9 +101,12 @@ public class RankJob {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
log.info("刷新用户年龄 开始执行");
|
||||||
userService.refreshByAge();
|
userService.refreshByAge();
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
log.error("刷新用户年龄失败!",e);
|
log.error("刷新用户年龄失败!",e);
|
||||||
|
} finally {
|
||||||
|
log.info("刷新用户年龄 结束执行");
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
long anchorNum = anchorService.count(Wrappers.emptyWrapper());
|
long anchorNum = anchorService.count(Wrappers.emptyWrapper());
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ public class BusOp {
|
|||||||
|
|
||||||
public void refreshUserVipStatus(){
|
public void refreshUserVipStatus(){
|
||||||
int current = 0;
|
int current = 0;
|
||||||
Page<User> page = new Page<>(0, 10);
|
Page<User> page = new Page<>(0, 100);
|
||||||
while (true){
|
while (true){
|
||||||
current++;
|
current++;
|
||||||
page.setCurrent(current);
|
page.setCurrent(current);
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ import org.springframework.web.bind.annotation.GetMapping;
|
|||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
@@ -103,6 +104,10 @@ public class IndexController {
|
|||||||
if(query.getType() == null){
|
if(query.getType() == null){
|
||||||
query.setType(1);
|
query.setType(1);
|
||||||
}
|
}
|
||||||
|
if(page.checkPageNum(5)){
|
||||||
|
return R.ok(Collections.emptyList());
|
||||||
|
}
|
||||||
|
page.resetPageSize();
|
||||||
Page<UserListVo> res = userService.pageApp(page,query);
|
Page<UserListVo> res = userService.pageApp(page,query);
|
||||||
return R.ok(res.getRecords());
|
return R.ok(res.getRecords());
|
||||||
}
|
}
|
||||||
@@ -111,6 +116,10 @@ public class IndexController {
|
|||||||
@Operation(summary = "群打招呼界面-用户搜索接口")
|
@Operation(summary = "群打招呼界面-用户搜索接口")
|
||||||
@Log(title = "群打招呼界面-用户搜索接口", businessType = BusinessType.OTHER, isPrintResponseData = false, isSaveDb = false)
|
@Log(title = "群打招呼界面-用户搜索接口", businessType = BusinessType.OTHER, isPrintResponseData = false, isSaveDb = false)
|
||||||
public R<List<UserListVo>> greetQuery(PageQuery page, GreetQuery query){
|
public R<List<UserListVo>> greetQuery(PageQuery page, GreetQuery query){
|
||||||
|
if(page.checkPageNum(5)){
|
||||||
|
return R.ok(Collections.emptyList());
|
||||||
|
}
|
||||||
|
page.resetPageSize();
|
||||||
Page<UserListVo> res = userService.greetPageApp(page,query);
|
Page<UserListVo> res = userService.greetPageApp(page,query);
|
||||||
return R.ok(res.getRecords());
|
return R.ok(res.getRecords());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import com.ruoyi.cai.service.AnchorService;
|
|||||||
import com.ruoyi.cai.service.AnchorTopService;
|
import com.ruoyi.cai.service.AnchorTopService;
|
||||||
import com.ruoyi.cai.service.UserService;
|
import com.ruoyi.cai.service.UserService;
|
||||||
import com.ruoyi.common.core.domain.PageQuery;
|
import com.ruoyi.common.core.domain.PageQuery;
|
||||||
|
import com.ruoyi.common.core.domain.R;
|
||||||
import com.ruoyi.common.helper.LoginHelper;
|
import com.ruoyi.common.helper.LoginHelper;
|
||||||
import com.ruoyi.common.utils.ServletUtils;
|
import com.ruoyi.common.utils.ServletUtils;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
@@ -106,13 +107,19 @@ public class HomeManager {
|
|||||||
}else if(anchorListQueryTypeEnum == AnchorListQueryTypeEnum.NEW){
|
}else if(anchorListQueryTypeEnum == AnchorListQueryTypeEnum.NEW){
|
||||||
RBucket<List<AnchorListVo>> bucket = redissonClient.getBucket(RedisHttpConstant.HOME_NEW_REDIS);
|
RBucket<List<AnchorListVo>> bucket = redissonClient.getBucket(RedisHttpConstant.HOME_NEW_REDIS);
|
||||||
vos = bucket.get();
|
vos = bucket.get();
|
||||||
} else { // 同城查询
|
} else if(anchorListQueryTypeEnum == AnchorListQueryTypeEnum.CITY){ // 同城查询
|
||||||
if(query.getCityId() == null){
|
if(query.getCityId() == null){
|
||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
query.setOnlineStatus(1);
|
query.setOnlineStatus(1);
|
||||||
query.setOpenVideoStatus(1);
|
query.setOpenVideoStatus(1);
|
||||||
|
if(pageQuery.checkPageNum(20)){
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
pageQuery.resetPageSize();
|
||||||
return anchorService.pageApp(pageQuery, query).getRecords();
|
return anchorService.pageApp(pageQuery, query).getRecords();
|
||||||
|
}else{
|
||||||
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
Collections.shuffle(vos);
|
Collections.shuffle(vos);
|
||||||
Integer pageNum = pageQuery.getPageNum();
|
Integer pageNum = pageQuery.getPageNum();
|
||||||
|
|||||||
@@ -36,7 +36,6 @@ public interface DynamicService extends IService<Dynamic> {
|
|||||||
|
|
||||||
void clearDynamic(Integer hours);
|
void clearDynamic(Integer hours);
|
||||||
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
|
||||||
void deleteDynamicAdmin(Long id);
|
void deleteDynamicAdmin(Long id);
|
||||||
|
|
||||||
boolean auditSuccess(List<Long> ids);
|
boolean auditSuccess(List<Long> ids);
|
||||||
|
|||||||
@@ -218,7 +218,6 @@ public class DynamicServiceImpl extends ServiceImpl<DynamicMapper, Dynamic> impl
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
|
||||||
@Override
|
@Override
|
||||||
public void deleteDynamicAdmin(Long id){
|
public void deleteDynamicAdmin(Long id){
|
||||||
this.removeById(id);
|
this.removeById(id);
|
||||||
|
|||||||
@@ -133,7 +133,7 @@ public class SmsVerifyServiceImpl extends ServiceImpl<SmsVerifyMapper,SmsVerify>
|
|||||||
List<SmsVerify> list = this.list(Wrappers.lambdaUpdate(SmsVerify.class)
|
List<SmsVerify> list = this.list(Wrappers.lambdaUpdate(SmsVerify.class)
|
||||||
.lt(SmsVerify::getCreateTime, deleteTimeFlag)
|
.lt(SmsVerify::getCreateTime, deleteTimeFlag)
|
||||||
.last("limit 100"));
|
.last("limit 100"));
|
||||||
if(index > 500 || CollectionUtils.isEmpty(list)){
|
if(index > 5000 || CollectionUtils.isEmpty(list)){
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
index++;
|
index++;
|
||||||
|
|||||||
@@ -137,6 +137,8 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
|
|||||||
mapperQuery.setNickname(query.getText());
|
mapperQuery.setNickname(query.getText());
|
||||||
}else if(query.getType() == 3){
|
}else if(query.getType() == 3){
|
||||||
mapperQuery.setUsercode(query.getText());
|
mapperQuery.setUsercode(query.getText());
|
||||||
|
}else{
|
||||||
|
return new Page<>();
|
||||||
}
|
}
|
||||||
return baseMapper.pageApp(page.build(),mapperQuery);
|
return baseMapper.pageApp(page.build(),mapperQuery);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import com.ruoyi.common.utils.StringUtils;
|
|||||||
import com.ruoyi.common.utils.sql.SqlUtil;
|
import com.ruoyi.common.utils.sql.SqlUtil;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import org.springframework.web.jsf.FacesContextUtils;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -61,6 +62,19 @@ public class PageQuery implements Serializable {
|
|||||||
// public static final int DEFAULT_PAGE_SIZE = Integer.MAX_VALUE;
|
// public static final int DEFAULT_PAGE_SIZE = Integer.MAX_VALUE;
|
||||||
public static final int DEFAULT_PAGE_SIZE = 20;
|
public static final int DEFAULT_PAGE_SIZE = 20;
|
||||||
|
|
||||||
|
public boolean checkPageNum(int pageNum){
|
||||||
|
if(this.pageNum != null && this.pageNum > pageNum){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void resetPageSize(){
|
||||||
|
if(this.pageSize != null && this.pageSize > DEFAULT_PAGE_SIZE){
|
||||||
|
this.pageSize = DEFAULT_PAGE_SIZE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public <T> Page<T> build() {
|
public <T> Page<T> build() {
|
||||||
Integer pageNum = ObjectUtil.defaultIfNull(getPageNum(), DEFAULT_PAGE_NUM);
|
Integer pageNum = ObjectUtil.defaultIfNull(getPageNum(), DEFAULT_PAGE_NUM);
|
||||||
Integer pageSize = ObjectUtil.defaultIfNull(getPageSize(), DEFAULT_PAGE_SIZE);
|
Integer pageSize = ObjectUtil.defaultIfNull(getPageSize(), DEFAULT_PAGE_SIZE);
|
||||||
|
|||||||
Reference in New Issue
Block a user