From 7ef593e1e3c35aaeecf9318f0b3941230d3ed002 Mon Sep 17 00:00:00 2001
From: yangys <y_ys79@sina.com>
Date: 星期三, 09 十月 2024 11:22:54 +0800
Subject: [PATCH] 增加在数据点计算规则后数据点名称加_n的适配

---
 collect/src/main/java/com/qianwen/mdc/collect/controller/StateController.java |   59 +++++++++++++++++++++++++++++++----------------------------
 1 files changed, 31 insertions(+), 28 deletions(-)

diff --git a/collect/src/main/java/com/qianwen/mdc/collect/controller/StateController.java b/collect/src/main/java/com/qianwen/mdc/collect/controller/StateController.java
index 2b42af2..6a48f03 100644
--- a/collect/src/main/java/com/qianwen/mdc/collect/controller/StateController.java
+++ b/collect/src/main/java/com/qianwen/mdc/collect/controller/StateController.java
@@ -1,43 +1,46 @@
 package com.qianwen.mdc.collect.controller;
-import java.util.Arrays;
+
 import java.util.List;
 
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RestController;
 
-import com.baomidou.dynamic.datasource.annotation.DS;
-import com.qianwen.mdc.collect.config.IotDBSessionConfig;
-import com.qianwen.mdc.collect.dto.CalendarShiftInfoDTO;
-import com.qianwen.mdc.collect.entity.iotdb.Output;
-import com.qianwen.mdc.collect.entity.iotdb.ProcessParam;
-import com.qianwen.mdc.collect.mapper.iotdb.OutputMapper;
-import com.qianwen.mdc.collect.mapper.iotdb.ProcessParamMapper;
-import com.qianwen.mdc.collect.mapper.mgr.CalendarMapper;
-import com.qianwen.mdc.collect.mqtt.MqttMessageSender;
+import com.qianwen.mdc.collect.dto.StateAggregateTimeDTO;
+import com.qianwen.mdc.collect.entity.iotdb.DeviceState;
+import com.qianwen.mdc.collect.mapper.iotdb.DeviceStateMapper;
 import com.qianwen.mdc.collect.service.DeviceStateAggregateService;
-import com.qianwen.mdc.collect.service.DeviceStateFixPointService;
-import com.qianwen.mdc.collect.service.IOTMqttReceiveService;
-import com.qianwen.mdc.collect.service.IotDBCommonService;
-import com.qianwen.mdc.collect.service.OutputAggregateService;
-import com.qianwen.mdc.collect.utils.redis.RedisUtil;
-
-import cn.hutool.core.date.DateField;
-import cn.hutool.core.date.DateTime;
-import cn.hutool.core.date.DateUtil;
 
 @RestController
 public class StateController {
-	
+
 	@Autowired
 	private DeviceStateAggregateService stateAggregateService;
+	@Autowired
+	private DeviceStateMapper stateMapper;
+
+	@GetMapping("/range")
+	public Object range() {
+		long wod = 1656819188967653378L;
+		StateAggregateTimeDTO timeRange = new StateAggregateTimeDTO();
+		timeRange.setEndTime(System.currentTimeMillis());
+		List<DeviceState> slist = stateMapper.statesInTimeRange(wod, timeRange);
+		
+		return "2";
+	}
+
+	@GetMapping("/stateagg")
+	public Object stateagg(Long workstationId) {
+		stateAggregateService.stateAggregate(workstationId);
+
+		return "1";
+	}
 	
-	
-    @GetMapping("/stateagg")
-    public Object stateagg(Long workstationId) {
-    	stateAggregateService.stateAggregate(workstationId);
-    	
-    	return "1";
-    }
-    
+	@GetMapping("/lttime")
+	public Object lttime(Long workstationId) {
+		DeviceState s = stateMapper.lastNoFeedbackStateLessThanTime(workstationId,System.currentTimeMillis());
+
+		return s;
+	}
+
 }

--
Gitblit v1.9.3