|
|
|
@ -56,6 +56,23 @@ public class ActivitiesServiceImpl implements ActivitiesService {
|
|
|
|
|
if (CollectionUtils.isEmpty(item.getTerms())) {
|
|
|
|
|
throw new ApiException("装置列表信息不能为空");
|
|
|
|
|
}
|
|
|
|
|
List<String> errList = new ArrayList<>();
|
|
|
|
|
for (Terminals term : item.getTerms()) {
|
|
|
|
|
if (term.getId() != null) {
|
|
|
|
|
} else if (StringUtils.isNotBlank(term.getCmdid())) {
|
|
|
|
|
Terminals t = terminalExtService.getByCmdid(term.getCmdid());
|
|
|
|
|
if (t != null) {
|
|
|
|
|
term.setId(t.getId());
|
|
|
|
|
} else {
|
|
|
|
|
errList.add(term.getCmdid() + "装置不存在");
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
errList.add("装置列表信息有异常");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (errList.size() > 0) {
|
|
|
|
|
throw new ApiException(String.join(",", errList));
|
|
|
|
|
}
|
|
|
|
|
MntnActivitiesExample example = new MntnActivitiesExample();
|
|
|
|
|
MntnActivitiesExample.Criteria criteria = example.createCriteria();
|
|
|
|
|
criteria.andTitleEqualTo(item.getTitle());
|
|
|
|
|