package com.ycl.platform.domain.result.UY;
|
|
import com.ycl.platform.domain.result.BaseResult;
|
import com.ycl.platform.domain.vo.DataCenter.MonitorQualifyResultVO;
|
import lombok.Data;
|
import org.springframework.data.mongodb.core.index.TextIndexed;
|
import org.springframework.data.mongodb.core.mapping.Document;
|
|
@Data
|
@Document(collection = "uy_monitor_qualify")
|
public class MonitorQualifyResult extends BaseResult {
|
/**
|
* 行政编码
|
*/
|
private QualifyResult civilCode;
|
/**
|
* 是否集成设备
|
*/
|
private QualifyResult integrated_device;
|
/**
|
* IP地址
|
*/
|
@TextIndexed
|
private QualifyResult ip;
|
/**
|
* 监控点位类型
|
*/
|
private QualifyResult jkdwlx;
|
/**
|
* 纬度
|
*/
|
private QualifyResult latitude;
|
/**
|
* 经度
|
*/
|
private QualifyResult longitude;
|
/**
|
* mac地址
|
*/
|
private QualifyResult macdz;
|
/**
|
* 设备名
|
*/
|
@TextIndexed
|
private QualifyResult name;
|
/**
|
* 设备状态
|
*/
|
private QualifyResult sbzt;
|
/**
|
* 设备编码
|
*/
|
@TextIndexed
|
private QualifyResult serialNumber;
|
/**
|
* 摄像机采集区域
|
*/
|
private QualifyResult sxjcjqy;
|
/**
|
* 摄像机功能类型
|
*/
|
private QualifyResult sxjgnlx;
|
/**
|
* 租户id
|
*/
|
private QualifyResult tenantId;
|
|
@Data
|
public static class QualifyResult {
|
/**
|
* 是否错误 正常是false,ture表示有问题
|
*/
|
private Boolean error;
|
private String errorMessage;
|
/**
|
* 展示值
|
*/
|
@TextIndexed
|
private String showValue;
|
/**
|
* 数据原始值,如国标码等
|
*/
|
@TextIndexed
|
private String value;
|
}
|
|
//全对返ture
|
public static boolean correct(MonitorQualifyResult result) {
|
return checkError(result.getName()) &&
|
checkError(result.getCivilCode()) &&
|
checkError(result.getIp()) &&
|
checkError(result.getSerialNumber()) &&
|
checkError(result.getMacdz()) &&
|
checkError(result.getLatitude()) &&
|
checkError(result.getLongitude()) &&
|
checkError(result.getSbzt()) &&
|
checkError(result.getSxjcjqy()) &&
|
checkError(result.getSxjgnlx()) &&
|
checkError(result.getJkdwlx()) &&
|
checkError(result.getIntegrated_device())
|
;
|
}
|
|
//检查指标,正常返回true
|
public static boolean checkError(MonitorQualifyResult.QualifyResult result) {
|
return result.getError() != null && !result.getError();
|
}
|
|
public static MonitorQualifyResultVO getVO(MonitorQualifyResult result) {
|
MonitorQualifyResultVO vo = new MonitorQualifyResultVO();
|
vo.setCivilCode(result.getCivilCode().getShowValue());
|
vo.setCivilCodeError(result.getCivilCode().getError());
|
vo.setIp(result.getIp().getShowValue());
|
vo.setIpError(result.getIp().getError());
|
vo.setIntegratedDevice(result.getIntegrated_device().getShowValue());
|
vo.setIntegratedDeviceError(result.getIntegrated_device().getError());
|
vo.setJkdwlx(result.getJkdwlx().getShowValue());
|
vo.setJkdwlxError(result.getJkdwlx().getError());
|
vo.setLatitude(result.getLatitude().getShowValue());
|
vo.setLatitudeError(result.getLatitude().getError());
|
vo.setLongitude(result.getLongitude().getShowValue());
|
vo.setLongitudeError(result.getLongitude().getError());
|
vo.setMacdz(result.getMacdz().getShowValue());
|
vo.setMacdzError(result.getMacdz().getError());
|
vo.setName(result.getName().getShowValue());
|
vo.setNameError(result.getName().getError());
|
vo.setSbzt(result.getSbzt().getShowValue());
|
vo.setSbztError(result.getSbzt().getError());
|
vo.setSerialNumber(result.getSerialNumber().getShowValue());
|
vo.setSerialNumberError(result.getSerialNumber().getError());
|
vo.setSxjcjqy(result.getSxjcjqy().getShowValue());
|
vo.setSxjcjqyError(result.getSxjcjqy().getError());
|
vo.setSxjgnlx(result.getSxjgnlx().getShowValue());
|
vo.setSxjgnlxError(result.getSxjgnlx().getError());
|
if (result.getNewDevice()) {
|
vo.setNewDevice("是");
|
} else {
|
vo.setNewDevice("否");
|
}
|
return vo;
|
}
|
}
|