|
@@ -77,6 +77,7 @@ import static com.xy.utils.PlusBeans.*;
|
|
|
public class DeviceInfoServiceImpl extends ServiceImpl<DeviceInfoMapper, DeviceInfo> implements DeviceInfoService {
|
|
|
|
|
|
private final CloudWalkApiService cloudWalkApiService;
|
|
|
+ private final AlgorithmService algorithmService;
|
|
|
/**
|
|
|
* 质检商户code
|
|
|
*/
|
|
@@ -761,6 +762,8 @@ public class DeviceInfoServiceImpl extends ServiceImpl<DeviceInfoMapper, DeviceI
|
|
|
List<GoodsDeviceDto.Vo> goodsDeviceList = R.feignCheckData(goodsService.queryGoodsDeviceInfo(new GoodsDto.QueryGoodsDeviceInfo().setMercId(mercId).setDeviceIds(deviceIds)));
|
|
|
Map<Long, List<GoodsDeviceDto.Vo>> deviceIdGoodsMap = goodsDeviceList.stream()
|
|
|
.collect(Collectors.groupingBy(GoodsDeviceDto.Vo::getDeviceId));
|
|
|
+ List<AlgorithmDto.ListNameId> algorithmList = R.feignCheckData(algorithmService.ListNameId());
|
|
|
+ Map<Long, String> algorithmListMap = algorithmList.stream().collect(Collectors.toMap(AlgorithmDto.ListNameId::getId, AlgorithmDto.ListNameId::getAlias));
|
|
|
|
|
|
for (DeviceInfoDto.MercHomeDeviceVo device : deviceInfos) {
|
|
|
Long dId = device.getDeviceId();
|
|
@@ -783,6 +786,12 @@ public class DeviceInfoServiceImpl extends ServiceImpl<DeviceInfoMapper, DeviceI
|
|
|
device.setFillNum(goodsDevice.stream().mapToInt(GoodsDeviceDto.Vo::getFillCount).sum());
|
|
|
}
|
|
|
}
|
|
|
+ //算法類型
|
|
|
+ Long algorithmId = device.getAlgorithmId();
|
|
|
+ if (algorithmId != null) {
|
|
|
+ String name = algorithmListMap.get(algorithmId);
|
|
|
+ device.setAlgorithmAlias(name);
|
|
|
+ }
|
|
|
|
|
|
//联网状态
|
|
|
Integer netState = deviceStatus == null ? DeviceNetSateType.DISCONNECT.getCode() : deviceStatus.getNetState();
|