|
|
|
@ -18,6 +18,7 @@ import javax.annotation.Resource;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Optional;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
@Service
|
|
|
|
|
@Slf4j
|
|
|
|
@ -105,28 +106,30 @@ public class ParamBindServiceImpl implements ParamBindService {
|
|
|
|
|
}
|
|
|
|
|
IcdConfigType type = optionalType.get();
|
|
|
|
|
|
|
|
|
|
List<Rptparamindex> result = new ArrayList<>();
|
|
|
|
|
String param = type.getIedName() + type.getLdeviceInst() + "/" + type.getLnClass()
|
|
|
|
|
+ inst.getInst();
|
|
|
|
|
List<IcdConfigTypeAtt> attList = attRepository.findByIcdConfigTypeId(type.getId());
|
|
|
|
|
List<String> msgList = new ArrayList<>();
|
|
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
Rptparamindex rpt = optionalRpt.get();
|
|
|
|
|
rpt.setTablename(type.getTableName());
|
|
|
|
|
rpt.setColname(att.getColName());
|
|
|
|
|
rpt.setEqmid(item.getEqmid());
|
|
|
|
|
result.add(rpt);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Response resp = Response.success(result);
|
|
|
|
|
Response resp = Response.success(attList);
|
|
|
|
|
if (StringUtils.isBlank(type.getTableName())) {
|
|
|
|
|
resp.setErrorMsg("该ICD配置类型还未设置对应的tableName");
|
|
|
|
|
msgList.add("该ICD配置类型还未设置对应的tableName");
|
|
|
|
|
} else if (!type.getTableName().equals(modevType.getTablename())) {
|
|
|
|
|
resp.setErrorMsg("该ICD配置类型的tableName和该监测装置类型的tableName不一致");
|
|
|
|
|
msgList.add("该ICD配置类型的tableName和该监测装置类型的tableName不一致");
|
|
|
|
|
}
|
|
|
|
|
if (msgList.size() > 0) {
|
|
|
|
|
String message = msgList.stream().collect(Collectors.joining(","));
|
|
|
|
|
resp.setErrorMsg(message);
|
|
|
|
|
}
|
|
|
|
|
return resp;
|
|
|
|
|
}
|
|
|
|
@ -188,23 +191,8 @@ public class ParamBindServiceImpl implements ParamBindService {
|
|
|
|
|
result.setIedName(type.getIedName());
|
|
|
|
|
String param = type.getIedName() + type.getLdeviceInst() + "/" + type.getLnClass()
|
|
|
|
|
+ inst.getInst();
|
|
|
|
|
List<Rptparamindex> rptList = new ArrayList<>();
|
|
|
|
|
List<IcdConfigTypeAtt> attList = attRepository.findByIcdConfigTypeId(type.getId());
|
|
|
|
|
for (IcdConfigTypeAtt att : attList) {
|
|
|
|
|
String paramindex = param + "$" + att.getLastName();
|
|
|
|
|
Rptparamindex rpt = new Rptparamindex();
|
|
|
|
|
Optional<Rptparamindex> optionalRpt = rptparamindexRepository.findById(paramindex);
|
|
|
|
|
if (optionalRpt.isPresent()) {
|
|
|
|
|
rpt = optionalRpt.get();
|
|
|
|
|
} else {
|
|
|
|
|
rpt.setParamindex(paramindex);
|
|
|
|
|
}
|
|
|
|
|
rpt.setTablename(type.getTableName());
|
|
|
|
|
rpt.setColname(att.getColName());
|
|
|
|
|
rpt.setEqmid(eqmid);
|
|
|
|
|
rptList.add(rpt);
|
|
|
|
|
}
|
|
|
|
|
result.setRptList(rptList);
|
|
|
|
|
result.setAttList(attList);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|