Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
624a3ce687
8
pom.xml
8
pom.xml
@ -23,6 +23,7 @@
|
||||
<spring-cloud.version>2021.0.5</spring-cloud.version>
|
||||
<logback.version>1.2.3</logback.version>
|
||||
<slf4j.version>1.7.21</slf4j.version>
|
||||
<easyexcel.version>3.3.3</easyexcel.version>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
<java.version>1.8</java.version>
|
||||
@ -67,6 +68,13 @@
|
||||
<version>${logback.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!--alibaba easy excel -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>easyexcel</artifactId>
|
||||
<version>${easyexcel.version}</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
|
||||
@ -69,6 +69,12 @@
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<!--alibaba easy excel -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>easyexcel</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<repositories>
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
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;
|
||||
@ -17,22 +19,57 @@ import java.time.LocalDateTime;
|
||||
@TableName(value = "gnssdevicelocationrecords")
|
||||
public class GnssCalcData {
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
@ExcelIgnore
|
||||
Long id;
|
||||
|
||||
@ExcelProperty("租户id")
|
||||
Integer tenantid;
|
||||
Boolean enabled;
|
||||
LocalDateTime createtime;
|
||||
|
||||
@ExcelProperty("设备编号")
|
||||
String deviceid;
|
||||
|
||||
@ExcelIgnore
|
||||
Boolean enabled;
|
||||
|
||||
@ExcelProperty("记录时间")
|
||||
LocalDateTime createtime;
|
||||
|
||||
@ExcelProperty("北斗位置东")
|
||||
Double b562e;
|
||||
|
||||
@ExcelProperty("北斗位置北")
|
||||
Double b562n;
|
||||
|
||||
@ExcelProperty("北斗位置天")
|
||||
Double b562d;
|
||||
|
||||
@ExcelProperty("惯导位置东")
|
||||
Double r9250e;
|
||||
|
||||
@ExcelProperty("惯导位置北")
|
||||
Double r9250n;
|
||||
|
||||
@ExcelProperty("惯导位置天")
|
||||
Double r9250d;
|
||||
|
||||
@ExcelProperty("融合位置东")
|
||||
Double resulte;
|
||||
|
||||
@ExcelProperty("融合位置北")
|
||||
Double resultn;
|
||||
|
||||
@ExcelProperty("融合位置天")
|
||||
Double resultd;
|
||||
|
||||
@ExcelProperty("相对北斗位置东")
|
||||
Double rb562e;
|
||||
Double rb562d;
|
||||
|
||||
@ExcelProperty("相对北斗位置北")
|
||||
Double rb562n;
|
||||
|
||||
@ExcelProperty("相对北斗位置天")
|
||||
Double rb562d;
|
||||
|
||||
@ExcelProperty("平均延迟")
|
||||
Integer pps;
|
||||
}
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
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;
|
||||
@ -16,12 +18,28 @@ import java.time.LocalDateTime;
|
||||
@TableName(value = "gnssmsg")
|
||||
public class GnssMsg {
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
@ExcelIgnore
|
||||
Long id;
|
||||
|
||||
@ExcelProperty("租户id")
|
||||
Integer tenantid;
|
||||
|
||||
@ExcelProperty("上报时间")
|
||||
LocalDateTime createtime;
|
||||
|
||||
@ExcelProperty("设备编号")
|
||||
String deviceid;
|
||||
|
||||
@ExcelProperty("消息类型")
|
||||
Integer msgtype;
|
||||
|
||||
@ExcelProperty("消息长度")
|
||||
Integer msglen;
|
||||
|
||||
@ExcelProperty("收发")
|
||||
Boolean tx;
|
||||
String content;//只记录部分
|
||||
|
||||
//只记录部分
|
||||
@ExcelProperty("内容")
|
||||
String content;
|
||||
}
|
||||
|
||||
@ -1,5 +1,8 @@
|
||||
package com.imdroid.secapi.dto;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnore;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.imdroid.secapi.easyexcel.LocalTimeStringConverter;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
@ -7,32 +10,77 @@ import java.time.LocalTime;
|
||||
|
||||
@Data
|
||||
public class GnssStatusJoin {
|
||||
@ExcelIgnore
|
||||
Long id;
|
||||
|
||||
@ExcelProperty("租户id")
|
||||
Integer tenantid;
|
||||
|
||||
@ExcelProperty("更新日期时间")
|
||||
LocalDateTime updatetime;
|
||||
|
||||
@ExcelProperty(value = "设备时间", converter = LocalTimeStringConverter.class)
|
||||
LocalTime devicetime;
|
||||
|
||||
@ExcelProperty("设备编号")
|
||||
String deviceid;
|
||||
|
||||
@ExcelProperty("设备位置")
|
||||
String location;
|
||||
|
||||
@ExcelProperty("roll")
|
||||
Float roll;
|
||||
|
||||
@ExcelProperty("pitch")
|
||||
Float pitch;
|
||||
|
||||
@ExcelProperty("yaw")
|
||||
Float yaw;
|
||||
|
||||
@ExcelProperty("rssi")
|
||||
Integer rssi;
|
||||
|
||||
@ExcelProperty("电压")
|
||||
Integer voltage;
|
||||
|
||||
@ExcelProperty("温度")
|
||||
Float temperature;
|
||||
|
||||
@ExcelProperty("湿度")
|
||||
Float humidity;
|
||||
|
||||
@ExcelProperty("可见卫星")
|
||||
Integer satelliteinview;
|
||||
|
||||
@ExcelProperty("使用卫星")
|
||||
Integer satelliteinuse;
|
||||
// 这里的收发都是服务端统计的,终端收发详细统计在msg_trx表里
|
||||
|
||||
@ExcelProperty("txbytes")
|
||||
Integer txbytes;
|
||||
|
||||
@ExcelProperty("rxbytes")
|
||||
Integer rxbytes;
|
||||
|
||||
@ExcelProperty("b562bytes")
|
||||
Integer b562bytes;
|
||||
|
||||
@ExcelProperty("d3xxbytes")
|
||||
Integer d3xxbytes;
|
||||
|
||||
@ExcelProperty("状态")
|
||||
Short state;
|
||||
|
||||
@ExcelProperty("告警编号")
|
||||
Integer warningcode;
|
||||
|
||||
@ExcelProperty("告警状态")
|
||||
Short warning;
|
||||
|
||||
@ExcelProperty("设备类型")
|
||||
Short devicetype;
|
||||
|
||||
@ExcelIgnore
|
||||
Integer group_id;
|
||||
|
||||
}
|
||||
|
||||
@ -1,8 +1,11 @@
|
||||
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 com.imdroid.secapi.easyexcel.LocalTimeStringConverter;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
@ -17,17 +20,42 @@ import java.time.LocalTime;
|
||||
@TableName(value = "gnssstatusmsg")
|
||||
public class GnssStatusMsg {
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
@ExcelIgnore
|
||||
Long id;
|
||||
|
||||
@ExcelProperty("租户id")
|
||||
Integer tenantid;
|
||||
|
||||
@ExcelProperty("上报时间")
|
||||
LocalDateTime createtime;
|
||||
|
||||
@ExcelProperty(value = "设备时间", converter = LocalTimeStringConverter.class)
|
||||
LocalTime devicetime;
|
||||
|
||||
@ExcelProperty("设备编号")
|
||||
String deviceid;
|
||||
|
||||
@ExcelProperty("roll")
|
||||
Float roll;
|
||||
|
||||
@ExcelProperty("pitch")
|
||||
Float pitch;
|
||||
|
||||
@ExcelProperty("yaw")
|
||||
Float yaw;
|
||||
|
||||
@ExcelProperty("dtu状态")
|
||||
Short dtustate;
|
||||
|
||||
@ExcelProperty("信号强度")
|
||||
Short rssi;
|
||||
|
||||
@ExcelProperty("电压")
|
||||
Integer voltage;
|
||||
|
||||
@ExcelProperty("温度")
|
||||
Float temperature;
|
||||
|
||||
@ExcelProperty("湿度")
|
||||
Float humidity;
|
||||
}
|
||||
|
||||
@ -1,8 +1,11 @@
|
||||
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 com.imdroid.secapi.easyexcel.LocalTimeStringConverter;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
@ -17,18 +20,43 @@ import java.time.LocalTime;
|
||||
@TableName(value = "gnsstrxmsg")
|
||||
public class GnssTrxMsg {
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
@ExcelIgnore
|
||||
Long id;
|
||||
|
||||
@ExcelProperty("租户id")
|
||||
Integer tenantid;
|
||||
|
||||
@ExcelProperty("上报时间")
|
||||
LocalDateTime createtime;
|
||||
|
||||
@ExcelProperty(value = "设备时间", converter = LocalTimeStringConverter.class)
|
||||
LocalTime devicetime;
|
||||
|
||||
@ExcelProperty("设备编号")
|
||||
String deviceid;
|
||||
|
||||
@ExcelProperty("串口1发")
|
||||
Integer uart1txbytes;
|
||||
|
||||
@ExcelProperty("串口1收")
|
||||
Integer uart1rxbytes;
|
||||
|
||||
@ExcelProperty("串口1未知")
|
||||
Integer uart1unknown;
|
||||
|
||||
@ExcelProperty("串口2发")
|
||||
Integer uart2txbytes;
|
||||
|
||||
@ExcelProperty("串口2收")
|
||||
Integer uart2rxbytes;
|
||||
|
||||
@ExcelProperty("串口2未知")
|
||||
Integer uart2unknown;
|
||||
|
||||
// 这里的收发都是服务端统计的,终端收发详细统计在msg_trx表里
|
||||
@ExcelProperty("B562")
|
||||
Integer b562bytes;
|
||||
|
||||
@ExcelProperty("D3XX")
|
||||
Integer d3xxbytes;
|
||||
}
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
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;
|
||||
@ -16,12 +18,27 @@ import java.time.LocalDateTime;
|
||||
@TableName(value = "warninginfo")
|
||||
public class WarningMsg {
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
@ExcelIgnore
|
||||
Long id;
|
||||
|
||||
@ExcelProperty("租户id")
|
||||
Integer tenantid;
|
||||
|
||||
@ExcelProperty("上报时间")
|
||||
LocalDateTime createtime;
|
||||
|
||||
@ExcelProperty("设备编号")
|
||||
String deviceid;
|
||||
|
||||
@ExcelProperty("设备类型")
|
||||
Short devicetype;
|
||||
|
||||
@ExcelProperty("告警级别")
|
||||
Short level;
|
||||
|
||||
@ExcelProperty("告警类型")
|
||||
Integer code;
|
||||
|
||||
@ExcelProperty("告警内容")
|
||||
String info;
|
||||
}
|
||||
|
||||
@ -0,0 +1,40 @@
|
||||
package com.imdroid.secapi.easyexcel;
|
||||
|
||||
import com.alibaba.excel.converters.Converter;
|
||||
import com.alibaba.excel.enums.CellDataTypeEnum;
|
||||
import com.alibaba.excel.metadata.GlobalConfiguration;
|
||||
import com.alibaba.excel.metadata.data.WriteCellData;
|
||||
import com.alibaba.excel.metadata.property.ExcelContentProperty;
|
||||
|
||||
import java.time.LocalTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
|
||||
/**
|
||||
* @author LiGang
|
||||
* @date 2024/1/6 13:59
|
||||
*/
|
||||
public class LocalTimeStringConverter implements Converter<LocalTime> {
|
||||
|
||||
@Override
|
||||
public Class supportJavaTypeKey() {
|
||||
return LocalTime.class;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public CellDataTypeEnum supportExcelTypeKey() {
|
||||
return CellDataTypeEnum.STRING;
|
||||
}
|
||||
|
||||
@Override
|
||||
public WriteCellData<?> convertToExcelData(LocalTime localTime, ExcelContentProperty excelContentProperty, GlobalConfiguration globalConfiguration) throws Exception {
|
||||
WriteCellData cellData = new WriteCellData();
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("HH:mm:ss");
|
||||
String cellValue = formatter.format(localTime);
|
||||
cellData.setType(CellDataTypeEnum.STRING);
|
||||
cellData.setStringValue(cellValue);
|
||||
cellData.setData(cellValue);
|
||||
return cellData;
|
||||
}
|
||||
}
|
||||
@ -1,23 +1,26 @@
|
||||
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.beidou.entity.Tenant;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.imdroid.beidou.service.CommonExcelService;
|
||||
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;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpSession;
|
||||
|
||||
/**
|
||||
* gnss设备解算数据 控制器
|
||||
*/
|
||||
@Controller
|
||||
public class GnssCalcDataController extends BasicController{
|
||||
public class GnssCalcDataController extends BasicController implements CommonExcelService<GnssCalcData, GnssCalcData> {
|
||||
@Autowired
|
||||
GnssCalcDataMapper dataMapper;
|
||||
|
||||
@RequestMapping("/page/gnss_data_calc")
|
||||
public String gnssData() {
|
||||
return "/page/gnss_data_calc";
|
||||
@ -26,40 +29,41 @@ public class GnssCalcDataController extends BasicController{
|
||||
/**** 推送数据 *****/
|
||||
@RequestMapping("/gnss/data/list_calc")
|
||||
@ResponseBody
|
||||
public JSONObject listMsg(HttpSession session, int page, int limit, String searchParams) {
|
||||
Page<GnssCalcData> pageable = new Page<>(page, limit);
|
||||
QueryWrapper<GnssCalcData> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.orderByDesc("createtime");
|
||||
Integer tenantId = getTenantId(session);
|
||||
if(tenantId != null && tenantId != Tenant.SAAS_PROVIDER_ID) {
|
||||
queryWrapper.eq("tenantid", tenantId);
|
||||
public JSONObject listMsg(HttpSession session, Integer page, Integer limit, String searchParams) {
|
||||
return this.pageList(session, page, limit, searchParams);
|
||||
}
|
||||
|
||||
// 条件查询
|
||||
if(searchParams != null) {
|
||||
JSONObject search = (JSONObject) JSONObject.parse(searchParams);
|
||||
//设备号
|
||||
String deviceid = search.getString("deviceid");
|
||||
if (!StringUtils.isEmpty(deviceid)) {
|
||||
queryWrapper.like("deviceid", deviceid);
|
||||
/**
|
||||
* 获取实体类的class
|
||||
*
|
||||
* @return 实体类的class
|
||||
*/
|
||||
@Override
|
||||
public Class<GnssCalcData> getEntityClass() {
|
||||
return GnssCalcData.class;
|
||||
}
|
||||
//时间范围
|
||||
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;
|
||||
/**
|
||||
* 获取实体类对应的mybatis mapper
|
||||
*
|
||||
* @return 实体类对应的mybatis mapper
|
||||
*/
|
||||
@Override
|
||||
public BaseMapper<GnssCalcData> getMapper() {
|
||||
return dataMapper;
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param session HttpSession
|
||||
* @param request HttpServletRequest
|
||||
* @param response HttpServletResponse
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping("/gnss/data/calc/export")
|
||||
@ResponseBody
|
||||
public void exportData(HttpSession session, HttpServletRequest request, HttpServletResponse response) throws Exception {
|
||||
this.export(session, request, response);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,27 +1,26 @@
|
||||
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.beidou.entity.Tenant;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.imdroid.beidou.service.CommonExcelService;
|
||||
import com.imdroid.secapi.dto.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.util.StringUtils;
|
||||
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;
|
||||
|
||||
/**
|
||||
* 消息摘要 控制器
|
||||
*/
|
||||
@Controller
|
||||
public class GnssMsgController extends BasicController{
|
||||
@Autowired
|
||||
GnssMsgMapper msgMapper;
|
||||
@Autowired
|
||||
GnssStatusMsgMapper statusMsgMapper;
|
||||
@Autowired
|
||||
GnssTrxMsgMapper trxMsgMapper;
|
||||
@RequiredArgsConstructor
|
||||
public class GnssMsgController extends BasicController implements CommonExcelService<GnssMsg, GnssMsg> {
|
||||
|
||||
private final GnssMsgMapper msgMapper;
|
||||
|
||||
/**** 推送页面 *****/
|
||||
@RequestMapping("/page/gnss_msg")
|
||||
@ -29,134 +28,45 @@ public class GnssMsgController extends BasicController{
|
||||
return "/page/gnss_msg";
|
||||
}
|
||||
|
||||
@RequestMapping("/page/gnss_msg_status")
|
||||
public String gnssStatusMsg() {
|
||||
return "/page/gnss_msg_status";
|
||||
}
|
||||
|
||||
@RequestMapping("/page/gnss_msg_trx")
|
||||
public String gnssTrxMsg(){
|
||||
return "/page/gnss_msg_trx";
|
||||
}
|
||||
|
||||
|
||||
/**** 推送数据 *****/
|
||||
@RequestMapping("/gnss/msg/list_all")
|
||||
@ResponseBody
|
||||
public JSONObject listMsg(HttpSession session, int page, int limit, String searchParams) {
|
||||
Page<GnssMsg> pageable = new Page<>(page, limit);
|
||||
QueryWrapper<GnssMsg> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.orderByDesc("createtime");
|
||||
Integer tenantId = getTenantId(session);
|
||||
if(tenantId != null && tenantId != Tenant.SAAS_PROVIDER_ID) {
|
||||
queryWrapper.eq("tenantid", tenantId);
|
||||
public JSONObject listMsg(HttpSession session, Integer page, Integer limit, String searchParams) {
|
||||
return this.pageList(session, page, limit, searchParams);
|
||||
}
|
||||
|
||||
// 条件查询
|
||||
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);
|
||||
jsonObject.put("msg", "");
|
||||
jsonObject.put("count", cs.getTotal());
|
||||
jsonObject.put("data", cs.getRecords());
|
||||
return jsonObject;
|
||||
}
|
||||
|
||||
@RequestMapping("/gnss/msg/list_status")
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param session HttpSession
|
||||
* @param request HttpServletRequest
|
||||
* @param response HttpServletResponse
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping("/gnss/msg/export")
|
||||
@ResponseBody
|
||||
public JSONObject listStatusMsg(HttpSession session, int page, int limit, String searchParams) {
|
||||
Page<GnssStatusMsg> pageable = new Page<>(page, limit);
|
||||
QueryWrapper<GnssStatusMsg> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.orderByDesc("createtime");
|
||||
Integer tenantId = getTenantId(session);
|
||||
if(tenantId != null && tenantId != Tenant.SAAS_PROVIDER_ID) {
|
||||
queryWrapper.eq("tenantid", tenantId);
|
||||
public void exportData(HttpSession session, HttpServletRequest request, HttpServletResponse response) throws Exception {
|
||||
this.export(session, request, response);
|
||||
}
|
||||
|
||||
// 条件查询
|
||||
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);
|
||||
jsonObject.put("msg", "");
|
||||
jsonObject.put("count", cs.getTotal());
|
||||
jsonObject.put("data", cs.getRecords());
|
||||
return jsonObject;
|
||||
/**
|
||||
* 获取实体类的class
|
||||
*
|
||||
* @return 实体类的class
|
||||
*/
|
||||
@Override
|
||||
public Class<GnssMsg> getEntityClass() {
|
||||
return GnssMsg.class;
|
||||
}
|
||||
|
||||
@RequestMapping("/gnss/msg/list_trx")
|
||||
@ResponseBody
|
||||
public JSONObject listTrxMsg(HttpSession session, int page, int limit, String searchParams) {
|
||||
Page<GnssTrxMsg> pageable = new Page<>(page, limit);
|
||||
QueryWrapper<GnssTrxMsg> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.orderByDesc("createtime");
|
||||
Integer tenantId = getTenantId(session);
|
||||
if(tenantId != null && tenantId != Tenant.SAAS_PROVIDER_ID) {
|
||||
queryWrapper.eq("tenantid", tenantId);
|
||||
/**
|
||||
* 获取实体类对应的mybatis mapper
|
||||
*
|
||||
* @return 实体类对应的mybatis mapper
|
||||
*/
|
||||
@Override
|
||||
public BaseMapper<GnssMsg> getMapper() {
|
||||
return msgMapper;
|
||||
}
|
||||
|
||||
// 条件查询
|
||||
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);
|
||||
jsonObject.put("msg", "");
|
||||
jsonObject.put("count", cs.getTotal());
|
||||
jsonObject.put("data", cs.getRecords());
|
||||
return jsonObject;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,73 @@
|
||||
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.GnssStatusMsg;
|
||||
import com.imdroid.secapi.dto.GnssStatusMsgMapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Controller;
|
||||
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 GnssMsgStatusController extends BasicController implements CommonExcelService<GnssStatusMsg, GnssStatusMsg> {
|
||||
|
||||
private final GnssStatusMsgMapper statusMsgMapper;
|
||||
|
||||
@RequestMapping("/page/gnss_msg_status")
|
||||
public String gnssStatusMsg() {
|
||||
return "/page/gnss_msg_status";
|
||||
}
|
||||
|
||||
@RequestMapping("/gnss/msg/status/list")
|
||||
@ResponseBody
|
||||
public JSONObject listStatusMsg(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("/gnss/msg/status/export")
|
||||
@ResponseBody
|
||||
public void exportData(HttpSession session, HttpServletRequest request, HttpServletResponse response) throws Exception {
|
||||
this.export(session, request, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取实体类的class
|
||||
*
|
||||
* @return 实体类的class
|
||||
*/
|
||||
@Override
|
||||
public Class<GnssStatusMsg> getEntityClass() {
|
||||
return GnssStatusMsg.class;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取实体类对应的mybatis mapper
|
||||
*
|
||||
* @return 实体类对应的mybatis mapper
|
||||
*/
|
||||
@Override
|
||||
public BaseMapper<GnssStatusMsg> getMapper() {
|
||||
return statusMsgMapper;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,73 @@
|
||||
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.GnssTrxMsg;
|
||||
import com.imdroid.secapi.dto.GnssTrxMsgMapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Controller;
|
||||
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;
|
||||
|
||||
/**
|
||||
* gnss统计消息 控制器
|
||||
*
|
||||
* @author LiGang
|
||||
* @date 2024/1/6 15:29
|
||||
*/
|
||||
@Controller
|
||||
@RequiredArgsConstructor
|
||||
public class GnssMsgTrxController extends BasicController implements CommonExcelService<GnssTrxMsg, GnssTrxMsg> {
|
||||
|
||||
private final GnssTrxMsgMapper trxMsgMapper;
|
||||
|
||||
@RequestMapping("/page/gnss_msg_trx")
|
||||
public String gnssTrxMsg(){
|
||||
return "/page/gnss_msg_trx";
|
||||
}
|
||||
|
||||
@RequestMapping("/gnss/msg/trx/list")
|
||||
@ResponseBody
|
||||
public JSONObject listTrxMsg(HttpSession session, int page, int limit, String searchParams) {
|
||||
return this.pageList(session, page, limit, searchParams);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param session HttpSession
|
||||
* @param request HttpServletRequest
|
||||
* @param response HttpServletResponse
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping("/gnss/msg/trx/export")
|
||||
@ResponseBody
|
||||
public void exportData(HttpSession session, HttpServletRequest request, HttpServletResponse response) throws Exception {
|
||||
this.export(session, request, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取实体类的class
|
||||
*
|
||||
* @return 实体类的class
|
||||
*/
|
||||
@Override
|
||||
public Class<GnssTrxMsg> getEntityClass() {
|
||||
return GnssTrxMsg.class;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取实体类对应的mybatis mapper
|
||||
*
|
||||
* @return 实体类对应的mybatis mapper
|
||||
*/
|
||||
@Override
|
||||
public BaseMapper<GnssTrxMsg> getMapper() {
|
||||
return trxMsgMapper;
|
||||
}
|
||||
}
|
||||
@ -1,23 +1,23 @@
|
||||
package com.imdroid.beidou.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.github.yulichang.query.MPJQueryWrapper;
|
||||
import com.imdroid.beidou.entity.Tenant;
|
||||
import com.imdroid.beidou.service.CommonExcelService;
|
||||
import com.imdroid.secapi.dto.GnssStatus;
|
||||
import com.imdroid.secapi.dto.GnssStatusJoin;
|
||||
import com.imdroid.secapi.dto.GnssStatusMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpSession;
|
||||
|
||||
@Controller
|
||||
public class GnssStatusController extends BasicController{
|
||||
public class GnssStatusController extends BasicController implements CommonExcelService<GnssStatus, GnssStatusJoin> {
|
||||
@Autowired
|
||||
GnssStatusMapper gnssStatusMapper;
|
||||
|
||||
@ -33,45 +33,72 @@ public class GnssStatusController extends BasicController{
|
||||
/**** 推送数据 *****/
|
||||
@RequestMapping("/gnss/status/list")
|
||||
@ResponseBody
|
||||
public JSONObject list(HttpSession session, int page, int limit, String searchParams) {
|
||||
MPJQueryWrapper queryWrapper = new MPJQueryWrapper<GnssStatus>()
|
||||
public JSONObject list(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("/gnss/status/export")
|
||||
@ResponseBody
|
||||
public void exportData(HttpSession session, HttpServletRequest request, HttpServletResponse response) throws Exception {
|
||||
this.export(session, request, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取实体类的class
|
||||
*
|
||||
* @return 实体类的class
|
||||
*/
|
||||
@Override
|
||||
public Class<GnssStatusJoin> getEntityClass() {
|
||||
return GnssStatusJoin.class;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取实体类对应的mybatis mapper
|
||||
*
|
||||
* @return 实体类对应的mybatis mapper
|
||||
*/
|
||||
@Override
|
||||
public BaseMapper<GnssStatus> getMapper() {
|
||||
return gnssStatusMapper;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取排序字段,默认降序排序
|
||||
*
|
||||
* @return 排序字段
|
||||
*/
|
||||
@Override
|
||||
public String getOrderByColumn() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 准备QueryWrapper,额外处理
|
||||
*/
|
||||
@Override
|
||||
public MPJQueryWrapper<GnssStatus> prepareQueryWrapper() {
|
||||
return new MPJQueryWrapper<GnssStatus>()
|
||||
.selectAll(GnssStatus.class)
|
||||
.select("d.devicetype as devicetype","d.tenantid as tenantid")
|
||||
.leftJoin("gnssdevices d on t.deviceid = d.deviceid");
|
||||
Integer tenantId = getTenantId(session);
|
||||
if(tenantId != null && tenantId != Tenant.SAAS_PROVIDER_ID) {
|
||||
queryWrapper.eq("tenantid", tenantId);
|
||||
}
|
||||
|
||||
// 条件查询
|
||||
if(searchParams != null) {
|
||||
JSONObject search = (JSONObject) JSONObject.parse(searchParams);
|
||||
//设备号
|
||||
String deviceid = search.getString("deviceid");
|
||||
if (!StringUtils.isEmpty(deviceid)) {
|
||||
queryWrapper.like("d.deviceid", deviceid);
|
||||
/**
|
||||
* 是否联表查询
|
||||
*
|
||||
* @return 是否联表查询
|
||||
*/
|
||||
@Override
|
||||
public boolean isJoinSelect() {
|
||||
return true;
|
||||
}
|
||||
//状态
|
||||
Integer state = search.getInteger("state");
|
||||
if(state!=null && state != QUERY_ALL){
|
||||
queryWrapper.eq("state", state);
|
||||
}
|
||||
//告警
|
||||
Integer warning = search.getInteger("warning");
|
||||
if(warning!=null && warning != QUERY_ALL){
|
||||
queryWrapper.eq("warning", warning);
|
||||
}
|
||||
}
|
||||
|
||||
//分页查询 (需要启用 mybatis plus 分页插件)
|
||||
IPage<GnssStatusJoin> cs = gnssStatusMapper.selectJoinPage(new Page<>(page, limit), GnssStatusJoin.class, queryWrapper);
|
||||
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("code", 0);
|
||||
jsonObject.put("msg", "");
|
||||
jsonObject.put("count", cs.getTotal());
|
||||
jsonObject.put("data", cs.getRecords());
|
||||
return jsonObject;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -2,10 +2,12 @@ package com.imdroid.beidou.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.imdroid.beidou.common.HttpResult;
|
||||
import com.imdroid.beidou.entity.Tenant;
|
||||
import com.imdroid.beidou.service.CommonExcelService;
|
||||
import com.imdroid.secapi.dto.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
@ -14,12 +16,14 @@ import org.springframework.util.StringUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpSession;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@Controller
|
||||
public class WarningController extends BasicController {
|
||||
public class WarningController extends BasicController implements CommonExcelService<WarningMsg, WarningMsg> {
|
||||
@Autowired
|
||||
WarningMsgMapper warningMsgMapper;
|
||||
|
||||
@ -61,52 +65,22 @@ public class WarningController extends BasicController {
|
||||
/**** 推送数据 *****/
|
||||
@RequestMapping("/warning/msg")
|
||||
@ResponseBody
|
||||
public JSONObject listMsg(HttpSession session, int page, int limit, String searchParams) {
|
||||
Page<WarningMsg> pageable = new Page<>(page, limit);
|
||||
QueryWrapper<WarningMsg> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.orderByDesc("createtime");
|
||||
Integer tenantId = getTenantId(session);
|
||||
if (tenantId != null && tenantId != Tenant.SAAS_PROVIDER_ID) {
|
||||
queryWrapper.eq("tenantid", tenantId);
|
||||
public JSONObject listMsg(HttpSession session, Integer page, Integer limit, String searchParams) {
|
||||
return this.pageList(session, page, limit, searchParams);
|
||||
}
|
||||
|
||||
// 条件查询
|
||||
if (searchParams != null) {
|
||||
JSONObject search = (JSONObject) JSONObject.parse(searchParams);
|
||||
//设备号
|
||||
String deviceid = search.getString("deviceid");
|
||||
if (!StringUtils.isEmpty(deviceid)) {
|
||||
queryWrapper.like("deviceid", deviceid);
|
||||
}
|
||||
//设备类型
|
||||
String devicetype = search.getString("devicetype");
|
||||
if (!StringUtils.isEmpty(devicetype)) {
|
||||
queryWrapper.eq("devicetype", devicetype);
|
||||
}
|
||||
//告警级别
|
||||
String level = search.getString("level");
|
||||
if (!StringUtils.isEmpty(level)) {
|
||||
queryWrapper.eq("level", level);
|
||||
}
|
||||
//时间范围
|
||||
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<WarningMsg> cs = warningMsgMapper.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;
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param session HttpSession
|
||||
* @param request HttpServletRequest
|
||||
* @param response HttpServletResponse
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping("/warning/export")
|
||||
@ResponseBody
|
||||
public void exportData(HttpSession session, HttpServletRequest request, HttpServletResponse response) throws Exception {
|
||||
this.export(session, request, response);
|
||||
}
|
||||
|
||||
@RequestMapping("/warning/cfg")
|
||||
@ -138,7 +112,9 @@ public class WarningController extends BasicController {
|
||||
queryWrapper.eq("type", cfg.getType());
|
||||
if (warningCfgMapper.selectCount(queryWrapper) == 0) {
|
||||
num = warningCfgMapper.insert(cfg);
|
||||
} else num = warningCfgMapper.update(cfg, queryWrapper);
|
||||
} else {
|
||||
num = warningCfgMapper.update(cfg, queryWrapper);
|
||||
}
|
||||
|
||||
if (num == 0) {
|
||||
return HttpResult.failed();
|
||||
@ -154,6 +130,28 @@ public class WarningController extends BasicController {
|
||||
int num = warningCfgMapper.deleteById(del_id);
|
||||
if (num == 0) {
|
||||
return HttpResult.failed();
|
||||
} else return HttpResult.ok();
|
||||
} else {
|
||||
return HttpResult.ok();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取实体类的class
|
||||
*
|
||||
* @return 实体类的class
|
||||
*/
|
||||
@Override
|
||||
public Class<WarningMsg> getEntityClass() {
|
||||
return WarningMsg.class;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取实体类对应的mybatis mapper
|
||||
*
|
||||
* @return 实体类对应的mybatis mapper
|
||||
*/
|
||||
@Override
|
||||
public BaseMapper<WarningMsg> getMapper() {
|
||||
return warningMsgMapper;
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,276 @@
|
||||
package com.imdroid.beidou.service;
|
||||
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.AbstractWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.github.yulichang.base.MPJBaseMapper;
|
||||
import com.github.yulichang.query.MPJQueryWrapper;
|
||||
import com.imdroid.beidou.auth.SessionUtils;
|
||||
import com.imdroid.beidou.entity.Tenant;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpSession;
|
||||
import java.util.Enumeration;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 分页查询,excel导出通用类
|
||||
*
|
||||
* @author LiGang
|
||||
* @date 2024/1/4 22:55
|
||||
*/
|
||||
public interface CommonExcelService<T, R> {
|
||||
|
||||
/**
|
||||
* 获取实体类的class
|
||||
*
|
||||
* @return 实体类的class
|
||||
*/
|
||||
Class<R> getEntityClass();
|
||||
|
||||
/**
|
||||
* 获取实体类对应的mybatis mapper
|
||||
*
|
||||
* @return 实体类对应的mybatis mapper
|
||||
*/
|
||||
BaseMapper<T> getMapper();
|
||||
|
||||
/**
|
||||
* 准备QueryWrapper,额外处理
|
||||
*/
|
||||
default AbstractWrapper prepareQueryWrapper() {
|
||||
QueryWrapper<T> queryWrapper = new QueryWrapper<>();
|
||||
if (!StringUtils.isEmpty(getOrderByColumn())) {
|
||||
if ("desc".equals(getOrder())) {
|
||||
queryWrapper.orderByDesc(getOrderByColumn());
|
||||
} else {
|
||||
queryWrapper.orderByAsc(getOrderByColumn());
|
||||
}
|
||||
}
|
||||
return queryWrapper;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取排序字段,默认降序排序
|
||||
*
|
||||
* @return 排序字段
|
||||
*/
|
||||
default String getOrderByColumn() {
|
||||
return "createtime";
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取排序方式,默认降序
|
||||
*
|
||||
* @return 排序方式
|
||||
*/
|
||||
default String getOrder() {
|
||||
return "desc";
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否联表查询
|
||||
*
|
||||
* @return 是否联表查询
|
||||
*/
|
||||
default boolean isJoinSelect() {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param session HttpSession
|
||||
* @param page 页数
|
||||
* @param limit 每页条数
|
||||
* @param searchParams json格式的搜索字段
|
||||
* @return page list record
|
||||
*/
|
||||
default JSONObject pageList(HttpSession session, Integer page, Integer limit, String searchParams) {
|
||||
Page pageable = new Page<>(page == null ? 1 : page, limit == null ? 10 : limit);
|
||||
|
||||
AbstractWrapper queryWrapper = prepareQueryWrapper();
|
||||
|
||||
Integer tenantId = (Integer) session.getAttribute(SessionUtils.SESSION_TENANT_ID);
|
||||
if (tenantId != null && tenantId != Tenant.SAAS_PROVIDER_ID) {
|
||||
queryWrapper.eq("tenantid", tenantId);
|
||||
}
|
||||
|
||||
// 条件查询
|
||||
if (searchParams != null) {
|
||||
JSONObject search = (JSONObject) JSONObject.parse(searchParams);
|
||||
for (Map.Entry<String, Object> entry : search.entrySet()) {
|
||||
setQueryWrapper(queryWrapper, entry.getKey(), entry.getValue());
|
||||
}
|
||||
}
|
||||
IPage<R> cs = null;
|
||||
if (isJoinSelect()) {
|
||||
MPJBaseMapper baseMapper = (MPJBaseMapper) getMapper();
|
||||
MPJQueryWrapper<T> mpjQueryWrapper = (MPJQueryWrapper<T>) queryWrapper;
|
||||
cs = baseMapper.selectJoinPage(pageable, getEntityClass(), mpjQueryWrapper);
|
||||
} else {
|
||||
cs = getMapper().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;
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param session HttpSession
|
||||
* @param request HttpServletRequest
|
||||
* @param response HttpServletResponse
|
||||
* @throws Exception
|
||||
*/
|
||||
default void export(HttpSession session, HttpServletRequest request, HttpServletResponse response) throws Exception {
|
||||
AbstractWrapper queryWrapper = prepareQueryWrapper();
|
||||
|
||||
Integer tenantId = (Integer) session.getAttribute(SessionUtils.SESSION_TENANT_ID);
|
||||
if (tenantId != null && tenantId != Tenant.SAAS_PROVIDER_ID) {
|
||||
queryWrapper.eq("tenantid", tenantId);
|
||||
}
|
||||
|
||||
// 条件查询
|
||||
Enumeration<String> enu = request.getParameterNames();
|
||||
while (enu.hasMoreElements()) {
|
||||
String paraName = (String) enu.nextElement();
|
||||
String paraValue = request.getParameter(paraName);
|
||||
setQueryWrapper(queryWrapper, paraName, paraValue);
|
||||
}
|
||||
List cs = null;
|
||||
if (isJoinSelect()) {
|
||||
MPJBaseMapper baseMapper = (MPJBaseMapper) getMapper();
|
||||
MPJQueryWrapper<T> mpjQueryWrapper = (MPJQueryWrapper<T>) queryWrapper;
|
||||
cs = baseMapper.selectJoinList(getEntityClass(), mpjQueryWrapper);
|
||||
} else {
|
||||
cs = getMapper().selectList(queryWrapper);
|
||||
}
|
||||
// 设置文本内省
|
||||
response.setContentType("application/vnd.ms-excel");
|
||||
// 设置字符编码
|
||||
response.setCharacterEncoding("utf-8");
|
||||
// 设置响应头
|
||||
String filename = System.currentTimeMillis() + "_" + getEntityClass().getSimpleName() + ".xlsx";
|
||||
response.setHeader("Content-disposition", "attachment;filename=" + filename);
|
||||
EasyExcel.write(response.getOutputStream(), getEntityClass()).sheet("sheet").doWrite(cs);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置查询条件
|
||||
*
|
||||
* @param queryWrapper QueryWrapper
|
||||
* @param paraName 查询参数名称
|
||||
* @param paraValue 查询参数值
|
||||
*/
|
||||
default void setQueryWrapper(AbstractWrapper queryWrapper, String paraName, Object paraValue) {
|
||||
// String
|
||||
if (paraName.startsWith("s") && !StringUtils.isEmpty(paraValue)) {
|
||||
addStringQueryWrapper(queryWrapper, paraName, paraValue);
|
||||
}
|
||||
// Number
|
||||
else if (paraName.startsWith("n") && !StringUtils.isEmpty(paraValue)) {
|
||||
addNumberQueryWrapper(queryWrapper, paraName, paraValue);
|
||||
}
|
||||
// Date & Time
|
||||
else if (paraName.startsWith("d") && !StringUtils.isEmpty(paraValue)) {
|
||||
addDateQueryWrapper(queryWrapper, paraName, paraValue);
|
||||
}
|
||||
// Boolean
|
||||
else if (paraName.startsWith("b") && !StringUtils.isEmpty(paraValue)) {
|
||||
addBooleanQueryWrapper(queryWrapper, paraName, paraValue);
|
||||
}
|
||||
}
|
||||
|
||||
default String getColumn(String paraName) {
|
||||
return paraName.substring(paraName.indexOf("_") + 1);
|
||||
}
|
||||
|
||||
default void addStringQueryWrapper(AbstractWrapper queryWrapper, String paraName, Object paraValue) {
|
||||
String column = getColumn(paraName);
|
||||
String value = paraValue.toString();
|
||||
if (StringUtils.isEmpty(value)) {
|
||||
return;
|
||||
}
|
||||
if (paraName.startsWith("s_")) {
|
||||
queryWrapper.eq(column, value);
|
||||
}
|
||||
if (paraName.startsWith("sn_")) {
|
||||
queryWrapper.ne(column, value);
|
||||
}
|
||||
if (paraName.startsWith("sl_")) {
|
||||
queryWrapper.like(column, value);
|
||||
}
|
||||
if (paraName.startsWith("slr_")) {
|
||||
queryWrapper.likeRight(column, value);
|
||||
}
|
||||
if (paraName.startsWith("sll_")) {
|
||||
queryWrapper.likeLeft(column, value);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
default void addNumberQueryWrapper(AbstractWrapper queryWrapper, String paraName, Object paraValue) {
|
||||
String column = getColumn(paraName);
|
||||
if (paraName.startsWith("n_")) {
|
||||
queryWrapper.eq(column, paraValue);
|
||||
}
|
||||
if (paraName.startsWith("nn_")) {
|
||||
queryWrapper.ne(column, paraValue);
|
||||
}
|
||||
if (paraName.startsWith("ngt_")) {
|
||||
queryWrapper.gt(column, paraValue);
|
||||
}
|
||||
if (paraName.startsWith("ngte_")) {
|
||||
queryWrapper.ge(column, paraValue);
|
||||
}
|
||||
if (paraName.startsWith("nlt_")) {
|
||||
queryWrapper.lt(column, paraValue);
|
||||
}
|
||||
if (paraName.startsWith("nlte_")) {
|
||||
queryWrapper.le(column, paraValue);
|
||||
}
|
||||
}
|
||||
|
||||
default void addDateQueryWrapper(AbstractWrapper queryWrapper, String paraName, Object paraValue) {
|
||||
String column = getColumn(paraName);
|
||||
if (paraName.startsWith("d_")) {
|
||||
queryWrapper.eq(column, paraValue);
|
||||
}
|
||||
if (paraName.startsWith("dn_")) {
|
||||
queryWrapper.ne(column, paraValue);
|
||||
}
|
||||
if (paraName.startsWith("dgt_")) {
|
||||
queryWrapper.gt(column, paraValue);
|
||||
}
|
||||
if (paraName.startsWith("dgte_")) {
|
||||
queryWrapper.ge(column, paraValue);
|
||||
}
|
||||
if (paraName.startsWith("dlt_")) {
|
||||
queryWrapper.lt(column, paraValue);
|
||||
}
|
||||
if (paraName.startsWith("dlte_")) {
|
||||
queryWrapper.le(column, paraValue);
|
||||
}
|
||||
}
|
||||
|
||||
default void addBooleanQueryWrapper(AbstractWrapper queryWrapper, String paraName, Object paraValue) {
|
||||
String column = getColumn(paraName);
|
||||
if (paraName.startsWith("b_")) {
|
||||
queryWrapper.eq(column, paraValue);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -16,26 +16,27 @@
|
||||
<fieldset class="table-search-fieldset">
|
||||
<legend>搜索信息</legend>
|
||||
<div style="margin: 10px 10px 10px 10px">
|
||||
<form class="layui-form layui-form-pane" action="">
|
||||
<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="deviceid" id="deviceid" autocomplete="off" class="layui-input">
|
||||
<input type="text" name="sl_deviceid" id="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="开始日期">
|
||||
<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="q_end" autocomplete="off" id="ID-laydate-end-date" class="layui-input" placeholder="结束日期">
|
||||
<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-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>
|
||||
@ -130,6 +131,14 @@
|
||||
return false;
|
||||
});
|
||||
|
||||
// 监听导出操作
|
||||
form.on('submit(data-export-btn)', function (data) {
|
||||
var result = $('#searchFrm').serialize();
|
||||
var u = "/gnss/data/calc/export?" + result;
|
||||
window.open(u, "_blank");
|
||||
return false;
|
||||
});
|
||||
|
||||
function showChart(chartData){
|
||||
var echartsDevice = echarts.init(document.getElementById('echarts-gnss'), 'walden');
|
||||
var t = [];
|
||||
|
||||
@ -16,25 +16,26 @@
|
||||
<fieldset class="table-search-fieldset">
|
||||
<legend>搜索信息</legend>
|
||||
<div style="margin: 10px 10px 10px 10px">
|
||||
<form class="layui-form layui-form-pane" action="">
|
||||
<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="deviceid" autocomplete="off" class="layui-input">
|
||||
<input type="text" name="sl_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="开始日期">
|
||||
<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="q_end" autocomplete="off" id="ID-laydate-end-date" class="layui-input" placeholder="结束日期">
|
||||
<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>
|
||||
@ -48,6 +49,7 @@
|
||||
<script src="../lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
|
||||
<script th:inline="none">
|
||||
layui.use(['form', 'table', 'laydate'], function () {
|
||||
var $ = layui.$;
|
||||
var form = layui.form,
|
||||
table = layui.table,
|
||||
laydate = layui.laydate;
|
||||
@ -97,6 +99,14 @@
|
||||
return false;
|
||||
});
|
||||
|
||||
// 监听导出操作
|
||||
form.on('submit(data-export-btn)', function (data) {
|
||||
var result = $('#searchFrm').serialize();
|
||||
var u = "/gnss/msg/export?" + result;
|
||||
window.open(u, "_blank");
|
||||
return false;
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@ -16,25 +16,26 @@
|
||||
<fieldset class="table-search-fieldset">
|
||||
<legend>搜索信息</legend>
|
||||
<div style="margin: 10px 10px 10px 10px">
|
||||
<form class="layui-form layui-form-pane" action="">
|
||||
<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="deviceid" autocomplete="off" class="layui-input">
|
||||
<input type="text" name="sl_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="开始日期">
|
||||
<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="q_end" autocomplete="off" id="ID-laydate-end-date" class="layui-input" placeholder="结束日期">
|
||||
<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>
|
||||
@ -48,6 +49,7 @@
|
||||
<script src="../lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
|
||||
<script th:inline="none">
|
||||
layui.use(['form', 'table', 'laydate'], function () {
|
||||
var $ = layui.$;
|
||||
var form = layui.form,
|
||||
table = layui.table,
|
||||
laydate = layui.laydate;
|
||||
@ -65,7 +67,7 @@
|
||||
|
||||
table.render({
|
||||
elem: '#currentTableId',
|
||||
url: '/gnss/msg/list_status',
|
||||
url: '/gnss/msg/status/list',
|
||||
cols: [[
|
||||
{field: 'deviceid', title: '设备号'},
|
||||
{field: 'createtime', title: '上报时间', templet: "<div>{{layui.util.toDateString(d.createtime, 'yyyy-MM-dd HH:mm:ss')}}</div>"},
|
||||
@ -101,6 +103,14 @@
|
||||
return false;
|
||||
});
|
||||
|
||||
// 监听导出操作
|
||||
form.on('submit(data-export-btn)', function (data) {
|
||||
var result = $('#searchFrm').serialize();
|
||||
var u = "/gnss/msg/status/export?" + result;
|
||||
window.open(u, "_blank");
|
||||
return false;
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@ -16,25 +16,26 @@
|
||||
<fieldset class="table-search-fieldset">
|
||||
<legend>搜索信息</legend>
|
||||
<div style="margin: 10px 10px 10px 10px">
|
||||
<form class="layui-form layui-form-pane" action="">
|
||||
<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="deviceid" autocomplete="off" class="layui-input">
|
||||
<input type="text" name="sl_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="开始日期">
|
||||
<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="q_end" autocomplete="off" id="ID-laydate-end-date" class="layui-input" placeholder="结束日期">
|
||||
<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>
|
||||
@ -48,6 +49,7 @@
|
||||
<script src="../lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
|
||||
<script th:inline="none">
|
||||
layui.use(['form', 'table', 'laydate'], function () {
|
||||
var $ = layui.$;
|
||||
var form = layui.form,
|
||||
table = layui.table,
|
||||
laydate = layui.laydate;
|
||||
@ -65,7 +67,7 @@
|
||||
|
||||
table.render({
|
||||
elem: '#currentTableId',
|
||||
url: '/gnss/msg/list_trx',
|
||||
url: '/gnss/msg/trx/list',
|
||||
cols: [[
|
||||
{field: 'deviceid', title: '设备号'},
|
||||
{field: 'createtime', title: '上报时间', templet: "<div>{{layui.util.toDateString(d.createtime, 'yyyy-MM-dd HH:mm:ss')}}</div>"},
|
||||
@ -102,6 +104,14 @@
|
||||
return false;
|
||||
});
|
||||
|
||||
// 监听导出操作
|
||||
form.on('submit(data-export-btn)', function (data) {
|
||||
var result = $('#searchFrm').serialize();
|
||||
var u = "/gnss/msg/trx/export?" + result;
|
||||
window.open(u, "_blank");
|
||||
return false;
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@ -16,19 +16,19 @@
|
||||
<fieldset class="table-search-fieldset">
|
||||
<legend>搜索信息</legend>
|
||||
<div style="margin: 10px 10px 10px 10px">
|
||||
<form class="layui-form layui-form-pane" action="">
|
||||
<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="deviceid" autocomplete="off" class="layui-input">
|
||||
<input type="text" name="sl_d.deviceid" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">状态</label>
|
||||
<div class="layui-input-inline">
|
||||
<select name="state" lay-search="">
|
||||
<option value="-1">全部</option>
|
||||
<select name="n_state" lay-search="">
|
||||
<option value="">全部</option>
|
||||
<option value="1">工作</option>
|
||||
<option value="2">休眠</option>
|
||||
<option value="0">掉线</option>
|
||||
@ -38,8 +38,8 @@
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">告警级别</label>
|
||||
<div class="layui-input-inline">
|
||||
<select name="warning" lay-search="">
|
||||
<option value="-1">全部</option>
|
||||
<select name="n_warning" lay-search="">
|
||||
<option value="">全部</option>
|
||||
<option value="0">正常</option>
|
||||
<option value="1">一般</option>
|
||||
<option value="2">严重</option>
|
||||
@ -48,6 +48,7 @@
|
||||
</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>
|
||||
@ -71,7 +72,8 @@
|
||||
<script src="../lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
|
||||
<script th:inline="none">
|
||||
layui.use(['form', 'table'], function () {
|
||||
var form = layui.form,
|
||||
var $ = layui.$,
|
||||
form = layui.form,
|
||||
table = layui.table;
|
||||
|
||||
/**
|
||||
@ -127,6 +129,14 @@
|
||||
return false;
|
||||
});
|
||||
|
||||
// 监听导出操作
|
||||
form.on('submit(data-export-btn)', function (data) {
|
||||
var result = $('#searchFrm').serialize();
|
||||
var u = "/gnss/status/export?" + result;
|
||||
window.open(u, "_blank");
|
||||
return false;
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@ -16,18 +16,18 @@
|
||||
<fieldset class="table-search-fieldset">
|
||||
<legend>搜索信息</legend>
|
||||
<div style="margin: 10px 10px 10px 10px">
|
||||
<form class="layui-form layui-form-pane" action="">
|
||||
<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="deviceid" autocomplete="off" class="layui-input">
|
||||
<input type="text" name="sl_deviceid" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">设备类型</label>
|
||||
<div class="layui-input-inline">
|
||||
<select name="devicetype" lay-search="">
|
||||
<select name="n_devicetype" lay-search="">
|
||||
<option value="">选择或搜索</option>
|
||||
<option value="1">北斗</option>
|
||||
<option value="2">测斜</option>
|
||||
@ -38,7 +38,7 @@
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">告警级别</label>
|
||||
<div class="layui-input-inline">
|
||||
<select name="level" lay-search="">
|
||||
<select name="n_level" lay-search="">
|
||||
<option value="">选择或搜索</option>
|
||||
<option value="1">一般</option>
|
||||
<option value="2">严重</option>
|
||||
@ -48,14 +48,15 @@
|
||||
<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="开始日期">
|
||||
<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="q_end" autocomplete="off" id="ID-laydate-end-date" class="layui-input" placeholder="结束日期">
|
||||
<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>
|
||||
@ -69,6 +70,7 @@
|
||||
<script src="../lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
|
||||
<script th:inline="none">
|
||||
layui.use(['form', 'table', 'laydate'], function () {
|
||||
var $ = layui.$;
|
||||
var form = layui.form,
|
||||
table = layui.table,
|
||||
laydate = layui.laydate;
|
||||
@ -122,6 +124,14 @@
|
||||
return false;
|
||||
});
|
||||
|
||||
// 监听导出操作
|
||||
form.on('submit(data-export-btn)', function (data) {
|
||||
var result = $('#searchFrm').serialize();
|
||||
var u = "/warning/export?" + result;
|
||||
window.open(u, "_blank");
|
||||
return false;
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user