安防增加安防状态
This commit is contained in:
parent
e949f4ea20
commit
d37ea25372
@ -87,6 +87,7 @@ public class UploadedPhotosController extends BaseController {
|
||||
@RequestParam("cpuTemp") Double cpuTemp,
|
||||
@RequestParam("eventType") String eventType,
|
||||
@RequestParam("doorState") String doorState,
|
||||
@RequestParam("anFangStatus") String anFangStatus,
|
||||
@RequestParam("time") String time) {
|
||||
|
||||
if (photo.isEmpty()) {
|
||||
@ -111,7 +112,7 @@ public class UploadedPhotosController extends BaseController {
|
||||
//推送告警短信通知
|
||||
uploadedPhotosService.sendAlarmMessage(sn, doorState, shakeState,eventType);
|
||||
UploadedPhotos uploadedPhotos = new UploadedPhotos(
|
||||
null, fileName, monitorPath, imei, sn, latitude, longitude, temperature, doorState, shakeState,cpuTemp,eventType, date
|
||||
null, fileName, monitorPath, imei, sn, latitude, longitude, temperature, doorState, shakeState,cpuTemp,eventType,anFangStatus, date
|
||||
);
|
||||
return toAjax(uploadedPhotosService.insertUploadedPhotos(uploadedPhotos));
|
||||
} catch (IOException e) {
|
||||
@ -142,6 +143,7 @@ public class UploadedPhotosController extends BaseController {
|
||||
@RequestParam("doorState") String doorState,
|
||||
@RequestParam("cpuTemp") Double cpuTemp,
|
||||
@RequestParam("eventType") String eventType,
|
||||
@RequestParam("anFangStatus") String anFangStatus,
|
||||
@RequestParam("time") String time) {
|
||||
// 处理可能为空的字段
|
||||
Double latitude = isEmpty(lat) ? 0.0 : Double.valueOf(lat);
|
||||
@ -156,7 +158,7 @@ public class UploadedPhotosController extends BaseController {
|
||||
//推送告警短信通知
|
||||
uploadedPhotosService.sendAlarmMessage(sn, doorState, shakeState,eventType);
|
||||
UploadedPhotos uploadedPhotos = new UploadedPhotos(
|
||||
null, "", monitorPath, imei, sn, latitude, longitude, temperature, doorState, shakeState,cpuTemp,eventType, date
|
||||
null, "", monitorPath, imei, sn, latitude, longitude, temperature, doorState, shakeState,cpuTemp,eventType,anFangStatus, date
|
||||
);
|
||||
return toAjax(uploadedPhotosService.insertUploadedPhotos(uploadedPhotos));
|
||||
}
|
||||
|
@ -244,6 +244,12 @@ public class UploadedPhotosServiceImpl implements IUploadedPhotosService {
|
||||
} else if (Integer.parseInt(eventType) == 3) {
|
||||
temp.put("warnInfo", "箱门持续打开");
|
||||
notify = true;
|
||||
}else if(Integer.parseInt(eventType) == 4){
|
||||
temp.put("warnInfo", "开启布放");
|
||||
notify = true;
|
||||
}else if(Integer.parseInt(eventType) == 5){
|
||||
temp.put("warnInfo", "撤防");
|
||||
notify = true;
|
||||
}
|
||||
if (notify) {
|
||||
DeviceAlertUser deviceAlertUser = new DeviceAlertUser();
|
||||
@ -278,14 +284,25 @@ public class UploadedPhotosServiceImpl implements IUploadedPhotosService {
|
||||
}
|
||||
int doorState = 0;
|
||||
int shakeState = 0;
|
||||
int anFangStatus = 0;
|
||||
int eventType = doorAlertBto.getEventType();
|
||||
if (doorAlertBto.getEventType() > 0) {
|
||||
if (doorAlertBto.getEventType() == 1) {
|
||||
if (eventType == 1) {
|
||||
shakeState = doorAlertBto.getEventType();
|
||||
doorState = 0;
|
||||
} else if (doorAlertBto.getEventType() >= 2) {
|
||||
anFangStatus = 1;
|
||||
} else if (eventType == 2 || eventType == 3) {
|
||||
doorState = 1;
|
||||
shakeState = 0;
|
||||
anFangStatus = 1;
|
||||
}else if(eventType == 4 ){
|
||||
anFangStatus = 1;
|
||||
doorState = 0;
|
||||
shakeState = 0;
|
||||
}else if(eventType == 5){
|
||||
anFangStatus = 0;
|
||||
doorState = 0;
|
||||
shakeState = 0;
|
||||
}
|
||||
sendAlarmMessage(device.getSerialNumber(), doorState + "", shakeState + "", eventType + "");
|
||||
}
|
||||
@ -295,7 +312,7 @@ public class UploadedPhotosServiceImpl implements IUploadedPhotosService {
|
||||
null, "", monitorPath, "", device.getSerialNumber(),
|
||||
device.getLatitude() != null ? device.getLatitude().doubleValue() : 0d,
|
||||
device.getLongitude() != null ? device.getLatitude().doubleValue() : 0d,
|
||||
18.23d, doorState + "", shakeState + "", 32.3, doorAlertBto.getEventType().toString(), new Date()
|
||||
18.23d, doorState + "", shakeState + "", 32.3, doorAlertBto.getEventType().toString(),anFangStatus + "", new Date()
|
||||
);
|
||||
int count = insertUploadedPhotos(uploadedPhotos);
|
||||
if (count > 0) {
|
||||
|
@ -61,9 +61,11 @@ public class UploadedPhotos extends BaseEntity
|
||||
/** CPU温度 */
|
||||
@Excel(name = "CPU温度")
|
||||
private Double cpuTemp;
|
||||
/** 事件类型:1=振动,2=箱门打开,3=人员入侵 */
|
||||
/** 事件类型:1=振动,2=箱门打开,3=箱门持续打开 */
|
||||
@Excel(name = "事件类型")
|
||||
private String eventType;
|
||||
@Excel(name = "安防状态:1=布防, 0=撤防")
|
||||
private String anFangStatus;
|
||||
|
||||
/** 上传时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
|
@ -18,6 +18,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="uploadTime" column="upload_time" />
|
||||
<result property="eventType" column="event_type" />
|
||||
<result property="cpuTemp" column="cpu_temp" />
|
||||
<result property="anFangStatus" column="an_fang_status" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectUploadedPhotosVo">
|
||||
@ -38,6 +39,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="eventType != null and eventType != ''"> and event_type = #{eventType}</if>
|
||||
<if test="cpuTemp != null and cpuTemp != ''"> and cpu_temp = #{cpuTemp}</if>
|
||||
<if test="shakeState != null and shakeState != ''"> and shake_state = #{shakeState}</if>
|
||||
<if test="anFangStatus != null and anFangStatus != ''"> and an_fang_status = #{anFangStatus}</if>
|
||||
<if test="params.beginUploadTime != null and params.beginUploadTime != '' and params.endUploadTime != null and params.endUploadTime != ''"> and upload_time between #{params.beginUploadTime} and #{params.endUploadTime}</if>
|
||||
</where>
|
||||
order by id desc
|
||||
@ -63,6 +65,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="uploadTime != null">upload_time,</if>
|
||||
<if test="eventType != null">event_type,</if>
|
||||
<if test="cpuTemp != null">cpu_temp,</if>
|
||||
<if test="anFangStatus != null">an_fang_status,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="photoPath != null and photoPath != ''">#{photoPath},</if>
|
||||
@ -77,6 +80,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="uploadTime != null">#{uploadTime},</if>
|
||||
<if test="eventType != null">#{eventType},</if>
|
||||
<if test="cpuTemp != null">#{cpuTemp},</if>
|
||||
<if test="anFangStatus != null">#{anFangStatus},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
@ -95,6 +99,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="uploadTime != null">upload_time = #{uploadTime},</if>
|
||||
<if test="eventType != null">event_type = #{eventType},</if>
|
||||
<if test="cpuTemp != null">cpu_temp = #{cpuTemp},</if>
|
||||
<if test="anFangStatus != null">an_fang_status = #{anFangStatus},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
@ -114,6 +119,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="uploadTime != null">upload_time = #{uploadTime},</if>
|
||||
<if test="eventType != null">event_type = #{eventType},</if>
|
||||
<if test="cpuTemp != null">cpu_temp = #{cpuTemp},</if>
|
||||
<if test="anFangStatus != null">an_fang_status = #{anFangStatus},</if>
|
||||
</trim>
|
||||
where sn = #{sn} and upload_time = #{uploadTime}
|
||||
</update>
|
||||
|
Loading…
x
Reference in New Issue
Block a user