forked from dyf/fys-Multi-tenant
首页数据
This commit is contained in:
@ -162,7 +162,7 @@ public class Device extends TenantEntity {
|
||||
private Date productionDate;
|
||||
|
||||
/**
|
||||
* 在线状态(0离线,1在线)
|
||||
* 在线状态(0离线,1在线,2异常)
|
||||
*/
|
||||
private Integer onlineStatus;
|
||||
}
|
||||
|
||||
@ -36,8 +36,10 @@ public class DeviceAlarm extends TenantEntity {
|
||||
|
||||
/**
|
||||
* 报警事项
|
||||
* 0-强制报警,1-撞击闯入,2-手动报警,3-电子围栏告警,4-强制告警
|
||||
* device_action
|
||||
*/
|
||||
private String deviceAction;
|
||||
private Integer deviceAction;
|
||||
|
||||
/**
|
||||
* 设备名称
|
||||
@ -92,6 +94,7 @@ public class DeviceAlarm extends TenantEntity {
|
||||
|
||||
/**
|
||||
* 0已处理,1未处理
|
||||
* treatment_state
|
||||
*/
|
||||
private Long treatmentState;
|
||||
|
||||
|
||||
@ -59,7 +59,7 @@ public class DeviceType extends TenantEntity {
|
||||
@Schema(title = "联网方式", example = "0:无;1:4G;2:WIFI")
|
||||
private String networkWay;
|
||||
|
||||
@Schema(title = "通讯方式", example = "0:4G;1:蓝牙")
|
||||
@Schema(title = "通讯方式", example = "0:4G;1:蓝牙,2 4G&蓝牙")
|
||||
private String communicationMode;
|
||||
|
||||
/**
|
||||
|
||||
@ -6,13 +6,12 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fuyuanshen.equipment.domain.Device;
|
||||
import com.fuyuanshen.equipment.domain.dto.InstructionRecordDto;
|
||||
import com.fuyuanshen.equipment.domain.query.DeviceQueryCriteria;
|
||||
import com.fuyuanshen.equipment.domain.vo.AppDeviceVo;
|
||||
import com.fuyuanshen.equipment.domain.vo.LocationHistoryVo;
|
||||
import com.fuyuanshen.equipment.domain.vo.WebDeviceVo;
|
||||
import com.fuyuanshen.equipment.domain.vo.*;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
@ -72,7 +71,42 @@ public interface DeviceMapper extends BaseMapper<Device> {
|
||||
|
||||
AppDeviceVo getDeviceInfo(@Param("deviceMac") String deviceMac);
|
||||
|
||||
Page<WebDeviceVo> queryWebDeviceList(Page<Object> build,@Param("criteria") DeviceQueryCriteria criteria);
|
||||
Page<WebDeviceVo> queryWebDeviceList(Page<Object> build, @Param("criteria") DeviceQueryCriteria criteria);
|
||||
|
||||
Page<LocationHistoryVo> getLocationHistory(Page<Object> build, @Param("bo") InstructionRecordDto criteria);
|
||||
|
||||
/**
|
||||
* 获取数据总览
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
DataOverviewVo getDataOverview();
|
||||
|
||||
/**
|
||||
* 获取设备分类
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
EquipmentClassificationVo getEquipmentClassification();
|
||||
|
||||
/**
|
||||
* 获取告警信息
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
AlarmInformationVo getAlarmInformation();
|
||||
|
||||
/**
|
||||
* 获取设备使用数据
|
||||
*
|
||||
* @param deviceId 设备ID
|
||||
* @param range 时间范围 1:半年 2:一年
|
||||
* @return 每月使用数据列表
|
||||
*/
|
||||
List<Map<String, Object>> getEquipmentUsageData(Long deviceId, Integer range);
|
||||
|
||||
// 在DeviceMapper.java中添加方法
|
||||
int getUsageDataForMonth(@Param("deviceId") Long deviceId,
|
||||
@Param("year") int year,
|
||||
@Param("month") int month);
|
||||
}
|
||||
|
||||
@ -9,12 +9,11 @@ import com.fuyuanshen.equipment.domain.Device;
|
||||
import com.fuyuanshen.equipment.domain.dto.AppDeviceBo;
|
||||
import com.fuyuanshen.equipment.domain.form.DeviceForm;
|
||||
import com.fuyuanshen.equipment.domain.query.DeviceQueryCriteria;
|
||||
import com.fuyuanshen.equipment.domain.vo.AppDeviceVo;
|
||||
import com.fuyuanshen.equipment.domain.vo.CustomerVo;
|
||||
import com.fuyuanshen.equipment.domain.vo.DataOverviewVo;
|
||||
import com.fuyuanshen.equipment.domain.vo.*;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
@ -122,4 +121,27 @@ public interface DeviceService extends IService<Device> {
|
||||
* @return
|
||||
*/
|
||||
DataOverviewVo getDataOverview();
|
||||
|
||||
/**
|
||||
* 获取设备分类
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
EquipmentClassificationVo getEquipmentClassification();
|
||||
|
||||
/**
|
||||
* 获取告警信息
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
AlarmInformationVo getAlarmInformation();
|
||||
|
||||
/**
|
||||
* 获取设备使用数据
|
||||
*
|
||||
* @param deviceId
|
||||
* @param range
|
||||
* @return
|
||||
*/
|
||||
List<Map<String, Object>> getEquipmentUsageData(Long deviceId, Integer range);
|
||||
}
|
||||
|
||||
@ -28,9 +28,7 @@ import com.fuyuanshen.equipment.domain.form.DeviceForm;
|
||||
import com.fuyuanshen.equipment.domain.query.DeviceAssignmentQuery;
|
||||
import com.fuyuanshen.equipment.domain.query.DeviceQueryCriteria;
|
||||
import com.fuyuanshen.equipment.domain.query.DeviceTypeQueryCriteria;
|
||||
import com.fuyuanshen.equipment.domain.vo.AppDeviceVo;
|
||||
import com.fuyuanshen.equipment.domain.vo.CustomerVo;
|
||||
import com.fuyuanshen.equipment.domain.vo.DataOverviewVo;
|
||||
import com.fuyuanshen.equipment.domain.vo.*;
|
||||
import com.fuyuanshen.equipment.enums.BindingStatusEnum;
|
||||
import com.fuyuanshen.equipment.enums.CommunicationModeEnum;
|
||||
import com.fuyuanshen.equipment.enums.DeviceActiveStatusEnum;
|
||||
@ -53,11 +51,9 @@ import org.springframework.web.multipart.MultipartFile;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.sql.Timestamp;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
@ -596,8 +592,6 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询设备MAC号
|
||||
*
|
||||
@ -623,7 +617,46 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme
|
||||
*/
|
||||
@Override
|
||||
public DataOverviewVo getDataOverview() {
|
||||
return null;
|
||||
DataOverviewVo dataOverviewVo = deviceMapper.getDataOverview();
|
||||
return dataOverviewVo;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取设备分类
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public EquipmentClassificationVo getEquipmentClassification() {
|
||||
EquipmentClassificationVo equipmentClassification = deviceMapper.getEquipmentClassification();
|
||||
return equipmentClassification;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取告警信息
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AlarmInformationVo getAlarmInformation() {
|
||||
AlarmInformationVo alarmInformation = deviceMapper.getAlarmInformation();
|
||||
return alarmInformation;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取设备使用数据
|
||||
*
|
||||
* @param deviceId 设备ID
|
||||
* @param range 时间范围 1:半年 2:一年
|
||||
* @return 每月使用数据列表
|
||||
*/
|
||||
@Override
|
||||
public List<Map<String, Object>> getEquipmentUsageData(Long deviceId, Integer range) {
|
||||
List<Map<String, Object>> equipmentUsageData = deviceMapper.getEquipmentUsageData(deviceId, range);
|
||||
return equipmentUsageData;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user