|
|
|
@ -349,6 +349,33 @@ public class YxStoreBargainServiceImpl extends BaseServiceImpl<YxStoreBargainMap
|
|
|
|
|
.build(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public List<YxStoreBargainQueryVo> getUserBargainList(int page, int limit) { |
|
|
|
|
Map<String,List<YxStoreBargainQueryVo>> map=new HashMap<>(); |
|
|
|
|
Page<YxStoreBargain> pageModel = new Page<>(page, limit); |
|
|
|
|
LambdaQueryWrapper<YxStoreBargain> wrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
Date nowTime = new Date(); |
|
|
|
|
wrapper.eq(YxStoreBargain::getStatus, ShopCommonEnum.IS_STATUS_1.getValue()) |
|
|
|
|
.lt(YxStoreBargain::getStartTime,nowTime) |
|
|
|
|
.gt(YxStoreBargain::getStopTime,nowTime); |
|
|
|
|
List<YxStoreBargainQueryVo> yxStoreBargainQueryVos = generator.convert( |
|
|
|
|
yxStoreBargainMapper.selectPage(pageModel,wrapper).getRecords(), |
|
|
|
|
YxStoreBargainQueryVo.class); |
|
|
|
|
long uid = LocalUser.getUidByToken(); |
|
|
|
|
List<YxStoreBargainQueryVo> isParticipation=new ArrayList<>(); |
|
|
|
|
yxStoreBargainQueryVos.forEach(item->{ |
|
|
|
|
item.setPeople(storeBargainUserService.getBargainUserCount(item.getId(), OrderInfoEnum.BARGAIN_STATUS_1.getValue())); |
|
|
|
|
item.setIsParticipation(storeBargainUserService.getUserIsParticipation(uid, item.getId())); |
|
|
|
|
if (item.getIsParticipation()){ |
|
|
|
|
isParticipation.add(item); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
return isParticipation; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 获取砍价商品列表 |
|
|
|
|
* @param page page |
|
|
|
@ -356,8 +383,7 @@ public class YxStoreBargainServiceImpl extends BaseServiceImpl<YxStoreBargainMap
|
|
|
|
|
* @return List |
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
public Map<String,List<YxStoreBargainQueryVo>> getList(int page, int limit) { |
|
|
|
|
Map<String,List<YxStoreBargainQueryVo>> map=new HashMap<>(); |
|
|
|
|
public List<YxStoreBargainQueryVo> getList(int page, int limit) { |
|
|
|
|
Page<YxStoreBargain> pageModel = new Page<>(page, limit); |
|
|
|
|
LambdaQueryWrapper<YxStoreBargain> wrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
Date nowTime = new Date(); |
|
|
|
@ -369,21 +395,22 @@ public class YxStoreBargainServiceImpl extends BaseServiceImpl<YxStoreBargainMap
|
|
|
|
|
yxStoreBargainMapper.selectPage(pageModel,wrapper).getRecords(), |
|
|
|
|
YxStoreBargainQueryVo.class); |
|
|
|
|
long uid = LocalUser.getUidByToken(); |
|
|
|
|
List<YxStoreBargainQueryVo> isParticipation=new ArrayList<>(); |
|
|
|
|
List<YxStoreBargainQueryVo> isNotParticipation=new ArrayList<>(); |
|
|
|
|
// List<YxStoreBargainQueryVo> isParticipation=new ArrayList<>();
|
|
|
|
|
// List<YxStoreBargainQueryVo> isNotParticipation=new ArrayList<>();
|
|
|
|
|
yxStoreBargainQueryVos.forEach(item->{ |
|
|
|
|
item.setPeople(storeBargainUserService.getBargainUserCount(item.getId(), OrderInfoEnum.BARGAIN_STATUS_1.getValue())); |
|
|
|
|
item.setIsParticipation(storeBargainUserService.getUserIsParticipation(uid, item.getId())); |
|
|
|
|
if (item.getIsParticipation()){ |
|
|
|
|
isParticipation.add(item); |
|
|
|
|
}else { |
|
|
|
|
isNotParticipation.add(item); |
|
|
|
|
} |
|
|
|
|
// if (item.getIsParticipation()){
|
|
|
|
|
// isParticipation.add(item);
|
|
|
|
|
// }else {
|
|
|
|
|
// isNotParticipation.add(item);
|
|
|
|
|
// }
|
|
|
|
|
}); |
|
|
|
|
map.put("yxStoreBargainQueryVos",yxStoreBargainQueryVos); |
|
|
|
|
map.put("isParticipation",isParticipation); |
|
|
|
|
map.put("isNotParticipation",isNotParticipation); |
|
|
|
|
return map; |
|
|
|
|
// map.put("yxStoreBargainQueryVos",yxStoreBargainQueryVos);
|
|
|
|
|
// map.put("isParticipation",isParticipation);
|
|
|
|
|
// map.put("isNotParticipation",isNotParticipation);
|
|
|
|
|
// return map;
|
|
|
|
|
return yxStoreBargainQueryVos; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|