提交修改
This commit is contained in:
parent
1667c19e99
commit
ea103cacfe
@ -80,5 +80,24 @@ public interface VvBuyerDao extends BaseMapper<VvBuyerEntity> {
|
|||||||
|
|
||||||
int updateVvBuyerByIdPromoterCanceledAmountPromoterNotArriveAmount(@Plus BigDecimal promoterCanceledAmount,@Sub BigDecimal promoterNotArriveAmount, Long id);
|
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);
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -48,6 +48,7 @@ private static final long serialVersionUID = 1L;
|
|||||||
public final static String reject_reason = CLASS_NAME + "reject_reason"; // 拒绝原因
|
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_reject = CLASS_NAME + "gmt_reject"; // 拒绝时间
|
||||||
public final static String gmt_agree = CLASS_NAME + "gmt_agree"; // 同意时间
|
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)
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
private Long id;
|
private Long id;
|
||||||
@ -103,6 +104,8 @@ private static final long serialVersionUID = 1L;
|
|||||||
private Date gmtReject;
|
private Date gmtReject;
|
||||||
//同意时间
|
//同意时间
|
||||||
private Date gmtAgree;
|
private Date gmtAgree;
|
||||||
|
//申请提现
|
||||||
|
private Date gmtApplyDraw;
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
@ -508,6 +511,21 @@ private static final long serialVersionUID = 1L;
|
|||||||
this.gmtAgree = gmtAgree;
|
this.gmtAgree = gmtAgree;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 申请提现
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public Date getGmtApplyDraw() {
|
||||||
|
return gmtApplyDraw;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 申请提现
|
||||||
|
* @param gmtApplyDraw
|
||||||
|
*/
|
||||||
|
public void setGmtApplyDraw(Date gmtApplyDraw) {
|
||||||
|
this.gmtApplyDraw = gmtApplyDraw;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "VvPromoterTradeOrderAwardEntity{" +
|
return "VvPromoterTradeOrderAwardEntity{" +
|
||||||
@ -538,6 +556,7 @@ private static final long serialVersionUID = 1L;
|
|||||||
",rejectReason=" + rejectReason +
|
",rejectReason=" + rejectReason +
|
||||||
",gmtReject=" + gmtReject +
|
",gmtReject=" + gmtReject +
|
||||||
",gmtAgree=" + gmtAgree +
|
",gmtAgree=" + gmtAgree +
|
||||||
|
",gmtApplyDraw=" + gmtApplyDraw +
|
||||||
"}";
|
"}";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -50,6 +50,7 @@ private static final long serialVersionUID = 1L;
|
|||||||
public final static String reject_reason = CLASS_NAME + "reject_reason"; // 拒绝原因
|
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_reject = CLASS_NAME + "gmt_reject"; // 拒绝时间
|
||||||
public final static String gmt_agree = CLASS_NAME + "gmt_agree"; // 同意时间
|
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)
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
private Long id;
|
private Long id;
|
||||||
@ -109,6 +110,8 @@ private static final long serialVersionUID = 1L;
|
|||||||
private Date gmtReject;
|
private Date gmtReject;
|
||||||
//同意时间
|
//同意时间
|
||||||
private Date gmtAgree;
|
private Date gmtAgree;
|
||||||
|
//申请提现
|
||||||
|
private Date gmtApplyDraw;
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
@ -544,6 +547,21 @@ private static final long serialVersionUID = 1L;
|
|||||||
this.gmtAgree = gmtAgree;
|
this.gmtAgree = gmtAgree;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 申请提现
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public Date getGmtApplyDraw() {
|
||||||
|
return gmtApplyDraw;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 申请提现
|
||||||
|
* @param gmtApplyDraw
|
||||||
|
*/
|
||||||
|
public void setGmtApplyDraw(Date gmtApplyDraw) {
|
||||||
|
this.gmtApplyDraw = gmtApplyDraw;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "VvPromoterTradeOrderLineAwardEntity{" +
|
return "VvPromoterTradeOrderLineAwardEntity{" +
|
||||||
@ -576,6 +594,7 @@ private static final long serialVersionUID = 1L;
|
|||||||
",rejectReason=" + rejectReason +
|
",rejectReason=" + rejectReason +
|
||||||
",gmtReject=" + gmtReject +
|
",gmtReject=" + gmtReject +
|
||||||
",gmtAgree=" + gmtAgree +
|
",gmtAgree=" + gmtAgree +
|
||||||
|
",gmtApplyDraw=" + gmtApplyDraw +
|
||||||
"}";
|
"}";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -71,7 +71,7 @@ public enum ActionEnums {
|
|||||||
Admin_Seller_Reject_Comment("Admin_Seller_Reject_Comment", "卖家拒绝评论", "/mm/comment/reject",
|
Admin_Seller_Reject_Comment("Admin_Seller_Reject_Comment", "卖家拒绝评论", "/mm/comment/reject",
|
||||||
OrderStatusEnums.delivered.getStatus()),
|
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()),
|
OrderStatusEnums.delivered.getStatus()),
|
||||||
|
|
||||||
Admin_Seller_Agree_Draw("Admin_Seller_Agree_Draw", "卖家同意提现", "/mm/draw/agree",
|
Admin_Seller_Agree_Draw("Admin_Seller_Agree_Draw", "卖家同意提现", "/mm/draw/agree",
|
||||||
|
|||||||
@ -48,7 +48,8 @@ public class MysqlMain_update {
|
|||||||
}
|
}
|
||||||
List<TablesBean> list = new ArrayList<TablesBean>();
|
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"));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -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;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -7,11 +7,6 @@ import lombok.Data;
|
|||||||
@Data
|
@Data
|
||||||
public class AppPromoterTradeOrderRequest extends AppBaseRequest {
|
public class AppPromoterTradeOrderRequest extends AppBaseRequest {
|
||||||
|
|
||||||
//推广者id,唯一值
|
|
||||||
private String promoterId;
|
|
||||||
|
|
||||||
//订单id
|
|
||||||
private Long tradeOrderId;
|
|
||||||
|
|
||||||
//create 创建, canceled 取消 , arrive,到账 ,
|
//create 创建, canceled 取消 , arrive,到账 ,
|
||||||
// create("create", "创建"),
|
// create("create", "创建"),
|
||||||
|
|||||||
@ -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.dao.vv.VvPromoterTradeOrderLineAwardDao;
|
||||||
import com.heyu.api.data.entity.vv.VvPromoterTradeOrderAwardEntity;
|
import com.heyu.api.data.entity.vv.VvPromoterTradeOrderAwardEntity;
|
||||||
import com.heyu.api.data.entity.vv.VvPromoterTradeOrderLineAwardEntity;
|
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.enums.AwardStatusEnums;
|
||||||
|
import com.heyu.api.data.service.impl.AbstractDrawAction;
|
||||||
import com.heyu.api.data.utils.R;
|
import com.heyu.api.data.utils.R;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@ -42,35 +44,26 @@ public class AdminDrawController {
|
|||||||
@Describe("同意提现")
|
@Describe("同意提现")
|
||||||
@RequestMapping("/agree")
|
@RequestMapping("/agree")
|
||||||
public R agree(@RequestBody VvAdminAgreeDrawRequest request) {
|
public R agree(@RequestBody VvAdminAgreeDrawRequest request) {
|
||||||
|
|
||||||
|
|
||||||
List<VvPromoterTradeOrderAwardEntity>
|
List<VvPromoterTradeOrderAwardEntity>
|
||||||
vvPromoterTradeOrderAwardEntityList = vvPromoterTradeOrderAwardDao.selectVvPromoterTradeOrderAwardByPromoterId(request.getPromoterTradeOrderIdList());
|
vvPromoterTradeOrderAwardEntityList = vvPromoterTradeOrderAwardDao.selectVvPromoterTradeOrderAwardByPromoterId(request.getPromoterTradeOrderIdList());
|
||||||
|
|
||||||
for (VvPromoterTradeOrderAwardEntity vvPromoterTradeOrderAwardEntity : vvPromoterTradeOrderAwardEntityList) {
|
for (VvPromoterTradeOrderAwardEntity vvPromoterTradeOrderAwardEntity : vvPromoterTradeOrderAwardEntityList) {
|
||||||
vvPromoterTradeOrderAwardEntity.setStatus(AwardStatusEnums.seller_reject_draw.getStatus());
|
if(AbstractDrawAction.checkFailed(vvPromoterTradeOrderAwardEntity,false, ActionEnums.Admin_Seller_Agree_Draw)){
|
||||||
vvPromoterTradeOrderAwardEntity.setRejectReason(request.getReason());
|
return R.error("提现状态不对");
|
||||||
vvPromoterTradeOrderAwardEntity.setGmtReject(new Date());
|
}
|
||||||
vvPromoterTradeOrderAwardDao.updateVvPromoterTradeOrderAwardById(vvPromoterTradeOrderAwardEntity);
|
|
||||||
|
|
||||||
vvBuyerDao.updateVvBuyerByIdPromoterArriveAccountAmountPromoterNotArriveAmount(
|
vvPromoterTradeOrderAwardEntity.setStatus(AwardStatusEnums.seller_agree_draw.getStatus());
|
||||||
vvPromoterTradeOrderAwardEntity.getAwardAmount()
|
vvPromoterTradeOrderAwardEntity.setGmtAgree(new Date());
|
||||||
, vvPromoterTradeOrderAwardEntity.getAwardAmount(),
|
vvPromoterTradeOrderAwardDao.updateVvPromoterTradeOrderAwardById(vvPromoterTradeOrderAwardEntity);
|
||||||
vvPromoterTradeOrderAwardEntity.getPromoterBuyerId());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
List<VvPromoterTradeOrderLineAwardEntity> vvPromoterTradeOrderLineAwardEntities = vvPromoterTradeOrderLineAwardDao
|
List<VvPromoterTradeOrderLineAwardEntity> vvPromoterTradeOrderLineAwardEntities = vvPromoterTradeOrderLineAwardDao
|
||||||
.selectVvPromoterTradeOrderLineAwardByPromoterIdList(request.getPromoterTradeOrderIdList());
|
.selectVvPromoterTradeOrderLineAwardByPromoterIdList(request.getPromoterTradeOrderIdList());
|
||||||
for (VvPromoterTradeOrderLineAwardEntity vvPromoterTradeOrderLineAwardEntity : vvPromoterTradeOrderLineAwardEntities) {
|
for (VvPromoterTradeOrderLineAwardEntity vvPromoterTradeOrderLineAwardEntity : vvPromoterTradeOrderLineAwardEntities) {
|
||||||
vvPromoterTradeOrderLineAwardEntity.setStatus(AwardStatusEnums.seller_reject_draw.getStatus());
|
vvPromoterTradeOrderLineAwardEntity.setStatus(AwardStatusEnums.seller_agree_draw.getStatus());
|
||||||
vvPromoterTradeOrderLineAwardEntity.setGmtReject(new Date());
|
vvPromoterTradeOrderLineAwardEntity.setGmtAgree(new Date());
|
||||||
vvPromoterTradeOrderLineAwardEntity.setRejectReason(request.getReason());
|
|
||||||
vvPromoterTradeOrderLineAwardDao.updateVvPromoterTradeOrderLineAwardById(vvPromoterTradeOrderLineAwardEntity);
|
vvPromoterTradeOrderLineAwardDao.updateVvPromoterTradeOrderLineAwardById(vvPromoterTradeOrderLineAwardEntity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -81,19 +74,30 @@ public class AdminDrawController {
|
|||||||
public R reject(@RequestBody VvAdminRejectDrawRequest request) {
|
public R reject(@RequestBody VvAdminRejectDrawRequest request) {
|
||||||
List<VvPromoterTradeOrderAwardEntity>
|
List<VvPromoterTradeOrderAwardEntity>
|
||||||
vvPromoterTradeOrderAwardEntityList = vvPromoterTradeOrderAwardDao.selectVvPromoterTradeOrderAwardByPromoterId(request.getPromoterTradeOrderIdList());
|
vvPromoterTradeOrderAwardEntityList = vvPromoterTradeOrderAwardDao.selectVvPromoterTradeOrderAwardByPromoterId(request.getPromoterTradeOrderIdList());
|
||||||
|
|
||||||
for (VvPromoterTradeOrderAwardEntity vvPromoterTradeOrderAwardEntity : vvPromoterTradeOrderAwardEntityList) {
|
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.setStatus(AwardStatusEnums.seller_reject_draw.getStatus());
|
||||||
vvPromoterTradeOrderAwardEntity.setRejectReason(request.getReason());
|
vvPromoterTradeOrderAwardEntity.setRejectReason(request.getReason());
|
||||||
vvPromoterTradeOrderAwardEntity.setGmtReject(new Date());
|
vvPromoterTradeOrderAwardEntity.setGmtReject(new Date());
|
||||||
vvPromoterTradeOrderAwardDao.updateVvPromoterTradeOrderAwardById(vvPromoterTradeOrderAwardEntity);
|
vvPromoterTradeOrderAwardDao.updateVvPromoterTradeOrderAwardById(vvPromoterTradeOrderAwardEntity);
|
||||||
|
|
||||||
vvBuyerDao.updateVvBuyerByIdPromoterArriveAccountAmountPromoterNotArriveAmount(
|
if (AwardStatusEnums.arrive.getStatus().equals(status)) {
|
||||||
vvPromoterTradeOrderAwardEntity.getAwardAmount()
|
vvBuyerDao.updateVvBuyerByIdPromoterDrawCashFailedAmountPromoterArriveAccountAmount(
|
||||||
, vvPromoterTradeOrderAwardEntity.getAwardAmount(),
|
vvPromoterTradeOrderAwardEntity.getAwardAmount()
|
||||||
vvPromoterTradeOrderAwardEntity.getPromoterBuyerId());
|
, vvPromoterTradeOrderAwardEntity.getAwardAmount(),
|
||||||
|
vvPromoterTradeOrderAwardEntity.getId());
|
||||||
|
} else if (AwardStatusEnums.apply_draw.getStatus().equals(status)) {
|
||||||
|
vvBuyerDao.updateVvBuyerByIdPromoterDrawCashFailedAmountPromoterApplyDrawCashAmount(
|
||||||
|
vvPromoterTradeOrderAwardEntity.getAwardAmount()
|
||||||
|
, vvPromoterTradeOrderAwardEntity.getAwardAmount(),
|
||||||
|
vvPromoterTradeOrderAwardEntity.getId());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
List<VvPromoterTradeOrderLineAwardEntity> vvPromoterTradeOrderLineAwardEntities = vvPromoterTradeOrderLineAwardDao
|
List<VvPromoterTradeOrderLineAwardEntity> vvPromoterTradeOrderLineAwardEntities = vvPromoterTradeOrderLineAwardDao
|
||||||
.selectVvPromoterTradeOrderLineAwardByPromoterIdList(request.getPromoterTradeOrderIdList());
|
.selectVvPromoterTradeOrderLineAwardByPromoterIdList(request.getPromoterTradeOrderIdList());
|
||||||
for (VvPromoterTradeOrderLineAwardEntity vvPromoterTradeOrderLineAwardEntity : vvPromoterTradeOrderLineAwardEntities) {
|
for (VvPromoterTradeOrderLineAwardEntity vvPromoterTradeOrderLineAwardEntity : vvPromoterTradeOrderLineAwardEntities) {
|
||||||
|
|||||||
@ -229,6 +229,7 @@ public class AdminReverseController {
|
|||||||
vvReverseOrderEntity.setStatus(ReverseStatusEnums.weixin_refunding.getStatus());
|
vvReverseOrderEntity.setStatus(ReverseStatusEnums.weixin_refunding.getStatus());
|
||||||
vvReverseOrderDao.updateVvReverseOrderById(vvReverseOrderEntity);
|
vvReverseOrderDao.updateVvReverseOrderById(vvReverseOrderEntity);
|
||||||
if (promoterId !=null) {
|
if (promoterId !=null) {
|
||||||
|
|
||||||
List<VvPromoterTradeOrderAwardEntity> vvPromoterTradeOrderAwardEntities = vvPromoterTradeOrderAwardDao.selectVvPromoterTradeOrderAwardByPromoterId(promoterId);
|
List<VvPromoterTradeOrderAwardEntity> vvPromoterTradeOrderAwardEntities = vvPromoterTradeOrderAwardDao.selectVvPromoterTradeOrderAwardByPromoterId(promoterId);
|
||||||
for (VvPromoterTradeOrderAwardEntity vvPromoterTradeOrderAwardEntity : vvPromoterTradeOrderAwardEntities) {
|
for (VvPromoterTradeOrderAwardEntity vvPromoterTradeOrderAwardEntity : vvPromoterTradeOrderAwardEntities) {
|
||||||
vvPromoterTradeOrderAwardEntity.setStatus(AwardStatusEnums.canceled.getStatus());
|
vvPromoterTradeOrderAwardEntity.setStatus(AwardStatusEnums.canceled.getStatus());
|
||||||
@ -238,7 +239,7 @@ public class AdminReverseController {
|
|||||||
vvBuyerDao.updateVvBuyerByIdPromoterCanceledAmountPromoterNotArriveAmount(
|
vvBuyerDao.updateVvBuyerByIdPromoterCanceledAmountPromoterNotArriveAmount(
|
||||||
vvPromoterTradeOrderAwardEntity.getAwardAmount()
|
vvPromoterTradeOrderAwardEntity.getAwardAmount()
|
||||||
,vvPromoterTradeOrderAwardEntity.getAwardAmount(),
|
,vvPromoterTradeOrderAwardEntity.getAwardAmount(),
|
||||||
vvPromoterTradeOrderAwardEntity.getPromoterBuyerId());
|
vvPromoterTradeOrderAwardEntity.getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
List<VvPromoterTradeOrderLineAwardEntity> vvPromoterTradeOrderLineAwardEntities = vvPromoterTradeOrderLineAwardDao.selectVvPromoterTradeOrderLineAwardByPromoterId(promoterId);
|
List<VvPromoterTradeOrderLineAwardEntity> vvPromoterTradeOrderLineAwardEntities = vvPromoterTradeOrderLineAwardDao.selectVvPromoterTradeOrderLineAwardByPromoterId(promoterId);
|
||||||
|
|||||||
@ -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();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -361,12 +361,9 @@ public class AppOrderController {
|
|||||||
vvTradeOrderLineDao.insertOrUpdateVvTradeOrderLine(tradeOrderLineEntity);
|
vvTradeOrderLineDao.insertOrUpdateVvTradeOrderLine(tradeOrderLineEntity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
List<VvPromoterBuyerEntity> vvPromoterBuyerList = vvPromoterBuyerDao.selectVvPromoterBuyerByPromoterId(vvActivityDTO.getPromoterId());
|
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)
|
if (CollectionUtils.isNotEmpty(vvPromoterBuyerList)
|
||||||
&& CollectionUtils.isNotEmpty(vvPromoterTradeOrderLineAwardEntityList)) {
|
&& CollectionUtils.isNotEmpty(vvPromoterTradeOrderLineAwardEntityList)) {
|
||||||
@ -377,6 +374,7 @@ public class AppOrderController {
|
|||||||
VvPromoterTradeOrderLineAwardEntity promoterTradeOrderLineAwardNew = new VvPromoterTradeOrderLineAwardEntity();
|
VvPromoterTradeOrderLineAwardEntity promoterTradeOrderLineAwardNew = new VvPromoterTradeOrderLineAwardEntity();
|
||||||
BeanUtils.copyProperties(vvPromoterTradeOrderLineAwardEntity, promoterTradeOrderLineAwardNew);
|
BeanUtils.copyProperties(vvPromoterTradeOrderLineAwardEntity, promoterTradeOrderLineAwardNew);
|
||||||
BigDecimal sum = BigDecimal.ZERO;
|
BigDecimal sum = BigDecimal.ZERO;
|
||||||
|
|
||||||
for (int i = 0; i < vvPromoterBuyerList.size(); i++) {
|
for (int i = 0; i < vvPromoterBuyerList.size(); i++) {
|
||||||
VvPromoterBuyerEntity vvPromoterBuyer = vvPromoterBuyerList.get(i);
|
VvPromoterBuyerEntity vvPromoterBuyer = vvPromoterBuyerList.get(i);
|
||||||
if (i == vvPromoterBuyerList.size() - 1) {
|
if (i == vvPromoterBuyerList.size() - 1) {
|
||||||
@ -409,8 +407,11 @@ public class AppOrderController {
|
|||||||
BigDecimal tradeOrderAward = SanUtils.sum(vvPromoterTradeOrderLineAwardEntities, VvPromoterTradeOrderLineAwardEntity::getAwardAmount);
|
BigDecimal tradeOrderAward = SanUtils.sum(vvPromoterTradeOrderLineAwardEntities, VvPromoterTradeOrderLineAwardEntity::getAwardAmount);
|
||||||
vvPromoterTradeOrderAwardEntity.setAwardAmount(tradeOrderAward);
|
vvPromoterTradeOrderAwardEntity.setAwardAmount(tradeOrderAward);
|
||||||
vvPromoterTradeOrderAwardDao.insertVvPromoterTradeOrderAward(vvPromoterTradeOrderAwardEntity);
|
vvPromoterTradeOrderAwardDao.insertVvPromoterTradeOrderAward(vvPromoterTradeOrderAwardEntity);
|
||||||
VvBuyerEntity promoterBuyerBuyer = vvBuyerEntityMap.get(vvPromoterTradeOrderAwardEntity.getPromoterBuyerId());
|
|
||||||
vvBuyerDao.updateVvBuyerByIdPromoterSumAmountPromoterNotArriveAmount(tradeOrderAward,tradeOrderAward,promoterBuyerBuyer.getId());
|
vvBuyerDao.updateVvBuyerByIdPromoterSumAmountPromoterNotArriveAmount(
|
||||||
|
vvPromoterTradeOrderAwardEntity.getAwardAmount(),
|
||||||
|
vvPromoterTradeOrderAwardEntity.getAwardAmount(),
|
||||||
|
vvPromoterTradeOrderAwardEntity.getId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -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.AppLogin;
|
||||||
import com.heyu.api.common.annotation.Describe;
|
import com.heyu.api.common.annotation.Describe;
|
||||||
import com.heyu.api.data.dao.vv.VvPromoterTradeOrderAwardDao;
|
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.VvPromoterTradeOrderAwardEntity;
|
||||||
import com.heyu.api.data.kuaidi100.ActionDTO;
|
import com.heyu.api.data.kuaidi100.ActionDTO;
|
||||||
import com.heyu.api.data.service.impl.AbstractDrawAction;
|
import com.heyu.api.data.service.impl.AbstractDrawAction;
|
||||||
@ -33,6 +34,9 @@ public class AppPromoterTradeOrderAwardController {
|
|||||||
private VvPromoterTradeOrderAwardDao vvPromoterTradeOrderAwardDao;
|
private VvPromoterTradeOrderAwardDao vvPromoterTradeOrderAwardDao;
|
||||||
|
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private VvPromoterTradeOrderLineAwardDao vvPromoterTradeOrderLineAwardDao;
|
||||||
|
|
||||||
/***
|
/***
|
||||||
* 奖励 列表
|
* 奖励 列表
|
||||||
* http://localhost:8888/app/promoter/award/list
|
* http://localhost:8888/app/promoter/award/list
|
||||||
@ -40,7 +44,6 @@ public class AppPromoterTradeOrderAwardController {
|
|||||||
@Describe("我的奖励列表")
|
@Describe("我的奖励列表")
|
||||||
@RequestMapping("/list")
|
@RequestMapping("/list")
|
||||||
public R list(@RequestBody AppPromoterTradeOrderRequest request) {
|
public R list(@RequestBody AppPromoterTradeOrderRequest request) {
|
||||||
|
|
||||||
PPageUtils pageUtils = PPageUtils.startPage(request.getPageNum(), request.getPageSize())
|
PPageUtils pageUtils = PPageUtils.startPage(request.getPageNum(), request.getPageSize())
|
||||||
.doSelect(new ISelect() {
|
.doSelect(new ISelect() {
|
||||||
@Override
|
@Override
|
||||||
@ -65,8 +68,14 @@ public class AppPromoterTradeOrderAwardController {
|
|||||||
promoterTradeOrderAwardDTO.setActionDTOList(actionDTOS);
|
promoterTradeOrderAwardDTO.setActionDTOList(actionDTOS);
|
||||||
promoterTradeOrderAwardDTOList.add(promoterTradeOrderAwardDTO);
|
promoterTradeOrderAwardDTOList.add(promoterTradeOrderAwardDTO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
pageUtils.setRows(promoterTradeOrderAwardDTOList);
|
pageUtils.setRows(promoterTradeOrderAwardDTOList);
|
||||||
return R.ok().setData(pageUtils);
|
return R.ok().setData(pageUtils);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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.service.vv.VvTradeOrderConvertService;
|
||||||
import com.heyu.api.data.utils.R;
|
import com.heyu.api.data.utils.R;
|
||||||
import com.heyu.api.data.utils.SanUtils;
|
import com.heyu.api.data.utils.SanUtils;
|
||||||
import com.heyu.api.data.utils.StringUtils;
|
|
||||||
import com.heyu.api.listener.BaseDelayedHandler;
|
import com.heyu.api.listener.BaseDelayedHandler;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@ -84,10 +83,11 @@ public class DeliveredHandler extends BaseDelayedHandler {
|
|||||||
for (VvPromoterTradeOrderAwardEntity vvPromoterTradeOrderAwardEntity : vvPromoterTradeOrderAwardEntities) {
|
for (VvPromoterTradeOrderAwardEntity vvPromoterTradeOrderAwardEntity : vvPromoterTradeOrderAwardEntities) {
|
||||||
vvPromoterTradeOrderAwardEntity.setStatus(AwardStatusEnums.arrive.getStatus());
|
vvPromoterTradeOrderAwardEntity.setStatus(AwardStatusEnums.arrive.getStatus());
|
||||||
vvPromoterTradeOrderAwardDao.updateVvPromoterTradeOrderAwardById(vvPromoterTradeOrderAwardEntity);
|
vvPromoterTradeOrderAwardDao.updateVvPromoterTradeOrderAwardById(vvPromoterTradeOrderAwardEntity);
|
||||||
|
|
||||||
vvBuyerDao.updateVvBuyerByIdPromoterArriveAccountAmountPromoterNotArriveAmount(
|
vvBuyerDao.updateVvBuyerByIdPromoterArriveAccountAmountPromoterNotArriveAmount(
|
||||||
vvPromoterTradeOrderAwardEntity.getAwardAmount()
|
vvPromoterTradeOrderAwardEntity.getAwardAmount()
|
||||||
,vvPromoterTradeOrderAwardEntity.getAwardAmount(),
|
,vvPromoterTradeOrderAwardEntity.getAwardAmount(),
|
||||||
vvPromoterTradeOrderAwardEntity.getPromoterBuyerId());
|
vvPromoterTradeOrderAwardEntity.getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
List<VvPromoterTradeOrderLineAwardEntity> vvPromoterTradeOrderLineAwardEntities = vvPromoterTradeOrderLineAwardDao.selectVvPromoterTradeOrderLineAwardByPromoterId(promoterId);
|
List<VvPromoterTradeOrderLineAwardEntity> vvPromoterTradeOrderLineAwardEntities = vvPromoterTradeOrderLineAwardDao.selectVvPromoterTradeOrderLineAwardByPromoterId(promoterId);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user