|
|
@@ -23,14 +23,9 @@ import java.util.Set;
|
|
|
@Service
|
|
|
public class MesStationTimeValidateService {
|
|
|
|
|
|
- private static final int DEFAULT_MAX_PROCESS_MINUTES = 15;
|
|
|
private static final int COOLING_OP023_TO_OP030_MINUTES = 30;
|
|
|
private static final int CROSS_OP150_TO_OP160_MINUTES = 15;
|
|
|
|
|
|
- private static final Set<String> MAX_DURATION_OPRNOS = new HashSet<>(Arrays.asList(
|
|
|
- "OP015", "OP200", "OP210", "OP260"
|
|
|
- ));
|
|
|
-
|
|
|
private static final Set<String> CROSS_TO_OP160_OPRNOS = new HashSet<>(Arrays.asList(
|
|
|
"OP160", "OP160A", "OP160B"
|
|
|
));
|
|
|
@@ -79,7 +74,7 @@ public class MesStationTimeValidateService {
|
|
|
if (crossErr != null) {
|
|
|
return crossErr;
|
|
|
}
|
|
|
- Integer maxMinutes = resolveMaxProcessMinutes(oldOprno, mesLineProcess);
|
|
|
+ Integer maxMinutes = resolveMaxProcessMinutes(mesLineProcess);
|
|
|
if (maxMinutes == null || maxMinutes <= 0) {
|
|
|
return null;
|
|
|
}
|
|
|
@@ -113,13 +108,15 @@ public class MesStationTimeValidateService {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
- private Integer resolveMaxProcessMinutes(String oldOprno, MesLineProcess mesLineProcess) {
|
|
|
+ /**
|
|
|
+ * 仅使用工序配置 max_duration:
|
|
|
+ * - >0:开启本工位超时校验
|
|
|
+ * - null 或 <=0:明确关闭(不做本工位超时校验)
|
|
|
+ */
|
|
|
+ private Integer resolveMaxProcessMinutes(MesLineProcess mesLineProcess) {
|
|
|
if (mesLineProcess.getMaxDuration() != null && mesLineProcess.getMaxDuration() > 0) {
|
|
|
return mesLineProcess.getMaxDuration();
|
|
|
}
|
|
|
- if (MAX_DURATION_OPRNOS.contains(normalizeOprno(oldOprno))) {
|
|
|
- return DEFAULT_MAX_PROCESS_MINUTES;
|
|
|
- }
|
|
|
return null;
|
|
|
}
|
|
|
|