|
|
@@ -1,16 +1,18 @@
|
|
|
|
package com.ruoyi.web.controller.shate;
|
|
|
|
package com.ruoyi.web.controller.shate;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.fasterxml.jackson.datatype.jsr310.deser.InstantDeserializer;
|
|
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
|
import com.ruoyi.common.utils.BarChart;
|
|
|
|
import com.ruoyi.common.utils.BarChart;
|
|
|
|
import com.ruoyi.common.utils.CustomXWPFDocument;
|
|
|
|
import com.ruoyi.common.utils.CustomXWPFDocument;
|
|
|
|
import com.ruoyi.common.utils.shate.PageUtils;
|
|
|
|
import com.ruoyi.common.utils.shate.PageUtils;
|
|
|
|
|
|
|
|
|
|
|
|
import com.ruoyi.system.domain_shate.*;
|
|
|
|
import com.ruoyi.system.domain_shate.*;
|
|
|
|
import com.ruoyi.system.service_shate.IDateUploadService;
|
|
|
|
import com.ruoyi.system.service_shate.*;
|
|
|
|
import com.ruoyi.system.service_shate.IPlantingSuitabilityService;
|
|
|
|
|
|
|
|
import com.ruoyi.system.service_shate.ISeedingSuccessService;
|
|
|
|
|
|
|
|
import com.ruoyi.system.service_shate.IVegetationHealthServices;
|
|
|
|
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
|
|
|
|
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.util.ResourceUtils;
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
import org.w3c.dom.Document;
|
|
|
|
import org.w3c.dom.Document;
|
|
|
@@ -24,6 +26,7 @@ import javax.servlet.http.HttpServletResponse;
|
|
|
|
import javax.xml.parsers.DocumentBuilder;
|
|
|
|
import javax.xml.parsers.DocumentBuilder;
|
|
|
|
import javax.xml.parsers.DocumentBuilderFactory;
|
|
|
|
import javax.xml.parsers.DocumentBuilderFactory;
|
|
|
|
import java.io.*;
|
|
|
|
import java.io.*;
|
|
|
|
|
|
|
|
import java.lang.reflect.AnnotatedArrayType;
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
import java.util.*;
|
|
|
|
import java.util.*;
|
|
|
|
|
|
|
|
|
|
|
@@ -35,15 +38,19 @@ import java.util.*;
|
|
|
|
@RequestMapping(value = "/api/Upload", produces = "application/json;charset=UTF-8")
|
|
|
|
@RequestMapping(value = "/api/Upload", produces = "application/json;charset=UTF-8")
|
|
|
|
@Api(tags = "文件上传记录")
|
|
|
|
@Api(tags = "文件上传记录")
|
|
|
|
|
|
|
|
|
|
|
|
public class DateUploadController
|
|
|
|
public class DateUploadController {
|
|
|
|
{
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
@Resource
|
|
|
|
IPlantingSuitabilityService plantingSuitabilityService;
|
|
|
|
IPlantingSuitabilityService plantingSuitabilityService;
|
|
|
|
@Resource
|
|
|
|
@Resource
|
|
|
|
|
|
|
|
ILandUseServices landUseServices;
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
IVegetationHealthServices vegetationHealthServices;
|
|
|
|
IVegetationHealthServices vegetationHealthServices;
|
|
|
|
@Resource
|
|
|
|
@Resource
|
|
|
|
private IDateUploadService service;
|
|
|
|
private IDateUploadService service;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
|
|
|
private ITopographicFactorService factorService;
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
@Resource
|
|
|
|
ISeedingSuccessService seedingSuccessService;
|
|
|
|
ISeedingSuccessService seedingSuccessService;
|
|
|
|
|
|
|
|
|
|
|
@@ -56,11 +63,8 @@ public class DateUploadController
|
|
|
|
private String ShpPaths;
|
|
|
|
private String ShpPaths;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value = "/SelectUpload", method = {RequestMethod.POST})
|
|
|
|
@RequestMapping(value = "/SelectUpload", method = {RequestMethod.POST})
|
|
|
|
public AjaxResult SelectUpload(@RequestBody paging paging)
|
|
|
|
public AjaxResult SelectUpload(@RequestBody paging paging) {
|
|
|
|
{
|
|
|
|
|
|
|
|
// LocalDate tomorrow = LocalDate.of(2022,10,2);
|
|
|
|
// LocalDate tomorrow = LocalDate.of(2022,10,2);
|
|
|
|
// LocalDate today = LocalDate.now();
|
|
|
|
// LocalDate today = LocalDate.now();
|
|
|
|
//
|
|
|
|
//
|
|
|
@@ -73,8 +77,7 @@ public class DateUploadController
|
|
|
|
String type = paging.getType().replace(" ", "");
|
|
|
|
String type = paging.getType().replace(" ", "");
|
|
|
|
String type2 = "";
|
|
|
|
String type2 = "";
|
|
|
|
|
|
|
|
|
|
|
|
if (paging.getType2()!=null)
|
|
|
|
if (paging.getType2() != null) {
|
|
|
|
{
|
|
|
|
|
|
|
|
type2 = paging.getType2().toUpperCase();
|
|
|
|
type2 = paging.getType2().toUpperCase();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
String date = paging.getUploadTime();
|
|
|
|
String date = paging.getUploadTime();
|
|
|
@@ -82,14 +85,10 @@ public class DateUploadController
|
|
|
|
String dateTime = paging.getDateTime();
|
|
|
|
String dateTime = paging.getDateTime();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ( name!=null && name!="")
|
|
|
|
if (name != null && name != "") {
|
|
|
|
{
|
|
|
|
if (name.equals("1")) {
|
|
|
|
if (name.equals("1"))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
name = "M_Heal%";
|
|
|
|
name = "M_Heal%";
|
|
|
|
}
|
|
|
|
} else if (name.equals("2")) {
|
|
|
|
else if(name.equals("2"))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
name = "H_Heal%";
|
|
|
|
name = "H_Heal%";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@@ -104,13 +103,8 @@ public class DateUploadController
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value = "/delUpload", method = {RequestMethod.POST})
|
|
|
|
@RequestMapping(value = "/delUpload", method = {RequestMethod.POST})
|
|
|
|
public AjaxResult DelUpload(@RequestBody UplodFile uplodFile)
|
|
|
|
public AjaxResult DelUpload(@RequestBody UplodFile uplodFile) {
|
|
|
|
{
|
|
|
|
|
|
|
|
return delUploadFile(uplodFile.getId());
|
|
|
|
return delUploadFile(uplodFile.getId());
|
|
|
|
// List<Integer> ids=uplodFile.getId();
|
|
|
|
// List<Integer> ids=uplodFile.getId();
|
|
|
|
// Integer Seeding=0;
|
|
|
|
// Integer Seeding=0;
|
|
|
@@ -133,14 +127,14 @@ public class DateUploadController
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value = "/delUpload1", method = {RequestMethod.DELETE})
|
|
|
|
@RequestMapping(value = "/delUpload1", method = {RequestMethod.DELETE})
|
|
|
|
public AjaxResult DelUpload1(@RequestParam("id") List<Integer> id)
|
|
|
|
public AjaxResult DelUpload1(@RequestParam("id") List<Integer> id) {
|
|
|
|
{
|
|
|
|
|
|
|
|
List<Integer> ids = id;
|
|
|
|
List<Integer> ids = id;
|
|
|
|
Integer Seeding = 0;
|
|
|
|
Integer Seeding = 0;
|
|
|
|
for (int i=0; i<ids.size();i++)
|
|
|
|
for (int i = 0; i < ids.size(); i++) {
|
|
|
|
{
|
|
|
|
|
|
|
|
Seeding = service.DelUpload(ids.get(i));
|
|
|
|
Seeding = service.DelUpload(ids.get(i));
|
|
|
|
if (Seeding==0){return AjaxResult.error("没有此id单据!"+ids.get(i));}
|
|
|
|
if (Seeding == 0) {
|
|
|
|
|
|
|
|
return AjaxResult.error("没有此id单据!" + ids.get(i));
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return AjaxResult.success(Seeding);
|
|
|
|
return AjaxResult.success(Seeding);
|
|
|
|
|
|
|
|
|
|
|
@@ -148,12 +142,10 @@ public class DateUploadController
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value = "/InitShp", method = {RequestMethod.POST})
|
|
|
|
@RequestMapping(value = "/InitShp", method = {RequestMethod.POST})
|
|
|
|
public AjaxResult InitShp(@RequestBody UplodFile uplodFile)
|
|
|
|
public AjaxResult InitShp(@RequestBody UplodFile uplodFile) {
|
|
|
|
{
|
|
|
|
|
|
|
|
List<DateUpload> dateUploads = infr(uplodFile.getDateUploads());
|
|
|
|
List<DateUpload> dateUploads = infr(uplodFile.getDateUploads());
|
|
|
|
|
|
|
|
|
|
|
|
for (int i=0; i<dateUploads.size();i++)
|
|
|
|
for (int i = 0; i < dateUploads.size(); i++) {
|
|
|
|
{
|
|
|
|
|
|
|
|
Integer Seeding = service.IntoShp(dateUploads.get(i));
|
|
|
|
Integer Seeding = service.IntoShp(dateUploads.get(i));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@@ -162,15 +154,13 @@ public class DateUploadController
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value = "/InitUpload", method = {RequestMethod.POST})
|
|
|
|
@RequestMapping(value = "/InitUpload", method = {RequestMethod.POST})
|
|
|
|
public AjaxResult InitUpload(@RequestBody UplodFile uplodFile)
|
|
|
|
public AjaxResult InitUpload(@RequestBody UplodFile uplodFile) {
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
readXml();
|
|
|
|
readXml();
|
|
|
|
|
|
|
|
|
|
|
|
List<DateUpload> dateUploads = infr(uplodFile.getDateUploads());
|
|
|
|
List<DateUpload> dateUploads = infr(uplodFile.getDateUploads());
|
|
|
|
|
|
|
|
|
|
|
|
for (int i=0; i<dateUploads.size();i++)
|
|
|
|
for (int i = 0; i < dateUploads.size(); i++) {
|
|
|
|
{
|
|
|
|
|
|
|
|
Integer Seeding = service.IntoUpload(dateUploads.get(i));
|
|
|
|
Integer Seeding = service.IntoUpload(dateUploads.get(i));
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
@@ -178,10 +168,8 @@ public class DateUploadController
|
|
|
|
return AjaxResult.success("成功");
|
|
|
|
return AjaxResult.success("成功");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private List<DateUpload> infr(List<DateUpload> dateUpload)
|
|
|
|
private List<DateUpload> infr(List<DateUpload> dateUpload) {
|
|
|
|
{
|
|
|
|
for (int i = 0; i < dateUpload.size(); i++) {
|
|
|
|
for (int i=0;i<dateUpload.size();i++)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String[] typesList = dateUpload.get(i).getType1().split("\\/");
|
|
|
|
String[] typesList = dateUpload.get(i).getType1().split("\\/");
|
|
|
|
|
|
|
|
|
|
|
@@ -195,8 +183,7 @@ public class DateUploadController
|
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
|
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
|
|
|
|
|
|
|
|
|
|
|
|
String dateNowStr = sdf.format(d);
|
|
|
|
String dateNowStr = sdf.format(d);
|
|
|
|
if(type1.equals("EVALUATIONINDICATORS"))
|
|
|
|
if (type1.equals("EVALUATIONINDICATORS")) {
|
|
|
|
{
|
|
|
|
|
|
|
|
String[] strs = dateUpload.get(i).getFileName().split("\\.");
|
|
|
|
String[] strs = dateUpload.get(i).getFileName().split("\\.");
|
|
|
|
|
|
|
|
|
|
|
|
String name = strs[0];
|
|
|
|
String name = strs[0];
|
|
|
@@ -233,8 +220,7 @@ public class DateUploadController
|
|
|
|
ShpPaths + uploadValue.getData_id());
|
|
|
|
ShpPaths + uploadValue.getData_id());
|
|
|
|
demo.run();
|
|
|
|
demo.run();
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
} else if (type1.equals("BOUNDARIES"))//Boundaries
|
|
|
|
else if(type1.equals("BOUNDARIES"))//Boundaries
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
String[] strs = dateUpload.get(i).getFileName().split("\\.");
|
|
|
|
String[] strs = dateUpload.get(i).getFileName().split("\\.");
|
|
|
|
|
|
|
|
|
|
|
@@ -256,9 +242,7 @@ public class DateUploadController
|
|
|
|
|
|
|
|
|
|
|
|
dateUpload.get(i).setExtent1(dateUpload.get(i).getExtent().toString());
|
|
|
|
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[] strs = dateUpload.get(i).getFileName().split("\\.");
|
|
|
|
|
|
|
|
|
|
|
|
String name = strs[0];
|
|
|
|
String name = strs[0];
|
|
|
@@ -295,9 +279,7 @@ public class DateUploadController
|
|
|
|
ShpPaths + uploadValue.getData_id());
|
|
|
|
ShpPaths + uploadValue.getData_id());
|
|
|
|
demo.run();
|
|
|
|
demo.run();
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
} else if (type1.equals("SUITABILITY")) {
|
|
|
|
else if(type1.equals("SUITABILITY"))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
String[] strs = dateUpload.get(i).getFileName().split("\\.");
|
|
|
|
String[] strs = dateUpload.get(i).getFileName().split("\\.");
|
|
|
|
|
|
|
|
|
|
|
|
String name = strs[0];
|
|
|
|
String name = strs[0];
|
|
|
@@ -334,9 +316,7 @@ public class DateUploadController
|
|
|
|
FilePaths + dateUpload.get(i).getData_id(),
|
|
|
|
FilePaths + dateUpload.get(i).getData_id(),
|
|
|
|
ShpPaths + uploadValue.getData_id());
|
|
|
|
ShpPaths + uploadValue.getData_id());
|
|
|
|
demo.run();
|
|
|
|
demo.run();
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
String[] strs = dateUpload.get(i).getFileName().split("\\.");
|
|
|
|
String[] strs = dateUpload.get(i).getFileName().split("\\.");
|
|
|
|
|
|
|
|
|
|
|
|
String name = strs[0];
|
|
|
|
String name = strs[0];
|
|
|
@@ -380,13 +360,13 @@ public class DateUploadController
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 调用exe
|
|
|
|
* 调用exe
|
|
|
|
|
|
|
|
*
|
|
|
|
* @param fileName 文件名称
|
|
|
|
* @param fileName 文件名称
|
|
|
|
* @param filePath tif文件路径
|
|
|
|
* @param filePath tif文件路径
|
|
|
|
* @param shpPath shp文件路径
|
|
|
|
* @param shpPath shp文件路径
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@RequestMapping(value = "/callExe", method = {RequestMethod.GET})
|
|
|
|
@RequestMapping(value = "/callExe", method = {RequestMethod.GET})
|
|
|
|
public void callExe(String fileName,String filePath,String shpPath)
|
|
|
|
public void callExe(String fileName, String filePath, String shpPath) {
|
|
|
|
{
|
|
|
|
|
|
|
|
BufferedReader bufferedReader = null;
|
|
|
|
BufferedReader bufferedReader = null;
|
|
|
|
Process proc = null;
|
|
|
|
Process proc = null;
|
|
|
|
try {
|
|
|
|
try {
|
|
|
@@ -415,7 +395,8 @@ public class DateUploadController
|
|
|
|
|
|
|
|
|
|
|
|
} catch (IOException e) {
|
|
|
|
} catch (IOException e) {
|
|
|
|
e.printStackTrace();
|
|
|
|
e.printStackTrace();
|
|
|
|
System.out.println(e.getMessage());;
|
|
|
|
System.out.println(e.getMessage());
|
|
|
|
|
|
|
|
;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@@ -433,6 +414,7 @@ public class DateUploadController
|
|
|
|
this.ShpPath = shpPath;
|
|
|
|
this.ShpPath = shpPath;
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void run() {
|
|
|
|
public void run() {
|
|
|
|
callExe(FileName, FilePath, ShpPath);
|
|
|
|
callExe(FileName, FilePath, ShpPath);
|
|
|
@@ -441,6 +423,7 @@ public class DateUploadController
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 删除
|
|
|
|
* 删除
|
|
|
|
|
|
|
|
*
|
|
|
|
* @return
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@RequestMapping(value = "/delUploadFile", method = {RequestMethod.DELETE})
|
|
|
|
@RequestMapping(value = "/delUploadFile", method = {RequestMethod.DELETE})
|
|
|
@@ -469,28 +452,31 @@ public class DateUploadController
|
|
|
|
type2 = type2.substring(0, type2.length() - 1);
|
|
|
|
type2 = type2.substring(0, type2.length() - 1);
|
|
|
|
file.UploadFile1(type2, value.getZone(), value.getDataTime(), service, "");
|
|
|
|
file.UploadFile1(type2, value.getZone(), value.getDataTime(), service, "");
|
|
|
|
Seeding = service.DelUpload(ids.get(i));
|
|
|
|
Seeding = service.DelUpload(ids.get(i));
|
|
|
|
if (Seeding==0){return AjaxResult.error("没有此id单据!"+ids.get(i));}
|
|
|
|
if (Seeding == 0) {
|
|
|
|
|
|
|
|
return AjaxResult.error("没有此id单据!" + ids.get(i));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// &&
|
|
|
|
// &&
|
|
|
|
// (type1.equals("RSIMAGES") || type1.equals("PLANTINGDISTRIBUTION") || type1.equals("VEGETATIONHEALTH"))
|
|
|
|
// (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[] typeValue = value.getFileName().split("_");
|
|
|
|
String resolution = typeValue[0];
|
|
|
|
String resolution = typeValue[0];
|
|
|
|
String type2 = "Heal";
|
|
|
|
String type2 = "Heal";
|
|
|
|
file.UploadFile1(type2, value.getZone(), value.getDataTime(), service, resolution);
|
|
|
|
file.UploadFile1(type2, value.getZone(), value.getDataTime(), service, resolution);
|
|
|
|
Seeding = service.DelUpload(ids.get(i));
|
|
|
|
Seeding = service.DelUpload(ids.get(i));
|
|
|
|
if (Seeding==0){return AjaxResult.error("没有此id单据!"+ids.get(i));}
|
|
|
|
if (Seeding == 0) {
|
|
|
|
|
|
|
|
return AjaxResult.error("没有此id单据!" + ids.get(i));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
} else {
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String[] typeValue = value.getFileName().split("_");
|
|
|
|
String[] typeValue = value.getFileName().split("_");
|
|
|
|
String type2 = typeValue[0];
|
|
|
|
String type2 = typeValue[0];
|
|
|
|
file.UploadFile1(type2, value.getZone(), value.getDataTime(), service, "");
|
|
|
|
file.UploadFile1(type2, value.getZone(), value.getDataTime(), service, "");
|
|
|
|
Seeding = service.DelUpload(ids.get(i));
|
|
|
|
Seeding = service.DelUpload(ids.get(i));
|
|
|
|
if (Seeding==0){return AjaxResult.error("没有此id单据!"+ids.get(i));}
|
|
|
|
if (Seeding == 0) {
|
|
|
|
|
|
|
|
return AjaxResult.error("没有此id单据!" + ids.get(i));
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
@@ -525,7 +511,6 @@ public class DateUploadController
|
|
|
|
// 区分,去掉空格和换行符
|
|
|
|
// 区分,去掉空格和换行符
|
|
|
|
if (childNodes.item(k).getNodeType() == Node.ELEMENT_NODE) {
|
|
|
|
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();
|
|
|
@@ -540,16 +525,19 @@ public class DateUploadController
|
|
|
|
e.printStackTrace();
|
|
|
|
e.printStackTrace();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 导出Word
|
|
|
|
* 导出Word
|
|
|
|
|
|
|
|
*
|
|
|
|
* @param
|
|
|
|
* @param
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@RequestMapping(value = "/exportWord",method = {RequestMethod.GET})
|
|
|
|
@RequestMapping(value = "/exportWord1", method = {RequestMethod.GET})
|
|
|
|
@ResponseBody
|
|
|
|
@ResponseBody
|
|
|
|
public void exportWord(HttpServletResponse response, HttpServletRequest request) throws Exception {
|
|
|
|
public void exportWord1(HttpServletResponse response, HttpServletRequest request) throws Exception {
|
|
|
|
|
|
|
|
String [] zoneList=new String[]{"01","02","03"};
|
|
|
|
//接受前端传来的数据
|
|
|
|
//接受前端传来的数据
|
|
|
|
String year = "2022";//request.getParameter("year");
|
|
|
|
String year = "2022";
|
|
|
|
String zone = "03";//request.getParameter("zone");
|
|
|
|
|
|
|
|
//创建文本对象
|
|
|
|
//创建文本对象
|
|
|
|
CustomXWPFDocument docxDocument = new CustomXWPFDocument();
|
|
|
|
CustomXWPFDocument docxDocument = new CustomXWPFDocument();
|
|
|
|
//创建标题
|
|
|
|
//创建标题
|
|
|
@@ -558,106 +546,137 @@ public class DateUploadController
|
|
|
|
BarChart.createFirstLevelTopic(docxDocument, "1.Background information");
|
|
|
|
BarChart.createFirstLevelTopic(docxDocument, "1.Background information");
|
|
|
|
//创建第一个段落的内容
|
|
|
|
//创建第一个段落的内容
|
|
|
|
BarChart.createParagraphAndInsertWord(docxDocument, "Date time: " + year);
|
|
|
|
BarChart.createParagraphAndInsertWord(docxDocument, "Date time: " + year);
|
|
|
|
BarChart.createParagraphAndInsertWord(docxDocument, "Evaluation area: "+zone);
|
|
|
|
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.createFirstLevelTopic(docxDocument, "2.Results of remote sensing monitoring of seeding success rate");
|
|
|
|
BarChart.createSecondLevelTopic(docxDocument, i+2+".2.2. Monitoring results of soil index");
|
|
|
|
//循环判断有多少个资源
|
|
|
|
//沙化指数
|
|
|
|
List<SeedingSuccessRate> seedingSuccessRates = seedingSuccessService.sqlSeeding(zone, year);
|
|
|
|
BarChart.insertPic(docxDocument, "C:\\Users\\HP\\Desktop\\文本文档\\1650791783(1).jpg");
|
|
|
|
for (SeedingSuccessRate seedingSuccessRate : seedingSuccessRates) {
|
|
|
|
BarChart.setPicTitle(docxDocument, "Figure "+(number+9)+" Spatial distribution data of soil desertification factor");
|
|
|
|
//图片的url
|
|
|
|
String[] xDesertificationAxis = new String[]{"<0.1", "01~0.3", "0.3~0.5", "0.5~0.7", ">0.7"};//x轴
|
|
|
|
//String productCode1 = seedingSuccessRate.getProductCode1();
|
|
|
|
Double[] yDesertificationAxis = new Double[]{main.getSoilDesertifications().get(0).getLevel1(),
|
|
|
|
//String productCode2 = seedingSuccessRate.getProductCode2();
|
|
|
|
main.getSoilDesertifications().get(0).getLevel2(), main.getSoilDesertifications().get(0).getLevel3(),
|
|
|
|
//创建第二段落的内容
|
|
|
|
main.getSoilDesertifications().get(0).getLevel4(), main.getSoilDesertifications().get(0).getLevel5()};
|
|
|
|
BarChart.insertPic(docxDocument, "C:\\Users\\xkrs\\Desktop\\pic\\1.png");
|
|
|
|
BarChart.drawTable(docxDocument, xDesertificationAxis, yDesertificationAxis);
|
|
|
|
BarChart.setPicTitle(docxDocument, "Spatial distribution data of successful seeding regions");
|
|
|
|
BarChart.setPicTitle(docxDocument, "Figure "+(number+10)+" Classification statistics of soil desertification factor");
|
|
|
|
BarChart.insertPic(docxDocument, "C:\\Users\\xkrs\\Desktop\\pic\\2.png");
|
|
|
|
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.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.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(),
|
|
|
|
BarChart.createFirstLevelTopic(docxDocument, "3.Results of remote sensing monitoring of vegetation health");
|
|
|
|
main.getSoilMoistures().get(0).getLevel2(), main.getSoilMoistures().get(0).getLevel3(),
|
|
|
|
//获取ProductCode1的集合
|
|
|
|
main.getSoilMoistures().get(0).getLevel4(), main.getSoilMoistures().get(0).getLevel5()};
|
|
|
|
List<String> M_code=new ArrayList<>();
|
|
|
|
BarChart.drawTable(docxDocument, xDesertificationAxis, yMoistureAxis);
|
|
|
|
List<String> H_code=new ArrayList<>();
|
|
|
|
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.");
|
|
|
|
List<VegetationHealth> vegetationHealths = vegetationHealthServices.sqlInfo(zone, year);
|
|
|
|
//盐渍化指数
|
|
|
|
//循环查询的数据分别加入到不同的集合中作为中质量和高质量的循环次数
|
|
|
|
BarChart.insertPic(docxDocument, "C:\\Users\\HP\\Desktop\\文本文档\\1650791783(1).jpg");
|
|
|
|
for (VegetationHealth vegetationHealth : vegetationHealths) {
|
|
|
|
BarChart.setPicTitle(docxDocument, "Figure "+(number+13)+" Spatial distribution data of soil salinization factor");
|
|
|
|
String productCode1 = vegetationHealth.getProductCode1();
|
|
|
|
Double[] ySalinizationsAxis = new Double[]{main.getSoilSalinizations().get(0).getLevel1(),
|
|
|
|
if(productCode1.startsWith("M"))
|
|
|
|
main.getSoilSalinizations().get(0).getLevel2(), main.getSoilSalinizations().get(0).getLevel3(),
|
|
|
|
{
|
|
|
|
main.getSoilSalinizations().get(0).getLevel4(), main.getSoilSalinizations().get(0).getLevel5()};
|
|
|
|
M_code.add(vegetationHealth.getProductCode1());
|
|
|
|
BarChart.drawTable(docxDocument, xDesertificationAxis, ySalinizationsAxis);//标题2图标
|
|
|
|
}
|
|
|
|
BarChart.setPicTitle(docxDocument, "Figure "+(number+14)+" Classification statistics of soil salinization factor");
|
|
|
|
if(productCode1.startsWith("H"))
|
|
|
|
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.");
|
|
|
|
{
|
|
|
|
|
|
|
|
H_code.add(vegetationHealth.getProductCode1());
|
|
|
|
//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");
|
|
|
|
int size=H_code.size()+M_code.size();
|
|
|
|
Double[] yRoadAxis = new Double[]{main.getRoadFactors().get(0).getLevel1(),
|
|
|
|
BarChart.createSecondLevelTopic(docxDocument, "3.1.Monitoring results of medium resolution data");
|
|
|
|
main.getRoadFactors().get(0).getLevel2(), main.getRoadFactors().get(0).getLevel3(),
|
|
|
|
for(int i = 0; i <M_code.size(); i++) {
|
|
|
|
main.getRoadFactors().get(0).getLevel4(), main.getRoadFactors().get(0).getLevel5()};
|
|
|
|
List<VegetationHealth> vegetationHealths_M = vegetationHealthServices.sqlSeeding(zone, M_code.get(i), year);
|
|
|
|
BarChart.drawTable(docxDocument, xDesertificationAxis, yRoadAxis);//标题2图标
|
|
|
|
for (VegetationHealth vegetationHealth_m : vegetationHealths_M) {
|
|
|
|
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\\xkrs\\Desktop\\pic\\2.png");
|
|
|
|
//水域因子
|
|
|
|
BarChart.setPicTitle(docxDocument, "Spatial distribution data of vegetation planting area");
|
|
|
|
BarChart.insertPic(docxDocument, "C:\\Users\\HP\\Desktop\\文本文档\\1650791783(1).jpg");
|
|
|
|
BarChart.insertPic(docxDocument, "C:\\Users\\xkrs\\Desktop\\pic\\1.png");
|
|
|
|
BarChart.setPicTitle(docxDocument, "Figure "+(number+17)+" Spatial distribution data of water factor");
|
|
|
|
BarChart.setPicTitle(docxDocument, "Spatial distribution data of vegetation health status");
|
|
|
|
Double[] yWaterAxis = new Double[]{main.getWaterFactors().get(0).getLevel1(),
|
|
|
|
//插入柱状图表
|
|
|
|
main.getWaterFactors().get(0).getLevel2(), main.getWaterFactors().get(0).getLevel3(),
|
|
|
|
String[] xAxisData = new String[]{"Health", "Normal", "Not-Health"};
|
|
|
|
main.getWaterFactors().get(0).getLevel4(), main.getWaterFactors().get(0).getLevel5()};
|
|
|
|
Double m1 = vegetationHealth_m.getHealthy();
|
|
|
|
BarChart.drawTable(docxDocument, xDesertificationAxis, yWaterAxis);//标题2图标
|
|
|
|
Double m2 = vegetationHealth_m.getNormal();
|
|
|
|
BarChart.setPicTitle(docxDocument, "Figure "+(number+18)+" Classification statistics of water factor");
|
|
|
|
Double m3 = vegetationHealth_m.getNotHealthy();
|
|
|
|
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.");
|
|
|
|
Double[] yAxisData = new Double[]{m1, m2, m3};
|
|
|
|
//2.3
|
|
|
|
BarChart.drawTable(docxDocument,xAxisData,yAxisData);
|
|
|
|
BarChart.createSecondLevelTopic(docxDocument, i+2+".3. Monitoring results of planting suitability");
|
|
|
|
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)+"%.");
|
|
|
|
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");
|
|
|
|
//第三段的第二个小标题
|
|
|
|
|
|
|
|
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\\xkrs\\Desktop\\pic\\1.png");
|
|
|
|
|
|
|
|
BarChart.setPicTitle(docxDocument, "Spatial distribution data of vegetation planting area");
|
|
|
|
|
|
|
|
BarChart.insertPic(docxDocument, "C:\\Users\\xkrs\\Desktop\\pic\\2.png");
|
|
|
|
|
|
|
|
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\\xkrs\\Desktop\\pic\\1.png");
|
|
|
|
|
|
|
|
BarChart.setPicTitle(docxDocument,"Spatial distribution data of planting suitability");
|
|
|
|
|
|
|
|
//此处插入图表
|
|
|
|
//此处插入图表
|
|
|
|
String[] xAxisData2 = new String[]{"Very Suitable", "Suitable", "Not Suitable"};
|
|
|
|
String[] xAxisData2 = new String[]{"Very Suitable", "Suitable", "Not Suitable"};
|
|
|
|
Double s1 = suitability.getVerySuitable();
|
|
|
|
Double x1 = suitability.getVerySuitable();
|
|
|
|
Double s2 = suitability.getSuitable();
|
|
|
|
Double x2 = suitability.getSuitable();
|
|
|
|
Double s3 = suitability.getNotSuitable();
|
|
|
|
Double x3 = suitability.getNotSuitable();
|
|
|
|
Double[] yAxisData2 = new Double[]{s1, s2, s3};
|
|
|
|
Double[] yAxisData2 = new Double[]{x1, x2, x3};
|
|
|
|
BarChart.drawTable(docxDocument, xAxisData2, yAxisData2);
|
|
|
|
BarChart.drawTable(docxDocument, xAxisData2, yAxisData2);
|
|
|
|
BarChart.setPicTitle(docxDocument,"Classification statistics of planting suitability");
|
|
|
|
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)+"%.");
|
|
|
|
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.setCharacterEncoding("UTF-8");
|
|
|
|
response.setContentType("application/msword");
|
|
|
|
response.setContentType("application/msword");
|
|
|
|
//文件名
|
|
|
|
//文件名
|
|
|
@@ -669,4 +688,137 @@ public class DateUploadController
|
|
|
|
responseOutputStream.close();
|
|
|
|
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();
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|