|
|
@@ -62,6 +62,8 @@ public class GroupsRelationChangeServiceImpl implements GroupsRelationChangeServ
|
|
|
GroupsTrips groupsTrips = groupsMapper.selectOne(Wrappers.lambdaQuery(GroupsTrips.class)
|
|
|
.eq(GroupsTrips::getStatus, GroupsTrips.Status.waiting)
|
|
|
.eq(GroupsTrips::getSkuId, skuId)
|
|
|
+ .gt(GroupsTrips::getAvailableNum, 0)
|
|
|
+ .orderByAsc(GroupsTrips::getAvailableNum)
|
|
|
.last("limit 1"));
|
|
|
GroupsRelation relation = null;
|
|
|
if (groupsTrips != null) {
|
|
|
@@ -82,6 +84,13 @@ public class GroupsRelationChangeServiceImpl implements GroupsRelationChangeServ
|
|
|
}
|
|
|
return getEmptyGroupsRelationIfRetry(userId, oriRelationId, skuId, retryNum);
|
|
|
}
|
|
|
+ Long groupsId = relation.getGroupsId();
|
|
|
+ int count = groupsMapper.decrAvailableNum(groupsId);
|
|
|
+ if (count == 0) {
|
|
|
+ log.error("车位异常 groupId:{}", groupsId);
|
|
|
+ groupsMapper.updateAvailableNum(groupsId);
|
|
|
+ log.error("车位异常");
|
|
|
+ }
|
|
|
syncGroupsRelation(oriRelationId, relation);
|
|
|
return relation;
|
|
|
}
|