|
@@ -116,21 +116,23 @@ public class DeviceInfoServiceImpl extends ServiceImpl<DeviceInfoMapper, DeviceI
|
|
|
PageBean pageBean = dto.getPage();
|
|
|
String searchKey = dto.getSearchKey();
|
|
|
Long mercId = dto.getMercId();
|
|
|
+ Integer type = dto.getType();
|
|
|
Long strategyId = dto.getStrategyId();
|
|
|
- List<Long> deviceIds = new ArrayList<>();
|
|
|
- if (strategyId != null) {
|
|
|
- GoodsDeviceDto.SelectList selectList = new GoodsDeviceDto.SelectList();
|
|
|
- selectList.setMercId(mercId).setPriceStrategyId(strategyId);
|
|
|
- List<GoodsDeviceDto.Vo> goodsDevices = R.feignCheckData(goodsDeviceService.list(selectList));
|
|
|
- if (CollUtil.isEmpty(goodsDevices)) {
|
|
|
- log.info("111111111111111111111111");
|
|
|
- return R.ok(new PageBean<>());
|
|
|
- }
|
|
|
- deviceIds = goodsDevices.stream().map(GoodsDeviceDto.Vo::getDeviceId).collect(Collectors.toList());
|
|
|
+
|
|
|
+ GoodsDeviceDto.SelectList selectList = new GoodsDeviceDto.SelectList();
|
|
|
+ selectList.setMercId(mercId).setPriceStrategyId(strategyId);
|
|
|
+ List<GoodsDeviceDto.Vo> goodsDevices = R.feignCheckData(goodsDeviceService.list(selectList));
|
|
|
+ if (type == 2 && CollUtil.isEmpty(goodsDevices)) {
|
|
|
+ //右侧已选的
|
|
|
+ return R.ok(new PageBean<>());
|
|
|
}
|
|
|
+ List<Long> deviceIds = goodsDevices.stream().map(GoodsDeviceDto.Vo::getDeviceId).collect(Collectors.toList());
|
|
|
+
|
|
|
LambdaQueryWrapper<DeviceInfo> lqw = new MybatisPlusQuery().eqWrapper(dto, DeviceInfo.class)
|
|
|
.build();
|
|
|
- lqw.in(CollUtil.isNotEmpty(deviceIds), DeviceInfo::getDeviceId, deviceIds);
|
|
|
+ lqw.in(type == 2 && CollUtil.isNotEmpty(deviceIds), DeviceInfo::getDeviceId, deviceIds);
|
|
|
+ //左侧排除掉已关联的
|
|
|
+ lqw.notIn(type == 1 && CollUtil.isNotEmpty(deviceIds), DeviceInfo::getDeviceId, deviceIds);
|
|
|
lqw.and(StrUtil.isNotEmpty(searchKey), wrapper -> wrapper
|
|
|
.eq(DeviceInfo::getDeviceId, searchKey)
|
|
|
.or()
|