From 08b6a55a3a111aaee9842999b85afa60b6d61dc3 Mon Sep 17 00:00:00 2001
From: houzhongjian <houzhongyi@126.com>
Date: 星期四, 14 十一月 2024 15:29:38 +0800
Subject: [PATCH] 大华及海康摄像头截图功能开发

---
 iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/api/controller/admin/ApiDataController.java |   15 ++++++---------
 1 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/api/controller/admin/ApiDataController.java b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/api/controller/admin/ApiDataController.java
index c44bb02..d5a4c21 100644
--- a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/api/controller/admin/ApiDataController.java
+++ b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/api/controller/admin/ApiDataController.java
@@ -5,6 +5,7 @@
 import com.iailab.framework.common.util.object.ConvertUtils;
 import com.iailab.framework.excel.core.util.ExcelUtils;
 import com.iailab.framework.tenant.core.context.TenantContextHolder;
+import com.iailab.module.data.api.dto.DeviceValueDTO;
 import com.iailab.module.data.api.dto.IndexQueryDTO;
 import com.iailab.module.data.api.dto.echarts.BarLineDTO;
 import com.iailab.module.data.api.dto.echarts.SeriesItem;
@@ -18,33 +19,29 @@
 import com.iailab.module.data.api.point.dto.ApiPointsValueQueryDTO;
 import com.iailab.module.data.common.ApiDataQueryDTO;
 import com.iailab.module.data.common.ApiDataValueDTO;
+import com.iailab.module.data.common.utils.ApiSecurityUtils;
 import com.iailab.module.data.ind.collection.IndItemCollector;
 import com.iailab.module.data.ind.item.vo.IndItemValueVO;
 import com.iailab.module.data.plan.item.entity.PlanItemEntity;
+import com.iailab.module.data.plan.item.service.PlanItemService;
 import com.iailab.module.data.plan.item.vo.PlanItemValueExportVO;
 import com.iailab.module.data.point.common.PointDataTypeEnum;
 import com.iailab.module.data.point.dto.DaPointDTO;
 import com.iailab.module.data.point.service.DaPointService;
-import com.iailab.module.data.api.dto.DeviceValueDTO;
-import com.iailab.module.data.common.utils.ApiSecurityUtils;
-import com.iailab.module.data.plan.item.service.PlanItemService;
-import com.iailab.module.data.point.vo.DaPointExcelVO;
 import io.swagger.v3.oas.annotations.Operation;
 import io.swagger.v3.oas.annotations.tags.Tag;
 import lombok.extern.slf4j.Slf4j;
-
-import javax.annotation.Resource;
-
-import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.util.CollectionUtils;
 import org.springframework.web.bind.annotation.*;
 
+import javax.annotation.Resource;
 import javax.annotation.security.PermitAll;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
 import java.math.BigDecimal;
+import java.math.RoundingMode;
 import java.util.*;
 import java.util.stream.Collectors;
 
@@ -300,7 +297,7 @@
         List<PlanItemValueExportVO> exportList = list.stream().map(item -> {
             PlanItemValueExportVO exportVO = new PlanItemValueExportVO();
             exportVO.setDataTime(DateUtils.format(item.getDataTime(), DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND));
-            exportVO.setDataValue(new BigDecimal(item.getDataValue()).setScale(0, BigDecimal.ROUND_HALF_UP).toString());
+            exportVO.setDataValue(BigDecimal.valueOf(item.getDataValue()).setScale(0, RoundingMode.HALF_UP).toString());
             return exportVO;
         }).collect(Collectors.toList());
         ExcelUtils.write(response, "计划数据.xls", "计划数据", PlanItemValueExportVO.class, exportList);

--
Gitblit v1.9.3