| | |
| | | |
| | | public ExecutedResult<String> create(ReqCreateAlarmHistory request) { |
| | | //查询报警记录是否存在 |
| | | AlarmHistoryPO historyPO = mapper.getListByFacilityId(request.getFacilityId(), request.getCode()); |
| | | if(Objects.nonNull(historyPO)){ |
| | | historyPO.setTotalCount(historyPO.getTotalCount()+1); |
| | | historyPO.setLastTime(LocalDateTimeUtil.nowTimeStamp()); |
| | | int i = mapper.updateById(historyPO); |
| | | if (i != 1) { |
| | | return ExecutedResult.failed("创建[报警信息]失败。"); |
| | | } |
| | | }else { |
| | | |
| | | // 转换po |
| | | AlarmHistoryPO item = AlarmHistoryConvert.INSTANCE.toCreate(request); |
| | | // 设置记录创建时间 |
| | |
| | | if (rowCount != 1) { |
| | | return ExecutedResult.failed("创建[报警信息]失败。"); |
| | | } |
| | | } |
| | | |
| | | return ExecutedResult.success(); |
| | | } |
| | |
| | | return ExecutedResult.failed(checkExists.getMsg()); |
| | | } |
| | | AlarmHistoryPO data = checkExists.getData(); |
| | | data.setIsConfirm(status); |
| | | int i = mapper.updateById(data); |
| | | if(i!=1){ |
| | | return ExecutedResult.failed("编辑[报警信息]失败。"); |