yangys
2024-09-03 52ff3bda72646a532c3297e4843bc4d5aee8b949
collect/src/main/java/com/qianwen/mdc/collect/controller/StateController.java
@@ -1,4 +1,5 @@
package com.qianwen.mdc.collect.controller;
import java.util.Arrays;
import java.util.List;
@@ -9,8 +10,11 @@
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.dto.StateAggregateTimeDTO;
import com.qianwen.mdc.collect.entity.iotdb.DeviceState;
import com.qianwen.mdc.collect.entity.iotdb.Output;
import com.qianwen.mdc.collect.entity.iotdb.ProcessParam;
import com.qianwen.mdc.collect.mapper.iotdb.DeviceStateMapper;
import com.qianwen.mdc.collect.mapper.iotdb.OutputMapper;
import com.qianwen.mdc.collect.mapper.iotdb.ProcessParamMapper;
import com.qianwen.mdc.collect.mapper.mgr.CalendarMapper;
@@ -28,16 +32,27 @@
@RestController
public class StateController {
   @Autowired
   private DeviceStateAggregateService stateAggregateService;
    @GetMapping("/stateagg")
    public Object stateagg(Long workstationId) {
       stateAggregateService.stateAggregate(workstationId);
       return "1";
    }
   @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";
   }
}