完善养殖端小程序

This commit is contained in:
xuqiuyun
2025-09-23 18:13:11 +08:00
parent bdc1b29934
commit e7a0cd4aa3
58 changed files with 12773 additions and 1228 deletions

View File

@@ -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;