Compare commits
No commits in common. '237ef2171416b901194aab2611c759778fc57cdd' and '027e6609db7319283bd081866fbdff20af182678' have entirely different histories.
237ef21714
...
027e6609db
@ -1,103 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.member.controller.app.distributionlog;
|
|
||||||
|
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
|
||||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|
||||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
|
||||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
|
||||||
import cn.iocoder.yudao.module.member.controller.admin.distributionlog.vo.DistributionLogPageReqVO;
|
|
||||||
import cn.iocoder.yudao.module.member.controller.admin.distributionlog.vo.DistributionLogRespVO;
|
|
||||||
import cn.iocoder.yudao.module.member.controller.app.distributionlog.vo.AppDistributionLogPageReqVO;
|
|
||||||
import cn.iocoder.yudao.module.member.controller.app.distributionlog.vo.AppDistributionLogRespVO;
|
|
||||||
import cn.iocoder.yudao.module.member.controller.app.distributionlog.vo.AppDistributionLogSaveReqVO;
|
|
||||||
import cn.iocoder.yudao.module.member.convert.distributionlog.DistributionLogConvert;
|
|
||||||
import cn.iocoder.yudao.module.member.dal.dataobject.distributionlog.DistributionLogDO;
|
|
||||||
import cn.iocoder.yudao.module.member.dal.dataobject.user.MemberUserDO;
|
|
||||||
import cn.iocoder.yudao.module.member.service.distributionlog.DistributionLogService;
|
|
||||||
import cn.iocoder.yudao.module.member.service.user.MemberUserService;
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
|
||||||
import io.swagger.v3.oas.annotations.Parameter;
|
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
import javax.validation.Valid;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
|
|
||||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
|
||||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertSet;
|
|
||||||
import static cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils.getLoginUserId;
|
|
||||||
|
|
||||||
@Tag(name = "app五占一接口 - 分销记录")
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/member/distribution-log")
|
|
||||||
@Validated
|
|
||||||
public class AppDistributionLogController {
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private DistributionLogService distributionLogService;
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private MemberUserService memberUserService;
|
|
||||||
|
|
||||||
@GetMapping("/getUserId")
|
|
||||||
@Operation(summary = "获取登录用户排名")
|
|
||||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
|
||||||
public CommonResult<?> getDistributionLog() {
|
|
||||||
//获取用户id
|
|
||||||
JSONObject obj = new JSONObject();
|
|
||||||
String rankNum = "请先购买1188产品";
|
|
||||||
Integer totalNum = 0;
|
|
||||||
Long loginUserId = getLoginUserId();
|
|
||||||
DistributionLogDO distributionLogDO1 = new DistributionLogDO();
|
|
||||||
distributionLogDO1.setGameStatus("1");
|
|
||||||
//查询所有未出线用户记录
|
|
||||||
List<DistributionLogDO> list1 = distributionLogService.getDistributionLogList(distributionLogDO1);
|
|
||||||
if(ObjectUtil.isNotEmpty(list1)){
|
|
||||||
totalNum = list1.size();
|
|
||||||
}
|
|
||||||
//先查询是否购买
|
|
||||||
DistributionLogDO distributionLogDO = new DistributionLogDO();
|
|
||||||
distributionLogDO.setMebId(loginUserId);
|
|
||||||
//查询用户记录
|
|
||||||
List<DistributionLogDO> list = distributionLogService.getDistributionLogList(distributionLogDO);
|
|
||||||
if(ObjectUtil.isNotEmpty(list)){
|
|
||||||
DistributionLogDO dto = list.get(0);
|
|
||||||
if(ObjectUtil.equal(dto.getGameStatus(),"0")){
|
|
||||||
rankNum = "已出线";
|
|
||||||
}else{
|
|
||||||
if(ObjectUtil.isNotEmpty(list1)){
|
|
||||||
for (int i = 0; i<list.size(); i++) {
|
|
||||||
DistributionLogDO dto1 = list.get(i);
|
|
||||||
if(ObjectUtil.equal(dto.getMebId(),loginUserId)){
|
|
||||||
rankNum = (i+1)+"名";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
obj.put("rankNum",rankNum);
|
|
||||||
obj.put("totalNum",totalNum);
|
|
||||||
return success(obj);
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/outTodaypage")
|
|
||||||
@Operation(summary = "已出线记录")
|
|
||||||
public CommonResult<PageResult<DistributionLogRespVO>> getDistributionLogPage(@Valid DistributionLogPageReqVO pageReqVO) {
|
|
||||||
pageReqVO.setGameStatus("0");
|
|
||||||
PageResult<DistributionLogDO> pageResult = distributionLogService.getDistributionLogPage(pageReqVO);
|
|
||||||
// 拼接结果返回
|
|
||||||
List<MemberUserDO> users = memberUserService.getUserList(
|
|
||||||
convertSet(pageResult.getList(), DistributionLogDO::getMebId));
|
|
||||||
return success(DistributionLogConvert.INSTANCE.convertPage(pageResult, users));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -1,54 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.member.controller.app.distributionlog.vo;
|
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
import lombok.ToString;
|
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
|
|
||||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
|
||||||
|
|
||||||
@Schema(description = "管理后台 - 分销记录分页 Request VO")
|
|
||||||
@Data
|
|
||||||
@EqualsAndHashCode(callSuper = true)
|
|
||||||
@ToString(callSuper = true)
|
|
||||||
public class AppDistributionLogPageReqVO extends PageParam {
|
|
||||||
|
|
||||||
@Schema(description = "推荐人id", example = "5267")
|
|
||||||
private Long referrerId;
|
|
||||||
|
|
||||||
@Schema(description = "推荐人id(便于回溯)", example = "23906")
|
|
||||||
private Long oldReferrerId;
|
|
||||||
|
|
||||||
@Schema(description = "购买人id", example = "6637")
|
|
||||||
private Long mebId;
|
|
||||||
|
|
||||||
@Schema(description = "佣金")
|
|
||||||
private Integer brokerage;
|
|
||||||
|
|
||||||
@Schema(description = "分佣结算核销状态", example = "2")
|
|
||||||
private String status;
|
|
||||||
|
|
||||||
@Schema(description = "游戏状态", example = "2")
|
|
||||||
private String gameStatus;
|
|
||||||
|
|
||||||
@Schema(description = "游戏兑换状态", example = "1")
|
|
||||||
private String convertStatus;
|
|
||||||
|
|
||||||
@Schema(description = "推荐人会员等级id", example = "10242")
|
|
||||||
private Long levelId;
|
|
||||||
|
|
||||||
@Schema(description = "创建时间")
|
|
||||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
|
||||||
private LocalDateTime[] createTime;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 出线时间
|
|
||||||
*/
|
|
||||||
@Schema(description = "出线时间")
|
|
||||||
private LocalDateTime outTime;
|
|
||||||
|
|
||||||
}
|
|
@ -1,75 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.member.controller.app.distributionlog.vo;
|
|
||||||
|
|
||||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
|
||||||
import com.alibaba.excel.annotation.ExcelProperty;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
|
|
||||||
@Schema(description = "管理后台 - 分销记录 Response VO")
|
|
||||||
@Data
|
|
||||||
@ExcelIgnoreUnannotated
|
|
||||||
public class AppDistributionLogRespVO {
|
|
||||||
|
|
||||||
@Schema(description = "id主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "4693")
|
|
||||||
@ExcelProperty("id主键")
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
@Schema(description = "推荐人id", example = "5267")
|
|
||||||
@ExcelProperty("推荐人id")
|
|
||||||
private Long referrerId;
|
|
||||||
|
|
||||||
@Schema(description = "推荐人id(便于回溯)", example = "23906")
|
|
||||||
@ExcelProperty("推荐人id(便于回溯)")
|
|
||||||
private Long oldReferrerId;
|
|
||||||
|
|
||||||
@Schema(description = "购买人id", example = "6637")
|
|
||||||
@ExcelProperty("购买人id")
|
|
||||||
private Long mebId;
|
|
||||||
|
|
||||||
@Schema(description = "佣金")
|
|
||||||
@ExcelProperty("佣金")
|
|
||||||
private Integer brokerage;
|
|
||||||
|
|
||||||
@Schema(description = "分佣结算核销状态", example = "2")
|
|
||||||
@ExcelProperty("分佣结算核销状态")
|
|
||||||
private String status;
|
|
||||||
|
|
||||||
@Schema(description = "游戏状态", example = "2")
|
|
||||||
@ExcelProperty("游戏状态")
|
|
||||||
private String gameStatus;
|
|
||||||
|
|
||||||
@Schema(description = "游戏兑换状态", example = "1")
|
|
||||||
@ExcelProperty("游戏兑换状态")
|
|
||||||
private String convertStatus;
|
|
||||||
|
|
||||||
@Schema(description = "推荐人会员等级id", example = "10242")
|
|
||||||
@ExcelProperty("推荐人会员等级id")
|
|
||||||
private Long levelId;
|
|
||||||
|
|
||||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
|
||||||
@ExcelProperty("创建时间")
|
|
||||||
private LocalDateTime createTime;
|
|
||||||
|
|
||||||
@Schema(description = "用户昵称", example = "2")
|
|
||||||
@ExcelProperty("用户昵称")
|
|
||||||
private String nickname;
|
|
||||||
|
|
||||||
@Schema(description = "用户名称", example = "2")
|
|
||||||
@ExcelProperty("用户名称")
|
|
||||||
private String userName;
|
|
||||||
|
|
||||||
@Schema(description = "手机号", example = "2")
|
|
||||||
@ExcelProperty("手机号")
|
|
||||||
private String phone;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 出线时间
|
|
||||||
*/
|
|
||||||
@Schema(description = "出线时间")
|
|
||||||
@ExcelProperty("出线时间")
|
|
||||||
private LocalDateTime outTime;
|
|
||||||
|
|
||||||
}
|
|
@ -1,45 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.member.controller.app.distributionlog.vo;
|
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
|
|
||||||
@Schema(description = "管理后台 - 分销记录新增/修改 Request VO")
|
|
||||||
@Data
|
|
||||||
public class AppDistributionLogSaveReqVO {
|
|
||||||
|
|
||||||
@Schema(description = "id主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "4693")
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
@Schema(description = "推荐人id", example = "5267")
|
|
||||||
private Long referrerId;
|
|
||||||
|
|
||||||
@Schema(description = "推荐人id(便于回溯)", example = "23906")
|
|
||||||
private Long oldReferrerId;
|
|
||||||
|
|
||||||
@Schema(description = "购买人id", example = "6637")
|
|
||||||
private Long mebId;
|
|
||||||
|
|
||||||
@Schema(description = "佣金")
|
|
||||||
private Integer brokerage;
|
|
||||||
|
|
||||||
@Schema(description = "分佣结算核销状态", example = "2")
|
|
||||||
private String status;
|
|
||||||
|
|
||||||
@Schema(description = "游戏状态", example = "2")
|
|
||||||
private String gameStatus;
|
|
||||||
|
|
||||||
@Schema(description = "游戏兑换状态", example = "1")
|
|
||||||
private String convertStatus;
|
|
||||||
|
|
||||||
@Schema(description = "推荐人会员等级id", example = "10242")
|
|
||||||
private Long levelId;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 出线时间
|
|
||||||
*/
|
|
||||||
@Schema(description = "出线时间")
|
|
||||||
private LocalDateTime outTime;
|
|
||||||
}
|
|
Loading…
Reference in New Issue