文件下载

This commit is contained in:
2023-03-07 13:53:43 +08:00
parent 4b48e7f55e
commit bc3cd91c6a
23 changed files with 677 additions and 265 deletions

View File

@ -24,6 +24,8 @@ public class RuoYiApplication
{
// System.setProperty("spring.devtools.restart.enabled", "false");
SpringApplication.run(RuoYiApplication.class, args);
System.out.println();

View File

@ -1,5 +1,6 @@
package com.ruoyi.web.controller.shate;
import ch.qos.logback.classic.pattern.LineOfCallerConverter;
import com.fasterxml.jackson.datatype.jsr310.deser.InstantDeserializer;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.BarChart;
@ -14,6 +15,7 @@ import io.swagger.v3.oas.models.security.SecurityScheme;
import net.sf.jsqlparser.statement.create.procedure.CreateProcedure;
import org.apache.poi.hssf.usermodel.HeaderFooter;
import org.apache.poi.xwpf.usermodel.XWPFDocument;
import org.aspectj.weaver.loadtime.Aj;
import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTSectPr;
import org.springframework.boot.autoconfigure.web.ServerProperties;
import org.springframework.util.ResourceUtils;
@ -30,9 +32,11 @@ import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import java.io.*;
import java.lang.reflect.AnnotatedArrayType;
import java.lang.reflect.Parameter;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
/**
* @Author: JinSheng Song
@ -66,6 +70,8 @@ public class DateUploadController {
private String ShpPaths;
private String MapExePath;
@RequestMapping(value = "/SelectUpload", method = {RequestMethod.POST})
public AjaxResult SelectUpload(@RequestBody paging paging) {
@ -347,18 +353,21 @@ public class DateUploadController {
}
public void callExe1(String filePath) {
public void callExe1(String fileName, String filePath) {
BufferedReader bufferedReader = null;
Process proc = null;
try {
String[] cmd = {ExePathName.replace("main", "thematicMap"), filePath + ".tif", filePath + "/jpg/"};
System.out.println("MapExePath路径:" + MapExePath);
String[] cmd = {MapExePath, fileName, filePath + ".tif", FilePaths + "jpg/"};
System.out.println("调用方法名:" + MapExePath + " 文件名:" + fileName + " 调用tif文件" + filePath + ".tif" + " 生成jpg路径" + FilePaths + "jpg/");
ProcessBuilder pb = new ProcessBuilder();
pb.command(cmd);
proc = pb.start();
System.out.println("Start calling algorithm");
System.out.println("Start calling algorithm(image)");
bufferedReader = new BufferedReader(new InputStreamReader(proc.getErrorStream()));
String aa = null;
@ -368,11 +377,9 @@ public class DateUploadController {
}
System.out.println(aa);
} catch (IOException e) {
e.printStackTrace();
System.out.println(e.getMessage());
;
e.printStackTrace();
}
}
@ -400,7 +407,7 @@ public class DateUploadController {
ProcessBuilder pb = new ProcessBuilder();
pb.command(cmd);
proc = pb.start();
System.out.println("Start calling algorithm");
System.out.println("Start calling algorithm(tif)");
bufferedReader = new BufferedReader(new InputStreamReader(proc.getErrorStream()));
String aa = null;
@ -435,7 +442,7 @@ public class DateUploadController {
@Override
public void run() {
callExe1(FilePath);
callExe1(FileName, FilePath);
callExe(FileName, FilePath, ShpPath);
}
}
@ -503,6 +510,7 @@ public class DateUploadController {
return AjaxResult.success("成功!");
}
public void readXml() {
try {
// 创建解析器工厂
@ -537,6 +545,8 @@ public class DateUploadController {
this.FilePaths = childNodes.item(5).getTextContent().trim();
this.ShpPaths = childNodes.item(7).getTextContent().trim();
this.MapExePath = childNodes.item(9).getTextContent().trim();
}
}
}
@ -545,6 +555,97 @@ public class DateUploadController {
}
}
/**
* 修改全部区域名称
* @return
*/
@RequestMapping(value = "/updateAllRegionName",method = {RequestMethod.POST})
public AjaxResult updateAllRegionName(@RequestBody RegionName regionName)
{
return landUseServices.updateAllRegionName(regionName.getRegionName());
}
/**
* 查询所有区域名称
* @return
*/
@RequestMapping(value = "/queryAllRegionName", method = {RequestMethod.GET})
public AjaxResult queryAllRegionName() {
try {
List<String> regionNameList = new ArrayList<>();
List<LandUse> landUses = landUseServices.sqlSeeding1(null, null);
UplodFile main = landUseServices.mainClass(null, null);
if (main == null) {
return null;
}
if (landUses != null) {
landUses.forEach(e -> {
regionNameList.add(e.getRegionName());
});
}
if (main.getWaterFactors() != null) {
main.getWaterFactors().forEach(e -> {
regionNameList.add(e.getRegionName());
});
}
if (main.getRoadFactors() != null) {
main.getRoadFactors().forEach(e -> {
regionNameList.add(e.getRegionName());
});
}
if (main.getSoilMoistures() != null) {
main.getSoilMoistures().forEach(e -> {
regionNameList.add(e.getRegionName());
});
}
if (main.getSoilSalinizations() != null) {
main.getSoilSalinizations().forEach(e -> {
regionNameList.add(e.getRegionName());
});
}
if (main.getSoilDesertifications() != null) {
main.getSoilDesertifications().forEach(e -> {
regionNameList.add(e.getRegionName());
});
}
if (main.getAspects() != null) {
main.getAspects().forEach(e -> {
regionNameList.add(e.getRegionName());
});
}
if (main.getSlopes() != null) {
main.getSlopes().forEach(e -> {
regionNameList.add(e.getRegionName());
});
}
if (main.getAltitudes() != null) {
main.getAltitudes().forEach(e -> {
regionNameList.add(e.getRegionName());
});
}
if (main.getInformation() != null) {
main.getInformation().forEach(e -> {
regionNameList.add(e.getRegionName());
});
}
if (main.getPlantingSuitabilities() != null) {
main.getPlantingSuitabilities().forEach(e -> {
regionNameList.add(e.getRegionName());
});
}
if (main.getVegetationHealths() != null) {
main.getVegetationHealths().forEach(e -> {
regionNameList.add(e.getRegionName());
});
}
List<String> regionNameLists = regionNameList.stream().distinct().collect(Collectors.toList());
Collections.sort(regionNameLists);
return AjaxResult.success(regionNameLists);
} catch (Exception e) {
return AjaxResult.error(e.getMessage());
}
}
/**
* 导出Word
@ -552,204 +653,223 @@ public class DateUploadController {
* @param
*/
@RequestMapping(value = "/exportWord1", method = {RequestMethod.POST})
@ResponseBody
public void exportWord1(HttpServletResponse response, HttpServletRequest request,@RequestBody WordVo wordVo) throws Exception {
readXml();
String[] zoneList = wordVo.getZoneList();
//接受前端传来的数据
String[] years = wordVo.getYear();
DecimalFormat df = new DecimalFormat("#.00");
String filePath=FilePaths+"jpg/";
for (String year : years) {
String zoneString = "";
for (String zone : zoneList) {
zone += " | ";
zoneString += zone;
public AjaxResult exportWord1(HttpServletResponse response, HttpServletRequest request, @RequestBody WordVo wordVo) {
try {
readXml();
String[] zoneList = wordVo.getZoneList();
//接受前端传来的数据
String[] years = wordVo.getYear();
String filePath = FilePaths + "jpg/";
for (String year : years) {
String zoneString = "";
for (String zone : zoneList) {
zone += " | ";
zoneString += zone;
}
zoneString = zoneString.substring(0, zoneString.length() - 3);
//创建文本对象
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.createHeader(docxDocument, "Evaluation report of planting monitoring in ITBA Nature Reserve");
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 + ")");
List<LandUse> landUses = landUseServices.sqlSeeding1(zone, year);
UplodFile main = landUseServices.mainClass(zone, year);
//土地利用类型
BarChart.createSecondLevelTopic(docxDocument, i + 2 + ".1. Monitoring results of land use types");
BarChart.insertPic(docxDocument, filePath + landUses.get(1).getProductCode3() + ".jpg");
BarChart.setPicTitle(docxDocument, "Figure " + (number + 1) + " Spatial distribution data of land use types");
//绘制土地利用类型图表
//x轴
String[] xAxisData = new String[]{"Fields", "Buildings", "Roads", "Water", "Forest", "Grass", "Soil", "Desert", "Rocks", "Other"};
//y轴
Double[] yAxisData = new Double[]{BarChart.fun(landUses.get(2).getArea() * 0.01),
BarChart.fun(landUses.get(0).getArea() * 0.01),
BarChart.fun(landUses.get(6).getArea() * 0.01),
BarChart.fun(landUses.get(9).getArea() * 0.01),
BarChart.fun(landUses.get(3).getArea() * 0.01),
BarChart.fun(landUses.get(4).getArea() * 0.01),
BarChart.fun(landUses.get(8).getArea() * 0.01),
BarChart.fun(landUses.get(1).getArea() * 0.01),
BarChart.fun(landUses.get(7).getArea() * 0.01),
BarChart.fun(landUses.get(5).getArea() * 0.01)};
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 "
+ BarChart.fun(landUses.get(2).getArea() * 0.01) + " km², the building is " + BarChart.fun(landUses.get(0).getArea() * 0.01) +
" km², the road is " + BarChart.fun(landUses.get(6).getArea() * 0.01) +
" km², the water is " + BarChart.fun(landUses.get(9).getArea() * 0.01) +
" km², the forest is " + BarChart.fun(landUses.get(3).getArea() * 0.01) +
" km², the grass is " + BarChart.fun(landUses.get(4).getArea() * 0.01) +
" km², the soil is " + BarChart.fun(landUses.get(8).getArea() * 0.01) +
" km², the desert is " + BarChart.fun(landUses.get(1).getArea() * 0.01) +
" km², the rock is " + BarChart.fun(landUses.get(7).getArea() * 0.01) +
" km², and other land use types are " + BarChart.fun(landUses.get(5).getArea() * 0.01) + " km².");
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, filePath + main.getAltitudes().get(0).getProductCode2() + ".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[]{BarChart.fun(main.getAltitudes().get(0).getLevel1() * 0.01),
BarChart.fun(main.getAltitudes().get(0).getLevel2() * 0.01),
BarChart.fun(main.getAltitudes().get(0).getLevel3() * 0.01),
BarChart.fun(main.getAltitudes().get(0).getLevel4() * 0.01),
BarChart.fun(main.getAltitudes().get(0).getLevel5() * 0.01)};//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 " + BarChart.fun(main.getAltitudes().get(0).getLevel1() * 0.01) + " km², the area with 400-600m is " + BarChart.fun(main.getAltitudes().get(0).getLevel2() * 0.01) + " km², the area with 600-1000m is " + BarChart.fun(main.getAltitudes().get(0).getLevel3() * 0.01) + " km², and the area with 1000-1500m is " + BarChart.fun(main.getAltitudes().get(0).getLevel4() * 0.01) + " km². The area with an altitude higher than 1500m is " + BarChart.fun(main.getAltitudes().get(0).getLevel5() * 0.01) + " km².");
//坡向
BarChart.insertPic(docxDocument, filePath + main.getAspects().get(0).getProductCode2() + ".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[]{BarChart.fun(main.getAspects().get(0).getNorth() * 0.01),
BarChart.fun(main.getAspects().get(0).getNortheast() * 0.01),
BarChart.fun(main.getAspects().get(0).getEast() * 0.01),
BarChart.fun(main.getAspects().get(0).getSoutheast() * 0.01),
BarChart.fun(main.getAspects().get(0).getSouth() * 0.01),
BarChart.fun(main.getAspects().get(0).getSouthwest() * 0.01),
BarChart.fun(main.getAspects().get(0).getWest() * 0.01),
BarChart.fun(main.getAspects().get(0).getNorthwest() * 0.01)};//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 " + BarChart.fun(main.getAspects().get(0).getNorth() / 100) +
" km², the area with the northeast aspect is " + BarChart.fun(main.getAspects().get(0).getNortheast() / 100) +
" km², the area with the east aspect is " + BarChart.fun(main.getAspects().get(0).getEast() / 100) +
" km², the area with the southeast aspect is " + BarChart.fun(main.getAspects().get(0).getSoutheast() / 100) +
" km², and the area with the south aspect is " + BarChart.fun(main.getAspects().get(0).getSouth() / 100) +
" km², the area with the southwest aspect is " + BarChart.fun(main.getAspects().get(0).getSouthwest() / 100) +
" km², the area with the west aspect is " + BarChart.fun(main.getAspects().get(0).getWest() / 100) +
" km², and the area with the northwest aspect is " + BarChart.fun(main.getAspects().get(0).getNorthwest() / 100) + " km².");
//坡度
BarChart.insertPic(docxDocument, filePath + main.getSlopes().get(0).getProductCode2() + ".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[]{BarChart.fun(main.getSlopes().get(0).getLevel1() * 0.01),
BarChart.fun(main.getSlopes().get(0).getLevel2() * 0.01),
BarChart.fun(main.getSlopes().get(0).getLevel3() * 0.01),
BarChart.fun(main.getSlopes().get(0).getLevel4() * 0.01),
BarChart.fun(main.getSlopes().get(0).getLevel5() * 0.01)};
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 " + BarChart.fun(main.getSlopes().get(0).getLevel1() * 0.01) + " km², the area of 10°-30° is " + BarChart.fun(main.getSlopes().get(0).getLevel2() * 0.01) + " km², the area of 30°-50° is " + BarChart.fun(main.getSlopes().get(0).getLevel3() * 0.01) + " km², and the area of 50°-70° is " + BarChart.fun(main.getSlopes().get(0).getLevel4() * 0.01) + "km². The area greater than 70° is " + BarChart.fun(main.getSlopes().get(0).getLevel5() * 0.01) + " km².");
//2.2.2 沙化指数、湿度指数、盐渍化指数
BarChart.createSecondLevelTopic(docxDocument, i + 2 + ".2.2. Monitoring results of soil index");
//沙化指数
BarChart.insertPic(docxDocument, filePath + main.getSoilDesertifications().get(0).getProductCode2() + ".jpg");
BarChart.setPicTitle(docxDocument, "Figure " + (number + 9) + " Spatial distribution data of soil desertification factor");
String[] xDesertificationAxis = new String[]{"<0.1", "0.1~0.3", "0.3~0.5", "0.5~0.7", ">0.7"};//x轴
Double[] yDesertificationAxis = new Double[]{BarChart.fun(main.getSoilDesertifications().get(0).getLevel1() * 0.01),
BarChart.fun(main.getSoilDesertifications().get(0).getLevel2() * 0.01),
BarChart.fun(main.getSoilDesertifications().get(0).getLevel3() * 0.01),
BarChart.fun(main.getSoilDesertifications().get(0).getLevel4() * 0.01),
BarChart.fun(main.getSoilDesertifications().get(0).getLevel5() * 0.01)};
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 " + BarChart.fun(main.getSoilDesertifications().get(0).getLevel1() * 0.01) + " km², the area of 0.1-0.3 is " + BarChart.fun(main.getSoilDesertifications().get(0).getLevel2() * 0.01) + "km², the area of 0.3-0.5 is " + BarChart.fun(main.getSoilDesertifications().get(0).getLevel3() * 0.01) + " km², and the area of 0.5-0.7 is " + BarChart.fun(main.getSoilDesertifications().get(0).getLevel4() * 0.01) + " km². The area greater than 0.7 is " + BarChart.fun(main.getSoilDesertifications().get(0).getLevel5() * 0.01) + " km².");
//湿度指数
BarChart.insertPic(docxDocument, filePath + main.getSoilMoistures().get(0).getProductCode2() + ".jpg");
BarChart.setPicTitle(docxDocument, "Figure " + (number + 11) + " Spatial distribution data of soil moisture factor");
Double[] yMoistureAxis = new Double[]{BarChart.fun(main.getSoilMoistures().get(0).getLevel1() * 0.01),
BarChart.fun(main.getSoilMoistures().get(0).getLevel2() * 0.01),
BarChart.fun(main.getSoilMoistures().get(0).getLevel3() * 0.01),
BarChart.fun(main.getSoilMoistures().get(0).getLevel4() * 0.01),
BarChart.fun(main.getSoilMoistures().get(0).getLevel5() * 0.01)};
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 " + BarChart.fun(main.getSoilMoistures().get(0).getLevel1() * 0.01) + " km², the area of 0.1-0.3 is " + BarChart.fun(main.getSoilMoistures().get(0).getLevel2() * 0.01) + " km², the area of 0.3-0.5 is " + BarChart.fun(main.getSoilMoistures().get(0).getLevel3() * 0.01) + " km², and the area of 0.5-0.7 is " + BarChart.fun(main.getSoilMoistures().get(0).getLevel4() * 0.01) + "km². The area greater than 0.7 is " + BarChart.fun(main.getSoilMoistures().get(0).getLevel5() * 0.01) + " km².");
//盐渍化指数
BarChart.insertPic(docxDocument, filePath + main.getSoilSalinizations().get(0).getProductCode2() + ".jpg");
BarChart.setPicTitle(docxDocument, "Figure " + (number + 13) + " Spatial distribution data of soil salinization factor");
Double[] ySalinizationsAxis = new Double[]{
BarChart.fun(main.getSoilSalinizations().get(0).getLevel1() * 0.01),
BarChart.fun(main.getSoilSalinizations().get(0).getLevel2() * 0.01),
BarChart.fun(main.getSoilSalinizations().get(0).getLevel3() * 0.01),
BarChart.fun(main.getSoilSalinizations().get(0).getLevel4() * 0.01),
BarChart.fun(main.getSoilSalinizations().get(0).getLevel5() * 0.01)};
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 0.1 is" + BarChart.fun(main.getSoilSalinizations().get(0).getLevel1() * 0.01) + "km², the area of 0.1-0.3 is " + BarChart.fun(main.getSoilSalinizations().get(0).getLevel2() * 0.01) + " km², the area of 0.3-0.5 is " + BarChart.fun(main.getSoilSalinizations().get(0).getLevel3() * 0.01) + " km², and the area of 0.5-0.7 is " + BarChart.fun(main.getSoilSalinizations().get(0).getLevel4() * 0.01) + " km². The area greater than 0.7 is " + BarChart.fun(main.getSoilSalinizations().get(0).getLevel5() * 0.01) + " km².");
//2.2.3 水域因子、道路因子
BarChart.createSecondLevelTopic(docxDocument, "2.2.3. Monitoring results of regional index");
//道路因子
BarChart.insertPic(docxDocument, filePath + main.getRoadFactors().get(0).getProductCode2() + ".jpg");
BarChart.setPicTitle(docxDocument, "Figure " + (number + 15) + " Spatial distribution data of road factor");
Double[] yRoadAxis = new Double[]{BarChart.fun(main.getRoadFactors().get(0).getLevel1() / 100),
BarChart.fun(main.getRoadFactors().get(0).getLevel2() / 100),
BarChart.fun(main.getRoadFactors().get(0).getLevel3() / 100),
BarChart.fun(main.getRoadFactors().get(0).getLevel4() / 100),
BarChart.fun(main.getRoadFactors().get(0).getLevel5() / 100)};
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 " + BarChart.fun(main.getRoadFactors().get(0).getLevel1() * 0.01) + " km², the area of 0.1-0.3 is " + BarChart.fun(main.getRoadFactors().get(0).getLevel2() * 0.01) + " km², the area of 0.3-0.5 is " + BarChart.fun(main.getRoadFactors().get(0).getLevel3() * 0.01) + " km², and the area of 0.5-0.7 is " + BarChart.fun(main.getRoadFactors().get(0).getLevel4() * 0.01) + " km². The area greater than 0.7 is " + BarChart.fun(main.getRoadFactors().get(0).getLevel5() * 0.01) + "km².");
//水域因子
BarChart.insertPic(docxDocument, filePath + main.getWaterFactors().get(0).getProductCode2() + ".jpg");
BarChart.setPicTitle(docxDocument, "Figure " + (number + 17) + " Spatial distribution data of water factor");
Double[] yWaterAxis = new Double[]{BarChart.fun(main.getWaterFactors().get(0).getLevel1() / 100),
BarChart.fun(main.getWaterFactors().get(0).getLevel2() / 100),
BarChart.fun(main.getWaterFactors().get(0).getLevel3() / 100),
BarChart.fun(main.getWaterFactors().get(0).getLevel4() / 100),
BarChart.fun(main.getWaterFactors().get(0).getLevel5() / 100)};
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 " + BarChart.fun(main.getWaterFactors().get(0).getLevel1() * 0.01) + " km², the area of 0.1-0.3 is " + BarChart.fun(main.getWaterFactors().get(0).getLevel2() * 0.01) + " km², the area of 0.3-0.5 is " + BarChart.fun(main.getWaterFactors().get(0).getLevel3() * 0.01) + " km², and the area of 0.5-0.7 is " + BarChart.fun(main.getWaterFactors().get(0).getLevel4() * 0.01) + " km². The area greater than 0.7 is " + BarChart.fun(main.getWaterFactors().get(0).getLevel5() * 0.01) + " km².");
//2.3
BarChart.createSecondLevelTopic(docxDocument, i + 2 + ".3. Monitoring results of planting suitability");
//查找适宜性
PlantingSuitability suitability = plantingSuitabilityService.sqlSeeding1(zone, year);
BarChart.insertPic(docxDocument, filePath + suitability.getProductCode3() + ".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() / 100;
Double x2 = suitability.getSuitable() / 100;
Double x3 = suitability.getNotSuitable() / 100;
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 " + BarChart.fun(suitability.getVerySuitable() / 100) +
" km², accounting for " + BarChart.fun((suitability.getVerySuitable() / suitability.getTotalArea()) * 100) + "%. The area of suitable grade was " + BarChart.fun(suitability.getSuitable() / 100) +
" km², accounting for " + BarChart.fun((suitability.getSuitable() / suitability.getTotalArea()) * 100) + "%. The area of unsuitable area was " + BarChart.fun(suitability.getNotSuitable() / 100) +
" km², accounting for " + BarChart.fun((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 - " + "Year:" + year + "(" + zoneString + ")" + ".docx";
response.setHeader("Content-Disposition", "attachment;fileName=" + new String(fileName.getBytes("UTF-8"), "ISO-8859-1"));
response.setHeader("Access-Control-Expose-Headers", "Content-Disposition");
ServletOutputStream responseOutputStream = response.getOutputStream();
docxDocument.write(responseOutputStream);
responseOutputStream.flush();
responseOutputStream.close();
}
zoneString = zoneString.substring(0, zoneString.length() - 3);
//创建文本对象
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.createHeader(docxDocument, "Evaluation report of planting monitoring in ITBA Nature Reserve");
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 + ")");
List<LandUse> landUses = landUseServices.sqlSeeding1(zone, year);
UplodFile main = landUseServices.mainClass(zone, year);
//土地利用类型
BarChart.createSecondLevelTopic(docxDocument, i + 2 + ".1. Monitoring results of land use types");
BarChart.insertPic(docxDocument, filePath+landUses.get(1).getProductCode3()+".jpg");
BarChart.setPicTitle(docxDocument, "Figure " + (number + 1) + " Spatial distribution data of land use types");
//绘制土地利用类型图表
//x轴
String[] xAxisData = new String[]{"Fields", "Buildings", "Roads", "Water", "Forest", "Grass", "Soil", "Desert", "Rocks", "Other"};
//y轴
Double[] yAxisData = new Double[]{BarChart.fun(landUses.get(0).getArea() * 0.01),
BarChart.fun(landUses.get(1).getArea() * 0.01),
BarChart.fun(landUses.get(2).getArea() * 0.01),
BarChart.fun(landUses.get(3).getArea() * 0.01),
BarChart.fun(landUses.get(4).getArea() * 0.01),
BarChart.fun(landUses.get(5).getArea() * 0.01),
BarChart.fun(landUses.get(6).getArea() * 0.01),
BarChart.fun(landUses.get(7).getArea() * 0.01),
BarChart.fun(landUses.get(8).getArea() * 0.01),
BarChart.fun(landUses.get(9).getArea() * 0.01)};
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 " + BarChart.fun(landUses.get(0).getArea() * 0.01 )+ " km², the building is " +BarChart.fun( landUses.get(1).getArea() * 0.01 )+ " km², the road is " + BarChart.fun(landUses.get(2).getArea() * 0.01) +
" km², the water is " + BarChart.fun(landUses.get(3).getArea() * 0.01) + " km², the forest is " + BarChart.fun(landUses.get(4).getArea() * 0.01 )+ " km², the grass is " + BarChart.fun(landUses.get(5).getArea() * 0.01) + " km², the soil is " +BarChart.fun( landUses.get(6).getArea() * 0.01 )+ " km², the desert is " +
BarChart.fun(landUses.get(7).getArea() * 0.01 )+ " km², the rock is " + BarChart.fun(landUses.get(8).getArea() * 0.01) + " km², and other land use types are " + BarChart.fun(landUses.get(9).getArea() * 0.01) + " km².");
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, filePath+main.getAltitudes().get(0).getProductCode2()+".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[]{BarChart.fun(main.getAltitudes().get(0).getLevel1() * 0.01),
BarChart.fun(main.getAltitudes().get(0).getLevel2() * 0.01),
BarChart.fun(main.getAltitudes().get(0).getLevel3() * 0.01),
BarChart.fun(main.getAltitudes().get(0).getLevel4() * 0.01),
BarChart.fun(main.getAltitudes().get(0).getLevel5() * 0.01)};//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 " +BarChart.fun( main.getAltitudes().get(0).getLevel1() * 0.01) + " km², the area with 400-600m is " + BarChart.fun(main.getAltitudes().get(0).getLevel2() * 0.01) + " km², the area with 600-1000m is " + BarChart.fun(main.getAltitudes().get(0).getLevel3() * 0.01) + " km², and the area with 1000-1500m is " + BarChart.fun(main.getAltitudes().get(0).getLevel4() * 0.01) + " km². The area with an altitude higher than 1500m is " + BarChart.fun(main.getAltitudes().get(0).getLevel5() * 0.01) + " km².");
//坡向
BarChart.insertPic(docxDocument, filePath+main.getAspects().get(0).getProductCode2()+".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[]{BarChart.fun(main.getAspects().get(0).getNorth() * 0.01),
BarChart.fun(main.getAspects().get(0).getNortheast() * 0.01),
BarChart.fun(main.getAspects().get(0).getEast() * 0.01),
BarChart.fun(main.getAspects().get(0).getSoutheast() * 0.01),
BarChart.fun(main.getAspects().get(0).getSouth() * 0.01),
BarChart.fun(main.getAspects().get(0).getSouthwest() * 0.01),
BarChart.fun(main.getAspects().get(0).getWest() * 0.01),
BarChart.fun(main.getAspects().get(0).getNorthwest() * 0.01)};//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 " + BarChart.fun(main.getAspects().get(0).getNorth() / 100) + " km², the area with the northeast aspect is " + BarChart.fun(main.getAspects().get(0).getNortheast() / 100 )+ " km², the area with the east aspect is " + BarChart.fun(main.getAspects().get(0).getEast() / 100 )+ " km², the area with the southeast aspect is " + BarChart.fun(main.getAspects().get(0).getSoutheast() / 100) + " km², and the area with the south aspect is " + BarChart.fun(main.getAspects().get(0).getNorth() / 100) + " km², the area with the southwest aspect is " + BarChart.fun(main.getAspects().get(0).getSouthwest() / 100) + " km², the area with the west aspect is " + BarChart.fun(main.getAspects().get(0).getWest() / 100) + " km², and the area with the northwest aspect is " +BarChart.fun( main.getAspects().get(0).getNorthwest() / 100)+ " km².");
//坡度
BarChart.insertPic(docxDocument, filePath+main.getSlopes().get(0).getProductCode2()+".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[]{BarChart.fun(main.getSlopes().get(0).getLevel1() * 0.01),
BarChart.fun(main.getSlopes().get(0).getLevel2() * 0.01),
BarChart.fun(main.getSlopes().get(0).getLevel3() * 0.01),
BarChart.fun(main.getSlopes().get(0).getLevel4() * 0.01),
BarChart.fun(main.getSlopes().get(0).getLevel5() * 0.01)};
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 " +BarChart.fun( main.getSlopes().get(0).getLevel1() * 0.01 )+ " km², the area of 10°-30° is " + BarChart.fun(main.getSlopes().get(0).getLevel2() * 0.01) + " km², the area of 30°-50° is " + BarChart.fun(main.getSlopes().get(0).getLevel3() * 0.01) + " km², and the area of 50°-70° is " + BarChart.fun(main.getSlopes().get(0).getLevel4() * 0.01) + "km². The area greater than 70° is " + BarChart.fun(main.getSlopes().get(0).getLevel5() * 0.01) + " km².");
//2.2.2 沙化指数、湿度指数、盐渍化指数
BarChart.createSecondLevelTopic(docxDocument, i + 2 + ".2.2. Monitoring results of soil index");
//沙化指数
BarChart.insertPic(docxDocument, filePath+main.getSoilDesertifications().get(0).getProductCode2()+".jpg");
BarChart.setPicTitle(docxDocument, "Figure " + (number + 9) + " Spatial distribution data of soil desertification factor");
String[] xDesertificationAxis = new String[]{"<0.1", "0.1~0.3", "0.3~0.5", "0.5~0.7", ">0.7"};//x轴
Double[] yDesertificationAxis = new Double[]{BarChart.fun(main.getSoilDesertifications().get(0).getLevel1() * 0.01),
BarChart.fun(main.getSoilDesertifications().get(0).getLevel2() * 0.01),
BarChart.fun(main.getSoilDesertifications().get(0).getLevel3() * 0.01),
BarChart.fun(main.getSoilDesertifications().get(0).getLevel4() * 0.01),
BarChart.fun(main.getSoilDesertifications().get(0).getLevel5() * 0.01)};
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 " +BarChart.fun( main.getSoilDesertifications().get(0).getLevel1() * 0.01 )+ " km², the area of 0.1-0.3 is " + BarChart.fun(main.getSoilDesertifications().get(0).getLevel2() * 0.01) + "km², the area of 0.3-0.5 is " + BarChart.fun(main.getSoilDesertifications().get(0).getLevel3() * 0.01) + " km², and the area of 0.5-0.7 is " + BarChart.fun(main.getSoilDesertifications().get(0).getLevel4() * 0.01 )+ " km². The area greater than 0.7 is " + BarChart.fun(main.getSoilDesertifications().get(0).getLevel5() * 0.01 )+ " km².");
//湿度指数
BarChart.insertPic(docxDocument, filePath+main.getSoilMoistures().get(0).getProductCode2()+".jpg");
BarChart.setPicTitle(docxDocument, "Figure " + (number + 11) + " Spatial distribution data of soil moisture factor");
Double[] yMoistureAxis = new Double[]{BarChart.fun(main.getSoilMoistures().get(0).getLevel1() * 0.01),
BarChart.fun(main.getSoilMoistures().get(0).getLevel2() * 0.01),
BarChart.fun(main.getSoilMoistures().get(0).getLevel3() * 0.01),
BarChart.fun(main.getSoilMoistures().get(0).getLevel4() * 0.01),
BarChart.fun(main.getSoilMoistures().get(0).getLevel5() * 0.01)};
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 " + BarChart.fun(main.getSoilMoistures().get(0).getLevel1() * 0.01) + " km², the area of 0.1-0.3 is " + BarChart.fun(main.getSoilMoistures().get(0).getLevel2() * 0.01) + " km², the area of 0.3-0.5 is " + BarChart.fun(main.getSoilMoistures().get(0).getLevel3() * 0.01 )+ " km², and the area of 0.5-0.7 is " + BarChart.fun(main.getSoilMoistures().get(0).getLevel4() * 0.01 )+ "km². The area greater than 0.7 is " + BarChart.fun(main.getSoilMoistures().get(0).getLevel5() * 0.01) + " km².");
//盐渍化指数
BarChart.insertPic(docxDocument, filePath+main.getSoilSalinizations().get(0).getProductCode2()+".jpg");
BarChart.setPicTitle(docxDocument, "Figure " + (number + 13) + " Spatial distribution data of soil salinization factor");
Double[] ySalinizationsAxis = new Double[]{
BarChart.fun(main.getSoilSalinizations().get(0).getLevel1() * 0.01),
BarChart.fun(main.getSoilSalinizations().get(0).getLevel2() * 0.01),
BarChart.fun(main.getSoilSalinizations().get(0).getLevel3() * 0.01),
BarChart.fun(main.getSoilSalinizations().get(0).getLevel4() * 0.01),
BarChart.fun(main.getSoilSalinizations().get(0).getLevel5() * 0.01)};
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 " + BarChart.fun(main.getSoilSalinizations().get(0).getLevel1() * 0.01 )+ " is 252 km², the area of 0.1-0.3 is " + BarChart.fun(main.getSoilSalinizations().get(0).getLevel2() * 0.01) + " km², the area of 0.3-0.5 is " +BarChart.fun( main.getSoilSalinizations().get(0).getLevel3() * 0.01) + " km², and the area of 0.5-0.7 is " +BarChart.fun( main.getSoilSalinizations().get(0).getLevel4() * 0.01 )+ " km². The area greater than 0.7 is " + BarChart.fun(main.getSoilSalinizations().get(0).getLevel5() * 0.01 )+ " km².");
//2.2.3 水域因子、道路因子
BarChart.createSecondLevelTopic(docxDocument, "2.2.3. Monitoring results of regional index");
//道路因子
BarChart.insertPic(docxDocument, filePath+main.getRoadFactors().get(0).getProductCode2()+".jpg");
BarChart.setPicTitle(docxDocument, "Figure " + (number + 15) + " Spatial distribution data of road factor");
Double[] yRoadAxis = new Double[]{BarChart.fun(main.getRoadFactors().get(0).getLevel1() / 100),
BarChart.fun(main.getRoadFactors().get(0).getLevel2() / 100),
BarChart.fun(main.getRoadFactors().get(0).getLevel3() / 100),
BarChart.fun(main.getRoadFactors().get(0).getLevel4() / 100),
BarChart.fun(main.getRoadFactors().get(0).getLevel5() / 100)};
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 " +BarChart.fun( main.getRoadFactors().get(0).getLevel1() * 0.01) + " km², the area of 0.1-0.3 is " + BarChart.fun(main.getRoadFactors().get(0).getLevel2() * 0.01) + " km², the area of 0.3-0.5 is " +BarChart.fun( main.getRoadFactors().get(0).getLevel3() * 0.01) + " km², and the area of 0.5-0.7 is " + BarChart.fun(main.getRoadFactors().get(0).getLevel4() * 0.01 )+ " km². The area greater than 0.7 is " + BarChart.fun(main.getRoadFactors().get(0).getLevel5() * 0.01 )+ "km².");
//水域因子
BarChart.insertPic(docxDocument, filePath+main.getWaterFactors().get(0).getProductCode2()+".jpg");
BarChart.setPicTitle(docxDocument, "Figure " + (number + 17) + " Spatial distribution data of water factor");
Double[] yWaterAxis = new Double[]{BarChart.fun(main.getWaterFactors().get(0).getLevel1() / 100),
BarChart.fun(main.getWaterFactors().get(0).getLevel2() / 100),
BarChart.fun(main.getWaterFactors().get(0).getLevel3() / 100),
BarChart.fun(main.getWaterFactors().get(0).getLevel4() / 100),
BarChart.fun(main.getWaterFactors().get(0).getLevel5() / 100)};
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 " + BarChart.fun(main.getWaterFactors().get(0).getLevel1() * 0.01) + " km², the area of 0.1-0.3 is " + BarChart.fun(main.getWaterFactors().get(0).getLevel2() * 0.01 )+ " km², the area of 0.3-0.5 is " +BarChart.fun( main.getWaterFactors().get(0).getLevel3() * 0.01 )+ " km², and the area of 0.5-0.7 is " + BarChart.fun(main.getWaterFactors().get(0).getLevel4() * 0.01 )+ " km². The area greater than 0.7 is " + BarChart.fun(main.getWaterFactors().get(0).getLevel5() * 0.01) + " km².");
//2.3
BarChart.createSecondLevelTopic(docxDocument, i + 2 + ".3. Monitoring results of planting suitability");
//查找适宜性
PlantingSuitability suitability = plantingSuitabilityService.sqlSeeding1(zone, year);
BarChart.insertPic(docxDocument, filePath+suitability.getProductCode3()+".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() / 100;
Double x2 = suitability.getSuitable() / 100;
Double x3 = suitability.getNotSuitable() / 100;
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 " +BarChart.fun( suitability.getVerySuitable() / 100 )+ " km², accounting for " + BarChart.getDoubleNumber((suitability.getVerySuitable() / suitability.getTotalArea())) + "%. The area of suitable grade was " +BarChart.fun( suitability.getSuitable()/100) + " km², accounting for " + BarChart.getDoubleNumber((suitability.getSuitable() / suitability.getTotalArea())) + "%. The area of unsuitable area was " + BarChart.fun(suitability.getNotSuitable()/100) + " km², accounting for " + BarChart.getDoubleNumber((suitability.getNotSuitable() / suitability.getTotalArea())) + "%.");
number += 20;
}
response.setCharacterEncoding("UTF-8");
response.setContentType("application/msword");
//文件名
String fileName = "Evaluation report of planting monitoring in ITBA Nature Reserve - "+"Year:" + year + "(" + zoneString + ")"+".docx";
response.setHeader("Content-Disposition", "attachment;fileName=" + new String(fileName.getBytes("UTF-8"), "ISO-8859-1"));
response.setHeader("Access-Control-Expose-Headers", "Content-Disposition");
ServletOutputStream responseOutputStream = response.getOutputStream();
docxDocument.write(responseOutputStream);
responseOutputStream.flush();
responseOutputStream.close();
} catch (Exception e) {
return AjaxResult.error(e.getMessage());
}
return AjaxResult.success("成功!");
}

View File

@ -95,6 +95,7 @@ public class LandUseController {
value1.setProductCode2(value.get(i).getProductCode2());
value1.setProductCode3(value.get(i).getProductCode3());
value1.setYear(value.get(i).getYear());
value1.setRegionName(value.get(i).getRegionName());
} else if (value.get(i).getLandUse().equals("Buildings") && value.get(i).getZone().equals(zonenew.get(j))) {
value1.setBuildings(value.get(i).getArea());
value1.setZone(value.get(i).getZone());
@ -102,12 +103,14 @@ public class LandUseController {
value1.setProductCode2(value.get(i).getProductCode2());
value1.setProductCode3(value.get(i).getProductCode3());
value1.setYear(value.get(i).getYear());
value1.setRegionName(value.get(i).getRegionName());
} else if (value.get(i).getLandUse().equals("Roads") && value.get(i).getZone().equals(zonenew.get(j))) {
value1.setRoads(value.get(i).getArea());
value1.setProductCode1(value.get(i).getProductCode1());
value1.setProductCode2(value.get(i).getProductCode2());
value1.setProductCode3(value.get(i).getProductCode3());
value1.setYear(value.get(i).getYear());
value1.setRegionName(value.get(i).getRegionName());
} else if (value.get(i).getLandUse().equals("Water") && value.get(i).getZone().equals(zonenew.get(j))) {
value1.setWater(value.get(i).getArea());
value1.setZone(value.get(i).getZone());
@ -115,6 +118,7 @@ public class LandUseController {
value1.setProductCode2(value.get(i).getProductCode2());
value1.setProductCode3(value.get(i).getProductCode3());
value1.setYear(value.get(i).getYear());
value1.setRegionName(value.get(i).getRegionName());
} else if (value.get(i).getLandUse().equals("Forest") && value.get(i).getZone().equals(zonenew.get(j))) {
value1.setForest(value.get(i).getArea());
value1.setZone(value.get(i).getZone());
@ -122,6 +126,7 @@ public class LandUseController {
value1.setProductCode2(value.get(i).getProductCode2());
value1.setProductCode3(value.get(i).getProductCode3());
value1.setYear(value.get(i).getYear());
value1.setRegionName(value.get(i).getRegionName());
} else if (value.get(i).getLandUse().equals("Grass") && value.get(i).getZone().equals(zonenew.get(j))) {
value1.setGrass(value.get(i).getArea());
value1.setZone(value.get(i).getZone());
@ -129,6 +134,7 @@ public class LandUseController {
value1.setProductCode2(value.get(i).getProductCode2());
value1.setProductCode3(value.get(i).getProductCode3());
value1.setYear(value.get(i).getYear());
value1.setRegionName(value.get(i).getRegionName());
} else if (value.get(i).getLandUse().equals("Soil") && value.get(i).getZone().equals(zonenew.get(j))) {
value1.setSoil(value.get(i).getArea());
value1.setZone(value.get(i).getZone());
@ -136,6 +142,7 @@ public class LandUseController {
value1.setProductCode2(value.get(i).getProductCode2());
value1.setProductCode3(value.get(i).getProductCode3());
value1.setYear(value.get(i).getYear());
value1.setRegionName(value.get(i).getRegionName());
} else if (value.get(i).getLandUse().equals("Desert") && value.get(i).getZone().equals(zonenew.get(j))) {
value1.setDesert(value.get(i).getArea());
value1.setZone(value.get(i).getZone());
@ -143,6 +150,7 @@ public class LandUseController {
value1.setProductCode2(value.get(i).getProductCode2());
value1.setProductCode3(value.get(i).getProductCode3());
value1.setYear(value.get(i).getYear());
value1.setRegionName(value.get(i).getRegionName());
} else if (value.get(i).getLandUse().equals("Rocks") && value.get(i).getZone().equals(zonenew.get(j))) {
value1.setRocks(value.get(i).getArea());
value1.setZone(value.get(i).getZone());
@ -150,6 +158,7 @@ public class LandUseController {
value1.setProductCode2(value.get(i).getProductCode2());
value1.setProductCode3(value.get(i).getProductCode3());
value1.setYear(value.get(i).getYear());
value1.setRegionName(value.get(i).getRegionName());
} else if (value.get(i).getLandUse().equals("Other") && value.get(i).getZone().equals(zonenew.get(j))) {
value1.setOther(value.get(i).getArea());
value1.setZone(value.get(i).getZone());
@ -157,6 +166,7 @@ public class LandUseController {
value1.setProductCode2(value.get(i).getProductCode2());
value1.setProductCode3(value.get(i).getProductCode3());
value1.setYear(value.get(i).getYear());
value1.setRegionName(value.get(i).getRegionName());
}
}
lanUseNews.add(value1);

View File

@ -18,8 +18,8 @@ ruoyi:
# 开发环境配置
server:
# 服务器的HTTP端口默认为8080
#port: 6051
port: 6051
#port: 9800
servlet:
# 应用的访问路径
context-path: /
@ -60,15 +60,15 @@ spring:
# redis 配置
redis:
# 地址
#host: rs-middleware-redis
# host: rs-middleware-redis
host: localhost
# 端口默认为6379
#port: 14096
port: 6379
# 数据库索引
database: 1
database: 0
# 密码
#password: SenseTime@2019
# password: SenseTime@2019
password: sdust2020
# 连接超时时间
timeout: 10s
@ -140,4 +140,4 @@ xss:
# 排除链接(多个用逗号分隔)
excludes: /system/notice/*
# 匹配链接
urlPatterns: /system/*,/monitor/*,/tool/*
urlPatterns: /system/*,/monitor/*,/tool/*