|
@@ -27,7 +27,13 @@ import com.sd.framework.util.sql.Sql;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
-import java.util.*;
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.Collections;
|
|
|
+import java.util.HashSet;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+import java.util.Objects;
|
|
|
+import java.util.Set;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
@@ -51,12 +57,11 @@ public class BomServiceImpl extends ServiceImpl<BomMapper, Bom> implements BomSe
|
|
|
@Autowired
|
|
|
private FileInfoService fileInfoService;
|
|
|
|
|
|
-
|
|
|
@Override
|
|
|
public Page<BomVo> getPage(BomSelectDto dto) {
|
|
|
|
|
|
List<Long> queryBomIdList = null;
|
|
|
- List<Long> queryBomClassifyIdList = new ArrayList<>();
|
|
|
+ Set<Long> queryBomClassifyIdSet = new HashSet<>();
|
|
|
if (!StrUtil.isAllBlank(dto.getColour(), dto.getBomSpecCode(), dto.getBomSpecName())) {
|
|
|
queryBomIdList = bomSpecService.listObject(BomSpec::getBomId, i -> i
|
|
|
.like(StrUtil.isNotBlank(dto.getColour()), BomSpec::getColour, dto.getColour())
|
|
@@ -67,10 +72,10 @@ public class BomServiceImpl extends ServiceImpl<BomMapper, Bom> implements BomSe
|
|
|
}
|
|
|
}
|
|
|
if (ObjectUtil.isNotNull(dto.getBomClassifyId())) {
|
|
|
- queryBomClassifyIdList.addAll(bomClassifyService.getChildrenIdList(dto.getBomClassifyId()));
|
|
|
+ queryBomClassifyIdSet.addAll(bomClassifyService.getChildrenIdList(dto.getBomClassifyId()));
|
|
|
}
|
|
|
if (ObjectUtil.isNotNull(dto.getBomClassifyIdList())) {
|
|
|
- queryBomClassifyIdList.addAll(bomClassifyService.getChildrenIdList(dto.getBomClassifyIdList()));
|
|
|
+ queryBomClassifyIdSet.addAll(bomClassifyService.getChildrenIdList(dto.getBomClassifyIdList()));
|
|
|
}
|
|
|
|
|
|
Page<BomVo> page = Sql.create(BomVo.class)
|
|
@@ -85,7 +90,7 @@ public class BomServiceImpl extends ServiceImpl<BomMapper, Bom> implements BomSe
|
|
|
.eq(Bom::getFrontGrain, dto.getFrontGrain())
|
|
|
.eq(Bom::getReverseGrain, dto.getReverseGrain())
|
|
|
.in(Bom::getId, queryBomIdList)
|
|
|
- .in(Bom::getBomClassifyId, queryBomClassifyIdList)
|
|
|
+ .in(Bom::getBomClassifyId, queryBomClassifyIdSet)
|
|
|
.page(dto);
|
|
|
List<BomVo> records = page.getRecords();
|
|
|
if (records.isEmpty()) {
|