diff --git a/ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java b/ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java index e3680a8..e5e555d 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java @@ -24,6 +24,8 @@ public class RuoYiApplication { + + // System.setProperty("spring.devtools.restart.enabled", "false"); SpringApplication.run(RuoYiApplication.class, args); System.out.println(); diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/shate/DateUploadController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/shate/DateUploadController.java index 36899df..9b339de 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/shate/DateUploadController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/shate/DateUploadController.java @@ -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 regionNameList = new ArrayList<>(); + List 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 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 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 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("成功!"); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/shate/LandUseController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/shate/LandUseController.java index bd4484b..674fead 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/shate/LandUseController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/shate/LandUseController.java @@ -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); diff --git a/ruoyi-admin/src/main/resources/application.yml b/ruoyi-admin/src/main/resources/application.yml index 27f1e88..83164b5 100644 --- a/ruoyi-admin/src/main/resources/application.yml +++ b/ruoyi-admin/src/main/resources/application.yml @@ -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/* \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/config/application.properties b/ruoyi-admin/src/main/resources/config/application.properties deleted file mode 100644 index e69de29..0000000 diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/BarChart.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/BarChart.java index 5ab30a8..cb1961b 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/BarChart.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/BarChart.java @@ -58,6 +58,8 @@ public class BarChart XWPFParagraph paragraph = header.createParagraph(); paragraph.setAlignment(ParagraphAlignment.BOTH); //设置段落左对齐 paragraph.setBorderBottom(Borders.THICK); //设置下划线 +// paragraph.setSpacingLineRule(LineSpacingRule.AUTO); + paragraph.setSpacingBetween(40,LineSpacingRule.EXACT); // paragraph.setAlignment(ParagraphAlignment.CENTER); XWPFRun run = paragraph.createRun(); @@ -66,7 +68,7 @@ public class BarChart /* * 取到图片的字节流 * */ - String logoFilePath="/home/sjs/ruoyi/shate/jpg/shate.png"; + String logoFilePath="shate.png"; if (StringUtils.isNotEmpty(logoFilePath)) { File file=new File(logoFilePath); InputStream is = new FileInputStream(file); @@ -126,21 +128,12 @@ public class BarChart } public static void drawTable(XWPFDocument document, String[] xAxisData,Double[] yAxisData) throws Exception { - /*int numOfPoints = categories.length; - String categoryDataRange = chart.formatRange(new CellRangeAddress(1, numOfPoints, 0, 0)); - String valuesDataRangeA = chart.formatRange(new CellRangeAddress(1, numOfPoints, 1, 1)); - String valuesDataRangeB = chart.formatRange(new CellRangeAddress(1, numOfPoints, 2, 2)); - XDDFDataSource categoriesData = XDDFDataSourcesFactory.fromArray(categories, categoryDataRange, 0); - XDDFNumericalDataSource valuesDataA = XDDFDataSourcesFactory.fromArray(valuesA, valuesDataRangeA, 1); - XDDFNumericalDataSource valuesDataB = XDDFDataSourcesFactory.fromArray(valuesB, valuesDataRangeB, 2);*/ // 创建chart图表对象,抛出异常 - XWPFChart chart = document.createChart(15 * Units.EMU_PER_CENTIMETER, 10 * Units.EMU_PER_CENTIMETER); - // 图表相关设置 - chart.setTitleText(""); // 图表标题 - +// XWPFChart chart = document.createChart(15 * Units.EMU_PER_CENTIMETER, 10 * Units.EMU_PER_CENTIMETER); + XWPFChart chart=document.createChart(15 * Units.EMU_PER_CENTIMETER, 11 * Units.EMU_PER_CENTIMETER); + chart.setTitleText(""); chart.setTitleOverlay(false); // 图例是否覆盖标题 - //XDDFChartLegend legend = chart.getOrAddLegend(); - //legend.setPosition(LegendPosition.TOP); // 图例位置:上下左右 + chart.setChartBottomMargin(50); // X轴(分类轴)相关设置 XDDFCategoryAxis xAxis =chart.createCategoryAxis(AxisPosition.BOTTOM); // 创建X轴,并且指定位置 xAxis.setTitle(""); // x轴标题 @@ -158,9 +151,11 @@ public class BarChart barChart.setVaryColors(false); // 加载柱状图数据集 XDDFBarChartData.Series barSeries = (XDDFBarChartData.Series) barChart.addSeries(xAxisSource, yAxisSource); - barSeries.setTitle(" ", null); // 图例标题 + barSeries.setTitle(" ", null); // 图例标题 // 绘制柱状图 chart.plot(barChart); + + } //插入图片 @@ -219,13 +214,25 @@ public class BarChart public static void setPicTitle(XWPFDocument document,String date) { XWPFParagraph Paragraph = document.createParagraph(); + +// Paragraph.setAlignment(ParagraphAlignment.CENTER); +//// 边框 +// Paragraph.setBorderBottom(Borders.NIL); +// Paragraph.setBorderTop(Borders.NIL); +// Paragraph.setBorderRight(Borders.NIL); +// Paragraph.setBorderLeft(Borders.NIL); +// Paragraph.setBorderBetween(Borders.SINGLE); +// Paragraph.setSpacingAfter(5); +// Paragraph.setSpacingBeforeLines(5); +// Paragraph.setSpacingBetween(5); Paragraph.setAlignment(ParagraphAlignment.CENTER);//对齐方式 - //BarChart.setLineSpace(Paragraph,30); + BarChart.setLineSpace(Paragraph,25); XWPFRun run = Paragraph.createRun(); +// run.addCarriageReturn(); run.setText(date); run.setBold(true);//加粗 run.setFontSize(10); - run.setFontFamily("Times New Roman"); +// run.setFontFamily("Times New Roman"); } //设置题目 public static void setTitle(XWPFDocument document,String date) diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain_shate/DateUpload.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain_shate/DateUpload.java index 03246c0..de3411d 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain_shate/DateUpload.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain_shate/DateUpload.java @@ -10,7 +10,7 @@ import java.util.List; * @Author: JinSheng Song * @Date: 2022/7/11 15:32 */ -public class DateUpload +public class DateUpload extends SysSTEntity { private String id; diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain_shate/RegionName.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain_shate/RegionName.java new file mode 100644 index 0000000..87f5bb9 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain_shate/RegionName.java @@ -0,0 +1,15 @@ +package com.ruoyi.system.domain_shate; + +import java.util.List; + +public class RegionName { + private List regionName; + + public List getRegionName() { + return regionName; + } + + public void setRegionName(List regionName) { + this.regionName = regionName; + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain_shate/RegionNameVO.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain_shate/RegionNameVO.java new file mode 100644 index 0000000..d4a486e --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain_shate/RegionNameVO.java @@ -0,0 +1,29 @@ +package com.ruoyi.system.domain_shate; + +public class RegionNameVO { + /** + * 历史 + */ + private String originalName; + /** + * 当前 + */ + private String currentName; + + + public String getOriginalName() { + return originalName; + } + + public void setOriginalName(String originalName) { + this.originalName = originalName; + } + + public String getCurrentName() { + return currentName; + } + + public void setCurrentName(String currentName) { + this.currentName = currentName; + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain_shate/SysSTEntity.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain_shate/SysSTEntity.java index 6540a5d..bdcaff2 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain_shate/SysSTEntity.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain_shate/SysSTEntity.java @@ -5,6 +5,8 @@ package com.ruoyi.system.domain_shate; * @Date: 2022/7/11 10:02 */ public class SysSTEntity { + + private String regionName; private String link; public String getLink() { @@ -14,4 +16,12 @@ public class SysSTEntity { public void setLink(String link) { this.link = link; } + + public String getRegionName() { + return regionName; + } + + public void setRegionName(String regionName) { + this.regionName = regionName; + } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain_shate/lanUseNew.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain_shate/lanUseNew.java index 1623044..38e779b 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain_shate/lanUseNew.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain_shate/lanUseNew.java @@ -4,7 +4,7 @@ package com.ruoyi.system.domain_shate; * @Author: JinSheng Song * @Date: 2022/7/23 16:38 */ -public class lanUseNew +public class lanUseNew extends SysSTEntity { private Integer id; diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper_shate/updateAllRegionNameMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper_shate/updateAllRegionNameMapper.java new file mode 100644 index 0000000..3c9f152 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper_shate/updateAllRegionNameMapper.java @@ -0,0 +1,49 @@ +package com.ruoyi.system.mapper_shate; + +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +@Mapper +public interface updateAllRegionNameMapper { + + Integer altitude(@Param("regionName") String regionName, + @Param("regionName1") String regionName1); + + Integer Aspect(@Param("regionName") String regionName, + @Param("regionName1") String regionName1); + + Integer Slope(@Param("regionName") String regionName, + @Param("regionName1") String regionName1); + + Integer salinization(@Param("regionName") String regionName, + @Param("regionName1") String regionName1); + + Integer moisture(@Param("regionName") String regionName, + @Param("regionName1") String regionName1); + + Integer desertification(@Param("regionName") String regionName, + @Param("regionName1") String regionName1); + + Integer road(@Param("regionName") String regionName, + @Param("regionName1") String regionName1); + + Integer water(@Param("regionName") String regionName, + @Param("regionName1") String regionName1); + + Integer landuse(@Param("regionName") String regionName, + @Param("regionName1") String regionName1); + Integer dataUpload(@Param("regionName") String regionName, + @Param("regionName1") String regionName1); + + Integer suitability(@Param("regionName") String regionName, + @Param("regionName1") String regionName1); + + Integer waterArea(@Param("regionName") String regionName, + @Param("regionName1") String regionName1); + + Integer seedSuccess(@Param("regionName") String regionName, + @Param("regionName1") String regionName1); + + Integer healthy(@Param("regionName") String regionName, + @Param("regionName1") String regionName1); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service_shate/ILandUseServices.java b/ruoyi-system/src/main/java/com/ruoyi/system/service_shate/ILandUseServices.java index 14cb916..9a301ad 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service_shate/ILandUseServices.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service_shate/ILandUseServices.java @@ -1,6 +1,8 @@ package com.ruoyi.system.service_shate; +import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.system.domain_shate.LandUse; +import com.ruoyi.system.domain_shate.RegionNameVO; import com.ruoyi.system.domain_shate.SeedingSuccessRate; import com.ruoyi.system.domain_shate.UplodFile; import org.apache.ibatis.annotations.Param; @@ -24,4 +26,6 @@ public interface ILandUseServices UplodFile mainClass(String zone,String year); + AjaxResult updateAllRegionName(List region); + } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service_shate/impl/LandUseServiceipml.java b/ruoyi-system/src/main/java/com/ruoyi/system/service_shate/impl/LandUseServiceipml.java index bfed388..3e98aea 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service_shate/impl/LandUseServiceipml.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service_shate/impl/LandUseServiceipml.java @@ -1,9 +1,9 @@ package com.ruoyi.system.service_shate.impl; import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.system.domain_shate.*; -import com.ruoyi.system.mapper_shate.LandUseMapper; -import com.ruoyi.system.mapper_shate.SoilFactorMapper; +import com.ruoyi.system.mapper_shate.*; import com.ruoyi.system.service_shate.ILandUseServices; import com.ruoyi.system.service_shate.IRegionalFactorService; import com.ruoyi.system.service_shate.ISoilFactorService; @@ -14,17 +14,30 @@ import javax.annotation.Resource; import java.time.Year; import java.util.List; import java.util.Set; +import java.util.stream.Collectors; /** * @Author: JinSheng Song * @Date: 2022/7/8 11:20 */ @Service -public class LandUseServiceipml implements ILandUseServices -{ +public class LandUseServiceipml implements ILandUseServices { + + @Resource + private PlantingSuitabilityMapper plantingSuitabilityMapper; + + @Resource + private SeedingSuccessMapper seedingSuccessMapper; + + @Resource + private VegetationHealthMapper vegetationHealthMapper; + @Resource private LandUseMapper mapper; + @Resource + private updateAllRegionNameMapper updateAllRegionNameMapper; + @Resource private ITopographicFactorService factorService; @@ -35,14 +48,14 @@ public class LandUseServiceipml implements ILandUseServices private IRegionalFactorService regionalFactorService; @Override - public List sqlSeeding(String zone, String[] landUses,String year) { - List value=mapper.sqlSeeding(zone, landUses,year); + public List sqlSeeding(String zone, String[] landUses, String year) { + List value = mapper.sqlSeeding(zone, landUses, year); return value; } @Override public List sqlSeeding1(String zone, String year) { - List value=mapper.sqlSeeding1(zone,year); + List value = mapper.sqlSeeding1(zone, year); return value; } @@ -57,25 +70,34 @@ public class LandUseServiceipml implements ILandUseServices } @Override - public UplodFile mainClass(String zone,String year) { + public UplodFile mainClass(String zone, String year) { - UplodFile file=new UplodFile(); + UplodFile file = new UplodFile(); + //播种成活率 + List information= seedingSuccessMapper.sqlSeeding(zone,year); + //植被健康状况 + List vegetationHealths=vegetationHealthMapper.sqlInfo(zone,year); + //种植适宜性 + List plantingSuitabilities=plantingSuitabilityMapper.sqlSeeding(zone); //海拔 - List altitude = factorService.sqlAltitude(zone,year); + List altitude = factorService.sqlAltitude(zone, year); //坡度 - List slopes = factorService.sqlSlope(zone,year); + List slopes = factorService.sqlSlope(zone, year); //坡向 - List aspects = factorService.sqlAspect(zone,year); + List aspects = factorService.sqlAspect(zone, year); //沙化指数 - List desertifications=soilFactorService.sqlDesert(zone,year); + List desertifications = soilFactorService.sqlDesert(zone, year); //湿度指数 - List moistures=soilFactorService.sqlMoisture(zone,year); + List moistures = soilFactorService.sqlMoisture(zone, year); //盐渍化指数 - List salinizations=soilFactorService.sqlSalin(zone,year); + List salinizations = soilFactorService.sqlSalin(zone, year); //水域因子 - List waterFactors=regionalFactorService.sqlWater(zone,year); + List waterFactors = regionalFactorService.sqlWater(zone, year); //道路因子 - List roadFactors=regionalFactorService.sqlRoad(zone,year); + List roadFactors = regionalFactorService.sqlRoad(zone, year); + file.setInformation(information); + file.setVegetationHealths(vegetationHealths); + file.setPlantingSuitabilities(plantingSuitabilities); file.setWaterFactors(waterFactors); file.setRoadFactors(roadFactors); file.setSoilMoistures(moistures); @@ -86,4 +108,41 @@ public class LandUseServiceipml implements ILandUseServices file.setAltitudes(altitude); return file; } + + @Override + public AjaxResult updateAllRegionName(List region) { + try { + List regionNameLists = region.stream().distinct().collect(Collectors.toList()); + regionNameLists.forEach(e -> { + try { + Thread.currentThread().sleep(100); + } catch (InterruptedException ex) { + throw new RuntimeException(ex); + } + + String regionName = e.getCurrentName(); + String regionName1 = e.getOriginalName(); + System.out.println("输出参数"+regionName+regionName1); + updateAllRegionNameMapper.desertification(regionName, regionName1); + updateAllRegionNameMapper.altitude(regionName, regionName1); + updateAllRegionNameMapper.Aspect(regionName, regionName1); + updateAllRegionNameMapper.Slope(regionName, regionName1); + updateAllRegionNameMapper.salinization(regionName, regionName1); + updateAllRegionNameMapper.moisture(regionName, regionName1); + updateAllRegionNameMapper.road(regionName, regionName1); + updateAllRegionNameMapper.water(regionName, regionName1); + updateAllRegionNameMapper.landuse(regionName, regionName1); + updateAllRegionNameMapper.dataUpload(regionName,regionName1); + updateAllRegionNameMapper.suitability(regionName,regionName1); + updateAllRegionNameMapper.waterArea(regionName,regionName1); + updateAllRegionNameMapper.seedSuccess(regionName,regionName1); + updateAllRegionNameMapper.healthy(regionName,regionName1); + }); + return AjaxResult.success("成功!"); + } + catch (Exception e) + { + return AjaxResult.error(e.getMessage()); + } + } } diff --git a/ruoyi-system/src/main/resources/mapper/system/DateUploadMapper.xml b/ruoyi-system/src/main/resources/mapper/system/DateUploadMapper.xml index e28fa5a..ef158a4 100644 --- a/ruoyi-system/src/main/resources/mapper/system/DateUploadMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/DateUploadMapper.xml @@ -29,12 +29,13 @@ + @@ -137,6 +138,7 @@ - + @@ -22,7 +22,7 @@ @@ -43,6 +43,7 @@ SELECT FROM landuse where 1=1 + AND zone = #{zone} @@ -52,13 +53,14 @@ + @@ -22,7 +23,7 @@ @@ -47,13 +48,14 @@ + @@ -23,6 +24,7 @@ + @@ -39,6 +41,7 @@ + @@ -59,7 +62,7 @@ @@ -97,7 +100,7 @@ + @@ -28,6 +29,7 @@ @@ -74,12 +76,14 @@ + @@ -22,6 +23,7 @@ + @@ -38,6 +40,7 @@ + @@ -53,7 +56,7 @@ @@ -70,7 +73,7 @@ + @@ -22,6 +23,7 @@ + @@ -41,6 +43,7 @@ + @@ -55,13 +58,13 @@ @@ -77,7 +80,7 @@ @@ -93,7 +96,7 @@ + diff --git a/ruoyi-system/src/main/resources/mapper/system/updateAllRegionNameMapper.xml b/ruoyi-system/src/main/resources/mapper/system/updateAllRegionNameMapper.xml new file mode 100644 index 0000000..b59918f --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/system/updateAllRegionNameMapper.xml @@ -0,0 +1,66 @@ + + + + + + UPDATE altitude SET region_name=#{regionName} where region_name=#{regionName1} + + + + UPDATE Aspect SET region_name=#{regionName} where region_name=#{regionName1} + + + + UPDATE Slope SET region_name=#{regionName} where region_name=#{regionName1} + + + + UPDATE salinization SET region_name=#{regionName} where region_name=#{regionName1} + + + + UPDATE moisture SET region_name=#{regionName} where region_name=#{regionName1} + + + + UPDATE desertification SET region_name=#{regionName} where region_name=#{regionName1} + + + + UPDATE road SET region_name=#{regionName} where region_name=#{regionName1} + + + + UPDATE water SET region_name=#{regionName} where region_name=#{regionName1} + + + + UPDATE landuse SET region_name=#{regionName} where region_name=#{regionName1} + + + + UPDATE data_upload SET region_name=#{regionName} where region_name=#{regionName1} + + + + UPDATE suitability SET region_name=#{regionName} where region_name=#{regionName1} + + + + UPDATE water_area SET region_name=#{regionName} where region_name=#{regionName1} + + + + UPDATE "seed_Success" SET region_name=#{regionName} where region_name=#{regionName1} + + + + UPDATE healthy SET region_name=#{regionName} where region_name=#{regionName1} + + + + + + \ No newline at end of file