添加新功能
报告生成
This commit is contained in:
parent
48e607e8b1
commit
4b48e7f55e
@ -8,10 +8,13 @@ import com.ruoyi.common.utils.shate.PageUtils;
|
|||||||
|
|
||||||
import com.ruoyi.system.domain_shate.*;
|
import com.ruoyi.system.domain_shate.*;
|
||||||
import com.ruoyi.system.service_shate.*;
|
import com.ruoyi.system.service_shate.*;
|
||||||
|
import com.sun.jna.platform.unix.solaris.LibKstat;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.v3.oas.models.security.SecurityScheme;
|
import io.swagger.v3.oas.models.security.SecurityScheme;
|
||||||
import net.sf.jsqlparser.statement.create.procedure.CreateProcedure;
|
import net.sf.jsqlparser.statement.create.procedure.CreateProcedure;
|
||||||
|
import org.apache.poi.hssf.usermodel.HeaderFooter;
|
||||||
import org.apache.poi.xwpf.usermodel.XWPFDocument;
|
import org.apache.poi.xwpf.usermodel.XWPFDocument;
|
||||||
|
import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTSectPr;
|
||||||
import org.springframework.boot.autoconfigure.web.ServerProperties;
|
import org.springframework.boot.autoconfigure.web.ServerProperties;
|
||||||
import org.springframework.util.ResourceUtils;
|
import org.springframework.util.ResourceUtils;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
@ -27,6 +30,7 @@ import javax.xml.parsers.DocumentBuilder;
|
|||||||
import javax.xml.parsers.DocumentBuilderFactory;
|
import javax.xml.parsers.DocumentBuilderFactory;
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.lang.reflect.AnnotatedArrayType;
|
import java.lang.reflect.AnnotatedArrayType;
|
||||||
|
import java.text.DecimalFormat;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
@ -106,22 +110,6 @@ public class DateUploadController {
|
|||||||
@RequestMapping(value = "/delUpload", method = {RequestMethod.POST})
|
@RequestMapping(value = "/delUpload", method = {RequestMethod.POST})
|
||||||
public AjaxResult DelUpload(@RequestBody UplodFile uplodFile) {
|
public AjaxResult DelUpload(@RequestBody UplodFile uplodFile) {
|
||||||
return delUploadFile(uplodFile.getId());
|
return delUploadFile(uplodFile.getId());
|
||||||
// List<Integer> ids=uplodFile.getId();
|
|
||||||
// Integer Seeding=0;
|
|
||||||
// UploadFile file=new UploadFile();
|
|
||||||
// for (int i=0; i<ids.size();i++)
|
|
||||||
// {
|
|
||||||
// DateUpload value= service.selectDel(ids.get(i));
|
|
||||||
//
|
|
||||||
// String[] strs2=value.getFileName().split("\\_");
|
|
||||||
//
|
|
||||||
//// file.UploadFile1(strs2[1],value.getZone(),value.getDataTime());
|
|
||||||
//
|
|
||||||
// Seeding= service.DelUpload(ids.get(i));
|
|
||||||
// if (Seeding==0){return AjaxResult.error("没有此id单据!"+ids.get(i));}
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// return AjaxResult.success(Seeding);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -358,6 +346,36 @@ public class DateUploadController {
|
|||||||
return dateUpload;
|
return dateUpload;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void callExe1(String filePath) {
|
||||||
|
|
||||||
|
BufferedReader bufferedReader = null;
|
||||||
|
Process proc = null;
|
||||||
|
try {
|
||||||
|
|
||||||
|
String[] cmd = {ExePathName.replace("main", "thematicMap"), filePath + ".tif", filePath + "/jpg/"};
|
||||||
|
|
||||||
|
ProcessBuilder pb = new ProcessBuilder();
|
||||||
|
pb.command(cmd);
|
||||||
|
proc = pb.start();
|
||||||
|
System.out.println("Start calling algorithm");
|
||||||
|
|
||||||
|
bufferedReader = new BufferedReader(new InputStreamReader(proc.getErrorStream()));
|
||||||
|
String aa = null;
|
||||||
|
String line = null;
|
||||||
|
while ((line = bufferedReader.readLine()) != null) {
|
||||||
|
aa = aa + line;
|
||||||
|
}
|
||||||
|
System.out.println(aa);
|
||||||
|
|
||||||
|
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
System.out.println(e.getMessage());
|
||||||
|
;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 调用exe
|
* 调用exe
|
||||||
*
|
*
|
||||||
@ -417,6 +435,7 @@ public class DateUploadController {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
callExe1(FilePath);
|
||||||
callExe(FileName, FilePath, ShpPath);
|
callExe(FileName, FilePath, ShpPath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -532,160 +551,206 @@ public class DateUploadController {
|
|||||||
*
|
*
|
||||||
* @param
|
* @param
|
||||||
*/
|
*/
|
||||||
@RequestMapping(value = "/exportWord1", method = {RequestMethod.GET})
|
@RequestMapping(value = "/exportWord1", method = {RequestMethod.POST})
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public void exportWord1(HttpServletResponse response, HttpServletRequest request) throws Exception {
|
public void exportWord1(HttpServletResponse response, HttpServletRequest request,@RequestBody WordVo wordVo) throws Exception {
|
||||||
String [] zoneList=new String[]{"01","02","03"};
|
readXml();
|
||||||
|
String[] zoneList = wordVo.getZoneList();
|
||||||
//接受前端传来的数据
|
//接受前端传来的数据
|
||||||
String year = "2022";
|
String[] years = wordVo.getYear();
|
||||||
//创建文本对象
|
DecimalFormat df = new DecimalFormat("#.00");
|
||||||
CustomXWPFDocument docxDocument = new CustomXWPFDocument();
|
String filePath=FilePaths+"jpg/";
|
||||||
//创建标题
|
for (String year : years) {
|
||||||
BarChart.setTitle(docxDocument, "Evaluation report of planting monitoring in ITBA Nature Reserve");
|
String zoneString = "";
|
||||||
//创建第一个段落的标题
|
for (String zone : zoneList) {
|
||||||
BarChart.createFirstLevelTopic(docxDocument, "1.Background information");
|
zone += " | ";
|
||||||
//创建第一个段落的内容
|
zoneString += zone;
|
||||||
BarChart.createParagraphAndInsertWord(docxDocument, "Date time: " + year);
|
}
|
||||||
String zoneString="";
|
zoneString = zoneString.substring(0, zoneString.length() - 3);
|
||||||
for (String zone:zoneList){
|
//创建文本对象
|
||||||
zone+=" | ";
|
CustomXWPFDocument docxDocument = new CustomXWPFDocument();
|
||||||
zoneString+=zone;
|
//创建标题
|
||||||
}
|
BarChart.setTitle(docxDocument, "Evaluation report of planting monitoring in ITBA Nature Reserve " );
|
||||||
zoneString=zoneString.substring(0,zoneString.length()-3);
|
//创建第一个段落的标题
|
||||||
BarChart.createParagraphAndInsertWord(docxDocument, "Evaluation area: " + zoneString);
|
BarChart.createFirstLevelTopic(docxDocument, "1.Background information");
|
||||||
Integer number=0;
|
//创建第一个段落的内容
|
||||||
for (int i=0;i<zoneList.length;i++){
|
BarChart.createParagraphAndInsertWord(docxDocument, "Date time: " + year);
|
||||||
String zone = zoneList[i];
|
//创建页眉页脚
|
||||||
//2.1
|
BarChart.createHeader(docxDocument, "Evaluation report of planting monitoring in ITBA Nature Reserve");
|
||||||
BarChart.createFirstLevelTopic(docxDocument, i+2+". Results of remote sensing monitoring of planting suitability"+"( zone:"+zone+")");
|
BarChart.createParagraphAndInsertWord(docxDocument, "Evaluation area: " + zoneString);
|
||||||
//土地利用类型
|
Integer number = 0;
|
||||||
BarChart.createSecondLevelTopic(docxDocument, i+2+".1. Monitoring results of land use types");
|
|
||||||
BarChart.insertPic(docxDocument, "C:\\Users\\HP\\Desktop\\文本文档\\1650791783(1).jpg");
|
|
||||||
BarChart.setPicTitle(docxDocument, "Figure "+(number+1)+" Spatial distribution data of land use types");
|
|
||||||
//绘制土地利用类型图表
|
|
||||||
List<LandUse> landUses = landUseServices.sqlSeeding1(zone, year);
|
|
||||||
UplodFile main = landUseServices.mainClass(zone, year);
|
|
||||||
//x轴
|
|
||||||
String[] xAxisData = new String[]{"Fields", "Buildings", "Roads", "Water", "Forest", "Grass", "Soil", "Desert", "Rocks", "Other"};
|
|
||||||
//y轴
|
|
||||||
Double[] yAxisData = new Double[]{landUses.get(0).getArea(), landUses.get(1).getArea(), landUses.get(2).getArea(), landUses.get(3).getArea(), landUses.get(4).getArea(), landUses.get(5).getArea(), landUses.get(6).getArea(), landUses.get(7).getArea(), landUses.get(8).getArea(), landUses.get(9).getArea()};
|
|
||||||
BarChart.drawTable(docxDocument, xAxisData, yAxisData);//标题2图标
|
|
||||||
BarChart.setPicTitle(docxDocument, "Figure "+(number+2)+" Statistical data on land use types");
|
|
||||||
BarChart.createParagraphAndInsertWord(docxDocument, "In "+zone+" region, the total area of field is "+landUses.get(0).getArea()+" hm², the building is "+landUses.get(1).getArea()+" hm², the road is "+landUses.get(2).getArea()+" hm², the water is "+landUses.get(3).getArea()+" hm², the forest is "+landUses.get(4).getArea()+" hm², the grass is "+landUses.get(5).getArea()+" hm², the soil is "+landUses.get(6).getArea()+" hm², the desert is "+landUses.get(7).getArea()+" hm², the rock is "+landUses.get(8).getArea()+" hm², and other land use types are "+landUses.get(9).getArea()+" hm².");
|
|
||||||
|
|
||||||
BarChart.createSecondLevelTopic(docxDocument, i+2+".2 Monitoring results of planting suitability evaluation index");
|
for (int i = 0; i < zoneList.length; i++) {
|
||||||
//2.2.1海拔、坡向、坡度
|
String zone = zoneList[i];
|
||||||
//海拔
|
//2.1
|
||||||
BarChart.createSecondLevelTopic(docxDocument, i+2+".2.1. Monitoring results of terrain index");
|
BarChart.createFirstLevelTopic(docxDocument, i + 2 + ". Results of remote sensing monitoring of planting suitability" + "( zone:" + zone + ")");
|
||||||
BarChart.insertPic(docxDocument, "C:\\Users\\HP\\Desktop\\文本文档\\1650791783(1).jpg");
|
List<LandUse> landUses = landUseServices.sqlSeeding1(zone, year);
|
||||||
BarChart.setPicTitle(docxDocument, "Figure "+(number+3)+" Spatial distribution data of altitude");
|
UplodFile main = landUseServices.mainClass(zone, year);
|
||||||
//绘制折线图(已取消)
|
//土地利用类型
|
||||||
String[] xAxis = new String[]{"<400", "400-600", "600-100", "1000-1500", ">1500"};//x轴
|
BarChart.createSecondLevelTopic(docxDocument, i + 2 + ".1. Monitoring results of land use types");
|
||||||
Double[] yAxis = new Double[]{main.getAltitudes().get(0).getLevel1(),
|
BarChart.insertPic(docxDocument, filePath+landUses.get(1).getProductCode3()+".jpg");
|
||||||
main.getAltitudes().get(0).getLevel2(), main.getAltitudes().get(0).getLevel3(),
|
BarChart.setPicTitle(docxDocument, "Figure " + (number + 1) + " Spatial distribution data of land use types");
|
||||||
main.getAltitudes().get(0).getLevel4(), main.getAltitudes().get(0).getLevel5()};//y轴
|
//绘制土地利用类型图表
|
||||||
BarChart.drawTable(docxDocument, xAxis, yAxis);
|
//x轴
|
||||||
BarChart.setPicTitle(docxDocument, "Figure "+(number+4)+" Classification statistics of altitude");
|
String[] xAxisData = new String[]{"Fields", "Buildings", "Roads", "Water", "Forest", "Grass", "Soil", "Desert", "Rocks", "Other"};
|
||||||
BarChart.createParagraphAndInsertWord(docxDocument, "In " + zone + " region, the area with an altitude lower than 400m is " + main.getAltitudes().get(0).getLevel1() + " hm², the area with 400-600m is " + main.getAltitudes().get(0).getLevel2() + " hm², the area with 600-1000m is " + main.getAltitudes().get(0).getLevel3() + " hm², and the area with 1000-1500m is " + main.getAltitudes().get(0).getLevel4() + " hm². The area with an altitude higher than 1500m is " + main.getAltitudes().get(0).getLevel5() + " hm².");
|
//y轴
|
||||||
//坡向
|
Double[] yAxisData = new Double[]{BarChart.fun(landUses.get(0).getArea() * 0.01),
|
||||||
BarChart.insertPic(docxDocument, "C:\\Users\\HP\\Desktop\\文本文档\\1650791783(1).jpg");
|
BarChart.fun(landUses.get(1).getArea() * 0.01),
|
||||||
BarChart.setPicTitle(docxDocument, "Figure "+(number+5)+" Spatial distribution data of aspect");
|
BarChart.fun(landUses.get(2).getArea() * 0.01),
|
||||||
String[] xAspectAxis = new String[]{"North", "Northeast", "East", "Southeast", "South", "Southwest", "West", "NorthWest"};//x轴
|
BarChart.fun(landUses.get(3).getArea() * 0.01),
|
||||||
Double[] yAspectAxis = new Double[]{main.getAspects().get(0).getNorth(), main.getAspects().get(0).getNortheast(),
|
BarChart.fun(landUses.get(4).getArea() * 0.01),
|
||||||
main.getAspects().get(0).getEast(), main.getAspects().get(0).getSoutheast(), main.getAspects().get(0).getSouth(),
|
BarChart.fun(landUses.get(5).getArea() * 0.01),
|
||||||
main.getAspects().get(0).getSouthwest(), main.getAspects().get(0).getWest(), main.getAspects().get(0).getNorthwest()};//y轴
|
BarChart.fun(landUses.get(6).getArea() * 0.01),
|
||||||
BarChart.drawTable(docxDocument, xAspectAxis, yAspectAxis);//标题2图标
|
BarChart.fun(landUses.get(7).getArea() * 0.01),
|
||||||
BarChart.setPicTitle(docxDocument, "Figure "+(number+6)+" Classification statistics of aspect");
|
BarChart.fun(landUses.get(8).getArea() * 0.01),
|
||||||
BarChart.createParagraphAndInsertWord(docxDocument, "In " + zone + " region, the area with the north aspect is " + main.getAspects().get(0).getNorth() + " hm², the area with the northeast aspect is " + main.getAspects().get(0).getNortheast() + " hm², the area with the east aspect is " + main.getAspects().get(0).getEast() + " hm², the area with the southeast aspect is " + main.getAspects().get(0).getSoutheast() + " hm², and the area with the south aspect is " + main.getAspects().get(0).getNorth() + " hm², the area with the southwest aspect is " + main.getAspects().get(0).getSouthwest() + " hm², the area with the west aspect is " + main.getAspects().get(0).getWest() + " hm², and the area with the northwest aspect is " + main.getAspects().get(0).getNorthwest() + " hm².");
|
BarChart.fun(landUses.get(9).getArea() * 0.01)};
|
||||||
//坡度
|
BarChart.drawTable(docxDocument, xAxisData, yAxisData);//标题2图标
|
||||||
BarChart.insertPic(docxDocument, "C:\\Users\\HP\\Desktop\\文本文档\\1650791783(1).jpg");
|
BarChart.setPicTitle(docxDocument, "Figure " + (number + 2) + " Statistical data on land use types");
|
||||||
BarChart.setPicTitle(docxDocument, "Figure "+(number+7)+" Spatial distribution data of slope");
|
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) +
|
||||||
String[] xSlopeAxis = new String[]{"<10°", "10°~30°", "30°~50°", "50°~70°", ">70°"};//x轴
|
" 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 " +
|
||||||
Double[] ySlopeAxis = new Double[]{main.getSlopes().get(0).getLevel1(),
|
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².");
|
||||||
main.getSlopes().get(0).getLevel2(), main.getSlopes().get(0).getLevel3(),
|
|
||||||
main.getSlopes().get(0).getLevel4(), main.getSlopes().get(0).getLevel5()};
|
|
||||||
BarChart.drawTable(docxDocument, xSlopeAxis, ySlopeAxis);//标题2图标
|
|
||||||
BarChart.setPicTitle(docxDocument, "Figure "+(number+8)+" Classification statistics of slope");
|
|
||||||
BarChart.createParagraphAndInsertWord(docxDocument, "In " + zone + " region, the area of slope less than 10° is " + main.getSlopes().get(0).getLevel1() + " hm2, the area of 10°-30° is " + main.getSlopes().get(0).getLevel2() + " hm2, the area of 30°-50° is " + main.getSlopes().get(0).getLevel3() + " hm2, and the area of 50°-70° is " + main.getSlopes().get(0).getLevel4() + "hm2. The area greater than 70° is " + main.getSlopes().get(0).getLevel5() + " hm2.");
|
|
||||||
|
|
||||||
//2.2.2 沙化指数、湿度指数、盐渍化指数
|
BarChart.createSecondLevelTopic(docxDocument, i + 2 + ".2 Monitoring results of planting suitability evaluation index");
|
||||||
BarChart.createSecondLevelTopic(docxDocument, i+2+".2.2. Monitoring results of soil index");
|
//2.2.1海拔、坡向、坡度
|
||||||
//沙化指数
|
//海拔
|
||||||
BarChart.insertPic(docxDocument, "C:\\Users\\HP\\Desktop\\文本文档\\1650791783(1).jpg");
|
BarChart.createSecondLevelTopic(docxDocument, i + 2 + ".2.1. Monitoring results of terrain index");
|
||||||
BarChart.setPicTitle(docxDocument, "Figure "+(number+9)+" Spatial distribution data of soil desertification factor");
|
BarChart.insertPic(docxDocument, filePath+main.getAltitudes().get(0).getProductCode2()+".jpg");
|
||||||
String[] xDesertificationAxis = new String[]{"<0.1", "01~0.3", "0.3~0.5", "0.5~0.7", ">0.7"};//x轴
|
BarChart.setPicTitle(docxDocument, "Figure " + (number + 3) + " Spatial distribution data of altitude");
|
||||||
Double[] yDesertificationAxis = new Double[]{main.getSoilDesertifications().get(0).getLevel1(),
|
//绘制折线图(已取消)
|
||||||
main.getSoilDesertifications().get(0).getLevel2(), main.getSoilDesertifications().get(0).getLevel3(),
|
String[] xAxis = new String[]{"<400", "400-600", "600-100", "1000-1500", ">1500"};//x轴
|
||||||
main.getSoilDesertifications().get(0).getLevel4(), main.getSoilDesertifications().get(0).getLevel5()};
|
Double[] yAxis = new Double[]{BarChart.fun(main.getAltitudes().get(0).getLevel1() * 0.01),
|
||||||
BarChart.drawTable(docxDocument, xDesertificationAxis, yDesertificationAxis);
|
BarChart.fun(main.getAltitudes().get(0).getLevel2() * 0.01),
|
||||||
BarChart.setPicTitle(docxDocument, "Figure "+(number+10)+" Classification statistics of soil desertification factor");
|
BarChart.fun(main.getAltitudes().get(0).getLevel3() * 0.01),
|
||||||
BarChart.createParagraphAndInsertWord(docxDocument, "In " + zone + " region, the area of soil desertification factor less than 0.1 is " + main.getSoilDesertifications().get(0).getLevel1() + " hm2, the area of 0.1-0.3 is " + main.getSoilDesertifications().get(0).getLevel2() + "hm2, the area of 0.3-0.5 is " + main.getSoilDesertifications().get(0).getLevel3() + " hm2, and the area of 0.5-0.7 is " + main.getSoilDesertifications().get(0).getLevel4() + " hm2. The area greater than 0.7 is " + main.getSoilDesertifications().get(0).getLevel5() + " hm2.");
|
BarChart.fun(main.getAltitudes().get(0).getLevel4() * 0.01),
|
||||||
//湿度指数
|
BarChart.fun(main.getAltitudes().get(0).getLevel5() * 0.01)};//y轴
|
||||||
BarChart.insertPic(docxDocument, "C:\\Users\\HP\\Desktop\\文本文档\\1650791783(1).jpg");
|
BarChart.drawTable(docxDocument, xAxis, yAxis);
|
||||||
BarChart.setPicTitle(docxDocument, "Figure "+(number+11)+" Spatial distribution data of soil moisture factor");
|
BarChart.setPicTitle(docxDocument, "Figure " + (number + 4) + " Classification statistics of altitude");
|
||||||
Double[] yMoistureAxis = new Double[]{main.getSoilMoistures().get(0).getLevel1(),
|
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².");
|
||||||
main.getSoilMoistures().get(0).getLevel2(), main.getSoilMoistures().get(0).getLevel3(),
|
//坡向
|
||||||
main.getSoilMoistures().get(0).getLevel4(), main.getSoilMoistures().get(0).getLevel5()};
|
BarChart.insertPic(docxDocument, filePath+main.getAspects().get(0).getProductCode2()+".jpg");
|
||||||
BarChart.drawTable(docxDocument, xDesertificationAxis, yMoistureAxis);
|
BarChart.setPicTitle(docxDocument, "Figure " + (number + 5) + " Spatial distribution data of aspect");
|
||||||
BarChart.setPicTitle(docxDocument, "Figure "+(number+12)+" Classification statistics of soil moisture factor");
|
String[] xAspectAxis = new String[]{"North", "Northeast", "East", "Southeast", "South", "Southwest", "West", "NorthWest"};//x轴
|
||||||
BarChart.createParagraphAndInsertWord(docxDocument, "In " + zone + " region, the area of soil moisture factor less than 0.1 is " + main.getSoilMoistures().get(0).getLevel1() + " hm2, the area of 0.1-0.3 is " + main.getSoilMoistures().get(0).getLevel2() + " hm2, the area of 0.3-0.5 is " + main.getSoilMoistures().get(0).getLevel3() + " hm2, and the area of 0.5-0.7 is " + main.getSoilMoistures().get(0).getLevel4() + "hm2. The area greater than 0.7 is " + main.getSoilMoistures().get(0).getLevel5() + " hm2.");
|
Double[] yAspectAxis = new Double[]{BarChart.fun(main.getAspects().get(0).getNorth() * 0.01),
|
||||||
//盐渍化指数
|
BarChart.fun(main.getAspects().get(0).getNortheast() * 0.01),
|
||||||
BarChart.insertPic(docxDocument, "C:\\Users\\HP\\Desktop\\文本文档\\1650791783(1).jpg");
|
BarChart.fun(main.getAspects().get(0).getEast() * 0.01),
|
||||||
BarChart.setPicTitle(docxDocument, "Figure "+(number+13)+" Spatial distribution data of soil salinization factor");
|
BarChart.fun(main.getAspects().get(0).getSoutheast() * 0.01),
|
||||||
Double[] ySalinizationsAxis = new Double[]{main.getSoilSalinizations().get(0).getLevel1(),
|
BarChart.fun(main.getAspects().get(0).getSouth() * 0.01),
|
||||||
main.getSoilSalinizations().get(0).getLevel2(), main.getSoilSalinizations().get(0).getLevel3(),
|
BarChart.fun(main.getAspects().get(0).getSouthwest() * 0.01),
|
||||||
main.getSoilSalinizations().get(0).getLevel4(), main.getSoilSalinizations().get(0).getLevel5()};
|
BarChart.fun(main.getAspects().get(0).getWest() * 0.01),
|
||||||
BarChart.drawTable(docxDocument, xDesertificationAxis, ySalinizationsAxis);//标题2图标
|
BarChart.fun(main.getAspects().get(0).getNorthwest() * 0.01)};//y轴
|
||||||
BarChart.setPicTitle(docxDocument, "Figure "+(number+14)+" Classification statistics of soil salinization factor");
|
|
||||||
BarChart.createParagraphAndInsertWord(docxDocument, "In " + zone + " region, In 01 area, the area of soil salinization factor less than " + main.getSoilSalinizations().get(0).getLevel1() + " is 252 hm2, the area of 0.1-0.3 is " + main.getSoilSalinizations().get(0).getLevel2() + " hm2, the area of 0.3-0.5 is " + main.getSoilSalinizations().get(0).getLevel3() + " hm2, and the area of 0.5-0.7 is " + main.getSoilSalinizations().get(0).getLevel4() + " hm2. The area greater than 0.7 is " + main.getSoilSalinizations().get(0).getLevel5() + " hm2.");
|
|
||||||
|
|
||||||
//2.2.3 水域因子、道路因子
|
BarChart.drawTable(docxDocument, xAspectAxis, yAspectAxis);//标题2图标
|
||||||
BarChart.createSecondLevelTopic(docxDocument, "2.2.3. Monitoring results of regional index");
|
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, "C:\\Users\\HP\\Desktop\\文本文档\\1650791783(1).jpg");
|
//坡度
|
||||||
BarChart.setPicTitle(docxDocument, "Figure "+(number+15)+" Spatial distribution data of road factor");
|
BarChart.insertPic(docxDocument, filePath+main.getSlopes().get(0).getProductCode2()+".jpg");
|
||||||
Double[] yRoadAxis = new Double[]{main.getRoadFactors().get(0).getLevel1(),
|
BarChart.setPicTitle(docxDocument, "Figure " + (number + 7) + " Spatial distribution data of slope");
|
||||||
main.getRoadFactors().get(0).getLevel2(), main.getRoadFactors().get(0).getLevel3(),
|
String[] xSlopeAxis = new String[]{"<10°", "10°~30°", "30°~50°", "50°~70°", ">70°"};//x轴
|
||||||
main.getRoadFactors().get(0).getLevel4(), main.getRoadFactors().get(0).getLevel5()};
|
Double[] ySlopeAxis = new Double[]{BarChart.fun(main.getSlopes().get(0).getLevel1() * 0.01),
|
||||||
BarChart.drawTable(docxDocument, xDesertificationAxis, yRoadAxis);//标题2图标
|
BarChart.fun(main.getSlopes().get(0).getLevel2() * 0.01),
|
||||||
BarChart.setPicTitle(docxDocument, "Figure "+(number+16)+" Classification statistics of road factor");
|
BarChart.fun(main.getSlopes().get(0).getLevel3() * 0.01),
|
||||||
BarChart.createParagraphAndInsertWord(docxDocument, "In " + zone + " region, the area of road factor less than 0.1 is " + main.getRoadFactors().get(0).getLevel1() + " hm2, the area of 0.1-0.3 is " + main.getRoadFactors().get(0).getLevel2() + " hm2, the area of 0.3-0.5 is " + main.getRoadFactors().get(0).getLevel3() + " hm2, and the area of 0.5-0.7 is " + main.getRoadFactors().get(0).getLevel4() + " hm2. The area greater than 0.7 is " + main.getRoadFactors().get(0).getLevel5() + "hm2.");
|
BarChart.fun(main.getSlopes().get(0).getLevel4() * 0.01),
|
||||||
//水域因子
|
BarChart.fun(main.getSlopes().get(0).getLevel5() * 0.01)};
|
||||||
BarChart.insertPic(docxDocument, "C:\\Users\\HP\\Desktop\\文本文档\\1650791783(1).jpg");
|
BarChart.drawTable(docxDocument, xSlopeAxis, ySlopeAxis);//标题2图标
|
||||||
BarChart.setPicTitle(docxDocument, "Figure "+(number+17)+" Spatial distribution data of water factor");
|
BarChart.setPicTitle(docxDocument, "Figure " + (number + 8) + " Classification statistics of slope");
|
||||||
Double[] yWaterAxis = new Double[]{main.getWaterFactors().get(0).getLevel1(),
|
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².");
|
||||||
main.getWaterFactors().get(0).getLevel2(), main.getWaterFactors().get(0).getLevel3(),
|
|
||||||
main.getWaterFactors().get(0).getLevel4(), main.getWaterFactors().get(0).getLevel5()};
|
//2.2.2 沙化指数、湿度指数、盐渍化指数
|
||||||
BarChart.drawTable(docxDocument, xDesertificationAxis, yWaterAxis);//标题2图标
|
BarChart.createSecondLevelTopic(docxDocument, i + 2 + ".2.2. Monitoring results of soil index");
|
||||||
BarChart.setPicTitle(docxDocument, "Figure "+(number+18)+" Classification statistics of water factor");
|
//沙化指数
|
||||||
BarChart.createParagraphAndInsertWord(docxDocument, "In " + zone + " region, the area of water factor less than 0.1 is " + main.getWaterFactors().get(0).getLevel1() + " hm2, the area of 0.1-0.3 is " + main.getWaterFactors().get(0).getLevel2() + " hm2, the area of 0.3-0.5 is " + main.getWaterFactors().get(0).getLevel3() + " hm2, and the area of 0.5-0.7 is " + main.getWaterFactors().get(0).getLevel4() + " hm2. The area greater than 0.7 is " + main.getWaterFactors().get(0).getLevel5() + " hm2.");
|
BarChart.insertPic(docxDocument, filePath+main.getSoilDesertifications().get(0).getProductCode2()+".jpg");
|
||||||
//2.3
|
BarChart.setPicTitle(docxDocument, "Figure " + (number + 9) + " Spatial distribution data of soil desertification factor");
|
||||||
BarChart.createSecondLevelTopic(docxDocument, i+2+".3. Monitoring results of planting suitability");
|
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),
|
||||||
PlantingSuitability suitability = plantingSuitabilityService.sqlSeeding1(zone, year);
|
BarChart.fun(main.getSoilDesertifications().get(0).getLevel2() * 0.01),
|
||||||
BarChart.insertPic(docxDocument, "C:\\Users\\HP\\Desktop\\文本文档\\1650791783(1).jpg");
|
BarChart.fun(main.getSoilDesertifications().get(0).getLevel3() * 0.01),
|
||||||
BarChart.setPicTitle(docxDocument, "Figure "+(number+19)+" Spatial distribution data of planting suitability");
|
BarChart.fun(main.getSoilDesertifications().get(0).getLevel4() * 0.01),
|
||||||
//此处插入图表
|
BarChart.fun(main.getSoilDesertifications().get(0).getLevel5() * 0.01)};
|
||||||
String[] xAxisData2 = new String[]{"Very Suitable", "Suitable", "Not Suitable"};
|
BarChart.drawTable(docxDocument, xDesertificationAxis, yDesertificationAxis);
|
||||||
Double x1 = suitability.getVerySuitable();
|
BarChart.setPicTitle(docxDocument, "Figure " + (number + 10) + " Classification statistics of soil desertification factor");
|
||||||
Double x2 = suitability.getSuitable();
|
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².");
|
||||||
Double x3 = suitability.getNotSuitable();
|
//湿度指数
|
||||||
Double[] yAxisData2 = new Double[]{x1, x2, x3};
|
BarChart.insertPic(docxDocument, filePath+main.getSoilMoistures().get(0).getProductCode2()+".jpg");
|
||||||
BarChart.drawTable(docxDocument, xAxisData2, yAxisData2);
|
BarChart.setPicTitle(docxDocument, "Figure " + (number + 11) + " Spatial distribution data of soil moisture factor");
|
||||||
BarChart.setPicTitle(docxDocument, "Figure "+(number+20)+" Classification statistics of planting suitability");
|
Double[] yMoistureAxis = new Double[]{BarChart.fun(main.getSoilMoistures().get(0).getLevel1() * 0.01),
|
||||||
BarChart.createParagraphAndInsertWord(docxDocument,"In "+suitability.getZone()+" region, the area of very suitable region was "+suitability.getVerySuitable()+" hm², accounting for "+BarChart.getDoubleNumber((suitability.getVerySuitable()/suitability.getTotalArea())*100)+"%. The area of suitable grade was "+suitability.getSuitable()+" hm², accounting for "+BarChart.getDoubleNumber((suitability.getSuitable()/suitability.getTotalArea())*100)+"%. The area of unsuitable area was "+suitability.getNotSuitable()+" hm², accounting for "+BarChart.getDoubleNumber((suitability.getNotSuitable()/suitability.getTotalArea())*100)+"%.");
|
BarChart.fun(main.getSoilMoistures().get(0).getLevel2() * 0.01),
|
||||||
number+=20;
|
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
response.setCharacterEncoding("UTF-8");
|
|
||||||
response.setContentType("application/msword");
|
|
||||||
//文件名
|
|
||||||
String fileName = "Evaluation report of planting monitoring in ITBA Nature Reserve - V2.0.docx";
|
|
||||||
response.setHeader("Content-Disposition", "attachment;fileName=" + new String(fileName.getBytes("UTF-8"), "ISO-8859-1"));
|
|
||||||
ServletOutputStream responseOutputStream = response.getOutputStream();
|
|
||||||
docxDocument.write(responseOutputStream);
|
|
||||||
responseOutputStream.flush();
|
|
||||||
responseOutputStream.close();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -726,7 +791,7 @@ public class DateUploadController {
|
|||||||
// BarChart.createParagraphAndInsertWord(docxDocument, ""+BarChart.changeDate(seedingSuccessRate.getImageDate())+
|
// BarChart.createParagraphAndInsertWord(docxDocument, ""+BarChart.changeDate(seedingSuccessRate.getImageDate())+
|
||||||
// ". The total planting area in "+seedingSuccessRate.getZone()+" area was "+
|
// ". The total planting area in "+seedingSuccessRate.getZone()+" area was "+
|
||||||
// BarChart.getDoubleNumber((seedingSuccessRate.getSeedingSuccessArea()/seedingSuccessRate.getSeedingSuccess())) +
|
// BarChart.getDoubleNumber((seedingSuccessRate.getSeedingSuccessArea()/seedingSuccessRate.getSeedingSuccess())) +
|
||||||
// " hm², the vegetation survival area was "+seedingSuccessRate.getSeedingSuccessArea()+" hm², and the seeding success rate was "+seedingSuccessRate.getSeedingSuccess()+"%.");
|
// " km², the vegetation survival area was "+seedingSuccessRate.getSeedingSuccessArea()+" km², and the seeding success rate was "+seedingSuccessRate.getSeedingSuccess()+"%.");
|
||||||
// }
|
// }
|
||||||
// //第三段的标题
|
// //第三段的标题
|
||||||
// BarChart.createFirstLevelTopic(docxDocument, "3.Results of remote sensing monitoring of vegetation health");
|
// BarChart.createFirstLevelTopic(docxDocument, "3.Results of remote sensing monitoring of vegetation health");
|
||||||
@ -755,9 +820,9 @@ public class DateUploadController {
|
|||||||
// List<VegetationHealth> vegetationHealths_M = vegetationHealthServices.sqlSeeding(zone, M_code.get(i), year);
|
// List<VegetationHealth> vegetationHealths_M = vegetationHealthServices.sqlSeeding(zone, M_code.get(i), year);
|
||||||
// for (VegetationHealth vegetationHealth_m : vegetationHealths_M) {
|
// for (VegetationHealth vegetationHealth_m : vegetationHealths_M) {
|
||||||
// //第三段的第一个小标题的内容
|
// //第三段的第一个小标题的内容
|
||||||
// BarChart.insertPic(docxDocument, "C:\\Users\\HP\\Desktop\\文本文档\\1650791783(1).jpg");
|
// BarChart.insertPic(docxDocument, "C:\\Users\\sjs\\Desktop\\R-C.jpg");
|
||||||
// BarChart.setPicTitle(docxDocument, "Spatial distribution data of vegetation planting area");
|
// BarChart.setPicTitle(docxDocument, "Spatial distribution data of vegetation planting area");
|
||||||
// BarChart.insertPic(docxDocument, "C:\\Users\\HP\\Desktop\\文本文档\\1650791783(1).jpg");
|
// BarChart.insertPic(docxDocument, "C:\\Users\\sjs\\Desktop\\R-C.jpg");
|
||||||
// BarChart.setPicTitle(docxDocument, "Spatial distribution data of vegetation health status");
|
// BarChart.setPicTitle(docxDocument, "Spatial distribution data of vegetation health status");
|
||||||
// //插入柱状图表
|
// //插入柱状图表
|
||||||
// String[] xAxisData = new String[]{"Health", "Normal", "Not-Health"};
|
// String[] xAxisData = new String[]{"Health", "Normal", "Not-Health"};
|
||||||
@ -767,7 +832,7 @@ public class DateUploadController {
|
|||||||
// Double[] yAxisData = new Double[]{m1, m2, m3};
|
// Double[] yAxisData = new Double[]{m1, m2, m3};
|
||||||
// BarChart.drawTable(docxDocument,xAxisData,yAxisData);
|
// BarChart.drawTable(docxDocument,xAxisData,yAxisData);
|
||||||
// BarChart.setPicTitle(docxDocument, "Statistical data on vegetation health");
|
// BarChart.setPicTitle(docxDocument, "Statistical data on vegetation health");
|
||||||
// BarChart.createParagraphAndInsertWord(docxDocument, ""+BarChart.changeDate(vegetationHealth_m.getImageDate())+". Based on the monitoring results of high resolution satellite images, the area of healthy vegetation growth in "+vegetationHealth_m.getZone()+" region was "+vegetationHealth_m.getHealthy()+" hm², accounting for "+BarChart.getDoubleNumber((vegetationHealth_m.getHealthy()/vegetationHealth_m.getTotalArea())*100)+"%. The area with normal vegetation growth was "+vegetationHealth_m.getNormal()+" hm², accounting for "+BarChart.getDoubleNumber((vegetationHealth_m.getNormal()/vegetationHealth_m.getTotalArea())*100)+"%. The area of unhealthy vegetation growth was "+vegetationHealth_m.getNotHealthy()+" hm², accounting for "+BarChart.getDoubleNumber((vegetationHealth_m.getNotHealthy()/vegetationHealth_m.getTotalArea())*100)+"%.");
|
// BarChart.createParagraphAndInsertWord(docxDocument, ""+BarChart.changeDate(vegetationHealth_m.getImageDate())+". Based on the monitoring results of high resolution satellite images, the area of healthy vegetation growth in "+vegetationHealth_m.getZone()+" region was "+vegetationHealth_m.getHealthy()+" km², accounting for "+BarChart.getDoubleNumber((vegetationHealth_m.getHealthy()/vegetationHealth_m.getTotalArea())*100)+"%. The area with normal vegetation growth was "+vegetationHealth_m.getNormal()+" km², accounting for "+BarChart.getDoubleNumber((vegetationHealth_m.getNormal()/vegetationHealth_m.getTotalArea())*100)+"%. The area of unhealthy vegetation growth was "+vegetationHealth_m.getNotHealthy()+" km², accounting for "+BarChart.getDoubleNumber((vegetationHealth_m.getNotHealthy()/vegetationHealth_m.getTotalArea())*100)+"%.");
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
// //第三段的第二个小标题
|
// //第三段的第二个小标题
|
||||||
@ -776,9 +841,9 @@ public class DateUploadController {
|
|||||||
// List<VegetationHealth> vegetationHealths_H = vegetationHealthServices.sqlSeeding(zone, H_code.get(i), year);
|
// List<VegetationHealth> vegetationHealths_H = vegetationHealthServices.sqlSeeding(zone, H_code.get(i), year);
|
||||||
// for (VegetationHealth vegetationHealth_h : vegetationHealths_H) {
|
// for (VegetationHealth vegetationHealth_h : vegetationHealths_H) {
|
||||||
// //第三段的第二个小标题的内容
|
// //第三段的第二个小标题的内容
|
||||||
// BarChart.insertPic(docxDocument, "C:\\Users\\HP\\Desktop\\文本文档\\1650791783(1).jpg");
|
// BarChart.insertPic(docxDocument, "C:\\Users\\sjs\\Desktop\\R-C.jpg");
|
||||||
// BarChart.setPicTitle(docxDocument, "Spatial distribution data of vegetation planting area");
|
// BarChart.setPicTitle(docxDocument, "Spatial distribution data of vegetation planting area");
|
||||||
// BarChart.insertPic(docxDocument, "C:\\Users\\HP\\Desktop\\文本文档\\1650791783(1).jpg");
|
// BarChart.insertPic(docxDocument, "C:\\Users\\sjs\\Desktop\\R-C.jpg");
|
||||||
// BarChart.setPicTitle(docxDocument, "Spatial distribution data of vegetation health status");
|
// BarChart.setPicTitle(docxDocument, "Spatial distribution data of vegetation health status");
|
||||||
// //此处插入图表
|
// //此处插入图表
|
||||||
// String[] xAxisData1 = new String[]{"Health", "Normal", "Not-Health"};
|
// String[] xAxisData1 = new String[]{"Health", "Normal", "Not-Health"};
|
||||||
@ -788,7 +853,7 @@ public class DateUploadController {
|
|||||||
// Double[] yAxisData1 = new Double[]{h1, h2, h3};
|
// Double[] yAxisData1 = new Double[]{h1, h2, h3};
|
||||||
// BarChart.drawTable(docxDocument, xAxisData1, yAxisData1);
|
// BarChart.drawTable(docxDocument, xAxisData1, yAxisData1);
|
||||||
// BarChart.setPicTitle(docxDocument, "Statistical data on vegetation health");
|
// BarChart.setPicTitle(docxDocument, "Statistical data on vegetation health");
|
||||||
// BarChart.createParagraphAndInsertWord(docxDocument, "" + BarChart.changeDate(vegetationHealth_h.getImageDate()) + ". Based on the monitoring results of high resolution satellite images, the area of healthy vegetation growth in " + vegetationHealth_h.getZone() + " region was " + vegetationHealth_h.getHealthy() + " hm², accounting for " + BarChart.getDoubleNumber((vegetationHealth_h.getHealthy() / vegetationHealth_h.getTotalArea()) * 100) + "%. The area with normal vegetation growth was " + vegetationHealth_h.getNormal() + " hm², accounting for " + BarChart.getDoubleNumber((vegetationHealth_h.getNormal() / vegetationHealth_h.getTotalArea()) * 100) + "%. The area of unhealthy vegetation growth was " + vegetationHealth_h.getNotHealthy() + " hm², accounting for " + BarChart.getDoubleNumber((vegetationHealth_h.getNotHealthy() / vegetationHealth_h.getTotalArea()) * 100) + "%.");
|
// BarChart.createParagraphAndInsertWord(docxDocument, "" + BarChart.changeDate(vegetationHealth_h.getImageDate()) + ". Based on the monitoring results of high resolution satellite images, the area of healthy vegetation growth in " + vegetationHealth_h.getZone() + " region was " + vegetationHealth_h.getHealthy() + " km², accounting for " + BarChart.getDoubleNumber((vegetationHealth_h.getHealthy() / vegetationHealth_h.getTotalArea()) * 100) + "%. The area with normal vegetation growth was " + vegetationHealth_h.getNormal() + " km², accounting for " + BarChart.getDoubleNumber((vegetationHealth_h.getNormal() / vegetationHealth_h.getTotalArea()) * 100) + "%. The area of unhealthy vegetation growth was " + vegetationHealth_h.getNotHealthy() + " km², accounting for " + BarChart.getDoubleNumber((vegetationHealth_h.getNotHealthy() / vegetationHealth_h.getTotalArea()) * 100) + "%.");
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
// //第四个标题
|
// //第四个标题
|
||||||
@ -798,7 +863,7 @@ public class DateUploadController {
|
|||||||
// //获取图片的url
|
// //获取图片的url
|
||||||
// String productCode1 = suitability.getProductCode1();
|
// String productCode1 = suitability.getProductCode1();
|
||||||
// //第四个标题的内容
|
// //第四个标题的内容
|
||||||
// BarChart.insertPic(docxDocument,"C:\\Users\\HP\\Desktop\\文本文档\\1650791783(1).jpg");
|
// BarChart.insertPic(docxDocument,"C:\\Users\\sjs\\Desktop\\R-C.jpg");
|
||||||
// BarChart.setPicTitle(docxDocument,"Spatial distribution data of planting suitability");
|
// BarChart.setPicTitle(docxDocument,"Spatial distribution data of planting suitability");
|
||||||
// //此处插入图表
|
// //此处插入图表
|
||||||
// String[] xAxisData2 = new String[]{"Very Suitable", "Suitable", "Not Suitable"};
|
// String[] xAxisData2 = new String[]{"Very Suitable", "Suitable", "Not Suitable"};
|
||||||
@ -808,7 +873,7 @@ public class DateUploadController {
|
|||||||
// Double[] yAxisData2 = new Double[]{s1, s2, s3};
|
// Double[] yAxisData2 = new Double[]{s1, s2, s3};
|
||||||
// BarChart.drawTable(docxDocument,xAxisData2,yAxisData2);
|
// BarChart.drawTable(docxDocument,xAxisData2,yAxisData2);
|
||||||
// BarChart.setPicTitle(docxDocument,"Classification statistics of planting suitability");
|
// BarChart.setPicTitle(docxDocument,"Classification statistics of planting suitability");
|
||||||
// BarChart.createParagraphAndInsertWord(docxDocument,"In "+suitability.getZone()+" region, the area of very suitable region was "+suitability.getVerySuitable()+" hm², accounting for "+BarChart.getDoubleNumber((suitability.getVerySuitable()/suitability.getTotalArea())*100)+"%. The area of suitable grade was "+suitability.getSuitable()+" hm², accounting for "+BarChart.getDoubleNumber((suitability.getSuitable()/suitability.getTotalArea())*100)+"%. The area of unsuitable area was "+suitability.getNotSuitable()+" hm², accounting for "+BarChart.getDoubleNumber((suitability.getNotSuitable()/suitability.getTotalArea())*100)+"%.");
|
// BarChart.createParagraphAndInsertWord(docxDocument,"In "+suitability.getZone()+" region, the area of very suitable region was "+suitability.getVerySuitable()+" km², accounting for "+BarChart.getDoubleNumber((suitability.getVerySuitable()/suitability.getTotalArea())*100)+"%. The area of suitable grade was "+suitability.getSuitable()+" km², accounting for "+BarChart.getDoubleNumber((suitability.getSuitable()/suitability.getTotalArea())*100)+"%. The area of unsuitable area was "+suitability.getNotSuitable()+" km², accounting for "+BarChart.getDoubleNumber((suitability.getNotSuitable()/suitability.getTotalArea())*100)+"%.");
|
||||||
// }
|
// }
|
||||||
// response.setCharacterEncoding("UTF-8");
|
// response.setCharacterEncoding("UTF-8");
|
||||||
// response.setContentType("application/msword");
|
// response.setContentType("application/msword");
|
||||||
|
@ -66,7 +66,7 @@ spring:
|
|||||||
#port: 14096
|
#port: 14096
|
||||||
port: 6379
|
port: 6379
|
||||||
# 数据库索引
|
# 数据库索引
|
||||||
database: 0
|
database: 1
|
||||||
# 密码
|
# 密码
|
||||||
#password: SenseTime@2019
|
#password: SenseTime@2019
|
||||||
password: sdust2020
|
password: sdust2020
|
||||||
|
@ -1,21 +1,26 @@
|
|||||||
package com.ruoyi.common.utils;
|
package com.ruoyi.common.utils;
|
||||||
|
import org.apache.poi.hpsf.Section;
|
||||||
|
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
|
||||||
|
import org.apache.poi.ss.usermodel.HeaderFooter;
|
||||||
|
import org.apache.poi.ss.usermodel.Picture;
|
||||||
import org.apache.poi.ss.util.CellRangeAddress;
|
import org.apache.poi.ss.util.CellRangeAddress;
|
||||||
import org.apache.poi.ss.util.CellReference;
|
import org.apache.poi.ss.util.CellReference;
|
||||||
import org.apache.poi.util.Units;
|
import org.apache.poi.util.Units;
|
||||||
|
import org.apache.poi.wp.usermodel.HeaderFooterType;
|
||||||
|
import org.apache.poi.wp.usermodel.Paragraph;
|
||||||
import org.apache.poi.xddf.usermodel.chart.*;
|
import org.apache.poi.xddf.usermodel.chart.*;
|
||||||
|
import org.apache.poi.xwpf.model.XWPFHeaderFooterPolicy;
|
||||||
import org.apache.poi.xwpf.usermodel.*;
|
import org.apache.poi.xwpf.usermodel.*;
|
||||||
import java.io.FileInputStream;
|
|
||||||
|
import java.io.*;
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.math.BigInteger;
|
import java.math.BigInteger;
|
||||||
import java.text.DecimalFormat;
|
import java.text.DecimalFormat;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.apache.poi.xwpf.usermodel.XWPFChart;
|
import org.apache.poi.xwpf.usermodel.XWPFChart;
|
||||||
import org.apache.poi.xwpf.usermodel.XWPFDocument;
|
import org.apache.poi.xwpf.usermodel.XWPFDocument;
|
||||||
import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTP;
|
import org.openxmlformats.schemas.wordprocessingml.x2006.main.*;
|
||||||
import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTPPr;
|
|
||||||
import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTSpacing;
|
|
||||||
import org.openxmlformats.schemas.wordprocessingml.x2006.main.STLineSpacingRule;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -26,6 +31,72 @@ import org.openxmlformats.schemas.wordprocessingml.x2006.main.STLineSpacingRule;
|
|||||||
public class BarChart
|
public class BarChart
|
||||||
{
|
{
|
||||||
|
|
||||||
|
public static Double fun(Double value)
|
||||||
|
{
|
||||||
|
BigDecimal bg=new BigDecimal(value);
|
||||||
|
return bg.setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private void setXWPFRunStyle(XWPFRun r1,String font,int fontSize) {
|
||||||
|
r1.setFontSize(fontSize);
|
||||||
|
CTRPr rpr = r1.getCTR().isSetRPr() ? r1.getCTR().getRPr() : r1.getCTR().addNewRPr();
|
||||||
|
CTFonts fonts = rpr.isSetRFonts() ? rpr.getRFonts() : rpr.addNewRFonts();
|
||||||
|
fonts.setAscii(font);
|
||||||
|
fonts.setEastAsia(font);
|
||||||
|
fonts.setHAnsi(font);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static void createHeader(XWPFDocument doc, String orgFullName){
|
||||||
|
try {
|
||||||
|
|
||||||
|
CTSectPr sectPr = doc.getDocument().getBody().addNewSectPr();
|
||||||
|
XWPFHeaderFooterPolicy headerFooterPolicy = new XWPFHeaderFooterPolicy(doc, sectPr);
|
||||||
|
XWPFHeader header = headerFooterPolicy.createHeader(XWPFHeaderFooterPolicy.DEFAULT);
|
||||||
|
XWPFParagraph paragraph = header.createParagraph();
|
||||||
|
paragraph.setAlignment(ParagraphAlignment.BOTH); //设置段落左对齐
|
||||||
|
paragraph.setBorderBottom(Borders.THICK); //设置下划线
|
||||||
|
// paragraph.setAlignment(ParagraphAlignment.CENTER);
|
||||||
|
|
||||||
|
XWPFRun run = paragraph.createRun();
|
||||||
|
run.setBold(false);
|
||||||
|
run.setFontSize(9);
|
||||||
|
/*
|
||||||
|
* 取到图片的字节流
|
||||||
|
* */
|
||||||
|
String logoFilePath="/home/sjs/ruoyi/shate/jpg/shate.png";
|
||||||
|
if (StringUtils.isNotEmpty(logoFilePath)) {
|
||||||
|
File file=new File(logoFilePath);
|
||||||
|
InputStream is = new FileInputStream(file);
|
||||||
|
XWPFPicture picture = run.addPicture(is, XWPFDocument.PICTURE_TYPE_JPEG, logoFilePath, Units.toEMU(60), Units.toEMU(30));
|
||||||
|
String blipID = "";
|
||||||
|
for(XWPFPictureData picturedata : header.getAllPackagePictures()) { //这段必须有,不然打开的logo图片不显示
|
||||||
|
blipID = header.getRelationId(picturedata);
|
||||||
|
}
|
||||||
|
picture.getCTPicture().getBlipFill().getBlip().setEmbed(blipID);
|
||||||
|
run.addTab();
|
||||||
|
is.close();
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
* 添加字体页眉
|
||||||
|
* */
|
||||||
|
if (StringUtils.isNotEmpty(orgFullName)) {
|
||||||
|
run = paragraph.createRun();
|
||||||
|
run.setText(" "+orgFullName);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
} catch (FileNotFoundException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
} catch (IOException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
} catch (InvalidFormatException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
//绘制折线图
|
//绘制折线图
|
||||||
public static void drawLine(XWPFDocument document, String[] xAxisData,Double[] yAxisData) throws Exception {
|
public static void drawLine(XWPFDocument document, String[] xAxisData,Double[] yAxisData) throws Exception {
|
||||||
XWPFChart xChart = document.createChart(15 * Units.EMU_PER_CENTIMETER, 10 * Units.EMU_PER_CENTIMETER);
|
XWPFChart xChart = document.createChart(15 * Units.EMU_PER_CENTIMETER, 10 * Units.EMU_PER_CENTIMETER);
|
||||||
@ -40,7 +111,7 @@ public class BarChart
|
|||||||
// 6、Y轴(值轴)相关设置
|
// 6、Y轴(值轴)相关设置
|
||||||
XDDFValueAxis yAxis = xChart.createValueAxis(AxisPosition.LEFT); // 创建Y轴,指定位置轴标题
|
XDDFValueAxis yAxis = xChart.createValueAxis(AxisPosition.LEFT); // 创建Y轴,指定位置轴标题
|
||||||
XDDFNumericalDataSource<Double> yAxisSource = XDDFDataSourcesFactory.fromArray(yAxisData); // 设置Y轴数据
|
XDDFNumericalDataSource<Double> yAxisSource = XDDFDataSourcesFactory.fromArray(yAxisData); // 设置Y轴数据
|
||||||
yAxis.setTitle("hm²");
|
yAxis.setTitle("km²");
|
||||||
// 7、创建折线图对象
|
// 7、创建折线图对象
|
||||||
XDDFLineChartData lineChart = (XDDFLineChartData) xChart.createData(ChartTypes.LINE, xAxis, yAxis);
|
XDDFLineChartData lineChart = (XDDFLineChartData) xChart.createData(ChartTypes.LINE, xAxis, yAxis);
|
||||||
|
|
||||||
@ -77,7 +148,7 @@ public class BarChart
|
|||||||
// Y轴(值轴)相关设置
|
// Y轴(值轴)相关设置
|
||||||
//chart.createValueAxis(AxisPosition.LEFT);
|
//chart.createValueAxis(AxisPosition.LEFT);
|
||||||
XDDFValueAxis yAxis = chart.createValueAxis(AxisPosition.LEFT); // 创建Y轴,指定位置
|
XDDFValueAxis yAxis = chart.createValueAxis(AxisPosition.LEFT); // 创建Y轴,指定位置
|
||||||
yAxis.setTitle("Area(hm²)"); // Y轴标题
|
yAxis.setTitle("Area(km²)"); // Y轴标题
|
||||||
yAxis.setCrossBetween(AxisCrossBetween.BETWEEN); // 设置图柱的位置:BETWEEN居中
|
yAxis.setCrossBetween(AxisCrossBetween.BETWEEN); // 设置图柱的位置:BETWEEN居中
|
||||||
XDDFNumericalDataSource<Double> yAxisSource = XDDFDataSourcesFactory.fromArray(yAxisData); // 设置Y轴数据
|
XDDFNumericalDataSource<Double> yAxisSource = XDDFDataSourcesFactory.fromArray(yAxisData); // 设置Y轴数据
|
||||||
ChartTypes chartTypes = ChartTypes.BAR;
|
ChartTypes chartTypes = ChartTypes.BAR;
|
||||||
@ -102,7 +173,7 @@ public class BarChart
|
|||||||
(fileAddress)) {
|
(fileAddress)) {
|
||||||
run.addPicture(is, XWPFDocument.PICTURE_TYPE_PNG,
|
run.addPicture(is, XWPFDocument.PICTURE_TYPE_PNG,
|
||||||
fileAddress,
|
fileAddress,
|
||||||
Units.toEMU(185), Units.toEMU(223)); // 200x200 pixels
|
Units.toEMU(392), Units.toEMU(280)); // 200x200 pixels
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
@ -163,8 +234,8 @@ public class BarChart
|
|||||||
title.setAlignment(ParagraphAlignment.CENTER);
|
title.setAlignment(ParagraphAlignment.CENTER);
|
||||||
XWPFRun runTitle = title.createRun();
|
XWPFRun runTitle = title.createRun();
|
||||||
runTitle.setText(date);
|
runTitle.setText(date);
|
||||||
runTitle.setBold(false);
|
runTitle.setBold(true);
|
||||||
runTitle.setFontSize(16);
|
runTitle.setFontSize(20);
|
||||||
runTitle.setFontFamily("Times New Roman");
|
runTitle.setFontFamily("Times New Roman");
|
||||||
}
|
}
|
||||||
//设置行间距
|
//设置行间距
|
||||||
@ -179,6 +250,7 @@ public class BarChart
|
|||||||
//1磅数是20
|
//1磅数是20
|
||||||
spacing.setLine(BigInteger.valueOf(size*20));
|
spacing.setLine(BigInteger.valueOf(size*20));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getDoubleNumber(Double d)
|
public static String getDoubleNumber(Double d)
|
||||||
{
|
{
|
||||||
DecimalFormat df = new DecimalFormat("#.00");
|
DecimalFormat df = new DecimalFormat("#.00");
|
||||||
|
@ -0,0 +1,24 @@
|
|||||||
|
package com.ruoyi.system.domain_shate;
|
||||||
|
|
||||||
|
public class WordVo {
|
||||||
|
|
||||||
|
private String [] zoneList;
|
||||||
|
|
||||||
|
private String[] year;
|
||||||
|
|
||||||
|
public String[] getZoneList() {
|
||||||
|
return zoneList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setZoneList(String[] zoneList) {
|
||||||
|
this.zoneList = zoneList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String[] getYear() {
|
||||||
|
return year;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setYear(String[] year) {
|
||||||
|
this.year = year;
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user