diff --git a/src/main/java/com/zhgd/netty/udp/UDPServerHandler.java b/src/main/java/com/zhgd/netty/udp/UDPServerHandler.java index 3cb8a3430..d4628e8a5 100644 --- a/src/main/java/com/zhgd/netty/udp/UDPServerHandler.java +++ b/src/main/java/com/zhgd/netty/udp/UDPServerHandler.java @@ -74,7 +74,7 @@ public class UDPServerHandler extends SimpleChannelInboundHandler queryById(@RequestParam(name = "id", required = true) String id) { Result result = new Result(); - FrontierProtectionNoNetData frontierProtectionNoNetData = frontierProtectionNoNetDataService.getById(id); - if (frontierProtectionNoNetData == null) { - result.error500("未找到对应实体"); - } else { - result.setResult(frontierProtectionNoNetData); - result.setSuccess(true); - } - return result; - } + FrontierProtectionNoNetData frontierProtectionNoNetData = frontierProtectionNoNetDataService.getById(id); + if (frontierProtectionNoNetData == null) { + result.error500("未找到对应实体"); + } else { + result.setResult(frontierProtectionNoNetData); + result.setSuccess(true); + } + return result; + } + + @ApiOperation(value = "艾礼安云平台设备状态信息订阅", notes = "报警主机在发生状态改变、报警时,主动向第三方平台上传相关信息,响应 \n" + + "0:表示成功 \n" + + "1:表示失败", httpMethod = "POST") + @ApiImplicitParams({ + @ApiImplicitParam(name = "projectSn", value = "项目sn", paramType = "body", required = true, dataType = "String"), + }) + @PostMapping(value = "/alaDeviceSubscribe") + public Integer alaDeviceSubscribe(@RequestBody FrontierProtectionNoNetDataDto dto) { + return frontierProtectionNoNetDataService.alaDeviceSubscribe(dto); + } } diff --git a/src/main/java/com/zhgd/xmgl/modules/frontierprotectionnonet/entity/FrontierProtectionNoNetDataDto.java b/src/main/java/com/zhgd/xmgl/modules/frontierprotectionnonet/entity/FrontierProtectionNoNetDataDto.java new file mode 100644 index 000000000..66b8d9eac --- /dev/null +++ b/src/main/java/com/zhgd/xmgl/modules/frontierprotectionnonet/entity/FrontierProtectionNoNetDataDto.java @@ -0,0 +1,29 @@ +package com.zhgd.xmgl.modules.frontierprotectionnonet.entity; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; + +@Data +public class FrontierProtectionNoNetDataDto { + @JsonProperty("deviceid") + private String deviceid; + @JsonProperty("devicename") + private String devicename; + @JsonProperty("type") + private String type; + @JsonProperty("address") + private String address; + @JsonProperty("alarm") + private String alarm; + @JsonProperty("state") + private String state; + @JsonProperty("zone") + private String zone; + @JsonProperty("zonename") + private String zonename; + @JsonProperty("time") + private String time; + @JsonProperty("number") + private String number; + +} diff --git a/src/main/java/com/zhgd/xmgl/modules/frontierprotectionnonet/service/IFrontierProtectionNoNetDataService.java b/src/main/java/com/zhgd/xmgl/modules/frontierprotectionnonet/service/IFrontierProtectionNoNetDataService.java index 859fc15e2..31bce6c9a 100644 --- a/src/main/java/com/zhgd/xmgl/modules/frontierprotectionnonet/service/IFrontierProtectionNoNetDataService.java +++ b/src/main/java/com/zhgd/xmgl/modules/frontierprotectionnonet/service/IFrontierProtectionNoNetDataService.java @@ -3,6 +3,7 @@ package com.zhgd.xmgl.modules.frontierprotectionnonet.service; import com.zhgd.xmgl.modules.frontierprotectionnonet.entity.FrontierProtectionNoNetData; import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.zhgd.xmgl.modules.frontierprotectionnonet.entity.FrontierProtectionNoNetDataDto; import java.util.HashMap; import java.util.List; @@ -22,4 +23,6 @@ public interface IFrontierProtectionNoNetDataService extends IService implements IFrontierProtectionNoNetDataService { @Autowired private FrontierProtectionNoNetDataMapper frontierProtectionNoNetDataMapper; + @Autowired + private FrontierProtectionNoNetDevMapper frontierProtectionNoNetDevMapper; @Override public IPage queryPageList(HashMap paramMap) { @@ -66,4 +75,24 @@ public class FrontierProtectionNoNetDataServiceImpl extends ServiceImpl() + .eq(FrontierProtectionNoNetDev::getDevSn, deviceid)); + if (dev == null) { + //throw new OpenAlertException("设备编号不正确"); + return 1; + } + FrontierProtectionNoNetData data = new FrontierProtectionNoNetData(); + data.setDevSn(deviceid); + data.setMonitorObject(null); + data.setAlarmTime(new Date(Long.parseLong(dto.getTime()) * 1000)); + data.setDeviceStatus(Integer.valueOf(dto.getAlarm())); + data.setDetailStatus(dto.getState()); + data.setProjectSn(dev.getProjectSn()); + baseMapper.insert(data); + return 0; + } } diff --git a/src/main/java/com/zhgd/xmgl/modules/location/entity/LocationTunnel.java b/src/main/java/com/zhgd/xmgl/modules/location/entity/LocationTunnel.java index ac5682348..67b6470be 100644 --- a/src/main/java/com/zhgd/xmgl/modules/location/entity/LocationTunnel.java +++ b/src/main/java/com/zhgd/xmgl/modules/location/entity/LocationTunnel.java @@ -109,4 +109,6 @@ public class LocationTunnel implements Serializable { private String planarGraph; @ApiModelProperty(value = "实时数据id") private Long realtimeId; + @ApiModelProperty(value = "矫正人员图标x方向") + private Integer correctorIconXDirection; } diff --git a/src/main/java/com/zhgd/xmgl/security/WebSecurityConfig.java b/src/main/java/com/zhgd/xmgl/security/WebSecurityConfig.java index a3e881191..24c2c3539 100644 --- a/src/main/java/com/zhgd/xmgl/security/WebSecurityConfig.java +++ b/src/main/java/com/zhgd/xmgl/security/WebSecurityConfig.java @@ -298,6 +298,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter { .antMatchers("/xmgl/workerAttendance/list").permitAll() .antMatchers("/xmgl/workerInfo/selectPersonTypeAndEduStatistics").permitAll() .antMatchers("/xmgl/taskProgressRt/queryById").permitAll() + .antMatchers("/xmgl/frontierProtectionNoNetData/alaDeviceSubscribe").permitAll() .antMatchers(HttpMethod.OPTIONS, "/**").anonymous() .anyRequest().authenticated() // 剩下所有的验证都需要验证. .and()