瀏覽代碼

报警统计

liuwj 2 年之前
父節點
當前提交
096d131a48

+ 1 - 1
itdmServer/module-iTDM/src/main/java/org/jeecg/modules/itdmAlarm/entity/ItdmAlarm.java

@@ -40,7 +40,7 @@ public class ItdmAlarm implements Serializable {
     @ApiModelProperty(value = "创建人")
     @ApiModelProperty(value = "创建人")
     private java.lang.String createBy;
     private java.lang.String createBy;
 	/**采集日期*/
 	/**采集日期*/
-    @Excel(name = "采集日期", width = 20, dictTable = "itdm_device", exportFormat = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "采集日期", width = 20, exportFormat = "yyyy-MM-dd HH:mm:ss")
 	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
 	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
     @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
     @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
     @ApiModelProperty(value = "采集日期")
     @ApiModelProperty(value = "采集日期")

+ 177 - 0
itdmServer/module-iTDM/src/main/java/org/jeecg/modules/itdmAlarmTotal/controller/ItdmAlarmTotalController.java

@@ -0,0 +1,177 @@
+package org.jeecg.modules.itdmAlarmTotal.controller;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecg.modules.itdmAlarmTotal.entity.ItdmAlarmTotal;
+import org.jeecg.modules.itdmAlarmTotal.service.IItdmAlarmTotalService;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import lombok.extern.slf4j.Slf4j;
+
+import org.jeecgframework.poi.excel.ExcelImportUtil;
+import org.jeecgframework.poi.excel.def.NormalExcelConstants;
+import org.jeecgframework.poi.excel.entity.ExportParams;
+import org.jeecgframework.poi.excel.entity.ImportParams;
+import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
+import org.jeecg.common.system.base.controller.JeecgController;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import org.springframework.web.servlet.ModelAndView;
+import com.alibaba.fastjson.JSON;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.jeecg.common.aspect.annotation.AutoLog;
+
+ /**
+ * @Description: 历史报警统计
+ * @Author: jeecg-boot
+ * @Date:   2023-05-20
+ * @Version: V1.0
+ */
+@Api(tags="历史报警统计")
+@RestController
+@RequestMapping("/itdmAlarmTotal/itdmAlarmTotal")
+@Slf4j
+public class ItdmAlarmTotalController extends JeecgController<ItdmAlarmTotal, IItdmAlarmTotalService> {
+	@Autowired
+	private IItdmAlarmTotalService itdmAlarmTotalService;
+	
+	/**
+	 * 分页列表查询
+	 *
+	 * @param itdmAlarmTotal
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	//@AutoLog(value = "历史报警统计-分页列表查询")
+	@ApiOperation(value="历史报警统计-分页列表查询", notes="历史报警统计-分页列表查询")
+	@GetMapping(value = "/list")
+	public Result<IPage<ItdmAlarmTotal>> queryPageList(ItdmAlarmTotal itdmAlarmTotal,
+								   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+								   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+								   HttpServletRequest req) {
+		QueryWrapper<ItdmAlarmTotal> queryWrapper = QueryGenerator.initQueryWrapper(itdmAlarmTotal, req.getParameterMap());
+		Page<ItdmAlarmTotal> page = new Page<ItdmAlarmTotal>(pageNo, pageSize);
+		IPage<ItdmAlarmTotal> pageList = itdmAlarmTotalService.page(page, queryWrapper);
+		return Result.OK(pageList);
+	}
+	
+	/**
+	 *   添加
+	 *
+	 * @param itdmAlarmTotal
+	 * @return
+	 */
+	@AutoLog(value = "历史报警统计-添加")
+	@ApiOperation(value="历史报警统计-添加", notes="历史报警统计-添加")
+	//@RequiresPermissions("org.jeecg.modules:itdm_alarm_total:add")
+	@PostMapping(value = "/add")
+	public Result<String> add(@RequestBody ItdmAlarmTotal itdmAlarmTotal) {
+		itdmAlarmTotalService.save(itdmAlarmTotal);
+		return Result.OK("添加成功!");
+	}
+	
+	/**
+	 *  编辑
+	 *
+	 * @param itdmAlarmTotal
+	 * @return
+	 */
+	@AutoLog(value = "历史报警统计-编辑")
+	@ApiOperation(value="历史报警统计-编辑", notes="历史报警统计-编辑")
+	//@RequiresPermissions("org.jeecg.modules:itdm_alarm_total:edit")
+	@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
+	public Result<String> edit(@RequestBody ItdmAlarmTotal itdmAlarmTotal) {
+		itdmAlarmTotalService.updateById(itdmAlarmTotal);
+		return Result.OK("编辑成功!");
+	}
+	
+	/**
+	 *   通过id删除
+	 *
+	 * @param id
+	 * @return
+	 */
+	@AutoLog(value = "历史报警统计-通过id删除")
+	@ApiOperation(value="历史报警统计-通过id删除", notes="历史报警统计-通过id删除")
+	//@RequiresPermissions("org.jeecg.modules:itdm_alarm_total:delete")
+	@DeleteMapping(value = "/delete")
+	public Result<String> delete(@RequestParam(name="id",required=true) String id) {
+		itdmAlarmTotalService.removeById(id);
+		return Result.OK("删除成功!");
+	}
+	
+	/**
+	 *  批量删除
+	 *
+	 * @param ids
+	 * @return
+	 */
+	@AutoLog(value = "历史报警统计-批量删除")
+	@ApiOperation(value="历史报警统计-批量删除", notes="历史报警统计-批量删除")
+	//@RequiresPermissions("org.jeecg.modules:itdm_alarm_total:deleteBatch")
+	@DeleteMapping(value = "/deleteBatch")
+	public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
+		this.itdmAlarmTotalService.removeByIds(Arrays.asList(ids.split(",")));
+		return Result.OK("批量删除成功!");
+	}
+	
+	/**
+	 * 通过id查询
+	 *
+	 * @param id
+	 * @return
+	 */
+	//@AutoLog(value = "历史报警统计-通过id查询")
+	@ApiOperation(value="历史报警统计-通过id查询", notes="历史报警统计-通过id查询")
+	@GetMapping(value = "/queryById")
+	public Result<ItdmAlarmTotal> queryById(@RequestParam(name="id",required=true) String id) {
+		ItdmAlarmTotal itdmAlarmTotal = itdmAlarmTotalService.getById(id);
+		if(itdmAlarmTotal==null) {
+			return Result.error("未找到对应数据");
+		}
+		return Result.OK(itdmAlarmTotal);
+	}
+
+    /**
+    * 导出excel
+    *
+    * @param request
+    * @param itdmAlarmTotal
+    */
+    //@RequiresPermissions("org.jeecg.modules:itdm_alarm_total:exportXls")
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, ItdmAlarmTotal itdmAlarmTotal) {
+        return super.exportXls(request, itdmAlarmTotal, ItdmAlarmTotal.class, "历史报警统计");
+    }
+
+    /**
+      * 通过excel导入数据
+    *
+    * @param request
+    * @param response
+    * @return
+    */
+    //@RequiresPermissions("itdm_alarm_total:importExcel")
+    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+        return super.importExcel(request, response, ItdmAlarmTotal.class);
+    }
+
+}

+ 17 - 0
itdmServer/module-iTDM/src/main/java/org/jeecg/modules/itdmAlarmTotal/mapper/ItdmAlarmTotalMapper.java

@@ -0,0 +1,17 @@
+package org.jeecg.modules.itdmAlarmTotal.mapper;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Param;
+import org.jeecg.modules.itdmAlarmTotal.entity.ItdmAlarmTotal;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * @Description: 历史报警统计
+ * @Author: jeecg-boot
+ * @Date:   2023-05-20
+ * @Version: V1.0
+ */
+public interface ItdmAlarmTotalMapper extends BaseMapper<ItdmAlarmTotal> {
+
+}

+ 5 - 0
itdmServer/module-iTDM/src/main/java/org/jeecg/modules/itdmAlarmTotal/mapper/xml/ItdmAlarmTotalMapper.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.jeecg.modules.itdmAlarmTotal.mapper.ItdmAlarmTotalMapper">
+
+</mapper>

+ 14 - 0
itdmServer/module-iTDM/src/main/java/org/jeecg/modules/itdmAlarmTotal/service/IItdmAlarmTotalService.java

@@ -0,0 +1,14 @@
+package org.jeecg.modules.itdmAlarmTotal.service;
+
+import org.jeecg.modules.itdmAlarmTotal.entity.ItdmAlarmTotal;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * @Description: 历史报警统计
+ * @Author: jeecg-boot
+ * @Date:   2023-05-20
+ * @Version: V1.0
+ */
+public interface IItdmAlarmTotalService extends IService<ItdmAlarmTotal> {
+
+}

+ 19 - 0
itdmServer/module-iTDM/src/main/java/org/jeecg/modules/itdmAlarmTotal/service/impl/ItdmAlarmTotalServiceImpl.java

@@ -0,0 +1,19 @@
+package org.jeecg.modules.itdmAlarmTotal.service.impl;
+
+import org.jeecg.modules.itdmAlarmTotal.entity.ItdmAlarmTotal;
+import org.jeecg.modules.itdmAlarmTotal.mapper.ItdmAlarmTotalMapper;
+import org.jeecg.modules.itdmAlarmTotal.service.IItdmAlarmTotalService;
+import org.springframework.stereotype.Service;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+
+/**
+ * @Description: 历史报警统计
+ * @Author: jeecg-boot
+ * @Date:   2023-05-20
+ * @Version: V1.0
+ */
+@Service
+public class ItdmAlarmTotalServiceImpl extends ServiceImpl<ItdmAlarmTotalMapper, ItdmAlarmTotal> implements IItdmAlarmTotalService {
+
+}

+ 26 - 0
itdmServer/module-iTDM/src/main/java/org/jeecg/modules/itdmAlarmTotal/vue/ItdmAlarmTotal_menu_insert.sql

@@ -0,0 +1,26 @@
+-- 注意:该页面对应的前台目录为views/itdmAlarmTotal文件夹下
+-- 如果你想更改到其他目录,请修改sql中component字段对应的值
+
+
+INSERT INTO sys_permission(id, parent_id, name, url, component, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_route, is_leaf, keep_alive, hidden, hide_tab, description, status, del_flag, rule_flag, create_by, create_time, update_by, update_time, internal_or_external)
+VALUES ('2023052001482490000', NULL, '历史报警统计', '/itdmAlarmTotal/itdmAlarmTotalList', 'module-iTDM/itdmAlarmTotal/ItdmAlarmTotalList', NULL, NULL, 0, NULL, '1', 0.00, 0, NULL, 1, 1, 0, 0, 0, NULL, '1', 0, 0, 'admin', '2023-05-20 13:48:00', NULL, NULL, 0);
+
+-- 权限控制sql
+-- 新增
+INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
+VALUES ('2023052001482490001', '2023052001482490000', '新增', NULL, NULL, 0, NULL, NULL, 2, 'org.jeecg.modules:itdm_alarm_total:add', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-05-20 13:48:00', NULL, NULL, 0, 0, '1', 0);
+-- 编辑
+INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
+VALUES ('2023052001482490002', '2023052001482490000', '编辑', NULL, NULL, 0, NULL, NULL, 2, 'org.jeecg.modules:itdm_alarm_total:edit', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-05-20 13:48:00', NULL, NULL, 0, 0, '1', 0);
+-- 删除
+INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
+VALUES ('2023052001482490003', '2023052001482490000', '删除', NULL, NULL, 0, NULL, NULL, 2, 'org.jeecg.modules:itdm_alarm_total:delete', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-05-20 13:48:00', NULL, NULL, 0, 0, '1', 0);
+-- 批量删除
+INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
+VALUES ('2023052001482490004', '2023052001482490000', '批量删除', NULL, NULL, 0, NULL, NULL, 2, 'org.jeecg.modules:itdm_alarm_total:deleteBatch', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-05-20 13:48:00', NULL, NULL, 0, 0, '1', 0);
+-- 导出excel
+INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
+VALUES ('2023052001482490005', '2023052001482490000', '导出excel', NULL, NULL, 0, NULL, NULL, 2, 'org.jeecg.modules:itdm_alarm_total:exportXls', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-05-20 13:48:00', NULL, NULL, 0, 0, '1', 0);
+-- 导入excel
+INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
+VALUES ('2023052001482490006', '2023052001482490000', '导入excel', NULL, NULL, 0, NULL, NULL, 2, 'org.jeecg.modules:itdm_alarm_total:importExcel', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-05-20 13:48:00', NULL, NULL, 0, 0, '1', 0);