优化了单次解算;增加了解算结果界面
This commit is contained in:
parent
c669070cbd
commit
73bffd2ce5
@ -34,4 +34,5 @@ public class GnssCalcData {
|
||||
double rb562e;
|
||||
double rb562d;
|
||||
double rb562n;
|
||||
int pps;
|
||||
}
|
||||
|
||||
@ -17,7 +17,7 @@ import java.sql.Timestamp;
|
||||
public class GnssStatusMsg {
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
Long id;
|
||||
Timestamp updatetime;
|
||||
Timestamp createtime;
|
||||
Timestamp devicetime;
|
||||
String deviceid;
|
||||
float roll;
|
||||
|
||||
@ -17,7 +17,7 @@ import java.sql.Timestamp;
|
||||
public class GnssTrxMsg {
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
Long id;
|
||||
Timestamp updatetime;
|
||||
Timestamp createtime;
|
||||
Timestamp devicetime;
|
||||
String deviceid;
|
||||
long uart1txbytes;
|
||||
|
||||
@ -127,6 +127,12 @@
|
||||
<artifactId>lombok</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<!-- 矩阵工具 -->
|
||||
<dependency>
|
||||
<groupId>org.ejml</groupId>
|
||||
<artifactId>ejml-all</artifactId>
|
||||
<version>0.41</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
||||
@ -20,6 +20,8 @@ public class FocusCalculator {
|
||||
private boolean flag = false; // 是否是第一次计算
|
||||
private List<Point> pointList = new ArrayList<>();
|
||||
public static double[] lastFocus = null;//
|
||||
private int delay_ms = 0;
|
||||
private int counter = 0;
|
||||
|
||||
|
||||
/**
|
||||
@ -322,4 +324,13 @@ public class FocusCalculator {
|
||||
return r;
|
||||
}
|
||||
|
||||
public void addDelayMs(int ms){
|
||||
delay_ms += ms;
|
||||
counter ++;
|
||||
}
|
||||
|
||||
public int getAvgDelayMs(){
|
||||
return delay_ms/counter;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.imdroid.sideslope.calc;
|
||||
|
||||
import com.imdroid.secapi.dto.GnssCalcData;
|
||||
import com.imdroid.sideslope.bd.*;
|
||||
import com.imdroid.sideslope.message.D341LocationMessage;
|
||||
import com.imdroid.sideslope.sal.*;
|
||||
@ -82,9 +83,12 @@ public class SingleLineGNSSCalcService implements GNSSCalcService {
|
||||
}
|
||||
focusCalculator.addTilt(tilt);
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("测站" + deviceId + "的9250单次解析结果:{}", tilt.toString() + "," + Arrays.toString(TiltUtil.toPosition(tilt, focusCalculator.getTilt0(), focusCalculator.getPosition0(), focusCalculator.getR())));
|
||||
logger.debug("测站" + deviceId + "的9250单次解析结果:{}", tilt + "," + Arrays.toString(TiltUtil.toPosition(tilt, focusCalculator.getTilt0(), focusCalculator.getPosition0(), focusCalculator.getR())));
|
||||
}
|
||||
|
||||
// 计算延迟
|
||||
focusCalculator.addDelayMs(message.getPps());
|
||||
|
||||
//计算到单次相对位置xyz并记录
|
||||
//tilt共16个字节,从后边开始找b562
|
||||
double[] doubles = message.getB562_loc();
|
||||
@ -127,6 +131,7 @@ public class SingleLineGNSSCalcService implements GNSSCalcService {
|
||||
logger.info("测站 {} 的9250相对坐标:{}", deviceId, Arrays.toString(r9250Result));
|
||||
logger.info("测站 {} 的相对坐标融合值:{}", deviceId, Arrays.toString(result));
|
||||
logger.info("测站 {} 的Tilt平均值:{}", deviceId, tilt);
|
||||
logger.info("测站 {} 的平均延迟:{}ms", deviceId, focusCalculator.getAvgDelayMs());
|
||||
|
||||
if (tilt != null) {
|
||||
if (Boolean.TRUE.equals(cleanTiltStatusMap.get(deviceId))) {
|
||||
@ -147,7 +152,7 @@ public class SingleLineGNSSCalcService implements GNSSCalcService {
|
||||
} else {
|
||||
positionMap.put(deviceId, result);
|
||||
}
|
||||
postLocationRecord(deviceId, b562Result, r9250Result, result);
|
||||
postLocationRecord(deviceId, b562Result, r9250Result, result, focusCalculator.getAvgDelayMs());
|
||||
}else{
|
||||
logger.error("融合值异常");
|
||||
}
|
||||
@ -159,18 +164,33 @@ public class SingleLineGNSSCalcService implements GNSSCalcService {
|
||||
timerMap.put(deviceId, future);
|
||||
}
|
||||
|
||||
private void postLocationRecord(String deviceId, double[] b562Result, double[] r9250Result, double[] result) {
|
||||
LocationRecordDTO locationRecord = new LocationRecordDTO(deviceId, NumberUtils.doubleArrayToString(b562Result),
|
||||
NumberUtils.doubleArrayToString(r9250Result), NumberUtils.doubleArrayToString(result),String.valueOf(isExceedMap.get(deviceId)));
|
||||
deviceService.postLocationRecord(locationRecord);
|
||||
private void postLocationRecord(String deviceId, double[] b562Result, double[] r9250Result, double[] result, int delay) {
|
||||
GnssCalcData locationRecord = new GnssCalcData();
|
||||
locationRecord.setDeviceid(deviceId);
|
||||
if(b562Result!=null) {
|
||||
locationRecord.setB562e(b562Result[0] * 10); //cm->mm
|
||||
locationRecord.setB562n(b562Result[1] * 10);
|
||||
locationRecord.setB562d(b562Result[2] * 10);
|
||||
}
|
||||
if(r9250Result!=null) {
|
||||
locationRecord.setR9250e(r9250Result[0]);
|
||||
locationRecord.setR9250n(r9250Result[1]);
|
||||
locationRecord.setR9250d(r9250Result[2]);
|
||||
}
|
||||
if(result!=null) {
|
||||
locationRecord.setResulte(result[0]);
|
||||
locationRecord.setResultn(result[1]);
|
||||
locationRecord.setResultd(result[2]);
|
||||
}
|
||||
locationRecord.setPps(delay);
|
||||
deviceService.postLocationRecord(locationRecord, isExceedMap.get(deviceId));
|
||||
}
|
||||
|
||||
@Override
|
||||
public double[] calcResult(String deviceId,double[] b562Xyz, double[] tiltXyz) {
|
||||
FocusCalculator focusCalculator = calculatorMap.get(deviceId);
|
||||
if (focusCalculator != null) {
|
||||
double[] result = focusCalculator.ekfResult(b562Xyz,tiltXyz);
|
||||
return result;
|
||||
return focusCalculator.ekfResult(b562Xyz,tiltXyz);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@ -179,8 +199,7 @@ public class SingleLineGNSSCalcService implements GNSSCalcService {
|
||||
public Tilt calcAvgTilt(String deviceId) {
|
||||
FocusCalculator focusCalculator = calculatorMap.get(deviceId);
|
||||
if (focusCalculator != null) {
|
||||
Tilt tilt = focusCalculator.avgTilt();
|
||||
return tilt;
|
||||
return focusCalculator.avgTilt();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -2,11 +2,13 @@ package com.imdroid.sideslope.message;
|
||||
|
||||
import com.imdroid.sideslope.util.WrongMessageRecorder;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author Layton
|
||||
* @date 2023/2/2 20:32
|
||||
*/
|
||||
@Data
|
||||
public abstract class BaseMessage {
|
||||
protected short header;
|
||||
protected String id;
|
||||
@ -37,44 +39,4 @@ public abstract class BaseMessage {
|
||||
public boolean shouldDecodeHeader() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public short getHeader() {
|
||||
return header;
|
||||
}
|
||||
|
||||
public void setHeader(short header) {
|
||||
this.header = header;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public int getLen() {
|
||||
return len;
|
||||
}
|
||||
|
||||
public void setLen(int len) {
|
||||
this.len = len;
|
||||
}
|
||||
|
||||
public int getPps() {
|
||||
return pps;
|
||||
}
|
||||
|
||||
public void setPps(int pps) {
|
||||
this.pps = pps;
|
||||
}
|
||||
|
||||
public byte[] getSrcData() {
|
||||
return srcData;
|
||||
}
|
||||
|
||||
public void setSrcData(byte[] srcData) {
|
||||
this.srcData = srcData;
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,6 +3,7 @@ package com.imdroid.sideslope.message;
|
||||
import com.imdroid.secapi.dto.GnssStatusMsg;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.sql.Timestamp;
|
||||
|
||||
@ -12,6 +13,7 @@ import java.sql.Timestamp;
|
||||
* @author Layton
|
||||
* @date 2023/2/2 20:38
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper=true)
|
||||
@Data
|
||||
public class D3F0SelfCheckMessage extends BaseMessage {
|
||||
|
||||
@ -20,7 +22,7 @@ public class D3F0SelfCheckMessage extends BaseMessage {
|
||||
@Override
|
||||
public void decodeBody(ByteBuf src) {
|
||||
statusMsg.setDeviceid(getId());
|
||||
statusMsg.setUpdatetime(new Timestamp(System.currentTimeMillis()));
|
||||
statusMsg.setCreatetime(new Timestamp(System.currentTimeMillis()));
|
||||
statusMsg.setDevicetime(new Timestamp(getPps()*1000));
|
||||
statusMsg.setPitch(src.readFloat());
|
||||
statusMsg.setRoll(src.readFloat());
|
||||
|
||||
@ -3,6 +3,7 @@ package com.imdroid.sideslope.message;
|
||||
import com.imdroid.secapi.dto.GnssTrxMsg;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.sql.Timestamp;
|
||||
|
||||
@ -12,14 +13,15 @@ import java.sql.Timestamp;
|
||||
* @author LiGang
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper=true)
|
||||
public class D3F2StopIndicationMessage extends BaseMessage {
|
||||
|
||||
private GnssTrxMsg trxMsg = new GnssTrxMsg();;
|
||||
private GnssTrxMsg trxMsg = new GnssTrxMsg();
|
||||
|
||||
@Override
|
||||
public void decodeBody(ByteBuf src) {
|
||||
trxMsg.setDeviceid(getId());
|
||||
trxMsg.setUpdatetime(new Timestamp(System.currentTimeMillis()));
|
||||
trxMsg.setCreatetime(new Timestamp(System.currentTimeMillis()));
|
||||
trxMsg.setDevicetime(new Timestamp(getPps()*1000));
|
||||
int keys = (this.len - 6) / 5;
|
||||
for (int i = 0; i < keys; i++) {
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package com.imdroid.sideslope.sal;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.imdroid.secapi.dto.GnssCalcData;
|
||||
import com.imdroid.secapi.dto.GnssDevice;
|
||||
import com.imdroid.secapi.dto.GnssDeviceMapper;
|
||||
import com.imdroid.sideslope.service.GNSSDeviceLocationRecordService;
|
||||
@ -62,10 +63,10 @@ public class DbDeviceServiceImpl implements DeviceService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean postLocationRecord(LocationRecordDTO locationRecord) {
|
||||
public boolean postLocationRecord(GnssCalcData locationRecord, boolean isExceed) {
|
||||
ThreadManager.getFixedThreadPool().submit(() -> {
|
||||
try {
|
||||
gnssDeviceLocationRecordService.save(locationRecord);
|
||||
gnssDeviceLocationRecordService.save(locationRecord, isExceed);
|
||||
} catch (Exception e) {
|
||||
logger.error(e.toString());
|
||||
}
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
package com.imdroid.sideslope.sal;
|
||||
|
||||
import com.imdroid.secapi.dto.GnssCalcData;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@ -13,7 +15,7 @@ public interface DeviceService {
|
||||
|
||||
List<Device> findByParentId(String parentId);
|
||||
|
||||
boolean postLocationRecord(LocationRecordDTO locationRecord);
|
||||
boolean postLocationRecord(GnssCalcData locationRecord, boolean isExceed);
|
||||
|
||||
void updateLatestDataTime(String deviceId, Date latestDataTime);
|
||||
}
|
||||
|
||||
@ -2,6 +2,7 @@ package com.imdroid.sideslope.sal;
|
||||
|
||||
import com.google.common.cache.Cache;
|
||||
import com.google.common.cache.CacheBuilder;
|
||||
import com.imdroid.secapi.dto.GnssCalcData;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@ -50,8 +51,8 @@ public class LocalDeviceServiceImpl implements DeviceService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean postLocationRecord(LocationRecordDTO locationRecord) {
|
||||
return delegate.postLocationRecord(locationRecord);
|
||||
public boolean postLocationRecord(GnssCalcData locationRecord, boolean isExceed) {
|
||||
return delegate.postLocationRecord(locationRecord, isExceed);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -1,81 +0,0 @@
|
||||
package com.imdroid.sideslope.sal;
|
||||
|
||||
|
||||
/**
|
||||
* @author Layton
|
||||
* @date 2023/2/15 20:58
|
||||
*/
|
||||
public class LocationRecordDTO {
|
||||
|
||||
private String deviceId;
|
||||
|
||||
/**
|
||||
* 北斗位置(b562),相对坐标
|
||||
*/
|
||||
private String b562;
|
||||
|
||||
/**
|
||||
* 惯导位置(9250),相对坐标
|
||||
*/
|
||||
private String r9250;
|
||||
|
||||
/**
|
||||
* 融合位置,相对坐标
|
||||
*/
|
||||
private String result;
|
||||
|
||||
|
||||
private String flag;
|
||||
|
||||
public LocationRecordDTO() {
|
||||
|
||||
}
|
||||
|
||||
public LocationRecordDTO(String deviceId, String b562, String r9250, String result, String flag) {
|
||||
this.deviceId = deviceId;
|
||||
this.b562 = b562;
|
||||
this.r9250 = r9250;
|
||||
this.result = result;
|
||||
this.flag = flag;
|
||||
}
|
||||
|
||||
public String getFlag() {
|
||||
return flag;
|
||||
}
|
||||
|
||||
public void setFlag(String flag) {
|
||||
this.flag = flag;
|
||||
}
|
||||
|
||||
public String getDeviceId() {
|
||||
return deviceId;
|
||||
}
|
||||
|
||||
public void setDeviceId(String deviceId) {
|
||||
this.deviceId = deviceId;
|
||||
}
|
||||
|
||||
public String getB562() {
|
||||
return b562;
|
||||
}
|
||||
|
||||
public void setB562(String b562) {
|
||||
this.b562 = b562;
|
||||
}
|
||||
|
||||
public String getR9250() {
|
||||
return r9250;
|
||||
}
|
||||
|
||||
public void setR9250(String r9250) {
|
||||
this.r9250 = r9250;
|
||||
}
|
||||
|
||||
public String getResult() {
|
||||
return result;
|
||||
}
|
||||
|
||||
public void setResult(String result) {
|
||||
this.result = result;
|
||||
}
|
||||
}
|
||||
@ -44,7 +44,7 @@ public class DataPersistServiceImpl implements DataPersistService {
|
||||
}
|
||||
//deviceState.setId(SequenceUtil.getSequence());
|
||||
deviceState.setDeviceid(message.getId());
|
||||
deviceState.setUpdatetime(statusMsg.getUpdatetime());
|
||||
deviceState.setUpdatetime(statusMsg.getCreatetime());
|
||||
deviceState.setRoll(statusMsg.getRoll());
|
||||
deviceState.setPitch(statusMsg.getPitch());
|
||||
deviceState.setYaw(statusMsg.getYaw());
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
package com.imdroid.sideslope.service;
|
||||
|
||||
import com.imdroid.secapi.dto.GnssCalcData;
|
||||
import com.imdroid.sideslope.message.D341LocationMessage;
|
||||
import com.imdroid.sideslope.sal.LocationRecordDTO;
|
||||
|
||||
|
||||
/**
|
||||
@ -10,6 +10,6 @@ import com.imdroid.sideslope.sal.LocationRecordDTO;
|
||||
*/
|
||||
public interface GNSSDeviceLocationRecordService {
|
||||
|
||||
public void save(LocationRecordDTO importRecord) throws Exception;
|
||||
public void saveSingleCalcData(D341LocationMessage message);
|
||||
void save(GnssCalcData locationRecord, boolean isExceed) throws Exception;
|
||||
void saveSingleCalcData(D341LocationMessage message);
|
||||
}
|
||||
|
||||
@ -5,13 +5,10 @@ import com.imdroid.secapi.dto.*;
|
||||
import com.imdroid.sideslope.bd.Tilt;
|
||||
import com.imdroid.sideslope.message.D341LocationMessage;
|
||||
import com.imdroid.sideslope.rabbitmq.RabbitmqConfig;
|
||||
import com.imdroid.sideslope.sal.LocationRecordDTO;
|
||||
import com.imdroid.sideslope.util.GsonUtil;
|
||||
import com.imdroid.sideslope.util.NumberUtils;
|
||||
import io.dt20.common.persistence.Attribute;
|
||||
import io.dt20.common.repo.AttributeRepository;
|
||||
import io.dt20.util.SequenceUtil;
|
||||
import io.dt20.util.StringUtil;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
||||
@ -53,40 +50,18 @@ public class GNSSDeviceLocationRecordServiceImpl implements GNSSDeviceLocationRe
|
||||
}
|
||||
|
||||
@Override
|
||||
public void save(LocationRecordDTO importRecord) throws Exception {
|
||||
GnssDevice gnssDevice = gnssDeviceRepository.queryByDeviceId(importRecord.getDeviceId());
|
||||
public void save(GnssCalcData locationRecord, boolean isExceed) {
|
||||
GnssDevice gnssDevice = gnssDeviceRepository.queryByDeviceId(locationRecord.getDeviceid());
|
||||
if(gnssDevice == null) return;
|
||||
|
||||
GnssCalcData locationRecord = new GnssCalcData();
|
||||
locationRecord.setDeviceid(importRecord.getDeviceId());
|
||||
locationRecord.setTenantid(gnssDevice.getTenantid());
|
||||
locationRecord.setCreatetime(new Timestamp(System.currentTimeMillis()));
|
||||
locationRecord.setEnabled(true);
|
||||
locationRecord.setId(SequenceUtil.getSequence());
|
||||
if (!StringUtil.isEmpty(importRecord.getB562())) {
|
||||
String resultStr = NumberUtils.removeBrackets(importRecord.getB562());
|
||||
String[] arr = resultStr.split(",");
|
||||
// 由cm转化为mm
|
||||
locationRecord.setB562e(NumberUtils.scaleTwo(Double.parseDouble(arr[0]) * 10));
|
||||
locationRecord.setB562n(NumberUtils.scaleTwo(Double.parseDouble(arr[1]) * 10));
|
||||
locationRecord.setB562d(NumberUtils.scaleTwo(Double.parseDouble(arr[2]) * 10));
|
||||
}
|
||||
if (!StringUtil.isEmpty(importRecord.getR9250())) {
|
||||
String resultStr = NumberUtils.removeBrackets(importRecord.getR9250());
|
||||
String[] arr = resultStr.split(",");
|
||||
locationRecord.setR9250e(NumberUtils.scaleTwo(arr[0]));
|
||||
locationRecord.setR9250n(NumberUtils.scaleTwo(arr[1]));
|
||||
locationRecord.setR9250d(NumberUtils.scaleTwo(arr[2]));
|
||||
}
|
||||
if (!StringUtil.isEmpty(importRecord.getResult())) {
|
||||
String resultStr = NumberUtils.removeBrackets(importRecord.getResult());
|
||||
String[] arr = resultStr.split(",");
|
||||
locationRecord.setResulte(NumberUtils.scaleTwo(arr[0]));
|
||||
locationRecord.setResultn(NumberUtils.scaleTwo(arr[1]));
|
||||
locationRecord.setResultd(NumberUtils.scaleTwo(arr[2]));
|
||||
|
||||
// 做滤波 水平方向按照shock 若 >1.5 用6h滤波 否则用25h
|
||||
// 垂直方向 用6+12
|
||||
List<Attribute> attributes = attributeRepository.findByObjectAndPid(gnssDevice.getObjectName(), gnssDevice.getId());
|
||||
if (!StringUtil.isEmpty(importRecord.getFlag()) && Boolean.parseBoolean(importRecord.getFlag())) {
|
||||
if (isExceed) {
|
||||
a = 6 * 60 * 60 * 1000;
|
||||
b = 6 * 60 * 60 * 1000;
|
||||
}
|
||||
@ -107,10 +82,9 @@ public class GNSSDeviceLocationRecordServiceImpl implements GNSSDeviceLocationRe
|
||||
}
|
||||
a = 25 * 60 * 60 * 1000;
|
||||
b = 25 * 60 * 60 * 1000;
|
||||
}
|
||||
sendDataToMq(locationRecord);
|
||||
repository.insert(locationRecord);
|
||||
|
||||
repository.insert(locationRecord);
|
||||
//sendDataToMq(locationRecord);
|
||||
}
|
||||
|
||||
public static final String ATTR_B562E = "b562e";
|
||||
|
||||
@ -0,0 +1,58 @@
|
||||
package com.imdroid.beidou.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.imdroid.secapi.dto.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
@Controller
|
||||
public class GnssCalcDataController extends BasicController{
|
||||
@Autowired
|
||||
GnssCalcDataMapper dataMapper;
|
||||
@RequestMapping("/page/gnss_data_calc")
|
||||
public String gnssDataRaw() {
|
||||
return "/page/gnss_data_calc";
|
||||
}
|
||||
|
||||
/**** 推送数据 *****/
|
||||
@RequestMapping("/gnss/data/list_calc")
|
||||
@ResponseBody
|
||||
public JSONObject listMsg(int page, int limit, String searchParams) {
|
||||
Page<GnssCalcData> pageable = new Page<>(page, limit);
|
||||
QueryWrapper<GnssCalcData> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.orderByDesc("createtime");
|
||||
|
||||
// 条件查询
|
||||
if(searchParams != null) {
|
||||
JSONObject search = (JSONObject) JSONObject.parse(searchParams);
|
||||
//设备号
|
||||
String deviceid = search.getString("deviceid");
|
||||
if (!StringUtils.isEmpty(deviceid)) {
|
||||
queryWrapper.like("deviceid", deviceid);
|
||||
}
|
||||
//时间范围
|
||||
String q_start = search.getString("q_start");
|
||||
if (!StringUtils.isEmpty(q_start)) {
|
||||
queryWrapper.ge("createtime", q_start);
|
||||
}
|
||||
String q_end = search.getString("q_end");
|
||||
if (!StringUtils.isEmpty(q_end)) {
|
||||
queryWrapper.le("createtime", q_end+" 23:59:59");
|
||||
}
|
||||
}
|
||||
IPage<GnssCalcData> cs = dataMapper.selectPage(pageable, queryWrapper);
|
||||
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("code", 0);
|
||||
jsonObject.put("msg", "");
|
||||
jsonObject.put("count", cs.getTotal());
|
||||
jsonObject.put("data", cs.getRecords());
|
||||
return jsonObject;
|
||||
}
|
||||
}
|
||||
@ -1,11 +1,13 @@
|
||||
package com.imdroid.beidou.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.imdroid.secapi.dto.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
@ -38,9 +40,31 @@ public class GnssMsgController extends BasicController{
|
||||
/**** 推送数据 *****/
|
||||
@RequestMapping("/gnss/msg/list_all")
|
||||
@ResponseBody
|
||||
public JSONObject listMsg(int page, int limit) {
|
||||
public JSONObject listMsg(int page, int limit, String searchParams) {
|
||||
Page<GnssMsg> pageable = new Page<>(page, limit);
|
||||
IPage<GnssMsg> cs = msgMapper.selectPage(pageable, null);
|
||||
QueryWrapper<GnssMsg> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.orderByDesc("createtime");
|
||||
|
||||
// 条件查询
|
||||
if(searchParams != null) {
|
||||
JSONObject search = (JSONObject) JSONObject.parse(searchParams);
|
||||
//设备号
|
||||
String deviceid = search.getString("deviceid");
|
||||
if (!StringUtils.isEmpty(deviceid)) {
|
||||
queryWrapper.like("deviceid", deviceid);
|
||||
}
|
||||
//时间范围
|
||||
String q_start = search.getString("q_start");
|
||||
if (!StringUtils.isEmpty(q_start)) {
|
||||
queryWrapper.ge("createtime", q_start);
|
||||
}
|
||||
String q_end = search.getString("q_end");
|
||||
if (!StringUtils.isEmpty(q_end)) {
|
||||
queryWrapper.le("createtime", q_end+" 23:59:59");
|
||||
}
|
||||
}
|
||||
|
||||
IPage<GnssMsg> cs = msgMapper.selectPage(pageable, queryWrapper);
|
||||
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("code", 0);
|
||||
@ -52,9 +76,30 @@ public class GnssMsgController extends BasicController{
|
||||
|
||||
@RequestMapping("/gnss/msg/list_status")
|
||||
@ResponseBody
|
||||
public JSONObject listStatusMsg(int page, int limit) {
|
||||
public JSONObject listStatusMsg(int page, int limit, String searchParams) {
|
||||
Page<GnssStatusMsg> pageable = new Page<>(page, limit);
|
||||
IPage<GnssStatusMsg> cs = statusMsgMapper.selectPage(pageable, null);
|
||||
QueryWrapper<GnssStatusMsg> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.orderByDesc("createtime");
|
||||
|
||||
// 条件查询
|
||||
if(searchParams != null) {
|
||||
JSONObject search = (JSONObject) JSONObject.parse(searchParams);
|
||||
//设备号
|
||||
String deviceid = search.getString("deviceid");
|
||||
if (!StringUtils.isEmpty(deviceid)) {
|
||||
queryWrapper.like("deviceid", deviceid);
|
||||
}
|
||||
//时间范围
|
||||
String q_start = search.getString("q_start");
|
||||
if (!StringUtils.isEmpty(q_start)) {
|
||||
queryWrapper.ge("createtime", q_start);
|
||||
}
|
||||
String q_end = search.getString("q_end");
|
||||
if (!StringUtils.isEmpty(q_end)) {
|
||||
queryWrapper.le("createtime", q_end+" 23:59:59");
|
||||
}
|
||||
}
|
||||
IPage<GnssStatusMsg> cs = statusMsgMapper.selectPage(pageable, queryWrapper);
|
||||
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("code", 0);
|
||||
@ -66,9 +111,30 @@ public class GnssMsgController extends BasicController{
|
||||
|
||||
@RequestMapping("/gnss/msg/list_trx")
|
||||
@ResponseBody
|
||||
public JSONObject listTrxMsg(int page, int limit) {
|
||||
public JSONObject listTrxMsg(int page, int limit, String searchParams) {
|
||||
Page<GnssTrxMsg> pageable = new Page<>(page, limit);
|
||||
IPage<GnssTrxMsg> cs = trxMsgMapper.selectPage(pageable, null);
|
||||
QueryWrapper<GnssTrxMsg> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.orderByDesc("createtime");
|
||||
|
||||
// 条件查询
|
||||
if(searchParams != null) {
|
||||
JSONObject search = (JSONObject) JSONObject.parse(searchParams);
|
||||
//设备号
|
||||
String deviceid = search.getString("deviceid");
|
||||
if (!StringUtils.isEmpty(deviceid)) {
|
||||
queryWrapper.like("deviceid", deviceid);
|
||||
}
|
||||
//时间范围
|
||||
String q_start = search.getString("q_start");
|
||||
if (!StringUtils.isEmpty(q_start)) {
|
||||
queryWrapper.ge("createtime", q_start);
|
||||
}
|
||||
String q_end = search.getString("q_end");
|
||||
if (!StringUtils.isEmpty(q_end)) {
|
||||
queryWrapper.le("createtime", q_end+" 23:59:59");
|
||||
}
|
||||
}
|
||||
IPage<GnssTrxMsg> cs = trxMsgMapper.selectPage(pageable, queryWrapper);
|
||||
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("code", 0);
|
||||
|
||||
@ -1,13 +1,14 @@
|
||||
package com.imdroid.beidou.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.imdroid.secapi.dto.GnssMsg;
|
||||
import com.imdroid.secapi.dto.GnssSingleCalcData;
|
||||
import com.imdroid.secapi.dto.GnssSingleCalcDataMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
@ -16,17 +17,37 @@ public class GnssSingleCalcDataController extends BasicController{
|
||||
@Autowired
|
||||
GnssSingleCalcDataMapper dataMapper;
|
||||
@RequestMapping("/page/gnss_data_raw")
|
||||
public String gnssDataRaw()throws Exception {
|
||||
public String gnssDataRaw() {
|
||||
return "/page/gnss_data_raw";
|
||||
}
|
||||
|
||||
/**** 推送数据 *****/
|
||||
@RequestMapping("/gnss/data/list_raw")
|
||||
@ResponseBody
|
||||
public JSONObject listMsg(int page, int limit) {
|
||||
public JSONObject listMsg(int page, int limit, String searchParams) {
|
||||
Page<GnssSingleCalcData> pageable = new Page<>(page, limit);
|
||||
IPage<GnssSingleCalcData> cs = dataMapper.selectPage(pageable, null);
|
||||
QueryWrapper<GnssSingleCalcData> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.orderByDesc("createtime");
|
||||
|
||||
// 条件查询
|
||||
if(searchParams != null) {
|
||||
JSONObject search = (JSONObject) JSONObject.parse(searchParams);
|
||||
//设备号
|
||||
String deviceid = search.getString("deviceid");
|
||||
if (!StringUtils.isEmpty(deviceid)) {
|
||||
queryWrapper.like("deviceid", deviceid);
|
||||
}
|
||||
//时间范围
|
||||
String q_start = search.getString("q_start");
|
||||
if (!StringUtils.isEmpty(q_start)) {
|
||||
queryWrapper.ge("createtime", q_start);
|
||||
}
|
||||
String q_end = search.getString("q_end");
|
||||
if (!StringUtils.isEmpty(q_end)) {
|
||||
queryWrapper.le("createtime", q_end+" 23:59:59");
|
||||
}
|
||||
}
|
||||
IPage<GnssSingleCalcData> cs = dataMapper.selectPage(pageable, queryWrapper);
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("code", 0);
|
||||
jsonObject.put("msg", "");
|
||||
|
||||
@ -6,32 +6,27 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
@Controller
|
||||
public class LayuiController extends BasicController{
|
||||
@RequestMapping("/login")
|
||||
public String login() throws Exception {
|
||||
public String login(){
|
||||
return "/login";
|
||||
}
|
||||
|
||||
@RequestMapping("/")
|
||||
public String index0()throws Exception {
|
||||
public String index0() {
|
||||
return "/index";
|
||||
}
|
||||
|
||||
@RequestMapping("/index")
|
||||
public String index()throws Exception {
|
||||
public String index() {
|
||||
return "/index";
|
||||
}
|
||||
|
||||
@RequestMapping("/page/device_overview")
|
||||
public String deviceOverview()throws Exception {
|
||||
public String deviceOverview() {
|
||||
return "/page/device_overview";
|
||||
}
|
||||
|
||||
@RequestMapping("/page/gnss_data_calc")
|
||||
public String gnssDataCalc()throws Exception {
|
||||
return "/page/gnss_data_calc";
|
||||
}
|
||||
|
||||
@RequestMapping("/page/gnss_data_tools")
|
||||
public String gnssDataTools()throws Exception {
|
||||
public String gnssDataTools() {
|
||||
return "/page/gnss_data_tools";
|
||||
}
|
||||
|
||||
|
||||
@ -124,6 +124,7 @@ CREATE TABLE IF NOT EXISTS `gnssdevicelocationrecords` (
|
||||
`rb562e` double DEFAULT NULL COMMENT '相对北斗位置东E',
|
||||
`rb562d` double DEFAULT NULL COMMENT '相对北斗位置北N',
|
||||
`rb562n` double DEFAULT NULL COMMENT '相对北斗位置天D',
|
||||
`pps` int DEFAULT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_deviceid_time` (`deviceid`,`createtime`) USING BTREE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
@ -154,7 +155,7 @@ CREATE TABLE IF NOT EXISTS `gnssmsg` (
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `gnssstatusmsg` (
|
||||
`id` bigint AUTO_INCREMENT,
|
||||
`updatetime` datetime DEFAULT NULL,
|
||||
`createtime` datetime DEFAULT NULL,
|
||||
`devicetime` datetime DEFAULT NULL,
|
||||
`deviceid` varchar(20) NOT NULL,
|
||||
`roll` float DEFAULT 0,
|
||||
@ -170,7 +171,7 @@ CREATE TABLE IF NOT EXISTS `gnssstatusmsg` (
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `gnsstrxmsg` (
|
||||
`id` bigint AUTO_INCREMENT,
|
||||
`updatetime` datetime DEFAULT NULL,
|
||||
`createtime` datetime DEFAULT NULL,
|
||||
`devicetime` datetime DEFAULT NULL,
|
||||
`deviceid` varchar(20) NOT NULL,
|
||||
`uart1txbytes` int DEFAULT 0,
|
||||
@ -185,3 +186,29 @@ CREATE TABLE IF NOT EXISTS `gnsstrxmsg` (
|
||||
`d3xxbytes` int DEFAULT 0,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `metadatas` (
|
||||
`id` bigint NOT NULL,
|
||||
`object` varchar(32) NOT NULL,
|
||||
`keyname` varchar(32) NOT NULL,
|
||||
`type` varchar(1) NOT NULL,
|
||||
`mandatory` int NOT NULL,
|
||||
`message` varchar(64) DEFAULT NULL,
|
||||
`notes` varchar(256) DEFAULT NULL,
|
||||
`format` varchar(128) DEFAULT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `object` (`object`,`keyname`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `attributes` (
|
||||
`id` bigint NOT NULL,
|
||||
`object` varchar(32) NOT NULL,
|
||||
`pid` bigint NOT NULL,
|
||||
`keyname` varchar(32) NOT NULL,
|
||||
`type` varchar(1) NOT NULL,
|
||||
`valuestring` varchar(255) DEFAULT NULL,
|
||||
`valuenumber` double DEFAULT NULL,
|
||||
`valuedate` datetime DEFAULT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `object` (`object`,`pid`,`keyname`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">设备号</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="username" autocomplete="off" class="layui-input">
|
||||
<input type="text" name="deviceid" id="deviceid" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
@ -45,12 +45,12 @@
|
||||
</div>
|
||||
|
||||
<script th:inline="none">
|
||||
layui.use(['form', 'table','miniPage','element'], function () {
|
||||
layui.use(['form', 'table','miniPage','element','echarts'], function () {
|
||||
var $ = layui.jquery,
|
||||
form = layui.form,
|
||||
table = layui.table,
|
||||
miniPage = layui.miniPage;
|
||||
|
||||
echarts = layui.echarts;
|
||||
var searchDeviceId = false;
|
||||
/**
|
||||
* 初始化表单,要加上,不然刷新部分组件可能会不加载
|
||||
*/
|
||||
@ -58,7 +58,7 @@
|
||||
|
||||
table.render({
|
||||
elem: '#currentTableId',
|
||||
url: 'api/gnss_data_calc.json',//假数据
|
||||
url: '/gnss/data/list_calc',
|
||||
defaultToolbar: ['filter', 'exports', 'print', {
|
||||
title: '提示',
|
||||
layEvent: 'LAYTABLE_TIPS',
|
||||
@ -66,35 +66,33 @@
|
||||
}],
|
||||
cols: [[
|
||||
{field: 'deviceid', title: '设备号'},
|
||||
{field: 'report_time', title: '时间'},
|
||||
{field: 'createtime', title: '上报时间', templet: "<div>{{layui.util.toDateString(d.createtime, 'yyyy-MM-dd HH:mm:ss')}}</div>"},
|
||||
{field: 'b562e', title: '原始东'},
|
||||
{field: 'b562n', title: '原始北'},
|
||||
{field: 'b562d', title: '原始天'},
|
||||
{field: 'roll', title: 'roll'},
|
||||
{field: 'pitch', title: 'pitch'},
|
||||
{field: 'yaw', title: 'yaw'},
|
||||
{field: 'resulte', title: '融合东'},
|
||||
{field: 'resultn', title: '融合北'},
|
||||
{field: 'resultd', title: '融合天'},
|
||||
{field: 'rb562e', title: '相对东'},
|
||||
{field: 'rb562n', title: '相对北'},
|
||||
{field: 'rb562d', title: '相对天'},
|
||||
{field: 'pps', title: '平均延迟'},
|
||||
{field: 'sat_count', title: '卫星数'},
|
||||
{field: 'sat_used', title: '使用卫星数'},
|
||||
{field: 'pps', title: '平均延迟'}
|
||||
]],
|
||||
limits: [10, 15, 20, 25, 50, 100],
|
||||
limit: 15,
|
||||
page: true,
|
||||
skin: 'line'
|
||||
skin: 'line',
|
||||
done: function (result, curr, count) {
|
||||
console.log(searchDeviceId);
|
||||
if(searchDeviceId){
|
||||
showChart(result.data);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// 监听搜索操作
|
||||
form.on('submit(data-search-btn)', function (data) {
|
||||
var result = JSON.stringify(data.field);
|
||||
layer.alert(result, {
|
||||
title: '最终的搜索信息'
|
||||
});
|
||||
var deviceId = $('#deviceid').val();
|
||||
searchDeviceId = !isNaN(parseFloat(deviceId));
|
||||
console.log(searchDeviceId);
|
||||
|
||||
//执行搜索重载
|
||||
table.reload('currentTableId', {
|
||||
@ -109,36 +107,26 @@
|
||||
return false;
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
function showChart(chartData){
|
||||
var echartsDevice = layui.echarts.init(document.getElementById('echarts-gnss'), 'walden');
|
||||
var t = [];
|
||||
var e = [];
|
||||
var n = [];
|
||||
var d = [];
|
||||
var fe = [];
|
||||
var fn = [];
|
||||
var fd = [];
|
||||
|
||||
<script>
|
||||
layui.use(function(){
|
||||
var laydate = layui.laydate;
|
||||
// 日期范围 - 左右面板独立选择模式
|
||||
laydate.render({
|
||||
elem: '#ID-laydate-start-date'
|
||||
});
|
||||
laydate.render({
|
||||
elem: '#ID-laydate-end-date'
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
layui.use(['layer','echarts'], function () {
|
||||
var $ = layui.jquery,
|
||||
layer = layui.layer,
|
||||
echarts = layui.echarts;
|
||||
|
||||
/**
|
||||
* 设备告警
|
||||
*/
|
||||
var echartsDevice = echarts.init(document.getElementById('echarts-gnss'), 'walden');
|
||||
for(var i=0; i<chartData.length; i++){
|
||||
t[i] = chartData[i].createtime;
|
||||
e[i] = chartData[i].b562e;
|
||||
n[i] = chartData[i].b562n;
|
||||
d[i] = chartData[i].b562d;
|
||||
}
|
||||
|
||||
var optionDevice = {
|
||||
title: {
|
||||
text: '累计位移'
|
||||
text: '位移曲线'
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
@ -150,7 +138,7 @@
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
data: ['原始x', '原始y', '原始z','相对x', '相对y', '相对z']
|
||||
data: ['东', '北', '天','平滑东', '平滑北', '平滑天']
|
||||
},
|
||||
toolbox: {
|
||||
feature: {
|
||||
@ -167,7 +155,7 @@
|
||||
{
|
||||
type: 'category',
|
||||
boundaryGap: false,
|
||||
data: ['周一', '周二', '周三', '周四', '周五', '周六', '周日']
|
||||
data: t
|
||||
}
|
||||
],
|
||||
yAxis: [
|
||||
@ -177,34 +165,34 @@
|
||||
],
|
||||
series: [
|
||||
{
|
||||
name: '原始x',
|
||||
name: '东',
|
||||
type: 'line',
|
||||
data: [1, 1.2, 1.3, 1.5, 1.4, 1.3, 1.3]
|
||||
data: e
|
||||
},
|
||||
{
|
||||
name: '原始y',
|
||||
name: '北',
|
||||
type: 'line',
|
||||
data: [0.1, 0.2, 0.3, 0.9, 0.6, 0.4, 0.5]
|
||||
data: n
|
||||
},
|
||||
{
|
||||
name: '原始z',
|
||||
name: '天',
|
||||
type: 'line',
|
||||
data: [1.5, 1.8, 1.7, 1.8, 1.4, 1.6, 1.6]
|
||||
data: d
|
||||
},
|
||||
{
|
||||
name: '相对x',
|
||||
name: '平滑东',
|
||||
type: 'line',
|
||||
data: [1, 1.1, 1.1, 1.2, 1.2, 1.2, 1.2]
|
||||
data: fe
|
||||
},
|
||||
{
|
||||
name: '相对y',
|
||||
name: '平滑北',
|
||||
type: 'line',
|
||||
data: [0.1, 0.1, 0.2, 0.5, 0.4, 0.4, 0.4]
|
||||
data: fn
|
||||
},
|
||||
{
|
||||
name: '相对z',
|
||||
name: '平滑天',
|
||||
type: 'line',
|
||||
data: [1.3, 1.4, 1.4, 1.5, 1.4, 1.5, 1.5]
|
||||
data: fd
|
||||
}
|
||||
]
|
||||
};
|
||||
@ -214,6 +202,21 @@
|
||||
window.onresize = function () {
|
||||
echartsDevice.resize();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<script>
|
||||
layui.use(function(){
|
||||
var laydate = layui.laydate;
|
||||
// 日期范围 - 左右面板独立选择模式
|
||||
laydate.render({
|
||||
elem: '#ID-laydate-start-date'
|
||||
});
|
||||
laydate.render({
|
||||
elem: '#ID-laydate-end-date'
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">设备号</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="username" autocomplete="off" class="layui-input">
|
||||
<input type="text" name="deviceid" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
@ -53,7 +53,7 @@
|
||||
|
||||
table.render({
|
||||
elem: '#currentTableId',
|
||||
url: '/gnss/data/list_raw',//假数据
|
||||
url: '/gnss/data/list_raw',
|
||||
defaultToolbar: ['filter', 'exports', 'print', {
|
||||
title: '提示',
|
||||
layEvent: 'LAYTABLE_TIPS',
|
||||
@ -73,15 +73,17 @@
|
||||
limits: [10, 15, 20, 25, 50, 100],
|
||||
limit: 15,
|
||||
page: true,
|
||||
skin: 'line'
|
||||
skin: 'line',
|
||||
done: function (result, curr, count) {
|
||||
//回调渲染折线图
|
||||
console.log(curr, count);
|
||||
console.log(result);
|
||||
}
|
||||
});
|
||||
|
||||
// 监听搜索操作
|
||||
form.on('submit(data-search-btn)', function (data) {
|
||||
var result = JSON.stringify(data.field);
|
||||
layer.alert(result, {
|
||||
title: '最终的搜索信息'
|
||||
});
|
||||
|
||||
//执行搜索重载
|
||||
table.reload('currentTableId', {
|
||||
|
||||
@ -9,17 +9,16 @@
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">设备号</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="username" autocomplete="off" class="layui-input">
|
||||
<input type="text" name="deviceid" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">消息类型</label>
|
||||
<label class="layui-form-label">范围</label>
|
||||
<div class="layui-input-inline">
|
||||
<select name="device_type" lay-verify="required" lay-search="">
|
||||
<option value="">选择或搜索</option>
|
||||
<option value="1">配置消息</option>
|
||||
<option value="2">状态消息</option>
|
||||
</select>
|
||||
<input type="text" name="q_start" autocomplete="off" id="ID-laydate-start-date" class="layui-input" placeholder="开始日期">
|
||||
</div>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="q_end" autocomplete="off" id="ID-laydate-end-date" class="layui-input" placeholder="结束日期">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
@ -36,16 +35,23 @@
|
||||
</div>
|
||||
|
||||
<script th:inline="none">
|
||||
layui.use(['form', 'table','miniPage','element'], function () {
|
||||
layui.use(['form', 'table', 'laydate'], function () {
|
||||
var $ = layui.jquery,
|
||||
form = layui.form,
|
||||
table = layui.table,
|
||||
miniPage = layui.miniPage;
|
||||
laydate = layui.laydate;
|
||||
/**
|
||||
* 初始化表单,要加上,不然刷新部分组件可能会不加载
|
||||
*/
|
||||
form.render();
|
||||
|
||||
laydate.render({
|
||||
elem: '#ID-laydate-start-date'
|
||||
});
|
||||
laydate.render({
|
||||
elem: '#ID-laydate-end-date'
|
||||
});
|
||||
|
||||
table.render({
|
||||
elem: '#currentTableId',
|
||||
url: '/gnss/msg/list_all',
|
||||
@ -65,9 +71,6 @@
|
||||
// 监听搜索操作
|
||||
form.on('submit(data-search-btn)', function (data) {
|
||||
var result = JSON.stringify(data.field);
|
||||
layer.alert(result, {
|
||||
title: '最终的搜索信息'
|
||||
});
|
||||
|
||||
//执行搜索重载
|
||||
table.reload('currentTableId', {
|
||||
|
||||
@ -9,7 +9,16 @@
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">设备号</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="username" autocomplete="off" class="layui-input">
|
||||
<input type="text" name="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="q_start" autocomplete="off" id="ID-laydate-start-date" class="layui-input" placeholder="开始日期">
|
||||
</div>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="q_end" autocomplete="off" id="ID-laydate-end-date" class="layui-input" placeholder="结束日期">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
@ -26,22 +35,29 @@
|
||||
</div>
|
||||
|
||||
<script th:inline="none">
|
||||
layui.use(['form', 'table','miniPage','element'], function () {
|
||||
layui.use(['form', 'table', 'laydate'], function () {
|
||||
var $ = layui.jquery,
|
||||
form = layui.form,
|
||||
table = layui.table,
|
||||
miniPage = layui.miniPage;
|
||||
laydate = layui.laydate;
|
||||
/**
|
||||
* 初始化表单,要加上,不然刷新部分组件可能会不加载
|
||||
*/
|
||||
form.render();
|
||||
|
||||
laydate.render({
|
||||
elem: '#ID-laydate-start-date'
|
||||
});
|
||||
laydate.render({
|
||||
elem: '#ID-laydate-end-date'
|
||||
});
|
||||
|
||||
table.render({
|
||||
elem: '#currentTableId',
|
||||
url: '/gnss/msg/list_status',
|
||||
cols: [[
|
||||
{field: 'deviceid', title: '设备号'},
|
||||
{field: 'updatetime', title: '上报时间', templet: "<div>{{layui.util.toDateString(d.updatetime, 'yyyy-MM-dd HH:mm:ss')}}</div>"},
|
||||
{field: 'createtime', title: '上报时间', templet: "<div>{{layui.util.toDateString(d.createtime, 'yyyy-MM-dd HH:mm:ss')}}</div>"},
|
||||
{field: 'devicetime', title: '设备时间', templet: "<div>{{layui.util.toDateString(d.devicetime, 'HH:mm:ss')}}</div>"},
|
||||
{field: 'roll', title: 'roll'},
|
||||
{field: 'pitch', title: 'pitch'},
|
||||
@ -60,9 +76,6 @@
|
||||
// 监听搜索操作
|
||||
form.on('submit(data-search-btn)', function (data) {
|
||||
var result = JSON.stringify(data.field);
|
||||
layer.alert(result, {
|
||||
title: '最终的搜索信息'
|
||||
});
|
||||
|
||||
//执行搜索重载
|
||||
table.reload('currentTableId', {
|
||||
|
||||
@ -9,17 +9,16 @@
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">设备号</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="username" autocomplete="off" class="layui-input">
|
||||
<input type="text" name="deviceid" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">统计</label>
|
||||
<label class="layui-form-label">范围</label>
|
||||
<div class="layui-input-inline">
|
||||
<select name="device_type" lay-verify="required" lay-search="">
|
||||
<option value="">选择或搜索</option>
|
||||
<option value="1">日</option>
|
||||
<option value="2">月</option>
|
||||
</select>
|
||||
<input type="text" name="q_start" autocomplete="off" id="ID-laydate-start-date" class="layui-input" placeholder="开始日期">
|
||||
</div>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="q_end" autocomplete="off" id="ID-laydate-end-date" class="layui-input" placeholder="结束日期">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
@ -36,22 +35,29 @@
|
||||
</div>
|
||||
|
||||
<script th:inline="none">
|
||||
layui.use(['form', 'table','miniPage','element'], function () {
|
||||
layui.use(['form', 'table', 'laydate'], function () {
|
||||
var $ = layui.jquery,
|
||||
form = layui.form,
|
||||
table = layui.table,
|
||||
miniPage = layui.miniPage;
|
||||
laydate = layui.laydate;
|
||||
/**
|
||||
* 初始化表单,要加上,不然刷新部分组件可能会不加载
|
||||
*/
|
||||
form.render();
|
||||
|
||||
laydate.render({
|
||||
elem: '#ID-laydate-start-date'
|
||||
});
|
||||
laydate.render({
|
||||
elem: '#ID-laydate-end-date'
|
||||
});
|
||||
|
||||
table.render({
|
||||
elem: '#currentTableId',
|
||||
url: '/gnss/msg/list_trx',
|
||||
cols: [[
|
||||
{field: 'deviceid', title: '设备号'},
|
||||
{field: 'updatetime', title: '上报时间', templet: "<div>{{layui.util.toDateString(d.updatetime, 'yyyy-MM-dd HH:mm:ss')}}</div>"},
|
||||
{field: 'createtime', title: '上报时间', templet: "<div>{{layui.util.toDateString(d.createtime, 'yyyy-MM-dd HH:mm:ss')}}</div>"},
|
||||
{field: 'devicetime', title: '设备时间', templet: "<div>{{layui.util.toDateString(d.devicetime, 'HH:mm:ss')}}</div>"},
|
||||
{field: 'd3xxbytes', title: 'D3XX'},
|
||||
{field: 'b562bytes', title: 'B562'},
|
||||
@ -73,9 +79,6 @@
|
||||
// 监听搜索操作
|
||||
form.on('submit(data-search-btn)', function (data) {
|
||||
var result = JSON.stringify(data.field);
|
||||
layer.alert(result, {
|
||||
title: '最终的搜索信息'
|
||||
});
|
||||
|
||||
//执行搜索重载
|
||||
table.reload('currentTableId', {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user