parent
4cd8a1dcb8
commit
284887bfcb
|
|
@ -0,0 +1,27 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>com.gunshi</groupId>
|
||||
<artifactId>gunshi-project-hsz-parent</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<relativePath>../parent/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
<artifactId>gunshi-project-hsz-common</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
package com.gunshi.project.hsz.common.mapper;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.gunshi.project.hsz.common.model.JcskByB;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@DS("tsg")
|
||||
@Mapper
|
||||
public interface JcskByBMapper extends BaseMapper<JcskByB> {
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
package com.gunshi.project.hsz.common.mapper;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.gunshi.project.hsz.common.model.JcskByR;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@DS("tsg")
|
||||
@Mapper
|
||||
public interface JcskByRMapper extends BaseMapper<JcskByR> {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
package com.gunshi.project.hsz.common.mapper;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.gunshi.project.hsz.common.model.JcskGnssB;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@DS("tsg")
|
||||
@Mapper
|
||||
public interface JcskGnssBMapper extends BaseMapper<JcskGnssB> {
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
package com.gunshi.project.hsz.common.mapper;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.gunshi.project.hsz.common.model.JcskGnssR;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@DS("tsg")
|
||||
@Mapper
|
||||
public interface JcskGnssRMapper extends BaseMapper<JcskGnssR> {
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
package com.gunshi.project.hsz.common.mapper;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.gunshi.project.hsz.common.model.JcskSlB;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@DS("tsg")
|
||||
@Mapper
|
||||
public interface JcskSlBMapper extends BaseMapper<JcskSlB> {
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
package com.gunshi.project.hsz.common.mapper;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.gunshi.project.hsz.common.model.JcskSlR;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@DS("tsg")
|
||||
@Mapper
|
||||
public interface JcskSlRMapper extends BaseMapper<JcskSlR> {
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
package com.gunshi.project.hsz.common.mapper;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.gunshi.project.hsz.common.model.JcskSyB;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@DS("tsg")
|
||||
@Mapper
|
||||
public interface JcskSyBMapper extends BaseMapper<JcskSyB> {
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
package com.gunshi.project.hsz.common.mapper;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.gunshi.project.hsz.common.model.JcskSyR;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@DS("tsg")
|
||||
@Mapper
|
||||
public interface JcskSyRMapper extends BaseMapper<JcskSyR> {
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
package com.gunshi.project.hsz.common.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.gunshi.project.hsz.common.model.StFlowR;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface StFlowRMapper extends BaseMapper<StFlowR> {
|
||||
|
||||
}
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
package com.gunshi.project.hsz.mapper;
|
||||
package com.gunshi.project.hsz.common.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.gunshi.project.hsz.model.StStbprpBElem;
|
||||
import com.gunshi.project.hsz.common.model.StStbprpBElem;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
package com.gunshi.project.hsz.common.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.gunshi.project.hsz.common.model.StStbprpB;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 描述: sttp 以水利标准来
|
||||
* author: xusan
|
||||
* date: 2024-07-08 15:44:08
|
||||
*/
|
||||
@Mapper
|
||||
public interface StStbprpBMapper extends BaseMapper<StStbprpB> {
|
||||
|
||||
|
||||
@Select("""
|
||||
select * from public.st_stbprp_b b
|
||||
join public.st_stbprp_b_elem e
|
||||
on b.stcd = e.stcd
|
||||
where e.elem='drp'
|
||||
""")
|
||||
List<StStbprpB> getPptnStations();
|
||||
|
||||
@Select("""
|
||||
select * from public.st_stbprp_b b
|
||||
where b.sttp='RR'
|
||||
""")
|
||||
List<StStbprpB> getRsvrStations();
|
||||
}
|
||||
|
|
@ -0,0 +1,211 @@
|
|||
package com.gunshi.project.hsz.common.model;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.gunshi.db.annotation.IgnoreAutoMapperAndDao;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 白蚁设备表实体类
|
||||
* 数据源为WaterDevice
|
||||
* 与r表通过device_id关联
|
||||
* @see com.gunshi.project.hsz.datasync.entity.jcsk.WaterDevice
|
||||
*/
|
||||
@Data
|
||||
@TableName("jcsk_by_b")
|
||||
@IgnoreAutoMapperAndDao
|
||||
public class JcskByB {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableField("id")
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 设备名称
|
||||
*/
|
||||
@TableField("name")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 设备编码
|
||||
*/
|
||||
@TableField("code")
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 站点接入编码
|
||||
*/
|
||||
@TableField("mn_no")
|
||||
private String mnNo;
|
||||
|
||||
/**
|
||||
* 厂家id
|
||||
*/
|
||||
@TableField("factory_id")
|
||||
private Integer factoryId;
|
||||
|
||||
/**
|
||||
* 服务站点id
|
||||
*/
|
||||
@TableField("station_id")
|
||||
private Integer stationId;
|
||||
|
||||
/**
|
||||
* 服务站点名称
|
||||
*/
|
||||
@TableField("station_name")
|
||||
private String stationName;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField("created_at")
|
||||
private Integer createdAt;
|
||||
|
||||
/**
|
||||
* 创建人id
|
||||
*/
|
||||
@TableField("created_user")
|
||||
private Integer createdUser;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@TableField("updated_at")
|
||||
private Integer updatedAt;
|
||||
|
||||
/**
|
||||
* 修改人id
|
||||
*/
|
||||
@TableField("updated_user")
|
||||
private Integer updatedUser;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
@TableField("status")
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 纬度
|
||||
*/
|
||||
@TableField("lat")
|
||||
private BigDecimal lat;
|
||||
|
||||
/**
|
||||
* 经度
|
||||
*/
|
||||
@TableField("lon")
|
||||
private BigDecimal lon;
|
||||
|
||||
/**
|
||||
* 省份id
|
||||
*/
|
||||
@TableField("province_id")
|
||||
private Long provinceId;
|
||||
|
||||
/**
|
||||
* 省份名称
|
||||
*/
|
||||
@TableField("province_name")
|
||||
private String provinceName;
|
||||
|
||||
/**
|
||||
* 城市id
|
||||
*/
|
||||
@TableField("city_id")
|
||||
private Long cityId;
|
||||
|
||||
/**
|
||||
* 城市名称
|
||||
*/
|
||||
@TableField("city_name")
|
||||
private String cityName;
|
||||
|
||||
/**
|
||||
* 区域名称
|
||||
*/
|
||||
@TableField("area_name")
|
||||
private String areaName;
|
||||
|
||||
/**
|
||||
* 区域id
|
||||
*/
|
||||
@TableField("area_id")
|
||||
private Long areaId;
|
||||
|
||||
/**
|
||||
* 设备类型
|
||||
*/
|
||||
@TableField("type")
|
||||
private Integer type;
|
||||
|
||||
/**
|
||||
* 设备类型详情
|
||||
*/
|
||||
@TableField("send_type")
|
||||
private String sendType;
|
||||
|
||||
/**
|
||||
* 联系人
|
||||
*/
|
||||
@TableField("contact")
|
||||
private String contact;
|
||||
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
@TableField("telephone")
|
||||
private String telephone;
|
||||
|
||||
/**
|
||||
* 流域
|
||||
*/
|
||||
@TableField("river")
|
||||
private String river;
|
||||
|
||||
/**
|
||||
* 安装地点
|
||||
*/
|
||||
@TableField("address")
|
||||
private String address;
|
||||
|
||||
/**
|
||||
* 产品型号
|
||||
*/
|
||||
@TableField("model")
|
||||
private String model;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@TableField("remark")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 通信方式
|
||||
*/
|
||||
@TableField("communication_type")
|
||||
private Integer communicationType;
|
||||
|
||||
/**
|
||||
* 设备图片
|
||||
*/
|
||||
@TableField("image_url")
|
||||
private String imageUrl;
|
||||
|
||||
/**
|
||||
* 设备视频流地址的ip
|
||||
*/
|
||||
@TableField("video_ip")
|
||||
private String videoIp;
|
||||
|
||||
/**
|
||||
* 设备视频id
|
||||
*/
|
||||
@TableField("video_id")
|
||||
private String videoId;
|
||||
}
|
||||
|
|
@ -0,0 +1,109 @@
|
|||
package com.gunshi.project.hsz.common.model;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.gunshi.db.annotation.IgnoreAutoMapperAndDao;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 白蚁数据表实体类
|
||||
* 数据源为WaterDataTermites
|
||||
* nmNo = JcskByB.
|
||||
* @see com.gunshi.project.hsz.datasync.entity.jcsk.WaterDataTermites
|
||||
*/
|
||||
@Data
|
||||
@TableName("jcsk_by_r")
|
||||
@IgnoreAutoMapperAndDao
|
||||
public class JcskByR {
|
||||
/**
|
||||
* 设备编码
|
||||
*/
|
||||
@TableField("mn_no")
|
||||
private String mnNo;
|
||||
|
||||
/**
|
||||
* 白蚁蚁情状态,有白蚁入侵为1
|
||||
*/
|
||||
@TableField("status")
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 白蚁设备电量
|
||||
*/
|
||||
@TableField("electricity")
|
||||
private Integer electricity;
|
||||
|
||||
/**
|
||||
* 白蚁设备安装的点位顺序
|
||||
*/
|
||||
@TableField("\"order\"")
|
||||
private String order;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField("created_at")
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
/**
|
||||
* 观测时间
|
||||
*/
|
||||
@TableField("ob_time")
|
||||
private String obTime;
|
||||
|
||||
/**
|
||||
* 观测时间2
|
||||
*/
|
||||
@TableField("ob_date")
|
||||
private LocalDateTime obDate;
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@TableField("id")
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 水库id
|
||||
*/
|
||||
@TableField("station_id")
|
||||
private Integer stationId;
|
||||
|
||||
/**
|
||||
* 站点名称
|
||||
*/
|
||||
@TableField("station_name")
|
||||
private String stationName;
|
||||
|
||||
/**
|
||||
* 设备id
|
||||
*/
|
||||
@TableField("device_id")
|
||||
private Integer deviceId;
|
||||
|
||||
/**
|
||||
* 设备名称
|
||||
*/
|
||||
@TableField("device_name")
|
||||
private String deviceName;
|
||||
|
||||
/**
|
||||
* 任务状态
|
||||
*/
|
||||
@TableField("task_status")
|
||||
private String taskStatus;
|
||||
|
||||
/**
|
||||
* 任务id
|
||||
*/
|
||||
@TableField("task_id")
|
||||
private String taskId;
|
||||
|
||||
/**
|
||||
* 接收类型
|
||||
*/
|
||||
@TableField("receive_type")
|
||||
private Short receiveType;
|
||||
}
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
package com.gunshi.project.hsz.common.model;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.gunshi.db.annotation.IgnoreAutoMapperAndDao;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 位移设备表
|
||||
* 数据源为AttWyCdBase
|
||||
* 与r表通过rscd加cd关联
|
||||
* @see com.gunshi.project.hsz.datasync.entity.jcsk.AttWyCdBase
|
||||
*/
|
||||
@Data
|
||||
@TableName("jcsk_gnss_b")
|
||||
@IgnoreAutoMapperAndDao
|
||||
public class JcskGnssB {
|
||||
/**
|
||||
* 测点编码
|
||||
*/
|
||||
@TableField("cd")
|
||||
private String cd;
|
||||
|
||||
/**
|
||||
* 测点名称
|
||||
*/
|
||||
@TableField("cd_nm")
|
||||
private String cdNm;
|
||||
|
||||
/**
|
||||
* 桩号
|
||||
*/
|
||||
@TableField("ch")
|
||||
private String ch;
|
||||
|
||||
/**
|
||||
* 测点类型(sl/wy/sy)
|
||||
*/
|
||||
@TableField("cd_type")
|
||||
private String cdType;
|
||||
|
||||
/**
|
||||
* 水库编码
|
||||
*/
|
||||
@TableField("res_cd")
|
||||
private String resCd;
|
||||
|
||||
/**
|
||||
* 设备状态
|
||||
*/
|
||||
@TableField("device_status")
|
||||
private String deviceStatus;
|
||||
}
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
package com.gunshi.project.hsz.common.model;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.gunshi.db.annotation.IgnoreAutoMapperAndDao;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 位移数据表
|
||||
* 数据源为AttMqttCalcData
|
||||
* @see com.gunshi.project.hsz.datasync.entity.jcsk.AttMqttCalcData
|
||||
*/
|
||||
@Data
|
||||
@TableName("jcsk_gnss_r")
|
||||
@IgnoreAutoMapperAndDao
|
||||
public class JcskGnssR {
|
||||
/**
|
||||
* 水库编码设备编码
|
||||
*/
|
||||
@TableField("res_cd")
|
||||
private String resCd;
|
||||
|
||||
/**
|
||||
* 测点编码
|
||||
*/
|
||||
@TableField("cd")
|
||||
private String cd;
|
||||
|
||||
/**
|
||||
* e方向变形值,单位(mm)
|
||||
*/
|
||||
@TableField("de")
|
||||
private BigDecimal de;
|
||||
|
||||
/**
|
||||
* n方向变形值,单位(mm)
|
||||
*/
|
||||
@TableField("dn")
|
||||
private BigDecimal dn;
|
||||
|
||||
/**
|
||||
* u方向变形值,单位(mm)
|
||||
*/
|
||||
@TableField("du")
|
||||
private BigDecimal du;
|
||||
|
||||
/**
|
||||
* 站点高程
|
||||
*/
|
||||
@TableField("alt")
|
||||
private BigDecimal alt;
|
||||
|
||||
/**
|
||||
* 监测时间
|
||||
*/
|
||||
@TableField("tm")
|
||||
private LocalDateTime tm;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField("update_tm")
|
||||
private LocalDateTime updateTm;
|
||||
}
|
||||
|
|
@ -0,0 +1,111 @@
|
|||
package com.gunshi.project.hsz.common.model;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.gunshi.db.annotation.IgnoreAutoMapperAndDao;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 渗流测点表实体类
|
||||
* 数据源为DsmSpgSpqnmp
|
||||
* 与r表通过rscd,stcd,mpcd关联
|
||||
* @see com.gunshi.project.hsz.datasync.entity.jcsk.DsmSpgSpqnmp
|
||||
*/
|
||||
@Data
|
||||
@TableName("jcsk_sl_b")
|
||||
@IgnoreAutoMapperAndDao
|
||||
public class JcskSlB {
|
||||
/**
|
||||
* 水库代码
|
||||
*/
|
||||
@TableField("rscd")
|
||||
private String rscd;
|
||||
|
||||
/**
|
||||
* 水工建筑物编号
|
||||
*/
|
||||
@TableField("hycncd")
|
||||
private String hycncd;
|
||||
|
||||
/**
|
||||
* 测点编号
|
||||
*/
|
||||
@TableField("mpcd")
|
||||
private String mpcd;
|
||||
|
||||
/**
|
||||
* rtu编号
|
||||
*/
|
||||
@TableField("stcd")
|
||||
private String stcd;
|
||||
|
||||
/**
|
||||
* 桩号
|
||||
*/
|
||||
@TableField("ch")
|
||||
private String ch;
|
||||
|
||||
/**
|
||||
* 轴距,单位m
|
||||
*/
|
||||
@TableField("ofax")
|
||||
private BigDecimal ofax;
|
||||
|
||||
/**
|
||||
* 高程,单位m
|
||||
*/
|
||||
@TableField("el")
|
||||
private BigDecimal el;
|
||||
|
||||
/**
|
||||
* 安装日期
|
||||
*/
|
||||
@TableField("indt")
|
||||
private LocalDate indt;
|
||||
|
||||
/**
|
||||
* 仪器编号
|
||||
*/
|
||||
@TableField("dvcd")
|
||||
private String dvcd;
|
||||
|
||||
/**
|
||||
* 经度
|
||||
*/
|
||||
@TableField("lgtd")
|
||||
private BigDecimal lgtd;
|
||||
|
||||
/**
|
||||
* 纬度
|
||||
*/
|
||||
@TableField("lttd")
|
||||
private BigDecimal lttd;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@TableField("rm")
|
||||
private String rm;
|
||||
|
||||
/**
|
||||
* 资料更新时间
|
||||
*/
|
||||
@TableField("dtuptm")
|
||||
private LocalDateTime dtuptm;
|
||||
|
||||
/**
|
||||
* 断面
|
||||
*/
|
||||
@TableField("dm")
|
||||
private String dm;
|
||||
|
||||
/**
|
||||
* 是否填报
|
||||
*/
|
||||
@TableField("is_tb")
|
||||
private String isTb;
|
||||
}
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
package com.gunshi.project.hsz.common.model;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.gunshi.db.annotation.IgnoreAutoMapperAndDao;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 渗流数据表实体类
|
||||
* 数据源为DsmSpgSpqnNormal
|
||||
* @see com.gunshi.project.hsz.datasync.entity.jcsk.DsmSpgSpqn
|
||||
*/
|
||||
@Data
|
||||
@TableName("jcsk_sl_r")
|
||||
@IgnoreAutoMapperAndDao
|
||||
public class JcskSlR {
|
||||
/**
|
||||
* 水库代码
|
||||
*/
|
||||
@TableField("rscd")
|
||||
private String rscd;
|
||||
|
||||
|
||||
/**
|
||||
* 水工建筑物编号
|
||||
*/
|
||||
@TableField("hycncd")
|
||||
private String hycncd;
|
||||
|
||||
/**
|
||||
* 测点编号
|
||||
*/
|
||||
@TableField("mpcd")
|
||||
private String mpcd;
|
||||
|
||||
/**
|
||||
* 测量时间
|
||||
*/
|
||||
@TableField("mstm")
|
||||
private LocalDateTime mstm;
|
||||
|
||||
/**
|
||||
* 温度,单位℃
|
||||
*/
|
||||
@TableField("tm")
|
||||
private BigDecimal tm;
|
||||
|
||||
/**
|
||||
* 渗流量,单位l/s
|
||||
*/
|
||||
@TableField("spqn")
|
||||
private BigDecimal spqn;
|
||||
|
||||
/**
|
||||
* 标准水温渗流量,单位l/s
|
||||
*/
|
||||
@TableField("stspqn")
|
||||
private BigDecimal stspqn;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,135 @@
|
|||
package com.gunshi.project.hsz.common.model;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.gunshi.db.annotation.IgnoreAutoMapperAndDao;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 渗压测点表
|
||||
* 数据源为DsmSpgSpprmp
|
||||
* 与r表通过rscd,stcd,mpcd关联
|
||||
* @see com.gunshi.project.hsz.datasync.entity.jcsk.DsmSpgSpprmp
|
||||
*/
|
||||
@Data
|
||||
@TableName("jcsk_sy_b")
|
||||
@IgnoreAutoMapperAndDao
|
||||
public class JcskSyB {
|
||||
/**
|
||||
* 水库代码
|
||||
*/
|
||||
@TableField("rscd")
|
||||
private String rscd;
|
||||
|
||||
/**
|
||||
* rtu编码
|
||||
*/
|
||||
@TableField("stcd")
|
||||
private String stcd;
|
||||
|
||||
/**
|
||||
* 水工建筑物编号
|
||||
*/
|
||||
@TableField("hycncd")
|
||||
private String hycncd;
|
||||
|
||||
/**
|
||||
* 测点编号
|
||||
*/
|
||||
@TableField("mpcd")
|
||||
private String mpcd;
|
||||
|
||||
/**
|
||||
* 桩号
|
||||
*/
|
||||
@TableField("ch")
|
||||
private String ch;
|
||||
|
||||
/**
|
||||
* 轴距,单位m
|
||||
*/
|
||||
@TableField("ofax")
|
||||
private BigDecimal ofax;
|
||||
|
||||
/**
|
||||
* 高程,单位m
|
||||
*/
|
||||
@TableField("el")
|
||||
private BigDecimal el;
|
||||
|
||||
/**
|
||||
* 监测类型
|
||||
*/
|
||||
@TableField("msps")
|
||||
private String msps;
|
||||
|
||||
/**
|
||||
* 透水段底高程,单位m
|
||||
*/
|
||||
@TableField("pmbtel")
|
||||
private BigDecimal pmbtel;
|
||||
|
||||
/**
|
||||
* 透水段顶高程,单位m
|
||||
*/
|
||||
@TableField("pmtpel")
|
||||
private BigDecimal pmtpel;
|
||||
|
||||
/**
|
||||
* 坝面高程
|
||||
*/
|
||||
@TableField("dsel")
|
||||
private BigDecimal dsel;
|
||||
|
||||
/**
|
||||
* 安装日期
|
||||
*/
|
||||
@TableField("indt")
|
||||
private LocalDate indt;
|
||||
|
||||
/**
|
||||
* 仪器编号
|
||||
*/
|
||||
@TableField("dvcd")
|
||||
private String dvcd;
|
||||
|
||||
/**
|
||||
* 经度
|
||||
*/
|
||||
@TableField("lgtd")
|
||||
private BigDecimal lgtd;
|
||||
|
||||
/**
|
||||
* 纬度
|
||||
*/
|
||||
@TableField("lttd")
|
||||
private BigDecimal lttd;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@TableField("rm")
|
||||
private String rm;
|
||||
|
||||
/**
|
||||
* 资料更新时间
|
||||
*/
|
||||
@TableField("dtuptm")
|
||||
private LocalDateTime dtuptm;
|
||||
|
||||
/**
|
||||
* 断面
|
||||
*/
|
||||
@TableField("dm")
|
||||
private String dm;
|
||||
|
||||
/**
|
||||
* 是否填报
|
||||
*/
|
||||
@TableField("is_tb")
|
||||
private String isTb;
|
||||
}
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
package com.gunshi.project.hsz.common.model;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.gunshi.db.annotation.IgnoreAutoMapperAndDao;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 渗压数据表实体类
|
||||
* 数据源为DsmSpgSpprNormal
|
||||
* @see com.gunshi.project.hsz.datasync.entity.jcsk.DsmSpgSppr
|
||||
*/
|
||||
@Data
|
||||
@TableName("jcsk_sy_r")
|
||||
@IgnoreAutoMapperAndDao
|
||||
public class JcskSyR {
|
||||
/**
|
||||
* 水库代码
|
||||
*/
|
||||
@TableField("rscd")
|
||||
private String rscd;
|
||||
|
||||
/**
|
||||
* rtu编码
|
||||
*/
|
||||
@TableField("stcd")
|
||||
private String stcd;
|
||||
|
||||
/**
|
||||
* 水工建筑物编号
|
||||
*/
|
||||
@TableField("hycncd")
|
||||
private String hycncd;
|
||||
|
||||
/**
|
||||
* 测点编号
|
||||
*/
|
||||
@TableField("mpcd")
|
||||
private String mpcd;
|
||||
|
||||
/**
|
||||
* 测量时间
|
||||
*/
|
||||
@TableField("mstm")
|
||||
private LocalDateTime mstm;
|
||||
|
||||
/**
|
||||
* 温度
|
||||
*/
|
||||
@TableField("tm")
|
||||
private BigDecimal tm;
|
||||
|
||||
/**
|
||||
* 渗流压力水位,单位m
|
||||
*/
|
||||
@TableField("spprwl")
|
||||
private BigDecimal spprwl;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField("update_tm")
|
||||
private LocalDateTime updateTm;
|
||||
}
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
package com.gunshi.project.hsz.common.model;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.gunshi.db.annotation.IgnoreAutoMapperAndDao;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @author lyf
|
||||
* @since 2025-10-16
|
||||
*/
|
||||
@Data
|
||||
@TableName("st_flow_r")
|
||||
@IgnoreAutoMapperAndDao
|
||||
public class StFlowR {
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.NONE)
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 测站编码
|
||||
*/
|
||||
@TableField("stcd")
|
||||
private String stcd;
|
||||
|
||||
/**
|
||||
* 观测时间
|
||||
*/
|
||||
@TableField("tm")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private LocalDateTime tm;
|
||||
|
||||
/**
|
||||
* 入库流量,单位m³/s
|
||||
*/
|
||||
@TableField("inq")
|
||||
private BigDecimal inq;
|
||||
|
||||
/**
|
||||
* 瞬时流量,单位m³/s
|
||||
*/
|
||||
@TableField("q")
|
||||
private BigDecimal q;
|
||||
|
||||
/**
|
||||
* 出库流量,单位m³/s
|
||||
*/
|
||||
@TableField("otq")
|
||||
private BigDecimal otq;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField("crtime")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private LocalDateTime crtime;
|
||||
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.gunshi.project.hsz.model;
|
||||
package com.gunshi.project.hsz.common.model;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
|
|
@ -6,9 +6,10 @@ import com.baomidou.mybatisplus.annotation.TableField;
|
|||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.gunshi.db.annotation.IgnoreAutoMapperAndDao;
|
||||
import com.gunshi.project.hsz.common.validate.markers.Update;
|
||||
import com.gunshi.core.dateformat.DateFormatString;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.validate.markers.Update;
|
||||
import com.gunshi.project.hsz.common.validate.markers.Insert;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.Size;
|
||||
|
|
@ -25,6 +26,7 @@ import java.util.Date;
|
|||
@Schema(description="sttp 以水利标准来")
|
||||
@Data
|
||||
@TableName("public.st_stbprp_b")
|
||||
@IgnoreAutoMapperAndDao
|
||||
public class StStbprpB implements Serializable {
|
||||
|
||||
|
||||
|
|
@ -1,10 +1,11 @@
|
|||
package com.gunshi.project.hsz.model;
|
||||
package com.gunshi.project.hsz.common.model;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.gunshi.db.annotation.IgnoreAutoMapperAndDao;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.Size;
|
||||
|
|
@ -20,6 +21,7 @@ import java.io.Serializable;
|
|||
@Schema(description="测站监测值类型")
|
||||
@Data
|
||||
@TableName("public.st_stbprp_b_elem")
|
||||
@IgnoreAutoMapperAndDao
|
||||
public class StStbprpBElem implements Serializable {
|
||||
|
||||
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.gunshi.project.hsz.validate.markers;
|
||||
package com.gunshi.project.hsz.common.validate.markers;
|
||||
|
||||
/**
|
||||
* 类描述
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.gunshi.project.hsz.validate.markers;
|
||||
package com.gunshi.project.hsz.common.validate.markers;
|
||||
|
||||
/**
|
||||
* 类描述
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.gunshi.project.hsz.validate.markers;
|
||||
package com.gunshi.project.hsz.common.validate.markers;
|
||||
|
||||
/**
|
||||
* 类描述
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.gunshi.project.hsz.validate.markers;
|
||||
package com.gunshi.project.hsz.common.validate.markers;
|
||||
|
||||
/**
|
||||
* 类描述
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.gunshi.project.hsz.validate.markers;
|
||||
package com.gunshi.project.hsz.common.validate.markers;
|
||||
|
||||
/**
|
||||
* 类描述
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.gunshi.project.hsz.validate.markers;
|
||||
package com.gunshi.project.hsz.common.validate.markers;
|
||||
|
||||
/**
|
||||
* 类描述
|
||||
|
|
@ -1,5 +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="com.gunshi.project.hsz.mapper.StStbprpBElemMapper">
|
||||
<mapper namespace="com.gunshi.project.hsz.common.mapper.StStbprpBElemMapper">
|
||||
|
||||
</mapper>
|
||||
|
|
@ -1,5 +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="com.gunshi.project.hsz.mapper.StStbprpBMapper">
|
||||
<mapper namespace="com.gunshi.project.hsz.common.mapper.StStbprpBMapper">
|
||||
|
||||
</mapper>
|
||||
|
|
@ -20,6 +20,9 @@
|
|||
黑石咀水库系统 - 父级POM
|
||||
</description>
|
||||
|
||||
<modules>
|
||||
<module>../module-common</module>
|
||||
</modules>
|
||||
<properties>
|
||||
<java.version>21</java.version>
|
||||
<maven.compiler.source>21</maven.compiler.source>
|
||||
|
|
@ -44,6 +47,12 @@
|
|||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.gunshi</groupId>
|
||||
<artifactId>gunshi-project-hsz-common</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Gunshi 项目依赖 -->
|
||||
<dependency>
|
||||
<groupId>com.gunshi</groupId>
|
||||
|
|
@ -131,6 +140,11 @@
|
|||
</dependency>
|
||||
|
||||
<!-- MyBatis Plus -->
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus</artifactId>
|
||||
<version>${mybatis-plus.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-spring-boot3-starter</artifactId>
|
||||
|
|
@ -266,15 +280,6 @@
|
|||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifest>
|
||||
<addClasspath>true</addClasspath>
|
||||
<classpathPrefix>lib/</classpathPrefix>
|
||||
<mainClass>com.gunshi.project.hsz.Main</mainClass>
|
||||
</manifest>
|
||||
</archive>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
|
|
@ -285,6 +290,12 @@
|
|||
<id>nexus</id>
|
||||
<name>Nexus public</name>
|
||||
<url>http://local.gunshiiot.com:8081/repository/maven-public/</url>
|
||||
<releases>
|
||||
<enabled>true</enabled>
|
||||
</releases>
|
||||
<snapshots>
|
||||
<enabled>true</enabled>
|
||||
</snapshots>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
|
|
|
|||
15
pom.xml
15
pom.xml
|
|
@ -17,9 +17,13 @@
|
|||
黑石咀水库系统
|
||||
</description>
|
||||
<!-- 属性继承自parent项目 -->
|
||||
|
||||
<!-- 依赖版本管理继承自parent项目 -->
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.gunshi</groupId>
|
||||
<artifactId>gunshi-project-hsz-common</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.gunshi</groupId>
|
||||
<artifactId>gunshi-db</artifactId>
|
||||
|
|
@ -145,6 +149,15 @@
|
|||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifest>
|
||||
<addClasspath>true</addClasspath>
|
||||
<classpathPrefix>lib/</classpathPrefix>
|
||||
<mainClass>com.gunshi.project.hsz.Main</mainClass>
|
||||
</manifest>
|
||||
</archive>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,45 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>com.gunshi</groupId>
|
||||
<artifactId>gunshi-project-hsz-parent</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<relativePath>../parent/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
<artifactId>gunshi-project-hsz-datasync</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
|
||||
<properties>
|
||||
<dameng.version>8.1.2.114</dameng.version>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.gunshi</groupId>
|
||||
<artifactId>gunshi-project-hsz-common</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.dameng</groupId>
|
||||
<artifactId>DmJdbcDriver18</artifactId>
|
||||
<version>${dameng.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.postgresql</groupId>
|
||||
<artifactId>postgresql</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
package com.gunshi.project.hsz.datasync;
|
||||
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
|
||||
/**
|
||||
* 应用程序入口类
|
||||
*/
|
||||
@SpringBootApplication
|
||||
@EnableScheduling
|
||||
@MapperScan({
|
||||
"com.gunshi.project.tsg.datasync.mapper",
|
||||
"com.gunshi.project.tsg.datasync.mapper.jcsk",
|
||||
"com.gunshi.project.tsg.datasync.rsvrWaterLevel",
|
||||
"com.gunshi.project.tsg.datasync.rainfall",
|
||||
"com.gunshi.project.tsg.datasync.gate",
|
||||
"com.gunshi.project.tsg.datasync.riverWaterLevel",
|
||||
})
|
||||
public class Main {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(Main.class, args);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,174 @@
|
|||
package com.gunshi.project.hsz.datasync.config;
|
||||
|
||||
import com.gunshi.project.hsz.datasync.service.impl.SyncByRService;
|
||||
import com.gunshi.project.hsz.datasync.service.impl.SyncGnssRService;
|
||||
import com.gunshi.project.hsz.datasync.service.impl.SyncSlRService;
|
||||
import com.gunshi.project.hsz.datasync.service.impl.SyncSyRService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.ApplicationArguments;
|
||||
import org.springframework.boot.ApplicationRunner;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
|
||||
|
||||
import java.util.concurrent.Executor;
|
||||
|
||||
@Configuration
|
||||
@EnableScheduling
|
||||
@Slf4j
|
||||
public class SyncTaskScheduler implements ApplicationRunner {
|
||||
|
||||
@Autowired
|
||||
private SyncByRService syncByRService;
|
||||
|
||||
@Autowired
|
||||
private SyncGnssRService syncGnssRService;
|
||||
|
||||
@Autowired
|
||||
private SyncSlRService syncSlRService;
|
||||
|
||||
@Autowired
|
||||
private SyncSyRService syncSyRService;
|
||||
|
||||
private boolean isApplicationReady = false;
|
||||
|
||||
// 任务执行状态标志,确保每个任务串行执行
|
||||
private volatile boolean isSyncByRRunning = false;
|
||||
private volatile boolean isSyncGnssRRunning = false;
|
||||
private volatile boolean isSyncSlRRunning = false;
|
||||
private volatile boolean isSyncSyRRunning = false;
|
||||
|
||||
/**
|
||||
* 配置定时任务线程池,确保并行执行
|
||||
*/
|
||||
public Executor taskScheduler() {
|
||||
ThreadPoolTaskScheduler scheduler = new ThreadPoolTaskScheduler();
|
||||
scheduler.setPoolSize(4); // 4个线程,每个服务一个
|
||||
scheduler.setThreadNamePrefix("SyncTask-");
|
||||
scheduler.initialize();
|
||||
return scheduler;
|
||||
}
|
||||
|
||||
/**
|
||||
* 在应用启动完成后设置标志
|
||||
*/
|
||||
@Override
|
||||
public void run(ApplicationArguments args) {
|
||||
isApplicationReady = true;
|
||||
log.info("应用初始化完成,定时任务将在下次调度时开始执行");
|
||||
}
|
||||
|
||||
/**
|
||||
* 白蚁数据同步任务 - 每5分钟执行一次
|
||||
* 确保上一次执行完毕后才会再次执行
|
||||
*/
|
||||
@Scheduled(cron = "0 */5 * * * ?")
|
||||
public void scheduleSyncByR() {
|
||||
if (!isApplicationReady) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 检查任务是否正在运行,如果是则跳过本次执行
|
||||
if (isSyncByRRunning) {
|
||||
log.info("白蚁数据同步任务正在执行中,跳过本次调度");
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
isSyncByRRunning = true; // 标记任务开始执行
|
||||
log.info("开始执行白蚁数据同步任务");
|
||||
syncByRService.syncData();
|
||||
log.info("白蚁数据同步任务执行完成");
|
||||
} catch (Exception e) {
|
||||
log.error("白蚁数据同步任务执行异常", e);
|
||||
} finally {
|
||||
isSyncByRRunning = false; // 无论成功失败,都标记任务执行完毕
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 位移数据同步任务 - 每15分钟执行一次
|
||||
* 确保上一次执行完毕后才会再次执行
|
||||
*/
|
||||
@Scheduled(cron = "0 */15 * * * ?")
|
||||
public void scheduleSyncGnssR() {
|
||||
if (!isApplicationReady) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 检查任务是否正在运行,如果是则跳过本次执行
|
||||
if (isSyncGnssRRunning) {
|
||||
log.info("位移数据同步任务正在执行中,跳过本次调度");
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
isSyncGnssRRunning = true; // 标记任务开始执行
|
||||
log.info("开始执行位移数据同步任务");
|
||||
syncGnssRService.syncData();
|
||||
log.info("位移数据同步任务执行完成");
|
||||
} catch (Exception e) {
|
||||
log.error("位移数据同步任务执行异常", e);
|
||||
} finally {
|
||||
isSyncGnssRRunning = false; // 无论成功失败,都标记任务执行完毕
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 渗流量数据同步任务 - 每15分钟执行一次
|
||||
* 确保上一次执行完毕后才会再次执行
|
||||
*/
|
||||
@Scheduled(cron = "0 */15 * * * ?")
|
||||
public void scheduleSyncSlR() {
|
||||
if (!isApplicationReady) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 检查任务是否正在运行,如果是则跳过本次执行
|
||||
if (isSyncSlRRunning) {
|
||||
log.info("渗流量数据同步任务正在执行中,跳过本次调度");
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
isSyncSlRRunning = true; // 标记任务开始执行
|
||||
log.info("开始执行渗流量数据同步任务");
|
||||
syncSlRService.syncData();
|
||||
log.info("渗流量数据同步任务执行完成");
|
||||
} catch (Exception e) {
|
||||
log.error("渗流量数据同步任务执行异常", e);
|
||||
} finally {
|
||||
isSyncSlRRunning = false; // 无论成功失败,都标记任务执行完毕
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 渗压数据同步任务 - 每15分钟执行一次
|
||||
* 确保上一次执行完毕后才会再次执行
|
||||
*/
|
||||
@Scheduled(cron = "0 */15 * * * ?")
|
||||
public void scheduleSyncSyR() {
|
||||
if (!isApplicationReady) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 检查任务是否正在运行,如果是则跳过本次执行
|
||||
if (isSyncSyRRunning) {
|
||||
log.info("渗压数据同步任务正在执行中,跳过本次调度");
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
isSyncSyRRunning = true; // 标记任务开始执行
|
||||
log.info("开始执行渗压数据同步任务");
|
||||
syncSyRService.syncData();
|
||||
log.info("渗压数据同步任务执行完成");
|
||||
} catch (Exception e) {
|
||||
log.error("渗压数据同步任务执行异常", e);
|
||||
} finally {
|
||||
isSyncSyRRunning = false; // 无论成功失败,都标记任务执行完毕
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
package com.gunshi.project.hsz.datasync.entity.jcsk;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.gunshi.project.hsz.common.model.JcskGnssR;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 位移数据表(数据源表)
|
||||
* 对应数据库表:SJZT_MD.att_mqtt_calc_data_normal
|
||||
* 数据来源:该表数据同步至jcsk_gnss_r表
|
||||
* @see AttWyCdBase
|
||||
* @see JcskGnssR
|
||||
*/
|
||||
@Data
|
||||
@TableName("SJZT_MD.\"att_mqtt_calc_data\"")
|
||||
public class AttMqttCalcData {
|
||||
/**
|
||||
* 水库编码设备编码
|
||||
*/
|
||||
@TableField("\"station_code\"")
|
||||
private String stationCode;
|
||||
|
||||
/**
|
||||
* e方向变形值,单位(mm)
|
||||
*/
|
||||
@TableField("\"de\"")
|
||||
private BigDecimal de;
|
||||
|
||||
/**
|
||||
* n方向变形值,单位(mm)
|
||||
*/
|
||||
@TableField("\"dn\"")
|
||||
private BigDecimal dn;
|
||||
|
||||
/**
|
||||
* u方向变形值,单位(mm)
|
||||
*/
|
||||
@TableField("\"du\"")
|
||||
private BigDecimal du;
|
||||
|
||||
/**
|
||||
* 站点高程
|
||||
*/
|
||||
@TableField("\"alt\"")
|
||||
private BigDecimal alt;
|
||||
|
||||
/**
|
||||
* 解算时间
|
||||
*/
|
||||
@TableField("\"calc_time\"")
|
||||
private Long calcTime;
|
||||
}
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
package com.gunshi.project.hsz.datasync.entity.jcsk;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.gunshi.project.hsz.common.model.JcskGnssB;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 位移设备表(数据源表)
|
||||
* 对应数据库表:SJZT_MD.att_wy_cd_base
|
||||
* 数据来源:该表数据同步至jcsk_gnss_b表
|
||||
* @see JcskGnssB
|
||||
* @see AttMqttCalcData
|
||||
*/
|
||||
@Data
|
||||
@TableName("SJZT_MD.\"att_wy_cd_base\"")
|
||||
public class AttWyCdBase {
|
||||
/**
|
||||
* 测点编码
|
||||
*/
|
||||
@TableField("\"cd\"")
|
||||
private String cd;
|
||||
|
||||
/**
|
||||
* 测点名称
|
||||
*/
|
||||
@TableField("\"cd_nm\"")
|
||||
private String cdNm;
|
||||
|
||||
/**
|
||||
* 桩号
|
||||
*/
|
||||
@TableField("\"ch\"")
|
||||
private String ch;
|
||||
|
||||
/**
|
||||
* 测点类型(sl/wy/sy)
|
||||
*/
|
||||
@TableField("\"cd_type\"")
|
||||
private String cdType;
|
||||
|
||||
/**
|
||||
* 水库编码
|
||||
*/
|
||||
@TableField("\"res_cd\"")
|
||||
private String resCd;
|
||||
|
||||
/**
|
||||
* 设备状态
|
||||
*/
|
||||
@TableField("\"device_status\"")
|
||||
private String deviceStatus;
|
||||
}
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
package com.gunshi.project.hsz.datasync.entity.jcsk;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.gunshi.project.hsz.common.model.JcskSyR;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 渗压数据表(数据源表)
|
||||
* 对应数据库表:SJZT_ODS.dsm_spg_sppr_normal
|
||||
* 数据来源:该表数据同步至jcsk_sy_r表
|
||||
* @see DsmSpgSpprmp
|
||||
* @see JcskSyR
|
||||
*/
|
||||
@Data
|
||||
@TableName("SJZT_ODS.\"dsm_spg_sppr\"")
|
||||
public class DsmSpgSppr {
|
||||
/**
|
||||
* 水库代码
|
||||
*/
|
||||
@TableField("\"rscd\"")
|
||||
private String rscd;
|
||||
|
||||
/**
|
||||
* rtu编码
|
||||
*/
|
||||
@TableField("\"stcd\"")
|
||||
private String stcd;
|
||||
|
||||
/**
|
||||
* 水工建筑物编号
|
||||
*/
|
||||
@TableField("\"hycncd\"")
|
||||
private String hycncd;
|
||||
|
||||
/**
|
||||
* 测点编号
|
||||
*/
|
||||
@TableField("\"mpcd\"")
|
||||
private String mpcd;
|
||||
|
||||
/**
|
||||
* 测量时间
|
||||
*/
|
||||
@TableField("\"mstm\"")
|
||||
private LocalDateTime mstm;
|
||||
|
||||
/**
|
||||
* 温度
|
||||
*/
|
||||
@TableField("\"tm\"")
|
||||
private BigDecimal tm;
|
||||
|
||||
/**
|
||||
* 渗流压力水位,单位m
|
||||
*/
|
||||
@TableField("\"spprwl\"")
|
||||
private BigDecimal spprwl;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,135 @@
|
|||
package com.gunshi.project.hsz.datasync.entity.jcsk;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.gunshi.project.hsz.common.model.JcskSyB;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 渗压测点表(数据源表)
|
||||
* 对应数据库表:SJZT_ODS.dsm_spg_spprmp
|
||||
* 数据来源:该表数据同步至jcsk_sy_b表
|
||||
* @see JcskSyB
|
||||
* @see DsmSpgSppr
|
||||
*/
|
||||
@Data
|
||||
@TableName("SJZT_ODS.\"dsm_spg_spprmp\"")
|
||||
public class DsmSpgSpprmp {
|
||||
/**
|
||||
* 水库代码
|
||||
*/
|
||||
@TableField("\"rscd\"")
|
||||
private String rscd;
|
||||
|
||||
/**
|
||||
* rtu编码
|
||||
*/
|
||||
@TableField("\"stcd\"")
|
||||
private String stcd;
|
||||
|
||||
/**
|
||||
* 水工建筑物编号
|
||||
*/
|
||||
@TableField("\"hycncd\"")
|
||||
private String hycncd;
|
||||
|
||||
/**
|
||||
* 测点编号
|
||||
*/
|
||||
@TableField("\"mpcd\"")
|
||||
private String mpcd;
|
||||
|
||||
/**
|
||||
* 桩号
|
||||
*/
|
||||
@TableField("\"ch\"")
|
||||
private String ch;
|
||||
|
||||
/**
|
||||
* 轴距,单位m
|
||||
*/
|
||||
@TableField("\"ofax\"")
|
||||
private BigDecimal ofax;
|
||||
|
||||
/**
|
||||
* 高程,单位m
|
||||
*/
|
||||
@TableField("\"el\"")
|
||||
private BigDecimal el;
|
||||
|
||||
/**
|
||||
* 监测类型
|
||||
*/
|
||||
@TableField("\"msps\"")
|
||||
private String msps;
|
||||
|
||||
/**
|
||||
* 透水段底高程,单位m
|
||||
*/
|
||||
@TableField("\"pmbtel\"")
|
||||
private BigDecimal pmbtel;
|
||||
|
||||
/**
|
||||
* 透水段顶高程,单位m
|
||||
*/
|
||||
@TableField("\"pmtpel\"")
|
||||
private BigDecimal pmtpel;
|
||||
|
||||
/**
|
||||
* 坝面高程
|
||||
*/
|
||||
@TableField("\"dsel\"")
|
||||
private BigDecimal dsel;
|
||||
|
||||
/**
|
||||
* 安装日期
|
||||
*/
|
||||
@TableField("\"indt\"")
|
||||
private LocalDate indt;
|
||||
|
||||
/**
|
||||
* 仪器编号
|
||||
*/
|
||||
@TableField("\"dvcd\"")
|
||||
private String dvcd;
|
||||
|
||||
/**
|
||||
* 经度
|
||||
*/
|
||||
@TableField("\"lgtd\"")
|
||||
private BigDecimal lgtd;
|
||||
|
||||
/**
|
||||
* 纬度
|
||||
*/
|
||||
@TableField("\"lttd\"")
|
||||
private BigDecimal lttd;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@TableField("\"rm\"")
|
||||
private String rm;
|
||||
|
||||
/**
|
||||
* 资料更新时间
|
||||
*/
|
||||
@TableField("\"dtuptm\"")
|
||||
private LocalDateTime dtuptm;
|
||||
|
||||
/**
|
||||
* 断面
|
||||
*/
|
||||
@TableField("\"dm\"")
|
||||
private String dm;
|
||||
|
||||
/**
|
||||
* 是否填报
|
||||
*/
|
||||
@TableField("\"is_tb\"")
|
||||
private String isTb;
|
||||
}
|
||||
|
|
@ -0,0 +1,64 @@
|
|||
package com.gunshi.project.hsz.datasync.entity.jcsk;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.gunshi.project.hsz.common.model.JcskSlR;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 渗流数据表(数据源表)
|
||||
* 对应数据库表:SJZT_ODS.dsm_spg_spqn_normal
|
||||
* 数据来源:该表数据同步至jcsk_sl_r表
|
||||
* @see DsmSpgSpqnmp
|
||||
* @see JcskSlR
|
||||
*/
|
||||
@Data
|
||||
@TableName("SJZT_ODS.\"dsm_spg_spqn\"")
|
||||
public class DsmSpgSpqn {
|
||||
/**
|
||||
* 水库代码
|
||||
*/
|
||||
@TableField("\"rscd\"")
|
||||
private String rscd;
|
||||
|
||||
|
||||
/**
|
||||
* 水工建筑物编号
|
||||
*/
|
||||
@TableField("\"hycncd\"")
|
||||
private String hycncd;
|
||||
|
||||
/**
|
||||
* 测点编号
|
||||
*/
|
||||
@TableField("\"mpcd\"")
|
||||
private String mpcd;
|
||||
|
||||
/**
|
||||
* 测量时间
|
||||
*/
|
||||
@TableField("\"mstm\"")
|
||||
private LocalDateTime mstm;
|
||||
|
||||
/**
|
||||
* 温度,单位℃
|
||||
*/
|
||||
@TableField("\"tm\"")
|
||||
private BigDecimal tm;
|
||||
|
||||
/**
|
||||
* 渗流量,单位l/s
|
||||
*/
|
||||
@TableField("\"spqn\"")
|
||||
private BigDecimal spqn;
|
||||
|
||||
/**
|
||||
* 标准水温渗流量,单位l/s
|
||||
*/
|
||||
@TableField("\"stspqn\"")
|
||||
private BigDecimal stspqn;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,111 @@
|
|||
package com.gunshi.project.hsz.datasync.entity.jcsk;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.gunshi.project.hsz.common.model.JcskSlB;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 渗流测点表(数据源表)
|
||||
* 对应数据库表:SJZT_ODS.dsm_spg_spqnmp
|
||||
* 数据来源:该表数据同步至jcsk_sl_b表
|
||||
* @see DsmSpgSpqn
|
||||
* @see JcskSlB
|
||||
*/
|
||||
@Data
|
||||
@TableName("SJZT_ODS.\"dsm_spg_spqnmp\"")
|
||||
public class DsmSpgSpqnmp {
|
||||
/**
|
||||
* 水库代码
|
||||
*/
|
||||
@TableField("\"rscd\"")
|
||||
private String rscd;
|
||||
|
||||
/**
|
||||
* 水工建筑物编号
|
||||
*/
|
||||
@TableField("\"hycncd\"")
|
||||
private String hycncd;
|
||||
|
||||
/**
|
||||
* 测点编号
|
||||
*/
|
||||
@TableField("\"mpcd\"")
|
||||
private String mpcd;
|
||||
|
||||
/**
|
||||
* rtu编号
|
||||
*/
|
||||
@TableField("\"stcd\"")
|
||||
private String stcd;
|
||||
|
||||
/**
|
||||
* 桩号
|
||||
*/
|
||||
@TableField("\"ch\"")
|
||||
private String ch;
|
||||
|
||||
/**
|
||||
* 轴距,单位m
|
||||
*/
|
||||
@TableField("\"ofax\"")
|
||||
private BigDecimal ofax;
|
||||
|
||||
/**
|
||||
* 高程,单位m
|
||||
*/
|
||||
@TableField("\"el\"")
|
||||
private BigDecimal el;
|
||||
|
||||
/**
|
||||
* 安装日期
|
||||
*/
|
||||
@TableField("\"indt\"")
|
||||
private LocalDate indt;
|
||||
|
||||
/**
|
||||
* 仪器编号
|
||||
*/
|
||||
@TableField("\"dvcd\"")
|
||||
private String dvcd;
|
||||
|
||||
/**
|
||||
* 经度
|
||||
*/
|
||||
@TableField("\"lgtd\"")
|
||||
private BigDecimal lgtd;
|
||||
|
||||
/**
|
||||
* 纬度
|
||||
*/
|
||||
@TableField("\"lttd\"")
|
||||
private BigDecimal lttd;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@TableField("\"rm\"")
|
||||
private String rm;
|
||||
|
||||
/**
|
||||
* 资料更新时间
|
||||
*/
|
||||
@TableField("\"dtuptm\"")
|
||||
private LocalDateTime dtuptm;
|
||||
|
||||
/**
|
||||
* 断面
|
||||
*/
|
||||
@TableField("\"dm\"")
|
||||
private String dm;
|
||||
|
||||
/**
|
||||
* 是否填报
|
||||
*/
|
||||
@TableField("\"is_tb\"")
|
||||
private String isTb;
|
||||
}
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
package com.gunshi.project.hsz.datasync.entity.jcsk;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @author lyf
|
||||
* @since 2025-10-16
|
||||
*/
|
||||
@Data
|
||||
@TableName("SJZT_ODS.\"st_flow_r\"")
|
||||
public class JcskStFlowR {
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@TableId(value = "\"id\"", type = IdType.NONE)
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 测站编码
|
||||
*/
|
||||
@TableField("\"stcd\"")
|
||||
private String stcd;
|
||||
|
||||
/**
|
||||
* 观测时间
|
||||
*/
|
||||
@TableField("\"tm\"")
|
||||
private LocalDateTime tm;
|
||||
|
||||
/**
|
||||
* 入库流量,单位m³/s
|
||||
*/
|
||||
@TableField("\"inq\"")
|
||||
private BigDecimal inq;
|
||||
|
||||
/**
|
||||
* 瞬时流量,单位m³/s
|
||||
*/
|
||||
@TableField("\"q\"")
|
||||
private BigDecimal q;
|
||||
|
||||
/**
|
||||
* 出库流量,单位m³/s
|
||||
*/
|
||||
@TableField("\"otq\"")
|
||||
private BigDecimal otq;
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,110 @@
|
|||
package com.gunshi.project.hsz.datasync.entity.jcsk;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.gunshi.project.hsz.common.model.JcskByR;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 白蚁数据表(数据源表)
|
||||
* 对应数据库表:SJZT_ODS.water_data_termites
|
||||
* 数据来源:该表数据同步至jcsk_by_r表
|
||||
* @see WaterDevice
|
||||
* @see JcskByR
|
||||
*/
|
||||
@Data
|
||||
@TableName("SJZT_ODS.\"water_data_termites\"")
|
||||
public class WaterDataTermites {
|
||||
/**
|
||||
* 设备编码
|
||||
*/
|
||||
@TableField("\"mn_no\"")
|
||||
private String mnNo;
|
||||
|
||||
/**
|
||||
* 白蚁蚁情状态,有白蚁入侵为1
|
||||
*/
|
||||
@TableField("\"status\"")
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 白蚁设备电量
|
||||
*/
|
||||
@TableField("\"electricity\"")
|
||||
private Integer electricity;
|
||||
|
||||
/**
|
||||
* 白蚁设备安装的点位顺序
|
||||
*/
|
||||
@TableField("\"order\"")
|
||||
private String order;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField("\"created_at\"")
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
/**
|
||||
* 观测时间
|
||||
*/
|
||||
@TableField("\"ob_time\"")
|
||||
private String obTime;
|
||||
|
||||
/**
|
||||
* 观测时间2
|
||||
*/
|
||||
@TableField("\"ob_date\"")
|
||||
private LocalDateTime obDate;
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@TableId("\"id\"")
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 水库id
|
||||
*/
|
||||
@TableField("\"station_id\"")
|
||||
private Integer stationId;
|
||||
|
||||
/**
|
||||
* 站点名称
|
||||
*/
|
||||
@TableField("\"station_name\"")
|
||||
private String stationName;
|
||||
|
||||
/**
|
||||
* 设备id
|
||||
*/
|
||||
@TableField("\"device_id\"")
|
||||
private Integer deviceId;
|
||||
|
||||
/**
|
||||
* 设备名称
|
||||
*/
|
||||
@TableField("\"device_name\"")
|
||||
private String deviceName;
|
||||
|
||||
/**
|
||||
* 任务状态
|
||||
*/
|
||||
@TableField("\"task_status\"")
|
||||
private String taskStatus;
|
||||
|
||||
/**
|
||||
* 任务id
|
||||
*/
|
||||
@TableField("\"task_id\"")
|
||||
private String taskId;
|
||||
|
||||
/**
|
||||
* 接收类型
|
||||
*/
|
||||
@TableField("\"receive_type\"")
|
||||
private Short receiveType;
|
||||
}
|
||||
|
|
@ -0,0 +1,211 @@
|
|||
package com.gunshi.project.hsz.datasync.entity.jcsk;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.gunshi.project.hsz.common.model.JcskByB;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 白蚁设备表(数据源表)
|
||||
* 对应数据库表:SJZT_ODS.water_device
|
||||
* 数据来源:该表数据同步至jcsk_by_b表
|
||||
* @see JcskByB
|
||||
* @see WaterDataTermites
|
||||
*/
|
||||
@Data
|
||||
@TableName("SJZT_ODS.\"water_device\"")
|
||||
public class WaterDevice {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableField("\"id\"")
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 设备名称
|
||||
*/
|
||||
@TableField("\"name\"")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 设备编码
|
||||
*/
|
||||
@TableField("\"code\"")
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 站点接入编码
|
||||
*/
|
||||
@TableField("\"mn_no\"")
|
||||
private String mnNo;
|
||||
|
||||
/**
|
||||
* 厂家id
|
||||
*/
|
||||
@TableField("\"factory_id\"")
|
||||
private Integer factoryId;
|
||||
|
||||
/**
|
||||
* 服务站点id
|
||||
*/
|
||||
@TableField("\"station_id\"")
|
||||
private Integer stationId;
|
||||
|
||||
/**
|
||||
* 服务站点名称
|
||||
*/
|
||||
@TableField("\"station_name\"")
|
||||
private String stationName;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField("\"created_at\"")
|
||||
private Integer createdAt;
|
||||
|
||||
/**
|
||||
* 创建人id
|
||||
*/
|
||||
@TableField("\"created_user\"")
|
||||
private Integer createdUser;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@TableField("\"updated_at\"")
|
||||
private Integer updatedAt;
|
||||
|
||||
/**
|
||||
* 修改人id
|
||||
*/
|
||||
@TableField("\"updated_user\"")
|
||||
private Integer updatedUser;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
@TableField("\"status\"")
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 纬度
|
||||
*/
|
||||
@TableField("\"lat\"")
|
||||
private BigDecimal lat;
|
||||
|
||||
/**
|
||||
* 经度
|
||||
*/
|
||||
@TableField("\"lon\"")
|
||||
private BigDecimal lon;
|
||||
|
||||
/**
|
||||
* 省份id
|
||||
*/
|
||||
@TableField("\"province_id\"")
|
||||
private Long provinceId;
|
||||
|
||||
/**
|
||||
* 省份名称
|
||||
*/
|
||||
@TableField("\"province_name\"")
|
||||
private String provinceName;
|
||||
|
||||
/**
|
||||
* 城市id
|
||||
*/
|
||||
@TableField("\"city_id\"")
|
||||
private Long cityId;
|
||||
|
||||
/**
|
||||
* 城市名称
|
||||
*/
|
||||
@TableField("\"city_name\"")
|
||||
private String cityName;
|
||||
|
||||
/**
|
||||
* 区域名称
|
||||
*/
|
||||
@TableField("\"area_name\"")
|
||||
private String areaName;
|
||||
|
||||
/**
|
||||
* 区域id
|
||||
*/
|
||||
@TableField("\"area_id\"")
|
||||
private Long areaId;
|
||||
|
||||
/**
|
||||
* 设备类型
|
||||
*/
|
||||
@TableField("\"type\"")
|
||||
private Integer type;
|
||||
|
||||
/**
|
||||
* 设备类型详情
|
||||
*/
|
||||
@TableField("\"send_type\"")
|
||||
private String sendType;
|
||||
|
||||
/**
|
||||
* 联系人
|
||||
*/
|
||||
@TableField("\"contact\"")
|
||||
private String contact;
|
||||
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
@TableField("\"telephone\"")
|
||||
private String telephone;
|
||||
|
||||
/**
|
||||
* 流域
|
||||
*/
|
||||
@TableField("\"river\"")
|
||||
private String river;
|
||||
|
||||
/**
|
||||
* 安装地点
|
||||
*/
|
||||
@TableField("\"address\"")
|
||||
private String address;
|
||||
|
||||
/**
|
||||
* 产品型号
|
||||
*/
|
||||
@TableField("\"model\"")
|
||||
private String model;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@TableField("\"remark\"")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 通信方式
|
||||
*/
|
||||
@TableField("\"communication_type\"")
|
||||
private Integer communicationType;
|
||||
|
||||
/**
|
||||
* 设备图片
|
||||
*/
|
||||
@TableField("\"image_url\"")
|
||||
private String imageUrl;
|
||||
|
||||
/**
|
||||
* 设备视频流地址的ip
|
||||
*/
|
||||
@TableField("\"video_ip\"")
|
||||
private String videoIp;
|
||||
|
||||
/**
|
||||
* 设备视频id
|
||||
*/
|
||||
@TableField("\"video_id\"")
|
||||
private String videoId;
|
||||
}
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
package com.gunshi.project.hsz.datasync.gate;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @author lyf
|
||||
* @since 2025-10-20
|
||||
*/
|
||||
@Data
|
||||
@TableName("st_gate_r")
|
||||
public class GateOpeningHeight {
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
@TableField(value="stcd")
|
||||
private String stcd;
|
||||
|
||||
@TableField(value="gtop")
|
||||
private BigDecimal gtop;
|
||||
|
||||
@TableField(value="tm")
|
||||
private LocalDateTime tm;
|
||||
|
||||
@TableField(value="recv_tm")
|
||||
private LocalDateTime recvTm;
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
package com.gunshi.project.hsz.datasync.gate;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @author lyf
|
||||
* @since 2025-10-20
|
||||
*/
|
||||
@DS("tsg")
|
||||
@Mapper
|
||||
public interface GateOpeningHeightMapper extends BaseMapper<GateOpeningHeight> {
|
||||
}
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
package com.gunshi.project.hsz.datasync.gate;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @author lyf
|
||||
* @since 2025-10-20
|
||||
*/
|
||||
@Service
|
||||
public class GateOpeningHeightService {
|
||||
|
||||
@Autowired
|
||||
private GateOpeningHeightMapper targetMapper;
|
||||
|
||||
@Scheduled(cron = "0 */5 * * * ?")
|
||||
public int syncData() {
|
||||
LocalDateTime tm = LocalDateTime.now();
|
||||
//抹去分和秒
|
||||
tm = tm.withMinute(0).withSecond(0).withNano(0);
|
||||
GateOpeningHeight target = new GateOpeningHeight();
|
||||
BigDecimal height;
|
||||
GateOpeningHeight exist;
|
||||
|
||||
target.setStcd("30111");
|
||||
target.setTm(tm);
|
||||
height = BigDecimal.valueOf(Math.random() * 10).setScale(0, RoundingMode.HALF_UP);
|
||||
target.setGtop(height);
|
||||
target.setRecvTm(tm);
|
||||
exist = targetMapper.selectOne(
|
||||
new LambdaQueryWrapper<GateOpeningHeight>()
|
||||
.eq(GateOpeningHeight::getStcd, target.getStcd())
|
||||
.eq(GateOpeningHeight::getTm, target.getTm())
|
||||
);
|
||||
if (exist == null) {
|
||||
targetMapper.insert(target);
|
||||
}
|
||||
|
||||
target.setStcd("30222");
|
||||
target.setTm(tm);
|
||||
height = BigDecimal.valueOf(Math.random() * 10).setScale(0, RoundingMode.HALF_UP);
|
||||
target.setGtop(height);
|
||||
target.setRecvTm(tm);
|
||||
exist = targetMapper.selectOne(
|
||||
new LambdaQueryWrapper<GateOpeningHeight>()
|
||||
.eq(GateOpeningHeight::getStcd, target.getStcd())
|
||||
.eq(GateOpeningHeight::getTm, target.getTm())
|
||||
);
|
||||
if (exist == null) {
|
||||
targetMapper.insert(target);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
package com.gunshi.project.hsz.datasync.mapper;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.gunshi.project.hsz.common.model.StFlowR;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @author lyf
|
||||
* @since 2025-10-16
|
||||
*/
|
||||
@DS("tsg")
|
||||
@Mapper
|
||||
public interface StFlowRMapper extends BaseMapper<StFlowR> {
|
||||
}
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
package com.gunshi.project.hsz.datasync.mapper;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.gunshi.project.hsz.common.model.StStbprpBElem;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lyf
|
||||
* @since 2025-10-16
|
||||
*/
|
||||
@DS("tsg")
|
||||
@Mapper
|
||||
public interface StbprpElemMapper {
|
||||
|
||||
@Select("""
|
||||
<script>
|
||||
select b.stcd, e.elem from st_stbprp_b b
|
||||
left join st_stbprp_b_elem e on b.stcd=e.stcd
|
||||
where elem = #{elem}
|
||||
</script>
|
||||
""")
|
||||
List<StStbprpBElem> selectByElem(@Param("elem") String elem);
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
package com.gunshi.project.hsz.datasync.mapper.jcsk;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.gunshi.project.hsz.datasync.entity.jcsk.AttMqttCalcData;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* AttMqttCalcDataNormal的Mapper接口
|
||||
*/
|
||||
@DS("jcsk")
|
||||
@Mapper
|
||||
public interface AttMqttCalcDataNormalMapper extends BaseMapper<AttMqttCalcData> {
|
||||
|
||||
// 可以在这里添加自定义的SQL方法
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
package com.gunshi.project.hsz.datasync.mapper.jcsk;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.gunshi.project.hsz.datasync.entity.jcsk.AttWyCdBase;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* AttWyCdBase的Mapper接口
|
||||
*/
|
||||
@DS("jcsk")
|
||||
@Mapper
|
||||
public interface AttWyCdBaseMapper extends BaseMapper<AttWyCdBase> {
|
||||
|
||||
// 可以在这里添加自定义的SQL方法
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
package com.gunshi.project.hsz.datasync.mapper.jcsk;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.gunshi.project.hsz.datasync.entity.jcsk.DsmSpgSppr;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* DsmSpgSpprNormal的Mapper接口
|
||||
*/
|
||||
@DS("jcsk")
|
||||
@Mapper
|
||||
public interface DsmSpgSpprMapper extends BaseMapper<DsmSpgSppr> {
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
package com.gunshi.project.hsz.datasync.mapper.jcsk;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.gunshi.project.hsz.datasync.entity.jcsk.DsmSpgSpprmp;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* DsmSpgSpprmp的Mapper接口
|
||||
*/
|
||||
@DS("jcsk")
|
||||
@Mapper
|
||||
public interface DsmSpgSpprmpMapper extends BaseMapper<DsmSpgSpprmp> {
|
||||
|
||||
// 可以在这里添加自定义的SQL方法
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
package com.gunshi.project.hsz.datasync.mapper.jcsk;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.gunshi.project.hsz.datasync.entity.jcsk.DsmSpgSpqn;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* DsmSpgSpqnNormal的Mapper接口
|
||||
*/
|
||||
@DS("jcsk")
|
||||
@Mapper
|
||||
public interface DsmSpgSpqnMapper extends BaseMapper<DsmSpgSpqn> {
|
||||
|
||||
// 可以在这里添加自定义的SQL方法
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
package com.gunshi.project.hsz.datasync.mapper.jcsk;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.gunshi.project.hsz.datasync.entity.jcsk.DsmSpgSpqnmp;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* DsmSpgSpqnmp的Mapper接口
|
||||
*/
|
||||
@DS("jcsk")
|
||||
@Mapper
|
||||
public interface DsmSpgSpqnmpMapper extends BaseMapper<DsmSpgSpqnmp> {
|
||||
|
||||
// 可以在这里添加自定义的SQL方法
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
package com.gunshi.project.hsz.datasync.mapper.jcsk;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.gunshi.project.hsz.datasync.entity.jcsk.JcskStFlowR;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @author lyf
|
||||
* @since 2025-10-16
|
||||
*/
|
||||
@DS("jcsk")
|
||||
@Mapper
|
||||
public interface JcskStFlowRMapper extends BaseMapper<JcskStFlowR> {
|
||||
}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
package com.gunshi.project.hsz.datasync.mapper.jcsk;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.gunshi.project.hsz.datasync.entity.jcsk.WaterDataTermites;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* WaterDataTermites的Mapper接口
|
||||
*/
|
||||
@DS("jcsk")
|
||||
@Mapper
|
||||
public interface WaterDataTermitesMapper extends BaseMapper<WaterDataTermites> {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
package com.gunshi.project.hsz.datasync.mapper.jcsk;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.gunshi.project.hsz.datasync.entity.jcsk.WaterDevice;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* WaterDevice的Mapper接口
|
||||
*/
|
||||
@DS("jcsk")
|
||||
@Mapper
|
||||
public interface WaterDeviceMapper extends BaseMapper<WaterDevice> {
|
||||
|
||||
// 可以在这里添加自定义的SQL方法
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
package com.gunshi.project.hsz.datasync.rainfall;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @author lyf
|
||||
* @since 2025-10-20
|
||||
*/
|
||||
@Data
|
||||
@TableName("st_pptn_r")
|
||||
public class Rainfall {
|
||||
/**
|
||||
* 测站编码
|
||||
*/
|
||||
@TableField("stcd")
|
||||
private String stcd;
|
||||
|
||||
/**
|
||||
* 时段降水量
|
||||
*/
|
||||
@TableField("drp")
|
||||
private BigDecimal drp;
|
||||
|
||||
/**
|
||||
* 时间
|
||||
*/
|
||||
@TableField("tm")
|
||||
private LocalDateTime tm;
|
||||
|
||||
/**
|
||||
* 时段长
|
||||
*/
|
||||
@TableField("intv")
|
||||
private BigDecimal intv;
|
||||
|
||||
/**
|
||||
* 天气状况
|
||||
*/
|
||||
@TableField("wth")
|
||||
private String wth;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
package com.gunshi.project.hsz.datasync.rainfall;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @author lyf
|
||||
* @since 2025-10-20
|
||||
*/
|
||||
@DS("tsg")
|
||||
@Mapper
|
||||
public interface RainfallMapper extends BaseMapper<Rainfall> {
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
package com.gunshi.project.hsz.datasync.rainfall;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author lyf
|
||||
* @since 2025-10-20
|
||||
*/
|
||||
@Data
|
||||
@TableName("st_pptn_r_real")
|
||||
public class RainfallReal {
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
package com.gunshi.project.hsz.datasync.rainfall;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* @author lyf
|
||||
* @since 2025-10-20
|
||||
*/
|
||||
@DS("tsg")
|
||||
@Mapper
|
||||
public interface RainfallRealMapper extends BaseMapper<RainfallReal> {
|
||||
int updateReal(@Param("stcd") String stcd);
|
||||
}
|
||||
|
|
@ -0,0 +1,113 @@
|
|||
package com.gunshi.project.hsz.datasync.rainfall;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.gunshi.project.hsz.common.model.StStbprpBElem;
|
||||
import com.gunshi.project.hsz.datasync.mapper.StbprpElemMapper;
|
||||
import com.gunshi.project.hsz.datasync.rainfall.datasource.JcskStPptnR;
|
||||
import com.gunshi.project.hsz.datasync.rainfall.datasource.JcskStPptnRMapper;
|
||||
import com.gunshi.project.hsz.datasync.service.SyncTableRService;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.lang.NonNull;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lyf
|
||||
* @since 2025-10-20
|
||||
*/
|
||||
@Service
|
||||
public class RainfallService implements SyncTableRService<JcskStPptnR, Rainfall> {
|
||||
@Autowired
|
||||
private JcskStPptnRMapper sourceMapper;
|
||||
|
||||
@Autowired
|
||||
private RainfallRealMapper targetRealMapper;
|
||||
|
||||
@Autowired
|
||||
private RainfallMapper targetMapper;
|
||||
|
||||
@Autowired
|
||||
private StbprpElemMapper stbprpMapper;
|
||||
|
||||
@Scheduled(cron = "0 */5 * * * ?")
|
||||
@Override
|
||||
public int syncData() {
|
||||
// 获取所有降雨要素的站点
|
||||
List<StStbprpBElem> stbprps = stbprpMapper.selectByElem("drp");
|
||||
|
||||
int cnt = 0;
|
||||
for (StStbprpBElem StStbprpBElem : stbprps) {
|
||||
Rainfall targetParams = new Rainfall();
|
||||
targetParams.setStcd(StStbprpBElem.getStcd());
|
||||
|
||||
Rainfall latestTarget = getLatestTargetEntity(targetParams);
|
||||
List<JcskStPptnR> sourceEntityList = getSourceEntityListByLatestTargetEntity(latestTarget);
|
||||
cnt += saveToTarget(sourceEntityList);
|
||||
}
|
||||
return cnt;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public Rainfall getLatestTargetEntity(Rainfall targetParams) {
|
||||
String stcd = targetParams.getStcd();
|
||||
|
||||
Rainfall target = targetMapper.selectOne(
|
||||
new LambdaQueryWrapper<Rainfall>()
|
||||
.eq(Rainfall::getStcd, stcd)
|
||||
.orderByDesc(Rainfall::getTm)
|
||||
.last("limit 1")
|
||||
);
|
||||
|
||||
if (target == null) {
|
||||
target = new Rainfall();
|
||||
target.setStcd(stcd);
|
||||
target.setTm(LocalDateTime.of(2025, 10, 20, 15, 0, 0));
|
||||
}
|
||||
|
||||
return target;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JcskStPptnR> getSourceEntityListByLatestTargetEntity(@NonNull Rainfall targetEntity) {
|
||||
String stcd = targetEntity.getStcd();
|
||||
LocalDateTime tm = targetEntity.getTm();
|
||||
return sourceMapper.selectList(
|
||||
new LambdaQueryWrapper<JcskStPptnR>()
|
||||
.gt(JcskStPptnR::getTm, tm)
|
||||
.eq(JcskStPptnR::getStcd, stcd)
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int saveToTarget(List<JcskStPptnR> sourceEntityList) {
|
||||
int count = 0;
|
||||
for (JcskStPptnR sourceEntity : sourceEntityList) {
|
||||
String stcd = sourceEntity.getStcd();
|
||||
LocalDateTime tm = sourceEntity.getTm();
|
||||
Rainfall existingTarget = targetMapper.selectOne(
|
||||
new LambdaQueryWrapper<Rainfall>()
|
||||
.eq(Rainfall::getStcd, stcd)
|
||||
.eq(Rainfall::getTm, tm)
|
||||
);
|
||||
|
||||
if (existingTarget == null) {
|
||||
Rainfall targetEntity = new Rainfall();
|
||||
BeanUtils.copyProperties(sourceEntity, targetEntity);
|
||||
targetMapper.insert(targetEntity);
|
||||
}
|
||||
count++;
|
||||
}
|
||||
|
||||
if (!sourceEntityList.isEmpty()) {
|
||||
JcskStPptnR sourceEntity = sourceEntityList.getFirst();
|
||||
String stcd = sourceEntity.getStcd();
|
||||
targetRealMapper.updateReal(stcd);
|
||||
}
|
||||
return count;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
package com.gunshi.project.hsz.datasync.rainfall.datasource;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @author lyf
|
||||
* @since 2025-10-20
|
||||
*/
|
||||
@Data
|
||||
@TableName("SJZT_MD.\"st_pptn_r\"")
|
||||
public class JcskStPptnR {
|
||||
/**
|
||||
* 测站编码
|
||||
*/
|
||||
@TableField("\"stcd\"")
|
||||
private String stcd;
|
||||
|
||||
/**
|
||||
* 时段降水量
|
||||
*/
|
||||
@TableField("\"drp\"")
|
||||
private BigDecimal drp;
|
||||
|
||||
/**
|
||||
* 时间
|
||||
*/
|
||||
@TableField("\"tm\"")
|
||||
private LocalDateTime tm;
|
||||
|
||||
/**
|
||||
* 时段长
|
||||
*/
|
||||
@TableField("\"intv\"")
|
||||
private BigDecimal intv;
|
||||
|
||||
/**
|
||||
* 天气状况
|
||||
*/
|
||||
@TableField("\"wth\"")
|
||||
private String wth;
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
package com.gunshi.project.hsz.datasync.rainfall.datasource;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @author lyf
|
||||
* @since 2025-10-20
|
||||
*/
|
||||
@DS("jcsk")
|
||||
@Mapper
|
||||
public interface JcskStPptnRMapper extends BaseMapper<JcskStPptnR> {
|
||||
}
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
package com.gunshi.project.hsz.datasync.riverWaterLevel;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @author lyf
|
||||
* @since 2025-10-30
|
||||
*/
|
||||
@Data
|
||||
@TableName("st_river_r")
|
||||
public class RiverWaterLevel {
|
||||
/**
|
||||
* 测站编码
|
||||
*/
|
||||
@TableField("stcd")
|
||||
private String stcd;
|
||||
|
||||
/**
|
||||
* 监测时间
|
||||
*/
|
||||
@TableField("tm")
|
||||
private LocalDateTime tm;
|
||||
|
||||
/**
|
||||
* 水位
|
||||
*/
|
||||
@TableField("z")
|
||||
private BigDecimal z;
|
||||
|
||||
/**
|
||||
* 水库水势
|
||||
*/
|
||||
@TableField("wptn")
|
||||
private String wptn;
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
package com.gunshi.project.hsz.datasync.riverWaterLevel;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @author lyf
|
||||
* @since 2025-10-20
|
||||
*/
|
||||
@DS("tsg")
|
||||
@Mapper
|
||||
public interface RiverWaterLevelMapper extends BaseMapper<RiverWaterLevel> {
|
||||
}
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
package com.gunshi.project.hsz.datasync.riverWaterLevel;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
|
||||
@Data
|
||||
@TableName("st_river_r_real")
|
||||
public class RiverWaterLevelReal {
|
||||
|
||||
/**
|
||||
* stcd
|
||||
*/
|
||||
@TableId(value = "stcd", type = IdType.AUTO)
|
||||
private String stcd;
|
||||
|
||||
/**
|
||||
* tm
|
||||
*/
|
||||
@TableField(value = "tm")
|
||||
private LocalDateTime tm;
|
||||
|
||||
/**
|
||||
* z
|
||||
*/
|
||||
@TableField(value = "")
|
||||
private BigDecimal z;
|
||||
|
||||
/**
|
||||
* rwptn
|
||||
*/
|
||||
@TableField(value = "wptn")
|
||||
private String wptn;
|
||||
|
||||
|
||||
/**
|
||||
* chtm
|
||||
*/
|
||||
@TableField(value = "chtm")
|
||||
private LocalDateTime chtm;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
package com.gunshi.project.hsz.datasync.riverWaterLevel;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @author lyf
|
||||
* @since 2025-10-20
|
||||
*/
|
||||
@DS("tsg")
|
||||
@Mapper
|
||||
public interface RiverWaterLevelRealMapper extends BaseMapper<RiverWaterLevelReal> {
|
||||
}
|
||||
|
|
@ -0,0 +1,126 @@
|
|||
package com.gunshi.project.hsz.datasync.riverWaterLevel;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.gunshi.project.hsz.common.model.StStbprpBElem;
|
||||
import com.gunshi.project.hsz.datasync.mapper.StbprpElemMapper;
|
||||
import com.gunshi.project.hsz.datasync.rsvrWaterLevel.datasource.JcskStRsvrR;
|
||||
import com.gunshi.project.hsz.datasync.rsvrWaterLevel.datasource.JcskStRsvrRMapper;
|
||||
import com.gunshi.project.hsz.datasync.service.SyncTableRService;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.lang.NonNull;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lyf
|
||||
* @since 2025-10-20
|
||||
* 荆楚水库的河道水位和水库水位共用一张表
|
||||
*/
|
||||
@Service
|
||||
public class RiverWaterLevelService implements SyncTableRService<JcskStRsvrR, RiverWaterLevel> {
|
||||
@Autowired
|
||||
private JcskStRsvrRMapper sourceMapper;
|
||||
|
||||
@Autowired
|
||||
private RiverWaterLevelRealMapper targetRealMapper;
|
||||
|
||||
@Autowired
|
||||
private RiverWaterLevelMapper targetMapper;
|
||||
|
||||
@Autowired
|
||||
private StbprpElemMapper stbprpMapper;
|
||||
|
||||
@Scheduled(cron = "0 */5 * * * ?")
|
||||
@Override
|
||||
public int syncData() {
|
||||
// 获取所有水库水位要素的站点
|
||||
List<StStbprpBElem> stbprps = stbprpMapper.selectByElem("z");
|
||||
|
||||
int cnt = 0;
|
||||
for (StStbprpBElem StStbprpBElem : stbprps) {
|
||||
RiverWaterLevel targetParams = new RiverWaterLevel();
|
||||
targetParams.setStcd(StStbprpBElem.getStcd());
|
||||
|
||||
RiverWaterLevel latestTarget = getLatestTargetEntity(targetParams);
|
||||
List<JcskStRsvrR> sourceEntityList = getSourceEntityListByLatestTargetEntity(latestTarget);
|
||||
cnt += saveToTarget(sourceEntityList);
|
||||
}
|
||||
return cnt;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public RiverWaterLevel getLatestTargetEntity(RiverWaterLevel targetParams) {
|
||||
String stcd = targetParams.getStcd();
|
||||
|
||||
RiverWaterLevel target = targetMapper.selectOne(
|
||||
new LambdaQueryWrapper<RiverWaterLevel>()
|
||||
.eq(RiverWaterLevel::getStcd, stcd)
|
||||
.orderByDesc(RiverWaterLevel::getTm)
|
||||
.last("limit 1")
|
||||
);
|
||||
|
||||
if (target == null) {
|
||||
target = new RiverWaterLevel();
|
||||
target.setStcd(stcd);
|
||||
target.setTm(LocalDateTime.of(2025, 10, 20, 15, 0, 0));
|
||||
}
|
||||
|
||||
return target;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JcskStRsvrR> getSourceEntityListByLatestTargetEntity(@NonNull RiverWaterLevel targetEntity) {
|
||||
String stcd = targetEntity.getStcd();
|
||||
LocalDateTime tm = targetEntity.getTm();
|
||||
return sourceMapper.selectList(
|
||||
new LambdaQueryWrapper<JcskStRsvrR>()
|
||||
.gt(JcskStRsvrR::getTm, tm)
|
||||
.eq(JcskStRsvrR::getStcd, stcd)
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int saveToTarget(List<JcskStRsvrR> sourceEntityList) {
|
||||
int count = 0;
|
||||
for (JcskStRsvrR sourceEntity : sourceEntityList) {
|
||||
String stcd = sourceEntity.getStcd();
|
||||
LocalDateTime tm = sourceEntity.getTm();
|
||||
RiverWaterLevel existingTarget = targetMapper.selectOne(
|
||||
new LambdaQueryWrapper<RiverWaterLevel>()
|
||||
.eq(RiverWaterLevel::getStcd, stcd)
|
||||
.eq(RiverWaterLevel::getTm, tm)
|
||||
);
|
||||
|
||||
if (existingTarget == null) {
|
||||
RiverWaterLevel targetEntity = new RiverWaterLevel();
|
||||
BeanUtils.copyProperties(sourceEntity, targetEntity);
|
||||
targetEntity.setZ(sourceEntity.getRz());
|
||||
targetEntity.setWptn(sourceEntity.getRwptn());
|
||||
targetMapper.insert(targetEntity);
|
||||
}
|
||||
count++;
|
||||
}
|
||||
|
||||
if (!sourceEntityList.isEmpty()) {
|
||||
sourceEntityList.sort((o1, o2) -> o2.getTm().compareTo(o1.getTm()));
|
||||
JcskStRsvrR sourceEntity = sourceEntityList.getFirst();
|
||||
String stcd = sourceEntity.getStcd();
|
||||
RiverWaterLevelReal real = targetRealMapper.selectById(stcd);
|
||||
if (real == null) {
|
||||
real = new RiverWaterLevelReal();
|
||||
}
|
||||
real.setTm(sourceEntity.getTm());
|
||||
real.setStcd(stcd);
|
||||
real.setZ(sourceEntity.getRz());
|
||||
real.setWptn(sourceEntity.getRwptn());
|
||||
real.setChtm(LocalDateTime.now());
|
||||
targetRealMapper.insertOrUpdate(real);
|
||||
}
|
||||
return count;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
package com.gunshi.project.hsz.datasync.rsvrWaterLevel;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @author lyf
|
||||
* @since 2025-10-20
|
||||
*/
|
||||
@Data
|
||||
@TableName("st_rsvr_r")
|
||||
public class RsvrWaterLevel {
|
||||
/**
|
||||
* 测站编码
|
||||
*/
|
||||
@TableField("stcd")
|
||||
private String stcd;
|
||||
|
||||
/**
|
||||
* 监测时间
|
||||
*/
|
||||
@TableField("tm")
|
||||
private LocalDateTime tm;
|
||||
|
||||
/**
|
||||
* 水位
|
||||
*/
|
||||
@TableField("rz")
|
||||
private BigDecimal rz;
|
||||
|
||||
/**
|
||||
* 入库流量
|
||||
*/
|
||||
@TableField("inq")
|
||||
private BigDecimal inq;
|
||||
|
||||
/**
|
||||
* 蓄水量
|
||||
*/
|
||||
@TableField("w")
|
||||
private BigDecimal w;
|
||||
|
||||
/**
|
||||
* 库下水位
|
||||
*/
|
||||
@TableField("blrz")
|
||||
private BigDecimal blrz;
|
||||
|
||||
/**
|
||||
* 出库流量
|
||||
*/
|
||||
@TableField("otq")
|
||||
private BigDecimal otq;
|
||||
|
||||
/**
|
||||
* 水库水势
|
||||
*/
|
||||
@TableField("rwptn")
|
||||
private String rwptn;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
package com.gunshi.project.hsz.datasync.rsvrWaterLevel;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @author lyf
|
||||
* @since 2025-10-20
|
||||
*/
|
||||
@DS("tsg")
|
||||
@Mapper
|
||||
public interface RsvrWaterLevelMapper extends BaseMapper<RsvrWaterLevel> {
|
||||
}
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
package com.gunshi.project.hsz.datasync.rsvrWaterLevel;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
|
||||
@Data
|
||||
@TableName("st_rsvr_r_real")
|
||||
public class RsvrWaterLevelReal {
|
||||
|
||||
/**
|
||||
* stcd
|
||||
*/
|
||||
@TableId(value = "stcd", type = IdType.AUTO)
|
||||
private String stcd;
|
||||
|
||||
/**
|
||||
* tm
|
||||
*/
|
||||
@TableField(value = "tm")
|
||||
private LocalDateTime tm;
|
||||
|
||||
/**
|
||||
* rz
|
||||
*/
|
||||
@TableField(value = "rz")
|
||||
private BigDecimal rz;
|
||||
|
||||
/**
|
||||
* rwptn
|
||||
*/
|
||||
@TableField(value = "rwptn")
|
||||
private String rwptn;
|
||||
|
||||
|
||||
/**
|
||||
* chtm
|
||||
*/
|
||||
@TableField(value = "chtm")
|
||||
private LocalDateTime chtm;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
package com.gunshi.project.hsz.datasync.rsvrWaterLevel;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @author lyf
|
||||
* @since 2025-10-20
|
||||
*/
|
||||
@DS("tsg")
|
||||
@Mapper
|
||||
public interface RsvrWaterLevelRealMapper extends BaseMapper<RsvrWaterLevelReal> {
|
||||
}
|
||||
|
|
@ -0,0 +1,123 @@
|
|||
package com.gunshi.project.hsz.datasync.rsvrWaterLevel;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.gunshi.project.hsz.common.model.StStbprpBElem;
|
||||
import com.gunshi.project.hsz.datasync.mapper.StbprpElemMapper;
|
||||
import com.gunshi.project.hsz.datasync.rsvrWaterLevel.datasource.JcskStRsvrR;
|
||||
import com.gunshi.project.hsz.datasync.rsvrWaterLevel.datasource.JcskStRsvrRMapper;
|
||||
import com.gunshi.project.hsz.datasync.service.SyncTableRService;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.lang.NonNull;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lyf
|
||||
* @since 2025-10-20
|
||||
*/
|
||||
@Service
|
||||
public class RsvrWaterLevelService implements SyncTableRService<JcskStRsvrR, RsvrWaterLevel> {
|
||||
@Autowired
|
||||
private JcskStRsvrRMapper sourceMapper;
|
||||
|
||||
@Autowired
|
||||
private RsvrWaterLevelRealMapper targetRealMapper;
|
||||
|
||||
@Autowired
|
||||
private RsvrWaterLevelMapper targetMapper;
|
||||
|
||||
@Autowired
|
||||
private StbprpElemMapper stbprpMapper;
|
||||
|
||||
@Scheduled(cron = "0 */5 * * * ?")
|
||||
@Override
|
||||
public int syncData() {
|
||||
// 获取所有水库水位要素的站点
|
||||
List<StStbprpBElem> stbprps = stbprpMapper.selectByElem("rz");
|
||||
|
||||
int cnt = 0;
|
||||
for (StStbprpBElem StStbprpBElem : stbprps) {
|
||||
RsvrWaterLevel targetParams = new RsvrWaterLevel();
|
||||
targetParams.setStcd(StStbprpBElem.getStcd());
|
||||
|
||||
RsvrWaterLevel latestTarget = getLatestTargetEntity(targetParams);
|
||||
List<JcskStRsvrR> sourceEntityList = getSourceEntityListByLatestTargetEntity(latestTarget);
|
||||
cnt += saveToTarget(sourceEntityList);
|
||||
}
|
||||
return cnt;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public RsvrWaterLevel getLatestTargetEntity(RsvrWaterLevel targetParams) {
|
||||
String stcd = targetParams.getStcd();
|
||||
|
||||
RsvrWaterLevel target = targetMapper.selectOne(
|
||||
new LambdaQueryWrapper<RsvrWaterLevel>()
|
||||
.eq(RsvrWaterLevel::getStcd, stcd)
|
||||
.orderByDesc(RsvrWaterLevel::getTm)
|
||||
.last("limit 1")
|
||||
);
|
||||
|
||||
if (target == null) {
|
||||
target = new RsvrWaterLevel();
|
||||
target.setStcd(stcd);
|
||||
target.setTm(LocalDateTime.of(2025,10,20,15,0,0));
|
||||
}
|
||||
|
||||
return target;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JcskStRsvrR> getSourceEntityListByLatestTargetEntity(@NonNull RsvrWaterLevel targetEntity) {
|
||||
String stcd = targetEntity.getStcd();
|
||||
LocalDateTime tm = targetEntity.getTm();
|
||||
return sourceMapper.selectList(
|
||||
new LambdaQueryWrapper<JcskStRsvrR>()
|
||||
.gt(JcskStRsvrR::getTm, tm)
|
||||
.eq(JcskStRsvrR::getStcd, stcd)
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int saveToTarget(List<JcskStRsvrR> sourceEntityList) {
|
||||
int count = 0;
|
||||
for (JcskStRsvrR sourceEntity : sourceEntityList) {
|
||||
String stcd = sourceEntity.getStcd();
|
||||
LocalDateTime tm = sourceEntity.getTm();
|
||||
RsvrWaterLevel existingTarget = targetMapper.selectOne(
|
||||
new LambdaQueryWrapper<RsvrWaterLevel>()
|
||||
.eq(RsvrWaterLevel::getStcd, stcd)
|
||||
.eq(RsvrWaterLevel::getTm, tm)
|
||||
);
|
||||
|
||||
if (existingTarget == null) {
|
||||
RsvrWaterLevel targetEntity = new RsvrWaterLevel();
|
||||
BeanUtils.copyProperties(sourceEntity, targetEntity);
|
||||
targetMapper.insert(targetEntity);
|
||||
}
|
||||
count++;
|
||||
}
|
||||
|
||||
if (!sourceEntityList.isEmpty()) {
|
||||
sourceEntityList.sort((o1, o2) -> o2.getTm().compareTo(o1.getTm()));
|
||||
JcskStRsvrR sourceEntity = sourceEntityList.getFirst();
|
||||
String stcd = sourceEntity.getStcd();
|
||||
RsvrWaterLevelReal real = targetRealMapper.selectById(stcd);
|
||||
if (real == null) {
|
||||
real = new RsvrWaterLevelReal();
|
||||
}
|
||||
real.setTm(sourceEntity.getTm());
|
||||
real.setStcd(stcd);
|
||||
real.setRz(sourceEntity.getRz());
|
||||
real.setRwptn(sourceEntity.getRwptn());
|
||||
real.setChtm(LocalDateTime.now());
|
||||
targetRealMapper.insertOrUpdate(real);
|
||||
}
|
||||
return count;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,84 @@
|
|||
package com.gunshi.project.hsz.datasync.rsvrWaterLevel.datasource;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @author lyf
|
||||
* @since 2025-10-20
|
||||
*/
|
||||
@Data
|
||||
@TableName("SJZT_MD.\"st_rsvr_r\"")
|
||||
public class JcskStRsvrR {
|
||||
|
||||
/**
|
||||
* 站码
|
||||
*/
|
||||
@TableId("\"stcd\"")
|
||||
private String stcd;
|
||||
|
||||
/**
|
||||
* 监测时间
|
||||
*/
|
||||
@TableField("\"tm\"")
|
||||
private LocalDateTime tm;
|
||||
|
||||
/**
|
||||
* 水位
|
||||
*/
|
||||
@TableField("\"rz\"")
|
||||
private BigDecimal rz;
|
||||
|
||||
/**
|
||||
* 入库流量
|
||||
*/
|
||||
@TableField("\"inq\"")
|
||||
private BigDecimal inq;
|
||||
|
||||
/**
|
||||
* 蓄水量
|
||||
*/
|
||||
@TableField("\"w\"")
|
||||
private BigDecimal w;
|
||||
|
||||
/**
|
||||
* 库下水位
|
||||
*/
|
||||
@TableField("\"blrz\"")
|
||||
private BigDecimal blrz;
|
||||
|
||||
/**
|
||||
* 出库流量
|
||||
*/
|
||||
@TableField("\"otq\"")
|
||||
private BigDecimal otq;
|
||||
|
||||
/**
|
||||
* 水库特征码
|
||||
*/
|
||||
@TableField("\"rwchrcd\"")
|
||||
private String rwchrcd;
|
||||
|
||||
/**
|
||||
* 水库水势
|
||||
*/
|
||||
@TableField("\"rwptn\"")
|
||||
private String rwptn;
|
||||
|
||||
/**
|
||||
* 入流时段长
|
||||
*/
|
||||
@TableField("\"inqdr\"")
|
||||
private BigDecimal inqdr;
|
||||
|
||||
/**
|
||||
* 测流方法
|
||||
*/
|
||||
@TableField("\"msqmt\"")
|
||||
private String msqmt;
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
package com.gunshi.project.hsz.datasync.rsvrWaterLevel.datasource;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @author lyf
|
||||
* @since 2025-10-20
|
||||
*/
|
||||
@DS("jcsk")
|
||||
@Mapper
|
||||
public interface JcskStRsvrRMapper extends BaseMapper<JcskStRsvrR> {
|
||||
}
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
package com.gunshi.project.hsz.datasync.service;
|
||||
|
||||
import org.springframework.lang.NonNull;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 数据同步服务接口
|
||||
*/
|
||||
public interface SyncTableRService<SourceEntity, TargetEntity> {
|
||||
|
||||
int syncData();
|
||||
|
||||
@NonNull
|
||||
TargetEntity getLatestTargetEntity(TargetEntity targetParams);
|
||||
|
||||
List<SourceEntity> getSourceEntityListByLatestTargetEntity(@NonNull TargetEntity targetEntity);
|
||||
|
||||
int saveToTarget(List<SourceEntity> sourceEntityList);
|
||||
|
||||
default LocalDateTime calculateEtm(LocalDateTime stm) {
|
||||
LocalDateTime etm = LocalDateTime.now();
|
||||
if (etm.isAfter(stm.plusDays(30))) {
|
||||
etm = stm.plusDays(30);
|
||||
}
|
||||
return etm;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,104 @@
|
|||
package com.gunshi.project.hsz.datasync.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.gunshi.project.hsz.common.model.JcskByB;
|
||||
import com.gunshi.project.hsz.common.model.JcskByR;
|
||||
import com.gunshi.project.hsz.datasync.entity.jcsk.WaterDataTermites;
|
||||
import com.gunshi.project.hsz.common.mapper.JcskByBMapper;
|
||||
import com.gunshi.project.hsz.common.mapper.JcskByRMapper;
|
||||
import com.gunshi.project.hsz.datasync.mapper.jcsk.WaterDataTermitesMapper;
|
||||
import com.gunshi.project.hsz.datasync.service.SyncTableRService;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.lang.NonNull;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class SyncByRService implements SyncTableRService<WaterDataTermites, JcskByR> {
|
||||
|
||||
@Autowired
|
||||
private WaterDataTermitesMapper sourceMapper;
|
||||
|
||||
@Autowired
|
||||
private JcskByBMapper targetBMapper;
|
||||
|
||||
@Autowired
|
||||
private JcskByRMapper targetMapper;
|
||||
|
||||
@Override
|
||||
public int syncData() {
|
||||
List<JcskByB> targetBList = targetBMapper.selectList(null);
|
||||
|
||||
int cnt = 0;
|
||||
for (JcskByB targetB : targetBList) {
|
||||
JcskByR targetParams = new JcskByR();
|
||||
targetParams.setDeviceId(targetB.getId());
|
||||
|
||||
JcskByR latestTarget = getLatestTargetEntity(targetParams);
|
||||
List<WaterDataTermites> sourceEntityList = getSourceEntityListByLatestTargetEntity(latestTarget);
|
||||
cnt += saveToTarget(sourceEntityList);
|
||||
}
|
||||
return cnt;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public JcskByR getLatestTargetEntity(JcskByR targetParams) {
|
||||
Integer deviceId = targetParams.getDeviceId();
|
||||
|
||||
JcskByR target = targetMapper.selectOne(
|
||||
new LambdaQueryWrapper<JcskByR>()
|
||||
.eq(JcskByR::getDeviceId, deviceId)
|
||||
.orderByDesc(JcskByR::getObDate)
|
||||
.last("limit 1")
|
||||
);
|
||||
|
||||
if (target == null) {
|
||||
target = new JcskByR();
|
||||
target.setDeviceId(deviceId);
|
||||
//数据源最早的数据时间
|
||||
target.setObDate(LocalDateTime.of(2025, 8, 22, 10, 15, 0));
|
||||
}
|
||||
|
||||
return target;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WaterDataTermites> getSourceEntityListByLatestTargetEntity(@NonNull JcskByR targetEntity) {
|
||||
Integer deviceId = targetEntity.getDeviceId();
|
||||
LocalDateTime stm = targetEntity.getObDate();
|
||||
LocalDateTime etm = calculateEtm(stm);
|
||||
return sourceMapper.selectList(
|
||||
new LambdaQueryWrapper<WaterDataTermites>()
|
||||
.gt(WaterDataTermites::getObDate, stm)
|
||||
.le(WaterDataTermites::getObDate, etm)
|
||||
.eq(WaterDataTermites::getDeviceId, deviceId)
|
||||
.ne(WaterDataTermites::getOrder, "000000")
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int saveToTarget(List<WaterDataTermites> sourceEntityList) {
|
||||
int count = 0;
|
||||
for (WaterDataTermites sourceEntity : sourceEntityList) {
|
||||
Integer deviceId = sourceEntity.getId();
|
||||
LocalDateTime tm = sourceEntity.getObDate();
|
||||
LambdaQueryWrapper<JcskByR> queryWrapper = new LambdaQueryWrapper<JcskByR>()
|
||||
.eq(JcskByR::getDeviceId, deviceId)
|
||||
.eq(JcskByR::getObDate, tm)
|
||||
.last("limit 1");
|
||||
JcskByR existingTarget = targetMapper.selectOne(queryWrapper);
|
||||
|
||||
if (existingTarget == null) {
|
||||
JcskByR targetEntity = new JcskByR();
|
||||
BeanUtils.copyProperties(sourceEntity, targetEntity);
|
||||
targetMapper.insert(targetEntity);
|
||||
}
|
||||
count++;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,107 @@
|
|||
package com.gunshi.project.hsz.datasync.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.gunshi.project.hsz.common.model.StFlowR;
|
||||
import com.gunshi.project.hsz.common.model.StStbprpBElem;
|
||||
import com.gunshi.project.hsz.datasync.entity.jcsk.JcskStFlowR;
|
||||
import com.gunshi.project.hsz.datasync.mapper.StFlowRMapper;
|
||||
import com.gunshi.project.hsz.datasync.mapper.StbprpElemMapper;
|
||||
import com.gunshi.project.hsz.datasync.mapper.jcsk.JcskStFlowRMapper;
|
||||
import com.gunshi.project.hsz.datasync.service.SyncTableRService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.lang.NonNull;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lyf
|
||||
* @since 2025-10-16
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class SyncFlowRService implements SyncTableRService<JcskStFlowR, StFlowR> {
|
||||
@Autowired
|
||||
private JcskStFlowRMapper jcskStFlowRMapper;
|
||||
|
||||
@Autowired
|
||||
private StFlowRMapper stFlowRMapper;
|
||||
|
||||
@Autowired
|
||||
private StbprpElemMapper stbprpMapper;
|
||||
|
||||
@Scheduled(cron = "0 */15 * * * ?")
|
||||
@Override
|
||||
public int syncData() {
|
||||
log.info("开始同步流量数据");
|
||||
// 获取所有流量要素的站点
|
||||
List<StStbprpBElem> stbprps = stbprpMapper.selectByElem("flow");
|
||||
|
||||
int cnt = 0;
|
||||
for (StStbprpBElem StStbprpBElem : stbprps) {
|
||||
StFlowR targetParams = new StFlowR();
|
||||
targetParams.setStcd(StStbprpBElem.getStcd());
|
||||
|
||||
StFlowR latestTarget = getLatestTargetEntity(targetParams);
|
||||
List<JcskStFlowR> sourceEntityList = getSourceEntityListByLatestTargetEntity(latestTarget);
|
||||
cnt += saveToTarget(sourceEntityList);
|
||||
}
|
||||
log.info("完成同步流量数据 {} {}", stbprps, cnt);
|
||||
return cnt;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public StFlowR getLatestTargetEntity(StFlowR targetParams) {
|
||||
String stcd = targetParams.getStcd();
|
||||
|
||||
StFlowR target = stFlowRMapper.selectOne(
|
||||
new LambdaQueryWrapper<StFlowR>()
|
||||
.eq(StFlowR::getStcd, stcd)
|
||||
.orderByDesc(StFlowR::getId)
|
||||
.last("limit 1")
|
||||
);
|
||||
|
||||
if (target == null) {
|
||||
target = new StFlowR();
|
||||
target.setStcd(stcd);
|
||||
//流量有主键自增id,所以不用时间比较
|
||||
target.setId(0);
|
||||
}
|
||||
|
||||
return target;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JcskStFlowR> getSourceEntityListByLatestTargetEntity(@NonNull StFlowR targetEntity) {
|
||||
String stcd = targetEntity.getStcd();
|
||||
Integer id = targetEntity.getId();
|
||||
return jcskStFlowRMapper.selectList(
|
||||
new LambdaQueryWrapper<JcskStFlowR>()
|
||||
.gt(JcskStFlowR::getId, id)
|
||||
.eq(JcskStFlowR::getStcd, stcd)
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int saveToTarget(List<JcskStFlowR> sourceEntityList) {
|
||||
int count = 0;
|
||||
for (JcskStFlowR sourceEntity : sourceEntityList) {
|
||||
Integer id = sourceEntity.getId();
|
||||
StFlowR existingTarget = stFlowRMapper.selectById(id);
|
||||
|
||||
if (existingTarget == null) {
|
||||
StFlowR targetEntity = new StFlowR();
|
||||
BeanUtils.copyProperties(sourceEntity, targetEntity);
|
||||
targetEntity.setCrtime(LocalDateTime.now());
|
||||
stFlowRMapper.insert(targetEntity);
|
||||
}
|
||||
count++;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,129 @@
|
|||
package com.gunshi.project.hsz.datasync.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.gunshi.project.hsz.common.model.JcskGnssB;
|
||||
import com.gunshi.project.hsz.common.model.JcskGnssR;
|
||||
import com.gunshi.project.hsz.datasync.entity.jcsk.AttMqttCalcData;
|
||||
import com.gunshi.project.hsz.common.mapper.JcskGnssBMapper;
|
||||
import com.gunshi.project.hsz.common.mapper.JcskGnssRMapper;
|
||||
import com.gunshi.project.hsz.datasync.mapper.jcsk.AttMqttCalcDataNormalMapper;
|
||||
import com.gunshi.project.hsz.datasync.service.SyncTableRService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.lang.NonNull;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.ZoneOffset;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lyf
|
||||
* @since 2025-08-22
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class SyncGnssRService implements SyncTableRService<AttMqttCalcData, JcskGnssR> {
|
||||
|
||||
@Autowired
|
||||
private AttMqttCalcDataNormalMapper sourceMapper;
|
||||
|
||||
@Autowired
|
||||
private JcskGnssBMapper targetBMapper;
|
||||
|
||||
@Autowired
|
||||
private JcskGnssRMapper targetMapper;
|
||||
|
||||
@Override
|
||||
public int syncData() {
|
||||
List<JcskGnssB> targetBList = targetBMapper.selectList(null);
|
||||
|
||||
int cnt = 0;
|
||||
for (JcskGnssB targetB : targetBList) {
|
||||
JcskGnssR targetParams = new JcskGnssR();
|
||||
targetParams.setResCd(targetB.getResCd());
|
||||
targetParams.setCd(targetB.getCd());
|
||||
|
||||
JcskGnssR latestTarget = getLatestTargetEntity(targetParams);
|
||||
List<AttMqttCalcData> sourceEntityList = getSourceEntityListByLatestTargetEntity(latestTarget);
|
||||
cnt += saveToTarget(sourceEntityList);
|
||||
}
|
||||
return cnt;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public JcskGnssR getLatestTargetEntity(JcskGnssR targetParams) {
|
||||
String resCd = targetParams.getResCd();
|
||||
String cd = targetParams.getCd();
|
||||
|
||||
JcskGnssR target = targetMapper.selectOne(
|
||||
new LambdaQueryWrapper<JcskGnssR>()
|
||||
.eq(JcskGnssR::getResCd, resCd)
|
||||
.eq(JcskGnssR::getCd, cd)
|
||||
.orderByDesc(JcskGnssR::getTm)
|
||||
.last("limit 1")
|
||||
);
|
||||
|
||||
if (target == null) {
|
||||
target = new JcskGnssR();
|
||||
target.setResCd(resCd);
|
||||
target.setCd(cd);
|
||||
//数据源最早的数据时间
|
||||
target.setTm(LocalDateTime.of(2025, 9, 15, 18, 30, 0));
|
||||
}
|
||||
|
||||
return target;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AttMqttCalcData> getSourceEntityListByLatestTargetEntity(@NonNull JcskGnssR targetEntity) {
|
||||
String resCd = targetEntity.getResCd();
|
||||
String cd = targetEntity.getCd();
|
||||
LocalDateTime stm = targetEntity.getTm();
|
||||
LocalDateTime etm = calculateEtm(stm);
|
||||
|
||||
Long stmMillis = stm.toInstant(ZoneOffset.of("+8")).toEpochMilli();
|
||||
Long etmMillis = etm.toInstant(ZoneOffset.of("+8")).toEpochMilli();
|
||||
// log.info("开始同步 位移 {} {} {} {}", resCd, cd, stm, etm);
|
||||
return sourceMapper.selectList(
|
||||
new LambdaQueryWrapper<AttMqttCalcData>()
|
||||
.eq(AttMqttCalcData::getStationCode, resCd+cd)
|
||||
.gt(AttMqttCalcData::getCalcTime, stmMillis)
|
||||
.le(AttMqttCalcData::getCalcTime, etmMillis)
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int saveToTarget(List<AttMqttCalcData> sourceEntityList) {
|
||||
int count = 0;
|
||||
for (AttMqttCalcData sourceEntity : sourceEntityList) {
|
||||
LocalDateTime tm = LocalDateTime.ofInstant(
|
||||
Instant.ofEpochMilli(sourceEntity.getCalcTime()), ZoneOffset.of("+8")
|
||||
);
|
||||
String stationCode = sourceEntity.getStationCode();
|
||||
String resCd = stationCode.substring(0, 11);
|
||||
String cd = stationCode.substring(11);
|
||||
LambdaQueryWrapper<JcskGnssR> queryWrapper = new LambdaQueryWrapper<JcskGnssR>()
|
||||
.eq(JcskGnssR::getResCd, resCd)
|
||||
.eq(JcskGnssR::getCd, cd)
|
||||
.eq(JcskGnssR::getTm, tm)
|
||||
.last("limit 1");
|
||||
JcskGnssR existingTarget = targetMapper.selectOne(queryWrapper);
|
||||
|
||||
if (existingTarget == null) {
|
||||
JcskGnssR targetEntity = new JcskGnssR();
|
||||
BeanUtils.copyProperties(sourceEntity, targetEntity);
|
||||
targetEntity.setResCd(resCd);
|
||||
targetEntity.setCd(cd);
|
||||
targetEntity.setTm(tm);
|
||||
targetEntity.setUpdateTm(LocalDateTime.now());
|
||||
targetMapper.insert(targetEntity);
|
||||
}
|
||||
count++;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,116 @@
|
|||
package com.gunshi.project.hsz.datasync.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.gunshi.project.hsz.common.model.JcskSlB;
|
||||
import com.gunshi.project.hsz.common.model.JcskSlR;
|
||||
import com.gunshi.project.hsz.datasync.entity.jcsk.DsmSpgSpqn;
|
||||
import com.gunshi.project.hsz.common.mapper.JcskSlBMapper;
|
||||
import com.gunshi.project.hsz.common.mapper.JcskSlRMapper;
|
||||
import com.gunshi.project.hsz.datasync.mapper.jcsk.DsmSpgSpqnMapper;
|
||||
import com.gunshi.project.hsz.datasync.service.SyncTableRService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.lang.NonNull;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lyf
|
||||
* @since 2025-08-22
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class SyncSlRService implements SyncTableRService<DsmSpgSpqn, JcskSlR> {
|
||||
|
||||
@Autowired
|
||||
private DsmSpgSpqnMapper sourceMapper;
|
||||
|
||||
@Autowired
|
||||
private JcskSlBMapper targetBMapper;
|
||||
|
||||
@Autowired
|
||||
private JcskSlRMapper targetMapper;
|
||||
|
||||
@Override
|
||||
public int syncData() {
|
||||
List<JcskSlB> targetBList = targetBMapper.selectList(null);
|
||||
|
||||
int cnt = 0;
|
||||
for (JcskSlB targetB : targetBList) {
|
||||
JcskSlR targetParams = new JcskSlR();
|
||||
targetParams.setRscd(targetB.getRscd());
|
||||
targetParams.setMpcd(targetB.getMpcd());
|
||||
|
||||
JcskSlR latestTarget = getLatestTargetEntity(targetParams);
|
||||
List<DsmSpgSpqn> sourceEntityList = getSourceEntityListByLatestTargetEntity(latestTarget);
|
||||
cnt += saveToTarget(sourceEntityList);
|
||||
}
|
||||
return cnt;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public JcskSlR getLatestTargetEntity(JcskSlR targetParams) {
|
||||
String resCd = targetParams.getRscd();
|
||||
String mpcd = targetParams.getMpcd();
|
||||
|
||||
JcskSlR target = targetMapper.selectOne(
|
||||
new LambdaQueryWrapper<JcskSlR>()
|
||||
.eq(JcskSlR::getRscd, resCd)
|
||||
.eq(JcskSlR::getMpcd, mpcd)
|
||||
.orderByDesc(JcskSlR::getMstm)
|
||||
.last("limit 1")
|
||||
);
|
||||
|
||||
if (target == null) {
|
||||
target = new JcskSlR();
|
||||
target.setRscd(resCd);
|
||||
target.setMpcd(mpcd);
|
||||
//数据源最早的数据时间
|
||||
target.setMstm(LocalDateTime.of(2025, 8, 1, 0, 0, 0));
|
||||
}
|
||||
|
||||
return target;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DsmSpgSpqn> getSourceEntityListByLatestTargetEntity(@NonNull JcskSlR targetEntity) {
|
||||
String rscd = targetEntity.getRscd();
|
||||
String mpcd = targetEntity.getMpcd();
|
||||
LocalDateTime stm = targetEntity.getMstm();
|
||||
LocalDateTime etm = calculateEtm(stm);
|
||||
|
||||
// 修复数据类型不匹配问题:使用mstm(LocalDateTime)字段进行时间比较,而不是tm(BigDecimal)字段
|
||||
return sourceMapper.selectList(
|
||||
new LambdaQueryWrapper<DsmSpgSpqn>()
|
||||
.eq(DsmSpgSpqn::getRscd, rscd)
|
||||
.eq(DsmSpgSpqn::getMpcd, mpcd)
|
||||
.gt(DsmSpgSpqn::getMstm, stm)
|
||||
.le(DsmSpgSpqn::getMstm, etm)
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int saveToTarget(List<DsmSpgSpqn> sourceEntityList) {
|
||||
int count = 0;
|
||||
for (DsmSpgSpqn sourceEntity : sourceEntityList) {
|
||||
LambdaQueryWrapper<JcskSlR> queryWrapper = new LambdaQueryWrapper<JcskSlR>()
|
||||
.eq(JcskSlR::getRscd, sourceEntity.getRscd())
|
||||
.eq(JcskSlR::getMpcd, sourceEntity.getMpcd())
|
||||
.eq(JcskSlR::getMstm, sourceEntity.getMstm())
|
||||
.last("limit 1");
|
||||
JcskSlR existingTarget = targetMapper.selectOne(queryWrapper);
|
||||
|
||||
if (existingTarget == null) {
|
||||
JcskSlR targetEntity = new JcskSlR();
|
||||
BeanUtils.copyProperties(sourceEntity, targetEntity);
|
||||
targetMapper.insert(targetEntity);
|
||||
}
|
||||
count++;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,119 @@
|
|||
package com.gunshi.project.hsz.datasync.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.gunshi.project.hsz.common.model.JcskSyB;
|
||||
import com.gunshi.project.hsz.common.model.JcskSyR;
|
||||
import com.gunshi.project.hsz.datasync.entity.jcsk.DsmSpgSppr;
|
||||
import com.gunshi.project.hsz.common.mapper.JcskSyBMapper;
|
||||
import com.gunshi.project.hsz.common.mapper.JcskSyRMapper;
|
||||
import com.gunshi.project.hsz.datasync.mapper.jcsk.DsmSpgSpprMapper;
|
||||
import com.gunshi.project.hsz.datasync.service.SyncTableRService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.lang.NonNull;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
public class SyncSyRService implements SyncTableRService<DsmSpgSppr, JcskSyR> {
|
||||
|
||||
@Autowired
|
||||
private DsmSpgSpprMapper sourceMapper;
|
||||
|
||||
@Autowired
|
||||
private JcskSyBMapper targetBMapper;
|
||||
|
||||
@Autowired
|
||||
private JcskSyRMapper targetMapper;
|
||||
|
||||
@Override
|
||||
public int syncData() {
|
||||
List<JcskSyB> targetBList = targetBMapper.selectList(null);
|
||||
|
||||
int cnt = 0;
|
||||
for (JcskSyB targetB : targetBList) {
|
||||
JcskSyR targetParams = new JcskSyR();
|
||||
targetParams.setRscd(targetB.getRscd());
|
||||
targetParams.setStcd(targetB.getStcd());
|
||||
targetParams.setMpcd(targetB.getMpcd());
|
||||
|
||||
JcskSyR latestTarget = getLatestTargetEntity(targetParams);
|
||||
List<DsmSpgSppr> sourceEntityList = getSourceEntityListByLatestTargetEntity(latestTarget);
|
||||
cnt += saveToTarget(sourceEntityList);
|
||||
}
|
||||
return cnt;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public JcskSyR getLatestTargetEntity(JcskSyR targetParams) {
|
||||
String resCd = targetParams.getRscd();
|
||||
String mpcd = targetParams.getMpcd();
|
||||
String stcd = targetParams.getStcd();
|
||||
|
||||
JcskSyR target = targetMapper.selectOne(
|
||||
new LambdaQueryWrapper<JcskSyR>()
|
||||
.eq(JcskSyR::getRscd, resCd)
|
||||
.eq(JcskSyR::getMpcd, mpcd)
|
||||
.eq(JcskSyR::getStcd, stcd)
|
||||
.orderByDesc(JcskSyR::getMstm)
|
||||
.last("limit 1")
|
||||
);
|
||||
|
||||
if (target == null) {
|
||||
target = new JcskSyR();
|
||||
target.setRscd(resCd);
|
||||
target.setMpcd(mpcd);
|
||||
target.setStcd(stcd);
|
||||
target.setMstm(LocalDateTime.of(2025, 9, 1, 16, 30, 0));
|
||||
}
|
||||
|
||||
return target;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DsmSpgSppr> getSourceEntityListByLatestTargetEntity(@NonNull JcskSyR targetEntity) {
|
||||
String rscd = targetEntity.getRscd();
|
||||
String mpcd = targetEntity.getMpcd();
|
||||
String stcd = targetEntity.getStcd();
|
||||
LocalDateTime stm = targetEntity.getMstm();
|
||||
LocalDateTime etm = calculateEtm(stm);
|
||||
|
||||
return sourceMapper.selectList(
|
||||
new LambdaQueryWrapper<DsmSpgSppr>()
|
||||
.eq(DsmSpgSppr::getRscd, rscd)
|
||||
.eq(DsmSpgSppr::getMpcd, mpcd)
|
||||
.eq(DsmSpgSppr::getStcd, stcd)
|
||||
.gt(DsmSpgSppr::getMstm, stm)
|
||||
.le(DsmSpgSppr::getMstm, etm)
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int saveToTarget(List<DsmSpgSppr> sourceEntityList) {
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
int count = 0;
|
||||
for (DsmSpgSppr sourceEntity : sourceEntityList) {
|
||||
LambdaQueryWrapper<JcskSyR> queryWrapper = new LambdaQueryWrapper<JcskSyR>()
|
||||
.eq(JcskSyR::getRscd, sourceEntity.getRscd())
|
||||
.eq(JcskSyR::getMpcd, sourceEntity.getMpcd())
|
||||
.eq(JcskSyR::getStcd, sourceEntity.getStcd())
|
||||
.eq(JcskSyR::getMstm, sourceEntity.getMstm())
|
||||
.last("limit 1");
|
||||
JcskSyR existingTarget = targetMapper.selectOne(queryWrapper);
|
||||
|
||||
if (existingTarget == null) {
|
||||
JcskSyR targetEntity = new JcskSyR();
|
||||
BeanUtils.copyProperties(sourceEntity, targetEntity);
|
||||
targetEntity.setUpdateTm(now);
|
||||
targetMapper.insert(targetEntity);
|
||||
count++;
|
||||
}
|
||||
}
|
||||
return count;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,19 +1,13 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.hsz.entity.so.AlarmSetPageSo;
|
||||
import com.gunshi.project.hsz.entity.so.OsmoticQueryPageSo;
|
||||
import com.gunshi.project.hsz.model.AlarmSet;
|
||||
import com.gunshi.project.hsz.model.ForecastProject;
|
||||
import com.gunshi.project.hsz.model.ForecastResults;
|
||||
import com.gunshi.project.hsz.model.OsmoticFlowR;
|
||||
import com.gunshi.project.hsz.service.AlarmSetService;
|
||||
import com.gunshi.project.hsz.timetask.AlarmTask;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.validate.markers.Update;
|
||||
import com.gunshi.project.hsz.common.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.common.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
|
|
@ -22,7 +16,6 @@ import org.springframework.validation.annotation.Validated;
|
|||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Tag(name = "告警设置")
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@ package com.gunshi.project.hsz.controller;
|
|||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.hsz.model.AssessCategory;
|
||||
import com.gunshi.project.hsz.service.AssessCategoryService;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.validate.markers.Update;
|
||||
import com.gunshi.project.hsz.common.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.common.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@ import com.gunshi.project.hsz.entity.dto.InspectItemDto;
|
|||
import com.gunshi.project.hsz.entity.so.AttCctvBasePage;
|
||||
import com.gunshi.project.hsz.model.AssessIndicator;
|
||||
import com.gunshi.project.hsz.service.AssessIndicatorService;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.validate.markers.Update;
|
||||
import com.gunshi.project.hsz.common.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.common.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
|
|
|
|||
|
|
@ -7,8 +7,8 @@ import com.gunshi.project.hsz.entity.so.AssessTaskPageSo;
|
|||
import com.gunshi.project.hsz.entity.vo.AssessResultVo;
|
||||
import com.gunshi.project.hsz.model.AssessTask;
|
||||
import com.gunshi.project.hsz.service.AssessTaskService;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.validate.markers.Update;
|
||||
import com.gunshi.project.hsz.common.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.common.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
|
|
|||
|
|
@ -7,8 +7,8 @@ import com.gunshi.project.hsz.entity.so.AttCctvBasePage;
|
|||
import com.gunshi.project.hsz.model.AssessIndicator;
|
||||
import com.gunshi.project.hsz.model.AssessTemplate;
|
||||
import com.gunshi.project.hsz.service.AssessTemplateService;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.validate.markers.Update;
|
||||
import com.gunshi.project.hsz.common.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.common.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
|
|
|
|||
|
|
@ -14,8 +14,8 @@ import com.gunshi.project.hsz.model.CctvBMenu;
|
|||
import com.gunshi.project.hsz.service.AttCctvBaseService;
|
||||
import com.gunshi.project.hsz.service.CctvBMenuService;
|
||||
import com.gunshi.project.hsz.util.OkHttpUtil;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.validate.markers.Update;
|
||||
import com.gunshi.project.hsz.common.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.common.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
|
|
|
|||
|
|
@ -11,8 +11,8 @@ import com.gunshi.project.hsz.model.AttDamBase;
|
|||
import com.gunshi.project.hsz.service.AttDamBaseService;
|
||||
import com.gunshi.project.hsz.service.AttResBaseService;
|
||||
import com.gunshi.project.hsz.service.FileAssociationsService;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.validate.markers.Update;
|
||||
import com.gunshi.project.hsz.common.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.common.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
|
|
|
|||
|
|
@ -11,8 +11,8 @@ import com.gunshi.project.hsz.entity.vo.ProfilePressTreeVo;
|
|||
import com.gunshi.project.hsz.model.AttDamProfile;
|
||||
import com.gunshi.project.hsz.service.AttDamProfileService;
|
||||
import com.gunshi.project.hsz.service.FileAssociationsService;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.validate.markers.Update;
|
||||
import com.gunshi.project.hsz.common.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.common.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@ import com.gunshi.core.result.R;
|
|||
import com.gunshi.project.hsz.entity.vo.GateMonitorDataVo;
|
||||
import com.gunshi.project.hsz.model.AttGateB;
|
||||
import com.gunshi.project.hsz.service.AttGateBService;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.validate.markers.Update;
|
||||
import com.gunshi.project.hsz.common.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.common.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
|
|
|
|||
|
|
@ -10,8 +10,8 @@ import com.gunshi.project.hsz.entity.so.GeneralDataPage;
|
|||
import com.gunshi.project.hsz.model.AttGateValve;
|
||||
import com.gunshi.project.hsz.service.AttGateValveService;
|
||||
import com.gunshi.project.hsz.service.FileAssociationsService;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.validate.markers.Update;
|
||||
import com.gunshi.project.hsz.common.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.common.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
|
|
|
|||
|
|
@ -10,8 +10,8 @@ import com.gunshi.project.hsz.entity.so.GeneralDataPage;
|
|||
import com.gunshi.project.hsz.model.AttMeaWeir;
|
||||
import com.gunshi.project.hsz.service.AttMeaWeirService;
|
||||
import com.gunshi.project.hsz.service.StAddvcdDService;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.validate.markers.Update;
|
||||
import com.gunshi.project.hsz.common.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.common.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
|
|
|
|||
|
|
@ -5,8 +5,8 @@ import com.gunshi.project.hsz.model.AttResBase;
|
|||
import com.gunshi.project.hsz.model.FileAssociations;
|
||||
import com.gunshi.project.hsz.service.AttResBaseService;
|
||||
import com.gunshi.project.hsz.service.FileAssociationsService;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.validate.markers.Update;
|
||||
import com.gunshi.project.hsz.common.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.common.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import com.gunshi.project.hsz.model.AttResBuilding;
|
|||
import com.gunshi.project.hsz.model.FileAssociations;
|
||||
import com.gunshi.project.hsz.service.AttResBuildingService;
|
||||
import com.gunshi.project.hsz.service.FileAssociationsService;
|
||||
import com.gunshi.project.hsz.validate.markers.Update;
|
||||
import com.gunshi.project.hsz.common.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
|
|
|
|||
|
|
@ -9,8 +9,8 @@ import com.gunshi.core.result.R;
|
|||
import com.gunshi.project.hsz.entity.so.GeneralDataPage;
|
||||
import com.gunshi.project.hsz.model.AttSpillwayBase;
|
||||
import com.gunshi.project.hsz.service.AttSpillwayBaseService;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.validate.markers.Update;
|
||||
import com.gunshi.project.hsz.common.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.common.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
|
|
|
|||
|
|
@ -5,8 +5,8 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.hsz.model.AttWaterItem;
|
||||
import com.gunshi.project.hsz.service.AttWaterItemService;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.validate.markers.Update;
|
||||
import com.gunshi.project.hsz.common.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.common.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@ package com.gunshi.project.hsz.controller;
|
|||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.hsz.model.BroadcastStation;
|
||||
import com.gunshi.project.hsz.service.BroadcastStationService;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.validate.markers.Update;
|
||||
import com.gunshi.project.hsz.common.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.common.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue