Commit ad3a08af authored by litengwei's avatar litengwei

Merge remote-tracking branch 'origin/develop_dl_plan6' into develop_dl_plan6

parents f98a774e e248b2bb
......@@ -14,7 +14,13 @@ public enum WordTemplateTypeEum {
firePatrolReport("消防巡查报表","FirePatrolReport.ftl"),
fireAutoSysManageReport("消防自动化综合管理报表","fireAutoSysManageReport.ftl"),
iotMonthReport("物联报表-月分析报表","iotMonthReport.ftl");
iotMonthReport("物联报表-月分析报表","iotMonthReport.ftl"),
iotWeekReport("物联报表-周分析报表","iotWeekReport.ftl"),
iotDayReport("物联报表-日分析报表","iotDayReport.ftl");
......
......@@ -16,6 +16,7 @@ import org.jfree.chart.plot.PlotOrientation;
import org.jfree.chart.renderer.category.LineAndShapeRenderer;
import org.jfree.data.category.DefaultCategoryDataset;
import org.jfree.data.general.DefaultPieDataset;
import org.springframework.util.ObjectUtils;
import java.awt.*;
import java.awt.image.BufferedImage;
......@@ -48,7 +49,7 @@ public class ChartsUtils {
// map.put(name.get(i), value.get(i));
// }
for (Map<String, Object> item : data) {
map.put(String.valueOf(item.get("type")),Double.parseDouble(String.valueOf(item.get("value"))));
map.put(String.valueOf(item.get("type")),Double.parseDouble(ObjectUtils.isEmpty(item.get("value"))?"0":String.valueOf(item.get("value"))));
}
......@@ -133,7 +134,7 @@ public class ChartsUtils {
}
}
public static String manyLineChart(List<Map<String, Object>> value) {
public static String manyLineChart(List<Map<String, Object>> value, String title, String xtitle, String ytitle) {
// 绘图数据集
DefaultCategoryDataset dataSet = new DefaultCategoryDataset();
......@@ -142,7 +143,7 @@ public class ChartsUtils {
}
JFreeChart chart = createManyLineChart(dataSet);
JFreeChart chart = createManyLineChart(dataSet, title, xtitle, ytitle);
BufferedImage image = chart.createBufferedImage(1000, 800);
byte[] bytes = null;
......@@ -161,16 +162,16 @@ public class ChartsUtils {
*
* @return
*/
public static JFreeChart createManyLineChart(DefaultCategoryDataset dataSet) {
public static JFreeChart createManyLineChart(DefaultCategoryDataset dataSet, String title, String xtitle, String ytitle) {
//如果把createLineChart改为createLineChart3D就变为了3D效果的折线图
JFreeChart chart = ChartFactory.createLineChart("月报警信息", "日期", "告警数量", dataSet,
JFreeChart chart = ChartFactory.createLineChart(title, xtitle, ytitle, dataSet,
PlotOrientation.VERTICAL, // 绘制方向
true, // 显示图例
true, // 采用标准生成器
false // 是否生成超链接
);
//如 果不使用Font,中文将显示不出来
Font font = new Font("新宋体", Font.BOLD, 10);
Font font = new Font("新宋体", Font.BOLD, 18);
chart.getTitle().setFont(font); // 设置标题字体
chart.getLegend().setItemFont(font);// 设置图例类别字体
......
......@@ -655,4 +655,48 @@ public class ConfigureController extends AbstractBaseController {
return CommonResponseUtil.success(iFireFightingSystemService.iotMonthReport(bizOrgCode, startDate, endDate));
}
@PersonIdentify
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/iotWeekReport")
@ApiOperation(httpMethod = "GET", value = "物联报表-周", notes = "物联报表-周")
public ResponseModel iotWeekReport(@RequestParam(value = "bizOrgCode", required = false) String bizOrgCode,
@RequestParam(value = "startDate") String startDate,
@RequestParam(value = "endDate") String endDate) {
if (ObjectUtils.isEmpty(bizOrgCode)) {
ReginParams reginParams = getSelectedOrgInfo();
ReginParams.PersonIdentity personIdentity = reginParams.getPersonIdentity();
if (!ValidationUtil.isEmpty(personIdentity)) {
bizOrgCode = personIdentity.getBizOrgCode();
}
}
if (ObjectUtils.isEmpty(bizOrgCode)){
return CommonResponseUtil.success(null);
}
return CommonResponseUtil.success(iFireFightingSystemService.iotWeekReport(bizOrgCode, startDate, endDate));
}
@PersonIdentify
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/iotDayReport")
@ApiOperation(httpMethod = "GET", value = "物联报表-日", notes = "物联报表-日")
public ResponseModel iotDayReport(@RequestParam(value = "bizOrgCode", required = false) String bizOrgCode,
@RequestParam(value = "startDate") String startDate,
@RequestParam(value = "endDate") String endDate) {
if (ObjectUtils.isEmpty(bizOrgCode)) {
ReginParams reginParams = getSelectedOrgInfo();
ReginParams.PersonIdentity personIdentity = reginParams.getPersonIdentity();
if (!ValidationUtil.isEmpty(personIdentity)) {
bizOrgCode = personIdentity.getBizOrgCode();
}
}
if (ObjectUtils.isEmpty(bizOrgCode)){
return CommonResponseUtil.success(null);
}
return CommonResponseUtil.success(iFireFightingSystemService.iotDayReport(bizOrgCode, startDate, endDate));
}
}
......@@ -480,5 +480,39 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
List<Map<String, Object>> selectMonthPolyline(@Param("systemCode") String sysCode, @Param("startDate") String startDate, @Param("endDate") String endDate, @Param("indicator") List<String> indicator);
List<Map<String, Object>> selectWeekReportList(@Param("systemId") String systemId,@Param("startDate") String startDate, @Param("endDate") String endDate, @Param("indicator") List<String> indicator);
Integer selectAlarms(@Param("systemId") String systemId,
@Param("indexType") String indexType,
@Param("equipmentCode") String equipmentCode,
@Param("startDate") String startDate,
@Param("endDate") String endDate,
@Param("indicator") List<String> indicator);
Map<String, Object> selectWeekSummarize(@Param("systemId") String systemId,
@Param("startDate") String startDate,
@Param("endDate") String endDate);
List<Map<String, Object>> selectWeekEquipEchart(@Param("systemCode") String systemCode,
@Param("startDate") String startDate,
@Param("endDate") String endDate);
List<Map<String, Object>> selectWeekEchart(@Param("systemCode") String systemCode,
@Param("startDate") String startDate,
@Param("endDate") String endDate);
List<Map<String, Object>> selectWeekLinesEchart(@Param("systemCode") String systemCode,
@Param("startDate") String startDate,
@Param("endDate") String endDate);
Map<String, Object> selectDaySummarize(@Param("systemId") String systemId,
@Param("startDate") String startDate,
@Param("endDate") String endDate);
List<Map<String, Object>> selectDayEquipEchart(@Param("systemCode") String systemCode,
@Param("startDate") String startDate,
@Param("endDate") String endDate);
List<Map<String, Object>> selectDayEchart(@Param("systemCode") String systemCode,
@Param("startDate") String startDate,
@Param("endDate") String endDate);
}
......@@ -276,4 +276,9 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE
String iotMonthReport(String bizOrgCode, String startDate, String endDate);
String iotWeekReport(String bizOrgCode, String startDate, String endDate);
String iotDayReport(String bizOrgCode, String startDate, String endDate);
}
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment