소스 검색

任务提交 完成流测时间配置和水位变幅配置 加入操作接口

qinguocai 1 년 전
부모
커밋
484eb0fb48

+ 66 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/BerthingFloatConfig.java

@@ -0,0 +1,66 @@
+package com.ruoyi.system.domain;
+
+import java.util.Date;
+import java.io.Serializable;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+
+/**
+ * 停泊点水位变幅配置(BerthingFloatConfig)实体类
+ *
+ * @author makejava
+ * @since 2024-04-17 11:00:28
+ */
+@Data
+public class BerthingFloatConfig implements Serializable {
+    private static final long serialVersionUID = -49994754277835773L;
+/**
+     * 水位变幅ID
+     */
+    private Long floatId;
+/**
+     * 站码
+     */
+    private String id;
+/**
+     * 站点ID
+     */
+    private Long siteId;
+/**
+     * 策略编号
+     */
+    private Long planid;
+/**
+     * 创建时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date createTime;
+/**
+     * 状态 0:无效 1.有效 
+     */
+    private Integer status;
+/**
+     * 是否删除
+     */
+    private Integer isDel;
+/**
+     * 起测水位
+     */
+    private Double wlevel;
+/**
+     * 时间间隔(分钟)
+     */
+    private Long timespan;
+/**
+     * 水位变幅
+     */
+    private Double wlevelchange;
+
+    /**
+     * 站点名称
+     */
+    private String siteName;
+
+}
+

+ 49 - 0
ruoyi-system/src/main/java/com/ruoyi/system/dto/BerthingFloatDTO.java

@@ -0,0 +1,49 @@
+package com.ruoyi.system.dto;
+
+import lombok.Data;
+
+import javax.validation.constraints.NotNull;
+import java.io.Serializable;
+
+/**
+ * 停泊点水位变幅配置(BerthingFloatConfig)实体类
+ *
+ * @author makejava
+ * @since 2024-04-17 11:00:28
+ */
+@Data
+public class BerthingFloatDTO implements Serializable {
+
+/**
+     * 水位变幅ID
+     */
+    private Long floatId;
+
+/**
+     * 站点ID
+     */
+    @NotNull(message = "站点ID不能为空")
+    private Long siteId;
+/**
+     * 策略编号
+     */
+    @NotNull(message = "策略编号不能为空")
+    private Long planid;
+/**
+     * 起测水位
+     */
+    @NotNull(message = "起测水位不能为空")
+    private Double wlevel;
+/**
+     * 时间间隔(分钟)
+     */
+    @NotNull(message = "时间间隔不能为空")
+    private Long timespan;
+/**
+     * 水位变幅
+     */
+    @NotNull(message = "水位变幅不能为空")
+    private Double wlevelchange;
+
+}
+

+ 0 - 1
ruoyi-system/src/main/java/com/ruoyi/system/dto/BerthingTimeDTO.java

@@ -3,7 +3,6 @@ package com.ruoyi.system.dto;
 
 import lombok.Data;
 
-import javax.validation.constraints.NotBlank;
 import javax.validation.constraints.NotEmpty;
 import javax.validation.constraints.NotNull;
 import java.io.Serializable;

+ 38 - 0
ruoyi-system/src/main/java/com/ruoyi/system/dto/ManualMeasureDTO.java

@@ -0,0 +1,38 @@
+package com.ruoyi.system.dto;
+
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotEmpty;
+import javax.validation.constraints.NotNull;
+import java.io.Serializable;
+import java.util.ArrayList;
+
+/**
+ * 停泊点配置(BerthingPoint)实体类
+ *
+ * @author makejava
+ * @since 2024-04-10 15:29:55
+ */
+@Data
+public class ManualMeasureDTO implements Serializable {
+
+    /**
+     * 测量类型 1为根据设置垂线测流  2为临时指定垂线测流
+     */
+    @NotNull(message = "测量类型不能为空")
+    private Long type;
+    /**
+     * 停泊点数组(当type为2时有效),当type为1时改项为null 断面点位json list字符串 例子:[{“x”:54.3,"y":44.2}]
+     */
+    private ArrayList<PrintExcelDTO> positions;
+
+    /**
+     * 站点ID
+     */
+    @NotNull(message =" 站点ID不能为空")
+    private Long siteId;
+
+
+}
+

+ 85 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/BerthingFloatConfigMapper.java

@@ -0,0 +1,85 @@
+package com.ruoyi.system.mapper;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ruoyi.system.domain.BerthingFloatConfig;
+import com.ruoyi.system.paramet.FloatPointQuery;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.data.domain.Pageable;
+import java.util.List;
+
+/**
+ * 停泊点水位变幅配置(BerthingFloatConfig)表数据库访问层
+ *
+ * @author makejava
+ * @since 2024-04-17 11:00:28
+ */
+public interface BerthingFloatConfigMapper {
+
+    /**
+     * 通过ID查询单条数据
+     *
+     * @param floatId 主键
+     * @return 实例对象
+     */
+    BerthingFloatConfig queryById(Long floatId);
+
+    /**
+     * 查询指定行数据
+     *
+     * @param floatPointQuery 查询条件
+     * @param page         分页对象
+     * @return 对象列表
+     */
+    Page<BerthingFloatConfig> queryAllByLimit(@Param("floatPointQuery") FloatPointQuery floatPointQuery, Page page);
+
+    /**
+     * 统计总行数
+     *
+     * @param berthingFloatConfig 查询条件
+     * @return 总行数
+     */
+    long count(BerthingFloatConfig berthingFloatConfig);
+
+    /**
+     * 新增数据
+     *
+     * @param berthingFloatConfig 实例对象
+     * @return 影响行数
+     */
+    int insert(BerthingFloatConfig berthingFloatConfig);
+
+    /**
+     * 批量新增数据(MyBatis原生foreach方法)
+     *
+     * @param entities List<BerthingFloatConfig> 实例对象列表
+     * @return 影响行数
+     */
+    int insertBatch(@Param("entities") List<BerthingFloatConfig> entities);
+
+    /**
+     * 批量新增或按主键更新数据(MyBatis原生foreach方法)
+     *
+     * @param entities List<BerthingFloatConfig> 实例对象列表
+     * @return 影响行数
+     * @throws org.springframework.jdbc.BadSqlGrammarException 入参是空List的时候会抛SQL语句错误的异常,请自行校验入参
+     */
+    int insertOrUpdateBatch(@Param("entities") List<BerthingFloatConfig> entities);
+
+    /**
+     * 修改数据
+     *
+     * @param berthingFloatConfig 实例对象
+     * @return 影响行数
+     */
+    int update(BerthingFloatConfig berthingFloatConfig);
+
+    /**
+     * 通过主键删除数据
+     *
+     * @param floatId 主键
+     * @return 影响行数
+     */
+    int deleteById(Long floatId);
+
+}
+

+ 38 - 0
ruoyi-system/src/main/java/com/ruoyi/system/paramet/FloatPointQuery.java

@@ -0,0 +1,38 @@
+package com.ruoyi.system.paramet;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * 停泊点配置(BerthingPoint)实体类
+ *
+ * @author makejava
+ * @since 2024-04-10 15:29:55
+ */
+@Data
+public class FloatPointQuery implements Serializable {
+
+
+    /**
+     * 停泊点增幅策略ID
+     */
+    private Long FloatId;
+
+    /**
+     * 站点ID
+     */
+    private Long siteId;
+
+    /**
+     * 分页
+     */
+    private Long page;
+
+    /**
+     * 分页长度
+     */
+    private Long size;
+
+}
+

+ 7 - 4
ruoyi-system/src/main/java/com/ruoyi/system/service/BerthingService.java

@@ -2,14 +2,13 @@ package com.ruoyi.system.service;
 
 
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ruoyi.system.domain.BerthingFloatConfig;
 import com.ruoyi.system.domain.BerthingPoint;
 import com.ruoyi.system.domain.BerthingPointConfig;
 import com.ruoyi.system.domain.BerthingTimeConfig;
-import com.ruoyi.system.dto.BerthingPointConfigDTO;
-import com.ruoyi.system.dto.BerthingPointDTO;
-import com.ruoyi.system.dto.BerthingTimeDTO;
-import com.ruoyi.system.dto.PrintExcelDTO;
+import com.ruoyi.system.dto.*;
 import com.ruoyi.system.paramet.BerthingPointQuery;
+import com.ruoyi.system.paramet.FloatPointQuery;
 import com.ruoyi.system.paramet.StopPointQuery;
 import com.ruoyi.system.paramet.TimePointQuery;
 import org.springframework.web.multipart.MultipartFile;
@@ -41,4 +40,8 @@ public interface BerthingService {
 
 
     Page<BerthingTimeConfig> queryTimePrint(TimePointQuery timePointQuery);
+
+    boolean addFloatPrint(BerthingFloatDTO berthingFloatDTO);
+
+    Page<BerthingFloatConfig> queryFloatPrint(FloatPointQuery floatPointQuery);
 }

+ 26 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/DirectiveService.java

@@ -0,0 +1,26 @@
+package com.ruoyi.system.service;
+
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ruoyi.system.domain.BerthingFloatConfig;
+import com.ruoyi.system.domain.BerthingPoint;
+import com.ruoyi.system.domain.BerthingPointConfig;
+import com.ruoyi.system.domain.BerthingTimeConfig;
+import com.ruoyi.system.dto.*;
+import com.ruoyi.system.paramet.BerthingPointQuery;
+import com.ruoyi.system.paramet.FloatPointQuery;
+import com.ruoyi.system.paramet.StopPointQuery;
+import com.ruoyi.system.paramet.TimePointQuery;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.ArrayList;
+
+
+public interface DirectiveService {
+
+    boolean manualMeasure(ManualMeasureDTO manualMeasureDTO);
+
+    boolean taskStop(Long siteId);
+
+}

+ 69 - 14
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/BerthingServiceImpl.java

@@ -9,19 +9,11 @@ import com.alibaba.excel.write.metadata.WriteSheet;
 import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.ruoyi.common.exception.base.BaseException;
-import com.ruoyi.system.domain.BerthingPoint;
-import com.ruoyi.system.domain.BerthingPointConfig;
-import com.ruoyi.system.domain.BerthingTimeConfig;
-import com.ruoyi.system.domain.SiteInfo;
-import com.ruoyi.system.dto.BerthingPointConfigDTO;
-import com.ruoyi.system.dto.BerthingPointDTO;
-import com.ruoyi.system.dto.BerthingTimeDTO;
-import com.ruoyi.system.dto.PrintExcelDTO;
-import com.ruoyi.system.mapper.BerthingPointConfigMapper;
-import com.ruoyi.system.mapper.BerthingPointMapper;
-import com.ruoyi.system.mapper.BerthingTimeConfigMapper;
-import com.ruoyi.system.mapper.SiteInfoMapper;
+import com.ruoyi.system.domain.*;
+import com.ruoyi.system.dto.*;
+import com.ruoyi.system.mapper.*;
 import com.ruoyi.system.paramet.BerthingPointQuery;
+import com.ruoyi.system.paramet.FloatPointQuery;
 import com.ruoyi.system.paramet.StopPointQuery;
 import com.ruoyi.system.paramet.TimePointQuery;
 import com.ruoyi.system.service.BerthingService;
@@ -31,7 +23,6 @@ import org.springframework.web.multipart.MultipartFile;
 
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletResponse;
-import javax.validation.constraints.NotBlank;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
 import java.util.Comparator;
@@ -60,6 +51,9 @@ public class BerthingServiceImpl implements BerthingService {
     @Resource
     private BerthingTimeConfigMapper berthingTimeConfigMapper;
 
+    @Resource
+    private BerthingFloatConfigMapper berthingFloatConfigMapper;
+
 
     @Override
     public ArrayList<PrintExcelDTO> uploadFile(MultipartFile file) {
@@ -145,7 +139,6 @@ public class BerthingServiceImpl implements BerthingService {
         try {
             List<PrintExcelDTO> positions = JSONUtil.toList(berthingPoint.getPositions(), PrintExcelDTO.class);
             response.setContentType("application/octet-stream; charset=utf-8");
-            // 文件名中文名需要转义
             String today = new SimpleDateFormat("yyyyMMdd").format(new Date());
             String fileName = "downFile_".concat(today);
             // 设置导出头信息,文件名放在里面
@@ -287,6 +280,68 @@ public class BerthingServiceImpl implements BerthingService {
     }
 
 
+    @Override
+    public boolean addFloatPrint(BerthingFloatDTO berthingFloatDTO) {
+        SiteInfo siteInfo = siteInfoMapper.queryById(berthingFloatDTO.getSiteId());
+        if (siteInfo == null) {
+            throw new BaseException("站点不存在");
+        }
+        if (berthingFloatDTO.getFloatId() == null) {
+           berthingFloatDTO.setFloatId(0L);
+        }
+        boolean res = false;
+        BerthingFloatConfig berthingFloat = berthingFloatConfigMapper.queryById(berthingFloatDTO.getFloatId());
+        try {
+            if (berthingFloat == null) {
+                //新增
+                berthingFloat = new BerthingFloatConfig();
+                berthingFloat.setFloatId(0L);
+                berthingFloat.setSiteId(siteInfo.getSiteId());
+                berthingFloat.setPlanid(berthingFloatDTO.getPlanid());
+                berthingFloat.setWlevel(berthingFloatDTO.getWlevel());
+                berthingFloat.setCreateTime(new Date());
+                berthingFloat.setIsDel(0);
+                berthingFloat.setStatus(1);
+                berthingFloat.setId(siteInfo.getId());
+                berthingFloat.setTimespan(berthingFloatDTO.getTimespan());
+                berthingFloat.setWlevelchange(berthingFloatDTO.getWlevelchange());
+                res =  berthingFloatConfigMapper.insert(berthingFloat) > 0;
+            } else {
+                //更新
+                berthingFloat.setPlanid(berthingFloatDTO.getPlanid());
+                berthingFloat.setWlevel(berthingFloatDTO.getWlevel());
+                berthingFloat.setTimespan(berthingFloatDTO.getTimespan());
+                berthingFloat.setWlevelchange(berthingFloatDTO.getWlevelchange());
+                res =  berthingFloatConfigMapper.update(berthingFloat) > 0;
+            }
+        } catch (Exception e){
+            log.error("新增或修改水位变幅策略错误", e);
+            throw new BaseException("新增或修改水位变幅策略错误");
+        }
+        //TODO 下发配置
+        return res;
+    }
+
+    @Override
+    public Page<BerthingFloatConfig> queryFloatPrint(FloatPointQuery floatPointQuery) {
+        try {
+            if (floatPointQuery.getPage() == null || floatPointQuery.getSize() == null) {
+                floatPointQuery.setPage(1L);
+                floatPointQuery.setSize(10L);
+            }
+            return berthingFloatConfigMapper.queryAllByLimit(floatPointQuery, new Page<>(floatPointQuery.getPage(), floatPointQuery.getSize()));
+        } catch (Exception e) {
+            log.error("查询水位变幅策略错误", e);
+            throw new BaseException("查询水位变幅策略错误");
+        }
+
+    }
+
+
+
+
+
+
 
 
 }

+ 74 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/DirectiveServiceImpl.java

@@ -0,0 +1,74 @@
+package com.ruoyi.system.service.impl;
+
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ruoyi.common.exception.base.BaseException;
+import com.ruoyi.system.domain.SiteConfig;
+import com.ruoyi.system.domain.SiteInfo;
+import com.ruoyi.system.dto.ManualMeasureDTO;
+import com.ruoyi.system.dto.SiteConfigDTO;
+import com.ruoyi.system.dto.SiteInfoDTO;
+import com.ruoyi.system.mapper.SiteConfigMapper;
+import com.ruoyi.system.mapper.SiteInfoMapper;
+import com.ruoyi.system.paramet.SiteInfoQuery;
+import com.ruoyi.system.service.DirectiveService;
+import com.ruoyi.system.service.SiteService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.BeanUtils;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.annotation.Resource;
+import java.util.Date;
+
+
+/**
+ * classname: 站点信息
+ * description  服务实现类
+ */
+@Service
+@Slf4j
+public class DirectiveServiceImpl implements DirectiveService {
+
+    @Resource
+    private SiteInfoMapper siteInfoMapper;
+
+    @Override
+    public boolean manualMeasure(ManualMeasureDTO manualMeasureDTO) {
+        SiteInfo siteInfo = siteInfoMapper.queryById(manualMeasureDTO.getSiteId());
+        if (siteInfo == null) {
+            throw new BaseException("站点不存在");
+        }
+        try {
+            log.info("手动测量信息下发{}", manualMeasureDTO);
+            //TODO 发送mqtt
+        } catch (Exception e){
+            log.error("手动测量下发异常", e);
+            throw new BaseException("手动测量下发异常");
+        }
+        return true;
+    }
+
+
+    @Override
+    public boolean taskStop(Long siteId) {
+        SiteInfo siteInfo = siteInfoMapper.queryById(siteId);
+        if (siteInfo == null) {
+            throw new BaseException("站点不存在");
+        }
+        try {
+            log.info("手动停止任务 {}", siteId);
+            //TODO 发送mqtt
+        } catch (Exception e){
+            log.error("手动测量下发异常", e);
+            throw new BaseException("手动测量下发异常");
+        }
+        return true;
+    }
+
+
+
+
+
+
+}

+ 154 - 0
ruoyi-system/src/main/resources/mapper/BerthingFloatConfigMapper.xml

@@ -0,0 +1,154 @@
+<?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.ruoyi.system.mapper.BerthingFloatConfigMapper">
+
+    <resultMap type="com.ruoyi.system.domain.BerthingFloatConfig" id="BerthingFloatConfigMap">
+        <result property="floatId" column="float_id" jdbcType="INTEGER"/>
+        <result property="id" column="id" jdbcType="VARCHAR"/>
+        <result property="siteId" column="site_id" jdbcType="INTEGER"/>
+        <result property="planid" column="planid" jdbcType="INTEGER"/>
+        <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
+        <result property="status" column="status" jdbcType="INTEGER"/>
+        <result property="isDel" column="is_del" jdbcType="INTEGER"/>
+        <result property="wlevel" column="wlevel" jdbcType="NUMERIC"/>
+        <result property="timespan" column="timespan" jdbcType="INTEGER"/>
+        <result property="wlevelchange" column="wlevelchange" jdbcType="NUMERIC"/>
+        <result property="siteName" column="site_name" jdbcType="VARCHAR"/>
+    </resultMap>
+
+    <!--查询单个-->
+    <select id="queryById" resultMap="BerthingFloatConfigMap">
+        select
+float_id, id, site_id, planid, create_time, status, is_del, wlevel, timespan, wlevelchange
+        from berthing_float_config
+        where float_id = #{floatId}
+    </select>
+
+    <!--查询指定行数据-->
+    <select id="queryAllByLimit" resultMap="BerthingFloatConfigMap">
+        select
+            a.float_id, a.id, a.site_id, a.planid, a.create_time, a.status, a.is_del, a.wlevel, a.timespan, a.wlevelchange, b.site_name
+        from berthing_float_config as a
+        join site_info as b on a.site_id = b.site_id
+        <where>
+            <if test="floatPointQuery.floatId != null">
+                and a.float_id = #{floatPointQuery.floatId}
+            </if>
+            <if test="floatPointQuery.siteId != null">
+                and a.site_id = #{floatPointQuery.siteId}
+            </if>
+        </where>
+    </select>
+
+    <!--统计总行数-->
+    <select id="count" resultType="java.lang.Long">
+        select count(1)
+        from berthing_float_config
+        <where>
+            <if test="floatId != null">
+                and float_id = #{floatId}
+            </if>
+            <if test="id != null and id != ''">
+                and id = #{id}
+            </if>
+            <if test="siteId != null">
+                and site_id = #{siteId}
+            </if>
+            <if test="planid != null">
+                and planid = #{planid}
+            </if>
+            <if test="createTime != null">
+                and create_time = #{createTime}
+            </if>
+            <if test="status != null">
+                and status = #{status}
+            </if>
+            <if test="isDel != null">
+                and is_del = #{isDel}
+            </if>
+            <if test="wlevel != null">
+                and wlevel = #{wlevel}
+            </if>
+            <if test="timespan != null">
+                and timespan = #{timespan}
+            </if>
+            <if test="wlevelchange != null">
+                and wlevelchange = #{wlevelchange}
+            </if>
+        </where>
+    </select>
+
+    <!--新增所有列-->
+    <insert id="insert" keyProperty="floatId" useGeneratedKeys="true">
+        insert into berthing_float_config(id, site_id, planid, create_time, status, is_del, wlevel, timespan, wlevelchange)
+        values (#{id}, #{siteId}, #{planid}, #{createTime}, #{status}, #{isDel}, #{wlevel}, #{timespan}, #{wlevelchange})
+    </insert>
+
+    <insert id="insertBatch" keyProperty="floatId" useGeneratedKeys="true">
+        insert into berthing_float_config(id, site_id, planid, create_time, status, is_del, wlevel, timespan, wlevelchange)
+        values
+        <foreach collection="entities" item="entity" separator=",">
+        (#{entity.id}, #{entity.siteId}, #{entity.planid}, #{entity.createTime}, #{entity.status}, #{entity.isDel}, #{entity.wlevel}, #{entity.timespan}, #{entity.wlevelchange})
+        </foreach>
+    </insert>
+
+    <insert id="insertOrUpdateBatch" keyProperty="floatId" useGeneratedKeys="true">
+        insert into berthing_float_config(id, site_id, planid, create_time, status, is_del, wlevel, timespan, wlevelchange)
+        values
+        <foreach collection="entities" item="entity" separator=",">
+            (#{entity.id}, #{entity.siteId}, #{entity.planid}, #{entity.createTime}, #{entity.status}, #{entity.isDel}, #{entity.wlevel}, #{entity.timespan}, #{entity.wlevelchange})
+        </foreach>
+        on duplicate key update
+id = values(id),
+site_id = values(site_id),
+planid = values(planid),
+create_time = values(create_time),
+status = values(status),
+is_del = values(is_del),
+wlevel = values(wlevel),
+timespan = values(timespan),
+wlevelchange = values(wlevelchange)
+    </insert>
+
+    <!--通过主键修改数据-->
+    <update id="update">
+        update berthing_float_config
+        <set>
+            <if test="id != null and id != ''">
+                id = #{id},
+            </if>
+            <if test="siteId != null">
+                site_id = #{siteId},
+            </if>
+            <if test="planid != null">
+                planid = #{planid},
+            </if>
+            <if test="createTime != null">
+                create_time = #{createTime},
+            </if>
+            <if test="status != null">
+                status = #{status},
+            </if>
+            <if test="isDel != null">
+                is_del = #{isDel},
+            </if>
+            <if test="wlevel != null">
+                wlevel = #{wlevel},
+            </if>
+            <if test="timespan != null">
+                timespan = #{timespan},
+            </if>
+            <if test="wlevelchange != null">
+                wlevelchange = #{wlevelchange},
+            </if>
+        </set>
+        where float_id = #{floatId}
+    </update>
+
+    <!--通过主键删除-->
+    <delete id="deleteById">
+        delete from berthing_float_config where float_id = #{floatId}
+    </delete>
+
+</mapper>
+

+ 15 - 5
waterAffairs-admin/src/main/java/com/ruoyi/web/controller/tool/BerthingController.java

@@ -3,14 +3,13 @@ package com.ruoyi.web.controller.tool;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.ruoyi.common.annotation.Anonymous;
 import com.ruoyi.common.utils.R;
+import com.ruoyi.system.domain.BerthingFloatConfig;
 import com.ruoyi.system.domain.BerthingPoint;
 import com.ruoyi.system.domain.BerthingPointConfig;
 import com.ruoyi.system.domain.BerthingTimeConfig;
-import com.ruoyi.system.dto.BerthingPointConfigDTO;
-import com.ruoyi.system.dto.BerthingPointDTO;
-import com.ruoyi.system.dto.BerthingTimeDTO;
-import com.ruoyi.system.dto.PrintExcelDTO;
+import com.ruoyi.system.dto.*;
 import com.ruoyi.system.paramet.BerthingPointQuery;
+import com.ruoyi.system.paramet.FloatPointQuery;
 import com.ruoyi.system.paramet.StopPointQuery;
 import com.ruoyi.system.paramet.TimePointQuery;
 import com.ruoyi.system.service.BerthingService;
@@ -86,13 +85,24 @@ public class BerthingController {
         return R.ok(berthingService.addTimePrint(berthingTimeDTO));
     }
 
-
     @PostMapping(value = "/queryTimePrint")
     @ApiOperation("查询时间策略")
     public R<Page<BerthingTimeConfig>> queryTimePrint(@RequestBody TimePointQuery timePointQuery) {
         return R.ok(berthingService.queryTimePrint(timePointQuery));
     }
 
+    @PostMapping(value = "/addFloatPrint")
+    @ApiOperation("增加或修改水位变幅策略")
+    public R<Boolean> addFloatPrint(@Valid @RequestBody BerthingFloatDTO berthingTimeDTO) {
+        return R.ok(berthingService.addFloatPrint(berthingTimeDTO));
+    }
+
+    @PostMapping(value = "/queryFloatPrint")
+    @ApiOperation("查询水位变幅策略")
+    public R<Page<BerthingFloatConfig>> queryFloatPrint(@RequestBody FloatPointQuery floatPointQuery) {
+        return R.ok(berthingService.queryFloatPrint(floatPointQuery));
+    }
+
 
 
 }

+ 46 - 0
waterAffairs-admin/src/main/java/com/ruoyi/web/controller/tool/DirectiveController.java

@@ -0,0 +1,46 @@
+package com.ruoyi.web.controller.tool;
+
+
+import com.ruoyi.common.annotation.Anonymous;
+import com.ruoyi.common.utils.R;
+import com.ruoyi.system.dto.ManualMeasureDTO;
+import com.ruoyi.system.service.DirectiveService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+import javax.validation.Valid;
+
+/**
+ * Create By Spring-2022/10/29
+ */
+@Controller
+@RequestMapping(value = "/directive")
+@Api(value = "DirectiveController", tags = {"指令控制"})
+@Slf4j
+@Anonymous
+public class DirectiveController {
+
+    @Resource
+    private DirectiveService directiveService;
+
+
+    @PostMapping(value = "/manualMeasure")
+    @ApiOperation("手动开始测量")
+    public R<Boolean> manualMeasure(@Valid @RequestBody ManualMeasureDTO manualMeasureDTO)  {
+        return R.ok(directiveService.manualMeasure(manualMeasureDTO));
+    }
+
+    @PostMapping(value = "/taskStop")
+    @ApiOperation("任务停止")
+    public R<Boolean> taskStop(Long siteId)  {
+        return R.ok(directiveService.taskStop(siteId));
+    }
+
+
+
+
+}

+ 53 - 0
waterAffairs-admin/src/main/java/com/ruoyi/web/controller/tool/ReportDataController.java

@@ -0,0 +1,53 @@
+package com.ruoyi.web.controller.tool;
+
+
+import com.ruoyi.common.annotation.Anonymous;
+import com.ruoyi.common.utils.R;
+import com.ruoyi.system.dto.ManualMeasureDTO;
+import com.ruoyi.system.service.DirectiveService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import javax.annotation.Resource;
+import javax.validation.Valid;
+
+/**
+ * Create By Spring-2022/10/29
+ */
+@Controller
+@RequestMapping(value = "/reportData")
+@Api(value = "ReportDataController", tags = {"数据查询"})
+@Slf4j
+@Anonymous
+public class ReportDataController {
+
+    //小车位置
+
+    //小车状态
+
+    //站点信息 有无任务
+
+    //即时信息
+
+    //当前水位
+
+    //水位趋势
+
+    //垂线点对应流量图
+
+    //通知消息
+
+    //成果列表
+
+    //成果导出
+
+    //散点图
+
+
+
+}