|
@@ -11,6 +11,7 @@ import cn.iocoder.yudao.framework.common.util.collection.MapUtils;
|
|
|
import cn.iocoder.yudao.framework.common.util.date.DateUtils;
|
|
import cn.iocoder.yudao.framework.common.util.date.DateUtils;
|
|
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
|
|
import cn.iocoder.yudao.framework.datapermission.core.util.DataPermissionUtils;
|
|
import cn.iocoder.yudao.framework.datapermission.core.util.DataPermissionUtils;
|
|
|
|
|
+import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
|
|
import cn.iocoder.yudao.module.pms.controller.admin.iotdevicerunlog.vo.IotDeviceRunLogRespVO;
|
|
import cn.iocoder.yudao.module.pms.controller.admin.iotdevicerunlog.vo.IotDeviceRunLogRespVO;
|
|
|
import cn.iocoder.yudao.module.pms.controller.admin.iotlockstock.vo.IotLockStockPageReqVO;
|
|
import cn.iocoder.yudao.module.pms.controller.admin.iotlockstock.vo.IotLockStockPageReqVO;
|
|
|
import cn.iocoder.yudao.module.pms.controller.admin.iotmaintenancebom.vo.IotMaintenanceBomPageReqVO;
|
|
import cn.iocoder.yudao.module.pms.controller.admin.iotmaintenancebom.vo.IotMaintenanceBomPageReqVO;
|
|
@@ -67,6 +68,7 @@ import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.
|
|
|
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertListByFlatMap;
|
|
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertListByFlatMap;
|
|
|
import static cn.iocoder.yudao.module.pms.enums.ErrorCodeConstant.IOT_MAIN_WORK_ORDER_EXECUTED;
|
|
import static cn.iocoder.yudao.module.pms.enums.ErrorCodeConstant.IOT_MAIN_WORK_ORDER_EXECUTED;
|
|
|
import static cn.iocoder.yudao.module.pms.enums.ErrorCodeConstant.IOT_MAIN_WORK_ORDER_NOT_EXISTS;
|
|
import static cn.iocoder.yudao.module.pms.enums.ErrorCodeConstant.IOT_MAIN_WORK_ORDER_NOT_EXISTS;
|
|
|
|
|
+import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.DEPT_NOT_FOUND;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 保养工单 Service 实现类
|
|
* 保养工单 Service 实现类
|
|
@@ -397,42 +399,59 @@ public class IotMainWorkOrderServiceImpl implements IotMainWorkOrderService {
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public PageResult<IotDeviceRespVO> deviceMainDistances(IotMainWorkOrderPageReqVO pageReqVO) {
|
|
public PageResult<IotDeviceRespVO> deviceMainDistances(IotMainWorkOrderPageReqVO pageReqVO) {
|
|
|
|
|
+ // 左侧组织树 组织层级查询
|
|
|
|
|
+ Set<Long> ids = new HashSet<>();
|
|
|
|
|
+ if (ObjUtil.isEmpty(pageReqVO.getDeptId())) {
|
|
|
|
|
+ // 如果没有传 deptId 查询当前登录人所属部门id
|
|
|
|
|
+ Long loginUserDeptId = SecurityFrameworkUtils.getLoginUserDeptId();
|
|
|
|
|
+ pageReqVO.setDeptId(loginUserDeptId);
|
|
|
|
|
+ }
|
|
|
|
|
+ Long deptId = pageReqVO.getDeptId();
|
|
|
|
|
+ ids = deptService.getChildDeptIdListFromCache(deptId);
|
|
|
|
|
+ ids.add(deptId);
|
|
|
|
|
+ if (CollUtil.isEmpty(ids)) {
|
|
|
|
|
+ return PageResult.empty();
|
|
|
|
|
+ }
|
|
|
|
|
+ // 查询条件 device_code 或 device_name
|
|
|
|
|
+ Set<Long> queryDeviceIds = new HashSet<>();
|
|
|
|
|
+ String deviceCode = pageReqVO.getDeviceCode();
|
|
|
|
|
+ String deviceName = pageReqVO.getDeviceName();
|
|
|
|
|
+
|
|
|
|
|
+ Set<Long> deviceCategoryIds = new HashSet<>();
|
|
|
|
|
+ Map<Long, Long> deviceCategoryPair = new HashMap<>();
|
|
|
|
|
+
|
|
|
|
|
+ // 需要根据查询条件中的设备查询对应的保养计划明细 运行记录累计值
|
|
|
|
|
+ IotDevicePageReqVO reqVO = new IotDevicePageReqVO();
|
|
|
|
|
+ if (StrUtil.isNotBlank(deviceCode)) {
|
|
|
|
|
+ reqVO.setDeviceCode(deviceCode);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (StrUtil.isNotBlank(deviceName)) {
|
|
|
|
|
+ reqVO.setDeviceName(deviceName);
|
|
|
|
|
+ }
|
|
|
|
|
+ reqVO.setDeptIds(new ArrayList<>(ids));
|
|
|
|
|
+ List<IotDeviceDO> qualifiedDevices = iotDeviceMapper.selectList(reqVO);
|
|
|
|
|
+ if (CollUtil.isNotEmpty(qualifiedDevices)) {
|
|
|
|
|
+ qualifiedDevices.forEach(device -> {
|
|
|
|
|
+ queryDeviceIds.add(device.getId());
|
|
|
|
|
+ // 设置设备类别
|
|
|
|
|
+ deviceCategoryIds.add(device.getAssetClass());
|
|
|
|
|
+ deviceCategoryPair.put(device.getId(), device.getAssetClass());
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// 20250624 只查询保养计划中的设备 不查询保养工单表
|
|
// 20250624 只查询保养计划中的设备 不查询保养工单表
|
|
|
// 所有保养计划 + 保养工单 明细中待保养的最近距离 里程/时间/自然日
|
|
// 所有保养计划 + 保养工单 明细中待保养的最近距离 里程/时间/自然日
|
|
|
// 查询所有保养工单明细中所有设备的累计运行里程 累计运行时间 如果保养项有设置 里程/时间规则 可以计算保养距离
|
|
// 查询所有保养工单明细中所有设备的累计运行里程 累计运行时间 如果保养项有设置 里程/时间规则 可以计算保养距离
|
|
|
- IotMainWorkOrderBomPageReqVO bomReqVO = new IotMainWorkOrderBomPageReqVO();
|
|
|
|
|
- // 不查询 已执行 临时创建 的工单
|
|
|
|
|
- IotMainWorkOrderPageReqVO reqVO = new IotMainWorkOrderPageReqVO();
|
|
|
|
|
- reqVO.setResult(1);
|
|
|
|
|
- reqVO.setType(1);
|
|
|
|
|
- List<Long> workOrderIds = new ArrayList<>();
|
|
|
|
|
-
|
|
|
|
|
- List<IotMainWorkOrderBomDO> workOrderBomS = new ArrayList<>();
|
|
|
|
|
- if (CollUtil.isNotEmpty(workOrderIds)) {
|
|
|
|
|
- bomReqVO.setWorkOrderIds(workOrderIds);
|
|
|
|
|
- workOrderBomS= iotMainWorkOrderBomMapper.selectList(bomReqVO);
|
|
|
|
|
- }
|
|
|
|
|
- Set<Long> deviceIds = CollUtil.isEmpty(workOrderBomS)
|
|
|
|
|
- ? new HashSet<>()
|
|
|
|
|
- : workOrderBomS.stream()
|
|
|
|
|
- .map(IotMainWorkOrderBomDO::getDeviceId) // 获取 deviceId
|
|
|
|
|
- .filter(Objects::nonNull) // 过滤非空值
|
|
|
|
|
- .collect(Collectors.toSet()); // 收集到 Set 中
|
|
|
|
|
- Set<Long> orderDeviceIds = new HashSet<>();
|
|
|
|
|
- orderDeviceIds.addAll(deviceIds);
|
|
|
|
|
|
|
+ Set<Long> deviceIds = new HashSet<>(); // 收集到 Set 中
|
|
|
// 查询保养计划明细中不包含 deviceIds 的设备id集合
|
|
// 查询保养计划明细中不包含 deviceIds 的设备id集合
|
|
|
- List<IotMaintenanceBomDO> mainBomS = new ArrayList<>();
|
|
|
|
|
Set<Long> mainBomDeviceIds = new HashSet<>();
|
|
Set<Long> mainBomDeviceIds = new HashSet<>();
|
|
|
IotMaintenanceBomPageReqVO mainBomReqVO = new IotMaintenanceBomPageReqVO();
|
|
IotMaintenanceBomPageReqVO mainBomReqVO = new IotMaintenanceBomPageReqVO();
|
|
|
- if (CollUtil.isNotEmpty(deviceIds)) {
|
|
|
|
|
- mainBomReqVO.setDeviceIds(new ArrayList<>(deviceIds));
|
|
|
|
|
- mainBomS = iotMaintenanceBomMapper.selectAlarmList(mainBomReqVO);
|
|
|
|
|
- } else {
|
|
|
|
|
- mainBomS = iotMaintenanceBomMapper.selectList(mainBomReqVO);
|
|
|
|
|
|
|
+ if (CollUtil.isNotEmpty(queryDeviceIds)) {
|
|
|
|
|
+ mainBomReqVO.setDeviceIds(new ArrayList<>(queryDeviceIds));
|
|
|
}
|
|
}
|
|
|
|
|
+ List<IotMaintenanceBomDO> mainBomS = iotMaintenanceBomMapper.selectList(mainBomReqVO);
|
|
|
Set<String> boundedMultiAttrNames = new HashSet<>();
|
|
Set<String> boundedMultiAttrNames = new HashSet<>();
|
|
|
- Set<Long> deviceCategoryIds = new HashSet<>();
|
|
|
|
|
- Map<Long, Long> deviceCategoryPair = new HashMap<>();
|
|
|
|
|
|
|
+
|
|
|
if (CollUtil.isNotEmpty(mainBomS)) {
|
|
if (CollUtil.isNotEmpty(mainBomS)) {
|
|
|
mainBomDeviceIds = CollUtil.isEmpty(mainBomS)
|
|
mainBomDeviceIds = CollUtil.isEmpty(mainBomS)
|
|
|
? Collections.emptySet()
|
|
? Collections.emptySet()
|
|
@@ -453,6 +472,7 @@ public class IotMainWorkOrderServiceImpl implements IotMainWorkOrderService {
|
|
|
});
|
|
});
|
|
|
// 查询所有设备类别id
|
|
// 查询所有设备类别id
|
|
|
// 组装bom关联的设备信息
|
|
// 组装bom关联的设备信息
|
|
|
|
|
+ /*
|
|
|
Map<Long, IotDeviceRespVO> deviceMap = iotDeviceService.getDeviceMap(convertListByFlatMap(mainBomS,
|
|
Map<Long, IotDeviceRespVO> deviceMap = iotDeviceService.getDeviceMap(convertListByFlatMap(mainBomS,
|
|
|
bom -> Stream.of(bom.getDeviceId())));
|
|
bom -> Stream.of(bom.getDeviceId())));
|
|
|
if (CollUtil.isNotEmpty(deviceMap)) {
|
|
if (CollUtil.isNotEmpty(deviceMap)) {
|
|
@@ -460,7 +480,7 @@ public class IotMainWorkOrderServiceImpl implements IotMainWorkOrderService {
|
|
|
deviceCategoryIds.add(v.getAssetClass());
|
|
deviceCategoryIds.add(v.getAssetClass());
|
|
|
deviceCategoryPair.put(k, v.getAssetClass());
|
|
deviceCategoryPair.put(k, v.getAssetClass());
|
|
|
});
|
|
});
|
|
|
- }
|
|
|
|
|
|
|
+ } */
|
|
|
}
|
|
}
|
|
|
deviceIds.addAll(mainBomDeviceIds);
|
|
deviceIds.addAll(mainBomDeviceIds);
|
|
|
if (CollUtil.isEmpty(deviceIds)){
|
|
if (CollUtil.isEmpty(deviceIds)){
|
|
@@ -470,8 +490,20 @@ public class IotMainWorkOrderServiceImpl implements IotMainWorkOrderService {
|
|
|
// 查询 运行记录模板中包含多个累计 时长 公里数 属性的集合
|
|
// 查询 运行记录模板中包含多个累计 时长 公里数 属性的集合
|
|
|
List<IotDeviceRunLogRespVO> multipleAccumulatedData = new ArrayList<>();
|
|
List<IotDeviceRunLogRespVO> multipleAccumulatedData = new ArrayList<>();
|
|
|
if (CollUtil.isNotEmpty(deviceIds) && CollUtil.isNotEmpty(boundedMultiAttrNames)) {
|
|
if (CollUtil.isNotEmpty(deviceIds) && CollUtil.isNotEmpty(boundedMultiAttrNames)) {
|
|
|
- multipleAccumulatedData = iotDeviceRunLogService.multipleAccumulatedData(deviceIds, boundedMultiAttrNames, null);
|
|
|
|
|
|
|
+ // multipleAccumulatedData = iotDeviceRunLogService.multipleAccumulatedData(deviceIds, boundedMultiAttrNames, null);
|
|
|
}
|
|
}
|
|
|
|
|
+ List<IotDeviceRunLogRespVO> deviceAttrRunLogs = new ArrayList<>();
|
|
|
|
|
+ if (CollUtil.isNotEmpty(deviceIds)) {
|
|
|
|
|
+ deviceAttrRunLogs = iotDeviceRunLogService.deviceAttrRunLogsSearch(new ArrayList<>(deviceIds));
|
|
|
|
|
+ if (CollUtil.isNotEmpty(deviceAttrRunLogs) && CollUtil.isNotEmpty(boundedMultiAttrNames)) {
|
|
|
|
|
+ deviceAttrRunLogs.forEach(runLog -> {
|
|
|
|
|
+ if (boundedMultiAttrNames.contains(runLog.getPointName())) {
|
|
|
|
|
+ multipleAccumulatedData.add(runLog);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// key(设备id-累计时长属性名称) value时长属性累计时长数值
|
|
// key(设备id-累计时长属性名称) value时长属性累计时长数值
|
|
|
Map<String, BigDecimal> tempTotalRunDataPair = new HashMap<>();
|
|
Map<String, BigDecimal> tempTotalRunDataPair = new HashMap<>();
|
|
|
if (CollUtil.isNotEmpty(multipleAccumulatedData)) {
|
|
if (CollUtil.isNotEmpty(multipleAccumulatedData)) {
|
|
@@ -482,8 +514,11 @@ public class IotMainWorkOrderServiceImpl implements IotMainWorkOrderService {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 查询 运行记录模板中 正常的累计时长 公里数集合
|
|
// 查询 运行记录模板中 正常的累计时长 公里数集合
|
|
|
- Map<Long, IotDeviceRunLogRespVO> deviceRunLogMap =
|
|
|
|
|
- iotDeviceRunLogService.getDeviceRunLogMapAlone(new ArrayList<>(deviceIds), new ArrayList<>(deviceCategoryIds), deviceCategoryPair, null);
|
|
|
|
|
|
|
+ Map<Long, IotDeviceRunLogRespVO> deviceRunLogMap = new HashMap<>();
|
|
|
|
|
+ if (CollUtil.isNotEmpty(deviceIds) && CollUtil.isNotEmpty(deviceCategoryIds)) {
|
|
|
|
|
+ deviceRunLogMap =
|
|
|
|
|
+ iotDeviceRunLogService.getDeviceRunLogMapSearch(new ArrayList<>(deviceIds), new ArrayList<>(deviceCategoryIds), deviceCategoryPair, deviceAttrRunLogs);
|
|
|
|
|
+ }
|
|
|
// 以设备为维度统计每个设备相关的保养项的最近保养距离 key设备id value设备下每个保养项的的最小保养距离集合
|
|
// 以设备为维度统计每个设备相关的保养项的最近保养距离 key设备id value设备下每个保养项的的最小保养距离集合
|
|
|
Map<Long, List<Map<String, Object>>> orderDistancePair = new HashMap<>();
|
|
Map<Long, List<Map<String, Object>>> orderDistancePair = new HashMap<>();
|
|
|
// 设备保养明细 key设备id value设备保养工单明细下所有保养规则数据最小值
|
|
// 设备保养明细 key设备id value设备保养工单明细下所有保养规则数据最小值
|
|
@@ -609,73 +644,6 @@ public class IotMainWorkOrderServiceImpl implements IotMainWorkOrderService {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- // 计算出每个保养工单明细的不同保养规则的保养距离最小值
|
|
|
|
|
- if (CollUtil.isNotEmpty(workOrderBomS)) {
|
|
|
|
|
- workOrderBomS.forEach(bom -> {
|
|
|
|
|
- BigDecimal runningTimeDistance = null;
|
|
|
|
|
- BigDecimal runningKiloDistance = null;
|
|
|
|
|
- BigDecimal naturalDateDistance = null;
|
|
|
|
|
- // 计算每个保养项 每个保养规则下的 距离保养时间
|
|
|
|
|
- if (ObjUtil.isNotEmpty(bom.getRunningTimeRule()) && 0 == bom.getRunningTimeRule()) {
|
|
|
|
|
- // 运行时间保养规则
|
|
|
|
|
- if (deviceRunLogMap.containsKey(bom.getDeviceId())) {
|
|
|
|
|
- BigDecimal totalRunTime = deviceRunLogMap.get(bom.getDeviceId()).getTotalRunTime();
|
|
|
|
|
- BigDecimal lastRunningTime = bom.getLastRunningTime(); // 上次保养运行时间
|
|
|
|
|
- BigDecimal runningTimePeriod = bom.getNextRunningTime(); // 运行时间周期
|
|
|
|
|
- BigDecimal timePeriodLead = bom.getTimePeriodLead(); // 运行时间周期提前量
|
|
|
|
|
- // runningTimeDistance = (lastRunningTime.add(runningTimePeriod).subtract(timePeriodLead)).subtract(totalRunTime);
|
|
|
|
|
- runningTimeDistance = runningTimePeriod.subtract(totalRunTime.subtract(lastRunningTime));
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- if (ObjUtil.isNotEmpty(bom.getMileageRule()) && 0 == bom.getMileageRule()) {
|
|
|
|
|
- // 运行里程保养规则
|
|
|
|
|
- // 累计运行里程规则 累计运行里程 >= (上次保养运行里程+运行里程周期-提前量)
|
|
|
|
|
- if (deviceRunLogMap.containsKey(bom.getDeviceId())) {
|
|
|
|
|
- BigDecimal totalMileage = deviceRunLogMap.get(bom.getDeviceId()).getTotalMileage();
|
|
|
|
|
- BigDecimal lastRunningKilo = bom.getLastRunningKilometers(); // 上次保养运行里程
|
|
|
|
|
- BigDecimal runningKiloPeriod = bom.getNextRunningKilometers(); // 运行里程周期
|
|
|
|
|
- BigDecimal kiloCycleLead = bom.getKiloCycleLead(); // 运行里程周期提前量
|
|
|
|
|
- // runningKiloDistance = (lastRunningKilo.add(runningKiloPeriod).subtract(kiloCycleLead)).subtract(totalMileage);
|
|
|
|
|
- runningKiloDistance = runningKiloPeriod.subtract(totalMileage.subtract(lastRunningKilo));
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- if (ObjUtil.isNotEmpty(bom.getNaturalDateRule()) && 0 == bom.getNaturalDateRule()) {
|
|
|
|
|
- // 自然日期保养规则
|
|
|
|
|
- LocalDateTime lastNaturalDate = bom.getLastNaturalDate(); // 上次保养自然日期
|
|
|
|
|
- BigDecimal naturalDatePeriod = bom.getNextNaturalDate(); // 自然日周期
|
|
|
|
|
- BigDecimal natualDateLead = bom.getNaturalDatePeriodLead(); // 自然日周期提前量
|
|
|
|
|
- if (ObjUtil.isNotEmpty(lastNaturalDate) && ObjUtil.isNotEmpty(naturalDatePeriod) && ObjUtil.isNotEmpty(natualDateLead)) {
|
|
|
|
|
- // 计算有效天数 = 自然日周期 - 提前量
|
|
|
|
|
- long days = naturalDatePeriod.longValue(); // 转为长整型天数
|
|
|
|
|
- // 计算目标日期:上次保养日期 + 有效天数(注意:LocalDateTime加天数会自动处理日期进位)
|
|
|
|
|
- LocalDateTime targetDate = lastNaturalDate.plusDays(days);
|
|
|
|
|
- // 获取当前日期时间
|
|
|
|
|
- LocalDateTime now = LocalDateTime.now();
|
|
|
|
|
- // 计算日期差值(以天为单位)
|
|
|
|
|
- naturalDateDistance = new BigDecimal(ChronoUnit.DAYS.between(now, targetDate));
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- // 找出距离0最近的数,作为工单的最近保养距离数据
|
|
|
|
|
- Object closet = chooseNearestDistance(runningTimeDistance, runningKiloDistance, naturalDateDistance);
|
|
|
|
|
- Map<String, Object> tempDistance = new HashMap<>();
|
|
|
|
|
- if (closet == runningTimeDistance) {
|
|
|
|
|
- tempDistance.put("H", closet);
|
|
|
|
|
- } else if (closet == runningKiloDistance) {
|
|
|
|
|
- tempDistance.put("KM", closet);
|
|
|
|
|
- } else if (closet == naturalDateDistance) {
|
|
|
|
|
- tempDistance.put("D", closet);
|
|
|
|
|
- }
|
|
|
|
|
- if (orderDistancePair.containsKey(bom.getDeviceId())) {
|
|
|
|
|
- List<Map<String, Object>> tempDistances = orderDistancePair.get(bom.getDeviceId());
|
|
|
|
|
- tempDistances.add(tempDistance);
|
|
|
|
|
- orderDistancePair.put(bom.getDeviceId(), tempDistances);
|
|
|
|
|
- } else {
|
|
|
|
|
- List<Map<String, Object>> tempDistances = new ArrayList<>();
|
|
|
|
|
- tempDistances.add(tempDistance);
|
|
|
|
|
- orderDistancePair.put(bom.getDeviceId(), tempDistances);
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
// 以设备id 为维度 统计每个保养工单明细中 距离最近的保养数据
|
|
// 以设备id 为维度 统计每个保养工单明细中 距离最近的保养数据
|
|
|
resultMap = findClosestToZero(orderDistancePair);
|
|
resultMap = findClosestToZero(orderDistancePair);
|
|
|
// 根据保养项规则应该生成保养工单的设备id集合
|
|
// 根据保养项规则应该生成保养工单的设备id集合
|
|
@@ -708,15 +676,8 @@ public class IotMainWorkOrderServiceImpl implements IotMainWorkOrderService {
|
|
|
// 排序后输出一个 List<Long> 类型的集合,排序对应上面的排序规则
|
|
// 排序后输出一个 List<Long> 类型的集合,排序对应上面的排序规则
|
|
|
List<Long> sortedDeviceIds = sortByNumericValue(resultMap);
|
|
List<Long> sortedDeviceIds = sortByNumericValue(resultMap);
|
|
|
try {
|
|
try {
|
|
|
- // 左侧组织树 组织层级查询
|
|
|
|
|
- Set<Long> ids = new HashSet<>();
|
|
|
|
|
- if (Objects.nonNull(pageReqVO.getDeptId())) {
|
|
|
|
|
- ids = deptService.getChildDeptIdListFromCache(pageReqVO.getDeptId());
|
|
|
|
|
- ids.add(pageReqVO.getDeptId());
|
|
|
|
|
- }
|
|
|
|
|
- // 不查询保养订单表 暂时传一个不会出现的设备id
|
|
|
|
|
- orderDeviceIds.add(Long.MIN_VALUE);
|
|
|
|
|
- List<IotDeviceRespVO> alarmDevices = iotDeviceMapper.deviceAlarmDistances(sortedDeviceIds, orderDeviceIds, mainBomDeviceIds);
|
|
|
|
|
|
|
+ List<IotDeviceRespVO> alarmDevices = iotDeviceMapper.deviceAlarmDistancesSearch(sortedDeviceIds, mainBomDeviceIds);
|
|
|
|
|
+
|
|
|
// 处理当前分页数据 拼接上已经排序的 筛选出的设备保养项 最小保养距离
|
|
// 处理当前分页数据 拼接上已经排序的 筛选出的设备保养项 最小保养距离
|
|
|
List<Long> alarmDeviceIds = new ArrayList<>();
|
|
List<Long> alarmDeviceIds = new ArrayList<>();
|
|
|
Map<Long, IotDeviceRespVO> alarmDevicePair = new HashMap<>();
|
|
Map<Long, IotDeviceRespVO> alarmDevicePair = new HashMap<>();
|