提交修改

This commit is contained in:
quyixiao 2025-11-22 14:42:30 +08:00
parent 1667c19e99
commit ea103cacfe
13 changed files with 209 additions and 42 deletions

View File

@ -80,5 +80,24 @@ public interface VvBuyerDao extends BaseMapper<VvBuyerEntity> {
int updateVvBuyerByIdPromoterCanceledAmountPromoterNotArriveAmount(@Plus BigDecimal promoterCanceledAmount,@Sub BigDecimal promoterNotArriveAmount, Long id);
int updateVvBuyerByIdPromoterArriveAccountAmountPromoterNotArriveAmount(@Plus BigDecimal promoterArriveAccountAmount,@Sub BigDecimal promoterNotArriveAmount, Long id);
int updateVvBuyerByIdPromoterArriveAccountAmountPromoterNotArriveAmount(@Plus BigDecimal promoterArriveAccountAmount,
@Sub BigDecimal promoterNotArriveAmount, Long id);
int updateVvBuyerByIdPromoterDrawCashFailedAmountPromoterArriveAccountAmount(@Plus BigDecimal promoterDrawCashFailedAmount,
@Sub BigDecimal promoterArriveAccountAmount,
Long id);
int updateVvBuyerByIdPromoterDrawCashFailedAmountPromoterApplyDrawCashAmount(@Plus BigDecimal promoterDrawCashFailedAmount,
@Sub BigDecimal promoterApplyDrawCashAmount,
Long id);
int updateVvBuyerByIdPromoterApplyDrawCashAmountPromoterArriveAccountAmount(@Plus BigDecimal promoterApplyDrawCashAmount,
@Sub BigDecimal promoterArriveAccountAmount,
Long id);
}

View File

@ -48,6 +48,7 @@ private static final long serialVersionUID = 1L;
public final static String reject_reason = CLASS_NAME + "reject_reason"; // 拒绝原因
public final static String gmt_reject = CLASS_NAME + "gmt_reject"; // 拒绝时间
public final static String gmt_agree = CLASS_NAME + "gmt_agree"; // 同意时间
public final static String gmt_apply_draw = CLASS_NAME + "gmt_apply_draw"; // 申请提现
//
@TableId(value = "id", type = IdType.AUTO)
private Long id;
@ -103,6 +104,8 @@ private static final long serialVersionUID = 1L;
private Date gmtReject;
//同意时间
private Date gmtAgree;
//申请提现
private Date gmtApplyDraw;
/**
*
* @return
@ -508,6 +511,21 @@ private static final long serialVersionUID = 1L;
this.gmtAgree = gmtAgree;
}
/**
* 申请提现
* @return
*/
public Date getGmtApplyDraw() {
return gmtApplyDraw;
}
/**
* 申请提现
* @param gmtApplyDraw
*/
public void setGmtApplyDraw(Date gmtApplyDraw) {
this.gmtApplyDraw = gmtApplyDraw;
}
@Override
public String toString() {
return "VvPromoterTradeOrderAwardEntity{" +
@ -538,6 +556,7 @@ private static final long serialVersionUID = 1L;
",rejectReason=" + rejectReason +
",gmtReject=" + gmtReject +
",gmtAgree=" + gmtAgree +
",gmtApplyDraw=" + gmtApplyDraw +
"}";
}
}

View File

@ -50,6 +50,7 @@ private static final long serialVersionUID = 1L;
public final static String reject_reason = CLASS_NAME + "reject_reason"; // 拒绝原因
public final static String gmt_reject = CLASS_NAME + "gmt_reject"; // 拒绝时间
public final static String gmt_agree = CLASS_NAME + "gmt_agree"; // 同意时间
public final static String gmt_apply_draw = CLASS_NAME + "gmt_apply_draw"; // 申请提现
//
@TableId(value = "id", type = IdType.AUTO)
private Long id;
@ -109,6 +110,8 @@ private static final long serialVersionUID = 1L;
private Date gmtReject;
//同意时间
private Date gmtAgree;
//申请提现
private Date gmtApplyDraw;
/**
*
* @return
@ -544,6 +547,21 @@ private static final long serialVersionUID = 1L;
this.gmtAgree = gmtAgree;
}
/**
* 申请提现
* @return
*/
public Date getGmtApplyDraw() {
return gmtApplyDraw;
}
/**
* 申请提现
* @param gmtApplyDraw
*/
public void setGmtApplyDraw(Date gmtApplyDraw) {
this.gmtApplyDraw = gmtApplyDraw;
}
@Override
public String toString() {
return "VvPromoterTradeOrderLineAwardEntity{" +
@ -576,6 +594,7 @@ private static final long serialVersionUID = 1L;
",rejectReason=" + rejectReason +
",gmtReject=" + gmtReject +
",gmtAgree=" + gmtAgree +
",gmtApplyDraw=" + gmtApplyDraw +
"}";
}
}

View File

@ -71,7 +71,7 @@ public enum ActionEnums {
Admin_Seller_Reject_Comment("Admin_Seller_Reject_Comment", "卖家拒绝评论", "/mm/comment/reject",
OrderStatusEnums.delivered.getStatus()),
App_Buyer_Apply_Draw("App_Buyer_Apply_Draw", "买家申请提现", "/app/apply/draw",
App_Buyer_Apply_Draw("App_Buyer_Apply_Draw", "买家申请提现", "/app/draw/apply",
OrderStatusEnums.delivered.getStatus()),
Admin_Seller_Agree_Draw("Admin_Seller_Agree_Draw", "卖家同意提现", "/mm/draw/agree",

View File

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

View File

@ -0,0 +1,21 @@
package com.heyu.api.alibaba.request.mm;
import com.heyu.api.data.service.impl.AppBaseRequest;
import lombok.Data;
import java.util.List;
@Data
public class AppPromoterTradeOrderDrawRequest extends AppBaseRequest {
/***
* 推广
*/
private List<Long> promoterTradeOrderIdList;
}

View File

@ -7,11 +7,6 @@ import lombok.Data;
@Data
public class AppPromoterTradeOrderRequest extends AppBaseRequest {
//推广者id唯一值
private String promoterId;
//订单id
private Long tradeOrderId;
//create 创建, canceled 取消 , arrive到账 ,
// create("create", "创建"),

View File

@ -9,7 +9,9 @@ import com.heyu.api.data.dao.vv.VvPromoterTradeOrderAwardDao;
import com.heyu.api.data.dao.vv.VvPromoterTradeOrderLineAwardDao;
import com.heyu.api.data.entity.vv.VvPromoterTradeOrderAwardEntity;
import com.heyu.api.data.entity.vv.VvPromoterTradeOrderLineAwardEntity;
import com.heyu.api.data.enums.ActionEnums;
import com.heyu.api.data.enums.AwardStatusEnums;
import com.heyu.api.data.service.impl.AbstractDrawAction;
import com.heyu.api.data.utils.R;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
@ -42,35 +44,26 @@ public class AdminDrawController {
@Describe("同意提现")
@RequestMapping("/agree")
public R agree(@RequestBody VvAdminAgreeDrawRequest request) {
List<VvPromoterTradeOrderAwardEntity>
vvPromoterTradeOrderAwardEntityList = vvPromoterTradeOrderAwardDao.selectVvPromoterTradeOrderAwardByPromoterId(request.getPromoterTradeOrderIdList());
for (VvPromoterTradeOrderAwardEntity vvPromoterTradeOrderAwardEntity : vvPromoterTradeOrderAwardEntityList) {
vvPromoterTradeOrderAwardEntity.setStatus(AwardStatusEnums.seller_reject_draw.getStatus());
vvPromoterTradeOrderAwardEntity.setRejectReason(request.getReason());
vvPromoterTradeOrderAwardEntity.setGmtReject(new Date());
vvPromoterTradeOrderAwardDao.updateVvPromoterTradeOrderAwardById(vvPromoterTradeOrderAwardEntity);
if(AbstractDrawAction.checkFailed(vvPromoterTradeOrderAwardEntity,false, ActionEnums.Admin_Seller_Agree_Draw)){
return R.error("提现状态不对");
}
vvBuyerDao.updateVvBuyerByIdPromoterArriveAccountAmountPromoterNotArriveAmount(
vvPromoterTradeOrderAwardEntity.getAwardAmount()
, vvPromoterTradeOrderAwardEntity.getAwardAmount(),
vvPromoterTradeOrderAwardEntity.getPromoterBuyerId());
vvPromoterTradeOrderAwardEntity.setStatus(AwardStatusEnums.seller_agree_draw.getStatus());
vvPromoterTradeOrderAwardEntity.setGmtAgree(new Date());
vvPromoterTradeOrderAwardDao.updateVvPromoterTradeOrderAwardById(vvPromoterTradeOrderAwardEntity);
}
List<VvPromoterTradeOrderLineAwardEntity> vvPromoterTradeOrderLineAwardEntities = vvPromoterTradeOrderLineAwardDao
.selectVvPromoterTradeOrderLineAwardByPromoterIdList(request.getPromoterTradeOrderIdList());
for (VvPromoterTradeOrderLineAwardEntity vvPromoterTradeOrderLineAwardEntity : vvPromoterTradeOrderLineAwardEntities) {
vvPromoterTradeOrderLineAwardEntity.setStatus(AwardStatusEnums.seller_reject_draw.getStatus());
vvPromoterTradeOrderLineAwardEntity.setGmtReject(new Date());
vvPromoterTradeOrderLineAwardEntity.setRejectReason(request.getReason());
vvPromoterTradeOrderLineAwardEntity.setStatus(AwardStatusEnums.seller_agree_draw.getStatus());
vvPromoterTradeOrderLineAwardEntity.setGmtAgree(new Date());
vvPromoterTradeOrderLineAwardDao.updateVvPromoterTradeOrderLineAwardById(vvPromoterTradeOrderLineAwardEntity);
}
return R.ok();
}
@ -81,19 +74,30 @@ public class AdminDrawController {
public R reject(@RequestBody VvAdminRejectDrawRequest request) {
List<VvPromoterTradeOrderAwardEntity>
vvPromoterTradeOrderAwardEntityList = vvPromoterTradeOrderAwardDao.selectVvPromoterTradeOrderAwardByPromoterId(request.getPromoterTradeOrderIdList());
for (VvPromoterTradeOrderAwardEntity vvPromoterTradeOrderAwardEntity : vvPromoterTradeOrderAwardEntityList) {
if(AbstractDrawAction.checkFailed(vvPromoterTradeOrderAwardEntity,false, ActionEnums.Admin_Seller_Reject_Draw)){
return R.error("提现状态不对");
}
String status = vvPromoterTradeOrderAwardEntity.getStatus();
vvPromoterTradeOrderAwardEntity.setStatus(AwardStatusEnums.seller_reject_draw.getStatus());
vvPromoterTradeOrderAwardEntity.setRejectReason(request.getReason());
vvPromoterTradeOrderAwardEntity.setGmtReject(new Date());
vvPromoterTradeOrderAwardDao.updateVvPromoterTradeOrderAwardById(vvPromoterTradeOrderAwardEntity);
vvBuyerDao.updateVvBuyerByIdPromoterArriveAccountAmountPromoterNotArriveAmount(
vvPromoterTradeOrderAwardEntity.getAwardAmount()
, vvPromoterTradeOrderAwardEntity.getAwardAmount(),
vvPromoterTradeOrderAwardEntity.getPromoterBuyerId());
if (AwardStatusEnums.arrive.getStatus().equals(status)) {
vvBuyerDao.updateVvBuyerByIdPromoterDrawCashFailedAmountPromoterArriveAccountAmount(
vvPromoterTradeOrderAwardEntity.getAwardAmount()
, vvPromoterTradeOrderAwardEntity.getAwardAmount(),
vvPromoterTradeOrderAwardEntity.getId());
} else if (AwardStatusEnums.apply_draw.getStatus().equals(status)) {
vvBuyerDao.updateVvBuyerByIdPromoterDrawCashFailedAmountPromoterApplyDrawCashAmount(
vvPromoterTradeOrderAwardEntity.getAwardAmount()
, vvPromoterTradeOrderAwardEntity.getAwardAmount(),
vvPromoterTradeOrderAwardEntity.getId());
}
}
List<VvPromoterTradeOrderLineAwardEntity> vvPromoterTradeOrderLineAwardEntities = vvPromoterTradeOrderLineAwardDao
.selectVvPromoterTradeOrderLineAwardByPromoterIdList(request.getPromoterTradeOrderIdList());
for (VvPromoterTradeOrderLineAwardEntity vvPromoterTradeOrderLineAwardEntity : vvPromoterTradeOrderLineAwardEntities) {

View File

@ -229,6 +229,7 @@ public class AdminReverseController {
vvReverseOrderEntity.setStatus(ReverseStatusEnums.weixin_refunding.getStatus());
vvReverseOrderDao.updateVvReverseOrderById(vvReverseOrderEntity);
if (promoterId !=null) {
List<VvPromoterTradeOrderAwardEntity> vvPromoterTradeOrderAwardEntities = vvPromoterTradeOrderAwardDao.selectVvPromoterTradeOrderAwardByPromoterId(promoterId);
for (VvPromoterTradeOrderAwardEntity vvPromoterTradeOrderAwardEntity : vvPromoterTradeOrderAwardEntities) {
vvPromoterTradeOrderAwardEntity.setStatus(AwardStatusEnums.canceled.getStatus());
@ -238,7 +239,7 @@ public class AdminReverseController {
vvBuyerDao.updateVvBuyerByIdPromoterCanceledAmountPromoterNotArriveAmount(
vvPromoterTradeOrderAwardEntity.getAwardAmount()
,vvPromoterTradeOrderAwardEntity.getAwardAmount(),
vvPromoterTradeOrderAwardEntity.getPromoterBuyerId());
vvPromoterTradeOrderAwardEntity.getId());
}
List<VvPromoterTradeOrderLineAwardEntity> vvPromoterTradeOrderLineAwardEntities = vvPromoterTradeOrderLineAwardDao.selectVvPromoterTradeOrderLineAwardByPromoterId(promoterId);

View File

@ -0,0 +1,78 @@
package com.heyu.api.controller.vv;
import com.heyu.api.alibaba.request.mm.AppPromoterTradeOrderDrawRequest;
import com.heyu.api.common.annotation.Describe;
import com.heyu.api.data.dao.vv.VvBuyerDao;
import com.heyu.api.data.dao.vv.VvPromoterTradeOrderAwardDao;
import com.heyu.api.data.dao.vv.VvPromoterTradeOrderLineAwardDao;
import com.heyu.api.data.entity.vv.VvPromoterTradeOrderAwardEntity;
import com.heyu.api.data.entity.vv.VvPromoterTradeOrderLineAwardEntity;
import com.heyu.api.data.enums.ActionEnums;
import com.heyu.api.data.enums.AwardStatusEnums;
import com.heyu.api.data.service.impl.AbstractDrawAction;
import com.heyu.api.data.utils.R;
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;
import java.util.Date;
import java.util.List;
@Slf4j
@RestController
@RequestMapping("/app/draw")
public class AppDrawController {
@Autowired
private VvPromoterTradeOrderAwardDao vvPromoterTradeOrderAwardDao;
@Autowired
private VvBuyerDao vvBuyerDao;
@Autowired
private VvPromoterTradeOrderLineAwardDao vvPromoterTradeOrderLineAwardDao;
/***
* 奖励 列表
* http://localhost:8888/app/draw/apply
*/
@Describe("app申请提现")
@RequestMapping("/apply")
public R draw(@RequestBody AppPromoterTradeOrderDrawRequest request) {
List<VvPromoterTradeOrderAwardEntity>
vvPromoterTradeOrderAwardEntityList = vvPromoterTradeOrderAwardDao.selectVvPromoterTradeOrderAwardByPromoterId(request.getPromoterTradeOrderIdList());
for (VvPromoterTradeOrderAwardEntity vvPromoterTradeOrderAwardEntity : vvPromoterTradeOrderAwardEntityList) {
if (AbstractDrawAction.checkFailed(vvPromoterTradeOrderAwardEntity, true, ActionEnums.App_Buyer_Apply_Draw)) {
return R.error("提现状态不对");
}
vvPromoterTradeOrderAwardEntity.setStatus(AwardStatusEnums.apply_draw.getStatus());
vvPromoterTradeOrderAwardEntity.setGmtApplyDraw(new Date());
vvPromoterTradeOrderAwardDao.updateVvPromoterTradeOrderAwardById(vvPromoterTradeOrderAwardEntity);
vvBuyerDao.updateVvBuyerByIdPromoterApplyDrawCashAmountPromoterArriveAccountAmount(
vvPromoterTradeOrderAwardEntity.getAwardAmount()
, vvPromoterTradeOrderAwardEntity.getAwardAmount(),
vvPromoterTradeOrderAwardEntity.getId());
}
List<VvPromoterTradeOrderLineAwardEntity> vvPromoterTradeOrderLineAwardEntities = vvPromoterTradeOrderLineAwardDao
.selectVvPromoterTradeOrderLineAwardByPromoterIdList(request.getPromoterTradeOrderIdList());
for (VvPromoterTradeOrderLineAwardEntity vvPromoterTradeOrderLineAwardEntity : vvPromoterTradeOrderLineAwardEntities) {
vvPromoterTradeOrderLineAwardEntity.setStatus(AwardStatusEnums.apply_draw.getStatus());
vvPromoterTradeOrderLineAwardEntity.setGmtApplyDraw(new Date());
vvPromoterTradeOrderLineAwardDao.updateVvPromoterTradeOrderLineAwardById(vvPromoterTradeOrderLineAwardEntity);
}
return R.ok();
}
}

View File

@ -361,12 +361,9 @@ public class AppOrderController {
vvTradeOrderLineDao.insertOrUpdateVvTradeOrderLine(tradeOrderLineEntity);
}
List<VvPromoterBuyerEntity> vvPromoterBuyerList = vvPromoterBuyerDao.selectVvPromoterBuyerByPromoterId(vvActivityDTO.getPromoterId());
List<Long> promoterBuyerIdList = SanUtils.getFieldList(vvPromoterBuyerList, VvPromoterBuyerEntity::getPromoterBuyerId);
List<VvBuyerEntity> vvBuyerEntities = vvBuyerDao.selectVvBuyerByIdList(promoterBuyerIdList);
Map<Long, VvBuyerEntity> vvBuyerEntityMap = SanUtils.groupByFiled2Map(vvBuyerEntities, VvBuyerEntity::getId);
if (CollectionUtils.isNotEmpty(vvPromoterBuyerList)
&& CollectionUtils.isNotEmpty(vvPromoterTradeOrderLineAwardEntityList)) {
@ -377,6 +374,7 @@ public class AppOrderController {
VvPromoterTradeOrderLineAwardEntity promoterTradeOrderLineAwardNew = new VvPromoterTradeOrderLineAwardEntity();
BeanUtils.copyProperties(vvPromoterTradeOrderLineAwardEntity, promoterTradeOrderLineAwardNew);
BigDecimal sum = BigDecimal.ZERO;
for (int i = 0; i < vvPromoterBuyerList.size(); i++) {
VvPromoterBuyerEntity vvPromoterBuyer = vvPromoterBuyerList.get(i);
if (i == vvPromoterBuyerList.size() - 1) {
@ -409,8 +407,11 @@ public class AppOrderController {
BigDecimal tradeOrderAward = SanUtils.sum(vvPromoterTradeOrderLineAwardEntities, VvPromoterTradeOrderLineAwardEntity::getAwardAmount);
vvPromoterTradeOrderAwardEntity.setAwardAmount(tradeOrderAward);
vvPromoterTradeOrderAwardDao.insertVvPromoterTradeOrderAward(vvPromoterTradeOrderAwardEntity);
VvBuyerEntity promoterBuyerBuyer = vvBuyerEntityMap.get(vvPromoterTradeOrderAwardEntity.getPromoterBuyerId());
vvBuyerDao.updateVvBuyerByIdPromoterSumAmountPromoterNotArriveAmount(tradeOrderAward,tradeOrderAward,promoterBuyerBuyer.getId());
vvBuyerDao.updateVvBuyerByIdPromoterSumAmountPromoterNotArriveAmount(
vvPromoterTradeOrderAwardEntity.getAwardAmount(),
vvPromoterTradeOrderAwardEntity.getAwardAmount(),
vvPromoterTradeOrderAwardEntity.getId());
}
}

View File

@ -7,6 +7,7 @@ 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.dao.vv.VvPromoterTradeOrderLineAwardDao;
import com.heyu.api.data.entity.vv.VvPromoterTradeOrderAwardEntity;
import com.heyu.api.data.kuaidi100.ActionDTO;
import com.heyu.api.data.service.impl.AbstractDrawAction;
@ -33,6 +34,9 @@ public class AppPromoterTradeOrderAwardController {
private VvPromoterTradeOrderAwardDao vvPromoterTradeOrderAwardDao;
@Autowired
private VvPromoterTradeOrderLineAwardDao vvPromoterTradeOrderLineAwardDao;
/***
* 奖励 列表
* http://localhost:8888/app/promoter/award/list
@ -40,7 +44,6 @@ public class AppPromoterTradeOrderAwardController {
@Describe("我的奖励列表")
@RequestMapping("/list")
public R list(@RequestBody AppPromoterTradeOrderRequest request) {
PPageUtils pageUtils = PPageUtils.startPage(request.getPageNum(), request.getPageSize())
.doSelect(new ISelect() {
@Override
@ -65,8 +68,14 @@ public class AppPromoterTradeOrderAwardController {
promoterTradeOrderAwardDTO.setActionDTOList(actionDTOS);
promoterTradeOrderAwardDTOList.add(promoterTradeOrderAwardDTO);
}
pageUtils.setRows(promoterTradeOrderAwardDTOList);
return R.ok().setData(pageUtils);
}
}

View File

@ -16,7 +16,6 @@ import com.heyu.api.data.service.impl.AbstractOrderAction;
import com.heyu.api.data.service.vv.VvTradeOrderConvertService;
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.listener.BaseDelayedHandler;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
@ -84,10 +83,11 @@ public class DeliveredHandler extends BaseDelayedHandler {
for (VvPromoterTradeOrderAwardEntity vvPromoterTradeOrderAwardEntity : vvPromoterTradeOrderAwardEntities) {
vvPromoterTradeOrderAwardEntity.setStatus(AwardStatusEnums.arrive.getStatus());
vvPromoterTradeOrderAwardDao.updateVvPromoterTradeOrderAwardById(vvPromoterTradeOrderAwardEntity);
vvBuyerDao.updateVvBuyerByIdPromoterArriveAccountAmountPromoterNotArriveAmount(
vvPromoterTradeOrderAwardEntity.getAwardAmount()
,vvPromoterTradeOrderAwardEntity.getAwardAmount(),
vvPromoterTradeOrderAwardEntity.getPromoterBuyerId());
vvPromoterTradeOrderAwardEntity.getId());
}
List<VvPromoterTradeOrderLineAwardEntity> vvPromoterTradeOrderLineAwardEntities = vvPromoterTradeOrderLineAwardDao.selectVvPromoterTradeOrderLineAwardByPromoterId(promoterId);