Compare commits
9 Commits
be17f5ca1d
...
new/v1.1.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
873460901a | ||
|
|
491ae3ddd6 | ||
|
|
550855360c | ||
|
|
e64478b8ab | ||
|
|
7598710f54 | ||
|
|
88f9a67d0c | ||
|
|
a60d62f511 | ||
|
|
59b9f2ff0f | ||
|
|
be4a4f00d4 |
@@ -71,8 +71,6 @@ public class RechargeOrderController extends BaseController {
|
||||
@SaCheckPermission("cai:rechargeOrder:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<RechargeOrderAdminVo> list(RechargeOrderAdminVo bo, PageQuery pageQuery) {
|
||||
String string = identifierGenerator.nextId(null).toString();
|
||||
log.info("ID============{}",string);
|
||||
Page<RechargeOrderAdminVo> page = rechargeOrderService.pageAdmin(pageQuery,bo);
|
||||
return TableDataInfo.build(page);
|
||||
}
|
||||
|
||||
@@ -117,7 +117,7 @@ public class AuthAppController {
|
||||
|
||||
|
||||
@Deprecated
|
||||
@PostMapping("/register/code")
|
||||
// @PostMapping("/register/code")
|
||||
@Operation(summary = "获取注册验证码")
|
||||
@Log(title = "获取注册验证码", businessType = BusinessType.OTHER, isSaveDb = false)
|
||||
public R<Map<String,String>> registerCode(@Validated @RequestBody RegisterCode code){
|
||||
@@ -232,7 +232,7 @@ public class AuthAppController {
|
||||
|
||||
|
||||
|
||||
@PostMapping("/login")
|
||||
// @PostMapping("/login")
|
||||
@Operation(summary = "登陆")
|
||||
@Log(title = "登陆", businessType = BusinessType.OTHER, isSaveDb = false)
|
||||
public R<LoginVo> login(@Validated @RequestBody LoginCaiUser loginBody){
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.ruoyi.web.controller.cai.app;
|
||||
|
||||
import cn.hutool.core.util.RandomUtil;
|
||||
import com.ruoyi.cai.domain.User;
|
||||
import com.ruoyi.cai.dto.app.RankIdReq;
|
||||
import com.ruoyi.cai.dto.app.vo.anchor.AnchorStatusDTO;
|
||||
@@ -272,10 +273,12 @@ public class RankAppController {
|
||||
if(StringUtils.isEmpty(nickname)){
|
||||
return "*";
|
||||
}
|
||||
if(containsEmoji(nickname)){
|
||||
return "*密";
|
||||
}
|
||||
return "*"+nickname.substring(nickname.length()-1);
|
||||
char c = RandomUtil.randomChinese();
|
||||
return "*"+c;
|
||||
// if(containsEmoji(nickname)){
|
||||
// return "*密";
|
||||
// }
|
||||
// return "*"+nickname.substring(nickname.length()-1);
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
|
||||
@@ -22,7 +22,7 @@ spring:
|
||||
# rewriteBatchedStatements=true 批处理优化 大幅提升批量插入更新删除性能(对数据库有性能损耗 使用批量操作应考虑性能问题)
|
||||
url: jdbc:mysql://124.222.254.188:4306/cai_v6?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true
|
||||
username: root
|
||||
password: tyYrk487R4y7FENM
|
||||
password: Zl930329!
|
||||
# 从库数据源
|
||||
slave:
|
||||
lazy: true
|
||||
@@ -57,7 +57,7 @@ spring:
|
||||
# 数据库索引
|
||||
database: 12
|
||||
# 密码(如没有密码请注释掉)
|
||||
password: dsjakldbwja
|
||||
password: WggDVPbn4eLpoX7
|
||||
# 连接超时时间
|
||||
timeout: 15s
|
||||
# 是否开启ssl
|
||||
@@ -65,7 +65,7 @@ spring:
|
||||
rabbitmq:
|
||||
addresses: 124.222.254.188 #ip地址
|
||||
username: admin # 账号
|
||||
password: THnpGkdS # 密码
|
||||
password: WggDVPbn4eLpoX7 # 密码
|
||||
port: 5672
|
||||
virtual-host: /cai-dev
|
||||
|
||||
@@ -120,3 +120,9 @@ cai:
|
||||
proxy-host: 7693
|
||||
home-name: 知予
|
||||
coin-name: 知钻
|
||||
tencent:
|
||||
captcha:
|
||||
app-secret-key: wCmccPiqdW1C8V3t7GdAIYB3Z
|
||||
captcha-app-id: 189992647
|
||||
secret-id: IKID8EXQFxZ2NbjiZHqGZjjaHpEh7OgruoZB
|
||||
secret-key: a3NbjkgTBbzNrFcwRtDORpYezddhgeWc
|
||||
|
||||
@@ -43,6 +43,7 @@ public class UserInfo {
|
||||
private BigDecimal payIncomeRate;
|
||||
/**
|
||||
*/
|
||||
@Deprecated
|
||||
private BigDecimal pointRate;
|
||||
/**
|
||||
* 登录次数
|
||||
|
||||
@@ -34,7 +34,7 @@ public enum SystemConfigEnum {
|
||||
VIP_PRIVATE_PLUS("0", "开启VIP隐私模式增强模式",SystemConfigGroupEnum.SECURITY,new BooleanSystemConfigCheck()),
|
||||
OPEN_ANCHOR_CHAT_COUNT("1", "开启主播主动消息统计",SystemConfigGroupEnum.SECURITY,new BooleanSystemConfigCheck()),
|
||||
// 4-recordId拦截 5-recordId加强拦截 6-性别拦截 7-vip加强拦截
|
||||
IM_FILTER_PLUS("0", "IM拦截配置(勿动,开发配置)",SystemConfigGroupEnum.SECURITY),
|
||||
IM_FILTER_PLUS("4", "IM拦截配置(勿动,开发配置)",SystemConfigGroupEnum.SECURITY),
|
||||
OPEN_NOTICE("1", "是否开启告警",SystemConfigGroupEnum.SECURITY, new BooleanSystemConfigCheck()),
|
||||
PAY_ERROR_NUM_NOTICE("2", "连续调用支付失败N次,发起告警",SystemConfigGroupEnum.SECURITY, new NumberSystemConfigCheck()),
|
||||
PAY_NOTIFY_ERROR_NUM_NOTICE("5", "连续调用N次支付,但是依旧未支付成功,发起告警",SystemConfigGroupEnum.SECURITY, new NumberSystemConfigCheck()),
|
||||
@@ -64,6 +64,7 @@ public enum SystemConfigEnum {
|
||||
/**
|
||||
* 抽奖和积分
|
||||
*/
|
||||
DEFAULT_PAY_POINT_RATE("0", "分销上级充值的积分提成",SystemConfigGroupEnum.DRAW,new RateAllowZeroSystemConfigCheck()),
|
||||
OPEN_DRAW_WOMEN("1","是否开启女用户积分抽奖",SystemConfigGroupEnum.DRAW,new BooleanSystemConfigCheck()),
|
||||
OPEN_DRAW_MAN("1","是否开启男用户积分抽奖",SystemConfigGroupEnum.DRAW,new BooleanSystemConfigCheck()),
|
||||
WOMEN_DRAW_POINT("100","女用户抽奖分数",SystemConfigGroupEnum.DRAW,new NumberSystemConfigCheck()),
|
||||
@@ -143,7 +144,6 @@ public enum SystemConfigEnum {
|
||||
DEFAULT_GIFT_INCOME_RATE("0.07", "默认分销上级礼物提成",SystemConfigGroupEnum.BUSINESS,new RateSystemConfigCheck()),
|
||||
DEFAULT_GUARD_INCOME_RATE("0.07", "默认分销上级守护提成",SystemConfigGroupEnum.BUSINESS,new RateSystemConfigCheck()),
|
||||
DEFAULT_PAY_INCOME_RATE("0.3", "默认分销上级充值提成",SystemConfigGroupEnum.BUSINESS,new RateSystemConfigCheck()),
|
||||
DEFAULT_PAY_POINT_RATE("0.07", "默认分销上级充值的积分提成",SystemConfigGroupEnum.BUSINESS,new RateSystemConfigCheck()),
|
||||
PAY_INCOME_RATE("0", "分销上级充值提成(配置大于0数据后将强制使用该提成)",SystemConfigGroupEnum.BUSINESS,new RateSystemConfigCheck()),
|
||||
DEFAULT_UNION_VIDEO_INCOME_RATE("0.01", "默认工会视频提成",SystemConfigGroupEnum.BUSINESS, new RateSystemConfigCheck()),
|
||||
DEFAULT_UNION_ONE_INCOME_RATE("0.07", "默认工会一级提成",SystemConfigGroupEnum.BUSINESS, new RateSystemConfigCheck()),
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.ruoyi.cai.enums.systemconfig;
|
||||
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
|
||||
import javax.net.ssl.SSLSocket;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
public class RateAllowZeroSystemConfigCheck implements ISystemConfigCheck{
|
||||
@Override
|
||||
public SystemCheckResp check(String value) {
|
||||
if(StringUtils.isEmpty(value)){
|
||||
return SystemCheckResp.fail("该配置必填");
|
||||
}
|
||||
boolean b = NumberUtil.isDouble(value);
|
||||
if(!b){
|
||||
return SystemCheckResp.fail("请填写(0-1)之间的数字,两位小数点");
|
||||
}
|
||||
BigDecimal bigDecimal = new BigDecimal(value);
|
||||
boolean in = NumberUtil.isIn(bigDecimal, BigDecimal.ZERO, BigDecimal.ONE);
|
||||
if(!in){
|
||||
return SystemCheckResp.fail("请填写(0-1)之间的数字,两位小数点");
|
||||
}
|
||||
if(bigDecimal.scale() > 2){
|
||||
return SystemCheckResp.fail("小数点位数只能配置两位");
|
||||
}
|
||||
return SystemCheckResp.ok();
|
||||
}
|
||||
|
||||
|
||||
public static void main(String[] args) {
|
||||
RateAllowZeroSystemConfigCheck check = new RateAllowZeroSystemConfigCheck();
|
||||
System.out.println(check.check("0.0").getMessage());
|
||||
System.out.println(check.check("1").getMessage());
|
||||
}
|
||||
}
|
||||
@@ -106,6 +106,7 @@ public class PointManager {
|
||||
if(checkPointIncr.isAllowPoint()){
|
||||
User user = userService.getById(userId);
|
||||
User inviteUser = userService.getById(inviteUserId);
|
||||
accountMapper.incrPoint(user.getId(), checkPointIncr.getGivePoint());
|
||||
PointChangeLog pointChangeLog = new PointChangeLog();
|
||||
pointChangeLog.setUserId(userId);
|
||||
pointChangeLog.setUsercode(user.getUsercode());
|
||||
@@ -122,6 +123,9 @@ public class PointManager {
|
||||
pointChangeLog.setTraceLinkType(PointChangeTraceTypeEnum.INVITE.getCode());
|
||||
pointChangeLog.setTraceId(traceId);
|
||||
pointChangeLogService.save(pointChangeLog);
|
||||
String redisKey = getRedisKey(user.getId());
|
||||
RAtomicLong atomicLong = redissonClient.getAtomicLong(redisKey);
|
||||
atomicLong.addAndGet(checkPointIncr.getGivePoint());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -165,6 +169,7 @@ public class PointManager {
|
||||
if(checkPointIncr.isAllowPoint()){ // 参与积分
|
||||
User user = userService.getById(userId);
|
||||
User inviteUser = userService.getById(inviteUserId);
|
||||
accountMapper.incrPoint(user.getId(), checkPointIncr.getGivePoint());
|
||||
PointChangeLog pointChangeLog = new PointChangeLog();
|
||||
pointChangeLog.setUserId(userId);
|
||||
pointChangeLog.setUsercode(user.getUsercode());
|
||||
@@ -181,6 +186,9 @@ public class PointManager {
|
||||
pointChangeLog.setTraceLinkType(PointChangeTraceTypeEnum.INVITE.getCode());
|
||||
pointChangeLog.setTraceId(traceId);
|
||||
pointChangeLogService.save(pointChangeLog);
|
||||
String redisKey = getRedisKey(user.getId());
|
||||
RAtomicLong atomicLong = redissonClient.getAtomicLong(redisKey);
|
||||
atomicLong.addAndGet(checkPointIncr.getGivePoint());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -12,4 +12,6 @@ import com.ruoyi.cai.domain.UserCodeGen;
|
||||
public interface UserCodeGenService extends IService<UserCodeGen> {
|
||||
|
||||
String getCodeGen();
|
||||
|
||||
String getCodeGenRandom();
|
||||
}
|
||||
|
||||
@@ -6,8 +6,10 @@ import com.ruoyi.cai.domain.*;
|
||||
import com.ruoyi.cai.dto.AddPointAdminDto;
|
||||
import com.ruoyi.cai.enums.ConsumeLogStatus;
|
||||
import com.ruoyi.cai.enums.PointLogType;
|
||||
import com.ruoyi.cai.enums.SystemConfigEnum;
|
||||
import com.ruoyi.cai.lottery.PointManager;
|
||||
import com.ruoyi.cai.manager.IdManager;
|
||||
import com.ruoyi.cai.manager.SystemConfigManager;
|
||||
import com.ruoyi.cai.mapper.AccountMapper;
|
||||
import com.ruoyi.cai.mapper.PointRecordLogMapper;
|
||||
import com.ruoyi.cai.service.*;
|
||||
@@ -19,6 +21,7 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
@@ -39,6 +42,8 @@ public class PointRecordLogServiceImpl extends ServiceImpl<PointRecordLogMapper,
|
||||
@Resource
|
||||
private AccountMapper accountMapper;
|
||||
@Autowired
|
||||
private SystemConfigManager systemConfigManager;
|
||||
@Autowired
|
||||
private PointChangeLogService pointChangeLogService;
|
||||
@Autowired
|
||||
private PointManager pointManager;
|
||||
@@ -66,8 +71,8 @@ public class PointRecordLogServiceImpl extends ServiceImpl<PointRecordLogMapper,
|
||||
if(userInvite != null){
|
||||
User oneUser = userService.getById(userInvite.getInviteId());
|
||||
if(oneUser != null && oneUser.getStatus() == 0){
|
||||
UserInfo inviteUserInfo = userInfoService.getByUserId(userInvite.getInviteId());
|
||||
pointLog.setOneRate(inviteUserInfo.getPointRate());
|
||||
BigDecimal payPointRate = systemConfigManager.getSystemConfigOfBigDecimal(SystemConfigEnum.DEFAULT_PAY_POINT_RATE);
|
||||
pointLog.setOneRate(payPointRate);
|
||||
pointLog.setOneUserId(oneUser.getId());
|
||||
pointLog.setOneUsercode(oneUser.getUsercode());
|
||||
pointLog.setOnePhone(oneUser.getMobile());
|
||||
@@ -102,8 +107,8 @@ public class PointRecordLogServiceImpl extends ServiceImpl<PointRecordLogMapper,
|
||||
if(userInvite != null){
|
||||
User oneUser = userService.getById(userInvite.getInviteId());
|
||||
if(oneUser != null && oneUser.getStatus() == 0){
|
||||
UserInfo userInfo = userInfoService.getByUserId(userInvite.getUserId());
|
||||
pointLog.setOneRate(userInfo.getPointRate());
|
||||
BigDecimal payPointRate = systemConfigManager.getSystemConfigOfBigDecimal(SystemConfigEnum.DEFAULT_PAY_POINT_RATE);
|
||||
pointLog.setOneRate(payPointRate);
|
||||
pointLog.setOneUserId(oneUser.getId());
|
||||
pointLog.setOneUsercode(oneUser.getUsercode());
|
||||
pointLog.setOnePhone(oneUser.getMobile());
|
||||
@@ -138,7 +143,7 @@ public class PointRecordLogServiceImpl extends ServiceImpl<PointRecordLogMapper,
|
||||
if(!update){
|
||||
return;
|
||||
}
|
||||
if(pointRecordLog.getOneUserId() == null || pointRecordLog.getPoints() <= 0){
|
||||
if(pointRecordLog.getOneUserId() == null || pointRecordLog.getOnePoints() <= 0){
|
||||
return;
|
||||
}
|
||||
if(!pointRecordLog.getOneJoin()){
|
||||
|
||||
@@ -88,6 +88,7 @@ public class RechargeOrderServiceImpl extends ServiceImpl<RechargeOrderMapper,Re
|
||||
order.setRechargeId(goods.getId());
|
||||
order.setRechargeName(goods.getName());
|
||||
order.setRechargeCoin(goods.getAmount());
|
||||
order.setGivePoint(goods.getGivePoint());
|
||||
order.setRechargeType(AccountTypeEnum.COIN.getCode());
|
||||
order.setPrice(goods.getPrice());
|
||||
order.setOrderNo(OrderNoUtil.createOrderNo(OrderTypeEnum.RECHARGE_ORDER_SUB));
|
||||
|
||||
@@ -128,7 +128,7 @@ public class SmsVerifyServiceImpl extends ServiceImpl<SmsVerifyMapper,SmsVerify>
|
||||
smsVerify.setVerifyCode(code);
|
||||
smsVerify.setSendInterface("阿里云");
|
||||
smsVerify.setOperateIp(clientIP);
|
||||
smsVerify.setOverTime(LocalDateTime.now().plusMinutes(5));
|
||||
smsVerify.setOverTime(LocalDateTime.now().plusMinutes(8));
|
||||
this.save(smsVerify);
|
||||
// boolean boo = aliSmsKit.sendMessage(mobile, codeEnum.getAliTemplate(), code, true);
|
||||
boolean boo = DuanXinBaoSmsKit.sendMessage(mobile, code);
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.ruoyi.cai.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.ruoyi.cai.domain.UserCodeGen;
|
||||
import com.ruoyi.cai.mapper.UserCodeGenMapper;
|
||||
@@ -27,8 +26,16 @@ public class UserCodeGenServiceImpl extends ServiceImpl<UserCodeGenMapper, UserC
|
||||
|
||||
private final Random random = new Random();
|
||||
|
||||
|
||||
@Override
|
||||
public String getCodeGen(){
|
||||
UserCodeGen gen = new UserCodeGen();
|
||||
this.save(gen);
|
||||
return gen.getId()+"";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCodeGenRandom() {
|
||||
// 使用数据库唯一索引保证不重复 + 随机生成
|
||||
for (int i = 0; i < MAX_RETRY_COUNT; i++) {
|
||||
// 生成随机用户号
|
||||
|
||||
@@ -136,6 +136,9 @@ public enum TrdPayTypeEnum {
|
||||
* Wsz6yTi6AG5X6Cxt5Zt6rXKGKXitsX5I
|
||||
*/
|
||||
V13("https://pp123.bghyvwk.cn","/mapi.php","/api.php","/api/pay/trd/notify/v13","success"),
|
||||
/**
|
||||
* https://efps.epaylinks.cn/open/index.html#/document.html?documentId=102&firstLevelId=10003&contentId=1097
|
||||
*/
|
||||
V14("https://efps.epaylinks.cn","/mapi.php","/api.php","/api/pay/trd/notify/v14","success"),
|
||||
/**
|
||||
* 下单网关:http://n5d4.damiepay.paysanguo.com/Pay_Index.html
|
||||
|
||||
Reference in New Issue
Block a user