|
|
@@ -417,12 +417,22 @@ public class IotWarnconfigServiceImpl implements IIotWarnconfigService {
|
|
|
if(null == iotWarnconfig){
|
|
|
throw new BizException(ErrorCode.INVALID_PARAMETER.getCode(),"告警规则不存在");
|
|
|
}
|
|
|
+
|
|
|
// 查询告警对象
|
|
|
IotWarnobject iotWarnobjectQuery = new IotWarnobject();
|
|
|
iotWarnobjectQuery.setTid(SecurityUtils.getTid());
|
|
|
iotWarnobjectQuery.setWcBid(wcBid);
|
|
|
List<IotWarnobject> iotWarnobjectList = iotWarnobjectService.selectIotWarnobjectList(iotWarnobjectQuery);
|
|
|
|
|
|
+ // 查询告警策略
|
|
|
+ String devtypeBid = iotWarnconfig.getDevtypeBid();
|
|
|
+ List<IotWarnindicator> iotWarnindicatorList = new ArrayList<>();
|
|
|
+ if(DevTypeUtil.isQxSq(devtypeBid)){
|
|
|
+ setInfoByQxz(iotWarnconfig, iotWarnobjectList, iotWarnindicatorList);
|
|
|
+ }else if(DevTypeUtil.isYfCbd(devtypeBid)){
|
|
|
+ setInfoByCbd(iotWarnconfig, iotWarnobjectList, iotWarnindicatorList);
|
|
|
+ }
|
|
|
+
|
|
|
String newWcBid = iotWarnconfig.getUUId();
|
|
|
|
|
|
iotWarnconfig.setWcBid(newWcBid);
|
|
|
@@ -436,13 +446,7 @@ public class IotWarnconfigServiceImpl implements IIotWarnconfigService {
|
|
|
iotWarnobjectMapper.insertIotWarnobject(iotWarnobject);
|
|
|
}
|
|
|
|
|
|
- // 查询告警策略
|
|
|
- IotWarnindicator iotWarnindicatorQuery = new IotWarnindicator();
|
|
|
- iotWarnindicatorQuery.setTid(SecurityUtils.getTid());
|
|
|
- iotWarnindicatorQuery.setWcBid(wcBid);
|
|
|
- List<IotWarnindicator> iotWarnindicatorList = iotWarnindicatorService.selectIotWarnindicatorList(iotWarnindicatorQuery);
|
|
|
// 重新赋值
|
|
|
-
|
|
|
addWarnindicator(newWcBid, iotWarnindicatorList);
|
|
|
|
|
|
iotWarnconfigMapper.insertIotWarnconfig(iotWarnconfig);
|