|
|
@@ -1227,35 +1227,24 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
|
|
|
List<OrderDon> orderDonList = this.list(Wrappers.lambdaQuery(OrderDon.class)
|
|
|
.eq(OrderDon::getMOid, orderMasterDon.getId()));
|
|
|
orderDonList.forEach(orderDon->{
|
|
|
+ orderDon.setStatus(OrderDon.Status.close);
|
|
|
+ updateById(orderDon);
|
|
|
//关闭车位锁定
|
|
|
GroupsRelation groupsRelation = groupsRelationMapper.selectById(orderDon.getRelationId());
|
|
|
if (groupsRelation != null) {
|
|
|
- if (!groupsRelation.getUserId().equals(orderDon.getUserId())) {
|
|
|
- TASK_POOL.execute(() -> {
|
|
|
- orderDon.setStatus(OrderDon.Status.close);
|
|
|
- updateById(orderDon);
|
|
|
- });
|
|
|
- if (groupsRelation.getUserId() != 0) {
|
|
|
- User user = userMapper.selectById(orderDon.getUserId());
|
|
|
- if (user != null) {
|
|
|
- checkIsSameUser(groupsRelation.getUserId(), user);
|
|
|
- }
|
|
|
- }
|
|
|
- } else {
|
|
|
- if (GroupsRelation.Status.locking == groupsRelation.getStatus() || GroupsRelation.Status.outside == groupsRelation.getStatus()) {
|
|
|
- log.info("清理用户userId:{}未支付订单", orderDon.getUserId());
|
|
|
- groupsRelation.setUserId(0L);
|
|
|
- Long groupsId = groupsRelation.getGroupsId();
|
|
|
- GroupsTrips groupsTrips = groupsMapper.selectById(groupsId);
|
|
|
- if (groupsRelation.getNum() > groupsTrips.getNum()) {
|
|
|
- groupsRelation.setStatus(GroupsRelation.Status.outside);
|
|
|
- } else {
|
|
|
- groupsRelation.setStatus(GroupsRelation.Status.none);
|
|
|
- }
|
|
|
- groupsRelation.setYhsId(0l);
|
|
|
- groupsRelationMapper.updateById(groupsRelation);
|
|
|
- orderCommonService.delRelation(groupsRelation);
|
|
|
+ if (GroupsRelation.Status.locking == groupsRelation.getStatus()) {
|
|
|
+ log.info("清理用户userId:{}未支付订单", orderDon.getUserId());
|
|
|
+ groupsRelation.setUserId(0L);
|
|
|
+ Long groupsId = groupsRelation.getGroupsId();
|
|
|
+ GroupsTrips groupsTrips = groupsMapper.selectById(groupsId);
|
|
|
+ if (groupsRelation.getNum() > groupsTrips.getNum()) {
|
|
|
+ groupsRelation.setStatus(GroupsRelation.Status.outside);
|
|
|
+ } else {
|
|
|
+ groupsRelation.setStatus(GroupsRelation.Status.none);
|
|
|
}
|
|
|
+ groupsRelation.setYhsId(0l);
|
|
|
+ groupsRelationMapper.updateById(groupsRelation);
|
|
|
+ orderCommonService.delRelation(groupsRelation);
|
|
|
}
|
|
|
}
|
|
|
//返还优惠券
|