提交新功能 分销商 积分 会员体系
This commit is contained in:
40
yshop-module-mall/yshop-module-distributor-api/pom.xml
Normal file
40
yshop-module-mall/yshop-module-distributor-api/pom.xml
Normal file
@ -0,0 +1,40 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>co.yixiang.boot</groupId>
|
||||
<artifactId>yshop-module-mall</artifactId>
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>yshop-module-distributor-api</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>${project.artifactId}</name>
|
||||
<description>
|
||||
分销商 API 模块
|
||||
</description>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>co.yixiang.boot</groupId>
|
||||
<artifactId>yshop-common</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 参数校验 -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-validation</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.swagger.core.v3</groupId>
|
||||
<artifactId>swagger-annotations</artifactId>
|
||||
<version>2.2.8</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
@ -0,0 +1,15 @@
|
||||
package co.yixiang.yshop.module.distributor.api;
|
||||
|
||||
import co.yixiang.yshop.module.distributor.api.dto.DistributorOrderDTO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface DistributorOrderApi {
|
||||
|
||||
void createDistributorOrder(DistributorOrderDTO distributorOrderDTO);
|
||||
|
||||
void cancelDistributorOrder(List<Long> ids);
|
||||
|
||||
void updateDistributorOrder(DistributorOrderDTO distributorOrderDTO);
|
||||
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package co.yixiang.yshop.module.distributor.api.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@ToString(callSuper = true)
|
||||
public class DistributorOrderDTO {
|
||||
|
||||
// 订单ID
|
||||
private Long oid;
|
||||
// 订单号
|
||||
private String orderId;
|
||||
// 下单用户
|
||||
private Long userId;
|
||||
// 用户昵称
|
||||
private String userName;
|
||||
// 分销商ID
|
||||
private Long distributorId;
|
||||
// 商品
|
||||
private List<DistributorProductDTO> productDTOList;
|
||||
// 结算类型
|
||||
private Integer distributorSettlementType;
|
||||
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
package co.yixiang.yshop.module.distributor.api.dto;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
@ToString(callSuper = true)
|
||||
public class DistributorProductDTO {
|
||||
|
||||
// 商品ID
|
||||
private Long productId;
|
||||
// 商品规格ID
|
||||
private Long productAttrValueId;
|
||||
// 商品名称
|
||||
private String productName;
|
||||
// 原价
|
||||
private BigDecimal productOriginalPrice;
|
||||
// 商品金额
|
||||
private BigDecimal productPrice;
|
||||
// 订单详情id
|
||||
private Long detailId;
|
||||
// 分销规则 0-默认 1-自定义
|
||||
private Integer distributionRule;
|
||||
// 分销自购 0-关闭 1-开启
|
||||
private Integer distributionPurchase;
|
||||
// 商品结算方式 0-实际支付价格 1-商品价格
|
||||
private Integer distributionProductSettlement;
|
||||
// 佣金结算方式 0-支付后结算 1-确认收获后结算 2-订单完成结算
|
||||
private Integer distributionWagesSettlement;
|
||||
// 分销规则 1-一级 2-二级
|
||||
private Integer distributionLevel;
|
||||
// 一级佣金比例
|
||||
private Integer firstWages;
|
||||
// 二级佣金比例
|
||||
private Integer secondWages;
|
||||
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package co.yixiang.yshop.module.distributor.enums;
|
||||
|
||||
public interface DistributorConstants {
|
||||
|
||||
// 不自动通过
|
||||
String APPLY_FALSE = "0";
|
||||
|
||||
// 自动通过
|
||||
String APPLY_TRUE = "1";
|
||||
|
||||
// 无限制客户保护
|
||||
String UNLIMITED_USER_EXPIRE = "-1";
|
||||
|
||||
// 无限制年数
|
||||
Integer UNLIMITED_YEAR = 100;
|
||||
|
||||
String FALSE_STR = "0";
|
||||
|
||||
String TURE_STR = "1";
|
||||
|
||||
Integer FALSE_INTEGER = 0;
|
||||
|
||||
Integer TURE_INTEGER = 1;
|
||||
|
||||
Integer DEFAULT_LEVEL = 1;
|
||||
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package co.yixiang.yshop.module.distributor.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum DistributorLevelTypeEnum {
|
||||
|
||||
P1(1,"一级分销商"),
|
||||
P2(2,"二级分销商"),;
|
||||
|
||||
private Integer type;
|
||||
|
||||
private String name;
|
||||
|
||||
public static DistributorLevelTypeEnum toType(Integer type) {
|
||||
return Stream.of(DistributorLevelTypeEnum.values())
|
||||
.filter(p -> Objects.equals(p.type, type))
|
||||
.findAny()
|
||||
.orElse(null);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package co.yixiang.yshop.module.distributor.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum DistributorLevelUpTypeEnum {
|
||||
|
||||
ONLY(0,"任意"),
|
||||
ALL(1,"全部"),;
|
||||
|
||||
private Integer type;
|
||||
|
||||
private String name;
|
||||
|
||||
public static DistributorLevelUpTypeEnum toType(Integer type) {
|
||||
return Stream.of(DistributorLevelUpTypeEnum.values())
|
||||
.filter(p -> Objects.equals(p.type, type))
|
||||
.findAny()
|
||||
.orElse(null);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package co.yixiang.yshop.module.distributor.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum DistributorOrderStatusEnum {
|
||||
|
||||
WAIT(0,"待结算"),
|
||||
COMPLETE(1,"已结算"),
|
||||
CANCEL(2,"已取消");
|
||||
|
||||
private Integer status;
|
||||
|
||||
private String name;
|
||||
|
||||
public static DistributorOrderStatusEnum toStatus(Integer status) {
|
||||
return Stream.of(DistributorOrderStatusEnum.values())
|
||||
.filter(p -> Objects.equals(p.status, status))
|
||||
.findAny()
|
||||
.orElse(null);
|
||||
}
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package co.yixiang.yshop.module.distributor.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum DistributorProductTypeEnum {
|
||||
|
||||
NO(0,"不参加分销"),
|
||||
YES(1,"参加分销"),;
|
||||
|
||||
private Integer type;
|
||||
|
||||
private String name;
|
||||
|
||||
public static DistributorProductTypeEnum toType(Integer type) {
|
||||
return Stream.of(DistributorProductTypeEnum.values())
|
||||
.filter(p -> Objects.equals(p.type, type))
|
||||
.findAny()
|
||||
.orElse(null);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package co.yixiang.yshop.module.distributor.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum DistributorSettlementTypeEnum {
|
||||
|
||||
PAY(0,"支付后结算"),
|
||||
CONFIRM(1,"确认收获后结算"),
|
||||
COMPLETE(2,"订单完成结算");
|
||||
|
||||
private Integer type;
|
||||
|
||||
private String name;
|
||||
|
||||
public static DistributorSettlementTypeEnum toType(Integer type) {
|
||||
return Stream.of(DistributorSettlementTypeEnum.values())
|
||||
.filter(p -> Objects.equals(p.type, type))
|
||||
.findAny()
|
||||
.orElse(null);
|
||||
}
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package co.yixiang.yshop.module.distributor.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum DistributorStatusEnum {
|
||||
|
||||
NOT_APPLIED(-1,"已清退"),
|
||||
AUDIT(0,"待审核"),
|
||||
PASSED(1,"已通过"),
|
||||
REFUSED(2,"已拒绝");
|
||||
|
||||
private Integer status;
|
||||
|
||||
private String name;
|
||||
|
||||
public static DistributorStatusEnum toStatus(Integer status) {
|
||||
return Stream.of(DistributorStatusEnum.values())
|
||||
.filter(p -> Objects.equals(p.status, status))
|
||||
.findAny()
|
||||
.orElse(null);
|
||||
}
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
package co.yixiang.yshop.module.distributor.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum DistributorWagesLogTypeEnum {
|
||||
|
||||
WAIT(0,"待入账"),
|
||||
COMPLETE(1,"已入账"),
|
||||
CANCEL(2,"已取消"),
|
||||
WITHDRAW_WAIT(3,"提现中"),
|
||||
WITHDRAW_COMPLETE(4,"提现成功"),
|
||||
WITHDRAW_FAIL(5,"提现失败"),
|
||||
;
|
||||
|
||||
private Integer type;
|
||||
|
||||
private String name;
|
||||
|
||||
public static DistributorWagesLogTypeEnum toType(Integer type) {
|
||||
return Stream.of(DistributorWagesLogTypeEnum.values())
|
||||
.filter(p -> Objects.equals(p.type, type))
|
||||
.findAny()
|
||||
.orElse(null);
|
||||
}
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package co.yixiang.yshop.module.distributor.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum DistributorWithdrawalMethodTypeEnum {
|
||||
|
||||
BALANCE(0,"余额"),
|
||||
AIL_PAY(1,"支付宝"),
|
||||
;
|
||||
|
||||
private Integer type;
|
||||
|
||||
private String paymentMethod;
|
||||
|
||||
public static DistributorWithdrawalMethodTypeEnum toType(Integer type) {
|
||||
return Stream.of(DistributorWithdrawalMethodTypeEnum.values())
|
||||
.filter(p -> Objects.equals(p.type, type))
|
||||
.findAny()
|
||||
.orElse(null);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,47 @@
|
||||
package co.yixiang.yshop.module.distributor.enums;
|
||||
|
||||
import co.yixiang.yshop.framework.common.exception.ErrorCode;
|
||||
|
||||
public interface ErrorCodeConstants {
|
||||
ErrorCode DISTRIBUTOR_NOT_EXISTS = new ErrorCode(1000001, "分销商不存在");
|
||||
|
||||
ErrorCode DISTRIBUTOR_USER_EXISTS = new ErrorCode(1000002, "您已申请过成为分销商请勿重复申请");
|
||||
|
||||
ErrorCode LEVEL_NOT_EXISTS = new ErrorCode(1100001, "分销商等级不存在");
|
||||
|
||||
ErrorCode LEVEL_EXISTS = new ErrorCode(1100002, "分销商等级已存在,请从新选择");
|
||||
|
||||
ErrorCode LEVEL_SUPERIOR_NOT_EXISTS = new ErrorCode(1100003, "上一等级未设置,请从新选择");
|
||||
|
||||
ErrorCode LEVEL_USERCOUNT_ERROR = new ErrorCode(1100004, "累计金额需要大于上一等级");
|
||||
|
||||
ErrorCode LEVEL_AMOUNT_ERROR = new ErrorCode(1100005, "累计用户需要大于上一等级");
|
||||
|
||||
ErrorCode LEVEL_WAGES_ERROR = new ErrorCode(1100006, "累计佣金需要大于上一等级");
|
||||
|
||||
ErrorCode LEVEL_USERCOUNT_LESS_ERROR = new ErrorCode(1100007, "累计金额需要小于下一等级");
|
||||
|
||||
ErrorCode LEVEL_AMOUNT_LESS_ERROR = new ErrorCode(1100008, "累计用户需要小于下一等级");
|
||||
|
||||
ErrorCode LEVEL_WAGES_LESS_ERROR = new ErrorCode(1100009, "累计佣金需要小于下一等级");
|
||||
|
||||
|
||||
ErrorCode ORDER_NOT_EXISTS = new ErrorCode(80003, "分销商订单不存在");
|
||||
|
||||
ErrorCode USER_NOT_EXISTS = new ErrorCode(80004, "分销商所属用户不存在");
|
||||
|
||||
ErrorCode WAGES_NOT_EXISTS = new ErrorCode(80005, "分销商佣金不存在");
|
||||
|
||||
ErrorCode WAGES_LOG_NOT_EXISTS = new ErrorCode(80006, "分销商佣金记录不存在");
|
||||
|
||||
ErrorCode DYNAMICS_NOT_EXISTS = new ErrorCode(80007, "分销商动态不存在");
|
||||
|
||||
ErrorCode WITHDRAWAL_METHOD_NOT_EXISTS = new ErrorCode(80008, "分销商提现方式不存在");
|
||||
|
||||
ErrorCode WITHDRAWAL_METHOD_EXISTS_USER = new ErrorCode(1200001, "提现方式不属于此登录用户");
|
||||
|
||||
ErrorCode WITHDRAWAL_AMOUNT_INSUFFICIENT = new ErrorCode(1200002, "可提现余额不足");
|
||||
|
||||
ErrorCode WITHDRAWAL_ALI_NOT_EXISTS = new ErrorCode(1200003, "未绑定支付宝账号");
|
||||
}
|
||||
|
Reference in New Issue
Block a user