TASK: 1.affiliate 新增referral新增、查询、修改以及其他相关的自动结算佣金的功能;2.删除affiliate_income表及相关mapper
This commit is contained in:
@@ -1,14 +0,0 @@
|
||||
package com.ai.da.mapper.primary;
|
||||
|
||||
import com.ai.da.mapper.primary.entity.AffiliateIncome;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface AffiliateIncomeMapper extends BaseMapper<AffiliateIncome> {
|
||||
|
||||
List<Map<String, Object>> getPersonalMonthlyIncome(Long affiliateAccountId, int year);
|
||||
|
||||
List<Map<String, Object>> getMonthlyAffiliateIncome(int year, int month);
|
||||
}
|
||||
@@ -12,7 +12,7 @@ public interface AffiliateMapper extends BaseMapper<Affiliate> {
|
||||
Map<String, Long> getMonthlyApprovedAffiliate(int year, int month);
|
||||
|
||||
List<AffiliateVO> getAffiliateList(String status, String startTime, String endTime,
|
||||
String order, Long affiliateId, int size, int offset);
|
||||
String order, Long affiliateId, String sortField, int size, int offset);
|
||||
|
||||
int queryAffiliateTotalCount(String status, String startTime, String endTime, Long affiliateId);
|
||||
|
||||
|
||||
32
src/main/java/com/ai/da/mapper/primary/ReferralMapper.java
Normal file
32
src/main/java/com/ai/da/mapper/primary/ReferralMapper.java
Normal file
@@ -0,0 +1,32 @@
|
||||
package com.ai.da.mapper.primary;
|
||||
|
||||
import com.ai.da.mapper.primary.entity.Referral;
|
||||
import com.ai.da.model.vo.ReferralPageQueryVO;
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface ReferralMapper extends BaseMapper<Referral> {
|
||||
// 使用自定义SQL进行分页查询
|
||||
IPage<ReferralPageQueryVO> selectReferralWithAffiliate(Page<ReferralPageQueryVO> page, @Param("ew") Wrapper<ReferralPageQueryVO> wrapper);
|
||||
|
||||
void batchDeleteByIds(List<Long> ids);
|
||||
|
||||
BigDecimal sumAmount(
|
||||
Long affiliateId,
|
||||
List<String> statusList, // 改为 List 类型
|
||||
LocalDateTime startTime, // 开始时间(可选)
|
||||
LocalDateTime endTime // 结束时间(可选)
|
||||
);
|
||||
|
||||
List<Map<String, Object>> getPersonalMonthlyIncome(Long affiliateAccountId, int year);
|
||||
|
||||
List<Map<String, Object>> getMonthlyAffiliateIncome(int year, int month);
|
||||
}
|
||||
@@ -22,7 +22,8 @@ public class Affiliate extends BaseEntity{
|
||||
|
||||
private Float unpaidEarnings = 0.00F;
|
||||
|
||||
private Integer visits = 0;
|
||||
// 邀请链接的访问人数,每分钟从redis同步到数据库
|
||||
private Long visits = 0L;
|
||||
|
||||
private Boolean approved = false;
|
||||
|
||||
|
||||
39
src/main/java/com/ai/da/mapper/primary/entity/Referral.java
Normal file
39
src/main/java/com/ai/da/mapper/primary/entity/Referral.java
Normal file
@@ -0,0 +1,39 @@
|
||||
package com.ai.da.mapper.primary.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
@TableName("t_referral")
|
||||
public class Referral extends BaseEntity{
|
||||
|
||||
// 佣金
|
||||
private BigDecimal commission;
|
||||
|
||||
private Long affiliateId;
|
||||
|
||||
// affiliate的accountId
|
||||
private Long affiliateAccountId;
|
||||
|
||||
// 产生当前订单的受邀者accountId
|
||||
private Long inviteeAccountId;
|
||||
|
||||
// 当前订单的总金额(订阅金额)
|
||||
private BigDecimal amount;
|
||||
|
||||
// 产生该笔佣金时的佣金百分比
|
||||
private Float commissionPercent;
|
||||
|
||||
// 产生该笔佣金的订单(payment_info id)
|
||||
private Long paymentInfoId;
|
||||
|
||||
// 状态 Pending || Accept || Rejected || Paid || Unpaid
|
||||
private String status;
|
||||
|
||||
private Integer isDeleted = 0;
|
||||
|
||||
private LocalDateTime paymentTime;
|
||||
}
|
||||
Reference in New Issue
Block a user