|
@@ -6,9 +6,12 @@ import com.persagy.apm.energyalarmstarter.alarmdata.feign.DmpResult;
|
|
|
import com.persagy.apm.energyalarmstarter.alarmdata.feign.client.AlarmClient;
|
|
|
import com.persagy.apm.energyalarmstarter.alarmdata.model.dto.AlarmCondition;
|
|
|
import com.persagy.apm.energyalarmstarter.alarmdata.model.dto.alarmconfig.AddAlarmConfigDTO;
|
|
|
+import com.persagy.apm.energyalarmstarter.alarmdata.model.dto.alarmconfig.BatchAddAlarmConfigDTO;
|
|
|
+import com.persagy.apm.energyalarmstarter.alarmdata.model.dto.alarmconfig.BatchUpdateAlarmConfigDTO;
|
|
|
import com.persagy.apm.energyalarmstarter.alarmdata.model.dto.common.QueryAlarmConfigDTO;
|
|
|
import com.persagy.apm.energyalarmstarter.alarmdata.model.dto.common.QueryDTO;
|
|
|
import com.persagy.apm.energyalarmstarter.alarmdata.model.vo.AlarmConfigItem;
|
|
|
+import com.persagy.apm.energyalarmstarter.alarmdata.model.vo.DmpBatchUpsertVO;
|
|
|
import com.persagy.apm.energyalarmstarter.alarmdata.model.vo.DmpUpsertVO;
|
|
|
import com.persagy.apm.energyalarmstarter.alarmdata.utils.DmpResultUtil;
|
|
|
import com.persagy.apm.energyalarmstarter.alarmdata.utils.Obj2JSONObject;
|
|
@@ -83,4 +86,31 @@ public class AlarmConfigServiceImpl {
|
|
|
System.out.println(jsonObject);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 批量创建
|
|
|
+ *
|
|
|
+ * @param batchAddAlarmConfigDTO 入参
|
|
|
+ * @return 报警条件ids
|
|
|
+ * @author lixing
|
|
|
+ * @version V1.0 2021/9/16 9:37 下午
|
|
|
+ */
|
|
|
+ public DmpResult<DmpBatchUpsertVO> batchCreate(BatchAddAlarmConfigDTO batchAddAlarmConfigDTO) throws Exception {
|
|
|
+ JSONObject jsonObject = Obj2JSONObject.convert(batchAddAlarmConfigDTO);
|
|
|
+ DmpResult<JSONObject> result = alarmClient.batchCreateAlarmConfig(batchAddAlarmConfigDTO.fetchParams(), jsonObject);
|
|
|
+ return DmpResultUtil.singleConvert(result, DmpBatchUpsertVO.class);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 批量更新
|
|
|
+ *
|
|
|
+ * @param batchUpdateAlarmConfigDTO 入参
|
|
|
+ * @return 报警条件ids
|
|
|
+ * @author lixing
|
|
|
+ * @version V1.0 2021/9/16 9:38 下午
|
|
|
+ */
|
|
|
+ public DmpResult<DmpBatchUpsertVO> batchUpdate(BatchUpdateAlarmConfigDTO batchUpdateAlarmConfigDTO) throws Exception {
|
|
|
+ JSONObject jsonObject = Obj2JSONObject.convert(batchUpdateAlarmConfigDTO);
|
|
|
+ DmpResult<JSONObject> result = alarmClient.batchCreateAlarmConfig(batchUpdateAlarmConfigDTO.fetchParams(), jsonObject);
|
|
|
+ return DmpResultUtil.singleConvert(result, DmpBatchUpsertVO.class);
|
|
|
+ }
|
|
|
}
|