From 1fd9d157364d0e2aa0a6e6cf3326acd8964a894f Mon Sep 17 00:00:00 2001
From: fuliqi <fuliqi@qq.com>
Date: 星期二, 26 三月 2024 15:38:23 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
ycl-server/src/main/java/com/ycl/platform/service/impl/YwThresholdServiceImpl.java | 90 ++++++++++
ycl-pojo/src/main/java/com/ycl/platform/domain/query/ReportQuery.java | 3
ycl-server/src/main/java/com/ycl/platform/controller/YwThresholdController.java | 90 ++++++++++
ycl-server/src/main/java/com/ycl/platform/mapper/YwThresholdMapper.java | 61 ++++++
ycl-server/src/main/java/com/ycl/platform/controller/ReportController.java | 2
ycl-server/src/main/resources/mapper/ycl/YwThresholdMapper.xml | 79 ++++++++
ycl-pojo/src/main/java/com/ycl/platform/domain/entity/YwThreshold.java | 98 ++++++++++
ycl-server/src/main/java/com/ycl/platform/service/IYwThresholdService.java | 62 ++++++
ycl-server/src/main/java/com/ycl/platform/service/impl/ReportServiceImpl.java | 2
9 files changed, 486 insertions(+), 1 deletions(-)
diff --git a/ycl-pojo/src/main/java/com/ycl/platform/domain/entity/YwThreshold.java b/ycl-pojo/src/main/java/com/ycl/platform/domain/entity/YwThreshold.java
new file mode 100644
index 0000000..f6f877c
--- /dev/null
+++ b/ycl-pojo/src/main/java/com/ycl/platform/domain/entity/YwThreshold.java
@@ -0,0 +1,98 @@
+package com.ycl.platform.domain.entity;
+
+
+import annotation.Excel;
+import com.ycl.system.entity.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+/**
+ * 杩愮淮闃堝�煎璞� t_yw_threshold
+ *
+ * @author gonghl
+ * @date 2024-03-25
+ */
+public class YwThreshold extends BaseEntity {
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 涓婚敭
+ */
+ private Integer id;
+
+ /**
+ * 璁惧绫诲瀷锛�1浜鸿劯 2杞﹁締 3瑙嗛
+ */
+ @Excel(name = "璁惧绫诲瀷锛�1浜鸿劯 2杞﹁締 3瑙嗛")
+ private String monitorType;
+
+ /**
+ * 瓒呮椂澶╂暟
+ */
+ @Excel(name = "瓒呮椂澶╂暟")
+ private Integer timeout;
+
+ /**
+ * 鎸囨爣json
+ */
+ @Excel(name = "鎸囨爣json")
+ private String indicator;
+
+ /**
+ * 閫昏緫鍒犻櫎锛�0鏈垹闄� 1鍒犻櫎
+ */
+ private String deleted;
+
+ public void setId(Integer id) {
+ this.id = id;
+ }
+
+ public Integer getId() {
+ return id;
+ }
+
+ public void setMonitorType(String monitorType) {
+ this.monitorType = monitorType;
+ }
+
+ public String getMonitorType() {
+ return monitorType;
+ }
+
+ public void setTimeout(Integer timeout) {
+ this.timeout = timeout;
+ }
+
+ public Integer getTimeout() {
+ return timeout;
+ }
+
+ public void setIndicator(String indicator) {
+ this.indicator = indicator;
+ }
+
+ public String getIndicator() {
+ return indicator;
+ }
+
+ public void setDeleted(String deleted) {
+ this.deleted = deleted;
+ }
+
+ public String getDeleted() {
+ return deleted;
+ }
+
+ @Override
+ public String toString() {
+ return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+ .append("id", getId())
+ .append("monitorType", getMonitorType())
+ .append("timeout", getTimeout())
+ .append("indicator", getIndicator())
+ .append("createTime", getCreateTime())
+ .append("updateTime", getUpdateTime())
+ .append("deleted", getDeleted())
+ .toString();
+ }
+}
diff --git a/ycl-pojo/src/main/java/com/ycl/platform/domain/query/ReportQuery.java b/ycl-pojo/src/main/java/com/ycl/platform/domain/query/ReportQuery.java
index 4c14366..db59460 100644
--- a/ycl-pojo/src/main/java/com/ycl/platform/domain/query/ReportQuery.java
+++ b/ycl-pojo/src/main/java/com/ycl/platform/domain/query/ReportQuery.java
@@ -19,5 +19,8 @@
@Accessors(chain = true)
@ApiModel(value = "Report鏌ヨ", description = "鎶ュ鏌ヨ")
public class ReportQuery extends AbsQuery {
+
+ private String reportType;
+
}
diff --git a/ycl-server/src/main/java/com/ycl/platform/controller/ReportController.java b/ycl-server/src/main/java/com/ycl/platform/controller/ReportController.java
index 0fab314..092da5c 100644
--- a/ycl-server/src/main/java/com/ycl/platform/controller/ReportController.java
+++ b/ycl-server/src/main/java/com/ycl/platform/controller/ReportController.java
@@ -57,7 +57,7 @@
@PostMapping("/page")
@ApiOperation(value = "鍒嗛〉", notes = "鍒嗛〉")
- public Result page(ReportQuery query) {
+ public Result page(@RequestBody ReportQuery query) {
return reportService.page(query);
}
diff --git a/ycl-server/src/main/java/com/ycl/platform/controller/YwThresholdController.java b/ycl-server/src/main/java/com/ycl/platform/controller/YwThresholdController.java
new file mode 100644
index 0000000..526fa72
--- /dev/null
+++ b/ycl-server/src/main/java/com/ycl/platform/controller/YwThresholdController.java
@@ -0,0 +1,90 @@
+package com.ycl.platform.controller;
+
+import annotation.Log;
+import com.ycl.platform.domain.entity.YwThreshold;
+import com.ycl.platform.service.IYwThresholdService;
+import com.ycl.system.AjaxResult;
+import com.ycl.system.controller.BaseController;
+import com.ycl.system.page.TableDataInfo;
+import com.ycl.utils.poi.ExcelUtil;
+import enumeration.BusinessType;
+import jakarta.servlet.http.HttpServletResponse;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 杩愮淮闃堝�糃ontroller
+ *
+ * @author gonghl
+ * @date 2024-03-25
+ */
+@RestController
+@RequestMapping("/ycl/threshold")
+public class YwThresholdController extends BaseController {
+ @Autowired
+ private IYwThresholdService ywThresholdService;
+
+ /**
+ * 鏌ヨ杩愮淮闃堝�煎垪琛�
+ */
+ // @PreAuthorize("@ss.hasPermi('ycl:threshold:list')")
+ @GetMapping("/list")
+ public TableDataInfo list(YwThreshold ywThreshold) {
+ startPage();
+ List<YwThreshold> list = ywThresholdService.selectYwThresholdList(ywThreshold);
+ return getDataTable(list);
+ }
+
+ /**
+ * 瀵煎嚭杩愮淮闃堝�煎垪琛�
+ */
+ // @PreAuthorize("@ss.hasPermi('ycl:threshold:export')")
+ @Log(title = "杩愮淮闃堝��", businessType = BusinessType.EXPORT)
+ @PostMapping("/export")
+ public void export(HttpServletResponse response, YwThreshold ywThreshold) {
+ List<YwThreshold> list = ywThresholdService.selectYwThresholdList(ywThreshold);
+ ExcelUtil<YwThreshold> util = new ExcelUtil<YwThreshold>(YwThreshold.class);
+ util.exportExcel(response, list, "杩愮淮闃堝�兼暟鎹�");
+ }
+
+ /**
+ * 鑾峰彇杩愮淮闃堝�艰缁嗕俊鎭�
+ */
+ // @PreAuthorize("@ss.hasPermi('ycl:threshold:query')")
+ @GetMapping(value = "/{id}")
+ public AjaxResult getInfo(@PathVariable("id") Integer id) {
+ return success(ywThresholdService.selectYwThresholdById(id));
+ }
+
+ /**
+ * 鏂板杩愮淮闃堝��
+ */
+ // @PreAuthorize("@ss.hasPermi('ycl:threshold:add')")
+ @Log(title = "杩愮淮闃堝��", businessType = BusinessType.INSERT)
+ @PostMapping
+ public AjaxResult add(@RequestBody YwThreshold ywThreshold) {
+ return toAjax(ywThresholdService.insertYwThreshold(ywThreshold));
+ }
+
+ /**
+ * 淇敼杩愮淮闃堝��
+ */
+ // @PreAuthorize("@ss.hasPermi('ycl:threshold:edit')")
+ @Log(title = "杩愮淮闃堝��", businessType = BusinessType.UPDATE)
+ @PutMapping
+ public AjaxResult edit(@RequestBody YwThreshold ywThreshold) {
+ return toAjax(ywThresholdService.updateYwThreshold(ywThreshold));
+ }
+
+ /**
+ * 鍒犻櫎杩愮淮闃堝��
+ */
+ // @PreAuthorize("@ss.hasPermi('ycl:threshold:remove')")
+ @Log(title = "杩愮淮闃堝��", businessType = BusinessType.DELETE)
+ @DeleteMapping("/{ids}")
+ public AjaxResult remove(@PathVariable Integer[] ids) {
+ return toAjax(ywThresholdService.deleteYwThresholdByIds(ids));
+ }
+}
diff --git a/ycl-server/src/main/java/com/ycl/platform/mapper/YwThresholdMapper.java b/ycl-server/src/main/java/com/ycl/platform/mapper/YwThresholdMapper.java
new file mode 100644
index 0000000..b4dd57f
--- /dev/null
+++ b/ycl-server/src/main/java/com/ycl/platform/mapper/YwThresholdMapper.java
@@ -0,0 +1,61 @@
+package com.ycl.platform.mapper;
+
+import com.ycl.platform.domain.entity.YwThreshold;
+
+import java.util.List;
+
+/**
+ * 杩愮淮闃堝�糓apper鎺ュ彛
+ *
+ * @author gonghl
+ * @date 2024-03-25
+ */
+public interface YwThresholdMapper {
+ /**
+ * 鏌ヨ杩愮淮闃堝��
+ *
+ * @param id 杩愮淮闃堝�间富閿�
+ * @return 杩愮淮闃堝��
+ */
+ public YwThreshold selectYwThresholdById(Integer id);
+
+ /**
+ * 鏌ヨ杩愮淮闃堝�煎垪琛�
+ *
+ * @param ywThreshold 杩愮淮闃堝��
+ * @return 杩愮淮闃堝�奸泦鍚�
+ */
+ public List<YwThreshold> selectYwThresholdList(YwThreshold ywThreshold);
+
+ /**
+ * 鏂板杩愮淮闃堝��
+ *
+ * @param ywThreshold 杩愮淮闃堝��
+ * @return 缁撴灉
+ */
+ public int insertYwThreshold(YwThreshold ywThreshold);
+
+ /**
+ * 淇敼杩愮淮闃堝��
+ *
+ * @param ywThreshold 杩愮淮闃堝��
+ * @return 缁撴灉
+ */
+ public int updateYwThreshold(YwThreshold ywThreshold);
+
+ /**
+ * 鍒犻櫎杩愮淮闃堝��
+ *
+ * @param id 杩愮淮闃堝�间富閿�
+ * @return 缁撴灉
+ */
+ public int deleteYwThresholdById(Integer id);
+
+ /**
+ * 鎵归噺鍒犻櫎杩愮淮闃堝��
+ *
+ * @param ids 闇�瑕佸垹闄ょ殑鏁版嵁涓婚敭闆嗗悎
+ * @return 缁撴灉
+ */
+ public int deleteYwThresholdByIds(Integer[] ids);
+}
diff --git a/ycl-server/src/main/java/com/ycl/platform/service/IYwThresholdService.java b/ycl-server/src/main/java/com/ycl/platform/service/IYwThresholdService.java
new file mode 100644
index 0000000..db7356a
--- /dev/null
+++ b/ycl-server/src/main/java/com/ycl/platform/service/IYwThresholdService.java
@@ -0,0 +1,62 @@
+package com.ycl.platform.service;
+
+
+import com.ycl.platform.domain.entity.YwThreshold;
+
+import java.util.List;
+
+/**
+ * 杩愮淮闃堝�糞ervice鎺ュ彛
+ *
+ * @author gonghl
+ * @date 2024-03-25
+ */
+public interface IYwThresholdService {
+ /**
+ * 鏌ヨ杩愮淮闃堝��
+ *
+ * @param id 杩愮淮闃堝�间富閿�
+ * @return 杩愮淮闃堝��
+ */
+ public YwThreshold selectYwThresholdById(Integer id);
+
+ /**
+ * 鏌ヨ杩愮淮闃堝�煎垪琛�
+ *
+ * @param ywThreshold 杩愮淮闃堝��
+ * @return 杩愮淮闃堝�奸泦鍚�
+ */
+ public List<YwThreshold> selectYwThresholdList(YwThreshold ywThreshold);
+
+ /**
+ * 鏂板杩愮淮闃堝��
+ *
+ * @param ywThreshold 杩愮淮闃堝��
+ * @return 缁撴灉
+ */
+ public int insertYwThreshold(YwThreshold ywThreshold);
+
+ /**
+ * 淇敼杩愮淮闃堝��
+ *
+ * @param ywThreshold 杩愮淮闃堝��
+ * @return 缁撴灉
+ */
+ public int updateYwThreshold(YwThreshold ywThreshold);
+
+ /**
+ * 鎵归噺鍒犻櫎杩愮淮闃堝��
+ *
+ * @param ids 闇�瑕佸垹闄ょ殑杩愮淮闃堝�间富閿泦鍚�
+ * @return 缁撴灉
+ */
+ public int deleteYwThresholdByIds(Integer[] ids);
+
+ /**
+ * 鍒犻櫎杩愮淮闃堝�间俊鎭�
+ *
+ * @param id 杩愮淮闃堝�间富閿�
+ * @return 缁撴灉
+ */
+ public int deleteYwThresholdById(Integer id);
+}
diff --git a/ycl-server/src/main/java/com/ycl/platform/service/impl/ReportServiceImpl.java b/ycl-server/src/main/java/com/ycl/platform/service/impl/ReportServiceImpl.java
index 7e759e5..91a7e7c 100644
--- a/ycl-server/src/main/java/com/ycl/platform/service/impl/ReportServiceImpl.java
+++ b/ycl-server/src/main/java/com/ycl/platform/service/impl/ReportServiceImpl.java
@@ -24,6 +24,7 @@
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.Assert;
import java.util.ArrayList;
+import java.util.Objects;
import java.util.stream.Collectors;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
@@ -112,6 +113,7 @@
public Result page(ReportQuery query) {
IPage<Report> page = new LambdaQueryChainWrapper<>(baseMapper)
+ .eq(StringUtils.isNotBlank(query.getReportType()), Report::getReportType, query.getReportType())
.orderByDesc(Report::getCreateTime)
.page(PageUtil.getPage(query, Report.class));
diff --git a/ycl-server/src/main/java/com/ycl/platform/service/impl/YwThresholdServiceImpl.java b/ycl-server/src/main/java/com/ycl/platform/service/impl/YwThresholdServiceImpl.java
new file mode 100644
index 0000000..0cbf737
--- /dev/null
+++ b/ycl-server/src/main/java/com/ycl/platform/service/impl/YwThresholdServiceImpl.java
@@ -0,0 +1,90 @@
+package com.ycl.platform.service.impl;
+
+import com.ycl.platform.domain.entity.YwThreshold;
+import com.ycl.platform.mapper.YwThresholdMapper;
+import com.ycl.platform.service.IYwThresholdService;
+import com.ycl.utils.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * 杩愮淮闃堝�糞ervice涓氬姟灞傚鐞�
+ *
+ * @author gonghl
+ * @date 2024-03-25
+ */
+@Service
+public class YwThresholdServiceImpl implements IYwThresholdService {
+ @Autowired
+ private YwThresholdMapper ywThresholdMapper;
+
+ /**
+ * 鏌ヨ杩愮淮闃堝��
+ *
+ * @param id 杩愮淮闃堝�间富閿�
+ * @return 杩愮淮闃堝��
+ */
+ @Override
+ public YwThreshold selectYwThresholdById(Integer id) {
+ return ywThresholdMapper.selectYwThresholdById(id);
+ }
+
+ /**
+ * 鏌ヨ杩愮淮闃堝�煎垪琛�
+ *
+ * @param ywThreshold 杩愮淮闃堝��
+ * @return 杩愮淮闃堝��
+ */
+ @Override
+ public List<YwThreshold> selectYwThresholdList(YwThreshold ywThreshold) {
+ return ywThresholdMapper.selectYwThresholdList(ywThreshold);
+ }
+
+ /**
+ * 鏂板杩愮淮闃堝��
+ *
+ * @param ywThreshold 杩愮淮闃堝��
+ * @return 缁撴灉
+ */
+ @Override
+ public int insertYwThreshold(YwThreshold ywThreshold) {
+ ywThreshold.setCreateTime(DateUtils.getNowDate());
+ return ywThresholdMapper.insertYwThreshold(ywThreshold);
+ }
+
+ /**
+ * 淇敼杩愮淮闃堝��
+ *
+ * @param ywThreshold 杩愮淮闃堝��
+ * @return 缁撴灉
+ */
+ @Override
+ public int updateYwThreshold(YwThreshold ywThreshold) {
+ ywThreshold.setUpdateTime(DateUtils.getNowDate());
+ return ywThresholdMapper.updateYwThreshold(ywThreshold);
+ }
+
+ /**
+ * 鎵归噺鍒犻櫎杩愮淮闃堝��
+ *
+ * @param ids 闇�瑕佸垹闄ょ殑杩愮淮闃堝�间富閿�
+ * @return 缁撴灉
+ */
+ @Override
+ public int deleteYwThresholdByIds(Integer[] ids) {
+ return ywThresholdMapper.deleteYwThresholdByIds(ids);
+ }
+
+ /**
+ * 鍒犻櫎杩愮淮闃堝�间俊鎭�
+ *
+ * @param id 杩愮淮闃堝�间富閿�
+ * @return 缁撴灉
+ */
+ @Override
+ public int deleteYwThresholdById(Integer id) {
+ return ywThresholdMapper.deleteYwThresholdById(id);
+ }
+}
diff --git a/ycl-server/src/main/resources/mapper/ycl/YwThresholdMapper.xml b/ycl-server/src/main/resources/mapper/ycl/YwThresholdMapper.xml
new file mode 100644
index 0000000..a4384cd
--- /dev/null
+++ b/ycl-server/src/main/resources/mapper/ycl/YwThresholdMapper.xml
@@ -0,0 +1,79 @@
+<?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="com.ycl.platform.mapper.YwThresholdMapper">
+
+ <resultMap type="YwThreshold" id="YwThresholdResult">
+ <result property="id" column="id"/>
+ <result property="monitorType" column="monitor_type"/>
+ <result property="timeout" column="timeout"/>
+ <result property="indicator" column="indicator"/>
+ <result property="createTime" column="create_time"/>
+ <result property="updateTime" column="update_time"/>
+ <result property="deleted" column="deleted"/>
+ </resultMap>
+
+ <sql id="selectYwThresholdVo">
+ select id, monitor_type, timeout, indicator, create_time, update_time, deleted
+ from t_yw_threshold
+ </sql>
+
+ <select id="selectYwThresholdList" parameterType="YwThreshold" resultMap="YwThresholdResult">
+ <include refid="selectYwThresholdVo"/>
+ <where>
+ <if test="monitorType != null and monitorType != ''">and monitor_type = #{monitorType}</if>
+ </where>
+ </select>
+
+ <select id="selectYwThresholdById" parameterType="Integer" resultMap="YwThresholdResult">
+ <include refid="selectYwThresholdVo"/>
+ where id = #{id}
+ </select>
+
+ <insert id="insertYwThreshold" parameterType="YwThreshold" useGeneratedKeys="true" keyProperty="id">
+ insert into t_yw_threshold
+ <trim prefix="(" suffix=")" suffixOverrides=",">
+ <if test="monitorType != null and monitorType != ''">monitor_type,</if>
+ <if test="timeout != null">timeout,</if>
+ <if test="indicator != null">indicator,</if>
+ <if test="createTime != null">create_time,</if>
+ <if test="updateTime != null">update_time,</if>
+ <if test="deleted != null">deleted,</if>
+ </trim>
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
+ <if test="monitorType != null and monitorType != ''">#{monitorType},</if>
+ <if test="timeout != null">#{timeout},</if>
+ <if test="indicator != null">#{indicator},</if>
+ <if test="createTime != null">#{createTime},</if>
+ <if test="updateTime != null">#{updateTime},</if>
+ <if test="deleted != null">#{deleted},</if>
+ </trim>
+ </insert>
+
+ <update id="updateYwThreshold" parameterType="YwThreshold">
+ update t_yw_threshold
+ <trim prefix="SET" suffixOverrides=",">
+ <if test="monitorType != null and monitorType != ''">monitor_type = #{monitorType},</if>
+ <if test="timeout != null">timeout = #{timeout},</if>
+ <if test="indicator != null">indicator = #{indicator},</if>
+ <if test="createTime != null">create_time = #{createTime},</if>
+ <if test="updateTime != null">update_time = #{updateTime},</if>
+ <if test="deleted != null">deleted = #{deleted},</if>
+ </trim>
+ where id = #{id}
+ </update>
+
+ <delete id="deleteYwThresholdById" parameterType="Integer">
+ delete
+ from t_yw_threshold
+ where id = #{id}
+ </delete>
+
+ <delete id="deleteYwThresholdByIds" parameterType="String">
+ delete from t_yw_threshold where id in
+ <foreach item="id" collection="array" open="(" separator="," close=")">
+ #{id}
+ </foreach>
+ </delete>
+</mapper>
\ No newline at end of file
--
Gitblit v1.8.0