Merge remote-tracking branch 'origin/test' into test
This commit is contained in:
@@ -84,6 +84,11 @@ public class RedisUtils {
|
|||||||
return this.fromJson(jsonStr, clazz);
|
return this.fromJson(jsonStr, clazz);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public <T> T getObjectDate(String key, Class<T> clazz) {
|
||||||
|
String jsonStr = get(key);
|
||||||
|
return this.fromJson(jsonStr, clazz);
|
||||||
|
}
|
||||||
|
|
||||||
public String getDate(String key, String method) {
|
public String getDate(String key, String method) {
|
||||||
if (!this.hasKey(key)) {
|
if (!this.hasKey(key)) {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -1495,11 +1495,11 @@ public class UserServiceImpl extends ServiceImpl<UserDao, UserEntity> implements
|
|||||||
userMoneyDetails.setCreateTime(DateUtil.format(new Date(System.currentTimeMillis() - 1000), "yyyy-MM-dd HH:mm:ss"));
|
userMoneyDetails.setCreateTime(DateUtil.format(new Date(System.currentTimeMillis() - 1000), "yyyy-MM-dd HH:mm:ss"));
|
||||||
userMoneyDetails.setMoneyType(1);
|
userMoneyDetails.setMoneyType(1);
|
||||||
boolean ret = userMoneyDetailsService.save(userMoneyDetails);
|
boolean ret = userMoneyDetailsService.save(userMoneyDetails);
|
||||||
// if (ret) {
|
if (ret) {
|
||||||
// ThreadUtil.execAsync(()->{
|
ThreadUtil.execAsync(()->{
|
||||||
// discSpinningService.withdrawAsync(entity, money.doubleValue(), "[提现]");
|
discSpinningService.withdrawAsync(entity, money.doubleValue(), "[提现]");
|
||||||
// },true);
|
},true);
|
||||||
// }
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("首绑支付宝发放奖励异常,用户信息:{}", JSONUtil.toJsonStr(entity));
|
log.error("首绑支付宝发放奖励异常,用户信息:{}", JSONUtil.toJsonStr(entity));
|
||||||
log.error("首绑支付宝发放奖励异常:", e);
|
log.error("首绑支付宝发放奖励异常:", e);
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
package com.sqx.modules.course.controller.app;
|
package com.sqx.modules.course.controller.app;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.sqx.common.annotation.Debounce;
|
import com.sqx.common.utils.RedisKeys;
|
||||||
|
import com.sqx.common.utils.RedisUtils;
|
||||||
import com.sqx.common.utils.Result;
|
import com.sqx.common.utils.Result;
|
||||||
import com.sqx.modules.app.annotation.Login;
|
import com.sqx.modules.app.annotation.Login;
|
||||||
|
import com.sqx.modules.course.entity.Course;
|
||||||
import com.sqx.modules.course.service.CourseDetailsService;
|
import com.sqx.modules.course.service.CourseDetailsService;
|
||||||
import com.sqx.modules.course.service.CourseService;
|
import com.sqx.modules.course.service.CourseService;
|
||||||
import com.sqx.modules.sys.controller.AbstractController;
|
import com.sqx.modules.sys.controller.AbstractController;
|
||||||
@@ -24,6 +26,8 @@ public class AppCourseController extends AbstractController {
|
|||||||
private CourseService courseService;
|
private CourseService courseService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private CourseDetailsService courseDetailsService;
|
private CourseDetailsService courseDetailsService;
|
||||||
|
@Autowired
|
||||||
|
private RedisUtils redisUtils;
|
||||||
|
|
||||||
@GetMapping("/selectCourse")
|
@GetMapping("/selectCourse")
|
||||||
@ApiOperation("查询短剧信息")
|
@ApiOperation("查询短剧信息")
|
||||||
@@ -41,10 +45,19 @@ public class AppCourseController extends AbstractController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Login
|
||||||
@GetMapping("/selectCourseDetailsById")
|
@GetMapping("/selectCourseDetailsById")
|
||||||
@ApiOperation("根据id查询短剧详情")
|
@ApiOperation("根据id查询短剧详情")
|
||||||
@Debounce(interval = 1000, value = "#id,#token")
|
public Result selectCourseDetailsById(@RequestAttribute("userId") Long userId, Long id, String token, String courseDetailsId) {
|
||||||
public Result selectCourseDetailsById(Long id, String token, String courseDetailsId) {
|
String redisKey = RedisKeys.getDateKey("course:") + userId + "-" + id;
|
||||||
|
Object week = redisUtils.getObjectDate(redisKey,Course.class);
|
||||||
|
if (week != null) {
|
||||||
|
return Result.success().put("data", week);
|
||||||
|
}
|
||||||
|
Result result = courseDetailsService.selectCourseDetailsById(id, token, courseDetailsId);
|
||||||
|
if (result.get("code").equals(0)) {
|
||||||
|
redisUtils.set(redisKey, result.get("data"), 3);
|
||||||
|
}
|
||||||
return courseDetailsService.selectCourseDetailsById(id, token, courseDetailsId);
|
return courseDetailsService.selectCourseDetailsById(id, token, courseDetailsId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -95,10 +95,10 @@ public class DiscSpinningServiceImpl extends ServiceImpl<DiscSpinningDao, DiscSp
|
|||||||
userMoneyService.updateAmount(1, receive.getUserId(), receive.getNumber().doubleValue());
|
userMoneyService.updateAmount(1, receive.getUserId(), receive.getNumber().doubleValue());
|
||||||
|
|
||||||
|
|
||||||
// if (receive.getNumber().compareTo(new BigDecimal("0.1")) > 0 && StringUtils.isNotBlank(userInfo.getZhiFuBao()) && StringUtils.isNotBlank(userInfo.getZhiFuBaoName())) {
|
if (receive.getNumber().compareTo(new BigDecimal("0.1")) > 0 && StringUtils.isNotBlank(userInfo.getZhiFuBao()) && StringUtils.isNotBlank(userInfo.getZhiFuBaoName())) {
|
||||||
// //提现
|
//提现
|
||||||
// withdraw(userInfo, receive.getNumber().doubleValue());
|
withdraw(userInfo, receive.getNumber().doubleValue());
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -18,6 +18,8 @@ import org.springframework.stereotype.Component;
|
|||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@Component("CashOutTask2")
|
@Component("CashOutTask2")
|
||||||
@@ -35,10 +37,13 @@ public class CashOutTask2 implements ITask {
|
|||||||
@Override
|
@Override
|
||||||
public void run(String params) {
|
public void run(String params) {
|
||||||
logger.info("提现开始");
|
logger.info("提现开始");
|
||||||
|
if (StringUtils.isBlank(params) || isValidDate(params)) {
|
||||||
|
params = DateUtil.today();
|
||||||
|
}
|
||||||
List<CashOut> cashOuts = cashOutDao.selectList(new QueryWrapper<CashOut>()
|
List<CashOut> cashOuts = cashOutDao.selectList(new QueryWrapper<CashOut>()
|
||||||
.eq("state", 0)
|
.eq("state", 0)
|
||||||
.gt("create_at", DateUtil.today()+" 00:00:00")
|
.gt("create_at", params + " 00:00:00")
|
||||||
.lt("create_at",DateUtil.today()+" 23:59:59"));
|
.lt("create_at", params + " 23:59:59"));
|
||||||
System.out.println(cashOuts.size());
|
System.out.println(cashOuts.size());
|
||||||
for (CashOut cashOut : cashOuts) {
|
for (CashOut cashOut : cashOuts) {
|
||||||
if (WuyouPay.checkCanCash(cashOut.getUserId())) {
|
if (WuyouPay.checkCanCash(cashOut.getUserId())) {
|
||||||
@@ -50,20 +55,20 @@ public class CashOutTask2 implements ITask {
|
|||||||
} else {
|
} else {
|
||||||
cashOut.setState(2);
|
cashOut.setState(2);
|
||||||
cashOut.setRefund(StringUtils.isNotBlank(baseResp.getMsg()) ? baseResp.getMsg() : baseResp.getErrorMsg());
|
cashOut.setRefund(StringUtils.isNotBlank(baseResp.getMsg()) ? baseResp.getMsg() : baseResp.getErrorMsg());
|
||||||
if (cashOut.getRefund().contains("收款人账户号出款属性不匹配")||cashOut.getRefund().contains("已驳回")) {
|
if (cashOut.getRefund().contains("收款人账户号出款属性不匹配") || cashOut.getRefund().contains("已驳回")) {
|
||||||
cashOut.setRefund("提现失败,请检查支付宝账号与收款人姓名后,重试。");
|
cashOut.setRefund("提现失败,请检查支付宝账号与收款人姓名后,重试。");
|
||||||
}else {
|
} else {
|
||||||
cashOut.setRefund(baseResp.getErrorMsg());
|
cashOut.setRefund(baseResp.getErrorMsg());
|
||||||
}
|
}
|
||||||
UserMoneyDetails userMoneyDetails = new UserMoneyDetails(
|
UserMoneyDetails userMoneyDetails = new UserMoneyDetails(
|
||||||
cashOut.getUserId(),null,null,"提现失败",4,1,1,
|
cashOut.getUserId(), null, null, "提现失败", 4, 1, 1,
|
||||||
new BigDecimal(cashOut.getMoney()),"提现失败存入余额" + cashOut.getMoney() + "元", 1);
|
new BigDecimal(cashOut.getMoney()), "提现失败存入余额" + cashOut.getMoney() + "元", 1);
|
||||||
|
|
||||||
//存入余额 钱
|
//存入余额 钱
|
||||||
userMoneyService.updateAmount(1, cashOut.getUserId(), Double.parseDouble(cashOut.getMoney()));
|
userMoneyService.updateAmount(1, cashOut.getUserId(), Double.parseDouble(cashOut.getMoney()));
|
||||||
userMoneyDetailsService.save(userMoneyDetails);
|
userMoneyDetailsService.save(userMoneyDetails);
|
||||||
}
|
}
|
||||||
}else {
|
} else {
|
||||||
cashOut.setState(3);
|
cashOut.setState(3);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -71,4 +76,14 @@ public class CashOutTask2 implements ITask {
|
|||||||
}
|
}
|
||||||
logger.info("提现结束");
|
logger.info("提现结束");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean isValidDate(String dateString) {
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
|
try {
|
||||||
|
sdf.parse(dateString);
|
||||||
|
return true;
|
||||||
|
} catch (Exception e) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,9 +6,9 @@ spring:
|
|||||||
url: jdbc:mysql://rm-gc7xx913734hv5w5q.mysql.cn-chengdu.rds.aliyuncs.com/duanju?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=CTT
|
url: jdbc:mysql://rm-gc7xx913734hv5w5q.mysql.cn-chengdu.rds.aliyuncs.com/duanju?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=CTT
|
||||||
username: video_user
|
username: video_user
|
||||||
password: VideoUser@1
|
password: VideoUser@1
|
||||||
initial-size: 10
|
initial-size: 50
|
||||||
max-active: 100
|
max-active: 200
|
||||||
min-idle: 10
|
min-idle: 50
|
||||||
max-wait: 60000
|
max-wait: 60000
|
||||||
pool-prepared-statements: true
|
pool-prepared-statements: true
|
||||||
max-pool-prepared-statement-per-connection-size: 20
|
max-pool-prepared-statement-per-connection-size: 20
|
||||||
@@ -36,5 +36,5 @@ swagger:
|
|||||||
enabled: false
|
enabled: false
|
||||||
pay:
|
pay:
|
||||||
h5BaseUrl: https://dj-h5.hnsiyao.cn/me/detail/detail?allId=
|
h5BaseUrl: https://dj-h5.hnsiyao.cn/me/detail/detail?allId=
|
||||||
orderNotifyUrl: https://dj-api.hnsiyao.cn/czg/app/wuyou/notify
|
orderNotifyUrl: https://pay.hnsiyao.cn/czg/app/wuyou/notify
|
||||||
extractNotifyUrl: https://dj-api.hnsiyao.cn/czg/app/wuyou/extractNotify
|
extractNotifyUrl: https://pay.hnsiyao.cn/czg/app/wuyou/extractNotify
|
||||||
|
|||||||
@@ -6,9 +6,10 @@ logging:
|
|||||||
server:
|
server:
|
||||||
tomcat:
|
tomcat:
|
||||||
uri-encoding: UTF-8
|
uri-encoding: UTF-8
|
||||||
max-threads: 1000
|
connection-timeout: 50000ms
|
||||||
min-spare-threads: 30
|
threads:
|
||||||
connection-timeout: 5000ms
|
max: 1600
|
||||||
|
min-spare: 50
|
||||||
port: 8100
|
port: 8100
|
||||||
servlet:
|
servlet:
|
||||||
context-path: /czg
|
context-path: /czg
|
||||||
|
|||||||
Reference in New Issue
Block a user