diff --git a/app/src/main/java/com/casic/br/operationsite/model/LatestGasDataModel.kt b/app/src/main/java/com/casic/br/operationsite/model/LatestGasDataModel.kt deleted file mode 100644 index 5192f68..0000000 --- a/app/src/main/java/com/casic/br/operationsite/model/LatestGasDataModel.kt +++ /dev/null @@ -1,8 +0,0 @@ -package com.casic.br.operationsite.model - -data class LatestGasDataModel( - val deviceCode: String, - val gasUnit: String, - val gasValue: String, - val ts: String -) \ No newline at end of file diff --git a/app/src/main/java/com/casic/br/operationsite/model/LatestGasDataModel.kt b/app/src/main/java/com/casic/br/operationsite/model/LatestGasDataModel.kt deleted file mode 100644 index 5192f68..0000000 --- a/app/src/main/java/com/casic/br/operationsite/model/LatestGasDataModel.kt +++ /dev/null @@ -1,8 +0,0 @@ -package com.casic.br.operationsite.model - -data class LatestGasDataModel( - val deviceCode: String, - val gasUnit: String, - val gasValue: String, - val ts: String -) \ No newline at end of file diff --git a/app/src/main/java/com/casic/br/operationsite/model/MultiGasDataModel.kt b/app/src/main/java/com/casic/br/operationsite/model/MultiGasDataModel.kt deleted file mode 100644 index b61f78b..0000000 --- a/app/src/main/java/com/casic/br/operationsite/model/MultiGasDataModel.kt +++ /dev/null @@ -1,15 +0,0 @@ -package com.casic.br.operationsite.model - -data class MultiGasDataModel( - val bloodOxygen: String, - val coValue: String, - val deviceCode: String, - val deviceId: String, - val exValue: String, - val groupCode: String, - val h2sValue: String, - val o2Value: String, - val projectId: String, - val projectName: String, - val uploadTimestamp: String -) \ No newline at end of file diff --git a/app/src/main/java/com/casic/br/operationsite/model/LatestGasDataModel.kt b/app/src/main/java/com/casic/br/operationsite/model/LatestGasDataModel.kt deleted file mode 100644 index 5192f68..0000000 --- a/app/src/main/java/com/casic/br/operationsite/model/LatestGasDataModel.kt +++ /dev/null @@ -1,8 +0,0 @@ -package com.casic.br.operationsite.model - -data class LatestGasDataModel( - val deviceCode: String, - val gasUnit: String, - val gasValue: String, - val ts: String -) \ No newline at end of file diff --git a/app/src/main/java/com/casic/br/operationsite/model/MultiGasDataModel.kt b/app/src/main/java/com/casic/br/operationsite/model/MultiGasDataModel.kt deleted file mode 100644 index b61f78b..0000000 --- a/app/src/main/java/com/casic/br/operationsite/model/MultiGasDataModel.kt +++ /dev/null @@ -1,15 +0,0 @@ -package com.casic.br.operationsite.model - -data class MultiGasDataModel( - val bloodOxygen: String, - val coValue: String, - val deviceCode: String, - val deviceId: String, - val exValue: String, - val groupCode: String, - val h2sValue: String, - val o2Value: String, - val projectId: String, - val projectName: String, - val uploadTimestamp: String -) \ No newline at end of file diff --git a/app/src/main/java/com/casic/br/operationsite/model/WorkSiteDeviceModel.java b/app/src/main/java/com/casic/br/operationsite/model/WorkSiteDeviceModel.java index 8788e9e..dd11bc9 100644 --- a/app/src/main/java/com/casic/br/operationsite/model/WorkSiteDeviceModel.java +++ b/app/src/main/java/com/casic/br/operationsite/model/WorkSiteDeviceModel.java @@ -55,7 +55,7 @@ private String id; private String isPowerSupply; private String isPowerSupplyName; - private Object latestGasData; + private LatestGasDataModel latestGasData; private LatestLocationModel latestLocation; private String manufacturer; private String online; @@ -173,11 +173,11 @@ this.isPowerSupplyName = isPowerSupplyName; } - public Object getLatestGasData() { + public LatestGasDataModel getLatestGasData() { return latestGasData; } - public void setLatestGasData(Object latestGasData) { + public void setLatestGasData(LatestGasDataModel latestGasData) { this.latestGasData = latestGasData; } @@ -277,6 +277,45 @@ this.workerName = workerName; } + public static class LatestGasDataModel { + private String deviceCode; + private String gasUnit; + private String gasValue; + private String ts; + + public String getDeviceCode() { + return deviceCode; + } + + public void setDeviceCode(String deviceCode) { + this.deviceCode = deviceCode; + } + + public String getGasUnit() { + return gasUnit; + } + + public void setGasUnit(String gasUnit) { + this.gasUnit = gasUnit; + } + + public String getGasValue() { + return gasValue; + } + + public void setGasValue(String gasValue) { + this.gasValue = gasValue; + } + + public String getTs() { + return ts; + } + + public void setTs(String ts) { + this.ts = ts; + } + } + public static class LatestLocationModel { private String deviceCode; private String gdLat; diff --git a/app/src/main/java/com/casic/br/operationsite/model/LatestGasDataModel.kt b/app/src/main/java/com/casic/br/operationsite/model/LatestGasDataModel.kt deleted file mode 100644 index 5192f68..0000000 --- a/app/src/main/java/com/casic/br/operationsite/model/LatestGasDataModel.kt +++ /dev/null @@ -1,8 +0,0 @@ -package com.casic.br.operationsite.model - -data class LatestGasDataModel( - val deviceCode: String, - val gasUnit: String, - val gasValue: String, - val ts: String -) \ No newline at end of file diff --git a/app/src/main/java/com/casic/br/operationsite/model/MultiGasDataModel.kt b/app/src/main/java/com/casic/br/operationsite/model/MultiGasDataModel.kt deleted file mode 100644 index b61f78b..0000000 --- a/app/src/main/java/com/casic/br/operationsite/model/MultiGasDataModel.kt +++ /dev/null @@ -1,15 +0,0 @@ -package com.casic.br.operationsite.model - -data class MultiGasDataModel( - val bloodOxygen: String, - val coValue: String, - val deviceCode: String, - val deviceId: String, - val exValue: String, - val groupCode: String, - val h2sValue: String, - val o2Value: String, - val projectId: String, - val projectName: String, - val uploadTimestamp: String -) \ No newline at end of file diff --git a/app/src/main/java/com/casic/br/operationsite/model/WorkSiteDeviceModel.java b/app/src/main/java/com/casic/br/operationsite/model/WorkSiteDeviceModel.java index 8788e9e..dd11bc9 100644 --- a/app/src/main/java/com/casic/br/operationsite/model/WorkSiteDeviceModel.java +++ b/app/src/main/java/com/casic/br/operationsite/model/WorkSiteDeviceModel.java @@ -55,7 +55,7 @@ private String id; private String isPowerSupply; private String isPowerSupplyName; - private Object latestGasData; + private LatestGasDataModel latestGasData; private LatestLocationModel latestLocation; private String manufacturer; private String online; @@ -173,11 +173,11 @@ this.isPowerSupplyName = isPowerSupplyName; } - public Object getLatestGasData() { + public LatestGasDataModel getLatestGasData() { return latestGasData; } - public void setLatestGasData(Object latestGasData) { + public void setLatestGasData(LatestGasDataModel latestGasData) { this.latestGasData = latestGasData; } @@ -277,6 +277,45 @@ this.workerName = workerName; } + public static class LatestGasDataModel { + private String deviceCode; + private String gasUnit; + private String gasValue; + private String ts; + + public String getDeviceCode() { + return deviceCode; + } + + public void setDeviceCode(String deviceCode) { + this.deviceCode = deviceCode; + } + + public String getGasUnit() { + return gasUnit; + } + + public void setGasUnit(String gasUnit) { + this.gasUnit = gasUnit; + } + + public String getGasValue() { + return gasValue; + } + + public void setGasValue(String gasValue) { + this.gasValue = gasValue; + } + + public String getTs() { + return ts; + } + + public void setTs(String ts) { + this.ts = ts; + } + } + public static class LatestLocationModel { private String deviceCode; private String gdLat; diff --git a/app/src/main/java/com/casic/br/operationsite/model/WorkSiteWorkerModel.java b/app/src/main/java/com/casic/br/operationsite/model/WorkSiteWorkerModel.java index 09a1ba2..f8ba3d9 100644 --- a/app/src/main/java/com/casic/br/operationsite/model/WorkSiteWorkerModel.java +++ b/app/src/main/java/com/casic/br/operationsite/model/WorkSiteWorkerModel.java @@ -49,12 +49,12 @@ private String enterReason; private String gender; private String genderName; - private Object health; + private HealthModel health; private String id; private String idCardNumber; private String isRegister; - private Object location; - private Object multiGas; + private LocationModel location; + private MultiGasModel multiGas; private String ownerShip; private String phoneNumber; private String registerTime; @@ -121,11 +121,11 @@ this.genderName = genderName; } - public Object getHealth() { + public HealthModel getHealth() { return health; } - public void setHealth(Object health) { + public void setHealth(HealthModel health) { this.health = health; } @@ -153,19 +153,19 @@ this.isRegister = isRegister; } - public Object getLocation() { + public LocationModel getLocation() { return location; } - public void setLocation(Object location) { + public void setLocation(LocationModel location) { this.location = location; } - public Object getMultiGas() { + public MultiGasModel getMultiGas() { return multiGas; } - public void setMultiGas(Object multiGas) { + public void setMultiGas(MultiGasModel multiGas) { this.multiGas = multiGas; } @@ -240,5 +240,248 @@ public void setWorkerTypeName(String workerTypeName) { this.workerTypeName = workerTypeName; } + + public static class HealthModel { + private String bloodOxygen; + private String deviceCode; + private String deviceId; + private String groupCode; + private String heartRate; + private String projectId; + private String uploadTimestamp; + + public String getBloodOxygen() { + return bloodOxygen; + } + + public void setBloodOxygen(String bloodOxygen) { + this.bloodOxygen = bloodOxygen; + } + + public String getDeviceCode() { + return deviceCode; + } + + public void setDeviceCode(String deviceCode) { + this.deviceCode = deviceCode; + } + + public String getDeviceId() { + return deviceId; + } + + public void setDeviceId(String deviceId) { + this.deviceId = deviceId; + } + + public String getGroupCode() { + return groupCode; + } + + public void setGroupCode(String groupCode) { + this.groupCode = groupCode; + } + + public String getHeartRate() { + return heartRate; + } + + public void setHeartRate(String heartRate) { + this.heartRate = heartRate; + } + + public String getProjectId() { + return projectId; + } + + public void setProjectId(String projectId) { + this.projectId = projectId; + } + + public String getUploadTimestamp() { + return uploadTimestamp; + } + + public void setUploadTimestamp(String uploadTimestamp) { + this.uploadTimestamp = uploadTimestamp; + } + } + + public static class LocationModel { + private String deviceCode; + private String deviceId; + private String gdLat; + private String gdLng; + private String groupCode; + private String lat; + private String lng; + private String projectId; + private String uploadTimestamp; + + public String getDeviceCode() { + return deviceCode; + } + + public void setDeviceCode(String deviceCode) { + this.deviceCode = deviceCode; + } + + public String getDeviceId() { + return deviceId; + } + + public void setDeviceId(String deviceId) { + this.deviceId = deviceId; + } + + public String getGdLat() { + return gdLat; + } + + public void setGdLat(String gdLat) { + this.gdLat = gdLat; + } + + public String getGdLng() { + return gdLng; + } + + public void setGdLng(String gdLng) { + this.gdLng = gdLng; + } + + public String getGroupCode() { + return groupCode; + } + + public void setGroupCode(String groupCode) { + this.groupCode = groupCode; + } + + public String getLat() { + return lat; + } + + public void setLat(String lat) { + this.lat = lat; + } + + public String getLng() { + return lng; + } + + public void setLng(String lng) { + this.lng = lng; + } + + public String getProjectId() { + return projectId; + } + + public void setProjectId(String projectId) { + this.projectId = projectId; + } + + public String getUploadTimestamp() { + return uploadTimestamp; + } + + public void setUploadTimestamp(String uploadTimestamp) { + this.uploadTimestamp = uploadTimestamp; + } + } + + public static class MultiGasModel { + private String coValue; + private String deviceCode; + private String deviceId; + private String exValue; + private String groupCode; + private String h2sValue; + private String o2Value; + private String projectId; + private String projectName; + private String uploadTimestamp; + + public String getCoValue() { + return coValue; + } + + public void setCoValue(String coValue) { + this.coValue = coValue; + } + + public String getDeviceCode() { + return deviceCode; + } + + public void setDeviceCode(String deviceCode) { + this.deviceCode = deviceCode; + } + + public String getDeviceId() { + return deviceId; + } + + public void setDeviceId(String deviceId) { + this.deviceId = deviceId; + } + + public String getExValue() { + return exValue; + } + + public void setExValue(String exValue) { + this.exValue = exValue; + } + + public String getGroupCode() { + return groupCode; + } + + public void setGroupCode(String groupCode) { + this.groupCode = groupCode; + } + + public String getH2sValue() { + return h2sValue; + } + + public void setH2sValue(String h2sValue) { + this.h2sValue = h2sValue; + } + + public String getO2Value() { + return o2Value; + } + + public void setO2Value(String o2Value) { + this.o2Value = o2Value; + } + + public String getProjectId() { + return projectId; + } + + public void setProjectId(String projectId) { + this.projectId = projectId; + } + + public String getProjectName() { + return projectName; + } + + public void setProjectName(String projectName) { + this.projectName = projectName; + } + + public String getUploadTimestamp() { + return uploadTimestamp; + } + + public void setUploadTimestamp(String uploadTimestamp) { + this.uploadTimestamp = uploadTimestamp; + } + } } } diff --git a/app/src/main/java/com/casic/br/operationsite/model/LatestGasDataModel.kt b/app/src/main/java/com/casic/br/operationsite/model/LatestGasDataModel.kt deleted file mode 100644 index 5192f68..0000000 --- a/app/src/main/java/com/casic/br/operationsite/model/LatestGasDataModel.kt +++ /dev/null @@ -1,8 +0,0 @@ -package com.casic.br.operationsite.model - -data class LatestGasDataModel( - val deviceCode: String, - val gasUnit: String, - val gasValue: String, - val ts: String -) \ No newline at end of file diff --git a/app/src/main/java/com/casic/br/operationsite/model/MultiGasDataModel.kt b/app/src/main/java/com/casic/br/operationsite/model/MultiGasDataModel.kt deleted file mode 100644 index b61f78b..0000000 --- a/app/src/main/java/com/casic/br/operationsite/model/MultiGasDataModel.kt +++ /dev/null @@ -1,15 +0,0 @@ -package com.casic.br.operationsite.model - -data class MultiGasDataModel( - val bloodOxygen: String, - val coValue: String, - val deviceCode: String, - val deviceId: String, - val exValue: String, - val groupCode: String, - val h2sValue: String, - val o2Value: String, - val projectId: String, - val projectName: String, - val uploadTimestamp: String -) \ No newline at end of file diff --git a/app/src/main/java/com/casic/br/operationsite/model/WorkSiteDeviceModel.java b/app/src/main/java/com/casic/br/operationsite/model/WorkSiteDeviceModel.java index 8788e9e..dd11bc9 100644 --- a/app/src/main/java/com/casic/br/operationsite/model/WorkSiteDeviceModel.java +++ b/app/src/main/java/com/casic/br/operationsite/model/WorkSiteDeviceModel.java @@ -55,7 +55,7 @@ private String id; private String isPowerSupply; private String isPowerSupplyName; - private Object latestGasData; + private LatestGasDataModel latestGasData; private LatestLocationModel latestLocation; private String manufacturer; private String online; @@ -173,11 +173,11 @@ this.isPowerSupplyName = isPowerSupplyName; } - public Object getLatestGasData() { + public LatestGasDataModel getLatestGasData() { return latestGasData; } - public void setLatestGasData(Object latestGasData) { + public void setLatestGasData(LatestGasDataModel latestGasData) { this.latestGasData = latestGasData; } @@ -277,6 +277,45 @@ this.workerName = workerName; } + public static class LatestGasDataModel { + private String deviceCode; + private String gasUnit; + private String gasValue; + private String ts; + + public String getDeviceCode() { + return deviceCode; + } + + public void setDeviceCode(String deviceCode) { + this.deviceCode = deviceCode; + } + + public String getGasUnit() { + return gasUnit; + } + + public void setGasUnit(String gasUnit) { + this.gasUnit = gasUnit; + } + + public String getGasValue() { + return gasValue; + } + + public void setGasValue(String gasValue) { + this.gasValue = gasValue; + } + + public String getTs() { + return ts; + } + + public void setTs(String ts) { + this.ts = ts; + } + } + public static class LatestLocationModel { private String deviceCode; private String gdLat; diff --git a/app/src/main/java/com/casic/br/operationsite/model/WorkSiteWorkerModel.java b/app/src/main/java/com/casic/br/operationsite/model/WorkSiteWorkerModel.java index 09a1ba2..f8ba3d9 100644 --- a/app/src/main/java/com/casic/br/operationsite/model/WorkSiteWorkerModel.java +++ b/app/src/main/java/com/casic/br/operationsite/model/WorkSiteWorkerModel.java @@ -49,12 +49,12 @@ private String enterReason; private String gender; private String genderName; - private Object health; + private HealthModel health; private String id; private String idCardNumber; private String isRegister; - private Object location; - private Object multiGas; + private LocationModel location; + private MultiGasModel multiGas; private String ownerShip; private String phoneNumber; private String registerTime; @@ -121,11 +121,11 @@ this.genderName = genderName; } - public Object getHealth() { + public HealthModel getHealth() { return health; } - public void setHealth(Object health) { + public void setHealth(HealthModel health) { this.health = health; } @@ -153,19 +153,19 @@ this.isRegister = isRegister; } - public Object getLocation() { + public LocationModel getLocation() { return location; } - public void setLocation(Object location) { + public void setLocation(LocationModel location) { this.location = location; } - public Object getMultiGas() { + public MultiGasModel getMultiGas() { return multiGas; } - public void setMultiGas(Object multiGas) { + public void setMultiGas(MultiGasModel multiGas) { this.multiGas = multiGas; } @@ -240,5 +240,248 @@ public void setWorkerTypeName(String workerTypeName) { this.workerTypeName = workerTypeName; } + + public static class HealthModel { + private String bloodOxygen; + private String deviceCode; + private String deviceId; + private String groupCode; + private String heartRate; + private String projectId; + private String uploadTimestamp; + + public String getBloodOxygen() { + return bloodOxygen; + } + + public void setBloodOxygen(String bloodOxygen) { + this.bloodOxygen = bloodOxygen; + } + + public String getDeviceCode() { + return deviceCode; + } + + public void setDeviceCode(String deviceCode) { + this.deviceCode = deviceCode; + } + + public String getDeviceId() { + return deviceId; + } + + public void setDeviceId(String deviceId) { + this.deviceId = deviceId; + } + + public String getGroupCode() { + return groupCode; + } + + public void setGroupCode(String groupCode) { + this.groupCode = groupCode; + } + + public String getHeartRate() { + return heartRate; + } + + public void setHeartRate(String heartRate) { + this.heartRate = heartRate; + } + + public String getProjectId() { + return projectId; + } + + public void setProjectId(String projectId) { + this.projectId = projectId; + } + + public String getUploadTimestamp() { + return uploadTimestamp; + } + + public void setUploadTimestamp(String uploadTimestamp) { + this.uploadTimestamp = uploadTimestamp; + } + } + + public static class LocationModel { + private String deviceCode; + private String deviceId; + private String gdLat; + private String gdLng; + private String groupCode; + private String lat; + private String lng; + private String projectId; + private String uploadTimestamp; + + public String getDeviceCode() { + return deviceCode; + } + + public void setDeviceCode(String deviceCode) { + this.deviceCode = deviceCode; + } + + public String getDeviceId() { + return deviceId; + } + + public void setDeviceId(String deviceId) { + this.deviceId = deviceId; + } + + public String getGdLat() { + return gdLat; + } + + public void setGdLat(String gdLat) { + this.gdLat = gdLat; + } + + public String getGdLng() { + return gdLng; + } + + public void setGdLng(String gdLng) { + this.gdLng = gdLng; + } + + public String getGroupCode() { + return groupCode; + } + + public void setGroupCode(String groupCode) { + this.groupCode = groupCode; + } + + public String getLat() { + return lat; + } + + public void setLat(String lat) { + this.lat = lat; + } + + public String getLng() { + return lng; + } + + public void setLng(String lng) { + this.lng = lng; + } + + public String getProjectId() { + return projectId; + } + + public void setProjectId(String projectId) { + this.projectId = projectId; + } + + public String getUploadTimestamp() { + return uploadTimestamp; + } + + public void setUploadTimestamp(String uploadTimestamp) { + this.uploadTimestamp = uploadTimestamp; + } + } + + public static class MultiGasModel { + private String coValue; + private String deviceCode; + private String deviceId; + private String exValue; + private String groupCode; + private String h2sValue; + private String o2Value; + private String projectId; + private String projectName; + private String uploadTimestamp; + + public String getCoValue() { + return coValue; + } + + public void setCoValue(String coValue) { + this.coValue = coValue; + } + + public String getDeviceCode() { + return deviceCode; + } + + public void setDeviceCode(String deviceCode) { + this.deviceCode = deviceCode; + } + + public String getDeviceId() { + return deviceId; + } + + public void setDeviceId(String deviceId) { + this.deviceId = deviceId; + } + + public String getExValue() { + return exValue; + } + + public void setExValue(String exValue) { + this.exValue = exValue; + } + + public String getGroupCode() { + return groupCode; + } + + public void setGroupCode(String groupCode) { + this.groupCode = groupCode; + } + + public String getH2sValue() { + return h2sValue; + } + + public void setH2sValue(String h2sValue) { + this.h2sValue = h2sValue; + } + + public String getO2Value() { + return o2Value; + } + + public void setO2Value(String o2Value) { + this.o2Value = o2Value; + } + + public String getProjectId() { + return projectId; + } + + public void setProjectId(String projectId) { + this.projectId = projectId; + } + + public String getProjectName() { + return projectName; + } + + public void setProjectName(String projectName) { + this.projectName = projectName; + } + + public String getUploadTimestamp() { + return uploadTimestamp; + } + + public void setUploadTimestamp(String uploadTimestamp) { + this.uploadTimestamp = uploadTimestamp; + } + } } } diff --git a/app/src/main/java/com/casic/br/operationsite/model/WorkerHealthModel.kt b/app/src/main/java/com/casic/br/operationsite/model/WorkerHealthModel.kt deleted file mode 100644 index 7232e3d..0000000 --- a/app/src/main/java/com/casic/br/operationsite/model/WorkerHealthModel.kt +++ /dev/null @@ -1,11 +0,0 @@ -package com.casic.br.operationsite.model - -data class WorkerHealthModel( - val bloodOxygen: String, - val deviceCode: String, - val deviceId: String, - val groupCode: String, - val heartRate: String, - val projectId: String, - val uploadTimestamp: String -) \ No newline at end of file diff --git a/app/src/main/java/com/casic/br/operationsite/model/LatestGasDataModel.kt b/app/src/main/java/com/casic/br/operationsite/model/LatestGasDataModel.kt deleted file mode 100644 index 5192f68..0000000 --- a/app/src/main/java/com/casic/br/operationsite/model/LatestGasDataModel.kt +++ /dev/null @@ -1,8 +0,0 @@ -package com.casic.br.operationsite.model - -data class LatestGasDataModel( - val deviceCode: String, - val gasUnit: String, - val gasValue: String, - val ts: String -) \ No newline at end of file diff --git a/app/src/main/java/com/casic/br/operationsite/model/MultiGasDataModel.kt b/app/src/main/java/com/casic/br/operationsite/model/MultiGasDataModel.kt deleted file mode 100644 index b61f78b..0000000 --- a/app/src/main/java/com/casic/br/operationsite/model/MultiGasDataModel.kt +++ /dev/null @@ -1,15 +0,0 @@ -package com.casic.br.operationsite.model - -data class MultiGasDataModel( - val bloodOxygen: String, - val coValue: String, - val deviceCode: String, - val deviceId: String, - val exValue: String, - val groupCode: String, - val h2sValue: String, - val o2Value: String, - val projectId: String, - val projectName: String, - val uploadTimestamp: String -) \ No newline at end of file diff --git a/app/src/main/java/com/casic/br/operationsite/model/WorkSiteDeviceModel.java b/app/src/main/java/com/casic/br/operationsite/model/WorkSiteDeviceModel.java index 8788e9e..dd11bc9 100644 --- a/app/src/main/java/com/casic/br/operationsite/model/WorkSiteDeviceModel.java +++ b/app/src/main/java/com/casic/br/operationsite/model/WorkSiteDeviceModel.java @@ -55,7 +55,7 @@ private String id; private String isPowerSupply; private String isPowerSupplyName; - private Object latestGasData; + private LatestGasDataModel latestGasData; private LatestLocationModel latestLocation; private String manufacturer; private String online; @@ -173,11 +173,11 @@ this.isPowerSupplyName = isPowerSupplyName; } - public Object getLatestGasData() { + public LatestGasDataModel getLatestGasData() { return latestGasData; } - public void setLatestGasData(Object latestGasData) { + public void setLatestGasData(LatestGasDataModel latestGasData) { this.latestGasData = latestGasData; } @@ -277,6 +277,45 @@ this.workerName = workerName; } + public static class LatestGasDataModel { + private String deviceCode; + private String gasUnit; + private String gasValue; + private String ts; + + public String getDeviceCode() { + return deviceCode; + } + + public void setDeviceCode(String deviceCode) { + this.deviceCode = deviceCode; + } + + public String getGasUnit() { + return gasUnit; + } + + public void setGasUnit(String gasUnit) { + this.gasUnit = gasUnit; + } + + public String getGasValue() { + return gasValue; + } + + public void setGasValue(String gasValue) { + this.gasValue = gasValue; + } + + public String getTs() { + return ts; + } + + public void setTs(String ts) { + this.ts = ts; + } + } + public static class LatestLocationModel { private String deviceCode; private String gdLat; diff --git a/app/src/main/java/com/casic/br/operationsite/model/WorkSiteWorkerModel.java b/app/src/main/java/com/casic/br/operationsite/model/WorkSiteWorkerModel.java index 09a1ba2..f8ba3d9 100644 --- a/app/src/main/java/com/casic/br/operationsite/model/WorkSiteWorkerModel.java +++ b/app/src/main/java/com/casic/br/operationsite/model/WorkSiteWorkerModel.java @@ -49,12 +49,12 @@ private String enterReason; private String gender; private String genderName; - private Object health; + private HealthModel health; private String id; private String idCardNumber; private String isRegister; - private Object location; - private Object multiGas; + private LocationModel location; + private MultiGasModel multiGas; private String ownerShip; private String phoneNumber; private String registerTime; @@ -121,11 +121,11 @@ this.genderName = genderName; } - public Object getHealth() { + public HealthModel getHealth() { return health; } - public void setHealth(Object health) { + public void setHealth(HealthModel health) { this.health = health; } @@ -153,19 +153,19 @@ this.isRegister = isRegister; } - public Object getLocation() { + public LocationModel getLocation() { return location; } - public void setLocation(Object location) { + public void setLocation(LocationModel location) { this.location = location; } - public Object getMultiGas() { + public MultiGasModel getMultiGas() { return multiGas; } - public void setMultiGas(Object multiGas) { + public void setMultiGas(MultiGasModel multiGas) { this.multiGas = multiGas; } @@ -240,5 +240,248 @@ public void setWorkerTypeName(String workerTypeName) { this.workerTypeName = workerTypeName; } + + public static class HealthModel { + private String bloodOxygen; + private String deviceCode; + private String deviceId; + private String groupCode; + private String heartRate; + private String projectId; + private String uploadTimestamp; + + public String getBloodOxygen() { + return bloodOxygen; + } + + public void setBloodOxygen(String bloodOxygen) { + this.bloodOxygen = bloodOxygen; + } + + public String getDeviceCode() { + return deviceCode; + } + + public void setDeviceCode(String deviceCode) { + this.deviceCode = deviceCode; + } + + public String getDeviceId() { + return deviceId; + } + + public void setDeviceId(String deviceId) { + this.deviceId = deviceId; + } + + public String getGroupCode() { + return groupCode; + } + + public void setGroupCode(String groupCode) { + this.groupCode = groupCode; + } + + public String getHeartRate() { + return heartRate; + } + + public void setHeartRate(String heartRate) { + this.heartRate = heartRate; + } + + public String getProjectId() { + return projectId; + } + + public void setProjectId(String projectId) { + this.projectId = projectId; + } + + public String getUploadTimestamp() { + return uploadTimestamp; + } + + public void setUploadTimestamp(String uploadTimestamp) { + this.uploadTimestamp = uploadTimestamp; + } + } + + public static class LocationModel { + private String deviceCode; + private String deviceId; + private String gdLat; + private String gdLng; + private String groupCode; + private String lat; + private String lng; + private String projectId; + private String uploadTimestamp; + + public String getDeviceCode() { + return deviceCode; + } + + public void setDeviceCode(String deviceCode) { + this.deviceCode = deviceCode; + } + + public String getDeviceId() { + return deviceId; + } + + public void setDeviceId(String deviceId) { + this.deviceId = deviceId; + } + + public String getGdLat() { + return gdLat; + } + + public void setGdLat(String gdLat) { + this.gdLat = gdLat; + } + + public String getGdLng() { + return gdLng; + } + + public void setGdLng(String gdLng) { + this.gdLng = gdLng; + } + + public String getGroupCode() { + return groupCode; + } + + public void setGroupCode(String groupCode) { + this.groupCode = groupCode; + } + + public String getLat() { + return lat; + } + + public void setLat(String lat) { + this.lat = lat; + } + + public String getLng() { + return lng; + } + + public void setLng(String lng) { + this.lng = lng; + } + + public String getProjectId() { + return projectId; + } + + public void setProjectId(String projectId) { + this.projectId = projectId; + } + + public String getUploadTimestamp() { + return uploadTimestamp; + } + + public void setUploadTimestamp(String uploadTimestamp) { + this.uploadTimestamp = uploadTimestamp; + } + } + + public static class MultiGasModel { + private String coValue; + private String deviceCode; + private String deviceId; + private String exValue; + private String groupCode; + private String h2sValue; + private String o2Value; + private String projectId; + private String projectName; + private String uploadTimestamp; + + public String getCoValue() { + return coValue; + } + + public void setCoValue(String coValue) { + this.coValue = coValue; + } + + public String getDeviceCode() { + return deviceCode; + } + + public void setDeviceCode(String deviceCode) { + this.deviceCode = deviceCode; + } + + public String getDeviceId() { + return deviceId; + } + + public void setDeviceId(String deviceId) { + this.deviceId = deviceId; + } + + public String getExValue() { + return exValue; + } + + public void setExValue(String exValue) { + this.exValue = exValue; + } + + public String getGroupCode() { + return groupCode; + } + + public void setGroupCode(String groupCode) { + this.groupCode = groupCode; + } + + public String getH2sValue() { + return h2sValue; + } + + public void setH2sValue(String h2sValue) { + this.h2sValue = h2sValue; + } + + public String getO2Value() { + return o2Value; + } + + public void setO2Value(String o2Value) { + this.o2Value = o2Value; + } + + public String getProjectId() { + return projectId; + } + + public void setProjectId(String projectId) { + this.projectId = projectId; + } + + public String getProjectName() { + return projectName; + } + + public void setProjectName(String projectName) { + this.projectName = projectName; + } + + public String getUploadTimestamp() { + return uploadTimestamp; + } + + public void setUploadTimestamp(String uploadTimestamp) { + this.uploadTimestamp = uploadTimestamp; + } + } } } diff --git a/app/src/main/java/com/casic/br/operationsite/model/WorkerHealthModel.kt b/app/src/main/java/com/casic/br/operationsite/model/WorkerHealthModel.kt deleted file mode 100644 index 7232e3d..0000000 --- a/app/src/main/java/com/casic/br/operationsite/model/WorkerHealthModel.kt +++ /dev/null @@ -1,11 +0,0 @@ -package com.casic.br.operationsite.model - -data class WorkerHealthModel( - val bloodOxygen: String, - val deviceCode: String, - val deviceId: String, - val groupCode: String, - val heartRate: String, - val projectId: String, - val uploadTimestamp: String -) \ No newline at end of file diff --git a/app/src/main/java/com/casic/br/operationsite/model/WorkerPositionModel.kt b/app/src/main/java/com/casic/br/operationsite/model/WorkerPositionModel.kt deleted file mode 100644 index 5381988..0000000 --- a/app/src/main/java/com/casic/br/operationsite/model/WorkerPositionModel.kt +++ /dev/null @@ -1,13 +0,0 @@ -package com.casic.br.operationsite.model - -data class WorkerPositionModel( - val deviceCode: String, - val deviceId: String, - val gdLat: String, - val gdLng: String, - val groupCode: String, - val lat: String, - val lng: String, - val projectId: String, - val uploadTimestamp: String -) \ No newline at end of file diff --git a/app/src/main/java/com/casic/br/operationsite/model/LatestGasDataModel.kt b/app/src/main/java/com/casic/br/operationsite/model/LatestGasDataModel.kt deleted file mode 100644 index 5192f68..0000000 --- a/app/src/main/java/com/casic/br/operationsite/model/LatestGasDataModel.kt +++ /dev/null @@ -1,8 +0,0 @@ -package com.casic.br.operationsite.model - -data class LatestGasDataModel( - val deviceCode: String, - val gasUnit: String, - val gasValue: String, - val ts: String -) \ No newline at end of file diff --git a/app/src/main/java/com/casic/br/operationsite/model/MultiGasDataModel.kt b/app/src/main/java/com/casic/br/operationsite/model/MultiGasDataModel.kt deleted file mode 100644 index b61f78b..0000000 --- a/app/src/main/java/com/casic/br/operationsite/model/MultiGasDataModel.kt +++ /dev/null @@ -1,15 +0,0 @@ -package com.casic.br.operationsite.model - -data class MultiGasDataModel( - val bloodOxygen: String, - val coValue: String, - val deviceCode: String, - val deviceId: String, - val exValue: String, - val groupCode: String, - val h2sValue: String, - val o2Value: String, - val projectId: String, - val projectName: String, - val uploadTimestamp: String -) \ No newline at end of file diff --git a/app/src/main/java/com/casic/br/operationsite/model/WorkSiteDeviceModel.java b/app/src/main/java/com/casic/br/operationsite/model/WorkSiteDeviceModel.java index 8788e9e..dd11bc9 100644 --- a/app/src/main/java/com/casic/br/operationsite/model/WorkSiteDeviceModel.java +++ b/app/src/main/java/com/casic/br/operationsite/model/WorkSiteDeviceModel.java @@ -55,7 +55,7 @@ private String id; private String isPowerSupply; private String isPowerSupplyName; - private Object latestGasData; + private LatestGasDataModel latestGasData; private LatestLocationModel latestLocation; private String manufacturer; private String online; @@ -173,11 +173,11 @@ this.isPowerSupplyName = isPowerSupplyName; } - public Object getLatestGasData() { + public LatestGasDataModel getLatestGasData() { return latestGasData; } - public void setLatestGasData(Object latestGasData) { + public void setLatestGasData(LatestGasDataModel latestGasData) { this.latestGasData = latestGasData; } @@ -277,6 +277,45 @@ this.workerName = workerName; } + public static class LatestGasDataModel { + private String deviceCode; + private String gasUnit; + private String gasValue; + private String ts; + + public String getDeviceCode() { + return deviceCode; + } + + public void setDeviceCode(String deviceCode) { + this.deviceCode = deviceCode; + } + + public String getGasUnit() { + return gasUnit; + } + + public void setGasUnit(String gasUnit) { + this.gasUnit = gasUnit; + } + + public String getGasValue() { + return gasValue; + } + + public void setGasValue(String gasValue) { + this.gasValue = gasValue; + } + + public String getTs() { + return ts; + } + + public void setTs(String ts) { + this.ts = ts; + } + } + public static class LatestLocationModel { private String deviceCode; private String gdLat; diff --git a/app/src/main/java/com/casic/br/operationsite/model/WorkSiteWorkerModel.java b/app/src/main/java/com/casic/br/operationsite/model/WorkSiteWorkerModel.java index 09a1ba2..f8ba3d9 100644 --- a/app/src/main/java/com/casic/br/operationsite/model/WorkSiteWorkerModel.java +++ b/app/src/main/java/com/casic/br/operationsite/model/WorkSiteWorkerModel.java @@ -49,12 +49,12 @@ private String enterReason; private String gender; private String genderName; - private Object health; + private HealthModel health; private String id; private String idCardNumber; private String isRegister; - private Object location; - private Object multiGas; + private LocationModel location; + private MultiGasModel multiGas; private String ownerShip; private String phoneNumber; private String registerTime; @@ -121,11 +121,11 @@ this.genderName = genderName; } - public Object getHealth() { + public HealthModel getHealth() { return health; } - public void setHealth(Object health) { + public void setHealth(HealthModel health) { this.health = health; } @@ -153,19 +153,19 @@ this.isRegister = isRegister; } - public Object getLocation() { + public LocationModel getLocation() { return location; } - public void setLocation(Object location) { + public void setLocation(LocationModel location) { this.location = location; } - public Object getMultiGas() { + public MultiGasModel getMultiGas() { return multiGas; } - public void setMultiGas(Object multiGas) { + public void setMultiGas(MultiGasModel multiGas) { this.multiGas = multiGas; } @@ -240,5 +240,248 @@ public void setWorkerTypeName(String workerTypeName) { this.workerTypeName = workerTypeName; } + + public static class HealthModel { + private String bloodOxygen; + private String deviceCode; + private String deviceId; + private String groupCode; + private String heartRate; + private String projectId; + private String uploadTimestamp; + + public String getBloodOxygen() { + return bloodOxygen; + } + + public void setBloodOxygen(String bloodOxygen) { + this.bloodOxygen = bloodOxygen; + } + + public String getDeviceCode() { + return deviceCode; + } + + public void setDeviceCode(String deviceCode) { + this.deviceCode = deviceCode; + } + + public String getDeviceId() { + return deviceId; + } + + public void setDeviceId(String deviceId) { + this.deviceId = deviceId; + } + + public String getGroupCode() { + return groupCode; + } + + public void setGroupCode(String groupCode) { + this.groupCode = groupCode; + } + + public String getHeartRate() { + return heartRate; + } + + public void setHeartRate(String heartRate) { + this.heartRate = heartRate; + } + + public String getProjectId() { + return projectId; + } + + public void setProjectId(String projectId) { + this.projectId = projectId; + } + + public String getUploadTimestamp() { + return uploadTimestamp; + } + + public void setUploadTimestamp(String uploadTimestamp) { + this.uploadTimestamp = uploadTimestamp; + } + } + + public static class LocationModel { + private String deviceCode; + private String deviceId; + private String gdLat; + private String gdLng; + private String groupCode; + private String lat; + private String lng; + private String projectId; + private String uploadTimestamp; + + public String getDeviceCode() { + return deviceCode; + } + + public void setDeviceCode(String deviceCode) { + this.deviceCode = deviceCode; + } + + public String getDeviceId() { + return deviceId; + } + + public void setDeviceId(String deviceId) { + this.deviceId = deviceId; + } + + public String getGdLat() { + return gdLat; + } + + public void setGdLat(String gdLat) { + this.gdLat = gdLat; + } + + public String getGdLng() { + return gdLng; + } + + public void setGdLng(String gdLng) { + this.gdLng = gdLng; + } + + public String getGroupCode() { + return groupCode; + } + + public void setGroupCode(String groupCode) { + this.groupCode = groupCode; + } + + public String getLat() { + return lat; + } + + public void setLat(String lat) { + this.lat = lat; + } + + public String getLng() { + return lng; + } + + public void setLng(String lng) { + this.lng = lng; + } + + public String getProjectId() { + return projectId; + } + + public void setProjectId(String projectId) { + this.projectId = projectId; + } + + public String getUploadTimestamp() { + return uploadTimestamp; + } + + public void setUploadTimestamp(String uploadTimestamp) { + this.uploadTimestamp = uploadTimestamp; + } + } + + public static class MultiGasModel { + private String coValue; + private String deviceCode; + private String deviceId; + private String exValue; + private String groupCode; + private String h2sValue; + private String o2Value; + private String projectId; + private String projectName; + private String uploadTimestamp; + + public String getCoValue() { + return coValue; + } + + public void setCoValue(String coValue) { + this.coValue = coValue; + } + + public String getDeviceCode() { + return deviceCode; + } + + public void setDeviceCode(String deviceCode) { + this.deviceCode = deviceCode; + } + + public String getDeviceId() { + return deviceId; + } + + public void setDeviceId(String deviceId) { + this.deviceId = deviceId; + } + + public String getExValue() { + return exValue; + } + + public void setExValue(String exValue) { + this.exValue = exValue; + } + + public String getGroupCode() { + return groupCode; + } + + public void setGroupCode(String groupCode) { + this.groupCode = groupCode; + } + + public String getH2sValue() { + return h2sValue; + } + + public void setH2sValue(String h2sValue) { + this.h2sValue = h2sValue; + } + + public String getO2Value() { + return o2Value; + } + + public void setO2Value(String o2Value) { + this.o2Value = o2Value; + } + + public String getProjectId() { + return projectId; + } + + public void setProjectId(String projectId) { + this.projectId = projectId; + } + + public String getProjectName() { + return projectName; + } + + public void setProjectName(String projectName) { + this.projectName = projectName; + } + + public String getUploadTimestamp() { + return uploadTimestamp; + } + + public void setUploadTimestamp(String uploadTimestamp) { + this.uploadTimestamp = uploadTimestamp; + } + } } } diff --git a/app/src/main/java/com/casic/br/operationsite/model/WorkerHealthModel.kt b/app/src/main/java/com/casic/br/operationsite/model/WorkerHealthModel.kt deleted file mode 100644 index 7232e3d..0000000 --- a/app/src/main/java/com/casic/br/operationsite/model/WorkerHealthModel.kt +++ /dev/null @@ -1,11 +0,0 @@ -package com.casic.br.operationsite.model - -data class WorkerHealthModel( - val bloodOxygen: String, - val deviceCode: String, - val deviceId: String, - val groupCode: String, - val heartRate: String, - val projectId: String, - val uploadTimestamp: String -) \ No newline at end of file diff --git a/app/src/main/java/com/casic/br/operationsite/model/WorkerPositionModel.kt b/app/src/main/java/com/casic/br/operationsite/model/WorkerPositionModel.kt deleted file mode 100644 index 5381988..0000000 --- a/app/src/main/java/com/casic/br/operationsite/model/WorkerPositionModel.kt +++ /dev/null @@ -1,13 +0,0 @@ -package com.casic.br.operationsite.model - -data class WorkerPositionModel( - val deviceCode: String, - val deviceId: String, - val gdLat: String, - val gdLng: String, - val groupCode: String, - val lat: String, - val lng: String, - val projectId: String, - val uploadTimestamp: String -) \ No newline at end of file diff --git a/app/src/main/java/com/casic/br/operationsite/view/WorkSiteTabActivity.kt b/app/src/main/java/com/casic/br/operationsite/view/WorkSiteTabActivity.kt index f843778..ac0964f 100644 --- a/app/src/main/java/com/casic/br/operationsite/view/WorkSiteTabActivity.kt +++ b/app/src/main/java/com/casic/br/operationsite/view/WorkSiteTabActivity.kt @@ -3,7 +3,6 @@ import android.annotation.SuppressLint import android.graphics.Color import android.os.Bundle -import android.util.Log import android.view.LayoutInflater import android.view.View import android.widget.TextView @@ -19,22 +18,16 @@ import com.casic.br.operationsite.R import com.casic.br.operationsite.databinding.ActivitySiteTabBinding import com.casic.br.operationsite.extensions.initImmersionBar -import com.casic.br.operationsite.model.LatestGasDataModel -import com.casic.br.operationsite.model.MultiGasDataModel import com.casic.br.operationsite.model.WorkSiteDeviceModel import com.casic.br.operationsite.model.WorkSiteWorkerModel -import com.casic.br.operationsite.model.WorkerHealthModel -import com.casic.br.operationsite.model.WorkerPositionModel import com.casic.br.operationsite.utils.AuthenticationHelper import com.casic.br.operationsite.utils.RuntimeCache import com.casic.br.operationsite.vm.LoginViewModel import com.casic.br.operationsite.vm.WorkSiteViewModel import com.google.android.material.bottomsheet.BottomSheetBehavior import com.google.gson.Gson -import com.google.gson.reflect.TypeToken import com.pengxh.kt.lite.base.KotlinBaseActivity import com.pengxh.kt.lite.extensions.navigatePageTo -import com.pengxh.kt.lite.extensions.timestampToCompleteDate import com.pengxh.kt.lite.utils.ActivityStackManager import com.pengxh.kt.lite.utils.LoadState import com.pengxh.kt.lite.utils.LoadingDialog @@ -211,17 +204,7 @@ if (it.code == 200) { val allMarkerOptions = ArrayList() it.data.forEach { worker -> - val locationObject = worker.location - if (locationObject == "") { - Log.e(kTag, "initOnCreate: worker's location is empty") - return@observe - } - - val typeToken = object : TypeToken() {}.type - val position = gson.fromJson( - locationObject.toString(), typeToken - ) - + val position = worker.location if (position.gdLat.isNotBlank() && position.gdLng.isNotBlank()) { val latitude = position.gdLat.toDouble() val longitude = position.gdLng.toDouble() @@ -283,13 +266,7 @@ return true } - val gasObject = deviceData.latestGasData - if (gasObject == "") { - Log.e(kTag, "onMarkerClick: latestGasData is empty") - return true - } - val typeToken = object : TypeToken() {}.type - val gas = gson.fromJson(gasObject.toString(), typeToken) + val gas = deviceData.latestGasData binding.deviceTypeView.text = deviceData.deviceTypeName binding.deviceStateView.text = deviceData.onlineName @@ -348,16 +325,11 @@ return } - val gasObject = deviceData.latestGasData - if (gasObject == "") { - Log.e(kTag, "renderSafetyTreeWindow: latestGasData is empty") - return - } - val typeToken = object : TypeToken() {}.type - val gas = gson.fromJson(gasObject.toString(), typeToken) + val gas = deviceData.latestGasData + deviceNameView.text = "安全树设备编号:${deviceData.deviceCode}" alarmValueView.text = "最新甲烷浓度:${gas.gasValue} ${gas.gasUnit}" - timeView.text = "数据更新时间:${gas.ts.toLong().timestampToCompleteDate()}" + timeView.text = "数据更新时间:${gas.ts}" } private fun renderWorkerWindow(marker: Marker, view: View) { @@ -376,34 +348,19 @@ return } - val healthObject = worker.health - if (healthObject == "") { - Log.e(kTag, "renderWorkerWindow: worker's health data is empty") - return - } - val health = gson.fromJson( - healthObject.toString(), object : TypeToken() {}.type - ) - userHelmetCode = marker.options.snippet + val health = worker.health workerNameView.text = "名称:${worker.workerName}" heartRateView.text = "心率:${health.heartRate}bpm" bloodOxygenView.text = "血氧:${health.bloodOxygen}%" - val multiGasObject = worker.multiGas - if (multiGasObject == "") { - Log.e(kTag, "renderWorkerWindow: multiGas data is empty") - return - } - val multiGas = gson.fromJson( - healthObject.toString(), object : TypeToken() {}.type - ) + val multiGas = worker.multiGas coValueView.text = "一氧化碳:${multiGas.coValue}ppm" gasValueView.text = "甲烷:${multiGas.exValue}%LEL" h2sValueView.text = "硫化氢:${multiGas.h2sValue}ppm" o2ValueView.text = "氧气:${multiGas.o2Value}%VOL" - timeView.text = "时间:${multiGas.uploadTimestamp.toLong().timestampToCompleteDate()}" + timeView.text = "时间:${multiGas.uploadTimestamp}" } override fun onInfoWindowClick(marker: Marker?) {