报告修改
This commit is contained in:
parent
cf9644ef29
commit
48e607e8b1
File diff suppressed because it is too large
Load Diff
@ -57,7 +57,6 @@ public class TopographicFactorController {
|
||||
{
|
||||
Max=ce.getLevel5();
|
||||
}
|
||||
|
||||
}
|
||||
for (int i=0;i<Seeding.size();i++)
|
||||
{
|
||||
|
@ -19,7 +19,7 @@ ruoyi:
|
||||
server:
|
||||
# 服务器的HTTP端口,默认为8080
|
||||
#port: 6051
|
||||
port: 9800
|
||||
port: 6051
|
||||
servlet:
|
||||
# 应用的访问路径
|
||||
context-path: /
|
||||
|
@ -1,4 +1,6 @@
|
||||
package com.ruoyi.common.utils;
|
||||
import org.apache.poi.ss.util.CellRangeAddress;
|
||||
import org.apache.poi.ss.util.CellReference;
|
||||
import org.apache.poi.util.Units;
|
||||
import org.apache.poi.xddf.usermodel.chart.*;
|
||||
import org.apache.poi.xwpf.usermodel.*;
|
||||
@ -23,6 +25,35 @@ import org.openxmlformats.schemas.wordprocessingml.x2006.main.STLineSpacingRule;
|
||||
*/
|
||||
public class BarChart
|
||||
{
|
||||
|
||||
//绘制折线图
|
||||
public static void drawLine(XWPFDocument document, String[] xAxisData,Double[] yAxisData) throws Exception {
|
||||
XWPFChart xChart = document.createChart(15 * Units.EMU_PER_CENTIMETER, 10 * Units.EMU_PER_CENTIMETER);
|
||||
// xChart.setTitleText("海拔"); // 图表标题
|
||||
xChart.setTitleOverlay(false);
|
||||
|
||||
// 5、X轴(分类轴)相关设置
|
||||
// 创建X轴,并且指定位置
|
||||
XDDFCategoryAxis xAxis = xChart.createCategoryAxis(AxisPosition.BOTTOM);
|
||||
XDDFCategoryDataSource xAxisSource = XDDFDataSourcesFactory.fromArray(xAxisData); // 设置X轴数据
|
||||
// xAxis.setTitle("海拔km²");
|
||||
// 6、Y轴(值轴)相关设置
|
||||
XDDFValueAxis yAxis = xChart.createValueAxis(AxisPosition.LEFT); // 创建Y轴,指定位置轴标题
|
||||
XDDFNumericalDataSource<Double> yAxisSource = XDDFDataSourcesFactory.fromArray(yAxisData); // 设置Y轴数据
|
||||
yAxis.setTitle("hm²");
|
||||
// 7、创建折线图对象
|
||||
XDDFLineChartData lineChart = (XDDFLineChartData) xChart.createData(ChartTypes.LINE, xAxis, yAxis);
|
||||
|
||||
// 8、加载折线图数据集
|
||||
XDDFLineChartData.Series lineSeries = (XDDFLineChartData.Series) lineChart.addSeries(xAxisSource, yAxisSource);
|
||||
lineSeries.setSmooth(false); // 线条样式:true平滑曲线,false折线
|
||||
lineSeries.setMarkerSize((short) 6); // 标记点大小
|
||||
lineSeries.setMarkerStyle(MarkerStyle.CIRCLE); // 标记点样式
|
||||
|
||||
// 9、绘制折线图
|
||||
xChart.plot(lineChart);
|
||||
}
|
||||
|
||||
public static void drawTable(XWPFDocument document, String[] xAxisData,Double[] yAxisData) throws Exception {
|
||||
/*int numOfPoints = categories.length;
|
||||
String categoryDataRange = chart.formatRange(new CellRangeAddress(1, numOfPoints, 0, 0));
|
||||
|
@ -0,0 +1,30 @@
|
||||
package com.ruoyi.system.domain_shate;
|
||||
|
||||
import java.sql.DataTruncation;
|
||||
|
||||
/**
|
||||
* @Author: JinSheng Song
|
||||
* @Date: 2022/11/14 16:20
|
||||
*/
|
||||
public class WordHelp {
|
||||
|
||||
private String year;
|
||||
|
||||
private String[] zone;
|
||||
|
||||
public String getYear() {
|
||||
return year;
|
||||
}
|
||||
|
||||
public void setYear(String year) {
|
||||
this.year = year;
|
||||
}
|
||||
|
||||
public String[] getZone() {
|
||||
return zone;
|
||||
}
|
||||
|
||||
public void setZone(String[] zone) {
|
||||
this.zone = zone;
|
||||
}
|
||||
}
|
@ -14,6 +14,9 @@ public interface PlantingSuitabilityMapper
|
||||
{
|
||||
List<PlantingSuitability> sqlSeeding(@Param("zone") String zone);
|
||||
|
||||
PlantingSuitability sqlSeeding1(@Param("zone") String zone,
|
||||
@Param("year") String year);
|
||||
|
||||
Integer InsertSeeding(PlantingSuitability suitability);
|
||||
|
||||
List<PlantingSuitability> sqlYear();
|
||||
|
@ -2,6 +2,7 @@ package com.ruoyi.system.service_shate;
|
||||
|
||||
import com.ruoyi.system.domain_shate.LandUse;
|
||||
import com.ruoyi.system.domain_shate.SeedingSuccessRate;
|
||||
import com.ruoyi.system.domain_shate.UplodFile;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
@ -21,4 +22,6 @@ public interface ILandUseServices
|
||||
|
||||
List<LandUse> sqlYear();
|
||||
|
||||
UplodFile mainClass(String zone,String year);
|
||||
|
||||
}
|
||||
|
@ -13,6 +13,8 @@ public interface IPlantingSuitabilityService
|
||||
{
|
||||
List<PlantingSuitability> sqlSeeding(String zone);
|
||||
|
||||
PlantingSuitability sqlSeeding1(String zone,String year);
|
||||
|
||||
Integer InsertSeeding(PlantingSuitability suitability);
|
||||
|
||||
List<PlantingSuitability> sqlYear();
|
||||
|
@ -1,9 +1,13 @@
|
||||
package com.ruoyi.system.service_shate.impl;
|
||||
|
||||
import com.ruoyi.system.domain_shate.LandUse;
|
||||
import com.ruoyi.system.domain_shate.SeedingSuccessRate;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.system.domain_shate.*;
|
||||
import com.ruoyi.system.mapper_shate.LandUseMapper;
|
||||
import com.ruoyi.system.mapper_shate.SoilFactorMapper;
|
||||
import com.ruoyi.system.service_shate.ILandUseServices;
|
||||
import com.ruoyi.system.service_shate.IRegionalFactorService;
|
||||
import com.ruoyi.system.service_shate.ISoilFactorService;
|
||||
import com.ruoyi.system.service_shate.ITopographicFactorService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@ -21,6 +25,15 @@ public class LandUseServiceipml implements ILandUseServices
|
||||
@Resource
|
||||
private LandUseMapper mapper;
|
||||
|
||||
@Resource
|
||||
private ITopographicFactorService factorService;
|
||||
|
||||
@Resource
|
||||
private ISoilFactorService soilFactorService;
|
||||
|
||||
@Resource
|
||||
private IRegionalFactorService regionalFactorService;
|
||||
|
||||
@Override
|
||||
public List<LandUse> sqlSeeding(String zone, String[] landUses,String year) {
|
||||
List<LandUse> value=mapper.sqlSeeding(zone, landUses,year);
|
||||
@ -42,4 +55,35 @@ public class LandUseServiceipml implements ILandUseServices
|
||||
public List<LandUse> sqlYear() {
|
||||
return mapper.sqlYear();
|
||||
}
|
||||
|
||||
@Override
|
||||
public UplodFile mainClass(String zone,String year) {
|
||||
|
||||
UplodFile file=new UplodFile();
|
||||
//海拔
|
||||
List<Altitude> altitude = factorService.sqlAltitude(zone,year);
|
||||
//坡度
|
||||
List<Slope> slopes = factorService.sqlSlope(zone,year);
|
||||
//坡向
|
||||
List<Aspect> aspects = factorService.sqlAspect(zone,year);
|
||||
//沙化指数
|
||||
List<SoilDesertification> desertifications=soilFactorService.sqlDesert(zone,year);
|
||||
//湿度指数
|
||||
List<SoilMoisture> moistures=soilFactorService.sqlMoisture(zone,year);
|
||||
//盐渍化指数
|
||||
List<SoilSalinization> salinizations=soilFactorService.sqlSalin(zone,year);
|
||||
//水域因子
|
||||
List<WaterFactor> waterFactors=regionalFactorService.sqlWater(zone,year);
|
||||
//道路因子
|
||||
List<RoadFactor> roadFactors=regionalFactorService.sqlRoad(zone,year);
|
||||
file.setWaterFactors(waterFactors);
|
||||
file.setRoadFactors(roadFactors);
|
||||
file.setSoilMoistures(moistures);
|
||||
file.setSoilSalinizations(salinizations);
|
||||
file.setSoilDesertifications(desertifications);
|
||||
file.setAspects(aspects);
|
||||
file.setSlopes(slopes);
|
||||
file.setAltitudes(altitude);
|
||||
return file;
|
||||
}
|
||||
}
|
||||
|
@ -22,6 +22,12 @@ public class PlantingSuitabilityServiceIpml implements IPlantingSuitabilityServi
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PlantingSuitability sqlSeeding1(String zone, String year) {
|
||||
PlantingSuitability value=mapper.sqlSeeding1(zone,year);
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer InsertSeeding(PlantingSuitability suitability) {
|
||||
return mapper.InsertSeeding(suitability);
|
||||
|
@ -34,6 +34,18 @@
|
||||
</if>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="sqlSeeding1" resultMap="RM_Seeding">
|
||||
SELECT <include refid="columns"/> FROM suitability
|
||||
WHERE 1=1
|
||||
<if test="zone!= null and zone !=''">
|
||||
AND zone = #{zone}
|
||||
</if>
|
||||
<if test="year!= null and year !=''">
|
||||
AND year1 = #{year}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="sqlYear" resultMap="RM_Seeding">
|
||||
SELECT distinct year1,ZONE FROM suitability
|
||||
</select>
|
||||
|
Loading…
x
Reference in New Issue
Block a user