...
|
...
|
@@ -2032,9 +2032,16 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport |
|
|
return;
|
|
|
}
|
|
|
// int minNum = queryActivityItemMinNum(activity.getId());
|
|
|
|
|
|
//查询可以参与活动的uid组
|
|
|
logger.info("dealWithWaitActivity,activity is {},selectUidList",activity);
|
|
|
List<UnionShareOrdersUidBo> uids=unionShareOrdersMapper.selectUidList(activity.getStartTime(), activity.getEndTime());
|
|
|
List<UnionShareOrdersUidBo> uids;
|
|
|
//满单返过滤维度:1-下单人满单,2-分享人满单
|
|
|
if (activity.getExtraUidType() == 2) {
|
|
|
uids = unionShareOrdersMapper.selectPromoteUidList(activity.getStartTime(), activity.getEndTime());
|
|
|
} else {
|
|
|
uids = unionShareOrdersMapper.selectUidList(activity.getStartTime(), activity.getEndTime());
|
|
|
}
|
|
|
logger.info("dealWithWaitActivity,activity is {},selectUidList, uids is {}",activity,uids);
|
|
|
uids.forEach(u->{
|
|
|
joinExtraActivity(u.getOrderUid(), u.getPromoteUid(), activity.getId());
|
...
|
...
|
@@ -2117,7 +2124,7 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport |
|
|
return activities;
|
|
|
}
|
|
|
//获取某时间段可参与活动的单数
|
|
|
private List<UnionShareOrders> queryUidActivity(int orderUid,int promoteUid,int beginTime,int endTime) {
|
|
|
private List<UnionShareOrders> queryUidActivity(Integer orderUid,int promoteUid,int beginTime,int endTime) {
|
|
|
logger.info("queryUidActivity,orderUid is {},promoteUid is {},beginTime is {},endTime is {}.",orderUid,promoteUid,beginTime,endTime);
|
|
|
List<UnionShareOrders> orders = unionShareOrdersMapper.selectListByOrderUidForActivity(beginTime, endTime, orderUid,promoteUid);
|
|
|
return orders;
|
...
|
...
|
@@ -2222,7 +2229,7 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport |
|
|
/**
|
|
|
* 参加满x单额外返活动
|
|
|
* */
|
|
|
public boolean joinExtraActivity(int orderUid ,int promoteUid ,int activityId){
|
|
|
public boolean joinExtraActivity(Integer orderUid ,int promoteUid ,int activityId){
|
|
|
logger.info("joinExtraActivity,orderUid is {},promoteUid is {},activityId is {}.",orderUid,promoteUid,activityId);
|
|
|
|
|
|
//查询是否已参加过此活动
|
...
|
...
|
@@ -2345,11 +2352,11 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport |
|
|
//向数据库插入参与某种额外返、新cps额外返活动的数据
|
|
|
boolean insertJoinDataForActivity(List<UnionShareOrders> orders, Integer orderUid , int promoteUid , UnionShareOrdersActivity activity, UnionShareOrdersActivityItem item) {
|
|
|
//满足此项标准
|
|
|
if (orderUid != null && activity.getType() != 3) {
|
|
|
// if (orderUid != null && activity.getType() != 3) {
|
|
|
//活动类型:1-订单返利比例升级,2-订单返利翻x倍,3-额外返,4-cps新人额外返
|
|
|
//当类型为3时需要传orderUid,当类型为4时不需要传orderUid
|
|
|
return false;
|
|
|
}
|
|
|
// return false;
|
|
|
// }
|
|
|
StringBuilder ordersStr = new StringBuilder();
|
|
|
List<Integer> orderIds = new ArrayList<>();
|
|
|
String status=ShareOrdersStatusEnum.CAN_SETTLE.getCode();
|
...
|
...
|
@@ -2364,14 +2371,14 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport |
|
|
int now = DateUtil.getCurrentTimeSecond();
|
|
|
UnionShareOrders insertExtraOrder = new UnionShareOrders();
|
|
|
UnionShareOrdersActivityLogs logs = new UnionShareOrdersActivityLogs();
|
|
|
if (orderUid != null) {
|
|
|
if (activity.getType() == 3) {
|
|
|
//3-额外返
|
|
|
logger.info("insertJoinDataForActivity,orderUid is {},promoteUid is {},activityId is {},updateByIdsForExtraActivity,orderIds is {} .",orderUid,promoteUid,activity.getId(),orderIds);
|
|
|
unionShareOrdersMapper.updateByIdsForExtraActivity(orderIds, activity.getId(),now);
|
|
|
insertExtraOrder.setOrderUid(orderUid);
|
|
|
logs.setOrderUid(orderUid);
|
|
|
insertExtraOrder.setExtraActivityId(activity.getId());
|
|
|
}else {
|
|
|
} else if (activity.getType() == 4) {
|
|
|
//4-cps新人n天额外返
|
|
|
int updateNum = unionShareUserMapper.updateCpsActByUid(promoteUid, activity.getId(), now);
|
|
|
if (updateNum < 1) {
|
...
|
...
|
@@ -2379,8 +2386,10 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport |
|
|
return false;
|
|
|
}
|
|
|
//更新关联订单
|
|
|
unionShareOrdersMapper.updateByIdsForCpsUserActivity(orderIds, activity.getId(),now);
|
|
|
unionShareOrdersMapper.updateByIdsForCpsUserActivity(orderIds, activity.getId(), now);
|
|
|
insertExtraOrder.setCpsExtraActivityId(activity.getId());
|
|
|
} else {
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
//插入额外返利单
|
...
|
...
|
|