Browse Source

精益事件告警信息表生成01

qiangxuan 7 months ago
parent
commit
24b9d781c0

+ 163 - 0
jeecg-module-gather/src/main/java/org/jeecg/modules/leanEventWarn/controller/LeanEventWarnInfoController.java

@@ -0,0 +1,163 @@
+package org.jeecg.modules.leanEventWarn.controller;
+
+import java.util.Arrays;
+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 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.jeecg.modules.leanEventWarn.entity.LeanEventWarnInfo;
+import org.jeecg.modules.leanEventWarn.service.ILeanEventWarnInfoService;
+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.servlet.ModelAndView;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.jeecg.common.aspect.annotation.AutoLog;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+
+ /**
+ * @Description: 精益事件告警信息表
+ * @Author: jeecg-boot
+ * @Date:   2024-10-29
+ * @Version: V1.0
+ */
+@Api(tags="精益事件告警信息表")
+@RestController
+@RequestMapping("/leanEventWarn/leanEventWarnInfo")
+@Slf4j
+public class LeanEventWarnInfoController extends JeecgController<LeanEventWarnInfo, ILeanEventWarnInfoService> {
+	@Autowired
+	private ILeanEventWarnInfoService leanEventWarnInfoService;
+	
+	/**
+	 * 分页列表查询
+	 *
+	 * @param leanEventWarnInfo
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	//@AutoLog(value = "精益事件告警信息表-分页列表查询")
+	@ApiOperation(value="精益事件告警信息表-分页列表查询", notes="精益事件告警信息表-分页列表查询")
+	@GetMapping(value = "/list")
+	public Result<IPage<LeanEventWarnInfo>> queryPageList(LeanEventWarnInfo leanEventWarnInfo,
+								   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+								   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+								   HttpServletRequest req) {
+		QueryWrapper<LeanEventWarnInfo> queryWrapper = QueryGenerator.initQueryWrapper(leanEventWarnInfo, req.getParameterMap());
+		Page<LeanEventWarnInfo> page = new Page<LeanEventWarnInfo>(pageNo, pageSize);
+		IPage<LeanEventWarnInfo> pageList = leanEventWarnInfoService.page(page, queryWrapper);
+		return Result.OK(pageList);
+	}
+	
+	/**
+	 *   添加
+	 *
+	 * @param leanEventWarnInfo
+	 * @return
+	 */
+	@AutoLog(value = "精益事件告警信息表-添加")
+	@ApiOperation(value="精益事件告警信息表-添加", notes="精益事件告警信息表-添加")
+	@RequiresPermissions("leanEventWarn:lean_event_warn_info:add")
+	@PostMapping(value = "/add")
+	public Result<String> add(@RequestBody LeanEventWarnInfo leanEventWarnInfo) {
+		leanEventWarnInfoService.save(leanEventWarnInfo);
+		return Result.OK("添加成功!");
+	}
+	
+	/**
+	 *  编辑
+	 *
+	 * @param leanEventWarnInfo
+	 * @return
+	 */
+	@AutoLog(value = "精益事件告警信息表-编辑")
+	@ApiOperation(value="精益事件告警信息表-编辑", notes="精益事件告警信息表-编辑")
+	@RequiresPermissions("leanEventWarn:lean_event_warn_info:edit")
+	@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
+	public Result<String> edit(@RequestBody LeanEventWarnInfo leanEventWarnInfo) {
+		leanEventWarnInfoService.updateById(leanEventWarnInfo);
+		return Result.OK("编辑成功!");
+	}
+	
+	/**
+	 *   通过id删除
+	 *
+	 * @param id
+	 * @return
+	 */
+	@AutoLog(value = "精益事件告警信息表-通过id删除")
+	@ApiOperation(value="精益事件告警信息表-通过id删除", notes="精益事件告警信息表-通过id删除")
+	@RequiresPermissions("leanEventWarn:lean_event_warn_info:delete")
+	@DeleteMapping(value = "/delete")
+	public Result<String> delete(@RequestParam(name="id",required=true) String id) {
+		leanEventWarnInfoService.removeById(id);
+		return Result.OK("删除成功!");
+	}
+	
+	/**
+	 *  批量删除
+	 *
+	 * @param ids
+	 * @return
+	 */
+	@AutoLog(value = "精益事件告警信息表-批量删除")
+	@ApiOperation(value="精益事件告警信息表-批量删除", notes="精益事件告警信息表-批量删除")
+	@RequiresPermissions("leanEventWarn:lean_event_warn_info:deleteBatch")
+	@DeleteMapping(value = "/deleteBatch")
+	public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
+		this.leanEventWarnInfoService.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<LeanEventWarnInfo> queryById(@RequestParam(name="id",required=true) String id) {
+		LeanEventWarnInfo leanEventWarnInfo = leanEventWarnInfoService.getById(id);
+		if(leanEventWarnInfo==null) {
+			return Result.error("未找到对应数据");
+		}
+		return Result.OK(leanEventWarnInfo);
+	}
+
+    /**
+    * 导出excel
+    *
+    * @param request
+    * @param leanEventWarnInfo
+    */
+    @RequiresPermissions("leanEventWarn:lean_event_warn_info:exportXls")
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, LeanEventWarnInfo leanEventWarnInfo) {
+        return super.exportXls(request, leanEventWarnInfo, LeanEventWarnInfo.class, "精益事件告警信息表");
+    }
+
+    /**
+      * 通过excel导入数据
+    *
+    * @param request
+    * @param response
+    * @return
+    */
+    @RequiresPermissions("leanEventWarn:lean_event_warn_info:importExcel")
+    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+        return super.importExcel(request, response, LeanEventWarnInfo.class);
+    }
+
+}

+ 86 - 0
jeecg-module-gather/src/main/java/org/jeecg/modules/leanEventWarn/entity/LeanEventWarnInfo.java

@@ -0,0 +1,86 @@
+package org.jeecg.modules.leanEventWarn.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:   2024-10-29
+ * @Version: V1.0
+ */
+@Data
+@TableName("lean_event_warn_info")
+@Accessors(chain = true)
+@EqualsAndHashCode(callSuper = false)
+@ApiModel(value="lean_event_warn_info对象", description="精益事件告警信息表")
+public class LeanEventWarnInfo implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+	/**主键*/
+	@TableId(type = IdType.ASSIGN_ID)
+    @ApiModelProperty(value = "主键")
+    private String id;
+	/**创建人*/
+    @ApiModelProperty(value = "创建人")
+    private String createBy;
+	/**创建日期*/
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "创建日期")
+    private Date createTime;
+	/**更新人*/
+    @ApiModelProperty(value = "更新人")
+    private String updateBy;
+	/**更新日期*/
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "更新日期")
+    private Date updateTime;
+	/**所属部门*/
+    @ApiModelProperty(value = "所属部门")
+    private String sysOrgCode;
+	/**区域ID*/
+	@Excel(name = "区域ID", width = 15)
+    @ApiModelProperty(value = "区域ID")
+    private String deviceRegionId;
+	/**设备ID*/
+	@Excel(name = "设备ID", width = 15)
+    @ApiModelProperty(value = "设备ID")
+    private String deviceInformationId;
+	/**采集点ID*/
+	@Excel(name = "采集点ID", width = 15)
+    @ApiModelProperty(value = "采集点ID")
+    private String devicePointId;
+	/**告警类型*/
+	@Excel(name = "告警类型", width = 15)
+    @ApiModelProperty(value = "告警类型")
+    private String warnType;
+	/**设备预警信息*/
+	@Excel(name = "设备预警信息", width = 15)
+    @ApiModelProperty(value = "设备预警信息")
+    private String deviceWarnInfo;
+	/**设备预警级别(0:重度,1:中度,2:轻度)*/
+	@Excel(name = "设备预警级别(0:重度,1:中度,2:轻度)", width = 15)
+    @ApiModelProperty(value = "设备预警级别(0:重度,1:中度,2:轻度)")
+    private String deviceWarnLevel;
+	/**拓展字段*/
+	@Excel(name = "拓展字段", width = 15)
+    @ApiModelProperty(value = "拓展字段")
+    private String remark;
+}

+ 14 - 0
jeecg-module-gather/src/main/java/org/jeecg/modules/leanEventWarn/mapper/LeanEventWarnInfoMapper.java

@@ -0,0 +1,14 @@
+package org.jeecg.modules.leanEventWarn.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.jeecg.modules.leanEventWarn.entity.LeanEventWarnInfo;
+
+/**
+ * @Description: 精益事件告警信息表
+ * @Author: jeecg-boot
+ * @Date:   2024-10-29
+ * @Version: V1.0
+ */
+public interface LeanEventWarnInfoMapper extends BaseMapper<LeanEventWarnInfo> {
+
+}

+ 5 - 0
jeecg-module-gather/src/main/java/org/jeecg/modules/leanEventWarn/mapper/xml/LeanEventWarnInfoMapper.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.leanEventWarn.mapper.LeanEventWarnInfoMapper">
+
+</mapper>

+ 14 - 0
jeecg-module-gather/src/main/java/org/jeecg/modules/leanEventWarn/service/ILeanEventWarnInfoService.java

@@ -0,0 +1,14 @@
+package org.jeecg.modules.leanEventWarn.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import org.jeecg.modules.leanEventWarn.entity.LeanEventWarnInfo;
+
+/**
+ * @Description: 精益事件告警信息表
+ * @Author: jeecg-boot
+ * @Date:   2024-10-29
+ * @Version: V1.0
+ */
+public interface ILeanEventWarnInfoService extends IService<LeanEventWarnInfo> {
+
+}

+ 19 - 0
jeecg-module-gather/src/main/java/org/jeecg/modules/leanEventWarn/service/impl/LeanEventWarnInfoServiceImpl.java

@@ -0,0 +1,19 @@
+package org.jeecg.modules.leanEventWarn.service.impl;
+
+import org.jeecg.modules.leanEventWarn.entity.LeanEventWarnInfo;
+import org.jeecg.modules.leanEventWarn.mapper.LeanEventWarnInfoMapper;
+import org.jeecg.modules.leanEventWarn.service.ILeanEventWarnInfoService;
+import org.springframework.stereotype.Service;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+
+/**
+ * @Description: 精益事件告警信息表
+ * @Author: jeecg-boot
+ * @Date:   2024-10-29
+ * @Version: V1.0
+ */
+@Service
+public class LeanEventWarnInfoServiceImpl extends ServiceImpl<LeanEventWarnInfoMapper, LeanEventWarnInfo> implements ILeanEventWarnInfoService {
+
+}