Commit 113039e7 authored by 赵啸非's avatar 赵啸非

修改设备站点名称

parent dd9f1b35
......@@ -94,9 +94,12 @@ public class DeviceController extends BaseCRUDJsonMappingController<DeviceServic
this.addDict(model, "status", paramService.getParamBySecondOrganize("Device", "status"));
this.addDict(model, "deviceFirmId", firmService.find(new FirmQuery()).stream().collect(Collectors.toMap(x -> x.getId().toString(), y -> y.getFirmName())));
this.addDict(model, "deviceSource", paramService.getParamBySecondOrganize("Device", "deviceSource"));
Map<Boolean, Long> collect = this.service.find(new DeviceQuery()).stream().collect(Collectors.partitioningBy(item -> (item.getDeviceOnlineStatus() == DeviceOnlineStatusEnum.在线.getValue()), Collectors.counting()));
List<DeviceEntity> deviceEntityList = this.service.find(new DeviceQuery());
Map<Boolean, Long> collect = deviceEntityList.stream().collect(Collectors.partitioningBy(item -> (item.getDeviceOnlineStatus() == DeviceOnlineStatusEnum.在线.getValue()), Collectors.counting()));
model.put("totalCount", deviceEntityList.size());
model.put("onlineCount", collect.get(true));
model.put("offlineCount", collect.get(false));
model.put("warnCount", 0);
super.init(request, response, form, model, context);
}
......
## 服务接口
### 查询设备列表
**URL:** http://localhost:8080/m/device/list
**Type:** POST
**Content-Type:** application/x-www-form-urlencoded;charset=utf-8
**Description:** 查询设备列表
**Query-parameters:**
参数名称|类型|备注|必填|其它
---|---|---|---|---
pageInfo|object|分页对象|否|-
└─prePageResult|Integer|每页条数|否|-
└─currPage|Integer|当前页|否|-
query|object|查询对象|否|-
└─deviceCode|String|设备编码|否|前后添加%%模糊查询
└─siteName|String|站点名称|否|前后添加%%模糊查询
└─deviceType|Integer|设备类型|否|来源dict中信息
└─deviceOnlineStatus|Integer|设备状态|否|来源dict中信息
**请求样例:**
```
curl -X POST -i http://localhost:8080/m/device/list --data 'query.id=1'
```
**响应参数:**
参数名称 |参数类型|备注|其它
---|---|---|---
code|Integer|结果码(0.失败,1.成功)|-
msg|String|消息|-
data|object|数据对象|-
└─result|array|结果集列表|数组
└─pageInfo|object|分页对象|-
└─dict|object|字典对象|-
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;└─deviceType|object|字典属性对象,详见附录|-
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;└─deviceOnlineStatus|object|字典属性对象,详见附录|-
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;└─status|object|字典属性对象,详见附录|-
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;└─deviceFirmId|object|字典属性对象,详见附录|-
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;└─totalCount|object|字典属性对象,详见附录|-
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;└─onlineCount|object|字典属性对象,详见附录|-
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;└─offlineCount|object|字典属性对象,详见附录|-
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;└─warnCount|object|字典属性对象,详见附录|-
└─query|object|查询时候返回的查询列表参数对象|-
**响应消息样例:**
```
{
"code":1,
"data":{
"result":[
{
"appId":6,
"businessName":"device",
}
],
"pageInfo":{
"currPage":1,
"prePageResult":200,
"totalPage":1,
"totalResult":16
},
"dict":{
"dividedTableType":{
"0":"无",
"1":"日"
}
}
},
"query":{
"appId":6
}
}
```
\ No newline at end of file
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