Compare commits
No commits in common. "main" and "dev_zsh" have entirely different histories.
BIN
CreateWordXDDFChart.docx
Normal file
BIN
CreateWordXDDFChart.docx
Normal file
Binary file not shown.
@ -18,23 +18,15 @@
|
||||
<dependencies>
|
||||
|
||||
<dependency>
|
||||
|
||||
<groupId>org.apache.poi</groupId>
|
||||
|
||||
<artifactId>poi</artifactId>
|
||||
|
||||
<version>4.0.1</version>
|
||||
|
||||
<version>4.1.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
||||
<groupId>org.apache.poi</groupId>
|
||||
|
||||
<artifactId>poi-ooxml</artifactId>
|
||||
|
||||
<version>4.0.1</version>
|
||||
|
||||
<version>4.1.2</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
@ -93,6 +85,9 @@
|
||||
<artifactId>ruoyi-generator</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
@ -8,7 +8,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
||||
|
||||
/**
|
||||
@ -23,6 +23,7 @@ public class RuoYiApplication
|
||||
public static void main(String[] args)
|
||||
{
|
||||
|
||||
|
||||
// System.setProperty("spring.devtools.restart.enabled", "false");
|
||||
SpringApplication.run(RuoYiApplication.class, args);
|
||||
System.out.println();
|
||||
|
@ -1,41 +1,34 @@
|
||||
package com.ruoyi.web.controller.shate;
|
||||
|
||||
import ch.qos.logback.core.pattern.color.MagentaCompositeConverter;
|
||||
import com.mysql.cj.x.protobuf.MysqlxResultset;
|
||||
import com.fasterxml.jackson.datatype.jsr310.deser.InstantDeserializer;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.utils.file.UrlFileUpload;
|
||||
import com.ruoyi.common.utils.BarChart;
|
||||
import com.ruoyi.common.utils.CustomXWPFDocument;
|
||||
import com.ruoyi.common.utils.shate.PageUtils;
|
||||
|
||||
import com.ruoyi.system.domain_shate.*;
|
||||
import com.ruoyi.system.service_shate.IDateUploadService;
|
||||
import com.sun.jna.platform.win32.OaIdl;
|
||||
import com.sun.jna.platform.win32.ShTypes;
|
||||
import com.ruoyi.system.service_shate.*;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.apache.commons.compress.utils.IOUtils;
|
||||
import org.apache.poi.openxml4j.opc.internal.unmarshallers.PackagePropertiesUnmarshaller;
|
||||
import io.swagger.v3.oas.models.security.SecurityScheme;
|
||||
import net.sf.jsqlparser.statement.create.procedure.CreateProcedure;
|
||||
import org.apache.poi.xwpf.usermodel.XWPFDocument;
|
||||
import org.springframework.boot.autoconfigure.web.ServerProperties;
|
||||
import org.springframework.util.ResourceUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Node;
|
||||
import org.w3c.dom.NodeList;
|
||||
import oshi.driver.mac.net.NetStat;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.ServletOutputStream;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import java.io.*;
|
||||
import java.text.ParseException;
|
||||
import java.lang.reflect.AnnotatedArrayType;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Properties;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.concurrent.ScheduledThreadPoolExecutor;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @Author: JinSheng Song
|
||||
@ -45,11 +38,22 @@ import java.util.concurrent.TimeUnit;
|
||||
@RequestMapping(value = "/api/Upload", produces = "application/json;charset=UTF-8")
|
||||
@Api(tags = "文件上传记录")
|
||||
|
||||
public class DateUploadController
|
||||
{
|
||||
public class DateUploadController {
|
||||
@Resource
|
||||
IPlantingSuitabilityService plantingSuitabilityService;
|
||||
@Resource
|
||||
ILandUseServices landUseServices;
|
||||
@Resource
|
||||
IVegetationHealthServices vegetationHealthServices;
|
||||
@Resource
|
||||
private IDateUploadService service;
|
||||
|
||||
@Resource
|
||||
private ITopographicFactorService factorService;
|
||||
|
||||
@Resource
|
||||
ISeedingSuccessService seedingSuccessService;
|
||||
|
||||
private String FilePathName;
|
||||
|
||||
private String ExePathName;
|
||||
@ -59,50 +63,48 @@ public class DateUploadController
|
||||
private String ShpPaths;
|
||||
|
||||
|
||||
@RequestMapping(value = "/SelectUpload",method = {RequestMethod.POST})
|
||||
public AjaxResult SelectUpload(@RequestBody paging paging)
|
||||
{
|
||||
String type1=paging.getType1().replace(" ","");
|
||||
String type=paging.getType().replace(" ","");
|
||||
String type2="";
|
||||
if (paging.getType2()!=null)
|
||||
{
|
||||
type2= paging.getType2().toUpperCase();
|
||||
@RequestMapping(value = "/SelectUpload", method = {RequestMethod.POST})
|
||||
public AjaxResult SelectUpload(@RequestBody paging paging) {
|
||||
// LocalDate tomorrow = LocalDate.of(2022,10,2);
|
||||
// LocalDate today = LocalDate.now();
|
||||
//
|
||||
// if(tomorrow.isAfter(today)==false)
|
||||
// {
|
||||
// return AjaxResult.error("软件授权日期已过,请联系管理人员!");
|
||||
// }
|
||||
|
||||
String type1 = paging.getType1().replace(" ", "");
|
||||
String type = paging.getType().replace(" ", "");
|
||||
String type2 = "";
|
||||
|
||||
if (paging.getType2() != null) {
|
||||
type2 = paging.getType2().toUpperCase();
|
||||
}
|
||||
String date=paging.getUploadTime();
|
||||
String name=paging.getType3();
|
||||
String dateTime =paging.getDateTime();
|
||||
String date = paging.getUploadTime();
|
||||
String name = paging.getType3();
|
||||
String dateTime = paging.getDateTime();
|
||||
|
||||
|
||||
if ( name!=null && name!="")
|
||||
{
|
||||
if (name.equals("1"))
|
||||
{
|
||||
name="M_Heal";
|
||||
}
|
||||
else if(name.equals("2"))
|
||||
{
|
||||
name="H_Heal%";
|
||||
if (name != null && name != "") {
|
||||
if (name.equals("1")) {
|
||||
name = "M_Heal%";
|
||||
} else if (name.equals("2")) {
|
||||
name = "H_Heal%";
|
||||
}
|
||||
|
||||
}
|
||||
List<DateUpload> Seeding= service.selectUpload(paging.getZone(),type.toUpperCase(), type1.toUpperCase(),
|
||||
type2,paging.getYear(),date,name,dateTime);
|
||||
pageVO vaue=new pageVO();
|
||||
List<?> value= PageUtils.getListPaging(Seeding,paging.getPageNum(),paging.getPageSize());
|
||||
List<DateUpload> Seeding = service.selectUpload(paging.getZone(), type.toUpperCase(), type1.toUpperCase(),
|
||||
type2, paging.getYear(), date, name, dateTime);
|
||||
pageVO vaue = new pageVO();
|
||||
List<?> value = PageUtils.getListPaging(Seeding, paging.getPageNum(), paging.getPageSize());
|
||||
vaue.setValue(value);
|
||||
vaue.setTotal(Seeding.size());
|
||||
return AjaxResult.success(vaue);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@RequestMapping(value = "/delUpload",method = {RequestMethod.POST})
|
||||
public AjaxResult DelUpload(@RequestBody UplodFile uplodFile)
|
||||
{
|
||||
@RequestMapping(value = "/delUpload", method = {RequestMethod.POST})
|
||||
public AjaxResult DelUpload(@RequestBody UplodFile uplodFile) {
|
||||
return delUploadFile(uplodFile.getId());
|
||||
// List<Integer> ids=uplodFile.getId();
|
||||
// Integer Seeding=0;
|
||||
@ -124,84 +126,77 @@ public class DateUploadController
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(value = "/delUpload1",method = {RequestMethod.DELETE})
|
||||
public AjaxResult DelUpload1(@RequestParam("id") List<Integer> id)
|
||||
{
|
||||
List<Integer> ids=id;
|
||||
Integer Seeding=0;
|
||||
for (int i=0; i<ids.size();i++)
|
||||
{
|
||||
Seeding= service.DelUpload(ids.get(i));
|
||||
if (Seeding==0){return AjaxResult.error("没有此id单据!"+ids.get(i));}
|
||||
@RequestMapping(value = "/delUpload1", method = {RequestMethod.DELETE})
|
||||
public AjaxResult DelUpload1(@RequestParam("id") List<Integer> id) {
|
||||
List<Integer> ids = id;
|
||||
Integer Seeding = 0;
|
||||
for (int i = 0; i < ids.size(); i++) {
|
||||
Seeding = service.DelUpload(ids.get(i));
|
||||
if (Seeding == 0) {
|
||||
return AjaxResult.error("没有此id单据!" + ids.get(i));
|
||||
}
|
||||
}
|
||||
return AjaxResult.success(Seeding);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(value = "/InitShp",method = {RequestMethod.POST})
|
||||
public AjaxResult InitShp(@RequestBody UplodFile uplodFile)
|
||||
{
|
||||
List<DateUpload> dateUploads=infr(uplodFile.getDateUploads());
|
||||
@RequestMapping(value = "/InitShp", method = {RequestMethod.POST})
|
||||
public AjaxResult InitShp(@RequestBody UplodFile uplodFile) {
|
||||
List<DateUpload> dateUploads = infr(uplodFile.getDateUploads());
|
||||
|
||||
for (int i=0; i<dateUploads.size();i++)
|
||||
{
|
||||
Integer Seeding= service.IntoShp(dateUploads.get(i));
|
||||
for (int i = 0; i < dateUploads.size(); i++) {
|
||||
Integer Seeding = service.IntoShp(dateUploads.get(i));
|
||||
}
|
||||
|
||||
return AjaxResult.success("成功");
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(value = "/InitUpload",method = {RequestMethod.POST})
|
||||
public AjaxResult InitUpload(@RequestBody UplodFile uplodFile)
|
||||
{
|
||||
@RequestMapping(value = "/InitUpload", method = {RequestMethod.POST})
|
||||
public AjaxResult InitUpload(@RequestBody UplodFile uplodFile) {
|
||||
|
||||
readXml();
|
||||
|
||||
List<DateUpload> dateUploads=infr(uplodFile.getDateUploads());
|
||||
List<DateUpload> dateUploads = infr(uplodFile.getDateUploads());
|
||||
|
||||
for (int i=0; i<dateUploads.size();i++)
|
||||
{
|
||||
Integer Seeding= service.IntoUpload(dateUploads.get(i));
|
||||
for (int i = 0; i < dateUploads.size(); i++) {
|
||||
Integer Seeding = service.IntoUpload(dateUploads.get(i));
|
||||
|
||||
}
|
||||
|
||||
return AjaxResult.success("成功");
|
||||
}
|
||||
|
||||
private List<DateUpload> infr(List<DateUpload> dateUpload)
|
||||
{
|
||||
for (int i=0;i<dateUpload.size();i++)
|
||||
{
|
||||
private List<DateUpload> infr(List<DateUpload> dateUpload) {
|
||||
for (int i = 0; i < dateUpload.size(); i++) {
|
||||
|
||||
String [] typesList=dateUpload.get(i).getType1().split("\\/");
|
||||
String[] typesList = dateUpload.get(i).getType1().split("\\/");
|
||||
|
||||
String type1=typesList[1].replace(" ","").toUpperCase();
|
||||
String type1 = typesList[1].replace(" ", "").toUpperCase();
|
||||
|
||||
String type=typesList[0].replace(" ","").toUpperCase();
|
||||
String type = typesList[0].replace(" ", "").toUpperCase();
|
||||
|
||||
|
||||
Date d=new Date();
|
||||
Date d = new Date();
|
||||
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
|
||||
|
||||
String dateNowStr = sdf.format(d);
|
||||
if(type1.equals("EVALUATIONINDICATORS"))
|
||||
{
|
||||
if (type1.equals("EVALUATIONINDICATORS")) {
|
||||
String[] strs = dateUpload.get(i).getFileName().split("\\.");
|
||||
|
||||
String name=strs[0];
|
||||
String name = strs[0];
|
||||
|
||||
String[] strs2=name.split("\\_");
|
||||
String[] strs2 = name.split("\\_");
|
||||
|
||||
String[] typeValue=name.split("2");
|
||||
String[] typeValue = name.split("2");
|
||||
|
||||
String type2=typeValue[0];
|
||||
String type2 = typeValue[0];
|
||||
|
||||
String name1=strs2[strs2.length-1];
|
||||
String name1 = strs2[strs2.length - 1];
|
||||
|
||||
String name2=strs2[strs2.length-2];
|
||||
String name2 = strs2[strs2.length - 2];
|
||||
|
||||
dateUpload.get(i).setDataTime(name2);
|
||||
|
||||
@ -213,34 +208,33 @@ public class DateUploadController
|
||||
|
||||
dateUpload.get(i).setType1(type1);
|
||||
|
||||
dateUpload.get(i).setYear(name2.substring(0,4));
|
||||
dateUpload.get(i).setYear(name2.substring(0, 4));
|
||||
|
||||
dateUpload.get(i).setType2(type2.substring(0,type2.length()-1).toUpperCase());
|
||||
dateUpload.get(i).setType2(type2.substring(0, type2.length() - 1).toUpperCase());
|
||||
|
||||
dateUpload.get(i).setExtent1(dateUpload.get(i).getExtent().toString());
|
||||
|
||||
DateUpload uploadValue=service.selectShp(name1,type,"");
|
||||
MyThread1 demo=new MyThread1(name.replace(".tif",""),
|
||||
FilePaths+dateUpload.get(i).getData_id(),
|
||||
ShpPaths+uploadValue.getData_id());
|
||||
DateUpload uploadValue = service.selectShp(name1, type, "");
|
||||
MyThread1 demo = new MyThread1(name.replace(".tif", ""),
|
||||
FilePaths + dateUpload.get(i).getData_id(),
|
||||
ShpPaths + uploadValue.getData_id());
|
||||
demo.run();
|
||||
|
||||
}
|
||||
else if(type1.equals("BOUNDARIES"))//Boundaries
|
||||
} else if (type1.equals("BOUNDARIES"))//Boundaries
|
||||
{
|
||||
String[] strs = dateUpload.get(i).getFileName().split("\\.");
|
||||
|
||||
String name=strs[0];
|
||||
String name = strs[0];
|
||||
|
||||
String[] strs2=name.split("\\_");
|
||||
String[] strs2 = name.split("\\_");
|
||||
|
||||
String name1=strs2[strs2.length-1];
|
||||
String name1 = strs2[strs2.length - 1];
|
||||
|
||||
dateUpload.get(i).setZone(name1);
|
||||
|
||||
dateUpload.get(i).setCreatedTime(dateNowStr);
|
||||
|
||||
dateUpload.get(i).setYear(dateNowStr.substring(0,4));
|
||||
dateUpload.get(i).setYear(dateNowStr.substring(0, 4));
|
||||
|
||||
dateUpload.get(i).setType(type);
|
||||
|
||||
@ -248,22 +242,20 @@ public class DateUploadController
|
||||
|
||||
dateUpload.get(i).setExtent1(dateUpload.get(i).getExtent().toString());
|
||||
|
||||
}
|
||||
else if(type1.equals("LANDUSE"))
|
||||
{
|
||||
} else if (type1.equals("LANDUSE")) {
|
||||
String[] strs = dateUpload.get(i).getFileName().split("\\.");
|
||||
|
||||
String name=strs[0];
|
||||
String name = strs[0];
|
||||
|
||||
String[] strs2=name.split("\\_");
|
||||
String[] strs2 = name.split("\\_");
|
||||
|
||||
String[] typeValue=name.split("2");
|
||||
String[] typeValue = name.split("2");
|
||||
|
||||
String type2=typeValue[0];
|
||||
String type2 = typeValue[0];
|
||||
|
||||
String name1=strs2[strs2.length-1];
|
||||
String name1 = strs2[strs2.length - 1];
|
||||
|
||||
String name2=strs2[strs2.length-2];
|
||||
String name2 = strs2[strs2.length - 2];
|
||||
|
||||
dateUpload.get(i).setDataTime(name2);
|
||||
|
||||
@ -275,34 +267,32 @@ public class DateUploadController
|
||||
|
||||
dateUpload.get(i).setType1(type1);
|
||||
|
||||
dateUpload.get(i).setYear(name2.substring(0,4));
|
||||
dateUpload.get(i).setYear(name2.substring(0, 4));
|
||||
|
||||
dateUpload.get(i).setType2(type2.substring(0,type2.length()-1).toUpperCase());
|
||||
dateUpload.get(i).setType2(type2.substring(0, type2.length() - 1).toUpperCase());
|
||||
|
||||
dateUpload.get(i).setExtent1(dateUpload.get(i).getExtent().toString());
|
||||
|
||||
DateUpload uploadValue=service.selectShp(name1,type,"");
|
||||
MyThread1 demo=new MyThread1(name.replace(".tif",""),
|
||||
FilePaths+dateUpload.get(i).getData_id(),
|
||||
ShpPaths+uploadValue.getData_id());
|
||||
DateUpload uploadValue = service.selectShp(name1, type, "");
|
||||
MyThread1 demo = new MyThread1(name.replace(".tif", ""),
|
||||
FilePaths + dateUpload.get(i).getData_id(),
|
||||
ShpPaths + uploadValue.getData_id());
|
||||
demo.run();
|
||||
|
||||
}
|
||||
else if(type1.equals("SUITABILITY"))
|
||||
{
|
||||
} else if (type1.equals("SUITABILITY")) {
|
||||
String[] strs = dateUpload.get(i).getFileName().split("\\.");
|
||||
|
||||
String name=strs[0];
|
||||
String name = strs[0];
|
||||
|
||||
String[] strs2=name.split("\\_");
|
||||
String[] strs2 = name.split("\\_");
|
||||
|
||||
String[] typeValue=name.split("2");
|
||||
String[] typeValue = name.split("2");
|
||||
|
||||
String type2=typeValue[0];
|
||||
String type2 = typeValue[0];
|
||||
|
||||
String name1=strs2[strs2.length-1];
|
||||
String name1 = strs2[strs2.length - 1];
|
||||
|
||||
String name2=strs2[strs2.length-2];
|
||||
String name2 = strs2[strs2.length - 2];
|
||||
|
||||
dateUpload.get(i).setDataTime(name2);
|
||||
|
||||
@ -314,36 +304,34 @@ public class DateUploadController
|
||||
|
||||
dateUpload.get(i).setType1(type1);
|
||||
|
||||
dateUpload.get(i).setYear(name2.substring(0,4));
|
||||
dateUpload.get(i).setYear(name2.substring(0, 4));
|
||||
|
||||
dateUpload.get(i).setType2(type2.substring(0,type2.length()-1).toUpperCase());
|
||||
dateUpload.get(i).setType2(type2.substring(0, type2.length() - 1).toUpperCase());
|
||||
|
||||
dateUpload.get(i).setExtent1(dateUpload.get(i).getExtent().toString());
|
||||
|
||||
DateUpload uploadValue=service.selectShp(name1,type,"");
|
||||
DateUpload uploadValue = service.selectShp(name1, type, "");
|
||||
|
||||
MyThread1 demo=new MyThread1(name.replace(".tif",""),
|
||||
FilePaths+dateUpload.get(i).getData_id(),
|
||||
ShpPaths+uploadValue.getData_id());
|
||||
MyThread1 demo = new MyThread1(name.replace(".tif", ""),
|
||||
FilePaths + dateUpload.get(i).getData_id(),
|
||||
ShpPaths + uploadValue.getData_id());
|
||||
demo.run();
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
String[] strs = dateUpload.get(i).getFileName().split("\\.");
|
||||
|
||||
String name=strs[0];
|
||||
String name = strs[0];
|
||||
|
||||
String[] strs2=name.split("\\_");
|
||||
String[] strs2 = name.split("\\_");
|
||||
|
||||
String name1=strs2[strs2.length-1];
|
||||
String name1 = strs2[strs2.length - 1];
|
||||
|
||||
String name2=strs2[strs2.length-2];
|
||||
String name2 = strs2[strs2.length - 2];
|
||||
|
||||
dateUpload.get(i).setDataTime(name2);
|
||||
|
||||
Integer month=Integer.parseInt(name2.substring(4,6));
|
||||
Integer month = Integer.parseInt(name2.substring(4, 6));
|
||||
|
||||
dateUpload.get(i).setYear(name2.substring(0,4));
|
||||
dateUpload.get(i).setYear(name2.substring(0, 4));
|
||||
|
||||
dateUpload.get(i).setMonth(month);
|
||||
|
||||
@ -358,10 +346,10 @@ public class DateUploadController
|
||||
dateUpload.get(i).setExtent1(dateUpload.get(i).getExtent().toString());
|
||||
|
||||
|
||||
DateUpload uploadValue=service.selectShp(name1,type,"");
|
||||
MyThread1 demo=new MyThread1(name.replace(".tif",""),
|
||||
FilePaths+dateUpload.get(i).getData_id(),
|
||||
ShpPaths+uploadValue.getData_id());
|
||||
DateUpload uploadValue = service.selectShp(name1, type, "");
|
||||
MyThread1 demo = new MyThread1(name.replace(".tif", ""),
|
||||
FilePaths + dateUpload.get(i).getData_id(),
|
||||
ShpPaths + uploadValue.getData_id());
|
||||
demo.run();
|
||||
|
||||
}
|
||||
@ -372,15 +360,15 @@ public class DateUploadController
|
||||
|
||||
/**
|
||||
* 调用exe
|
||||
*
|
||||
* @param fileName 文件名称
|
||||
* @param filePath tif文件路径
|
||||
* @param shpPath shp文件路径
|
||||
*/
|
||||
@RequestMapping(value = "/callExe",method = {RequestMethod.GET})
|
||||
public void callExe(String fileName,String filePath,String shpPath)
|
||||
{
|
||||
BufferedReader bufferedReader=null;
|
||||
Process proc=null;
|
||||
@RequestMapping(value = "/callExe", method = {RequestMethod.GET})
|
||||
public void callExe(String fileName, String filePath, String shpPath) {
|
||||
BufferedReader bufferedReader = null;
|
||||
Process proc = null;
|
||||
try {
|
||||
|
||||
// String til = UrlFileUpload.fileUpload(filePath,FilePathName);
|
||||
@ -388,30 +376,31 @@ public class DateUploadController
|
||||
// String shp = UrlFileUpload.fileUpload(shpPath,FilePathName);
|
||||
String[] cmd = {ExePathName,
|
||||
fileName,
|
||||
filePath+".tif",
|
||||
shpPath+".zip"};
|
||||
filePath + ".tif",
|
||||
shpPath + ".zip"};
|
||||
|
||||
ProcessBuilder pb = new ProcessBuilder();
|
||||
pb.command(cmd);
|
||||
proc=pb.start();
|
||||
proc = pb.start();
|
||||
System.out.println("Start calling algorithm");
|
||||
|
||||
bufferedReader =new BufferedReader(new InputStreamReader(proc.getErrorStream()));
|
||||
String aa=null;
|
||||
String line=null;
|
||||
while ((line=bufferedReader.readLine())!=null){
|
||||
aa=aa+line;
|
||||
bufferedReader = new BufferedReader(new InputStreamReader(proc.getErrorStream()));
|
||||
String aa = null;
|
||||
String line = null;
|
||||
while ((line = bufferedReader.readLine()) != null) {
|
||||
aa = aa + line;
|
||||
}
|
||||
System.out.println(aa);
|
||||
|
||||
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
System.out.println(e.getMessage());;
|
||||
System.out.println(e.getMessage());
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
public class MyThread1 extends Thread{
|
||||
public class MyThread1 extends Thread {
|
||||
|
||||
private String FileName;
|
||||
|
||||
@ -419,23 +408,25 @@ public class DateUploadController
|
||||
|
||||
private String ShpPath;
|
||||
|
||||
public MyThread1(String fileName,String filePath,String shpPath){
|
||||
public MyThread1(String fileName, String filePath, String shpPath) {
|
||||
this.FileName = fileName;
|
||||
this.FilePath = filePath;
|
||||
this.ShpPath = shpPath;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(){
|
||||
callExe(FileName,FilePath,ShpPath);
|
||||
public void run() {
|
||||
callExe(FileName, FilePath, ShpPath);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/delUploadFile",method = {RequestMethod.DELETE})
|
||||
@RequestMapping(value = "/delUploadFile", method = {RequestMethod.DELETE})
|
||||
public AjaxResult delUploadFile(List<Integer> id) {
|
||||
|
||||
|
||||
@ -446,11 +437,11 @@ public class DateUploadController
|
||||
|
||||
for (int i = 0; i < ids.size(); i++) {
|
||||
|
||||
Integer Seeding=0;
|
||||
Integer Seeding = 0;
|
||||
DateUpload value = service.selectDel(ids.get(i));
|
||||
|
||||
String type1=value.getType1();
|
||||
String type= value.getType();
|
||||
String type1 = value.getType1();
|
||||
String type = value.getType();
|
||||
|
||||
if (type1.equals("EVALUATIONINDICATORS")) {
|
||||
|
||||
@ -458,31 +449,34 @@ public class DateUploadController
|
||||
|
||||
String[] typeValue = value.getFileName().split("2");
|
||||
String type2 = typeValue[0];
|
||||
type2=type2.substring(0,type2.length()-1);
|
||||
file.UploadFile1(type2, value.getZone(), value.getDataTime(),service,"");
|
||||
Seeding= service.DelUpload(ids.get(i));
|
||||
if (Seeding==0){return AjaxResult.error("没有此id单据!"+ids.get(i));}
|
||||
type2 = type2.substring(0, type2.length() - 1);
|
||||
file.UploadFile1(type2, value.getZone(), value.getDataTime(), service, "");
|
||||
Seeding = service.DelUpload(ids.get(i));
|
||||
if (Seeding == 0) {
|
||||
return AjaxResult.error("没有此id单据!" + ids.get(i));
|
||||
}
|
||||
|
||||
}
|
||||
// &&
|
||||
// (type1.equals("RSIMAGES") || type1.equals("PLANTINGDISTRIBUTION") || type1.equals("VEGETATIONHEALTH"))
|
||||
else if (type.equals("VEGETATIONHEALTH"))
|
||||
{
|
||||
else if (type.equals("VEGETATIONHEALTH")) {
|
||||
String[] typeValue = value.getFileName().split("_");
|
||||
String resolution=typeValue[0];
|
||||
String resolution = typeValue[0];
|
||||
String type2 = "Heal";
|
||||
file.UploadFile1(type2, value.getZone(), value.getDataTime(),service,resolution);
|
||||
Seeding= service.DelUpload(ids.get(i));
|
||||
if (Seeding==0){return AjaxResult.error("没有此id单据!"+ids.get(i));}
|
||||
file.UploadFile1(type2, value.getZone(), value.getDataTime(), service, resolution);
|
||||
Seeding = service.DelUpload(ids.get(i));
|
||||
if (Seeding == 0) {
|
||||
return AjaxResult.error("没有此id单据!" + ids.get(i));
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
|
||||
String[] typeValue = value.getFileName().split("_");
|
||||
String type2 = typeValue[0];
|
||||
file.UploadFile1(type2, value.getZone(), value.getDataTime(),service,"");
|
||||
Seeding= service.DelUpload(ids.get(i));
|
||||
if (Seeding==0){return AjaxResult.error("没有此id单据!"+ids.get(i));}
|
||||
file.UploadFile1(type2, value.getZone(), value.getDataTime(), service, "");
|
||||
Seeding = service.DelUpload(ids.get(i));
|
||||
if (Seeding == 0) {
|
||||
return AjaxResult.error("没有此id单据!" + ids.get(i));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -501,7 +495,7 @@ public class DateUploadController
|
||||
|
||||
|
||||
File file = new File("route.xml");
|
||||
Document doc =db.parse(file);
|
||||
Document doc = db.parse(file);
|
||||
NodeList routeList = doc.getElementsByTagName("Rodel");
|
||||
// 遍历每个book节点
|
||||
for (int i = 0; i < routeList.getLength(); i++) {
|
||||
@ -517,14 +511,13 @@ public class DateUploadController
|
||||
// 区分,去掉空格和换行符
|
||||
if (childNodes.item(k).getNodeType() == Node.ELEMENT_NODE) {
|
||||
|
||||
this.ExePathName = childNodes.item(1).getTextContent().trim();
|
||||
|
||||
this.ExePathName=childNodes.item(1).getTextContent().trim();
|
||||
this.FilePathName = childNodes.item(3).getTextContent().trim();
|
||||
|
||||
this.FilePathName=childNodes.item(3).getTextContent().trim();
|
||||
this.FilePaths = childNodes.item(5).getTextContent().trim();
|
||||
|
||||
this.FilePaths=childNodes.item(5).getTextContent().trim();
|
||||
|
||||
this.ShpPaths=childNodes.item(7).getTextContent().trim();
|
||||
this.ShpPaths = childNodes.item(7).getTextContent().trim();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -533,4 +526,299 @@ public class DateUploadController
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 导出Word
|
||||
*
|
||||
* @param
|
||||
*/
|
||||
@RequestMapping(value = "/exportWord1", method = {RequestMethod.GET})
|
||||
@ResponseBody
|
||||
public void exportWord1(HttpServletResponse response, HttpServletRequest request) throws Exception {
|
||||
String [] zoneList=new String[]{"01","02","03"};
|
||||
//接受前端传来的数据
|
||||
String year = "2022";
|
||||
//创建文本对象
|
||||
CustomXWPFDocument docxDocument = new CustomXWPFDocument();
|
||||
//创建标题
|
||||
BarChart.setTitle(docxDocument, "Evaluation report of planting monitoring in ITBA Nature Reserve");
|
||||
//创建第一个段落的标题
|
||||
BarChart.createFirstLevelTopic(docxDocument, "1.Background information");
|
||||
//创建第一个段落的内容
|
||||
BarChart.createParagraphAndInsertWord(docxDocument, "Date time: " + year);
|
||||
String zoneString="";
|
||||
for (String zone:zoneList){
|
||||
zone+=" | ";
|
||||
zoneString+=zone;
|
||||
}
|
||||
zoneString=zoneString.substring(0,zoneString.length()-3);
|
||||
BarChart.createParagraphAndInsertWord(docxDocument, "Evaluation area: " + zoneString);
|
||||
Integer number=0;
|
||||
for (int i=0;i<zoneList.length;i++){
|
||||
String zone = zoneList[i];
|
||||
//2.1
|
||||
BarChart.createFirstLevelTopic(docxDocument, i+2+". Results of remote sensing monitoring of planting suitability"+"( zone:"+zone+")");
|
||||
//土地利用类型
|
||||
BarChart.createSecondLevelTopic(docxDocument, i+2+".1. Monitoring results of land use types");
|
||||
BarChart.insertPic(docxDocument, "C:\\Users\\HP\\Desktop\\文本文档\\1650791783(1).jpg");
|
||||
BarChart.setPicTitle(docxDocument, "Figure "+(number+1)+" Spatial distribution data of land use types");
|
||||
//绘制土地利用类型图表
|
||||
List<LandUse> landUses = landUseServices.sqlSeeding1(zone, year);
|
||||
UplodFile main = landUseServices.mainClass(zone, year);
|
||||
//x轴
|
||||
String[] xAxisData = new String[]{"Fields", "Buildings", "Roads", "Water", "Forest", "Grass", "Soil", "Desert", "Rocks", "Other"};
|
||||
//y轴
|
||||
Double[] yAxisData = new Double[]{landUses.get(0).getArea(), landUses.get(1).getArea(), landUses.get(2).getArea(), landUses.get(3).getArea(), landUses.get(4).getArea(), landUses.get(5).getArea(), landUses.get(6).getArea(), landUses.get(7).getArea(), landUses.get(8).getArea(), landUses.get(9).getArea()};
|
||||
BarChart.drawTable(docxDocument, xAxisData, yAxisData);//标题2图标
|
||||
BarChart.setPicTitle(docxDocument, "Figure "+(number+2)+" Statistical data on land use types");
|
||||
BarChart.createParagraphAndInsertWord(docxDocument, "In "+zone+" region, the total area of field is "+landUses.get(0).getArea()+" hm², the building is "+landUses.get(1).getArea()+" hm², the road is "+landUses.get(2).getArea()+" hm², the water is "+landUses.get(3).getArea()+" hm², the forest is "+landUses.get(4).getArea()+" hm², the grass is "+landUses.get(5).getArea()+" hm², the soil is "+landUses.get(6).getArea()+" hm², the desert is "+landUses.get(7).getArea()+" hm², the rock is "+landUses.get(8).getArea()+" hm², and other land use types are "+landUses.get(9).getArea()+" hm².");
|
||||
|
||||
BarChart.createSecondLevelTopic(docxDocument, i+2+".2 Monitoring results of planting suitability evaluation index");
|
||||
//2.2.1海拔、坡向、坡度
|
||||
//海拔
|
||||
BarChart.createSecondLevelTopic(docxDocument, i+2+".2.1. Monitoring results of terrain index");
|
||||
BarChart.insertPic(docxDocument, "C:\\Users\\HP\\Desktop\\文本文档\\1650791783(1).jpg");
|
||||
BarChart.setPicTitle(docxDocument, "Figure "+(number+3)+" Spatial distribution data of altitude");
|
||||
//绘制折线图(已取消)
|
||||
String[] xAxis = new String[]{"<400", "400-600", "600-100", "1000-1500", ">1500"};//x轴
|
||||
Double[] yAxis = new Double[]{main.getAltitudes().get(0).getLevel1(),
|
||||
main.getAltitudes().get(0).getLevel2(), main.getAltitudes().get(0).getLevel3(),
|
||||
main.getAltitudes().get(0).getLevel4(), main.getAltitudes().get(0).getLevel5()};//y轴
|
||||
BarChart.drawTable(docxDocument, xAxis, yAxis);
|
||||
BarChart.setPicTitle(docxDocument, "Figure "+(number+4)+" Classification statistics of altitude");
|
||||
BarChart.createParagraphAndInsertWord(docxDocument, "In " + zone + " region, the area with an altitude lower than 400m is " + main.getAltitudes().get(0).getLevel1() + " hm², the area with 400-600m is " + main.getAltitudes().get(0).getLevel2() + " hm², the area with 600-1000m is " + main.getAltitudes().get(0).getLevel3() + " hm², and the area with 1000-1500m is " + main.getAltitudes().get(0).getLevel4() + " hm². The area with an altitude higher than 1500m is " + main.getAltitudes().get(0).getLevel5() + " hm².");
|
||||
//坡向
|
||||
BarChart.insertPic(docxDocument, "C:\\Users\\HP\\Desktop\\文本文档\\1650791783(1).jpg");
|
||||
BarChart.setPicTitle(docxDocument, "Figure "+(number+5)+" Spatial distribution data of aspect");
|
||||
String[] xAspectAxis = new String[]{"North", "Northeast", "East", "Southeast", "South", "Southwest", "West", "NorthWest"};//x轴
|
||||
Double[] yAspectAxis = new Double[]{main.getAspects().get(0).getNorth(), main.getAspects().get(0).getNortheast(),
|
||||
main.getAspects().get(0).getEast(), main.getAspects().get(0).getSoutheast(), main.getAspects().get(0).getSouth(),
|
||||
main.getAspects().get(0).getSouthwest(), main.getAspects().get(0).getWest(), main.getAspects().get(0).getNorthwest()};//y轴
|
||||
BarChart.drawTable(docxDocument, xAspectAxis, yAspectAxis);//标题2图标
|
||||
BarChart.setPicTitle(docxDocument, "Figure "+(number+6)+" Classification statistics of aspect");
|
||||
BarChart.createParagraphAndInsertWord(docxDocument, "In " + zone + " region, the area with the north aspect is " + main.getAspects().get(0).getNorth() + " hm², the area with the northeast aspect is " + main.getAspects().get(0).getNortheast() + " hm², the area with the east aspect is " + main.getAspects().get(0).getEast() + " hm², the area with the southeast aspect is " + main.getAspects().get(0).getSoutheast() + " hm², and the area with the south aspect is " + main.getAspects().get(0).getNorth() + " hm², the area with the southwest aspect is " + main.getAspects().get(0).getSouthwest() + " hm², the area with the west aspect is " + main.getAspects().get(0).getWest() + " hm², and the area with the northwest aspect is " + main.getAspects().get(0).getNorthwest() + " hm².");
|
||||
//坡度
|
||||
BarChart.insertPic(docxDocument, "C:\\Users\\HP\\Desktop\\文本文档\\1650791783(1).jpg");
|
||||
BarChart.setPicTitle(docxDocument, "Figure "+(number+7)+" Spatial distribution data of slope");
|
||||
String[] xSlopeAxis = new String[]{"<10°", "10°~30°", "30°~50°", "50°~70°", ">70°"};//x轴
|
||||
Double[] ySlopeAxis = new Double[]{main.getSlopes().get(0).getLevel1(),
|
||||
main.getSlopes().get(0).getLevel2(), main.getSlopes().get(0).getLevel3(),
|
||||
main.getSlopes().get(0).getLevel4(), main.getSlopes().get(0).getLevel5()};
|
||||
BarChart.drawTable(docxDocument, xSlopeAxis, ySlopeAxis);//标题2图标
|
||||
BarChart.setPicTitle(docxDocument, "Figure "+(number+8)+" Classification statistics of slope");
|
||||
BarChart.createParagraphAndInsertWord(docxDocument, "In " + zone + " region, the area of slope less than 10° is " + main.getSlopes().get(0).getLevel1() + " hm2, the area of 10°-30° is " + main.getSlopes().get(0).getLevel2() + " hm2, the area of 30°-50° is " + main.getSlopes().get(0).getLevel3() + " hm2, and the area of 50°-70° is " + main.getSlopes().get(0).getLevel4() + "hm2. The area greater than 70° is " + main.getSlopes().get(0).getLevel5() + " hm2.");
|
||||
|
||||
//2.2.2 沙化指数、湿度指数、盐渍化指数
|
||||
BarChart.createSecondLevelTopic(docxDocument, i+2+".2.2. Monitoring results of soil index");
|
||||
//沙化指数
|
||||
BarChart.insertPic(docxDocument, "C:\\Users\\HP\\Desktop\\文本文档\\1650791783(1).jpg");
|
||||
BarChart.setPicTitle(docxDocument, "Figure "+(number+9)+" Spatial distribution data of soil desertification factor");
|
||||
String[] xDesertificationAxis = new String[]{"<0.1", "01~0.3", "0.3~0.5", "0.5~0.7", ">0.7"};//x轴
|
||||
Double[] yDesertificationAxis = new Double[]{main.getSoilDesertifications().get(0).getLevel1(),
|
||||
main.getSoilDesertifications().get(0).getLevel2(), main.getSoilDesertifications().get(0).getLevel3(),
|
||||
main.getSoilDesertifications().get(0).getLevel4(), main.getSoilDesertifications().get(0).getLevel5()};
|
||||
BarChart.drawTable(docxDocument, xDesertificationAxis, yDesertificationAxis);
|
||||
BarChart.setPicTitle(docxDocument, "Figure "+(number+10)+" Classification statistics of soil desertification factor");
|
||||
BarChart.createParagraphAndInsertWord(docxDocument, "In " + zone + " region, the area of soil desertification factor less than 0.1 is " + main.getSoilDesertifications().get(0).getLevel1() + " hm2, the area of 0.1-0.3 is " + main.getSoilDesertifications().get(0).getLevel2() + "hm2, the area of 0.3-0.5 is " + main.getSoilDesertifications().get(0).getLevel3() + " hm2, and the area of 0.5-0.7 is " + main.getSoilDesertifications().get(0).getLevel4() + " hm2. The area greater than 0.7 is " + main.getSoilDesertifications().get(0).getLevel5() + " hm2.");
|
||||
//湿度指数
|
||||
BarChart.insertPic(docxDocument, "C:\\Users\\HP\\Desktop\\文本文档\\1650791783(1).jpg");
|
||||
BarChart.setPicTitle(docxDocument, "Figure "+(number+11)+" Spatial distribution data of soil moisture factor");
|
||||
Double[] yMoistureAxis = new Double[]{main.getSoilMoistures().get(0).getLevel1(),
|
||||
main.getSoilMoistures().get(0).getLevel2(), main.getSoilMoistures().get(0).getLevel3(),
|
||||
main.getSoilMoistures().get(0).getLevel4(), main.getSoilMoistures().get(0).getLevel5()};
|
||||
BarChart.drawTable(docxDocument, xDesertificationAxis, yMoistureAxis);
|
||||
BarChart.setPicTitle(docxDocument, "Figure "+(number+12)+" Classification statistics of soil moisture factor");
|
||||
BarChart.createParagraphAndInsertWord(docxDocument, "In " + zone + " region, the area of soil moisture factor less than 0.1 is " + main.getSoilMoistures().get(0).getLevel1() + " hm2, the area of 0.1-0.3 is " + main.getSoilMoistures().get(0).getLevel2() + " hm2, the area of 0.3-0.5 is " + main.getSoilMoistures().get(0).getLevel3() + " hm2, and the area of 0.5-0.7 is " + main.getSoilMoistures().get(0).getLevel4() + "hm2. The area greater than 0.7 is " + main.getSoilMoistures().get(0).getLevel5() + " hm2.");
|
||||
//盐渍化指数
|
||||
BarChart.insertPic(docxDocument, "C:\\Users\\HP\\Desktop\\文本文档\\1650791783(1).jpg");
|
||||
BarChart.setPicTitle(docxDocument, "Figure "+(number+13)+" Spatial distribution data of soil salinization factor");
|
||||
Double[] ySalinizationsAxis = new Double[]{main.getSoilSalinizations().get(0).getLevel1(),
|
||||
main.getSoilSalinizations().get(0).getLevel2(), main.getSoilSalinizations().get(0).getLevel3(),
|
||||
main.getSoilSalinizations().get(0).getLevel4(), main.getSoilSalinizations().get(0).getLevel5()};
|
||||
BarChart.drawTable(docxDocument, xDesertificationAxis, ySalinizationsAxis);//标题2图标
|
||||
BarChart.setPicTitle(docxDocument, "Figure "+(number+14)+" Classification statistics of soil salinization factor");
|
||||
BarChart.createParagraphAndInsertWord(docxDocument, "In " + zone + " region, In 01 area, the area of soil salinization factor less than " + main.getSoilSalinizations().get(0).getLevel1() + " is 252 hm2, the area of 0.1-0.3 is " + main.getSoilSalinizations().get(0).getLevel2() + " hm2, the area of 0.3-0.5 is " + main.getSoilSalinizations().get(0).getLevel3() + " hm2, and the area of 0.5-0.7 is " + main.getSoilSalinizations().get(0).getLevel4() + " hm2. The area greater than 0.7 is " + main.getSoilSalinizations().get(0).getLevel5() + " hm2.");
|
||||
|
||||
//2.2.3 水域因子、道路因子
|
||||
BarChart.createSecondLevelTopic(docxDocument, "2.2.3. Monitoring results of regional index");
|
||||
//道路因子
|
||||
BarChart.insertPic(docxDocument, "C:\\Users\\HP\\Desktop\\文本文档\\1650791783(1).jpg");
|
||||
BarChart.setPicTitle(docxDocument, "Figure "+(number+15)+" Spatial distribution data of road factor");
|
||||
Double[] yRoadAxis = new Double[]{main.getRoadFactors().get(0).getLevel1(),
|
||||
main.getRoadFactors().get(0).getLevel2(), main.getRoadFactors().get(0).getLevel3(),
|
||||
main.getRoadFactors().get(0).getLevel4(), main.getRoadFactors().get(0).getLevel5()};
|
||||
BarChart.drawTable(docxDocument, xDesertificationAxis, yRoadAxis);//标题2图标
|
||||
BarChart.setPicTitle(docxDocument, "Figure "+(number+16)+" Classification statistics of road factor");
|
||||
BarChart.createParagraphAndInsertWord(docxDocument, "In " + zone + " region, the area of road factor less than 0.1 is " + main.getRoadFactors().get(0).getLevel1() + " hm2, the area of 0.1-0.3 is " + main.getRoadFactors().get(0).getLevel2() + " hm2, the area of 0.3-0.5 is " + main.getRoadFactors().get(0).getLevel3() + " hm2, and the area of 0.5-0.7 is " + main.getRoadFactors().get(0).getLevel4() + " hm2. The area greater than 0.7 is " + main.getRoadFactors().get(0).getLevel5() + "hm2.");
|
||||
//水域因子
|
||||
BarChart.insertPic(docxDocument, "C:\\Users\\HP\\Desktop\\文本文档\\1650791783(1).jpg");
|
||||
BarChart.setPicTitle(docxDocument, "Figure "+(number+17)+" Spatial distribution data of water factor");
|
||||
Double[] yWaterAxis = new Double[]{main.getWaterFactors().get(0).getLevel1(),
|
||||
main.getWaterFactors().get(0).getLevel2(), main.getWaterFactors().get(0).getLevel3(),
|
||||
main.getWaterFactors().get(0).getLevel4(), main.getWaterFactors().get(0).getLevel5()};
|
||||
BarChart.drawTable(docxDocument, xDesertificationAxis, yWaterAxis);//标题2图标
|
||||
BarChart.setPicTitle(docxDocument, "Figure "+(number+18)+" Classification statistics of water factor");
|
||||
BarChart.createParagraphAndInsertWord(docxDocument, "In " + zone + " region, the area of water factor less than 0.1 is " + main.getWaterFactors().get(0).getLevel1() + " hm2, the area of 0.1-0.3 is " + main.getWaterFactors().get(0).getLevel2() + " hm2, the area of 0.3-0.5 is " + main.getWaterFactors().get(0).getLevel3() + " hm2, and the area of 0.5-0.7 is " + main.getWaterFactors().get(0).getLevel4() + " hm2. The area greater than 0.7 is " + main.getWaterFactors().get(0).getLevel5() + " hm2.");
|
||||
//2.3
|
||||
BarChart.createSecondLevelTopic(docxDocument, i+2+".3. Monitoring results of planting suitability");
|
||||
//查找适宜性
|
||||
PlantingSuitability suitability = plantingSuitabilityService.sqlSeeding1(zone, year);
|
||||
BarChart.insertPic(docxDocument, "C:\\Users\\HP\\Desktop\\文本文档\\1650791783(1).jpg");
|
||||
BarChart.setPicTitle(docxDocument, "Figure "+(number+19)+" Spatial distribution data of planting suitability");
|
||||
//此处插入图表
|
||||
String[] xAxisData2 = new String[]{"Very Suitable", "Suitable", "Not Suitable"};
|
||||
Double x1 = suitability.getVerySuitable();
|
||||
Double x2 = suitability.getSuitable();
|
||||
Double x3 = suitability.getNotSuitable();
|
||||
Double[] yAxisData2 = new Double[]{x1, x2, x3};
|
||||
BarChart.drawTable(docxDocument, xAxisData2, yAxisData2);
|
||||
BarChart.setPicTitle(docxDocument, "Figure "+(number+20)+" Classification statistics of planting suitability");
|
||||
BarChart.createParagraphAndInsertWord(docxDocument,"In "+suitability.getZone()+" region, the area of very suitable region was "+suitability.getVerySuitable()+" hm², accounting for "+BarChart.getDoubleNumber((suitability.getVerySuitable()/suitability.getTotalArea())*100)+"%. The area of suitable grade was "+suitability.getSuitable()+" hm², accounting for "+BarChart.getDoubleNumber((suitability.getSuitable()/suitability.getTotalArea())*100)+"%. The area of unsuitable area was "+suitability.getNotSuitable()+" hm², accounting for "+BarChart.getDoubleNumber((suitability.getNotSuitable()/suitability.getTotalArea())*100)+"%.");
|
||||
number+=20;
|
||||
}
|
||||
|
||||
response.setCharacterEncoding("UTF-8");
|
||||
response.setContentType("application/msword");
|
||||
//文件名
|
||||
String fileName = "Evaluation report of planting monitoring in ITBA Nature Reserve - V2.0.docx";
|
||||
response.setHeader("Content-Disposition", "attachment;fileName=" + new String(fileName.getBytes("UTF-8"), "ISO-8859-1"));
|
||||
ServletOutputStream responseOutputStream = response.getOutputStream();
|
||||
docxDocument.write(responseOutputStream);
|
||||
responseOutputStream.flush();
|
||||
responseOutputStream.close();
|
||||
}
|
||||
|
||||
|
||||
// /**
|
||||
// * 导出Word
|
||||
// * @param
|
||||
// */
|
||||
// @RequestMapping(value = "/exportWord",method = {RequestMethod.GET})
|
||||
// @ResponseBody
|
||||
// public void exportWord(HttpServletResponse response, HttpServletRequest request) throws Exception {
|
||||
// //接受前端传来的数据
|
||||
// String year = "2022";//request.getParameter("year");
|
||||
// String zone = "03";//request.getParameter("zone");
|
||||
// //创建文本对象
|
||||
// CustomXWPFDocument docxDocument = new CustomXWPFDocument();
|
||||
// //创建标题
|
||||
// BarChart.setTitle(docxDocument,"Evaluation report of planting monitoring in ITBA Nature Reserve");
|
||||
// //创建第一个段落的标题
|
||||
// BarChart.createFirstLevelTopic(docxDocument, "1.Background information");
|
||||
// //创建第一个段落的内容
|
||||
// BarChart.createParagraphAndInsertWord(docxDocument, "Date time: "+year);
|
||||
// BarChart.createParagraphAndInsertWord(docxDocument, "Evaluation area: "+zone);
|
||||
//
|
||||
//
|
||||
// //创建第二段落的标题
|
||||
// BarChart.createFirstLevelTopic(docxDocument, "2.Results of remote sensing monitoring of seeding success rate");
|
||||
// //循环判断有多少个资源
|
||||
// List<SeedingSuccessRate> seedingSuccessRates = seedingSuccessService.sqlSeeding(zone, year);
|
||||
// for (SeedingSuccessRate seedingSuccessRate : seedingSuccessRates) {
|
||||
// //图片的url
|
||||
// //String productCode1 = seedingSuccessRate.getProductCode1();
|
||||
// //String productCode2 = seedingSuccessRate.getProductCode2();
|
||||
// //创建第二段落的内容
|
||||
// BarChart.insertPic(docxDocument, "C:\\Users\\xkrs\\Desktop\\pic\\1.png");
|
||||
// BarChart.setPicTitle(docxDocument, "Spatial distribution data of successful seeding regions");
|
||||
// BarChart.insertPic(docxDocument, "C:\\Users\\xkrs\\Desktop\\pic\\2.png");
|
||||
// BarChart.setPicTitle(docxDocument, "Spatial distribution data of seeding success rate");
|
||||
// BarChart.createParagraphAndInsertWord(docxDocument, ""+BarChart.changeDate(seedingSuccessRate.getImageDate())+
|
||||
// ". The total planting area in "+seedingSuccessRate.getZone()+" area was "+
|
||||
// BarChart.getDoubleNumber((seedingSuccessRate.getSeedingSuccessArea()/seedingSuccessRate.getSeedingSuccess())) +
|
||||
// " hm², the vegetation survival area was "+seedingSuccessRate.getSeedingSuccessArea()+" hm², and the seeding success rate was "+seedingSuccessRate.getSeedingSuccess()+"%.");
|
||||
// }
|
||||
// //第三段的标题
|
||||
// BarChart.createFirstLevelTopic(docxDocument, "3.Results of remote sensing monitoring of vegetation health");
|
||||
// //获取ProductCode1的集合
|
||||
// List<String> M_code=new ArrayList<>();
|
||||
// List<String> H_code=new ArrayList<>();
|
||||
// //查询数据库中有多少条数据
|
||||
// List<VegetationHealth> vegetationHealths = vegetationHealthServices.sqlInfo(zone, year);
|
||||
// //循环查询的数据分别加入到不同的集合中作为中质量和高质量的循环次数
|
||||
// for (VegetationHealth vegetationHealth : vegetationHealths) {
|
||||
// String productCode1 = vegetationHealth.getProductCode1();
|
||||
// if(productCode1.startsWith("M"))
|
||||
// {
|
||||
// M_code.add(vegetationHealth.getProductCode1());
|
||||
// }
|
||||
// if(productCode1.startsWith("H"))
|
||||
// {
|
||||
// H_code.add(vegetationHealth.getProductCode1());
|
||||
// }
|
||||
// }
|
||||
// //第三段的内容
|
||||
// //第三段的第一个小标题
|
||||
// int size=H_code.size()+M_code.size();
|
||||
// BarChart.createSecondLevelTopic(docxDocument, "3.1.Monitoring results of medium resolution data");
|
||||
// for(int i = 0; i <M_code.size(); i++) {
|
||||
// List<VegetationHealth> vegetationHealths_M = vegetationHealthServices.sqlSeeding(zone, M_code.get(i), year);
|
||||
// for (VegetationHealth vegetationHealth_m : vegetationHealths_M) {
|
||||
// //第三段的第一个小标题的内容
|
||||
// BarChart.insertPic(docxDocument, "C:\\Users\\HP\\Desktop\\文本文档\\1650791783(1).jpg");
|
||||
// BarChart.setPicTitle(docxDocument, "Spatial distribution data of vegetation planting area");
|
||||
// BarChart.insertPic(docxDocument, "C:\\Users\\HP\\Desktop\\文本文档\\1650791783(1).jpg");
|
||||
// BarChart.setPicTitle(docxDocument, "Spatial distribution data of vegetation health status");
|
||||
// //插入柱状图表
|
||||
// String[] xAxisData = new String[]{"Health", "Normal", "Not-Health"};
|
||||
// Double m1 = vegetationHealth_m.getHealthy();
|
||||
// Double m2 = vegetationHealth_m.getNormal();
|
||||
// Double m3 = vegetationHealth_m.getNotHealthy();
|
||||
// Double[] yAxisData = new Double[]{m1, m2, m3};
|
||||
// BarChart.drawTable(docxDocument,xAxisData,yAxisData);
|
||||
// BarChart.setPicTitle(docxDocument, "Statistical data on vegetation health");
|
||||
// BarChart.createParagraphAndInsertWord(docxDocument, ""+BarChart.changeDate(vegetationHealth_m.getImageDate())+". Based on the monitoring results of high resolution satellite images, the area of healthy vegetation growth in "+vegetationHealth_m.getZone()+" region was "+vegetationHealth_m.getHealthy()+" hm², accounting for "+BarChart.getDoubleNumber((vegetationHealth_m.getHealthy()/vegetationHealth_m.getTotalArea())*100)+"%. The area with normal vegetation growth was "+vegetationHealth_m.getNormal()+" hm², accounting for "+BarChart.getDoubleNumber((vegetationHealth_m.getNormal()/vegetationHealth_m.getTotalArea())*100)+"%. The area of unhealthy vegetation growth was "+vegetationHealth_m.getNotHealthy()+" hm², accounting for "+BarChart.getDoubleNumber((vegetationHealth_m.getNotHealthy()/vegetationHealth_m.getTotalArea())*100)+"%.");
|
||||
// }
|
||||
// }
|
||||
// //第三段的第二个小标题
|
||||
// BarChart.createSecondLevelTopic(docxDocument, "3.2.Monitoring results of high resolution data");
|
||||
// for(int i=0;i<H_code.size();i++) {
|
||||
// List<VegetationHealth> vegetationHealths_H = vegetationHealthServices.sqlSeeding(zone, H_code.get(i), year);
|
||||
// for (VegetationHealth vegetationHealth_h : vegetationHealths_H) {
|
||||
// //第三段的第二个小标题的内容
|
||||
// BarChart.insertPic(docxDocument, "C:\\Users\\HP\\Desktop\\文本文档\\1650791783(1).jpg");
|
||||
// BarChart.setPicTitle(docxDocument, "Spatial distribution data of vegetation planting area");
|
||||
// BarChart.insertPic(docxDocument, "C:\\Users\\HP\\Desktop\\文本文档\\1650791783(1).jpg");
|
||||
// BarChart.setPicTitle(docxDocument, "Spatial distribution data of vegetation health status");
|
||||
// //此处插入图表
|
||||
// String[] xAxisData1 = new String[]{"Health", "Normal", "Not-Health"};
|
||||
// Double h1 = vegetationHealth_h.getHealthy();
|
||||
// Double h2 = vegetationHealth_h.getNormal();
|
||||
// Double h3 = vegetationHealth_h.getNotHealthy();
|
||||
// Double[] yAxisData1 = new Double[]{h1, h2, h3};
|
||||
// BarChart.drawTable(docxDocument, xAxisData1, yAxisData1);
|
||||
// BarChart.setPicTitle(docxDocument, "Statistical data on vegetation health");
|
||||
// BarChart.createParagraphAndInsertWord(docxDocument, "" + BarChart.changeDate(vegetationHealth_h.getImageDate()) + ". Based on the monitoring results of high resolution satellite images, the area of healthy vegetation growth in " + vegetationHealth_h.getZone() + " region was " + vegetationHealth_h.getHealthy() + " hm², accounting for " + BarChart.getDoubleNumber((vegetationHealth_h.getHealthy() / vegetationHealth_h.getTotalArea()) * 100) + "%. The area with normal vegetation growth was " + vegetationHealth_h.getNormal() + " hm², accounting for " + BarChart.getDoubleNumber((vegetationHealth_h.getNormal() / vegetationHealth_h.getTotalArea()) * 100) + "%. The area of unhealthy vegetation growth was " + vegetationHealth_h.getNotHealthy() + " hm², accounting for " + BarChart.getDoubleNumber((vegetationHealth_h.getNotHealthy() / vegetationHealth_h.getTotalArea()) * 100) + "%.");
|
||||
// }
|
||||
// }
|
||||
// //第四个标题
|
||||
// List<PlantingSuitability> plantingSuitabilities = plantingSuitabilityService.sqlSeeding(zone);
|
||||
// for (PlantingSuitability suitability : plantingSuitabilities) {
|
||||
// BarChart.createFirstLevelTopic(docxDocument,"4.Results of remote sensing monitoring of planting suitability");
|
||||
// //获取图片的url
|
||||
// String productCode1 = suitability.getProductCode1();
|
||||
// //第四个标题的内容
|
||||
// BarChart.insertPic(docxDocument,"C:\\Users\\HP\\Desktop\\文本文档\\1650791783(1).jpg");
|
||||
// BarChart.setPicTitle(docxDocument,"Spatial distribution data of planting suitability");
|
||||
// //此处插入图表
|
||||
// String[] xAxisData2 = new String[]{"Very Suitable", "Suitable", "Not Suitable"};
|
||||
// Double s1 = suitability.getVerySuitable();
|
||||
// Double s2 = suitability.getSuitable();
|
||||
// Double s3 = suitability.getNotSuitable();
|
||||
// Double[] yAxisData2 = new Double[]{s1, s2, s3};
|
||||
// BarChart.drawTable(docxDocument,xAxisData2,yAxisData2);
|
||||
// BarChart.setPicTitle(docxDocument,"Classification statistics of planting suitability");
|
||||
// BarChart.createParagraphAndInsertWord(docxDocument,"In "+suitability.getZone()+" region, the area of very suitable region was "+suitability.getVerySuitable()+" hm², accounting for "+BarChart.getDoubleNumber((suitability.getVerySuitable()/suitability.getTotalArea())*100)+"%. The area of suitable grade was "+suitability.getSuitable()+" hm², accounting for "+BarChart.getDoubleNumber((suitability.getSuitable()/suitability.getTotalArea())*100)+"%. The area of unsuitable area was "+suitability.getNotSuitable()+" hm², accounting for "+BarChart.getDoubleNumber((suitability.getNotSuitable()/suitability.getTotalArea())*100)+"%.");
|
||||
// }
|
||||
// response.setCharacterEncoding("UTF-8");
|
||||
// response.setContentType("application/msword");
|
||||
// //文件名
|
||||
// String fileName = "Evaluation report of planting monitoring in ITBA Nature Reserve - V2.0.docx";
|
||||
// response.setHeader("Content-Disposition","attachment;fileName="+new String(fileName.getBytes("UTF-8"), "ISO-8859-1"));
|
||||
// ServletOutputStream responseOutputStream = response.getOutputStream();
|
||||
// docxDocument.write(responseOutputStream);
|
||||
// responseOutputStream.flush();
|
||||
// responseOutputStream.close();
|
||||
// }
|
||||
|
||||
}
|
||||
|
@ -10,6 +10,7 @@ import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.time.LocalDate;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
@ -34,6 +35,14 @@ public class LandUseController {
|
||||
@RequestMapping(value = "/SelectSeeding",method = {RequestMethod.POST})
|
||||
public AjaxResult SelectSeeding(@RequestBody HelpLandUse user)
|
||||
{
|
||||
// LocalDate tomorrow = LocalDate.of(2022,10,2);
|
||||
// LocalDate today = LocalDate.now();
|
||||
//
|
||||
// if(tomorrow.isAfter(today)==false)
|
||||
// {
|
||||
// return AjaxResult.error("软件授权日期已过,请联系管理人员!");
|
||||
// }
|
||||
|
||||
if(user.getLandUses().length==0)
|
||||
{
|
||||
List<LandUse> Seeding= Service.sqlSeeding1(user.getZone(),user.getYear());
|
||||
|
@ -14,6 +14,7 @@ import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -36,6 +37,14 @@ public class PlantingSuitabilityController
|
||||
@RequestMapping(value = "/SelectSeeding",method = {RequestMethod.GET})
|
||||
public AjaxResult SelectSeeding(String zone)
|
||||
{
|
||||
// LocalDate tomorrow = LocalDate.of(2022,10,2);
|
||||
// LocalDate today = LocalDate.now();
|
||||
//
|
||||
// if(tomorrow.isAfter(today)==false)
|
||||
// {
|
||||
// return AjaxResult.error("软件授权日期已过,请联系管理人员!");
|
||||
// }
|
||||
|
||||
List<PlantingSuitability> Seeding= Service.sqlSeeding(zone);
|
||||
Double Number=0.0;
|
||||
Double Max=0.0;
|
||||
|
@ -57,7 +57,6 @@ public class TopographicFactorController {
|
||||
{
|
||||
Max=ce.getLevel5();
|
||||
}
|
||||
|
||||
}
|
||||
for (int i=0;i<Seeding.size();i++)
|
||||
{
|
||||
|
@ -6,15 +6,14 @@ spring:
|
||||
driver-class-name: org.postgresql.Driver
|
||||
druid:
|
||||
master:
|
||||
url: jdbc:postgresql://rs-middleware-postgres:5432/itba?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&serverTimezone=Asia/Shanghai
|
||||
username: gis
|
||||
password: AQBSdU5bT27AKxAAvKoWQdGpSuNRCHjC4B8DVA
|
||||
# url: jdbc:postgresql://rs-middleware-postgres:5432/itba?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&serverTimezone=Asia/Shanghai
|
||||
# username: gis
|
||||
# password: AQBSdU5bT27AKxAAvKoWQdGpSuNRCHjC4B8DVA
|
||||
|
||||
#url: jdbc:postgresql://192.168.2.9:5432/saudiArabia?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&serverTimezone=Asia/Shanghai
|
||||
#url: jdbc:postgresql://121.36.229.60:5432/saudiArabia?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&serverTimezone=Asia/Shanghai
|
||||
|
||||
#username: sjs
|
||||
#password: song5325
|
||||
url: jdbc:postgresql://121.36.229.60:5432/saudiArabia?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&serverTimezone=Asia/Shanghai
|
||||
username: sjs
|
||||
password: song5325
|
||||
# 从库数据源
|
||||
slave:
|
||||
# 从数据源开关/默认关闭
|
||||
|
@ -19,7 +19,7 @@ ruoyi:
|
||||
server:
|
||||
# 服务器的HTTP端口,默认为8080
|
||||
#port: 6051
|
||||
port: 9800
|
||||
port: 6051
|
||||
servlet:
|
||||
# 应用的访问路径
|
||||
context-path: /
|
||||
@ -60,16 +60,16 @@ spring:
|
||||
# redis 配置
|
||||
redis:
|
||||
# 地址
|
||||
host: rs-middleware-redis
|
||||
#host: localhost
|
||||
#host: rs-middleware-redis
|
||||
host: localhost
|
||||
# 端口,默认为6379
|
||||
#port: 14096
|
||||
port: 6379
|
||||
# 数据库索引
|
||||
database: 0
|
||||
# 密码
|
||||
password: SenseTime@2019
|
||||
#password: sdust2020
|
||||
#password: SenseTime@2019
|
||||
password: sdust2020
|
||||
# 连接超时时间
|
||||
timeout: 10s
|
||||
lettuce:
|
||||
|
@ -140,6 +140,24 @@
|
||||
<artifactId>commons-beanutils</artifactId>
|
||||
<version>1.9.4</version>
|
||||
</dependency>
|
||||
<!--<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<version>1.18.24</version>
|
||||
</dependency>-->
|
||||
|
||||
<!-- <dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
<version>11.0.2</version>
|
||||
</dependency>
|
||||
-->
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-all</artifactId>
|
||||
<version>5.3.7</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
</dependencies>
|
||||
|
||||
|
197
ruoyi-common/src/main/java/com/ruoyi/common/utils/BarChart.java
Normal file
197
ruoyi-common/src/main/java/com/ruoyi/common/utils/BarChart.java
Normal file
@ -0,0 +1,197 @@
|
||||
package com.ruoyi.common.utils;
|
||||
import org.apache.poi.ss.util.CellRangeAddress;
|
||||
import org.apache.poi.ss.util.CellReference;
|
||||
import org.apache.poi.util.Units;
|
||||
import org.apache.poi.xddf.usermodel.chart.*;
|
||||
import org.apache.poi.xwpf.usermodel.*;
|
||||
import java.io.FileInputStream;
|
||||
import java.math.BigInteger;
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.poi.xwpf.usermodel.XWPFChart;
|
||||
import org.apache.poi.xwpf.usermodel.XWPFDocument;
|
||||
import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTP;
|
||||
import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTPPr;
|
||||
import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTSpacing;
|
||||
import org.openxmlformats.schemas.wordprocessingml.x2006.main.STLineSpacingRule;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @Description: poi工具类
|
||||
* @Date: 2022/10/11
|
||||
* @Author shuaihua zang
|
||||
*/
|
||||
public class BarChart
|
||||
{
|
||||
|
||||
//绘制折线图
|
||||
public static void drawLine(XWPFDocument document, String[] xAxisData,Double[] yAxisData) throws Exception {
|
||||
XWPFChart xChart = document.createChart(15 * Units.EMU_PER_CENTIMETER, 10 * Units.EMU_PER_CENTIMETER);
|
||||
// xChart.setTitleText("海拔"); // 图表标题
|
||||
xChart.setTitleOverlay(false);
|
||||
|
||||
// 5、X轴(分类轴)相关设置
|
||||
// 创建X轴,并且指定位置
|
||||
XDDFCategoryAxis xAxis = xChart.createCategoryAxis(AxisPosition.BOTTOM);
|
||||
XDDFCategoryDataSource xAxisSource = XDDFDataSourcesFactory.fromArray(xAxisData); // 设置X轴数据
|
||||
// xAxis.setTitle("海拔km²");
|
||||
// 6、Y轴(值轴)相关设置
|
||||
XDDFValueAxis yAxis = xChart.createValueAxis(AxisPosition.LEFT); // 创建Y轴,指定位置轴标题
|
||||
XDDFNumericalDataSource<Double> yAxisSource = XDDFDataSourcesFactory.fromArray(yAxisData); // 设置Y轴数据
|
||||
yAxis.setTitle("hm²");
|
||||
// 7、创建折线图对象
|
||||
XDDFLineChartData lineChart = (XDDFLineChartData) xChart.createData(ChartTypes.LINE, xAxis, yAxis);
|
||||
|
||||
// 8、加载折线图数据集
|
||||
XDDFLineChartData.Series lineSeries = (XDDFLineChartData.Series) lineChart.addSeries(xAxisSource, yAxisSource);
|
||||
lineSeries.setSmooth(false); // 线条样式:true平滑曲线,false折线
|
||||
lineSeries.setMarkerSize((short) 6); // 标记点大小
|
||||
lineSeries.setMarkerStyle(MarkerStyle.CIRCLE); // 标记点样式
|
||||
|
||||
// 9、绘制折线图
|
||||
xChart.plot(lineChart);
|
||||
}
|
||||
|
||||
public static void drawTable(XWPFDocument document, String[] xAxisData,Double[] yAxisData) throws Exception {
|
||||
/*int numOfPoints = categories.length;
|
||||
String categoryDataRange = chart.formatRange(new CellRangeAddress(1, numOfPoints, 0, 0));
|
||||
String valuesDataRangeA = chart.formatRange(new CellRangeAddress(1, numOfPoints, 1, 1));
|
||||
String valuesDataRangeB = chart.formatRange(new CellRangeAddress(1, numOfPoints, 2, 2));
|
||||
XDDFDataSource<String> categoriesData = XDDFDataSourcesFactory.fromArray(categories, categoryDataRange, 0);
|
||||
XDDFNumericalDataSource<Double> valuesDataA = XDDFDataSourcesFactory.fromArray(valuesA, valuesDataRangeA, 1);
|
||||
XDDFNumericalDataSource<Double> valuesDataB = XDDFDataSourcesFactory.fromArray(valuesB, valuesDataRangeB, 2);*/
|
||||
// 创建chart图表对象,抛出异常
|
||||
XWPFChart chart = document.createChart(15 * Units.EMU_PER_CENTIMETER, 10 * Units.EMU_PER_CENTIMETER);
|
||||
// 图表相关设置
|
||||
chart.setTitleText(""); // 图表标题
|
||||
|
||||
chart.setTitleOverlay(false); // 图例是否覆盖标题
|
||||
//XDDFChartLegend legend = chart.getOrAddLegend();
|
||||
//legend.setPosition(LegendPosition.TOP); // 图例位置:上下左右
|
||||
// X轴(分类轴)相关设置
|
||||
XDDFCategoryAxis xAxis =chart.createCategoryAxis(AxisPosition.BOTTOM); // 创建X轴,并且指定位置
|
||||
xAxis.setTitle(""); // x轴标题
|
||||
XDDFCategoryDataSource xAxisSource = XDDFDataSourcesFactory.fromArray(xAxisData); // 设置X轴数据
|
||||
// Y轴(值轴)相关设置
|
||||
//chart.createValueAxis(AxisPosition.LEFT);
|
||||
XDDFValueAxis yAxis = chart.createValueAxis(AxisPosition.LEFT); // 创建Y轴,指定位置
|
||||
yAxis.setTitle("Area(hm²)"); // Y轴标题
|
||||
yAxis.setCrossBetween(AxisCrossBetween.BETWEEN); // 设置图柱的位置:BETWEEN居中
|
||||
XDDFNumericalDataSource<Double> yAxisSource = XDDFDataSourcesFactory.fromArray(yAxisData); // 设置Y轴数据
|
||||
ChartTypes chartTypes = ChartTypes.BAR;
|
||||
// 创建柱状图对象
|
||||
XDDFBarChartData barChart = (XDDFBarChartData) chart.createData(chartTypes, xAxis, yAxis);
|
||||
barChart.setBarDirection(BarDirection.COL); // 设置柱状图的方向:BAR横向,COL竖向,默认是BAR
|
||||
barChart.setVaryColors(false);
|
||||
// 加载柱状图数据集
|
||||
XDDFBarChartData.Series barSeries = (XDDFBarChartData.Series) barChart.addSeries(xAxisSource, yAxisSource);
|
||||
barSeries.setTitle(" ", null); // 图例标题
|
||||
// 绘制柱状图
|
||||
chart.plot(barChart);
|
||||
}
|
||||
|
||||
//插入图片
|
||||
public static void insertPic(XWPFDocument document,String fileAddress)
|
||||
{
|
||||
XWPFParagraph Paragraph = document.createParagraph();
|
||||
Paragraph.setAlignment(ParagraphAlignment.CENTER);//对齐方式
|
||||
XWPFRun run = Paragraph.createRun();
|
||||
try (FileInputStream is = new FileInputStream
|
||||
(fileAddress)) {
|
||||
run.addPicture(is, XWPFDocument.PICTURE_TYPE_PNG,
|
||||
fileAddress,
|
||||
Units.toEMU(185), Units.toEMU(223)); // 200x200 pixels
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
//创建段落并插入文字
|
||||
public static void createParagraphAndInsertWord(XWPFDocument document,String date) {
|
||||
XWPFParagraph Paragraph = document.createParagraph();
|
||||
//设置行距固定值20磅
|
||||
//setLineSpace(Paragraph,30);
|
||||
Paragraph.setAlignment(ParagraphAlignment.LEFT);//对齐方式
|
||||
//paragraph_2.setFirstLineIndent(400);//首行缩进
|
||||
XWPFRun run = Paragraph.createRun();
|
||||
run.setText(date);
|
||||
run.setBold(false);//加粗
|
||||
run.setFontSize(12);
|
||||
run.setFontFamily("Times New Roman");
|
||||
}
|
||||
//创建一级标题的内容
|
||||
public static void createFirstLevelTopic(XWPFDocument document,String date)
|
||||
{
|
||||
XWPFParagraph Paragraph = document.createParagraph();
|
||||
Paragraph.setAlignment(ParagraphAlignment.LEFT);//对齐方式
|
||||
//BarChart.setLineSpace(Paragraph,30);
|
||||
XWPFRun run = Paragraph.createRun();
|
||||
run.setText(date);
|
||||
run.setBold(true);//加粗
|
||||
run.setFontSize(16);
|
||||
run.setFontFamily("Times New Roman");
|
||||
}
|
||||
//创建二级标题的内容
|
||||
public static void createSecondLevelTopic(XWPFDocument document,String date)
|
||||
{
|
||||
XWPFParagraph Paragraph = document.createParagraph();
|
||||
Paragraph.setAlignment(ParagraphAlignment.LEFT);//对齐方式
|
||||
//BarChart.setLineSpace(Paragraph,30);
|
||||
XWPFRun run = Paragraph.createRun();
|
||||
run.setText(date);
|
||||
run.setBold(true);//加粗
|
||||
run.setFontSize(12);
|
||||
run.setFontFamily("Times New Roman");
|
||||
}
|
||||
//创建图片标题的内容
|
||||
public static void setPicTitle(XWPFDocument document,String date)
|
||||
{
|
||||
XWPFParagraph Paragraph = document.createParagraph();
|
||||
Paragraph.setAlignment(ParagraphAlignment.CENTER);//对齐方式
|
||||
//BarChart.setLineSpace(Paragraph,30);
|
||||
XWPFRun run = Paragraph.createRun();
|
||||
run.setText(date);
|
||||
run.setBold(true);//加粗
|
||||
run.setFontSize(10);
|
||||
run.setFontFamily("Times New Roman");
|
||||
}
|
||||
//设置题目
|
||||
public static void setTitle(XWPFDocument document,String date)
|
||||
{
|
||||
XWPFParagraph title = document.createParagraph();
|
||||
title.setAlignment(ParagraphAlignment.CENTER);
|
||||
XWPFRun runTitle = title.createRun();
|
||||
runTitle.setText(date);
|
||||
runTitle.setBold(false);
|
||||
runTitle.setFontSize(16);
|
||||
runTitle.setFontFamily("Times New Roman");
|
||||
}
|
||||
//设置行间距
|
||||
public static void setLineSpace(XWPFParagraph titleParagraph,int size) {
|
||||
CTP ctp = titleParagraph.getCTP();
|
||||
CTPPr ppr = ctp.isSetPPr() ? ctp.getPPr() : ctp.addNewPPr();
|
||||
CTSpacing spacing = ppr.isSetSpacing()? ppr.getSpacing() : ppr.addNewSpacing();
|
||||
spacing.setAfter(BigInteger.valueOf(0));
|
||||
spacing.setBefore(BigInteger.valueOf(0));
|
||||
//设置行距类型为 EXACT
|
||||
spacing.setLineRule(STLineSpacingRule.EXACT);
|
||||
//1磅数是20
|
||||
spacing.setLine(BigInteger.valueOf(size*20));
|
||||
}
|
||||
public static String getDoubleNumber(Double d)
|
||||
{
|
||||
DecimalFormat df = new DecimalFormat("#.00");
|
||||
return df.format(d);
|
||||
}
|
||||
public static String changeDate(String date)
|
||||
{
|
||||
String s1 = date.substring(0, 4);
|
||||
String s2 = date.substring(4, 6);
|
||||
String s3 = date.substring(6, date.length());
|
||||
return s1+"-"+s2+"-"+s3;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,108 @@
|
||||
package com.ruoyi.common.utils;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import org.apache.poi.openxml4j.opc.OPCPackage;
|
||||
|
||||
import org.apache.poi.xwpf.usermodel.XWPFDocument;
|
||||
import org.apache.poi.xwpf.usermodel.XWPFParagraph;
|
||||
import org.apache.xmlbeans.XmlException;
|
||||
import org.apache.xmlbeans.XmlToken;
|
||||
import org.openxmlformats.schemas.drawingml.x2006.main.CTNonVisualDrawingProps;
|
||||
import org.openxmlformats.schemas.drawingml.x2006.main.CTPositiveSize2D;
|
||||
import org.openxmlformats.schemas.drawingml.x2006.wordprocessingDrawing.CTInline;
|
||||
|
||||
/**
|
||||
* @Author shuaihua zang
|
||||
* @date 2022/10/8
|
||||
* word导出图片所需的工具类
|
||||
*/
|
||||
public class CustomXWPFDocument extends XWPFDocument{
|
||||
public CustomXWPFDocument(InputStream in) throws IOException {
|
||||
super(in);
|
||||
}
|
||||
|
||||
public CustomXWPFDocument() {
|
||||
super();
|
||||
}
|
||||
|
||||
public CustomXWPFDocument(OPCPackage pkg) throws IOException {
|
||||
super(pkg);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param id
|
||||
* @param width
|
||||
* 宽
|
||||
* @param height
|
||||
* 高
|
||||
* @param paragraph
|
||||
* 段落
|
||||
*/
|
||||
public void createPicture(int id, int width, int height,
|
||||
XWPFParagraph paragraph) {
|
||||
final int EMU = 9525;
|
||||
width *= EMU;
|
||||
height *= EMU;
|
||||
String blipId = super.getRelationId(super.getAllPictures().get(id));
|
||||
CTInline inline = paragraph.createRun().getCTR().addNewDrawing()
|
||||
.addNewInline();
|
||||
String picXml = ""
|
||||
+ "<a:graphic xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\">"
|
||||
+ " <a:graphicData uri=\"http://schemas.openxmlformats.org/drawingml/2006/picture\">"
|
||||
+ " <pic:pic xmlns:pic=\"http://schemas.openxmlformats.org/drawingml/2006/picture\">"
|
||||
+ " <pic:nvPicPr>" + " <pic:cNvPr id=\""
|
||||
+ id
|
||||
+ "\" name=\"Generated\"/>"
|
||||
+ " <pic:cNvPicPr/>"
|
||||
+ " </pic:nvPicPr>"
|
||||
+ " <pic:blipFill>"
|
||||
+ " <a:blip r:embed=\""
|
||||
+ blipId
|
||||
+ "\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\"/>"
|
||||
+ " <a:stretch>"
|
||||
+ " <a:fillRect/>"
|
||||
+ " </a:stretch>"
|
||||
+ " </pic:blipFill>"
|
||||
+ " <pic:spPr>"
|
||||
+ " <a:xfrm>"
|
||||
+ " <a:off x=\"0\" y=\"0\"/>"
|
||||
+ " <a:ext cx=\""
|
||||
+ width
|
||||
+ "\" cy=\""
|
||||
+ height
|
||||
+ "\"/>"
|
||||
+ " </a:xfrm>"
|
||||
+ " <a:prstGeom prst=\"rect\">"
|
||||
+ " <a:avLst/>"
|
||||
+ " </a:prstGeom>"
|
||||
+ " </pic:spPr>"
|
||||
+ " </pic:pic>"
|
||||
+ " </a:graphicData>" + "</a:graphic>";
|
||||
|
||||
inline.addNewGraphic().addNewGraphicData();
|
||||
XmlToken xmlToken = null;
|
||||
try {
|
||||
xmlToken = XmlToken.Factory.parse(picXml);
|
||||
} catch (XmlException xe) {
|
||||
xe.printStackTrace();
|
||||
}
|
||||
inline.set(xmlToken);
|
||||
|
||||
inline.setDistT(0);
|
||||
inline.setDistB(0);
|
||||
inline.setDistL(0);
|
||||
inline.setDistR(0);
|
||||
|
||||
CTPositiveSize2D extent = inline.addNewExtent();
|
||||
extent.setCx(width);
|
||||
extent.setCy(height);
|
||||
|
||||
CTNonVisualDrawingProps docPr = inline.addNewDocPr();
|
||||
docPr.setId(id);
|
||||
docPr.setName("图片名称");
|
||||
docPr.setDescr("描述信息");
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,146 @@
|
||||
package com.ruoyi.common.utils;
|
||||
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
public class StringFilterUtil {
|
||||
/** 过滤字符串,去除[]中的内容,包括[]
|
||||
* @param input
|
||||
* @return
|
||||
*/
|
||||
public static String filterForBetween(String input, char startChar, char endChar) {
|
||||
int head = input.indexOf(startChar); // 标记第一个使用左括号的位置
|
||||
if (head == -1) {
|
||||
return input; // 如果context中不存在括号,什么也不做,直接跑到函数底端返回初值str
|
||||
} else {
|
||||
int next = head + 1; // 从head+1起检查每个字符
|
||||
int count = 1; // 记录括号情况
|
||||
do {
|
||||
if (input.charAt(next) == startChar)
|
||||
count++;
|
||||
else if (input.charAt(next) == endChar)
|
||||
count--;
|
||||
next++; // 更新即将读取的下一个字符的位置
|
||||
if (count == 0) // 已经找到匹配的括号
|
||||
{
|
||||
String temp = input.substring(head, next); // 将两括号之间的内容及括号提取到temp中
|
||||
input = input.replace(temp, ""); // 用空内容替换,复制给context
|
||||
head = input.indexOf(endChar); // 找寻下一个左括号
|
||||
next = head + 1; // 标记下一个左括号后的字符位置
|
||||
count = 1; // count的值还原成1
|
||||
}
|
||||
} while (head != -1); // 如果在该段落中找不到左括号了,就终止循环
|
||||
}
|
||||
return input; // 返回更新后的context
|
||||
}
|
||||
|
||||
/**
|
||||
* str.replaceAll("\\s*", ""); //s* 可以匹配空格、制表符、换页符等空白字符的其中任意一个。
|
||||
* str.replaceAll(" +",""); //去掉所有空格,包括首尾、中间
|
||||
* str.replaceAll(" ", ""); //去掉所有空格,包括首尾、中间
|
||||
* str.replace(" ",""); //去除所有空格,包括首尾、中间
|
||||
* str.trim(); //去掉首尾空格
|
||||
* @param inputStr
|
||||
* @return
|
||||
*/
|
||||
public static String filterForBlank(String inputStr){
|
||||
if(inputStr.length()==0||inputStr==null) {
|
||||
return "";
|
||||
}
|
||||
return inputStr.replace(" ", "");
|
||||
}
|
||||
|
||||
/** 过滤字符串,只允许字母和数字
|
||||
* @param inputStr
|
||||
* @return
|
||||
*/
|
||||
public static String filterForChars(String inputStr) {
|
||||
if(inputStr.length()==0||inputStr==null) {
|
||||
return "";
|
||||
}
|
||||
String regEx = "[^a-zA-Z0-9]";
|
||||
Pattern p = Pattern.compile(regEx);
|
||||
Matcher m = p.matcher(inputStr);
|
||||
return m.replaceAll("").trim();
|
||||
}
|
||||
|
||||
/**过滤字符串,替换特殊字符
|
||||
* <pre>
|
||||
* StringFilterUtil.filterForSpechars(null)
|
||||
* </pre>
|
||||
* @param inputStr
|
||||
* @return
|
||||
*/
|
||||
public static String filterForSpechars(String inputStr) {
|
||||
if(inputStr.length()==0||inputStr==null) {
|
||||
return "";
|
||||
}
|
||||
String regEx = "[`~!@#$%^&*()+=|{}':;',\\[\\].<>/?~!@#¥%……&*()——+|{}【】‘;:”“’。,、?]";
|
||||
Pattern p = Pattern.compile(regEx);
|
||||
Matcher m = p.matcher(inputStr);
|
||||
return m.replaceAll("").trim();
|
||||
}
|
||||
|
||||
/**过滤字符串,去除html标记
|
||||
* <pre>
|
||||
* StringFilterUtil.filterForHtml(null) = ""
|
||||
* StringFilterUtil.filterForHtml("") = ""
|
||||
* StringFilterUtil.filterForHtml("<td>content</td>") = "content"
|
||||
* </pre>
|
||||
* @param inputStr
|
||||
* @return
|
||||
*/
|
||||
public static String filterForHtml(String inputStr) {
|
||||
if(inputStr.length()==0||inputStr==null) {
|
||||
return "";
|
||||
}
|
||||
String regEx = "<.+?>";
|
||||
Pattern p = Pattern.compile(regEx, Pattern.DOTALL);
|
||||
Matcher m = p.matcher(inputStr);
|
||||
return m.replaceAll("");
|
||||
}
|
||||
|
||||
/**过滤字符串,查询href条件
|
||||
* <pre>
|
||||
* StringFilterUtil.filterForHref(null)
|
||||
* </pre>
|
||||
* @param inputStr
|
||||
* @return
|
||||
*/
|
||||
public static String filterForHref(String inputStr) {
|
||||
if(inputStr.length()==0||inputStr==null) {
|
||||
return "";
|
||||
}
|
||||
String regEx = "href=\"(.+?)\"";
|
||||
Pattern p = Pattern.compile(regEx);
|
||||
Matcher m = p.matcher(inputStr);
|
||||
if(m.find()) {
|
||||
return m.group(1);
|
||||
}else {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
/**过滤字符串,匹配http://地址//,获取Url地址
|
||||
* @param inputStr
|
||||
* @return
|
||||
* 备注:地址后需要以空格结束
|
||||
*/
|
||||
public static String filterForUrl(String inputStr) {
|
||||
if(inputStr.length()==0||inputStr==null) {
|
||||
return "";
|
||||
}
|
||||
String regEx = "(http://|https://){1}[\\w\\.\\-/:]+";
|
||||
Pattern p = Pattern.compile(regEx);
|
||||
Matcher m = p.matcher(inputStr);
|
||||
StringBuffer buffer = new StringBuffer();
|
||||
while(m.find()){
|
||||
buffer.append(m.group());
|
||||
buffer.append("\r\n");
|
||||
}
|
||||
return buffer.toString();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@ -24,6 +24,8 @@ public class SeedingSuccessRate extends SysSTEntity
|
||||
|
||||
private Double seedingSuccessArea;
|
||||
|
||||
|
||||
|
||||
private Double seedingSuccess;
|
||||
|
||||
private String imageDate;
|
||||
@ -141,6 +143,7 @@ public class SeedingSuccessRate extends SysSTEntity
|
||||
this.productCode3 = productCode3;
|
||||
this.createdBy = createdBy;
|
||||
this.createdTime = createdTime;
|
||||
|
||||
}
|
||||
|
||||
public String getYear() {
|
||||
|
@ -0,0 +1,30 @@
|
||||
package com.ruoyi.system.domain_shate;
|
||||
|
||||
import java.sql.DataTruncation;
|
||||
|
||||
/**
|
||||
* @Author: JinSheng Song
|
||||
* @Date: 2022/11/14 16:20
|
||||
*/
|
||||
public class WordHelp {
|
||||
|
||||
private String year;
|
||||
|
||||
private String[] zone;
|
||||
|
||||
public String getYear() {
|
||||
return year;
|
||||
}
|
||||
|
||||
public void setYear(String year) {
|
||||
this.year = year;
|
||||
}
|
||||
|
||||
public String[] getZone() {
|
||||
return zone;
|
||||
}
|
||||
|
||||
public void setZone(String[] zone) {
|
||||
this.zone = zone;
|
||||
}
|
||||
}
|
@ -14,6 +14,9 @@ public interface PlantingSuitabilityMapper
|
||||
{
|
||||
List<PlantingSuitability> sqlSeeding(@Param("zone") String zone);
|
||||
|
||||
PlantingSuitability sqlSeeding1(@Param("zone") String zone,
|
||||
@Param("year") String year);
|
||||
|
||||
Integer InsertSeeding(PlantingSuitability suitability);
|
||||
|
||||
List<PlantingSuitability> sqlYear();
|
||||
|
@ -21,4 +21,8 @@ public interface VegetationHealthMapper
|
||||
List<VegetationHealth> sqlYear();
|
||||
|
||||
Integer insertSeeding(VegetationHealth health);
|
||||
|
||||
|
||||
List<VegetationHealth> sqlInfo(@Param("zone")String zone,
|
||||
@Param("year")String year);
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ package com.ruoyi.system.service_shate;
|
||||
|
||||
import com.ruoyi.system.domain_shate.LandUse;
|
||||
import com.ruoyi.system.domain_shate.SeedingSuccessRate;
|
||||
import com.ruoyi.system.domain_shate.UplodFile;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
@ -21,4 +22,6 @@ public interface ILandUseServices
|
||||
|
||||
List<LandUse> sqlYear();
|
||||
|
||||
UplodFile mainClass(String zone,String year);
|
||||
|
||||
}
|
||||
|
@ -13,6 +13,8 @@ public interface IPlantingSuitabilityService
|
||||
{
|
||||
List<PlantingSuitability> sqlSeeding(String zone);
|
||||
|
||||
PlantingSuitability sqlSeeding1(String zone,String year);
|
||||
|
||||
Integer InsertSeeding(PlantingSuitability suitability);
|
||||
|
||||
List<PlantingSuitability> sqlYear();
|
||||
|
@ -20,4 +20,7 @@ public interface ISeedingSuccessService {
|
||||
Integer InsertSeeding2(SeedingSuccessRate eastVO);
|
||||
|
||||
Integer Delete(String zone,String imageDate,String name);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -15,6 +15,8 @@ public interface IVegetationHealthServices {
|
||||
List<VegetationHealth> sqlSeeding(String zone,String name,String year);
|
||||
|
||||
List<VegetationHealth> sqlYear();
|
||||
|
||||
List<VegetationHealth> sqlInfo(String zone,String year);
|
||||
Integer insertSeeding(VegetationHealth health);
|
||||
|
||||
|
||||
}
|
||||
|
@ -1,9 +1,13 @@
|
||||
package com.ruoyi.system.service_shate.impl;
|
||||
|
||||
import com.ruoyi.system.domain_shate.LandUse;
|
||||
import com.ruoyi.system.domain_shate.SeedingSuccessRate;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.system.domain_shate.*;
|
||||
import com.ruoyi.system.mapper_shate.LandUseMapper;
|
||||
import com.ruoyi.system.mapper_shate.SoilFactorMapper;
|
||||
import com.ruoyi.system.service_shate.ILandUseServices;
|
||||
import com.ruoyi.system.service_shate.IRegionalFactorService;
|
||||
import com.ruoyi.system.service_shate.ISoilFactorService;
|
||||
import com.ruoyi.system.service_shate.ITopographicFactorService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@ -21,6 +25,15 @@ public class LandUseServiceipml implements ILandUseServices
|
||||
@Resource
|
||||
private LandUseMapper mapper;
|
||||
|
||||
@Resource
|
||||
private ITopographicFactorService factorService;
|
||||
|
||||
@Resource
|
||||
private ISoilFactorService soilFactorService;
|
||||
|
||||
@Resource
|
||||
private IRegionalFactorService regionalFactorService;
|
||||
|
||||
@Override
|
||||
public List<LandUse> sqlSeeding(String zone, String[] landUses,String year) {
|
||||
List<LandUse> value=mapper.sqlSeeding(zone, landUses,year);
|
||||
@ -42,4 +55,35 @@ public class LandUseServiceipml implements ILandUseServices
|
||||
public List<LandUse> sqlYear() {
|
||||
return mapper.sqlYear();
|
||||
}
|
||||
|
||||
@Override
|
||||
public UplodFile mainClass(String zone,String year) {
|
||||
|
||||
UplodFile file=new UplodFile();
|
||||
//海拔
|
||||
List<Altitude> altitude = factorService.sqlAltitude(zone,year);
|
||||
//坡度
|
||||
List<Slope> slopes = factorService.sqlSlope(zone,year);
|
||||
//坡向
|
||||
List<Aspect> aspects = factorService.sqlAspect(zone,year);
|
||||
//沙化指数
|
||||
List<SoilDesertification> desertifications=soilFactorService.sqlDesert(zone,year);
|
||||
//湿度指数
|
||||
List<SoilMoisture> moistures=soilFactorService.sqlMoisture(zone,year);
|
||||
//盐渍化指数
|
||||
List<SoilSalinization> salinizations=soilFactorService.sqlSalin(zone,year);
|
||||
//水域因子
|
||||
List<WaterFactor> waterFactors=regionalFactorService.sqlWater(zone,year);
|
||||
//道路因子
|
||||
List<RoadFactor> roadFactors=regionalFactorService.sqlRoad(zone,year);
|
||||
file.setWaterFactors(waterFactors);
|
||||
file.setRoadFactors(roadFactors);
|
||||
file.setSoilMoistures(moistures);
|
||||
file.setSoilSalinizations(salinizations);
|
||||
file.setSoilDesertifications(desertifications);
|
||||
file.setAspects(aspects);
|
||||
file.setSlopes(slopes);
|
||||
file.setAltitudes(altitude);
|
||||
return file;
|
||||
}
|
||||
}
|
||||
|
@ -22,6 +22,12 @@ public class PlantingSuitabilityServiceIpml implements IPlantingSuitabilityServi
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PlantingSuitability sqlSeeding1(String zone, String year) {
|
||||
PlantingSuitability value=mapper.sqlSeeding1(zone,year);
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer InsertSeeding(PlantingSuitability suitability) {
|
||||
return mapper.InsertSeeding(suitability);
|
||||
|
@ -22,6 +22,7 @@ public class SeedingSuccessServiceimpl implements ISeedingSuccessService
|
||||
public List<SeedingSuccessRate> sqlSeeding(String zone, String year)
|
||||
{
|
||||
List<SeedingSuccessRate> vaue =mapper.sqlSeeding(zone,year);
|
||||
|
||||
return vaue;
|
||||
}
|
||||
|
||||
|
@ -30,8 +30,15 @@ public class VegetationHealthServiceimpl implements IVegetationHealthServices
|
||||
return mapper.sqlYear();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<VegetationHealth> sqlInfo(String zone,String year) {
|
||||
return mapper.sqlInfo(zone,year);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer insertSeeding(VegetationHealth health) {
|
||||
return mapper.insertSeeding(health);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -238,7 +238,7 @@
|
||||
</delete>
|
||||
|
||||
<delete id="seedSuccess">
|
||||
DELETE FROM #{seed_Success}
|
||||
DELETE FROM "seed_Success"
|
||||
WHERE zone = #{zone}
|
||||
and image_date =#{imageDate}
|
||||
</delete>
|
||||
|
@ -34,6 +34,18 @@
|
||||
</if>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="sqlSeeding1" resultMap="RM_Seeding">
|
||||
SELECT <include refid="columns"/> FROM suitability
|
||||
WHERE 1=1
|
||||
<if test="zone!= null and zone !=''">
|
||||
AND zone = #{zone}
|
||||
</if>
|
||||
<if test="year!= null and year !=''">
|
||||
AND year1 = #{year}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="sqlYear" resultMap="RM_Seeding">
|
||||
SELECT distinct year1,ZONE FROM suitability
|
||||
</select>
|
||||
|
@ -11,7 +11,7 @@
|
||||
<result property="seedingSuccessArea" column="Seeding_success_area"/>
|
||||
<result property="seedingSuccess" column="seeding_success"/>
|
||||
<result property="imageDate" column="Image_date"/>
|
||||
<result property="productCode1" column="Product_code1"/>
|
||||
<result property="productCode1" column="productCode1"/>
|
||||
<result property="productCode2" column="Product_code2"/>
|
||||
<result property="productCode3" column="Product_code3"/>
|
||||
<result property="year" column="year1"/>
|
||||
|
@ -77,6 +77,16 @@
|
||||
<select id="sqlYear" resultMap="RM_Seeding">
|
||||
SELECT distinct year1,ZONE FROM healthy
|
||||
</select>
|
||||
<select id="sqlInfo" resultMap="RM_Seeding">
|
||||
select * from healthy
|
||||
where 1=1
|
||||
<if test="zone!= null and zone !=''">
|
||||
AND zone = #{zone}
|
||||
</if>
|
||||
<if test="year!= null and year !=''">
|
||||
AND year1=#{year}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
Loading…
x
Reference in New Issue
Block a user