Compare commits

..

No commits in common. '237ef2171416b901194aab2611c759778fc57cdd' and '027e6609db7319283bd081866fbdff20af182678' have entirely different histories.

@ -93,31 +93,6 @@ public class AppBrokerageUserController {
// 统计分销用户数量(一级)
Long firstBrokerageUserCount = brokerageUserService.getBrokerageUserCountByBindUserId(brokerageUser.getId(), 1);
// 统计分销用户数量(二级)
Long secondBrokerageUserCount = brokerageUserService.getBrokerageUserCountByBindUserId(brokerageUser.getId(), null);
// 拼接返回
return success(BrokerageUserConvert.INSTANCE.convert(yesterdayPrice, withdrawPrice, firstBrokerageUserCount, secondBrokerageUserCount, brokerageUser));
}
@GetMapping("/get-zdscsummary")
@Operation(summary = "郑大商城获得个人分销统计")
@PreAuthenticated
public CommonResult<AppBrokerageUserMySummaryRespVO> getZdscBrokerageUserSummary() {
// 查询当前登录用户信息
BrokerageUserDO brokerageUser = brokerageUserService.getBrokerageUser(getLoginUserId());
// 统计用户昨日的佣金
LocalDateTime yesterday = LocalDateTime.now().minusDays(1);
LocalDateTime beginTime = LocalDateTimeUtil.beginOfDay(yesterday);
LocalDateTime endTime = LocalDateTimeUtil.endOfDay(yesterday);
Integer yesterdayPrice = brokerageRecordService.getSummaryPriceByUserId(brokerageUser.getId(),
BrokerageRecordBizTypeEnum.ORDER, BrokerageRecordStatusEnum.SETTLEMENT, beginTime, endTime);
// 统计用户提现的佣金
Integer withdrawPrice = brokerageWithdrawService.getWithdrawSummaryListByUserId(Collections.singleton(brokerageUser.getId()),
BrokerageWithdrawStatusEnum.AUDIT_SUCCESS).stream()
.findFirst().map(BrokerageWithdrawSummaryRespBO::getPrice).orElse(0);
// 统计直销用户数量(一级)
Long firstBrokerageUserCount = brokerageUserService.getBrokerageUserCountByBindUserId(brokerageUser.getId(), 1);
// 统计分销用户数量(二级)
Long secondBrokerageUserCount = brokerageUserService.getBrokerageUserCountByBindUserId(brokerageUser.getId(), 2);
// 拼接返回

@ -64,7 +64,7 @@ public interface BrokerageRecordMapper extends BaseMapperX<BrokerageRecordDO> {
.selectCount(BrokerageRecordDO::getId, UserBrokerageSummaryRespBO::getCount)
.selectSum(BrokerageRecordDO::getPrice)
.in(BrokerageRecordDO::getUserId, userIds)
.eq(BrokerageRecordDO::getBizType, bizType)
.eq(BrokerageRecordDO::getBizId, bizType)
.eq(BrokerageRecordDO::getStatus, status)
.groupBy(BrokerageRecordDO::getUserId)); // 按照 userId 聚合
return BeanUtil.copyToList(list, UserBrokerageSummaryRespBO.class);

@ -63,7 +63,7 @@ public interface BrokerageUserMapper extends BaseMapperX<BrokerageUserDO> {
Assert.isTrue(incrCount > 0);
LambdaUpdateWrapper<BrokerageUserDO> lambdaUpdateWrapper = new LambdaUpdateWrapper<BrokerageUserDO>()
.setSql(" brokerage_price = brokerage_price + " + incrCount)
.eq(BrokerageUserDO::getId, id);
.eq(BrokerageUserDO::getBindUserId, id);
update(null, lambdaUpdateWrapper);
}
@ -95,7 +95,7 @@ public interface BrokerageUserMapper extends BaseMapperX<BrokerageUserDO> {
Assert.isTrue(incrCount < 0);
LambdaUpdateWrapper<BrokerageUserDO> lambdaUpdateWrapper = new LambdaUpdateWrapper<BrokerageUserDO>()
.setSql(" brokerage_price = brokerage_price + " + incrCount) // 负数,所以使用 + 号
.eq(BrokerageUserDO::getId, id);
.eq(BrokerageUserDO::getBindUserId, id);
return update(null, lambdaUpdateWrapper);
}

@ -250,7 +250,7 @@ public class BrokerageUserServiceImpl implements BrokerageUserService {
if (CollUtil.isEmpty(userMap)) {
return PageResult.empty();
}
Integer status = BrokerageRecordStatusEnum.SETTLEMENT.getStatus();
// 2. 分页查询
IPage<AppBrokerageUserChildSummaryRespVO> pageResult = brokerageUserMapper.selectSummaryPageByUserId(
MyBatisUtils.buildPage(pageReqVO), BrokerageRecordBizTypeEnum.ORDER.getType(),
@ -340,64 +340,6 @@ if(ObjectUtil.isNotEmpty(bindUser)){
* @return
*/
private List<Long> getChildUserIdsByLevel(Long bindUserId, Integer level) {
if (bindUserId == null) {
return Collections.emptyList();
}
// 情况一level 为空,查询所有级别---郑大商城无限级别需递归查询
if (level == null) {
// 大商城无限级别需递归查询
List<Long> bindUserIds = recursionChildUserIds(new ArrayList<Long>(), bindUserId);
return bindUserIds;
}
// 先查第 1 级
List<Long> bindUserIds = brokerageUserMapper.selectIdListByBindUserIdIn(Collections.singleton(bindUserId));
if (CollUtil.isEmpty(bindUserIds)) {
return Collections.emptyList();
}
// 情况二level 为 1只查询第 1 级
if (level == 1) {
return bindUserIds;
}
// 情况三level 为 1只查询第 2 级
if (level == 2) {
return brokerageUserMapper.selectIdListByBindUserIdIn(bindUserIds);
}
throw exception(BROKERAGE_USER_LEVEL_NOT_SUPPORT);
}
/**
*
*
* @param bindUserIds
* @param bindUserId
* level 1+2
* @return
*/
private List<Long> recursionChildUserIds(List<Long> bindUserIds,Long bindUserId){
if (bindUserId == null) {
return Collections.emptyList();
}
//查询下级
List<Long> childbindUserIds = brokerageUserMapper.selectIdListByBindUserIdIn(Collections.singleton(bindUserId));
if (CollUtil.isNotEmpty(childbindUserIds)) {
bindUserIds.addAll(childbindUserIds);
for (Long userId:childbindUserIds) {
recursionChildUserIds(bindUserIds,userId);
}
}
return bindUserIds;
}
/**
* ------
*
* @param bindUserId
* @param level
* level 1+2
* @return
*/
private List<Long> getChildUserIdsByLevelCopy(Long bindUserId, Integer level) {
if (bindUserId == null) {
return Collections.emptyList();
}

@ -6,7 +6,6 @@ import cn.hutool.core.map.MapUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.number.MoneyUtils;
import cn.iocoder.yudao.module.pay.enums.wallet.PayWalletBizTypeEnum;
import cn.iocoder.yudao.module.system.api.notify.NotifyMessageSendApi;
import cn.iocoder.yudao.module.system.api.notify.dto.NotifySendSingleToUserReqDTO;
import cn.iocoder.yudao.module.trade.controller.admin.brokerage.vo.withdraw.BrokerageWithdrawPageReqVO;
@ -94,13 +93,13 @@ public class BrokerageWithdrawServiceImpl implements BrokerageWithdrawService {
}
// 4. 通知用户
// Map<String, Object> templateParams = MapUtil.<String, Object>builder()
// .put("createTime", LocalDateTimeUtil.formatNormal(withdraw.getCreateTime()))
// .put("price", MoneyUtils.fenToYuanStr(withdraw.getPrice()))
// .put("reason", withdraw.getAuditReason())
// .build();
// notifyMessageSendApi.sendSingleMessageToMember(new NotifySendSingleToUserReqDTO()
// .setUserId(withdraw.getUserId()).setTemplateCode(templateCode).setTemplateParams(templateParams));
Map<String, Object> templateParams = MapUtil.<String, Object>builder()
.put("createTime", LocalDateTimeUtil.formatNormal(withdraw.getCreateTime()))
.put("price", MoneyUtils.fenToYuanStr(withdraw.getPrice()))
.put("reason", withdraw.getAuditReason())
.build();
notifyMessageSendApi.sendSingleMessageToMember(new NotifySendSingleToUserReqDTO()
.setUserId(withdraw.getUserId()).setTemplateCode(templateCode).setTemplateParams(templateParams));
}
private BrokerageWithdrawDO validateBrokerageWithdrawExists(Integer id) {

@ -27,19 +27,14 @@ import cn.iocoder.yudao.module.trade.controller.app.order.vo.AppTradeOrderCreate
import cn.iocoder.yudao.module.trade.controller.app.order.vo.AppTradeOrderSettlementReqVO;
import cn.iocoder.yudao.module.trade.controller.app.order.vo.AppTradeOrderSettlementRespVO;
import cn.iocoder.yudao.module.trade.controller.app.order.vo.item.AppTradeOrderItemCommentCreateReqVO;
import cn.iocoder.yudao.module.trade.convert.brokerage.BrokerageRecordConvert;
import cn.iocoder.yudao.module.trade.convert.order.TradeOrderConvert;
import cn.iocoder.yudao.module.trade.dal.dataobject.brokerage.BrokerageRecordDO;
import cn.iocoder.yudao.module.trade.dal.dataobject.brokerage.BrokerageUserDO;
import cn.iocoder.yudao.module.trade.dal.dataobject.cart.CartDO;
import cn.iocoder.yudao.module.trade.dal.dataobject.delivery.DeliveryExpressDO;
import cn.iocoder.yudao.module.trade.dal.dataobject.order.TradeOrderDO;
import cn.iocoder.yudao.module.trade.dal.dataobject.order.TradeOrderItemDO;
import cn.iocoder.yudao.module.trade.dal.mysql.brokerage.BrokerageRecordMapper;
import cn.iocoder.yudao.module.trade.dal.mysql.order.TradeOrderItemMapper;
import cn.iocoder.yudao.module.trade.dal.mysql.order.TradeOrderMapper;
import cn.iocoder.yudao.module.trade.dal.redis.no.TradeNoRedisDAO;
import cn.iocoder.yudao.module.trade.enums.brokerage.BrokerageRecordBizTypeEnum;
import cn.iocoder.yudao.module.trade.enums.delivery.DeliveryTypeEnum;
import cn.iocoder.yudao.module.trade.enums.order.*;
import cn.iocoder.yudao.module.trade.framework.order.config.TradeOrderProperties;
@ -116,9 +111,6 @@ public class TradeOrderUpdateServiceImpl implements TradeOrderUpdateService {
@Resource
private BrokerageUserService brokerageUserService;
@Resource
private BrokerageRecordMapper brokerageRecordMapper;
// =================== Order ===================
@ -693,12 +685,7 @@ public class TradeOrderUpdateServiceImpl implements TradeOrderUpdateService {
@Override
@TradeOrderLog(operateType = TradeOrderOperateTypeEnum.ADMIN_PICK_UP_RECEIVE)
public void pickUpOrderByAdmin(Long id, String pickUpVerifyCode) {
boolean b = brokerageUserService.updateUserPriceByBindUserId(id, 3000);
// 3. 新增记录
BrokerageUserDO user = brokerageUserService.getBrokerageUser(id);
BrokerageRecordDO record = BrokerageRecordConvert.INSTANCE.convert(user, BrokerageRecordBizTypeEnum.ORDER, "", 0, 3000,
null, "门店核销佣金", null, null);
brokerageRecordMapper.insert(record);
boolean b = brokerageUserService.updateUserPriceByBindUserId(id, 30);
getSelf().pickUpOrder(tradeOrderMapper.selectOneByPickUpVerifyCode(pickUpVerifyCode));
}

@ -5,18 +5,22 @@
<select id="selectSummaryPageByUserId"
resultType="cn.iocoder.yudao.module.trade.controller.app.brokerage.vo.user.AppBrokerageUserChildSummaryRespVO">
select * from (SELECT bu.id, bu.bind_user_time AS brokerageTime,
SELECT bu.id, bu.bind_user_time AS brokerageTime,
(SELECT SUM(price) FROM trade_brokerage_record r
WHERE r.user_id = bu.id AND biz_type = #{bizType} AND r.status = #{status} AND r.deleted = FALSE) AS
brokeragePrice,
WHERE r.user_id = bu.id AND biz_type = #{bizType} AND r.status = #{status} AND r.deleted = FALSE) AS brokeragePrice,
(SELECT COUNT(1) FROM trade_brokerage_record r
WHERE r.user_id = bu.id AND biz_type = #{bizType} AND r.status = #{status} AND r.deleted = FALSE) AS
brokerageOrderCount,
WHERE r.user_id = bu.id AND biz_type = #{bizType} AND r.status = #{status} AND r.deleted = FALSE) AS brokerageOrderCount,
(SELECT COUNT(1) FROM trade_brokerage_user c
WHERE c.bind_user_id = bu.id AND c.deleted = FALSE) AS brokerageUserCount
FROM trade_brokerage_user AS bu
<where>
bu.deleted = false
<if test="ids != null and ids.size() > 0">
and bu.id in
<foreach collection="ids" open="(" item="id" separator="," close=")">
#{id}
</foreach>
</if>
</where>
<choose>
<when test="sortingField.field == 'userCount'">
@ -31,15 +35,7 @@
<otherwise>
ORDER BY bu.bind_user_time DESC
</otherwise>
</choose>) r
<where>
<if test="ids != null and ids.size() > 0">
and r.id in
<foreach collection="ids" open="(" item="id" separator="," close=")">
#{id}
</foreach>
</if>
</where>
</choose>
</select>
</mapper>

@ -43,11 +43,4 @@ public class DistributionLogPageReqVO extends PageParam {
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
/**
* 线
*/
@Schema(description = "出线时间")
private LocalDateTime outTime;
}

@ -64,12 +64,4 @@ public class DistributionLogRespVO {
@ExcelProperty("手机号")
private String phone;
/**
* 线
*/
@Schema(description = "出线时间")
private LocalDateTime outTime;
}

@ -2,8 +2,6 @@ package cn.iocoder.yudao.module.member.controller.admin.distributionlog.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.time.LocalDateTime;
import java.util.*;
import javax.validation.constraints.*;
@ -38,10 +36,4 @@ public class DistributionLogSaveReqVO {
@Schema(description = "推荐人会员等级id", example = "10242")
private Long levelId;
/**
* 线
*/
@Schema(description = "出线时间")
private LocalDateTime outTime;
}

@ -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;
}

@ -60,9 +60,4 @@ public class DistributionLogDO extends BaseDO {
*/
private Long levelId;
/**
* 线
*/
private LocalDateTime outTime;
}

@ -28,7 +28,7 @@ public interface DistributionLogMapper extends BaseMapperX<DistributionLogDO> {
.eqIfPresent(DistributionLogDO::getConvertStatus, reqVO.getConvertStatus())
.eqIfPresent(DistributionLogDO::getLevelId, reqVO.getLevelId())
.betweenIfPresent(DistributionLogDO::getCreateTime, reqVO.getCreateTime())
.orderByAsc(DistributionLogDO::getId));
.orderByDesc(DistributionLogDO::getId));
}
}

@ -51,12 +51,5 @@ public interface DistributionLogService {
* @return
*/
PageResult<DistributionLogDO> getDistributionLogPage(DistributionLogPageReqVO pageReqVO);
/**
*
*
* @param pageReqVO
* @return
*/
List<DistributionLogDO> getDistributionLogList(DistributionLogDO pageReqVO);
}

@ -1,7 +1,5 @@
package cn.iocoder.yudao.module.member.service.distributionlog;
import cn.hutool.core.util.ObjectUtil;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
@ -73,29 +71,4 @@ public class DistributionLogServiceImpl implements DistributionLogService {
return distributionLogMapper.selectPage(pageReqVO);
}
@Override
public List<DistributionLogDO> getDistributionLogList(DistributionLogDO pageReqVO) {
LambdaQueryWrapperX<DistributionLogDO> queryWrapperX = new LambdaQueryWrapperX<>();
if(ObjectUtil.isNotEmpty(pageReqVO.getMebId())){
queryWrapperX.eq(DistributionLogDO::getMebId,pageReqVO.getMebId());
}
if(ObjectUtil.isNotEmpty(pageReqVO.getStatus())){
queryWrapperX.eq(DistributionLogDO::getStatus,pageReqVO.getStatus());
}
if(ObjectUtil.isNotEmpty(pageReqVO.getConvertStatus())){
queryWrapperX.eq(DistributionLogDO::getConvertStatus,pageReqVO.getConvertStatus());
}
if(ObjectUtil.isNotEmpty(pageReqVO.getGameStatus())){
queryWrapperX.eq(DistributionLogDO::getGameStatus,pageReqVO.getGameStatus());
}
if(ObjectUtil.isNotEmpty(pageReqVO.getLevelId())){
queryWrapperX.eq(DistributionLogDO::getLevelId,pageReqVO.getLevelId());
}
if(ObjectUtil.isNotEmpty(pageReqVO.getReferrerId())){
queryWrapperX.eq(DistributionLogDO::getReferrerId,pageReqVO.getReferrerId());
}
queryWrapperX.orderByAsc(DistributionLogDO::getId);
return distributionLogMapper.selectList(queryWrapperX);
}
}

@ -444,9 +444,6 @@ public class MemberUserServiceImpl implements MemberUserService {
.orderByAsc(DistributionMebConfigDO::getLevelId));
//添加5占一
if(ObjectUtil.isNotEmpty(distributionMebConfigDOS)){
Long l = distributionLogMapper.selectCount(new LambdaQueryWrapperX<DistributionLogDO>().eq(DistributionLogDO::getMebId, userId)
.orderByAsc(DistributionLogDO::getCreateTime));
if(l == 0){
//添加5占一游戏
DistributionLogDO distributionLogDO = new DistributionLogDO();
distributionLogDO.setMebId(userId);
@ -454,25 +451,23 @@ public class MemberUserServiceImpl implements MemberUserService {
// distributionLogDO.setBrokerage();
distributionLogDO.setGameStatus("1");
distributionLogDO.setConvertStatus("1");
distributionLogDO.setOutTime(LocalDateTime.now());
distributionLogMapper.insert(distributionLogDO);
//查询5占一总数
List<DistributionLogDO> distributionLogDOS = distributionLogMapper.selectList(new LambdaQueryWrapperX<DistributionLogDO>()
.orderByAsc(DistributionLogDO::getCreateTime));
int i1 = distributionLogDOS.size() % 5;
if(i1 == 0){
DistributionLogDO vo = distributionLogDOS.get((distributionLogDOS.size()/5)-1);
vo.setGameStatus("0");
distributionLogMapper.updateById(vo);
// List<DistributionLogDO> distributionLogDOS1 = distributionLogDOS.subList(0, (distributionLogDOS.size() / 5));
// for (DistributionLogDO dt:distributionLogDOS1) {
// dt.setGameStatus("0");
// }
// distributionLogMapper.updateBatch(distributionLogDOS1);
// DistributionLogDO vo = distributionLogDOS.get((distributionLogDOS.size()/5)-1);
// vo.setGameStatus("0");
// distributionLogMapper.updateById(vo);
List<DistributionLogDO> distributionLogDOS1 = distributionLogDOS.subList(0, (distributionLogDOS.size() / 5));
for (DistributionLogDO dt:distributionLogDOS1) {
dt.setGameStatus("0");
}
distributionLogMapper.updateBatch(distributionLogDOS1);
// distributionLogMapper.up
}
}
}
//发放直销奖励
//查询推广员
@ -487,8 +482,6 @@ public class MemberUserServiceImpl implements MemberUserService {
if(eg.getLevelId() == memberUserDO.getLevelId()){
//添加佣金记录
BrokerageRecordDO brokerageRecordDO = new BrokerageRecordDO();
// brokerageRecordDO.setId(Math.toIntExact(brokerageUserDO.getBindUserId()));
brokerageRecordDO.setBizId(orderId+"");
brokerageRecordDO.setUserId(memberUserDO.getId());
brokerageRecordDO.setBizType(1);
brokerageRecordDO.setTitle("分销直推佣金");
@ -507,15 +500,11 @@ public class MemberUserServiceImpl implements MemberUserService {
brokerageRecordDO.setSourceUserLevel(configLevelDO.getLevel());
brokerageRecordDO.setSourceUserId(userId);
brokerageRecordMapper.insert(brokerageRecordDO);
//修改推广员佣金
BrokerageUserDO brokerageUserDO1 = brokerageUserMapper.selectById(brokerageUserDO.getBindUserId());
brokerageUserDO1.setBrokeragePrice(eg.getBrokerage()*100+brokerageUserDO1.getBrokeragePrice());
brokerageUserMapper.updateById(brokerageUserDO1);
break;
}
}
}
recursionMemberLevel(brokerageUserDO.getBindUserId(),orderId);
recursionMemberLevel(brokerageUserDO.getId(),orderId);
}
}
}
@ -525,7 +514,6 @@ public class MemberUserServiceImpl implements MemberUserService {
private void recursionMemberLevel(Long userId,Long orderId){
//查询会员信息
MemberUserDO memberUserDO = memberUserMapper.selectById(userId);
if(ObjectUtil.isNotEmpty(memberUserDO)){
DistributionStatisticsDO distributionStatisticsDO = new DistributionStatisticsDO();
distributionStatisticsDO.setLevelId(memberUserDO.getLevelId());
distributionStatisticsDO.setMebId(memberUserDO.getId());
@ -604,5 +592,4 @@ public class MemberUserServiceImpl implements MemberUserService {
}
}
}
}
}

@ -197,8 +197,8 @@ const loginData = reactive({
tenantEnable: import.meta.env.VITE_APP_TENANT_ENABLE !== 'false',
loginForm: {
tenantName: '郑大钒水',
username: 'zhengdafanshui',
password: '123456',
username: 'admin',
password: 'admin123',
captchaVerification: '',
rememberMe: false
}

Loading…
Cancel
Save