提交修改

This commit is contained in:
quyixiao 2025-10-25 15:11:30 +08:00
parent 2d2b6fa51a
commit 37ead7237a
11 changed files with 353 additions and 134 deletions

View File

@ -8,13 +8,14 @@ package com.heyu.api.data.dao.vv;
* @since 2025-08-23
*/
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.heyu.api.data.entity.vv.VvBuyerEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lz.mybatis.plugin.annotations.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.math.BigDecimal;
import java.util.List;
@Mapper
@ -44,8 +45,14 @@ public interface VvBuyerDao extends BaseMapper<VvBuyerEntity> {
@IF @LIKE String buyerName,
@IF @LIKE String buyerPhone,
@IF @LIKE String buyerWeixin,
@IF @GE Long minCreateTimestamp,
@IF @LE Long maxCreateTimestamp,
@IF @GE @Column(VvBuyerEntity.create_timestamp) Long minCreateTimestamp,
@IF @LE @Column(VvBuyerEntity.create_timestamp) Long maxCreateTimestamp,
@IF Integer isTest,
@IF String promoterId,
@IF Integer scanCode,
@IF Integer scanCodeAwardCount,
@IF @GE @Column(VvBuyerEntity.promoter_sum_amount) BigDecimal minPromoterSumAmount,
@IF @LE @Column(VvBuyerEntity.promoter_sum_amount) BigDecimal maxPromoterSumAmount,
@OrderBy @IF @Column(VvBuyerEntity.create_timestamp) String createTimestampSort);

View File

@ -9,8 +9,13 @@ package com.heyu.api.data.dao.vv;
*/
import com.heyu.api.data.entity.vv.VvPromoterEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lz.mybatis.plugin.annotations.IFNullReturnEmpty;
import com.lz.mybatis.plugin.annotations.IN;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface VvPromoterDao extends BaseMapper<VvPromoterEntity> {
@ -33,4 +38,8 @@ public interface VvPromoterDao extends BaseMapper<VvPromoterEntity> {
int deleteVvPromoterById(@Param("id")Long id);
List<VvPromoterEntity> selectVvPromoterByPromoteIds(@IFNullReturnEmpty @IN List<String> promoterId);
}

View File

@ -21,24 +21,26 @@ private static final long serialVersionUID = 1L;
public final static String CLASS_NAME ="com.heyu.api.data.entity.vv.VvBuyerEntity:";
public final static String all = CLASS_NAME + "*";
public final static String id_ = CLASS_NAME + "id"; //
public final static String is_delete = CLASS_NAME + "is_delete"; // 是否删除0 1 删除
public final static String create_time = CLASS_NAME + "create_time"; // 创建时间
public final static String modify_time = CLASS_NAME + "modify_time"; // 修改时间
public final static String buyer_name = CLASS_NAME + "buyer_name"; // 买家名称
public final static String buyer_weixin = CLASS_NAME + "buyer_weixin"; // 买家微信
public final static String buyer_phone = CLASS_NAME + "buyer_phone"; // 买家手机号
public final static String create_timestamp = CLASS_NAME + "create_timestamp"; // 买家创建时间
public final static String modify_timestamp = CLASS_NAME + "modify_timestamp"; // 买家修改时间
public final static String is_test = CLASS_NAME + "is_test"; // 是否是测试账号
public final static String promoter_id = CLASS_NAME + "promoter_id"; // 推荐者id
public final static String scan_code = CLASS_NAME + "scan_code"; // 是否是扫码关注
public final static String scan_code_award_count = CLASS_NAME + "scan_code_award_count"; // 是否已经领取
public final static String sum_amount = CLASS_NAME + "sum_amount"; // 总金额
public final static String draw_cash_amount = CLASS_NAME + "draw_cash_amount"; // 提现金额
public final static String account_mount = CLASS_NAME + "account_mount"; // 账户余额
public final static String not_arrive_account = CLASS_NAME + "not_arrive_account"; // 未到账金额
public final static String canceled_account = CLASS_NAME + "canceled_account"; // 取消金额
public final static String id_ = CLASS_NAME + "id"; //
public final static String is_delete = CLASS_NAME + "is_delete"; // 是否删除0 1 删除
public final static String create_time = CLASS_NAME + "create_time"; // 创建时间
public final static String modify_time = CLASS_NAME + "modify_time"; // 修改时间
public final static String buyer_name = CLASS_NAME + "buyer_name"; // 买家名称
public final static String buyer_weixin = CLASS_NAME + "buyer_weixin"; // 买家微信
public final static String buyer_phone = CLASS_NAME + "buyer_phone"; // 买家手机号
public final static String create_timestamp = CLASS_NAME + "create_timestamp"; // 买家创建时间
public final static String modify_timestamp = CLASS_NAME + "modify_timestamp"; // 买家修改时间
public final static String is_test = CLASS_NAME + "is_test"; // 是否是测试账号
public final static String promoter_id = CLASS_NAME + "promoter_id"; // 推荐者id
public final static String scan_code = CLASS_NAME + "scan_code"; // 是否是扫码关注的用户
public final static String scan_code_award_count = CLASS_NAME + "scan_code_award_count"; // 是否已经领取是否已经领取新人福利1 已领取0 未领取
public final static String promoter_sum_amount = CLASS_NAME + "promoter_sum_amount"; // 总金额
public final static String promoter_draw_cash_amount = CLASS_NAME + "promoter_draw_cash_amount"; // 提现金额
public final static String promoter_account_mount = CLASS_NAME + "promoter_account_mount"; // 账户余额
public final static String promoter_not_arrive_account = CLASS_NAME + "promoter_not_arrive_account"; // 未到账金额
public final static String promoter_canceled_account = CLASS_NAME + "promoter_canceled_account"; // 取消金额
public final static String promoter_buyer_count = CLASS_NAME + "promoter_buyer_count"; // 推荐的买家数量
public final static String avatar_ = CLASS_NAME + "avatar"; // 微信头像
//
@TableId(value = "id", type = IdType.AUTO)
private Long id;
@ -62,20 +64,24 @@ private static final long serialVersionUID = 1L;
private Integer isTest;
//推荐者id
private String promoterId;
//是否是扫码关注
//是否是扫码关注的用户
private Integer scanCode;
//是否已经领取
//是否已经领取是否已经领取新人福利1 已领取0 未领取
private Integer scanCodeAwardCount;
//总金额
private BigDecimal sumAmount;
private BigDecimal promoterSumAmount;
//提现金额
private BigDecimal drawCashAmount;
private BigDecimal promoterDrawCashAmount;
//账户余额
private BigDecimal accountMount;
private BigDecimal promoterAccountMount;
//未到账金额
private BigDecimal notArriveAccount;
private BigDecimal promoterNotArriveAccount;
//取消金额
private BigDecimal canceledAccount;
private BigDecimal promoterCanceledAccount;
//推荐的买家数量
private Integer promoterBuyerCount;
//微信头像
private String avatar;
/**
*
* @return
@ -242,14 +248,14 @@ private static final long serialVersionUID = 1L;
}
/**
* 是否是扫码关注
* 是否是扫码关注的用户
* @return
*/
public Integer getScanCode() {
return scanCode;
}
/**
* 是否是扫码关注
* 是否是扫码关注的用户
* @param scanCode
*/
public void setScanCode(Integer scanCode) {
@ -257,14 +263,14 @@ private static final long serialVersionUID = 1L;
}
/**
* 是否已经领取
* 是否已经领取是否已经领取新人福利1 已领取0 未领取
* @return
*/
public Integer getScanCodeAwardCount() {
return scanCodeAwardCount;
}
/**
* 是否已经领取
* 是否已经领取是否已经领取新人福利1 已领取0 未领取
* @param scanCodeAwardCount
*/
public void setScanCodeAwardCount(Integer scanCodeAwardCount) {
@ -275,75 +281,105 @@ private static final long serialVersionUID = 1L;
* 总金额
* @return
*/
public BigDecimal getSumAmount() {
return sumAmount;
public BigDecimal getPromoterSumAmount() {
return promoterSumAmount;
}
/**
* 总金额
* @param sumAmount
* @param promoterSumAmount
*/
public void setSumAmount(BigDecimal sumAmount) {
this.sumAmount = sumAmount;
public void setPromoterSumAmount(BigDecimal promoterSumAmount) {
this.promoterSumAmount = promoterSumAmount;
}
/**
* 提现金额
* @return
*/
public BigDecimal getDrawCashAmount() {
return drawCashAmount;
public BigDecimal getPromoterDrawCashAmount() {
return promoterDrawCashAmount;
}
/**
* 提现金额
* @param drawCashAmount
* @param promoterDrawCashAmount
*/
public void setDrawCashAmount(BigDecimal drawCashAmount) {
this.drawCashAmount = drawCashAmount;
public void setPromoterDrawCashAmount(BigDecimal promoterDrawCashAmount) {
this.promoterDrawCashAmount = promoterDrawCashAmount;
}
/**
* 账户余额
* @return
*/
public BigDecimal getAccountMount() {
return accountMount;
public BigDecimal getPromoterAccountMount() {
return promoterAccountMount;
}
/**
* 账户余额
* @param accountMount
* @param promoterAccountMount
*/
public void setAccountMount(BigDecimal accountMount) {
this.accountMount = accountMount;
public void setPromoterAccountMount(BigDecimal promoterAccountMount) {
this.promoterAccountMount = promoterAccountMount;
}
/**
* 未到账金额
* @return
*/
public BigDecimal getNotArriveAccount() {
return notArriveAccount;
public BigDecimal getPromoterNotArriveAccount() {
return promoterNotArriveAccount;
}
/**
* 未到账金额
* @param notArriveAccount
* @param promoterNotArriveAccount
*/
public void setNotArriveAccount(BigDecimal notArriveAccount) {
this.notArriveAccount = notArriveAccount;
public void setPromoterNotArriveAccount(BigDecimal promoterNotArriveAccount) {
this.promoterNotArriveAccount = promoterNotArriveAccount;
}
/**
* 取消金额
* @return
*/
public BigDecimal getCanceledAccount() {
return canceledAccount;
public BigDecimal getPromoterCanceledAccount() {
return promoterCanceledAccount;
}
/**
* 取消金额
* @param canceledAccount
* @param promoterCanceledAccount
*/
public void setCanceledAccount(BigDecimal canceledAccount) {
this.canceledAccount = canceledAccount;
public void setPromoterCanceledAccount(BigDecimal promoterCanceledAccount) {
this.promoterCanceledAccount = promoterCanceledAccount;
}
/**
* 推荐的买家数量
* @return
*/
public Integer getPromoterBuyerCount() {
return promoterBuyerCount;
}
/**
* 推荐的买家数量
* @param promoterBuyerCount
*/
public void setPromoterBuyerCount(Integer promoterBuyerCount) {
this.promoterBuyerCount = promoterBuyerCount;
}
/**
* 微信头像
* @return
*/
public String getAvatar() {
return avatar;
}
/**
* 微信头像
* @param avatar
*/
public void setAvatar(String avatar) {
this.avatar = avatar;
}
@Override
@ -362,11 +398,13 @@ private static final long serialVersionUID = 1L;
",promoterId=" + promoterId +
",scanCode=" + scanCode +
",scanCodeAwardCount=" + scanCodeAwardCount +
",sumAmount=" + sumAmount +
",drawCashAmount=" + drawCashAmount +
",accountMount=" + accountMount +
",notArriveAccount=" + notArriveAccount +
",canceledAccount=" + canceledAccount +
",promoterSumAmount=" + promoterSumAmount +
",promoterDrawCashAmount=" + promoterDrawCashAmount +
",promoterAccountMount=" + promoterAccountMount +
",promoterNotArriveAccount=" + promoterNotArriveAccount +
",promoterCanceledAccount=" + promoterCanceledAccount +
",promoterBuyerCount=" + promoterBuyerCount +
",avatar=" + avatar +
"}";
}
}

View File

@ -21,14 +21,19 @@ private static final long serialVersionUID = 1L;
public final static String CLASS_NAME ="com.heyu.api.data.entity.vv.VvPromoterEntity:";
public final static String all = CLASS_NAME + "*";
public final static String id_ = CLASS_NAME + "id"; //
public final static String is_delete = CLASS_NAME + "is_delete"; // 是否删除0 1 删除
public final static String create_time = CLASS_NAME + "create_time"; // 创建时间
public final static String modify_time = CLASS_NAME + "modify_time"; // 修改时间
public final static String promoter_id = CLASS_NAME + "promoter_id"; // 推广者id唯一值
public final static String buyer_name = CLASS_NAME + "buyer_name"; // 买家名称
public final static String buyer_weixin = CLASS_NAME + "buyer_weixin"; // 买家微信
public final static String buyer_phone = CLASS_NAME + "buyer_phone"; // 买家微信
public final static String id_ = CLASS_NAME + "id"; //
public final static String is_delete = CLASS_NAME + "is_delete"; // 是否删除0 1 删除
public final static String create_time = CLASS_NAME + "create_time"; // 创建时间
public final static String modify_time = CLASS_NAME + "modify_time"; // 修改时间
public final static String promoter_id = CLASS_NAME + "promoter_id"; // 推广者id唯一值
public final static String promoter_buyer_name = CLASS_NAME + "promoter_buyer_name"; // 买家名称
public final static String promoter_buyer_weixin = CLASS_NAME + "promoter_buyer_weixin"; // 买家微信
public final static String promoter_buyer_phone = CLASS_NAME + "promoter_buyer_phone"; // 买家微信
public final static String promoter_buyer_id = CLASS_NAME + "promoter_buyer_id"; // 买家id
public final static String was_buyer_name = CLASS_NAME + "was_buyer_name"; // 被推荐买家名称
public final static String was_buyer_weixin = CLASS_NAME + "was_buyer_weixin"; // 被推荐买家微信
public final static String was_buyer_phone = CLASS_NAME + "was_buyer_phone"; // 被推荐者手机号
public final static String was_promoter_buyer_id = CLASS_NAME + "was_promoter_buyer_id"; // 被推荐者买家id
//
@TableId(value = "id", type = IdType.AUTO)
private Long id;
@ -41,11 +46,21 @@ private static final long serialVersionUID = 1L;
//推广者id唯一值
private String promoterId;
//买家名称
private String buyerName;
private String promoterBuyerName;
//买家微信
private String buyerWeixin;
private String promoterBuyerWeixin;
//买家微信
private String buyerPhone;
private String promoterBuyerPhone;
//买家id
private Long promoterBuyerId;
//被推荐买家名称
private String wasBuyerName;
//被推荐买家微信
private String wasBuyerWeixin;
//被推荐者手机号
private String wasBuyerPhone;
//被推荐者买家id
private Long wasPromoterBuyerId;
/**
*
* @return
@ -125,45 +140,120 @@ private static final long serialVersionUID = 1L;
* 买家名称
* @return
*/
public String getBuyerName() {
return buyerName;
public String getPromoterBuyerName() {
return promoterBuyerName;
}
/**
* 买家名称
* @param buyerName
* @param promoterBuyerName
*/
public void setBuyerName(String buyerName) {
this.buyerName = buyerName;
public void setPromoterBuyerName(String promoterBuyerName) {
this.promoterBuyerName = promoterBuyerName;
}
/**
* 买家微信
* @return
*/
public String getBuyerWeixin() {
return buyerWeixin;
public String getPromoterBuyerWeixin() {
return promoterBuyerWeixin;
}
/**
* 买家微信
* @param buyerWeixin
* @param promoterBuyerWeixin
*/
public void setBuyerWeixin(String buyerWeixin) {
this.buyerWeixin = buyerWeixin;
public void setPromoterBuyerWeixin(String promoterBuyerWeixin) {
this.promoterBuyerWeixin = promoterBuyerWeixin;
}
/**
* 买家微信
* @return
*/
public String getBuyerPhone() {
return buyerPhone;
public String getPromoterBuyerPhone() {
return promoterBuyerPhone;
}
/**
* 买家微信
* @param buyerPhone
* @param promoterBuyerPhone
*/
public void setBuyerPhone(String buyerPhone) {
this.buyerPhone = buyerPhone;
public void setPromoterBuyerPhone(String promoterBuyerPhone) {
this.promoterBuyerPhone = promoterBuyerPhone;
}
/**
* 买家id
* @return
*/
public Long getPromoterBuyerId() {
return promoterBuyerId;
}
/**
* 买家id
* @param promoterBuyerId
*/
public void setPromoterBuyerId(Long promoterBuyerId) {
this.promoterBuyerId = promoterBuyerId;
}
/**
* 被推荐买家名称
* @return
*/
public String getWasBuyerName() {
return wasBuyerName;
}
/**
* 被推荐买家名称
* @param wasBuyerName
*/
public void setWasBuyerName(String wasBuyerName) {
this.wasBuyerName = wasBuyerName;
}
/**
* 被推荐买家微信
* @return
*/
public String getWasBuyerWeixin() {
return wasBuyerWeixin;
}
/**
* 被推荐买家微信
* @param wasBuyerWeixin
*/
public void setWasBuyerWeixin(String wasBuyerWeixin) {
this.wasBuyerWeixin = wasBuyerWeixin;
}
/**
* 被推荐者手机号
* @return
*/
public String getWasBuyerPhone() {
return wasBuyerPhone;
}
/**
* 被推荐者手机号
* @param wasBuyerPhone
*/
public void setWasBuyerPhone(String wasBuyerPhone) {
this.wasBuyerPhone = wasBuyerPhone;
}
/**
* 被推荐者买家id
* @return
*/
public Long getWasPromoterBuyerId() {
return wasPromoterBuyerId;
}
/**
* 被推荐者买家id
* @param wasPromoterBuyerId
*/
public void setWasPromoterBuyerId(Long wasPromoterBuyerId) {
this.wasPromoterBuyerId = wasPromoterBuyerId;
}
@Override
@ -174,9 +264,14 @@ private static final long serialVersionUID = 1L;
",createTime=" + createTime +
",modifyTime=" + modifyTime +
",promoterId=" + promoterId +
",buyerName=" + buyerName +
",buyerWeixin=" + buyerWeixin +
",buyerPhone=" + buyerPhone +
",promoterBuyerName=" + promoterBuyerName +
",promoterBuyerWeixin=" + promoterBuyerWeixin +
",promoterBuyerPhone=" + promoterBuyerPhone +
",promoterBuyerId=" + promoterBuyerId +
",wasBuyerName=" + wasBuyerName +
",wasBuyerWeixin=" + wasBuyerWeixin +
",wasBuyerPhone=" + wasBuyerPhone +
",wasPromoterBuyerId=" + wasPromoterBuyerId +
"}";
}
}

View File

@ -1,12 +1,12 @@
package com.heyu.api.data.entity.vv;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import com.lz.mybatis.plugin.annotations.AS;
import java.math.BigDecimal;
import java.util.Date;import java.util.Date;
import java.util.Date;
/**
*购物车
* @author quyixiao
@ -69,7 +69,7 @@ private static final long serialVersionUID = 1L;
//退货数量
private Integer refundCount;
//买家id
private Integer buyerId;
private Long buyerId;
//创建时间撮
private Long createTimestamp;
//修改时间撮
@ -263,14 +263,14 @@ private static final long serialVersionUID = 1L;
* 买家id
* @return
*/
public Integer getBuyerId() {
public Long getBuyerId() {
return buyerId;
}
/**
* 买家id
* @param buyerId
*/
public void setBuyerId(Integer buyerId) {
public void setBuyerId(Long buyerId) {
this.buyerId = buyerId;
}

View File

@ -97,6 +97,9 @@ public class SanUtils {
}
public static <T, R, V> Map<R, List<V>> list2GroupBy(List<V> values, LBiFunction0<T, R> function) {
if(CollectionUtils.isEmpty(values)){
return new HashMap<>();
}
Map<R, List<V>> listmap = new HashMap<>();
Method method = getMethod(function);
try {

View File

@ -48,7 +48,7 @@ public class MysqlMain_update {
}
List<TablesBean> list = new ArrayList<TablesBean>();
list.add(new TablesBean("vv_buyer"));
list.add(new TablesBean("vv_promoter"));
Map<String, String> map = MysqlUtil2ShowCreateTable.getComments();

View File

@ -0,0 +1,14 @@
package com.heyu.api.alibaba.request.mm;
import lombok.Data;
@Data
public class VVAdminBaseRequest {
private Integer pageNum = 1 ;
private Integer pageSize = 10 ;
}

View File

@ -3,19 +3,15 @@ package com.heyu.api.alibaba.request.mm;
import lombok.Data;
import java.math.BigDecimal;
@Data
public class VvBuyerRequest {
private Integer pageNum = 1 ;
private Integer pageSize = 10 ;
public class VvBuyerRequest extends VVAdminBaseRequest {
//创建时间撮
private Long minCreateTimestamp;
private Long maxCreateTimestamp;
private Long maxCreateTimestamp;
//买家名称
private String buyerName;
@ -23,10 +19,27 @@ public class VvBuyerRequest {
private String buyerWeixin;
//买家手机号
private String buyerPhone;
/***
* 按创建时间排序, ASC DESC
*/
private String createTimestampSort;
/***
* 是否是测试卖家
*/
private Integer isTest;
//推荐者id
private String promoterId;
//是否是扫码关注的用户
private Integer scanCode;
//是否已经领取是否已经领取新人福利1 已领取0 未领取
private Integer scanCodeAwardCount;
//推荐总金额最小值
private BigDecimal minPromoterSumAmount;
//推荐总金额最大值
private BigDecimal maxPromoterSumAmount;
}

View File

@ -2,6 +2,7 @@ package com.heyu.api.alibaba.request.mm.order;
import com.heyu.api.data.entity.vv.VvBuyerAddressEntity;
import com.heyu.api.data.entity.vv.VvBuyerEntity;
import com.heyu.api.data.entity.vv.VvPromoterEntity;
import lombok.Data;
import java.util.List;
@ -10,6 +11,14 @@ import java.util.List;
public class VvBuyerDTO extends VvBuyerEntity {
/***
* 地址信息
*/
private List<VvBuyerAddressEntity> vvBuyerAddressEntityList;
/***
* 推荐者信息
*/
private List<VvPromoterEntity> vvPromoterList;
}

View File

@ -6,9 +6,13 @@ import com.heyu.api.alibaba.request.mm.VvBuyerRequest;
import com.heyu.api.alibaba.request.mm.order.VvBuyerDTO;
import com.heyu.api.data.dao.vv.VvBuyerAddressDao;
import com.heyu.api.data.dao.vv.VvBuyerDao;
import com.heyu.api.data.dao.vv.VvPromoterDao;
import com.heyu.api.data.entity.vv.VvBuyerAddressEntity;
import com.heyu.api.data.entity.vv.VvBuyerEntity;
import com.heyu.api.data.entity.vv.VvPromoterEntity;
import com.heyu.api.data.utils.R;
import com.heyu.api.data.utils.SanUtils;
import com.heyu.api.data.utils.StringUtils;
import com.heyu.api.utils.ISelect;
import com.heyu.api.utils.PPageUtils;
import lombok.extern.slf4j.Slf4j;
@ -19,7 +23,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -35,14 +38,13 @@ public class AdminBuyerController {
@Autowired
private VvBuyerAddressDao vvBuyerAddressDao;
@Autowired
private VvPromoterDao vvPromoterDao;
/***
* 列表
* http://localhost:8888/mm/buyer/list
*
*
*
*
*
*/
@RequestMapping("/list")
public R list(@RequestBody VvBuyerRequest vvProductRequest) {
@ -56,6 +58,12 @@ public class AdminBuyerController {
vvProductRequest.getBuyerWeixin(),
vvProductRequest.getMinCreateTimestamp(),
vvProductRequest.getMaxCreateTimestamp(),
vvProductRequest.getIsTest(),
vvProductRequest.getPromoterId(),
vvProductRequest.getScanCode(),
vvProductRequest.getScanCodeAwardCount(),
vvProductRequest.getMinPromoterSumAmount(),
vvProductRequest.getMaxPromoterSumAmount(),
vvProductRequest.getCreateTimestampSort()
);
}
@ -65,44 +73,67 @@ public class AdminBuyerController {
List<Long> buyerIds = new ArrayList<>();
List<String> promoterIds = new ArrayList<>();
for (VvBuyerEntity buyerEntity : vvBuyerEntities) {
buyerIds.add(buyerEntity.getId());
if (StringUtils.isNotEmpty(buyerEntity.getPromoterId())) {
promoterIds.add(buyerEntity.getPromoterId());
}
}
List<VvBuyerAddressEntity> vvBuyerAddressEntities = vvBuyerAddressDao.selectMapByBuyerIds(buyerIds);
Map<Long, List<VvBuyerAddressEntity>> listMap = SanUtils.list2GroupBy(vvBuyerAddressEntities, VvBuyerAddressEntity::getBuyerId);
Map<Long, List<VvBuyerAddressEntity>> listMap = new HashMap<>();
for (VvBuyerAddressEntity vvBuyerAddressEntity : vvBuyerAddressEntities) {
List<VvBuyerAddressEntity> vvBuyerAddressEntityList = listMap.get(vvBuyerAddressEntity.getBuyerId());
if (vvBuyerAddressEntityList == null) {
vvBuyerAddressEntityList = new ArrayList<>();
}
vvBuyerAddressEntityList.add(vvBuyerAddressEntity);
listMap.put(vvBuyerAddressEntity.getBuyerId(), vvBuyerAddressEntityList);
}
List<VvPromoterEntity> vvPromoterEntities = vvPromoterDao.selectVvPromoterByPromoteIds(promoterIds);
Map<String, List<VvPromoterEntity>> vvPromoterGroupBy = SanUtils.list2GroupBy(vvPromoterEntities, VvPromoterEntity::getPromoterId);
List<VvBuyerDTO> buyerDTOs = new ArrayList<>();
for (VvBuyerEntity vvBuyerAddressEntity : vvBuyerEntities) {
VvBuyerDTO vvBuyerDTO = new VvBuyerDTO();
BeanUtils.copyProperties(vvBuyerAddressEntity, vvBuyerDTO);
vvBuyerDTO.setVvBuyerAddressEntityList(listMap.get(vvBuyerDTO.getId()));
// 获取买家推荐者信息
if (StringUtils.isNotEmpty(vvBuyerDTO.getPromoterId())) {
vvBuyerDTO.setVvPromoterList(vvPromoterGroupBy.get(vvBuyerDTO.getPromoterId()));
}
buyerDTOs.add(vvBuyerDTO);
}
pageUtils.setRows(buyerDTOs);
return R.ok().setData(pageUtils);
}
}