|
@@ -43,10 +43,7 @@ import com.xy.sys.EnumDataClearSize;
|
|
|
import com.xy.util.ExcelUtils;
|
|
|
import com.xy.utils.*;
|
|
|
import com.xy.utils.Enum.AlgorithmTypeEnum;
|
|
|
-import com.xy.utils.enums.DeviceActiveStateEnum;
|
|
|
-import com.xy.utils.enums.DeviceLockState;
|
|
|
-import com.xy.utils.enums.DeviceNetSateType;
|
|
|
-import com.xy.utils.enums.DeviceTypeEnum;
|
|
|
+import com.xy.utils.enums.*;
|
|
|
import com.xy.vo.DeviceQueryVO;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
@@ -1066,14 +1063,20 @@ public class DeviceInfoServiceImpl extends ServiceImpl<DeviceInfoMapper, DeviceI
|
|
|
mercHomeStatisticalVO.setOfflineNum(offlineNum);
|
|
|
|
|
|
//锁机、未锁机
|
|
|
- Map<Integer, Long> countLockLstateMap = deviceStatuses.stream().collect(Collectors
|
|
|
- .groupingBy(DeviceStatus::getLockStateL, Collectors.counting()));
|
|
|
- Long lockLStateNum = countLockLstateMap.get(DeviceLockState.LOCK.getCode());
|
|
|
- Long unLockLStateNum = countLockLstateMap.get(DeviceLockState.UN_LOCK.getCode());
|
|
|
- mercHomeStatisticalVO.setOperatingNum(unLockLStateNum == null ? 0 : unLockLStateNum.intValue());
|
|
|
- mercHomeStatisticalVO.setClosedNum(lockLStateNum == null ? 0 : lockLStateNum.intValue());
|
|
|
+// Map<Integer, Long> countLockLstateMap = deviceStatuses.stream().collect(Collectors
|
|
|
+// .groupingBy(DeviceStatus::getLockStateL, Collectors.counting()));
|
|
|
+// Long lockLStateNum = countLockLstateMap.get(DeviceLockState.LOCK.getCode());
|
|
|
+// Long unLockLStateNum = countLockLstateMap.get(DeviceLockState.UN_LOCK.getCode());
|
|
|
+ Map<Integer, Long> countLockLstateMap = mercDevices.stream().collect(Collectors
|
|
|
+ .groupingBy(DeviceInfo::getBusyState, Collectors.counting()));
|
|
|
+ //运营
|
|
|
+ Long operatingNum = countLockLstateMap.get(DeviceBusySateType.OPERATING.getCode());
|
|
|
+ //停运
|
|
|
+ Long suspendedNum = countLockLstateMap.get(DeviceBusySateType.SUSPENDED.getCode());
|
|
|
+ mercHomeStatisticalVO.setOperatingNum(operatingNum == null ? 0 : operatingNum.intValue());
|
|
|
+ mercHomeStatisticalVO.setClosedNum(suspendedNum == null ? 0 : suspendedNum.intValue());
|
|
|
//待补货
|
|
|
- Integer deviceNum = R.feignCheckData(goodsDeviceService.countOutOfStockDevice(new GoodsDeviceDto.CountOutOfStockDevice().setMercId(mercId)));
|
|
|
+ Integer deviceNum = R.feignCheckData(goodsDeviceService.countOutOfStockDevice(new GoodsDeviceDto.CountOutOfStockDevice().setMercId(mercId).setDeviceIds(myDeviceIds)));
|
|
|
mercHomeStatisticalVO.setNeedToFillNum(deviceNum);
|
|
|
return R.ok(mercHomeStatisticalVO);
|
|
|
}
|