|
|
@@ -94,8 +94,10 @@ public class IotAlarmRuleServiceImpl extends ServiceImpl<IotAlarmRuleMapper, Iot
|
|
|
|
|
|
final Object rs = jsb.get("ruleSourceList");
|
|
|
final Object re = jsb.get("ruleExpresses");
|
|
|
+ final Long ruleId = rule.getId();
|
|
|
if (rs != null) {
|
|
|
final List<JSONObject> list = JSON.parseArray(rs.toString(), JSONObject.class);
|
|
|
+ ruleSourceService.deleteByRuleId(ruleId);
|
|
|
for (JSONObject j : list) {
|
|
|
final IotAlarmRuleSource ruleSource = j.toJavaObject(IotAlarmRuleSource.class);
|
|
|
final IotAlarmRuleSource source = new IotAlarmRuleSource();
|
|
|
@@ -109,8 +111,8 @@ public class IotAlarmRuleServiceImpl extends ServiceImpl<IotAlarmRuleMapper, Iot
|
|
|
}
|
|
|
if (re != null) {
|
|
|
final List<IotAlarmRuleExpress> list = JSON.parseArray(re.toString(), IotAlarmRuleExpress.class);
|
|
|
+ ruleExpressService.delByRuleId(ruleId);
|
|
|
ruleExpressService.saveOrUpdateBatch(list);
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
}
|