分销分钱具体逻辑
This commit is contained in:
@@ -0,0 +1,103 @@
|
||||
|
||||
package com.czg.market.dto;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import lombok.experimental.Accessors;
|
||||
import java.io.Serial;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 分销记录表 实体类。
|
||||
*
|
||||
* @author ww
|
||||
* @since 2025-10-27
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
public class MkDistributionFlowDTO implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 店铺用户id
|
||||
*/
|
||||
private Long shopUserId;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 店铺id
|
||||
*/
|
||||
private Long shopId;
|
||||
|
||||
/**
|
||||
* 分销员id
|
||||
*/
|
||||
private Long distributionUserId;
|
||||
|
||||
/**
|
||||
* 等级id
|
||||
*/
|
||||
private Long levelId;
|
||||
|
||||
/**
|
||||
* 等级名称
|
||||
*/
|
||||
private String levelName;
|
||||
|
||||
/**
|
||||
* 用户名称
|
||||
*/
|
||||
private String nickname;
|
||||
|
||||
/**
|
||||
* 订单编号
|
||||
*/
|
||||
private String orderNo;
|
||||
|
||||
/**
|
||||
* 订单总金额
|
||||
*/
|
||||
private BigDecimal amount;
|
||||
|
||||
/**
|
||||
* 奖励金额
|
||||
*/
|
||||
private BigDecimal rewardAmount;
|
||||
|
||||
/**
|
||||
* order订单 recharge充值
|
||||
*/
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* pending待入账 success已入账
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
package com.czg.market.entity;
|
||||
|
||||
import com.mybatisflex.annotation.Column;
|
||||
import com.mybatisflex.annotation.Id;
|
||||
import com.mybatisflex.annotation.KeyType;
|
||||
import com.mybatisflex.annotation.Table;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 分销记录表 实体类。
|
||||
*
|
||||
* @author ww
|
||||
* @since 2025-10-27
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Table("mk_distribution_flow")
|
||||
@Accessors(chain = true)
|
||||
public class MkDistributionFlow implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Id(keyType = KeyType.Auto)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 店铺用户id
|
||||
*/
|
||||
private Long shopUserId;
|
||||
|
||||
|
||||
/**
|
||||
* 店铺id
|
||||
*/
|
||||
private Long shopId;
|
||||
|
||||
/**
|
||||
* 分销员id
|
||||
*/
|
||||
private Long distributionUserId;
|
||||
|
||||
/**
|
||||
* 等级id
|
||||
*/
|
||||
private Long levelId;
|
||||
|
||||
/**
|
||||
* 等级
|
||||
*/
|
||||
private Integer level;
|
||||
|
||||
/**
|
||||
* 用户名称
|
||||
*/
|
||||
private String nickname;
|
||||
private String sourceNickName;
|
||||
|
||||
/**
|
||||
* 订单编号
|
||||
*/
|
||||
private String orderNo;
|
||||
|
||||
private Long sourceId;
|
||||
/**
|
||||
* 订单总金额
|
||||
*/
|
||||
private BigDecimal amount;
|
||||
|
||||
/**
|
||||
* 奖励金额
|
||||
*/
|
||||
private BigDecimal rewardAmount;
|
||||
|
||||
/**
|
||||
* order订单 recharge充值
|
||||
*/
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* pending待入账 success已入账
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Column(onInsertValue = "now()")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@Column(onInsertValue = "now()", onUpdateValue = "now()")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 来源用户id
|
||||
*/
|
||||
private Long sourceShopUserId;
|
||||
|
||||
}
|
||||
@@ -16,7 +16,7 @@ import java.util.Map;
|
||||
* @since 2025-10-25
|
||||
*/
|
||||
public interface MkDistributionConfigService extends IService<MkDistributionConfig> {
|
||||
MkDistributionConfigVO detail(Long mainShopId);
|
||||
MkDistributionConfigVO detail(Long shopId);
|
||||
|
||||
Boolean edit(Long shopId, MkDistributionConfigDTO dto);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.czg.market.service;
|
||||
|
||||
import com.mybatisflex.core.service.IService;
|
||||
import com.czg.market.entity.MkDistributionFlow;
|
||||
|
||||
/**
|
||||
* 分销记录表 服务层。
|
||||
*
|
||||
* @author ww
|
||||
* @since 2025-10-27
|
||||
*/
|
||||
public interface MkDistributionFlowService extends IService<MkDistributionFlow> {
|
||||
|
||||
}
|
||||
@@ -54,6 +54,19 @@ public interface MkDistributionUserService extends IService<MkDistributionUser>
|
||||
*/
|
||||
void open(Long userId, BigDecimal amount, Long shopId, Long sourceId);
|
||||
|
||||
/**
|
||||
* 分销商户运营余额充值回调
|
||||
*/
|
||||
void rechargeCallBack(Long userId, Long shopId, BigDecimal amount, Long paymentId);
|
||||
|
||||
/**
|
||||
* 发放分销奖励
|
||||
* @param orderId 订单id
|
||||
* @param orderNo 订单编号
|
||||
* @param amount 金额
|
||||
* @param userId 用户id
|
||||
* @param shopId 店铺id
|
||||
*/
|
||||
void distribute(Long orderId, String orderNo, BigDecimal amount, Long userId, Long shopId, String type);
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user