庞家镇

This commit is contained in:
2023-07-01 16:06:17 +08:00
parent 27c29fca42
commit 8fb45cb66f
15 changed files with 263 additions and 20 deletions

View File

@ -0,0 +1,48 @@
package com.ruoyi.crops.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import java.util.Date;
/**
* 发布shp地图服务文件表;
* @author : http://www.chiner.pro
* @date : 2023-6-30
*/
public class GeoserverShp{
@JsonInclude(JsonInclude.Include.NON_EMPTY)
private Integer id ;
private String fileName ;
@JsonFormat(pattern="yyyy-MM-dd",timezone = "GMT+8")
private Date time ;
public Integer getId(){
return this.id;
}
public void setId(Integer id){
this.id=id;
}
public String getFileName(){
return this.fileName;
}
public void setFileName(String fileName){
this.fileName=fileName;
}
public Date getTime(){
return this.time;
}
public void setTime(Date time){
this.time=time;
}
@Override
public String toString() {
return "GeoserverShp{" +
"id=" + id +
", fileName='" + fileName + '\'' +
", time='" + time + '\'' +
'}';
}
}

View File

@ -5,6 +5,8 @@ public class FarmMachineryVo {
private Integer id ;
/** 农机编号 */
private String vehicleno ;
/** 终端编号 */
private String vmeid ;
/** 农机类型 */
private String vehicletype ;
/** 车主姓名 */
@ -41,4 +43,12 @@ public class FarmMachineryVo {
public void setOwnername(String ownername) {
this.ownername = ownername;
}
public String getVmeid() {
return vmeid;
}
public void setVmeid(String vmeid) {
this.vmeid = vmeid;
}
}

View File

@ -0,0 +1,15 @@
package com.ruoyi.crops.mapper;
import com.ruoyi.crops.domain.GeoserverShp;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
public interface GeoserverShpMapper {
List<GeoserverShp> queryByTime(@Param("beginTime")Date beginTime, @Param("endTime")Date endTime);
void insert(GeoserverShp geoserverShp);
int deleteById(Integer id);
}

View File

@ -11,7 +11,6 @@ import org.locationtech.jts.geom.Coordinate;
import java.util.Date;
import java.util.List;
import java.util.Map;
public interface IFarmMachineryService {

View File

@ -6,6 +6,6 @@ import com.ruoyi.crops.domain.ServiceType;
public interface IGeoServer {
public String publishTiff(String workSpace, String storeName, String filePath ,String styleName) throws Exception;
public String publishShp(String workSpace, String storeName, String layername, String filePath);
public Boolean publishShp(String workSpace, String storeName, String layername, String filePath);
int insert(ServiceType serviceType);
}

View File

@ -0,0 +1,36 @@
package com.ruoyi.crops.service;
import com.ruoyi.crops.domain.GeoserverShp;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import java.util.Date;
import java.util.List;
/**
* 发布shp地图服务文件表;(geoserver_shp)表服务接口
* @author : http://www.chiner.pro
* @date : 2023-6-30
*/
public interface IGeoserverShpService {
/**
* 通过时间查询
*/
List<GeoserverShp> queryByTime(Date begintime,Date endtime);
/**
* 新增数据
*
* @param geoserverShp 实例对象
* @return 实例对象
*/
GeoserverShp insert(GeoserverShp geoserverShp);
/**
* 通过主键删除数据
*
* @param id 主键
* @return 是否成功
*/
boolean deleteById(Integer id);
}

View File

@ -72,8 +72,8 @@ public class GeoServerImpl implements IGeoServer {
}
@Override
public String publishShp(String workSpace, String storeName, String layername, String filePath) {
String result="";
public Boolean publishShp(String workSpace, String storeName, String layername, String filePath) {
boolean result = false;
try {
File zipFile=new File(filePath);
GeoServerRESTReader reader = new GeoServerRESTReader(url, username, password);
@ -92,10 +92,10 @@ public class GeoServerImpl implements IGeoServer {
if(workspaces.contains(workSpace)){
if(publisher.publishShp(workSpace, storeName, layername, zipFile, "EPSG:4326")){
result = "发布成功!";
} else {
result = "发布失败!";
// result = "发布成功!";
result = true;
}
}
}catch (Exception e){
e.printStackTrace();

View File

@ -0,0 +1,50 @@
package com.ruoyi.crops.service.impl;
import com.ruoyi.crops.domain.GeoserverShp;
import com.ruoyi.crops.mapper.GeoserverShpMapper;
import com.ruoyi.crops.service.IGeoserverShpService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
/**
* 发布shp地图服务文件表;(geoserver_shp)表服务实现类
* @author : http://www.chiner.pro
* @date : 2023-6-30
*/
@Service
public class GeoserverShpServiceImpl implements IGeoserverShpService {
@Autowired
private GeoserverShpMapper geoserverShpMapper;
/**
* 通过时间查询
*/
public List<GeoserverShp> queryByTime(Date beginTime,Date endTime){
return geoserverShpMapper.queryByTime(beginTime,endTime);
}
/**
* 新增数据
*
* @param geoserverShp 实例对象
* @return 实例对象
*/
public GeoserverShp insert(GeoserverShp geoserverShp){
geoserverShpMapper.insert(geoserverShp);
return geoserverShp;
}
/**
* 通过主键删除数据
*
* @param id 主键
* @return 是否成功
*/
public boolean deleteById(Integer id){
int total = geoserverShpMapper.deleteById(id);
return total > 0;
}
}

View File

@ -16,7 +16,7 @@
<result property="belongcorp" column="belongcorp" jdbcType="VARCHAR"/>
</resultMap>
<select id="selectMachineryData" resultType="com.ruoyi.crops.domain.vo.FarmMachineryVo">
select id,vehicletype,vehicleno,ownername
select id,vehicletype,vmeid,vehicleno,ownername
from ruoyi.farm_machinery
<where>
<if test="vehicleno != null and vehicleno!=''">

View File

@ -0,0 +1,23 @@
<?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.GeoserverShpMapper">
<resultMap type="com.ruoyi.crops.domain.GeoserverShp" id="GeoserverShpMap">
<result property="id" column="id" jdbcType="INTEGER"/>
<result property="fileName" column="file_name" jdbcType="VARCHAR"/>
<result property="time" column="time" jdbcType="DATE"/>
</resultMap>
<select id="queryByTime" resultMap="GeoserverShpMap">
select file_name,time from ruoyi.geoserver_shp where time between #{beginTime} and #{endTime}
</select>
<insert id="insert">
insert into ruoyi.geoserver_shp(file_name, time)
select #{fileName} ,#{time}
where not exists (select file_name from ruoyi.geoserver_shp where file_name = #{fileName})
</insert>
<delete id="deleteById">
delete from ruoyi.geoserver_shp where id = #{id}
</delete>
</mapper>

View File

@ -34,7 +34,7 @@
</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
select fm.vehicletype,mjd.vehicleno,mjd.vmeid,mjd.jobday,mjd.jobarea,fm.ownername,fm.ownertel,mjd.jobtype,mjd.area,mjd.workHours
from ruoyi.machinery_job_data mjd
left join ruoyi.farm_machinery fm on mjd.vmeid = fm.vmeid
<where>