|
@@ -92,7 +92,7 @@ public class MesProcessParamLimitCheckService {
|
|
|
}
|
|
}
|
|
|
List<NormalizedLimit> limits = limitMap.get("arc115");
|
|
List<NormalizedLimit> limits = limitMap.get("arc115");
|
|
|
for (MesProductCmt row : list) {
|
|
for (MesProductCmt row : list) {
|
|
|
- row.setLimitFlag(checkArcContent(row == null ? null : row.getContent(), limits) ? "1" : "0");
|
|
|
|
|
|
|
+ row.setLimitFlag(checkArcContent(row == null ? null : row.getContent(), limits, true) ? "1" : "0");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -133,7 +133,7 @@ public class MesProcessParamLimitCheckService {
|
|
|
|
|
|
|
|
public boolean checkCmtRecord(MesProductCmt row) {
|
|
public boolean checkCmtRecord(MesProductCmt row) {
|
|
|
Map<String, List<NormalizedLimit>> limitMap = loadLimitMap();
|
|
Map<String, List<NormalizedLimit>> limitMap = loadLimitMap();
|
|
|
- return checkArcContent(row == null ? null : row.getContent(), limitMap.get("arc115"));
|
|
|
|
|
|
|
+ return checkArcContent(row == null ? null : row.getContent(), limitMap.get("arc115"), true);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private Map<String, List<NormalizedLimit>> loadLimitMap() {
|
|
private Map<String, List<NormalizedLimit>> loadLimitMap() {
|
|
@@ -191,14 +191,14 @@ public class MesProcessParamLimitCheckService {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private boolean checkArcRow(MesProductArcWelding row, List<NormalizedLimit> limits) {
|
|
private boolean checkArcRow(MesProductArcWelding row, List<NormalizedLimit> limits) {
|
|
|
- return checkArcContent(row == null ? null : row.getContent(), limits);
|
|
|
|
|
|
|
+ return checkArcContent(row == null ? null : row.getContent(), limits, false);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private boolean checkArcContent(String content, List<NormalizedLimit> limits) {
|
|
|
|
|
|
|
+ private boolean checkArcContent(String content, List<NormalizedLimit> limits, boolean swapVoltageCurrent) {
|
|
|
if (limits == null || limits.isEmpty() || StringUtils.isBlank(content)) {
|
|
if (limits == null || limits.isEmpty() || StringUtils.isBlank(content)) {
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
- for (JSONObject sample : parseArcSamples(content)) {
|
|
|
|
|
|
|
+ for (JSONObject sample : parseArcSamples(content, swapVoltageCurrent)) {
|
|
|
for (NormalizedLimit limit : limits) {
|
|
for (NormalizedLimit limit : limits) {
|
|
|
for (String value : readArcValues(sample, limit.paramCode)) {
|
|
for (String value : readArcValues(sample, limit.paramCode)) {
|
|
|
if (isOutOfRange(value, limit)) {
|
|
if (isOutOfRange(value, limit)) {
|
|
@@ -210,7 +210,7 @@ public class MesProcessParamLimitCheckService {
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private List<JSONObject> parseArcSamples(String content) {
|
|
|
|
|
|
|
+ private List<JSONObject> parseArcSamples(String content, boolean swapVoltageCurrent) {
|
|
|
List<JSONObject> result = new ArrayList<>();
|
|
List<JSONObject> result = new ArrayList<>();
|
|
|
try {
|
|
try {
|
|
|
String text = StringUtils.trim(content);
|
|
String text = StringUtils.trim(content);
|
|
@@ -235,19 +235,19 @@ public class MesProcessParamLimitCheckService {
|
|
|
if (arr != null) {
|
|
if (arr != null) {
|
|
|
for (int i = 0; i < arr.size(); i++) {
|
|
for (int i = 0; i < arr.size(); i++) {
|
|
|
String record = arr.getString(i);
|
|
String record = arr.getString(i);
|
|
|
- appendOldArcRecord(record, result);
|
|
|
|
|
|
|
+ appendOldArcRecord(record, result, swapVoltageCurrent);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
return result;
|
|
return result;
|
|
|
}
|
|
}
|
|
|
- appendOldArcRecord(text, result);
|
|
|
|
|
|
|
+ appendOldArcRecord(text, result, swapVoltageCurrent);
|
|
|
return result;
|
|
return result;
|
|
|
} catch (Exception ex) {
|
|
} catch (Exception ex) {
|
|
|
return result;
|
|
return result;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private void appendOldArcRecord(String record, List<JSONObject> result) {
|
|
|
|
|
|
|
+ private void appendOldArcRecord(String record, List<JSONObject> result, boolean swapVoltageCurrent) {
|
|
|
if (StringUtils.isBlank(record)) {
|
|
if (StringUtils.isBlank(record)) {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
@@ -267,11 +267,12 @@ public class MesProcessParamLimitCheckService {
|
|
|
sample.put("v" + i, values[i]);
|
|
sample.put("v" + i, values[i]);
|
|
|
}
|
|
}
|
|
|
if (values.length >= 11) {
|
|
if (values.length >= 11) {
|
|
|
- sample.put("robot1Voltage", values[0]);
|
|
|
|
|
- sample.put("robot1Current", values[1]);
|
|
|
|
|
|
|
+ // 115弧焊/CMT 设备上报顺序为电流|电压,与 HEV 弧焊不同
|
|
|
|
|
+ sample.put("robot1Voltage", values[swapVoltageCurrent ? 1 : 0]);
|
|
|
|
|
+ sample.put("robot1Current", values[swapVoltageCurrent ? 0 : 1]);
|
|
|
sample.put("robot1Speed", values[2]);
|
|
sample.put("robot1Speed", values[2]);
|
|
|
- sample.put("robot2Voltage", values[5]);
|
|
|
|
|
- sample.put("robot2Current", values[6]);
|
|
|
|
|
|
|
+ sample.put("robot2Voltage", values[swapVoltageCurrent ? 6 : 5]);
|
|
|
|
|
+ sample.put("robot2Current", values[swapVoltageCurrent ? 5 : 6]);
|
|
|
sample.put("robot2Speed", values[7]);
|
|
sample.put("robot2Speed", values[7]);
|
|
|
sample.put("time", values[values.length - 1]);
|
|
sample.put("time", values[values.length - 1]);
|
|
|
}
|
|
}
|