|
@@ -69,7 +69,6 @@ public class MachineController {
|
|
}
|
|
}
|
|
boolean isAbnormality = true;
|
|
boolean isAbnormality = true;
|
|
JSONArray nodes = query.getJSONArray("nodes");
|
|
JSONArray nodes = query.getJSONArray("nodes");
|
|
- Iterator<Object> it = nodes.iterator();
|
|
|
|
for(int i = 0;i< nodes.size();i++){
|
|
for(int i = 0;i< nodes.size();i++){
|
|
JSONObject jsonObject = nodes.getJSONObject(i);
|
|
JSONObject jsonObject = nodes.getJSONObject(i);
|
|
String processNo = jsonObject.getString("processId");
|
|
String processNo = jsonObject.getString("processId");
|
|
@@ -102,50 +101,51 @@ public class MachineController {
|
|
isAbnormality = false;
|
|
isAbnormality = false;
|
|
}
|
|
}
|
|
}else{
|
|
}else{
|
|
- ptsMachineLogs.setLogsProcessStatus(1);
|
|
+ ptsMachineLogs.setLogsProcessStatus(processNode.getNodeStatus());
|
|
}
|
|
}
|
|
ptsMachineLogs.setLogsProcessPrompt(processNode.getNodeStatus() == 0?"异常操作": null);
|
|
ptsMachineLogs.setLogsProcessPrompt(processNode.getNodeStatus() == 0?"异常操作": null);
|
|
ptsMachineLogs.setLogsProcessTime(logsProcessDate);
|
|
ptsMachineLogs.setLogsProcessTime(logsProcessDate);
|
|
ptsMachineLogs.setLogsCreateTime(new Date());
|
|
ptsMachineLogs.setLogsCreateTime(new Date());
|
|
|
|
|
|
if(i > 0){
|
|
if(i > 0){
|
|
-
|
|
+ if(produceProcess.getProcessType() == 1){
|
|
-
|
|
+
|
|
- int num = 0;
|
|
+
|
|
- ProduceProcess produceProcess2 = null;
|
|
+ int num = 0;
|
|
- JSONObject jsonObject2;
|
|
+ ProduceProcess produceProcess2 = null;
|
|
- String processNo2 = null;
|
|
+ JSONObject jsonObject2;
|
|
-
|
|
+ String processNo2 = null;
|
|
- jsonObject2 = nodes.getJSONObject(i-1);
|
|
+
|
|
- if(jsonObject2 != null){
|
|
+ jsonObject2 = nodes.getJSONObject(i-1);
|
|
- processNo2 = jsonObject.getString("processId");
|
|
+ if(jsonObject2 != null){
|
|
- produceProcess2 = produceService.getProduceProcess(produce.getProduceId(),processNo2.charAt(0));
|
|
+ processNo2 = jsonObject2.getString("processId");
|
|
- if(produceProcess2.getProcessType() == 1){
|
|
+ produceProcess2 = produceService.getProduceProcess(produce.getProduceId(),processNo2.charAt(0));
|
|
- if(produceProcess.getProcessSort() - produceProcess2.getProcessSort() != 1){
|
|
+ if(produceProcess2.getProcessType() == 1){
|
|
- ptsMachineLogs.setLogsProcessStatus(0);
|
|
+ if(produceProcess.getProcessSort() - produceProcess2.getProcessSort() != 1){
|
|
- ptsMachineLogs.setLogsErrorType(1);
|
|
+ ptsMachineLogs.setLogsProcessStatus(0);
|
|
- isAbnormality = false;
|
|
+ ptsMachineLogs.setLogsErrorType(1);
|
|
- }
|
|
+ isAbnormality = false;
|
|
- }else{
|
|
|
|
- for(int j = i-1;j<= i-1;j--){
|
|
|
|
- if(num == i){
|
|
|
|
- break;
|
|
|
|
}
|
|
}
|
|
- jsonObject2 = nodes.getJSONObject(j);
|
|
+ }else{
|
|
- if(jsonObject2 != null){
|
|
+ for(int j = i-1;j<= i-1;j--){
|
|
- processNo2 = jsonObject.getString("processId");
|
|
+ if(num == i){
|
|
- produceProcess2 = produceService.getProduceProcess(produce.getProduceId(),processNo2.charAt(0));
|
|
+ break;
|
|
- if(produceProcess2.getProcessType() == 1){
|
|
+ }
|
|
- break;
|
|
+ jsonObject2 = nodes.getJSONObject(j);
|
|
- }else{
|
|
+ if(jsonObject2 != null){
|
|
- if(produceProcess.getProcessSort() > produceProcess2.getProcessSort()){
|
|
+ processNo2 = jsonObject2.getString("processId");
|
|
- ptsMachineLogs.setLogsProcessStatus(0);
|
|
+ produceProcess2 = produceService.getProduceProcess(produce.getProduceId(),processNo2.charAt(0));
|
|
- ptsMachineLogs.setLogsErrorType(1);
|
|
+ if(produceProcess2.getProcessType() == 1){
|
|
- isAbnormality = false;
|
|
+ if(produceProcess.getProcessSort() > produceProcess2.getProcessSort()){
|
|
|
|
+ ptsMachineLogs.setLogsProcessStatus(0);
|
|
|
|
+ ptsMachineLogs.setLogsErrorType(2);
|
|
|
|
+ isAbnormality = false;
|
|
|
|
+ }
|
|
|
|
+ break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ num++;
|
|
}
|
|
}
|
|
- num++;
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -154,7 +154,7 @@ public class MachineController {
|
|
machineLogsService.addMachineLogs(ptsMachineLogs);
|
|
machineLogsService.addMachineLogs(ptsMachineLogs);
|
|
}
|
|
}
|
|
|
|
|
|
- if(isAbnormality){
|
|
+ if(!isAbnormality){
|
|
PtsMachine ptsMachine2 = new PtsMachine();
|
|
PtsMachine ptsMachine2 = new PtsMachine();
|
|
ptsMachine2.setMachineId(ptsMachine.getMachineId());
|
|
ptsMachine2.setMachineId(ptsMachine.getMachineId());
|
|
ptsMachine2.setMachineProcessState(2);
|
|
ptsMachine2.setMachineProcessState(2);
|