|
@@ -69,6 +69,8 @@ public class DeviceInfoServiceImpl extends ServiceImpl<DeviceInfoMapper, DeviceI
|
|
|
private final DeviceErrorsRecordServiceImpl deviceErrorsRecordService;
|
|
|
private final DeviceDataServiceImpl deviceDataService;
|
|
|
|
|
|
+ private final GoodsDeviceService goodsDeviceService;
|
|
|
+
|
|
|
private final RedisService<String> redisService;
|
|
|
|
|
|
private final String keyPrefix = "device:history:";
|
|
@@ -643,7 +645,18 @@ public class DeviceInfoServiceImpl extends ServiceImpl<DeviceInfoMapper, DeviceI
|
|
|
* @return
|
|
|
*/
|
|
|
private DeviceInfoDto.DeviceDataCountVO dataCount5(DeviceInfoDto.DeviceDataCountDTO dto) {
|
|
|
+ Long deviceId = dto.getDeviceId();
|
|
|
DeviceInfoDto.DeviceDataCountVO vo = new DeviceInfoDto.DeviceDataCountVO();
|
|
|
+ DeviceStatus deviceStatus = deviceStatusService.getById(dto.getDeviceId());
|
|
|
+ DeviceInfoDto.GoodsData goodsData = copy(DeviceInfoDto.GoodsData.class, deviceStatus);
|
|
|
+ //在售商品种类
|
|
|
+ //根据设备ID查商品id
|
|
|
+ GoodsDeviceDto.SelectList selectList = new GoodsDeviceDto.SelectList();
|
|
|
+ selectList.setDeviceId(deviceId);
|
|
|
+ R<List<GoodsDeviceDto.Vo>> r = R.feignCheck(goodsDeviceService.list(selectList));
|
|
|
+ List<GoodsDeviceDto.Vo> goodsDeviceList = r.getData();
|
|
|
+ goodsData.setCategoryNum(CollUtil.isNotEmpty(goodsDeviceList) ? goodsDeviceList.size() : 0);
|
|
|
+ vo.setGoodsData(goodsData);
|
|
|
return vo;
|
|
|
}
|
|
|
|