Browse Source

设备运行时间

liuwj 1 year ago
parent
commit
5bacac689e

+ 75 - 0
itdmServer/module-iTDM/src/main/java/org/jeecg/modules/itdmAlarmTotal/entity/ItdmAlarmTotal.java

@@ -0,0 +1,75 @@
+package org.jeecg.modules.itdmAlarmTotal.entity;
+
+import java.io.Serializable;
+import java.io.UnsupportedEncodingException;
+import java.util.Date;
+import java.math.BigDecimal;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import lombok.Data;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springframework.format.annotation.DateTimeFormat;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.jeecg.common.aspect.annotation.Dict;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * @Description: 历史报警统计
+ * @Author: jeecg-boot
+ * @Date:   2023-05-20
+ * @Version: V1.0
+ */
+@Data
+@TableName("itdm_alarm_total")
+@Accessors(chain = true)
+@EqualsAndHashCode(callSuper = false)
+@ApiModel(value="itdm_alarm_total对象", description="历史报警统计")
+public class ItdmAlarmTotal implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+	/**主键*/
+	@TableId(type = IdType.ASSIGN_ID)
+    @ApiModelProperty(value = "主键")
+    private java.lang.String id;
+	/**创建人*/
+    @ApiModelProperty(value = "创建人")
+    private java.lang.String createBy;
+	/**创建日期*/
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "创建日期")
+    private java.util.Date createTime;
+	/**更新人*/
+    @ApiModelProperty(value = "更新人")
+    private java.lang.String updateBy;
+	/**更新日期*/
+    @Excel(name = "更新日期", width = 20, exportFormat = "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")
+    @ApiModelProperty(value = "更新日期")
+    private java.util.Date updateTime;
+	/**所属部门*/
+    @ApiModelProperty(value = "所属部门")
+    private java.lang.String sysOrgCode;
+	/**年份*/
+	@Excel(name = "年份", width = 15)
+    @ApiModelProperty(value = "年份")
+    private java.lang.Integer alarmYear;
+	/**月份*/
+	@Excel(name = "月份", width = 15)
+    @ApiModelProperty(value = "月份")
+    private java.lang.Integer alarmMonth;
+	/**报警总数*/
+	@Excel(name = "报警总数", width = 15)
+    @ApiModelProperty(value = "报警总数")
+    private java.lang.Integer alarmTotal;
+	/**备注*/
+	@Excel(name = "备注", width = 15)
+    @ApiModelProperty(value = "备注")
+    private java.lang.String remark;
+}

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

@@ -1,26 +0,0 @@
-
-
-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);
-
-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);
-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);
-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);

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

@@ -0,0 +1,177 @@
+package org.jeecg.modules.itdmDeviceRun.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.itdmDeviceRun.entity.ItdmDeviceRun;
+import org.jeecg.modules.itdmDeviceRun.service.IItdmDeviceRunService;
+
+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("/itdmDeviceRun/itdmDeviceRun")
+@Slf4j
+public class ItdmDeviceRunController extends JeecgController<ItdmDeviceRun, IItdmDeviceRunService> {
+	@Autowired
+	private IItdmDeviceRunService itdmDeviceRunService;
+	
+	/**
+	 * 分页列表查询
+	 *
+	 * @param itdmDeviceRun
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	//@AutoLog(value = "设备运行时间表-分页列表查询")
+	@ApiOperation(value="设备运行时间表-分页列表查询", notes="设备运行时间表-分页列表查询")
+	@GetMapping(value = "/list")
+	public Result<IPage<ItdmDeviceRun>> queryPageList(ItdmDeviceRun itdmDeviceRun,
+								   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+								   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+								   HttpServletRequest req) {
+		QueryWrapper<ItdmDeviceRun> queryWrapper = QueryGenerator.initQueryWrapper(itdmDeviceRun, req.getParameterMap());
+		Page<ItdmDeviceRun> page = new Page<ItdmDeviceRun>(pageNo, pageSize);
+		IPage<ItdmDeviceRun> pageList = itdmDeviceRunService.page(page, queryWrapper);
+		return Result.OK(pageList);
+	}
+	
+	/**
+	 *   添加
+	 *
+	 * @param itdmDeviceRun
+	 * @return
+	 */
+	@AutoLog(value = "设备运行时间表-添加")
+	@ApiOperation(value="设备运行时间表-添加", notes="设备运行时间表-添加")
+	//@RequiresPermissions("org.jeecg.modules:itdm_device_run:add")
+	@PostMapping(value = "/add")
+	public Result<String> add(@RequestBody ItdmDeviceRun itdmDeviceRun) {
+		itdmDeviceRunService.save(itdmDeviceRun);
+		return Result.OK("添加成功!");
+	}
+	
+	/**
+	 *  编辑
+	 *
+	 * @param itdmDeviceRun
+	 * @return
+	 */
+	@AutoLog(value = "设备运行时间表-编辑")
+	@ApiOperation(value="设备运行时间表-编辑", notes="设备运行时间表-编辑")
+	//@RequiresPermissions("org.jeecg.modules:itdm_device_run:edit")
+	@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
+	public Result<String> edit(@RequestBody ItdmDeviceRun itdmDeviceRun) {
+		itdmDeviceRunService.updateById(itdmDeviceRun);
+		return Result.OK("编辑成功!");
+	}
+	
+	/**
+	 *   通过id删除
+	 *
+	 * @param id
+	 * @return
+	 */
+	@AutoLog(value = "设备运行时间表-通过id删除")
+	@ApiOperation(value="设备运行时间表-通过id删除", notes="设备运行时间表-通过id删除")
+	//@RequiresPermissions("org.jeecg.modules:itdm_device_run:delete")
+	@DeleteMapping(value = "/delete")
+	public Result<String> delete(@RequestParam(name="id",required=true) String id) {
+		itdmDeviceRunService.removeById(id);
+		return Result.OK("删除成功!");
+	}
+	
+	/**
+	 *  批量删除
+	 *
+	 * @param ids
+	 * @return
+	 */
+	@AutoLog(value = "设备运行时间表-批量删除")
+	@ApiOperation(value="设备运行时间表-批量删除", notes="设备运行时间表-批量删除")
+	//@RequiresPermissions("org.jeecg.modules:itdm_device_run:deleteBatch")
+	@DeleteMapping(value = "/deleteBatch")
+	public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
+		this.itdmDeviceRunService.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<ItdmDeviceRun> queryById(@RequestParam(name="id",required=true) String id) {
+		ItdmDeviceRun itdmDeviceRun = itdmDeviceRunService.getById(id);
+		if(itdmDeviceRun==null) {
+			return Result.error("未找到对应数据");
+		}
+		return Result.OK(itdmDeviceRun);
+	}
+
+    /**
+    * 导出excel
+    *
+    * @param request
+    * @param itdmDeviceRun
+    */
+    //@RequiresPermissions("org.jeecg.modules:itdm_device_run:exportXls")
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, ItdmDeviceRun itdmDeviceRun) {
+        return super.exportXls(request, itdmDeviceRun, ItdmDeviceRun.class, "设备运行时间表");
+    }
+
+    /**
+      * 通过excel导入数据
+    *
+    * @param request
+    * @param response
+    * @return
+    */
+    //@RequiresPermissions("itdm_device_run:importExcel")
+    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+        return super.importExcel(request, response, ItdmDeviceRun.class);
+    }
+
+}

+ 103 - 0
itdmServer/module-iTDM/src/main/java/org/jeecg/modules/itdmDeviceRun/entity/ItdmDeviceRun.java

@@ -0,0 +1,103 @@
+package org.jeecg.modules.itdmDeviceRun.entity;
+
+import java.io.Serializable;
+import java.io.UnsupportedEncodingException;
+import java.util.Date;
+import java.math.BigDecimal;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import lombok.Data;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springframework.format.annotation.DateTimeFormat;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.jeecg.common.aspect.annotation.Dict;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * @Description: 设备运行时间表
+ * @Author: jeecg-boot
+ * @Date:   2023-05-20
+ * @Version: V1.0
+ */
+@Data
+@TableName("itdm_device_run")
+@Accessors(chain = true)
+@EqualsAndHashCode(callSuper = false)
+@ApiModel(value="itdm_device_run对象", description="设备运行时间表")
+public class ItdmDeviceRun implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+	/**主键*/
+	@TableId(type = IdType.ASSIGN_ID)
+    @ApiModelProperty(value = "主键")
+    private java.lang.String id;
+	/**所属部门*/
+    @ApiModelProperty(value = "所属部门")
+    private java.lang.String sysOrgCode;
+	/**设备id*/
+//	@Excel(name = "设备id", width = 15, dictTable = "itdm_device", dicText = "device_name", dicCode = "id")
+	@Dict(dictTable = "itdm_device", dicText = "device_name", dicCode = "id")
+    @ApiModelProperty(value = "设备id")
+    private java.lang.Integer deviceId;
+	/**设备名称*/
+	@Excel(name = "设备名称", width = 15)
+    @ApiModelProperty(value = "设备名称")
+    private java.lang.String deviceName;
+	/**设备类型*/
+	@Excel(name = "设备类型", width = 15)
+    @ApiModelProperty(value = "设备类型")
+    private java.lang.String deviceType;
+	/**设备开始运行时间*/
+	@Excel(name = "设备开始运行时间", width = 20, format = "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")
+    @ApiModelProperty(value = "设备开始运行时间")
+    private java.util.Date timeBegin;
+	/**设备结束运行时间*/
+	@Excel(name = "设备结束运行时间", width = 20, format = "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")
+    @ApiModelProperty(value = "设备结束运行时间")
+    private java.util.Date timeEnd;
+	/**设备本次运行时间*/
+	@Excel(name = "设备本次运行时间", width = 20)
+    @ApiModelProperty(value = "设备本次运行时间")
+    private java.lang.String timeRun;
+	/**天*/
+//	@Excel(name = "天", width = 15)
+    @ApiModelProperty(value = "天")
+    private java.lang.Integer timeDay;
+	/**小时*/
+//	@Excel(name = "小时", width = 15)
+    @ApiModelProperty(value = "小时")
+    private java.lang.Integer timeHour;
+	/**分钟*/
+//	@Excel(name = "分钟", width = 15)
+    @ApiModelProperty(value = "分钟")
+    private java.lang.Integer timeMinute;
+	/**秒*/
+//	@Excel(name = "秒", width = 15)
+    @ApiModelProperty(value = "秒")
+    private java.lang.Integer timeSecond;
+	/**创建人*/
+    @ApiModelProperty(value = "创建人")
+    private java.lang.String createBy;
+	/**创建日期*/
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "创建日期")
+    private java.util.Date createTime;
+	/**更新人*/
+    @ApiModelProperty(value = "更新人")
+    private java.lang.String updateBy;
+	/**更新日期*/
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "更新日期")
+    private java.util.Date updateTime;
+}

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

@@ -0,0 +1,17 @@
+package org.jeecg.modules.itdmDeviceRun.mapper;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Param;
+import org.jeecg.modules.itdmDeviceRun.entity.ItdmDeviceRun;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * @Description: 设备运行时间表
+ * @Author: jeecg-boot
+ * @Date:   2023-05-20
+ * @Version: V1.0
+ */
+public interface ItdmDeviceRunMapper extends BaseMapper<ItdmDeviceRun> {
+
+}

+ 5 - 0
itdmServer/module-iTDM/src/main/java/org/jeecg/modules/itdmDeviceRun/mapper/xml/ItdmDeviceRunMapper.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.itdmDeviceRun.mapper.ItdmDeviceRunMapper">
+
+</mapper>

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

@@ -0,0 +1,14 @@
+package org.jeecg.modules.itdmDeviceRun.service;
+
+import org.jeecg.modules.itdmDeviceRun.entity.ItdmDeviceRun;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * @Description: 设备运行时间表
+ * @Author: jeecg-boot
+ * @Date:   2023-05-20
+ * @Version: V1.0
+ */
+public interface IItdmDeviceRunService extends IService<ItdmDeviceRun> {
+
+}

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

@@ -0,0 +1,19 @@
+package org.jeecg.modules.itdmDeviceRun.service.impl;
+
+import org.jeecg.modules.itdmDeviceRun.entity.ItdmDeviceRun;
+import org.jeecg.modules.itdmDeviceRun.mapper.ItdmDeviceRunMapper;
+import org.jeecg.modules.itdmDeviceRun.service.IItdmDeviceRunService;
+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 ItdmDeviceRunServiceImpl extends ServiceImpl<ItdmDeviceRunMapper, ItdmDeviceRun> implements IItdmDeviceRunService {
+
+}