|
@@ -217,7 +217,16 @@ public class IotWarnconfigServiceImpl implements IIotWarnconfigService {
|
|
|
|
|
|
|
|
List<IotWarnindicator> childrenList = item.getChildrenList();
|
|
List<IotWarnindicator> childrenList = item.getChildrenList();
|
|
|
if(childrenList != null && !childrenList.isEmpty()){
|
|
if(childrenList != null && !childrenList.isEmpty()){
|
|
|
|
|
+ Set<String> wiCodeSet = new HashSet<>();
|
|
|
for(IotWarnindicator iotWarnindicator : childrenList){
|
|
for(IotWarnindicator iotWarnindicator : childrenList){
|
|
|
|
|
+ String wiCode = iotWarnindicator.getWiCode();
|
|
|
|
|
+ if(StringUtils.isEmpty(wiCode)){
|
|
|
|
|
+ throw new BizException(ErrorCode.INVALID_PARAMETER.getCode(),"告警要素不能为空");
|
|
|
|
|
+ }
|
|
|
|
|
+ if(wiCodeSet.contains(wiCode)){
|
|
|
|
|
+ throw new BizException(ErrorCode.INVALID_PARAMETER.getCode(),"告警要素不能重复");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
iotWarnindicator.setWiBid(iotWarnindicator.getUUId());
|
|
iotWarnindicator.setWiBid(iotWarnindicator.getUUId());
|
|
|
iotWarnindicator.setWcBid(wcBid);
|
|
iotWarnindicator.setWcBid(wcBid);
|
|
|
iotWarnindicator.setTid(tid);
|
|
iotWarnindicator.setTid(tid);
|
|
@@ -227,6 +236,7 @@ public class IotWarnconfigServiceImpl implements IIotWarnconfigService {
|
|
|
iotWarnindicator.setWiParentbid(wiBid);
|
|
iotWarnindicator.setWiParentbid(wiBid);
|
|
|
|
|
|
|
|
insertList.add(iotWarnindicator);
|
|
insertList.add(iotWarnindicator);
|
|
|
|
|
+ wiCodeSet.add(wiCode);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|