|
@@ -2,6 +2,8 @@ package com.zhongzheng.modules.goods.service.impl;
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
|
|
import com.zhongzheng.common.utils.DateUtils;
|
|
|
import com.zhongzheng.modules.goods.bo.GoodsAttachedAddBo;
|
|
|
import com.zhongzheng.modules.goods.bo.GoodsAttachedEditBo;
|
|
@@ -10,6 +12,7 @@ import com.zhongzheng.modules.goods.domain.GoodsAttached;
|
|
|
import com.zhongzheng.modules.goods.mapper.GoodsAttachedMapper;
|
|
|
import com.zhongzheng.modules.goods.mapper.GoodsMapper;
|
|
|
import com.zhongzheng.modules.goods.service.IGoodsAttachedService;
|
|
|
+import com.zhongzheng.modules.goods.vo.GoodsAttachedPaperVo;
|
|
|
import com.zhongzheng.modules.goods.vo.GoodsAttachedVo;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -60,7 +63,19 @@ public class GoodsAttachedServiceImpl extends ServiceImpl<GoodsAttachedMapper, G
|
|
|
|
|
|
@Override
|
|
|
public List<GoodsAttachedVo> getList(GoodsAttachedQueryBo bo) {
|
|
|
- return goodsAttachedMapper.getList(bo);
|
|
|
+ List<GoodsAttachedVo> list = goodsAttachedMapper.getList(bo);
|
|
|
+ if (ObjectUtils.isNotNull(bo.getPaperId())){
|
|
|
+ List<GoodsAttachedPaperVo> paperVos = goodsAttachedMapper.getPaperIds(bo.getGoodsId());
|
|
|
+ if (CollectionUtils.isNotEmpty(paperVos)){
|
|
|
+ //需要过滤的
|
|
|
+ List<Long> goodsAttIds = paperVos.stream().filter(x -> x.getExamPaperId().equals(bo.getPaperId()))
|
|
|
+ .map(GoodsAttachedPaperVo::getGoodsAttachedId).collect(Collectors.toList());
|
|
|
+ if (CollectionUtils.isNotEmpty(goodsAttIds)){
|
|
|
+ list = list.stream().filter(item -> goodsAttIds.contains(item.getId())).collect(Collectors.toList());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return list;
|
|
|
}
|
|
|
|
|
|
/**
|