perf: 优化数据

haikang
huangfeng 1 year ago
parent 45a02a9993
commit 4a8d3025a7

@ -10,6 +10,7 @@ import java.io.Serializable;
public class Response<T> implements Serializable {
private boolean success;
private String errorMsg;
private String warnMsg;
private T data;
public Response(T data) {

@ -113,11 +113,12 @@ public class ParamBindServiceImpl implements ParamBindService {
for (IcdConfigTypeAtt att : attList) {
if (StringUtils.isBlank(att.getColName())) {
msgList.add(att.getDoName() + "该属性还未配置绑定字段");
}
String paramindex = param + "$" + att.getLastName();
Optional<Rptparamindex> optionalRpt = rptparamindexRepository.findById(paramindex);
if (!optionalRpt.isPresent()) {
throw new Exception("未找到该Rptparamindex对象参引=" + paramindex);
} else {
String paramindex = param + "$" + att.getLastName();
Optional<Rptparamindex> optionalRpt = rptparamindexRepository.findById(paramindex);
if (!optionalRpt.isPresent()) {
throw new Exception("未找到该Rptparamindex对象参引=" + paramindex);
}
}
}
@ -125,11 +126,11 @@ public class ParamBindServiceImpl implements ParamBindService {
if (StringUtils.isBlank(type.getTableName())) {
msgList.add("该ICD配置类型还未设置对应的tableName");
} else if (!type.getTableName().equals(modevType.getTablename())) {
msgList.add("该ICD配置类型的tableName和该监测装置类型的tableName不一致");
msgList.add("该ICD配置类型的tableName(" + type.getTableName() + ")和该监测装置类型的tableName(" + modevType.getTablename() + ")不一致");
}
if (msgList.size() > 0) {
String message = msgList.stream().collect(Collectors.joining(","));
resp.setErrorMsg(message);
String message = msgList.stream().collect(Collectors.joining("\n\r"));
resp.setWarnMsg(message);
}
return resp;
}

@ -80,18 +80,18 @@ public class IcdXmlUtil {
config.addInst(lnInst);
config.addAtt(doName, param);
} else if ("ST".equals(fc)) {
IcdConfigType config = result.get(key);
if (config == null) {
config = IcdConfigType.builder()
.iedName(iedName)
.ldeviceInst(ldeviceInst)
.lnClass(lnClass)
.build();
result.put(key, config);
}
String param = fc + "$" + doName + "$" + lastname;
config.addInst(lnInst);
config.addAtt(doName, param);
// IcdConfigType config = result.get(key);
// if (config == null) {
// config = IcdConfigType.builder()
// .iedName(iedName)
// .ldeviceInst(ldeviceInst)
// .lnClass(lnClass)
// .build();
// result.put(key, config);
// }
// String param = fc + "$" + doName + "$" + lastname;
// config.addInst(lnInst);
// config.addAtt(doName, param);
}
}
}

Loading…
Cancel
Save