优化首页统计

This commit is contained in:
weidong 2024-10-15 15:00:39 +08:00
parent 0bbab04187
commit e40660f2c1
2 changed files with 10 additions and 3 deletions

View File

@ -58,8 +58,12 @@ public class IndexController extends BasicController{
Iterator<GnssStatusJoin> iterator = deviceList.iterator(); Iterator<GnssStatusJoin> iterator = deviceList.iterator();
while(iterator.hasNext()){ while(iterator.hasNext()){
GnssStatusJoin status=iterator.next(); GnssStatusJoin status=iterator.next();
if(status.getState() == GnssStatus.STATE_OFFLINE) deviceOfflineNum++; if(status.getState() == GnssStatus.STATE_OFFLINE) {
if((status.getWarningcode()&WarningCfg.TYPE_NO_FIXED_RESULT) != 0) noFix++; deviceOfflineNum++;
}
else if((status.getWarningcode()&WarningCfg.TYPE_NO_FIXED_RESULT) != 0) {
noFix++;
}
if(status.getWarning() == WarningCfg.LEVEL_1) warning1Num++; if(status.getWarning() == WarningCfg.LEVEL_1) warning1Num++;
else if(status.getWarning() == WarningCfg.LEVEL_2) warning2Num++; else if(status.getWarning() == WarningCfg.LEVEL_2) warning2Num++;
@ -111,7 +115,7 @@ public class IndexController extends BasicController{
Page pageable = new Page<>(page == null ? 1 : page, limit == null ? 10 : limit); Page pageable = new Page<>(page == null ? 1 : page, limit == null ? 10 : limit);
MPJQueryWrapper<GnssStatus> queryWrapper = new MPJQueryWrapper<>(); MPJQueryWrapper<GnssStatus> queryWrapper = new MPJQueryWrapper<>();
queryWrapper.selectAll(GnssStatus.class) queryWrapper.selectAll(GnssStatus.class)
.select("d.name as name","d.devicetype as devicetype") .select("d.name as name","d.devicetype as devicetype","d.project_id as project_id")
.leftJoin("gnssdevices d on t.deviceid = d.deviceid") .leftJoin("gnssdevices d on t.deviceid = d.deviceid")
.ne("d.tenantid",Tenant.SAAS_PROVIDER_ID) .ne("d.tenantid",Tenant.SAAS_PROVIDER_ID)
.eq("opmode",GnssDevice.OP_MODE_USE) .eq("opmode",GnssDevice.OP_MODE_USE)

View File

@ -39,6 +39,7 @@
cols: [[ cols: [[
{field: 'deviceid', title: '设备号', sort: true}, {field: 'deviceid', title: '设备号', sort: true},
{field: 'devicetype', title: '设备类型',templet: '#typeTrans'}, {field: 'devicetype', title: '设备类型',templet: '#typeTrans'},
{field: 'project_id', title: '项目号'},
{field: 'name', title: '工点'}, {field: 'name', title: '工点'},
{field: 'updatetime', title: '更新时间', templet: "<div>{{layui.util.toDateString(d.updatetime, 'yyyy-MM-dd HH:mm:ss')}}</div>"}, {field: 'updatetime', title: '更新时间', templet: "<div>{{layui.util.toDateString(d.updatetime, 'yyyy-MM-dd HH:mm:ss')}}</div>"},
{field: 'state', title: '状态',templet: '#stateTrans'}, {field: 'state', title: '状态',templet: '#stateTrans'},
@ -47,6 +48,8 @@
{field: 'temperature', title: '温度'}, {field: 'temperature', title: '温度'},
{field: 'humidity', title: '湿度'}, {field: 'humidity', title: '湿度'},
{field: 'rssi', title: '信号'}, {field: 'rssi', title: '信号'},
{field: 'pitch', title: 'x倾角'},
{field: 'roll', title: 'y倾角'},
{field: 'satelliteinuse', title: '使用卫星数'} {field: 'satelliteinuse', title: '使用卫星数'}
]], ]],
limits: [10, 15, 20, 25, 50, 100], limits: [10, 15, 20, 25, 50, 100],