Showing
1 changed file
with
25 additions
and
1 deletions
... | ... | @@ -200,7 +200,7 @@ public class AlarmController extends BaseController { |
200 | 200 | processAlarm(strAlarmId); |
201 | 201 | } |
202 | 202 | |
203 | - @ApiOperation(value = "批量处理确认") | |
203 | + @ApiOperation(value = "批量处理") | |
204 | 204 | @PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')") |
205 | 205 | @RequestMapping(value = "/alarm/batch/ack", method = RequestMethod.POST) |
206 | 206 | @ResponseStatus(value = HttpStatus.OK) |
... | ... | @@ -243,6 +243,30 @@ public class AlarmController extends BaseController { |
243 | 243 | @RequestMapping(value = "/alarm/{alarmId}/clear", method = RequestMethod.POST) |
244 | 244 | @ResponseStatus(value = HttpStatus.OK) |
245 | 245 | public void clearAlarm(@ApiParam(value = ALARM_ID_PARAM_DESCRIPTION) @PathVariable(ALARM_ID) String strAlarmId) throws ThingsboardException { |
246 | + //Thingskit function | |
247 | + processClear(strAlarmId); | |
248 | + } | |
249 | + | |
250 | + @ApiOperation(value = "批量清除") | |
251 | + @PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')") | |
252 | + @RequestMapping(value = "/alarm/batch/clear", method = RequestMethod.POST) | |
253 | + @ResponseStatus(value = HttpStatus.OK) | |
254 | + public void batchClearAlarm(@ApiParam(value = ALARM_ID_PARAM_DESCRIPTION) @RequestBody BatchAckAlarmDTO batchAckAlarmDTO) throws ThingsboardException { | |
255 | + List<String> strAlarmIds = batchAckAlarmDTO.getAlarmIds(); | |
256 | + if(null == strAlarmIds || strAlarmIds.isEmpty()){ | |
257 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
258 | + } | |
259 | + for (String strAlarmId:strAlarmIds){ | |
260 | + if(StringUtils.isEmpty(strAlarmId)){ | |
261 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
262 | + } | |
263 | + //thingsKit function | |
264 | + processClear(strAlarmId); | |
265 | + } | |
266 | + } | |
267 | + | |
268 | + //Thingskit function | |
269 | + private void processClear(String strAlarmId) throws ThingsboardException { | |
246 | 270 | checkParameter(ALARM_ID, strAlarmId); |
247 | 271 | try { |
248 | 272 | AlarmId alarmId = new AlarmId(toUUID(strAlarmId)); | ... | ... |