Compare commits
5 Commits
release-20
...
b769ff9f71
| Author | SHA1 | Date | |
|---|---|---|---|
| b769ff9f71 | |||
| db4a1c587b | |||
|
|
a49ed00e37 | ||
| b4d8384150 | |||
| 6e41399631 |
39
doc/sql/pending/20260224_increase.sql
Normal file
39
doc/sql/pending/20260224_increase.sql
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
DROP TABLE IF EXISTS user_sms_log;
|
||||||
|
CREATE TABLE user_sms_log
|
||||||
|
(
|
||||||
|
id int8 NOT NULL PRIMARY KEY, -- 主键
|
||||||
|
user_id int8 DEFAULT 0 NOT NULL, -- 用户id
|
||||||
|
sms_type int4 NOT NULL DEFAULT 0, -- 短信类型 0-找回密码
|
||||||
|
content TEXT, -- 存储短信业务发送的具体内容,用于回溯审计
|
||||||
|
stat_date timestamp(6) NOT NULL, -- 统计日期,格式 '2026-02-24'
|
||||||
|
remarks varchar(200) NULL, -- 备注
|
||||||
|
create_user int8 NULL, -- 创建人
|
||||||
|
create_dept int8 NULL, -- 创建部门
|
||||||
|
create_time timestamp(6) NULL, -- 创建时间
|
||||||
|
update_user int8 NULL, -- 修改人
|
||||||
|
update_time timestamp(6) NULL, -- 修改时间
|
||||||
|
status int4 NULL, -- 状态
|
||||||
|
is_deleted int4 DEFAULT 0 NULL -- 是否已删除
|
||||||
|
);
|
||||||
|
|
||||||
|
-- 用于按天统计查询用户发送短信次数
|
||||||
|
CREATE INDEX idx_usl_stat ON user_sms_log (user_id, sms_type, stat_date, create_time);
|
||||||
|
-- 用于按时间倒序查看某个用户的发送记录
|
||||||
|
CREATE INDEX idx_usl_uid_time ON user_sms_log (user_id, sms_type, create_time DESC);
|
||||||
|
|
||||||
|
COMMENT ON TABLE user_sms_log IS '用户短信日志';
|
||||||
|
COMMENT ON COLUMN user_sms_log.id IS '主键';
|
||||||
|
COMMENT ON COLUMN user_sms_log.user_id IS '用户id';
|
||||||
|
COMMENT ON COLUMN user_sms_log.sms_type IS '短信类型 0-找回密码';
|
||||||
|
COMMENT ON COLUMN user_sms_log.content IS '存储短信业务发送的具体内容,用于回溯审计';
|
||||||
|
COMMENT ON COLUMN user_sms_log.stat_date IS '统计日期';
|
||||||
|
COMMENT ON COLUMN user_sms_log.remarks IS '备注';
|
||||||
|
COMMENT ON COLUMN user_sms_log.create_user IS '创建人';
|
||||||
|
COMMENT ON COLUMN user_sms_log.create_dept IS '创建部门';
|
||||||
|
COMMENT ON COLUMN user_sms_log.create_time IS '创建时间';
|
||||||
|
COMMENT ON COLUMN user_sms_log.update_user IS '修改人';
|
||||||
|
COMMENT ON COLUMN user_sms_log.update_time IS '修改时间';
|
||||||
|
COMMENT ON COLUMN user_sms_log.status IS '状态';
|
||||||
|
COMMENT ON COLUMN user_sms_log.is_deleted IS '是否已删除';
|
||||||
|
|
||||||
|
|
||||||
@@ -105,11 +105,11 @@ public class APPUserController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户订单列表
|
* 用户订单详情
|
||||||
*/
|
*/
|
||||||
@GetMapping("/order-detail")
|
@GetMapping("/order-detail")
|
||||||
@ApiOperationSupport(order = 6)
|
@ApiOperationSupport(order = 6)
|
||||||
@Operation(summary = "用户订单分页列表")
|
@Operation(summary = "用户订单详情")
|
||||||
public R<CommonUserOrderDetailApiVO> orderDetail(Long id) {
|
public R<CommonUserOrderDetailApiVO> orderDetail(Long id) {
|
||||||
return R.data(orderService.orderDetail(id));
|
return R.data(orderService.orderDetail(id));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -110,9 +110,13 @@ public class AppRegisterTokenGranter extends PasswordTokenGranter {
|
|||||||
user.setPassword(DigestUtil.encrypt(ParamCache.getValue(INIT_PASSWD_VALUE)));
|
user.setPassword(DigestUtil.encrypt(ParamCache.getValue(INIT_PASSWD_VALUE)));
|
||||||
|
|
||||||
String code = request.getCode();
|
String code = request.getCode();
|
||||||
Assert.isTrue(code.contains(StringPool.COMMA), ExceptionCode.INVALID_USER.getMessage());
|
if (!code.contains(StringPool.COMMA)) {
|
||||||
|
throw new UserInvalidException("无效验证码");
|
||||||
|
}
|
||||||
String[] splitCode = code.split(StringPool.COMMA);
|
String[] splitCode = code.split(StringPool.COMMA);
|
||||||
Assert.isTrue(splitCode.length == 2, ExceptionCode.INVALID_USER.getMessage());
|
if (splitCode.length != 2) {
|
||||||
|
throw new UserInvalidException("无效验证码");
|
||||||
|
}
|
||||||
String smsCode = splitCode[0];
|
String smsCode = splitCode[0];
|
||||||
String invitationCode = splitCode[1];
|
String invitationCode = splitCode[1];
|
||||||
if (StringUtil.isBlank(smsCode)) {
|
if (StringUtil.isBlank(smsCode)) {
|
||||||
@@ -128,9 +132,13 @@ public class AppRegisterTokenGranter extends PasswordTokenGranter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
invitor = service.getByPhone(invitorCode);
|
invitor = service.getByPhone(invitorCode);
|
||||||
Assert.notNull(invitor, "无效邀请码");
|
if (invitor == null) {
|
||||||
|
throw new UserInvalidException("无效邀请码");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!dynpsService.verifySms(request.getPhone(), smsCode)) {
|
||||||
|
throw new UserInvalidException("验证码验证失败");
|
||||||
}
|
}
|
||||||
Assert.isTrue(dynpsService.verifySms(request.getPhone(), smsCode), "验证码验证失败");
|
|
||||||
|
|
||||||
// 执行用户注册
|
// 执行用户注册
|
||||||
if (service.registerAppUser(user)) {
|
if (service.registerAppUser(user)) {
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import com.alibaba.fastjson2.JSON;
|
|||||||
import io.jsonwebtoken.lang.Assert;
|
import io.jsonwebtoken.lang.Assert;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springblade.core.log.exception.ServiceException;
|
||||||
import org.springblade.core.secure.utils.AuthUtil;
|
import org.springblade.core.secure.utils.AuthUtil;
|
||||||
import org.springblade.modules.common.eums.BusinessModule;
|
import org.springblade.modules.common.eums.BusinessModule;
|
||||||
import org.springblade.modules.common.eums.UserPointFlowType;
|
import org.springblade.modules.common.eums.UserPointFlowType;
|
||||||
@@ -64,7 +65,7 @@ public class CommonUserPointServiceImpl extends BaseServiceImpl<CommonUserPointM
|
|||||||
pointsAmount = order.getActualAmount().multiply(BigDecimal.valueOf(0.3));
|
pointsAmount = order.getActualAmount().multiply(BigDecimal.valueOf(0.3));
|
||||||
sourceType = SELF_OPERATED_MALL.getCode();
|
sourceType = SELF_OPERATED_MALL.getCode();
|
||||||
}
|
}
|
||||||
default -> throw new RuntimeException("无效订单类型");
|
default -> throw new ServiceException("无效订单类型");
|
||||||
}
|
}
|
||||||
CommonUserPointEntity userPoint = getById(order.getUserId());
|
CommonUserPointEntity userPoint = getById(order.getUserId());
|
||||||
BigDecimal lastAmount = userPoint.getAmount();
|
BigDecimal lastAmount = userPoint.getAmount();
|
||||||
@@ -75,7 +76,7 @@ public class CommonUserPointServiceImpl extends BaseServiceImpl<CommonUserPointM
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
throw new RuntimeException("奖励用户积分失败");
|
throw new ServiceException("奖励用户积分失败");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -93,7 +94,7 @@ public class CommonUserPointServiceImpl extends BaseServiceImpl<CommonUserPointM
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
throw new RuntimeException("消费用户积分失败");
|
throw new ServiceException("消费用户积分失败");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ import lombok.AllArgsConstructor;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springblade.common.cache.ParamCache;
|
import org.springblade.common.cache.ParamCache;
|
||||||
import org.springblade.common.constant.CommonConstant;
|
import org.springblade.common.constant.CommonConstant;
|
||||||
|
import org.springblade.core.log.exception.ServiceException;
|
||||||
import org.springblade.core.tool.utils.DateUtil;
|
import org.springblade.core.tool.utils.DateUtil;
|
||||||
import org.springblade.core.tool.utils.DigestUtil;
|
import org.springblade.core.tool.utils.DigestUtil;
|
||||||
import org.springblade.core.tool.utils.Func;
|
import org.springblade.core.tool.utils.Func;
|
||||||
@@ -101,8 +102,8 @@ public class MarketInfoServiceImpl extends BaseServiceImpl<MarketInfoMapper, Mar
|
|||||||
if (save(info) && userPointService.save(userPoint) && cashCouponService.save(cashCoupon) && benefitPointService.save(benefitPoint) && commissionService.save(commission)) {
|
if (save(info) && userPointService.save(userPoint) && cashCouponService.save(cashCoupon) && benefitPointService.save(benefitPoint) && commissionService.save(commission)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
log.error("用户信息初始化失败,id: {}", user.getId());
|
log.error("用户资产初始化失败,id: {}", user.getId());
|
||||||
throw new RuntimeException("初始化失败");
|
throw new ServiceException("用户资产初始化失败");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user