|
@@ -115,8 +115,21 @@ public class DeviceInfoServiceImpl extends ServiceImpl<DeviceInfoMapper, DeviceI
|
|
public R<PageBean<DeviceInfoDto.MyDeviceInfo>> myDeviceList(@RequestBody @Validated DeviceInfoDto.MyDeviceDTO dto) {
|
|
public R<PageBean<DeviceInfoDto.MyDeviceInfo>> myDeviceList(@RequestBody @Validated DeviceInfoDto.MyDeviceDTO dto) {
|
|
PageBean pageBean = dto.getPage();
|
|
PageBean pageBean = dto.getPage();
|
|
String searchKey = dto.getSearchKey();
|
|
String searchKey = dto.getSearchKey();
|
|
|
|
+ Long mercId = dto.getMercId();
|
|
|
|
+ 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)) {
|
|
|
|
+ return R.ok(new PageBean<>());
|
|
|
|
+ }
|
|
|
|
+ deviceIds = goodsDevices.stream().map(GoodsDeviceDto.Vo::getDeviceId).collect(Collectors.toList());
|
|
|
|
+ }
|
|
LambdaQueryWrapper<DeviceInfo> lqw = new MybatisPlusQuery().eqWrapper(dto, DeviceInfo.class)
|
|
LambdaQueryWrapper<DeviceInfo> lqw = new MybatisPlusQuery().eqWrapper(dto, DeviceInfo.class)
|
|
.build();
|
|
.build();
|
|
|
|
+ lqw.in(CollUtil.isNotEmpty(deviceIds), DeviceInfo::getDeviceId, deviceIds);
|
|
lqw.and(StrUtil.isNotEmpty(searchKey), wrapper -> wrapper
|
|
lqw.and(StrUtil.isNotEmpty(searchKey), wrapper -> wrapper
|
|
.eq(DeviceInfo::getDeviceId, searchKey)
|
|
.eq(DeviceInfo::getDeviceId, searchKey)
|
|
.or()
|
|
.or()
|