Commit 371b04a6 authored by caotao's avatar caotao

动态获取风机装态图

parent 553dc03b
...@@ -28,6 +28,8 @@ import org.springframework.web.bind.annotation.*; ...@@ -28,6 +28,8 @@ import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.component.emq.EmqKeeper; import org.typroject.tyboot.component.emq.EmqKeeper;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.*; import java.util.*;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
...@@ -193,7 +195,14 @@ public class DemoController extends BaseController { ...@@ -193,7 +195,14 @@ public class DemoController extends BaseController {
} }
influxDbConnection.insert("indicators_" + monitorFanIndicator.getGateway(), tag, maps2, 1688558007051L, TimeUnit.MILLISECONDS); influxDbConnection.insert("indicators_" + monitorFanIndicator.getGateway(), tag, maps2, 1688558007051L, TimeUnit.MILLISECONDS);
} }
}
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "测试动态图片")
@GetMapping("/test7")
public ResponseModel<HashMap<String,String>> demoTest6() {
HashMap<String,String > hashMap = new HashMap<>();
hashMap.put("url","upload/jxiop/amos_studio/758F6F4BC695B777899485DB0C7E5D3.gif");
return ResponseHelper.buildResponse(hashMap);
} }
} }
...@@ -13,6 +13,7 @@ import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.CommonServiceImpl; ...@@ -13,6 +13,7 @@ import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.CommonServiceImpl;
import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.MonitorFanIndicatorImpl; import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.MonitorFanIndicatorImpl;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.elasticsearch.index.Index;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
...@@ -24,6 +25,7 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation; ...@@ -24,6 +25,7 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper; import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.io.File;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -51,6 +53,9 @@ public class MonitorFanIdxController extends BaseController { ...@@ -51,6 +53,9 @@ public class MonitorFanIdxController extends BaseController {
@Value("${gl.avg.column}") @Value("${gl.avg.column}")
String avgColumn; String avgColumn;
@Value("${fan.statuts.stattuspath}")
private String fanStatusImagePathPrefix;
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "根据设备编号、场站id、前段展示模块、系统类型查询表数据") @ApiOperation(value = "根据设备编号、场站id、前段展示模块、系统类型查询表数据")
@GetMapping("/getFanIdxInfoByPage") @GetMapping("/getFanIdxInfoByPage")
...@@ -89,6 +94,31 @@ public class MonitorFanIdxController extends BaseController { ...@@ -89,6 +94,31 @@ public class MonitorFanIdxController extends BaseController {
} }
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "风机布置图 - 风机状态图片")
@GetMapping("/getFanStatusListImage")
public ResponseModel<IPage<HashMap<String,String>>> getFanStatusListImages() {
List<IndexDto> fanStatusList = monitorFanIndicator.getFanStatusList("1660231556607774721");
List<IndexDto> collect = fanStatusList.stream()
.limit(999)
.collect(Collectors.toList());
IPage<HashMap<String,String>> page = new Page<>();
HashMap<String,String> hashMap = new HashMap<>();
List<IndexDto> indexDtoList = collect.stream().sorted(Comparator.comparing(IndexDto::getEquipmentNumber)).collect(Collectors.toList());
for (int i = 1; i <= indexDtoList.size(); i++) {
IndexDto indexDto = indexDtoList.get(i-1);
hashMap.put("url"+i,fanStatusImagePathPrefix+"/"+"风机-"+indexDto.getState()+".gif");
hashMap.put("name"+i,indexDto.getEquipmentNumber());
}
page.setTotal(10);
page.setSize(10);
page.setCurrent(1);
List<HashMap<String,String>> hashMapList = new ArrayList<>();
hashMapList.add(hashMap);
page.setRecords(hashMapList);
return ResponseHelper.buildResponse(page);
}
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "风机布置图 - 风机数量") @ApiOperation(value = "风机布置图 - 风机数量")
@GetMapping("/getFanNum") @GetMapping("/getFanNum")
public ResponseModel<Integer> getFanNum(@RequestParam(value = "stationId", required = false) String stationId) { public ResponseModel<Integer> getFanNum(@RequestParam(value = "stationId", required = false) String stationId) {
......
...@@ -99,3 +99,6 @@ spring.activemq.user=admin ...@@ -99,3 +99,6 @@ spring.activemq.user=admin
spring.activemq.password=admin spring.activemq.password=admin
spring.jms.pub-sub-domain=false spring.jms.pub-sub-domain=false
myqueue=amos.privilege.v1.JXIOP.AQSC_FDGL.userBusiness myqueue=amos.privilege.v1.JXIOP.AQSC_FDGL.userBusiness
# ?????????
fan.statuts.stattuspath=upload/jxiop/device_status
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment