|
|
|
@@ -23,10 +23,7 @@ import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Propagation; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.Date; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.*; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
/** |
|
|
|
@@ -146,11 +143,12 @@ public class WxOrderGroupServiceImpl implements WxOrderGroupService { |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public ResultData queryRemainOne(WxOrderGroup wxOrderGroup) { |
|
|
|
public ResultData queryRemainOne(WxOrderGroup wxOrderGroup, Long userId) { |
|
|
|
//取过期时间最大的数据 |
|
|
|
WxOrderGroup group = wxOrderGroupMapper.select(wxOrderGroup).stream().max((x, y) -> { |
|
|
|
return x.getExpiredDate().after(y.getExpiredDate()) ? 1 : 0; |
|
|
|
}).orElse(null); |
|
|
|
WxOrderGroup group = wxOrderGroupMapper.select(wxOrderGroup).parallelStream() |
|
|
|
.filter(o -> !o.getUserId().equals(userId) && o.getExpiredDate().after(new Date())) |
|
|
|
.max(Comparator.comparing(WxOrderGroup::getExpiredDate)) |
|
|
|
.orElse(null); |
|
|
|
if (group == null) { |
|
|
|
return new ResultData(Result.SUCCESS, "查询成功", group); |
|
|
|
} |
|
|
|
@@ -163,6 +161,7 @@ public class WxOrderGroupServiceImpl implements WxOrderGroupService { |
|
|
|
PageHelper.startPage(pageIndex, pageSize); |
|
|
|
List<Map<String, Object>> result = wxOrderGroupMapper.queryOrderGroup(wxOrder); |
|
|
|
//更新状态 |
|
|
|
logger.info("更新状态:" + result); |
|
|
|
updateOrderGroupStatus(result); |
|
|
|
PageHelper.startPage(pageIndex, pageSize); |
|
|
|
result = wxOrderGroupMapper.queryOrderGroup(wxOrder); |
|
|
|
|