swagger 推广后台 优化对战百佳历史接口
This commit is contained in:
-4
@@ -14,7 +14,6 @@ import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.utils.uuid.IdUtils;
|
||||
import com.ruoyi.domain.entity.TtBlankCardKey;
|
||||
import com.ruoyi.domain.entity.TtRechargeProd;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@@ -40,7 +39,6 @@ public class AdminBlankCardKeyController extends BaseController {
|
||||
/**
|
||||
* 获取充值产品列表(金额选项)
|
||||
*/
|
||||
@ApiOperation("获取充值产品列表")
|
||||
@GetMapping("/rechargeList")
|
||||
public R<List<TtRechargeProd>> getRechargeList() {
|
||||
List<TtRechargeProd> list = rechargeProdMapper.selectList(
|
||||
@@ -52,7 +50,6 @@ public class AdminBlankCardKeyController extends BaseController {
|
||||
/**
|
||||
* 生成空白卡密(管理后台,不扣余额)
|
||||
*/
|
||||
@ApiOperation("生成空白卡密")
|
||||
@PostMapping("/generate")
|
||||
public R<List<String>> generate(@RequestBody java.util.Map<String, Object> request) {
|
||||
Integer rechargeListId = (Integer) request.get("rechargeListId");
|
||||
@@ -99,7 +96,6 @@ public class AdminBlankCardKeyController extends BaseController {
|
||||
/**
|
||||
* 获取空白卡密列表
|
||||
*/
|
||||
@ApiOperation("获取空白卡密列表")
|
||||
@GetMapping("/list")
|
||||
public R<List<TtBlankCardKey>> list(
|
||||
@RequestParam(required = false) String usedByName,
|
||||
|
||||
-7
@@ -9,8 +9,6 @@ import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.core.page.PageDataInfo;
|
||||
import com.ruoyi.domain.entity.TtLossRebate;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
@@ -22,7 +20,6 @@ import java.util.List;
|
||||
* 数据由定时任务 lossRebateService.generateHalfMonthLossRebate() 每半月写入,
|
||||
* 本页只做「查看 + 对超过单期上限的用户人工发放CDK」。
|
||||
*/
|
||||
@Api(tags = "管理端 亏损返水")
|
||||
@RestController
|
||||
@RequestMapping("/admin/lossRebate")
|
||||
public class LossRebateController extends BaseController {
|
||||
@@ -33,7 +30,6 @@ public class LossRebateController extends BaseController {
|
||||
this.lossRebateService = lossRebateService;
|
||||
}
|
||||
|
||||
@ApiOperation("亏损返水结算明细列表")
|
||||
@GetMapping("/list")
|
||||
public PageDataInfo<TtLossRebate> list(@RequestParam(required = false) String period,
|
||||
@RequestParam(required = false) Integer userId,
|
||||
@@ -45,21 +41,18 @@ public class LossRebateController extends BaseController {
|
||||
|
||||
@Log(title = "亏损返水", action = "发放CDK", businessType = BusinessType.GRANT,
|
||||
entityClass = TtLossRebate.class, mapperClass = TtLossRebateMapper.class, idField = "id")
|
||||
@ApiOperation("人工发放CDK(超过单期上限/自动发放失败的记录)")
|
||||
@PostMapping("/grant")
|
||||
public R<String> grant(@RequestBody GrantRequest request) {
|
||||
if (request == null || request.getId() == null) return R.fail("缺少明细ID");
|
||||
return lossRebateService.grantManually(request.getId(), request.getAmount(), getUsername());
|
||||
}
|
||||
|
||||
@ApiOperation("读取单期返水上限")
|
||||
@GetMapping("/config")
|
||||
public AjaxResult getConfig() {
|
||||
return AjaxResult.success(lossRebateService.getMaxAmount());
|
||||
}
|
||||
|
||||
@Log(title = "亏损返水", action = "保存上限", businessType = BusinessType.UPDATE)
|
||||
@ApiOperation("保存单期返水上限(返水超过该金额不自动发放,转人工;0=不设上限)")
|
||||
@PostMapping("/config")
|
||||
public AjaxResult saveConfig(@RequestParam(required = false) BigDecimal maxAmount) {
|
||||
lossRebateService.saveMaxAmount(maxAmount);
|
||||
|
||||
-6
@@ -12,15 +12,12 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.core.page.PageDataInfo;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Api(tags = "管理端 商城管理")
|
||||
@RestController
|
||||
@RequestMapping("/admin/shopping")
|
||||
public class ShoppingController extends BaseController {
|
||||
@@ -34,7 +31,6 @@ public class ShoppingController extends BaseController {
|
||||
this.ornamentsService = ornamentsService;
|
||||
}
|
||||
|
||||
@ApiOperation("商品列表")
|
||||
@GetMapping("/list")
|
||||
public PageDataInfo<ShoppingDataVO> list(ShoppingBody shoppingBody) {
|
||||
startPage();
|
||||
@@ -65,7 +61,6 @@ public class ShoppingController extends BaseController {
|
||||
}
|
||||
|
||||
@Log(title = "商城列表", action = "一键上架", businessType = BusinessType.UPDATE)
|
||||
@ApiOperation("一键上架所有商品")
|
||||
@PostMapping("/putAwayAll")
|
||||
public R<Boolean> putAwayAll() {
|
||||
LambdaUpdateWrapper<TtOrnament> updateWrapper = new LambdaUpdateWrapper<>();
|
||||
@@ -82,7 +77,6 @@ public class ShoppingController extends BaseController {
|
||||
}
|
||||
|
||||
@Log(title = "商城列表", action = "一键下架", businessType = BusinessType.UPDATE)
|
||||
@ApiOperation("一键下架所有商品")
|
||||
@PostMapping("/soldOutAll")
|
||||
public R<Boolean> soldOutAll() {
|
||||
LambdaUpdateWrapper<TtOrnament> updateWrapper = new LambdaUpdateWrapper<>();
|
||||
|
||||
-12
@@ -20,8 +20,6 @@ import com.ruoyi.domain.other.TtBoxBody;
|
||||
import com.ruoyi.domain.vo.BoxPoolStatisticsVO;
|
||||
import com.ruoyi.domain.vo.TtBoxDataVO;
|
||||
import com.ruoyi.domain.vo.box.TtBoxUserVO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
@@ -38,7 +36,6 @@ import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Api(tags = "管理端 宝箱管理")
|
||||
@RestController
|
||||
@RequestMapping("/admin/box")
|
||||
public class TtBoxController extends BaseController {
|
||||
@@ -57,7 +54,6 @@ public class TtBoxController extends BaseController {
|
||||
return success();
|
||||
}
|
||||
|
||||
@ApiOperation("获取宝箱列表")
|
||||
@GetMapping("/list")
|
||||
public PageDataInfo<TtBoxDataVO> list(TtBoxBody ttBoxBody) {
|
||||
startPage();
|
||||
@@ -80,14 +76,12 @@ public class TtBoxController extends BaseController {
|
||||
}
|
||||
|
||||
@Log(title = "宝箱列表", action = "修改", businessType = BusinessType.UPDATE)
|
||||
@ApiOperation("修改宝箱")
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody TtBoxDataVO ttBoxDataVO) {
|
||||
String msg = boxService.updateTtBoxById(ttBoxDataVO);
|
||||
return StringUtils.isEmpty(msg) ? AjaxResult.success() : AjaxResult.error(msg);
|
||||
}
|
||||
|
||||
@ApiOperation("清空当前奖池")
|
||||
@GetMapping("clearPrizePool/{boxId}")
|
||||
public R clearPrizePool(@PathVariable("boxId") Integer boxId) {
|
||||
|
||||
@@ -110,27 +104,23 @@ public class TtBoxController extends BaseController {
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@ApiOperation("宝箱统计(按奖池/开箱人类型拆分)")
|
||||
@GetMapping("/statisticsBoxData/{boxId}")
|
||||
public R<List<BoxPoolStatisticsVO>> statisticsBoxData(@PathVariable Integer boxId, @RequestParam(required = false) Date date) {
|
||||
List<BoxPoolStatisticsVO> poolStatistics = boxService.statisticsBoxData(boxId, date);
|
||||
return R.ok(poolStatistics);
|
||||
}
|
||||
|
||||
@ApiOperation("添加宝箱三级爆率玩家范围")
|
||||
@PostMapping("/createTtBoxThirdExplosiveUsers")
|
||||
public AjaxResult createTtBoxThirdExplosiveUsers(@RequestBody TtBoxUserVO ttBoxUserVO) {
|
||||
String msg = boxService.createTtBoxThirdExplosiveUsers(ttBoxUserVO);
|
||||
return StringUtils.isEmpty(msg) ? AjaxResult.success() : AjaxResult.error(msg);
|
||||
}
|
||||
|
||||
@ApiOperation("查询宝箱三级爆率玩家范围")
|
||||
@GetMapping("/queryTtBoxThirdExplosiveUsers/{boxId}")
|
||||
public AjaxResult queryBoxUsers(@PathVariable Integer boxId) {
|
||||
return boxService.queryTtBoxThirdExplosiveUsers(boxId);
|
||||
}
|
||||
|
||||
@ApiOperation("删除宝箱三级爆率玩家范围")
|
||||
@PostMapping("/deleteTtBoxThirdExplosiveUsers")
|
||||
public AjaxResult deleteTtBoxThirdExplosiveUsers(@RequestBody TtBoxUserVO ttBoxUserVO) {
|
||||
return boxService.deleteTtBoxThirdExplosiveUsers(ttBoxUserVO);
|
||||
@@ -143,13 +133,11 @@ public class TtBoxController extends BaseController {
|
||||
util.exportExcel(response, list.getRows(), "宝箱列表");
|
||||
}
|
||||
|
||||
@ApiOperation("查询开箱临时爆率队列")
|
||||
@GetMapping("/mockresult/list")
|
||||
public R<List<BoxMockCache.MockItem>> getBoxMockResult(@RequestParam("uid") Integer uid) {
|
||||
return R.ok(boxMockService.getMockResultList(uid));
|
||||
}
|
||||
|
||||
@ApiOperation("设置开箱临时爆率队列")
|
||||
@PostMapping("/mockresult/list")
|
||||
public R<List<BoxMockCache.MockItem>> updateBoxMockResult(@RequestBody BoxMockRequest request) {
|
||||
return R.ok(boxMockService.updateMockResultList(request));
|
||||
|
||||
-6
@@ -12,8 +12,6 @@ import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.core.page.PageDataInfo;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
@@ -26,7 +24,6 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Api(tags = "管理端 宝箱物品")
|
||||
@RestController
|
||||
@RequestMapping("/admin/boxOrnaments")
|
||||
public class TtBoxOrnamentsController extends BaseController {
|
||||
@@ -37,7 +34,6 @@ public class TtBoxOrnamentsController extends BaseController {
|
||||
this.boxOrnamentsService = boxOrnamentsService;
|
||||
}
|
||||
|
||||
@ApiOperation("宝箱物品详情")
|
||||
@GetMapping("/list/{boxId}")
|
||||
public PageDataInfo<TtBoxOrnamentsDataVO> list(@PathVariable("boxId") Integer boxId) {
|
||||
// 在分页之前算总数(避免PageHelper干扰百分比计算)
|
||||
@@ -48,7 +44,6 @@ public class TtBoxOrnamentsController extends BaseController {
|
||||
return getPageData(list);
|
||||
}
|
||||
|
||||
@ApiOperation("宝箱统计数据")
|
||||
@GetMapping("/globalData/{boxId}")
|
||||
public R globalData(@PathVariable("boxId") Integer boxId) {
|
||||
return boxOrnamentsService.globalData(boxId);
|
||||
@@ -123,7 +118,6 @@ public class TtBoxOrnamentsController extends BaseController {
|
||||
}
|
||||
@Log(title = "宝箱列表", action = "批量填货", businessType = BusinessType.INSERT)
|
||||
// 宝箱填货
|
||||
@ApiOperation("宝箱填货")
|
||||
@PostMapping("/batchAdd")
|
||||
public AjaxResult batchAdd(@RequestBody batchAddParam param) {
|
||||
return boxOrnamentsService.batchAdd(param);
|
||||
|
||||
-5
@@ -20,7 +20,6 @@ import com.ruoyi.domain.common.constant.UserType;
|
||||
import com.ruoyi.domain.entity.TtUserBlendErcash;
|
||||
import com.ruoyi.domain.entity.sys.TtUser;
|
||||
import com.ruoyi.domain.vo.user.TtUserVo;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -48,7 +47,6 @@ public class TtCardMerchantController extends BaseController {
|
||||
@Autowired
|
||||
private RedisLock redisLock;
|
||||
|
||||
@ApiOperation("获取卡商列表")
|
||||
@GetMapping("/list")
|
||||
public PageDataInfo<TtUserVo> cardMerchantList(
|
||||
@RequestParam(required = false) Integer userId,
|
||||
@@ -86,7 +84,6 @@ public class TtCardMerchantController extends BaseController {
|
||||
|
||||
@Log(title = "卡商充值", action = "确认充值", businessType = BusinessType.GRANT,
|
||||
entityClass = TtUser.class, mapperClass = TtUserMapper.class, idField = "userId")
|
||||
@ApiOperation("卡商充值(管理员给卡商增加余额)")
|
||||
@PostMapping("/recharge")
|
||||
public AjaxResult cardMerchantRecharge(@RequestBody Map<String, Object> params) {
|
||||
Integer userId = (Integer) params.get("userId");
|
||||
@@ -154,7 +151,6 @@ public class TtCardMerchantController extends BaseController {
|
||||
|
||||
@Log(title = "卡商充值", action = "确认修改", businessType = BusinessType.UPDATE,
|
||||
entityClass = TtUser.class, mapperClass = TtUserMapper.class, idField = "userId")
|
||||
@ApiOperation("修改卡商余额(直接设为指定值,按差额写审计流水)")
|
||||
@PostMapping("/updateBalance")
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public AjaxResult cardMerchantUpdateBalance(@RequestBody Map<String, Object> params) {
|
||||
@@ -234,7 +230,6 @@ public class TtCardMerchantController extends BaseController {
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation("卡商充值记录")
|
||||
@GetMapping("/rechargeLog")
|
||||
public PageDataInfo<TtUserBlendErcash> cardMerchantRechargeLog(@RequestParam(required = false) Integer userId) {
|
||||
LambdaQueryChainWrapper<TtUserBlendErcash> wrapper = new LambdaQueryChainWrapper<>(blendErcashMapper);
|
||||
|
||||
-7
@@ -11,13 +11,10 @@ import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.core.page.PageDataInfo;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Api(tags = "管理端 发货管理")
|
||||
@RestController
|
||||
@RequestMapping("/admin/deliverGoods")
|
||||
public class TtDeliveryRecordController extends BaseController {
|
||||
@@ -28,7 +25,6 @@ public class TtDeliveryRecordController extends BaseController {
|
||||
this.deliveryRecordService = deliveryRecordService;
|
||||
}
|
||||
|
||||
@ApiOperation("发货申请列表")
|
||||
@GetMapping("/getDeliveryApplyList")
|
||||
public PageDataInfo<DeliveryApplyVO> getDeliveryApplyList(TtDeliveryApplyBody deliveryApplyBody) {
|
||||
startPage();
|
||||
@@ -36,7 +32,6 @@ public class TtDeliveryRecordController extends BaseController {
|
||||
return getPageData(list);
|
||||
}
|
||||
|
||||
@ApiOperation("退回发货申请")
|
||||
@PostMapping("/deliveryFail")
|
||||
public R<Boolean> deliveryFail(@RequestParam("deliveryRecordId") Integer deliveryRecordId, @RequestParam("message") String message) {
|
||||
String msg = deliveryRecordService.deliveryFail(deliveryRecordId, message);
|
||||
@@ -44,14 +39,12 @@ public class TtDeliveryRecordController extends BaseController {
|
||||
}
|
||||
|
||||
@Log(title = "发货记录", action = "确认发货", businessType = BusinessType.GRANT)
|
||||
@ApiOperation("审核通过发货申请")
|
||||
@PostMapping("/deliveryApprove")
|
||||
public R<Boolean> deliveryApprove(@RequestParam("deliveryRecordId") Integer deliveryRecordId) {
|
||||
String msg = deliveryRecordService.deliveryApprove(deliveryRecordId);
|
||||
return StringUtils.isEmpty(msg) ? R.ok(true, "操作成功!") : R.fail(false, msg);
|
||||
}
|
||||
|
||||
@ApiOperation("发货记录申请")
|
||||
@GetMapping("/getDeliveryRecordList")
|
||||
public PageDataInfo<TtDeliveryRecordDataVO> getDeliveryRecordList(TtDeliveryRecordBody deliveryRecordBody) {
|
||||
startPage();
|
||||
|
||||
-9
@@ -13,13 +13,10 @@ import com.ruoyi.common.core.page.PageDataInfo;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.domain.entity.roll.TtOfficialRollConfig;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Api(tags = "管理端 官方周期Roll配置")
|
||||
@RestController
|
||||
@RequestMapping("/admin/officialRollConfig")
|
||||
public class TtOfficialRollConfigController extends BaseController {
|
||||
@@ -30,7 +27,6 @@ public class TtOfficialRollConfigController extends BaseController {
|
||||
this.configService = configService;
|
||||
}
|
||||
|
||||
@ApiOperation("配置列表")
|
||||
@GetMapping("/list")
|
||||
public PageDataInfo<TtOfficialRollConfig> list(
|
||||
@RequestParam(value = "configName", required = false) String configName,
|
||||
@@ -46,7 +42,6 @@ public class TtOfficialRollConfigController extends BaseController {
|
||||
return getPageData(configList);
|
||||
}
|
||||
|
||||
@ApiOperation("配置详情")
|
||||
@GetMapping("/{id}")
|
||||
public R<TtOfficialRollConfig> getInfo(@PathVariable("id") Integer id) {
|
||||
return R.ok(configService.getById(id));
|
||||
@@ -54,7 +49,6 @@ public class TtOfficialRollConfigController extends BaseController {
|
||||
|
||||
@Log(title = "官方周期Roll配置", action = "新增", businessType = BusinessType.INSERT,
|
||||
entityClass = TtOfficialRollConfig.class, mapperClass = TtOfficialRollConfigMapper.class)
|
||||
@ApiOperation("新增配置")
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody TtOfficialRollConfig config) {
|
||||
config.setCreateBy(getUsername());
|
||||
@@ -64,7 +58,6 @@ public class TtOfficialRollConfigController extends BaseController {
|
||||
|
||||
@Log(title = "官方周期Roll配置", action = "修改", businessType = BusinessType.UPDATE,
|
||||
entityClass = TtOfficialRollConfig.class, mapperClass = TtOfficialRollConfigMapper.class)
|
||||
@ApiOperation("编辑配置")
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody TtOfficialRollConfig config) {
|
||||
config.setUpdateBy(getUsername());
|
||||
@@ -73,13 +66,11 @@ public class TtOfficialRollConfigController extends BaseController {
|
||||
}
|
||||
|
||||
@Log(title = "官方周期Roll配置", action = "删除", businessType = BusinessType.DELETE)
|
||||
@ApiOperation("删除配置")
|
||||
@DeleteMapping("/{id}")
|
||||
public AjaxResult remove(@PathVariable("id") Integer id) {
|
||||
return configService.removeById(id) ? AjaxResult.success() : AjaxResult.error("删除失败");
|
||||
}
|
||||
|
||||
@ApiOperation("启用/停用配置")
|
||||
@PutMapping("/changeStatus")
|
||||
public AjaxResult changeStatus(@RequestBody TtOfficialRollConfig config) {
|
||||
if (config.getId() == null) return AjaxResult.error("配置ID不能为空");
|
||||
|
||||
-4
@@ -6,14 +6,11 @@ import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.core.page.PageDataInfo;
|
||||
import com.ruoyi.domain.dto.sys.OrderQueryCondition;
|
||||
import com.ruoyi.domain.entity.TtOrder;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Api(tags = "管理端 订单管理")
|
||||
@RestController
|
||||
@RequestMapping("/admin/order")
|
||||
public class TtOrderController extends BaseController {
|
||||
@@ -24,7 +21,6 @@ public class TtOrderController extends BaseController {
|
||||
this.ttOrderService = ttOrderService;
|
||||
}
|
||||
|
||||
@ApiOperation("网站支付订单查询")
|
||||
@PostMapping("/list")
|
||||
public R list(@RequestBody @Validated OrderQueryCondition condition) {
|
||||
return ttOrderService.adminList(condition);
|
||||
|
||||
-8
@@ -15,8 +15,6 @@ import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.domain.other.TtOrnamentsPrice;
|
||||
import com.ruoyi.domain.vo.TtOrnamentVO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -24,7 +22,6 @@ import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
@Api(tags = "管理端 饰品管理")
|
||||
@RestController
|
||||
@RequestMapping("/admin/ornaments")
|
||||
public class TtOrnamentsController extends BaseController {
|
||||
@@ -36,7 +33,6 @@ public class TtOrnamentsController extends BaseController {
|
||||
private TtOrnamentService ttOrnamentService;
|
||||
|
||||
// 饰品列表多条件筛选
|
||||
@ApiOperation("饰品列表多条件筛选")
|
||||
@GetMapping("/list")
|
||||
public R list(TtOrnamentsBody param) {
|
||||
Page<TtOrnamentVO> ttOrnamentVOPage = ttOrnamentService.listByParam(param);
|
||||
@@ -59,7 +55,6 @@ public class TtOrnamentsController extends BaseController {
|
||||
}
|
||||
|
||||
@Log(title = "饰品列表", action = "发放饰品", businessType = BusinessType.GRANT)
|
||||
@ApiOperation("饰品发放")
|
||||
@PostMapping("/grantOrnaments/{userId}/{ornamentsId}/{num}")
|
||||
public AjaxResult grantOrnaments(@PathVariable("userId") Integer userId,
|
||||
@PathVariable("ornamentsId") Long ornamentsId,
|
||||
@@ -75,7 +70,6 @@ public class TtOrnamentsController extends BaseController {
|
||||
|
||||
@Log(title = "饰品列表", action = "新增饰品", businessType = BusinessType.INSERT,
|
||||
entityClass = TtOrnament.class, mapperClass = TtOrnamentMapper.class)
|
||||
@ApiOperation("新增饰品")
|
||||
@PostMapping("/addTtOrnament")
|
||||
public AjaxResult add(@RequestBody TtOrnament ttOrnament) {
|
||||
if (ttOrnament.getId() == null) {
|
||||
@@ -86,14 +80,12 @@ public class TtOrnamentsController extends BaseController {
|
||||
|
||||
@Log(title = "饰品列表", action = "编辑", businessType = BusinessType.UPDATE,
|
||||
entityClass = TtOrnament.class, mapperClass = TtOrnamentMapper.class)
|
||||
@ApiOperation("修改饰品")
|
||||
@PostMapping("/editTtOrnament")
|
||||
public AjaxResult edit(@RequestBody TtOrnament ttOrnament) {
|
||||
return toAjax(ornamentsService.updateById(ttOrnament));
|
||||
}
|
||||
|
||||
@Log(title = "饰品列表", action = "删除", businessType = BusinessType.DELETE)
|
||||
@ApiOperation("删除饰品(支持批量)")
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult delete(@PathVariable("ids") List<Long> ids) {
|
||||
if (ids == null || ids.isEmpty()) {
|
||||
|
||||
-4
@@ -10,13 +10,10 @@ import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.core.page.PageDataInfo;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Api(tags = "管理端 饰品等级信息")
|
||||
@RestController
|
||||
@RequestMapping("/admin/ornamentsLevel")
|
||||
public class TtOrnamentsLevelController extends BaseController {
|
||||
@@ -27,7 +24,6 @@ public class TtOrnamentsLevelController extends BaseController {
|
||||
this.ornamentsLevelService = ornamentsLevelService;
|
||||
}
|
||||
|
||||
@ApiOperation("获取所有饰品等级背景")
|
||||
@GetMapping("/list")
|
||||
public PageDataInfo<TtOrnamentsLevel> list() {
|
||||
startPage();
|
||||
|
||||
-3
@@ -8,7 +8,6 @@ import com.ruoyi.common.core.page.PageDataInfo;
|
||||
import com.ruoyi.domain.param.promotion.AnchorDailyTurnoverParam;
|
||||
import com.ruoyi.domain.param.promotion.AnchorRechargeParam;
|
||||
import com.ruoyi.domain.vo.promotion.AnchorDailyTurnoverVo;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@@ -22,7 +21,6 @@ public class TtPromoTurnoverController extends BaseController {
|
||||
@Autowired
|
||||
private TtPromoTurnoverService ttPromoTurnoverService;
|
||||
|
||||
@ApiOperation("获取主播推广数据")
|
||||
@GetMapping("/getAnchorPromotionData")
|
||||
public PageDataInfo<AnchorDailyTurnoverVo> getAnchorPromotionData(AnchorDailyTurnoverParam param) {
|
||||
List<AnchorDailyTurnoverVo> list = ttPromoTurnoverService.getAnchorDailyTurnover(param);
|
||||
@@ -38,7 +36,6 @@ public class TtPromoTurnoverController extends BaseController {
|
||||
return pageDataInfo;
|
||||
}
|
||||
|
||||
@ApiOperation("主播充值")
|
||||
@PostMapping("/recharge")
|
||||
public AjaxResult recharge(@RequestBody AnchorRechargeParam param) {
|
||||
return ttPromoTurnoverService.recharge(param);
|
||||
|
||||
-4
@@ -13,14 +13,11 @@ import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.core.page.PageDataInfo;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
@Api(tags = "管理端 红包")
|
||||
@RestController
|
||||
@RequestMapping("/admin/redPacket")
|
||||
public class TtRedPacketController extends BaseController {
|
||||
@@ -45,7 +42,6 @@ public class TtRedPacketController extends BaseController {
|
||||
}
|
||||
|
||||
@Log(title = "CDK口令", action = "新增", businessType = BusinessType.INSERT)
|
||||
@ApiOperation("生成红包")
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody TtRedPacketDataVO ttRedPacketDataVO) {
|
||||
List<String> passwordList = redPacketService.insertRedPacket(ttRedPacketDataVO);
|
||||
|
||||
-18
@@ -24,8 +24,6 @@ import com.ruoyi.domain.entity.roll.TtRollUser;
|
||||
import com.ruoyi.domain.entity.sys.TtUser;
|
||||
import com.ruoyi.domain.vo.TtRollPrizeDataVO;
|
||||
import com.ruoyi.domain.vo.roll.RollJackpotOrnamentsByPageVO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.Data;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -35,7 +33,6 @@ import jakarta.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Api(tags = "管理端 roll房")
|
||||
@RestController
|
||||
@RequestMapping("/admin/roll")
|
||||
public class TtRollController extends BaseController {
|
||||
@@ -77,7 +74,6 @@ public class TtRollController extends BaseController {
|
||||
@Log(title = "Roll房列表", action = "新增", businessType = BusinessType.INSERT,
|
||||
entityClass = TtRoll.class, mapperClass = TtRollMapper.class)
|
||||
// 创建roll房
|
||||
@ApiOperation("创建roll房")
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody TtRoll ttRoll) {
|
||||
|
||||
@@ -88,7 +84,6 @@ public class TtRollController extends BaseController {
|
||||
}
|
||||
|
||||
// roll房拉人
|
||||
@ApiOperation("roll房拉人")
|
||||
@PostMapping("/inviteRollUser")
|
||||
public R inviteRollUser(@RequestBody InviteRollUser InviteRollUser) {
|
||||
|
||||
@@ -97,7 +92,6 @@ public class TtRollController extends BaseController {
|
||||
}
|
||||
|
||||
// 获取roll房成员信息
|
||||
@ApiOperation("获取roll房成员信息")
|
||||
@GetMapping("getRollUsers/{rollId}")
|
||||
public AjaxResult getRollUsers(@PathVariable("rollId") Integer rollId) {
|
||||
return rollService.getRollUsers(rollId);
|
||||
@@ -106,7 +100,6 @@ public class TtRollController extends BaseController {
|
||||
|
||||
@Log(title = "Roll房列表", action = "修改", businessType = BusinessType.UPDATE,
|
||||
entityClass = TtRoll.class, mapperClass = TtRollMapper.class)
|
||||
@ApiOperation("编辑roll房")
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody TtRoll ttRoll) {
|
||||
|
||||
@@ -117,14 +110,12 @@ public class TtRollController extends BaseController {
|
||||
}
|
||||
|
||||
@Log(title = "Roll房列表", action = "删除", businessType = BusinessType.DELETE)
|
||||
@ApiOperation("删除roll房")
|
||||
@DeleteMapping("/remove/{rollId}")
|
||||
public AjaxResult remove(@PathVariable Long rollId) {
|
||||
return rollService.removeRollById(rollId, getUsername());
|
||||
}
|
||||
|
||||
|
||||
// @ApiOperation("roll房奖品列表")
|
||||
// @PostMapping("/getRollPrizeList")
|
||||
// public R<List<TtRollPrizeDataVO>> getRollPrizeList(@RequestBody RollPrizesCondition condition) {
|
||||
//
|
||||
@@ -133,7 +124,6 @@ public class TtRollController extends BaseController {
|
||||
// return R.ok(list);
|
||||
//
|
||||
// }
|
||||
@ApiOperation("roll房奖品列表")
|
||||
@GetMapping("/getRollPrizeList/{rollId}")
|
||||
public R<List<TtRollPrizeDataVO>> getRollPrizeList(@PathVariable("rollId") Integer rollId) {
|
||||
|
||||
@@ -143,40 +133,34 @@ public class TtRollController extends BaseController {
|
||||
|
||||
}
|
||||
|
||||
@ApiOperation("获取 roll房奖池详情")
|
||||
@PostMapping("/getRollPrizePool")
|
||||
public R<RollJackpotOrnamentsByPageVO> getRollPrizePool(@RequestBody @Validated GetRollPrizePool param) {
|
||||
return rollService.getRollPrizePool(param);
|
||||
}
|
||||
|
||||
@ApiOperation("roll房的指定获奖人名单")
|
||||
@GetMapping("/rollWinners/{rollId}")
|
||||
public R rollWinners(@PathVariable Integer rollId) {
|
||||
return rollUserService.rollWinners(rollId);
|
||||
}
|
||||
|
||||
@ApiOperation("roll房实际中奖记录(开奖后参与用户中了什么饰品)")
|
||||
@GetMapping("/winningRecords/{rollId}")
|
||||
public R<List<Map<String, Object>>> winningRecords(@PathVariable("rollId") Integer rollId) {
|
||||
return rollService.winningRecords(rollId);
|
||||
}
|
||||
|
||||
@Log(title = "装备列表", action = "指定获奖者", businessType = BusinessType.INSERT)
|
||||
@ApiOperation("指定roll房winner")
|
||||
@PostMapping("/namedWinner")
|
||||
public AjaxResult namedWinner(@RequestBody @Validated TtRollPrizeDataVO param) {
|
||||
return rollService.namedWinner(param);
|
||||
}
|
||||
|
||||
@Log(title = "装备列表", action = "取消奖品", businessType = BusinessType.DELETE)
|
||||
@ApiOperation("取消指定roll房奖品")
|
||||
@DeleteMapping("/cancelNamedWinner")
|
||||
public R cancelNamedWinner(@RequestBody List<Integer> rollUserPrizeIds) {
|
||||
return rollService.cancelNamedWinner(rollUserPrizeIds);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("获取ROLL房用户")
|
||||
@GetMapping("/getRollUser/{rollId}")
|
||||
public AjaxResult getRollUser(@PathVariable("rollId") Integer rollId) {
|
||||
List<TtUser> rollUserList = rollService.getRollUser(rollId);
|
||||
@@ -184,13 +168,11 @@ public class TtRollController extends BaseController {
|
||||
}
|
||||
|
||||
@Log(title = "房间用户", action = "加入机器人", businessType = BusinessType.INSERT)
|
||||
@ApiOperation("加入机器人")
|
||||
@PostMapping("/addRobot")
|
||||
public AjaxResult addRobot(@RequestBody AddRobotBody addRobotBody) {
|
||||
return rollService.addRobot(addRobotBody);
|
||||
}
|
||||
@Log(title = "房间用户", action = "加入用户", businessType = BusinessType.INSERT)
|
||||
@ApiOperation("强制加入普通用户")
|
||||
@PostMapping("/addUser")
|
||||
public AjaxResult addUser(@RequestBody AddUserBody addUserBody) {
|
||||
return rollService.addUser(addUserBody);
|
||||
|
||||
-5
@@ -13,14 +13,11 @@ import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.core.page.PageDataInfo;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
@Api(tags = "管理端 roll奖池")
|
||||
@RestController
|
||||
@RequestMapping("/admin/rollJackpot")
|
||||
public class TtRollJackpotController extends BaseController {
|
||||
@@ -31,7 +28,6 @@ public class TtRollJackpotController extends BaseController {
|
||||
this.rollJackpotService = rollJackpotService;
|
||||
}
|
||||
|
||||
@ApiOperation("奖池列表")
|
||||
@GetMapping("/list")
|
||||
public PageDataInfo<TtRollJackpot> list(@RequestParam(value = "jackpotName", required = false) String jackpotName) {
|
||||
startPage();
|
||||
@@ -51,7 +47,6 @@ public class TtRollJackpotController extends BaseController {
|
||||
|
||||
@Log(title = "奖池列表", action = "新增", businessType = BusinessType.INSERT,
|
||||
entityClass = TtRollJackpot.class, mapperClass = TtRollJackpotMapper.class)
|
||||
@ApiOperation("添加奖池")
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody TtRollJackpot ttRollJackpot) {
|
||||
ttRollJackpot.setCreateBy(getUsername());
|
||||
|
||||
-6
@@ -16,14 +16,11 @@ import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.core.page.PageDataInfo;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
@Api(tags = "管理端 roll奖池物品管理")
|
||||
@RestController
|
||||
@RequestMapping("/admin/rollJackpotOrnaments")
|
||||
public class TtRollJackpotOrnamentsController extends BaseController {
|
||||
@@ -37,7 +34,6 @@ public class TtRollJackpotOrnamentsController extends BaseController {
|
||||
this.rollJackpotOrnamentsService = rollJackpotOrnamentsService;
|
||||
}
|
||||
|
||||
@ApiOperation("物品列表")
|
||||
@GetMapping("/list")
|
||||
public PageDataInfo<TtRollJackpotOrnamentsDataVO> list(TtRollJackpotOrnamentsBody rollJackpotOrnamentsBody) {
|
||||
startPage();
|
||||
@@ -61,7 +57,6 @@ public class TtRollJackpotOrnamentsController extends BaseController {
|
||||
|
||||
@Log(title = "奖池列表", action = "修改", businessType = BusinessType.UPDATE,
|
||||
entityClass = TtRollJackpotOrnaments.class, mapperClass = TtRollJackpotOrnamentsMapper.class)
|
||||
@ApiOperation("修改奖池道具")
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody TtRollJackpotOrnaments rollJOEdit) {
|
||||
String msg = rollJackpotOrnamentsService.updateRollJackpotOrnamentsById(rollJOEdit);
|
||||
@@ -82,7 +77,6 @@ public class TtRollJackpotOrnamentsController extends BaseController {
|
||||
return toAjax(ok);
|
||||
}
|
||||
|
||||
@ApiOperation("奖池批量填货")
|
||||
@PostMapping("/batchAdd/{rollJackpotId}/{OrnamentsIds}")
|
||||
public AjaxResult batchAdd(@PathVariable Integer rollJackpotId, @PathVariable Long[] OrnamentsIds) {
|
||||
String msg = rollJackpotOrnamentsService.batchAdd(rollJackpotId, Arrays.asList(OrnamentsIds));
|
||||
|
||||
-9
@@ -11,14 +11,11 @@ import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.domain.other.TransferApplyBody;
|
||||
import com.ruoyi.domain.vo.transfer.TransferApplyBatchVO;
|
||||
import com.ruoyi.domain.vo.transfer.TransferApplyVO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
@Api(tags = "管理端 转赠申请管理")
|
||||
@RestController
|
||||
@RequestMapping("/admin/transferApply")
|
||||
public class TtTransferApplyController extends BaseController {
|
||||
@@ -32,7 +29,6 @@ public class TtTransferApplyController extends BaseController {
|
||||
this.redisLock = redisLock;
|
||||
}
|
||||
|
||||
@ApiOperation("转赠申请列表(按饰品逐条)")
|
||||
@GetMapping("/list")
|
||||
public PageDataInfo<TransferApplyVO> list(TransferApplyBody body) {
|
||||
startPage();
|
||||
@@ -40,7 +36,6 @@ public class TtTransferApplyController extends BaseController {
|
||||
return getPageData(list);
|
||||
}
|
||||
|
||||
@ApiOperation("转赠申请批次列表(按批次聚合,含饰品明细)")
|
||||
@GetMapping("/batchList")
|
||||
public PageDataInfo<TransferApplyBatchVO> batchList(TransferApplyBody body) {
|
||||
startPage();
|
||||
@@ -48,7 +43,6 @@ public class TtTransferApplyController extends BaseController {
|
||||
return getPageData(list);
|
||||
}
|
||||
|
||||
@ApiOperation("审核通过(单条,兼容旧接口)")
|
||||
@Log(title = "转赠申请", action = "同意", businessType = BusinessType.GRANT)
|
||||
@PostMapping("/approve")
|
||||
public R<Boolean> approve(@RequestParam("id") Integer id) {
|
||||
@@ -64,7 +58,6 @@ public class TtTransferApplyController extends BaseController {
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation("审核驳回(单条,兼容旧接口)")
|
||||
@Log(title = "转赠申请", action = "驳回", businessType = BusinessType.GRANT)
|
||||
@PostMapping("/reject")
|
||||
public R<Boolean> reject(@RequestParam("id") Integer id,
|
||||
@@ -81,7 +74,6 @@ public class TtTransferApplyController extends BaseController {
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation("批次审核通过(整个批次一起通过)")
|
||||
@Log(title = "转赠申请", action = "确定同意", businessType = BusinessType.GRANT)
|
||||
@PostMapping("/approveBatch")
|
||||
public R<Boolean> approveBatch(@RequestParam("batchId") String batchId) {
|
||||
@@ -97,7 +89,6 @@ public class TtTransferApplyController extends BaseController {
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation("批次审核驳回(整个批次一起驳回)")
|
||||
@Log(title = "转赠申请", action = "驳回", businessType = BusinessType.GRANT)
|
||||
@PostMapping("/rejectBatch")
|
||||
public R<Boolean> rejectBatch(@RequestParam("batchId") String batchId,
|
||||
|
||||
-6
@@ -9,9 +9,6 @@ import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.PageDataInfo;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
@@ -25,7 +22,6 @@ import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Api(tags = "管理端 失败物品奖励")
|
||||
@RestController
|
||||
@RequestMapping("/admin/upgradeFailOrnaments")
|
||||
public class TtUpgradeFailOrnamentsController extends BaseController {
|
||||
@@ -43,7 +39,6 @@ public class TtUpgradeFailOrnamentsController extends BaseController {
|
||||
@NotNull(message = "参与升级物品id不能为空")
|
||||
private Integer upgradeOrnamentId;
|
||||
}
|
||||
@ApiOperation("失败奖励列表")
|
||||
@PostMapping("/list")
|
||||
public PageDataInfo<TtUpgradeFailOrnamentsDataVO> list(@RequestBody listParam param) {
|
||||
startPage();
|
||||
@@ -67,7 +62,6 @@ public class TtUpgradeFailOrnamentsController extends BaseController {
|
||||
private Boolean useAllFlag;
|
||||
}
|
||||
@Log(title = "失败奖励", action = "新增", businessType = BusinessType.INSERT)
|
||||
@ApiOperation("批量添加失败奖励")
|
||||
@PostMapping("/batchAdd")
|
||||
public AjaxResult batchAdd(@RequestBody @Validated BatchAddParam param) {
|
||||
return upgradeFailOrnamentsService.batchAdd(param);
|
||||
|
||||
-5
@@ -14,8 +14,6 @@ import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.core.page.PageDataInfo;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
@@ -24,7 +22,6 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Api(tags = "管理端 幸运升级")
|
||||
@RestController
|
||||
@RequestMapping("/admin/upgradeOrnaments")
|
||||
public class TtUpgradeOrnamentsController extends BaseController {
|
||||
@@ -38,7 +35,6 @@ public class TtUpgradeOrnamentsController extends BaseController {
|
||||
this.upgradeOrnamentsService = upgradeOrnamentsService;
|
||||
}
|
||||
|
||||
@ApiOperation("获取参与幸运升级的物品")
|
||||
@GetMapping("/list")
|
||||
public PageDataInfo<TtUpgradeOrnamentsDataVO> list(TtUpgradeOrnamentsBody ttUpgradeOrnamentsBody){
|
||||
startPage();
|
||||
@@ -53,7 +49,6 @@ public class TtUpgradeOrnamentsController extends BaseController {
|
||||
}
|
||||
|
||||
@Log(title = "饰品列表", action = "新增", businessType = BusinessType.INSERT)
|
||||
@ApiOperation("批量填货")
|
||||
@PostMapping("/batchAdd/{ornamentsIds}")
|
||||
public AjaxResult batchAdd(@PathVariable Long[] ornamentsIds) {
|
||||
String msg = upgradeOrnamentsService.batchAdd(Arrays.asList(ornamentsIds));
|
||||
|
||||
-4
@@ -10,14 +10,11 @@ import com.ruoyi.domain.other.TtUpgradeRecordBody;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.page.PageDataInfo;
|
||||
import com.ruoyi.domain.vo.upgrade.UpgradeRecordVO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Api(tags = "管理端 幸运升级日志")
|
||||
@RestController
|
||||
@RequestMapping("/admin/upgradeRecord")
|
||||
public class TtUpgradeRecordController extends BaseController {
|
||||
@@ -28,7 +25,6 @@ public class TtUpgradeRecordController extends BaseController {
|
||||
this.upgradeRecordService = upgradeRecordService;
|
||||
}
|
||||
|
||||
@ApiOperation("幸运升级日志")
|
||||
@PostMapping("/list")
|
||||
public R<Page<UpgradeRecordVO>> list(@RequestBody @Validated UpgradeCondition param){
|
||||
return upgradeRecordService.adminGetLog(param);
|
||||
|
||||
-9
@@ -6,8 +6,6 @@ import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.domain.other.UpgradeWatermarkSettingBody;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@@ -21,7 +19,6 @@ import java.util.Map;
|
||||
* 后台只配一个「目标水位(%)」:水位高于它 → 随机数中心下移(放水);低于它 → 上移(收紧),
|
||||
* 长期自动收敛回目标值。随机数的取值范围仍由每个饰品自己的区间限定。
|
||||
*/
|
||||
@Api(tags = "幸运升级·奖池水位")
|
||||
@RestController
|
||||
@RequestMapping("/admin/upgradeWatermark")
|
||||
public class TtUpgradeWatermarkController extends BaseController {
|
||||
@@ -29,13 +26,11 @@ public class TtUpgradeWatermarkController extends BaseController {
|
||||
@Autowired
|
||||
private UpgradeWatermarkService watermarkService;
|
||||
|
||||
@ApiOperation("当前水位快照 + 目标水位策略 + 按目标水位推算的随机数中心")
|
||||
@GetMapping("/info")
|
||||
public R<Map<String, Object>> info() {
|
||||
return R.ok(watermarkService.info());
|
||||
}
|
||||
|
||||
@ApiOperation("保存目标水位策略(目标水位 + 灵敏度)")
|
||||
@Log(title = "幸运升级水位策略", action = "保存", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/setting")
|
||||
public R<Map<String, Object>> saveSetting(@RequestBody UpgradeWatermarkSettingBody body) {
|
||||
@@ -46,7 +41,6 @@ public class TtUpgradeWatermarkController extends BaseController {
|
||||
return R.ok(watermarkService.info());
|
||||
}
|
||||
|
||||
@ApiOperation("注水/抽水(type 1注水 2抽水;调整原因必填)")
|
||||
@Log(title = "幸运升级水位", action = "注水/抽水", businessType = BusinessType.GRANT)
|
||||
@PostMapping("/adjust")
|
||||
public R<Map<String, Object>> adjust(@RequestBody Map<String, Object> body) {
|
||||
@@ -60,7 +54,6 @@ public class TtUpgradeWatermarkController extends BaseController {
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation("重置人工调整(插入抵消日志,SUM(delta) 归零,历史保留)")
|
||||
@Log(title = "幸运升级水位", action = "重置调整", businessType = BusinessType.CLEAN)
|
||||
@PostMapping("/adjustReset")
|
||||
public R<Map<String, Object>> adjustReset(@RequestBody(required = false) Map<String, Object> body) {
|
||||
@@ -72,14 +65,12 @@ public class TtUpgradeWatermarkController extends BaseController {
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation("调整历史(分页)")
|
||||
@GetMapping("/adjustLog")
|
||||
public R<Map<String, Object>> adjustLog(@RequestParam(defaultValue = "1") int page,
|
||||
@RequestParam(defaultValue = "10") int size) {
|
||||
return R.ok(watermarkService.pageLog(page, size));
|
||||
}
|
||||
|
||||
@ApiOperation("按历史记录全量重算累计下注/返奖(纠正 Redis 计数漂移)")
|
||||
@Log(title = "幸运升级水位", action = "重算累计量", businessType = BusinessType.CLEAN)
|
||||
@PostMapping("/recalc")
|
||||
public R<Map<String, Object>> recalc() {
|
||||
|
||||
-5
@@ -9,8 +9,6 @@ import com.ruoyi.system.config.ArchiveDaysConfig;
|
||||
import com.ruoyi.domain.other.TtUserAmountRecordsBody;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.page.PageDataInfo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -22,7 +20,6 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Slf4j
|
||||
@Api(tags = "管理端 金币账户")
|
||||
@RestController
|
||||
@RequestMapping("/admin/userAmountRecords")
|
||||
public class TtUserAmountRecordsController extends BaseController {
|
||||
@@ -38,7 +35,6 @@ public class TtUserAmountRecordsController extends BaseController {
|
||||
this.userAmountRecordsService = userAmountRecordsService;
|
||||
}
|
||||
|
||||
@ApiOperation("获取列表")
|
||||
@PostMapping("/list")
|
||||
public R list(@RequestBody @Validated TtUserAmountRecordsBody ttUserAmountRecordsBody) {
|
||||
return userAmountRecordsService.queryList(ttUserAmountRecordsBody);
|
||||
@@ -55,7 +51,6 @@ public class TtUserAmountRecordsController extends BaseController {
|
||||
* - userId 排序 → 快速模式(先分页用户再聚合当页数据,Java内存排序)
|
||||
* - 聚合字段排序 → 全局排序模式(先聚合所有用户→SQL排序→分页),确保全局排序正确
|
||||
*/
|
||||
@ApiOperation("用户流水统计")
|
||||
@GetMapping("/userTurnover")
|
||||
public R userTurnover(
|
||||
@RequestParam(required = false) Integer userId,
|
||||
|
||||
-5
@@ -5,8 +5,6 @@ import com.ruoyi.admin.service.TtUserBlendErcashService;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.domain.dto.userRecord.BlendErcashCondition;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -15,7 +13,6 @@ import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@Api(tags = "管理端 收支明细")
|
||||
@RestController
|
||||
@RequestMapping("/admin/blendErcash")
|
||||
@Slf4j
|
||||
@@ -24,13 +21,11 @@ public class TtUserBlendErcashController extends BaseController {
|
||||
@Autowired
|
||||
private TtUserBlendErcashService ttUserBlendErcashService;
|
||||
|
||||
@ApiOperation("收支明细")
|
||||
@PostMapping("/list")
|
||||
public R list(@RequestBody @Validated BlendErcashCondition condition) {
|
||||
return ttUserBlendErcashService.byCondition(condition);
|
||||
}
|
||||
|
||||
@ApiOperation("收支明细-仅归档表")
|
||||
@PostMapping("/archive/list")
|
||||
public R archiveList(@RequestBody @Validated BlendErcashCondition condition) {
|
||||
return ttUserBlendErcashService.byConditionArchive(condition);
|
||||
|
||||
-10
@@ -27,7 +27,6 @@ import com.ruoyi.domain.other.TtUserBody;
|
||||
import com.ruoyi.domain.other.TtUserPackSackBody;
|
||||
import com.ruoyi.domain.vo.TtUserPackSackDataVO;
|
||||
import com.ruoyi.domain.vo.user.TtUserVo;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import lombok.Data;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -89,14 +88,12 @@ public class TtUserController extends BaseController {
|
||||
}
|
||||
|
||||
@Log(title = "用户列表", action = "生成招商账号", businessType = BusinessType.INSERT)
|
||||
@ApiOperation("生成招商账号")
|
||||
@PostMapping("/generateAccount")
|
||||
public void generateAccount(HttpServletResponse response, @RequestBody GenerateAccountBody body) {
|
||||
List<TtUser> userList = userService.getAccountList(body.getNum(), body.getCustomPhoneNumbers());
|
||||
userService.generateAccount(response, userList);
|
||||
}
|
||||
|
||||
@ApiOperation("生成账号")
|
||||
@GetMapping("/generateAccountByPhoneNum")
|
||||
public R generateAccountByPhoneNum(HttpServletResponse response, @RequestParam("phoneNum") String phoneNum,
|
||||
@RequestParam("password") String password) {
|
||||
@@ -105,7 +102,6 @@ public class TtUserController extends BaseController {
|
||||
}
|
||||
|
||||
@Log(title = "用户列表", action = "生成机器人", businessType = BusinessType.INSERT)
|
||||
@ApiOperation("生成机器人")
|
||||
@PostMapping("/generateRobot/{num}")
|
||||
public void generateRobot(HttpServletResponse response, @PathVariable("num") Integer num) {
|
||||
List<TtUser> userList = userService.getRobotList(num);
|
||||
@@ -113,7 +109,6 @@ public class TtUserController extends BaseController {
|
||||
}
|
||||
|
||||
@Log(title = "用户列表", action = "生成白号", businessType = BusinessType.INSERT)
|
||||
@ApiOperation("生成白号")
|
||||
@PostMapping("/generateBlankAccount")
|
||||
public void generateBlankAccount(HttpServletResponse response, @RequestBody GenerateAccountBody body) {
|
||||
List<TtUser> userList = userService.getBlankAccountList(body.getNum(), body.getCustomPhoneNumbers());
|
||||
@@ -121,7 +116,6 @@ public class TtUserController extends BaseController {
|
||||
}
|
||||
|
||||
@Log(title = "用户列表", action = "生成卡商账号", businessType = BusinessType.INSERT)
|
||||
@ApiOperation("生成卡商账号")
|
||||
@PostMapping("/generateCardMerchant")
|
||||
public void generateCardMerchant(HttpServletResponse response, @RequestBody GenerateAccountBody body) {
|
||||
List<TtUser> userList = userService.getCardMerchantList(body.getNum(), body.getCustomPhoneNumbers());
|
||||
@@ -130,7 +124,6 @@ public class TtUserController extends BaseController {
|
||||
|
||||
@Log(title = "用户列表", action = "修改", businessType = BusinessType.UPDATE,
|
||||
entityClass = TtUser.class, mapperClass = TtUserMapper.class)
|
||||
@ApiOperation("修改用户信息")
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody TtUser ttUser) {
|
||||
ttUser.setUpdateBy(getUsername());
|
||||
@@ -146,7 +139,6 @@ public class TtUserController extends BaseController {
|
||||
|
||||
@Log(title = "用户列表", action = "修改邀请码", businessType = BusinessType.UPDATE,
|
||||
entityClass = TtUser.class, mapperClass = TtUserMapper.class)
|
||||
@ApiOperation("修改邀请码")
|
||||
@PostMapping("/editInvitationCode")
|
||||
public AjaxResult editInvitationCode(@RequestBody TtUser ttUser) {
|
||||
ttUser.setUpdateBy(getUsername());
|
||||
@@ -225,7 +217,6 @@ public class TtUserController extends BaseController {
|
||||
|
||||
@Log(title = "用户列表", action = "重置余额积分", businessType = BusinessType.CLEAN,
|
||||
entityClass = TtUser.class, mapperClass = TtUserMapper.class, idField = "userId")
|
||||
@ApiOperation("重置用户余额和积分")
|
||||
@PostMapping("/resetBalance/{userId}")
|
||||
public AjaxResult resetUserBalance(@PathVariable("userId") Integer userId){
|
||||
TtUser ttUser = new TtUser();
|
||||
@@ -239,7 +230,6 @@ public class TtUserController extends BaseController {
|
||||
}
|
||||
|
||||
@Log(title = "用户列表", action = "真删除", businessType = BusinessType.FORCE)
|
||||
@ApiOperation("真删除用户(数据库删除,不可恢复)")
|
||||
@DeleteMapping("/forceDelete/{userId}")
|
||||
public AjaxResult forceDelete(@PathVariable("userId") Integer userId) {
|
||||
// 0. 先清登录态:物理删除后 tt_user 查不到该用户,若不清 Redis Token,
|
||||
|
||||
-10
@@ -18,8 +18,6 @@ import com.ruoyi.domain.entity.TtOrnament;
|
||||
import com.ruoyi.domain.entity.lottery.TtTurnoverLottery;
|
||||
import com.ruoyi.domain.entity.lottery.TtTurnoverLotteryPrize;
|
||||
import com.ruoyi.domain.entity.lottery.TtTurnoverLotteryRecord;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@@ -31,7 +29,6 @@ import java.util.concurrent.TimeUnit;
|
||||
/**
|
||||
* 后台管理 - 流水抽奖配置
|
||||
*/
|
||||
@Api(tags = "后台流水抽奖管理")
|
||||
@RestController
|
||||
@RequestMapping("/admin/turnoverLottery")
|
||||
public class TurnoverLotteryAdminController extends BaseController {
|
||||
@@ -57,7 +54,6 @@ public class TurnoverLotteryAdminController extends BaseController {
|
||||
/**
|
||||
* 获取抽奖活动列表
|
||||
*/
|
||||
@ApiOperation("获取抽奖活动列表")
|
||||
@GetMapping("/list")
|
||||
public PageDataInfo<TtTurnoverLottery> list(
|
||||
@RequestParam(required = false) String lotteryName,
|
||||
@@ -92,7 +88,6 @@ public class TurnoverLotteryAdminController extends BaseController {
|
||||
/**
|
||||
* 保存抽奖奖品配置
|
||||
*/
|
||||
@ApiOperation("保存抽奖奖品")
|
||||
@PostMapping("/save/{lotteryId}")
|
||||
public R<String> savePrizes(
|
||||
@PathVariable("lotteryId") Long lotteryId,
|
||||
@@ -112,7 +107,6 @@ public class TurnoverLotteryAdminController extends BaseController {
|
||||
/**
|
||||
* 更新抽奖活动状态
|
||||
*/
|
||||
@ApiOperation("更新抽奖状态")
|
||||
@PostMapping("/toggleStatus")
|
||||
public R<String> toggleStatus(@RequestBody Map<String, Object> body) {
|
||||
Long lotteryId = body.get("lotteryId") != null ? ((Number) body.get("lotteryId")).longValue() : null;
|
||||
@@ -139,7 +133,6 @@ public class TurnoverLotteryAdminController extends BaseController {
|
||||
/**
|
||||
* 创建新的抽奖活动
|
||||
*/
|
||||
@ApiOperation("创建抽奖活动")
|
||||
@PostMapping("/create")
|
||||
public R<TtTurnoverLottery> create(@RequestBody Map<String, Object> body) {
|
||||
String lotteryName = body.get("lotteryName") != null ? body.get("lotteryName").toString() : null;
|
||||
@@ -170,7 +163,6 @@ public class TurnoverLotteryAdminController extends BaseController {
|
||||
/**
|
||||
* 删除抽奖活动
|
||||
*/
|
||||
@ApiOperation("删除抽奖活动")
|
||||
@DeleteMapping("/delete/{lotteryId}")
|
||||
public R<String> delete(@PathVariable("lotteryId") Long lotteryId) {
|
||||
lotteryMapper.deleteById(lotteryId);
|
||||
@@ -180,7 +172,6 @@ public class TurnoverLotteryAdminController extends BaseController {
|
||||
/**
|
||||
* 搜索饰品 (用于奖品配置时调用)
|
||||
*/
|
||||
@ApiOperation("搜索饰品")
|
||||
@GetMapping("/searchOrnaments")
|
||||
public R<List<TtOrnament>> searchOrnaments(
|
||||
@RequestParam(value = "name", required = false) String name,
|
||||
@@ -205,7 +196,6 @@ public class TurnoverLotteryAdminController extends BaseController {
|
||||
/**
|
||||
* 更新抽奖活动基础信息
|
||||
*/
|
||||
@ApiOperation("更新抽奖活动")
|
||||
@PostMapping("/update")
|
||||
public R<String> update(@RequestBody Map<String, Object> body) {
|
||||
Long lotteryId = body.get("lotteryId") != null ? ((Number) body.get("lotteryId")).longValue() : null;
|
||||
|
||||
-8
@@ -18,8 +18,6 @@ import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.domain.entity.lottery.TtTurnoverLottery;
|
||||
import com.ruoyi.domain.entity.lottery.TtTurnoverLotteryPrize;
|
||||
import com.ruoyi.domain.other.TtOrnamentsLevel;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@@ -33,7 +31,6 @@ import java.util.stream.Collectors;
|
||||
/**
|
||||
* 流水抽奖奖品管理 (仿宝箱饰品管理 boxOrnaments)
|
||||
*/
|
||||
@Api(tags = "流水抽奖奖品管理")
|
||||
@RestController
|
||||
@RequestMapping("/admin/turnoverLotteryPrize")
|
||||
public class TurnoverLotteryPrizeController extends BaseController {
|
||||
@@ -56,7 +53,6 @@ public class TurnoverLotteryPrizeController extends BaseController {
|
||||
/**
|
||||
* 获取奖品列表 (分页,含爆率百分比计算)
|
||||
*/
|
||||
@ApiOperation("奖品列表")
|
||||
@GetMapping("/list/{lotteryId}")
|
||||
public PageDataInfo<TtTurnoverLotteryPrize> list(@PathVariable("lotteryId") Long lotteryId) {
|
||||
// 先算总数(避免 PageHelper 干扰百分比计算)
|
||||
@@ -108,7 +104,6 @@ public class TurnoverLotteryPrizeController extends BaseController {
|
||||
/**
|
||||
* 获取单个奖品详情
|
||||
*/
|
||||
@ApiOperation("奖品详情")
|
||||
@GetMapping("/{id}")
|
||||
public R<TtTurnoverLotteryPrize> getInfo(@PathVariable("id") Long id) {
|
||||
return R.ok(prizeMapper.selectById(id));
|
||||
@@ -118,7 +113,6 @@ public class TurnoverLotteryPrizeController extends BaseController {
|
||||
/**
|
||||
* 新增奖品
|
||||
*/
|
||||
@ApiOperation("新增奖品")
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody TtTurnoverLotteryPrize prize) {
|
||||
if (prize == null || prize.getLotteryId() == null) {
|
||||
@@ -165,7 +159,6 @@ public class TurnoverLotteryPrizeController extends BaseController {
|
||||
/**
|
||||
* 修改奖品
|
||||
*/
|
||||
@ApiOperation("修改奖品")
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody TtTurnoverLotteryPrize prize) {
|
||||
Long lotteryId = prize.getLotteryId();
|
||||
@@ -211,7 +204,6 @@ public class TurnoverLotteryPrizeController extends BaseController {
|
||||
/**
|
||||
* 删除奖品
|
||||
*/
|
||||
@ApiOperation("删除奖品")
|
||||
@DeleteMapping("/{lotteryId}/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long lotteryId, @PathVariable Long[] ids) {
|
||||
String lockKey = RedisConstants.TURNOVER_LOTTERY_DRAW_BOX_LOCK + lotteryId;
|
||||
|
||||
-5
@@ -9,8 +9,6 @@ import com.ruoyi.common.core.page.PageDataInfo;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.domain.entity.lottery.TtTurnoverLotteryRecord;
|
||||
import com.ruoyi.domain.entity.lottery.TtTurnoverLottery;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@@ -19,7 +17,6 @@ import java.util.List;
|
||||
/**
|
||||
* 后台管理 - 抽奖记录查询
|
||||
*/
|
||||
@Api(tags = "后台抽奖记录管理")
|
||||
@RestController
|
||||
@RequestMapping("/admin/turnoverLotteryRecord")
|
||||
public class TurnoverLotteryRecordController extends BaseController {
|
||||
@@ -33,7 +30,6 @@ public class TurnoverLotteryRecordController extends BaseController {
|
||||
/**
|
||||
* 查询抽奖记录列表
|
||||
*/
|
||||
@ApiOperation("查询抽奖记录")
|
||||
@GetMapping("/list")
|
||||
public PageDataInfo<TtTurnoverLotteryRecord> list(
|
||||
@RequestParam(value = "userId", required = false) Long userId,
|
||||
@@ -58,7 +54,6 @@ public class TurnoverLotteryRecordController extends BaseController {
|
||||
/**
|
||||
* 获取所有抽奖活动(用于下拉选择)
|
||||
*/
|
||||
@ApiOperation("获取抽奖活动选项")
|
||||
@GetMapping("/lotteryOptions")
|
||||
public R<List<TtTurnoverLottery>> lotteryOptions() {
|
||||
LambdaQueryWrapper<TtTurnoverLottery> wrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
-7
@@ -6,8 +6,6 @@ import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.redis.config.RedisLock;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@@ -18,7 +16,6 @@ import java.util.concurrent.TimeUnit;
|
||||
/**
|
||||
* 用户端 - 流水抽奖
|
||||
*/
|
||||
@Api(tags = "用户流水抽奖")
|
||||
@RestController
|
||||
@RequestMapping("/api/turnoverLottery")
|
||||
public class TurnoverLotteryUserController extends BaseController {
|
||||
@@ -32,7 +29,6 @@ public class TurnoverLotteryUserController extends BaseController {
|
||||
/**
|
||||
* 获取用户今日流水统计和可参与的抽奖宝箱
|
||||
*/
|
||||
@ApiOperation("获取抽奖信息")
|
||||
@PostMapping("/myStats")
|
||||
public R<Map<String, Object>> getMyStats() {
|
||||
Integer userId = getUserId().intValue();
|
||||
@@ -42,7 +38,6 @@ public class TurnoverLotteryUserController extends BaseController {
|
||||
/**
|
||||
* 执行抽奖
|
||||
*/
|
||||
@ApiOperation("执行抽奖")
|
||||
@PostMapping("/draw")
|
||||
public R<Map<String, Object>> draw(@RequestBody Map<String, Object> params) {
|
||||
Integer userId = getUserId().intValue();
|
||||
@@ -82,7 +77,6 @@ public class TurnoverLotteryUserController extends BaseController {
|
||||
/**
|
||||
* 查询我的抽奖记录(分页)
|
||||
*/
|
||||
@ApiOperation("我的抽奖记录")
|
||||
@PostMapping("/myRecords")
|
||||
public R<Map<String, Object>> myRecords(@RequestBody(required = false) Map<String, Object> params) {
|
||||
Integer userId = getUserId().intValue();
|
||||
@@ -109,7 +103,6 @@ public class TurnoverLotteryUserController extends BaseController {
|
||||
/**
|
||||
* 查询全服中奖记录(分页,已排除白号/机器人/封禁/已删除用户)
|
||||
*/
|
||||
@ApiOperation("全服中奖记录")
|
||||
@PostMapping("/globalRecords")
|
||||
public R<Map<String, Object>> globalRecords(@RequestBody(required = false) Map<String, Object> params) {
|
||||
Long lotteryId = null;
|
||||
|
||||
-5
@@ -13,15 +13,12 @@ import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.core.page.PageDataInfo;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.domain.vo.upgrade.SimpleOrnamentVO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
@Api(tags = "管理端 道具管理")
|
||||
@RestController
|
||||
@RequestMapping("/admin/websiteProperty")
|
||||
@Slf4j
|
||||
@@ -36,7 +33,6 @@ public class WebsitePropertyController extends BaseController {
|
||||
this.ornamentsService = ornamentsService;
|
||||
}
|
||||
|
||||
// @ApiOperation("获取道具列表")
|
||||
// @GetMapping("/list")
|
||||
// public PageDataInfo<WebsitePropertyDataVO> list() {
|
||||
// startPage();
|
||||
@@ -44,7 +40,6 @@ public class WebsitePropertyController extends BaseController {
|
||||
// return getPageData(Arrays.asList());
|
||||
// }
|
||||
|
||||
@ApiOperation("获取道具列表")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(OrnamentCondition condition) {
|
||||
startPage();
|
||||
|
||||
@@ -7,7 +7,6 @@ import com.ruoyi.domain.entity.TtOrnament;
|
||||
import com.ruoyi.domain.entity.TtOrnamentsYY;
|
||||
import com.ruoyi.domain.vo.WebsitePropertyDataVO;
|
||||
import com.ruoyi.domain.vo.upgrade.SimpleOrnamentVO;
|
||||
import io.swagger.models.auth.In;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
+15
-7
@@ -78,7 +78,7 @@ public class ApiUserDetailsServiceImpl implements UserDetailsService {
|
||||
} else {
|
||||
userData.setParentInvitationCode(ParentUser.getInvitationCode());
|
||||
}
|
||||
return createLoginUser(userData);
|
||||
return createLoginUser(userData, LoginUser.SCOPE_PLAYER);
|
||||
} else if (username.startsWith("promo_user_")) {
|
||||
String phoneNumber = username.substring(11);
|
||||
TtUser user = new LambdaQueryChainWrapper<>(ttUserService.getBaseMapper())
|
||||
@@ -93,7 +93,7 @@ public class ApiUserDetailsServiceImpl implements UserDetailsService {
|
||||
if (hasPromoRole) {
|
||||
UserData userData = UserData.builder().build();
|
||||
BeanUtils.copyBeanProp(userData, user);
|
||||
return createLoginUser(userData);
|
||||
return createLoginUser(userData, LoginUser.SCOPE_PROMO);
|
||||
}
|
||||
// 超级管理员账号(promo_admin.username / phone_number)也可以是手机号
|
||||
PromoAdmin promoAdmin = promoAdminMapper.findByAccount(phoneNumber);
|
||||
@@ -105,7 +105,7 @@ public class ApiUserDetailsServiceImpl implements UserDetailsService {
|
||||
.userType(UserType.SUPER_ADMIN.getCode())
|
||||
.password(promoAdmin.getPassword())
|
||||
.build();
|
||||
return createLoginUser(userData);
|
||||
return createLoginUser(userData, LoginUser.SCOPE_PROMO);
|
||||
}
|
||||
// 以下报错语义与原逻辑保持一致
|
||||
if (StringUtils.isNull(user)) {
|
||||
@@ -137,7 +137,7 @@ public class ApiUserDetailsServiceImpl implements UserDetailsService {
|
||||
.userType(UserType.SUPER_ADMIN.getCode())
|
||||
.password(promoAdmin.getPassword())
|
||||
.build();
|
||||
return createLoginUser(userData);
|
||||
return createLoginUser(userData, LoginUser.SCOPE_PROMO);
|
||||
} else {
|
||||
SysUser user = userService.selectUserByUserName(username);
|
||||
if (StringUtils.isNull(user)) {
|
||||
@@ -157,11 +157,19 @@ public class ApiUserDetailsServiceImpl implements UserDetailsService {
|
||||
}
|
||||
}
|
||||
|
||||
private UserDetails createLoginUser(UserData userData) {
|
||||
return new LoginUser(userData.getUserId().longValue(), userData);
|
||||
/**
|
||||
* 玩家 / 推广端登录:账号前缀决定登录端标记,token 只能用于对应端的接口
|
||||
*/
|
||||
private UserDetails createLoginUser(UserData userData, String loginScope) {
|
||||
LoginUser loginUser = new LoginUser(userData.getUserId().longValue(), userData);
|
||||
loginUser.setLoginScope(loginScope);
|
||||
return loginUser;
|
||||
}
|
||||
|
||||
/** 后台账号登录(sys_user) */
|
||||
private UserDetails createLoginUser(SysUser user) {
|
||||
return new LoginUser(user.getUserId(), user.getDeptId(), user, permissionService.getMenuPermission(user));
|
||||
LoginUser loginUser = new LoginUser(user.getUserId(), user.getDeptId(), user, permissionService.getMenuPermission(user));
|
||||
loginUser.setLoginScope(LoginUser.SCOPE_ADMIN);
|
||||
return loginUser;
|
||||
}
|
||||
}
|
||||
|
||||
+3
-1
@@ -12,7 +12,9 @@ public interface TtFightResultService extends IService<TtFightResult> {
|
||||
FightResultVO getFightResult(Integer fightId);
|
||||
|
||||
/**
|
||||
* 批量获取多个对战的详细结果(替代循环调用 getFightResult 的 N+1 问题)
|
||||
* 批量获取多个对战的结果(替代循环调用 getFightResult 的 N+1 问题)。
|
||||
* 只算卡片要展示的金额,开箱明细(fightResult/winnerPrize/endGamePrize)不组装,
|
||||
* 客户端点卡片进观战/回顾时自己请求 getFightResult 取权威明细。
|
||||
*
|
||||
* @param fightIds 对战ID列表
|
||||
* @return 按入参顺序返回的 FightResultVO 列表(跳过不存在的 fightId)
|
||||
|
||||
+2
-6
@@ -38,9 +38,7 @@ public interface TtUserService extends IService<TtUser> {
|
||||
|
||||
void generateAccount(HttpServletResponse response, List<TtUser> accountList);
|
||||
|
||||
List<TtUser> getAccountList(Integer num);
|
||||
|
||||
// 生成招商账号:支持按位置传入自定义手机号(为空的位置随机生成)
|
||||
// 生成招商账号:手机号必填(推广后台靠手机号收短信验证码登录,随机号收不到码)
|
||||
List<TtUser> getAccountList(Integer num, List<String> customPhoneNumbers);
|
||||
|
||||
TtUser getAccountList(String phoneNumber, String password);
|
||||
@@ -52,9 +50,7 @@ public interface TtUserService extends IService<TtUser> {
|
||||
// 生成白号:支持按位置传入自定义手机号(为空的位置随机生成)
|
||||
List<TtUser> getBlankAccountList(Integer num, List<String> customPhoneNumbers);
|
||||
|
||||
List<TtUser> getCardMerchantList(Integer num);
|
||||
|
||||
// 生成卡商账号:支持按位置传入自定义手机号(为空的位置随机生成)
|
||||
// 生成卡商账号:手机号必填(推广后台靠手机号收短信验证码登录,随机号收不到码)
|
||||
List<TtUser> getCardMerchantList(Integer num, List<String> customPhoneNumbers);
|
||||
|
||||
boolean checkUserNameUnique(TtUser user);
|
||||
|
||||
+78
-113
@@ -306,7 +306,7 @@ public class TtFightResultServiceImpl extends ServiceImpl<TtFightResultMapper, T
|
||||
Map<Integer, TtFight> fightMap = fights.stream()
|
||||
.collect(Collectors.toMap(TtFight::getId, f -> f, (a, b) -> a));
|
||||
|
||||
// 2. 批量查询所有座位玩家的 vipLevel
|
||||
// 2. 批量查询座位玩家 vipLevel + 房主实时昵称(一次查询覆盖两类用户)
|
||||
List<Integer> allPlayerIds = fights.stream()
|
||||
.filter(f -> f.getSeats() != null)
|
||||
.flatMap(f -> f.getSeats().stream())
|
||||
@@ -314,30 +314,42 @@ public class TtFightResultServiceImpl extends ServiceImpl<TtFightResultMapper, T
|
||||
.filter(Objects::nonNull)
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
Map<Integer, Integer> vipMap = new HashMap<>();
|
||||
if (!allPlayerIds.isEmpty()) {
|
||||
List<Integer> allUserIds = new ArrayList<>(allPlayerIds);
|
||||
fights.stream().map(TtFight::getUserId).filter(Objects::nonNull).forEach(allUserIds::add);
|
||||
allUserIds = allUserIds.stream().distinct().collect(Collectors.toList());
|
||||
Map<Integer, TtUser> userMap = new HashMap<>();
|
||||
if (!allUserIds.isEmpty()) {
|
||||
List<TtUser> users = new LambdaQueryChainWrapper<>(ttUserMapper)
|
||||
.in(TtUser::getUserId, allPlayerIds)
|
||||
.select(TtUser::getUserId, TtUser::getVipLevel)
|
||||
.in(TtUser::getUserId, allUserIds)
|
||||
.select(TtUser::getUserId, TtUser::getVipLevel, TtUser::getNickName)
|
||||
.list();
|
||||
vipMap = users.stream()
|
||||
.collect(Collectors.toMap(TtUser::getUserId,
|
||||
u -> u.getVipLevel() != null && u.getVipLevel() > 0 ? u.getVipLevel() - 1 : 0, (a, b) -> a));
|
||||
userMap = users.stream().filter(Objects::nonNull)
|
||||
.collect(Collectors.toMap(TtUser::getUserId, u -> u, (a, b) -> a));
|
||||
}
|
||||
for (TtFight fight : fights) {
|
||||
if (fight.getSeats() != null) {
|
||||
for (FightSeat seat : fight.getSeats()) {
|
||||
if (seat.getPlayerId() != null) {
|
||||
seat.setVipLevel(vipMap.getOrDefault(seat.getPlayerId(), 0));
|
||||
TtUser user = userMap.get(seat.getPlayerId());
|
||||
Integer vipLevel = user != null ? user.getVipLevel() : null;
|
||||
seat.setVipLevel(vipLevel != null && vipLevel > 0 ? vipLevel - 1 : 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
// 用户存在时用实时昵称覆盖;用户被物理删除时保留入库的 ownerNickName
|
||||
TtUser owner = userMap.get(fight.getUserId());
|
||||
if (owner != null && owner.getNickName() != null) {
|
||||
fight.setOwnerNickName(owner.getNickName());
|
||||
}
|
||||
}
|
||||
|
||||
// 3. 批量查询所有 TtBoxRecords(按 fight_id 分组,只取本场玩家的记录)
|
||||
// 3. 批量查询所有 TtBoxRecords(按 fight_id 分组,只取本场玩家的记录;只查算金额需要的列)
|
||||
LambdaQueryWrapper<TtBoxRecords> boxRecordsQuery = new LambdaQueryWrapper<>();
|
||||
boxRecordsQuery.in(TtBoxRecords::getFightId, fightIds)
|
||||
.in(TtBoxRecords::getUserId, allPlayerIds);
|
||||
.in(TtBoxRecords::getUserId, allPlayerIds)
|
||||
.select(TtBoxRecords::getFightId, TtBoxRecords::getUserId, TtBoxRecords::getHolderUserId,
|
||||
TtBoxRecords::getOrnamentId, TtBoxRecords::getOrnamentsPrice,
|
||||
TtBoxRecords::getFightRoundNumber, TtBoxRecords::getCreateTime);
|
||||
List<TtBoxRecords> allBoxRecords = boxRecordsService.list(boxRecordsQuery);
|
||||
|
||||
// 过滤旧数据:回合数不超过对战实际总回合数 + 时间过滤
|
||||
@@ -377,25 +389,7 @@ public class TtFightResultServiceImpl extends ServiceImpl<TtFightResultMapper, T
|
||||
.collect(Collectors.toMap(TtBox::getBoxId, b -> b.getBoxName() != null ? b.getBoxName() : "", (a, b) -> a));
|
||||
}
|
||||
|
||||
// 5. 批量查询所有饰品 exteriorName
|
||||
List<Long> allOrnamentIds = allBoxRecords.stream()
|
||||
.filter(r -> r.getOrnamentId() != null)
|
||||
.map(TtBoxRecords::getOrnamentId)
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
Map<Long, String> exteriorNameMap = new HashMap<>();
|
||||
if (!allOrnamentIds.isEmpty()) {
|
||||
List<TtOrnament> ornaments = new LambdaQueryChainWrapper<>(ttOrnamentMapper)
|
||||
.in(TtOrnament::getId, allOrnamentIds)
|
||||
.select(TtOrnament::getId, TtOrnament::getExteriorName)
|
||||
.list();
|
||||
exteriorNameMap = ornaments.stream()
|
||||
.collect(Collectors.toMap(TtOrnament::getId,
|
||||
o -> normalizeExterior(o.getExteriorName()),
|
||||
(a, b) -> a));
|
||||
}
|
||||
|
||||
// 6. 逐个构建 FightResultVO
|
||||
// 5. 逐个构建结果(只算金额,不组装开箱明细列表)
|
||||
List<FightResultVO> result = new ArrayList<>();
|
||||
for (Integer fightId : fightIds) {
|
||||
TtFight fight = fightMap.get(fightId);
|
||||
@@ -420,46 +414,23 @@ public class TtFightResultServiceImpl extends ServiceImpl<TtFightResultMapper, T
|
||||
}
|
||||
}
|
||||
|
||||
// 构建 fightBoxVOList
|
||||
// 箱图只用 boxImg01(boxImg02 客户端零读取);价格/箱名回填到 boxData,客户端按 boxId 取用
|
||||
Map<String, FightBoxVO> boxData = fight.getBoxData();
|
||||
ArrayList<FightBoxVO> fightBoxVOList = new ArrayList<>();
|
||||
if (boxData != null) {
|
||||
final Map<Integer, BigDecimal> finalBoxPriceMap = boxPriceMap;
|
||||
final Map<Integer, String> finalBoxNameMap = batchBoxNameMap;
|
||||
boxData.keySet().stream()
|
||||
.sorted(Comparator.comparingInt(Integer::parseInt))
|
||||
.forEach(boxId -> {
|
||||
Object value = boxData.get(boxId);
|
||||
if (value instanceof LinkedHashMap) {
|
||||
Map<String, Object> map = (LinkedHashMap) value;
|
||||
FightBoxVO vo = new FightBoxVO(
|
||||
map.get("boxId") != null ? Integer.valueOf(map.get("boxId").toString()) : null,
|
||||
map.get("number") != null ? Integer.valueOf(map.get("number").toString()) : null,
|
||||
map.get("boxImg01") != null ? map.get("boxImg01").toString() : null,
|
||||
map.get("boxImg02") != null ? map.get("boxImg02").toString() : null);
|
||||
vo.setPrice(finalBoxPriceMap.getOrDefault(vo.getBoxId(), BigDecimal.ZERO));
|
||||
vo.setBoxName(finalBoxNameMap.getOrDefault(vo.getBoxId(), ""));
|
||||
fightBoxVOList.add(vo);
|
||||
} else {
|
||||
FightBoxVO vo = boxData.get(boxId);
|
||||
vo.setPrice(finalBoxPriceMap.getOrDefault(vo.getBoxId(), BigDecimal.ZERO));
|
||||
vo.setBoxName(finalBoxNameMap.getOrDefault(vo.getBoxId(), ""));
|
||||
fightBoxVOList.add(vo);
|
||||
}
|
||||
});
|
||||
for (Map.Entry<String, FightBoxVO> entry : boxData.entrySet()) {
|
||||
FightBoxVO box = resolveFightBoxVO(entry.getValue());
|
||||
if (box == null) {
|
||||
continue;
|
||||
}
|
||||
box.setPrice(boxPriceMap.getOrDefault(box.getBoxId(), BigDecimal.ZERO));
|
||||
box.setBoxName(batchBoxNameMap.getOrDefault(box.getBoxId(), ""));
|
||||
box.setBoxImg02(null);
|
||||
entry.setValue(box);
|
||||
}
|
||||
}
|
||||
|
||||
// 分离正常回合结果和赛后奖励
|
||||
List<TtBoxRecords> roundResults = fightBoxRecords.stream()
|
||||
.filter(r -> r.getFightRoundNumber() != null && r.getFightRoundNumber() > 0)
|
||||
.collect(Collectors.toList());
|
||||
List<TtBoxRecords> endGameRecords = fightBoxRecords.stream()
|
||||
.filter(r -> r.getFightRoundNumber() == null || r.getFightRoundNumber() <= 0)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// 胜利方获得的回合饰品(排除赛后奖励)
|
||||
// 胜利方:DB winner_ids 为空时,从 Redis 对战状态快照兜底(单场处理,异常不影响批量流程)
|
||||
List<Integer> winnerIds = fight.getWinnerIds() != null ? fight.getWinnerIds() : new ArrayList<>();
|
||||
// 数据库 winner_ids 为空时,从 Redis 对战状态快照兜底(单个 fight 处理,异常不影响批量流程)
|
||||
if (winnerIds.isEmpty()) {
|
||||
try {
|
||||
FightState state = redisCache.getCacheObject("fight_state:" + fightId);
|
||||
@@ -471,63 +442,57 @@ public class TtFightResultServiceImpl extends ServiceImpl<TtFightResultMapper, T
|
||||
log.warn("对战{} 从Redis获取winnerIds兜底失败: {}", fightId, e.getMessage());
|
||||
}
|
||||
}
|
||||
final List<Integer> finalWinnerIds = winnerIds;
|
||||
List<TtBoxRecords> winnerPrize = roundResults.stream()
|
||||
.filter(r -> r.getHolderUserId() != null && finalWinnerIds.contains(r.getHolderUserId()))
|
||||
.filter(r -> r.getOrnamentId() != null)
|
||||
.collect(Collectors.toList());
|
||||
// 平分奖:赛后奖励中持有人为赢家的记录,计入赢家所得
|
||||
winnerPrize.addAll(endGameRecords.stream()
|
||||
.filter(r -> r.getHolderUserId() != null && finalWinnerIds.contains(r.getHolderUserId()))
|
||||
.filter(r -> r.getOrnamentId() != null)
|
||||
.collect(Collectors.toList()));
|
||||
|
||||
// 失败方安慰奖
|
||||
List<TtBoxRecords> endGamePrize = endGameRecords.stream()
|
||||
.filter(r -> r.getHolderUserId() != null && !finalWinnerIds.contains(r.getHolderUserId()))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// 填充 exteriorName
|
||||
List<TtBoxRecords> allPrizeRecords = new ArrayList<>();
|
||||
allPrizeRecords.addAll(winnerPrize);
|
||||
allPrizeRecords.addAll(endGamePrize);
|
||||
final Map<Long, String> finalExteriorNameMap = exteriorNameMap;
|
||||
allPrizeRecords.forEach(r -> {
|
||||
if (r.getOrnamentId() != null) {
|
||||
r.setExteriorName(finalExteriorNameMap.getOrDefault(r.getOrnamentId(), "崭新出厂"));
|
||||
// 明细列表(fightResult/winnerPrize/endGamePrize)不组装,直接把口径累加成金额:
|
||||
// 赢家所得 = 持有人为赢家的全部记录(回合饰品 + 赛后平分奖),只算真实饰品(ornamentId 非空);
|
||||
// 失败方安慰奖 = 赛后记录(回合数<=0)中持有人非赢家的部分。
|
||||
BigDecimal winnerTotalPrice = BigDecimal.ZERO;
|
||||
BigDecimal loserTotalPrice = BigDecimal.ZERO;
|
||||
BigDecimal totalOrnamentsPrice = BigDecimal.ZERO;
|
||||
for (TtBoxRecords record : fightBoxRecords) {
|
||||
BigDecimal price = record.getOrnamentsPrice();
|
||||
if (price == null) {
|
||||
continue;
|
||||
}
|
||||
});
|
||||
totalOrnamentsPrice = totalOrnamentsPrice.add(price);
|
||||
Integer holderUserId = record.getHolderUserId();
|
||||
if (holderUserId == null) {
|
||||
continue;
|
||||
}
|
||||
if (winnerIds.contains(holderUserId)) {
|
||||
if (record.getOrnamentId() != null) {
|
||||
winnerTotalPrice = winnerTotalPrice.add(price);
|
||||
}
|
||||
} else if (record.getFightRoundNumber() == null || record.getFightRoundNumber() <= 0) {
|
||||
loserTotalPrice = loserTotalPrice.add(price);
|
||||
}
|
||||
}
|
||||
|
||||
// 获得的饰品按价格降序,空价格放最后
|
||||
roundResults.sort(ORNAMENT_PRICE_DESC);
|
||||
winnerPrize.sort(ORNAMENT_PRICE_DESC);
|
||||
endGamePrize.sort(ORNAMENT_PRICE_DESC);
|
||||
|
||||
// 计算金额
|
||||
BigDecimal winnerTotalPrice = winnerPrize.stream()
|
||||
.map(r -> r.getOrnamentsPrice() != null ? r.getOrnamentsPrice() : BigDecimal.ZERO)
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
BigDecimal loserTotalPrice = endGamePrize.stream()
|
||||
.map(r -> r.getOrnamentsPrice() != null ? r.getOrnamentsPrice() : BigDecimal.ZERO)
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
BigDecimal totalOrnamentsPrice = fightBoxRecords.stream()
|
||||
.filter(r -> r.getOrnamentsPrice() != null)
|
||||
.map(TtBoxRecords::getOrnamentsPrice)
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
|
||||
FightResultVO resultVO = FightResultVO.builder()
|
||||
result.add(FightResultVO.builder()
|
||||
.fight(fight)
|
||||
.winnerIds(winnerIds)
|
||||
.fightResult(roundResults)
|
||||
.winnerPrize(winnerPrize)
|
||||
.endGamePrize(endGamePrize)
|
||||
.winnerTotalPrice(winnerTotalPrice)
|
||||
.loserTotalPrice(loserTotalPrice)
|
||||
.totalOrnamentsPrice(totalOrnamentsPrice)
|
||||
.fightBoxVOList(fightBoxVOList)
|
||||
.build();
|
||||
result.add(resultVO);
|
||||
.build());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* boxData 反序列化后可能是 FightBoxVO,也可能是原始 Map(历史脏数据),统一取成 FightBoxVO。
|
||||
*/
|
||||
private FightBoxVO resolveFightBoxVO(Object value) {
|
||||
if (value == null) return null;
|
||||
if (value instanceof FightBoxVO) return (FightBoxVO) value;
|
||||
if (value instanceof LinkedHashMap) {
|
||||
Map<String, Object> map = (LinkedHashMap) value;
|
||||
return new FightBoxVO(
|
||||
map.get("boxId") != null ? Integer.valueOf(map.get("boxId").toString()) : null,
|
||||
map.get("number") != null ? Integer.valueOf(map.get("number").toString()) : null,
|
||||
map.get("boxImg01") != null ? map.get("boxImg01").toString() : null,
|
||||
map.get("boxImg02") != null ? map.get("boxImg02").toString() : null);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
+21
-15
@@ -473,11 +473,6 @@ public class TtUserServiceImpl extends ServiceImpl<TtUserMapper, TtUser> impleme
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TtUser> getAccountList(Integer num) {
|
||||
return getAccountList(num, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public List<TtUser> getAccountList(Integer num, List<String> customPhoneNumbers) {
|
||||
@@ -490,8 +485,8 @@ public class TtUserServiceImpl extends ServiceImpl<TtUserMapper, TtUser> impleme
|
||||
.list();
|
||||
List<TtUser> userList = new ArrayList<>();
|
||||
for (int i = 0; i < num; i++) {
|
||||
// 优先使用第 i 个自定义手机号,为空则随机生成
|
||||
String phoneNumber = getCustomPhoneOrRandom(customPhoneNumbers, i);
|
||||
// 招商账号必须逐个指定手机号,不随机生成
|
||||
String phoneNumber = getRequiredPhone(customPhoneNumbers, i, "招商账号");
|
||||
String nickName = RandomUtils.getRandomName(new Random().nextInt(2));
|
||||
String password = generateMixedPassword(10);
|
||||
String invitationCode = getInvitationCode();
|
||||
@@ -523,7 +518,7 @@ public class TtUserServiceImpl extends ServiceImpl<TtUserMapper, TtUser> impleme
|
||||
}
|
||||
|
||||
/**
|
||||
* 取第 index 个自定义手机号;为空或越界时返回随机生成的手机号
|
||||
* 取第 index 个自定义手机号;为空或越界时返回随机生成的手机号(仅白号使用)
|
||||
*/
|
||||
private String getCustomPhoneOrRandom(List<String> customPhoneNumbers, int index) {
|
||||
if (customPhoneNumbers != null && index < customPhoneNumbers.size()
|
||||
@@ -533,6 +528,22 @@ public class TtUserServiceImpl extends ServiceImpl<TtUserMapper, TtUser> impleme
|
||||
return getRandomPhoneNumber();
|
||||
}
|
||||
|
||||
/**
|
||||
* 取第 index 个手机号(必填)。招商/卡商账号是推广后台的登录账号,
|
||||
* 登录只认「手机号 + 短信验证码」,随机号收不到码就等于发一个登不进去的号,所以不兜底随机生成。
|
||||
*/
|
||||
private String getRequiredPhone(List<String> customPhoneNumbers, int index, String label) {
|
||||
String phone = customPhoneNumbers != null && index < customPhoneNumbers.size()
|
||||
? StringUtils.trim(customPhoneNumbers.get(index)) : null;
|
||||
if (StringUtils.isBlank(phone)) {
|
||||
throw new ServiceException("请填写第 " + (index + 1) + " 个" + label + "的手机号");
|
||||
}
|
||||
if (!phone.matches("^1[3-9]\\d{9}$")) {
|
||||
throw new ServiceException("第 " + (index + 1) + " 个手机号格式不正确,请输入 11 位有效手机号");
|
||||
}
|
||||
return phone;
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验自定义手机号:批次内不可重复,且不可与库中已存在(用户名/手机号)冲突。
|
||||
* 忽略 del_flag,连软删除记录也拦截,避免直接 insert 触发唯一键冲突。
|
||||
@@ -722,11 +733,6 @@ public class TtUserServiceImpl extends ServiceImpl<TtUserMapper, TtUser> impleme
|
||||
return userList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TtUser> getCardMerchantList(Integer num) {
|
||||
return getCardMerchantList(num, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public List<TtUser> getCardMerchantList(Integer num, List<String> customPhoneNumbers) {
|
||||
@@ -739,8 +745,8 @@ public class TtUserServiceImpl extends ServiceImpl<TtUserMapper, TtUser> impleme
|
||||
.list();
|
||||
List<TtUser> userList = new ArrayList<>();
|
||||
for (int i = 0; i < num; i++) {
|
||||
// 优先使用第 i 个自定义手机号,为空则随机生成
|
||||
String phoneNumber = getCustomPhoneOrRandom(customPhoneNumbers, i);
|
||||
// 卡商账号必须逐个指定手机号,不随机生成
|
||||
String phoneNumber = getRequiredPhone(customPhoneNumbers, i, "卡商账号");
|
||||
String nickName = RandomUtils.getRandomName(new Random().nextInt(2));
|
||||
String password = generateMixedPassword(10);
|
||||
String invitationCode = getInvitationCode();
|
||||
|
||||
Reference in New Issue
Block a user