nnnn
This commit is contained in:
@@ -11,6 +11,7 @@ CREATE TABLE `cai_point_change_log`
|
||||
`user_id` bigint(20) NOT NULL COMMENT '用户ID',
|
||||
`usercode` varchar(100) NOT NULL COMMENT '用户',
|
||||
`message` varchar(100) NOT NULL COMMENT '账户明细说明',
|
||||
`action_type` varchar(36) DEFAULT NULL COMMENT '触发来源 1-充值 2-分销 3-抽奖',
|
||||
`tar_user_id` bigint DEFAULT NULL COMMENT '目标ID,用户、抽奖ID',
|
||||
`tar_usercode` varchar(20) DEFAULT NULL COMMENT '目标用户Code,有用户才有用',
|
||||
`tar_name` varchar(255) DEFAULT NULL COMMENT '目标名称,用户名称,抽奖名称',
|
||||
@@ -22,13 +23,31 @@ CREATE TABLE `cai_point_change_log`
|
||||
`is_admin` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '是否为后台用户手动调整',
|
||||
`trace_link_type` varchar(36) DEFAULT NULL COMMENT '跟踪类型 1-充值 2-分销 3-抽奖',
|
||||
`trace_id` varchar(50) DEFAULT NULL COMMENT '跟踪ID 订单号-礼物ID',
|
||||
`give_flag` tinyint NOT NULL DEFAULT '0' COMMENT '是否兑换',
|
||||
`give_time` datetime comment '兑换时间',
|
||||
`give_flag` tinyint NOT NULL DEFAULT '0' COMMENT '是否兑换',
|
||||
`give_time` datetime comment '兑换时间',
|
||||
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
UNIQUE KEY `user_id` (`user_id`) USING BTREE
|
||||
INDEX `user_id` (`user_id`) USING BTREE
|
||||
) ENGINE = InnoDB
|
||||
AUTO_INCREMENT = 1
|
||||
DEFAULT CHARSET = utf8mb4
|
||||
COLLATE = utf8mb4_general_ci
|
||||
ROW_FORMAT = DYNAMIC COMMENT ='积分记录';
|
||||
|
||||
-- 菜单 SQL
|
||||
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible,
|
||||
status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values (1998592326494093313, '积分记录', '1738084052270563330', '1', 'pointChangeLog', 'cai/pointChangeLog/index', 1, 0,
|
||||
'C', '0', '0', 'cai:pointChangeLog:list', '#', 'admin', sysdate(), '', null, '积分记录菜单');
|
||||
|
||||
-- 按钮 SQL
|
||||
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible,
|
||||
status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values (1998592326494093314, '积分记录查询', 1998592326494093313, '1', '#', '', 1, 0, 'F', '0', '0',
|
||||
'cai:pointChangeLog:query', '#', 'admin', sysdate(), '', null, '');
|
||||
|
||||
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible,
|
||||
status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values (1998592326494093316, '积分记录修改', 1998592326494093313, '3', '#', '', 1, 0, 'F', '0', '0',
|
||||
'cai:pointChangeLog:edit', '#', 'admin', sysdate(), '', null, '');
|
||||
|
||||
|
||||
@@ -93,7 +93,7 @@ public class PointChangeLogServiceImpl extends ServiceImpl<PointChangeLogMapper,
|
||||
pointChangeLog.setUserId(userId);
|
||||
pointChangeLog.setUsercode(user.getUsercode());
|
||||
pointChangeLog.setActionType(PointChangeLogActionTypeEnum.SYSTEM.getCode());
|
||||
String message = String.format("从【%s】中充值分成新增%s积分", inviteUser.getNickname(), givePoint);
|
||||
String message = String.format("从【%s】的充值中获得%s积分", inviteUser.getNickname(), givePoint);
|
||||
pointChangeLog.setMessage(message);
|
||||
pointChangeLog.setTarUserId(inviteUser.getId());
|
||||
pointChangeLog.setTarUsercode(inviteUser.getUsercode());
|
||||
|
||||
@@ -63,8 +63,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());
|
||||
UserInfo inviteUserInfo = userInfoService.getByUserId(userInvite.getInviteId());
|
||||
pointLog.setOneRate(inviteUserInfo.getPointRate());
|
||||
pointLog.setOneUserId(oneUser.getId());
|
||||
pointLog.setOneUsercode(oneUser.getUsercode());
|
||||
pointLog.setOnePhone(oneUser.getMobile());
|
||||
@@ -74,7 +74,7 @@ public class PointRecordLogServiceImpl extends ServiceImpl<PointRecordLogMapper,
|
||||
}
|
||||
if(dto.isDistribution()){ // 需要分销,直接分销
|
||||
pointLog.setStatus(ConsumeLogStatus.ALREADY.getCode());
|
||||
if(pointLog.getOnePoints() >= 0 && pointLog.getOneUserId() != null && !pointLog.getOneJoin()){
|
||||
if(pointLog.getOnePoints() >= 0 && pointLog.getOneUserId() != null && pointLog.getOneJoin()){
|
||||
String traceId = IdManager.nextIdStr();
|
||||
pointChangeLogService.adminInvite(pointLog.getOneUserId(),pointLog.getOnePoints(),pointLog.getSourceUserId(),traceId);
|
||||
pointLog.setTraceId(traceId);
|
||||
|
||||
Reference in New Issue
Block a user