Compare commits
10 Commits
952b5dec28
...
8bc91b3bac
| Author | SHA1 | Date | |
|---|---|---|---|
| 8bc91b3bac | |||
|
|
7b63f24af5 | ||
|
|
bd52c6df20 | ||
|
|
2f45c45ca7 | ||
|
|
d05e2c7adf | ||
|
|
7afdaa29dd | ||
|
|
4e50e98a3f | ||
|
|
440044c0ab | ||
|
|
d7067dbe88 | ||
|
|
2f8e8bb446 |
@ -0,0 +1,72 @@
|
||||
package com.imdroid.secapi.dto;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnore;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* GNSS状态消息,每个工作周期开始时上报一次
|
||||
*
|
||||
* @author LiGang
|
||||
*/
|
||||
@Data
|
||||
@TableName(value = "surface_incline_data")
|
||||
public class SurfaceInclineData {
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
@ExcelIgnore
|
||||
Long id;
|
||||
|
||||
@ExcelProperty("租户id")
|
||||
Integer tenantid;
|
||||
|
||||
@ExcelProperty("上报时间")
|
||||
LocalDateTime createtime;
|
||||
|
||||
@ExcelProperty("设备编号")
|
||||
String deviceid;
|
||||
|
||||
@ExcelProperty("传感器号")
|
||||
Short sensorid;
|
||||
|
||||
@ExcelProperty("倾角X")
|
||||
Float anglex;
|
||||
|
||||
@ExcelProperty("倾角Y")
|
||||
Float angley;
|
||||
|
||||
@ExcelProperty("倾角Z")
|
||||
Float anglez;
|
||||
|
||||
@ExcelProperty("加速度X")
|
||||
Float accx;
|
||||
|
||||
@ExcelProperty("加速度Y")
|
||||
Float accy;
|
||||
|
||||
@ExcelProperty("加速度Z")
|
||||
Float accz;
|
||||
|
||||
@ExcelProperty("MaxX")
|
||||
Float maxaccx;
|
||||
|
||||
@ExcelProperty("MaxY")
|
||||
Float maxaccy;
|
||||
|
||||
@ExcelProperty("MaxZ")
|
||||
Float maxaccz;
|
||||
|
||||
@ExcelProperty("MinX")
|
||||
Float minaccx;
|
||||
|
||||
@ExcelProperty("MinY")
|
||||
Float minaccy;
|
||||
|
||||
@ExcelProperty("MinZ")
|
||||
Float minaccz;
|
||||
|
||||
}
|
||||
@ -0,0 +1,10 @@
|
||||
package com.imdroid.secapi.dto;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
|
||||
@Mapper
|
||||
public interface SurfaceInclineDataMapper extends BaseMapper<SurfaceInclineData> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,161 @@
|
||||
package com.imdroid.beidou_fwd.task;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.imdroid.beidou_fwd.entity.XFZData;
|
||||
import com.imdroid.beidou_fwd.service.TCPClient;
|
||||
import com.imdroid.common.util.GsonUtil;
|
||||
import com.imdroid.common.util.NumberUtils;
|
||||
import com.imdroid.secapi.dto.GnssCalcData;
|
||||
import com.imdroid.secapi.dto.ResendRecord;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Component
|
||||
@Configuration
|
||||
@EnableScheduling
|
||||
public class GXJS10mForwarder extends GXXfzForwarder{
|
||||
private final String FORWARDER_NAME = "广西新发展10分钟推送";
|
||||
@Value("${xfz.server.host}")
|
||||
private String host;
|
||||
|
||||
@Value("${xfz.server.port}")
|
||||
private int port;
|
||||
private boolean enabled=true;
|
||||
|
||||
@PostConstruct
|
||||
void registerMe(){
|
||||
init(FORWARDER_NAME, "TCP "+host+":"+port,1,FWD_DEVICE_ID,10);
|
||||
xfzTcpClient = new TCPClient();
|
||||
xfzTcpClient.init(host, port,listener);
|
||||
if(!enabled) return;
|
||||
|
||||
xfzTcpClient.start();
|
||||
}
|
||||
|
||||
/**
|
||||
* 每半小时转发GNSS解算结果
|
||||
*/
|
||||
@Scheduled(cron = "0 0/10 * * * ?") // 每10分钟执行一次
|
||||
private void forwardGnss() {
|
||||
if(!enabled) return;
|
||||
logger.debug("gxjs forwardGnss");
|
||||
forwardCurrentGnss();
|
||||
}
|
||||
|
||||
@Override
|
||||
int send(String projectId, List<GnssCalcData> records, LocalDateTime sentTime){
|
||||
int batchNum = 0;
|
||||
int sendNum = 0;
|
||||
if(records.size() == 0) return 0;
|
||||
|
||||
XFZData xfzTcpMessage = new XFZData();
|
||||
xfzTcpMessage.setProjectID(projectId);
|
||||
xfzTcpMessage.setWorkPointID(projectId);
|
||||
|
||||
List<XFZData.Data> dataList = new ArrayList<>(records.size());
|
||||
xfzTcpMessage.setData(dataList);
|
||||
|
||||
for(GnssCalcData locationRecord: records) {
|
||||
XFZData.Data data = new XFZData.Data();
|
||||
dataList.add(data);
|
||||
data.setDataTime(locationRecord.getCreatetime().format(formatter));
|
||||
data.setDevNum(locationRecord.getDeviceid());
|
||||
data.setDevtype("GNSS");
|
||||
// 单位由mm转化为m
|
||||
data.setX(NumberUtils.scale(locationRecord.getRpose() * 0.001, 5));
|
||||
data.setY(NumberUtils.scale(locationRecord.getRposn() * 0.001, 5));
|
||||
data.setZ(NumberUtils.scale(locationRecord.getRposd() * 0.001, 5));
|
||||
// 经纬度
|
||||
data.setDevLng(locationRecord.getR9250e());
|
||||
data.setDevLat(locationRecord.getR9250n());
|
||||
|
||||
if(projectId!=null && projectId.equals("20257071")) {
|
||||
//倾角
|
||||
XFZData.Data data2 = new XFZData.Data();
|
||||
dataList.add(data2);
|
||||
data2.setDataTime(locationRecord.getCreatetime().format(formatter));
|
||||
data2.setDevNum(locationRecord.getDeviceid() + "_qj");
|
||||
data2.setDevtype("InclinoMeter");
|
||||
// 角度
|
||||
data2.setX(NumberUtils.scale(locationRecord.getAuxe(), 3));
|
||||
data2.setY(NumberUtils.scale(locationRecord.getAuxn(), 3));
|
||||
data2.setZ(NumberUtils.scale(locationRecord.getAuxd(), 3));
|
||||
// 经纬度
|
||||
data2.setDevLng(locationRecord.getR9250e());
|
||||
data2.setDevLat(locationRecord.getR9250n());
|
||||
}
|
||||
// 发送
|
||||
batchNum++;
|
||||
|
||||
if(batchNum==20){
|
||||
String json = "#" + GsonUtil.toJson(xfzTcpMessage) + "!";
|
||||
//logger.debug("project {}: forwad {} gnss records to {}",projectId, dataList.size(),fwdGroupId);
|
||||
//logger.debug(json);
|
||||
try {
|
||||
listener.clear();
|
||||
xfzTcpClient.writeAndFlush(json);
|
||||
//等待应答
|
||||
if(checkResult()) sendNum += batchNum;
|
||||
} catch (Exception e1) {
|
||||
logger.error(e1.toString());
|
||||
}
|
||||
batchNum = 0;
|
||||
dataList.clear();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(batchNum>0){
|
||||
String json = "#" + GsonUtil.toJson(xfzTcpMessage) + "!";
|
||||
logger.debug("project {}: forwad {} gnss records to {}",projectId, dataList.size(),fwdGroupId);
|
||||
logger.debug(json);
|
||||
try {
|
||||
listener.clear();
|
||||
xfzTcpClient.writeAndFlush(json);
|
||||
//等待应答
|
||||
if(checkResult()) sendNum += batchNum;
|
||||
} catch (Exception e1) {
|
||||
logger.error(e1.toString());
|
||||
}
|
||||
dataList.clear();
|
||||
}
|
||||
return sendNum;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
void forwardHistoryGnss(){
|
||||
// 1.从转发记录表里检索待补传记录时间表,含设备Id,时间段
|
||||
QueryWrapper<ResendRecord> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("fwd_group_id",fwdGroupId);
|
||||
queryWrapper.eq("state",ResendRecord.STATE_BREAK_POINT);
|
||||
queryWrapper.ge("createtime", LocalDateTime.now().minusDays(30));
|
||||
List<ResendRecord> resendRecordsList = resendRecordMapper.selectList(queryWrapper);
|
||||
|
||||
if(resendRecordsList!=null && resendRecordsList.size()>0){
|
||||
//修改状态
|
||||
UpdateWrapper<ResendRecord> updateWrapper = new UpdateWrapper<>();
|
||||
updateWrapper.eq("fwd_group_id",fwdGroupId);
|
||||
updateWrapper.eq("state",ResendRecord.STATE_BREAK_POINT);
|
||||
updateWrapper.ge("createtime", LocalDateTime.now().minusDays(30));
|
||||
updateWrapper.set("state",ResendRecord.STATE_FWDING);
|
||||
int updateNum = resendRecordMapper.update(null, updateWrapper);
|
||||
logger.debug("{} forward history records: {}, update {}",fwdGroupId, resendRecordsList.size(),updateNum);
|
||||
// 2.检索这个这个时间段的解算结果,如果有数据则单个终端转发,标志记录为已补传
|
||||
for(ResendRecord record:resendRecordsList){
|
||||
if(record.getProjectid()!=null)
|
||||
logger.debug("{} forward history {}",fwdGroupId, record.getProjectid());
|
||||
forwardBatchGnssRecords(record);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -17,6 +17,7 @@ import org.springframework.stereotype.Component;
|
||||
import javax.annotation.PostConstruct;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
|
||||
@Component
|
||||
@ -24,6 +25,8 @@ import java.util.List;
|
||||
@EnableScheduling
|
||||
public class GXJSForwarder extends GXXfzForwarder{
|
||||
private final String FORWARDER_NAME = "广西新发展";
|
||||
private final String inclineProjects = "20257071,20251131";
|
||||
private HashSet<String> inclineProjectSet = new HashSet<>();
|
||||
@Value("${xfz.server.host}")
|
||||
private String host;
|
||||
|
||||
@ -39,6 +42,12 @@ public class GXJSForwarder extends GXXfzForwarder{
|
||||
if(!enabled) return;
|
||||
|
||||
xfzTcpClient.start();
|
||||
|
||||
// incline devices
|
||||
String[] inclineDeviceList = inclineProjects.split(",");
|
||||
for(String s:inclineDeviceList){
|
||||
inclineProjectSet.add(s);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -78,7 +87,7 @@ public class GXJSForwarder extends GXXfzForwarder{
|
||||
data.setDevLng(locationRecord.getR9250e());
|
||||
data.setDevLat(locationRecord.getR9250n());
|
||||
|
||||
if(projectId!=null && projectId.equals("20257071")) {
|
||||
if(projectId!=null && inclineProjectSet.contains(projectId)) {
|
||||
//倾角
|
||||
XFZData.Data data2 = new XFZData.Data();
|
||||
dataList.add(data2);
|
||||
|
||||
@ -0,0 +1,42 @@
|
||||
package com.imdroid.beidou_fwd.task;
|
||||
|
||||
import com.imdroid.beidou_fwd.service.TCPClient;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
|
||||
@Component
|
||||
@Configuration
|
||||
@EnableScheduling
|
||||
public class GZB10mForwarder extends GXXfzForwarder{
|
||||
private final String FORWARDER_NAME = "葛洲坝10分钟";
|
||||
@Value("${gzb.server.host}")
|
||||
private String host;
|
||||
|
||||
@Value("${gzb.server.port}")
|
||||
private int port;
|
||||
private boolean enabled=true;
|
||||
|
||||
@PostConstruct
|
||||
void registerMe(){
|
||||
init(FORWARDER_NAME, "TCP "+host+":"+port,1,FWD_DEVICE_ID,10);
|
||||
xfzTcpClient = new TCPClient();
|
||||
xfzTcpClient.init(host, port,listener);
|
||||
if(!enabled) return;
|
||||
xfzTcpClient.start();
|
||||
}
|
||||
|
||||
/**
|
||||
* 每半小时转发GNSS解算结果
|
||||
*/
|
||||
@Scheduled(cron = "0 0/10 * * * ?") // 每10分钟执行一次
|
||||
private void forwardGnss() {
|
||||
if(!enabled) return;
|
||||
logger.debug("gzb forwardGnss");
|
||||
forwardCurrentGnss();
|
||||
}
|
||||
}
|
||||
@ -67,7 +67,7 @@ public class GZYMQTTForwarder extends Forwarder {
|
||||
logger.debug("gzy mqtt forwardGnss");
|
||||
if(mqttClient.isConnected()) {
|
||||
forwardCurrentGnss();
|
||||
//forwardAngleData();
|
||||
forwardAngleData();
|
||||
}
|
||||
else{
|
||||
try{
|
||||
@ -130,6 +130,7 @@ public class GZYMQTTForwarder extends Forwarder {
|
||||
|
||||
GZYMQTTAngle tranData = new GZYMQTTAngle();
|
||||
tranData.setDeviceSn(msg.getDeviceid());
|
||||
tranData.setDeviceType(8);
|
||||
tranData.setCollectTime(msg.getCreatetime().format(formatter));
|
||||
float x = msg.getRoll()==null?0:msg.getRoll();
|
||||
float y = msg.getPitch()==null?0:msg.getPitch();
|
||||
|
||||
@ -27,7 +27,7 @@ import java.util.List;
|
||||
@Configuration
|
||||
@EnableScheduling
|
||||
public class GZYMqttTestForwarder extends Forwarder {
|
||||
static final String FORWARDER_NAME = "贵州交勘院MQTT";
|
||||
static final String FORWARDER_NAME = "贵州交勘院MQTT测试平台";
|
||||
@Value("${gzymqtttest.server.brokerUrl}")
|
||||
private String brokerUrl;
|
||||
@Value("${gzymqtttest.server.username}")
|
||||
|
||||
@ -0,0 +1,160 @@
|
||||
package com.imdroid.beidou_fwd.task;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.imdroid.beidou_fwd.entity.XFZData;
|
||||
import com.imdroid.beidou_fwd.service.TCPClient;
|
||||
import com.imdroid.common.util.GsonUtil;
|
||||
import com.imdroid.common.util.NumberUtils;
|
||||
import com.imdroid.secapi.dto.GnssCalcData;
|
||||
import com.imdroid.secapi.dto.ResendRecord;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Component
|
||||
@Configuration
|
||||
@EnableScheduling
|
||||
public class GZYZForwarder extends GXXfzForwarder{
|
||||
private final String FORWARDER_NAME = "广州英卓";
|
||||
@Value("${gzyz.server.host}")
|
||||
private String host;
|
||||
|
||||
@Value("${gzyz.server.port}")
|
||||
private int port;
|
||||
private boolean enabled=true;
|
||||
|
||||
@PostConstruct
|
||||
void registerMe(){
|
||||
init(FORWARDER_NAME, "TCP "+host+":"+port,14,FWD_DEVICE_ID,30);
|
||||
xfzTcpClient = new TCPClient();
|
||||
xfzTcpClient.init(host, port,listener);
|
||||
if(!enabled) return;
|
||||
|
||||
xfzTcpClient.start();
|
||||
}
|
||||
|
||||
/**
|
||||
* 每半小时转发GNSS解算结果
|
||||
*/
|
||||
@Scheduled(cron = "0 0/30 * * * ?") // 每30分钟执行一次
|
||||
private void forwardGnss() {
|
||||
if(!enabled) return;
|
||||
logger.debug("gzyz forwardGnss");
|
||||
forwardCurrentGnss();
|
||||
}
|
||||
|
||||
@Override
|
||||
int send(String projectId, List<GnssCalcData> records, LocalDateTime sentTime){
|
||||
int batchNum = 0;
|
||||
int sendNum = 0;
|
||||
if(records.size() == 0) return 0;
|
||||
|
||||
XFZData xfzTcpMessage = new XFZData();
|
||||
xfzTcpMessage.setProjectID(projectId);
|
||||
xfzTcpMessage.setWorkPointID(projectId);
|
||||
|
||||
List<XFZData.Data> dataList = new ArrayList<>(records.size());
|
||||
xfzTcpMessage.setData(dataList);
|
||||
|
||||
for(GnssCalcData locationRecord: records) {
|
||||
XFZData.Data data = new XFZData.Data();
|
||||
dataList.add(data);
|
||||
data.setDataTime(locationRecord.getCreatetime().format(formatter));
|
||||
data.setDevNum(locationRecord.getDeviceid());
|
||||
data.setDevtype("GNSS");
|
||||
// 单位由mm转化为m
|
||||
data.setX(NumberUtils.scale(locationRecord.getRpose() * 0.001, 5));
|
||||
data.setY(NumberUtils.scale(locationRecord.getRposn() * 0.001, 5));
|
||||
data.setZ(NumberUtils.scale(locationRecord.getRposd() * 0.001, 5));
|
||||
// 经纬度
|
||||
data.setDevLng(locationRecord.getR9250e());
|
||||
data.setDevLat(locationRecord.getR9250n());
|
||||
|
||||
//倾角
|
||||
XFZData.Data data2 = new XFZData.Data();
|
||||
dataList.add(data2);
|
||||
data2.setDataTime(locationRecord.getCreatetime().format(formatter));
|
||||
data2.setDevNum(locationRecord.getDeviceid() + "_qj");
|
||||
data2.setDevtype("InclinoMeter");
|
||||
// 角度
|
||||
data2.setX(NumberUtils.scale(locationRecord.getAuxe(), 3));
|
||||
data2.setY(NumberUtils.scale(locationRecord.getAuxn(), 3));
|
||||
data2.setZ(NumberUtils.scale(locationRecord.getAuxd(), 3));
|
||||
// 经纬度
|
||||
data2.setDevLng(locationRecord.getR9250e());
|
||||
data2.setDevLat(locationRecord.getR9250n());
|
||||
|
||||
// 发送
|
||||
batchNum++;
|
||||
|
||||
if(batchNum==20){
|
||||
String json = "#" + GsonUtil.toJson(xfzTcpMessage) + "!";
|
||||
//logger.debug("project {}: forwad {} gnss records to {}",projectId, dataList.size(),fwdGroupId);
|
||||
//logger.debug(json);
|
||||
try {
|
||||
listener.clear();
|
||||
xfzTcpClient.writeAndFlush(json);
|
||||
//等待应答
|
||||
if(checkResult()) sendNum += batchNum;
|
||||
} catch (Exception e1) {
|
||||
logger.error(e1.toString());
|
||||
}
|
||||
batchNum = 0;
|
||||
dataList.clear();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(batchNum>0){
|
||||
String json = "#" + GsonUtil.toJson(xfzTcpMessage) + "!";
|
||||
logger.debug("project {}: forwad {} gnss records to {}",projectId, dataList.size(),fwdGroupId);
|
||||
logger.debug(json);
|
||||
try {
|
||||
listener.clear();
|
||||
xfzTcpClient.writeAndFlush(json);
|
||||
//等待应答
|
||||
if(checkResult()) sendNum += batchNum;
|
||||
} catch (Exception e1) {
|
||||
logger.error(e1.toString());
|
||||
}
|
||||
dataList.clear();
|
||||
}
|
||||
return sendNum;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
void forwardHistoryGnss(){
|
||||
// 1.从转发记录表里检索待补传记录时间表,含设备Id,时间段
|
||||
QueryWrapper<ResendRecord> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("fwd_group_id",fwdGroupId);
|
||||
queryWrapper.eq("state",ResendRecord.STATE_BREAK_POINT);
|
||||
queryWrapper.ge("createtime", LocalDateTime.now().minusDays(30));
|
||||
List<ResendRecord> resendRecordsList = resendRecordMapper.selectList(queryWrapper);
|
||||
|
||||
if(resendRecordsList!=null && resendRecordsList.size()>0){
|
||||
//修改状态
|
||||
UpdateWrapper<ResendRecord> updateWrapper = new UpdateWrapper<>();
|
||||
updateWrapper.eq("fwd_group_id",fwdGroupId);
|
||||
updateWrapper.eq("state",ResendRecord.STATE_BREAK_POINT);
|
||||
updateWrapper.ge("createtime", LocalDateTime.now().minusDays(30));
|
||||
updateWrapper.set("state",ResendRecord.STATE_FWDING);
|
||||
int updateNum = resendRecordMapper.update(null, updateWrapper);
|
||||
logger.debug("{} forward history records: {}, update {}",fwdGroupId, resendRecordsList.size(),updateNum);
|
||||
// 2.检索这个这个时间段的解算结果,如果有数据则单个终端转发,标志记录为已补传
|
||||
for(ResendRecord record:resendRecordsList){
|
||||
if(record.getProjectid()!=null)
|
||||
logger.debug("{} forward history {}",fwdGroupId, record.getProjectid());
|
||||
forwardBatchGnssRecords(record);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -37,6 +37,11 @@ public class Gga {
|
||||
private int quality=0;
|
||||
private int satellitesInUsed=0;
|
||||
|
||||
/**
|
||||
* 大地水准面相对椭球面的高度
|
||||
*/
|
||||
private double geoidSeparation = 0;
|
||||
|
||||
public Gga() {
|
||||
}
|
||||
|
||||
@ -94,8 +99,8 @@ public class Gga {
|
||||
}
|
||||
}
|
||||
if(ggaStr != null){
|
||||
String[] params = ggaStr.split(",",11);
|
||||
if(params.length == 11){
|
||||
String[] params = ggaStr.split(",", 14);
|
||||
if(params.length >= 12){
|
||||
Gga gga = new Gga();
|
||||
try {
|
||||
gga.setLatitude(transGGAPos(Double.parseDouble(params[2])));
|
||||
@ -103,6 +108,7 @@ public class Gga {
|
||||
gga.setAltitude(Double.parseDouble(params[9]));
|
||||
gga.setQuality(Integer.parseInt(params[6]));
|
||||
gga.setSatellitesInUsed(Integer.parseInt(params[7]));
|
||||
gga.setGeoidSeparation(Double.parseDouble(params[11]));
|
||||
return gga;
|
||||
}
|
||||
catch (Exception e){
|
||||
|
||||
@ -116,10 +116,10 @@ public class D331RtcmMessageExecutor implements Executor<D331RtcmMessage, Void>
|
||||
deviceBs.setLatitude(gga.getLatitude());
|
||||
deviceBs.setLongitude(gga.getLongitude());
|
||||
deviceBs.setAltitude(gga.getAltitude());
|
||||
deviceBs.setGeoidSeparation(gga.getGeoidSeparation());
|
||||
}
|
||||
|
||||
// 添加NTRIP处理
|
||||
|
||||
if(deviceBs.getForwardToNtrip()) {
|
||||
byte[] srcdata = message.getSrcData();
|
||||
String rtcm = ByteUtil.bytesToHexString(srcdata);
|
||||
|
||||
@ -0,0 +1,47 @@
|
||||
package com.imdroid.sideslope.executor;
|
||||
|
||||
import com.imdroid.common.util.ThreadManager;
|
||||
import com.imdroid.secapi.dto.*;
|
||||
import com.imdroid.sideslope.message.D350SurfaceInclineMessage;
|
||||
import com.imdroid.sideslope.service.Device;
|
||||
import com.imdroid.sideslope.service.DeviceService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
|
||||
/**
|
||||
* @author Layton
|
||||
* @date 2023/2/2 20:40
|
||||
* 1、回ACK,以便终端判断是否连接上服务器后台
|
||||
* 2、同步参数
|
||||
* 3、判断是否发冷启动指令
|
||||
* 4、保存状态信息,判断是否有低电压等告警,清除离线告警
|
||||
*/
|
||||
@Component
|
||||
public class D350SurfaceInclineMessageExecutor implements Executor<D350SurfaceInclineMessage, Void> {
|
||||
@Autowired
|
||||
SurfaceInclineDataMapper dataMapper;
|
||||
@Autowired
|
||||
private DeviceService deviceService;
|
||||
@Override
|
||||
public Void execute(D350SurfaceInclineMessage message) {
|
||||
Device device = deviceService.findByDeviceId(message.getId());
|
||||
if(device == null) return null;
|
||||
// 补齐tenantId
|
||||
message.getInclineData().setTenantid(device.getTenantId());
|
||||
|
||||
ThreadManager.getFixedThreadPool().submit(() -> {
|
||||
|
||||
//保存状态信息,判断是否有低电压等告警,清除离线告警
|
||||
dataMapper.insert(message.getInclineData());
|
||||
});
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getMessageType() {
|
||||
return D350SurfaceInclineMessage.class;
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,32 +0,0 @@
|
||||
package com.imdroid.sideslope.executor;
|
||||
|
||||
import com.imdroid.sideslope.message.D350TestMessage;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @author Layton
|
||||
* @date 2023/2/2 20:40
|
||||
*/
|
||||
@Component
|
||||
public class D350TestMessageExecutor implements Executor<D350TestMessage, Void> {
|
||||
private final Logger logger = LoggerFactory.getLogger(this.getClass());
|
||||
|
||||
@Override
|
||||
public Void execute(D350TestMessage message) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("device {} max acc(g) in 1s: x={},y={},z={}",message.getId(),
|
||||
message.getAccX(),message.getAccY(),message.getAccZ());
|
||||
}
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Class<?> getMessageType() {
|
||||
return D350TestMessage.class;
|
||||
}
|
||||
}
|
||||
@ -36,7 +36,7 @@ public class MessageParser {
|
||||
types.put((short)0xd31A, D31xConfigAckMessage.class);//DTU配置应答
|
||||
types.put((short)0xd31B, D31xConfigAckMessage.class);//LORA配置应答
|
||||
types.put((short)0xd320, D31xConfigAckMessage.class);//v3.2 DTU配置应答
|
||||
types.put((short)0xd350, D350TestMessage.class);//ACC上报
|
||||
types.put((short)0xd350, D350SurfaceInclineMessage.class);//ACC上报
|
||||
types.put((short)0xd314, D314PingMessage.class);//ping
|
||||
}
|
||||
|
||||
|
||||
@ -0,0 +1,50 @@
|
||||
package com.imdroid.sideslope.message;
|
||||
|
||||
import com.imdroid.secapi.dto.SurfaceInclineData;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 自检消息
|
||||
*
|
||||
* @author Layton
|
||||
* @date 2023/2/2 20:38
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper=true)
|
||||
@Data
|
||||
public class D350SurfaceInclineMessage extends BaseMessage {
|
||||
|
||||
SurfaceInclineData inclineData = new SurfaceInclineData();
|
||||
|
||||
@Override
|
||||
public void decodeBody(ByteBuf src) {
|
||||
// d3 50 length(2bytes) device_id(4bytes) seq(2bytes) data
|
||||
this.len = src.readableBytes(); // total length
|
||||
this.header = src.readUnsignedShort();// flag
|
||||
src.readUnsignedShort();// d342 length
|
||||
this.id = String.valueOf(src.readUnsignedInt());//id
|
||||
this.seq = src.readUnsignedShort();
|
||||
|
||||
inclineData.setDeviceid(getId());
|
||||
inclineData.setCreatetime(createTime);
|
||||
|
||||
inclineData.setSensorid(src.readUnsignedByte());
|
||||
inclineData.setAnglex(src.readFloat());
|
||||
inclineData.setAngley(src.readFloat());
|
||||
inclineData.setAnglez(src.readFloat());
|
||||
inclineData.setAccx(src.readFloat());
|
||||
inclineData.setAccy(src.readFloat());
|
||||
inclineData.setAccz(src.readFloat());
|
||||
inclineData.setMaxaccx(src.readFloat());
|
||||
inclineData.setMaxaccy(src.readFloat());
|
||||
inclineData.setMaxaccz(src.readFloat());
|
||||
inclineData.setMinaccx(src.readFloat());
|
||||
inclineData.setMinaccy(src.readFloat());
|
||||
inclineData.setMinaccz(src.readFloat());
|
||||
}
|
||||
@Override
|
||||
public boolean shouldDecodeHeader() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -1,25 +0,0 @@
|
||||
package com.imdroid.sideslope.message;
|
||||
|
||||
import com.imdroid.sideslope.bd.Gga;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* @author Layton
|
||||
* @date 2023/2/2 20:50
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper=true)
|
||||
public class D350TestMessage extends BaseMessage {
|
||||
double accX;
|
||||
double accY;
|
||||
double accZ;
|
||||
Gga gga;
|
||||
@Override
|
||||
public void decodeBody(ByteBuf src) {
|
||||
accX = src.readFloat();
|
||||
accY = src.readFloat();
|
||||
accZ = src.readFloat();
|
||||
}
|
||||
}
|
||||
@ -62,6 +62,12 @@ public class Device {
|
||||
Double latitude;
|
||||
Double longitude;
|
||||
Double altitude;
|
||||
|
||||
// 大地水准面相对椭球面的高度差
|
||||
// 博通 GGA 此处可能非零,影响 RTK 运算,故需通过此属性判断。
|
||||
Double geoidSeparation = 0.0;
|
||||
|
||||
|
||||
Double ecefx;
|
||||
Double ecefy;
|
||||
Double ecefz;
|
||||
@ -69,6 +75,7 @@ public class Device {
|
||||
Double iPose;
|
||||
Double iPosn;
|
||||
Double iPosd;
|
||||
|
||||
private BigDecimal remaining;
|
||||
private BigDecimal total;
|
||||
private BigDecimal used;
|
||||
@ -78,10 +85,10 @@ public class Device {
|
||||
LocalDateTime lastD3f2Time;
|
||||
short noFixedAndFloatResult=0;
|
||||
|
||||
// 日志记录控制
|
||||
Short loggingmode;
|
||||
// NtripCaster 推送控制
|
||||
Boolean forwardToNtrip = false;
|
||||
|
||||
Short loggingmode;// 日志记录控制
|
||||
Boolean forwardToNtrip = false;// NtripCaster 推送控制
|
||||
|
||||
int lastRxHead = 0;
|
||||
|
||||
int fixedNum = 0;
|
||||
|
||||
@ -0,0 +1,75 @@
|
||||
package com.imdroid.beidou.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.imdroid.beidou.service.CommonExcelService;
|
||||
import com.imdroid.secapi.dto.*;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpSession;
|
||||
|
||||
/**
|
||||
* 状态消息 控制器
|
||||
*
|
||||
* @author LiGang
|
||||
* @date 2024/1/6 14:37
|
||||
*/
|
||||
@Controller
|
||||
@RequiredArgsConstructor
|
||||
public class SurfaceInclineController extends BasicController implements CommonExcelService<SurfaceInclineData, SurfaceInclineData> {
|
||||
@Autowired
|
||||
SurfaceInclineDataMapper dataMapper;
|
||||
|
||||
@RequestMapping("/page/surface_incline_data")
|
||||
public String surfaceInclineData(Model m, HttpSession session) {
|
||||
initModel(m, session);
|
||||
return "/page/surface_incline_data";
|
||||
}
|
||||
|
||||
@RequestMapping("/surface_incline/data/list")
|
||||
@ResponseBody
|
||||
public JSONObject listData(HttpSession session, Integer page, Integer limit, String searchParams) {
|
||||
return this.pageList(session, page, limit, searchParams);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param session HttpSession
|
||||
* @param request HttpServletRequest
|
||||
* @param response HttpServletResponse
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping("/surface_incline/data/export")
|
||||
@ResponseBody
|
||||
public void exportData(HttpSession session, HttpServletRequest request, HttpServletResponse response) throws Exception {
|
||||
this.export(session, request, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取实体类的class
|
||||
*
|
||||
* @return 实体类的class
|
||||
*/
|
||||
@Override
|
||||
public Class<SurfaceInclineData> getEntityClass() {
|
||||
return SurfaceInclineData.class;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取实体类对应的mybatis mapper
|
||||
*
|
||||
* @return 实体类对应的mybatis mapper
|
||||
*/
|
||||
@Override
|
||||
public BaseMapper<SurfaceInclineData> getMapper() {
|
||||
return dataMapper;
|
||||
}
|
||||
}
|
||||
@ -403,3 +403,27 @@ CREATE TABLE IF NOT EXISTS `traffic_records` (
|
||||
KEY `idx_iccid` (`iccid`),
|
||||
KEY `idx_recordtime` (`recordtime`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='流量使用记录表';
|
||||
|
||||
/***
|
||||
倾角计
|
||||
*/
|
||||
CREATE TABLE IF NOT EXISTS `surface_incline_data` (
|
||||
`id` bigint AUTO_INCREMENT,
|
||||
`tenantid` int NOT NULL,
|
||||
`createtime` datetime DEFAULT NULL,
|
||||
`deviceid` varchar(20) NOT NULL,
|
||||
`sensorid` smallint DEFAULT NULL,
|
||||
`anglex` float DEFAULT NULL,
|
||||
`angley` float DEFAULT NULL,
|
||||
`anglez` float DEFAULT NULL,
|
||||
`accx` float DEFAULT NULL,
|
||||
`accy` float DEFAULT NULL,
|
||||
`accz` float DEFAULT NULL,
|
||||
`maxaccx` float DEFAULT NULL,
|
||||
`maxaccy` float DEFAULT NULL,
|
||||
`maxaccz` float DEFAULT NULL,
|
||||
`minaccx` float DEFAULT NULL,
|
||||
`minaccy` float DEFAULT NULL,
|
||||
`minaccz` float DEFAULT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
"href": "page/device_overview"
|
||||
},
|
||||
"logoInfo": {
|
||||
"title": "北斗管理平台",
|
||||
"title": "地质监测平台",
|
||||
"image": "images/logo.png",
|
||||
"href": ""
|
||||
},
|
||||
@ -41,12 +41,6 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "解算结果",
|
||||
"href": "page/gnss_data_calc",
|
||||
"icon": "fa fa-calculator",
|
||||
"target": "_self"
|
||||
},
|
||||
{
|
||||
"title": "配置管理",
|
||||
"href": "",
|
||||
@ -82,6 +76,32 @@
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "监测数据",
|
||||
"icon": "fa fa-address-book",
|
||||
"href": "",
|
||||
"target": "_self",
|
||||
"child": [
|
||||
{
|
||||
"title": "北斗",
|
||||
"href": "page/gnss_data_calc",
|
||||
"icon": "fa fa-calculator",
|
||||
"target": "_self"
|
||||
},
|
||||
{
|
||||
"title": "倾角计",
|
||||
"href": "page/surface_incline_data",
|
||||
"icon": "fa fa-calculator",
|
||||
"target": "_self"
|
||||
},
|
||||
{
|
||||
"title": "测斜仪",
|
||||
"href": "",
|
||||
"icon": "fa fa-calculator",
|
||||
"target": "_self"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -4,7 +4,7 @@
|
||||
"href": "page/device_overview"
|
||||
},
|
||||
"logoInfo": {
|
||||
"title": "北斗管理平台",
|
||||
"title": "地质监测平台",
|
||||
"image": "images/logo.png",
|
||||
"href": ""
|
||||
},
|
||||
@ -53,12 +53,6 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "解算结果",
|
||||
"href": "page/gnss_data_calc",
|
||||
"icon": "fa fa-calculator",
|
||||
"target": "_self"
|
||||
},
|
||||
{
|
||||
"title": "日志",
|
||||
"href": "page/gnss_single_data",
|
||||
@ -177,6 +171,32 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "监测数据",
|
||||
"icon": "fa fa-address-book",
|
||||
"href": "",
|
||||
"target": "_self",
|
||||
"child": [
|
||||
{
|
||||
"title": "北斗",
|
||||
"href": "page/gnss_data_calc",
|
||||
"icon": "fa fa-calculator",
|
||||
"target": "_self"
|
||||
},
|
||||
{
|
||||
"title": "倾角计",
|
||||
"href": "page/surface_incline_data",
|
||||
"icon": "fa fa-calculator",
|
||||
"target": "_self"
|
||||
},
|
||||
{
|
||||
"title": "测斜仪",
|
||||
"href": "",
|
||||
"icon": "fa fa-calculator",
|
||||
"target": "_self"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "系统管理",
|
||||
"icon": "fa fa-lemon-o",
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
"href": "page/device_overview"
|
||||
},
|
||||
"logoInfo": {
|
||||
"title": "北斗管理平台",
|
||||
"title": "地质监测平台",
|
||||
"image": "images/logo.png",
|
||||
"href": ""
|
||||
},
|
||||
@ -47,12 +47,6 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "解算结果",
|
||||
"href": "page/gnss_data_calc",
|
||||
"icon": "fa fa-calculator",
|
||||
"target": "_self"
|
||||
},
|
||||
{
|
||||
"title": "配置管理",
|
||||
"href": "",
|
||||
@ -135,6 +129,32 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "监测数据",
|
||||
"icon": "fa fa-address-book",
|
||||
"href": "",
|
||||
"target": "_self",
|
||||
"child": [
|
||||
{
|
||||
"title": "北斗",
|
||||
"href": "page/gnss_data_calc",
|
||||
"icon": "fa fa-calculator",
|
||||
"target": "_self"
|
||||
},
|
||||
{
|
||||
"title": "倾角计",
|
||||
"href": "page/surface_incline_data",
|
||||
"icon": "fa fa-calculator",
|
||||
"target": "_self"
|
||||
},
|
||||
{
|
||||
"title": "测斜仪",
|
||||
"href": "",
|
||||
"icon": "fa fa-calculator",
|
||||
"target": "_self"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "系统管理",
|
||||
"icon": "fa fa-lemon-o",
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>北斗管理系统</title>
|
||||
<title>地质监测平台</title>
|
||||
<meta name="renderer" content="webkit">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta http-equiv="Access-Control-Allow-Origin" content="*">
|
||||
|
||||
@ -59,7 +59,7 @@
|
||||
<div class="main-body">
|
||||
<div class="login-main">
|
||||
<div class="login-top">
|
||||
<span>北斗管理系统登录</span>
|
||||
<span>地质监测系统登录</span>
|
||||
<span class="bg1"></span>
|
||||
<span class="bg2"></span>
|
||||
</div>
|
||||
|
||||
@ -24,6 +24,18 @@
|
||||
<input type="text" name="s_deviceid" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">电压小于</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="number" name="nlt_voltage" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">湿度大于</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="number" name="ngt_humidity" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">内置电池</label>
|
||||
<div class="layui-input-inline">
|
||||
|
||||
@ -0,0 +1,138 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>倾角计</title>
|
||||
<meta name="renderer" content="webkit">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||
<link rel="stylesheet" href="../lib/layui-v2.6.3/css/layui.css" media="all">
|
||||
<link rel="stylesheet" href="../css/public.css" media="all">
|
||||
</head>
|
||||
<body>
|
||||
<div class="layuimini-container">
|
||||
<div class="layuimini-main">
|
||||
|
||||
<fieldset class="table-search-fieldset">
|
||||
<legend>搜索信息</legend>
|
||||
<div style="margin: 10px 10px 10px 10px">
|
||||
<form class="layui-form layui-form-pane" action="" id="searchFrm">
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">设备号</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="s_deviceid" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">传感器号</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="s_sensorid" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">范围</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="dgt_createtime" autocomplete="off" id="ID-laydate-start-date" class="layui-input" placeholder="开始日期">
|
||||
</div>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="dlt_createtime" autocomplete="off" id="ID-laydate-end-date" class="layui-input" placeholder="结束日期">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<button type="submit" class="layui-btn layui-btn-primary" lay-submit lay-filter="data-search-btn"><i class="layui-icon"></i> 搜 索</button>
|
||||
<button type="submit" class="layui-btn layui-btn-primary" lay-submit lay-filter="data-export-btn"><i class="layui-icon"></i>导出</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
<table class="layui-hide" id="currentTableId" lay-filter="currentTableFilter"></table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<script src="../lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
|
||||
<script th:inline="javascript">
|
||||
layui.use(['form', 'table', 'laydate'], function () {
|
||||
var $ = layui.$;
|
||||
var form = layui.form,
|
||||
table = layui.table,
|
||||
laydate = layui.laydate;
|
||||
|
||||
var cfg_cols = [
|
||||
{field: 'deviceid', title: '设备号', width: 100, fixed: "left"},
|
||||
{field: 'sensorid', title: '传感器号', width: 15, fixed: "left"},
|
||||
{field: 'createtime', title: '上报时间', fixed: "left", templet: "<div>{{layui.util.toDateString(d.createtime, 'yyyy-MM-dd HH:mm:ss')}}</div>"},
|
||||
{field: 'anglex', title: '倾角X', templet: "<div>{{d.anglex.toFixed(3)}}</div>"},
|
||||
{field: 'angley', title: '倾角Y', templet: "<div>{{d.angley.toFixed(3)}}</div>"},
|
||||
{field: 'anglez', title: '倾角Z', templet: "<div>{{d.anglez.toFixed(3)}}</div>"},
|
||||
{field: 'accx', title: '加速度X', templet: "<div>{{d.accx.toFixed(3)}}</div>"},
|
||||
{field: 'accy', title: '加速度Y', templet: "<div>{{d.accy.toFixed(3)}}</div>"},
|
||||
{field: 'accz', title: '加速度Z', templet: "<div>{{d.accz.toFixed(3)}}</div>"},
|
||||
{field: 'maxaccx', title: 'MaxX', templet: "<div>{{d.maxaccx.toFixed(3)}}</div>"},
|
||||
{field: 'maxaccy', title: 'MaxY', templet: "<div>{{d.maxaccy.toFixed(3)}}</div>"},
|
||||
{field: 'maxaccz', title: 'MaxZ', templet: "<div>{{d.maxaccz.toFixed(3)}}</div>"},
|
||||
{field: 'minaccx', title: 'MinX', templet: "<div>{{d.minaccx.toFixed(3)}}</div>"},
|
||||
{field: 'minaccy', title: 'MinY', templet: "<div>{{d.minaccy.toFixed(3)}}</div>"},
|
||||
{field: 'minaccz', title: 'MinZ', templet: "<div>{{d.minaccz.toFixed(3)}}</div>"},
|
||||
|
||||
];
|
||||
/**
|
||||
* 初始化表单,要加上,不然刷新部分组件可能会不加载
|
||||
*/
|
||||
form.render();
|
||||
|
||||
laydate.render({
|
||||
elem: '#ID-laydate-start-date',
|
||||
type: 'datetime'
|
||||
});
|
||||
laydate.render({
|
||||
elem: '#ID-laydate-end-date',
|
||||
type: 'datetime'
|
||||
});
|
||||
|
||||
table.render({
|
||||
elem: '#currentTableId',
|
||||
url: '/surface_incline/data/list',
|
||||
toolbar: '#toolbarDemo',//开启头部工具栏
|
||||
defaultToolbar: ['filter'],
|
||||
cols: [
|
||||
cfg_cols
|
||||
],
|
||||
limits: [10, 50, 100, 200],
|
||||
limit: 10,
|
||||
page: true,
|
||||
skin: 'line'
|
||||
});
|
||||
|
||||
// 监听搜索操作
|
||||
form.on('submit(data-search-btn)', function (data) {
|
||||
var result = JSON.stringify(data.field);
|
||||
|
||||
//执行搜索重载
|
||||
table.reload('currentTableId', {
|
||||
page: {
|
||||
curr: 1
|
||||
}
|
||||
, where: {
|
||||
searchParams: result
|
||||
}
|
||||
}, 'data');
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
// 监听导出操作
|
||||
form.on('submit(data-export-btn)', function (data) {
|
||||
var result = $('#searchFrm').serialize();
|
||||
var u = "/surface_incline/data/export?" + result;
|
||||
window.open(u, "_blank");
|
||||
return false;
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Loading…
x
Reference in New Issue
Block a user