bug修复
This commit is contained in:
parent
fbfb2b8ed6
commit
cde5ab179c
@ -74,7 +74,7 @@ public class UDPServerHandler extends SimpleChannelInboundHandler<DatagramPacket
|
|||||||
locationData.setCardno(cardno);
|
locationData.setCardno(cardno);
|
||||||
locationData.setPersonName(workerInfos.get(0).getWorkerName());
|
locationData.setPersonName(workerInfos.get(0).getWorkerName());
|
||||||
//算出洞口的距离
|
//算出洞口的距离
|
||||||
locationData.setInlX(Double.parseDouble(inlX) + 271);
|
locationData.setInlX(Double.parseDouble(inlX));
|
||||||
try {
|
try {
|
||||||
locationData.setPY((double) RandomUtil.randomInt(locationTunnel.getYValueRandomRangeStart(), locationTunnel.getYValueRandomRangeEnd()));
|
locationData.setPY((double) RandomUtil.randomInt(locationTunnel.getYValueRandomRangeStart(), locationTunnel.getYValueRandomRangeEnd()));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
package com.zhgd.xmgl.modules.frontierprotectionnonet.controller;
|
package com.zhgd.xmgl.modules.frontierprotectionnonet.controller;
|
||||||
|
|
||||||
import com.zhgd.xmgl.modules.frontierprotectionnonet.entity.FrontierProtectionNoNetData;
|
import com.zhgd.xmgl.modules.frontierprotectionnonet.entity.FrontierProtectionNoNetData;
|
||||||
|
import com.zhgd.xmgl.modules.frontierprotectionnonet.entity.FrontierProtectionNoNetDataDto;
|
||||||
import com.zhgd.xmgl.modules.frontierprotectionnonet.service.IFrontierProtectionNoNetDataService;
|
import com.zhgd.xmgl.modules.frontierprotectionnonet.service.IFrontierProtectionNoNetDataService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
@ -136,4 +137,15 @@ public class FrontierProtectionNoNetDataController {
|
|||||||
return result;
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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;
|
||||||
|
|
||||||
|
}
|
||||||
@ -3,6 +3,7 @@ package com.zhgd.xmgl.modules.frontierprotectionnonet.service;
|
|||||||
import com.zhgd.xmgl.modules.frontierprotectionnonet.entity.FrontierProtectionNoNetData;
|
import com.zhgd.xmgl.modules.frontierprotectionnonet.entity.FrontierProtectionNoNetData;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.zhgd.xmgl.modules.frontierprotectionnonet.entity.FrontierProtectionNoNetDataDto;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -22,4 +23,6 @@ public interface IFrontierProtectionNoNetDataService extends IService<FrontierPr
|
|||||||
void add(FrontierProtectionNoNetData frontierProtectionNoNetData);
|
void add(FrontierProtectionNoNetData frontierProtectionNoNetData);
|
||||||
|
|
||||||
void edit(FrontierProtectionNoNetData frontierProtectionNoNetData);
|
void edit(FrontierProtectionNoNetData frontierProtectionNoNetData);
|
||||||
|
|
||||||
|
Integer alaDeviceSubscribe(FrontierProtectionNoNetDataDto dto);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,8 +1,14 @@
|
|||||||
package com.zhgd.xmgl.modules.frontierprotectionnonet.service.impl;
|
package com.zhgd.xmgl.modules.frontierprotectionnonet.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.zhgd.jeecg.common.execption.OpenAlertException;
|
||||||
import com.zhgd.xmgl.modules.frontierprotectionnonet.entity.FrontierProtectionNoNetData;
|
import com.zhgd.xmgl.modules.frontierprotectionnonet.entity.FrontierProtectionNoNetData;
|
||||||
|
import com.zhgd.xmgl.modules.frontierprotectionnonet.entity.FrontierProtectionNoNetDataDto;
|
||||||
|
import com.zhgd.xmgl.modules.frontierprotectionnonet.entity.FrontierProtectionNoNetDev;
|
||||||
import com.zhgd.xmgl.modules.frontierprotectionnonet.mapper.FrontierProtectionNoNetDataMapper;
|
import com.zhgd.xmgl.modules.frontierprotectionnonet.mapper.FrontierProtectionNoNetDataMapper;
|
||||||
|
import com.zhgd.xmgl.modules.frontierprotectionnonet.mapper.FrontierProtectionNoNetDevMapper;
|
||||||
import com.zhgd.xmgl.modules.frontierprotectionnonet.service.IFrontierProtectionNoNetDataService;
|
import com.zhgd.xmgl.modules.frontierprotectionnonet.service.IFrontierProtectionNoNetDataService;
|
||||||
|
import io.swagger.models.auth.In;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
@ -11,6 +17,7 @@ import com.zhgd.jeecg.common.system.query.QueryGenerator;
|
|||||||
import com.zhgd.xmgl.util.PageUtil;
|
import com.zhgd.xmgl.util.PageUtil;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -29,6 +36,8 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||||||
public class FrontierProtectionNoNetDataServiceImpl extends ServiceImpl<FrontierProtectionNoNetDataMapper, FrontierProtectionNoNetData> implements IFrontierProtectionNoNetDataService {
|
public class FrontierProtectionNoNetDataServiceImpl extends ServiceImpl<FrontierProtectionNoNetDataMapper, FrontierProtectionNoNetData> implements IFrontierProtectionNoNetDataService {
|
||||||
@Autowired
|
@Autowired
|
||||||
private FrontierProtectionNoNetDataMapper frontierProtectionNoNetDataMapper;
|
private FrontierProtectionNoNetDataMapper frontierProtectionNoNetDataMapper;
|
||||||
|
@Autowired
|
||||||
|
private FrontierProtectionNoNetDevMapper frontierProtectionNoNetDevMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IPage<FrontierProtectionNoNetData> queryPageList(HashMap<String, Object> paramMap) {
|
public IPage<FrontierProtectionNoNetData> queryPageList(HashMap<String, Object> paramMap) {
|
||||||
@ -66,4 +75,24 @@ public class FrontierProtectionNoNetDataServiceImpl extends ServiceImpl<Frontier
|
|||||||
public void edit(FrontierProtectionNoNetData frontierProtectionNoNetData) {
|
public void edit(FrontierProtectionNoNetData frontierProtectionNoNetData) {
|
||||||
baseMapper.updateById(frontierProtectionNoNetData);
|
baseMapper.updateById(frontierProtectionNoNetData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer alaDeviceSubscribe(FrontierProtectionNoNetDataDto dto) {
|
||||||
|
String deviceid = dto.getDeviceid();
|
||||||
|
FrontierProtectionNoNetDev dev = frontierProtectionNoNetDevMapper.selectOne(new LambdaQueryWrapper<FrontierProtectionNoNetDev>()
|
||||||
|
.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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -109,4 +109,6 @@ public class LocationTunnel implements Serializable {
|
|||||||
private String planarGraph;
|
private String planarGraph;
|
||||||
@ApiModelProperty(value = "实时数据id")
|
@ApiModelProperty(value = "实时数据id")
|
||||||
private Long realtimeId;
|
private Long realtimeId;
|
||||||
|
@ApiModelProperty(value = "矫正人员图标x方向")
|
||||||
|
private Integer correctorIconXDirection;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -298,6 +298,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
|
|||||||
.antMatchers("/xmgl/workerAttendance/list").permitAll()
|
.antMatchers("/xmgl/workerAttendance/list").permitAll()
|
||||||
.antMatchers("/xmgl/workerInfo/selectPersonTypeAndEduStatistics").permitAll()
|
.antMatchers("/xmgl/workerInfo/selectPersonTypeAndEduStatistics").permitAll()
|
||||||
.antMatchers("/xmgl/taskProgressRt/queryById").permitAll()
|
.antMatchers("/xmgl/taskProgressRt/queryById").permitAll()
|
||||||
|
.antMatchers("/xmgl/frontierProtectionNoNetData/alaDeviceSubscribe").permitAll()
|
||||||
.antMatchers(HttpMethod.OPTIONS, "/**").anonymous()
|
.antMatchers(HttpMethod.OPTIONS, "/**").anonymous()
|
||||||
.anyRequest().authenticated() // 剩下所有的验证都需要验证.
|
.anyRequest().authenticated() // 剩下所有的验证都需要验证.
|
||||||
.and()
|
.and()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user