init
This commit is contained in:
@@ -0,0 +1,95 @@
|
||||
package com.ruoyi.cai.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.cai.domain.CaiConsumeLog;
|
||||
import com.ruoyi.cai.service.CaiConsumeLogService;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.annotation.RepeatSubmit;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.core.validate.AddGroup;
|
||||
import com.ruoyi.common.core.validate.EditGroup;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* 消费记录
|
||||
*
|
||||
* @author 77
|
||||
* @date 2023-12-24
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/cai/consumeLog")
|
||||
public class CaiConsumeLogController extends BaseController {
|
||||
|
||||
private final CaiConsumeLogService caiConsumeLogService;
|
||||
|
||||
/**
|
||||
* 查询消费记录列表
|
||||
*/
|
||||
@SaCheckPermission("cai:consumeLog:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<CaiConsumeLog> list(CaiConsumeLog bo, PageQuery pageQuery) {
|
||||
Page<CaiConsumeLog> page = caiConsumeLogService.page(pageQuery.build(), Wrappers.lambdaQuery(bo));
|
||||
return TableDataInfo.build(page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取消费记录详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("cai:consumeLog:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<CaiConsumeLog> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(caiConsumeLogService.getById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增消费记录
|
||||
*/
|
||||
@SaCheckPermission("cai:consumeLog:add")
|
||||
@Log(title = "消费记录", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody CaiConsumeLog bo) {
|
||||
return toAjax(caiConsumeLogService.save(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改消费记录
|
||||
*/
|
||||
@SaCheckPermission("cai:consumeLog:edit")
|
||||
@Log(title = "消费记录", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody CaiConsumeLog bo) {
|
||||
return toAjax(caiConsumeLogService.updateById(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除消费记录
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("cai:consumeLog:remove")
|
||||
@Log(title = "消费记录", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(caiConsumeLogService.removeBatchByIds(Arrays.asList(ids), true));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
package com.ruoyi.cai.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.cai.domain.CaiGiveLog;
|
||||
import com.ruoyi.cai.service.CaiGiveLogService;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.annotation.RepeatSubmit;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.core.validate.AddGroup;
|
||||
import com.ruoyi.common.core.validate.EditGroup;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* 赠送记录
|
||||
*
|
||||
* @author 77
|
||||
* @date 2023-12-24
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/cai/giveLog")
|
||||
public class CaiGiveLogController extends BaseController {
|
||||
|
||||
private final CaiGiveLogService caiGiveLogService;
|
||||
|
||||
/**
|
||||
* 查询赠送记录列表
|
||||
*/
|
||||
@SaCheckPermission("cai:giveLog:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<CaiGiveLog> list(CaiGiveLog bo, PageQuery pageQuery) {
|
||||
Page<CaiGiveLog> page = caiGiveLogService.page(pageQuery.build(), Wrappers.lambdaQuery(bo));
|
||||
return TableDataInfo.build(page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取赠送记录详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("cai:giveLog:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<CaiGiveLog> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(caiGiveLogService.getById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增赠送记录
|
||||
*/
|
||||
@SaCheckPermission("cai:giveLog:add")
|
||||
@Log(title = "赠送记录", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody CaiGiveLog bo) {
|
||||
return toAjax(caiGiveLogService.save(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改赠送记录
|
||||
*/
|
||||
@SaCheckPermission("cai:giveLog:edit")
|
||||
@Log(title = "赠送记录", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody CaiGiveLog bo) {
|
||||
return toAjax(caiGiveLogService.updateById(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除赠送记录
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("cai:giveLog:remove")
|
||||
@Log(title = "赠送记录", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(caiGiveLogService.removeBatchByIds(Arrays.asList(ids)));
|
||||
}
|
||||
}
|
||||
@@ -65,10 +65,6 @@ public class CaiAnchor implements Serializable{
|
||||
* 服务总时长
|
||||
*/
|
||||
private Long serviceTime;
|
||||
/**
|
||||
* 礼物的邀请比例
|
||||
*/
|
||||
private BigDecimal giftInviteRate;
|
||||
/**
|
||||
* 视频分成比例
|
||||
*/
|
||||
@@ -85,15 +81,6 @@ public class CaiAnchor implements Serializable{
|
||||
* 状态 0 可用 1不可用
|
||||
*/
|
||||
private Integer status;
|
||||
/**
|
||||
* 主播积分数
|
||||
*/
|
||||
private BigDecimal jifen;
|
||||
/**
|
||||
* 上一次积分
|
||||
*/
|
||||
private BigDecimal lastJifen;
|
||||
|
||||
|
||||
private LocalDateTime createTime;
|
||||
|
||||
|
||||
161
ruoyi-cai/src/main/java/com/ruoyi/cai/domain/CaiConsumeLog.java
Normal file
161
ruoyi-cai/src/main/java/com/ruoyi/cai/domain/CaiConsumeLog.java
Normal file
@@ -0,0 +1,161 @@
|
||||
package com.ruoyi.cai.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 消费记录对象 cai_consume_log
|
||||
*
|
||||
* @author 77
|
||||
* @date 2023-12-24
|
||||
*/
|
||||
@Data
|
||||
@TableName("cai_consume_log")
|
||||
public class CaiConsumeLog implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
/**
|
||||
* 类型 1-充值 2-礼物 3-守护 4-通话
|
||||
*/
|
||||
private Integer type;
|
||||
/**
|
||||
* 业务ID
|
||||
*/
|
||||
private Integer sourceBusinessId;
|
||||
/**
|
||||
* 发生金额
|
||||
*/
|
||||
private BigDecimal amount;
|
||||
/**
|
||||
* 主播金额
|
||||
*/
|
||||
private BigDecimal anchorAmount;
|
||||
/**
|
||||
* 一级金额
|
||||
*/
|
||||
private BigDecimal oneAmount;
|
||||
/**
|
||||
* 二级金额
|
||||
*/
|
||||
private BigDecimal twoAmount;
|
||||
/**
|
||||
* 平台金额
|
||||
*/
|
||||
private BigDecimal platformAmount;
|
||||
/**
|
||||
* 消费方用户
|
||||
*/
|
||||
private Integer sourceUserId;
|
||||
/**
|
||||
* 消费方用户
|
||||
*/
|
||||
private String sourceUsercode;
|
||||
/**
|
||||
* 消费方用户
|
||||
*/
|
||||
private String sourcePhone;
|
||||
/**
|
||||
* 接收方用户
|
||||
*/
|
||||
private Integer targetUserId;
|
||||
/**
|
||||
* 接收方用户
|
||||
*/
|
||||
private String targetUsercode;
|
||||
/**
|
||||
* 接收方用户
|
||||
*/
|
||||
private String targetPhone;
|
||||
/**
|
||||
* 一级分销方
|
||||
*/
|
||||
private Integer oneUserId;
|
||||
/**
|
||||
* 一级分销方
|
||||
*/
|
||||
private String oneUsercode;
|
||||
/**
|
||||
* 一级分销方
|
||||
*/
|
||||
private String onePhone;
|
||||
/**
|
||||
* 一级分销方抽成比例
|
||||
*/
|
||||
private Integer oneRate;
|
||||
/**
|
||||
* 是否为工会管理员 0=否 1=是
|
||||
*/
|
||||
private Integer oneIsUnion;
|
||||
/**
|
||||
* 二级分销方
|
||||
*/
|
||||
private Integer twoUserId;
|
||||
/**
|
||||
* 二级分销方
|
||||
*/
|
||||
private String twoUsercode;
|
||||
/**
|
||||
* 二级分销方
|
||||
*/
|
||||
private String twoPhone;
|
||||
/**
|
||||
* 二级分销方抽成比例
|
||||
*/
|
||||
private Integer twoRate;
|
||||
/**
|
||||
* 是否为工会管理员 0=否 1=是
|
||||
*/
|
||||
private Integer twoIsUnion;
|
||||
/**
|
||||
* 状态 0-待计算分销 1-已计算分销
|
||||
*/
|
||||
private String calculateStatus;
|
||||
/**
|
||||
* 状态 -1-无须分销 0-待分销 1-已分销
|
||||
*/
|
||||
private Integer status;
|
||||
/**
|
||||
* 状态 0-否 1-是
|
||||
*/
|
||||
private String admin;
|
||||
/**
|
||||
* 管理员ID
|
||||
*/
|
||||
private Long adminId;
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String adminName;
|
||||
/**
|
||||
* 分销人ID
|
||||
*/
|
||||
private Long opId;
|
||||
/**
|
||||
* 分销人名称
|
||||
*/
|
||||
private String opName;
|
||||
/**
|
||||
* 分销时间
|
||||
*/
|
||||
private LocalDateTime opCreate;
|
||||
|
||||
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
72
ruoyi-cai/src/main/java/com/ruoyi/cai/domain/CaiGiveLog.java
Normal file
72
ruoyi-cai/src/main/java/com/ruoyi/cai/domain/CaiGiveLog.java
Normal file
@@ -0,0 +1,72 @@
|
||||
package com.ruoyi.cai.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 赠送记录对象 cai_give_log
|
||||
*
|
||||
* @author 77
|
||||
* @date 2023-12-24
|
||||
*/
|
||||
@Data
|
||||
@TableName("cai_give_log")
|
||||
public class CaiGiveLog implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
/**
|
||||
* 类型 1-注册 2-首充
|
||||
*/
|
||||
private Integer type;
|
||||
/**
|
||||
* 业务ID
|
||||
*/
|
||||
private Integer sourceBusinessId;
|
||||
/**
|
||||
* 发生金额
|
||||
*/
|
||||
private BigDecimal amount;
|
||||
/**
|
||||
* 消费方用户
|
||||
*/
|
||||
private Integer sourceUserId;
|
||||
/**
|
||||
* 消费方用户
|
||||
*/
|
||||
private Integer sourceUsercode;
|
||||
/**
|
||||
* 消费方用户
|
||||
*/
|
||||
private String sourcePhone;
|
||||
/**
|
||||
* 状态 -1-无须赠送 0-待赠送 1-已赠送
|
||||
*/
|
||||
private Integer status;
|
||||
/**
|
||||
* 分发人ID
|
||||
*/
|
||||
private Long opId;
|
||||
/**
|
||||
* 分发人名称
|
||||
*/
|
||||
private String opName;
|
||||
/**
|
||||
* 分发时间
|
||||
*/
|
||||
private LocalDateTime opCreate;
|
||||
|
||||
private LocalDateTime createTime;
|
||||
|
||||
|
||||
}
|
||||
@@ -28,18 +28,6 @@ public class CaiUserInfo {
|
||||
*/
|
||||
@TableId(value = "user_id",type = IdType.INPUT)
|
||||
private Long userId;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String realname;
|
||||
/**
|
||||
* 星座
|
||||
*/
|
||||
private Integer signs;
|
||||
/**
|
||||
* 用户评分
|
||||
*/
|
||||
private BigDecimal giveScore;
|
||||
/**
|
||||
* 奖励好友支出的比率
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.ruoyi.cai.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
public enum AccountBusinessEnum {
|
||||
|
||||
// 用户端
|
||||
A1("101","紫贝充值","增加充值的紫贝"),
|
||||
A2("102","注册奖励","增加充值的紫贝"),
|
||||
A3("103","首充奖励","增加充值的紫贝"),
|
||||
A4("104","送出礼物","扣除紫贝"),
|
||||
A5("105","送出守护","扣除紫贝"),
|
||||
A6("106","视频支出","扣除紫贝"),
|
||||
A7("106","聊天支出","扣除紫贝"),
|
||||
A8("108","提现","扣除收益的紫贝"),
|
||||
|
||||
// 主播端
|
||||
B1("201","收到礼物","增加收益的紫贝"),
|
||||
B2("202","收到守护","增加收益的紫贝"),
|
||||
B3("203","视频收入","增加收益的紫贝"),
|
||||
|
||||
// 分销
|
||||
C1("301","充值分成","增加收益的紫贝"),
|
||||
C2("301","礼物分成","增加收益的紫贝"),
|
||||
C3("301","守护分成","增加收益的紫贝"),
|
||||
C4("301","视频分成","增加收益的紫贝"),
|
||||
|
||||
// 工会
|
||||
D1("401","礼物工会分成","增加收益的紫贝"),
|
||||
D2("401","守护工会分成","增加收益的紫贝"),
|
||||
D3("401","视频工会分成","增加收益的紫贝"),
|
||||
|
||||
// 系统
|
||||
Z1("1001","系统调账","系统调账"),
|
||||
;
|
||||
|
||||
private final String code;
|
||||
private final String name;
|
||||
private final String desc;
|
||||
|
||||
AccountBusinessEnum(String code, String name, String desc) {
|
||||
this.code = code;
|
||||
this.name = name;
|
||||
this.desc = desc;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.ruoyi.cai.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.ruoyi.cai.domain.CaiConsumeLog;
|
||||
|
||||
/**
|
||||
* 消费记录Mapper接口
|
||||
*
|
||||
* @author 77
|
||||
* @date 2023-12-24
|
||||
*/
|
||||
public interface CaiConsumeLogMapper extends BaseMapper<CaiConsumeLog> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.ruoyi.cai.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.ruoyi.cai.domain.CaiGiveLog;
|
||||
|
||||
/**
|
||||
* 赠送记录Mapper接口
|
||||
*
|
||||
* @author 77
|
||||
* @date 2023-12-24
|
||||
*/
|
||||
public interface CaiGiveLogMapper extends BaseMapper<CaiGiveLog> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.ruoyi.cai.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.ruoyi.cai.domain.CaiConsumeLog;
|
||||
|
||||
/**
|
||||
* 消费记录Service接口
|
||||
*
|
||||
* @author 77
|
||||
* @date 2023-12-24
|
||||
*/
|
||||
public interface CaiConsumeLogService extends IService<CaiConsumeLog> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.ruoyi.cai.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.ruoyi.cai.domain.CaiGiveLog;
|
||||
|
||||
/**
|
||||
* 赠送记录Service接口
|
||||
*
|
||||
* @author 77
|
||||
* @date 2023-12-24
|
||||
*/
|
||||
public interface CaiGiveLogService extends IService<CaiGiveLog> {
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.ruoyi.cai.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.ruoyi.cai.domain.CaiConsumeLog;
|
||||
import com.ruoyi.cai.mapper.CaiConsumeLogMapper;
|
||||
import com.ruoyi.cai.service.CaiConsumeLogService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 消费记录Service业务层处理
|
||||
*
|
||||
* @author 77
|
||||
* @date 2023-12-24
|
||||
*/
|
||||
@Service
|
||||
public class CaiConsumeLogServiceImpl extends ServiceImpl<CaiConsumeLogMapper,CaiConsumeLog> implements CaiConsumeLogService {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.ruoyi.cai.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.ruoyi.cai.domain.CaiGiveLog;
|
||||
import com.ruoyi.cai.mapper.CaiGiveLogMapper;
|
||||
import com.ruoyi.cai.service.CaiGiveLogService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 赠送记录Service业务层处理
|
||||
*
|
||||
* @author 77
|
||||
* @date 2023-12-24
|
||||
*/
|
||||
@Service
|
||||
public class CaiGiveLogServiceImpl extends ServiceImpl<CaiGiveLogMapper,CaiGiveLog> implements CaiGiveLogService {
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user