提交修改

This commit is contained in:
quyixiao 2025-11-22 14:11:28 +08:00
parent 23a48721f4
commit 5ddbd84421
12 changed files with 180 additions and 49 deletions

View File

@ -43,6 +43,7 @@ public interface VvPromoterBuyerDao extends BaseMapper<VvPromoterBuyerEntity> {
@OrderBy(VvPromoterBuyerEntity.id_)
List<VvPromoterBuyerEntity> selectBuyerByCondition(IPage page,
@IF String promoterId,
@IF Long promoterBuyerId,
@ -57,4 +58,45 @@ public interface VvPromoterBuyerDao extends BaseMapper<VvPromoterBuyerEntity> {
List<VvPromoterBuyerEntity> selectVvPromoterBuyerByPromoterId(Long promoterId);
@OrderBy(VvPromoterBuyerEntity.id_)
List<VvPromoterBuyerEntity> selectAppByCondition(IPage page,
Long wasBuyerId,
@IF @Column(VvPromoterBuyerEntity.create_timestamp) Long minCreateTimestamp,
@IF @Column(VvPromoterBuyerEntity.create_timestamp) Long maxCreateTimestamp,
@OrderBy @IF @Column(VvPromoterBuyerEntity.create_timestamp) String createTimestampSort
);
}

View File

@ -1,12 +1,12 @@
package com.heyu.api.data.dao.vv;
/**
* <p>
* 推广者获得奖品名细 服务类
* </p>
*
* @author quyixiao
* @since 2025-11-21
*/
* <p>
* 推广者获得奖品名细 服务类
* </p>
*
* @author quyixiao
* @since 2025-11-21
*/
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
@ -22,16 +22,16 @@ import java.util.List;
public interface VvPromoterTradeOrderAwardDao extends BaseMapper<VvPromoterTradeOrderAwardEntity> {
VvPromoterTradeOrderAwardEntity selectVvPromoterTradeOrderAwardById(@Param("id")Long id);
VvPromoterTradeOrderAwardEntity selectVvPromoterTradeOrderAwardById(@Param("id") Long id);
Long insertVvPromoterTradeOrderAward(VvPromoterTradeOrderAwardEntity vvPromoterTradeOrderAward);
Long insertVvPromoterTradeOrderAward(VvPromoterTradeOrderAwardEntity vvPromoterTradeOrderAward);
Long insertOrUpdateVvPromoterTradeOrderAward(VvPromoterTradeOrderAwardEntity vvPromoterTradeOrderAward);
Long insertOrUpdateVvPromoterTradeOrderAward(VvPromoterTradeOrderAwardEntity vvPromoterTradeOrderAward);
int updateVvPromoterTradeOrderAwardById(VvPromoterTradeOrderAwardEntity vvPromoterTradeOrderAward);
int updateVvPromoterTradeOrderAwardById(VvPromoterTradeOrderAwardEntity vvPromoterTradeOrderAward);
int updateCoverVvPromoterTradeOrderAwardById(VvPromoterTradeOrderAwardEntity vvPromoterTradeOrderAward);
@ -60,6 +60,18 @@ public interface VvPromoterTradeOrderAwardDao extends BaseMapper<VvPromoterTrade
List<VvPromoterTradeOrderAwardEntity> selectVvPromoterTradeOrderAwardByPromoterId(Long promoterId);
List<VvPromoterTradeOrderAwardEntity> selectVvPromoterTradeOrderAwardByPromoterId(@IN List<Long> promoterId);
}
@OrderBy(VvPromoterTradeOrderAwardEntity.id_)
List<VvPromoterTradeOrderAwardEntity> selectAppByCondition(IPage page,
Long wasBuyerId,
@IF String status,
@IF @GE @Column(VvBuyerEntity.create_timestamp) Long minCreateTimestamp,
@IF @LE @Column(VvBuyerEntity.create_timestamp) Long maxCreateTimestamp,
@IF @Column(VvBuyerEntity.create_timestamp) String createTimestampSort
);
}

View File

@ -10,7 +10,7 @@ import java.util.Date;import java.util.Date;
/**
*推广者
* @author quyixiao
* @since 2025-11-21
* @since 2025-11-22
*/
@Data
@ -47,7 +47,7 @@ private static final long serialVersionUID = 1L;
//时间毫秒值
private Long createTimestamp;
//推广者id唯一值
private String promoterId;
private Long promoterId;
//推广者买家名称
private String promoterBuyerName;
//推广者买家微信
@ -143,14 +143,14 @@ private static final long serialVersionUID = 1L;
* 推广者id唯一值
* @return
*/
public String getPromoterId() {
public Long getPromoterId() {
return promoterId;
}
/**
* 推广者id唯一值
* @param promoterId
*/
public void setPromoterId(String promoterId) {
public void setPromoterId(Long promoterId) {
this.promoterId = promoterId;
}

View File

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

View File

@ -0,0 +1,46 @@
package com.heyu.api.alibaba.request.mm;
import com.heyu.api.data.service.impl.AppBaseRequest;
import lombok.Data;
@Data
public class AppPromoterTradeOrderRequest extends AppBaseRequest {
//推广者id唯一值
private String promoterId;
//订单id
private Long tradeOrderId;
//create 创建, canceled 取消 , arrive到账 ,
// create("create", "创建"),
//
// canceled("canceled", "取消"),
//
// arrive("arrive", "到账"),
//
// apply_draw("apply_draw", "买家申请提现"),
//
// seller_agree_draw("seller_agree_draw", "卖家同意提现"),
//
// seller_reject_draw("seller_reject_draw", "卖家拒绝提现"),
//
// draw_success("draw_success", "提现成功"),
//
// draw_failed("draw_failed", "提现失败"),
// create 创建, canceled 取消 , arrive到账, apply_draw:买家申请提现,seller_agree_draw: 卖家同意提现,seller_reject_draw:卖家拒绝提现,draw_success:提现成功,draw_failed:提现失败
private String status;
//创建时间撮
private Long minCreateTimestamp;
// 创建时间最小值
private Long maxCreateTimestamp;
/***
* 按创建时间排序, ASC DESC
*/
private String createTimestampSort;
}

View File

@ -12,7 +12,7 @@ public class AppActivityRequest extends AppBaseRequest {
/***
* 推广者id
*/
private String promoterId ;
private Long promoterId ;
}

View File

@ -5,7 +5,7 @@ import com.heyu.api.data.service.impl.AppBaseRequest;
import lombok.Data;
@Data
public class AppPromoterRequest extends AppBaseRequest {
public class AppPromoterBuyerRequest extends AppBaseRequest {
//创建时间撮

View File

@ -63,17 +63,18 @@ public class AdminPromoterBuyerController {
List<VvPromoterBuyerEntity> vvPromoterBuyerEntities = pageUtils.getRows();
List<String> promoterIdList = SanUtils.getFieldList(vvPromoterBuyerEntities, VvPromoterBuyerEntity::getPromoterId);
List<Long> promoterIdList = SanUtils.getFieldList(vvPromoterBuyerEntities, VvPromoterBuyerEntity::getPromoterId);
List<VvPromoterEntity> vvPromoterEntities = vvPromoterDao.selectVvPromoterByIdList(promoterIdList);
List<VvPromoterEntity> vvPromoterEntities = vvPromoterDao.selectVvPromoterByIdList(SanUtils.baseTypeConvert(promoterIdList, Long.class));
Map<Long, VvPromoterEntity> vvPromoterEntityMap = SanUtils.groupByFiled2Map(vvPromoterEntities, VvPromoterEntity::getId);
List<VvPromoterBuyerDTO > vvPromoterBuyerDTOList = new ArrayList<>();
for (VvPromoterBuyerEntity vvPromoterBuyerEntity : vvPromoterBuyerEntities) {
VvPromoterBuyerDTO vvPromoterBuyerDTO = new VvPromoterBuyerDTO();
vvPromoterBuyerDTO.setVvPromoterEntity(vvPromoterEntityMap.get(vvPromoterBuyerEntity.getPromoterId()));
}
pageUtils.setRows(vvPromoterBuyerDTOList);
return R.ok().setData(pageUtils);
}

View File

@ -22,6 +22,7 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@ -75,6 +76,7 @@ public class AdminPromoterTradeOrderController {
Map<Long, List<VvPromoterTradeOrderLineAwardEntity>> promoterTradeOrderLineAwardMap =
SanUtils.groupByFiled2MapList(promoterTradeOrderLineAwardList, VvPromoterTradeOrderLineAwardEntity::getPromoterId);
List<PromoterTradeOrderAwardDTO> promoterTradeOrderAwardDTOList = new ArrayList<>();
for (VvPromoterTradeOrderAwardEntity vvPromoterTradeOrderAwardEntity : vvPromoterTradeOrderAwardEntities) {
PromoterTradeOrderAwardDTO promoterTradeOrderAwardDTO = new PromoterTradeOrderAwardDTO();
BeanUtils.copyProperties(vvPromoterTradeOrderAwardEntity, promoterTradeOrderAwardDTO);
@ -83,8 +85,10 @@ public class AdminPromoterTradeOrderController {
promoterTradeOrderAwardDTO.setVvPromoterTradeOrderLineAwardEntityList(
promoterTradeOrderLineAwardMap.get(vvPromoterTradeOrderAwardEntity.getPromoterId()));
promoterTradeOrderAwardDTOList.add(promoterTradeOrderAwardDTO);
}
pageUtils.setRows(promoterTradeOrderAwardDTOList);
return R.ok().setData(pageUtils);
}

View File

@ -64,7 +64,8 @@ public class AppActivityController {
@Describe("访问推广链接")
@RequestMapping("/register")
public R register(@RequestBody AppActivityRequest request) {
VvPromoterEntity vvPromoterEntity = vvPromoterDao.selectVvPromoterById(Long.parseLong(request.getPromoterId()));
VvPromoterEntity vvPromoterEntity = vvPromoterDao.selectVvPromoterById(request.getPromoterId());
if (vvPromoterEntity == null) {
return R.error("推广信息不存在");
}

View File

@ -3,13 +3,15 @@ package com.heyu.api.controller.vv;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.heyu.api.alibaba.request.vv.AppPromoterRequest;
import com.heyu.api.alibaba.request.vv.AppPromoterBuyerRequest;
import com.heyu.api.common.annotation.AppLogin;
import com.heyu.api.common.annotation.Describe;
import com.heyu.api.data.dao.vv.VvPromoterBuyerDao;
import com.heyu.api.data.utils.R;
import com.heyu.api.utils.ISelect;
import com.heyu.api.utils.PPageUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@ -18,13 +20,12 @@ import java.util.List;
@Slf4j
@RestController
@RequestMapping("/app/promoter")
@RequestMapping("/app/promoter/buyer")
@AppLogin
public class AppPromoterBuyerController {
//@Autowired
//private VvPromoterDao vvPromoterDao;
@Autowired
private VvPromoterBuyerDao vvPromoterBuyerDao;
/***
* 列表
@ -32,18 +33,17 @@ public class AppPromoterBuyerController {
*/
@Describe("我推荐的好友")
@RequestMapping("/list")
public R list(@RequestBody AppPromoterRequest request) {
public R list(@RequestBody AppPromoterBuyerRequest request) {
PPageUtils pageUtils = PPageUtils.startPage(request.getPageNum(), request.getPageSize())
.doSelect(new ISelect() {
@Override
public List doSelect(IPage page) {
// return vvPromoterDao.selectAppByCondition(page,
// request.getBuyerId(),
// request.getMinCreateTimestamp(),
// request.getMaxCreateTimestamp(),
// request.getCreateTimestampSort()
// );
return null;
return vvPromoterBuyerDao.selectAppByCondition(page,
request.getBuyerId(),
request.getMinCreateTimestamp(),
request.getMaxCreateTimestamp(),
request.getCreateTimestampSort()
);
}
});
return R.ok().setData(pageUtils);

View File

@ -2,17 +2,25 @@ package com.heyu.api.controller.vv;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.heyu.api.alibaba.request.mm.VvPromoterTradeOrderLineRequest;
import com.heyu.api.alibaba.request.mm.AppPromoterTradeOrderRequest;
import com.heyu.api.alibaba.request.mm.order.PromoterTradeOrderAwardDTO;
import com.heyu.api.common.annotation.AppLogin;
import com.heyu.api.common.annotation.Describe;
import com.heyu.api.data.dao.vv.VvPromoterTradeOrderAwardDao;
import com.heyu.api.data.entity.vv.VvPromoterTradeOrderAwardEntity;
import com.heyu.api.data.kuaidi100.ActionDTO;
import com.heyu.api.data.service.impl.AbstractDrawAction;
import com.heyu.api.data.utils.R;
import com.heyu.api.utils.ISelect;
import com.heyu.api.utils.PPageUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.List;
@Slf4j
@ -21,7 +29,8 @@ import java.util.List;
@AppLogin
public class AppPromoterTradeOrderAwardController {
@Autowired
private VvPromoterTradeOrderAwardDao vvPromoterTradeOrderAwardDao;
/***
@ -30,21 +39,37 @@ public class AppPromoterTradeOrderAwardController {
*/
@Describe("我的奖励列表")
@RequestMapping("/list")
public R list(@RequestBody VvPromoterTradeOrderLineRequest vvPromoterRequest) {
PPageUtils pageUtils = PPageUtils.startPage(vvPromoterRequest.getPageNum(), vvPromoterRequest.getPageSize())
public R list(@RequestBody AppPromoterTradeOrderRequest request) {
PPageUtils pageUtils = PPageUtils.startPage(request.getPageNum(), request.getPageSize())
.doSelect(new ISelect() {
@Override
public List doSelect(IPage page) {
// return vvPromoterAwardLineDao.selectByAppCondition(page,
// vvPromoterRequest.getPromoterBuyerId(),
// vvPromoterRequest.getMinCreateTimestamp(),
// vvPromoterRequest.getMaxCreateTimestamp(),
// vvPromoterRequest.getCreateTimestampSort()
// );
return null;
return vvPromoterTradeOrderAwardDao.selectAppByCondition(page,
request.getBuyerId(),
request.getStatus(),
request.getMinCreateTimestamp(),
request.getMaxCreateTimestamp(),
request.getCreateTimestampSort()
);
}
});
List<VvPromoterTradeOrderAwardEntity> vvPromoterTradeOrderAwardEntities = pageUtils.getRows();
List<PromoterTradeOrderAwardDTO> promoterTradeOrderAwardDTOList = new ArrayList<>();
for (VvPromoterTradeOrderAwardEntity vvPromoterTradeOrderAwardEntity : vvPromoterTradeOrderAwardEntities) {
PromoterTradeOrderAwardDTO promoterTradeOrderAwardDTO = new PromoterTradeOrderAwardDTO();
BeanUtils.copyProperties(vvPromoterTradeOrderAwardEntity, promoterTradeOrderAwardDTO);
List<ActionDTO> actionDTOS = AbstractDrawAction.getDrawActionDTO(vvPromoterTradeOrderAwardEntity, true);
promoterTradeOrderAwardDTO.setActionDTOList(actionDTOS);
promoterTradeOrderAwardDTOList.add(promoterTradeOrderAwardDTO);
}
pageUtils.setRows(promoterTradeOrderAwardDTOList);
return R.ok().setData(pageUtils);
}