风机页面遥控接口
This commit is contained in:
parent
790c6adf98
commit
c8b1a13853
@ -1,14 +1,12 @@
|
||||
package com.das.modules.page.controller;
|
||||
|
||||
import com.das.common.result.R;
|
||||
import com.das.modules.node.domain.dto.DeviceCommandDto;
|
||||
import com.das.modules.page.domian.WindTurbinesPageVo;
|
||||
import com.das.modules.page.service.WindTurbinesPageService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ -27,7 +25,7 @@ public class WindTurbinesPageController {
|
||||
* 获取风机机组所属线路列表
|
||||
* @return 返回字符串数组
|
||||
*/
|
||||
@PostMapping("/lines")
|
||||
@GetMapping("/lines")
|
||||
public R<List<String>> queryBelongLines() {
|
||||
//TODO: 查询sql: select distinct belong_line as name from sys_equipment t where t.object_type = 10002 and belong_line !='';
|
||||
List<String> lines = windTurbinesPageService.queryBelongLines();
|
||||
@ -43,4 +41,15 @@ public class WindTurbinesPageController {
|
||||
List<WindTurbinesPageVo> windTurbinesPageVos = windTurbinesPageService.queryAllWindTurbinesPages();
|
||||
return R.success(windTurbinesPageVos);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param controlList 遥控List
|
||||
* @return 成功或者失败
|
||||
*/
|
||||
@PostMapping ("/queryWindTurbinesPages")
|
||||
public R<Void> windTurbinesControl(@RequestBody List<DeviceCommandDto> controlList){
|
||||
windTurbinesPageService.windTurbinesControl(controlList);
|
||||
return R.success();
|
||||
}
|
||||
}
|
||||
|
@ -3,6 +3,8 @@ package com.das.modules.page.service;
|
||||
import com.das.modules.data.domain.SnapshotValueQueryParam;
|
||||
import com.das.modules.data.service.DataService;
|
||||
import com.das.modules.equipment.mapper.SysEquipmentMapper;
|
||||
import com.das.modules.node.domain.dto.DeviceCommandDto;
|
||||
import com.das.modules.node.service.SysNodeService;
|
||||
import com.das.modules.page.domian.WindTurbinesPageVo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -25,6 +27,9 @@ public class WindTurbinesPageService {
|
||||
@Autowired
|
||||
private DataService dataService;
|
||||
|
||||
@Autowired
|
||||
SysNodeService sysNodeService;
|
||||
|
||||
/**
|
||||
* 获取风机机组所属线路列表
|
||||
* @return 返回字符串数组
|
||||
@ -33,6 +38,11 @@ public class WindTurbinesPageService {
|
||||
return sysEquipmentMapper.queryBelongLines(OBJECT_TYPE);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取风机页面数据
|
||||
* @return 返回风机页面数据
|
||||
*/
|
||||
public List<WindTurbinesPageVo> queryAllWindTurbinesPages(){
|
||||
List<WindTurbinesPageVo> windTurbinesPageVos = sysEquipmentMapper.queryAllWindList(OBJECT_TYPE);
|
||||
List<SnapshotValueQueryParam> paramList = new ArrayList<>();
|
||||
@ -64,4 +74,10 @@ public class WindTurbinesPageService {
|
||||
}
|
||||
return windTurbinesPageVos;
|
||||
}
|
||||
|
||||
public void windTurbinesControl(List<DeviceCommandDto> controlList){
|
||||
for (DeviceCommandDto item : controlList){
|
||||
sysNodeService.deviceCommand(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user