完善养殖端小程序
This commit is contained in:
@@ -45,7 +45,7 @@ exports.getCollarAlertStats = async (req, res) => {
|
||||
const dailySteps = totalSteps - yesterdaySteps;
|
||||
|
||||
// 离线预警
|
||||
if (device.state === 0) {
|
||||
if (device.is_connect === 0) {
|
||||
stats.offline++;
|
||||
stats.totalAlerts++;
|
||||
}
|
||||
@@ -191,8 +191,8 @@ exports.getCollarAlerts = async (req, res) => {
|
||||
alert.battery = actualBattery;
|
||||
alert.temperature = actualTemperature;
|
||||
alert.alertTime = alertTime;
|
||||
alert.deviceStatus = device.state === 1 ? '在线' : '离线';
|
||||
alert.gpsSignal = device.state === 1 ? '强' : '无';
|
||||
alert.deviceStatus = device.is_connect === 1 ? '在线' : '离线';
|
||||
alert.gpsSignal = device.is_connect === 1 ? '强' : '无';
|
||||
alert.wearStatus = device.bandge_status === 1 ? '已佩戴' : '未佩戴';
|
||||
alert.longitude = 116.3974 + (device.id % 100) * 0.0001;
|
||||
alert.latitude = 39.9093 + (device.id % 100) * 0.0001;
|
||||
@@ -200,7 +200,7 @@ exports.getCollarAlerts = async (req, res) => {
|
||||
};
|
||||
|
||||
// 离线预警
|
||||
if (device.state === 0) {
|
||||
if (device.is_connect === 0) {
|
||||
allAlerts.push(addBaseInfoToAlert({
|
||||
id: `${device.id}_offline`,
|
||||
alertType: 'offline',
|
||||
@@ -584,8 +584,8 @@ exports.exportCollarAlerts = async (req, res) => {
|
||||
alert.battery = actualBattery;
|
||||
alert.temperature = actualTemperature;
|
||||
alert.alertTime = alertTime;
|
||||
alert.deviceStatus = device.state === 1 ? '在线' : '离线';
|
||||
alert.gpsSignal = device.state === 1 ? '强' : '无';
|
||||
alert.deviceStatus = device.is_connect === 1 ? '在线' : '离线';
|
||||
alert.gpsSignal = device.is_connect === 1 ? '强' : '无';
|
||||
alert.wearStatus = device.bandge_status === 1 ? '已佩戴' : '未佩戴';
|
||||
alert.longitude = 116.3974 + (device.id % 100) * 0.0001;
|
||||
alert.latitude = 39.9093 + (device.id % 100) * 0.0001;
|
||||
|
||||
Reference in New Issue
Block a user