From cc6270c5f434f93bf51f4c454e3de512be70b584 Mon Sep 17 00:00:00 2001
From: dengzedong <dengzedong@email>
Date: 星期三, 02 四月 2025 13:10:33 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/api/controller/admin/ApiDataController.java |   28 +++++++---------------------
 1 files changed, 7 insertions(+), 21 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 13e4146..7effc8c 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
@@ -3,12 +3,12 @@
 import com.iailab.framework.common.pojo.CommonResult;
 import com.iailab.framework.common.pojo.PageResult;
 import com.iailab.framework.common.util.date.DateUtils;
-import com.iailab.framework.common.util.object.ConvertUtils;
 import com.iailab.framework.excel.core.util.ExcelUtils;
 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;
+import com.iailab.module.data.api.ind.IndItemApi;
 import com.iailab.module.data.api.ind.dto.ApiIndItemQueryDTO;
 import com.iailab.module.data.api.ind.dto.ApiIndItemValueDTO;
 import com.iailab.module.data.api.plan.PlanItemApi;
@@ -18,8 +18,6 @@
 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;
@@ -68,7 +66,7 @@
     private PlanItemApi planItemApi;
 
     @Autowired
-    private IndItemCollector indItemCollector;
+    private IndItemApi indItemApi;
 
     @Autowired
     private PlanItemService planItemService;
@@ -168,7 +166,8 @@
         if (!PointDataTypeEnum.BOOLEAN.getCode().equals(dataType)) {
             BigDecimal decValue = new BigDecimal(value.toString());
             if (PointDataTypeEnum.FLOAT.getCode().equals(dataType)) {
-                return decValue.setScale(2, BigDecimal.ROUND_HALF_UP);
+                // return decValue.setScale(2, BigDecimal.ROUND_HALF_UP);
+                return value;
             } else if (PointDataTypeEnum.INT.getCode().equals(dataType)) {
                 decValue = decValue.setScale(0, BigDecimal.ROUND_HALF_UP);
             }
@@ -303,28 +302,15 @@
     @PermitAll
     @GetMapping("/query-ind/default-value")
     @Operation(summary = "查询指标默认值")
-    public CommonResult<List<ApiIndItemValueDTO>> queryIndItemDefaultValue(HttpServletResponse response, HttpServletRequest
-            request,@RequestParam String itemNo) throws Exception {
-        apiSecurityUtils.validate(request);
-        List<IndItemValueVO> list = indItemCollector.queryValue(itemNo);
-        List<ApiIndItemValueDTO> dtoList = new ArrayList<>();
-        list.forEach(item -> {
-            if (item != null) {
-                ApiIndItemValueDTO dto = new ApiIndItemValueDTO();
-                dto.setDataTime(item.getDataTime());
-                dto.setDataValue(item.getDataValue().doubleValue());
-                dtoList.add(dto);
-            }
-        });
-        return success(dtoList);
+    public CommonResult<List<ApiIndItemValueDTO>> queryIndItemDefaultValue(@RequestParam String itemNo) {
+        return success(indItemApi.queryIndItemDefaultValue(itemNo));
     }
 
     @PermitAll
     @PostMapping("/query-ind/history-value")
     @Operation(summary = "查询指标历史值")
     public CommonResult<List<ApiIndItemValueDTO>> queryIndItemHistoryValue(@RequestBody ApiIndItemQueryDTO dto) {
-        List<IndItemValueVO> list = indItemCollector.queryValue(dto.getItemNo(), dto.getStart(), dto.getEnd());
-        return success(ConvertUtils.sourceToTarget(list, ApiIndItemValueDTO.class));
+        return success(indItemApi.queryIndItemHistoryValue(dto));
     }
 
     @PermitAll

--
Gitblit v1.9.3