|
|
@@ -208,9 +208,9 @@ public class GxtFaultCodesServiceImpl implements IGxtFaultCodesService
|
|
|
// 检查是否已存在相同场站、机型、故障条文的组合数据
|
|
|
GxtFaultCodes faultCodesByCondition = gxtFaultCodesMapper.selectGxtFaultCodesByStationModelBarcode(faultCodes);
|
|
|
if (faultCodesByCondition == null) {
|
|
|
- if(!checkFaultCodeUnique(faultCodes)){
|
|
|
+ if(!checkGxtFaultCodesByStationModelFaultCode(faultCodes)){
|
|
|
failureNum++;
|
|
|
- failureMsg.append("<br/>第" + row + "行故障代码已存在");
|
|
|
+ failureMsg.append("<br/>第" + row + "行场站、机型、故障代码组合已存在");
|
|
|
continue;
|
|
|
}
|
|
|
// 新增
|
|
|
@@ -222,9 +222,9 @@ public class GxtFaultCodesServiceImpl implements IGxtFaultCodesService
|
|
|
} else if (updateSupport) {
|
|
|
// 更新
|
|
|
faultCodes.setId(faultCodesByCondition.getId());
|
|
|
- if(!checkFaultCodeUnique(faultCodes)){
|
|
|
+ if(!checkGxtFaultCodesByStationModelFaultCode(faultCodes)){
|
|
|
failureNum++;
|
|
|
- failureMsg.append("<br/>第" + row + "行故障代码已存在");
|
|
|
+ failureMsg.append("<br/>第" + row + "行场站、机型、故障代码组合已存在");
|
|
|
continue;
|
|
|
}
|
|
|
faultCodes.setUpdateBy(operName);
|
|
|
@@ -262,4 +262,16 @@ public class GxtFaultCodesServiceImpl implements IGxtFaultCodesService
|
|
|
}
|
|
|
return true;
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public boolean checkGxtFaultCodesByStationModelFaultCode(GxtFaultCodes gxtFaultCodes) {
|
|
|
+ if(StringUtils.isNotEmpty(gxtFaultCodes.getFaultCode())){
|
|
|
+ Long id = gxtFaultCodes.getId() == null ? -1L : gxtFaultCodes.getId();
|
|
|
+ GxtFaultCodes info = gxtFaultCodesMapper.selectGxtFaultCodesByStationModelFaultCode(gxtFaultCodes);
|
|
|
+ if (info != null && info.getId().longValue() != id.longValue()) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ }
|
|
|
}
|