|
@@ -90,7 +90,7 @@ public class SchedulerServiceImpl implements SchedulerService {
|
|
|
.field(GroupsRelationView::getStatus, GroupsRelation.Status.validity.name())
|
|
.field(GroupsRelationView::getStatus, GroupsRelation.Status.validity.name())
|
|
|
.field(GroupsRelationView::getExpiryTime, nextBeginDay).op(Operator.GreaterEqual)
|
|
.field(GroupsRelationView::getExpiryTime, nextBeginDay).op(Operator.GreaterEqual)
|
|
|
.build());
|
|
.build());
|
|
|
- reAssign(g_groupsId, now, groupsRelations);
|
|
|
|
|
|
|
+ reAssign(g_groupsId, now, groupsRelations, UserTicketClearedRecord.Source.timing_change_ticket);
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -113,14 +113,14 @@ public class SchedulerServiceImpl implements SchedulerService {
|
|
|
.field(GroupsRelationView::getStatus, List.of(GroupsRelation.Status.validity.name(), GroupsRelation.Status.outside.name())).op(Operator.InList)
|
|
.field(GroupsRelationView::getStatus, List.of(GroupsRelation.Status.validity.name(), GroupsRelation.Status.outside.name())).op(Operator.InList)
|
|
|
.field(GroupsRelationView::getExpiryTime, now).op(Operator.GreaterEqual)
|
|
.field(GroupsRelationView::getExpiryTime, now).op(Operator.GreaterEqual)
|
|
|
.build());
|
|
.build());
|
|
|
- reAssign(groupsId, now, groupsRelations);
|
|
|
|
|
|
|
+ reAssign(groupsId, now, groupsRelations, UserTicketClearedRecord.Source.disable);
|
|
|
redisService.del(key);
|
|
redisService.del(key);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 重新分配车位
|
|
* 重新分配车位
|
|
|
*/
|
|
*/
|
|
|
- public void reAssign(Long g_groupsId, DateTime now, List<GroupsRelationView> groupsRelations) {
|
|
|
|
|
|
|
+ public void reAssign(Long g_groupsId, DateTime now, List<GroupsRelationView> groupsRelations, UserTicketClearedRecord.Source source) {
|
|
|
log.info("迁移groupsId:{}未过期用户数量:{}", g_groupsId, groupsRelations.size());
|
|
log.info("迁移groupsId:{}未过期用户数量:{}", g_groupsId, groupsRelations.size());
|
|
|
Map<Long, GoodsDon> goodsMap = new ConcurrentHashMap<>();
|
|
Map<Long, GoodsDon> goodsMap = new ConcurrentHashMap<>();
|
|
|
Map<Long, GoodsDonSku> skuMap = new ConcurrentHashMap<>();
|
|
Map<Long, GoodsDonSku> skuMap = new ConcurrentHashMap<>();
|
|
@@ -136,16 +136,22 @@ public class SchedulerServiceImpl implements SchedulerService {
|
|
|
log.info("存在userId:{}无法转移的车票relationId:{}", userId, change_relationId);
|
|
log.info("存在userId:{}无法转移的车票relationId:{}", userId, change_relationId);
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- Date expiryTime = relationView.getExpiryTime();
|
|
|
|
|
|
|
+ Date expiryTime = DateUtil.beginOfDay(relationView.getExpiryTime());
|
|
|
Long skuId = relationView.getSkuId();
|
|
Long skuId = relationView.getSkuId();
|
|
|
//仅针对chatGPT
|
|
//仅针对chatGPT
|
|
|
if (relationView.getGoodsId() == 18) {
|
|
if (relationView.getGoodsId() == 18) {
|
|
|
Long bet_day = DateUtil.between(now, expiryTime, DateUnit.DAY);
|
|
Long bet_day = DateUtil.between(now, expiryTime, DateUnit.DAY);
|
|
|
|
|
+ //10人月付 10天内硬塞20个 10天外硬塞10个
|
|
|
|
|
+ //4人月付 硬塞5个
|
|
|
|
|
+ Integer extra_num = 5;
|
|
|
//10天以内
|
|
//10天以内
|
|
|
if (bet_day <= 10) {
|
|
if (bet_day <= 10) {
|
|
|
|
|
+ if (skuId.equals(161l)) {
|
|
|
|
|
+ extra_num = 20;
|
|
|
|
|
+ }
|
|
|
//分配到过期账号5天内误差的相同规格车队里
|
|
//分配到过期账号5天内误差的相同规格车队里
|
|
|
DateTime five_day = DateUtil.offsetDay(expiryTime, 5);
|
|
DateTime five_day = DateUtil.offsetDay(expiryTime, 5);
|
|
|
- Long item_groupsId = groupsMapper.selectSameSpecItemGroupsByTime(g_groupsId, skuId, expiryTime, five_day, false);
|
|
|
|
|
|
|
+ Long item_groupsId = groupsMapper.selectSameSpecItemGroupsByTime(g_groupsId, skuId, expiryTime, five_day, extra_num);
|
|
|
if (item_groupsId == null) {
|
|
if (item_groupsId == null) {
|
|
|
//无对应车队 退款
|
|
//无对应车队 退款
|
|
|
//退款至余额
|
|
//退款至余额
|
|
@@ -171,7 +177,7 @@ public class SchedulerServiceImpl implements SchedulerService {
|
|
|
}
|
|
}
|
|
|
//清除车票
|
|
//清除车票
|
|
|
GroupsRelation relation = groupsRelationMapper.selectById(change_relationId);
|
|
GroupsRelation relation = groupsRelationMapper.selectById(change_relationId);
|
|
|
- groupRelationClearService.clearTicket(relation, UserTicketClearedRecord.Source.timing_change_ticket);
|
|
|
|
|
|
|
+ groupRelationClearService.clearTicket(relation, source);
|
|
|
//退款至余额
|
|
//退款至余额
|
|
|
//实付金额 + 余额
|
|
//实付金额 + 余额
|
|
|
BigDecimal money = orderDon.getMoney().add(orderDon.getBalance());
|
|
BigDecimal money = orderDon.getMoney().add(orderDon.getBalance());
|
|
@@ -215,13 +221,16 @@ public class SchedulerServiceImpl implements SchedulerService {
|
|
|
cmsOrderDonService.refundRecord(orderDon, goodsDon, sku, StrUtil.EMPTY, "balance");
|
|
cmsOrderDonService.refundRecord(orderDon, goodsDon, sku, StrUtil.EMPTY, "balance");
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- changeTickerRelation(item_groupsId, relationView, UserTicketClearedRecord.Source.timing_change_ticket);
|
|
|
|
|
|
|
+ changeTickerRelation(item_groupsId, relationView, source);
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
//大于10天
|
|
//大于10天
|
|
|
//分配到过期账号10天内误差的相同规格车队里
|
|
//分配到过期账号10天内误差的相同规格车队里
|
|
|
|
|
+ if (skuId.equals(161l)) {
|
|
|
|
|
+ extra_num = 10;
|
|
|
|
|
+ }
|
|
|
DateTime ten_day = DateUtil.offsetDay(expiryTime, 10);
|
|
DateTime ten_day = DateUtil.offsetDay(expiryTime, 10);
|
|
|
- Long item_groupsId = groupsMapper.selectSameSpecItemGroupsByTime(g_groupsId, skuId, expiryTime, ten_day, true);
|
|
|
|
|
|
|
+ Long item_groupsId = groupsMapper.selectSameSpecItemGroupsByTime(g_groupsId, skuId, expiryTime, ten_day, extra_num);
|
|
|
if (item_groupsId == null) {
|
|
if (item_groupsId == null) {
|
|
|
//无对应车队 生成空车队
|
|
//无对应车队 生成空车队
|
|
|
//寻找空车队
|
|
//寻找空车队
|
|
@@ -236,7 +245,7 @@ public class SchedulerServiceImpl implements SchedulerService {
|
|
|
changeTickerRelation(item_groupsId, relationView, UserTicketClearedRecord.Source.new_groups_ticket);
|
|
changeTickerRelation(item_groupsId, relationView, UserTicketClearedRecord.Source.new_groups_ticket);
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- changeTickerRelation(item_groupsId, relationView, UserTicketClearedRecord.Source.timing_change_ticket);
|
|
|
|
|
|
|
+ changeTickerRelation(item_groupsId, relationView, source);
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
if (relationView.getGoodsId() == 26) {
|
|
if (relationView.getGoodsId() == 26) {
|
|
@@ -248,7 +257,7 @@ public class SchedulerServiceImpl implements SchedulerService {
|
|
|
changeErrorRecordService.changeTicketErrorRecord(relationView, UserRelationChangeErrorRecord.Source.change);
|
|
changeErrorRecordService.changeTicketErrorRecord(relationView, UserRelationChangeErrorRecord.Source.change);
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- changeTickerRelation(item_groupsId, relationView, UserTicketClearedRecord.Source.timing_change_ticket);
|
|
|
|
|
|
|
+ changeTickerRelation(item_groupsId, relationView, source);
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|