|
|
@@ -4,7 +4,6 @@ import cn.hutool.core.date.DateField;
|
|
|
import cn.hutool.core.date.DateTime;
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.cyksj.common.annotation.NoSubmit;
|
|
|
@@ -299,16 +298,18 @@ public class ExchangeCodeServiceImpl extends ServiceImpl<ExchangeCodeMapper, Exc
|
|
|
//寻找差不多过期时间规格的车位
|
|
|
relation = groupRelationFrontService.getSimilarExpiredGroupRelation(sku.getId(), sku.getMonths(), errorsRelationIds);
|
|
|
if (relation == null) {
|
|
|
- LambdaQueryWrapper<GroupsTrips> queryWrapper = Wrappers.lambdaQuery(GroupsTrips.class)
|
|
|
+ GroupsTrips groups = groupsMapper.selectOne(Wrappers.lambdaQuery(GroupsTrips.class)
|
|
|
.eq(GroupsTrips::getSkuId, sku.getId())
|
|
|
.gt(GroupsTrips::getAvailableNum, 0).last("limit 1")
|
|
|
.eq(GroupsTrips::getStatus, GroupsTrips.Status.validity)
|
|
|
- .orderByAsc(GroupsTrips::getAvailableNum);
|
|
|
- GroupsTrips groups = groupsMapper.selectOne(queryWrapper);
|
|
|
+ .orderByAsc(GroupsTrips::getAvailableNum));
|
|
|
//待发车
|
|
|
if (groups == null) {
|
|
|
- queryWrapper.eq(GroupsTrips::getStatus, GroupsTrips.Status.waiting);
|
|
|
- groups = groupsMapper.selectOne(queryWrapper);
|
|
|
+ groups = groupsMapper.selectOne(Wrappers.lambdaQuery(GroupsTrips.class)
|
|
|
+ .eq(GroupsTrips::getSkuId, sku.getId())
|
|
|
+ .gt(GroupsTrips::getAvailableNum, 0).last("limit 1")
|
|
|
+ .eq(GroupsTrips::getStatus, GroupsTrips.Status.waiting)
|
|
|
+ .orderByAsc(GroupsTrips::getAvailableNum));
|
|
|
}
|
|
|
if (groups == null) {
|
|
|
//新增车位 并关联
|