夺宝精灵:新增夺宝精灵活动
This commit is contained in:
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -13,6 +14,7 @@ import java.util.List;
|
||||
* @Description: 前端分页返回数据
|
||||
**/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class Pagination {
|
||||
|
||||
|
@@ -0,0 +1,21 @@
|
||||
package com.accompany.admin.mapper.treasure;
|
||||
|
||||
import com.accompany.admin.vo.treasure.SeizeTreasureDailyRecordVo;
|
||||
import com.accompany.admin.vo.treasure.SeizeTreasureRecordVo;
|
||||
import com.accompany.business.vo.treasure.record.SeizeTreasureStaticVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface SeizeTreasureAdminMapper {
|
||||
|
||||
SeizeTreasureStaticVo getRecordTotal(@Param("poolType") Integer poolType, @Param("poolGroup") Integer poolGroup, @Param("poolLevel") Integer poolLevel, @Param("uid") Long uid, @Param("startDate") Date startDate, @Param("endDate") Date endDate);
|
||||
|
||||
List<SeizeTreasureDailyRecordVo> getRecordDaily(@Param("poolType") Integer poolType, @Param("poolGroup") Integer poolGroup, @Param("poolLevel") Integer poolLevel, @Param("uid") Long uid, @Param("startDate") Date startDate, @Param("endDate") Date endDate);
|
||||
|
||||
List<SeizeTreasureRecordVo> getRecord(@Param("poolType") Integer poolType, @Param("poolGroup") Integer poolGroup, @Param("poolLevel") Integer poolLevel, @Param("uid") Long uid, @Param("startDate") Date startDate, @Param("endDate") Date endDate);
|
||||
|
||||
}
|
@@ -0,0 +1,19 @@
|
||||
package com.accompany.admin.params.treasure;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class TreasureRecordReq {
|
||||
private Integer poolType;
|
||||
private Integer poolGroup;
|
||||
private Integer poolLevel;
|
||||
private Long erbanNo;
|
||||
private Date startDate;
|
||||
private Date endDate;
|
||||
}
|
@@ -0,0 +1,72 @@
|
||||
package com.accompany.admin.service.treasure;
|
||||
|
||||
import com.accompany.admin.base.Pagination;
|
||||
import com.accompany.admin.mapper.treasure.SeizeTreasureAdminMapper;
|
||||
import com.accompany.admin.params.treasure.TreasureRecordReq;
|
||||
import com.accompany.admin.vo.GiftSendRecordAdminVo;
|
||||
import com.accompany.admin.vo.treasure.SeizeTreasureDailyRecordVo;
|
||||
import com.accompany.admin.vo.treasure.SeizeTreasureRecordVo;
|
||||
import com.accompany.business.service.user.UsersService;
|
||||
import com.accompany.business.vo.treasure.record.SeizeTreasureStaticVo;
|
||||
import com.accompany.common.model.PageReq;
|
||||
import com.accompany.core.model.Users;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class SeizeTreasureAdminService {
|
||||
@Autowired
|
||||
private UsersService usersService;
|
||||
@Autowired
|
||||
private SeizeTreasureAdminMapper seizeTreasureAdminMapper;
|
||||
|
||||
public SeizeTreasureStaticVo getRecordTotal(TreasureRecordReq recordReq) {
|
||||
Users userByErbanNo = null;
|
||||
if (recordReq.getErbanNo() != null) {
|
||||
userByErbanNo = usersService.getUserByErbanNo(recordReq.getErbanNo());
|
||||
if (userByErbanNo == null) {
|
||||
return new SeizeTreasureStaticVo();
|
||||
}
|
||||
}
|
||||
SeizeTreasureStaticVo recordTotal = seizeTreasureAdminMapper.getRecordTotal(
|
||||
recordReq.getPoolType(), recordReq.getPoolGroup(), recordReq.getPoolLevel(), userByErbanNo == null ? null : userByErbanNo.getUid(),
|
||||
recordReq.getStartDate(), recordReq.getEndDate());
|
||||
return recordTotal;
|
||||
}
|
||||
|
||||
public Pagination getRecordDaily(TreasureRecordReq recordReq, PageReq pageReq) {
|
||||
Users userByErbanNo = null;
|
||||
if (recordReq.getErbanNo() != null) {
|
||||
userByErbanNo = usersService.getUserByErbanNo(recordReq.getErbanNo());
|
||||
if (userByErbanNo == null) {
|
||||
return new Pagination();
|
||||
}
|
||||
}
|
||||
PageHelper.startPage(pageReq.getPage(), pageReq.getPageSize());
|
||||
List<SeizeTreasureDailyRecordVo> recordDaily = seizeTreasureAdminMapper.getRecordDaily(
|
||||
recordReq.getPoolType(), recordReq.getPoolGroup(), recordReq.getPoolLevel(), userByErbanNo == null ? null : userByErbanNo.getUid(),
|
||||
recordReq.getStartDate(), recordReq.getEndDate());
|
||||
PageInfo<GiftSendRecordAdminVo> pageInfo = new PageInfo(recordDaily);
|
||||
return new Pagination(pageInfo);
|
||||
}
|
||||
|
||||
public Pagination getRecord(TreasureRecordReq recordReq, PageReq pageReq) {
|
||||
Users userByErbanNo = null;
|
||||
if (recordReq.getErbanNo() != null) {
|
||||
userByErbanNo = usersService.getUserByErbanNo(recordReq.getErbanNo());
|
||||
if (userByErbanNo == null) {
|
||||
return new Pagination();
|
||||
}
|
||||
}
|
||||
PageHelper.startPage(pageReq.getPage(), pageReq.getPageSize());
|
||||
List<SeizeTreasureRecordVo> recordDaily = seizeTreasureAdminMapper.getRecord(
|
||||
recordReq.getPoolType(), recordReq.getPoolGroup(), recordReq.getPoolLevel(), userByErbanNo == null ? null : userByErbanNo.getUid(),
|
||||
recordReq.getStartDate(), recordReq.getEndDate());
|
||||
PageInfo<GiftSendRecordAdminVo> pageInfo = new PageInfo(recordDaily);
|
||||
return new Pagination(pageInfo);
|
||||
}
|
||||
}
|
@@ -0,0 +1,11 @@
|
||||
package com.accompany.admin.vo.treasure;
|
||||
|
||||
import com.accompany.business.vo.treasure.record.SeizeTreasureStaticVo;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public class SeizeTreasureDailyRecordVo extends SeizeTreasureStaticVo {
|
||||
private String dateStr;
|
||||
}
|
@@ -0,0 +1,25 @@
|
||||
package com.accompany.admin.vo.treasure;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public class SeizeTreasureRecordVo {
|
||||
private Long id;
|
||||
private Long erbanNo;
|
||||
private String userNick;
|
||||
private Integer poolType;
|
||||
private String poolGroup;
|
||||
private Integer poolLevel;
|
||||
private Long rewardId;
|
||||
private Long rewardRefId;
|
||||
private String rewardType;
|
||||
private String rewardName;
|
||||
private Integer rewardNum;
|
||||
private Integer rewardLevel;
|
||||
private Integer rewardShowValue;
|
||||
private Date createTime;
|
||||
}
|
@@ -0,0 +1,89 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.accompany.admin.mapper.treasure.SeizeTreasureAdminMapper">
|
||||
<select id="getRecordTotal" resultType="com.accompany.business.vo.treasure.record.SeizeTreasureStaticVo">
|
||||
SELECT
|
||||
count( DISTINCT stpdr.uid ) AS drawPeopleNum,
|
||||
count( stpdr.id ) AS drawCountNum,
|
||||
sum( str.reward_show_value ) AS drawOutputValue,
|
||||
count( stpdr.id )* 10 AS drawInputValue
|
||||
FROM
|
||||
seize_treasure_pool_draw_record stpdr
|
||||
LEFT JOIN seize_treasure_reward str ON stpdr.reward_id = str.id
|
||||
WHERE
|
||||
stpdr.pool_type = #{poolType}
|
||||
<if test="uid != null" >
|
||||
AND stpdr.uid = #{uid}
|
||||
</if>
|
||||
<if test="poolGroup != null" >
|
||||
AND stpdr.pool_group = #{poolGroup}
|
||||
</if>
|
||||
<if test="poolLevel != null" >
|
||||
AND stpdr.pool_level = #{poolLevel}
|
||||
</if>
|
||||
<if test="startDate != null" >
|
||||
AND stpdr.create_time >= #{startDate}
|
||||
</if>
|
||||
<if test="endDate != null" >
|
||||
AND stpdr.create_time < #{endDate}
|
||||
</if>
|
||||
</select>
|
||||
<select id="getRecordDaily" resultType="com.accompany.admin.vo.treasure.SeizeTreasureDailyRecordVo">
|
||||
SELECT DATE
|
||||
( stpdr.create_time ) dateStr,
|
||||
count( DISTINCT stpdr.uid ) AS drawPeopleNum,
|
||||
count( stpdr.id ) AS drawCountNum,
|
||||
sum( str.reward_show_value ) AS drawOutputValue,
|
||||
count( stpdr.id )* 10 AS drawInputValue
|
||||
FROM
|
||||
seize_treasure_pool_draw_record stpdr
|
||||
LEFT JOIN seize_treasure_reward str ON stpdr.reward_id = str.id
|
||||
WHERE
|
||||
stpdr.pool_type = 1
|
||||
<if test="startDate != null" >
|
||||
AND stpdr.create_time >= #{startDate}
|
||||
</if>
|
||||
<if test="endDate != null" >
|
||||
AND stpdr.create_time < #{endDate}
|
||||
</if>
|
||||
GROUP BY dateStr
|
||||
</select>
|
||||
<select id="getRecord" resultType="com.accompany.admin.vo.treasure.SeizeTreasureRecordVo">
|
||||
SELECT
|
||||
stpdr.id,
|
||||
u.erban_no,
|
||||
u.nick AS userNick,
|
||||
stpdr.pool_type,
|
||||
IF(stpdr.pool_group=1,'基础奖池组','高级奖池组') AS poolGroup,
|
||||
stpdr.pool_level,
|
||||
stpdr.reward_id,
|
||||
str.reward_ref_id,
|
||||
IF(str.reward_type='gift','礼物','其他') AS rewardType,
|
||||
str.reward_name,
|
||||
str.reward_num,
|
||||
str.reward_level,
|
||||
str.reward_show_value,
|
||||
stpdr.create_time
|
||||
FROM
|
||||
seize_treasure_pool_draw_record stpdr
|
||||
LEFT JOIN seize_treasure_reward str ON stpdr.reward_id = str.id
|
||||
left join users u on stpdr.uid = u.uid
|
||||
WHERE
|
||||
stpdr.pool_type = #{poolType}
|
||||
<if test="uid != null" >
|
||||
AND stpdr.uid = #{uid}
|
||||
</if>
|
||||
<if test="poolGroup != null" >
|
||||
AND stpdr.pool_group = #{poolGroup}
|
||||
</if>
|
||||
<if test="poolLevel != null" >
|
||||
AND stpdr.pool_level = #{poolLevel}
|
||||
</if>
|
||||
<if test="startDate != null" >
|
||||
AND stpdr.create_time >= #{startDate}
|
||||
</if>
|
||||
<if test="endDate != null" >
|
||||
AND stpdr.create_time < #{endDate}
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
@@ -0,0 +1,35 @@
|
||||
package com.accompany.admin.controller.treasure;
|
||||
|
||||
import com.accompany.admin.base.Pagination;
|
||||
import com.accompany.admin.controller.BaseController;
|
||||
import com.accompany.admin.params.treasure.TreasureRecordReq;
|
||||
import com.accompany.admin.service.treasure.SeizeTreasureAdminService;
|
||||
import com.accompany.business.vo.treasure.record.SeizeTreasureStaticVo;
|
||||
import com.accompany.common.model.PageReq;
|
||||
import com.accompany.common.result.BusiResult;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/admin/seize-treasure")
|
||||
public class SeizeTreasureAdminController extends BaseController {
|
||||
@Autowired
|
||||
private SeizeTreasureAdminService seizeTreasureAdminService;
|
||||
|
||||
@GetMapping("/treasure/record/total")
|
||||
public BusiResult<SeizeTreasureStaticVo> getTreasureRecordTotal(TreasureRecordReq params) {
|
||||
return new BusiResult(seizeTreasureAdminService.getRecordTotal(params));
|
||||
}
|
||||
|
||||
@GetMapping("/treasure/record/day")
|
||||
public Pagination getTreasureRecordDaily(TreasureRecordReq params, PageReq pageReq) {
|
||||
return seizeTreasureAdminService.getRecordDaily(params, pageReq);
|
||||
}
|
||||
|
||||
@GetMapping("/treasure/record")
|
||||
public Pagination getTreasureRecord(TreasureRecordReq params, PageReq pageReq) {
|
||||
return seizeTreasureAdminService.getRecord(params, pageReq);
|
||||
}
|
||||
}
|
@@ -44,6 +44,7 @@
|
||||
<option value="3">深海奇缘活动</option>
|
||||
<option value="6">守护星球</option>
|
||||
<option value="10">航海冒险</option>
|
||||
<option value="13">夺宝精灵</option>
|
||||
</select>
|
||||
|
||||
<button class="btn btn-default" id="search">
|
||||
@@ -113,6 +114,7 @@
|
||||
<label class="radio-inline"><input type="radio" onclick="changeType(this.value)" name="packType" value="3">深海奇缘活动</label>
|
||||
<label class="radio-inline"><input type="radio" onclick="changeType(this.value)" name="packType" value="6">守护星球活动</label>
|
||||
<label class="radio-inline"><input type="radio" onclick="changeType(this.value)" name="packType" value="10">航海冒险活动</label>
|
||||
<label class="radio-inline"><input type="radio" onclick="changeType(this.value)" name="packType" value="13">夺宝精灵活动</label>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -519,6 +521,8 @@
|
||||
return '守护星球活动';
|
||||
case 10:
|
||||
return '航海冒险活动';
|
||||
case 13:
|
||||
return '夺宝精灵活动';
|
||||
}
|
||||
}},
|
||||
{field: 'ticketNum', title: '赠送门票数量', align: 'center', valign: 'middle', width: '10%'},
|
||||
|
@@ -0,0 +1,242 @@
|
||||
<style>
|
||||
.dataCount {
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
margin-top: 10px;
|
||||
}
|
||||
.dataCount > p {
|
||||
padding: 5px;
|
||||
border-radius: 5px;
|
||||
background: #ccc;
|
||||
margin-right: 10px;
|
||||
}
|
||||
.tips{
|
||||
color:red;
|
||||
font-size: 14px;
|
||||
}
|
||||
.qry_col{
|
||||
float: left;
|
||||
}
|
||||
</style>
|
||||
|
||||
<section class="content">
|
||||
<div class="box box-primary">
|
||||
<section class="content-header">
|
||||
<h1 id="itemTitle"></h1>
|
||||
</section>
|
||||
|
||||
<section class="content">
|
||||
|
||||
<div id="toolbar">
|
||||
<form action="" id="searchForm" method="POST">
|
||||
<div class="col-sm-12">
|
||||
<div class="col-sm-4">
|
||||
<label for="timeBegin" class="qry_col control-label">日期:</label>
|
||||
<input type="text" name="timeBegin" id="timeBegin" class="input-sm" placeholder="起始时间">
|
||||
- <input type="text" name="timeEnd" id="timeEnd" class="input-sm" placeholder="结束时间">
|
||||
</div>
|
||||
<label for="erbanNo" class="qry_col control-label">用户ID:</label>
|
||||
<div class="col-sm-2">
|
||||
<input type="text" name="erbanNo" id="erbanNo" class="input-sm" placeholder="">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<button class="btn btn-primary" id="searchBtn">筛选</button>
|
||||
<div class="dataCount">
|
||||
<p>
|
||||
<span>参与用户数量:</span>
|
||||
<span id="drawPeopleNum"></span>
|
||||
</p>
|
||||
<p>
|
||||
<span>抽奖次数:</span>
|
||||
<span id="drawCountNum"></span>
|
||||
</p>
|
||||
<p>
|
||||
<span>投入总价值:</span>
|
||||
<span id="drawInputValue"></span>
|
||||
</p>
|
||||
<p>
|
||||
<span>产出总价值:</span>
|
||||
<span id="drawOutputValue"></span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="table"></div>
|
||||
</section>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
<script>
|
||||
$(function() {
|
||||
var picker1 = $('#timeBegin').datetimepicker({
|
||||
format: 'yyyy-mm-dd',
|
||||
todayBtn: true,
|
||||
autoclose: true,
|
||||
minView: 'month',
|
||||
endDate: new Date()
|
||||
});
|
||||
|
||||
var picker2 = $('#timeEnd').datetimepicker({
|
||||
format: 'yyyy-mm-dd',
|
||||
todayBtn: true,
|
||||
autoclose: true,
|
||||
minView: 'month',
|
||||
endDate: new Date()
|
||||
});
|
||||
|
||||
var $timeBegin = '' , $timeEnd = '';
|
||||
var main = {
|
||||
init: function() {
|
||||
this.eventRegister();
|
||||
this.valueChange();
|
||||
},
|
||||
|
||||
eventRegister: function() {
|
||||
picker1.on('changeDate', function() {
|
||||
var date = $('#timeBegin').datetimepicker('getDate');
|
||||
picker2.datetimepicker('setStartDate',date);
|
||||
});
|
||||
picker2.on('changeDate', function() {
|
||||
var date = $('#timeEnd').datetimepicker('getDate');
|
||||
picker1.datetimepicker('setEndDate',date);
|
||||
});
|
||||
|
||||
$('#searchBtn').on('click', function() {
|
||||
var $dataCount = $('.dataCount');
|
||||
// var $startDate = $('#timeBegin').val().replace(/\//g,'-');
|
||||
|
||||
if($('#timeBegin').val() == "" || $('#timeBegin').val() == 'undefined') {
|
||||
var $startDate = '';
|
||||
} else {
|
||||
/*var arr = $('#timeBegin').val().split('/');
|
||||
var length = arr.length;
|
||||
var $startDate = arr[length-1] +'-' + arr[0] + '-' + arr[length - 2];*/
|
||||
var $startDate = $('#timeBegin').val();
|
||||
}
|
||||
|
||||
if($('#timeEnd').val() == '' || $('#timeEnd').val() == 'undefined') {
|
||||
var $endDate = $startDate;
|
||||
} else {
|
||||
/*var arr2 = $('#timeEnd').val().split('/');
|
||||
var length2 = arr2.length;
|
||||
var $endDate = arr2[length2-1] + '-' + arr2[0] + '-' + arr2[length2-2];*/
|
||||
var $endDate = $('#timeEnd').val();
|
||||
}
|
||||
|
||||
if($startDate == '') {
|
||||
$timeBegin = '';
|
||||
$timeEnd = '';
|
||||
} else {
|
||||
$timeBegin = $startDate + ' 00:00:00';
|
||||
$timeEnd = $endDate + ' 23:59:59';
|
||||
}
|
||||
|
||||
$.get('/admin/seize-treasure/treasure/record/total',{
|
||||
erbanNo: $('#erbanNo').val(),
|
||||
poolType: 1,
|
||||
startDate: $timeBegin,
|
||||
endDate: $timeEnd,
|
||||
},function(res) {
|
||||
console.log(res);
|
||||
|
||||
if(res.code ==200) {
|
||||
var data = res.data;
|
||||
$dataCount.find('#drawPeopleNum').html(data.drawPeopleNum);
|
||||
$dataCount.find('#drawCountNum').html(data.drawCountNum);
|
||||
$dataCount.find('#drawInputValue').html(data.drawInputValue);
|
||||
$dataCount.find('#drawOutputValue').html(data.drawOutputValue);
|
||||
// TableHelper.doRefresh('#table');
|
||||
tableRefresh();
|
||||
} else {
|
||||
console.log('数据错误,导致加载失败,' + res.code);
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
$('#table').on('click','#details',function() {
|
||||
console.log($(this).data('id'));
|
||||
});
|
||||
|
||||
|
||||
},
|
||||
|
||||
valueChange: function() {
|
||||
var $dataCount = $('.dataCount');
|
||||
$.get('/admin/seize-treasure/treasure/record/total',{
|
||||
erbanNo: $('#erbanNo').val(),
|
||||
poolType: 1,
|
||||
startDate: $timeBegin,
|
||||
endDate: $timeEnd,
|
||||
},function(res) {
|
||||
console.log(res);
|
||||
|
||||
if(res.code ==200) {
|
||||
var data = res.data;
|
||||
$dataCount.find('#drawPeopleNum').html(data.drawPeopleNum);
|
||||
$dataCount.find('#drawCountNum').html(data.drawCountNum);
|
||||
$dataCount.find('#drawInputValue').html(data.drawInputValue);
|
||||
$dataCount.find('#drawOutputValue').html(data.drawOutputValue);
|
||||
TableHelper.doRefresh('#table');
|
||||
} else {
|
||||
console.log('数据错误,导致加载失败,' + res.code);
|
||||
}
|
||||
})
|
||||
}
|
||||
};
|
||||
main.init();
|
||||
|
||||
function tableRefresh() {
|
||||
$('#table').bootstrapTable('destroy');
|
||||
$('#table').bootstrapTable({
|
||||
columns: [
|
||||
{field: 'dateStr', title: '日期', align: 'center', valign: 'middle', width: '20%',formatter: function(val,rows,index) {
|
||||
if(val) {
|
||||
var date = new Date(val);
|
||||
return date.format('yyyy-MM-dd')
|
||||
} else {
|
||||
return '-';
|
||||
}
|
||||
}},
|
||||
{field: 'drawPeopleNum', title: '参与用户数量', align: 'center', valign: 'middle', width: '10%'},
|
||||
{field: 'drawCountNum', title: '抽奖次数', align: 'center', valign: 'middle', width: '10%'},
|
||||
{field: 'drawInputValue', title: '投入总价值', align: 'center', valign: 'middle', width: '10%'},
|
||||
{field: 'drawOutputValue', title: '产出总价值', align: 'center', valign: 'middle', width: '10%'},
|
||||
],
|
||||
cache: false,
|
||||
striped: true,
|
||||
showRefresh: false,
|
||||
pageSize: 10,
|
||||
pagination: true,
|
||||
pageList: [10,20,30,50],
|
||||
sidePagination: 'server',
|
||||
queryParamsType: 'undefined',
|
||||
queryParams: function queryParams(params) {
|
||||
var param = {
|
||||
pageSize: params.pageSize,
|
||||
pageNumber: params.pageNumber,
|
||||
poolType: 1,
|
||||
startDate: $timeBegin,
|
||||
endDate: $timeEnd,
|
||||
erbanNo: $('#erbanNo').val(),
|
||||
};
|
||||
return param;
|
||||
},
|
||||
uniqueId: 'id',
|
||||
toolbar: '#toolbar',
|
||||
url: '/admin/seize-treasure/treasure/record/day',
|
||||
onLoadSuccess: function() {
|
||||
console.log('load success');
|
||||
},
|
||||
onLOadError: function() {
|
||||
console.log('load fail');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
})
|
||||
</script>
|
@@ -0,0 +1,183 @@
|
||||
<style>
|
||||
.dataCount {
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
margin-top: 10px;
|
||||
}
|
||||
.dataCount > p {
|
||||
padding: 5px;
|
||||
border-radius: 5px;
|
||||
background: #ccc;
|
||||
margin-right: 10px;
|
||||
}
|
||||
.tips{
|
||||
color:red;
|
||||
font-size: 14px;
|
||||
}
|
||||
.qry_col{
|
||||
float: left;
|
||||
}
|
||||
</style>
|
||||
|
||||
<section class="content">
|
||||
<div class="box box-primary">
|
||||
<section class="content-header">
|
||||
<h1 id="itemTitle"></h1>
|
||||
</section>
|
||||
|
||||
<section class="content">
|
||||
|
||||
<div id="toolbar">
|
||||
<form action="" id="searchForm" method="POST">
|
||||
<div class="col-sm-12">
|
||||
<div class="col-sm-4">
|
||||
<label for="timeBegin" class="qry_col control-label">日期:</label>
|
||||
<input type="text" name="timeBegin" id="timeBegin" class="input-sm" placeholder="起始时间">
|
||||
- <input type="text" name="timeEnd" id="timeEnd" class="input-sm" placeholder="结束时间">
|
||||
</div>
|
||||
<label for="erbanNo" class="qry_col control-label">用户ID:</label>
|
||||
<div class="col-sm-2">
|
||||
<input type="text" name="erbanNo" id="erbanNo" class="input-sm" placeholder="">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<button class="btn btn-primary" id="searchBtn">筛选</button>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="table"></div>
|
||||
</section>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
<script>
|
||||
$(function() {
|
||||
var picker1 = $('#timeBegin').datetimepicker({
|
||||
format: 'yyyy-mm-dd',
|
||||
todayBtn: true,
|
||||
autoclose: true,
|
||||
minView: 'month',
|
||||
endDate: new Date()
|
||||
});
|
||||
|
||||
var picker2 = $('#timeEnd').datetimepicker({
|
||||
format: 'yyyy-mm-dd',
|
||||
todayBtn: true,
|
||||
autoclose: true,
|
||||
minView: 'month',
|
||||
endDate: new Date()
|
||||
});
|
||||
|
||||
var $timeBegin = '' , $timeEnd = '';
|
||||
var main = {
|
||||
init: function() {
|
||||
this.eventRegister();
|
||||
this.valueChange();
|
||||
},
|
||||
|
||||
eventRegister: function() {
|
||||
picker1.on('changeDate', function() {
|
||||
var date = $('#timeBegin').datetimepicker('getDate');
|
||||
picker2.datetimepicker('setStartDate',date);
|
||||
});
|
||||
picker2.on('changeDate', function() {
|
||||
var date = $('#timeEnd').datetimepicker('getDate');
|
||||
picker1.datetimepicker('setEndDate',date);
|
||||
});
|
||||
|
||||
$('#searchBtn').on('click', function() {
|
||||
var $dataCount = $('.dataCount');
|
||||
// var $startDate = $('#timeBegin').val().replace(/\//g,'-');
|
||||
|
||||
if($('#timeBegin').val() == "" || $('#timeBegin').val() == 'undefined') {
|
||||
var $startDate = '';
|
||||
} else {
|
||||
/*var arr = $('#timeBegin').val().split('/');
|
||||
var length = arr.length;
|
||||
var $startDate = arr[length-1] +'-' + arr[0] + '-' + arr[length - 2];*/
|
||||
var $startDate = $('#timeBegin').val();
|
||||
}
|
||||
|
||||
if($('#timeEnd').val() == '' || $('#timeEnd').val() == 'undefined') {
|
||||
var $endDate = $startDate;
|
||||
} else {
|
||||
/*var arr2 = $('#timeEnd').val().split('/');
|
||||
var length2 = arr2.length;
|
||||
var $endDate = arr2[length2-1] + '-' + arr2[0] + '-' + arr2[length2-2];*/
|
||||
var $endDate = $('#timeEnd').val();
|
||||
}
|
||||
|
||||
if($startDate == '') {
|
||||
$timeBegin = '';
|
||||
$timeEnd = '';
|
||||
} else {
|
||||
$timeBegin = $startDate + ' 00:00:00';
|
||||
$timeEnd = $endDate + ' 23:59:59';
|
||||
}
|
||||
tableRefresh();
|
||||
});
|
||||
|
||||
$('#table').on('click','#details',function() {
|
||||
console.log($(this).data('id'));
|
||||
});
|
||||
|
||||
|
||||
},
|
||||
|
||||
};
|
||||
main.init();
|
||||
|
||||
function tableRefresh() {
|
||||
$('#table').bootstrapTable('destroy');
|
||||
$('#table').bootstrapTable({
|
||||
columns: [
|
||||
{field: 'id', title: 'id', align: 'center', valign: 'middle', width: '10%'},
|
||||
{field: 'erbanNo', title: 'erbanNo', align: 'center', valign: 'middle', width: '10%'},
|
||||
{field: 'nick', title: '昵称', align: 'center', valign: 'middle', width: '10%'},
|
||||
{field: 'poolGroup', title: '奖池组', align: 'center', valign: 'middle', width: '10%'},
|
||||
// {field: 'poolLevel', title: '奖池等级', align: 'center', valign: 'middle', width: '10%'},
|
||||
{field: 'rewardId', title: '奖励id', align: 'center', valign: 'middle', width: '10%'},
|
||||
{field: 'rewardRefId', title: '奖励关联id', align: 'center', valign: 'middle', width: '10%'},
|
||||
{field: 'rewardType', title: '奖励类型', align: 'center', valign: 'middle', width: '10%'},
|
||||
{field: 'rewardName', title: '奖励名称', align: 'center', valign: 'middle', width: '10%'},
|
||||
{field: 'rewardNum', title: '奖励数量', align: 'center', valign: 'middle', width: '10%'},
|
||||
{field: 'rewardLevel', title: '奖励等级', align: 'center', valign: 'middle', width: '10%'},
|
||||
{field: 'rewardShowValue', title: '奖励价值', align: 'center', valign: 'middle', width: '10%'},
|
||||
{field: 'createTime', title: '抽奖时间', align: 'center', valign: 'middle', width: '10%'},
|
||||
],
|
||||
cache: false,
|
||||
striped: true,
|
||||
showRefresh: false,
|
||||
pageSize: 10,
|
||||
pagination: true,
|
||||
pageList: [10,20,30,50],
|
||||
sidePagination: 'server',
|
||||
queryParamsType: 'undefined',
|
||||
queryParams: function queryParams(params) {
|
||||
var param = {
|
||||
pageSize: params.pageSize,
|
||||
pageNumber: params.pageNumber,
|
||||
poolType: 1,
|
||||
startDate: $timeBegin,
|
||||
endDate: $timeEnd,
|
||||
erbanNo: $('#erbanNo').val(),
|
||||
};
|
||||
return param;
|
||||
},
|
||||
uniqueId: 'id',
|
||||
toolbar: '#toolbar',
|
||||
url: '/admin/seize-treasure/treasure/record',
|
||||
onLoadSuccess: function() {
|
||||
console.log('load success');
|
||||
},
|
||||
onLOadError: function() {
|
||||
console.log('load fail');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
})
|
||||
</script>
|
@@ -31,6 +31,8 @@ public class WebSecurityConfig {
|
||||
private String activityEnterpriseWechatPushKey;
|
||||
// 特殊通知
|
||||
private String specialEnterpriseWechatPushKey;
|
||||
private String seizeTreasureWechatPushKey;
|
||||
|
||||
|
||||
public void setJwtWebKey(String jwtWebKey) {
|
||||
WebSecurityConfig.jwtWebKey = jwtWebKey;
|
||||
|
@@ -307,6 +307,29 @@ public class Constant {
|
||||
public static int roomFreeGiftReset = 960;
|
||||
public static int roomFreeGiftUpdate = 961;
|
||||
// --------------- 房间内免费礼物自定义消息类型 ---------------------
|
||||
|
||||
/**
|
||||
* 夺宝精灵
|
||||
*/
|
||||
public static int SEIZE_TREASURE = 97;
|
||||
|
||||
public static int SEIZE_TREASURE_SEND_ELF = 9701; // 赠送小精灵
|
||||
public static int SEIZE_TREASURE_ASK_FOR_ELF = 9702; // 索要小精灵
|
||||
|
||||
public static int SEIZE_TREASURE_DRAW_GIFT_L1 = 9711; // 抽奖L1礼物
|
||||
public static int SEIZE_TREASURE_DRAW_GIFT_L2 = 9712; // 抽奖L2礼物
|
||||
public static int SEIZE_TREASURE_DRAW_GIFT_L3 = 9713; // 抽奖L3礼物
|
||||
public static int SEIZE_TREASURE_DRAW_GIFT_L4 = 9714; // 抽奖L4礼物
|
||||
public static int SEIZE_TREASURE_DRAW_GIFT_L5 = 9715; // 抽奖L5礼物
|
||||
|
||||
public static int SEIZE_TREASURE_DRAW_BALL_L1 = 9721; // 抽奖L1精灵球
|
||||
public static int SEIZE_TREASURE_DRAW_BALL_L2 = 9722; // 抽奖L2精灵球
|
||||
public static int SEIZE_TREASURE_DRAW_BALL_L3 = 9723; // 抽奖L3精灵球
|
||||
|
||||
public static int SEIZE_TREASURE_CONVERT_L1 = 9731; // 召唤L1
|
||||
public static int SEIZE_TREASURE_CONVERT_L2 = 9732; // 召唤L2
|
||||
public static int SEIZE_TREASURE_CONVERT_L3 = 9733; // 召唤L3
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1756,6 +1779,9 @@ public class Constant {
|
||||
* 特殊预警-谷歌充值
|
||||
* */
|
||||
public static final String GOOGLE_CHARGE_WARNING_CONFIG = "google_charge_warning_config";
|
||||
|
||||
/**** 夺宝精灵配置 ****/
|
||||
public static final String ACT_SEIZE_TREASURE_CONFIG = "act_seize_treasure_config";
|
||||
}
|
||||
|
||||
public static class ActiveMq {
|
||||
@@ -5764,5 +5790,21 @@ public class Constant {
|
||||
public static final Byte delete = 5;
|
||||
}
|
||||
|
||||
public static class ActivityRewardType{
|
||||
public static final String ACTIVITY_PROPS = "activityProps";
|
||||
public static final String DIAMOND = "diamond";
|
||||
// 礼物
|
||||
public static final String GIFT = "gift";
|
||||
// 铭牌
|
||||
public static final String NAME_PLATE = "namePlate";
|
||||
// 头饰
|
||||
public static final String HEADWEAR = "headwear";
|
||||
// 座驾
|
||||
public static final String CAR = "car";
|
||||
// 气泡
|
||||
public static final String CHAT_BUBBLE = "chatBubble";
|
||||
// 资料卡
|
||||
public static final String INFO_CARD = "infoCard";
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -0,0 +1,291 @@
|
||||
package com.accompany.common.constant;
|
||||
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
public interface SeizeTreasureConstant {
|
||||
interface ActInfo {
|
||||
String ACT_NAME = "seize_treasure";
|
||||
String ACT_DESC = "夺宝精灵";
|
||||
}
|
||||
|
||||
interface PoolType {
|
||||
/**
|
||||
* 密藏奖池
|
||||
*/
|
||||
Integer TREASURE = 1;
|
||||
/**
|
||||
* 幸运值奖池
|
||||
*/
|
||||
Integer TREASURE_DRAW_NUM = 2;
|
||||
/**
|
||||
* 森林奖池
|
||||
*/
|
||||
Integer FOREST = 3;
|
||||
/**
|
||||
* 合成奖池
|
||||
*/
|
||||
Integer COMPOUND = 4;
|
||||
}
|
||||
|
||||
interface TreasurePoolGroup {
|
||||
/**
|
||||
* 基础奖池
|
||||
*/
|
||||
Integer BASE = 1;
|
||||
/**
|
||||
* 高级奖池
|
||||
*/
|
||||
Integer HIGH = 2;
|
||||
}
|
||||
|
||||
interface ForestPoolLevel {
|
||||
/**
|
||||
* 基础奖池
|
||||
*/
|
||||
Integer BASE = 1;
|
||||
/**
|
||||
* 中级奖池
|
||||
*/
|
||||
Integer MIDDLE = 2;
|
||||
/**
|
||||
* 高级奖池
|
||||
*/
|
||||
Integer HIGH = 3;
|
||||
}
|
||||
|
||||
interface DrawUserInfoField {
|
||||
// 当前抽奖次数
|
||||
String CURRENT_DRAW_NUM_FIELD = "currentDrawNum";
|
||||
// 需要的抽奖次数
|
||||
String NEED_DRAW_NUM_FIELD = "needDrawNum";
|
||||
// 上轮差值
|
||||
String LESS_DRAW_NUM_FIELD = "lessDrawNum";
|
||||
}
|
||||
|
||||
interface ActPropsId {
|
||||
/**
|
||||
* 精灵碎片
|
||||
*/
|
||||
Long CHIP = 1001001L;
|
||||
|
||||
/**
|
||||
* 初级精灵球
|
||||
*/
|
||||
Long LOW_LEVEL_BALL = 1002001L;
|
||||
/**
|
||||
* 中级精灵球
|
||||
*/
|
||||
Long MIDDLE_LEVEL_BALL = 1002002L;
|
||||
/**
|
||||
* 高级精灵球
|
||||
*/
|
||||
Long HIGH_LEVEL_BALL = 1002003L;
|
||||
|
||||
/**
|
||||
* 初级-龙
|
||||
*/
|
||||
Long LOW_LEVEL_DRAGON = 1003001L;
|
||||
/**
|
||||
* 初级-猪
|
||||
*/
|
||||
Long LOW_LEVEL_PIG = 1003002L;
|
||||
/**
|
||||
* 初级-兔
|
||||
*/
|
||||
Long LOW_LEVEL_RABBIT = 1003003L;
|
||||
/**
|
||||
* 初级-龟
|
||||
*/
|
||||
Long LOW_LEVEL_TURTLE = 1003004L;
|
||||
/**
|
||||
* 初级-虎
|
||||
*/
|
||||
Long LOW_LEVEL_TIGER = 1003005L;
|
||||
List<Long> lowElfIdList = Arrays.asList(LOW_LEVEL_DRAGON, LOW_LEVEL_PIG, LOW_LEVEL_RABBIT, LOW_LEVEL_TURTLE, LOW_LEVEL_TIGER);
|
||||
/**
|
||||
* 中级-龙
|
||||
*/
|
||||
Long MIDDLE_LEVEL_DRAGON = 1004001L;
|
||||
/**
|
||||
* 中级-猪
|
||||
*/
|
||||
Long MIDDLE_LEVEL_PIG = 1004002L;
|
||||
/**
|
||||
* 中级-兔
|
||||
*/
|
||||
Long MIDDLE_LEVEL_RABBIT = 1004003L;
|
||||
/**
|
||||
* 中级-龟
|
||||
*/
|
||||
Long MIDDLE_LEVEL_TURTLE = 1004004L;
|
||||
/**
|
||||
* 中级-虎
|
||||
*/
|
||||
Long MIDDLE_LEVEL_TIGER = 1004005L;
|
||||
List<Long> middleElfIdList = Arrays.asList(MIDDLE_LEVEL_DRAGON, MIDDLE_LEVEL_PIG, MIDDLE_LEVEL_RABBIT, MIDDLE_LEVEL_TURTLE, MIDDLE_LEVEL_TIGER);
|
||||
|
||||
/**
|
||||
* 高级-龙
|
||||
*/
|
||||
Long HIGH_LEVEL_DRAGON = 1005001L;
|
||||
/**
|
||||
* 高级-猪
|
||||
*/
|
||||
Long HIGH_LEVEL_PIG = 1005002L;
|
||||
/**
|
||||
* 高级-兔
|
||||
*/
|
||||
Long HIGH_LEVEL_RABBIT = 1005003L;
|
||||
/**
|
||||
* 高级-龟
|
||||
*/
|
||||
Long HIGH_LEVEL_TURTLE = 1005004L;
|
||||
/**
|
||||
* 高级-虎
|
||||
*/
|
||||
Long HIGH_LEVEL_TIGER = 1005005L;
|
||||
List<Long> highElfIdList = Arrays.asList(HIGH_LEVEL_DRAGON, HIGH_LEVEL_PIG, HIGH_LEVEL_RABBIT, HIGH_LEVEL_TURTLE, HIGH_LEVEL_TIGER);
|
||||
|
||||
}
|
||||
|
||||
interface PropType {
|
||||
/**
|
||||
* 碎片
|
||||
*/
|
||||
Integer CHIP = 1;
|
||||
/**
|
||||
* 精灵球
|
||||
*/
|
||||
Integer BALL = 2;
|
||||
/**
|
||||
* 精灵
|
||||
*/
|
||||
Integer ELF = 3;
|
||||
}
|
||||
|
||||
interface PropLevel {
|
||||
/**
|
||||
* 1级
|
||||
*/
|
||||
Integer L1 = 1;
|
||||
/**
|
||||
* 2级
|
||||
*/
|
||||
Integer L2 = 2;
|
||||
/**
|
||||
* 3级
|
||||
*/
|
||||
Integer L3 = 3;
|
||||
}
|
||||
|
||||
interface PropRecordType {
|
||||
/**
|
||||
* 索要
|
||||
*/
|
||||
Integer ASK_FOR = 1;
|
||||
/**
|
||||
* 赠予
|
||||
*/
|
||||
Integer SEND = 2;
|
||||
/**
|
||||
* 获赠
|
||||
*/
|
||||
Integer RECEIVE = 3;
|
||||
/**
|
||||
* 合成获得
|
||||
*/
|
||||
Integer COMPOUND_GAIN = 4;
|
||||
/**
|
||||
* 合成消耗
|
||||
*/
|
||||
Integer COMPOUND_EXPEND = 5;
|
||||
/**
|
||||
* 兑换消耗
|
||||
*/
|
||||
Integer CONVERT_EXPEND = 6;
|
||||
}
|
||||
|
||||
interface ConvertType {
|
||||
/**
|
||||
* 精灵兑换
|
||||
*/
|
||||
Integer ELF = 1;
|
||||
/**
|
||||
* 碎片兑换
|
||||
*/
|
||||
Integer CHIP = 2;
|
||||
}
|
||||
|
||||
interface RedisKey{
|
||||
/**
|
||||
* 用户活动缓存
|
||||
*/
|
||||
String USER_INFO_KEY = "user_info";
|
||||
/**
|
||||
* 用户活动道具初始化锁
|
||||
*/
|
||||
String USER_PROP_INIT_LOCK_KEY = "user_prop:init_lock";
|
||||
/**
|
||||
* 用户活动道具初始化锁
|
||||
*/
|
||||
String POOL_INFO_KEY = "pool_info";
|
||||
/**
|
||||
* 夺宝奖池
|
||||
*/
|
||||
String POOL_KEY = "pool";
|
||||
/**
|
||||
* 奖池初始化锁
|
||||
*/
|
||||
String POOL_INIT_LOCK_KEY = "pool:init_lock";
|
||||
/**
|
||||
* 幸运值奖池
|
||||
*/
|
||||
String DRAW_NUM_POOL_KEY = "pool:draw_num";
|
||||
/**
|
||||
* 幸运奖池初始化锁
|
||||
*/
|
||||
String DRAW_NUM_POOL_INIT_LOCK_KEY = "pool:draw_num:init_lock";
|
||||
/**
|
||||
* 森林奖池
|
||||
*/
|
||||
String FOREST_POOL_KEY = "pool:forest";
|
||||
/**
|
||||
* 森林奖池初始化锁
|
||||
*/
|
||||
String FOREST_POOL_INIT_LOCK_KEY = "pool:forest:init_lock";
|
||||
/**
|
||||
* 精灵合成奖池
|
||||
*/
|
||||
String ELF_COMPOUND_POOL_KEY = "pool:elf_compound";
|
||||
/**
|
||||
* 精灵合成奖池初始化锁
|
||||
*/
|
||||
String ELF_COMPOUND_POOL_INIT_LOCK_KEY = "pool:elf_compound:init_lock";
|
||||
/**
|
||||
* 产出榜单
|
||||
*/
|
||||
String VALUE_RANK = "rank:value";
|
||||
/**
|
||||
*
|
||||
* @param str
|
||||
* @return
|
||||
*/
|
||||
static String getActRedisKey(@Nullable String... str) {
|
||||
StringBuilder sb = new StringBuilder("yinyou:seize_treasure");
|
||||
|
||||
if (null != str && str.length > 0) {
|
||||
for (String suf : str) {
|
||||
// 仅拼接有内容的字符串
|
||||
if (StringUtils.hasText(suf)) {
|
||||
sb.append(":").append(suf);
|
||||
}
|
||||
}
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
}
|
@@ -1782,6 +1782,8 @@ public enum RedisKey {
|
||||
room_first_charge_window,
|
||||
|
||||
mq_user_first_login_status,
|
||||
// 夺宝精灵
|
||||
seize_treasure,
|
||||
;
|
||||
|
||||
|
||||
|
@@ -818,6 +818,13 @@ public enum BusiStatus {
|
||||
VALENTINE_CP_HAS_CP(405, "已經和TA締結CP"),
|
||||
VALENTINE_CP_NOT_ENGOUTH_CURRENCY(405, "情簽不足,請獲得足夠的情簽再來兌換吧~"),
|
||||
|
||||
/**** 夺宝精灵活动 ****/
|
||||
SEIZE_TREASURE_NOT_OPEN(33001, "活动未开始"),
|
||||
SEIZE_TREASURE_DRAW_TOO_FAST(33002, "参与频繁,请稍后"),
|
||||
SEIZE_TREASURE_POOL_CONFIG_ERROR(33003, "奖池配置异常"),
|
||||
SEIZE_TREASURE_DRAW_TOO_BUSY(33004, "活动参与人数太多啦,请稍后重试"),
|
||||
SEIZE_TREASURE_USER_PROP_NOT_ENOUGH(33005, "道具不足"),
|
||||
|
||||
;
|
||||
|
||||
|
||||
|
@@ -152,6 +152,8 @@ public enum BillObjTypeEnum {
|
||||
SEEK_ELFIN_REWARD_DIAMOND((byte) 96,"寻找小精灵中奖奖励",BillTypeEnum.IN,CurrencyEnum.DIAMOND),
|
||||
|
||||
ACTIVITY_VALENTINE_CP_BUY_KEEPSAKE((byte) 97, "情人节CP购买信物", BillTypeEnum.OUT, CurrencyEnum.DIAMOND),
|
||||
ACTIVITY_SEIZE_TREASURE_PACK((byte) 98, "夺宝精灵礼包购买", BillTypeEnum.OUT, CurrencyEnum.DIAMOND),
|
||||
|
||||
;
|
||||
BillObjTypeEnum(byte value, String desc, BillTypeEnum type, CurrencyEnum currency) {
|
||||
this.value = value;
|
||||
|
@@ -1336,6 +1336,34 @@ public class JedisService {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过redis的Pipeline 批量添加list数据
|
||||
*/
|
||||
public boolean rpushList(String key, List<?> list) {
|
||||
Jedis wjedis = null;
|
||||
boolean status = false;
|
||||
try {
|
||||
wjedis = this.writeJedisPoolManager.getJedis();
|
||||
Pipeline p = wjedis.pipelined();
|
||||
if (list != null && !list.isEmpty()) {
|
||||
for (Object el : list) {
|
||||
p.rpush(key, String.valueOf(el));
|
||||
}
|
||||
}
|
||||
p.sync();
|
||||
status = true;
|
||||
return status;
|
||||
} catch (Exception e) {
|
||||
log.error("rpushList from jedis error. key:{} list:{}", key, list);
|
||||
return status;
|
||||
} finally {
|
||||
if (wjedis != null) {
|
||||
wjedis.close();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过redis的Pipeline 批量添加Set数据
|
||||
*/
|
||||
|
@@ -19,6 +19,8 @@ public enum ActivitesPackTypeEnum {
|
||||
CP_ACT_2022(8, false, "七夕活动2022电池"),
|
||||
SHIP_ANTICS(10, true, "航海冒险"),
|
||||
LINEARLIY_PRIZE_POOL_COIN(11, false, "航海冒险元宝货币"),
|
||||
SEIZE_TREASURE_TICKET(13,true,"夺宝精灵夺宝券礼包"),
|
||||
|
||||
;
|
||||
private Integer value;
|
||||
|
||||
|
@@ -0,0 +1,24 @@
|
||||
package com.accompany.business.model.treasure;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public class SeizeTreasureConvertItem {
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
private Long rewardId;
|
||||
private Integer type;
|
||||
private Integer level;
|
||||
private Integer expendType;
|
||||
private Integer expendNum;
|
||||
private Integer status;
|
||||
private Date createTime;
|
||||
private Date updateTime;
|
||||
|
||||
}
|
@@ -0,0 +1,29 @@
|
||||
package com.accompany.business.model.treasure;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public class SeizeTreasureConvertRecord {
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
private Long uid;
|
||||
private Long itemId;
|
||||
private Integer convertType;
|
||||
private Integer convertLevel;
|
||||
private Long rewardId;
|
||||
private String rewardType;
|
||||
private String rewardName;
|
||||
private Integer rewardNum;
|
||||
private String rewardUnit;
|
||||
private String rewardPicUrl;
|
||||
private Integer rewardShowValue;
|
||||
private Date createTime;
|
||||
private Date updateTime;
|
||||
|
||||
}
|
@@ -0,0 +1,37 @@
|
||||
package com.accompany.business.model.treasure;
|
||||
|
||||
import com.accompany.business.vo.treasure.reward.SeizeTreasurePoolRewardCache;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SeizeTreasurePoolDrawRecord {
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
private Integer poolType;
|
||||
private Integer poolGroup;
|
||||
private Integer poolLevel;
|
||||
private Long poolId;
|
||||
private Long rewardId;
|
||||
private Long uid;
|
||||
private Date createTime;
|
||||
private Date updateTime;
|
||||
|
||||
public SeizeTreasurePoolDrawRecord( Long uid,SeizeTreasurePoolRewardCache rewardCache) {
|
||||
this.poolType = rewardCache.getPoolType();
|
||||
this.poolGroup = rewardCache.getPoolGroup();
|
||||
this.poolLevel = rewardCache.getPoolLevel();
|
||||
this.poolId = rewardCache.getPoolId();
|
||||
this.rewardId = rewardCache.getReward().getId();
|
||||
this.uid = uid;
|
||||
}
|
||||
}
|
@@ -0,0 +1,27 @@
|
||||
package com.accompany.business.model.treasure;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public class SeizeTreasurePoolItem {
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
private Integer poolType;
|
||||
private Integer poolGroup;
|
||||
private Integer poolLevel;
|
||||
private Long rewardId;
|
||||
private Integer poolNum;
|
||||
private Integer ratio;
|
||||
private Integer showRatio;
|
||||
private Integer itemIndex;
|
||||
private String creator;
|
||||
private Date createTime;
|
||||
private Date updateTime;
|
||||
|
||||
}
|
@@ -0,0 +1,22 @@
|
||||
package com.accompany.business.model.treasure;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public class SeizeTreasureProp {
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
private Integer type;
|
||||
private Integer level;
|
||||
private String name;
|
||||
private String picUrl;
|
||||
private Date createTime;
|
||||
private Date updateTime;
|
||||
|
||||
}
|
@@ -0,0 +1,36 @@
|
||||
package com.accompany.business.model.treasure;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public class SeizeTreasureReward {
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 奖励类型
|
||||
*/
|
||||
private String rewardType;
|
||||
/**
|
||||
* 关联id
|
||||
*/
|
||||
private Long rewardRefId;
|
||||
private String rewardName;
|
||||
private String rewardPicUrl;
|
||||
private Integer rewardNum;
|
||||
private String rewardUnit;
|
||||
private Integer rewardValue;
|
||||
private Integer rewardShowValue;
|
||||
private Integer rewardLevel;
|
||||
private Integer rewardOrder;
|
||||
private String creator;
|
||||
private Date createTime;
|
||||
private Date updateTime;
|
||||
|
||||
}
|
@@ -0,0 +1,23 @@
|
||||
package com.accompany.business.model.treasure;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@NoArgsConstructor
|
||||
public class SeizeTreasureUserProp {
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
private Long uid;
|
||||
private Long propId;
|
||||
private Integer propNum;
|
||||
private Date createTime;
|
||||
private Date updateTime;
|
||||
|
||||
}
|
@@ -0,0 +1,42 @@
|
||||
package com.accompany.business.model.treasure;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public class SeizeTreasureUserPropRecord {
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
private Long uid;
|
||||
private Long propId;
|
||||
private Integer propNum;
|
||||
private Integer type;
|
||||
private Long targetUid;
|
||||
private Long bizId;
|
||||
private Integer bizLevel;
|
||||
private Date createTime;
|
||||
private Date updateTime;
|
||||
|
||||
public SeizeTreasureUserPropRecord(Long uid, Long propId, Integer type) {
|
||||
this(uid,type, propId, 1, null, null, null);
|
||||
}
|
||||
|
||||
public SeizeTreasureUserPropRecord(Long uid, Long propId, Integer type, Long targetUid) {
|
||||
this(uid, type,propId, 1, targetUid, null, null);
|
||||
}
|
||||
|
||||
public SeizeTreasureUserPropRecord(Long uid, Integer type, Long propId, Integer propNum, Long targetUid, Long bizId, Integer bizLevel) {
|
||||
this.uid = uid;
|
||||
this.propId = propId;
|
||||
this.propNum = propNum;
|
||||
this.type = type;
|
||||
this.targetUid = targetUid;
|
||||
this.bizId = bizId;
|
||||
this.bizLevel = bizLevel;
|
||||
}
|
||||
}
|
@@ -1,6 +1,7 @@
|
||||
package com.accompany.business.mybatismapper;
|
||||
|
||||
import com.accompany.business.model.Fans;
|
||||
import com.accompany.business.vo.follow.FriendVo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
@@ -18,4 +19,7 @@ public interface FansMapperExpand {
|
||||
List<String> searchFansAndFollowing(@Param("uid") Long uid, @Param("searchKey") String searchKey);
|
||||
|
||||
List<String> searchFriendList(@Param("uid")Long uid);
|
||||
|
||||
List<FriendVo> getFriendList(@Param("uid")Long uid, @Param("nick")String nick);
|
||||
|
||||
}
|
||||
|
@@ -0,0 +1,16 @@
|
||||
package com.accompany.business.mybatismapper.treasure;
|
||||
|
||||
import com.accompany.business.model.treasure.SeizeTreasureConvertItem;
|
||||
import com.accompany.business.vo.treasure.convert.SeizeTreasureCovertItemVo;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface SeizeTreasureConvertItemMapper extends BaseMapper<SeizeTreasureConvertItem> {
|
||||
List<SeizeTreasureCovertItemVo> getConvertItem(@Param("convertType") Integer convertType);
|
||||
|
||||
SeizeTreasureCovertItemVo getItemById(@Param("itemId") Long itemId);
|
||||
}
|
@@ -0,0 +1,14 @@
|
||||
package com.accompany.business.mybatismapper.treasure;
|
||||
|
||||
import com.accompany.business.model.treasure.SeizeTreasureConvertRecord;
|
||||
import com.accompany.business.vo.treasure.convert.SeizeTreasureConvertRecordVo;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface SeizeTreasureConvertRecordMapper extends BaseMapper<SeizeTreasureConvertRecord> {
|
||||
List<SeizeTreasureConvertRecordVo> getConvertRecord(@Param("uid") Long uid, @Param("convertType") Integer convertType);
|
||||
}
|
@@ -0,0 +1,19 @@
|
||||
package com.accompany.business.mybatismapper.treasure;
|
||||
|
||||
import com.accompany.business.model.treasure.SeizeTreasurePoolDrawRecord;
|
||||
import com.accompany.business.vo.treasure.record.SeizeTreasurePoolDrawRecordVo;
|
||||
import com.accompany.business.vo.treasure.record.SeizeTreasureStaticVo;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface SeizeTreasurePoolDrawRecordMapper extends BaseMapper<SeizeTreasurePoolDrawRecord> {
|
||||
|
||||
List<SeizeTreasurePoolDrawRecordVo> getDrawRecordList(@Param("uid") Long uid, @Param("poolTypeList") List<Integer> poolTypeList);
|
||||
|
||||
SeizeTreasureStaticVo staticPoolRecord(@Param("poolType") Integer poolType, @Param("poolGroup") Integer poolGroup, @Param("poolLevel") Integer poolLevel, @Param("startDate") Date startDate, @Param("endDate") Date endDate);
|
||||
}
|
@@ -0,0 +1,16 @@
|
||||
package com.accompany.business.mybatismapper.treasure;
|
||||
|
||||
import com.accompany.business.model.treasure.SeizeTreasurePoolItem;
|
||||
import com.accompany.business.vo.treasure.SeizeTreasurePoolItemVo;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface SeizeTreasurePoolItemMapper extends BaseMapper<SeizeTreasurePoolItem> {
|
||||
List<SeizeTreasurePoolItemVo> getPoolItemList(
|
||||
@Param("poolType") Integer poolType, @Param("poolGroup") Integer poolGroup,@Param("poolLevel") Integer poolLeveler);
|
||||
|
||||
}
|
@@ -0,0 +1,10 @@
|
||||
package com.accompany.business.mybatismapper.treasure;
|
||||
|
||||
import com.accompany.business.model.treasure.SeizeTreasureProp;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface SeizeTreasurePropMapper extends BaseMapper<SeizeTreasureProp> {
|
||||
|
||||
}
|
@@ -0,0 +1,11 @@
|
||||
package com.accompany.business.mybatismapper.treasure;
|
||||
|
||||
import com.accompany.business.model.treasure.SeizeTreasureReward;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface SeizeTreasureRewardMapper extends BaseMapper<SeizeTreasureReward> {
|
||||
|
||||
}
|
||||
|
@@ -0,0 +1,38 @@
|
||||
package com.accompany.business.mybatismapper.treasure;
|
||||
|
||||
import com.accompany.business.model.treasure.SeizeTreasureUserProp;
|
||||
import com.accompany.business.vo.treasure.elf.SeizeTreasureUserElfVo;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
@Mapper
|
||||
public interface SeizeTreasureUserPropMapper extends BaseMapper<SeizeTreasureUserProp> {
|
||||
void addUserProp(@Param("uid") Long uid, @Param("propId") Long propId, @Param("addNum") Integer addNum);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param uid
|
||||
* @param propId
|
||||
* @param reduceNum
|
||||
* @param minNum
|
||||
* @return 受影响的行数
|
||||
*/
|
||||
Integer reduceUserProp(@Param("uid") Long uid, @Param("propId") Long propId, @Param("reduceNum") Integer reduceNum,@Param("minNum") Integer minNum);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param uid
|
||||
* @param propIdSet
|
||||
* @param reduceNum
|
||||
* @param minNum
|
||||
* @return 受影响的行数
|
||||
*/
|
||||
Integer batchReduceUserProp(@Param("uid") Long uid, @Param("propIdSet") Set<Long> propIdSet, @Param("reduceNum") Integer reduceNum, @Param("minNum") Integer minNum);
|
||||
|
||||
|
||||
List<SeizeTreasureUserElfVo> getUserElvesVo(@Param("uid") Long uid);
|
||||
}
|
@@ -0,0 +1,20 @@
|
||||
package com.accompany.business.mybatismapper.treasure;
|
||||
|
||||
import com.accompany.business.model.treasure.SeizeTreasureUserPropRecord;
|
||||
import com.accompany.business.vo.treasure.compound.SeizeTreasureElfCompoundRecordVo;
|
||||
import com.accompany.business.vo.treasure.elf.SeizeTreasureElfRecordVo;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface SeizeTreasureUserPropRecordMapper extends BaseMapper<SeizeTreasureUserPropRecord> {
|
||||
|
||||
List<SeizeTreasureElfRecordVo> getUserElfRecord(@Param("uid") Long uid, @Param("typeList") List<Integer> typeList);
|
||||
|
||||
List<SeizeTreasureElfCompoundRecordVo> getCompoundGainRecord(@Param("uid") Long uid);
|
||||
|
||||
List<SeizeTreasureElfCompoundRecordVo.ElfCompoundExpendVo> getCompoundExpendList(@Param("recordIdList")List<Long> recordIdList);
|
||||
}
|
@@ -10,9 +10,10 @@
|
||||
*/
|
||||
package com.accompany.business.mybatismapper.user;
|
||||
|
||||
import com.accompany.business.model.user.UserActPropertyInfo;
|
||||
import com.accompany.business.model.user.UserActPropertyInfoV2;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Update;
|
||||
|
||||
/**
|
||||
* <br>接口描述:
|
||||
@@ -22,5 +23,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
* @date [2020/12/28]
|
||||
*/
|
||||
public interface UserActPropertyInfoV2Mapper extends BaseMapper<UserActPropertyInfoV2> {
|
||||
@Update("UPDATE user_act_property_info_v2 SET piece_num = piece_num - #{reduceNum} WHERE uid = #{uid} AND property_type = #{propertyType} AND piece_num >= #{reduceNum} ")
|
||||
Integer reduceUserPieceNum(@Param("uid")Long uid, @Param("propertyType")Integer propertyType, @Param("reduceNum")Integer reduceNum);
|
||||
|
||||
}
|
||||
|
@@ -1,24 +1,39 @@
|
||||
package com.accompany.business.service;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.accompany.common.utils.UUIDUitl;
|
||||
import com.accompany.business.service.room.RoomQueryService;
|
||||
import com.accompany.common.constant.Attach;
|
||||
import com.accompany.common.constant.Constant;
|
||||
import com.accompany.common.netease.neteaseacc.result.RubbishRet;
|
||||
import com.accompany.common.utils.UUIDUitl;
|
||||
import com.accompany.core.model.Room;
|
||||
import com.google.gson.Gson;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.core.task.TaskExecutor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* Created by liuguofu on 2017/6/6.
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class SendChatRoomMsgService {
|
||||
private static final Logger logger = LoggerFactory.getLogger(SendChatRoomMsgService.class);
|
||||
@Autowired
|
||||
private ErBanNetEaseService erBanNetEaseService;
|
||||
@Autowired
|
||||
private RoomQueryService roomQueryService;
|
||||
@Resource(name = "bizExecutor")
|
||||
private TaskExecutor bizExecutor;
|
||||
private static int defMsgType=100;
|
||||
private Integer BATCH_SIZE = 500;
|
||||
private Gson gson=new Gson();
|
||||
|
||||
|
||||
@@ -40,4 +55,60 @@ public class SendChatRoomMsgService {
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送所有房间消息
|
||||
* @param first
|
||||
* @param second
|
||||
* @param playRoom 许愿用户所在房间
|
||||
* @param msgObj
|
||||
*/
|
||||
public long sendBatchRoomMsg(int first, int second, final Room playRoom, final Object msgObj) {
|
||||
Attach attach = new Attach();
|
||||
attach.setFirst(first);
|
||||
attach.setSecond(second);
|
||||
attach.setData(msgObj);
|
||||
return sendMessageToAllValidRooms(playRoom.getUid(), gson.toJson(attach), playRoom);
|
||||
}
|
||||
|
||||
private long sendMessageToAllValidRooms(Long sender, String msg, Room playRoom) {
|
||||
long count = this.roomQueryService.countValidRoomsExcludePlayroom(playRoom.getRoomId());
|
||||
// 由于用户在玩的房间一定是要发消息的, 所以预留一个位置给这个房间
|
||||
int pageSize = BATCH_SIZE - 1;
|
||||
long times = count % pageSize == 0 ? (count / pageSize) : (count / pageSize) + 1;
|
||||
boolean hasSendPlayroom = false;
|
||||
for (int i = 0; i < times; i++) {
|
||||
Integer index = i * pageSize;
|
||||
List<Room> validRooms = this.roomQueryService.listValidRoomsExcludePlayroom(playRoom.getRoomId(), index, pageSize);
|
||||
if (!hasSendPlayroom) {
|
||||
if (validRooms == null) {
|
||||
validRooms = new ArrayList<>();
|
||||
}
|
||||
validRooms.add(playRoom);
|
||||
hasSendPlayroom = true;
|
||||
}
|
||||
this.batchSendRoomMessage(sender, validRooms, msg);
|
||||
}
|
||||
log.info("发送所有有效房间消息,房间数:{}", count);
|
||||
return count;
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量发送房间消息
|
||||
*
|
||||
* @param sender
|
||||
* @param rooms
|
||||
* @param msg
|
||||
*/
|
||||
private void batchSendRoomMessage(final Long sender, final List<Room> rooms, final String msg) {
|
||||
for (Room room : rooms) {
|
||||
bizExecutor.execute(() -> {
|
||||
try {
|
||||
erBanNetEaseService.sendChatRoomMsg(room.getRoomId(), UUIDUitl.get(), sender.toString(), Constant.DefineProtocol.CUSTOM_MESS_DEFINE, msg);
|
||||
} catch (Exception e) {
|
||||
log.error("批量发送房间消息失败[room={}, message={}]", gson.toJson(room), msg, e);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -130,7 +130,10 @@ public class ActivityPackMessageService {
|
||||
// 守护星球
|
||||
billObjTypeEnum = BillObjTypeEnum.SHIP_ANTICS_PACK;
|
||||
}
|
||||
|
||||
// 夺宝精灵
|
||||
if(packType == ActivitesPackTypeEnum.SEIZE_TREASURE_TICKET.getValue().byteValue()){
|
||||
billObjTypeEnum = BillObjTypeEnum.ACTIVITY_SEIZE_TREASURE_PACK;
|
||||
}
|
||||
return billObjTypeEnum;
|
||||
}
|
||||
|
||||
|
@@ -22,6 +22,7 @@ import com.accompany.business.vo.RoomVo;
|
||||
import com.accompany.business.vo.follow.FansFollowVo;
|
||||
import com.accompany.business.vo.follow.FansPersonVo;
|
||||
import com.accompany.business.vo.follow.FansRoomVo;
|
||||
import com.accompany.business.vo.follow.FriendVo;
|
||||
import com.accompany.business.vo.home.PlayRoomVo;
|
||||
import com.accompany.business.vo.roomtab.RoomFollowVo;
|
||||
import com.accompany.common.config.SystemConfig;
|
||||
@@ -875,4 +876,8 @@ public class FansService extends ServiceImpl<FansMapper,Fans> {
|
||||
}
|
||||
}
|
||||
|
||||
public List<FriendVo> getFriendList(Long uid, String nick) {
|
||||
return fansMapperExpand.getFriendList(uid, nick);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -270,6 +270,7 @@ public class BillRecordService extends ServiceImpl<BillRecordMapper,BillRecord>
|
||||
objTypes.add(BillObjTypeEnum.SEND_DIAMOND_OUT.getValue());
|
||||
objTypes.add(BillObjTypeEnum.ACTIVITY_LUCKY_SEA_DRAW.getValue());
|
||||
objTypes.add(BillObjTypeEnum.ACTIVITY_NEW_YEAR_FIREWORK_DRAW.getValue());
|
||||
objTypes.add(BillObjTypeEnum.ACTIVITY_SEIZE_TREASURE_PACK.getValue());
|
||||
break;
|
||||
case WITHDRAW_IN_OUT:
|
||||
objTypes.add(BillObjTypeEnum.WITHDRAW.getValue());
|
||||
|
@@ -0,0 +1,24 @@
|
||||
package com.accompany.business.service.treasure;
|
||||
|
||||
import com.accompany.business.model.treasure.SeizeTreasureConvertItem;
|
||||
import com.accompany.business.mybatismapper.treasure.SeizeTreasureConvertItemMapper;
|
||||
import com.accompany.business.vo.treasure.convert.SeizeTreasureCovertItemVo;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class SeizeTreasureConvertItemService extends ServiceImpl<SeizeTreasureConvertItemMapper, SeizeTreasureConvertItem> {
|
||||
@Autowired
|
||||
private SeizeTreasureConvertItemMapper seizeTreasureConvertItemMapper;
|
||||
|
||||
List<SeizeTreasureCovertItemVo> getConvertItem(Integer convertType) {
|
||||
return seizeTreasureConvertItemMapper.getConvertItem(convertType);
|
||||
}
|
||||
|
||||
SeizeTreasureCovertItemVo getItemById(Long itemId) {
|
||||
return seizeTreasureConvertItemMapper.getItemById(itemId);
|
||||
}
|
||||
}
|
@@ -0,0 +1,43 @@
|
||||
package com.accompany.business.service.treasure;
|
||||
|
||||
import com.accompany.business.model.treasure.SeizeTreasureConvertRecord;
|
||||
import com.accompany.business.mybatismapper.treasure.SeizeTreasureConvertRecordMapper;
|
||||
import com.accompany.business.vo.treasure.convert.SeizeTreasureConvertRecordVo;
|
||||
import com.accompany.business.vo.treasure.convert.SeizeTreasureCovertItemVo;
|
||||
import com.accompany.business.vo.treasure.reward.seizeTreasureRewardBaseVo;
|
||||
import com.accompany.common.model.PageReq;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class SeizeTreasureConvertRecordService extends ServiceImpl<SeizeTreasureConvertRecordMapper, SeizeTreasureConvertRecord> {
|
||||
@Autowired
|
||||
private SeizeTreasureConvertRecordMapper seizeTreasureConvertRecordMapper;
|
||||
|
||||
public SeizeTreasureConvertRecord addRecord(Long uid, SeizeTreasureCovertItemVo covertItem, seizeTreasureRewardBaseVo convertReward) {
|
||||
SeizeTreasureConvertRecord record = new SeizeTreasureConvertRecord();
|
||||
|
||||
record.setUid(uid);
|
||||
record.setItemId(covertItem.getItemId());
|
||||
record.setConvertType(covertItem.getType());
|
||||
record.setConvertLevel(covertItem.getLevel());
|
||||
record.setRewardId(covertItem.getRewardId());
|
||||
record.setRewardType(convertReward.getRewardType());
|
||||
record.setRewardName(covertItem.getRewardName());
|
||||
record.setRewardNum(covertItem.getRewardNum());
|
||||
record.setRewardUnit(convertReward.getRewardUnit());
|
||||
record.setRewardPicUrl(covertItem.getRewardPicUrl());
|
||||
record.setRewardShowValue(convertReward.getRewardShowValue());
|
||||
this.save(record);
|
||||
return record;
|
||||
}
|
||||
|
||||
public List<SeizeTreasureConvertRecordVo> getConvertRecord(Long uid, Integer convertType, PageReq pageReq) {
|
||||
PageHelper.startPage(pageReq.getPage(), pageReq.getPageSize());
|
||||
return seizeTreasureConvertRecordMapper.getConvertRecord(uid, convertType);
|
||||
}
|
||||
}
|
@@ -0,0 +1,37 @@
|
||||
package com.accompany.business.service.treasure;
|
||||
|
||||
import com.accompany.business.model.treasure.SeizeTreasurePoolDrawRecord;
|
||||
import com.accompany.business.mybatismapper.treasure.SeizeTreasurePoolDrawRecordMapper;
|
||||
import com.accompany.business.vo.treasure.record.SeizeTreasurePoolDrawRecordVo;
|
||||
import com.accompany.business.vo.treasure.record.SeizeTreasureStaticVo;
|
||||
import com.accompany.common.model.PageReq;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 夺宝精灵奖池类
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class SeizeTreasurePoolDrawRecordService extends ServiceImpl<SeizeTreasurePoolDrawRecordMapper, SeizeTreasurePoolDrawRecord> {
|
||||
|
||||
@Autowired
|
||||
private SeizeTreasurePoolDrawRecordMapper seizeTreasurePoolDrawRecordMapper;
|
||||
|
||||
public List<SeizeTreasurePoolDrawRecordVo> getDrawRecordList(Long uid, List<Integer> poolTypeList, PageReq pageReq) {
|
||||
PageHelper.startPage(pageReq.getPage(), pageReq.getPageSize());
|
||||
List<SeizeTreasurePoolDrawRecordVo> drawRecordList = seizeTreasurePoolDrawRecordMapper.getDrawRecordList(uid, poolTypeList);
|
||||
return drawRecordList;
|
||||
}
|
||||
|
||||
public SeizeTreasureStaticVo staticPoolRecord(Integer poolType, @Nullable Integer poolGroup, @Nullable Integer poolLevel, Date startDate, Date endDate) {
|
||||
return seizeTreasurePoolDrawRecordMapper.staticPoolRecord(poolType, poolGroup, poolLevel, startDate, endDate);
|
||||
}
|
||||
}
|
@@ -0,0 +1,36 @@
|
||||
package com.accompany.business.service.treasure;
|
||||
|
||||
import com.accompany.business.model.treasure.SeizeTreasurePoolItem;
|
||||
import com.accompany.business.mybatismapper.treasure.SeizeTreasurePoolItemMapper;
|
||||
import com.accompany.business.vo.treasure.SeizeTreasurePoolItemVo;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 夺宝精灵奖池类
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class SeizeTreasurePoolItemService extends ServiceImpl<SeizeTreasurePoolItemMapper, SeizeTreasurePoolItem> {
|
||||
|
||||
@Autowired
|
||||
private SeizeTreasurePoolItemMapper seizeTreasurePoolItemMapper;
|
||||
|
||||
public List<SeizeTreasurePoolItem> getPoolItem(@Nullable Integer poolType, @Nullable Integer poolGroup, @Nullable Integer poolLevel) {
|
||||
return this.lambdaQuery()
|
||||
.eq(poolType != null, SeizeTreasurePoolItem::getPoolType, poolType)
|
||||
.eq(poolGroup != null, SeizeTreasurePoolItem::getPoolGroup, poolGroup)
|
||||
.eq(poolLevel != null, SeizeTreasurePoolItem::getPoolLevel, poolLevel)
|
||||
.list();
|
||||
}
|
||||
|
||||
public List<SeizeTreasurePoolItemVo> getPoolItemVo(@Nullable Integer poolType, @Nullable Integer poolGroup, @Nullable Integer poolLevel) {
|
||||
return seizeTreasurePoolItemMapper.getPoolItemList(poolType, poolGroup, poolLevel);
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,10 @@
|
||||
package com.accompany.business.service.treasure;
|
||||
|
||||
import com.accompany.business.model.treasure.SeizeTreasureProp;
|
||||
import com.accompany.business.mybatismapper.treasure.SeizeTreasurePropMapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class SeizeTreasurePropService extends ServiceImpl<SeizeTreasurePropMapper, SeizeTreasureProp> {
|
||||
}
|
@@ -0,0 +1,18 @@
|
||||
package com.accompany.business.service.treasure;
|
||||
|
||||
import com.accompany.business.model.treasure.SeizeTreasureReward;
|
||||
import com.accompany.business.mybatismapper.treasure.SeizeTreasureRewardMapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
public class SeizeTreasureRewardService extends ServiceImpl<SeizeTreasureRewardMapper, SeizeTreasureReward> {
|
||||
|
||||
List<SeizeTreasureReward> getByRewardIds(List<Long> rewardIdList) {
|
||||
return lambdaQuery().in(SeizeTreasureReward::getId, rewardIdList).list();
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,48 @@
|
||||
package com.accompany.business.service.treasure;
|
||||
|
||||
import com.accompany.business.model.treasure.SeizeTreasureUserPropRecord;
|
||||
import com.accompany.business.mybatismapper.treasure.SeizeTreasureUserPropRecordMapper;
|
||||
import com.accompany.business.vo.treasure.compound.SeizeTreasureElfCompoundRecordVo;
|
||||
import com.accompany.business.vo.treasure.elf.SeizeTreasureElfRecordVo;
|
||||
import com.accompany.common.model.PageReq;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 夺宝精灵奖池类
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class SeizeTreasureUserPropRecordService extends ServiceImpl<SeizeTreasureUserPropRecordMapper, SeizeTreasureUserPropRecord> {
|
||||
|
||||
@Autowired
|
||||
private SeizeTreasureUserPropRecordMapper seizeTreasureUserPropRecordMapper;
|
||||
|
||||
public List<SeizeTreasureElfRecordVo> getUserElfRecord(Long uid, List<Integer> recordType, PageReq pageReq) {
|
||||
PageHelper.startPage(pageReq.getPage(), pageReq.getPageSize());
|
||||
return seizeTreasureUserPropRecordMapper.getUserElfRecord(uid, recordType);
|
||||
}
|
||||
|
||||
public List<SeizeTreasureElfCompoundRecordVo> getCompoundGainRecord(Long uid, PageReq pageReq) {
|
||||
PageHelper.startPage(pageReq.getPage(), pageReq.getPageSize());
|
||||
return seizeTreasureUserPropRecordMapper.getCompoundGainRecord(uid);
|
||||
}
|
||||
|
||||
public List<SeizeTreasureElfCompoundRecordVo.ElfCompoundExpendVo> getCompoundExpendList(List<Long> recordIdList) {
|
||||
return seizeTreasureUserPropRecordMapper.getCompoundExpendList(recordIdList);
|
||||
}
|
||||
|
||||
public void addRecord(Long uid, Integer type, Long bizId, Integer bizLevel, List<Long> propIdList, Integer propNum) {
|
||||
List<SeizeTreasureUserPropRecord> recordList = new ArrayList<>();
|
||||
for (Long propId : propIdList) {
|
||||
recordList.add(new SeizeTreasureUserPropRecord(uid, type, propId, propNum, null, bizId, bizLevel));
|
||||
}
|
||||
this.saveBatch(recordList);
|
||||
}
|
||||
}
|
@@ -0,0 +1,108 @@
|
||||
package com.accompany.business.service.treasure;
|
||||
|
||||
import com.accompany.business.model.treasure.SeizeTreasureUserProp;
|
||||
import com.accompany.business.mybatismapper.treasure.SeizeTreasureUserPropMapper;
|
||||
import com.accompany.business.vo.treasure.elf.SeizeTreasureUserElfVo;
|
||||
import com.accompany.common.constant.SeizeTreasureConstant;
|
||||
import com.accompany.core.service.common.JedisLockService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
public class SeizeTreasureUserPropService extends ServiceImpl<SeizeTreasureUserPropMapper, SeizeTreasureUserProp> {
|
||||
@Autowired
|
||||
private SeizeTreasureUserPropMapper seizeTreasureUserPropMapper;
|
||||
@Autowired
|
||||
private JedisLockService jedisLockService;
|
||||
|
||||
public void addUserProp(Long uid, Long propId, Integer addNum) {
|
||||
log.info("SeizeTreasureUserPropService updateUserProp uid:{} propId:{} addNum:{}", uid, propId, addNum);
|
||||
|
||||
SeizeTreasureUserProp userProp = lambdaQuery().eq(SeizeTreasureUserProp::getUid, uid).eq(SeizeTreasureUserProp::getPropId, propId).one();
|
||||
if (userProp == null) {
|
||||
// 初始化加锁
|
||||
String propInitLockKey = SeizeTreasureConstant.RedisKey.getActRedisKey(SeizeTreasureConstant.RedisKey.USER_PROP_INIT_LOCK_KEY, uid.toString());
|
||||
String propInitLockValue = jedisLockService.lock(propInitLockKey, 10 * 1000);
|
||||
if (StringUtils.isEmpty(propInitLockValue)) {
|
||||
log.error("SeizeTreasureUserPropService updateUserProp init user prop get redis lock failed");
|
||||
return;
|
||||
}
|
||||
try {
|
||||
// 加锁后再次判断
|
||||
userProp = lambdaQuery().eq(SeizeTreasureUserProp::getUid, uid).eq(SeizeTreasureUserProp::getPropId, uid).one();
|
||||
if (userProp == null) {
|
||||
this.save(new SeizeTreasureUserProp().setUid(uid).setPropId(propId).setPropNum(addNum));
|
||||
return;
|
||||
}
|
||||
} finally {
|
||||
jedisLockService.unlock(propInitLockKey, propInitLockValue);
|
||||
}
|
||||
}
|
||||
seizeTreasureUserPropMapper.addUserProp(uid, propId, addNum);
|
||||
}
|
||||
|
||||
/**
|
||||
* 扣除用户指定道具数量
|
||||
*
|
||||
* @param uid
|
||||
* @param propId
|
||||
* @param reduceNum
|
||||
*/
|
||||
public Boolean reduceUserProp(Long uid, Long propId, Integer reduceNum) {
|
||||
return this.reduceUserProp(uid, propId, reduceNum, reduceNum);
|
||||
}
|
||||
|
||||
/**
|
||||
* 同时扣除用户多个指定道具数量
|
||||
*
|
||||
* @param uid
|
||||
* @param propIdSet
|
||||
* @param reduceNum
|
||||
*/
|
||||
public Boolean batchReduceUserProp(Long uid, Set<Long> propIdSet, Integer reduceNum) {
|
||||
return this.batchReduceUserProp(uid, propIdSet, reduceNum, reduceNum);
|
||||
}
|
||||
|
||||
/**
|
||||
* 扣除用户指定道具数量
|
||||
*
|
||||
* @param uid
|
||||
* @param propId
|
||||
* @param reduceNum
|
||||
* @param minNum 最小要求数量
|
||||
*/
|
||||
public Boolean reduceUserProp(Long uid, Long propId, Integer reduceNum, Integer minNum) {
|
||||
Integer affectedNum = seizeTreasureUserPropMapper.reduceUserProp(uid, propId, reduceNum, minNum);
|
||||
// 受影响行数为0时,代表指定用户指定道具数量不足扣减值
|
||||
return affectedNum == 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* 扣除用户指定道具数量
|
||||
*
|
||||
* @param uid
|
||||
* @param propIdSet
|
||||
* @param reduceNum
|
||||
* @param minNum 最小要求数量
|
||||
*/
|
||||
public Boolean batchReduceUserProp(Long uid, Set<Long> propIdSet, Integer reduceNum, Integer minNum) {
|
||||
if (CollectionUtils.isEmpty(propIdSet)) {
|
||||
return true;
|
||||
}
|
||||
Integer affectedNum = seizeTreasureUserPropMapper.batchReduceUserProp(uid, propIdSet, reduceNum, minNum);
|
||||
// 受影响行数为0时,代表指定用户指定道具数量不足扣减值
|
||||
return affectedNum == propIdSet.size();
|
||||
}
|
||||
|
||||
public List<SeizeTreasureUserElfVo> getUserElvesVo(Long uid) {
|
||||
return seizeTreasureUserPropMapper.getUserElvesVo(uid);
|
||||
}
|
||||
}
|
@@ -4,8 +4,6 @@ import com.accompany.business.enums.UserActPropertyObjType;
|
||||
import com.accompany.business.model.user.UserActPropertyInfoV2;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface UserActPropertyInfoV2Service extends IService<UserActPropertyInfoV2> {
|
||||
|
||||
/**
|
||||
@@ -40,4 +38,14 @@ public interface UserActPropertyInfoV2Service extends IService<UserActPropertyIn
|
||||
* 获取对应活动的资产信息
|
||||
*/
|
||||
UserActPropertyInfoV2 getUserActPropertyInfo(Long uid, Integer propertyType);
|
||||
|
||||
/**
|
||||
* 减少用户道具数量
|
||||
* @param uid
|
||||
* @param propertyType
|
||||
* @param pieceNum
|
||||
* @return 是否成功
|
||||
*/
|
||||
void reduceUserPieceNum(Long uid, Integer propertyType, Integer pieceNum);
|
||||
|
||||
}
|
||||
|
@@ -1,7 +1,6 @@
|
||||
package com.accompany.business.service.user;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.accompany.business.dto.room.RoomFreeGiftConfigDto;
|
||||
import com.accompany.business.model.Gift;
|
||||
import com.accompany.business.model.UserBackpack;
|
||||
@@ -19,7 +18,6 @@ import com.accompany.common.constant.Constant;
|
||||
import com.accompany.common.redis.RedisKey;
|
||||
import com.accompany.common.status.BusiStatus;
|
||||
import com.accompany.common.utils.BlankUtil;
|
||||
import com.accompany.common.utils.DateTimeUtil;
|
||||
import com.accompany.core.base.BeanMapper;
|
||||
import com.accompany.core.exception.ServiceException;
|
||||
import com.accompany.core.service.base.BaseService;
|
||||
@@ -542,4 +540,15 @@ public class UserBackpackService extends BaseService {
|
||||
this.jedisService.del(key);
|
||||
}
|
||||
}
|
||||
|
||||
public void sendGiftToUser(Long userId, Integer giftId, Integer giftNum,Byte giftType) {
|
||||
Gift gift = giftService.newGetGiftById(giftId);
|
||||
UserBackpackParam backpackParam = new UserBackpackParam();
|
||||
backpackParam.setGiftSeq(gift.getSeqNo());
|
||||
backpackParam.setGiftId(gift.getGiftId());
|
||||
backpackParam.setCount(giftNum);
|
||||
backpackParam.setUid(userId);
|
||||
backpackParam.setGiftType(giftType);
|
||||
this.saveOrUpdateUserBackpack(backpackParam);
|
||||
}
|
||||
}
|
||||
|
@@ -9,6 +9,7 @@ import com.accompany.common.redis.RedisKey;
|
||||
import com.accompany.common.status.BusiStatus;
|
||||
import com.accompany.core.exception.ServiceException;
|
||||
import com.accompany.core.service.common.JedisLockService;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -16,7 +17,6 @@ import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@@ -115,4 +115,14 @@ public class UserActPropertyInfoV2ServiceImpl extends ServiceImpl<UserActPropert
|
||||
UserActPropertyInfoV2 userActPropertyInfo = getOne(wrapper);
|
||||
return userActPropertyInfo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reduceUserPieceNum(Long uid, Integer propertyType, Integer reduceNum) {
|
||||
Integer integer = userActPropertyInfoV2Mapper.reduceUserPieceNum(uid, propertyType, reduceNum);
|
||||
if (integer != 1){
|
||||
throw new ServiceException(BusiStatus.PIECE_NOT_ENOUGH);
|
||||
}
|
||||
// 记录用户消耗
|
||||
userActPropertyInfoRecordService.record(uid, reduceNum, propertyType, UserActPropertyObjType.DRAW);
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1,24 @@
|
||||
package com.accompany.business.vo.follow;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@NoArgsConstructor
|
||||
public class FriendVo {
|
||||
@ApiModelProperty("uid")
|
||||
private Long uid;
|
||||
@ApiModelProperty("erbanNo")
|
||||
private Long erbanNo;
|
||||
@ApiModelProperty("昵称")
|
||||
private String nick;
|
||||
@ApiModelProperty("头像")
|
||||
private String avatar;
|
||||
@ApiModelProperty("性别 1:男 2:女")
|
||||
private Byte gender;
|
||||
@ApiModelProperty("简介")
|
||||
private String userDesc;
|
||||
}
|
@@ -0,0 +1,74 @@
|
||||
package com.accompany.business.vo.treasure;
|
||||
|
||||
import com.accompany.common.status.BusiStatus;
|
||||
import com.accompany.core.exception.ServiceException;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SeizeTreasureConfig {
|
||||
@ApiModelProperty("开始时间")
|
||||
private Date startTime;
|
||||
@ApiModelProperty("结束时间")
|
||||
private Date endTime;
|
||||
@ApiModelProperty("白名单uid列表")
|
||||
private List<Long> whiteUidList = new ArrayList<>();
|
||||
@ApiModelProperty("推送消息奖励列表")
|
||||
private List<Long> msgRewardIdList = new ArrayList<>();
|
||||
@ApiModelProperty("辛运值奖池基数,需大于200")
|
||||
private Integer treasureDrawBaseNum = 500;
|
||||
@ApiModelProperty("夺宝奖池最小维持个数")
|
||||
private Integer minTreasurePoolSize = 30000;
|
||||
@ApiModelProperty("森林奖池最小维持个数")
|
||||
private Integer minForestPoolSize = 300;
|
||||
@ApiModelProperty("森林奖池最小维持个数")
|
||||
private Integer minElfCompoundPoolSize = 300;
|
||||
@ApiModelProperty("财富等级限制")
|
||||
private Integer userLevelLimit = 3;
|
||||
@ApiModelProperty("小时统计消息")
|
||||
private Boolean hourCountMsg = true;
|
||||
@ApiModelProperty("小时频率")
|
||||
private Integer hourLimit = 1;
|
||||
@ApiModelProperty("定时初始化奖池")
|
||||
private Boolean autoInitPool = true;
|
||||
/**
|
||||
* 活动是否开启
|
||||
*
|
||||
* @param uid
|
||||
* @return
|
||||
*/
|
||||
public Boolean isOpen(Long uid) {
|
||||
Date now = new Date();
|
||||
if (now.before(startTime) || now.after(endTime)) {
|
||||
return whiteUidList.contains(uid);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public void checkOpen(Long uid) {
|
||||
Boolean isOpen = this.isOpen(uid);
|
||||
if (!isOpen) {
|
||||
throw new ServiceException(BusiStatus.SEIZE_TREASURE_NOT_OPEN);
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
SeizeTreasureConfig config = new SeizeTreasureConfig();
|
||||
config.setStartTime(new Date(1675180800000L));
|
||||
config.setEndTime(new Date(1676699200000L));
|
||||
config.setWhiteUidList(Lists.newArrayList(1006041L));
|
||||
System.out.println(new GsonBuilder()
|
||||
.setDateFormat("yyyy-MM-dd HH:mm:ss")
|
||||
.create().toJson(config));
|
||||
}
|
||||
}
|
@@ -0,0 +1,34 @@
|
||||
package com.accompany.business.vo.treasure;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SeizeTreasurePoolItemVo {
|
||||
@ApiModelProperty("奖励下标")
|
||||
private Integer itemIndex;
|
||||
@ApiModelProperty("奖池序号")
|
||||
private Integer itemOrder;
|
||||
@ApiModelProperty("奖励id")
|
||||
private Long rewardId;
|
||||
@ApiModelProperty("奖励类型 activityProps:活动道具;gift:礼物;namePlate:铭牌;car:座驾;headwear:头饰;chatBubble:气泡;infoCard:资料卡;")
|
||||
private String rewardType;
|
||||
@ApiModelProperty("奖励名称")
|
||||
private String rewardName;
|
||||
@ApiModelProperty("奖励图片")
|
||||
private String rewardPicUrl;
|
||||
@ApiModelProperty("奖励数量")
|
||||
private Integer rewardNum;
|
||||
@ApiModelProperty("奖励单位")
|
||||
private String rewardUnit;
|
||||
@ApiModelProperty("展示价值")
|
||||
private Integer rewardShowValue;
|
||||
@ApiModelProperty("展示概率")
|
||||
private Integer showRatio;
|
||||
@ApiModelProperty("奖励序号")
|
||||
private Integer rewardOrder;
|
||||
}
|
@@ -0,0 +1,16 @@
|
||||
package com.accompany.business.vo.treasure;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SeizeTreasureStatus {
|
||||
@ApiModelProperty("活动是否开启")
|
||||
private Boolean open = false;
|
||||
@ApiModelProperty("最低限制等级")
|
||||
private Integer levelLimit = 3;
|
||||
}
|
@@ -0,0 +1,34 @@
|
||||
package com.accompany.business.vo.treasure.compound;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SeizeTreasureElfCompoundRecordVo {
|
||||
private Long recordId;
|
||||
private Integer compoundLevel;
|
||||
private String elfLevel;
|
||||
private String elfName;
|
||||
private List<ElfCompoundExpendVo> expendList;
|
||||
private Date createTime;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class ElfCompoundExpendVo {
|
||||
private Long bizId;
|
||||
private Long elfId;
|
||||
private Integer elfLevel;
|
||||
private String elfName;
|
||||
private Integer elfNum;
|
||||
}
|
||||
}
|
@@ -0,0 +1,33 @@
|
||||
package com.accompany.business.vo.treasure.compound;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SeizeTreasureElfCompoundReq {
|
||||
@ApiModelProperty("试炼类型 1:史诗;2:传说;")
|
||||
private Integer level;
|
||||
|
||||
@ApiModelProperty("试炼消耗")
|
||||
private List<ElfCompoundExpend> expendList = new ArrayList<>();
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class ElfCompoundExpend {
|
||||
@ApiModelProperty("消耗精灵id")
|
||||
private Long elfId;
|
||||
@ApiModelProperty("消耗精灵数量")
|
||||
private Integer elfNum;
|
||||
}
|
||||
}
|
@@ -0,0 +1,25 @@
|
||||
package com.accompany.business.vo.treasure.convert;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SeizeTreasureConvertRecordVo {
|
||||
private Long recordId;
|
||||
private Integer convertType;
|
||||
private Integer convertLevel;
|
||||
private String rewardType;
|
||||
private String rewardName;
|
||||
private String rewardNum;
|
||||
private String rewardUnit;
|
||||
private String rewardPicUrl;
|
||||
private String rewardShowValue;
|
||||
private Date createTime;
|
||||
}
|
@@ -0,0 +1,36 @@
|
||||
package com.accompany.business.vo.treasure.convert;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SeizeTreasureCovertItemVo {
|
||||
@ApiModelProperty("兑换项id")
|
||||
private Long itemId;
|
||||
@ApiModelProperty("兑换类型")
|
||||
private Integer type;
|
||||
@ApiModelProperty("兑换等级")
|
||||
private Integer level;
|
||||
@ApiModelProperty("消耗数量")
|
||||
private Integer expendNum;
|
||||
@ApiModelProperty("奖励id")
|
||||
private Long rewardId;
|
||||
@ApiModelProperty("奖励类型 activityProps:活动道具;gift:礼物;namePlate:铭牌;car:座驾;headwear:头饰;chatBubble:气泡;infoCard:资料卡;")
|
||||
private String rewardType;
|
||||
@ApiModelProperty("奖励名称")
|
||||
private String rewardName;
|
||||
@ApiModelProperty("奖励图片url")
|
||||
private String rewardPicUrl;
|
||||
@ApiModelProperty("奖励数量")
|
||||
private Integer rewardNum;
|
||||
@ApiModelProperty("奖励单位")
|
||||
private String rewardUnit;
|
||||
@ApiModelProperty("奖励价值")
|
||||
private String rewardShowValue;
|
||||
}
|
@@ -0,0 +1,28 @@
|
||||
package com.accompany.business.vo.treasure.elf;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SeizeTreasureElfMsgVo {
|
||||
@ApiModelProperty("uid")
|
||||
private Long uid;
|
||||
@ApiModelProperty("用户昵称")
|
||||
private String nick;
|
||||
@ApiModelProperty("目标uid")
|
||||
private Long targetUid;
|
||||
@ApiModelProperty("目标用户昵称")
|
||||
private String targetNick;
|
||||
@ApiModelProperty("精灵id")
|
||||
private Long elfId;
|
||||
@ApiModelProperty("精灵名称")
|
||||
private String elfName;
|
||||
@ApiModelProperty("精灵图片链接")
|
||||
private String elfPicUrl;
|
||||
@ApiModelProperty("消息内容")
|
||||
private String msgContent;
|
||||
}
|
@@ -0,0 +1,29 @@
|
||||
package com.accompany.business.vo.treasure.elf;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public class SeizeTreasureElfRecordVo {
|
||||
@ApiModelProperty("记录id")
|
||||
private Long recordId;
|
||||
@ApiModelProperty("记录类型 2:赠予 3:获赠")
|
||||
private Integer type;
|
||||
@ApiModelProperty("精灵id")
|
||||
private Long elfId;
|
||||
@ApiModelProperty("精灵名称")
|
||||
private String elfName;
|
||||
@ApiModelProperty("精灵图片链接")
|
||||
private String elfPicUrl;
|
||||
@ApiModelProperty("目标用户uid")
|
||||
private Long targetUid;
|
||||
@ApiModelProperty("目标用户昵称")
|
||||
private String targetNick;
|
||||
@ApiModelProperty("目标用户头像图片链接")
|
||||
private String targetAvatar;
|
||||
private Date createTime;
|
||||
}
|
@@ -0,0 +1,22 @@
|
||||
package com.accompany.business.vo.treasure.elf;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SeizeTreasureElfVo {
|
||||
@ApiModelProperty("精灵id")
|
||||
private Long elfId;
|
||||
@ApiModelProperty("精灵等级")
|
||||
private Integer elfLevel;
|
||||
@ApiModelProperty("精灵名称")
|
||||
private String elfName;
|
||||
@ApiModelProperty("精灵图片")
|
||||
private String elfPicUrl;
|
||||
}
|
@@ -0,0 +1,14 @@
|
||||
package com.accompany.business.vo.treasure.elf;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@NoArgsConstructor
|
||||
public class SeizeTreasureUserElfVo extends SeizeTreasureElfVo {
|
||||
@ApiModelProperty("精灵数量")
|
||||
private Integer elfNum = 0;
|
||||
}
|
@@ -0,0 +1,46 @@
|
||||
package com.accompany.business.vo.treasure.msg;
|
||||
|
||||
import com.accompany.business.vo.treasure.reward.seizeTreasureRewardBaseVo;
|
||||
import com.accompany.core.model.Users;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public class SeizeTreasureMsg {
|
||||
@ApiModelProperty("uid")
|
||||
private Long uid;
|
||||
@ApiModelProperty("昵称")
|
||||
private String nick;
|
||||
@ApiModelProperty("所在房间uid")
|
||||
private Long roomUid;
|
||||
@ApiModelProperty("奖励类型")
|
||||
private String rewardType;
|
||||
@ApiModelProperty("奖励名称")
|
||||
private String rewardName;
|
||||
@ApiModelProperty("奖励等级")
|
||||
private Integer rewardLevel;
|
||||
@ApiModelProperty("奖励数量")
|
||||
private Integer rewardNum;
|
||||
@ApiModelProperty("奖励单位")
|
||||
private String rewardUnit;
|
||||
@ApiModelProperty("展示价值")
|
||||
private Integer rewardShowValue;
|
||||
@ApiModelProperty("限制等级")
|
||||
private Integer userLevelLimit;
|
||||
|
||||
|
||||
public SeizeTreasureMsg(Users users, Long roomUid, seizeTreasureRewardBaseVo rewardVo, Integer userLevelLimit) {
|
||||
this.uid = users.getUid();
|
||||
this.nick = users.getNick();
|
||||
this.roomUid = roomUid;
|
||||
this.rewardType = rewardVo.getRewardType();
|
||||
this.rewardName = rewardVo.getRewardName();
|
||||
this.rewardLevel = rewardVo.getRewardLevel();
|
||||
this.rewardNum = rewardVo.getRewardNum();
|
||||
this.rewardUnit = rewardVo.getRewardUnit();
|
||||
this.rewardShowValue = rewardVo.getRewardShowValue();
|
||||
this.userLevelLimit = userLevelLimit;
|
||||
}
|
||||
}
|
@@ -0,0 +1,36 @@
|
||||
package com.accompany.business.vo.treasure.rank;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public class SeizeTreasureRankVo {
|
||||
private SeizeTreasureRankEntityVo currentRank;
|
||||
|
||||
private List<SeizeTreasureRankEntityVo> rankList = new ArrayList<>();
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class SeizeTreasureRankEntityVo {
|
||||
@ApiModelProperty("排名")
|
||||
private Integer order;
|
||||
@ApiModelProperty("erbanNo")
|
||||
private Long erbanNo;
|
||||
@ApiModelProperty("uid")
|
||||
private Long uid;
|
||||
@ApiModelProperty("用户昵称")
|
||||
private String nick;
|
||||
@ApiModelProperty("用户头像")
|
||||
private String avatar;
|
||||
@ApiModelProperty("用户分值")
|
||||
private Double score;
|
||||
|
||||
}
|
||||
}
|
@@ -0,0 +1,36 @@
|
||||
package com.accompany.business.vo.treasure.record;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SeizeTreasurePoolDrawRecordVo {
|
||||
@ApiModelProperty("奖池等级 1:初级 2:中级 3:高级")
|
||||
private Integer poolLevel;
|
||||
@ApiModelProperty("奖励id")
|
||||
private Long rewardId;
|
||||
@ApiModelProperty("奖励类型 activityProps:活动道具;gift:礼物;namePlate:铭牌;car:座驾;headwear:头饰;chatBubble:气泡;infoCard:资料卡;")
|
||||
private String rewardType;
|
||||
@ApiModelProperty("奖励名称")
|
||||
private String rewardName;
|
||||
@ApiModelProperty("奖励图片")
|
||||
private String rewardPicUrl;
|
||||
@ApiModelProperty("奖励数量")
|
||||
private Integer rewardNum;
|
||||
@ApiModelProperty("奖励单位")
|
||||
private String rewardUnit;
|
||||
@ApiModelProperty("展示价值")
|
||||
private Integer rewardShowValue;
|
||||
@ApiModelProperty("展示概率")
|
||||
private Integer showRatio;
|
||||
@ApiModelProperty("奖励序号")
|
||||
private Integer rewardOrder;
|
||||
@ApiModelProperty("奖励序号")
|
||||
private Date drawTime;
|
||||
}
|
@@ -0,0 +1,20 @@
|
||||
package com.accompany.business.vo.treasure.record;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SeizeTreasureStaticVo {
|
||||
@ApiModelProperty("参与用户数量")
|
||||
private Integer drawPeopleNum;
|
||||
@ApiModelProperty("抽奖次数")
|
||||
private Integer drawCountNum;
|
||||
@ApiModelProperty("投入总价值")
|
||||
private Long drawInputValue;
|
||||
@ApiModelProperty("产出总价值")
|
||||
private Long drawOutputValue;
|
||||
}
|
@@ -0,0 +1,35 @@
|
||||
package com.accompany.business.vo.treasure.reward;
|
||||
|
||||
import com.accompany.business.model.treasure.SeizeTreasurePoolItem;
|
||||
import com.accompany.business.model.treasure.SeizeTreasureReward;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@NoArgsConstructor
|
||||
public class SeizeTreasurePoolRewardCache {
|
||||
@ApiModelProperty("奖池id")
|
||||
private Long poolId;
|
||||
@ApiModelProperty("奖励下班")
|
||||
private Integer itemIndex;
|
||||
@ApiModelProperty("奖池类型")
|
||||
private Integer poolType;
|
||||
@ApiModelProperty("奖池组")
|
||||
private Integer poolGroup;
|
||||
@ApiModelProperty("奖池等级")
|
||||
private Integer poolLevel;
|
||||
@ApiModelProperty("奖励")
|
||||
private SeizeTreasureReward reward;
|
||||
|
||||
public SeizeTreasurePoolRewardCache(Long poolId, SeizeTreasurePoolItem poolItem, SeizeTreasureReward reward) {
|
||||
this.poolId = poolId;
|
||||
this.itemIndex = poolItem.getItemIndex();
|
||||
this.poolType = poolItem.getPoolType();
|
||||
this.poolGroup = poolItem.getPoolGroup();
|
||||
this.poolLevel = poolItem.getPoolLevel();
|
||||
this.reward = reward;
|
||||
}
|
||||
}
|
@@ -0,0 +1,24 @@
|
||||
package com.accompany.business.vo.treasure.reward;
|
||||
|
||||
import com.accompany.business.model.treasure.SeizeTreasureReward;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@NoArgsConstructor
|
||||
public class SeizeTreasurePoolRewardVo extends seizeTreasureRewardBaseVo {
|
||||
@ApiModelProperty("奖励下标")
|
||||
private Integer itemIndex;
|
||||
|
||||
public SeizeTreasurePoolRewardVo(Integer itemIndex, SeizeTreasureReward reward) {
|
||||
super(reward);
|
||||
// 如果数量 > 1,将展示价格修改为奖励单价
|
||||
if (getRewardNum() > 1) {
|
||||
setRewardShowValue(getRewardShowValue() / getRewardNum());
|
||||
}
|
||||
this.itemIndex = itemIndex;
|
||||
}
|
||||
}
|
@@ -0,0 +1,53 @@
|
||||
package com.accompany.business.vo.treasure.reward;
|
||||
|
||||
import com.accompany.business.model.treasure.SeizeTreasureReward;
|
||||
import com.accompany.common.constant.SeizeTreasureConstant;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@NoArgsConstructor
|
||||
public class seizeTreasureRewardBaseVo {
|
||||
@ApiModelProperty("奖励id")
|
||||
private Long rewardId;
|
||||
@ApiModelProperty("奖励关联id")
|
||||
private Long rewardRefId;
|
||||
@ApiModelProperty("奖励类型 activityProps:活动道具;gift:礼物;namePlate:铭牌;car:座驾;headwear:头饰;chatBubble:气泡;infoCard:资料卡;")
|
||||
private String rewardType;
|
||||
@ApiModelProperty("活动道具类型 1:碎片")
|
||||
private Integer propType;
|
||||
@ApiModelProperty("奖励名称")
|
||||
private String rewardName;
|
||||
@ApiModelProperty("奖励等级")
|
||||
private Integer rewardLevel = 0;
|
||||
@ApiModelProperty("奖励展示价值")
|
||||
private Integer rewardShowValue = 0;
|
||||
@ApiModelProperty("奖励数量")
|
||||
private Integer rewardNum = 1;
|
||||
@ApiModelProperty("奖励单位")
|
||||
private String rewardUnit = "个";
|
||||
@ApiModelProperty("奖励图片uil")
|
||||
private String rewardPicUrl;
|
||||
@ApiModelProperty("奖励序号")
|
||||
private Integer rewardOrder;
|
||||
|
||||
public seizeTreasureRewardBaseVo(SeizeTreasureReward reward) {
|
||||
this.rewardId = reward.getId();
|
||||
this.rewardRefId = reward.getRewardRefId();
|
||||
// 判断是否碎片
|
||||
if (SeizeTreasureConstant.ActPropsId.CHIP.equals(rewardRefId)) {
|
||||
this.propType = 1;
|
||||
}
|
||||
this.rewardType = reward.getRewardType();
|
||||
this.rewardName = reward.getRewardName();
|
||||
this.rewardLevel = reward.getRewardLevel();
|
||||
this.rewardShowValue = reward.getRewardShowValue();
|
||||
this.rewardNum = reward.getRewardNum();
|
||||
this.rewardUnit = reward.getRewardUnit();
|
||||
this.rewardPicUrl = reward.getRewardPicUrl();
|
||||
this.rewardOrder = reward.getRewardOrder();
|
||||
}
|
||||
}
|
@@ -0,0 +1,28 @@
|
||||
package com.accompany.business.vo.treasure.userinfo;
|
||||
|
||||
import com.accompany.core.model.Users;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SeizeTreasureUserBaseInfo {
|
||||
@ApiModelProperty("erbanNo")
|
||||
private Long erbanNo;
|
||||
@ApiModelProperty("uid")
|
||||
private Long uid;
|
||||
@ApiModelProperty("头像")
|
||||
private String avatar;
|
||||
@ApiModelProperty("昵称")
|
||||
private String nick;
|
||||
|
||||
public void completeBaseInfo(Users user) {
|
||||
this.erbanNo = user.getErbanNo();
|
||||
this.uid = user.getUid();
|
||||
this.avatar = user.getAvatar();
|
||||
this.nick = user.getNick();
|
||||
}
|
||||
}
|
@@ -0,0 +1,20 @@
|
||||
package com.accompany.business.vo.treasure.userinfo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SeizeTreasureUserDrawInfo extends SeizeTreasureUserBaseInfo {
|
||||
@ApiModelProperty("夺宝券")
|
||||
private Long drawTicketNum = 0L;
|
||||
@ApiModelProperty("当前幸运值")
|
||||
private Integer luckyNum = 0;
|
||||
@ApiModelProperty("获得精灵球距离")
|
||||
private Integer nextBallNum = 0;
|
||||
@ApiModelProperty("需要幸运值")
|
||||
private Integer needLuckyNum = 0;
|
||||
}
|
@@ -0,0 +1,25 @@
|
||||
package com.accompany.business.vo.treasure.userinfo;
|
||||
|
||||
import com.accompany.business.vo.treasure.elf.SeizeTreasureUserElfVo;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SeizeTreasureUserElfInfo extends SeizeTreasureUserBaseInfo {
|
||||
@ApiModelProperty("精灵碎片")
|
||||
private Integer chipNum = 0;
|
||||
@ApiModelProperty("初级精灵")
|
||||
private List<SeizeTreasureUserElfVo> lowElves = new ArrayList<>();
|
||||
@ApiModelProperty("中级精")
|
||||
private List<SeizeTreasureUserElfVo> middleElves = new ArrayList<>();
|
||||
@ApiModelProperty("高级精灵")
|
||||
private List<SeizeTreasureUserElfVo> highElves = new ArrayList<>();
|
||||
|
||||
}
|
@@ -0,0 +1,19 @@
|
||||
package com.accompany.business.vo.treasure.userinfo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SeizeTreasureUserForestInfo extends SeizeTreasureUserBaseInfo {
|
||||
@ApiModelProperty("初级精灵球数量")
|
||||
private Integer lowBallNum = 0;
|
||||
@ApiModelProperty("中级精灵球数量")
|
||||
private Integer middleBallNum = 0;
|
||||
@ApiModelProperty("高级精灵球数量")
|
||||
private Integer highBallNum = 0;
|
||||
|
||||
}
|
@@ -0,0 +1,16 @@
|
||||
package com.accompany.business.vo.treasure.userinfo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SeizeTreasureUserInfo extends SeizeTreasureUserBaseInfo {
|
||||
@ApiModelProperty("钻石余额")
|
||||
private Double diamonds = 0d;
|
||||
@ApiModelProperty("夺宝券")
|
||||
private Long drawTicketNum = 0L;
|
||||
}
|
@@ -50,4 +50,27 @@
|
||||
</if>
|
||||
) t;
|
||||
</select>
|
||||
<select id="getFriendList"
|
||||
resultType="com.accompany.business.vo.follow.FriendVo">
|
||||
SELECT
|
||||
u.uid,
|
||||
u.erban_no,
|
||||
u.nick,
|
||||
u.avatar,
|
||||
u.gender,
|
||||
u.user_desc
|
||||
FROM
|
||||
users u
|
||||
WHERE
|
||||
u.uid IN (
|
||||
SELECT
|
||||
t1.uid
|
||||
FROM
|
||||
( SELECT f1.liked_uid uid FROM fans f1 WHERE f1.like_uid = #{uid} ) t1
|
||||
INNER JOIN ( SELECT f2.like_uid uid FROM fans f2 WHERE f2.liked_uid = #{uid} ) t2 ON t1.uid = t2.uid
|
||||
)
|
||||
<if test="nick!=null">
|
||||
AND u.nick LIKE concat('%', #{nick}, '%')
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
@@ -0,0 +1,47 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.accompany.business.mybatismapper.treasure.SeizeTreasureConvertItemMapper">
|
||||
<select id="getConvertItem"
|
||||
resultType="com.accompany.business.vo.treasure.convert.SeizeTreasureCovertItemVo">
|
||||
SELECT
|
||||
stci.id AS itemId,
|
||||
stci.type,
|
||||
stci.level,
|
||||
stci.expend_num,
|
||||
stci.reward_id,
|
||||
str.reward_type,
|
||||
str.reward_name,
|
||||
str.reward_pic_url,
|
||||
str.reward_num,
|
||||
str.reward_unit,
|
||||
str.reward_show_value
|
||||
FROM
|
||||
seize_treasure_convert_item stci
|
||||
LEFT JOIN seize_treasure_reward str ON stci.reward_id = str.id
|
||||
WHERE
|
||||
stci.type = #{convertType}
|
||||
AND stci.status = 1
|
||||
ORDER BY
|
||||
stci.level
|
||||
</select>
|
||||
<select id="getItemById" resultType="com.accompany.business.vo.treasure.convert.SeizeTreasureCovertItemVo">
|
||||
SELECT
|
||||
stci.id AS itmeId,
|
||||
stci.type,
|
||||
stci.level,
|
||||
stci.expend_num,
|
||||
stci.reward_id,
|
||||
str.reward_type,
|
||||
str.reward_name,
|
||||
str.reward_pic_url,
|
||||
str.reward_num,
|
||||
str.reward_unit,
|
||||
str.reward_show_value
|
||||
FROM
|
||||
seize_treasure_convert_item stci
|
||||
LEFT JOIN seize_treasure_reward str ON stci.reward_id = str.id
|
||||
WHERE
|
||||
stci.id = #{itemId}
|
||||
AND stci.status = 1
|
||||
</select>
|
||||
</mapper>
|
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.accompany.business.mybatismapper.treasure.SeizeTreasureConvertRecordMapper">
|
||||
<select id="getConvertRecord"
|
||||
resultType="com.accompany.business.vo.treasure.convert.SeizeTreasureConvertRecordVo">
|
||||
SELECT
|
||||
stcr.id AS recordId,
|
||||
stcr.convert_type,
|
||||
stcr.convert_level,
|
||||
stcr.reward_type,
|
||||
stcr.reward_name,
|
||||
stcr.reward_num,
|
||||
stcr.reward_unit,
|
||||
stcr.reward_pic_url,
|
||||
stcr.reward_show_value,
|
||||
stcr.create_time
|
||||
FROM
|
||||
seize_treasure_convert_record stcr
|
||||
WHERE
|
||||
stcr.uid = #{uid}
|
||||
AND stcr.convert_type = #{convertType}
|
||||
ORDER BY
|
||||
create_time DESC
|
||||
</select>
|
||||
</mapper>
|
@@ -0,0 +1,39 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.accompany.business.mybatismapper.treasure.SeizeTreasurePoolDrawRecordMapper">
|
||||
|
||||
|
||||
<select id="getDrawRecordList" resultType="com.accompany.business.vo.treasure.record.SeizeTreasurePoolDrawRecordVo">
|
||||
SELECT stpdr.pool_level,stpdr.reward_id,str.reward_type,str.reward_name,str.reward_pic_url,str.reward_num,str.reward_unit,
|
||||
str.reward_show_value,str.reward_order,stpdr.create_time as drawTime
|
||||
FROM seize_treasure_pool_draw_record stpdr
|
||||
LEFT JOIN seize_treasure_reward str ON stpdr.reward_id=str.id
|
||||
WHERE stpdr.uid = #{uid}
|
||||
<if test="poolTypeList != null and poolTypeList.size() > 0">
|
||||
AND stpdr.pool_type IN
|
||||
<foreach collection="poolTypeList" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
ORDER BY stpdr.create_time DESC
|
||||
</select>
|
||||
<select id="staticPoolRecord" resultType="com.accompany.business.vo.treasure.record.SeizeTreasureStaticVo">
|
||||
SELECT
|
||||
count( DISTINCT stpdr.uid ) AS drawPeopleNum,
|
||||
count( stpdr.id ) AS drawCountNum,
|
||||
sum( str.reward_show_value ) AS drawOutputValue,
|
||||
count( stpdr.id )* 10 AS drawInputValue
|
||||
FROM
|
||||
seize_treasure_pool_draw_record stpdr
|
||||
LEFT JOIN seize_treasure_reward str ON stpdr.reward_id = str.id
|
||||
WHERE
|
||||
stpdr.pool_type = #{poolType}
|
||||
<if test="poolGroup != null" >
|
||||
AND stpdr.pool_group = #{poolGroup}
|
||||
</if>
|
||||
<if test="poolLevel != null" >
|
||||
AND stpdr.pool_level = #{poolLevel}
|
||||
</if>
|
||||
AND stpdr.create_time >= #{startDate} AND stpdr.create_time < #{endDate}
|
||||
</select>
|
||||
</mapper>
|
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.accompany.business.mybatismapper.treasure.SeizeTreasurePoolItemMapper">
|
||||
<select id="getPoolItemList" resultType="com.accompany.business.vo.treasure.SeizeTreasurePoolItemVo">
|
||||
SELECT
|
||||
str.id as rewardId,str.reward_type,str.reward_name,str.reward_pic_url,str.reward_num,str.reward_unit,
|
||||
str.reward_show_value,str.reward_order,stpi.show_ratio,stpi.item_index,stpi.item_order
|
||||
FROM
|
||||
seize_treasure_pool_item stpi LEFT JOIN seize_treasure_reward str ON stpi.reward_id = str.id
|
||||
WHERE 1=1
|
||||
<if test="poolType != null ">
|
||||
AND stpi.pool_type = #{poolType}
|
||||
</if>
|
||||
<if test="poolGroup != null" >
|
||||
AND stpi.pool_group = #{poolGroup}
|
||||
</if>
|
||||
<if test="poolLevel != null" >
|
||||
AND stpi.pool_level = #{poolLevel}
|
||||
</if>
|
||||
ORDER BY stpi.item_order
|
||||
</select>
|
||||
|
||||
</mapper>
|
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.accompany.business.mybatismapper.treasure.SeizeTreasureRewardMapper">
|
||||
|
||||
|
||||
</mapper>
|
@@ -0,0 +1,46 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.accompany.business.mybatismapper.treasure.SeizeTreasureUserPropMapper">
|
||||
<update id="addUserProp">
|
||||
UPDATE
|
||||
seize_treasure_user_prop st
|
||||
SET
|
||||
st.prop_num = st.prop_num + #{addNum}
|
||||
WHERE
|
||||
st.uid = #{uid}
|
||||
AND st.prop_id = #{propId}
|
||||
</update>
|
||||
<update id="reduceUserProp">
|
||||
UPDATE
|
||||
seize_treasure_user_prop st
|
||||
SET
|
||||
st.prop_num = st.prop_num - #{reduceNum}
|
||||
WHERE
|
||||
st.uid = #{uid}
|
||||
AND st.prop_id = #{propId}
|
||||
AND st.prop_num >= #{minNum}
|
||||
</update>
|
||||
<update id="batchReduceUserProp">
|
||||
UPDATE
|
||||
seize_treasure_user_prop st
|
||||
SET
|
||||
st.prop_num = st.prop_num - #{reduceNum}
|
||||
WHERE
|
||||
st.uid = #{uid}
|
||||
AND st.prop_id IN
|
||||
<foreach collection="propIdSet" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
AND st.prop_num >= #{minNum}
|
||||
</update>
|
||||
<select id="getUserElvesVo" resultType="com.accompany.business.vo.treasure.elf.SeizeTreasureUserElfVo">
|
||||
SELECT
|
||||
atp.id AS elfId,atp.LEVEL AS elfLevel,atp.NAME AS elfName,atp.pic_url AS elfPicUrl,stup.uid,stup.prop_num AS elfNum
|
||||
FROM
|
||||
seize_treasure_prop atp LEFT JOIN seize_treasure_user_prop stup ON atp.id = stup.prop_id AND stup.uid = #{uid}
|
||||
WHERE
|
||||
atp.type = 3
|
||||
ORDER BY
|
||||
atp.id
|
||||
</select>
|
||||
</mapper>
|
@@ -0,0 +1,62 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.accompany.business.mybatismapper.treasure.SeizeTreasureUserPropRecordMapper">
|
||||
<select id="getUserElfRecord" resultType="com.accompany.business.vo.treasure.elf.SeizeTreasureElfRecordVo">
|
||||
SELECT
|
||||
ster.id AS recordId,
|
||||
ster.type,
|
||||
ster.prop_id AS elfId,
|
||||
atp.name AS elfName,
|
||||
atp.pic_url AS elfPicUrl,
|
||||
ster.target_uid,
|
||||
u.nick AS targetNick,
|
||||
u.avatar AS targetAvatar,
|
||||
ster.create_time
|
||||
FROM
|
||||
seize_treasure_user_prop_record ster
|
||||
LEFT JOIN seize_treasure_prop atp ON ster.prop_id = atp.id
|
||||
LEFT JOIN users u ON ster.target_uid = u.uid
|
||||
WHERE
|
||||
ster.uid = #{uid}
|
||||
<if test="typeList != null and typeList.size() > 0">
|
||||
AND ster.type IN
|
||||
<foreach collection="typeList" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
ORDER BY ster.create_time DESC
|
||||
</select>
|
||||
<select id="getCompoundGainRecord" resultType="com.accompany.business.vo.treasure.compound.SeizeTreasureElfCompoundRecordVo">
|
||||
SELECT
|
||||
ster.id AS recordId,
|
||||
ster.biz_level AS compoundLevel,
|
||||
stp.level AS elfLevel,
|
||||
stp.name AS elfName,
|
||||
ster.create_time
|
||||
FROM
|
||||
seize_treasure_user_prop_record ster
|
||||
LEFT JOIN seize_treasure_prop stp ON ster.prop_id = stp.id
|
||||
WHERE
|
||||
ster.uid = #{uid}
|
||||
AND ster.type = 4
|
||||
ORDER BY
|
||||
ster.create_time DESC
|
||||
</select>
|
||||
<select id="getCompoundExpendList" resultType="com.accompany.business.vo.treasure.compound.SeizeTreasureElfCompoundRecordVo$ElfCompoundExpendVo">
|
||||
SELECT
|
||||
ster.biz_id,
|
||||
stp.id AS elfId,
|
||||
stp.level AS elfLevel,
|
||||
stp.name AS elfName,
|
||||
ster.prop_num AS elfNum
|
||||
FROM
|
||||
seize_treasure_user_prop_record ster
|
||||
LEFT JOIN seize_treasure_prop stp ON ster.prop_id = stp.id
|
||||
WHERE
|
||||
ster.type = 5
|
||||
AND ster.biz_id IN
|
||||
<foreach collection="recordIdList" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</select>
|
||||
</mapper>
|
@@ -0,0 +1,276 @@
|
||||
package com.accompany.business.controller.treasure;
|
||||
|
||||
import com.accompany.business.common.BaseController;
|
||||
import com.accompany.business.constant.activities.ActivitesPackTypeEnum;
|
||||
import com.accompany.business.model.ActivityPack;
|
||||
import com.accompany.business.service.activity.ActivityPackService;
|
||||
import com.accompany.business.service.treasure.SeizeTreasureService;
|
||||
import com.accompany.business.vo.treasure.SeizeTreasureConfig;
|
||||
import com.accompany.business.vo.treasure.SeizeTreasurePoolItemVo;
|
||||
import com.accompany.business.vo.treasure.SeizeTreasureStatus;
|
||||
import com.accompany.business.vo.treasure.compound.SeizeTreasureElfCompoundRecordVo;
|
||||
import com.accompany.business.vo.treasure.compound.SeizeTreasureElfCompoundReq;
|
||||
import com.accompany.business.vo.treasure.convert.SeizeTreasureConvertRecordVo;
|
||||
import com.accompany.business.vo.treasure.convert.SeizeTreasureCovertItemVo;
|
||||
import com.accompany.business.vo.treasure.elf.SeizeTreasureElfRecordVo;
|
||||
import com.accompany.business.vo.treasure.elf.SeizeTreasureElfVo;
|
||||
import com.accompany.business.vo.treasure.rank.SeizeTreasureRankVo;
|
||||
import com.accompany.business.vo.treasure.record.SeizeTreasurePoolDrawRecordVo;
|
||||
import com.accompany.business.vo.treasure.reward.SeizeTreasurePoolRewardVo;
|
||||
import com.accompany.business.vo.treasure.reward.seizeTreasureRewardBaseVo;
|
||||
import com.accompany.business.vo.treasure.userinfo.SeizeTreasureUserDrawInfo;
|
||||
import com.accompany.business.vo.treasure.userinfo.SeizeTreasureUserElfInfo;
|
||||
import com.accompany.business.vo.treasure.userinfo.SeizeTreasureUserForestInfo;
|
||||
import com.accompany.business.vo.treasure.userinfo.SeizeTreasureUserInfo;
|
||||
import com.accompany.common.annotation.Authorization;
|
||||
import com.accompany.common.constant.SeizeTreasureConstant;
|
||||
import com.accompany.common.model.PageReq;
|
||||
import com.accompany.common.result.BusiResult;
|
||||
import com.accompany.common.status.BusiStatus;
|
||||
import com.accompany.core.exception.ServiceException;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.time.LocalDate;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@RestController
|
||||
@Api(tags = "夺宝精灵")
|
||||
@RequestMapping("/act/seize-treasure")
|
||||
public class SeizeTreasureController extends BaseController {
|
||||
@Autowired
|
||||
private SeizeTreasureService seizeTreasureService;
|
||||
@Autowired
|
||||
private ActivityPackService activityPackService;
|
||||
public static final List<Integer> DRAW_NUM_LIST = Arrays.asList(1, 10, 100);
|
||||
public static final List<Integer> FOREST_DRAW_NUM_LIST = Arrays.asList(1, 10);
|
||||
public static final List<Integer> POOL_LEVEL_LIST = Arrays.asList(1, 2, 3);
|
||||
|
||||
@Authorization
|
||||
@ApiOperation("夺宝-礼包列表")
|
||||
@GetMapping("pack/list")
|
||||
public BusiResult<List<ActivityPack>> getPackList() {
|
||||
return new BusiResult<>(activityPackService.getPackListByType(ActivitesPackTypeEnum.SEIZE_TREASURE_TICKET.getValue().byteValue()));
|
||||
}
|
||||
|
||||
@Authorization
|
||||
@ApiOperation("夺宝-奖励列表")
|
||||
@ApiImplicitParam(name = "orderType", value = "排序方式 1:奖池order升序;2:礼物价值降序", allowableValues = "1,2", defaultValue = "1", required = false)
|
||||
@GetMapping("draw/pool/list")
|
||||
public BusiResult<List<SeizeTreasurePoolItemVo>> getTreasurePoolList(Integer orderType) {
|
||||
List<SeizeTreasurePoolItemVo> poolItemList = seizeTreasureService.getPoolItemList(SeizeTreasureConstant.PoolType.TREASURE, null, null);
|
||||
List<SeizeTreasurePoolItemVo> resultList;
|
||||
orderType = orderType == null ? 1 : orderType;
|
||||
if (orderType == 2) {
|
||||
resultList = poolItemList.stream().sorted(Comparator.comparingInt(SeizeTreasurePoolItemVo::getRewardShowValue).reversed()).collect(Collectors.toList());
|
||||
} else {
|
||||
resultList = poolItemList;
|
||||
}
|
||||
return new BusiResult<>(resultList);
|
||||
}
|
||||
|
||||
@Authorization
|
||||
@ApiOperation("夺宝-用户信息")
|
||||
@GetMapping("/user/draw/info")
|
||||
public BusiResult<SeizeTreasureUserDrawInfo> getUserDrawInfo() {
|
||||
return new BusiResult<>(seizeTreasureService.getUserDrawInfo(getUid()));
|
||||
}
|
||||
|
||||
@Authorization
|
||||
@ApiOperation("夺宝-抽奖")
|
||||
@ApiImplicitParam(name = "drawNum", value = "抽奖次数", allowableValues = "1,10,100", required = true)
|
||||
@PostMapping("/draw")
|
||||
public BusiResult<List<SeizeTreasurePoolRewardVo>> draw(Long roomUid, Integer drawNum) throws IOException {
|
||||
if (!DRAW_NUM_LIST.contains(drawNum)) {
|
||||
throw new ServiceException(BusiStatus.PARAMETERILLEGAL);
|
||||
}
|
||||
return new BusiResult<>(seizeTreasureService.treasureDraw(getUid(), roomUid, drawNum));
|
||||
}
|
||||
|
||||
@Authorization
|
||||
@ApiOperation("夺宝-抽奖记录")
|
||||
@GetMapping("/draw/record")
|
||||
public BusiResult<List<SeizeTreasurePoolDrawRecordVo>> getDrawRecordList(PageReq pageReq) {
|
||||
return new BusiResult<>(
|
||||
seizeTreasureService.getDrawRecordList(
|
||||
getUid(),
|
||||
Arrays.asList(SeizeTreasureConstant.PoolType.TREASURE, SeizeTreasureConstant.PoolType.TREASURE_DRAW_NUM),
|
||||
pageReq));
|
||||
}
|
||||
|
||||
@Authorization
|
||||
@ApiOperation("猛犸森林-用户信息")
|
||||
@GetMapping("/user/forest/info")
|
||||
public BusiResult<SeizeTreasureUserForestInfo> getUserForestInfo() {
|
||||
return new BusiResult<>(seizeTreasureService.getUserForestInfo(getUid()));
|
||||
}
|
||||
|
||||
@Authorization
|
||||
@ApiOperation("猛犸森林-抽奖")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "poolLevel", value = "奖池类型 1:初级;2:中级;3:高级;", required = true),
|
||||
@ApiImplicitParam(name = "drawNum", value = "抽奖次数", allowableValues = "1,10", required = true)
|
||||
})
|
||||
@PostMapping("/forest/draw")
|
||||
public BusiResult<List<SeizeTreasurePoolRewardVo>> forestDraw(Integer poolLevel, Integer drawNum) throws IOException {
|
||||
if (!POOL_LEVEL_LIST.contains(poolLevel)) {
|
||||
throw new ServiceException(BusiStatus.PARAMETERILLEGAL);
|
||||
}
|
||||
if (!FOREST_DRAW_NUM_LIST.contains(drawNum)) {
|
||||
throw new ServiceException(BusiStatus.PARAMETERILLEGAL);
|
||||
}
|
||||
return new BusiResult<>(seizeTreasureService.forestDraw(getUid(), poolLevel, drawNum));
|
||||
}
|
||||
|
||||
@Authorization
|
||||
@ApiOperation("猛犸森林-奖池奖励列表")
|
||||
@ApiImplicitParam(name = "poolLevel", value = "奖池类型 1:初级;2:中级;3:高级;", required = true)
|
||||
@GetMapping("draw/forest/item")
|
||||
public BusiResult<List<SeizeTreasurePoolItemVo>> getForestPoolItemList(Integer poolLevel) {
|
||||
poolLevel = poolLevel == null ? 1 : poolLevel;
|
||||
return new BusiResult<>(seizeTreasureService.getPoolItemList(SeizeTreasureConstant.PoolType.FOREST, null, poolLevel));
|
||||
}
|
||||
|
||||
@Authorization
|
||||
@ApiOperation("猛犸森林-抽奖记录")
|
||||
@GetMapping("/forest/draw/record")
|
||||
public BusiResult<List<SeizeTreasurePoolDrawRecordVo>> getForestDrawRecordList(PageReq pageReq) {
|
||||
return new BusiResult<>(seizeTreasureService.getDrawRecordList(getUid(),
|
||||
Collections.singletonList(SeizeTreasureConstant.PoolType.FOREST), pageReq));
|
||||
}
|
||||
|
||||
@Authorization
|
||||
@ApiOperation("精灵-用户信息")
|
||||
@GetMapping("/elf/user/info")
|
||||
public BusiResult<SeizeTreasureUserElfInfo> getUserElvesInfo() {
|
||||
return new BusiResult<>(seizeTreasureService.getUserElvesInfo(getUid()));
|
||||
}
|
||||
|
||||
@Authorization
|
||||
@ApiOperation("精灵-赠予")
|
||||
@PostMapping("/elf/send")
|
||||
public BusiResult<Boolean> sendElf(Long elfId, Long targetUid) {
|
||||
seizeTreasureService.sendElf(getUid(), elfId, targetUid);
|
||||
return new BusiResult<>(Boolean.TRUE);
|
||||
}
|
||||
|
||||
@Authorization
|
||||
@ApiOperation("精灵-索要")
|
||||
@PostMapping("/elf/askFor")
|
||||
public BusiResult<Boolean> askForElf(Long elfId, Long targetUid) {
|
||||
seizeTreasureService.askForElf(elfId, getUid(), targetUid);
|
||||
return new BusiResult<>(Boolean.TRUE);
|
||||
}
|
||||
|
||||
@Authorization
|
||||
@ApiOperation("精灵-赠予/获赠记录")
|
||||
@GetMapping("/elf/record")
|
||||
public BusiResult<List<SeizeTreasureElfRecordVo>> getUserElfRecord(PageReq pageReq) {
|
||||
return new BusiResult<>(seizeTreasureService.getUserElfRecord(getUid(), pageReq));
|
||||
}
|
||||
|
||||
@Authorization
|
||||
@ApiOperation("精灵-试炼")
|
||||
@PostMapping("/elf/compound")
|
||||
public BusiResult<SeizeTreasureElfVo> compoundElf(@RequestBody SeizeTreasureElfCompoundReq compoundReqs) {
|
||||
return new BusiResult<>(seizeTreasureService.compoundElf(getUid(), compoundReqs));
|
||||
}
|
||||
|
||||
@Authorization
|
||||
@ApiOperation("精灵-试炼记录")
|
||||
@GetMapping("/elf/compound/record")
|
||||
public BusiResult<List<SeizeTreasureElfCompoundRecordVo>> getElfCompoundRecord(PageReq pageReq) {
|
||||
return new BusiResult<>(seizeTreasureService.getElfCompoundRecord(getUid(), pageReq));
|
||||
}
|
||||
|
||||
@Authorization
|
||||
@ApiOperation("兑换-精灵召唤列表")
|
||||
@GetMapping("/convert/elf/list")
|
||||
public BusiResult<List<SeizeTreasureCovertItemVo>> getElfConvertList() {
|
||||
return new BusiResult<>(seizeTreasureService.getElfConvertList());
|
||||
}
|
||||
|
||||
@Authorization
|
||||
@ApiOperation("兑换-碎片兑换列表")
|
||||
@GetMapping("/convert/chip/list")
|
||||
public BusiResult<List<SeizeTreasureCovertItemVo>> getChipConvertList() {
|
||||
return new BusiResult<>(seizeTreasureService.getChipConvertList());
|
||||
}
|
||||
|
||||
@Authorization
|
||||
@ApiOperation("兑换-兑换")
|
||||
@PostMapping("/convert")
|
||||
public BusiResult<seizeTreasureRewardBaseVo> getChipConvertList(Long itemId, Long roomUid) {
|
||||
return new BusiResult<>(seizeTreasureService.convert(getUid(), roomUid, itemId));
|
||||
}
|
||||
|
||||
@Authorization
|
||||
@ApiOperation("兑换-兑换记录")
|
||||
@ApiImplicitParam(name = "convertType", value = "1:精灵召唤 2:碎片兑换", required = false)
|
||||
@GetMapping("/convert/record")
|
||||
public BusiResult<List<SeizeTreasureConvertRecordVo>> getConvertRecord(Integer convertType, PageReq pageReq) {
|
||||
return new BusiResult<>(seizeTreasureService.getConvertRecord(getUid(), convertType, pageReq));
|
||||
}
|
||||
|
||||
@Authorization
|
||||
@ApiOperation("用户活动信息")
|
||||
@GetMapping("/user/info")
|
||||
public BusiResult<SeizeTreasureUserInfo> getUserActInfo() {
|
||||
return new BusiResult<>(seizeTreasureService.getUserInfo(getUid()));
|
||||
}
|
||||
|
||||
@Authorization
|
||||
@ApiOperation("夺宝榜单")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "rankDateStr", value = "排行榜日期,默认当日", example = "2022-08-25", required = false),
|
||||
@ApiImplicitParam(name = "rankNum", value = "排行榜条数,默认10", required = false),
|
||||
@ApiImplicitParam(name = "showOrder", value = "排名展示最大值,默认30", required = false)
|
||||
})
|
||||
@GetMapping("rank/value")
|
||||
public BusiResult<SeizeTreasureRankVo> getValueRank(String rankDateStr, Integer rankNum, Integer showOrder) {
|
||||
rankDateStr = StringUtils.hasText(rankDateStr) ? rankDateStr : LocalDate.now().toString();
|
||||
rankNum = (rankNum == null || rankNum == 0) ? 10 : rankNum;
|
||||
showOrder = (showOrder == null || showOrder == 0) ? 30 : showOrder;
|
||||
return new BusiResult(seizeTreasureService.getValueRank(getUid(), rankDateStr, rankNum, showOrder));
|
||||
}
|
||||
|
||||
@Authorization
|
||||
@ApiOperation("初始化奖池")
|
||||
@GetMapping("/t/init/pool")
|
||||
public BusiResult<Boolean> initPool() {
|
||||
boolean contains = seizeTreasureService.getActConfig().getWhiteUidList().contains(getUid());
|
||||
if (contains) {
|
||||
seizeTreasureService.initPool();
|
||||
}
|
||||
return new BusiResult(contains);
|
||||
}
|
||||
|
||||
@Authorization
|
||||
@ApiOperation("发送统计消息")
|
||||
@GetMapping("/t/send/countMsg")
|
||||
public BusiResult<Boolean> sendCountMsg() {
|
||||
boolean contains = seizeTreasureService.getActConfig().getWhiteUidList().contains(getUid());
|
||||
if (contains) {
|
||||
seizeTreasureService.hourCountMsg();
|
||||
}
|
||||
return new BusiResult(contains);
|
||||
}
|
||||
|
||||
@Authorization
|
||||
@ApiOperation("活动状态")
|
||||
@GetMapping("/status")
|
||||
public BusiResult<SeizeTreasureStatus> getStatus() {
|
||||
SeizeTreasureConfig actConfig = seizeTreasureService.getActConfig();
|
||||
return new BusiResult(new SeizeTreasureStatus(actConfig.isOpen(getUid()), actConfig.getUserLevelLimit()));
|
||||
}
|
||||
}
|
@@ -1,25 +1,23 @@
|
||||
package com.accompany.business.controller.user;
|
||||
|
||||
import com.accompany.business.common.BaseController;
|
||||
import com.accompany.business.vo.follow.FansPersonVo;
|
||||
import com.accompany.common.device.DeviceInfo;
|
||||
import com.accompany.core.exception.ServiceException;
|
||||
import com.accompany.business.service.follow.FansService;
|
||||
import com.accompany.core.util.StringUtils;
|
||||
import com.accompany.business.vo.follow.FansFollowVo;
|
||||
import com.google.common.util.concurrent.RateLimiter;
|
||||
import com.accompany.business.vo.follow.FansPersonVo;
|
||||
import com.accompany.business.vo.follow.FriendVo;
|
||||
import com.accompany.common.annotation.Authorization;
|
||||
import com.accompany.common.device.DeviceInfo;
|
||||
import com.accompany.common.result.BusiResult;
|
||||
import com.accompany.common.status.BusiStatus;
|
||||
import com.accompany.core.exception.ServiceException;
|
||||
import com.accompany.core.util.StringUtils;
|
||||
import com.google.common.util.concurrent.RateLimiter;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
@@ -199,4 +197,10 @@ public class FansController extends BaseController {
|
||||
return new BusiResult(BusiStatus.SUCCESS, fansService.partTabFollowList(this.getUid()));
|
||||
}
|
||||
|
||||
@Authorization
|
||||
@ApiOperation("好友列表")
|
||||
@GetMapping("friend/list")
|
||||
public BusiResult<List<FriendVo>> getFriendList(String nick) {
|
||||
return new BusiResult<>(fansService.getFriendList(getUid(), nick));
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1,34 @@
|
||||
package com.accompany.scheduler.task.activity;
|
||||
|
||||
import com.accompany.business.service.treasure.SeizeTreasureService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@Slf4j
|
||||
public class SeizeTreasureTask {
|
||||
@Autowired
|
||||
private SeizeTreasureService seizeTreasureService;
|
||||
|
||||
/**
|
||||
* 夺宝精灵自动生成奖池
|
||||
*/
|
||||
@Scheduled(cron = "0 * * * * ?")
|
||||
public void initSeizeTreasurePoolTask() {
|
||||
log.info("SeizeTreasureTask initSeizeTreasurePoolTask begin");
|
||||
seizeTreasureService.initPool();
|
||||
log.info("SeizeTreasureTask initSeizeTreasurePoolTask end");
|
||||
}
|
||||
|
||||
/**
|
||||
* 夺宝精灵自动生成奖池
|
||||
*/
|
||||
@Scheduled(cron = "0 0 * * * ?")
|
||||
public void hourCountMsg() {
|
||||
log.info("SeizeTreasureTask hourCountMsg begin");
|
||||
seizeTreasureService.hourCountMsg();
|
||||
log.info("SeizeTreasureTask hourCountMsg end");
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user