修改告警导出 新增公共档案
This commit is contained in:
@@ -73,17 +73,17 @@ public class AlertLogController extends BaseController
|
||||
{
|
||||
Map<String,Integer> map = new HashMap<>();
|
||||
AlertLog alertLog = new AlertLog();
|
||||
alertLog.setStatus(2);
|
||||
alertLog.setStatus("2");
|
||||
List<AlertLog> list = alertLogService.selectAlertLogList(alertLog);
|
||||
//1=提醒通知,2=轻微问题,3=严重警告
|
||||
List<AlertLog> tlist =list.stream()
|
||||
.filter(log -> log.getAlertLevel() == 1)
|
||||
.filter(log -> log.getAlertLevel() == "1")
|
||||
.collect(Collectors.toList());
|
||||
List<AlertLog> qlist =list.stream()
|
||||
.filter(log -> log.getAlertLevel() == 2)
|
||||
.filter(log -> log.getAlertLevel() == "2")
|
||||
.collect(Collectors.toList());
|
||||
List<AlertLog> ylist =list.stream()
|
||||
.filter(log -> log.getAlertLevel() == 3)
|
||||
.filter(log -> log.getAlertLevel() == "3")
|
||||
.collect(Collectors.toList());
|
||||
map.put("tx",tlist.size());
|
||||
map.put("qw",qlist.size());
|
||||
|
||||
@@ -0,0 +1,110 @@
|
||||
package com.xinda.data.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.xinda.common.annotation.Log;
|
||||
import com.xinda.common.core.controller.BaseController;
|
||||
import com.xinda.common.core.domain.AjaxResult;
|
||||
import com.xinda.common.enums.BusinessType;
|
||||
import com.xinda.iot.domain.PubDoc;
|
||||
import com.xinda.iot.service.IPubDocService;
|
||||
import com.xinda.common.utils.poi.ExcelUtil;
|
||||
import com.xinda.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 公共档案Controller
|
||||
*
|
||||
* @author kerwincui
|
||||
* @date 2025-08-02
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/iot/pubDoc")
|
||||
@Api(tags = "公共档案")
|
||||
public class PubDocController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IPubDocService pubDocService;
|
||||
|
||||
/**
|
||||
* 查询公共档案列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('iot:pubDoc:list')")
|
||||
@GetMapping("/list")
|
||||
@ApiOperation("查询公共档案列表")
|
||||
public TableDataInfo list(PubDoc pubDoc)
|
||||
{
|
||||
startPage();
|
||||
List<PubDoc> list = pubDocService.selectPubDocList(pubDoc);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出公共档案列表
|
||||
*/
|
||||
@ApiOperation("导出公共档案列表")
|
||||
@PreAuthorize("@ss.hasPermi('iot:pubDoc:export')")
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, PubDoc pubDoc)
|
||||
{
|
||||
List<PubDoc> list = pubDocService.selectPubDocList(pubDoc);
|
||||
ExcelUtil<PubDoc> util = new ExcelUtil<PubDoc>(PubDoc.class);
|
||||
util.exportExcel(response, list, "公共档案数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取公共档案详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('iot:pubDoc:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
@ApiOperation("获取公共档案详细信息")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(pubDocService.selectPubDocById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增公共档案
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('iot:pubDoc:add')")
|
||||
@PostMapping
|
||||
@ApiOperation("新增公共档案")
|
||||
public AjaxResult add(@RequestBody PubDoc pubDoc)
|
||||
{
|
||||
return toAjax(pubDocService.insertPubDoc(pubDoc));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改公共档案
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('iot:pubDoc:edit')")
|
||||
@PutMapping
|
||||
@ApiOperation("修改公共档案")
|
||||
public AjaxResult edit(@RequestBody PubDoc pubDoc)
|
||||
{
|
||||
return toAjax(pubDocService.updatePubDoc(pubDoc));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除公共档案
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('iot:pubDoc:remove')")
|
||||
@DeleteMapping("/{ids}")
|
||||
@ApiOperation("删除公共档案")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(pubDocService.deletePubDocByIds(ids));
|
||||
}
|
||||
}
|
||||
@@ -166,7 +166,7 @@ public class DeviceJob {
|
||||
alertPushParams.setNotifyTemplateId(alertNotifyTemplate.getNotifyTemplateId());
|
||||
notifySendService.alertSend(alertPushParams);
|
||||
}
|
||||
List<AlertLog> alist = alertLogService.selectAlertLogListByCreateBy(alertlog.getSceneId().toString(), alertlog.getId(), 2);
|
||||
List<AlertLog> alist = alertLogService.selectAlertLogListByCreateBy(alertlog.getSceneId().toString(), alertlog.getId(), "2");
|
||||
if (alist.isEmpty()) {
|
||||
AlertLog alertLog = buildAlertLog(alertSceneSendVO, device, alertlog);
|
||||
alertLogList.add(alertLog);
|
||||
@@ -190,7 +190,7 @@ public class DeviceJob {
|
||||
alertLog.setProductId(device.getProductId());
|
||||
alertLog.setDeviceName(device.getDeviceName());
|
||||
alertLog.setUserId(device.getTenantId());
|
||||
alertLog.setStatus(2);
|
||||
alertLog.setStatus("2");
|
||||
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("id", Item.getId());
|
||||
|
||||
Reference in New Issue
Block a user