庞家镇

This commit is contained in:
2023-06-29 16:59:03 +08:00
parent a94bad2a78
commit 3c7b59498c
183 changed files with 15217 additions and 4959 deletions

View File

@ -31,6 +31,26 @@
<version>1.7.0-pdok2</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.16.1</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>javax.persistence</groupId>
<artifactId>persistence-api</artifactId>
<version>1.0.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>6.0</version>
<scope>provided</scope>
</dependency>
</dependencies>
<properties>

View File

@ -14,7 +14,7 @@ import com.ruoyi.common.core.domain.BaseEntity;
* @author my
* @date 2023-04-20
*/
public class CropsComprehensiveData extends BaseEntity
public class CropsComprehensiveData
{
private static final long serialVersionUID = 1L;
@ -22,83 +22,65 @@ public class CropsComprehensiveData extends BaseEntity
private Long id;
/** 镇耕地面积(万亩) */
@Excel(name = "镇耕地面积(万亩)")
private Float cultivatedArea;
/** 粮食总产(万吨) */
@Excel(name = "粮食总产(万吨)")
private Float foodstuffProduction;
/** 蔬菜种植面积(亩) */
@Excel(name = "蔬菜种植面积(亩)")
private Long vegetablePlantingArea;
/** 蔬菜总产(吨) */
@Excel(name = "蔬菜总产(吨)")
private Long vegetableProduction;
/** 农产品种类 */
@Excel(name = "农产品种类")
private Long type;
/** 农产品种植面积(亩) */
@Excel(name = "农产品种植面积(亩)")
private Long agriculturalPlantingArea;
/** 特色农业总产量(吨) */
@Excel(name = "特色农业总产量(吨)")
private Long agricultureProduction;
/** 特色农业年产值(万元) */
@Excel(name = "特色农业年产值(万元)")
private Long agricultureOutputVaule;
/** 总人口(人) */
@Excel(name = "总人口(人)")
private Long totalPopulation;
/** 占地面积(平方公里) */
@Excel(name = "占地面积(平方公里)")
private Float coverArea;
/** 示范大棚数量(个) */
@Excel(name = "示范大棚数量(个)")
private Long exampleGreenhouse;
/** 村居数量(个) */
@Excel(name = "村居数量(个)")
private Long rusticate;
/** 联合社耕地面积(万亩) */
@Excel(name = "联合社耕地面积(万亩)")
private Float cultivatedAlly;
/** 大棚数量(个) */
@Excel(name = "大棚数量(个)")
private Long greenhouse;
/** 农产品产值(万元) */
@Excel(name = "农产品产值(万元)")
private Long outputValue;
/** 庞家镇矢量边界 */
@Excel(name = "庞家镇矢量边界")
private String vectorBoundary;
/** 庞家镇村庄矢量边界 */
@Excel(name = "庞家镇村庄矢量边界")
private String villageVectorBoundary;
/** 图片 */
private String img;
/** 创建人 */
@Excel(name = "创建人")
private String createdBy;
/** 创建时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date createdTime;
public void setId(Long id)

View File

@ -0,0 +1,123 @@
package com.ruoyi.crops.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import javax.persistence.*;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;
import java.util.Date;
/**
* 用户表;
* @author : http://www.chiner.pro
* @date : 2023-5-19
*/
@Entity
@Table(name = "crops_user")
public class CropsUser implements Serializable{
/** id */
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "crops_user_seq_gen")
@SequenceGenerator(name = "crops_user_seq_gen", sequenceName = "crops_user_seq")
private Integer id ;
/** 用户名 */
@NotNull()
private String userName ;
/** 密码 */
@JsonInclude(JsonInclude.Include.NON_EMPTY)
@NotBlank(message = "密码不能为空")
private String password ;
/** 联系方式 */
@Pattern(regexp = "1[3457][0-9]{9}",message = "请输入正确的手机号")
@NotBlank(message = "手机号不能为空")
private String phone ;
/** 角色 */
private String role ;
/** 创建时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private Date creatTime ;
/** 备注 */
private String remark ;
/** 帐号状态0正常 1停用 */
private Integer status ;
/** 删除标志0存在 1删除 */
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
private Integer delFlag ;
/** id */
public Integer getId(){
return this.id;
}
/** id */
public void setId(Integer id){
this.id=id;
}
/** 用户名 */
public String getUserName(){
return this.userName;
}
/** 用户名 */
public void setUserName(String userName){
this.userName=userName;
}
/** 密码 */
public String getPassword(){
return this.password;
}
/** 密码 */
public void setPassword(String password){
this.password=password;
}
/** 联系方式 */
public String getPhone(){
return this.phone;
}
/** 联系方式 */
public void setPhone(String phone){
this.phone=phone;
}
/** 角色 */
public String getRole(){
return this.role;
}
/** 角色 */
public void setRole(String role){
this.role=role;
}
/** 创建时间 */
public Date getCreatTime(){
return this.creatTime;
}
/** 创建时间 */
public void setCreatTime(Date creatTime){
this.creatTime=creatTime;
}
/** 备注 */
public String getRemark(){
return this.remark;
}
/** 备注 */
public void setRemark(String remark){
this.remark=remark;
}
/** 帐号状态0正常 1停用 */
public Integer getStatus(){
return this.status;
}
/** 帐号状态0正常 1停用 */
public void setStatus(Integer status){
this.status=status;
}
/** 删除标志0存在 1删除 */
public Integer getDelFlag(){
return this.delFlag;
}
/** 删除标志0存在 1删除 */
public void setDelFlag(Integer delFlag){
this.delFlag=delFlag;
}
}

View File

@ -0,0 +1,113 @@
package com.ruoyi.crops.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.util.Date;
/**
* 数据采集表;
* @author : http://www.chiner.pro
* @date : 2023-5-23
*/
public class DataAcquisition{
/** id */
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
private Integer id ;
/** 影像数据条数 */
private Integer imageData ;
/** 影像数据总量 */
private Float imageDataTotal ;
/** 无人机数据条数 */
private Integer droneData ;
/** 无人机数据总量 */
private Float droneDataTotal ;
/** 传感器数据条数 */
private Integer sensorData ;
/** 传感器数据总量 */
private Float sensorDataTotal ;
/** 时间 */
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")//接收时间类型
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")//返回时间类型
private Date time ;
/** id */
public Integer getId(){
return this.id;
}
/** id */
public void setId(Integer id){
this.id=id;
}
/** 影像数据条数 */
public Integer getImageData(){
return this.imageData;
}
/** 影像数据条数 */
public void setImageData(Integer imageData){
this.imageData=imageData;
}
/** 影像数据总量 */
public Float getImageDataTotal(){
return this.imageDataTotal;
}
/** 影像数据总量 */
public void setImageDataTotal(Float imageDataTotal){
this.imageDataTotal=imageDataTotal;
}
/** 无人机数据条数 */
public Integer getDroneData(){
return this.droneData;
}
/** 无人机数据条数 */
public void setDroneData(Integer droneData){
this.droneData=droneData;
}
/** 无人机数据总量 */
public Float getDroneDataTotal(){
return this.droneDataTotal;
}
/** 无人机数据总量 */
public void setDroneDataTotal(Float droneDataTotal){
this.droneDataTotal=droneDataTotal;
}
/** 传感器数据条数 */
public Integer getSensorData(){
return this.sensorData;
}
/** 传感器数据条数 */
public void setSensorData(Integer sensorData){
this.sensorData=sensorData;
}
/** 传感器数据总量 */
public Float getSensorDataTotal(){
return this.sensorDataTotal;
}
/** 传感器数据总量 */
public void setSensorDataTotal(Float sensorDataTotal){
this.sensorDataTotal=sensorDataTotal;
}
/** 时间 */
public Date getTime(){
return this.time;
}
/** 时间 */
public void setTime(Date time){
this.time=time;
}
@Override
public String toString() {
return "DataAcquisition{" +
"id=" + id +
", imageData=" + imageData +
", imageDataTotal='" + imageDataTotal + '\'' +
", droneData=" + droneData +
", droneDataTotal='" + droneDataTotal + '\'' +
", sensorData=" + sensorData +
", sensorDataTotal='" + sensorDataTotal + '\'' +
", time=" + time +
'}';
}
}

View File

@ -1,6 +1,7 @@
package com.ruoyi.crops.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
@ -85,7 +86,8 @@ public class DeviceSense {
private Integer BeiYong2 ;
/** 上报时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")//接收时间类型
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")//返回时间类型
private Date time ;
public Integer getId() {

View File

@ -0,0 +1,130 @@
package com.ruoyi.crops.domain;
/**
* 农机设备信息表;
* @author : http://www.chiner.pro
* @date : 2023-6-6
*/
public class FarmMachinery{
/** id */
private Integer id ;
/** 农机所属省 */
private String province ;
/** 农机所属市 */
private String city ;
/** 农机所属县 */
private String county ;
/** 农机所属乡镇 */
private String town ;
/** 终端编号 */
private String vmeid ;
/** 农机编号 */
private String vehicleno ;
/** 农机类型 */
private String vehicletype ;
/** 农机型号 */
private String vehiclenum ;
/** 车主姓名 */
private String ownername ;
/** 车主电话 */
private String ownertel ;
/** 归属合作社 */
private String belongcorp ;
/** id */
public Integer getId(){
return this.id;
}
/** id */
public void setId(Integer id){
this.id=id;
}
/** 农机所属省 */
public String getProvince(){
return this.province;
}
/** 农机所属省 */
public void setProvince(String province){
this.province=province;
}
/** 农机所属市 */
public String getCity(){
return this.city;
}
/** 农机所属市 */
public void setCity(String city){
this.city=city;
}
/** 农机所属县 */
public String getCounty(){
return this.county;
}
/** 农机所属县 */
public void setCounty(String county){
this.county=county;
}
/** 农机所属乡镇 */
public String getTown(){
return this.town;
}
/** 农机所属乡镇 */
public void setTown(String town){
this.town=town;
}
/** 终端编号 */
public String getVmeid(){
return this.vmeid;
}
/** 终端编号 */
public void setVmeid(String vmeid){
this.vmeid=vmeid;
}
/** 农机编号 */
public String getVehicleno(){
return this.vehicleno;
}
/** 农机编号 */
public void setVehicleno(String vehicleno){
this.vehicleno=vehicleno;
}
/** 农机类型 */
public String getVehicletype(){
return this.vehicletype;
}
/** 农机类型 */
public void setVehicletype(String vehicletype){
this.vehicletype=vehicletype;
}
/** 农机型号 */
public String getVehiclenum(){
return this.vehiclenum;
}
/** 农机型号 */
public void setVehiclenum(String vehiclenum){
this.vehiclenum=vehiclenum;
}
/** 车主姓名 */
public String getOwnername(){
return this.ownername;
}
/** 车主姓名 */
public void setOwnername(String ownername){
this.ownername=ownername;
}
/** 车主电话 */
public String getOwnertel(){
return this.ownertel;
}
/** 车主电话 */
public void setOwnertel(String ownertel){
this.ownertel=ownertel;
}
/** 归属合作社 */
public String getBelongcorp(){
return this.belongcorp;
}
/** 归属合作社 */
public void setBelongcorp(String belongcorp){
this.belongcorp=belongcorp;
}
}

View File

@ -0,0 +1,75 @@
package com.ruoyi.crops.domain;
public class FarmStatus {
/**
* 农机总量
*/
private int total;
/**
* 在线机器数量
*/
private int online;
/**
* 离线机器数量
*/
private int offline;
/**
* 作业机器数量
*/
private int working;
/**
* 未作业机器数量
*/
private int unwork;
public int getTotal() {
return total;
}
public void setTotal(int total) {
this.total = total;
}
public int getOnline() {
return online;
}
public void setOnline(int online) {
this.online = online;
}
public int getOffline() {
return offline;
}
public void setOffline(int offline) {
this.offline = offline;
}
public int getWorking() {
return working;
}
public void setWorking(int working) {
this.working = working;
}
public int getUnwork() {
return unwork;
}
public void setUnwork(int unwork) {
this.unwork = unwork;
}
@Override
public String toString() {
return "FarmStatus{" +
"total=" + total +
", online=" + online +
", offline=" + offline +
", working=" + working +
", unwork=" + unwork +
'}';
}
}

View File

@ -0,0 +1,81 @@
package com.ruoyi.crops.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import javax.persistence.*;
import java.util.Date;
/**
* 接口数据量统计;
* @author : http://www.chiner.pro
* @date : 2023-5-24
*/
@Table(name="interface_statistics")
public class InterfaceStatistics{
/** id */
@Id
@GeneratedValue
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
private Integer id ;
/** 访问次数 */
private Integer visits ;
/** 访问用户量 */
private Integer accessingUsers ;
/** 交换数据量 */
private Integer dataEntries ;
/** 时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private Date time ;
/** id */
public Integer getId(){
return this.id;
}
/** id */
public void setId(Integer id){
this.id=id;
}
/** 访问次数 */
public Integer getVisits(){
return this.visits;
}
/** 访问次数 */
public void setVisits(Integer visits){
this.visits=visits;
}
/** 访问用户量 */
public Integer getAccessingUsers(){
return this.accessingUsers;
}
/** 访问用户量 */
public void setAccessingUsers(Integer accessingUsers){
this.accessingUsers=accessingUsers;
}
/** 交换数据量 */
public Integer getDataEntries(){
return this.dataEntries;
}
/** 交换数据量 */
public void setDataEntries(Integer dataEntries){
this.dataEntries=dataEntries;
}
/** 时间 */
public Date getTime(){
return this.time;
}
/** 时间 */
public void setTime(Date time){
this.time=time;
}
@Override
public String toString() {
return "InterfaceStatistics{" +
"id=" + id +
", visits=" + visits +
", accessingUsers=" + accessingUsers +
", dataEntries=" + dataEntries +
", time=" + time +
'}';
}
}

View File

@ -1,70 +1,378 @@
package com.ruoyi.crops.domain;
/**
* 水肥一体机参数;
* 水肥一体机状态表;
* @author : http://www.chiner.pro
* @date : 2023-4-27
* @date : 2023-5-18
*/
public class MachineParameter{
/** id */
private String id ;
/** 大棚名称 */
private String greenhouseName ;
/** 压力 */
private Double pressure ;
/** 流量 */
private Double flow ;
// /** id */
// private Integer id ;
/** 阀门1 */
private String Valve1 ;
/** 阀门2 */
private String valve2 ;
/** 阀门3 */
private String Valve3 ;
/** 阀门4 */
private String Valve4 ;
/** 阀门5 */
private String Valve5 ;
/** 阀门6 */
private String Valve6 ;
/** 阀门7 */
private String Valve7 ;
/** 阀门8 */
private String Valve8 ;
/** 阀门9 */
private String Valve9 ;
/** 阀门10 */
private String Valve10 ;
/** 阀门11 */
private String Valve11 ;
/** 阀门12 */
private String Valve12 ;
/** 阀门13 */
private String Valve13 ;
/** 阀门14 */
private String Valve14 ;
/** 阀门15 */
private String Valve15 ;
/** 阀门16 */
private String Valve16 ;
/** 阀门17 */
private String Valve17 ;
/** 阀门18 */
private String Valve18 ;
/** 阀门19 */
private String Valve19 ;
/** 阀门20 */
private String Valve20 ;
/** 进水泵 */
private String InflowPump ;
/** 出料泵 */
private String FeedingPump ;
/** 搅拌1 */
private String JiaoBan1 ;
/** 搅拌2 */
private String JiaoBan2 ;
/** 搅拌3 */
private String JiaoBan3 ;
/** 搅拌4 */
private String JiaoBan4 ;
/** pH值 */
private Double pH ;
/** 电导率 */
private Double conductivity ;
private Double Conduct ;
/** 进水流量 */
private Double Inflow ;
/** 进水压力 */
private Double InflowPressure ;
/** 功率模式 */
private String PowerMode ;
/** 控制模式 */
private String ControlMode ;
public String getId() {
return id;
/** id */
// public Integer getId(){
// return this.id;
// }
/** id */
// public void setId(Integer id){
// this.id=id;
// }
public String getValve1() {
return Valve1;
}
public void setId(String id) {
this.id = id;
public void setValve1(String valve1) {
Valve1 = valve1;
}
public String getGreenhouseName() {
return greenhouseName;
public String getvalve2() {
return valve2;
}
public void setGreenhouseName(String greenhouseName) {
this.greenhouseName = greenhouseName;
public void setvalve2(String valve2) {
this.valve2 = valve2;
}
public Double getPressure() {
return pressure;
public String getValve3() {
return Valve3;
}
public void setPressure(Double pressure) {
this.pressure = pressure;
public void setValve3(String valve3) {
Valve3 = valve3;
}
public Double getFlow() {
return flow;
public String getValve4() {
return Valve4;
}
public void setFlow(Double flow) {
this.flow = flow;
public void setValve4(String valve4) {
Valve4 = valve4;
}
public Double getConductivity() {
return conductivity;
public String getValve5() {
return Valve5;
}
public void setConductivity(Double conductivity) {
this.conductivity = conductivity;
public void setValve5(String valve5) {
Valve5 = valve5;
}
public String getValve6() {
return Valve6;
}
public void setValve6(String valve6) {
Valve6 = valve6;
}
public String getValve7() {
return Valve7;
}
public void setValve7(String valve7) {
Valve7 = valve7;
}
public String getValve8() {
return Valve8;
}
public void setValve8(String valve8) {
Valve8 = valve8;
}
public String getValve9() {
return Valve9;
}
public void setValve9(String valve9) {
Valve9 = valve9;
}
public String getValve10() {
return Valve10;
}
public void setValve10(String valve10) {
Valve10 = valve10;
}
public String getValve11() {
return Valve11;
}
public void setValve11(String valve11) {
Valve11 = valve11;
}
public String getValve12() {
return Valve12;
}
public void setValve12(String valve12) {
Valve12 = valve12;
}
public String getValve13() {
return Valve13;
}
public void setValve13(String valve13) {
Valve13 = valve13;
}
public String getValve14() {
return Valve14;
}
public void setValve14(String valve14) {
Valve14 = valve14;
}
public String getValve15() {
return Valve15;
}
public void setValve15(String valve15) {
Valve15 = valve15;
}
public String getValve16() {
return Valve16;
}
public void setValve16(String valve16) {
Valve16 = valve16;
}
public String getValve17() {
return Valve17;
}
public void setValve17(String valve17) {
Valve17 = valve17;
}
public String getValve18() {
return Valve18;
}
public void setValve18(String valve18) {
Valve18 = valve18;
}
public String getValve19() {
return Valve19;
}
public void setValve19(String valve19) {
Valve19 = valve19;
}
public String getValve20() {
return Valve20;
}
public void setValve20(String valve20) {
Valve20 = valve20;
}
public String getInflowPump() {
return InflowPump;
}
public void setInflowPump(String inflowPump) {
InflowPump = inflowPump;
}
public String getFeedingPump() {
return FeedingPump;
}
public void setFeedingPump(String feedingPump) {
FeedingPump = feedingPump;
}
public String getJiaoBan1() {
return JiaoBan1;
}
public void setJiaoBan1(String jiaoBan1) {
JiaoBan1 = jiaoBan1;
}
public String getJiaoBan2() {
return JiaoBan2;
}
public void setJiaoBan2(String jiaoBan2) {
JiaoBan2 = jiaoBan2;
}
public String getJiaoBan3() {
return JiaoBan3;
}
public void setJiaoBan3(String jiaoBan3) {
JiaoBan3 = jiaoBan3;
}
public String getJiaoBan4() {
return JiaoBan4;
}
public void setJiaoBan4(String jiaoBan4) {
JiaoBan4 = jiaoBan4;
}
public Double getpH() {
return pH;
}
public void setpH(Double pH) {
this.pH = pH;
}
public Double getConduct() {
return Conduct;
}
public void setConduct(Double conduct) {
Conduct = conduct;
}
public Double getInflow() {
return Inflow;
}
public void setInflow(Double inflow) {
Inflow = inflow;
}
public Double getInflowPressure() {
return InflowPressure;
}
public void setInflowPressure(Double inflowPressure) {
InflowPressure = inflowPressure;
}
public String getPowerMode() {
return PowerMode;
}
public void setPowerMode(String powerMode) {
PowerMode = powerMode;
}
public String getControlMode() {
return ControlMode;
}
public void setControlMode(String controlMode) {
ControlMode = controlMode;
}
@Override
public String toString() {
return "MachineParameter{" +
"id='" + id + '\'' +
", greenhouseName='" + greenhouseName + '\'' +
", pressure=" + pressure +
", flow=" + flow +
", conductivity=" + conductivity +
"Valve1='" + Valve1 + '\'' +
", valve2='" + valve2 + '\'' +
", Valve3='" + Valve3 + '\'' +
", Valve4='" + Valve4 + '\'' +
", Valve5='" + Valve5 + '\'' +
", Valve6='" + Valve6 + '\'' +
", Valve7='" + Valve7 + '\'' +
", Valve8='" + Valve8 + '\'' +
", Valve9='" + Valve9 + '\'' +
", Valve10='" + Valve10 + '\'' +
", Valve11='" + Valve11 + '\'' +
", Valve12='" + Valve12 + '\'' +
", Valve13='" + Valve13 + '\'' +
", Valve14='" + Valve14 + '\'' +
", Valve15='" + Valve15 + '\'' +
", Valve16='" + Valve16 + '\'' +
", Valve17='" + Valve17 + '\'' +
", Valve18='" + Valve18 + '\'' +
", Valve19='" + Valve19 + '\'' +
", Valve20='" + Valve20 + '\'' +
", InflowPump='" + InflowPump + '\'' +
", FeedingPump='" + FeedingPump + '\'' +
", JiaoBan1='" + JiaoBan1 + '\'' +
", JiaoBan2='" + JiaoBan2 + '\'' +
", JiaoBan3='" + JiaoBan3 + '\'' +
", JiaoBan4='" + JiaoBan4 + '\'' +
", pH=" + pH +
", Conduct=" + Conduct +
", Inflow=" + Inflow +
", InflowPressure=" + InflowPressure +
", PowerMode='" + PowerMode + '\'' +
", ControlMode='" + ControlMode + '\'' +
'}';
}
}

View File

@ -0,0 +1,188 @@
package com.ruoyi.crops.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
/**
* 农机作业任务表;
* @author : http://www.chiner.pro
* @date : 2023-6-7
*/
public class MachineryJobData {
/** id */
private Integer id ;
/** 归属省 */
private String province ;
/** 归属地市 */
private String city ;
/** 归属区县 */
private String county ;
/** 作业日期 */
@DateTimeFormat(pattern="yyyy-MM-dd")
@JsonFormat(pattern="yyyy-MM-dd")
private Date jobday ;
/** 作业类型码 */
private Integer jobtype ;
/** 农机编号 */
private String vehicleno ;
/** 终端编号 */
private String vmeid ;
/** 作业地块面积(单位:亩) */
private Double plotarea ;
/** 作业面积(单位:亩) */
private Double jobarea ;
/** 达标比() */
private Double qualratio ;
/** 达标面积(单位:亩) */
private Double qualarea ;
/** 作业幅宽(单位:米) */
private Double jobwidth ;
/** 面积(单位:亩) */
private Double area ;
/** 时长(单位:小时) */
private Double workhours ;
/** id */
public Integer getId(){
return this.id;
}
/** id */
public void setId(Integer id){
this.id=id;
}
/** 归属省 */
public String getProvince(){
return this.province;
}
/** 归属省 */
public void setProvince(String province){
this.province=province;
}
/** 归属地市 */
public String getCity(){
return this.city;
}
/** 归属地市 */
public void setCity(String city){
this.city=city;
}
/** 归属区县 */
public String getCounty(){
return this.county;
}
/** 归属区县 */
public void setCounty(String county){
this.county=county;
}
/** 作业日期 */
public Date getJobday(){
return this.jobday;
}
/** 作业日期 */
public void setJobday(Date jobday){
this.jobday=jobday;
}
/** 作业类型码 */
public Integer getJobtype(){
return this.jobtype;
}
/** 作业类型码 */
public void setJobtype(Integer jobtype){
this.jobtype=jobtype;
}
/** 农机编号 */
public String getVehicleno(){
return this.vehicleno;
}
/** 农机编号 */
public void setVehicleno(String vehicleno){
this.vehicleno=vehicleno;
}
/** 终端编号 */
public String getVmeid(){
return this.vmeid;
}
/** 终端编号 */
public void setVmeid(String vmeid){
this.vmeid=vmeid;
}
/** 作业地块面积(单位:亩) */
public Double getPlotarea(){
return this.plotarea;
}
/** 作业地块面积(单位:亩) */
public void setPlotarea(Double plotarea){
this.plotarea=plotarea;
}
/** 作业面积(单位:亩) */
public Double getJobarea(){
return this.jobarea;
}
/** 作业面积(单位:亩) */
public void setJobarea(Double jobarea){
this.jobarea=jobarea;
}
/** 达标比() */
public Double getQualratio(){
return this.qualratio;
}
/** 达标比() */
public void setQualratio(Double qualratio){
this.qualratio=qualratio;
}
/** 达标面积(单位:亩) */
public Double getQualarea(){
return this.qualarea;
}
/** 达标面积(单位:亩) */
public void setQualarea(Double qualarea){
this.qualarea=qualarea;
}
/** 作业幅宽(单位:米) */
public Double getJobwidth(){
return this.jobwidth;
}
/** 作业幅宽(单位:米) */
public void setJobwidth(Double jobwidth){
this.jobwidth=jobwidth;
}
public Double getArea() {
return area;
}
public void setArea(Double area) {
this.area = area;
}
public Double getWorkhours() {
return workhours;
}
public void setWorkhours(Double workhours) {
this.workhours = workhours;
}
@Override
public String toString() {
return "MachineryJobData{" +
"id=" + id +
", province='" + province + '\'' +
", city='" + city + '\'' +
", county='" + county + '\'' +
", jobday=" + jobday +
", jobtype=" + jobtype +
", vehicleno='" + vehicleno + '\'' +
", vmeid='" + vmeid + '\'' +
", plotarea=" + plotarea +
", jobarea=" + jobarea +
", qualratio=" + qualratio +
", qualarea=" + qualarea +
", jobwidth=" + jobwidth +
", area=" + area +
", workhours=" + workhours +
'}';
}
}

View File

@ -0,0 +1,92 @@
package com.ruoyi.crops.domain;
import java.util.Date;
/**
* 农机位置表;
* @author : http://www.chiner.pro
* @date : 2023-6-6
*/
public class MachineryPosition {
/** id */
private Integer id ;
/** 农机编号 */
private String vehicleno ;
/** 时间(北京时间) */
private Date postime ;
/** 纬度值(WGS84 坐标系) */
private Double lat ;
/** 经度值(WGS84 坐标系) */
private Double lng ;
/** 速度km/h */
private Double speed ;
/** 作业类型代码 */
private Integer jobtype ;
/** 作业深度cm */
private Double depth ;
/** id */
public Integer getId(){
return this.id;
}
/** id */
public void setId(Integer id){
this.id=id;
}
/** 农机编号 */
public String getVehicleno(){
return this.vehicleno;
}
/** 农机编号 */
public void setVehicleno(String vehicleno){
this.vehicleno=vehicleno;
}
/** 时间(北京时间) */
public Date getPostime(){
return this.postime;
}
/** 时间(北京时间) */
public void setPostime(Date postime){
this.postime=postime;
}
/** 纬度值(WGS84 坐标系) */
public Double getLat(){
return this.lat;
}
/** 纬度值(WGS84 坐标系) */
public void setLat(Double lat){
this.lat=lat;
}
/** 经度值(WGS84 坐标系) */
public Double getLng(){
return this.lng;
}
/** 经度值(WGS84 坐标系) */
public void setLng(Double lng){
this.lng=lng;
}
/** 速度km/h */
public Double getSpeed(){
return this.speed;
}
/** 速度km/h */
public void setSpeed(Double speed){
this.speed=speed;
}
/** 作业类型代码 */
public Integer getJobtype(){
return this.jobtype;
}
/** 作业类型代码 */
public void setJobtype(Integer jobtype){
this.jobtype=jobtype;
}
/** 作业深度cm */
public Double getDepth(){
return this.depth;
}
/** 作业深度cm */
public void setDepth(Double depth){
this.depth=depth;
}
}

View File

@ -17,8 +17,6 @@ public class OperationRecords {
private Date updateTime ;
/** 操作内容 */
private String operationContent ;
/** 更新人 */
private String updateBy ;
public String getId() {
return id;
@ -44,21 +42,12 @@ public class OperationRecords {
this.operationContent = operationContent;
}
public String getUpdateBy() {
return updateBy;
}
public void setUpdateBy(String updateBy) {
this.updateBy = updateBy;
}
@Override
public String toString() {
return "OperationRecords{" +
"id='" + id + '\'' +
", updateTime=" + updateTime +
", operationContent='" + operationContent + '\'' +
", updateBy='" + updateBy + '\'' +
'}';
}
}

View File

@ -0,0 +1,65 @@
package com.ruoyi.crops.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date;
/**
* 农机信息预警表;
* @author : http://www.chiner.pro
* @date : 2023-6-15
*/
public class WarningFarm{
/** id */
private Integer id ;
/** 农机名称 */
private String vehicleno ;
/** 车主姓名 */
private String ownername ;
/** 异常类型 */
private String warningInfo ;
/** 预警时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private Date time ;
/** id */
public Integer getId(){
return this.id;
}
/** id */
public void setId(Integer id){
this.id=id;
}
/** 农机名称 */
public String getVehicleno(){
return this.vehicleno;
}
/** 农机名称 */
public void setVehicleno(String vehicleno){
this.vehicleno=vehicleno;
}
/** 车主姓名 */
public String getOwnername(){
return this.ownername;
}
/** 车主姓名 */
public void setOwnername(String ownername){
this.ownername=ownername;
}
/** 异常类型 */
public String getWarningInfo(){
return this.warningInfo;
}
/** 异常类型 */
public void setWarningInfo(String warningInfo){
this.warningInfo=warningInfo;
}
/** 预警时间 */
public Date getTime(){
return this.time;
}
/** 预警时间 */
public void setTime(Date time){
this.time=time;
}
}

View File

@ -0,0 +1,154 @@
package com.ruoyi.crops.domain;
import javax.persistence.*;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
* 气象预报 表
* @author tajochen
*/
@Entity
@Table(name="weather_prediction")
public class WeatherPredictionEntity implements Serializable {
/**
* 指定主键,建立自增序列,主键值取自序列
*/
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "weather_prediction_seq_gen")
@SequenceGenerator(name = "weather_prediction_seq_gen", sequenceName = "weather_prediction_seq")
private Integer id;
// 气象时间
private LocalDateTime weatherTime;
// 气象名称
@Column(length = 16, columnDefinition = "varchar(16)")
private String weatherName;
// 气温
@Column(length = 16, columnDefinition = "varchar(16)")
private String airTemperature;
// 降水量
@Column(length = 16, columnDefinition = "varchar(16)")
private String precipitation;
// 风速
@Column(length = 16, columnDefinition = "varchar(16)")
private String windSpeed;
// 风向
@Column(length = 16, columnDefinition = "varchar(16)")
private String windDirection;
// 气压
@Column(length = 16, columnDefinition = "varchar(16)")
private String atmosphericPressure;
// 湿度
@Column(length = 16, columnDefinition = "varchar(16)")
private String humidity;
// 云量
@Column(length = 16, columnDefinition = "varchar(16)")
private String cloudCover;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public LocalDateTime getWeatherTime() {
return weatherTime;
}
public void setWeatherTime(LocalDateTime weatherTime) {
this.weatherTime = weatherTime;
}
public String getWeatherName() {
return weatherName;
}
public void setWeatherName(String weatherName) {
this.weatherName = weatherName;
}
public String getAirTemperature() {
return airTemperature;
}
public void setAirTemperature(String airTemperature) {
this.airTemperature = airTemperature;
}
public String getPrecipitation() {
return precipitation;
}
public void setPrecipitation(String precipitation) {
this.precipitation = precipitation;
}
public String getWindSpeed() {
return windSpeed;
}
public void setWindSpeed(String windSpeed) {
this.windSpeed = windSpeed;
}
public String getWindDirection() {
return windDirection;
}
public void setWindDirection(String windDirection) {
this.windDirection = windDirection;
}
public String getAtmosphericPressure() {
return atmosphericPressure;
}
public void setAtmosphericPressure(String atmosphericPressure) {
this.atmosphericPressure = atmosphericPressure;
}
public String getHumidity() {
return humidity;
}
public void setHumidity(String humidity) {
this.humidity = humidity;
}
public String getCloudCover() {
return cloudCover;
}
public void setCloudCover(String cloudCover) {
this.cloudCover = cloudCover;
}
@Override
public String toString() {
return "WeatherPredictionEntity{" +
"id=" + id +
", weatherTime=" + weatherTime +
", weatherName='" + weatherName + '\'' +
", airTemperature='" + airTemperature + '\'' +
", precipitation='" + precipitation + '\'' +
", windSpeed='" + windSpeed + '\'' +
", windDirection='" + windDirection + '\'' +
", atmosphericPressure='" + atmosphericPressure + '\'' +
", humidity='" + humidity + '\'' +
", cloudCover='" + cloudCover + '\'' +
'}';
}
}

View File

@ -0,0 +1,27 @@
package com.ruoyi.crops.domain.gsonBean;
import com.ruoyi.crops.domain.FarmMachinery;
import java.util.List;
public class GsonFarmMachineryBean {
public int status;
public List<FarmMachinery> vehicle;
public int getStatus() {
return status;
}
public void setStatus(int status) {
this.status = status;
}
public List<FarmMachinery> getVehicle() {
return vehicle;
}
public void setVehicle(List<FarmMachinery> vehicle) {
this.vehicle = vehicle;
}
}

View File

@ -0,0 +1,353 @@
package com.ruoyi.crops.domain.gsonBean;
public class GsonMachineParameterBean {
public GsonMachineParameterBean() {
}
public String msg;
public MachineParameter data;
public Integer code;
public Boolean result;
public String time;
public class MachineParameter{
/** 阀门1 */
public property Valve1 ;
/** 阀门2 */
public property valve2 ;
/** 阀门3 */
public property Valve3 ;
/** 阀门4 */
public property Valve4 ;
/** 阀门5 */
public property Valve5 ;
/** 阀门6 */
public property Valve6 ;
/** 阀门7 */
public property Valve7 ;
/** 阀门8 */
public property Valve8 ;
/** 阀门9 */
public property Valve9 ;
/** 阀门10 */
public property Valve10 ;
/** 阀门11 */
public property Valve11 ;
/** 阀门12 */
public property Valve12 ;
/** 阀门13 */
public property Valve13 ;
/** 阀门14 */
public property Valve14 ;
/** 阀门15 */
public property Valve15 ;
/** 阀门16 */
public property Valve16 ;
/** 阀门17 */
public property Valve17 ;
/** 阀门18 */
public property Valve18 ;
/** 阀门19 */
public property Valve19 ;
/** 阀门20 */
public property Valve20 ;
/** 进水泵 */
public property InflowPump ;
/** 出料泵 */
public property FeedingPump ;
/** 搅拌1 */
public property JiaoBan1 ;
/** 搅拌2 */
public property JiaoBan2 ;
/** 搅拌3 */
public property JiaoBan3 ;
/** 搅拌4 */
public property JiaoBan4 ;
/** pH值 */
public property pH ;
/** 电导率 */
public property Conduct ;
/** 进水流量 */
public property Inflow ;
/** 进水压力 */
public property InflowPressure ;
/** 功率模式 */
public property PowerMode ;
/** 控制模式 */
public property ControlMode ;
public property getValve1() {
return Valve1;
}
public void setValve1(property valve1) {
Valve1 = valve1;
}
public property getvalve2() {
return valve2;
}
public void setvalve2(property valve2) {
this.valve2 = valve2;
}
public property getValve3() {
return Valve3;
}
public void setValve3(property valve3) {
Valve3 = valve3;
}
public property getValve4() {
return Valve4;
}
public void setValve4(property valve4) {
Valve4 = valve4;
}
public property getValve5() {
return Valve5;
}
public void setValve5(property valve5) {
Valve5 = valve5;
}
public property getValve6() {
return Valve6;
}
public void setValve6(property valve6) {
Valve6 = valve6;
}
public property getValve7() {
return Valve7;
}
public void setValve7(property valve7) {
Valve7 = valve7;
}
public property getValve8() {
return Valve8;
}
public void setValve8(property valve8) {
Valve8 = valve8;
}
public property getValve9() {
return Valve9;
}
public void setValve9(property valve9) {
Valve9 = valve9;
}
public property getValve10() {
return Valve10;
}
public void setValve10(property valve10) {
Valve10 = valve10;
}
public property getValve11() {
return Valve11;
}
public void setValve11(property valve11) {
Valve11 = valve11;
}
public property getValve12() {
return Valve12;
}
public void setValve12(property valve12) {
Valve12 = valve12;
}
public property getValve13() {
return Valve13;
}
public void setValve13(property valve13) {
Valve13 = valve13;
}
public property getValve14() {
return Valve14;
}
public void setValve14(property valve14) {
Valve14 = valve14;
}
public property getValve15() {
return Valve15;
}
public void setValve15(property valve15) {
Valve15 = valve15;
}
public property getValve16() {
return Valve16;
}
public void setValve16(property valve16) {
Valve16 = valve16;
}
public property getValve17() {
return Valve17;
}
public void setValve17(property valve17) {
Valve17 = valve17;
}
public property getValve18() {
return Valve18;
}
public void setValve18(property valve18) {
Valve18 = valve18;
}
public property getValve19() {
return Valve19;
}
public void setValve19(property valve19) {
Valve19 = valve19;
}
public property getValve20() {
return Valve20;
}
public void setValve20(property valve20) {
Valve20 = valve20;
}
public property getInflowPump() {
return InflowPump;
}
public void setInflowPump(property inflowPump) {
InflowPump = inflowPump;
}
public property getFeedingPump() {
return FeedingPump;
}
public void setFeedingPump(property feedingPump) {
FeedingPump = feedingPump;
}
public property getJiaoBan1() {
return JiaoBan1;
}
public void setJiaoBan1(property jiaoBan1) {
JiaoBan1 = jiaoBan1;
}
public property getJiaoBan2() {
return JiaoBan2;
}
public void setJiaoBan2(property jiaoBan2) {
JiaoBan2 = jiaoBan2;
}
public property getJiaoBan3() {
return JiaoBan3;
}
public void setJiaoBan3(property jiaoBan3) {
JiaoBan3 = jiaoBan3;
}
public property getJiaoBan4() {
return JiaoBan4;
}
public void setJiaoBan4(property jiaoBan4) {
JiaoBan4 = jiaoBan4;
}
public property getpH() {
return pH;
}
public void setpH(property pH) {
this.pH = pH;
}
public property getConduct() {
return Conduct;
}
public void setConduct(property conduct) {
Conduct = conduct;
}
public property getInflow() {
return Inflow;
}
public void setInflow(property inflow) {
Inflow = inflow;
}
public property getInflowPressure() {
return InflowPressure;
}
public void setInflowPressure(property inflowPressure) {
InflowPressure = inflowPressure;
}
public property getPowerMode() {
return PowerMode;
}
public void setPowerMode(property powerMode) {
PowerMode = powerMode;
}
public property getControlMode() {
return ControlMode;
}
public void setControlMode(property controlMode) {
ControlMode = controlMode;
}
}
public class property{
public String propertyName;
public String dataType;
public String propertyNameShow;
public String propertyValve;
@Override
public String toString() {
return "property{" +
"propertyName='" + propertyName + '\'' +
", dataType='" + dataType + '\'' +
", propertyNameShow='" + propertyNameShow + '\'' +
", propertyValve='" + propertyValve + '\'' +
'}';
}
}
}

View File

@ -0,0 +1,26 @@
package com.ruoyi.crops.domain.gsonBean;
import com.ruoyi.crops.domain.MachineryPosition;
import java.util.List;
public class GsonMachineryPositionBean {
public int status;
public List<MachineryPosition> position;
public int getStatus() {
return status;
}
public void setStatus(int status) {
this.status = status;
}
public List<MachineryPosition> getPosition() {
return position;
}
public void setPosition(List<MachineryPosition> position) {
this.position = position;
}
}

View File

@ -1,6 +1,7 @@
package com.ruoyi.crops.domain.gsonBean;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.crops.domain.Meteorological;
import java.util.ArrayList;
import java.util.Date;
@ -10,26 +11,4 @@ public class GsonMeteorologicalBean {
public ArrayList<Meteorological> result;
public String error_code;
public class Meteorological{
/** 预警消息ID */
public String id ;
/** 预警消息标题 */
public String title ;
/** 预警等级, 橙色/红色/蓝色/黄色/未知 */
public String level ;
/** 预警类型 */
public String type ;
/** 预警发布时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
public Date time ;
/** 省份, 可能为空 */
public String province ;
/** 城市, 可能为空 */
public String city ;
/** 区域, 可能为空 */
public String district ;
/** 预警详细内容 */
public String content ;
}
}

View File

@ -0,0 +1,119 @@
package com.ruoyi.crops.domain.gsonBean;
import java.util.Date;
import java.util.List;
public class GsonVehicleTrackBean {
private int status;
private String vehicleno;
private List<postions> postions;
public int getStatus() {
return status;
}
public void setStatus(int status) {
this.status = status;
}
public String getVehicleno() {
return vehicleno;
}
public void setVehicleno(String vehicleno) {
this.vehicleno = vehicleno;
}
public List<GsonVehicleTrackBean.postions> getPostions() {
return postions;
}
public void setPostions(List<GsonVehicleTrackBean.postions> postions) {
this.postions = postions;
}
public class postions{
private Date pttime;
private float lat;
private float lng;
private float course;
private int haspic;
private String imgurl;
private int iswork;
private double jobwidth;
private float depth;
public Date getPttime() {
return pttime;
}
public void setPttime(Date pttime) {
this.pttime = pttime;
}
public float getLat() {
return lat;
}
public void setLat(float lat) {
this.lat = lat;
}
public float getLng() {
return lng;
}
public void setLng(float lng) {
this.lng = lng;
}
public float getCourse() {
return course;
}
public void setCourse(float course) {
this.course = course;
}
public int getHaspic() {
return haspic;
}
public void setHaspic(int haspic) {
this.haspic = haspic;
}
public String getImgurl() {
return imgurl;
}
public void setImgurl(String imgurl) {
this.imgurl = imgurl;
}
public int getIswork() {
return iswork;
}
public void setIswork(int iswork) {
this.iswork = iswork;
}
public double getJobwidth() {
return jobwidth;
}
public void setJobwidth(double jobwidth) {
this.jobwidth = jobwidth;
}
public float getDepth() {
return depth;
}
public void setDepth(float depth) {
this.depth = depth;
}
}
}

View File

@ -1,6 +1,7 @@
package com.ruoyi.crops.domain.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
@ -20,7 +21,8 @@ public class DeviceSenseVo {
/** 二氧化碳浓度[ppm] */
private Double AvgCO2 ;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")//接收时间类型
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")//返回时间类型
private Date time ;
public String getDid() {

View File

@ -0,0 +1,44 @@
package com.ruoyi.crops.domain.vo;
public class FarmMachineryVo {
/** id */
private Integer id ;
/** 农机编号 */
private String vehicleno ;
/** 农机类型 */
private String vehicletype ;
/** 车主姓名 */
private String ownername ;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getVehicleno() {
return vehicleno;
}
public void setVehicleno(String vehicleno) {
this.vehicleno = vehicleno;
}
public String getVehicletype() {
return vehicletype;
}
public void setVehicletype(String vehicletype) {
this.vehicletype = vehicletype;
}
public String getOwnername() {
return ownername;
}
public void setOwnername(String ownername) {
this.ownername = ownername;
}
}

View File

@ -0,0 +1,54 @@
package com.ruoyi.crops.domain.vo;
public class InterfaceStatisticsVo {
/** 访问次数 */
private Integer visits ;
/** 访问用户量 */
private Integer accessingUsers ;
/** 交换数据量 */
private Integer dataEntries ;
/** 数据库总量 */
private Float volume;
public Integer getVisits() {
return visits;
}
public void setVisits(Integer visits) {
this.visits = visits;
}
public Integer getAccessingUsers() {
return accessingUsers;
}
public void setAccessingUsers(Integer accessingUsers) {
this.accessingUsers = accessingUsers;
}
public Integer getDataEntries() {
return dataEntries;
}
public void setDataEntries(Integer dataEntries) {
this.dataEntries = dataEntries;
}
public Float getVolume() {
return volume;
}
public void setVolume(Float volume) {
this.volume = volume;
}
@Override
public String toString() {
return "InterfaceStatisticsVo{" +
"visits=" + visits +
", accessingUsers=" + accessingUsers +
", dataEntries=" + dataEntries +
", volume='" + volume + '\'' +
'}';
}
}

View File

@ -0,0 +1,15 @@
package com.ruoyi.crops.domain.vo;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
@Data
public class MachineParameterVo {
private Double pH;
private Double Conduct;
private Double Inflow;
private Double InflowPressure;
}

View File

@ -0,0 +1,143 @@
package com.ruoyi.crops.domain.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
public class MachineryJobDataVo {
/** 作业类型码 */
private String jobtype ;
/** 农机编号 */
@Excel(name = "设备编号")
private String vehicleno ;
/** 农机类型 */
@Excel(name = "设备类型")
private String vehicletype ;
/** 终端编号 */
@Excel(name = "机器码")
private String vmeid ;
/** 作业日期 */
@Excel(name = "作业日期",dateFormat = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
@JsonFormat(pattern="yyyy-MM-dd")
private Date jobday ;
@Excel(name = "作业面积(亩)")
/** 作业面积(单位:亩) */
private Double jobarea ;
/** 车主姓名 */
@Excel(name = "用户名")
private String ownername ;
/** 车主电话 */
@Excel(name = "联系方式")
private String ownertel ;
/** 面积(单位:亩) */
private Double area ;
/** 时长(单位:小时) */
private Double workhours ;
public String getVehicletype() {
return vehicletype;
}
public void setVehicletype(String vehicletype) {
this.vehicletype = vehicletype;
}
public String getVehicleno() {
return vehicleno;
}
public void setVehicleno(String vehicleno) {
this.vehicleno = vehicleno;
}
public String getVmeid() {
return vmeid;
}
public void setVmeid(String vmeid) {
this.vmeid = vmeid;
}
public Date getJobday() {
return jobday;
}
public void setJobday(Date jobday) {
this.jobday = jobday;
}
public Double getJobarea() {
return jobarea;
}
public void setJobarea(Double jobarea) {
this.jobarea = jobarea;
}
public String getOwnername() {
return ownername;
}
public void setOwnername(String ownername) {
this.ownername = ownername;
}
public String getOwnertel() {
return ownertel;
}
public void setOwnertel(String ownertel) {
this.ownertel = ownertel;
}
public String getJobtype() {
return jobtype;
}
public void setJobtype(String jobtype) {
this.jobtype = jobtype;
}
public Double getArea() {
return area;
}
public void setArea(Double area) {
this.area = area;
}
public Double getWorkhours() {
return workhours;
}
public void setWorkhours(Double workhours) {
this.workhours = workhours;
}
@Override
public String toString() {
return "MachineryJobDataVo{" +
"jobtype='" + jobtype + '\'' +
", vehicleno='" + vehicleno + '\'' +
", vehicletype='" + vehicletype + '\'' +
", vmeid='" + vmeid + '\'' +
", jobday=" + jobday +
", jobarea=" + jobarea +
", ownername='" + ownername + '\'' +
", ownertel='" + ownertel + '\'' +
", area=" + area +
", workhours=" + workhours +
'}';
}
}

View File

@ -0,0 +1,88 @@
package com.ruoyi.crops.domain.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
public class WeatherPredoctionVo {
private String maxAirTemperature;
private String minAirTemperature;
private String maxHumidity;
private String minHumidity;
private String windSpeed;
private String precipitation;
@DateTimeFormat(pattern = "yyyy-MM-dd")//接收时间类型
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")//返回时间类型
private Date weatherTime;
public String getMaxAirTemperature() {
return maxAirTemperature;
}
public void setMaxAirTemperature(String maxAirTemperature) {
this.maxAirTemperature = maxAirTemperature;
}
public String getMinAirTemperature() {
return minAirTemperature;
}
public void setMinAirTemperature(String minAirTemperature) {
this.minAirTemperature = minAirTemperature;
}
public String getMaxHumidity() {
return maxHumidity;
}
public void setMaxHumidity(String maxHumidity) {
this.maxHumidity = maxHumidity;
}
public String getMinHumidity() {
return minHumidity;
}
public void setMinHumidity(String minHumidity) {
this.minHumidity = minHumidity;
}
public String getWindSpeed() {
return windSpeed;
}
public void setWindSpeed(String windSpeed) {
this.windSpeed = windSpeed;
}
public String getPrecipitation() {
return precipitation;
}
public void setPrecipitation(String precipitation) {
this.precipitation = precipitation;
}
public Date getWeatherTime() {
return weatherTime;
}
public void setWeatherTime(Date weatherTime) {
this.weatherTime = weatherTime;
}
@Override
public String toString() {
return "WeatherPredoctionVo{" +
"maxAirTemperature='" + maxAirTemperature + '\'' +
", minAirTemperature='" + minAirTemperature + '\'' +
", maxHumidity='" + maxHumidity + '\'' +
", minHumidity='" + minHumidity + '\'' +
", windSpeed='" + windSpeed + '\'' +
", precipitation='" + precipitation + '\'' +
", weatherTime=" + weatherTime +
'}';
}
}

View File

@ -7,7 +7,17 @@ import java.util.Date;
import java.util.List;
public interface CropsDroughtMapper {
/**
* 批量新增作物长势数据
* @param cropsDroughtList
* @return
*/
public int insertBatch(@Param("list") List<CropsDrought> cropsDroughtList);
/**
* 根据时间查询作物长势数据
* @param time
* @return
*/
List<CropsDrought> selectByTime(Date time);
}

View File

@ -14,7 +14,17 @@ public interface CropsStructureMapper {
*/
public int insertCropsStructure(CropStructure cropStructure);
/**
* 批量新增作物种植结构
* @param list
* @return
*/
public int insertBatch(@Param("list") List<CropStructure> list);
/**
* 根据时间查询作物种植结构
* @param time
* @return
*/
public List<CropStructure> selectByTime(Date time);
}

View File

@ -0,0 +1,47 @@
package com.ruoyi.crops.mapper;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.crops.domain.CropsUser;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface CropsUserMapper {
/**
* 获取用户列表
* @return
*/
List<CropsUser> list();
/**
* 新增用户
* @param cropsUser
* @return
*/
int insert(CropsUser cropsUser);
/**
* 删除用户
* @param id
* @return
*/
int delete(Integer id);
/**
* 修改用户
* @param id
* @return
*/
int update(Integer id);
/**
* 根据id查询用户
* @param phone
* @return
*/
CropsUser selectByPhone(String phone);
CropsUser login(CropsUser user);
int selectCountByName(String userName);
}

View File

@ -7,7 +7,17 @@ import java.util.Date;
import java.util.List;
public interface CropsYieldMapper {
/**
* 根据年份查询
* @param year
* @return
*/
public List<CropsYield> selectByYear(Integer year);
/**
* 批量新增
* @param list
* @return
*/
public int insertBatch(@Param("list") List<CropsYield> list);
}

View File

@ -0,0 +1,15 @@
package com.ruoyi.crops.mapper;
import com.ruoyi.crops.domain.DataAcquisition;
import java.util.List;
public interface DataAcquisitionMapper {
DataAcquisition getData();
int insert(DataAcquisition data);
void analyze();
DataAcquisition getSensorData();
}

View File

@ -15,10 +15,10 @@ public interface DeviceSenseMapper {
List<DeviceSense> selectById(String deviceId);
List<DeviceSense> selectByTime(@Param("startTime") String startTime, @Param("endTime") String endTime);
List<DeviceSense> selectByTime(@Param("startTime") Date startTime, @Param("endTime") Date endTime);
List<DeviceSenseVo> selecthours(@Param("startTime") String startTime, @Param("endTime") String endTime);
List<DeviceSenseVo> selecthours(@Param("startTime") Date startTime, @Param("endTime") Date endTime);
List<DeviceSenseVo> selectdays(@Param("startTime") String startTime, @Param("endTime") String endTime);
List<DeviceSenseVo> selectdays(@Param("startTime") Date startTime, @Param("endTime") Date endTime);
}

View File

@ -0,0 +1,15 @@
package com.ruoyi.crops.mapper;
import com.ruoyi.crops.domain.FarmMachinery;
import com.ruoyi.crops.domain.vo.FarmMachineryVo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface FarmMachineryMapper {
public FarmMachineryVo selectMachineryData(@Param("vehicleno") String vehicleno);
public List<FarmMachineryVo> selectMachineryData();
public int insertBatch(@Param("entities") List<FarmMachinery> farmMachineryList);
}

View File

@ -4,7 +4,7 @@ import com.ruoyi.crops.domain.FertigationSense;
public interface FertigationSenseMapper {
void dedupInsert (FertigationSense fertigationSense);
void dedupInsert(FertigationSense fertigationSense);
int insert(FertigationSense fertigationSense);
}

View File

@ -0,0 +1,15 @@
package com.ruoyi.crops.mapper;
import com.ruoyi.crops.domain.InterfaceStatistics;
import com.ruoyi.crops.domain.vo.InterfaceStatisticsVo;
import java.util.List;
public interface InterfaceStatisticsMapper {
int insert(InterfaceStatistics interfaceStatistics);
InterfaceStatistics selectByDay();
InterfaceStatisticsVo selectTotal();
}

View File

@ -1,11 +0,0 @@
package com.ruoyi.crops.mapper;
import com.ruoyi.crops.domain.MachineParameter;
import java.util.List;
public interface MachineParameterMapper {
List<MachineParameter> selectByName(String name);
int insert(MachineParameter machineParameter);
}

View File

@ -0,0 +1,31 @@
package com.ruoyi.crops.mapper;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.crops.domain.MachineryJobData;
import com.ruoyi.crops.domain.vo.MachineryJobDataVo;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
import java.util.Map;
public interface MachineryJobDataMapper {
int insertBatch(@Param("entities") List<MachineryJobData> list);
List<MachineryJobData> selectByTime(@Param("startTime") Date startTime,@Param("endTime")Date endTime);
List<MachineryJobDataVo> selectMachineryJobData(@Param("startTime") Date startTime,@Param("endTime")Date endTime,@Param("vehicleno") String vehicleno);
List<MachineryJobDataVo> selectMachineryJobData();
void updateAreaWorkhours(@Param("vehicleno")String vehicleno, @Param("workArea") Double workArea, @Param("workhours")Double workhours);
MachineryJobDataVo selectTodayJobData();
/**
* 查询全部农机编号
* @return
*/
List<String> selectVehicleno();
}

View File

@ -0,0 +1,28 @@
package com.ruoyi.crops.mapper;
import com.ruoyi.crops.domain.MachineryPosition;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface MachineryPositionMapper {
/**
* 查询农机在线数量
* @return
*/
public int selectMachineryOnline();
/**
* 插入农机位置
* @param machineryPositions
* @return
*/
public int insertBatch(@Param("entities")List<MachineryPosition> machineryPositions);
/**
* 查询农机作业类型
* @param vehicleno
* @return
*/
int selectJobtype(String vehicleno);
}

View File

@ -0,0 +1,30 @@
package com.ruoyi.crops.mapper;
import com.ruoyi.crops.domain.MachineryTrajectory;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
public interface MachineryTrajectoryMapper {
int insertTrajectory(@Param("entities") List<MachineryTrajectory> tragectory);
List<MachineryTrajectory> selectByVehicleno(String vehicleno);
List<MachineryTrajectory> selectVehicleTrack(@Param("workplace") String workplace, @Param("pttime") Date pttime);
List<String> distinctWorkplace(@Param("vehicleno") String vehicleno);
List<String> distinctWorkplace();
/**
* 查询今日作业农机编号
* @return
*/
List<String> distinctVehicleno();
/**
* 查询正在作业农机数量
* @return
*/
int selectWorkingMachinery();
}

View File

@ -1,6 +1,7 @@
package com.ruoyi.crops.mapper;
import com.ruoyi.crops.domain.Meteorological;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@ -10,5 +11,7 @@ public interface MeteorologicalMapper {
int insert(Meteorological ml);
int insertBatch(@Param("entities") List<Meteorological> ml);
// void insert2(Meteorological ml2);
}

View File

@ -6,13 +6,42 @@ import java.util.List;
public interface ServiceTypeMapper {
/**
* 根据类型查询
*
* @param type
* @return
*/
List<ServiceType> selectByType(String type);
/**
* 新增单条数据
*
* @param serviceType
* @return
*/
int insert(ServiceType serviceType);
/**
* 查询全部数据
*
* @return
*/
List<ServiceType> selectAll();
/**
* 根据id数组删除
*
* @param ids
* @return
*/
int deleteByIds(Long[] ids);
/**
* 查询数据库是否存在相同文件名数据
*
* @param name
* @return
*/
int selectByfile(String name);
}

View File

@ -0,0 +1,14 @@
package com.ruoyi.crops.mapper;
import com.ruoyi.crops.domain.WarningFarm;
import com.ruoyi.crops.domain.WarningInformation;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
public interface WarningFarmMapper {
int insertWarning(WarningFarm warningFarm);
List<WarningFarm> selectByTime(@Param("beginTime") Date beginTime, @Param("endTime") Date endTime);
}

View File

@ -8,7 +8,7 @@ import java.util.Date;
import java.util.List;
public interface WarningMapper {
List<WarningInformation> selectByTime(@Param("startTime") Date startTime,@Param("endTime") Date endTime);
List<WarningInformation> selectByTime(@Param("startTime") Date startTime, @Param("endTime") Date endTime);
int insert(WarningInformation warningInformation);

View File

@ -0,0 +1,22 @@
package com.ruoyi.crops.mapper;
import com.ruoyi.crops.domain.WeatherPredictionEntity;
import com.ruoyi.crops.domain.vo.WeatherPredoctionVo;
import org.springframework.data.repository.query.Param;
import java.util.Date;
import java.util.List;
public interface WeatherPredictionMapper {
int insert(WeatherPredictionEntity weatherPredictionEntity);
int insertBatch(@Param("list") List<WeatherPredictionEntity> list);
List<WeatherPredictionEntity> selectWeek();
List<WeatherPredoctionVo> selectByTime(Date time);
List<WeatherPredictionEntity> select(Date time);
}

View File

@ -0,0 +1,14 @@
package com.ruoyi.crops.runner;
import com.ruoyi.crops.service.impl.FarmMachineryServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;
@Component
public class Runner implements CommandLineRunner {
@Override
public void run(String... args) throws Exception {
// System.out.println("程序初始化");
}
}

View File

@ -8,11 +8,16 @@ import java.util.List;
public interface ICropsGrowthService {
/**
* 批量新增
* 批量新增作物长势数据
* @param cropGrowth
* @return
*/
public int insertBatch(List<CropsGrowth> cropGrowth);
/**
* 根据时间查询作物长势数据
* @param time
* @return
*/
public List<CropsGrowth> selectByTime(Date time);
}

View File

@ -0,0 +1,46 @@
package com.ruoyi.crops.service;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.crops.domain.CropsUser;
import java.util.List;
public interface ICropsUserService {
/**
* 获取全部用户
* @return
*/
List<CropsUser> list();
/**
* 新增用户
* @param cropsUser
* @return
*/
int insert(CropsUser cropsUser);
/**
* 删除用户
* @param id
* @return
*/
int delete(Integer id);
/**
* 修改用户
* @param id
* @return
*/
int update(Integer id);
/**
* 根据id查询用户
* @param phone
* @return
*/
CropsUser selectByPhone(String phone);
CropsUser login(CropsUser user);
int regist(CropsUser cropsUser);
}

View File

@ -6,7 +6,17 @@ import java.util.Date;
import java.util.List;
public interface ICropsYieldService {
/**
* 根据年份查询作物产量
* @param year
* @return
*/
public List<CropsYield> selectByYear(Integer year);
/**
* 批量新增作物产量数据
* @param cropYieldList
* @return
*/
public int insertBatch (List<CropsYield> cropYieldList);
}

View File

@ -0,0 +1,16 @@
package com.ruoyi.crops.service;
import com.ruoyi.crops.domain.DataAcquisition;
import java.io.FileNotFoundException;
import java.util.List;
public interface IDataAcquisitionService {
DataAcquisition getData();
int insert(DataAcquisition data);
DataAcquisition getdataAcquisition();
}

View File

@ -7,14 +7,35 @@ import java.util.Date;
import java.util.List;
public interface IDeviceSenseService {
/**
* 插入设备状态信息
* @param deviceSense
* @return
*/
int insert(DeviceSense deviceSense);
//sql判断重复数据后插入
void dedupInsert(DeviceSense deviceSense);
/**
* 根据id查询设备状态信息
* @param deviceId
* @return
*/
List<DeviceSense> selectById(String deviceId);
List<DeviceSense> selectByTime(String startTime, String endTime);
/**
* 根据时间进行查询设备状态信息
* @param startTime
* @param endTime
* @return
*/
List<DeviceSense> selectByTime(Date startTime, Date endTime);
/**
* 根据类型查询平均数据
* @param type
* @return
*/
List<DeviceSenseVo> averageList(String type);
}

View File

@ -0,0 +1,173 @@
package com.ruoyi.crops.service;
import com.ruoyi.crops.domain.FarmMachinery;
import com.ruoyi.crops.domain.MachineryJobData;
import com.ruoyi.crops.domain.MachineryPosition;
import com.ruoyi.crops.domain.MachineryTrajectory;
import com.ruoyi.crops.domain.vo.FarmMachineryVo;
import com.ruoyi.crops.domain.vo.MachineryJobDataVo;
import org.apache.ibatis.annotations.Param;
import org.locationtech.jts.geom.Coordinate;
import java.util.Date;
import java.util.List;
import java.util.Map;
public interface IFarmMachineryService {
/**
* 将字符串多坐标点转换为坐标数组
*
* @param latLonString "116.616634,40.272665|116.644733,40.280371|116.636181,40.264352|116.616634,40.272665"
* @return org.locationtech.jts.geom.Coordinate[]
*/
public Coordinate[] getCoordinateArray(String latLonString);
/**
* 判断坐标点是否在多坐标点组成的多边形面内
*
* @param coordinateArray
* @param coordinate
* @return boolean
* @author guochao.bj@fang.com
* within 判断是否在内部边缘点返回false
* intersects 判断是否相交,弥补 within边缘点缺陷
*/
public boolean withinAndIntersects(Coordinate[] coordinateArray, Coordinate coordinate);
/**
* @param lnglatPolygon 坐标数组
* @param lng 经度
* @param lat 纬度
* @return
*/
public boolean withinAndIntersects(String lnglatPolygon, double lng, double lat);
/**
* 农机信息查询
* @return
*/
public List<FarmMachineryVo> selectMachineryData();
public FarmMachineryVo selectMachineryData(String vehicleno);
/**
* 在线农机数量查询
* @return
*/
public int selectMachineryOnline();
/**
* 批量插入农机设备信息
* @param farmMachineryList
* @return
*/
public int insertBatch(List<FarmMachinery> farmMachineryList);
/**
* 批量插入农机作业任务
* @param list
* @return
*/
public int insertJobDataBatch(List<MachineryJobData> list);
/**
* 农机作业任务查询
* @param startTime
* @param endTime
* @return
*/
public List<MachineryJobData> selectJobDataByTime(Date startTime,Date endTime);
/**
* 历史作业信息查询
* @param startTime
* @param endTime
* @param vehicleno
* @return
*/
List<MachineryJobDataVo> selectMachineryJobData(Date startTime,Date endTime,String vehicleno);
List<MachineryJobDataVo> selectMachineryJobData();
/**
* 农机轨迹数据分类
* @param machineryTrajectories
* @param vehicleno
* @return
*/
public List<List<MachineryTrajectory>> processPositions(List<MachineryTrajectory> machineryTrajectories,String vehicleno);
/**
* 插入农机轨迹数据
* @param list
* @param vehicleno
* @return
*/
public void insertProcessPositions(List<MachineryTrajectory> list,String vehicleno);
/**
* 查询农机轨迹数据
* @param workplace
* @param pttime
* @return
*/
List<MachineryTrajectory> selectVehicleTrack(String workplace, Date pttime);
/**
* 查询今日作业地块
* @param vehicleno 农机编号(为空查询今日全部)
* @return
*/
List<String> distinctWorkplace(String vehicleno);
List<String> distinctWorkplace();
/**
* 查询今日作业农机编号
* @return
*/
List<String> distinctVehicleno();
/**
* 更新作业面积和时长
* @param vehicleno
* @param area
* @param workingHours
*/
void updateAreaWorkhours(String vehicleno,double area, double workingHours);
/**
* 查询今日作业数据
* @return
*/
MachineryJobDataVo selectTodayJobData();
/**
* 查询正在作业农机数量
*/
int selectWorkingMachinery();
/**
* 插入农机位置
* @param position
*/
void insertPositions(List<MachineryPosition> position);
/**
* 查询农机作业类型
* @param vehicleno
* @return
*/
int selectJobtype(@Param("vehicleno")String vehicleno);
void updateworkplace();
/**
* 查询全部农机编号
* @return
*/
List<String> selectVehicleno();
}

View File

@ -4,6 +4,7 @@ import com.ruoyi.crops.domain.DeviceSense;
import com.ruoyi.crops.domain.FertigationSense;
public interface IFertigationSenseService {
//使用sql判断重复数据插入
void dedupInsert(FertigationSense fertigationSense);
int insert(FertigationSense fertigationSense);
}

View File

@ -1,9 +1,11 @@
package com.ruoyi.crops.service;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.crops.domain.ServiceType;
public interface IGeoServer {
public String GeoServer(String workSpace, String storeName, String filePath) throws Exception;
public String publishTiff(String workSpace, String storeName, String filePath ,String styleName) throws Exception;
public String publishShp(String workSpace, String storeName, String layername, String filePath);
int insert(ServiceType serviceType);
}

View File

@ -1,11 +1,33 @@
package com.ruoyi.crops.service;
import cn.hutool.http.HttpUtil;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.ruoyi.crops.domain.MachineParameter;
import com.ruoyi.crops.domain.UserInfo;
import com.ruoyi.crops.domain.gsonBean.GsonMachineParameterBean;
import com.ruoyi.crops.domain.vo.MachineParameterVo;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public interface IMachineParameterService {
List<MachineParameter> selectByName(String name);
int insert(MachineParameter machineParameter);
/**
* 获取水肥机全部状态参数
* @return
* @throws Exception
*/
public MachineParameter getMachineParameter() throws Exception;
/**
* 获取ph值流量压力值
* @return
* @throws Exception
*/
MachineParameterVo selectParameter() throws Exception;
}

View File

@ -0,0 +1,15 @@
package com.ruoyi.crops.service;
import com.ruoyi.common.utils.MyPoint;
import java.util.List;
public interface IMapDrawPolygonService {
/**
* 根据经纬度数筛选出边界数据
* @param points
* @return
* @throws Exception
*/
public List<MyPoint> DrawPolygon(List<MyPoint> points) throws Exception;
}

View File

@ -6,7 +6,23 @@ import java.util.List;
public interface IMeteorologicalService {
/**
* 根据时间查询
* @return
*/
List<Meteorological> selectByTime();
/**
* 新增单条数据
* @param ml
* @return
*/
int insert(Meteorological ml);
/**
* 批量插入数据
* @param ml
* @return
*/
int insertBatch(List<Meteorological> ml);
}

View File

@ -6,11 +6,30 @@ import java.util.List;
public interface IServiceTypeService {
/**
* 根据类型查询
* @param type
* @return
*/
List<ServiceType> selectByType(String type);
/**
* 新增数据
* @param serviceType
* @return
*/
int insert(ServiceType serviceType);
/**
* 查询全部
* @return
*/
List<ServiceType> selectAll();
/**
* 根据id批量删除
* @param ids
* @return
*/
int deleteByIds(Long[] ids);
}

View File

@ -5,6 +5,12 @@ import org.springframework.web.multipart.MultipartFile;
import java.io.IOException;
public interface IUploadService {
String upload(String type,MultipartFile file, String fileRoot) throws IOException;
/**
* 文件上传
* @param file 文件名
* @param fileRoot 文件路径
* @return
* @throws IOException
*/
String upload(MultipartFile file, String fileRoot) throws IOException;
}

View File

@ -0,0 +1,13 @@
package com.ruoyi.crops.service;
import com.ruoyi.crops.domain.WarningFarm;
import com.ruoyi.crops.domain.WarningInformation;
import java.util.Date;
import java.util.List;
public interface IWarningFarmService {
int insertWarning(WarningFarm warningFarm);
List<WarningFarm> selectByTime(Date beginTime, Date endTime);
}

View File

@ -8,9 +8,9 @@ import java.util.Date;
import java.util.List;
public interface IWarningService {
List<WarningInformation> selectByTime(Date startTime,Date endTime);
List<WarningInformation> selectByTime(Date startTime, Date endTime);
int insert(WarningInformation warningInformation);
int insertWarning(DeviceSense deviceSense);
int judgeWarning(DeviceSense deviceSense);
}

View File

@ -0,0 +1,22 @@
package com.ruoyi.crops.service;
import com.ruoyi.crops.domain.WeatherPredictionEntity;
import com.ruoyi.crops.domain.vo.WeatherPredoctionVo;
import java.io.IOException;
import java.util.Date;
import java.util.List;
public interface IWeatherPredictionService {
public List<WeatherPredictionEntity> getWeather() throws IOException;
public int insert(WeatherPredictionEntity weatherPredictionEntity);
public int insertBatch(List<WeatherPredictionEntity> list);
public List<WeatherPredictionEntity> selectWeek();
List<WeatherPredoctionVo> selectByTime(Date time);
List<WeatherPredictionEntity> select(Date time);
}

View File

@ -0,0 +1,15 @@
package com.ruoyi.crops.service;
import com.ruoyi.crops.domain.InterfaceStatistics;
import com.ruoyi.crops.domain.vo.InterfaceStatisticsVo;
import java.util.List;
public interface InterfaceStatisticsService {
int insert(InterfaceStatistics interfaceStatistics);
InterfaceStatistics selectByDay();
InterfaceStatisticsVo selectTotal();
}

View File

@ -1,5 +1,6 @@
package com.ruoyi.crops.service.impl;
import com.github.pagehelper.PageHelper;
import com.ruoyi.crops.domain.CropsDrought;
import com.ruoyi.crops.domain.CropsYield;
import com.ruoyi.crops.mapper.CropsDroughtMapper;
@ -14,11 +15,22 @@ import java.util.List;
public class CropsDroughtServiceImpl implements ICropsDroughtService {
@Autowired
private CropsDroughtMapper cropsDroughtMapper;
/**
* 批量插入作物旱情数据
* @param cropsYieldList
* @return
*/
@Override
public int insertBatch(List<CropsDrought> cropsYieldList) {
return cropsDroughtMapper.insertBatch(cropsYieldList);
}
/**
* 根据时间查询作物旱情数据
* @param time
* @return
*/
@Override
public List<CropsDrought> selectByTime(Date time) {
return cropsDroughtMapper.selectByTime(time);

View File

@ -13,11 +13,22 @@ import java.util.List;
public class CropsGrowthServiceImpl implements ICropsGrowthService {
@Autowired
private CropsGrowthMapper cropsGrowthMapper;
/**
* 批量新增作物长势数据
* @param cropGrowth
* @return
*/
@Override
public int insertBatch(List<CropsGrowth> cropGrowth) {
return cropsGrowthMapper.insertBatch(cropGrowth);
}
/**
* 根据时间查询作物长势数据
* @param time
* @return
*/
@Override
public List<CropsGrowth> selectByTime(Date time) {
return cropsGrowthMapper.selectByTime(time);

View File

@ -34,6 +34,11 @@ public class CropsStructureServiceImpl implements ICropsStructureService {
return cropsStructureMapper.insertBatch(cropStructureList);
}
/**
* 根据时间查询作物种植结构
* @param time
* @return
*/
@Override
public List<CropStructure> selectByTime(Date time) {
return cropsStructureMapper.selectByTime(time);

View File

@ -0,0 +1,78 @@
package com.ruoyi.crops.service.impl;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.crops.domain.CropsUser;
import com.ruoyi.crops.mapper.CropsUserMapper;
import com.ruoyi.crops.service.ICropsUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class CropsUserServiceImpl implements ICropsUserService {
@Autowired
private CropsUserMapper cropsUserMapper;
/**
* 获取全部用户列表
* @return
*/
@Override
public List<CropsUser> list() {
return cropsUserMapper.list();
}
/**
* 新增用户
* @param cropsUser
* @return
*/
@Override
public int insert(CropsUser cropsUser) {
return cropsUserMapper.insert(cropsUser);
}
/**
* 删除用户
* @param id
* @return
*/
@Override
public int delete(Integer id) {
return cropsUserMapper.delete(id);
}
/**
* 修改用户
* @param id
* @return
*/
@Override
public int update(Integer id) {
return cropsUserMapper.update(id);
}
@Override
public CropsUser selectByPhone(String phone) {
return cropsUserMapper.selectByPhone(phone);
}
@Override
public CropsUser login(CropsUser user) {
return cropsUserMapper.login(user);
}
@Override
public int regist(CropsUser cropsUser) {
CropsUser cnt = cropsUserMapper.selectByPhone(cropsUser.getPhone());
if (cnt!=null){
throw new RuntimeException("手机号已存在");
}
int tmp = cropsUserMapper.selectCountByName(cropsUser.getUserName());
if (tmp == 1){
throw new RuntimeException("用户名已存在");
}
return cropsUserMapper.insert(cropsUser);
}
}

View File

@ -6,18 +6,39 @@ import com.ruoyi.crops.service.ICropsYieldService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
@Service
public class CropsYieldServiceImpl implements ICropsYieldService {
@Autowired
private CropsYieldMapper cropsYieldMapper;
/**
* 根据年份查询作物产量
* @param year
* @return
*/
@Override
public List<CropsYield> selectByYear(Integer year) {
return cropsYieldMapper.selectByYear(year);
List<CropsYield> cropsYields = cropsYieldMapper.selectByYear(year);
for (CropsYield cropsYield : cropsYields) {
switch (cropsYield.getCropType()) {
case "ym":cropsYield.setCropType("玉米");
case "xm":cropsYield.setCropType("小麦");
case "dd":cropsYield.setCropType("大豆");
case "hs":cropsYield.setCropType("花生");
case "qt":cropsYield.setCropType("其他");
}
}
return cropsYields;
}
/**
* 批量新增作物产量数据
* @param cropYieldList
* @return
*/
@Override
public int insertBatch(List<CropsYield> cropYieldList) {
return cropsYieldMapper.insertBatch(cropYieldList);

View File

@ -0,0 +1,63 @@
package com.ruoyi.crops.service.impl;
import com.ruoyi.common.config.RuoYiConfig;
import com.ruoyi.crops.domain.DataAcquisition;
import com.ruoyi.crops.mapper.DataAcquisitionMapper;
import com.ruoyi.crops.service.IDataAcquisitionService;
import org.apache.poi.ss.formula.functions.Now;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.List;
@Service
public class DataAcquisitionServiceImpl implements IDataAcquisitionService {
@Autowired
private DataAcquisitionMapper dataAcquisitionMapper;
long numb = 0;//总大小(字节)
int length = 0;//文件个数
@Override
public DataAcquisition getData() {
return dataAcquisitionMapper.getData();
}
@Override
public int insert(DataAcquisition data) {
return dataAcquisitionMapper.insert(data);
}
@Override
public DataAcquisition getdataAcquisition(){
File file = new File(RuoYiConfig.getUploadPath()+"\\tifFile");
countfile(file);//统计tiff影像文件
//查询前刷新表数据
dataAcquisitionMapper.analyze();
DataAcquisition sensorData = dataAcquisitionMapper.getSensorData();
sensorData.setImageData(length);
sensorData.setImageDataTotal((float)numb / 1024 / 1024);
insert(sensorData);
return sensorData;
}
public void countfile(File fpath){
String path = fpath.getPath();
File file = new File(path); //获取其file对象
File[] fs = file.listFiles(); //遍历path下的文件和目录放在File数组中
length = fs.length;
for (File f : fs) { //遍历File[]数组
if (!f.isDirectory()) //若非目录(即文件),对其进行遍历
{
numb += f.length();//获取文件大小(字节)
} else {
countfile(f);
}
}
}
}

View File

@ -13,6 +13,7 @@ import org.springframework.stereotype.Service;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@ -37,29 +38,45 @@ public class DeviceSenseServiceImpl implements IDeviceSenseService {
deviceSenseMapper.dedupInsert(deviceSense);
}
/**
* 根据设备id查询
* @param deviceId
* @return
*/
@Override
public List<DeviceSense> selectById(String deviceId) {
return deviceSenseMapper.selectById(deviceId);
}
/**
* 根据时间查询设备状态
* @param startTime 开始时间
* @param endTime 结束时间
* @return
*/
@Override
public List<DeviceSense> selectByTime(String startTime, String endTime) {
public List<DeviceSense> selectByTime(Date startTime, Date endTime) {
return deviceSenseMapper.selectByTime(startTime, endTime);
}
/**
* 根据天周月查询设备状态平均值
* @param type
* @return
*/
@Override
public List<DeviceSenseVo> averageList(String type) {
if (type.equals("hours")) {
String dayBegin = new SimpleDateFormat("yyyy-MM-dd").format(DateUtil.getBeginDayOfYesterday());
String dayend = new SimpleDateFormat("yyyy-MM-dd").format(DateUtil.getBeginDayOfTomorrow());
Date dayBegin = DateUtil.getBeginDayOfYesterday();
Date dayend = DateUtil.getBeginDayOfTomorrow();
return deviceSenseMapper.selecthours(dayBegin, dayend);
} else if (type.equals("week")) {
String weekBegin = new SimpleDateFormat("yyyy-MM-dd").format(DateUtil.getBeginDayOfWeek());
String weekEnd = new SimpleDateFormat("yyyy-MM-dd").format(DateUtil.getEndDayOfWeek());
Date weekBegin = DateUtil.getBeginDayOf7day();
Date weekEnd = DateUtil.getDayBegin();
return deviceSenseMapper.selectdays(weekBegin, weekEnd);
} else if (type.equals("month")) {
String monthBegin = new SimpleDateFormat("yyyy-MM-dd").format(DateUtil.getBeginDayOfMonth());
String monthEnd = new SimpleDateFormat("yyyy-MM-dd").format(DateUtil.getEndDayOfMonth());
Date monthBegin = DateUtil.getBeginDayOfMonth();
Date monthEnd = DateUtil.getEndDayOfMonth();
return deviceSenseMapper.selectdays(monthBegin, monthEnd);
}
return null;

View File

@ -12,21 +12,41 @@ public class ExeServiceImpl implements IexeService {
@Override
public String execCommand(String type, String filePath, String boundaryDataPath) {
String path;
if (type.equals("zzjg")) {
path = exePath + "农作物种植结构.exe ";
} else if (type.equals("zwzs")) {
path = exePath + "农作物长势.exe ";
} else if (type.equals("zwhq")) {
path = exePath + "农作物旱情.exe ";
} else if (type.equals("zyzd_hq")) {
path = exePath + "旱情指导.exe ";
} else if (type.equals("zyzd_zs")) {
path = exePath + "长势指导.exe ";
} else {
path = exePath + "农作物产量.exe ";
String path = "";
String yieldType = "";
switch (type) {
case "zzjg":
path = exePath + "农作物种植结构.exe ";
break;
case "zwzs":
path = exePath + "农作物长势.exe ";
break;
case "zwhq":
path = exePath + "农作物旱情.exe ";
break;
case "zwcl_ym":
path = exePath + "农作物产量.exe ";
yieldType = " '玉米'";
break;
case "zwcl_xm":
path = exePath + "农作物产量.exe ";
yieldType = " '小麦'";
break;
case "zwcl_qt":
path = exePath + "农作物产量.exe ";
yieldType = " '其他'";
break;
case "zwcl_hs":
path = exePath + "农作物产量.exe ";
yieldType = " '花生'";
break;
case "zwcl_dd":
path = exePath + "农作物产量.exe ";
yieldType = " '大豆'";
break;
default:return " 未执行exe";
}
return BashUtils.execCommand(path + "\"" + filePath + "\"" + " \"" + boundaryDataPath + "\"");
return BashUtils.execCommand(path + "\"" + filePath + "\"" + " \"" + boundaryDataPath + "\"" + yieldType);
}
}

View File

@ -0,0 +1,372 @@
package com.ruoyi.crops.service.impl;
import com.ruoyi.crops.domain.FarmMachinery;
import com.ruoyi.crops.domain.MachineryJobData;
import com.ruoyi.crops.domain.MachineryPosition;
import com.ruoyi.crops.domain.MachineryTrajectory;
import com.ruoyi.crops.domain.vo.FarmMachineryVo;
import com.ruoyi.crops.domain.vo.MachineryJobDataVo;
import com.ruoyi.crops.mapper.FarmMachineryMapper;
import com.ruoyi.crops.mapper.MachineryJobDataMapper;
import com.ruoyi.crops.mapper.MachineryPositionMapper;
import com.ruoyi.crops.mapper.MachineryTrajectoryMapper;
import com.ruoyi.crops.service.IFarmMachineryService;
import org.locationtech.jts.geom.Coordinate;
import org.locationtech.jts.geom.GeometryFactory;
import org.locationtech.jts.geom.Point;
import org.locationtech.jts.geom.Polygon;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;
import java.util.*;
@Service
public class FarmMachineryServiceImpl implements IFarmMachineryService {
// private int lastProcessedIndex = -1;
private List<MachineryTrajectory> previousGroup = null;
private static int workplace;
@Autowired
private MachineryTrajectoryMapper machineryTrajectoryMapper;
@Autowired
private FarmMachineryMapper farmMachineryMapper;
@Autowired
private MachineryPositionMapper machineryPositionMapper;
@Autowired
private MachineryJobDataMapper machineryJobDataMapper;
@Override
public void updateworkplace(){
workplace=64;
}
/**
* 查询全部农机编号
* @return
*/
@Override
public List<String> selectVehicleno() {
return machineryJobDataMapper.selectVehicleno();
}
/**
* 将字符串多坐标点转换为坐标数组
*
* @param latLonString "116.616634,40.272665|116.644733,40.280371|116.636181,40.264352|116.616634,40.272665"
* @return org.locationtech.jts.geom.Coordinate[]
*/
@Override
public Coordinate[] getCoordinateArray(String latLonString) {
String[] split = latLonString.split("\\|");
Coordinate[] coordinateArray = new Coordinate[split.length];
for (int i = 0; i < split.length; i++) {
String[] LatLng = split[i].split(",");
Coordinate coordinate = new Coordinate(Double.valueOf(LatLng[0]), Double.valueOf(LatLng[1]));
coordinateArray[i] = coordinate;
}
return coordinateArray;
}
/**
* 判断坐标点是否在多坐标点组成的多边形面内
*
* @param coordinateArray
* @param coordinate
* @return boolean
* @author guochao.bj@fang.com
* within 判断是否在内部边缘点返回false
* intersects 判断是否相交,弥补 within边缘点缺陷
*/
@Override
public boolean withinAndIntersects(Coordinate[] coordinateArray, Coordinate coordinate) {
boolean result = false;
//小于3个点无法组成多边形
if (coordinateArray.length < 3) {
return result;
}
//必须首尾坐标点相同组成闭合多边形
if (!(coordinateArray[0].equals2D(coordinateArray[coordinateArray.length - 1]))) {
return result;
}
GeometryFactory geometryFactory = new GeometryFactory();
Point point = geometryFactory.createPoint(coordinate);
Polygon polygon = geometryFactory.createPolygon(coordinateArray);
if (point.within(polygon) || point.intersects(polygon)) {
result = true;
}
return result;
}
/**
* @param lnglatPolygon 坐标数组
* @param lng 经度
* @param lat 纬度
* @return
*/
@Override
public boolean withinAndIntersects(String lnglatPolygon, double lng, double lat) {
Coordinate[] latLonMap = getCoordinateArray(lnglatPolygon);
Coordinate coordinate = new Coordinate(lng, lat);
boolean within = withinAndIntersects(latLonMap, coordinate);
return within;
}
/**
* 农机设备信息查询
*
* @return
*/
@Override
public List<FarmMachineryVo> selectMachineryData() {
return farmMachineryMapper.selectMachineryData();
}
@Override
public FarmMachineryVo selectMachineryData(String vehicleno) {
return farmMachineryMapper.selectMachineryData(vehicleno);
}
/**
* 查询农机在线数量
*
* @return
*/
@Override
public int selectMachineryOnline() {
return machineryPositionMapper.selectMachineryOnline();
}
/**
* 批量插入农机设备信息
*
* @param farmMachineryList
* @return
*/
@Override
public int insertBatch(List<FarmMachinery> farmMachineryList) {
return farmMachineryMapper.insertBatch(farmMachineryList);
}
/**
* 批量插入农机作业任务
*
* @param list
* @return
*/
@Override
public int insertJobDataBatch(List<MachineryJobData> list) {
return machineryJobDataMapper.insertBatch(list);
}
/**
* 农机作业任务查询
*
* @param startTime 开始时间
* @param endTime 结束时间
* @return
*/
@Override
public List<MachineryJobData> selectJobDataByTime(Date startTime, Date endTime) {
return machineryJobDataMapper.selectByTime(startTime, endTime);
}
/**
* 历史作业信息查询
*
* @param startTime
* @param endTime
* @param vehicleno
* @return
*/
@Override
public List<MachineryJobDataVo> selectMachineryJobData(Date startTime, Date endTime, String vehicleno) {
return machineryJobDataMapper.selectMachineryJobData(startTime, endTime, vehicleno);
}
@Override
public List<MachineryJobDataVo> selectMachineryJobData() {
return machineryJobDataMapper.selectMachineryJobData();
}
/**
* 农机轨迹数据分类
*
* @param machineryTrajectories
* @param vehicleno
* @return
*/
@Override
public List<List<MachineryTrajectory>> processPositions(List<MachineryTrajectory> machineryTrajectories, String vehicleno) {
List<List<MachineryTrajectory>> result = new ArrayList<>();
List<MachineryTrajectory> currentGroup = null;
boolean isPreviousWork = false;
//判断第一次分组后结果如果上次分组不为空并且等于1那么就和上次查询分组放在一起
if (previousGroup != null && !previousGroup.isEmpty() && previousGroup.get(previousGroup.size() - 1).getIswork() == 1) {
isPreviousWork = true;
currentGroup = previousGroup;
}
for (int i = 0; i < machineryTrajectories.size(); i++) {
MachineryTrajectory machineryTrajectory = machineryTrajectories.get(i);
if (machineryTrajectory.getIswork() == 1 && machineryTrajectory.getCourse() != 0) {
if (!isPreviousWork) {
//记录工作地块
workplace++;
currentGroup = new ArrayList<>();
result.add(currentGroup);
}
machineryTrajectory.setWorkplace(String.valueOf((char) workplace));
machineryTrajectory.setVehicleno(vehicleno);
currentGroup.add(machineryTrajectory);
isPreviousWork = true;
} else {
isPreviousWork = false;
currentGroup = null;
}
// lastProcessedIndex = i;
}
if (currentGroup != null && !currentGroup.isEmpty() && currentGroup.get(currentGroup.size() - 1).getIswork() == 1) {
previousGroup = currentGroup;
} else {
previousGroup = null;
}
return result;
}
/**
* 插入作业轨迹数据
* @param list
* @param vehicleno
*/
@Override
public void insertProcessPositions(List<MachineryTrajectory> list, String vehicleno) {
//对轨迹数据进行分组
List<List<MachineryTrajectory>> result = processPositions(list, vehicleno);
for (List<MachineryTrajectory> machineryTrajectories : result) {
List<MachineryTrajectory> res = new ArrayList<>();
//数据抽稀每隔十条数据取出一条
for (int i = 0; i < machineryTrajectories.size(); i += 10) {
res.add(machineryTrajectories.get(i));
}
//点位小于3过滤掉
if (res.size() <= 3) {
continue;
}
//判断数据库里重复数据
List<MachineryTrajectory> mt = machineryTrajectoryMapper
.selectByVehicleno(machineryTrajectories.get(machineryTrajectories.size() - 1).getVehicleno());
for (int j = 0; j < res.size(); j++) {
MachineryTrajectory machineryTrajectory = res.get(j);
for (MachineryTrajectory trajectory : mt) {
if (machineryTrajectory.getLng() == trajectory.getLng() && machineryTrajectory.getLat() == trajectory.getLat()) {
res.remove(j);
j--;
}
}
}
//将结果插入数据库
if (!res.isEmpty()) {
machineryTrajectoryMapper.insertTrajectory(res);
}
}
}
/**
* 查询农机轨迹数据
* @param workplace
* @param pttime
* @return
*/
@Override
public List<MachineryTrajectory> selectVehicleTrack(String workplace, Date pttime) {
return machineryTrajectoryMapper.selectVehicleTrack(workplace, pttime);
}
/**
* 查询今日作业地块
* @param vehicleno 农机编号(为空查询今日全部)
* @return
*/
@Override
public List<String> distinctWorkplace(String vehicleno) {
return machineryTrajectoryMapper.distinctWorkplace(vehicleno);
}
@Override
public List<String> distinctWorkplace() {
return machineryTrajectoryMapper.distinctWorkplace();
}
/**
* 查询今日作业农机编号
*
* @return
*/
@Override
public List<String> distinctVehicleno() {
return machineryTrajectoryMapper.distinctVehicleno();
}
/**
* 更新农机作业面积,作业时间
*
* @param area
* @param workingHours
* @param vehicleno
*/
@Override
public void updateAreaWorkhours(String vehicleno, double area, double workingHours) {
machineryJobDataMapper.updateAreaWorkhours(vehicleno, area, workingHours);
}
/**
* 查询今日作业数据
* @return
*/
@Override
public MachineryJobDataVo selectTodayJobData() {
return machineryJobDataMapper.selectTodayJobData();
}
/**
* 查询正在工作农机数量
* @return
*/
@Override
public int selectWorkingMachinery() {
return machineryTrajectoryMapper.selectWorkingMachinery();
}
/**
* 插入农机位置
* @param position
*/
@Override
public void insertPositions(List<MachineryPosition> position) {
machineryPositionMapper.insertBatch(position);
}
/**
* 查询农机作业类型
* @param vehicleno
* @return
*/
@Override
public int selectJobtype(String vehicleno) {
return machineryPositionMapper.selectJobtype(vehicleno);
}
}

View File

@ -5,7 +5,6 @@ import com.ruoyi.crops.domain.FertigationSense;
import com.ruoyi.crops.mapper.FertigationSenseMapper;
import com.ruoyi.crops.service.IFertigationSenseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;
@Service

View File

@ -5,17 +5,22 @@ import com.ruoyi.crops.mapper.ServiceTypeMapper;
import com.ruoyi.crops.service.IGeoServer;
import it.geosolutions.geoserver.rest.GeoServerRESTManager;
import it.geosolutions.geoserver.rest.GeoServerRESTPublisher;
import it.geosolutions.geoserver.rest.GeoServerRESTReader;
import it.geosolutions.geoserver.rest.decoder.RESTDataStore;
import it.geosolutions.geoserver.rest.encoder.GSLayerEncoder;
import it.geosolutions.geoserver.rest.encoder.GSResourceEncoder;
import it.geosolutions.geoserver.rest.encoder.datastore.GSGeoTIFFDatastoreEncoder;
import it.geosolutions.geoserver.rest.manager.GeoServerRESTStyleManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.io.File;
import java.net.URL;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Service
public class GeoServerImpl implements IGeoServer {
@ -26,15 +31,13 @@ public class GeoServerImpl implements IGeoServer {
private String username;
@Value("${geoserver.password}")
private String password;
private static final Logger logger = LoggerFactory.getLogger(GeoServerImpl.class);
@Autowired
private ServiceTypeMapper serviceTypeMapper;
@Override
public String GeoServer(String workSpace, String storeName, String filePath) throws Exception {
//待创建和发布图层的工作区名称workspace
//待创建和发布图层的数据存储名称store
public String publishTiff(String workSpace, String storeName, String filePath, String styleName) throws Exception {
String result="";
//判断工作区workspace是否存在不存在则创建
URL u = new URL(url);
GeoServerRESTManager manager = new GeoServerRESTManager(u, username, password);
@ -42,29 +45,62 @@ public class GeoServerImpl implements IGeoServer {
List<String> workspaces = manager.getReader().getWorkspaceNames();
if (!workspaces.contains(workSpace)) {
boolean createws = publisher.createWorkspace(workSpace);
System.out.println("create ws : " + createws);
} else {
System.out.println("workspace已经存在了,ws :" + workSpace);
logger.info("create ws : " + createws);
}
try {
//判断数据存储datastore是否已经存在不存在则创建
RESTDataStore restStore = manager.getReader().getDatastore(workSpace, storeName);
if (restStore == null) {
GSGeoTIFFDatastoreEncoder gsGeoTIFFDatastoreEncoder = new GSGeoTIFFDatastoreEncoder(storeName);
gsGeoTIFFDatastoreEncoder.setWorkspaceName(workSpace);
gsGeoTIFFDatastoreEncoder.setUrl(new URL("file:" + filePath));
boolean createStore = manager.getStoreManager().create(workSpace, gsGeoTIFFDatastoreEncoder);
logger.info("create store (TIFF文件创建状态) : " + createStore);
//判断数据存储datastore是否已经存在不存在则创建
boolean publish = manager.getPublisher().publishGeoTIFF(workSpace, storeName, storeName,new File(filePath),"EPSG:4326",
GSResourceEncoder.ProjectionPolicy.FORCE_DECLARED,styleName,null);
logger.info("publish (TIFF文件发布状态) : " + publish);
RESTDataStore restStore = manager.getReader().getDatastore(workSpace, storeName);
if (restStore == null) {
GSGeoTIFFDatastoreEncoder gsGeoTIFFDatastoreEncoder = new GSGeoTIFFDatastoreEncoder(storeName);
gsGeoTIFFDatastoreEncoder.setWorkspaceName(workSpace);
gsGeoTIFFDatastoreEncoder.setUrl(new URL("file:" + filePath));
boolean createStore = manager.getStoreManager().create(workSpace, gsGeoTIFFDatastoreEncoder);
System.out.println("create store (TIFF文件创建状态) : " + createStore);
boolean publish = manager.getPublisher().publishGeoTIFF(workSpace, storeName, new File(filePath));
System.out.println("publish (TIFF文件发布状态) : " + publish);
return "create store (TIFF文件创建状态) : " + createStore + " publish (TIFF文件发布状态) : " + publish;
} else {
System.out.println("数据存储已经存在了,store:" + storeName);
result = "create store (TIFF文件创建状态) : " + createStore + " publish (TIFF文件发布状态) : " + publish;
} else {
result = "数据存储已经存在了,store:" + storeName;
}
}catch (Exception e){
e.printStackTrace();
}
return null;
return result;
}
@Override
public String publishShp(String workSpace, String storeName, String layername, String filePath) {
String result="";
try {
File zipFile=new File(filePath);
GeoServerRESTReader reader = new GeoServerRESTReader(url, username, password);
GeoServerRESTPublisher publisher = new GeoServerRESTPublisher(url, username, password);
List<String> workspaces=reader.getWorkspaceNames();
// 判断工作空间和图层是否存在
boolean existsStore = reader.existsDatastore(workSpace, storeName);
boolean existsLayer = reader.existsLayer(workSpace, layername);
if (existsStore||existsLayer){
logger.info("工作空间存在:"+existsStore+"图层存在:"+existsLayer);
boolean removeLayer = publisher.removeLayer(workSpace, layername);
boolean removeStore = publisher.removeDatastore(workSpace, storeName, true);
logger.info("删除工作空间:"+removeStore+"删除图层:"+removeLayer);
}
if(workspaces.contains(workSpace)){
if(publisher.publishShp(workSpace, storeName, layername, zipFile, "EPSG:4326")){
result = "发布成功!";
} else {
result = "发布失败!";
}
}
}catch (Exception e){
e.printStackTrace();
}
return result;
}
@Override

View File

@ -0,0 +1,187 @@
package com.ruoyi.crops.service.impl;
import com.ruoyi.crops.domain.WeatherPredictionEntity;
import com.ruoyi.crops.domain.vo.WeatherPredoctionVo;
import com.ruoyi.crops.mapper.WeatherPredictionMapper;
import com.ruoyi.crops.service.IWeatherPredictionService;
import org.jsoup.Connection;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.nodes.Node;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.io.IOException;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.*;
@Service
public class IWeatherPredictionServiceImpl implements IWeatherPredictionService {
@Autowired
private WeatherPredictionMapper weatherPredictionMapper;
@Override
public List<WeatherPredictionEntity> getWeather() throws IOException {
// 目标网页中国气象局
String testURL = "https://weather.cma.cn/web/weather/54737.html";
Connection con = Jsoup.connect(testURL);
// 选择发送方式,获取整个网页信息存在documnet类里
Document document = con.get();
// 定义天气日期列表
List<LocalDate> weatherDayList = new ArrayList<>();
// 定义天气名称列表
List<String> weatherNameList = new ArrayList<>();
// 获取当前日期
LocalDate dateNow = LocalDate.now();
DateTimeFormatter dfDate = DateTimeFormatter.ofPattern("yyyy-MM-dd");
LocalDate lastDate = dateNow.minusDays(1);
;
DateTimeFormatter dfDateTime = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm");
// 获取日期列表
List<Node> dayList = Objects.requireNonNull(document.body().getElementById("dayList")).childNodes();
for (Node node : dayList) {
if (node != null && !node.toString().equals("")) {
String datStr = dateNow.getYear() + "-" + node.childNode(1).childNode(2).toString().
replaceAll("\r|\n", "").replaceAll("/", "-");
String weatherName = node.childNode(5).childNode(0).toString().replaceAll("\r|\n", "");
LocalDate dateDay = LocalDate.parse(datStr, dfDate);
// 如果日期未按顺序排列,则发生跨年,年份加一
if (lastDate.isAfter(dateDay)) {
dateDay = dateDay.plusYears(1);
}
lastDate = dateDay;
weatherDayList.add(dateDay);
weatherNameList.add(weatherName);
}
}
// 定义天气变量列表
List<LocalDateTime> weatherTimeList = new ArrayList<>();
List<String> airTemperatureList = new ArrayList<>();
List<String> precipitationList = new ArrayList<>();
List<String> windSpeedList = new ArrayList<>();
List<String> windDirectionList = new ArrayList<>();
List<String> atmosphericPressureList = new ArrayList<>();
List<String> humidityList = new ArrayList<>();
List<String> cloudCoverList = new ArrayList<>();
// 获取分小时气象信息
List<Element> hourTableList = new ArrayList<>(Arrays.asList(document.body().getElementById("hourTable_0"),
document.body().getElementById("hourTable_1"), document.body().getElementById("hourTable_2"),
document.body().getElementById("hourTable_3"), document.body().getElementById("hourTable_4"),
document.body().getElementById("hourTable_5"), document.body().getElementById("hourTable_6")
));
// 获取当前时间
LocalDateTime dateTimeNow = LocalDateTime.now();
int m = 0;
// 获取逐天分小时气象信息表格数据
for (Element elementList : hourTableList) {
List<Node> nodeList = elementList.childNode(1).childNodes();
LocalDateTime lastDateTime = dateTimeNow.minusMinutes(180);
int n = 0;
for (Node node : nodeList) {
if (node != null && !node.toString().equals("")) {
List<Node> nodeList2 = node.childNodes();
for (Node node2 : nodeList2) {
if (node2 != null && !node2.toString().equals("")) {
n = n + 1;
// 如果多于一个节点
if (node2.childNodes().size() > 1) {
List<?> list = new ArrayList<>();
list = new ArrayList<>(new LinkedHashSet<>(list));
} else {
// 如果是单一节点,获取该节点的值
if (n > 1 && n < 10) {
String dateTimeStr = weatherDayList.get(m) + " " + node2.childNode(0);
LocalDateTime localDateTime = LocalDateTime.parse(dateTimeStr, dfDateTime);
// 若跨日,日期加一
if (lastDateTime.isAfter(localDateTime)) {
localDateTime = localDateTime.plusDays(1);
}
weatherTimeList.add(localDateTime);
lastDateTime = localDateTime;
}
if (n > 10 && n < 19) {
weatherNameList.add(node2.childNode(0).toString());
}
if (n > 19 && n < 28) {
airTemperatureList.add(node2.childNode(0).toString());
}
if (n > 28 && n < 37) {
precipitationList.add(node2.childNode(0).toString());
}
if (n > 37 && n < 46) {
windSpeedList.add(node2.childNode(0).toString());
}
if (n > 46 && n < 55) {
windDirectionList.add(node2.childNode(0).toString());
}
if (n > 55 && n < 64) {
atmosphericPressureList.add(node2.childNode(0).toString());
}
if (n > 64 && n < 73) {
humidityList.add(node2.childNode(0).toString());
}
if (n > 73 && n < 82) {
cloudCoverList.add(node2.childNode(0).toString());
}
}
}
}
}
}
m = m + 1;
}
List<WeatherPredictionEntity> weatherPredictionEntityArrayList = new ArrayList<>();
// 长度固定 8*7 = 56
int len = 8 * 7;
for (int i = 0; i < len; i++) {
WeatherPredictionEntity weatherPredictionEntity = new WeatherPredictionEntity();
weatherPredictionEntity.setWeatherName(weatherNameList.get(i / 8));
weatherPredictionEntity.setWeatherTime(weatherTimeList.get(i));
weatherPredictionEntity.setAirTemperature(airTemperatureList.get(i));
weatherPredictionEntity.setPrecipitation(precipitationList.get(i));
weatherPredictionEntity.setWindSpeed(windSpeedList.get(i));
weatherPredictionEntity.setWindDirection(windDirectionList.get(i));
weatherPredictionEntity.setAtmosphericPressure(atmosphericPressureList.get(i));
weatherPredictionEntity.setHumidity(humidityList.get(i));
weatherPredictionEntity.setCloudCover(cloudCoverList.get(i));
weatherPredictionEntityArrayList.add(weatherPredictionEntity);
}
return weatherPredictionEntityArrayList;
}
@Override
public int insert(WeatherPredictionEntity weatherPredictionEntity) {
return weatherPredictionMapper.insert(weatherPredictionEntity);
}
@Override
public int insertBatch(List<WeatherPredictionEntity> list) {
return weatherPredictionMapper.insertBatch(list);
}
@Override
public List<WeatherPredictionEntity> selectWeek() {
return weatherPredictionMapper.selectWeek();
}
@Override
public List<WeatherPredoctionVo> selectByTime(Date time) {
return weatherPredictionMapper.selectByTime(time);
}
@Override
public List<WeatherPredictionEntity> select(Date time) {
return weatherPredictionMapper.select(time);
}
}

View File

@ -0,0 +1,31 @@
package com.ruoyi.crops.service.impl;
import com.ruoyi.crops.domain.InterfaceStatistics;
import com.ruoyi.crops.domain.vo.InterfaceStatisticsVo;
import com.ruoyi.crops.mapper.InterfaceStatisticsMapper;
import com.ruoyi.crops.service.InterfaceStatisticsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class InterfaceStatisticsServiceImpl implements InterfaceStatisticsService {
@Autowired
private InterfaceStatisticsMapper interfaceStatisticsMapper;
@Override
public int insert(InterfaceStatistics interfaceStatistics) {
return interfaceStatisticsMapper.insert(interfaceStatistics);
}
@Override
public InterfaceStatistics selectByDay() {
return interfaceStatisticsMapper.selectByDay();
}
@Override
public InterfaceStatisticsVo selectTotal() {
return interfaceStatisticsMapper.selectTotal();
}
}

View File

@ -1,24 +1,101 @@
package com.ruoyi.crops.service.impl;
import cn.hutool.http.HttpUtil;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.ruoyi.crops.domain.MachineParameter;
import com.ruoyi.crops.mapper.MachineParameterMapper;
import com.ruoyi.crops.domain.UserInfo;
import com.ruoyi.crops.domain.gsonBean.GsonMachineParameterBean;
import com.ruoyi.crops.domain.vo.MachineParameterVo;
import com.ruoyi.crops.service.IMachineParameterService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Service
public class MachineParameterServiceImpl implements IMachineParameterService {
@Autowired
private MachineParameterMapper machineParameterMapper;
private RedisTemplate redisTemplate;
@Value("${url.machine}")
private String url;
/**
* 获取水肥机全部状态参数
* @return
* @throws Exception
*/
@Override
public List<MachineParameter> selectByName(String name) {
return machineParameterMapper.selectByName(name);
public MachineParameter getMachineParameter() throws Exception {
Map<String, Object> map = new HashMap<>();//存放参数
UserInfo userInfo = (UserInfo) redisTemplate.opsForValue().get("cropsUserInfo");
// map.put("id", userInfo.getId());
map.put("id", "7f3f70c7cd134881b84d1db36b20c416");
map.put("deviceId", "00093495000000000002");
HashMap<String, String> headers = new HashMap<>();//存放请求头,可以存放多个请求头
// headers.put("token", userInfo.getToken());
headers.put("token", "BAC5284E7938B521E888E9B3CB6B5DA9");
//发送get请求并接收响应数据
String result = HttpUtil.createGet(url).addHeaders(headers).form(map).execute().body();
Gson gson = new GsonBuilder().setDateFormat("yyyy/MM/dd HH:mm:ss").create();
//格式化json封装到GsonDeviceSenseBean类型
GsonMachineParameterBean model = gson.fromJson(result, GsonMachineParameterBean.class);
MachineParameter machineParameter = new MachineParameter();
//反射获取data里所有对象
Field[] field = model.data.getClass().getDeclaredFields();
for (int i = 0; i < field.length - 1; i++) {
//遍历对象的属性名
String name = field[i].getName();
//获取相应对象的get方法
Method m = model.data.getClass().getMethod("get" + name);
//执行get方法得到property对象
GsonMachineParameterBean.property value = (GsonMachineParameterBean.property) m.invoke(model.data);
//获取property对象里的value
String propertyValve = value.propertyValve;
if (propertyValve != null) {
//获取要set对象的对应类型
Field f = machineParameter.getClass().getDeclaredField(name);
String type = f.getType().getName();
Class[] classes = new Class[0];
Object[] objects = new Object[0];
if (type.equals("java.lang.Double")) {
classes = new Class[]{Double.class};
objects = new Object[]{new Double(Double.parseDouble(propertyValve))};
} else if (type.equals("java.lang.String")) {
classes = new Class[]{String.class};
objects = new Object[]{new String(propertyValve)};
}
Method mset = machineParameter.getClass().getMethod("set" + name, classes);
mset.invoke(machineParameter, objects);
}
}
return machineParameter;
}
/**
* 获取ph值流量压力值
* @return
* @throws Exception
*/
@Override
public int insert(MachineParameter machineParameter) {
return machineParameterMapper.insert(machineParameter);
public MachineParameterVo selectParameter() throws Exception {
MachineParameter machineParameter = getMachineParameter();
MachineParameterVo vo = new MachineParameterVo();
BeanUtils.copyProperties(machineParameter,vo);
return vo;
}
}

View File

@ -0,0 +1,154 @@
package com.ruoyi.crops.service.impl;
import com.ruoyi.common.utils.MyPoint;
import com.ruoyi.crops.service.IMapDrawPolygonService;
import org.springframework.stereotype.Service;
import java.util.*;
import java.util.stream.Collectors;
@Service
public class MapDrawPolygonServiceImpl implements IMapDrawPolygonService {
// public String DrawPolygon(List<MyPoint> points) {
//
// String wkt = point2WktPolygon(convexHull(points));
//// AjaxResult a = new AjaxResult();
//// a.put("WKT",wkt);
//// a.put("area",getAreaByWkt(wkt));
//// return AjaxResult.success(a);
// return wkt;
// }
@Override
public List<MyPoint> DrawPolygon(List<MyPoint> points) {
return convexHull(points);
}
public static List<MyPoint> convexHull(List<MyPoint> points) {
//小于三个点的情况,直接返回
if (points.size() < 3) {
return points;
}
MyPoint first = points.get(0);
// 找到最左下角的点
for (int i = 0; i < points.size(); i++) {
if (points.get(i).getY() < first.getY() || (points.get(i).getY() == first.getY() && points.get(i).getX() < first.getX())) {
first = points.get(i);
}
}
List<MyPoint> sortedList = angleSorting(first, points);
// logger.info("凸包计算-最下面偏左的点位是:{}", first);
// logger.info("凸包计算-角排序结果:{}", JSONObject.toJSONString(sortedList));
int firstIndex = 0;
for (int i = 0; i < sortedList.size(); i++) {
if (first.getX() == sortedList.get(i).getX() && first.getY() == sortedList.get(i).getY()) {
firstIndex = i;
}
}
// 结果集合
List<MyPoint> convexHullPoints = new ArrayList<>();
convexHullPoints.add(first);
int nextIndex = firstIndex + 1 == sortedList.size() ? 0 : firstIndex + 1;
MyPoint next = new MyPoint();
while (next != first) {
next = sortedList.get(nextIndex);
while (true) {
if (convexHullPoints.size() < 2) {
convexHullPoints.add(next);
break;
}
if (isEnabled(convexHullPoints.get(convexHullPoints.size() - 2), convexHullPoints.get(convexHullPoints.size() - 1), next)) {
convexHullPoints.add(next);
break;
} else {
convexHullPoints.remove(convexHullPoints.size() - 1);
}
}
nextIndex = nextIndex + 1 == sortedList.size() ? 0 : nextIndex + 1;
}
convexHullPoints = convexHullPoints.stream().distinct().collect(Collectors.toList());
// logger.info("凸包计算-结果:{}", JSONObject.toJSONString(convexHullPoints));
// logger.info("凸包结算-结果绘制成线:{}", point2WktLine(convexHullPoints));
return convexHullPoints;
}
public static boolean isEnabled(MyPoint A, MyPoint B, MyPoint C) {
double mulCross = A.getX() * B.getY() - A.getY() * B.getX() + B.getX() * C.getY() - B.getY() * C.getX() + C.getX() * A.getY() - C.getY() * A.getX();
if (mulCross >= 0) {
return true;
} else {
return false;
}
}
public static class MyHashMap<k,v> extends HashMap{
@Override
public Object put(Object key, Object value) {
if (containsKey(key)){
return null;
}
return super.put(key, value);
}
}
/**
* 以原点为中心进行角排序
*
* @param points 点位
* @return 排序的点位
*/
public static List<MyPoint> angleSorting(MyPoint first, List<MyPoint> points) {
points = points.stream().sorted(Comparator.comparing(MyPoint::getX)).collect(Collectors.toList());
points = points.stream().sorted(Comparator.comparing(MyPoint::getY)).collect(Collectors.toList());
MyHashMap<Double, MyPoint> pointMap = new MyHashMap<>();
List<Double> angles = new ArrayList<>();
for (MyPoint point : points) {
double angle = Math.atan2(point.getY() - first.getY(), point.getX() - first.getX()) * 180.0 / Math.PI;
if (angle < 0) {
angle += 360.0;
}
pointMap.put(angle, point);
angles.add(angle);
}
angles = angles.stream().sorted().collect(Collectors.toList());
List<MyPoint> result = new ArrayList<>();
for (Double angle : angles) {
result.add((MyPoint) pointMap.get(angle));
}
// result.add(first);
return result;
}
public static String point2WktPolygon(List<MyPoint> points) {
StringBuilder sb = new StringBuilder("POLYGON((");
for (MyPoint point : points) {
sb.append(point.getX()).append(" ").append(point.getY()).append(",");
}
sb.append(points.get(0).getX()).append(" ").append(points.get(0).getY()).append("))");
return sb.toString();
}
public static String point2WktLine(List<MyPoint> points) {
StringBuilder sb = new StringBuilder("LINESTRING(");
for (MyPoint point : points) {
sb.append(point.getX()).append(" ").append(point.getY()).append(", ");
}
sb.append(points.get(0).getX()).append(" ").append(points.get(0).getY()).append(")");
return sb.toString();
}
public static String point2WktPoint(List<MyPoint> points) {
StringBuilder sb = new StringBuilder("MULTIPOINT(");
for (MyPoint point : points) {
sb.append(point.getX()).append(" ").append(point.getY()).append(", ");
}
sb.append(points.get(0).getX()).append(" ").append(points.get(0).getY()).append(")");
return sb.toString();
}
}

View File

@ -13,14 +13,33 @@ public class MeteorologicalServiceImpl implements IMeteorologicalService {
@Autowired
private MeteorologicalMapper meteorologicalMapper;
/**
* 根据时间查询
* @return
*/
@Override
public List<Meteorological> selectByTime() {
return meteorologicalMapper.selectbyTime();
}
/**
* 新增单条数据
* @param ml
* @return
*/
@Override
public int insert(Meteorological ml) {
return meteorologicalMapper.insert(ml);
}
/**
* 批量新增数据
* @param ml
* @return
*/
@Override
public int insertBatch(List<Meteorological> ml) {
return meteorologicalMapper.insertBatch(ml);
}
}

View File

@ -9,9 +9,10 @@ import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class OperationRecordsServiceImppl implements IOperationRecordsService {
public class OperationRecordsServiceImpl implements IOperationRecordsService {
@Autowired
private OperationRecordsMapper operationRecordsMapper;
@Override
public List<OperationRecords> selectAll() {
return operationRecordsMapper.selectAll();

View File

@ -12,22 +12,46 @@ import java.util.List;
public class ServiceTypeServiceImpl implements IServiceTypeService {
@Autowired
private ServiceTypeMapper serviceTypeMapper;
/**
* 根据类型查询
*
* @param type
* @return
*/
@Override
public List<ServiceType> selectByType(String type) {
return serviceTypeMapper.selectByType(type);
}
/**
* 新增单条数据
*
* @param serviceType
* @return
*/
@Override
public int insert(ServiceType serviceType) {
return serviceTypeMapper.insert(serviceType);
}
/**
* 查询全部数据
*
* @return
*/
@Override
public List<ServiceType> selectAll() {
return serviceTypeMapper.selectAll();
}
/**
* 根据id数组批量删除
*
* @param ids
* @return
*/
@Override
public int deleteByIds(Long[] ids) {
return serviceTypeMapper.deleteByIds(ids);

View File

@ -1,5 +1,6 @@
package com.ruoyi.crops.service.impl;
import com.ruoyi.common.exception.base.BaseException;
import com.ruoyi.crops.mapper.ServiceTypeMapper;
import com.ruoyi.crops.service.IUploadService;
@ -15,16 +16,17 @@ import java.util.regex.Matcher;
public class UploadServiceImpl implements IUploadService {
@Autowired
private ServiceTypeMapper serviceTypeMapper;
@Override
public String upload(String type,MultipartFile file, String fileRoot) throws IOException {
public String upload(MultipartFile file, String fileRoot) throws IOException {
prepareFilePath(fileRoot);
// 获取上传文件的原文件名
String fileName = file.getOriginalFilename();
if (serviceTypeMapper.selectByfile(fileName)>0){
return "文件已存在";
}else {
if (serviceTypeMapper.selectByfile(fileName) > 0) {
throw new BaseException("文件已存在");
} else {
// 规则化之后的文件上传根路径
String normalizeFileRoot = getNormalizeFileRoot(fileRoot);
// 根据路径和文件名创建目标文件
@ -34,7 +36,7 @@ public class UploadServiceImpl implements IUploadService {
if (targetFile.exists())
targetFile.delete();
// 将目标文件进行转移
// 将目标文件进行转移保存到指定位置,程序运行时,临时存储在temp这个文件夹中
file.transferTo(targetFile);
return String.format("%s\\%s", normalizeFileRoot, fileName);
@ -42,8 +44,8 @@ public class UploadServiceImpl implements IUploadService {
}
/**
fileRoot上传文件保存的根路径
此方法是准备文件上传的路径,如果路径不存在,即创建
* fileRoot上传文件保存的根路径
* 此方法是准备文件上传的路径,如果路径不存在,即创建
*/
private void prepareFilePath(String fileRoot) {
File file = new File(normalizePath(fileRoot));
@ -52,12 +54,13 @@ public class UploadServiceImpl implements IUploadService {
}
/**
该方法主要对文件路径进行规则化D:\\\360Browser\///360Chrome\\//,
像这种路径就不正确此方法可以将路径规则化为D:\360Browser\360Chrome
* 该方法主要对文件路径进行规则化D:\\\360Browser\///360Chrome\\//,
* 像这种路径就不正确此方法可以将路径规则化为D:\360Browser\360Chrome
*/
private String getNormalizeFileRoot(String fileRoot) {
return normalizePath(fileRoot);
}
public static String normalizePath(String path) {
String result = path.replaceAll("/+", Matcher.quoteReplacement(File.separator));
return result.replaceAll("\\\\+", Matcher.quoteReplacement(File.separator));

View File

@ -0,0 +1,27 @@
package com.ruoyi.crops.service.impl;
import com.ruoyi.crops.domain.WarningFarm;
import com.ruoyi.crops.domain.WarningInformation;
import com.ruoyi.crops.mapper.WarningFarmMapper;
import com.ruoyi.crops.service.IWarningFarmService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
@Service
public class WarningFarmServiceImpl implements IWarningFarmService {
@Autowired
private WarningFarmMapper warningFarmMapper;
@Override
public int insertWarning(WarningFarm warningFarm) {
return warningFarmMapper.insertWarning(warningFarm);
}
@Override
public List<WarningFarm> selectByTime(Date beginTime, Date endTime) {
return warningFarmMapper.selectByTime(beginTime,endTime);
}
}

View File

@ -10,15 +10,14 @@ import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
import static cn.hutool.core.date.DateTime.now;
@Service
public class WarningServiceImpl implements IWarningService {
@Autowired
private WarningMapper warningMapper;
@Override
public List<WarningInformation> selectByTime(Date startTime,Date endTime) {
return warningMapper.selectByTime(startTime,endTime);
public List<WarningInformation> selectByTime(Date startTime, Date endTime) {
return warningMapper.selectByTime(startTime, endTime);
}
@Override
@ -27,7 +26,7 @@ public class WarningServiceImpl implements IWarningService {
}
@Override
public int insertWarning(DeviceSense deviceSense) {
public int judgeWarning(DeviceSense deviceSense) {
WarningInformation warningInformation = new WarningInformation();
Double sunlight = deviceSense.getSunlight();
if (sunlight > 2) {
@ -38,7 +37,8 @@ public class WarningServiceImpl implements IWarningService {
warningInformation.setAaus("Lux");
warningMapper.insert(warningInformation);
} if (sunlight < 1) {
}
if (sunlight < 1) {
warningInformation.setMonitoringIndicators("光照强度");
warningInformation.setMonitoringValues(sunlight);
warningInformation.setAbnormalCause("偏低");
@ -48,7 +48,7 @@ public class WarningServiceImpl implements IWarningService {
}
//空气温度[°C]
Double airTemp = deviceSense.getAirTemp();
if (airTemp>22.6){
if (airTemp > 22.6) {
warningInformation.setMonitoringIndicators("空气温度");
warningInformation.setMonitoringValues(airTemp);
warningInformation.setAbnormalCause("偏高");
@ -56,7 +56,7 @@ public class WarningServiceImpl implements IWarningService {
warningInformation.setAaus("°C");
warningMapper.insert(warningInformation);
}
if (airTemp<22.2){
if (airTemp < 22.2) {
warningInformation.setMonitoringIndicators("空气温度");
warningInformation.setMonitoringValues(airTemp);
warningInformation.setAbnormalCause("偏低");
@ -66,7 +66,7 @@ public class WarningServiceImpl implements IWarningService {
}
//空气湿度[%]
Double airHumidity = deviceSense.getAirHumidity();
if (airHumidity>48){
if (airHumidity > 48) {
warningInformation.setMonitoringIndicators("空气湿度");
warningInformation.setMonitoringValues(airHumidity);
warningInformation.setAbnormalCause("偏高");
@ -74,7 +74,7 @@ public class WarningServiceImpl implements IWarningService {
warningInformation.setAaus("%");
warningMapper.insert(warningInformation);
}
if (airHumidity<45){
if (airHumidity < 45) {
warningInformation.setMonitoringIndicators("空气湿度");
warningInformation.setMonitoringValues(airHumidity);
warningInformation.setAbnormalCause("偏低");
@ -84,7 +84,7 @@ public class WarningServiceImpl implements IWarningService {
}
//土壤温度[°C]
Double soilTemp = deviceSense.getSoilTemp();
if (soilTemp>22.8){
if (soilTemp > 22.8) {
warningInformation.setMonitoringIndicators("土壤温度");
warningInformation.setMonitoringValues(soilTemp);
warningInformation.setAbnormalCause("偏高");
@ -92,7 +92,7 @@ public class WarningServiceImpl implements IWarningService {
warningInformation.setAaus("°C");
warningMapper.insert(warningInformation);
}
if (soilTemp<22.7){
if (soilTemp < 22.7) {
warningInformation.setMonitoringIndicators("土壤温度");
warningInformation.setMonitoringValues(soilTemp);
warningInformation.setAbnormalCause("偏低");
@ -102,7 +102,7 @@ public class WarningServiceImpl implements IWarningService {
}
//土壤湿度[%]
Double soilHumidity = deviceSense.getSoilHumidity();
if (soilHumidity>3){
if (soilHumidity > 3) {
warningInformation.setMonitoringIndicators("土壤湿度");
warningInformation.setMonitoringValues(soilHumidity);
warningInformation.setAbnormalCause("偏高");
@ -110,7 +110,7 @@ public class WarningServiceImpl implements IWarningService {
warningInformation.setAaus("%");
warningMapper.insert(warningInformation);
}
if (soilHumidity<1){
if (soilHumidity < 1) {
warningInformation.setMonitoringIndicators("土壤湿度");
warningInformation.setMonitoringValues(soilHumidity);
warningInformation.setAbnormalCause("偏低");
@ -121,7 +121,7 @@ public class WarningServiceImpl implements IWarningService {
//二氧化碳浓度[ppm]
Double co2_ = deviceSense.getCO2_();
if (co2_>800){
if (co2_ > 800) {
warningInformation.setMonitoringIndicators("二氧化碳浓度");
warningInformation.setMonitoringValues(co2_);
warningInformation.setAbnormalCause("偏高");
@ -129,7 +129,7 @@ public class WarningServiceImpl implements IWarningService {
warningInformation.setAaus("ppm");
warningMapper.insert(warningInformation);
}
if (co2_<530){
if (co2_ < 530) {
warningInformation.setMonitoringIndicators("二氧化碳浓度");
warningInformation.setMonitoringValues(co2_);
warningInformation.setAbnormalCause("偏低");

View File

@ -29,10 +29,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectCropsComprehensiveDataVo">
select id, cultivated_area, foodstuff_production, vegetable_planting_area, vegetable_production, type, agricultural_planting_area, agriculture_production, agriculture_output_vaule, total_population, cover_area, example_greenhouse, rusticate, cultivated_ally, greenhouse, output_value, vector_boundary, village_vector_boundary,img, created_by, created_time from crops_comprehensive_data
select id, cultivated_area, foodstuff_production, vegetable_planting_area, vegetable_production, type, agricultural_planting_area, agriculture_production, agriculture_output_vaule, total_population, cover_area, example_greenhouse, rusticate, cultivated_ally, greenhouse, output_value, vector_boundary, village_vector_boundary,img, created_by, created_time
from ruoyi.crops_comprehensive_data
</sql>
<select id="selectCropsComprehensiveDataList" parameterType="CropsComprehensiveData" resultMap="CropsComprehensiveDataResult">
<select id="selectCropsComprehensiveDataList" parameterType="com.ruoyi.crops.domain.CropsComprehensiveData" resultMap="CropsComprehensiveDataResult">
<include refid="selectCropsComprehensiveDataVo"/>
<where>
<if test="cultivatedArea != null "> and cultivated_area = #{cultivatedArea}</if>
@ -64,55 +65,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<insert id="insertCropsComprehensiveData" parameterType="com.ruoyi.crops.domain.CropsComprehensiveData" useGeneratedKeys="true" keyProperty="id">
insert into ruoyi.crops_comprehensive_data
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="cultivatedArea != null">cultivated_area,</if>
<if test="foodstuffProduction != null">foodstuff_production,</if>
<if test="vegetablePlantingArea != null">vegetable_planting_area,</if>
<if test="vegetableProduction != null">vegetable_production,</if>
<if test="type != null">type,</if>
<if test="agriculturalPlantingArea != null">agricultural_planting_area,</if>
<if test="agricultureProduction != null">agriculture_production,</if>
<if test="agricultureOutputVaule != null">agriculture_output_vaule,</if>
<if test="totalPopulation != null">total_population,</if>
<if test="coverArea != null">cover_area,</if>
<if test="exampleGreenhouse != null">example_greenhouse,</if>
<if test="rusticate != null">rusticate,</if>
<if test="cultivatedAlly != null">cultivated_ally,</if>
<if test="greenhouse != null">greenhouse,</if>
<if test="outputValue != null">output_value,</if>
<if test="vectorBoundary != null">vector_boundary,</if>
<if test="villageVectorBoundary != null">village_vector_boundary,</if>
<if test="img != null">img,</if>
<if test="createdBy != null">created_by,</if>
<if test="createdTime != null">created_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="cultivatedArea != null">#{cultivatedArea},</if>
<if test="foodstuffProduction != null">#{foodstuffProduction},</if>
<if test="vegetablePlantingArea != null">#{vegetablePlantingArea},</if>
<if test="vegetableProduction != null">#{vegetableProduction},</if>
<if test="type != null">#{type},</if>
<if test="agriculturalPlantingArea != null">#{agriculturalPlantingArea},</if>
<if test="agricultureProduction != null">#{agricultureProduction},</if>
<if test="agricultureOutputVaule != null">#{agricultureOutputVaule},</if>
<if test="totalPopulation != null">#{totalPopulation},</if>
<if test="coverArea != null">#{coverArea},</if>
<if test="exampleGreenhouse != null">#{exampleGreenhouse},</if>
<if test="rusticate != null">#{rusticate},</if>
<if test="cultivatedAlly != null">#{cultivatedAlly},</if>
<if test="greenhouse != null">#{greenhouse},</if>
<if test="outputValue != null">#{outputValue},</if>
<if test="vectorBoundary != null">#{vectorBoundary},</if>
<if test="villageVectorBoundary != null">#{villageVectorBoundary},</if>
<if test="img != null">#{img},</if>
<if test="createdBy != null">#{createdBy},</if>
<if test="createdTime != null">#{createdTime},</if>
</trim>
insert into ruoyi.crops_comprehensive_data (cultivated_area, foodstuff_production, vegetable_planting_area, vegetable_production, type, agricultural_planting_area, agriculture_production, agriculture_output_vaule, total_population, cover_area, example_greenhouse, rusticate,cultivated_ally, greenhouse, output_value, vector_boundary, village_vector_boundary, img, created_by, created_time)
VALUE (#{cultivatedArea}, #{foodstuffProduction}, #{vegetablePlantingArea}, #{vegetableProduction}, #{type},
#{agriculturalPlantingArea}, #{agricultureProduction}, #{agricultureOutputVaule}, #{totalPopulation}, #{coverArea},
#{exampleGreenhouse}, #{rusticate}, #{cultivatedAlly}, #{greenhouse}, #{outputValue}, #{vectorBoundary},
#{villageVectorBoundary}, #{img}, #{createdBy},now())
</insert>
<update id="updateCropsComprehensiveData" parameterType="CropsComprehensiveData">
update crops_comprehensive_data
<update id="updateCropsComprehensiveData" parameterType="com.ruoyi.crops.domain.CropsComprehensiveData">
update ruoyi.crops_comprehensive_data
<trim prefix="SET" suffixOverrides=",">
<if test="cultivatedArea != null">cultivated_area = #{cultivatedArea},</if>
<if test="foodstuffProduction != null">foodstuff_production = #{foodstuffProduction},</if>
@ -139,11 +100,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</update>
<delete id="deleteCropsComprehensiveDataById" parameterType="Long">
delete from crops_comprehensive_data where id = #{id}
delete from ruoyi.crops_comprehensive_data where id = #{id}
</delete>
<delete id="deleteCropsComprehensiveDataByIds" parameterType="String">
delete from crops_comprehensive_data where id in
delete from ruoyi.crops_comprehensive_data where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>

View File

@ -0,0 +1,105 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.crops.mapper.CropsUserMapper">
<resultMap type="com.ruoyi.crops.domain.CropsUser" id="CropsUserMap">
<result property="id" column="id" jdbcType="INTEGER"/>
<result property="userName" column="user_name" jdbcType="VARCHAR"/>
<result property="password" column="password" jdbcType="VARCHAR"/>
<result property="phone" column="phone" jdbcType="VARCHAR"/>
<result property="role" column="role" jdbcType="VARCHAR"/>
<result property="creatTime" column="creat_time" jdbcType="TIMESTAMP"/>
<result property="remark" column="remark" jdbcType="VARCHAR"/>
<result property="status" column="status" jdbcType="INTEGER"/>
<result property="delFlag" column="del_flag" jdbcType="INTEGER"/>
</resultMap>
<select id="selectByPhone" resultMap="CropsUserMap">
select id,
user_name,
password,
phone,
role,
creat_time,
remark,
status
from ruoyi.crops_user
where phone = #{phone}
</select>
<select id="list" resultMap="CropsUserMap">
select s.user_id as id,
s.user_name,
s.phonenumber as phone,
sr.role_name as role,
s.create_time,
s.remark,
s.status
from ruoyi.sys_user s
join ruoyi.sys_user_role sur on s.user_id = sur.user_id
join ruoyi.sys_role sr on sur.role_id = sr.role_id
</select>
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
insert into ruoyi.crops_user(user_name, password, phone, role, creat_time, remark, status, del_flag)
values (#{userName}, md5(#{password}), #{phone}, '普通用户', now(), #{remark}, 0, 0)
</insert>
<delete id="delete">
update ruoyi.sys_user
set del_flag=1
where user_id = #{id}
</delete>
<update id="update">
update ruoyi.crops_user
<set>
<if test="userName != null and userName != ''">
user_name = #{userName},
</if>
<if test="password != null and password != ''">
password = #{password},
</if>
<if test="phone != null and phone != ''">
phone = #{phone},
</if>
<if test="role != null and role != ''">
role = #{role},
</if>
<if test="creatTime != null and creatTime != ''">
creat_time = #{creatTime},
</if>
<if test="remark != null and remark != ''">
remark = #{remark},
</if>
<if test="status != null and status != ''">
status = #{status},
</if>
<if test="delFlag != null and delFlag != ''">
del_flag = #{delFlag},
</if>
</set>
where id = #{id}
</update>
<select id="login" resultMap="CropsUserMap">
select id,
user_name,
password,
phone,
role,
creat_time,
remark,
status,
del_flag
from ruoyi.crops_user
where phone = #{phone}
and password = md5(#{password})
and del_flag = 0
</select>
<select id="selectCountByName" resultType="int">
select count(1)
from ruoyi.crops_user
where user_name = #{userName}
</select>
</mapper>

View File

@ -0,0 +1,59 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.crops.mapper.DataAcquisitionMapper">
<resultMap type="com.ruoyi.crops.domain.DataAcquisition" id="DataAcquisitionMap">
<result property="id" column="id" jdbcType="INTEGER"/>
<result property="imageData" column="image_data" jdbcType="INTEGER"/>
<result property="imageDataTotal" column="image_data_total" jdbcType="DOUBLE"/>
<result property="droneData" column="drone_data" jdbcType="INTEGER"/>
<result property="droneDataTotal" column="drone_data_total" jdbcType="DOUBLE"/>
<result property="sensorData" column="sensor_data" jdbcType="INTEGER"/>
<result property="sensorDataTotal" column="sensor_data_total" jdbcType="DOUBLE"/>
<result property="time" column="time" jdbcType="TIMESTAMP"/>
</resultMap>
<!-- 查询出数据库里最新一条数据-->
<select id="getData" resultMap="DataAcquisitionMap">
select image_data, image_data_total, drone_data, drone_data_total, sensor_data, sensor_data_total, time from ruoyi.data_acquisition
order by time desc limit 0,1
</select>
<insert id="insert">
insert into ruoyi.data_acquisition(image_data, image_data_total, drone_data, drone_data_total, sensor_data, sensor_data_total, time)
VALUES (#{imageData},#{imageDataTotal},#{droneData},#{droneDataTotal},#{sensorData},#{sensorDataTotal},now())
</insert>
<insert id="analyze" >
ANALYZE TABLE crop_drought,crop_growth,crop_structure,crop_yield
</insert>
<!--<select id="getImageData" resultMap="DataAcquisitionMap">
&lt;!&ndash;作物表的数据条数和大小&ndash;&gt;
select sum(t.TABLE_ROWS) as image_data ,sum(t.Total) as image_data_total from
(select TABLE_ROWS ,ROUND((data_length+index_length)/(1024*1024),4) AS'Total'
FROM information_schema. TABLES a WHERE a.table_schema = 'ruoyi' AND TABLE_NAME='crop_drought'
UNION ALL
select TABLE_ROWS ,ROUND((data_length+index_length)/(1024*1024),4) AS'Total'
FROM information_schema. TABLES a WHERE a.table_schema = 'ruoyi' AND TABLE_NAME='crop_growth'
UNION ALL
select TABLE_ROWS ,ROUND((data_length+index_length)/(1024*1024),4) AS'Total'
FROM information_schema. TABLES a WHERE a.table_schema = 'ruoyi' AND TABLE_NAME='crop_structure'
UNION ALL
select TABLE_ROWS ,ROUND((data_length+index_length)/(1024*1024),4) AS'Total'
FROM information_schema. TABLES a WHERE a.table_schema = 'ruoyi' AND TABLE_NAME='crop_yield')
as t
</select>-->
<select id="getSensorData" resultMap="DataAcquisitionMap">
select sum(t.TABLE_ROWS) as sensor_data ,sum(t.Total) as sensor_data_total from
<!--设备传感数据-->
(select TABLE_ROWS ,ROUND((data_length+index_length)/(1024*1024),4) AS'Total'
FROM information_schema. TABLES a WHERE a.table_schema = 'ruoyi' AND TABLE_NAME='device_sense'
UNION ALL
<!--水肥机传感数据-->
select TABLE_ROWS ,ROUND((data_length+index_length)/(1024*1024),4) AS'Total'
FROM information_schema. TABLES a WHERE a.table_schema = 'ruoyi' AND TABLE_NAME='fertigation_sense')
as t
</select>
</mapper>

View File

@ -38,7 +38,7 @@
<result property="control_status8" column="control_status8" jdbcType="VARCHAR"/>
<result property="BeiYong1" column="bei_yong1" jdbcType="INTEGER"/>
<result property="BeiYong2" column="bei_yong2" jdbcType="INTEGER"/>
<result property="time" column="time" jdbcType="VARCHAR"/>
<result property="time" column="time" jdbcType="TIMESTAMP"/>
</resultMap>
<insert id="insert">
@ -145,7 +145,7 @@
where deviceId = #{deviceId}
</select>
<select id="selectByTime" resultMap="DeviceSenseMap">
<select id="selectByTime" resultMap="DeviceSenseMap" resultType="com.ruoyi.crops.domain.DeviceSense">
select deviceId,
sunlight,
air_temp,
@ -190,12 +190,12 @@
<select id="selecthours" resultType="com.ruoyi.crops.domain.vo.DeviceSenseVo">
select *
from (select did
, avg(sunlight) as AvgSunlight
, avg(air_temp) as AvgAirTemp
, avg(air_humidity) as AvgAirHumidity
, avg(soil_temp) as AvgSoilTemp
, avg(soil_humidity) as AvgSoilHumidity
, avg(co2) as AvgCO2
, round(avg(sunlight),2) as AvgSunlight
, round(avg(air_temp),2) as AvgAirTemp
, round(avg(air_humidity),2) as AvgAirHumidity
, round(avg(soil_temp),2) as AvgSoilTemp
, round(avg(soil_humidity),2) as AvgSoilHumidity
, round(avg(co2),2) as AvgCO2
, DATE_FORMAT(time, '%Y-%m-%d %H:%m:%s') time
from (select ANY_VALUE(deviceId) as did,
sunlight,
@ -210,18 +210,18 @@
did, sunlight, air_temp, air_humidity, soil_temp, soil_humidity, co2
) as t
group by time) as tt
where time between #{startTime} and #{endTime}
where time between DATE (#{startTime}) and DATE(#{endTime})
</select>
<select id="selectdays" resultType="com.ruoyi.crops.domain.vo.DeviceSenseVo">
select *
from (select did
, avg(sunlight) as AvgSunlight
, avg(air_temp) as AvgAirTemp
, avg(air_humidity) as AvgAirHumidity
, avg(soil_temp) as AvgSoilTemp
, avg(soil_humidity) as AvgSoilHumidity
, avg(co2) as AvgCO2
, round(avg(sunlight),2) as AvgSunlight
, round(avg(air_temp),2) as AvgAirTemp
, round(avg(air_humidity),2) as AvgAirHumidity
, round(avg(soil_temp),2) as AvgSoilTemp
, round(avg(soil_humidity),2) as AvgSoilHumidity
, round(avg(co2),2) as AvgCO2
, time
from (
select ANY_VALUE(deviceId) as did,
@ -237,7 +237,7 @@
did, sunlight, air_temp, air_humidity, soil_temp, soil_humidity, co2
) as t
group by time) as tt
where time between #{startTime} and #{endTime}
where time between DATE (#{startTime}) and DATE (#{endTime})
</select>
</mapper>

View File

@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.crops.mapper.FarmMachineryMapper">
<resultMap type="com.ruoyi.crops.domain.FarmMachinery" id="FarmMachineryMap">
<result property="id" column="id" jdbcType="INTEGER"/>
<result property="province" column="province" jdbcType="VARCHAR"/>
<result property="city" column="city" jdbcType="VARCHAR"/>
<result property="county" column="county" jdbcType="VARCHAR"/>
<result property="town" column="town" jdbcType="VARCHAR"/>
<result property="vmeid" column="vmeid" jdbcType="VARCHAR"/>
<result property="vehicleno" column="vehicleno" jdbcType="VARCHAR"/>
<result property="vehicletype" column="vehicletype" jdbcType="VARCHAR"/>
<result property="vehiclenum" column="vehiclenum" jdbcType="VARCHAR"/>
<result property="ownername" column="ownername" jdbcType="VARCHAR"/>
<result property="ownertel" column="ownertel" jdbcType="VARCHAR"/>
<result property="belongcorp" column="belongcorp" jdbcType="VARCHAR"/>
</resultMap>
<select id="selectMachineryData" resultType="com.ruoyi.crops.domain.vo.FarmMachineryVo">
select id,vehicletype,vehicleno,ownername
from ruoyi.farm_machinery
<where>
<if test="vehicleno != null and vehicleno!=''">
vehicleno = #{vehicleno}
</if>
</where>
</select>
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
insert into ruoyi.farm_machinery(province,city,county,town,vmeid,vehicleno,vehicletype,vehiclenum,ownername,ownertel,belongcorp)
value
<foreach collection="entities" item="entity" separator=",">
(#{entity.province},#{entity.city},#{entity.county},#{entity.town},#{entity.vmeid},#{entity.vehicleno},#{entity.vehicletype},#{entity.vehiclenum},#{entity.ownername},#{entity.ownertel},#{entity.belongcorp})
</foreach>
</insert>
</mapper>

View File

@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.crops.mapper.InterfaceStatisticsMapper">
<resultMap type="com.ruoyi.crops.domain.InterfaceStatistics" id="InterfaceStatisticsMap">
<result property="id" column="id" jdbcType="INTEGER"/>
<result property="visits" column="visits" jdbcType="INTEGER"/>
<result property="accessingUsers" column="accessing_users" jdbcType="INTEGER"/>
<result property="dataEntries" column="data_entries" jdbcType="INTEGER"/>
<result property="time" column="time" jdbcType="TIMESTAMP"/>
</resultMap>
<insert id="insert">
insert into ruoyi.interface_statistics (visits, accessing_users, data_entries, time)
VALUE (#{visits}, #{accessingUsers}, #{dataEntries}, now())
</insert>
<select id="selectByDay" resultMap="InterfaceStatisticsMap">
select *
from ruoyi.interface_statistics
order by time desc limit 0,1
</select>
<select id="selectTotal" resultType="com.ruoyi.crops.domain.vo.InterfaceStatisticsVo">
select t2.visits, t2.accessingUsers, t2.dataEntries, t1.volume
from (select round(sum(data_length / 1024 / 1024), 2) as volume
from information_schema.TABLES
where table_schema = 'ruoyi') as t1
join
(select sum(t.visits) as visits, sum(t.accessingUsers) as accessingUsers, sum(t.dataEntries) as dataEntries
from (select max(visits) as visits,
max(accessing_users) as accessingUsers,
max(data_entries) as dataEntries,
DATE(time) as time
from ruoyi.interface_statistics
GROUP BY DATE(time)) as t) as t2
on 1 = 1;
</select>
</mapper>

View File

@ -1,25 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.crops.mapper.MachineParameterMapper">
<resultMap type="com.ruoyi.crops.domain.MachineParameter" id="MachineParameterMap">
<result property="id" column="id" jdbcType="INTEGER"/>
<result property="greenhouseName" column="greenhouse_name" jdbcType="VARCHAR"/>
<result property="pressure" column="pressure" jdbcType="DOUBLE"/>
<result property="flow" column="flow" jdbcType="DOUBLE"/>
<result property="conductivity" column="conductivity" jdbcType="DOUBLE"/>
</resultMap>
<sql id="selectMachineParameterVo">
select id, greenhouse_name, pressure, flow, conductivity
from ruoyi.machine_parameter
</sql>
<select id="selectByName" resultMap="MachineParameterMap">
<include refid="selectMachineParameterVo">
</include>
where greenhouse_name=#{name}
</select>
<insert id="insert">
insert into ruoyi.machine_parameter (greenhouse_name, pressure, flow, conductivity)
VALUE (#{greenhouseName},#{pressure},#{flow},#{conductivity})
</insert>
</mapper>

View File

@ -0,0 +1,66 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.crops.mapper.MachineryJobDataMapper">
<resultMap type="com.ruoyi.crops.domain.MachineryJobData" id="MachineryJobDataMap">
<result property="id" column="id" jdbcType="INTEGER"/>
<result property="province" column="province" jdbcType="VARCHAR"/>
<result property="city" column="city" jdbcType="VARCHAR"/>
<result property="county" column="county" jdbcType="VARCHAR"/>
<result property="jobday" column="jobday" jdbcType="DATE"/>
<result property="jobtype" column="jobtype" jdbcType="INTEGER"/>
<result property="vehicleno" column="vehicleno" jdbcType="VARCHAR"/>
<result property="vmeid" column="vmeid" jdbcType="VARCHAR"/>
<result property="plotarea" column="plotarea" jdbcType="DOUBLE"/>
<result property="jobarea" column="jobarea" jdbcType="DOUBLE"/>
<result property="qualratio" column="qualratio" jdbcType="DOUBLE"/>
<result property="qualarea" column="qualarea" jdbcType="DOUBLE"/>
<result property="jobwidth" column="jobwidth" jdbcType="DOUBLE"/>
<result property="area" column="area" jdbcType="DOUBLE"/>
<result property="workhours" column="workHours" jdbcType="DOUBLE"/>
</resultMap>
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
insert into ruoyi.machinery_job_data (province, city, county, jobday, jobtype, vehicleno, vmeid, plotarea, jobarea, qualratio, qualarea, jobwidth)
value
<foreach collection="entities" item="entity" separator=",">
(#{entity.province},#{entity.city},#{entity.county},#{entity.jobday},#{entity.jobtype},#{entity.vehicleno},#{entity.vmeid},#{entity.plotarea},#{entity.jobarea},#{entity.qualratio},#{entity.qualarea},#{entity.jobwidth})
</foreach>
</insert>
<select id="selectByTime" resultMap="MachineryJobDataMap">
select province, city, county, jobday, jobtype, vehicleno, vmeid, plotarea, jobarea, qualratio, qualarea, jobwidth,area,workHours
from ruoyi.machinery_job_data
where jobday between #{startTime} and #{endTime}
</select>
<select id="selectMachineryJobData" resultType="com.ruoyi.crops.domain.vo.MachineryJobDataVo">
select fm.vehicletype,mjd.vehicleno,mjd.vmeid,mjd.jobday,mjd.jobarea,fm.ownername,fm.ownertel,mjd.jobtype,mjd.area
from ruoyi.machinery_job_data mjd
left join ruoyi.farm_machinery fm on mjd.vmeid = fm.vmeid
<where>
<if test="vehicleno!=null">
and mjd.vehicleno = #{vehicleno}
</if>
<if test="startTime != null and endTime != null">
and mjd.jobday between #{startTime} and #{endTime}
</if>
</where>
</select>
<update id="updateAreaWorkhours">
update ruoyi.machinery_job_data set area=#{workArea},workHours=#{workhours}
<!-- where vehicleno = #{vehicleno} and jobday = DATE(now())-->
where vehicleno = #{vehicleno} and jobday = DATE ('2023-03-13')
</update>
<select id="selectTodayJobData" resultType="com.ruoyi.crops.domain.vo.MachineryJobDataVo">
select sum(area) as area, sum(workHours) as workHours
from ruoyi.machinery_job_data
<!-- where jobday = DATE(now())-->
where jobday = DATE('2023-03-13')
</select>
<select id="selectVehicleno" resultType="java.lang.String">
select vehicleno from ruoyi.farm_machinery
</select>
</mapper>

View File

@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.crops.mapper.MachineryPositionMapper">
<resultMap type="com.ruoyi.crops.domain.MachineryPosition" id="MachineryPositionMap">
<result property="id" column="id" jdbcType="INTEGER"/>
<result property="vehicleno" column="vehicleno" jdbcType="VARCHAR"/>
<result property="postime" column="postime" jdbcType="TIMESTAMP"/>
<result property="lat" column="lat" jdbcType="DOUBLE"/>
<result property="lng" column="lng" jdbcType="DOUBLE"/>
<result property="speed" column="speed" jdbcType="DOUBLE"/>
<result property="jobtype" column="jobtype" jdbcType="INTEGER"/>
<result property="depth" column="depth" jdbcType="DOUBLE"/>
</resultMap>
<select id="selectMachineryOnline" resultType="java.lang.Integer">
select count(*)
from ruoyi.machinery_position
<!-- where DATE (postime) = DATE (now())-->
where DATE (postime) = DATE ('2023-05-18')
</select>
<insert id="insertBatch" keyProperty="vehicleno" useGeneratedKeys="true">
insert into ruoyi.machinery_position(vehicleno, postime, lat, lng, speed, jobtype, depth)
value
<foreach collection="entities" item="entity" separator=",">
(#{entity.vehicleno}, #{entity.postime}, #{entity.lat}, #{entity.lng}, #{entity.speed},
#{entity.jobtype}, #{entity.depth})
</foreach>
on duplicate key update
vehicleno=values(vehicleno),
postime=values(postime),
lat=values(lat),
lng=values(lng),
speed=values(speed),
jobtype=values(jobtype),
depth=values(depth)
</insert>
<select id="selectJobtype" resultType="int">
select jobtype from ruoyi.machinery_position where vehicleno = #{vehicleno}
</select>
</mapper>

View File

@ -0,0 +1,60 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.crops.mapper.MachineryTrajectoryMapper">
<resultMap type="com.ruoyi.crops.domain.MachineryTrajectory" id="MachineryTrajectoryMap">
<result property="id" column="id" jdbcType="INTEGER"/>
<result property="pttime" column="pttime" jdbcType="TIMESTAMP"/>
<result property="lat" column="lat" jdbcType="DOUBLE"/>
<result property="lng" column="lng" jdbcType="DOUBLE"/>
<result property="course" column="course" jdbcType="DOUBLE"/>
<result property="haspic" column="haspic" jdbcType="INTEGER"/>
<result property="imgurl" column="imgurl" jdbcType="VARCHAR"/>
<result property="iswork" column="iswork" jdbcType="INTEGER"/>
<result property="jobwidth" column="jobwidth" jdbcType="DOUBLE"/>
<result property="depth" column="depth" jdbcType="DOUBLE"/>
<result property="vehicleno" column="vehicleno" jdbcType="VARCHAR"/>
<result property="workplace" column="workplace" jdbcType="VARCHAR"/>
</resultMap>
<insert id="insertTrajectory" parameterType="com.ruoyi.crops.domain.MachineryTrajectory">
insert into ruoyi.machinery_trajectory
(vehicleno, pttime, lat, lng, workplace, course, haspic, imgurl, iswork, jobwidth, depth)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.vehicleno},#{entity.pttime},#{entity.lat},#{entity.lng},#{entity.workplace},#{entity.course},#{entity.haspic},#{entity.imgurl},#{entity.iswork},#{entity.jobwidth},#{entity.depth})
</foreach>
</insert>
<select id="selectByVehicleno" resultMap="MachineryTrajectoryMap">
select * from ruoyi.machinery_trajectory
<!-- where pttime BETWEEN DATE(NOW())and DATE (DATE_ADD(now(), INTERVAL 1 DAY))-->
where pttime BETWEEN '2023-03-01'and '2023-06-12'
</select>
<select id="selectVehicleTrack" resultMap="MachineryTrajectoryMap">
select vehicleno, pttime, lat, lng, workplace,iswork, depth from ruoyi.machinery_trajectory
where workplace = #{workplace} and DATE (pttime) = DATE (#{pttime})
order by pttime
</select>
<select id="distinctWorkplace" resultType="java.lang.String">
select distinct workplace
from ruoyi.machinery_trajectory
<where>
DATE(pttime) = DATE('2023-03-13')
<if test="vehicleno != null">
and vehicleno = #{vehicleno}
</if>
</where>
</select>
<select id="distinctVehicleno" resultType="java.lang.String">
select distinct vehicleno from ruoyi.machinery_trajectory
where DATE (pttime) = DATE ('2023-03-13')
</select>
<select id="selectWorkingMachinery" resultType="int">
select count(distinct vehicleno) from ruoyi.machinery_trajectory
<!-- where pttime between DATE_SUB(now(),interval 30 minute) and now()-->
where pttime between DATE_SUB('2023-03-13 11:28:58',interval 10 minute) and '2023-03-13 11:28:58'
</select>
</mapper>

View File

@ -27,6 +27,16 @@
VALUE (#{warnId},#{title},#{level},#{type},#{time},#{province},#{city},#{district},#{content})
</insert>
<insert id="insertBatch" parameterType="com.ruoyi.crops.domain.Meteorological">
insert into ruoyi.meteorological
(warn_id, title, level, type, time, province, city, district, content)
VALUE
<foreach collection="entities" item="entity" separator=",">
(#{entity.id},#{entity.title},#{entity.level},#{entity.type},#{entity.time},
#{entity.province},#{entity.city},#{entity.district},#{entity.content})
</foreach>
</insert>
<!--sql语句直接去重-->
<select id="insert2">
insert into ruoyi.meteorological(warn_id, title, level, type, time, province, city, district, content)

View File

@ -5,7 +5,7 @@
<result property="id" column="id" jdbcType="VARCHAR"/>
<result property="updateTime" column="update_time" jdbcType="DATETIMEOFFSET"/>
<result property="operationContent" column="operation_content" jdbcType="VARCHAR"/>
<result property="updateBy" column="update_by" jdbcType="VARCHAR"/>
</resultMap>
<select id="selectAll" resultMap="OperationRecordsMap">
@ -14,7 +14,7 @@
</select>
<insert id="insert">
insert into ruoyi.operation_records(update_time, operation_content, update_by)
VALUE(#{updateTime},#{operationContent},#{updateBy})
insert into ruoyi.operation_records(update_time, operation_content)
VALUE(#{updateTime},#{operationContent})
</insert>
</mapper>

View File

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.crops.mapper.WarningFarmMapper">
<resultMap type="com.ruoyi.crops.domain.WarningFarm" id="WarningFarmMap">
<result property="id" column="id" jdbcType="INTEGER"/>
<result property="vehicleno" column="vehicleno" jdbcType="VARCHAR"/>
<result property="ownername" column="ownername" jdbcType="VARCHAR"/>
<result property="warningInfo" column="warning_info" jdbcType="VARCHAR"/>
<result property="time" column="time" jdbcType="TIMESTAMP"/>
</resultMap>
<insert id="insertWarning" keyProperty="id" useGeneratedKeys="true">
insert into ruoyi.warning_farm(vehicleno, ownername, warning_info, time)
VALUES (#{vehicleno},#{ownername},#{warningInfo},#{time})
</insert>
<select id="selectByTime" resultMap="WarningFarmMap">
select *
from ruoyi.warning_farm
<if test="beginTime != null and endTime != null ">
where time between #{beginTime} and #{endTime}
</if>
order by time desc
</select>
</mapper>

View File

@ -7,16 +7,17 @@
<result property="monitoringIndicators" column="monitoring_indicators" jdbcType="VARCHAR"/>
<result property="monitoringValues" column="monitoring_values" jdbcType="DOUBLE"/>
<result property="abnormalCause" column="abnormal_cause" jdbcType="VARCHAR"/>
<result property="warningTime" column="warning_time" jdbcType="VARCHAR"/>
<result property="warningTime" column="warning_time" jdbcType="TIMESTAMP"/>
<result property="aaus" column="aaus" jdbcType="VARCHAR"/>
</resultMap>
<select id="selectByTime" resultMap="WarningInformationMap">
select * from ruoyi.warning_information
where warning_time between #{startTime} and #{endTime}
<if test="startTime != null and endTime != null">
where warning_time between #{startTime} and #{endTime}
</if>
order by warning_time desc
</select>
<insert id="insert">

View File

@ -0,0 +1,76 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.crops.mapper.WeatherPredictionMapper">
<resultMap type="com.ruoyi.crops.domain.WeatherPredictionEntity" id="WeatherPredictionMap">
<result property="id" column="id" jdbcType="INTEGER"/>
<result property="weatherTime" column="weather_time" jdbcType="TIMESTAMP"/>
<result property="weatherName" column="weather_name" jdbcType="VARCHAR"/>
<result property="airTemperature" column="air_temperature" jdbcType="VARCHAR"/>
<result property="precipitation" column="precipitation" jdbcType="VARCHAR"/>
<result property="windSpeed" column="wind_speed" jdbcType="VARCHAR"/>
<result property="windDirection" column="wind_direction" jdbcType="VARCHAR"/>
<result property="atmosphericPressure" column="atmospheric_pressure" jdbcType="VARCHAR"/>
<result property="humidity" column="humidity" jdbcType="VARCHAR"/>
<result property="cloudCover" column="cloud_cover" jdbcType="VARCHAR"/>
</resultMap>
<insert id="insert">
insert into ruoyi.weather_prediction(weather_time, weather_name, air_temperature, precipitation, wind_speed,
wind_direction, atmospheric_pressure, humidity, cloud_cover)
values (#{weatherTime}, #{weatherName}, #{airTemperature}, #{precipitation}, #{windSpeed},
#{windDirection}, #{atmosphericPressure}, #{humidity}, #{cloudCover})
on duplicate key update weather_time = values(weather_time)
, weather_name = values(weather_name)
, air_temperature = values(air_temperature)
, precipitation = values(precipitation)
, wind_speed = values(wind_speed)
, wind_direction = values(wind_direction)
, atmospheric_pressure = values(atmospheric_pressure)
, humidity = values(humidity)
, cloud_cover = values(cloud_cover)
</insert>
<insert id="insertBatch">
insert into ruoyi.weather_prediction(weather_time, weather_name, air_temperature, precipitation, wind_speed,
wind_direction, atmospheric_pressure, humidity, cloud_cover)
value
<foreach collection="list" item="entity" separator=",">
(#{entity.weatherTime}, #{entity.weatherName}, #{entity.airTemperature},
#{entity.precipitation}, #{entity.windSpeed}, #{entity.windDirection}, #{entity.atmosphericPressure},
#{entity.humidity}, #{entity.cloudCover})
</foreach>
on duplicate key update
weather_time=values(weather_time),
weather_name=values(weather_name),
air_temperature=values(air_temperature),
precipitation=values(precipitation),
wind_speed=values(wind_speed),
wind_direction=values(wind_direction),
atmospheric_pressure=values(atmospheric_pressure),
humidity=values(humidity),
cloud_cover=values(cloud_cover)
</insert>
<select id="selectWeek" resultMap="WeatherPredictionMap">
SELECT *
FROM ruoyi.weather_prediction
WHERE DATE(weather_time) BETWEEN CURDATE() and DATE_ADD(CURDATE(), interval 7 day);
</select>
<select id="selectByTime"
resultType="com.ruoyi.crops.domain.vo.WeatherPredoctionVo">
select max(air_temperature) as maxAirTemperature,
min(air_temperature) as minAirTemperature,
max(humidity) as maxHumidity,
min(humidity) as minHumidity,
avg(wind_speed) as windSpeed,
avg(precipitation) as precipitation
from ruoyi.weather_prediction
where DATE(weather_time) = DATE(#{time})
</select>
<select id="select" resultMap="WeatherPredictionMap">
select * from ruoyi.weather_prediction
where DATE (weather_time) = #{time}
</select>
</mapper>