1、优化解算结果曲线显示
This commit is contained in:
parent
84a8f8f9d8
commit
22d2538183
@ -1,11 +1,14 @@
|
|||||||
package com.imdroid.secapi.dto;
|
package com.imdroid.secapi.dto;
|
||||||
|
|
||||||
|
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.base.MPJBaseMapper;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Select;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface GnssCalcDataMapper extends MPJBaseMapper<GnssCalcData> {
|
public interface GnssCalcDataMapper extends MPJBaseMapper<GnssCalcData> {
|
||||||
@Select({"select * from gnssdevicelocationrecords where deviceid = #{deviceId} limit 1"})
|
Page<GnssCalcData> queryByDeviceId(@Param("page") IPage page, @Param("deviceId") String deviceId,
|
||||||
GnssCalcData queryByDeviceId(String deviceId);
|
@Param("beginTime") String beginTime, @Param("endTime") String endTime, @Param("count") Integer count);
|
||||||
}
|
}
|
||||||
|
|||||||
18
sec-api/src/main/resources/mapper/GnssCalcDataMapper.xml
Normal file
18
sec-api/src/main/resources/mapper/GnssCalcDataMapper.xml
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.imdroid.secapi.dto.GnssCalcDataMapper">
|
||||||
|
|
||||||
|
<select id="queryByDeviceId" resultType="com.imdroid.secapi.dto.GnssCalcData">
|
||||||
|
select c.* from (select @n:=@n+1 as n, a.* from (select * from gnssdevicelocationrecords
|
||||||
|
<where>
|
||||||
|
deviceid = #{deviceId}
|
||||||
|
<if test="beginTime != null and beginTime != ''">
|
||||||
|
and createtime >= #{beginTime}
|
||||||
|
</if>
|
||||||
|
<if test="endTime != null and endTime != ''">
|
||||||
|
and createtime <= #{endTime}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
order by createtime desc)a,(select @n:=0)b)c where c.n%#{count}=1
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
@ -20,7 +20,7 @@ public class AuthInterceptor implements HandlerInterceptor {
|
|||||||
@Override
|
@Override
|
||||||
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
|
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
|
||||||
String username = SessionUtils.getCurrentUser(request);
|
String username = SessionUtils.getCurrentUser(request);
|
||||||
if (!StringUtils.isEmpty(username)) {
|
if (!StringUtils.hasText(username)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
String clientType = request.getHeader("x-imdroid-type");
|
String clientType = request.getHeader("x-imdroid-type");
|
||||||
|
|||||||
@ -1,7 +1,9 @@
|
|||||||
package com.imdroid.beidou.controller;
|
package com.imdroid.beidou.controller;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
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.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.github.yulichang.query.MPJQueryWrapper;
|
import com.github.yulichang.query.MPJQueryWrapper;
|
||||||
import com.imdroid.beidou.entity.Tenant;
|
import com.imdroid.beidou.entity.Tenant;
|
||||||
import com.imdroid.beidou.entity.TenantMapper;
|
import com.imdroid.beidou.entity.TenantMapper;
|
||||||
@ -16,6 +18,10 @@ import org.springframework.web.bind.annotation.ResponseBody;
|
|||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import javax.servlet.http.HttpSession;
|
import javax.servlet.http.HttpSession;
|
||||||
|
import java.time.Duration;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
|
import java.util.Enumeration;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -27,20 +33,71 @@ public class GnssCalcDataController extends BasicController implements CommonExc
|
|||||||
GnssCalcDataMapper dataMapper;
|
GnssCalcDataMapper dataMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
TenantMapper tenantMapper;
|
TenantMapper tenantMapper;
|
||||||
|
@Autowired
|
||||||
|
GnssDeviceMapper deviceMapper;
|
||||||
boolean isJoinQuery = false;
|
boolean isJoinQuery = false;
|
||||||
|
final DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||||
|
|
||||||
@RequestMapping("/page/gnss_data_calc")
|
@RequestMapping("/page/gnss_data_calc")
|
||||||
public String gnssData(Model m, HttpSession session) {
|
public String gnssData(Model m, HttpSession session) {
|
||||||
initModel(m, session);
|
initModel(m, session);
|
||||||
List<Tenant> tenants = tenantMapper.selectList(null);
|
List<Tenant> tenants = tenantMapper.selectList(null);
|
||||||
m.addAttribute("tenant_list", tenants);
|
m.addAttribute("tenant_list", tenants);
|
||||||
|
|
||||||
|
if(tenantId != Tenant.SAAS_PROVIDER_ID) {
|
||||||
|
QueryWrapper<GnssDevice> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.eq("tenantid", tenantId);
|
||||||
|
queryWrapper.select("project_id");
|
||||||
|
queryWrapper.groupBy("project_id");
|
||||||
|
List<GnssDevice> gnssDeviceList = deviceMapper.selectList(queryWrapper);
|
||||||
|
m.addAttribute("project_list", gnssDeviceList);
|
||||||
|
}
|
||||||
return "/page/gnss_data_calc";
|
return "/page/gnss_data_calc";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**** 推送数据 *****/
|
/**** 推送数据 *****/
|
||||||
@RequestMapping("/gnss/data/list_calc")
|
@RequestMapping("/gnss/data/list_calc")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public JSONObject listMsg(HttpSession session, Integer page, Integer limit, String searchParams) {
|
public JSONObject listData(HttpSession session, Integer page, Integer limit, String searchParams) {
|
||||||
|
// 检查查询条件
|
||||||
|
JSONObject search = null;
|
||||||
|
if (searchParams != null) {
|
||||||
|
search = (JSONObject) JSONObject.parse(searchParams);
|
||||||
|
String deviceId = search.getString("sl_t.deviceid");
|
||||||
|
Integer freqency = search.getInteger("freqency");
|
||||||
|
String begin = search.getString("dgt_t.createtime");
|
||||||
|
String end = search.getString("dlt_t.createtime");
|
||||||
|
|
||||||
|
if(deviceId != null && !deviceId.isBlank() && freqency!=0){
|
||||||
|
Page pageable = new Page<>(page == null ? 1 : page, limit == null ? 10 : limit);
|
||||||
|
|
||||||
|
// 缺省按1小时采样,如果时间跨度较大,则按最多300条记录的采样率采样
|
||||||
|
int sample = 6;
|
||||||
|
|
||||||
|
if(freqency == 2){
|
||||||
|
LocalDateTime endTime = LocalDateTime.now();
|
||||||
|
LocalDateTime beginTime = endTime.minusDays(30);
|
||||||
|
if(begin!=null && !begin.isBlank()){
|
||||||
|
beginTime = LocalDateTime.parse(begin,df);
|
||||||
|
}
|
||||||
|
if(end!=null && !end.isBlank()){
|
||||||
|
endTime = LocalDateTime.parse(end,df);
|
||||||
|
}
|
||||||
|
Duration duration = Duration.between(beginTime, endTime);
|
||||||
|
int hours = (int)duration.toHours();
|
||||||
|
if(hours > 300) sample = hours*6/300;
|
||||||
|
}
|
||||||
|
Page<GnssCalcData> calcDataList = dataMapper.queryByDeviceId(pageable, deviceId,begin,end,sample);
|
||||||
|
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("code", 0);
|
||||||
|
jsonObject.put("msg", "");
|
||||||
|
jsonObject.put("count", calcDataList.getTotal());
|
||||||
|
jsonObject.put("data", calcDataList.getRecords());
|
||||||
|
return jsonObject;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return this.pageList(session, page, limit, searchParams);
|
return this.pageList(session, page, limit, searchParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -86,6 +143,19 @@ public class GnssCalcDataController extends BasicController implements CommonExc
|
|||||||
}
|
}
|
||||||
else isJoinQuery=false;
|
else isJoinQuery=false;
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
|
public void checkSearchParams(Enumeration<String> enu){
|
||||||
|
isJoinQuery=false;
|
||||||
|
if(enu != null) {
|
||||||
|
while (enu.hasMoreElements()) {
|
||||||
|
if(enu.nextElement().contains("d.parentid")){
|
||||||
|
isJoinQuery = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public MPJQueryWrapper<GnssCalcData> prepareQueryWrapper() {
|
public MPJQueryWrapper<GnssCalcData> prepareQueryWrapper() {
|
||||||
if(isJoinQuery) {
|
if(isJoinQuery) {
|
||||||
|
|||||||
@ -106,22 +106,22 @@ public class GnssDeviceController extends BasicController{
|
|||||||
JSONObject search = (JSONObject) JSONObject.parse(searchParams);
|
JSONObject search = (JSONObject) JSONObject.parse(searchParams);
|
||||||
//设备号
|
//设备号
|
||||||
String deviceid = search.getString("deviceid");
|
String deviceid = search.getString("deviceid");
|
||||||
if (!StringUtils.isEmpty(deviceid)) {
|
if (!StringUtils.hasText(deviceid)) {
|
||||||
queryWrapper.like("deviceid", deviceid);
|
queryWrapper.like("deviceid", deviceid);
|
||||||
}
|
}
|
||||||
//父设备号
|
//父设备号
|
||||||
String parentid = search.getString("parentid");
|
String parentid = search.getString("parentid");
|
||||||
if (!StringUtils.isEmpty(parentid)) {
|
if (!StringUtils.hasText(parentid)) {
|
||||||
queryWrapper.like("parentid", parentid);
|
queryWrapper.like("parentid", parentid);
|
||||||
}
|
}
|
||||||
//项目号
|
//项目号
|
||||||
String project_id = search.getString("project_id");
|
String project_id = search.getString("project_id");
|
||||||
if (!StringUtils.isEmpty(project_id)) {
|
if (!StringUtils.hasText(project_id)) {
|
||||||
queryWrapper.like("project_id", project_id);
|
queryWrapper.like("project_id", project_id);
|
||||||
}
|
}
|
||||||
//所属组织
|
//所属组织
|
||||||
String tenantname = search.getString("tenantname");
|
String tenantname = search.getString("tenantname");
|
||||||
if (!StringUtils.isEmpty(tenantname)) {
|
if (!StringUtils.hasText(tenantname)) {
|
||||||
queryWrapper.like("tenantname", tenantname);
|
queryWrapper.like("tenantname", tenantname);
|
||||||
}
|
}
|
||||||
//设备类型
|
//设备类型
|
||||||
@ -337,12 +337,12 @@ public class GnssDeviceController extends BasicController{
|
|||||||
JSONObject search = (JSONObject) JSONObject.parse(searchParams);
|
JSONObject search = (JSONObject) JSONObject.parse(searchParams);
|
||||||
//设备号
|
//设备号
|
||||||
String deviceid = search.getString("deviceid");
|
String deviceid = search.getString("deviceid");
|
||||||
if (!StringUtils.isEmpty(deviceid)) {
|
if (!StringUtils.hasText(deviceid)) {
|
||||||
queryWrapper.like("deviceid", deviceid);
|
queryWrapper.like("deviceid", deviceid);
|
||||||
}
|
}
|
||||||
//父设备号
|
//父设备号
|
||||||
String parentid = search.getString("parentid");
|
String parentid = search.getString("parentid");
|
||||||
if (!StringUtils.isEmpty(parentid)) {
|
if (!StringUtils.hasText(parentid)) {
|
||||||
queryWrapper.like("parentid", parentid);
|
queryWrapper.like("parentid", parentid);
|
||||||
}
|
}
|
||||||
//设备类型
|
//设备类型
|
||||||
@ -367,4 +367,48 @@ public class GnssDeviceController extends BasicController{
|
|||||||
return jsonObject;
|
return jsonObject;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@RequestMapping("/gnss/device/q_project")
|
||||||
|
@ResponseBody
|
||||||
|
public JSONObject queryProject(HttpSession session, Integer tenantid) {
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
if(tenantid != null){
|
||||||
|
QueryWrapper<GnssDevice> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.eq("tenantid",tenantid);
|
||||||
|
queryWrapper.select("project_id");
|
||||||
|
queryWrapper.groupBy("project_id");
|
||||||
|
List<GnssDevice> gnssDeviceList = gnssDeviceMapper.selectList(queryWrapper);
|
||||||
|
jsonObject.put("data",gnssDeviceList);
|
||||||
|
}
|
||||||
|
return jsonObject;
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping("/gnss/device/q_parentid")
|
||||||
|
@ResponseBody
|
||||||
|
public JSONObject queryParent(HttpSession session, String projectid) {
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
if(projectid != null){
|
||||||
|
QueryWrapper<GnssDevice> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.eq("project_id",projectid);
|
||||||
|
queryWrapper.select("parentid");
|
||||||
|
queryWrapper.groupBy("parentid");
|
||||||
|
List<GnssDevice> gnssDeviceList = gnssDeviceMapper.selectList(queryWrapper);
|
||||||
|
jsonObject.put("data",gnssDeviceList);
|
||||||
|
}
|
||||||
|
return jsonObject;
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping("/gnss/device/q_deviceid")
|
||||||
|
@ResponseBody
|
||||||
|
public JSONObject queryDevice(HttpSession session, String parentid) {
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
if(parentid != null){
|
||||||
|
QueryWrapper<GnssDevice> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.eq("parentid",parentid);
|
||||||
|
queryWrapper.select("deviceid");
|
||||||
|
queryWrapper.groupBy("deviceid");
|
||||||
|
List<GnssDevice> gnssDeviceList = gnssDeviceMapper.selectList(queryWrapper);
|
||||||
|
jsonObject.put("data",gnssDeviceList);
|
||||||
|
}
|
||||||
|
return jsonObject;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -54,7 +54,7 @@ public class OssFileController {
|
|||||||
@RequestMapping("/upload-device-image")
|
@RequestMapping("/upload-device-image")
|
||||||
public HttpResult upload(@RequestParam("file") MultipartFile multipartFile, String deviceId) throws Exception {
|
public HttpResult upload(@RequestParam("file") MultipartFile multipartFile, String deviceId) throws Exception {
|
||||||
System.out.println("upload device image:" + multipartFile.getOriginalFilename());
|
System.out.println("upload device image:" + multipartFile.getOriginalFilename());
|
||||||
if (StringUtils.isEmpty(deviceId)) {
|
if (StringUtils.hasText(deviceId)) {
|
||||||
return HttpResult.fail("设备编号不能为空");
|
return HttpResult.fail("设备编号不能为空");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -47,7 +47,7 @@ public interface CommonExcelService<T, R> {
|
|||||||
*/
|
*/
|
||||||
default AbstractWrapper prepareQueryWrapper() {
|
default AbstractWrapper prepareQueryWrapper() {
|
||||||
QueryWrapper<T> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<T> queryWrapper = new QueryWrapper<>();
|
||||||
if (!StringUtils.isEmpty(getOrderByColumn())) {
|
if (!StringUtils.hasText(getOrderByColumn())) {
|
||||||
if ("desc".equals(getOrder())) {
|
if ("desc".equals(getOrder())) {
|
||||||
queryWrapper.orderByDesc(getOrderByColumn());
|
queryWrapper.orderByDesc(getOrderByColumn());
|
||||||
} else {
|
} else {
|
||||||
@ -146,6 +146,7 @@ public interface CommonExcelService<T, R> {
|
|||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
default void export(HttpSession session, HttpServletRequest request, HttpServletResponse response) throws Exception {
|
default void export(HttpSession session, HttpServletRequest request, HttpServletResponse response) throws Exception {
|
||||||
|
checkSearchParams(request.getParameterNames());
|
||||||
AbstractWrapper queryWrapper = prepareQueryWrapper();
|
AbstractWrapper queryWrapper = prepareQueryWrapper();
|
||||||
|
|
||||||
Integer tenantId = (Integer) session.getAttribute(SessionUtils.SESSION_TENANT_ID);
|
Integer tenantId = (Integer) session.getAttribute(SessionUtils.SESSION_TENANT_ID);
|
||||||
@ -160,6 +161,7 @@ public interface CommonExcelService<T, R> {
|
|||||||
String paraValue = request.getParameter(paraName);
|
String paraValue = request.getParameter(paraName);
|
||||||
setQueryWrapper(queryWrapper, paraName, paraValue);
|
setQueryWrapper(queryWrapper, paraName, paraValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
List cs = null;
|
List cs = null;
|
||||||
if (isJoinSelect()) {
|
if (isJoinSelect()) {
|
||||||
MPJBaseMapper baseMapper = (MPJBaseMapper) getMapper();
|
MPJBaseMapper baseMapper = (MPJBaseMapper) getMapper();
|
||||||
@ -179,6 +181,7 @@ public interface CommonExcelService<T, R> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
default void checkSearchParams(JSONObject search){}
|
default void checkSearchParams(JSONObject search){}
|
||||||
|
default void checkSearchParams(Enumeration<String> enu){}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置查询条件
|
* 设置查询条件
|
||||||
@ -189,19 +192,19 @@ public interface CommonExcelService<T, R> {
|
|||||||
*/
|
*/
|
||||||
default void setQueryWrapper(AbstractWrapper queryWrapper, String paraName, Object paraValue) {
|
default void setQueryWrapper(AbstractWrapper queryWrapper, String paraName, Object paraValue) {
|
||||||
// String
|
// String
|
||||||
if (paraName.startsWith("s") && !StringUtils.isEmpty(paraValue)) {
|
if (paraName.startsWith("s") && !StringUtils.hasText((String)paraValue)) {
|
||||||
addStringQueryWrapper(queryWrapper, paraName, paraValue);
|
addStringQueryWrapper(queryWrapper, paraName, paraValue);
|
||||||
}
|
}
|
||||||
// Number
|
// Number
|
||||||
else if (paraName.startsWith("n") && !StringUtils.isEmpty(paraValue)) {
|
else if (paraName.startsWith("n") && !StringUtils.hasText((String)paraValue)) {
|
||||||
addNumberQueryWrapper(queryWrapper, paraName, paraValue);
|
addNumberQueryWrapper(queryWrapper, paraName, paraValue);
|
||||||
}
|
}
|
||||||
// Date & Time
|
// Date & Time
|
||||||
else if (paraName.startsWith("d") && !StringUtils.isEmpty(paraValue)) {
|
else if (paraName.startsWith("d") && !StringUtils.hasText((String)paraValue)) {
|
||||||
addDateQueryWrapper(queryWrapper, paraName, paraValue);
|
addDateQueryWrapper(queryWrapper, paraName, paraValue);
|
||||||
}
|
}
|
||||||
// Boolean
|
// Boolean
|
||||||
else if (paraName.startsWith("b") && !StringUtils.isEmpty(paraValue)) {
|
else if (paraName.startsWith("b") && !StringUtils.hasText((String)paraValue)) {
|
||||||
addBooleanQueryWrapper(queryWrapper, paraName, paraValue);
|
addBooleanQueryWrapper(queryWrapper, paraName, paraValue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -213,7 +216,7 @@ public interface CommonExcelService<T, R> {
|
|||||||
default void addStringQueryWrapper(AbstractWrapper queryWrapper, String paraName, Object paraValue) {
|
default void addStringQueryWrapper(AbstractWrapper queryWrapper, String paraName, Object paraValue) {
|
||||||
String column = getColumn(paraName);
|
String column = getColumn(paraName);
|
||||||
String value = paraValue.toString();
|
String value = paraValue.toString();
|
||||||
if (StringUtils.isEmpty(value)) {
|
if (StringUtils.hasText(value)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (paraName.startsWith("s_")) {
|
if (paraName.startsWith("s_")) {
|
||||||
|
|||||||
@ -21,22 +21,36 @@
|
|||||||
<div class="layui-inline">
|
<div class="layui-inline">
|
||||||
<label class="layui-form-label">设备号</label>
|
<label class="layui-form-label">设备号</label>
|
||||||
<div class="layui-input-inline">
|
<div class="layui-input-inline">
|
||||||
<input type="text" name="sl_t.deviceid" id="deviceid" autocomplete="off" class="layui-input">
|
<input type="text" name="sl_t.deviceid" id="input_deviceid" class="layui-input" style="position:absolute;z-index:2;width:85%;" value="" autocomplete="off">
|
||||||
|
<select id="deviceid" lay-search="" lay-filter="device" >
|
||||||
|
<option value="">全部</option>
|
||||||
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="layui-inline" th:if="${tenant_id==0}">
|
<div class="layui-inline" th:if="${tenant_id==0}">
|
||||||
<label class="layui-form-label">所属部门</label>
|
<label class="layui-form-label">所属部门</label>
|
||||||
<div class="layui-input-inline">
|
<div class="layui-input-inline">
|
||||||
<select name="n_t.tenantid" id="tenantid" lay-search="">
|
<select name="n_t.tenantid" id="tenantid" lay-search="" lay-filter="tenant">
|
||||||
<option value="">全部</option>
|
<option value="">全部</option>
|
||||||
<option th:each="item : ${tenant_list}" th:text="${item.name}" th:value="${item.id}"></option>
|
<option th:each="item : ${tenant_list}" th:text="${item.name}" th:value="${item.id}"></option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="layui-inline">
|
<div class="layui-inline">
|
||||||
<label class="layui-form-label">关联基站号</label>
|
<label class="layui-form-label">所属项目</label>
|
||||||
<div class="layui-input-inline">
|
<div class="layui-input-inline">
|
||||||
<input type="text" name="sl_d.parentid" autocomplete="off" class="layui-input">
|
<select name="project_id" id="projectid" lay-search="" lay-filter="project">
|
||||||
|
<option value="">全部</option>
|
||||||
|
<option th:each="item : ${project_list}" th:text="${item.project_id}" th:value="${item.project_id}"></option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="layui-inline">
|
||||||
|
<label class="layui-form-label">所属基站</label>
|
||||||
|
<div class="layui-input-inline">
|
||||||
|
<select name="sl_d.parentid" id="parentid" lay-search="" lay-filter="ref_device">
|
||||||
|
<option value="">全部</option>
|
||||||
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="layui-inline">
|
<div class="layui-inline">
|
||||||
@ -48,6 +62,16 @@
|
|||||||
<input type="text" name="dlt_t.createtime" autocomplete="off" id="ID-laydate-end-date" class="layui-input" placeholder="结束日期">
|
<input type="text" name="dlt_t.createtime" autocomplete="off" id="ID-laydate-end-date" class="layui-input" placeholder="结束日期">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="layui-inline">
|
||||||
|
<label class="layui-form-label">粒度</label>
|
||||||
|
<div class="layui-input-inline">
|
||||||
|
<select name="freqency" id="freqency" lay-search="">
|
||||||
|
<option value="0">次</option>
|
||||||
|
<option value="1">小时</option>
|
||||||
|
<option value="2">自动</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="layui-inline">
|
<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>
|
||||||
@ -58,18 +82,27 @@
|
|||||||
</div>
|
</div>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
<table class="layui-hide" id="currentTableId" lay-filter="currentTableFilter"></table>
|
<div class="layui-tab layui-tab-card" lay-filter="data-tab">
|
||||||
|
<ul class="layui-tab-title">
|
||||||
|
<li class="layui-this">数据表格</li>
|
||||||
|
<li>单个设备曲线</li>
|
||||||
|
</ul>
|
||||||
|
<div class="layui-tab-content">
|
||||||
|
<div class="layui-tab-item layui-show">
|
||||||
|
<table class="layui-hide" id="currentTableId" lay-filter="currentTableFilter"></table>
|
||||||
|
</div>
|
||||||
|
<div class="layui-tab-item">
|
||||||
|
<div id="echarts-gnss" style="min-height:300px;padding: 10px"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<script type="text/html" id="currentTableBar">
|
<script type="text/html" id="currentTableBar">
|
||||||
<a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="cmd">命令行</a>
|
<a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="cmd">命令行</a>
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="layuimini-main">
|
|
||||||
<div class="layui-row layui-col-space15">
|
|
||||||
<div id="echarts-gnss" style="background-color:#ffffff;min-height:300px;padding: 10px"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="../js/lay-module/echarts/echartsTheme.js" charset="utf-8"></script>
|
<script src="../js/lay-module/echarts/echartsTheme.js" charset="utf-8"></script>
|
||||||
@ -82,6 +115,7 @@
|
|||||||
table = layui.table,
|
table = layui.table,
|
||||||
laydate = layui.laydate;
|
laydate = layui.laydate;
|
||||||
var searchDeviceId = false;
|
var searchDeviceId = false;
|
||||||
|
var echartsDevice = echarts.init(document.getElementById('echarts-gnss'), 'walden');
|
||||||
var data_cols = [
|
var data_cols = [
|
||||||
{field: 'deviceid', title: '设备号'},
|
{field: 'deviceid', title: '设备号'},
|
||||||
{field: 'createtime', title: '产生时间', width:'18%', templet: "<div>{{layui.util.toDateString(d.createtime, 'yyyy-MM-dd HH:mm:ss')}}</div>"},
|
{field: 'createtime', title: '产生时间', width:'18%', templet: "<div>{{layui.util.toDateString(d.createtime, 'yyyy-MM-dd HH:mm:ss')}}</div>"},
|
||||||
@ -123,7 +157,7 @@
|
|||||||
cols: [
|
cols: [
|
||||||
data_cols
|
data_cols
|
||||||
],
|
],
|
||||||
limits: [10, 15, 20, 25, 50, 100],
|
limits: [10, 50, 100, 200, 300],
|
||||||
limit: 15,
|
limit: 15,
|
||||||
page: true,
|
page: true,
|
||||||
skin: 'line',
|
skin: 'line',
|
||||||
@ -160,8 +194,92 @@
|
|||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
form.on('select(device)', function (data) {
|
||||||
|
//对select和input进行监控渲染
|
||||||
|
if (data.value != "") {
|
||||||
|
$("#input_deviceid").val(data.value);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// 所属部门下拉框改变,修改项目下拉框
|
||||||
|
form.on('select(tenant)', function (data) {
|
||||||
|
//console.log(data.value);
|
||||||
|
$.ajax({
|
||||||
|
type:"GET",
|
||||||
|
url:"/gnss/device/q_project",
|
||||||
|
data:{
|
||||||
|
'tenantid':data.value
|
||||||
|
},
|
||||||
|
success: function(result) {
|
||||||
|
$('#projectid').empty();
|
||||||
|
$('#projectid').append(new Option("全部", ""));
|
||||||
|
$('#parentid').empty();
|
||||||
|
$('#parentid').append(new Option("全部", ""));
|
||||||
|
$('#deviceid').empty();
|
||||||
|
//console.log(result);
|
||||||
|
$.each(result.data, function (index, item) {
|
||||||
|
$('#projectid')
|
||||||
|
.append(new Option(item.project_id, item.project_id));
|
||||||
|
});
|
||||||
|
layui.form.render("select");
|
||||||
|
},
|
||||||
|
error: function () {
|
||||||
|
console.log("ajax error");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
// 项目下拉框改变,修改基站下拉框
|
||||||
|
form.on('select(project)', function (data) {
|
||||||
|
$.ajax({
|
||||||
|
type:"GET",
|
||||||
|
url:"/gnss/device/q_parentid",
|
||||||
|
data:{
|
||||||
|
'projectid':data.value
|
||||||
|
},
|
||||||
|
success: function(result) {
|
||||||
|
$('#parentid').empty();
|
||||||
|
$('#parentid').append(new Option("全部", ""));
|
||||||
|
//console.log(result);
|
||||||
|
$.each(result.data, function (index, item) {
|
||||||
|
$('#parentid').append(new Option(item.parentid, item.parentid));
|
||||||
|
});
|
||||||
|
layui.form.render("select");
|
||||||
|
},
|
||||||
|
error: function () {
|
||||||
|
console.log("ajax error");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
//基站下拉框改变,修改设备号下拉框
|
||||||
|
form.on('select(ref_device)', function (data) {
|
||||||
|
$.ajax({
|
||||||
|
type:"GET",
|
||||||
|
url:"/gnss/device/q_deviceid",
|
||||||
|
data:{
|
||||||
|
'parentid':data.value
|
||||||
|
},
|
||||||
|
success: function(result) {
|
||||||
|
$('#deviceid').empty();
|
||||||
|
//console.log(result);
|
||||||
|
$.each(result.data, function (index, item) {
|
||||||
|
$('#deviceid').append(new Option(item.deviceid, item.deviceid));
|
||||||
|
});
|
||||||
|
layui.form.render("select");
|
||||||
|
},
|
||||||
|
error: function () {
|
||||||
|
console.log("ajax error");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
//监听Tab切换,重新resize图表,否则显示不出来
|
||||||
|
layui.element.on('tab(data-tab)', function(data){
|
||||||
|
if (data.index == 1) {
|
||||||
|
echartsDevice.resize();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
function showChart(chartData){
|
function showChart(chartData){
|
||||||
var echartsDevice = echarts.init(document.getElementById('echarts-gnss'), 'walden');
|
|
||||||
var t = [];
|
var t = [];
|
||||||
var e = [];
|
var e = [];
|
||||||
var n = [];
|
var n = [];
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user