|
|
@@ -64,20 +64,18 @@ public class GroupsRelationChangeServiceImpl implements GroupsRelationChangeServ
|
|
|
.eq(GroupsTrips::getStatus, GroupsTrips.Status.waiting)
|
|
|
.eq(GroupsTrips::getSkuId, skuId)
|
|
|
.last("limit 1"));
|
|
|
- GroupsRelation relation;
|
|
|
+ GroupsRelation relation = null;
|
|
|
if (groupsTrips != null) {
|
|
|
relation = relationMapper.selectOne(Wrappers.lambdaQuery(GroupsRelation.class)
|
|
|
.eq(GroupsRelation::getGroupsId, groupsTrips.getId())
|
|
|
.eq(GroupsRelation::getUserId, 0)
|
|
|
.last("limit 1"));
|
|
|
- } else {
|
|
|
+ }
|
|
|
+ if (relation == null) {
|
|
|
//新增空车队
|
|
|
GoodsDonSku sku = skuMapper.selectById(skuId);
|
|
|
relation = groupsFuncService.createNewGroupsTrips(sku);
|
|
|
}
|
|
|
- if (relation == null) {
|
|
|
- return null;
|
|
|
- }
|
|
|
if (!redisService.setNx(RedisKey.GROUPS_RELATION_NUM_KEY + relation.getId(), userId, 60 * 2L)) {
|
|
|
retryNum++;
|
|
|
if (retryNum >= 7) {
|