This commit is contained in:
2025-10-27 18:40:32 +08:00
parent 58f9622656
commit 4d6cac0e1f
8 changed files with 88 additions and 59 deletions

View File

@@ -93,10 +93,6 @@ public class MkDistributionConfig implements Serializable {
@Column(onInsertValue = "now()", onUpdateValue = "now()")
private LocalDateTime updateTime;
/**
* 主店id
*/
private Long mainShopId;
private Long shopId;
}

View File

@@ -111,6 +111,10 @@ public class MkDistributionUser implements Serializable {
/**
* 是否删除 0 未删除 1 已删除
*/
private boolean isDel;
private Integer isDel;
/**
* 邀请码
*/
private String inviteCode;
}

View File

@@ -37,7 +37,7 @@ public interface MkDistributionUserService extends IService<MkDistributionUser>
/**
* 分销员中心-配置信息
*/
Map<String, Object> centerConfig(Long userId);
Map<String, Object> centerConfig(Long userId, Long shopId);
/**
* 获取分销员分页列表
@@ -84,11 +84,12 @@ public interface MkDistributionUserService extends IService<MkDistributionUser>
/**
* 发放分销奖励
*
* @param sourceId 来源id
* @param orderNo 订单编号
* @param amount 金额
* @param userId 用户id
* @param shopId 店铺id
* @param orderNo 订单编号
* @param amount 金额
* @param userId 用户id
* @param shopId 店铺id
*/
void distribute(Long sourceId, String orderNo, BigDecimal amount, Long userId, Long shopId, String type);

View File

@@ -0,0 +1,38 @@
package com.czg.utils;
import cn.hutool.core.lang.id.NanoId;
/**
* @author ww
* @description
*/
public class CzgRandomUtils {
private static final char[] DEFAULT_ALPHABET =
"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".toCharArray();
/**
* 默认长度
*/
public static final int DEFAULT_SIZE = 12;
/**
* 随机生成指定长度的字符串
*
* @return 随机字符串
*/
public static String randomString() {
return NanoId.randomNanoId(null, DEFAULT_ALPHABET, DEFAULT_SIZE);
}
/**
* 随机生成指定长度的字符串
*
* @param length 字符串长度
* @return 随机字符串
*/
public static String randomString(int length) {
return NanoId.randomNanoId(null, DEFAULT_ALPHABET, length);
}
}