Merge remote-tracking branch 'origin/test' into test

This commit is contained in:
张松
2024-12-30 23:55:30 +08:00
10 changed files with 83 additions and 57 deletions

View File

@@ -13,6 +13,7 @@ import com.sqx.modules.app.annotation.LoginUser;
import com.sqx.modules.app.entity.UserEntity;
import com.sqx.modules.app.service.AppService;
import com.sqx.modules.app.service.UserService;
import com.sqx.modules.common.service.CommonInfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.codec.digest.DigestUtils;
@@ -33,6 +34,8 @@ public class AppController {
private UserService userService;
@Autowired
private AppService appService;
@Autowired
private CommonInfoService commonRepository;
@PostMapping("/authenticationRegister")
@ApiOperation("认证创建账号")
@@ -80,8 +83,8 @@ public class AppController {
if (StrUtil.isEmpty(zhiFuBao) || StrUtil.isEmpty(zhiFuBaoName)) {
return Result.error("支付宝账户及姓名不能为空!");
}
if (!DataLimitUtil.isAccessAllowed(zhiFuBao+zhiFuBaoName, 1, "month")) {
return Result.error("修改失败,相同支付宝账号每月可绑定");
if (!DataLimitUtil.isAccessAllowed(zhiFuBao+zhiFuBaoName, Integer.parseInt(commonRepository.findOne(924).getValue()), "month")) {
return Result.error("修改失败,相同支付宝账号每月可绑定次数已用完");
}
int count = userService.count(new QueryWrapper<UserEntity>()
.ne("user_id", userId)
@@ -91,8 +94,8 @@ public class AppController {
if (count > 0) {
return Result.error("一个支付宝账号仅可绑定一个用户");
}
if (!ApiAccessLimitUtil.isAccessAllowed(userId.toString(), "updateZFB", 3, "month")) {
return Result.error("每月仅支持修改三次,请联系管理员");
if (!ApiAccessLimitUtil.isAccessAllowed(userId.toString(), "updateZFB", Integer.parseInt(commonRepository.findOne(925).getValue()), "month")) {
return Result.error("每月可修改次数已用完,请联系管理员");
}
UserEntity old = userService.getById(userId);
String accountNo = old.getZhiFuBao();

View File

@@ -19,7 +19,7 @@ public interface BannerDao extends BaseMapper<Banner> {
List<Banner> selectLists(@Param("classify") Integer classify);
List<Banner> selectList(@Param("classify") Integer classify);
// List<Banner> selectList(@Param("classify") Integer classify);
IPage<Banner> selectBannerPage(Page<Banner> page,@Param("classify") Integer classify);

View File

@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sqx.common.utils.PageUtils;
import com.sqx.common.utils.Result;
import com.sqx.modules.banner.dao.BannerDao;
import com.sqx.modules.banner.entity.Activity;
import com.sqx.modules.banner.entity.Banner;
import com.sqx.modules.banner.service.BannerService;
import com.sqx.modules.course.dao.CourseDao;
@@ -40,7 +41,7 @@ public class BannerServiceImpl extends ServiceImpl<BannerDao, Banner> implements
@Override
@Cacheable(key = "#classify")
public List<Banner> selectBannerList(Integer classify) {
return bannerDao.selectList(classify);
return bannerDao.selectList(new QueryWrapper<Banner>().eq("classify", classify).eq("state", 1).orderByDesc("sort"));
}
@@ -51,9 +52,9 @@ public class BannerServiceImpl extends ServiceImpl<BannerDao, Banner> implements
}
@Override
public PageUtils selectBannerPage(Integer page,Integer limit,Integer classify) {
Page<Banner> pages=new Page<>(page,limit);
return new PageUtils(bannerDao.selectBannerPage(pages,classify));
public PageUtils selectBannerPage(Integer page, Integer limit, Integer classify) {
Page<Banner> pages = new Page<>(page, limit);
return new PageUtils(bannerDao.selectBannerPage(pages, classify));
}
@Override

View File

@@ -21,7 +21,7 @@ public class UserIntegralServiceImpl extends ServiceImpl<UserIntegralDao, UserIn
@Override
public UserIntegral selectById(Long id) {
UserIntegral userIntegral = userIntegralDao.selectById(id);
UserIntegral userIntegral = baseMapper.selectById(id);
if (userIntegral == null) {
userIntegral = new UserIntegral();
userIntegral.setUserId(id);

View File

@@ -28,7 +28,7 @@ public class SpinningTask3 {
private Logger logger = LoggerFactory.getLogger(getClass());
@Scheduled(cron = "0 0/2 * * * ? ")
@Scheduled(cron = "0 0/5 * * * ? ")
public void record() {
record("1");
}
@@ -41,8 +41,8 @@ public class SpinningTask3 {
params = "1";
}
// 获取五分钟前的时间
Date fiveMinutesAgo = DateUtil.offsetMinute(now, Integer.valueOf(params) * -5);
Date tenMinutesAgo = DateUtil.offsetMinute(now, (Integer.valueOf(params) * -5) - 5);
Date fiveMinutesAgo = DateUtil.offsetMinute(now, Integer.valueOf(params) * -6);
Date tenMinutesAgo = DateUtil.offsetMinute(now, (Integer.valueOf(params) * -6) - 6);
// 将五分钟前的时间转换为指定格式的时间字符串,这里采用常见的"yyyy-MM-dd HH:mm:ss"格式
String fiveMinutesAgoStr = DateUtil.format(fiveMinutesAgo, "yyyy-MM-dd HH:mm:ss");
String tenMinutesAgoStr = DateUtil.format(tenMinutesAgo, "yyyy-MM-dd HH:mm:ss");

View File

@@ -29,6 +29,7 @@ import com.sqx.modules.sys.entity.SysUserEntity;
import com.sqx.modules.sys.service.SysUserService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
@@ -71,11 +72,13 @@ public class TempOrdersTask {
private Logger logger = LoggerFactory.getLogger(getClass());
public void run(String params) {
@Scheduled(cron = "0 0/10 * * * ? ")
public void order() {
logger.info("订单表数据处理开始");
List<Orders> orders = ordersDao.selectList(Wrappers.<Orders>lambdaQuery()
.eq(Orders::getStatus, 0)
.lt(Orders::getCreateTime, DateUtil.offsetMinute(DateUtil.date(), -5)));
.lt(Orders::getCreateTime, DateUtil.offsetMinute(DateUtil.date(), -15)));
if (CollUtil.isEmpty(orders)) {
return;
}

View File

@@ -16,7 +16,7 @@ import java.util.Map;
@Mapper
public interface PayDetailsDao extends BaseMapper<PayDetails> {
PayDetails selectById(@Param("id") Long id);
// PayDetails selectById(@Param("id") Long id);
PayDetails selectByRemark(@Param("remark") String remark);