|
@@ -204,7 +204,7 @@ public class IotMainWorkOrderServiceImpl implements IotMainWorkOrderService {
|
|
|
BigDecimal runningKiloDistance = null;
|
|
|
BigDecimal naturalDateDistance = null;
|
|
|
// 计算每个保养项 每个保养规则下的 距离保养时间 单位 小时
|
|
|
- if (0 == bom.getRunningTimeRule()) {
|
|
|
+ if (ObjUtil.isNotEmpty(bom.getRunningTimeRule()) && 0 == bom.getRunningTimeRule()) {
|
|
|
// 运行时间保养规则
|
|
|
if (deviceRunLogMap.containsKey(bom.getDeviceId())) {
|
|
|
BigDecimal totalRunTime = deviceRunLogMap.get(bom.getDeviceId()).getTotalRunTime();
|
|
@@ -215,7 +215,7 @@ public class IotMainWorkOrderServiceImpl implements IotMainWorkOrderService {
|
|
|
runningTimeDistance = runningTimePeriod.subtract(totalRunTime.subtract(lastRunningTime));
|
|
|
}
|
|
|
}
|
|
|
- if (0 == bom.getMileageRule()) {
|
|
|
+ if (ObjUtil.isNotEmpty(bom.getMileageRule()) && 0 == bom.getMileageRule()) {
|
|
|
// 运行里程保养规则 累计运行里程规则 累计运行里程 >= (上次保养运行里程+运行里程周期-提前量)
|
|
|
if (deviceRunLogMap.containsKey(bom.getDeviceId())) {
|
|
|
BigDecimal totalMileage = deviceRunLogMap.get(bom.getDeviceId()).getTotalMileage();
|
|
@@ -226,7 +226,7 @@ public class IotMainWorkOrderServiceImpl implements IotMainWorkOrderService {
|
|
|
runningKiloDistance = runningKiloPeriod.subtract(totalMileage.subtract(lastRunningKilo));
|
|
|
}
|
|
|
}
|
|
|
- if (0 == bom.getNaturalDateRule()) {
|
|
|
+ if (ObjUtil.isNotEmpty(bom.getNaturalDateRule()) && 0 == bom.getNaturalDateRule()) {
|
|
|
// 自然日期保养规则
|
|
|
LocalDateTime lastNaturalDate = bom.getLastNaturalDate(); // 上次保养自然日期
|
|
|
BigDecimal naturalDatePeriod = bom.getNextNaturalDate(); // 自然日周期
|