Merge remote-tracking branch 'origin/test' into test
This commit is contained in:
commit
c7242e9ab0
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,37 +1,56 @@
|
|||
# 数据源的一些配置
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
# 最小空闲连接,默认值10,小于0或大于maximum-pool-size,都会重置为maximum-pool-size
|
||||
minimum-idle: 5
|
||||
# 最大连接数,小于等于0会被重置为默认值10;大于零小于1会被重置为minimum-idle的值
|
||||
maximum-pool-size: 15
|
||||
# 空闲连接超时时间,默认值600000(10分钟),大于等于max-lifetime且max-lifetime>0,会被重置为0;不等于0且小于10秒,会被重置为10秒。
|
||||
idle-timeout: 30000
|
||||
# 连接最大存活时间.不等于0且小于30秒,会被重置为默认值30分钟.设置应该比mysql设置的超时时间短
|
||||
max-lifetime: 30000
|
||||
# 连接超时时间:毫秒,小于250毫秒,否则被重置为默认值30秒
|
||||
connection-timeout: 30000
|
||||
|
||||
spring:
|
||||
datasource:
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
druid:
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://rm-gc7xx913734hv5w5q.mysql.cn-chengdu.rds.aliyuncs.com/duanju?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=CTT
|
||||
username: video_user
|
||||
password: VideoUser@1
|
||||
initial-size: 50
|
||||
max-active: 200
|
||||
min-idle: 50
|
||||
max-wait: 60000
|
||||
pool-prepared-statements: true
|
||||
max-pool-prepared-statement-per-connection-size: 20
|
||||
time-between-eviction-runs-millis: 60000
|
||||
min-evictable-idle-time-millis: 300000
|
||||
#Oracle需要打开注释
|
||||
#validation-query: SELECT 1 FROM DUAL
|
||||
test-while-idle: true
|
||||
test-on-borrow: false
|
||||
test-on-return: false
|
||||
stat-view-servlet:
|
||||
enabled: true
|
||||
url-pattern: /druid/*
|
||||
#login-username: admin
|
||||
#login-password: admin
|
||||
filter:
|
||||
stat:
|
||||
log-slow-sql: true
|
||||
slow-sql-millis: 1000
|
||||
merge-sql: false
|
||||
wall:
|
||||
config:
|
||||
multi-statement-allow: true
|
||||
# sharding-jdbc 配置
|
||||
shardingsphere:
|
||||
center-tables-data-node: duanju.%s
|
||||
# 显示sharding-jdbc改写的sql语句
|
||||
show-sql: false
|
||||
# 数据源名称
|
||||
datasource:
|
||||
# 数据源配置begin
|
||||
master-0:
|
||||
driver-class-name: ${driver-class-name}
|
||||
jdbc-url: jdbc:mysql://rm-gc7xx913734hv5w5q.mysql.cn-chengdu.rds.aliyuncs.com/duanju?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=CTT
|
||||
username: video_user
|
||||
password: VideoUser@1
|
||||
minimum-idle: ${minimum-idle}
|
||||
maximum-pool-size: ${maximum-pool-size}
|
||||
idle-timeout: ${idle-timeout}
|
||||
max-lifetime: ${max-lifetime}
|
||||
connection-timeout: ${connection-timeout}
|
||||
slave-0:
|
||||
driver-class-name: ${driver-class-name}
|
||||
jdbc-url: jdbc:mysql://localhost:3306/duanju?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=CTT
|
||||
username: root
|
||||
password: acddb0c84a192ada
|
||||
minimum-idle: ${minimum-idle}
|
||||
maximum-pool-size: ${maximum-pool-size}
|
||||
idle-timeout: ${idle-timeout}
|
||||
max-lifetime: ${max-lifetime}
|
||||
connection-timeout: ${connection-timeout}
|
||||
# 数据源配置end
|
||||
|
||||
# 读写分离配置begin
|
||||
master-slave-rules:
|
||||
#数据源
|
||||
duanju:
|
||||
master-data-source-name: master-0
|
||||
slave-data-source-names: slave-0
|
||||
# - master-0
|
||||
# - slave-0
|
||||
|
||||
swagger:
|
||||
enabled: false
|
||||
pay:
|
||||
|
|
|
|||
|
|
@ -3,11 +3,11 @@
|
|||
|
||||
<mapper namespace="com.sqx.modules.banner.dao.BannerDao">
|
||||
|
||||
<select id="selectList" resultType="com.sqx.modules.banner.entity.Banner">
|
||||
select * from banner
|
||||
where classify=#{classify} and `state`=1
|
||||
order by `sort` desc
|
||||
</select>
|
||||
<!-- <select id="selectList" resultType="com.sqx.modules.banner.entity.Banner">-->
|
||||
<!-- select * from banner-->
|
||||
<!-- where classify=#{classify} and `state`=1-->
|
||||
<!-- order by `sort` desc-->
|
||||
<!-- </select>-->
|
||||
|
||||
<select id="selectLists" resultType="com.sqx.modules.banner.entity.Banner">
|
||||
select * from banner
|
||||
|
|
|
|||
|
|
@ -3,9 +3,9 @@
|
|||
|
||||
<mapper namespace="com.sqx.modules.pay.dao.PayDetailsDao">
|
||||
|
||||
<select id="selectById" resultType="com.sqx.modules.pay.entity.PayDetails">
|
||||
select * from pay_details d where d.id=#{id}
|
||||
</select>
|
||||
<!-- <select id="selectById" resultType="com.sqx.modules.pay.entity.PayDetails">-->
|
||||
<!-- select * from pay_details d where d.id=#{id}-->
|
||||
<!-- </select>-->
|
||||
|
||||
<select id="selectByRemark" resultType="com.sqx.modules.pay.entity.PayDetails">
|
||||
select * from pay_details d where d.remark=#{remark}
|
||||
|
|
|
|||
Loading…
Reference in New Issue