Commit 99c38505 authored by kiritoausna's avatar kiritoausna

2022-4-25

parent 3e7c9a85
......@@ -16,6 +16,7 @@
package me.zhengjie.annotation;
import me.zhengjie.aspect.LimitType;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
......
......@@ -16,17 +16,13 @@
package me.zhengjie.annotation.rest;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import me.zhengjie.annotation.AnonymousAccess;
import org.springframework.core.annotation.AliasFor;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import java.lang.annotation.*;
/**
* Annotation for mapping HTTP {@code DELETE} requests onto specific handler
* methods.
......
......@@ -16,17 +16,13 @@
package me.zhengjie.annotation.rest;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import me.zhengjie.annotation.AnonymousAccess;
import org.springframework.core.annotation.AliasFor;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import java.lang.annotation.*;
/**
* Annotation for mapping HTTP {@code GET} requests onto specific handler
* methods.
......
......@@ -16,17 +16,13 @@
package me.zhengjie.annotation.rest;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import me.zhengjie.annotation.AnonymousAccess;
import org.springframework.core.annotation.AliasFor;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import java.lang.annotation.*;
/**
* Annotation for mapping HTTP {@code PATCH} requests onto specific handler
* methods.
......
......@@ -16,17 +16,13 @@
package me.zhengjie.annotation.rest;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import me.zhengjie.annotation.AnonymousAccess;
import org.springframework.core.annotation.AliasFor;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import java.lang.annotation.*;
/**
* Annotation for mapping HTTP {@code POST} requests onto specific handler
* methods.
......
......@@ -16,17 +16,13 @@
package me.zhengjie.annotation.rest;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import me.zhengjie.annotation.AnonymousAccess;
import org.springframework.core.annotation.AliasFor;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import java.lang.annotation.*;
/**
* Annotation for mapping HTTP {@code PUT} requests onto specific handler
* methods.
......
......@@ -31,6 +31,7 @@ import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.script.DefaultRedisScript;
import org.springframework.data.redis.core.script.RedisScript;
import org.springframework.stereotype.Component;
import javax.servlet.http.HttpServletRequest;
import java.lang.reflect.Method;
......
......@@ -3,6 +3,7 @@ package me.zhengjie.base;
import lombok.Getter;
import lombok.Setter;
import org.apache.commons.lang3.builder.ToStringBuilder;
import java.io.Serializable;
import java.lang.reflect.Field;
import java.sql.Timestamp;
......
......@@ -24,6 +24,7 @@ import org.hibernate.annotations.UpdateTimestamp;
import org.springframework.data.annotation.CreatedBy;
import org.springframework.data.annotation.LastModifiedBy;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import javax.persistence.Column;
import javax.persistence.EntityListeners;
import javax.persistence.MappedSuperclass;
......
......@@ -18,6 +18,7 @@ package me.zhengjie.config;
import me.zhengjie.utils.SecurityUtils;
import org.springframework.data.domain.AuditorAware;
import org.springframework.stereotype.Component;
import java.util.Optional;
/**
......
......@@ -16,7 +16,6 @@
package me.zhengjie.config;
import lombok.Data;
import me.zhengjie.utils.StringUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
......
......@@ -18,6 +18,7 @@ package me.zhengjie.config;
import me.zhengjie.utils.SecurityUtils;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.stereotype.Service;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
......
......@@ -39,6 +39,7 @@ import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.serializer.RedisSerializationContext;
import org.springframework.data.redis.serializer.RedisSerializer;
import reactor.util.annotation.Nullable;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.time.Duration;
......
......@@ -34,8 +34,10 @@ import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spi.service.contexts.SecurityContext;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
import java.util.ArrayList;
import java.util.List;
import static com.google.common.collect.Lists.newArrayList;
import static springfox.documentation.schema.AlternateTypeRules.newRule;
......
......@@ -17,6 +17,7 @@ package me.zhengjie.exception;
import lombok.Getter;
import org.springframework.http.HttpStatus;
import static org.springframework.http.HttpStatus.BAD_REQUEST;
/**
......
......@@ -17,6 +17,7 @@ package me.zhengjie.exception.handler;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.time.LocalDateTime;
/**
......
......@@ -26,8 +26,10 @@ import org.springframework.security.authentication.BadCredentialsException;
import org.springframework.web.bind.MethodArgumentNotValidException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import java.util.Objects;
import static org.springframework.http.HttpStatus.*;
import static org.springframework.http.HttpStatus.NOT_FOUND;
/**
* @author Zheng Jie
......
......@@ -25,6 +25,7 @@ import org.apache.poi.xssf.streaming.SXSSFSheet;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
......
......@@ -16,7 +16,11 @@
package me.zhengjie.utils;
import org.springframework.data.domain.Page;
import java.util.*;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
/**
* 分页工具
......
......@@ -21,9 +21,13 @@ import cn.hutool.core.util.ObjectUtil;
import lombok.extern.slf4j.Slf4j;
import me.zhengjie.annotation.DataPermission;
import me.zhengjie.annotation.Query;
import javax.persistence.criteria.*;
import java.lang.reflect.Field;
import java.util.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
/**
* @author Zheng Jie
......
......@@ -22,7 +22,10 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.connection.RedisConnection;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.core.*;
import org.springframework.data.redis.core.Cursor;
import org.springframework.data.redis.core.RedisConnectionUtils;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.ScanOptions;
import org.springframework.stereotype.Component;
import java.util.*;
......
......@@ -17,6 +17,7 @@ package me.zhengjie.utils;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
import java.util.Objects;
......
package me.zhengjie.utils;
import org.apache.commons.codec.binary.Base64;
import javax.crypto.Cipher;
import java.io.ByteArrayOutputStream;
import java.security.*;
......
......@@ -26,6 +26,7 @@ import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import java.util.List;
/**
......
......@@ -21,6 +21,7 @@ import org.springframework.beans.factory.DisposableBean;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.core.env.Environment;
import java.util.ArrayList;
import java.util.List;
......
......@@ -24,6 +24,7 @@ import net.dreamlu.mica.ip2region.core.Ip2regionSearcher;
import net.dreamlu.mica.ip2region.core.IpInfo;
import nl.basjes.parse.useragent.UserAgent;
import nl.basjes.parse.useragent.UserAgentAnalyzer;
import javax.servlet.http.HttpServletRequest;
import java.net.InetAddress;
import java.net.NetworkInterface;
......
......@@ -16,6 +16,7 @@
package me.zhengjie.utils;
import cn.hutool.json.JSONArray;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
......
package me.zhengjie.utils;
import org.junit.Test;
import static org.junit.Assert.*;
import static me.zhengjie.utils.EncryptUtils.*;
import static me.zhengjie.utils.EncryptUtils.desDecrypt;
import static me.zhengjie.utils.EncryptUtils.desEncrypt;
import static org.junit.Assert.assertEquals;
public class EncryptUtilsTest {
......
......@@ -3,8 +3,8 @@ package me.zhengjie.utils;
import org.junit.Test;
import org.springframework.mock.web.MockMultipartFile;
import static org.junit.Assert.*;
import static me.zhengjie.utils.FileUtil.*;
import static org.junit.Assert.assertEquals;
public class FileUtilTest {
......
......@@ -4,10 +4,11 @@ import org.junit.Test;
import org.springframework.mock.web.MockHttpServletRequest;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.Date;
import static me.zhengjie.utils.StringUtils.*;
import static org.junit.Assert.*;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
public class StringUtilsTest {
......
......@@ -20,6 +20,7 @@ import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import me.zhengjie.utils.GenUtil;
import javax.persistence.*;
import java.io.Serializable;
......
......@@ -19,6 +19,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import javax.persistence.*;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
......
......@@ -17,6 +17,7 @@ package me.zhengjie.repository;
import me.zhengjie.domain.ColumnInfo;
import org.springframework.data.jpa.repository.JpaRepository;
import java.util.List;
/**
......
......@@ -27,6 +27,7 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
......
......@@ -15,10 +15,10 @@
*/
package me.zhengjie.service;
import me.zhengjie.domain.GenConfig;
import me.zhengjie.domain.ColumnInfo;
import me.zhengjie.domain.GenConfig;
import org.springframework.http.ResponseEntity;
import org.springframework.scheduling.annotation.Async;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
......
......@@ -19,8 +19,8 @@ import lombok.RequiredArgsConstructor;
import me.zhengjie.domain.GenConfig;
import me.zhengjie.repository.GenConfigRepository;
import me.zhengjie.service.GenConfigService;
import me.zhengjie.utils.StringUtils;
import org.springframework.stereotype.Service;
import java.io.File;
/**
......
......@@ -19,8 +19,8 @@ import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.ZipUtil;
import lombok.RequiredArgsConstructor;
import me.zhengjie.domain.GenConfig;
import me.zhengjie.domain.ColumnInfo;
import me.zhengjie.domain.GenConfig;
import me.zhengjie.domain.vo.TableInfo;
import me.zhengjie.exception.BadRequestException;
import me.zhengjie.repository.ColumnInfoRepository;
......@@ -34,6 +34,7 @@ import org.slf4j.LoggerFactory;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;
......
......@@ -15,7 +15,9 @@
*/
package me.zhengjie.utils;
import org.apache.commons.configuration.*;
import org.apache.commons.configuration.Configuration;
import org.apache.commons.configuration.ConfigurationException;
import org.apache.commons.configuration.PropertiesConfiguration;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......
......@@ -18,8 +18,8 @@ package me.zhengjie.utils;
import cn.hutool.core.util.StrUtil;
import cn.hutool.extra.template.*;
import lombok.extern.slf4j.Slf4j;
import me.zhengjie.domain.GenConfig;
import me.zhengjie.domain.ColumnInfo;
import me.zhengjie.domain.GenConfig;
import org.springframework.util.ObjectUtils;
import java.io.File;
......@@ -27,7 +27,10 @@ import java.io.FileWriter;
import java.io.IOException;
import java.io.Writer;
import java.time.LocalDate;
import java.util.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static me.zhengjie.utils.FileUtil.SYS_TEM_DIR;
......
......@@ -29,6 +29,7 @@ import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;
import javax.servlet.http.HttpServletRequest;
/**
......
......@@ -19,6 +19,7 @@ import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.hibernate.annotations.CreationTimestamp;
import javax.persistence.*;
import java.io.Serializable;
import java.sql.Timestamp;
......
......@@ -27,6 +27,7 @@ import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
......
......@@ -16,6 +16,7 @@
package me.zhengjie.service.dto;
import lombok.Data;
import java.io.Serializable;
import java.sql.Timestamp;
......
......@@ -17,6 +17,7 @@ package me.zhengjie.service.dto;
import lombok.Data;
import me.zhengjie.annotation.Query;
import java.sql.Timestamp;
import java.util.List;
......
......@@ -16,6 +16,7 @@
package me.zhengjie.service.dto;
import lombok.Data;
import java.io.Serializable;
import java.sql.Timestamp;
......
......@@ -40,10 +40,10 @@
</dependency>
<!-- Spring boot websocket -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-websocket</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-websocket</artifactId>
</dependency>
<!-- jwt -->
<dependency>
......@@ -69,16 +69,16 @@
</dependency>
<!-- linux的管理 -->
<dependency>
<groupId>ch.ethz.ganymed</groupId>
<artifactId>ganymed-ssh2</artifactId>
<version>build210</version>
</dependency>
<dependency>
<groupId>com.jcraft</groupId>
<artifactId>jsch</artifactId>
<version>0.1.55</version>
</dependency>
<dependency>
<groupId>ch.ethz.ganymed</groupId>
<artifactId>ganymed-ssh2</artifactId>
<version>build210</version>
</dependency>
<dependency>
<groupId>com.jcraft</groupId>
<artifactId>jsch</artifactId>
<version>0.1.55</version>
</dependency>
<!-- 获取系统信息 -->
<dependency>
......
......@@ -28,6 +28,7 @@ import org.springframework.web.filter.CorsFilter;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.List;
......
......@@ -20,6 +20,7 @@ import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.AsyncConfigurer;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import java.util.concurrent.Executor;
import java.util.concurrent.ThreadPoolExecutor;
......
......@@ -17,7 +17,6 @@ package me.zhengjie.config.thread;
import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
/**
......
package me.zhengjie.gemho.controller;
import io.netty.buffer.Unpooled;
import me.zhengjie.gemho.netty.NettyServerHandler;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
import java.net.URLEncoder;
import java.nio.charset.Charset;
/**
* <p>
* 前端控制器
* </p>
*
* @author llj
* @since 2021-12-22
*/
@RestController
@RequestMapping("/test")
public class TestController {
@GetMapping
public void tes() {
NettyServerHandler.context.channel().writeAndFlush(Unpooled.wrappedBuffer("你好".getBytes(Charset.forName("GBK"))));
}
//根据城市获取天气信息的java代码
//cityName 是你要取得天气信息的城市的中文名字,如“北京”,“深圳”
static String getWeatherInform(String cityName){
//百度天气API
String baiduUrl = "http://api.map.baidu.com/telematics/v3/weather?location=北京&output=json&ak=W69oaDTCfuGwzNwmtVvgWfGH";
StringBuffer strBuf;
try {
//通过浏览器直接访问http://api.map.baidu.com/telematics/v3/weather?location=北京&output=json&ak=5slgyqGDENN7Sy7pw29IUvrZ
//5slgyqGDENN7Sy7pw29IUvrZ 是我自己申请的一个AK(许可码),如果访问不了,可以自己去申请一个新的ak
//百度ak申请地址:http://lbsyun.baidu.com/apiconsole/key
//要访问的地址URL,通过URLEncoder.encode()函数对于中文进行转码
baiduUrl = "http://api.map.baidu.com/telematics/v3/weather?location="+ URLEncoder.encode(cityName, "utf-8")+"&output=json&ak=5slgyqGDENN7Sy7pw29IUvrZ";
} catch (UnsupportedEncodingException e1) {
e1.printStackTrace();
}
strBuf = new StringBuffer();
try{
URL url = new URL(baiduUrl);
URLConnection conn = url.openConnection();
BufferedReader reader = new BufferedReader(new InputStreamReader(conn.getInputStream(),"utf-8"));//转码。
String line = null;
while ((line = reader.readLine()) != null)
strBuf.append(line + " ");
reader.close();
}catch(MalformedURLException e) {
e.printStackTrace();
}catch(IOException e){
e.printStackTrace();
}
return strBuf.toString();
}
public static void main(String[] args) {
String s = getWeatherInform("威海");
System.out.println(s);
}
}
package me.zhengjie.gemho.controller.artificial;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
* 人工监测数据表 前端控制器
* </p>
*
* @author llj
* @since 2022-04-25
*/
@RestController
@RequestMapping("/artificial-data")
public class ArtificialDataController {
}
package me.zhengjie.gemho.controller.artificial;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
* 人工监测点位表 前端控制器
* </p>
*
* @author llj
* @since 2022-04-25
*/
@RestController
@RequestMapping("/artificial-point")
public class ArtificialPointController {
}
package me.zhengjie.gemho.controller.data;
import io.swagger.annotations.Api;
import me.zhengjie.gemho.datavo.DataVo;
import me.zhengjie.gemho.entity.sys.visual.Children;
import me.zhengjie.gemho.util.PageResult;
import me.zhengjie.gemho.util.RealVo;
import me.zhengjie.gemho.x_datavo.DataVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
......
......@@ -4,20 +4,26 @@ package me.zhengjie.gemho.controller.data;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import me.zhengjie.gemho.datavo.DataVo;
import me.zhengjie.annotation.Log;
import me.zhengjie.gemho.entity.data.DbData;
import me.zhengjie.gemho.service.data.DbDataService;
import me.zhengjie.gemho.util.PageResult;
import me.zhengjie.gemho.util.PostOrPutResult;
import me.zhengjie.gemho.util.RealVo;
import me.zhengjie.gemho.x_datavo.DataVo;
import me.zhengjie.gemho.x_datavo.data.DataQueryCriteria;
import me.zhengjie.modules.system.service.dto.DeptQueryCriteria;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
/**
* <p>
......@@ -75,16 +81,17 @@ public class DbDataController {
* @param dbData
* @return
*/
@ApiOperation(value = "新增干滩人工巡检数据", response = PostOrPutResult.class)
@Log(value = "新增干滩人工检测数据")
@ApiOperation(value = "新增干滩人工检测数据", response = PostOrPutResult.class)
@PostMapping
public ResponseEntity<Object> add(@RequestBody DbData dbData) {
try {
Date time = dbData.getTime();
/*Date time = dbData.getTime();
String format = sdf.format(time);
dbData.setId(Integer.parseInt(format));
dbData.setCreatetime(new Date());
dbData.setUpdatetime(new Date());
dbData.setDatasource(0);
dbData.setDatasource(0);*/
boolean save = dbDataService.save(dbData);
if (save) {
return new ResponseEntity<>(new PostOrPutResult().success(), HttpStatus.OK);
......@@ -102,6 +109,7 @@ public class DbDataController {
* @param dbData
* @return
*/
@Log(value = "修改干滩人工检测数据")
@ApiOperation(value = "修改干滩人工巡检数据", response = PostOrPutResult.class)
@PutMapping
public ResponseEntity<Object> updata(@RequestBody DbData dbData) {
......@@ -124,6 +132,7 @@ public class DbDataController {
* @param map
* @return
*/
@Log(value = "删除干滩人工检测数据")
@ApiOperation(value = "删除干滩人工巡检数据", response = PostOrPutResult.class)
@DeleteMapping
public ResponseEntity<Object> deletedb(@RequestBody HashMap<String, Integer> map) {
......@@ -143,35 +152,46 @@ public class DbDataController {
/**
* 获取干滩的历史数据
*
* @param page
* @param size
* @param searchName
* @param searchValue
* @param limit
* @param timeSpace
* @param sort
* @param datasource
* @param
* @return
*/
@ApiOperation("获取干滩的历史数据")
@GetMapping("history")
public ResponseEntity<Object> gethistory(@ApiParam(value = "分页参数,页数", required = true) String page,
@ApiParam(value = "分页参数,数量", required = true) String size,
@ApiParam(value = "查询条件字段") String searchName,
@ApiParam(value = "查询条件数值") String searchValue,
@ApiParam(value = "查询条件精准或者模糊") String limit,
@ApiParam(value = "查询条件时间区间") String timeSpace,
@ApiParam(value = "查询条件正序或者倒序") String sort,
@ApiParam(value = "数据来源", required = true) String datasource) {
public ResponseEntity<Object> gethistory(DataQueryCriteria dataQueryCriteria) {
try {
long l = Long.parseLong(page);
long l1 = Long.parseLong(size);
HashMap<String, Object> map = dbDataService.pageall(searchName, searchValue, limit, timeSpace, sort, l, l1, datasource);
HashMap<String, Object> map = dbDataService.pageall(dataQueryCriteria);
return new ResponseEntity<>(new PageResult().success(map), HttpStatus.OK);
} catch (NumberFormatException e) {
e.printStackTrace();
}
return new ResponseEntity<>(new PageResult().failed(), HttpStatus.INTERNAL_SERVER_ERROR);
}
@ApiOperation(value = "设备的下拉列表")
@GetMapping("equiplist")
public ResponseEntity<Object> dbList() {
return null;
}
@ApiOperation(value = "图标历史")
@GetMapping("imghistory")
public ResponseEntity<Object> imgList(
@ApiParam(value = "查询条件字段") String searchName,
@ApiParam(value = "查询条件数值") String searchValue,
@ApiParam(value = "查询条件精准或者模糊") String limit,
@ApiParam(value = "查询条件时间区间") String timeSpace,
@ApiParam(value = "查询条件正序或者倒序") String sort,
@ApiParam(value = "数据来源", required = true) String datasource) {
return null;
}
@ApiOperation("导出菜单数据")
@GetMapping("download")
public void exportDept(HttpServletResponse response, DeptQueryCriteria criteria) throws Exception {
List<DbData> dbData = new ArrayList<>();
dbData = dbDataService.list();
dbDataService.download(dbData, response);
}
}
......@@ -4,12 +4,12 @@ package me.zhengjie.gemho.controller.data;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import me.zhengjie.gemho.datavo.DataVo;
import me.zhengjie.gemho.entity.data.DmData;
import me.zhengjie.gemho.service.data.DmDataService;
import me.zhengjie.gemho.util.PageResult;
import me.zhengjie.gemho.util.PostOrPutResult;
import me.zhengjie.gemho.util.RealVo;
import me.zhengjie.gemho.x_datavo.DataVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
......
......@@ -4,12 +4,12 @@ package me.zhengjie.gemho.controller.data;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import me.zhengjie.gemho.datavo.DataVo;
import me.zhengjie.gemho.entity.data.MpData;
import me.zhengjie.gemho.service.data.MpDataService;
import me.zhengjie.gemho.util.PageResult;
import me.zhengjie.gemho.util.PostOrPutResult;
import me.zhengjie.gemho.util.RealVo;
import me.zhengjie.gemho.x_datavo.DataVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
......
package me.zhengjie.gemho.controller.tab;
package me.zhengjie.gemho.controller.data;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import me.zhengjie.gemho.service.tab.DrybeachequipinforService;
import me.zhengjie.gemho.service.tab.MonDrybeachequipinforService;
import me.zhengjie.gemho.entity.data.Pdata;
import me.zhengjie.gemho.service.data.PdataService;
import me.zhengjie.gemho.util.PageResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
......@@ -13,40 +11,25 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
/**
* <p>
* 前端控制器
* 人工检测数据表 前端控制器
* </p>
*
* @author llj
* @since 2022-02-14
* @since 2022-03-04
*/
@Api(tags = "基础信息: 监测点和设备")
@RestController
@RequestMapping("tab/mondrybeachequipinfor")
public class MonDrybeachequipinforController {
@Autowired
private MonDrybeachequipinforService monDrybeachequipinforService;
@RequestMapping("data/pdata")
public class PdataController {
@Autowired
private DrybeachequipinforService drybeachequipinforService;
private PdataService pdataService;
@GetMapping("code")
public ResponseEntity<Object> getDryCode() {
//获取设备的下拉列表
ArrayList<HashMap<String, String>> dryCode = drybeachequipinforService.getDryCode();
return new ResponseEntity<>(new PageResult().nopagesuccess(dryCode), HttpStatus.OK);
@GetMapping()
public ResponseEntity<Object> get() {
List<Pdata> list = pdataService.list();
return new ResponseEntity<>(new PageResult().nopagesuccess(list), HttpStatus.OK);
}
@ApiOperation(value = "获取指定监测点的设备信息")
@GetMapping("mon")
public ResponseEntity<Object> getByMon(String monitoringno) {
ArrayList<HashMap<String, String>> bymon = monDrybeachequipinforService.getBymon(monitoringno);
return new ResponseEntity<>(new PageResult().nopagesuccess(bymon), HttpStatus.OK);
}
}
......@@ -4,12 +4,12 @@ package me.zhengjie.gemho.controller.data;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import me.zhengjie.gemho.datavo.DataVo;
import me.zhengjie.gemho.entity.data.PslData;
import me.zhengjie.gemho.service.data.PslDataService;
import me.zhengjie.gemho.util.PageResult;
import me.zhengjie.gemho.util.PostOrPutResult;
import me.zhengjie.gemho.util.RealVo;
import me.zhengjie.gemho.x_datavo.DataVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
......
package me.zhengjie.gemho.controller.data;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import me.zhengjie.gemho.datavo.RealDataVo;
import me.zhengjie.gemho.entity.data.*;
import me.zhengjie.gemho.entity.tab.Drybeachequipinfor;
import me.zhengjie.gemho.entity.sys.SysType;
import me.zhengjie.gemho.service.data.*;
import me.zhengjie.gemho.service.sys.SysTypeService;
import me.zhengjie.gemho.service.tab.DrybeachequipinforService;
import me.zhengjie.gemho.util.PageResult;
import me.zhengjie.gemho.x_datavo.RealDataVo;
import me.zhengjie.modules.security.service.OnlineUserService;
import me.zhengjie.utils.RedisUtils;
import me.zhengjie.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
......@@ -17,7 +18,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@RequestMapping("data/real")
......@@ -26,6 +26,8 @@ public class RealDataController {
@Autowired
private DrybeachequipinforService drybeachequipinforService;
@Autowired
private SysTypeService sysTypeService;
@Autowired
private DbDataService dbDataService;
@Autowired
private OnlineUserService onlineUserService;
......@@ -43,14 +45,15 @@ public class RealDataController {
private PslDataService pslDataService;
@Autowired
private SlDataService slDataService;
@Autowired
private RedisUtils redisUtils;
@GetMapping
public ResponseEntity<Object> real() {
//创建返回对象
HashMap<String, Object> map = new HashMap<>();
ArrayList<RealDataVo> realDataVos = new ArrayList<>();
ArrayList<RealDataVo> realDataVos1 = new ArrayList<>();
//创建条件构造器
QueryWrapper<DbData> dbDataQueryWrapper = new QueryWrapper<>();
/*QueryWrapper<DbData> dbDataQueryWrapper = new QueryWrapper<>();
QueryWrapper<WtData> wtDataQueryWrapper = new QueryWrapper<>();
QueryWrapper<MpData> mpDataQueryWrapper = new QueryWrapper<>();
QueryWrapper<DmData> dmDataQueryWrapper = new QueryWrapper<>();
......@@ -58,63 +61,62 @@ public class RealDataController {
QueryWrapper<RgData> rgDataQueryWrapper = new QueryWrapper<>();
QueryWrapper<PslData> pslDataQueryWrapper = new QueryWrapper<>();
QueryWrapper<SzData> szDataQueryWrapper = new QueryWrapper<>();
QueryWrapper<SlData> slDataQueryWrapper = new QueryWrapper<>();
QueryWrapper<SlData> slDataQueryWrapper = new QueryWrapper<>();*/
//获取当前登录用户 根据当前用户获取尾矿库id
String username = SecurityUtils.getCurrentUsername();
String gettailno = onlineUserService.gettailno(username);
//获取相应尾矿库下的所有设备
QueryWrapper<Drybeachequipinfor> drybeachequipinforQueryWrapper = new QueryWrapper<>();
drybeachequipinforQueryWrapper.eq("tailingid", gettailno);
List<Drybeachequipinfor> list = drybeachequipinforService.list(drybeachequipinforQueryWrapper);
List<String> equipnos = drybeachequipinforService.getequipno(gettailno);
//获取所有检测项
QueryWrapper<SysType> sysTypeQueryWrapper = new QueryWrapper<>();
sysTypeQueryWrapper.eq("must", 0);
List<SysType> list = sysTypeService.list(sysTypeQueryWrapper);
if (list.isEmpty()) {
return new ResponseEntity<>(new PageResult().nopagefailed("确实该尾矿下是否有绑定的设备"), HttpStatus.INTERNAL_SERVER_ERROR);
}
for (Drybeachequipinfor drybeachequipinfor : list) {
switch (drybeachequipinfor.getDevicetype()) {
for (SysType sysType : list) {
switch (sysType.getCode()) {
case "1":
RealDataVo real1 = dbDataService.real(drybeachequipinfor.getEquipno());
real1.setName(drybeachequipinfor.getEquipname());
realDataVos.add(real1);
List<RealDataVo> dbdatas = dbDataService.real(sysType.getTypeno());
realDataVos.addAll(dbdatas);
break;
case "2":
RealDataVo real2 = wtDataService.real(drybeachequipinfor.getEquipno());
real2.setName(drybeachequipinfor.getEquipname());
realDataVos.add(real2);
List<RealDataVo> wtdatas = wtDataService.real(sysType.getTypeno());
realDataVos.addAll(wtdatas);
break;
case "3":
RealDataVo mpData = mpDataService.real(drybeachequipinfor.getEquipno());
mpData.setName(drybeachequipinfor.getEquipname());
realDataVos.add(mpData);
List<RealDataVo> mpdatas = mpDataService.real(sysType.getTypeno());
realDataVos.addAll(mpdatas);
break;
case "4":
RealDataVo dmData = dmDataService.real(drybeachequipinfor.getEquipno());
dmData.setName(drybeachequipinfor.getEquipname());
realDataVos.add(dmData);
List<RealDataVo> dmdatas = dmDataService.real(sysType.getTypeno());
realDataVos.addAll(dmdatas);
break;
case "5":
RealDataVo stData = stDataService.real(drybeachequipinfor.getEquipno());
stData.setName(drybeachequipinfor.getEquipname());
realDataVos.add(stData);
List<RealDataVo> stdatas = stDataService.real(sysType.getTypeno());
realDataVos.addAll(stdatas);
break;
case "6":
RealDataVo rgData = rgDataService.real(drybeachequipinfor.getEquipno());
rgData.setName(drybeachequipinfor.getEquipname());
realDataVos.add(rgData);
List<RealDataVo> rgdatas = rgDataService.real(sysType.getTypeno());
realDataVos.addAll(rgdatas);
break;
case "7":
RealDataVo real = pslDataService.real(drybeachequipinfor.getEquipno());
real.setName(drybeachequipinfor.getEquipname());
realDataVos.add(real);
break;
case "8":
List<RealDataVo> psldatas = pslDataService.real(sysType.getTypeno());
realDataVos.addAll(psldatas);
break;
case "9":
RealDataVo slData = slDataService.real(drybeachequipinfor.getEquipno());
slData.setName(drybeachequipinfor.getEquipname());
realDataVos.add(slData);
List<RealDataVo> sldatas = slDataService.real(sysType.getTypeno());
realDataVos.addAll(sldatas);
break;
}
}
return new ResponseEntity<>(new PageResult().nopagesuccess(realDataVos), HttpStatus.OK);
for (RealDataVo realDataVo : realDataVos) {
boolean contains = equipnos.contains(realDataVo.getEquipno());
if (contains) {
realDataVos1.add(realDataVo);
}
}
redisUtils.set("realData", realDataVos1);
return new ResponseEntity<>(new PageResult().nopagesuccess(realDataVos1), HttpStatus.OK);
}
}
......@@ -4,12 +4,12 @@ package me.zhengjie.gemho.controller.data;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import me.zhengjie.gemho.datavo.DataVo;
import me.zhengjie.gemho.entity.data.RgData;
import me.zhengjie.gemho.service.data.RgDataService;
import me.zhengjie.gemho.util.PageResult;
import me.zhengjie.gemho.util.PostOrPutResult;
import me.zhengjie.gemho.util.RealVo;
import me.zhengjie.gemho.x_datavo.DataVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
......
......@@ -4,12 +4,12 @@ package me.zhengjie.gemho.controller.data;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import me.zhengjie.gemho.datavo.DataVo;
import me.zhengjie.gemho.entity.data.SlData;
import me.zhengjie.gemho.service.data.SlDataService;
import me.zhengjie.gemho.util.PageResult;
import me.zhengjie.gemho.util.PostOrPutResult;
import me.zhengjie.gemho.util.RealVo;
import me.zhengjie.gemho.x_datavo.DataVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
......
......@@ -4,12 +4,12 @@ package me.zhengjie.gemho.controller.data;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import me.zhengjie.gemho.datavo.DataVo;
import me.zhengjie.gemho.entity.data.StData;
import me.zhengjie.gemho.service.data.StDataService;
import me.zhengjie.gemho.util.PageResult;
import me.zhengjie.gemho.util.PostOrPutResult;
import me.zhengjie.gemho.util.RealVo;
import me.zhengjie.gemho.x_datavo.DataVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
......
......@@ -4,12 +4,12 @@ package me.zhengjie.gemho.controller.data;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import me.zhengjie.gemho.datavo.DataVo;
import me.zhengjie.gemho.entity.data.SzData;
import me.zhengjie.gemho.service.data.SzDataService;
import me.zhengjie.gemho.util.PageResult;
import me.zhengjie.gemho.util.PostOrPutResult;
import me.zhengjie.gemho.util.RealVo;
import me.zhengjie.gemho.x_datavo.DataVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
......
......@@ -4,12 +4,12 @@ package me.zhengjie.gemho.controller.data;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import me.zhengjie.gemho.datavo.DataVo;
import me.zhengjie.gemho.entity.data.WtData;
import me.zhengjie.gemho.service.data.WtDataService;
import me.zhengjie.gemho.util.PageResult;
import me.zhengjie.gemho.util.PostOrPutResult;
import me.zhengjie.gemho.util.RealVo;
import me.zhengjie.gemho.x_datavo.DataVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
......
package me.zhengjie.gemho.controller.demo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import me.zhengjie.gemho.entity.demo.MonitorPoints;
import me.zhengjie.gemho.service.demo.MonitorPointsService;
import me.zhengjie.gemho.util.PageResult;
import me.zhengjie.gemho.util.PostOrPutResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.HashMap;
/**
* <p>
* 前端控制器
* </p>
*
* @author llj
* @since 2022-04-02
*/
@Api(tags = "")
@RestController
@RequestMapping("wweb/httpdemo")
public class MonitorPointsController {
@Autowired
private MonitorPointsService monitorPointsService;
@ApiOperation(value = "分页列表", response = MonitorPoints.class)
@GetMapping(value = "/page")
public ResponseEntity<Object> list(@ApiParam(value = "分页参数,页数") String page,
@ApiParam(value = "分页参数,数量") String size,
@ApiParam(value = "查询条件字段") String searchName,
@ApiParam(value = "查询条件数值") String searchValue,
@ApiParam(value = "查询条件精准或者模糊") String limit,
@ApiParam(value = "查询条件时间区间") String timeSpace,
@ApiParam(value = "查询条件正序或者倒序") String sort) {
HashMap<String, Object> data = monitorPointsService.list(searchName, searchValue, limit, timeSpace, sort, page, size);
return new ResponseEntity<>(new PageResult().success(data), HttpStatus.OK);
}
@ApiOperation(value = "新增")
@PostMapping()
public Object add(@Valid @RequestBody MonitorPoints param) {
boolean result = monitorPointsService.add(param);
if (result) {
return new ResponseEntity<>(new PostOrPutResult().success(), HttpStatus.OK);
} else {
return new ResponseEntity<>(new PostOrPutResult().failed(), HttpStatus.INTERNAL_SERVER_ERROR);
}
}
@ApiOperation(value = "修改")
@PutMapping()
public Object modify(@Valid @RequestBody MonitorPoints param) {
boolean result = monitorPointsService.modify(param);
if (result) {
return new ResponseEntity<>(new PostOrPutResult().success(), HttpStatus.OK);
} else {
return new ResponseEntity<>(new PostOrPutResult().failed(), HttpStatus.INTERNAL_SERVER_ERROR);
}
}
@ApiOperation(value = "删除(单个条目)")
@DeleteMapping()
public Object remove(@RequestBody HashMap<String, Object> map) {
Integer id = Integer.valueOf(map.get("id").toString());
boolean result = monitorPointsService.removeById(id);
if (result) {
return new ResponseEntity<>(new PostOrPutResult().success(), HttpStatus.OK);
} else {
return new ResponseEntity<>(new PostOrPutResult().failed(), HttpStatus.INTERNAL_SERVER_ERROR);
}
}
@PostMapping("test")
public void testdemo(String json) {
System.out.println(json);
//return new ResponseEntity(new PageResult().success(json),HttpStatus.OK);
}
}
package me.zhengjie.gemho.controller.dic;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import lombok.RequiredArgsConstructor;
import me.zhengjie.gemho.entity.dic.Jcjd;
import me.zhengjie.gemho.entity.dic.Jczx;
import me.zhengjie.gemho.service.dic.IJcjdService;
import me.zhengjie.gemho.service.dic.IJczxService;
import me.zhengjie.gemho.util.PageResult;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@RequiredArgsConstructor
@RestController
@RequestMapping("dic/artificial")
public class ArtificialController {
private final IJcjdService iJcjdService;
private final IJczxService iJczxService;
@GetMapping("parent")
public ResponseEntity<Object> parent() {
List<Jcjd> list = iJcjdService.list();
return new ResponseEntity<>(new PageResult().nopagesuccess(list), HttpStatus.OK);
}
@GetMapping("child")
public ResponseEntity<Object> child(String p_id) {
QueryWrapper<Jczx> jczxQueryWrapper = new QueryWrapper<>();
jczxQueryWrapper.eq("p_id", Integer.valueOf(p_id));
List<Jczx> list = iJczxService.list(jczxQueryWrapper);
return new ResponseEntity<>(new PageResult().nopagesuccess(list), HttpStatus.OK);
}
}
package me.zhengjie.gemho.controller.sys;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import me.zhengjie.annotation.Log;
import me.zhengjie.gemho.entity.sys.SysArea;
import me.zhengjie.gemho.entity.sys.SysSelect;
import me.zhengjie.gemho.entity.sys.SysViews;
......@@ -11,15 +11,15 @@ import me.zhengjie.gemho.service.sys.SysAreaService;
import me.zhengjie.gemho.service.sys.SysSelectService;
import me.zhengjie.gemho.service.sys.SysSummaryService;
import me.zhengjie.gemho.service.sys.SysViewsService;
import me.zhengjie.gemho.service.tab.TailpondinforService;
import me.zhengjie.gemho.util.PageResult;
import me.zhengjie.gemho.util.PostOrPutResult;
import me.zhengjie.modules.security.service.OnlineUserService;
import me.zhengjie.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.HashMap;
......@@ -37,6 +37,8 @@ import java.util.List;
@RestController
@RequestMapping("sys/Area")
public class SysAreaController {
@Autowired
private TailpondinforService tailpondinforService;
@Autowired
private SysAreaService sysAreaService;
@Autowired
......@@ -58,9 +60,7 @@ public class SysAreaController {
String currentUsername = SecurityUtils.getCurrentUsername();
//根据用户获取尾矿库编号
String gettailno = onlineUserService.gettailno(currentUsername);
QueryWrapper<SysSelect> sysSelectQueryWrapper = new QueryWrapper<>();
sysSelectQueryWrapper.eq("tailno", gettailno);
List<SysSelect> list2 = sysSelectService.list(sysSelectQueryWrapper);
List<SysSelect> list2 = sysSelectService.getbytail(gettailno);
HashMap<String, ArrayList<SysSelect>> sysselectmap = new HashMap<>();
for (SysSelect sysSelect : list2) {
ArrayList<SysSelect> sysSelects = new ArrayList<SysSelect>();
......@@ -91,9 +91,28 @@ public class SysAreaController {
@ApiOperation(value = "大屏获取数据的接口")
@GetMapping("visual")
public ResponseEntity<Object> visual() {
HashMap<String, Object> map = new HashMap<>();
List<SysArea> visual = sysSelectService.visual();
return new ResponseEntity<>(new PageResult().nopagesuccess(visual), HttpStatus.OK);
}
@ApiOperation(value = "大屏标题")
@GetMapping("title")
public ResponseEntity<Object> title() {
String screenTitle = tailpondinforService.getScreenTitle();
HashMap<String, String> map = new HashMap<>();
map.put("title", screenTitle);
return new ResponseEntity<>(new PageResult().nopagesuccess(map), HttpStatus.OK);
}
@Log("修改大屏标题")
@ApiOperation(value = "大屏标题")
@PostMapping("title")
public ResponseEntity<Object> updateTitle(@RequestBody HashMap<String, String> requestMap) {
String title = requestMap.get("title");
tailpondinforService.updateTitle(title);
return new ResponseEntity<>(new PostOrPutResult().success(), HttpStatus.OK);
}
}
......@@ -2,6 +2,7 @@ package me.zhengjie.gemho.controller.sys;
import io.swagger.annotations.Api;
import me.zhengjie.annotation.Log;
import me.zhengjie.gemho.service.sys.SysSelectService;
import me.zhengjie.gemho.util.PostOrPutResult;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -26,6 +27,7 @@ public class SysSelectController {
@Autowired
private SysSelectService sysSelectService;
@Log(value = "修改配置大屏检测项")
@PostMapping
public ResponseEntity<Object> add(@RequestBody HashMap<String, Object> map) {
boolean updata = sysSelectService.updata(map);
......@@ -35,6 +37,7 @@ public class SysSelectController {
return new ResponseEntity<>(new PostOrPutResult().failed(), HttpStatus.INTERNAL_SERVER_ERROR);
}
@Log(value = "删除大屏配置检测项")
@DeleteMapping
public ResponseEntity<Object> shanchu(@RequestBody HashMap<String, Object> map) {
boolean updata = sysSelectService.shanchu(map);
......
......@@ -5,7 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import me.zhengjie.gemho.entity.sys.SysSelect;
import me.zhengjie.annotation.Log;
import me.zhengjie.gemho.entity.sys.SysSummary;
import me.zhengjie.gemho.entity.tab.Monitorvideo;
import me.zhengjie.gemho.service.sys.SysSelectService;
......@@ -20,7 +20,7 @@ import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import java.util.Date;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.List;
......@@ -52,9 +52,14 @@ public class SysSummaryController {
*/
@ApiOperation(value = "查询", response = SysSummary.class)
@GetMapping
public ResponseEntity<Object> getall(@ApiParam(value = "分页参数,页数") String page,
@ApiParam(value = "分页参数,每页的数据条数") String size) {
HashMap<String, Object> hashMap = sysSummaryService.getall(page, size);
public ResponseEntity<Object> getall(@ApiParam(value = "分页参数,页数", required = true) String page,
@ApiParam(value = "分页参数,数量", required = true) String size,
@ApiParam(value = "查询条件字段") String searchName,
@ApiParam(value = "查询条件数值") String searchValue,
@ApiParam(value = "查询条件精准或者模糊") String limit,
@ApiParam(value = "查询条件时间区间") String timeSpace,
@ApiParam(value = "查询条件正序或者倒序") String sort) {
HashMap<String, Object> hashMap = sysSummaryService.getall(page, size, searchName, searchValue);
return new ResponseEntity<>(new PageResult().success(hashMap), HttpStatus.OK);
}
......@@ -64,13 +69,13 @@ public class SysSummaryController {
* @param sysSummary
* @return
*/
@Log(value = "新增检测项")
@ApiOperation(value = "新增")
@PostMapping
public ResponseEntity<Object> add(@RequestBody SysSummary sysSummary) {
String currentUsername = SecurityUtils.getCurrentUsername();
String gettailno = onlineUserService.gettailno(currentUsername);
sysSummary.setCreatetime(new Date());
sysSummary.setUpdatetime(new Date());
sysSummary.setCreatetime(LocalDateTime.now());
String title = sysSummary.getTitle();
String deviceid = sysSummary.getDeviceid();
QueryWrapper<SysSummary> sysSummaryQueryWrapper = new QueryWrapper<>();
......@@ -108,6 +113,7 @@ public class SysSummaryController {
return new ResponseEntity<>(new PostOrPutResult().failed(), HttpStatus.INTERNAL_SERVER_ERROR);
}
@Log(value = "修改检测项")
@ApiOperation(value = "修改")
@PutMapping
public ResponseEntity<Object> xiugai(@RequestBody SysSummary sysSummary) {
......@@ -135,6 +141,7 @@ public class SysSummaryController {
return new ResponseEntity<>(new PostOrPutResult().failed(), HttpStatus.INTERNAL_SERVER_ERROR);
}
@Log(value = "删除检测项")
@ApiOperation(value = "删除")
@DeleteMapping
public ResponseEntity<Object> shanchu(@RequestBody HashMap<String, String> map) {
......@@ -142,14 +149,8 @@ public class SysSummaryController {
String currentUsername = SecurityUtils.getCurrentUsername();
String gettailno = onlineUserService.gettailno(currentUsername);
Integer id = Integer.valueOf(map.get("id"));
boolean b = sysSummaryService.removeById(id);
if (b) {
QueryWrapper<Monitorvideo> monitorvideoQueryWrapper = new QueryWrapper<>();
monitorvideoQueryWrapper.eq("v_sumid", id.toString());
monitorvideoService.remove(monitorvideoQueryWrapper);
QueryWrapper<SysSelect> sysSelectQueryWrapper = new QueryWrapper<>();
sysSelectQueryWrapper.eq("sumid", id).eq("tailno", gettailno);
sysSelectService.remove(sysSelectQueryWrapper);
boolean deletebyid = sysSummaryService.deletebyid(id);
if (deletebyid) {
return new ResponseEntity<>(new PostOrPutResult().success(), HttpStatus.OK);
}
return new ResponseEntity<>(new PostOrPutResult(), HttpStatus.INTERNAL_SERVER_ERROR);
......
......@@ -4,7 +4,6 @@ package me.zhengjie.gemho.controller.sys;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import me.zhengjie.gemho.datavo.sys.*;
import me.zhengjie.gemho.entity.sys.SysDaterange;
import me.zhengjie.gemho.entity.sys.SysSubitem;
import me.zhengjie.gemho.entity.sys.SysType;
......@@ -16,6 +15,7 @@ import me.zhengjie.gemho.service.sys.SysTypeService;
import me.zhengjie.gemho.service.sys.SysValueService;
import me.zhengjie.gemho.service.tab.DrybeachequipinforService;
import me.zhengjie.gemho.util.PageResult;
import me.zhengjie.gemho.x_datavo.sys.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
......
......@@ -2,8 +2,21 @@ package me.zhengjie.gemho.controller.tab;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import me.zhengjie.annotation.Log;
import me.zhengjie.gemho.service.tab.DrybeachequipinforService;
import me.zhengjie.gemho.service.tab.TabAbnormalService;
import me.zhengjie.gemho.util.PageResult;
import me.zhengjie.gemho.util.PostOrPutResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
/**
* <p>
......@@ -13,10 +26,123 @@ import org.springframework.web.bind.annotation.RestController;
* @author llj
* @since 2021-12-22
*/
@Api(tags = "基础信息: 警")
@Api(tags = "基础信息: 警")
@RestController
@RequestMapping("/tabAbnormal")
@RequestMapping("/tab/Abnormal")
public class AbnormalController {
@Autowired
private TabAbnormalService tabAbnormalService;
@Autowired
private DrybeachequipinforService drybeachequipinforService;
@ApiOperation(value = "获取预警列表")
@GetMapping()
public ResponseEntity<Object> getAbnormalall() {
ArrayList<HashMap<String, Object>> abnormal = tabAbnormalService.getAbnormal();
return new ResponseEntity<>(new PageResult().nopagesuccess(abnormal), HttpStatus.OK);
}
@Log("接触报警")
@ApiOperation(value = "解除预警")
@PostMapping
public ResponseEntity<Object> jcbj(@RequestBody HashMap<String, String> map) {
String equipno = map.get("equipno");
String time = map.get("time");
String reason = map.get("reason");
String jcreason = map.get("jcreason");
boolean jcbj = tabAbnormalService.jcbj(equipno, time, reason, jcreason);
if (jcbj) {
return new ResponseEntity<>(new PostOrPutResult().success(), HttpStatus.OK);
}
return new ResponseEntity<>(new PostOrPutResult().dingyifailed("解除失败"), HttpStatus.INTERNAL_SERVER_ERROR);
}
@ApiOperation(value = "风险统计")
@GetMapping("statistics")
public ResponseEntity<Object> statistics(String date) {
List<HashMap<String, Object>> statistics = tabAbnormalService.statistics(date);
return new ResponseEntity<>(new PageResult().nopagesuccess(statistics), HttpStatus.OK);
}
@ApiOperation(value = "检测项风险状态列表")
@GetMapping("typelist")
public ResponseEntity<Object> typelist() {
List<HashMap<String, Object>> statistics1 = tabAbnormalService.statistics1();
HashMap<String, Integer> map = new HashMap<>();
for (HashMap<String, Object> stringObjectHashMap : statistics1) {
String devicetype = (String) stringObjectHashMap.get("code");
Integer integer4 = Integer.parseInt(stringObjectHashMap.get("4").toString());
Integer integer3 = Integer.parseInt(stringObjectHashMap.get("3").toString());
Integer integer2 = Integer.parseInt(stringObjectHashMap.get("2").toString());
Integer integer1 = Integer.parseInt(stringObjectHashMap.get("1").toString());
if (integer4 > 3) {
stringObjectHashMap.put("2", integer3 + 1);
if (integer3 + 1 > 2) {
stringObjectHashMap.put("2", integer2 + 1);
if (integer2 + 1 > 1) {
stringObjectHashMap.put("2", integer1 + 1);
}
}
}
if (integer4 > 0) {
map.put(devicetype, 4);
}
if (integer3 > 0) {
map.put(devicetype, 3);
}
if (integer2 > 0) {
map.put(devicetype, 2);
}
if (integer1 > 0) {
map.put(devicetype, 1);
}
}
List<HashMap<String, Object>> typelist = tabAbnormalService.typelist();
for (HashMap<String, Object> statistic : typelist) {
String code = (String) statistic.get("code");
Integer integer = map.get(code);
if (integer == null) {
integer = 0;
}
statistic.put("alarmlevel", integer);
}
return new ResponseEntity<>(new PageResult().nopagesuccess(typelist), HttpStatus.OK);
}
@ApiOperation(value = "风险等级月统计")
@GetMapping("monthtj")
public ResponseEntity<Object> monthtj() {
List<HashMap<String, Object>> monthtj = tabAbnormalService.monthtj();
return new ResponseEntity<>(new PageResult().nopagesuccess(monthtj), HttpStatus.OK);
}
@ApiOperation(value = "获取设备的四级报警")
@GetMapping("level")
public ResponseEntity<Object> alarmlevel(@ApiParam(value = "分页参数,页数") String page,
@ApiParam(value = "分页参数,数量") String size,
@ApiParam(value = "查询条件字段") String searchName,
@ApiParam(value = "查询条件数值") String searchValue,
@ApiParam(value = "查询条件精准或者模糊") String limit,
@ApiParam(value = "查询条件时间区间") String timeSpace,
@ApiParam(value = "查询条件正序或者倒序") String sort) {
Long page1 = Long.valueOf(page);
Long size1 = Long.valueOf(size);
HashMap<String, Object> level = drybeachequipinforService.level(searchName, searchValue, limit, timeSpace, sort, page1, size1);
return new ResponseEntity<>(new PageResult().nopagesuccess(level), HttpStatus.OK);
}
@ApiOperation(value = "修改设备预警")
@PutMapping("level")
public ResponseEntity<Object> dealLevel(@RequestBody HashMap<String, String> map) {
drybeachequipinforService.dealLevel(map);
return new ResponseEntity<>(new PostOrPutResult().success(), HttpStatus.OK);
}
public static void main(String[] args) {
String s= "";
if(!"".equals(s)&&s!=null){
System.out.println("进入");
}
}
}
......@@ -3,14 +3,16 @@ package me.zhengjie.gemho.controller.tab;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.swagger.annotations.*;
import me.zhengjie.gemho.datavo.DryVo;
import me.zhengjie.annotation.Log;
import me.zhengjie.gemho.entity.sys.SysType;
import me.zhengjie.gemho.entity.tab.Drybeachequipinfor;
import me.zhengjie.gemho.service.sys.SysSummaryService;
import me.zhengjie.gemho.service.sys.SysTypeService;
import me.zhengjie.gemho.service.tab.DrybeachequipinforService;
import me.zhengjie.gemho.service.tab.TabAbnormalService;
import me.zhengjie.gemho.util.PageResult;
import me.zhengjie.gemho.util.PostOrPutResult;
import me.zhengjie.gemho.x_datavo.DryVo;
import me.zhengjie.modules.security.service.OnlineUserService;
import me.zhengjie.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -43,6 +45,8 @@ public class DrybeachequipinforController {
@Autowired
private SysTypeService sysTypeService;
@Autowired
private SysSummaryService sysSummaryService;
@Autowired
private OnlineUserService onlineUserService;
/**
......@@ -51,6 +55,7 @@ public class DrybeachequipinforController {
* @param drybeachequipinfor
* @return
*/
@Log("新增设备")
@ApiOperation(value = "新增设备", response = PostOrPutResult.class)
@PostMapping
public ResponseEntity<Object> add(@RequestBody Drybeachequipinfor drybeachequipinfor) {
......@@ -61,8 +66,10 @@ public class DrybeachequipinforController {
String eqno = format + i;
drybeachequipinfor.setEquipno(eqno);
drybeachequipinfor.setCreatetime(new Date());
drybeachequipinfor.setUpdatetime(new Date());
boolean save = drybeachequipinforService.save(drybeachequipinfor);
if (save) {
onlineUserService.clearMenu();
return new ResponseEntity<>(new PostOrPutResult().success(), HttpStatus.OK);
} else {
return new ResponseEntity<>(new PostOrPutResult().failed(), HttpStatus.INTERNAL_SERVER_ERROR);
......@@ -78,14 +85,26 @@ public class DrybeachequipinforController {
* @param map
* @return
*/
@Log("删除设备")
@ApiOperation(value = "删除设备", response = PostOrPutResult.class)
@PreAuthorize("hasAnyRole('admin','menu:edit')")
@PreAuthorize("@el.check('delect:dry')")
@DeleteMapping
public ResponseEntity<Object> deleteone(@RequestBody HashMap<String, Integer> map) {
public ResponseEntity<Object> deleteone(@RequestBody HashMap<String, String> map) {
try {
Integer id = map.get("id");
boolean b = drybeachequipinforService.removeById(id);
boolean b = false;
Integer id = Integer.parseInt(map.get("id"));
QueryWrapper<Drybeachequipinfor> drybeachequipinforQueryWrapper = new QueryWrapper<>();
drybeachequipinforQueryWrapper.eq("id", id);
Drybeachequipinfor one = drybeachequipinforService.getOne(drybeachequipinforQueryWrapper);
String equipno = one.getEquipno();
String devicetype = one.getDevicetype();
if (devicetype.equals("8")) {
b = drybeachequipinforService.removeById(id);
} else {
b = drybeachequipinforService.deleteall(equipno);
}
if (b) {
onlineUserService.clearMenu();
return new ResponseEntity<>(new PostOrPutResult().success(), HttpStatus.OK);
} else {
return new ResponseEntity<>(new PostOrPutResult().failed(), HttpStatus.INTERNAL_SERVER_ERROR);
......@@ -101,6 +120,7 @@ public class DrybeachequipinforController {
* @param drybeachequipinfor
* @return
*/
@Log("修改设备")
@ApiOperation(value = "修改设备", response = PostOrPutResult.class)
@PutMapping
public ResponseEntity<Object> updateone(@RequestBody Drybeachequipinfor drybeachequipinfor) {
......@@ -109,6 +129,7 @@ public class DrybeachequipinforController {
//drybeachequipinfor.setCreatetime(new Date());
boolean save = drybeachequipinforService.saveOrUpdate(drybeachequipinfor);
if (save) {
onlineUserService.clearMenu();
return new ResponseEntity<>(new PostOrPutResult().success(), HttpStatus.OK);
} else {
return new ResponseEntity<>(new PostOrPutResult().failed(), HttpStatus.INTERNAL_SERVER_ERROR);
......@@ -145,37 +166,9 @@ public class DrybeachequipinforController {
return new ResponseEntity<>(new PageResult().failed(), HttpStatus.INTERNAL_SERVER_ERROR);
}
}
/*
/**
* 解除报警
*
* @return
*/
@PutMapping("jcbj")
public ResponseEntity<Object> jcbj(@RequestBody HashMap<String, String> map) {
boolean jcbj1 = false;
//获取参数
String equipname = map.get("equipname");
String time = map.get("time");
String reason = map.get("reason");
//查询对应的设备编码
QueryWrapper<Drybeachequipinfor> wrapper = new QueryWrapper<>();
wrapper.eq("equipname", equipname);
Drybeachequipinfor one = drybeachequipinforService.getOne(wrapper);
if (one != null) {
String equipno = one.getEquipno();
jcbj1 = tabAbnormalService.jcbj(equipno, time, reason);
} else {
return new ResponseEntity<>(new PostOrPutResult().setCode(200).setMsg("设备名称不对"), HttpStatus.OK);
}
boolean jcbj = drybeachequipinforService.jcbj(equipname);
if (jcbj && jcbj1) {
return new ResponseEntity<>(new PostOrPutResult().success(), HttpStatus.OK);
} else {
return new ResponseEntity<>(new PostOrPutResult().failed(), HttpStatus.INTERNAL_SERVER_ERROR);
}
}
*/
@ApiOperation(value = "获取所有设备id", response = DryVo.class)
@GetMapping("ids")
......@@ -224,6 +217,7 @@ public class DrybeachequipinforController {
HashMap<String, Integer> map = drybeachequipinforService.getdyinfo();
return new ResponseEntity<>(new PageResult().success(map), HttpStatus.OK);
}
}
package me.zhengjie.gemho.controller.tab;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import me.zhengjie.gemho.entity.tab.Monitoring;
import me.zhengjie.gemho.service.tab.MonitoringService;
import me.zhengjie.gemho.util.PageResult;
import me.zhengjie.gemho.util.PostOrPutResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import java.util.HashMap;
import java.util.List;
/**
* <p>
* 监测点 前端控制器
* </p>
*
* @author llj
* @since 2022-02-11
*/
@Api(tags = "基础信息: 监测点")
@RestController
@RequestMapping("tab/monitoring")
public class MonitoringController {
@Autowired
private MonitoringService iTbMonitoringService;
@ApiOperation(value = "新增监测点")
@PostMapping()
public ResponseEntity<Object> add(@RequestBody Monitoring monitoring) {
try {
boolean save = iTbMonitoringService.save(monitoring);
if (save) {
return new ResponseEntity<>(new PostOrPutResult().success(), HttpStatus.OK);
}
return new ResponseEntity<>(new PostOrPutResult().failed(), HttpStatus.OK);
} catch (Exception e) {
System.out.println(e);
return new ResponseEntity<>(new PostOrPutResult().failed(), HttpStatus.OK);
}
}
@ApiModelProperty(value = "删除监测点")
@DeleteMapping
public ResponseEntity<Object> delete(@RequestBody HashMap<String, Integer> map) {
try {
Integer id = map.get("id");
boolean result = iTbMonitoringService.removeById(id);
if (result) {
return new ResponseEntity<>(new PostOrPutResult().success(), HttpStatus.OK);
}
return new ResponseEntity<>(new PostOrPutResult().failed(), HttpStatus.OK);
} catch (Exception e) {
System.out.println(e);
return new ResponseEntity<>(new PostOrPutResult().failed(), HttpStatus.OK);
}
}
@ApiModelProperty(value = "修改监测点信息")
@PutMapping
public ResponseEntity<Object> updata(@RequestBody Monitoring monitoring) {
try {
boolean result = iTbMonitoringService.saveOrUpdate(monitoring);
if (result) {
return new ResponseEntity<>(new PostOrPutResult().success(), HttpStatus.OK);
}
return new ResponseEntity<>(new PostOrPutResult().failed(), HttpStatus.OK);
} catch (Exception e) {
System.out.println(e);
return new ResponseEntity<>(new PostOrPutResult().failed(), HttpStatus.OK);
}
}
@ApiModelProperty(value = "获取所有检测点位信息")
@GetMapping
public ResponseEntity<Object> getall() {
List<Monitoring> list = iTbMonitoringService.list();
return new ResponseEntity<>(new PageResult().nopagesuccess(list), HttpStatus.OK);
}
}
package me.zhengjie.gemho.controller.tab;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.swagger.annotations.Api;
import me.zhengjie.gemho.entity.sys.SysSelect;
import me.zhengjie.gemho.entity.tab.Monitorvideo;
import me.zhengjie.gemho.service.sys.SysSelectService;
import me.zhengjie.gemho.service.sys.SysSummaryService;
import me.zhengjie.gemho.service.tab.MonitorvideoService;
import me.zhengjie.gemho.util.PageResult;
import me.zhengjie.modules.security.service.OnlineUserService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@Api(tags = "基础信息: 视频监控")
@RestController
@RequestMapping("tab/montorvideo")
public class MonitorvideoController {
@Autowired
private MonitorvideoService monitorvideoService;
@Autowired
private SysSummaryService sysSummaryService;
@Autowired
private OnlineUserService onlineUserService;
@Autowired
private SysSelectService sysSelectService;
@GetMapping
public ResponseEntity<Object> getmontorvideo(@Param(value = "检测项id") String id,
@Param(value = "检测项名称") String sumtitle) {
QueryWrapper<SysSelect> sysSelectQueryWrapper = new QueryWrapper<>();
sysSelectQueryWrapper.eq("id", Integer.parseInt(id));
SysSelect one2 = sysSelectService.getOne(sysSelectQueryWrapper);
Integer sumid = one2.getSumid();
//根据检测项返回
QueryWrapper<Monitorvideo> monitorvideoQueryWrapper = new QueryWrapper<>();
monitorvideoQueryWrapper.eq("v_sumid", sumid + "");
Monitorvideo one = monitorvideoService.getOne(monitorvideoQueryWrapper);
return new ResponseEntity<>(new PageResult().nopagesuccess(one), HttpStatus.OK);
}
}
......@@ -3,6 +3,7 @@ package me.zhengjie.gemho.controller.tab;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.swagger.annotations.*;
import me.zhengjie.annotation.Log;
import me.zhengjie.gemho.entity.tab.Tailpondinfor;
import me.zhengjie.gemho.service.tab.TailpondinforService;
import me.zhengjie.gemho.util.PageResult;
......@@ -16,9 +17,9 @@ import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
/**
* <p>
......@@ -43,6 +44,7 @@ public class TailpondinforController {
* @param tailpondinfor
* @return
*/
@Log("新增尾矿库信息")
@PreAuthorize("@el.check('admin')")
@ApiOperation(value = "新增尾矿库基础信息", response = PostOrPutResult.class)
@PostMapping
......@@ -101,6 +103,7 @@ public class TailpondinforController {
* @param map
* @return
*/
@Log("删除尾矿库信息")
@PreAuthorize("@el.check('admin')")
@ApiOperation(value = "删除尾矿库基础信息", response = PostOrPutResult.class)
@DeleteMapping
......@@ -124,6 +127,7 @@ public class TailpondinforController {
* @param tailpondinfor
* @return
*/
@Log("修改尾矿库信息")
@ApiOperation(value = "修改尾矿库基础信息", response = PostOrPutResult.class)
@PutMapping
public ResponseEntity<Object> updateone(@RequestBody Tailpondinfor tailpondinfor) {
......@@ -147,6 +151,7 @@ public class TailpondinforController {
boolean b = tailpondinforService.updataDefaultno(currentUsername, tailpondinfor.getTailingno());
if (b) {
onlineUserService.saveWKKBase(currentUsername);
}
}
return new ResponseEntity<>(new PostOrPutResult().success(), HttpStatus.OK);
......@@ -187,27 +192,35 @@ public class TailpondinforController {
}
}
@ApiOperation(value = "获取当前用户可切换的尾矿库列表")
@ApiOperation(value = "获取当前用户尾矿库")
@GetMapping("usertailpon")
public ResponseEntity<Object> userta() {
try {
ArrayList<HashMap<String, Object>> usertailpon = tailpondinforService.usertailpon();
List<Tailpondinfor> usertailpon = tailpondinforService.usertailpon();
return new ResponseEntity<>(new PageResult().nopagesuccess(usertailpon), HttpStatus.OK);
} catch (Exception e) {
e.printStackTrace();
return new ResponseEntity<>(new PageResult().nopagefailed(ThrowableUtil.getStackTrace(e)), HttpStatus.INTERNAL_SERVER_ERROR);
}
}
@Log("切换尾矿库")
@ApiOperation(value = "切换尾矿库")
@PutMapping("usertailpon")
@PostMapping("usertailpon")
public ResponseEntity<Object> change(@RequestBody HashMap<String, String> map) {
String tailingno = map.get("tailingno");
String username = SecurityUtils.getCurrentUsername();
tailpondinforService.updataDefaultno(username, tailingno);
onlineUserService.changeWkkBase(username, tailingno);
return new ResponseEntity<>(new PostOrPutResult().success(), HttpStatus.OK);
}
@ApiOperation(value = "获取当前尾矿库信息")
@GetMapping("dryinfo")
public ResponseEntity<Object> change() {
String currentUsername = SecurityUtils.getCurrentUsername();
String gettailno = onlineUserService.gettailno(currentUsername);
HashMap<String, Object> getzuobiao = tailpondinforService.getzuobiao(gettailno);
return new ResponseEntity<>(new PageResult().nopagesuccess(getzuobiao), HttpStatus.OK);
}
}
......@@ -4,6 +4,7 @@ package me.zhengjie.gemho.controller.tab;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import me.zhengjie.annotation.Log;
import me.zhengjie.gemho.entity.tab.UserTailpon;
import me.zhengjie.gemho.service.tab.TailpondinforService;
import me.zhengjie.gemho.service.tab.UserTailponService;
......@@ -54,11 +55,12 @@ public class UserTailponController {
HashMap hashMap = new HashMap<String, ArrayList<HashMap<String, Object>>>();
ArrayList<HashMap<String, Object>> codeByUser = tailpondinforService.getCodeByUser(username);
ArrayList<HashMap<String, Object>> getcodes = tailpondinforService.getcodes();
hashMap.put("user",codeByUser);
hashMap.put("list",getcodes);
hashMap.put("user", codeByUser);
hashMap.put("list", getcodes);
return new ResponseEntity<>(new PageResult().nopagesuccess(hashMap), HttpStatus.OK);
}
@Log("绑定用户尾矿库信息")
@ApiOperation(value = "绑定用户和尾矿信息")
@PostMapping()
public ResponseEntity<Object> add(String username, ArrayList<HashMap<String, String>> maps) {
......
......@@ -4,10 +4,10 @@ import cn.hutool.http.HttpRequest;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.swagger.annotations.Api;
import me.zhengjie.gemho.datavo.weather.WeatherVo;
import me.zhengjie.gemho.entity.tab.Tailpondinfor;
import me.zhengjie.gemho.service.tab.TailpondinforService;
import me.zhengjie.gemho.util.PageResult;
import me.zhengjie.gemho.x_datavo.weather.WeatherVo;
import me.zhengjie.modules.security.service.OnlineUserService;
import me.zhengjie.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
......
package me.zhengjie.gemho.controller.web;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import me.zhengjie.annotation.Log;
import me.zhengjie.gemho.entity.web.WebMonitorChart;
import me.zhengjie.gemho.service.web.IWebMonitorChartService;
import me.zhengjie.gemho.util.PageResult;
import me.zhengjie.gemho.util.PostOrPutResult;
import me.zhengjie.gemho.x_datavo.web.MonitorChartVo;
import me.zhengjie.modules.security.service.OnlineUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import java.util.HashMap;
/**
* <p>
* 监测点模块前端控制器
* </p>
*
* @author llj
* @since 2022-03-28
*/
@Api(tags = "监测点: 尾矿库-监测点")
@RestController
@RequestMapping("web/monitorchart")
public class WebMonitorChartController {
@Autowired
private IWebMonitorChartService iWebMonitorChartService;
@Autowired
private OnlineUserService onlineUserService;
@Log("新增/修改监测点模块信息")
@ApiOperation(value = "新增/修改监测点模块信息")
@PostMapping
public ResponseEntity<Object> add(@RequestBody WebMonitorChart webMonitorChart) {
boolean save = iWebMonitorChartService.deal(webMonitorChart);
if (save) {
return new ResponseEntity<>(new PostOrPutResult().success(), HttpStatus.OK);
}
return new ResponseEntity<>(new PostOrPutResult().failed(), HttpStatus.INTERNAL_SERVER_ERROR);
}
@Log("删除检测项图片")
@ApiOperation(value = "删除检测项图片")
@DeleteMapping
public ResponseEntity<Object> delete(@RequestBody HashMap<String, Object> map) {
Integer id = Integer.valueOf(map.get("id").toString());
boolean b = iWebMonitorChartService.depic(id);
if (b) {
return new ResponseEntity<>(new PostOrPutResult().success(), HttpStatus.OK);
}
return new ResponseEntity<>(new PostOrPutResult().failed(), HttpStatus.INTERNAL_SERVER_ERROR);
}
@ApiOperation(value = "监测点模块信息")
@GetMapping
public ResponseEntity<Object> get() {
MonitorChartVo getmonbase = iWebMonitorChartService.getmonbase();
return new ResponseEntity<>(new PageResult().nopagesuccess(getmonbase), HttpStatus.OK);
}
@ApiOperation(value = "监测点模块信息_大屏使用")
@GetMapping("visual")
public ResponseEntity<Object> getvisual() {
MonitorChartVo getmonbase = iWebMonitorChartService.getmonbasevisual();
return new ResponseEntity<>(new PageResult().nopagesuccess(getmonbase), HttpStatus.OK);
}
}
package me.zhengjie.gemho.controller.web;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import me.zhengjie.annotation.Log;
import me.zhengjie.gemho.mapper.web.WebMonitorChartMapper;
import me.zhengjie.gemho.service.web.IWebMonitorChartService;
import me.zhengjie.gemho.service.web.IWebMonitorLinkService;
import me.zhengjie.gemho.service.web.IWebMonitorPointsService;
import me.zhengjie.gemho.util.PostOrPutResult;
import me.zhengjie.gemho.x_datavo.web.MonitorChartRq;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* <p>
* 监测点详细信息
* 前端控制器
* </p>
*
* @author llj
* @since 2022-03-28
*/
@Api(tags = "监测点: 详细信息")
@RestController
@RequestMapping("web/monitorpoints")
public class WebMonitorPointsController {
@Autowired
private IWebMonitorChartService iWebMonitorChartService;
@Autowired
private IWebMonitorPointsService webMonitorPointsService;
@Autowired
private IWebMonitorLinkService iWebMonitorLinkService;
@Autowired
private WebMonitorChartMapper webMonitorChartMapper;
@Log("配置监测点信息")
@ApiOperation(value = "配置监测点信息")
@PostMapping
public ResponseEntity<Object> add(@RequestBody MonitorChartRq monitorChartVo) {
webMonitorPointsService.deal(monitorChartVo);
return new ResponseEntity<>(new PostOrPutResult().success(), HttpStatus.OK);
}
@Log("删除监测点")
@ApiOperation(value = "删除监测点")
@DeleteMapping()
public ResponseEntity<Object> delete(@RequestBody List<String> ids) {
boolean remove = webMonitorPointsService.deletePoints(ids.get(0));
if (remove) {
return new ResponseEntity<>(new PostOrPutResult().success(), HttpStatus.OK);
}
return new ResponseEntity<>(new PostOrPutResult().failed(), HttpStatus.INTERNAL_SERVER_ERROR);
}
}
\ No newline at end of file
......@@ -5,6 +5,7 @@ import lombok.Getter;
import lombok.Setter;
import java.io.Serializable;
import java.time.LocalDate;
/**
* <p>
......@@ -27,5 +28,9 @@ public class Test implements Serializable {
private String password;
public static void main(String[] args) {
LocalDate now = LocalDate.now();
}
}
package me.zhengjie.gemho.entity.artificial;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
* <p>
* 人工监测数据表
* </p>
*
* @author llj
* @since 2022-04-25
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("artificial_data")
@ApiModel(value="ArtificialData对象", description="人工监测数据表")
public class ArtificialData implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
@ApiModelProperty(value = "监测项id")
@TableField("jcitemid")
private Integer jcitemid;
@ApiModelProperty(value = "监测子项id")
@TableField("jcziitemid")
private Integer jcziitemid;
@ApiModelProperty(value = "监测内容及要求id")
@TableField("jcneirongid")
private Integer jcneirongid;
@ApiModelProperty(value = "监测仪器")
@TableField("jcyiqi")
private Integer jcyiqi;
@ApiModelProperty(value = "监测精度")
@TableField("jcjingdu")
private Integer jcjingdu;
@ApiModelProperty(value = "监测结果")
@TableField("jcjieguo")
private String jcjieguo;
@ApiModelProperty(value = "添加时间或修改时间")
@TableField("addtime")
private LocalDateTime addtime;
@ApiModelProperty(value = "监测时间")
@TableField("jctime")
private LocalDateTime jctime;
}
package me.zhengjie.gemho.entity.artificial;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
* <p>
* 人工监测点位表
* </p>
*
* @author llj
* @since 2022-04-25
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("artificial_point")
@ApiModel(value="ArtificialPoint对象", description="人工监测点位表")
public class ArtificialPoint implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
@ApiModelProperty(value = "监测项")
@TableField("jcitem")
private String jcitem;
@ApiModelProperty(value = "人工监测点名称")
@TableField("jcdname")
private String jcdname;
@ApiModelProperty(value = "地点备注")
@TableField("remarks")
private String remarks;
@ApiModelProperty(value = "添加时间")
@TableField("addtime")
private LocalDateTime addtime;
}
......@@ -41,6 +41,8 @@ public class DbData implements Serializable {
@ApiModelProperty("设备id")
public String sensorid;
@ApiModelProperty("设备名称")
public String sensorname;
/**
* 测量时间
*/
......@@ -96,7 +98,6 @@ public class DbData implements Serializable {
public Integer datasource;
public static void main(String[] args) {
DbData dbData = new DbData();
dbData.setLenth("1");
......
package me.zhengjie.gemho.entity.data;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
* <p>
* 人工检测数据表
* </p>
*
* @author llj
* @since 2022-03-04
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("tb_pdata")
@ApiModel(value = "Pdata对象", description = "人工检测数据表")
public class Pdata implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
@ApiModelProperty(value = "监测项目(表面位移,浸润线.....)")
private String type;
@ApiModelProperty(value = "监测内容及要求")
private String content;
@ApiModelProperty(value = "监测仪器")
private String equipno;
@ApiModelProperty(value = "监测值")
private String value;
@ApiModelProperty(value = "监测时间")
private LocalDateTime time;
}
package me.zhengjie.gemho.entity.demo;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Getter;
import lombok.Setter;
import java.io.Serializable;
import java.sql.Blob;
/**
* <p>
*
* </p>
*
* @author llj
* @since 2022-04-02
*/
@Getter
@Setter
@TableName("web_monitor_chart")
public class MonitorChart implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
/**
* 尾矿库编号
*/
private String tailingno;
/**
* 监测点背景图片
*/
private Blob picture;
/**
* 区域高度
*/
private Integer height;
/**
* 区域宽度
*/
private Integer width;
}
package me.zhengjie.gemho.entity.demo;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Getter;
import lombok.Setter;
import java.io.Serializable;
/**
* <p>
*
* </p>
*
* @author llj
* @since 2022-04-02
*/
@Getter
@Setter
@TableName("web_monitor_points")
public class MonitorPoints implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
/**
* 图表ID
*/
private Integer chartid;
/**
* 监测点类型
*/
private String type;
/**
* 编号
*/
private String guid;
/**
* 监测点名称
*/
private String name;
/**
* x位置
*/
private String x;
/**
* y位置
*/
private String y;
/**
* 高度
*/
private Double height;
/**
* 宽度
*/
private Double width;
/**
* 角度
*/
private Double angle;
/**
* 信息框位置
*/
private String infoseat;
/**
* 备注
*/
private String remark;
}
package me.zhengjie.gemho.entity.tab;
package me.zhengjie.gemho.entity.dic;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
......@@ -13,30 +13,26 @@ import java.io.Serializable;
/**
* <p>
*
* 检测项_字典
* </p>
*
* @author llj
* @since 2022-02-11
* @since 2022-04-25
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("tb_mon_drybeachequipinfor")
@ApiModel(value="TbMonDrybeachequipinfor对象", description="")
public class MonDrybeachequipinfor implements Serializable {
@TableName("c_jcjd")
@ApiModel(value="Jcjd对象", description="检测项_字典")
public class Jcjd implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "主键id")
@ApiModelProperty(value = "主键")
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
@ApiModelProperty(value = "监测点编号")
private String monitoringno;
@ApiModelProperty(value = "设备编号")
private String equipno;
private String name;
}
package me.zhengjie.gemho.entity.dic;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serializable;
/**
* <p>
* 检测子项_字典
* </p>
*
* @author llj
* @since 2022-04-25
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("c_jczx")
@ApiModel(value="Jczx对象", description="检测子项_字典")
public class Jczx implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "主键id")
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
@ApiModelProperty(value = "监测子项")
private String name;
@ApiModelProperty(value = "关联要求")
private String content;
@ApiModelProperty(value = "仪器")
private String implement;
@ApiModelProperty(value = "精度")
private String precision;
private Integer pId;
}
......@@ -9,7 +9,7 @@ import lombok.Getter;
import lombok.Setter;
import java.io.Serializable;
import java.util.Date;
import java.time.LocalDateTime;
/**
* <p>
......@@ -79,9 +79,9 @@ public class SysSummary implements Serializable {
private String title;
private Date createtime;
private LocalDateTime createtime;
private Date updatetime;
private LocalDateTime updatetime;
private int must;
@TableField(exist = false)
private String v_appkey;
......
......@@ -85,5 +85,7 @@ public class Abnormal implements Serializable {
*/
private Date updatetime;
private int alarmlevel;
}
......@@ -560,8 +560,13 @@ public class Tailpondinfor implements Serializable {
@ApiModelProperty(value = "关联用户")
private String username;
@ApiModelProperty(value = "关联省市区")
private String subtailingno;
@ApiModelProperty(value = "大屏标题")
private String screen_title;
/**
* 创建时间
*/
......
package me.zhengjie.gemho.entity.web;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serializable;
/**
* <p>
*
* </p>
*
* @author llj
* @since 2022-03-28
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value = "WebMonitorChart对象", description = "")
public class WebMonitorChart implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键,自增
*/
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
@ApiModelProperty(value = "尾矿库编号")
@TableField(value = "tailingno")
private String tailingno;
@ApiModelProperty(value = "监测点背景图片")
private String picture;
@ApiModelProperty(value = "区域高度")
private Integer height;
@ApiModelProperty(value = "区域宽度")
private Integer width;
}
package me.zhengjie.gemho.entity.web;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serializable;
/**
* <p>
*
* </p>
*
* @author llj
* @since 2022-03-28
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="WebMonitorIcon对象", description="")
public class WebMonitorIcon implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键,自增
*/
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
@ApiModelProperty(value = "监测点类型")
private String type;
@ApiModelProperty(value = "高度")
private Double height;
@ApiModelProperty(value = "宽度")
private Double width;
@ApiModelProperty(value = "角度")
private Double angle;
@ApiModelProperty(value = "备注")
private String remark;
}
package me.zhengjie.gemho.entity.web;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serializable;
/**
* <p>
*
* </p>
*
* @author llj
* @since 2022-03-28
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="WebMonitorLink对象", description="")
public class WebMonitorLink implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键,自增
*/
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
@ApiModelProperty(value = "监测点ID")
@TableField(value = "pointid")
private String pointid;
@ApiModelProperty(value = "设备ID")
private String deviceid;
@ApiModelProperty(value = "备注")
private String remark;
}
package me.zhengjie.gemho.entity.tab;
package me.zhengjie.gemho.entity.web;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -13,53 +13,58 @@ import java.io.Serializable;
/**
* <p>
* 监测点
*
* </p>
*
* @author llj
* @since 2022-02-11
* @since 2022-03-28
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("tb_monitoring")
@ApiModel(value="TbMonitoring对象", description="监测点")
public class Monitoring implements Serializable {
@ApiModel(value = "WebMonitorPoints对象", description = "")
public class WebMonitorPoints implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键,自增
*/
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
@ApiModelProperty(value = "监测点名称")
private String monitoringname;
@ApiModelProperty(value = "图表ID")
@TableField(value = "chartid")
private Integer chartid;
@ApiModelProperty(value = "监测点编码")
private String monitoringno;
@ApiModelProperty(value = "监测点类型")
private String type;
@ApiModelProperty(value = "监测点X坐标")
private String monitoringxzb;
@ApiModelProperty(value = "编号")
private String guid;
@ApiModelProperty(value = "监测点Y坐标")
private String monitoringyzb;
@ApiModelProperty(value = "监测点名称")
private String name;
@ApiModelProperty(value = "position方位")
private String monitoringposition;
@ApiModelProperty(value = "x位置")
private Double x;
@ApiModelProperty(value = "字体大小fontSize")
private String monitoringfontSize;
@ApiModelProperty(value = "y位置")
private Double y;
@ApiModelProperty(value = "颜色color")
private String monitoringcolor;
@ApiModelProperty(value = "高度")
private Double height;
@ApiModelProperty(value = "背景")
private String monitoringimage;
@ApiModelProperty(value = "宽度")
private Double width;
@ApiModelProperty(value = "预留字段无实际意义")
private String remark;
@ApiModelProperty(value = "角度")
private Double angle;
@ApiModelProperty(value = "信息框位置")
private String infoseat;
@ApiModelProperty(value = "预留字段无实际意义")
private String backups;
@ApiModelProperty(value = "备注")
private String remark;
}
package me.zhengjie.gemho.mapper.artificial;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import me.zhengjie.gemho.entity.artificial.ArtificialData;
/**
* <p>
* 人工监测数据表 Mapper 接口
* </p>
*
* @author llj
* @since 2022-04-25
*/
public interface ArtificialDataMapper extends BaseMapper<ArtificialData> {
}
package me.zhengjie.gemho.mapper.artificial;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import me.zhengjie.gemho.entity.artificial.ArtificialPoint;
/**
* <p>
* 人工监测点位表 Mapper 接口
* </p>
*
* @author llj
* @since 2022-04-25
*/
public interface ArtificialPointMapper extends BaseMapper<ArtificialPoint> {
}
......@@ -22,6 +22,6 @@ public interface DbDataMapper extends BaseMapper<DbData> {
@Select("SELECT * FROM (SELECT * FROM `tb_db_data` where datasource =#{datasource} ORDER BY time DESC)a where sensorid=#{deviceid} and time>=#{start} and time <=#{end}GROUP BY DATE_FORMAT(a.time,'%y-%m-%d')")
List<DbData> dealmonth(String deviceid, String start, String end, int datasource);
@Select(value = "SELECT a.lenth as `lenth`,a.angle as angle ,a.safeheight as safeheight FROM `tb_db_data` a join tb_drybeachequipinfor b on a.sensorid = b.equipno where a.datasource =1 and b.equipno = #{equipno} ORDER BY time DESC LIMIT 1")
HashMap<String, Object> real(String equipno);
@Select(value = "SELECT r.* from(select b.eqdanwei as eqdanwei,b.equipno equipno,a.sensorname,a.lenth as `lenth`,a.angle as angle ,a.safeheight as safeheight ,DATE_FORMAT(a.time,'%y-%m-%d %H:%m:%m') as time from tb_db_data a join tb_drybeachequipinfor b on a.sensorid=b.equipno where a.datasource =1 and b.tailingid=#{tailingid} ORDER BY time DESC) r GROUP BY r.sensorname")
List<HashMap<String, Object>> real(String tailingid);
}
......@@ -22,6 +22,6 @@ public interface DmDataMapper extends BaseMapper<DmData> {
@Select("SELECT * FROM (SELECT * FROM `tb_dm_data` where datasource =#{datasource} ORDER BY time DESC)a where sensorid=#{sensorid} and time>=#{start} and time <=#{end}GROUP BY DATE_FORMAT(a.time,'%y-%m-%d')")
List<DmData> dealmonth(String sensorid, String start, String end, int datasource);
@Select(value = "SELECT a.dispA as dispA,a.dispB as dispB FROM `tb_dm_data` a join tb_drybeachequipinfor b on a.sensorid=b.equipno where datasource = 1 and b.equipno =#{equipno}ORDER BY time DESC LIMIT 1")
HashMap<String, Object> real(String real);
@Select(value = "SELECT r.* from(select b.eqdanwei as eqdanwei,a.sensorname,b.equipno equipno,a.dispA as dispA,a.dispB as dispB , DATE_FORMAT(a.time,'%y-%m-%d %H:%m:%m') as time from tb_dm_data a join tb_drybeachequipinfor b on a.sensorid=b.equipno where a.datasource =1 and b.tailingid=#{tailingid} ORDER BY time DESC) r GROUP BY r.sensorname")
List<HashMap<String, Object>> real(String tailingid);
}
package me.zhengjie.gemho.mapper.data;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import me.zhengjie.gemho.config.aescode.AESEncryptHandler;
import me.zhengjie.gemho.entity.data.MpData;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import java.util.HashMap;
......@@ -22,13 +19,13 @@ import java.util.List;
@Mapper
public interface MpDataMapper extends BaseMapper<MpData> {
@Results({
@Result(column = "acceler_x", property = "accelerx", typeHandler = AESEncryptHandler.class)
})
@Select("SELECT * FROM (SELECT * FROM `tb_mp_data` where datasource =#{datasource} ORDER BY time DESC)a where sensorid=#{deviceid} and time>=#{start} and time <=#{end}GROUP BY DATE_FORMAT(a.time,'%y-%m-%d')")
/* @Results({
@Result(column = "acceler_x", property = "accelerx", typeHandler = AESEncryptHandler.class)
})*/
@Select("SELECT a.disp_x as dispx ,a.disp_y as dispy,a.disp_h as disph ,a.time as time FROM (SELECT * FROM `tb_mp_data` where datasource =#{datasource} ORDER BY time DESC)a where sensorid=#{deviceid} and time>=#{start} and time <=#{end}GROUP BY DATE_FORMAT(a.time,'%y-%m-%d')")
List<MpData> dealmonth(String deviceid, String start, String end, int datasource);
@Select(value = "SELECT a.disp_x as disp_x , a.disp_y as dis_y ,a.disp_h as disp_h FROM `tb_mp_data` a join tb_drybeachequipinfor b on a.sensorid = b.equipno where a.datasource =1 and equipno=#{equipno} ORDER BY time DESC LIMIT 1")
HashMap<String, Object> real(String equipno);
@Select(value = "SELECT r.* from(select b.eqdanwei as eqdanwei,b.equipno equipno,a.sensorname,a.disp_x as disp_x , a.disp_y as disp_y ,a.disp_h as disp_h ,DATE_FORMAT(a.time,'%y-%m-%d %H:%m:%m') as time from tb_mp_data a join tb_drybeachequipinfor b on a.sensorid=b.equipno where a.datasource =1 and b.tailingid=#{tailingid} ORDER BY time DESC) r GROUP BY r.sensorname")
List<HashMap<String, Object>> real(String tailingid);
}
package me.zhengjie.gemho.mapper.tab;
package me.zhengjie.gemho.mapper.data;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import me.zhengjie.gemho.entity.tab.Monitoring;
import me.zhengjie.gemho.entity.data.Pdata;
import org.apache.ibatis.annotations.Mapper;
/**
* <p>
* 监测点 Mapper 接口
* 人工检测数据表 Mapper 接口
* </p>
*
* @author llj
* @since 2022-02-11
* @since 2022-03-04
*/
@Mapper
public interface TbMonitoringMapper extends BaseMapper<Monitoring> {
public interface PdataMapper extends BaseMapper<Pdata> {
}
......@@ -22,6 +22,6 @@ public interface PslDataMapper extends BaseMapper<PslData> {
@Select("SELECT * FROM (SELECT * FROM `tb_psl_data` where datasource =#{datasource} ORDER BY time DESC)a where sensorid=#{deviceid} and time>=#{start} and time <=#{end}GROUP BY DATE_FORMAT(a.time,'%y-%m-%d')")
List<PslData> dealmonth(String deviceid, String start, String end, int datasource);
@Select(value = "SELECT a.pslvalue as `value` FROM `tb_psl_data` a join tb_drybeachequipinfor b on a.sensorid = b.equipno where a.datasource =1 and equipno=#{equipno} ORDER BY time DESC LIMIT 1")
HashMap<String, Object> real(String equipno);
@Select(value = "SELECT r.* from(select b.eqdanwei as eqdanwei,b.equipno equipno,a.sensorname,a.pslvalue as `value`, DATE_FORMAT(a.time,'%y-%m-%d %H:%m:%m')as time from tb_psl_data a join tb_drybeachequipinfor b on a.sensorid=b.equipno where a.datasource =1 and b.tailingid=#{tailingid} ORDER BY time DESC) r GROUP BY r.sensorname")
List<HashMap<String, Object>> real(String tailingid);
}
......@@ -6,6 +6,7 @@ import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import java.util.HashMap;
import java.util.List;
/**
* <p>
......@@ -18,6 +19,6 @@ import java.util.HashMap;
@Mapper
public interface RgDataMapper extends BaseMapper<RgData> {
@Select(value = "select a.rainfall as `rainfall` from tb_rg_data a join tb_drybeachequipinfor b on a.sensorid=b.equipno where a.datasource =1 and b.equipno=#{equipno} ORDER BY time DESC LIMIT 1")
HashMap<String, Object> real(String equipno);
@Select(value = "SELECT r.* from(select b.eqdanwei as eqdanwei,b.equipno equipno,a.sensorname,a.rainfall as `rainfall` ,DATE_FORMAT(a.time,'%y-%m-%d %H:%m:%m') as time from tb_rg_data a join tb_drybeachequipinfor b on a.sensorid=b.equipno where a.datasource =1 and b.tailingid=#{tailingid} ORDER BY time DESC) r GROUP BY r.sensorname")
List<HashMap<String, Object>> real(String tailingid);
}
......@@ -22,6 +22,6 @@ public interface SlDataMapper extends BaseMapper<SlData> {
@Select("SELECT * FROM (SELECT * FROM `tb_sl_data` where datasource =#{datasource} ORDER BY time DESC)a where sensorid=#{deviceid} and time>=#{start} and time <=#{end}GROUP BY DATE_FORMAT(a.time,'%y-%m-%d')")
List<SlData> dealmonth(String deviceid, String start, String end, int datasource);
@Select(value = "select a.sllvalue as `value` from tb_sl_data a join tb_drybeachequipinfor b on a.sensorid=b.equipno where a.datasource =1 and b.equipno=#{equipno} ORDER BY time DESC LIMIT 1")
HashMap<String, Object> real(String equipno);
@Select(value = "SELECT r.* from(select b.eqdanwei as eqdanwei,b.equipno equipno,a.sensorname,a.sllvalue as `value`, DATE_FORMAT(a.time,'%y-%m-%d %H:%m:%m') as time from tb_sl_data a join tb_drybeachequipinfor b on a.sensorid=b.equipno where a.datasource =1 and b.tailingid=#{tailingid} ORDER BY time DESC) r GROUP BY r.sensorname")
List<HashMap<String, Object>> real(String tailingid);
}
......@@ -21,6 +21,6 @@ public interface StDataMapper extends BaseMapper<StData> {
@Select("SELECT * FROM (SELECT * FROM `tb_st_data` where datasource =#{datasource} ORDER BY time DESC)a where sensorid=#{deviceid} and time>=#{start} and time <=#{end}GROUP BY DATE_FORMAT(a.time,'%y-%m-%d')")
List<StData> dealmonth(String deviceid, String start, String end, int datasource);
@Select(value = "SELECT a.stage as stage,a.depth as depth FROM `tb_st_data` a join tb_drybeachequipinfor b on a.sensorid=b.equipno where datasource = 1 and b.equipno =#{equipno}ORDER BY time DESC LIMIT 1")
HashMap<String, Object> real(String equipno);
@Select(value = "SELECT r.* from(select b.eqdanwei as eqdanwei,b.equipno equipno,a.sensorname,a.stage as stage,a.depth as depth ,DATE_FORMAT(a.time,'%y-%m-%d %H:%m:%m') as time from tb_st_data a join tb_drybeachequipinfor b on a.sensorid=b.equipno where a.datasource =1 and b.tailingid=#{tailingid} ORDER BY time DESC) r GROUP BY r.sensorname")
List<HashMap<String, Object>> real(String tailingid);
}
......@@ -19,6 +19,6 @@ import java.util.HashMap;
@Mapper
public interface SzDataMapper extends BaseMapper<SzData> {
@Select(value = "select c.`value` as `value`,c.name as name from (select a.svalue as `value`,b.equipname as `name` ,b.equipno as equipno from tb_sz_data a join tb_drybeachequipinfor b on a.sensorid =b.equipno WHERE b.devicetype=8 ORDER BY time DESC) c GROUP BY c.equipno")
ArrayList<HashMap<String, Object>> real();
@Select(value = "select c.`value` as `value`,c.name as name from (select a.svalue as `value`,b.equipname as `name` ,b.equipno as equipno ,DATE_FORMAT(a.time,'%y-%m-%d %H:%m:%m') as time from tb_sz_data a join tb_drybeachequipinfor b on a.sensorid =b.equipno WHERE b.devicetype=8 and b.tailingid=#{tailingid} ORDER BY time DESC) c GROUP BY c.equipno")
ArrayList<HashMap<String, Object>> real(String tailingid);
}
......@@ -21,8 +21,6 @@ public interface WtDataMapper extends BaseMapper<WtData> {
@Select("SELECT * FROM (SELECT * FROM `tb_wt_data` where datasource =#{datasource} ORDER BY time DESC)a where sensorid=#{deviceid} and time>=#{start} and time <=#{end}GROUP BY DATE_FORMAT(a.time,'%y-%m-%d')")
List<WtData> dealmonth(String deviceid, String start, String end, int datasource);
@Select(value = "SELECT a.stage as `stage` FROM `tb_wt_data` a join tb_drybeachequipinfor b on a.sensorid = b.equipno where a.datasource =1 and b.equipno = #{equipno} ORDER BY time DESC LIMIT 1")
HashMap<String, Object>
real(String equipno);
@Select(value = "SELECT r.* from(select b.eqdanwei as eqdanwei,b.equipno equipno,a.sensorname,a.stage as `stage` ,DATE_FORMAT(a.time,'%y-%m-%d %H:%m:%m') as time from tb_wt_data a join tb_drybeachequipinfor b on a.sensorid=b.equipno where a.datasource =1 and b.tailingid=#{tailingid} ORDER BY time DESC) r GROUP BY r.sensorname")
List<HashMap<String, Object>> real(String tailingid);
}
package me.zhengjie.gemho.mapper.demo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import me.zhengjie.gemho.entity.demo.MonitorChart;
import org.apache.ibatis.annotations.Mapper;
/**
* <p>
* Mapper 接口
* </p>
*
* @author llj
* @since 2022-04-02
*/
@Mapper
public interface MonitorChartMapper extends BaseMapper<MonitorChart> {
}
package me.zhengjie.gemho.mapper.demo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import me.zhengjie.gemho.entity.demo.MonitorPoints;
import org.apache.ibatis.annotations.Mapper;
/**
* <p>
* Mapper 接口
* </p>
*
* @author llj
* @since 2022-04-02
*/
@Mapper
public interface MonitorPointsMapper extends BaseMapper<MonitorPoints> {
}
package me.zhengjie.gemho.mapper.dic;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
* 检测项_字典 Mapper 接口
* </p>
*
* @author llj
* @since 2022-04-25
*/
public interface JcjdMapper extends BaseMapper<Jcjd> {
}
package me.zhengjie.gemho.mapper.dic;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
* 检测子项_字典 Mapper 接口
* </p>
*
* @author llj
* @since 2022-04-25
*/
public interface JczxMapper extends BaseMapper<Jczx> {
}
package me.zhengjie.gemho.mapper.sys;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import me.zhengjie.gemho.datavo.sys.DataRangeVo;
import me.zhengjie.gemho.entity.sys.SysDaterange;
import me.zhengjie.gemho.x_datavo.sys.DataRangeVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
......
......@@ -27,4 +27,7 @@ public interface SysSelectMapper extends BaseMapper<SysSelect> {
@Select("select ss.id as id,sy.title as sumtitle,sy.ranges as `range` , sy.requrl as requrl,sy.type as type,sy.subitem as subitem ,ss.mdcode as mdcode ,sy.deviceid as deviceid ,sy.`values` as `values` from sys_select ss JOIN sys_summary sy on sy.id=ss.sumid where ss.tailno=#{tailno}")
List<Children> getchildren(String tailno);
@Select(value = "SELECT a.id as id ,a.mdcode as mdcode ,a.sumid as sumid , a.tailno as tailno, b.title as sumtitle FROM sys_select a join sys_summary b on a.sumid=b.id where a.tailno=#{gettailno}")
List<SysSelect> getbytail(String gettailno);
}
package me.zhengjie.gemho.mapper.sys;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import me.zhengjie.gemho.datavo.sys.TypeVo;
import me.zhengjie.gemho.entity.sys.SysSubitem;
import me.zhengjie.gemho.x_datavo.sys.TypeVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
......
......@@ -3,10 +3,7 @@ package me.zhengjie.gemho.mapper.sys;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import me.zhengjie.gemho.entity.sys.SysSummary;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.*;
import java.util.List;
import java.util.Map;
......@@ -31,7 +28,7 @@ public interface SysSummaryMapper extends BaseMapper<SysSummary> {
@Select(value = "select id from sys_summary where mdcode =#{mdcode} ")
List<Integer> getcode(String mdcode);
@Select(value = "select a.id as id ,a.title as title from sys_summary a JOIN sys_devicetype b on a.type=b.type where b.must = '1' " +
@Select(value = "select a.id as id ,a.title as title from sys_summary a JOIN sys_devicetype b on a.type=b.type where b.must = '1' and a.name=#{tailingno} " +
"UNION\n" +
"select a.id as id,a.title as title from sys_summary a JOIN sys_devicetype b on a.type=b.type where a.deviceid in (select equipno FROM tb_drybeachequipinfor where tailingid = #{tailingno}) ORDER BY id DESC")
List<Map<String, Object>> getUncode(String tailingno);
......@@ -46,14 +43,23 @@ public interface SysSummaryMapper extends BaseMapper<SysSummary> {
"select a.* from sys_summary a JOIN sys_devicetype b on a.type=b.type where a.deviceid in (select equipno FROM tb_drybeachequipinfor where tailingid =#{tailingno}) ORDER BY id DESC")
Page<SysSummary> getbyeqno(Page page, @Param("tailingno") String tailingno);
/* @Select(value = "SELECT a.* FROM `sys_summary` a JOIN monitorvideo b ON a.id = b.v_sumid where name =#{tailingno}")
Page<SysSummary> getbyeqno(Page page, @Param("tailingno") String tailingno);
@Select(value = "select a.* from sys_summary a JOIN sys_devicetype b on a.type=b.type where a.deviceid in (select equipno FROM tb_drybeachequipinfor where tailingid =#{tailingno}) ORDER BY id DESC")
Page<SysSummary> getbyeqno1(Page page, @Param("tailingno") String tailingno);
@Select(value = " select r.* from (SELECT * FROM `sys_summary` where type!='t_14' and name =#{tailingno}\n" +
"UNION\n" +
"SELECT a.* FROM `sys_summary` a JOIN monitorvideo b ON a.id = b.v_sumid where name =#{tailingno}\n" +
"UNION\n" +
"select a.* from sys_summary a JOIN sys_devicetype b on a.type=b.type where a.deviceid in (select equipno FROM tb_drybeachequipinfor where tailingid =#{tailingno}) ORDER BY id DESC) r where r.title like CONCAT(CONCAT('%', #{searchValue}), '%')")
Page<SysSummary> getbyeqnobyseach(Page page, @Param("tailingno") String tailingno, String searchValue);
/* @Select(value = "SELECT a.* FROM `sys_summary` a JOIN monitorvideo b ON a.id = b.v_sumid where name =#{tailingno}")
Page<SysSummary> getbyeqno(Page page, @Param("tailingno") String tailingno);
@Select(value = "SELECT * FROM `sys_summary` where type!='t_14' and name =#{tailingno}")
Page<SysSummary> getbyeqno2(Page page, @Param("tailingno") String tailingno);*/
@Select(value = "select a.* from sys_summary a JOIN sys_devicetype b on a.type=b.type where a.deviceid in (select equipno FROM tb_drybeachequipinfor where tailingid =#{tailingno}) ORDER BY id DESC")
Page<SysSummary> getbyeqno1(Page page, @Param("tailingno") String tailingno);
@Select(value = "SELECT * FROM `sys_summary` where type!='t_14' and name =#{tailingno}")
Page<SysSummary> getbyeqno2(Page page, @Param("tailingno") String tailingno);*/
@Delete(value = "DELETE sy.*,ss.*,m.*from sys_select ss RIGHT join sys_summary sy on sy.id=ss.sumid LEFT JOIN monitorvideo m on sy.id= m.v_sumid where sy.id=#{id}")
int deletebyid(int id);
}
......@@ -5,6 +5,8 @@ import me.zhengjie.gemho.entity.sys.SysType;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import java.util.List;
/**
* <p>
* 大屏配置系统表 Mapper 接口
......@@ -18,4 +20,10 @@ import org.apache.ibatis.annotations.Select;
public interface SysTypeMapper extends BaseMapper<SysType> {
@Select(value = " SELECT must FROM `sys_devicetype` where type=#{type}")
int getMust(String type);
@Select(value = "select b.name from tb_drybeachequipinfor a join sys_devicetype b on a.devicetype=b.`code` where tailingid=#{tailingid}")
List<String> getbytailno(String tailingid);
@Select(value = "SELECT name FROM `sys_devicetype` where must = 0 or name ='水质'")
List<String> getname();
}
package me.zhengjie.gemho.mapper.sys;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import me.zhengjie.gemho.datavo.sys.ValuesVo;
import me.zhengjie.gemho.entity.sys.SysValue;
import me.zhengjie.gemho.x_datavo.sys.ValuesVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
......
package me.zhengjie.gemho.mapper.tab;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import me.zhengjie.gemho.entity.dic.Dic;
import me.zhengjie.gemho.entity.tab.Drybeachequipinfor;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
/**
* <p>
* 干滩设备信息 Mapper 接口
* 设备信息 Mapper 接口
* </p>
*
* @author llj
......@@ -22,13 +25,13 @@ import java.util.HashMap;
@Mapper
public interface DrybeachequipinforMapper extends BaseMapper<Drybeachequipinfor> {
@Update("update tb_drybeachequipinfor set state = 0 where equipname=#{equipname} ")
int jcbj(String equipname);
@Update("update tb_drybeachequipinfor set state = 0 where equipno=#{equipno} ")
int jcbj(String equipno);
@Select(value = "select tailingno as value ,tailingname as name from tb_tailpondinfor")
ArrayList<Dic> gettailingid();
@Select(value = "select code as value ,name from sys_devicetype where must ='0' ")
@Select(value = "select code as value ,name from sys_devicetype where must ='0' or type='t_8' ")
ArrayList<Dic> getdevicetype();
@Select(value = "select equipno from tb_drybeachequipinfor where tailingid = #{tailingid}")
......@@ -37,29 +40,48 @@ public interface DrybeachequipinforMapper extends BaseMapper<Drybeachequipinfor>
@Select(value = "select equipno as value ,equipname as name from tb_drybeachequipinfor")
ArrayList<HashMap<String, String>> getDryCode();
@Select(value = "select count(id) from tb_drybeachequipinfor ")
int getallcount();
@Select(value = "select count(id) from tb_drybeachequipinfor where tailingid=#{tailingid}")
int getallcount(String equipno);
@Select("SELECT count(distinct sensorid)AS `online` from tb_db_data WHERE time >=DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 DAY),'%Y-%m-%d')\n" +
@Select("SELECT count(distinct sensorid)AS `online` from tb_db_data a join tb_drybeachequipinfor b on a.sensorid=b.equipno WHERE a.time >=DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 DAY),'%Y-%m-%d') and b.tailingid=#{tailingid}" +
"UNION ALL\n" +
"SELECT count(distinct sensorid)AS `online` from tb_dm_data WHERE time >=DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 DAY),'%Y-%m-%d')\n" +
"SELECT count(distinct sensorid)AS `online` from tb_dm_data a join tb_drybeachequipinfor b on a.sensorid=b.equipno WHERE a.time >=DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 DAY),'%Y-%m-%d')and b.tailingid=#{tailingid}" +
"UNION ALL\n" +
"SELECT count(distinct sensorid)AS `online` from tb_sz_data WHERE time >=DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 DAY),'%Y-%m-%d') \n" +
"SELECT count(distinct sensorid)AS `online` from tb_sz_data a join tb_drybeachequipinfor b on a.sensorid=b.equipno WHERE a.time >=DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 DAY),'%Y-%m-%d') and b.tailingid=#{tailingid}" +
"UNION ALL\n" +
"SELECT count(distinct sensorid)AS `online` from tb_psl_data WHERE time >=DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 DAY),'%Y-%m-%d')\n" +
"SELECT count(distinct sensorid)AS `online` from tb_psl_data a join tb_drybeachequipinfor b on a.sensorid=b.equipno WHERE a.time >=DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 DAY),'%Y-%m-%d')and b.tailingid=#{tailingid}" +
"UNION ALL\n" +
"SELECT count(distinct sensorid)AS `online` from tb_st_data WHERE time >=DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 DAY),'%Y-%m-%d')\n" +
"SELECT count(distinct sensorid)AS `online` from tb_st_data a join tb_drybeachequipinfor b on a.sensorid=b.equipno WHERE a.time >=DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 DAY),'%Y-%m-%d')and b.tailingid=#{tailingid}" +
"UNION ALL\n" +
"SELECT count(distinct sensorid)AS `online` from tb_st_data WHERE time >=DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 DAY),'%Y-%m-%d')\n" +
"SELECT count(distinct sensorid)AS `online` from tb_st_data a join tb_drybeachequipinfor b on a.sensorid=b.equipno WHERE a.time >=DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 DAY),'%Y-%m-%d')and b.tailingid=#{tailingid}" +
"UNION ALL\n" +
"SELECT count(distinct sensorid)AS `online` from tb_rg_data WHERE time >=DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 DAY),'%Y-%m-%d')\n" +
"SELECT count(distinct sensorid)AS `online` from tb_rg_data a join tb_drybeachequipinfor b on a.sensorid=b.equipno WHERE a.time >=DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 DAY),'%Y-%m-%d')and b.tailingid=#{tailingid}" +
"UNION ALL\n" +
"SELECT count(distinct sensorid)AS `online` from tb_wt_data WHERE time >=DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 DAY),'%Y-%m-%d')\n" +
"SELECT count(distinct sensorid)AS `online` from tb_wt_data a join tb_drybeachequipinfor b on a.sensorid=b.equipno WHERE a.time >=DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 DAY),'%Y-%m-%d')and b.tailingid=#{tailingid}" +
"UNION ALL\n" +
"SELECT count(distinct sensorid)AS `online` from tb_sl_data WHERE time >=DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 DAY),'%Y-%m-%d')\n")
ArrayList<Integer> getonlinecount();
"SELECT count(distinct sensorid)AS `online` from tb_sl_data a join tb_drybeachequipinfor b on a.sensorid=b.equipno WHERE a.time >=DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 DAY),'%Y-%m-%d')and b.tailingid=#{tailingid}")
ArrayList<Integer> getonlinecount(String tailingid);
@Select(value = "select a.type from sys_devicetype a join tb_drybeachequipinfor b on a.`code`= b.devicetype where b.equipno=#{equipno}")
String getdrytype(String equipno);
int deleteall(String equipno);
@Select(value = "select equipno from tb_drybeachequipinfor where tailingid =#{tailno}")
List<String> getequipno(String tailno);
@Select(value = "select equipno as id ,equipname as name from tb_drybeachequipinfor where tailingid =#{tailno}")
List<HashMap<String, Object>> getDevice(String tailingid);
@Select(value = "<script>" +
"select equipno, equipname, onelevelalarm, twolevelalarm, threelevelalarm, fourlevelalarm from tb_drybeachequipinfor where tailingid = #{tailingid}" +
" <if test='searchValue!=\"\" and searchValue!=null '>\n" +
" and equipname=#{searchValue}\n" +
" </if>" +
"</script>")
Page<HashMap<String, Object>> level(Page page, String tailingid, String searchName, String searchValue);
int dealLevel(@Param(value = "equipno") String equipno, @Param(value = "onelevelalarm") String onelevelalarm, @Param(value = "twolevelalarm") String twolevelalarm, @Param(value = "threelevelalarm") String threelevelalarm, @Param(value = "fourlevelalarm") String fourlevelalarm);
List<HashMap<String, Object>> dryStateCount(String tailingid);
}
package me.zhengjie.gemho.mapper.tab;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import me.zhengjie.gemho.entity.tab.MonDrybeachequipinfor;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import java.util.ArrayList;
import java.util.HashMap;
/**
* <p>
* Mapper 接口
* </p>
*
* @author llj
* @since 2022-02-11
*/
@Mapper
public interface MonDrybeachequipinforMapper extends BaseMapper<MonDrybeachequipinfor> {
@Select(value = "SELECT a.equipno as id ,a.equipname as name from tb_drybeachequipinfor a join tb_mon_drybeachequipinfor b on a.equipno = b.equipno WHERE b.monitoringno=#{monitoringno}")
ArrayList<HashMap<String, String>> getBymo(String monitoringno);
}
package me.zhengjie.gemho.mapper.tab;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import me.zhengjie.gemho.datavo.sys.MonitorvideoVo;
import me.zhengjie.gemho.entity.tab.Monitorvideo;
import me.zhengjie.gemho.x_datavo.sys.MonitorvideoVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
......
......@@ -3,6 +3,13 @@ package me.zhengjie.gemho.mapper.tab;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import me.zhengjie.gemho.entity.tab.Abnormal;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
/**
* <p>
......@@ -15,5 +22,67 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface TabAbnormalMapper extends BaseMapper<Abnormal> {
@Select(value = "select ta.equipno as equipno , ta.evalue as evalue , ta.alarmlevel as alarmlevel ,td.equipname ,td.eqdanwei as eqdanwei ,DATE_FORMAT(ta.time,'%Y-%m-%d %H:%i:%s') as time from tab_abnormal ta join tb_drybeachequipinfor td on ta.equipno = td.equipno where ta.state='1' ORDER BY ta.time DESC")
ArrayList<HashMap<String, Object>> getalarminfo();
@Update(value = "update tab_abnormal set state = '0' ,jcreason= #{jcreason},jcbjtime=#{jcbjtime},reason=#{reason} where equipno =#{equipno}")
int jcbj(@Param(value = "jcreason") String jcreason,
@Param(value = "jcbjtime") String jcbjtime,
@Param(value = "reason") String reason,
@Param(value = "equipno") String equipno);
@Select(value = "select b.name,b.code ,\n" +
"sum(case when alarmlevel =1 then 1 else 0 end )as \"red\",\n" +
"sum(case when alarmlevel =2 then 1 else 0 end )as \"orange\",\n" +
"sum(case when alarmlevel =3 then 1 else 0 end )as \"yellow\",\n" +
"sum(case when alarmlevel =4 then 1 else 0 end )as \"blue\" \n" +
"FROM (SELECT * from tab_abnormal where DATE_FORMAT(time,'%y') =DATE_FORMAT(NOW(),'%y') ) a right join (SELECT tdr.equipno as equipno ,tdr.devicetype as `code` ,ssd.`name` as `name` FROM `tb_drybeachequipinfor` tdr join sys_devicetype ssd on tdr.devicetype =ssd.`code` WHERE tdr.tailingid=#{tailno}) b on a.equipno= b.equipno GROUP BY b.code")
List<HashMap<String, Object>> statistics(String tailno);
@Select(value = "select count(a.equipno) as count ,b.equipname,b.equipno ,\n" +
"sum(case when alarmlevel =1 then 1 else 0 end )as 'red',\n" +
"sum(case when alarmlevel =2 then 1 else 0 end )as 'orange',\n" +
"sum(case when alarmlevel =3 then 1 else 0 end )as 'yellow',\n" +
"sum(case when alarmlevel =4 then 1 else 0 end )as 'blue' \n" +
"FROM (SELECT ta.* from tab_abnormal ta join tb_drybeachequipinfor td on ta.equipno = td.equipno where DATE_FORMAT(ta.time,'%y-%m') =DATE_FORMAT(NOW(),'%y-%m') and td.tailingid=#{tailingid}) a right join tb_drybeachequipinfor b on a.equipno= b.equipno GROUP BY b.equipno")
List<HashMap<String, Object>> monthequipno(String tailingid);
@Select(value = "select b.name,b.code ,\n" +
"sum(case when alarmlevel =1 then 1 else 0 end )as \"1\",\n" +
"sum(case when alarmlevel =2 then 1 else 0 end )as \"2\",\n" +
"sum(case when alarmlevel =3 then 1 else 0 end )as \"3\",\n" +
"sum(case when alarmlevel =4 then 1 else 0 end )as \"4\" \n" +
"FROM (SELECT * from tab_abnormal where DATE_FORMAT(time,'%y') =DATE_FORMAT(NOW(),'%y') and state = 1) a right join (SELECT tdr.equipno as equipno ,tdr.devicetype as `code` ,ssd.`name` as `name` FROM `tb_drybeachequipinfor` tdr join sys_devicetype ssd on tdr.devicetype =ssd.`code` WHERE tdr.tailingid=#{tailno}) b on a.equipno= b.equipno GROUP BY b.code")
List<HashMap<String, Object>> statistics1(String tailno);
/**
* 获得指定设备的最新的报警级别
*/
@Select(value = "select alarmlevel from tab_abnormal where equipno=#{equipno} and state =1 ORDER BY time desc LIMIT 1")
Integer getalarmlevel(String equipno);
/**
* 检测项风险报警列表
*/
@Select(value = "select sd.name ,case\n" +
" when ta.time is null then DATE_FORMAT(now(),'%Y-%m-%d %H:%i:%s')\n" +
" else DATE_FORMAT(ta.time,'%Y-%m-%d %H:%i:%s') end as time ,sd.`code`,CASE\n" +
"\twhen ta.alarmlevel is null THEN 0\n" +
"\telse ta.alarmlevel\n" +
" end\n" +
" as alarmlevel\n" +
" from (select * from tab_abnormal ORDER BY alarmlevel DESC) ta RIGHT join (SELECT tdr.equipno as equipno ,tdr.devicetype as `code` ,ssd.`name` as `name` FROM `tb_drybeachequipinfor` tdr join sys_devicetype ssd on tdr.devicetype =ssd.`code` WHERE tdr.tailingid=#{tailno}) sd on sd.`equipno`=ta.equipno GROUP BY sd.`code`")
List<HashMap<String, Object>> gettypelist(String tailno);
@Select(value = "select case ta.alarmlevel when '1' then 'red'\n" +
" when '2' then 'orange'\n" +
" when '3' then 'yellow'\n" +
" when '4' then 'blue'\n" +
" else 'zc' end as alarmlevel\n" +
" ,COUNT(ta.id) as count FROM tab_abnormal ta join tb_drybeachequipinfor td on ta.equipno = td.equipno where DATE_FORMAT( ta.time,'%y-%m') = DATE_FORMAT(NOW(),'%y-%m') and td.tailingid = #{tailingid} GROUP BY ta.alarmlevel")
List<HashMap<String, Object>> monthtj(String tailingid);
List<HashMap<String, Object>> realalarm();
}
......@@ -9,6 +9,7 @@ import org.apache.ibatis.annotations.Update;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
/**
* <p>
......@@ -27,6 +28,9 @@ public interface TailpondinforMapper extends BaseMapper<Tailpondinfor> {
@Select(value = "select defaultno from sys_user where username=#{username}")
String gettailnobyuser(String username);
@Select(value = "SELECT b.* FROM `sys_user` a join tb_tailpondinfor b on a.defaultno= b.tailingno where a.username=#{username}")
Tailpondinfor gettailnoinfobyuser(String username);
@Select(value = "select tailingno as value ,tailingname as name from tb_tailpondinfor where tailingno not IN (SELECT tailingno from tab_user_tailpon where username = #{username}) order by id desc")
HashMap<String, Object> getcode(String username);
......@@ -42,6 +46,25 @@ public interface TailpondinforMapper extends BaseMapper<Tailpondinfor> {
@Select(value = "SELECT a.* FROM `tb_tailpondinfor` a JOIN tab_user_tailpon b ON a.tailingno = b.tailingno JOIN sys_user c ON c.username = b.username WHERE c.username = #{username}")
ArrayList<Tailpondinfor> getByUsername(String username);
@Select(value = "SELECT tailingno as `value` ,tailingname as name from tb_tailpondinfor ")
ArrayList<HashMap<String, Object>> tailpons();
@Select(value = "SELECT * from tb_tailpondinfor ")
List<Tailpondinfor> tailpons();
@Select(value = "select longitude, latitude FROM tb_tailpondinfor where tailingno=#{tailingno}")
HashMap<String, Object> getzuobiao(String tailingno);
/**
* 获取大屏标题
* @return
*/
@Select(value = "SELECT screen_title from tb_tailpondinfor where tailingno=#{tailingno}")
String getScreenTitle(String tailingno);
/**
* 修改大屏标题
* @param title
* @param tailingno
* @return
*/
@Update(value = "update tb_tailpondinfor set screen_title= #{title} where tailingno=#{tailingno}")
int updateTitle(String title,String tailingno);
}
package me.zhengjie.gemho.mapper.tab;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import me.zhengjie.gemho.entity.tab.Tailpondinfor;
import me.zhengjie.gemho.entity.tab.UserTailpon;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
/**
* <p>
......@@ -22,6 +23,6 @@ public interface UserTailponMapper extends BaseMapper<UserTailpon> {
ArrayList<String> gettailnos(String username);
@Select(value = "select b.tailingname as name ,b.tailingno as `value` from tab_user_tailpon a join tb_tailpondinfor b on b.tailingno =a.tailingno where a.username=#{username}")
ArrayList<HashMap<String, Object>> usertailpon(String username);
@Select(value = "select b.*from tab_user_tailpon a join tb_tailpondinfor b on b.tailingno =a.tailingno where a.username=#{username}")
List<Tailpondinfor> usertailpon(String username);
}
package me.zhengjie.gemho.mapper.web;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import me.zhengjie.gemho.entity.web.WebMonitorChart;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import java.util.HashMap;
/**
* <p>
* Mapper 接口
* </p>
*
* @author llj
* @since 2022-03-28
*/
@Mapper
public interface WebMonitorChartMapper extends BaseMapper<WebMonitorChart> {
@Update(value = "update web_monitor_chart set picture=null where id =#{id} ")
int delpic(int id);
@Select(value = "select * from web_monitor_chart where tailingno=#{tailingno} ")
WebMonitorChart getpic(String tailingno);
@Select(value = "select id from web_monitor_chart where tailingno=#{tailingno} ")
HashMap<String, Integer> getId(String tailingno);
@Update("update web_monitor_chart set height = #{height},width=#{width} where id =#{id}")
int updatehw(int height, int width, int id);
}
package me.zhengjie.gemho.mapper.web;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import me.zhengjie.gemho.entity.web.WebMonitorIcon;
import org.apache.ibatis.annotations.Mapper;
/**
* <p>
* Mapper 接口
* </p>
*
* @author llj
* @since 2022-03-28
*/
@Mapper
public interface WebMonitorIconMapper extends BaseMapper<WebMonitorIcon> {
}
package me.zhengjie.gemho.mapper.web;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import me.zhengjie.gemho.entity.web.WebMonitorLink;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import java.util.HashMap;
import java.util.List;
/**
* <p>
* Mapper 接口
* </p>
*
* @author llj
* @since 2022-03-28
*/
@Mapper
public interface WebMonitorLinkMapper extends BaseMapper<WebMonitorLink> {
@Select(value = "SELECT b.pointid,c.equipno as id,c.equipname as name FROM web_monitor_link b join tb_drybeachequipinfor c on c.equipno = b .deviceid where b.pointid in (select guid from web_monitor_points where chartid = #{chartid} )")
List<HashMap<String, Object>> getByChartId(int chartid);
@Select(value = "SELECT * FROM `web_monitor_link` where pointid = (select guid from web_monitor_points where guid = #{guid})")
List<WebMonitorLink> getallbypid(String guid);
void batchinsert(List<WebMonitorLink> webMonitorLinks);
int removebyids(List<String> guids);
}
package me.zhengjie.gemho.mapper.web;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import me.zhengjie.gemho.entity.web.WebMonitorPoints;
import me.zhengjie.gemho.x_datavo.web.WebMonitorPointsVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import java.util.List;
/**
* <p>
* Mapper 接口
* </p>
*
* @author llj
* @since 2022-03-28
*/
@Mapper
public interface WebMonitorPointsMapper extends BaseMapper<WebMonitorPoints> {
@Select(value = "SELECT * FROM web_monitor_points where chartid=#{chartid}")
List<WebMonitorPointsVo> getbycid(int chartid);
int deletepoints(String guid);
void batchinsert(List<WebMonitorPoints> webMonitorPoints);
}
package me.zhengjie.gemho.netty;
import io.netty.bootstrap.ServerBootstrap;
import io.netty.buffer.Unpooled;
import io.netty.channel.Channel;
import io.netty.channel.ChannelFuture;
import io.netty.channel.ChannelOption;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.socket.nio.NioServerSocketChannel;
import lombok.extern.slf4j.Slf4j;
import java.net.InetSocketAddress;
import java.nio.charset.StandardCharsets;
@Slf4j
public class NettyServer {
private Channel channel;
public void start(String port) {
InetSocketAddress socketAddress = new InetSocketAddress("192.168.4.61", Integer.parseInt(port));
//创建主线程组
NioEventLoopGroup bossGroup = new NioEventLoopGroup(1);
//创建工作主线程
NioEventLoopGroup workGroup = new NioEventLoopGroup();
ServerBootstrap serverBootstrap = new ServerBootstrap()
.group(bossGroup, workGroup)
.channel(NioServerSocketChannel.class)
.childHandler(new ServerChannelInitializer())
.localAddress(socketAddress)
.option(ChannelOption.SO_BACKLOG, 1024)
.childOption(ChannelOption.SO_KEEPALIVE, true);
try {
ChannelFuture channelFuture = serverBootstrap.bind(socketAddress).sync();
channel = channelFuture.channel();
log.info("服务器启动开始监听端口" + socketAddress.getPort());
channel.closeFuture().sync();
} catch (InterruptedException e) {
log.error("服务器打开失败" + e);
} finally {
//关闭主线程组
bossGroup.shutdownGracefully();
//关闭工作线程组
workGroup.shutdownGracefully();
}
}
public void send(String msg) {
if (channel != null) {
channel.writeAndFlush(Unpooled.wrappedBuffer(msg.getBytes(StandardCharsets.UTF_8)));
} else {
log.info("消息发送失败,连接尚未建立");
}
}
}
\ No newline at end of file
package me.zhengjie.gemho.netty;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;
import lombok.extern.slf4j.Slf4j;
import java.net.InetSocketAddress;
/**
* netty服务端处理器
**/
@Slf4j
public class NettyServerHandler extends ChannelInboundHandlerAdapter {
public static ChannelHandlerContext context;
/**
* 客户端连接会触发
*/
@Override
public void channelActive(ChannelHandlerContext ctx) throws Exception {
if (NettyServerHandler.context == null) {
NettyServerHandler.context = ctx;
}
InetSocketAddress address = (InetSocketAddress) ctx.channel().remoteAddress();
String ip = address.getAddress().getHostAddress();
int port = address.getPort();
log.info("客户端{0}:{1}已连接"+ip+":"+port, ip, port);
super.channelActive(ctx);
}
/**
* 客户端发消息会触发
*/
@Override
public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
log.info("服务器收到消息: {}", msg.toString());
ctx.write("你也好哦");
ctx.flush();
}
/**
* 发生异常触发
*/
@Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
cause.printStackTrace();
ctx.close();
}
}
package me.zhengjie.gemho.netty;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.socket.SocketChannel;
import io.netty.handler.codec.string.StringDecoder;
import io.netty.handler.codec.string.StringEncoder;
import java.nio.charset.Charset;
/**
* netty服务初始化器
**/
public class ServerChannelInitializer extends ChannelInitializer<SocketChannel> {
@Override
protected void initChannel(SocketChannel socketChannel) throws Exception {
//添加编解码
socketChannel.pipeline().addLast("decoder", new StringDecoder(Charset.forName("GBk")));
socketChannel.pipeline().addLast("encoder", new StringEncoder(Charset.forName("GBK")));
socketChannel.pipeline().addLast(new NettyServerHandler());
}
}
package me.zhengjie.gemho.service.artificial;
import com.baomidou.mybatisplus.extension.service.IService;
import me.zhengjie.gemho.entity.artificial.ArtificialData;
/**
* <p>
* 人工监测数据表 服务类
* </p>
*
* @author llj
* @since 2022-04-25
*/
public interface IArtificialDataService extends IService<ArtificialData> {
}
package me.zhengjie.gemho.service.artificial;
import com.baomidou.mybatisplus.extension.service.IService;
import me.zhengjie.gemho.entity.artificial.ArtificialPoint;
/**
* <p>
* 人工监测点位表 服务类
* </p>
*
* @author llj
* @since 2022-04-25
*/
public interface IArtificialPointService extends IService<ArtificialPoint> {
}
package me.zhengjie.gemho.service.artificial.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import me.zhengjie.gemho.entity.artificial.ArtificialData;
import me.zhengjie.gemho.mapper.artificial.ArtificialDataMapper;
import me.zhengjie.gemho.service.artificial.IArtificialDataService;
import org.springframework.stereotype.Service;
/**
* <p>
* 人工监测数据表 服务实现类
* </p>
*
* @author llj
* @since 2022-04-25
*/
@Service
public class ArtificialDataServiceImpl extends ServiceImpl<ArtificialDataMapper, ArtificialData> implements IArtificialDataService {
}
package me.zhengjie.gemho.service.artificial.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import me.zhengjie.gemho.entity.artificial.ArtificialPoint;
import me.zhengjie.gemho.mapper.artificial.ArtificialPointMapper;
import me.zhengjie.gemho.service.artificial.IArtificialPointService;
import org.springframework.stereotype.Service;
/**
* <p>
* 人工监测点位表 服务实现类
* </p>
*
* @author llj
* @since 2022-04-25
*/
@Service
public class ArtificialPointServiceImpl extends ServiceImpl<ArtificialPointMapper, ArtificialPoint> implements IArtificialPointService {
}
package me.zhengjie.gemho.service.data;
import com.baomidou.mybatisplus.extension.service.IService;
import me.zhengjie.gemho.datavo.DataVo;
import me.zhengjie.gemho.datavo.RealDataVo;
import me.zhengjie.gemho.entity.data.DbData;
import me.zhengjie.gemho.x_datavo.DataVo;
import me.zhengjie.gemho.x_datavo.RealDataVo;
import me.zhengjie.gemho.x_datavo.data.DataQueryCriteria;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.HashMap;
import java.util.List;
/**
* <p>
......@@ -50,23 +54,36 @@ public interface DbDataService extends IService<DbData> {
DataVo month(String date, String values, String deviceid, String subitem);
/**
* 分页查询历史记录
* 获取干滩的历史数据
* @param dataQueryCriteria
* @return
*/
HashMap<String, Object> pageall(DataQueryCriteria dataQueryCriteria);
/**
* 图表数据
*
* @param searchName
* @param searchValue
* @param limit
* @param timeSpace
* @param sort
* @param page
* @param size
* @param datasource
* @param state
* @return
*/
HashMap<String, Object> pageall(String searchName, String searchValue, String limit, String timeSpace, String sort, long page, long size, String datasource);
List<DbData> imgList(String searchName, String searchValue, String limit, String timeSpace, String sort, String datasource, String state);
/**
* 实时数据
*
* @return
*/
RealDataVo real(String equipno );
List<RealDataVo> real(String equipno);
/***
* 导出干滩表格
*/
void download(List<DbData> dbdatas, HttpServletResponse response) throws IOException;
}
package me.zhengjie.gemho.service.data;
import com.baomidou.mybatisplus.extension.service.IService;
import me.zhengjie.gemho.datavo.DataVo;
import me.zhengjie.gemho.datavo.RealDataVo;
import me.zhengjie.gemho.entity.data.DmData;
import me.zhengjie.gemho.x_datavo.DataVo;
import me.zhengjie.gemho.x_datavo.RealDataVo;
import java.util.HashMap;
import java.util.List;
/**
* <p>
......@@ -69,5 +70,5 @@ public interface DmDataService extends IService<DmData> {
*
* @return
*/
RealDataVo real(String equipno);
List<RealDataVo> real(String equipno);
}
package me.zhengjie.gemho.service.data;
import com.baomidou.mybatisplus.extension.service.IService;
import me.zhengjie.gemho.datavo.DataVo;
import me.zhengjie.gemho.datavo.RealDataVo;
import me.zhengjie.gemho.entity.data.MpData;
import me.zhengjie.gemho.x_datavo.DataVo;
import me.zhengjie.gemho.x_datavo.RealDataVo;
import java.util.HashMap;
import java.util.List;
......@@ -69,5 +69,5 @@ public interface MpDataService extends IService<MpData> {
*
* @return
*/
RealDataVo real(String equipno);
List<RealDataVo> real(String equipno);
}
package me.zhengjie.gemho.service.tab;
package me.zhengjie.gemho.service.data;
import com.baomidou.mybatisplus.extension.service.IService;
import me.zhengjie.gemho.entity.tab.Monitoring;
import me.zhengjie.gemho.entity.data.Pdata;
/**
* <p>
* 监测点 服务类
* 人工检测数据表 服务类
* </p>
*
* @author llj
* @since 2022-02-11
* @since 2022-03-04
*/
public interface MonitoringService extends IService<Monitoring> {
public interface PdataService extends IService<Pdata> {
}
package me.zhengjie.gemho.service.data;
import com.baomidou.mybatisplus.extension.service.IService;
import me.zhengjie.gemho.datavo.DataVo;
import me.zhengjie.gemho.datavo.RealDataVo;
import me.zhengjie.gemho.entity.data.PslData;
import me.zhengjie.gemho.x_datavo.DataVo;
import me.zhengjie.gemho.x_datavo.RealDataVo;
import java.util.HashMap;
import java.util.List;
/**
* <p>
......@@ -68,5 +69,5 @@ public interface PslDataService extends IService<PslData> {
* 实时数据
* @return
*/
RealDataVo real(String equipno);
List<RealDataVo> real(String equipno);
}
package me.zhengjie.gemho.service.data;
import com.baomidou.mybatisplus.extension.service.IService;
import me.zhengjie.gemho.datavo.DataVo;
import me.zhengjie.gemho.datavo.RealDataVo;
import me.zhengjie.gemho.entity.data.RgData;
import me.zhengjie.gemho.x_datavo.DataVo;
import me.zhengjie.gemho.x_datavo.RealDataVo;
import java.util.HashMap;
import java.util.List;
/**
* <p>
......@@ -66,5 +67,5 @@ public interface RgDataService extends IService<RgData> {
*
* @return
*/
RealDataVo real(String equipno);
List<RealDataVo> real(String equipno);
}
package me.zhengjie.gemho.service.data;
import com.baomidou.mybatisplus.extension.service.IService;
import me.zhengjie.gemho.datavo.DataVo;
import me.zhengjie.gemho.datavo.RealDataVo;
import me.zhengjie.gemho.entity.data.SlData;
import me.zhengjie.gemho.x_datavo.DataVo;
import me.zhengjie.gemho.x_datavo.RealDataVo;
import java.util.HashMap;
import java.util.List;
/**
* <p>
......@@ -66,7 +67,8 @@ public interface SlDataService extends IService<SlData> {
/**
* 实时数据
*
* @return
*/
RealDataVo real(String equipno);
List<RealDataVo> real(String equipno);
}
package me.zhengjie.gemho.service.data;
import com.baomidou.mybatisplus.extension.service.IService;
import me.zhengjie.gemho.datavo.DataVo;
import me.zhengjie.gemho.datavo.RealDataVo;
import me.zhengjie.gemho.entity.data.StData;
import me.zhengjie.gemho.x_datavo.DataVo;
import me.zhengjie.gemho.x_datavo.RealDataVo;
import java.util.HashMap;
import java.util.List;
/**
* <p>
......@@ -70,5 +71,5 @@ public interface StDataService extends IService<StData> {
* @param equipno
* @return
*/
RealDataVo real(String equipno);
List<RealDataVo> real(String equipno);
}
package me.zhengjie.gemho.service.data;
import com.baomidou.mybatisplus.extension.service.IService;
import me.zhengjie.gemho.datavo.DataVo;
import me.zhengjie.gemho.entity.data.SzData;
import me.zhengjie.gemho.x_datavo.DataVo;
import java.util.ArrayList;
import java.util.HashMap;
......
package me.zhengjie.gemho.service.data;
import com.baomidou.mybatisplus.extension.service.IService;
import me.zhengjie.gemho.datavo.DataVo;
import me.zhengjie.gemho.datavo.RealDataVo;
import me.zhengjie.gemho.entity.data.WtData;
import me.zhengjie.gemho.x_datavo.DataVo;
import me.zhengjie.gemho.x_datavo.RealDataVo;
import java.util.HashMap;
import java.util.List;
/**
* <p>
......@@ -69,5 +70,5 @@ public interface WtDataService extends IService<WtData> {
*
* @return
*/
RealDataVo real(String equipno);
List<RealDataVo> real(String equipno);
}
......@@ -3,23 +3,23 @@ package me.zhengjie.gemho.service.data.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import me.zhengjie.gemho.datavo.DataVo;
import me.zhengjie.gemho.datavo.NameVo;
import me.zhengjie.gemho.datavo.RealDataVo;
import me.zhengjie.gemho.datavo.Result;
import me.zhengjie.gemho.entity.data.DbData;
import me.zhengjie.gemho.entity.tab.Drybeachequipinfor;
import me.zhengjie.gemho.mapper.data.DbDataMapper;
import me.zhengjie.gemho.mapper.tab.DrybeachequipinforMapper;
import me.zhengjie.gemho.service.data.DbDataService;
import me.zhengjie.gemho.util.DataUtil;
import me.zhengjie.gemho.util.DateUtil;
import me.zhengjie.gemho.util.ReadJsonFileUtil;
import me.zhengjie.gemho.util.ServiceUtil;
import me.zhengjie.gemho.util.*;
import me.zhengjie.gemho.x_datavo.DataVo;
import me.zhengjie.gemho.x_datavo.NameVo;
import me.zhengjie.gemho.x_datavo.RealDataVo;
import me.zhengjie.gemho.x_datavo.Result;
import me.zhengjie.gemho.x_datavo.data.DataQueryCriteria;
import me.zhengjie.utils.FileUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.lang.reflect.Field;
import java.text.ParseException;
import java.text.SimpleDateFormat;
......@@ -75,7 +75,7 @@ public class DbDataServiceImpl extends ServiceImpl<DbDataMapper, DbData> impleme
for (String string : strings) {
HashMap<String, Double> hashMap = new HashMap<>();
hashMap.put(dbdata, 0.0);
hashMap.put("p_" + dbdata, 0.0);
//hashMap.put("p_" + dbdata, 0.0);
Result result = new Result();
if (!dbData1.isEmpty()) {
for (DbData data1 : dbData1) {
......@@ -90,7 +90,7 @@ public class DbDataServiceImpl extends ServiceImpl<DbDataMapper, DbData> impleme
}
}
}
if (!dbData2.isEmpty()) {
/* if (!dbData2.isEmpty()) {
for (DbData data2 : dbData2) {
String format = sdf2.format(data2.getTime());
if (string.equals(format)) {
......@@ -102,19 +102,18 @@ public class DbDataServiceImpl extends ServiceImpl<DbDataMapper, DbData> impleme
break;
}
}
}
}*/
Date parse = sdf1.parse(string + ":00:00");
result.setValues(hashMap);
result.setDate(parse);
result.setDateUnit(string.substring(string.length() - 2, string.length()) + "时");
/* result.setDateUnit(string.substring(string.length() - 2, string.length()) + "时")*/
;
result.setDateUnit(string);
results.add(result);
}
nameVos = DataUtil.dbdatanames(nameVos, subitem);
Drybeachequipinfor dealalarm = DataUtil.dealalarm(deviceid);
dataVo.setAlarm1(dealalarm.getOnelevelalarm().toString());
dataVo.setAlarm2(dealalarm.getTwolevelalarm().toString());
dataVo.setAlarm3(dealalarm.getThreelevelalarm().toString());
dataVo.setAlarm4(dealalarm.getFourlevelalarm().toString());
HashMap<String, Object> dealalarm = DataUtil.dealalarm(deviceid);
dataVo.setAlarm(dealalarm);
dataVo.setNames(nameVos);
dataVo.setDevid(deviceid);
dataVo.setLists(results);
......@@ -155,7 +154,7 @@ public class DbDataServiceImpl extends ServiceImpl<DbDataMapper, DbData> impleme
Result result = new Result();
HashMap<String, Double> hashMap = new HashMap<>();
hashMap.put(dbdata, 0.0);
hashMap.put("p_" + dbdata, 0.0);
//hashMap.put("p_" + dbdata, 0.0);
if (!dbData1.isEmpty()) {
for (DbData data1 : dbData1) {
String format = sdf.format(data1.getTime());
......@@ -169,7 +168,7 @@ public class DbDataServiceImpl extends ServiceImpl<DbDataMapper, DbData> impleme
}
}
}
if (!dbData2.isEmpty()) {
/* if (!dbData2.isEmpty()) {
for (DbData data2 : dbData2) {
String format = sdf.format(data2.getTime());
if (string.equals(format)) {
......@@ -181,20 +180,17 @@ public class DbDataServiceImpl extends ServiceImpl<DbDataMapper, DbData> impleme
break;
}
}
}
}*/
Date parse = sdf1.parse(string + " 00:00:00");
result.setValues(hashMap);
String deal = deal(parse);
result.setDate(parse);
result.setDateUnit(deal);
result.setDateUnit(string.split("-")[1] + "-" + string.split("-")[2]);
results.add(result);
}
nameVos = DataUtil.dbdatanames(nameVos, subitem);
Drybeachequipinfor dealalarm = DataUtil.dealalarm(deviceid);
dataVo.setAlarm1(dealalarm.getOnelevelalarm().toString());
dataVo.setAlarm2(dealalarm.getTwolevelalarm().toString());
dataVo.setAlarm3(dealalarm.getThreelevelalarm().toString());
dataVo.setAlarm4(dealalarm.getFourlevelalarm().toString());
HashMap<String, Object> dealalarm = DataUtil.dealalarm(deviceid);
dataVo.setAlarm(dealalarm);
dataVo.setNames(nameVos);
dataVo.setDevid(deviceid);
dataVo.setLists(results);
......@@ -236,7 +232,7 @@ public class DbDataServiceImpl extends ServiceImpl<DbDataMapper, DbData> impleme
Result result = new Result();
HashMap<String, Double> hashMap = new HashMap<>();
hashMap.put(dbdata, 0.0);
hashMap.put("p_" + dbdata, 0.0);
//hashMap.put("p_" + dbdata, 0.0);
if (!dbData1.isEmpty()) {
for (DbData data1 : dbData1) {
String format = sdf.format(data1.getTime());
......@@ -250,7 +246,7 @@ public class DbDataServiceImpl extends ServiceImpl<DbDataMapper, DbData> impleme
}
}
}
if (!dbData2.isEmpty()) {
/* if (!dbData2.isEmpty()) {
for (DbData data2 : dbData2) {
String format = sdf.format(data2.getTime());
if (string.equals(format)) {
......@@ -263,7 +259,7 @@ public class DbDataServiceImpl extends ServiceImpl<DbDataMapper, DbData> impleme
}
}
}
*/
Date parse = sdf1.parse(string + " 00:00:00");
result.setValues(hashMap);
......@@ -272,11 +268,8 @@ public class DbDataServiceImpl extends ServiceImpl<DbDataMapper, DbData> impleme
results.add(result);
}
nameVos = DataUtil.dbdatanames(nameVos, subitem);
Drybeachequipinfor dealalarm = DataUtil.dealalarm(deviceid);
dataVo.setAlarm1(dealalarm.getOnelevelalarm().toString());
dataVo.setAlarm2(dealalarm.getTwolevelalarm().toString());
dataVo.setAlarm3(dealalarm.getThreelevelalarm().toString());
dataVo.setAlarm4(dealalarm.getFourlevelalarm().toString());
HashMap<String, Object> dealalarm = DataUtil.dealalarm(deviceid);
dataVo.setAlarm(dealalarm);
dataVo.setNames(nameVos);
dataVo.setDevid(deviceid);
dataVo.setLists(results);
......@@ -288,10 +281,12 @@ public class DbDataServiceImpl extends ServiceImpl<DbDataMapper, DbData> impleme
}
@Override
public HashMap<String, Object> pageall(String searchName, String searchValue, String limit, String timeSpace, String sort, long page, long size, String datasource) {
public HashMap<String, Object> pageall(DataQueryCriteria dataQueryCriteria) {
long size = dataQueryCriteria.getSize();
long page = dataQueryCriteria.getPage();
HashMap<String, Object> map = new HashMap<>();
QueryWrapper<DbData> dbDataQueryWrapper = new QueryWrapper<>();
ServiceUtil.dbquery(dbDataQueryWrapper, searchName, searchValue, limit, timeSpace, sort, datasource);
ServiceUtil.dataQuery(dbDataQueryWrapper, dataQueryCriteria);
Page<DbData> dbDataPage = new Page<>(page + 1, size);
dbDataPage = dbDataMapper.selectPage(dbDataPage, dbDataQueryWrapper);
map.put("list", dbDataPage.getRecords());
......@@ -300,16 +295,58 @@ public class DbDataServiceImpl extends ServiceImpl<DbDataMapper, DbData> impleme
}
@Override
public RealDataVo real(String equipno) {
HashMap<String, Object> real = dbDataMapper.real(equipno);
public List<DbData> imgList(String searchName, String searchValue, String limit, String timeSpace, String sort, String datasource, String state) {
QueryWrapper<DbData> dbDataQueryWrapper = new QueryWrapper<>();
ServiceUtil.dbquery(dbDataQueryWrapper, searchName, searchValue, limit, timeSpace, sort, datasource);
List<DbData> dbData = dbDataMapper.selectList(dbDataQueryWrapper);
return dbData;
}
@Override
public List<RealDataVo> real(String equipno1) {
String tailInfoNo = TailNoForInfoUtil.getTailInfoNo();
List<HashMap<String, Object>> reals = dbDataMapper.real(tailInfoNo);
HashMap<String, List<Map>> realdata = ReadJsonFileUtil.getMap("realdata");
Object keys1 = realdata.get("dbdata");
RealDataVo realDataVo = new RealDataVo();
realDataVo.setData(real);
realDataVo.setKeys(keys1);
String getdrytype = drybeachequipinforMapper.getdrytype(equipno);
realDataVo.setType(getdrytype);
return realDataVo;
ArrayList<RealDataVo> realDataVos = new ArrayList<>();
for (int i = 0; i < reals.size(); i++) {
HashMap<String, Object> real = reals.get(i);
String sensorname = (String) real.get("sensorname");
String eqdanwei = (String) real.get("eqdanwei");
String equipno = (String) real.get("equipno");
String time = (String) real.get("time");
real.remove("time");
real.remove("equipno");
real.remove("sensorname");
real.remove("eqdanwei");
RealDataVo realDataVo = new RealDataVo();
realDataVo.setTime(time);
realDataVo.setEquipno(equipno);
realDataVo.setData(real);
realDataVo.setKeys(keys1);
realDataVo.setName(sensorname);
realDataVo.setType(equipno1);
realDataVo.setEqdanwei(eqdanwei);
realDataVos.add(realDataVo);
}
return realDataVos;
}
@Override
public void download(List<DbData> dbdatas, HttpServletResponse response) throws IOException {
List<Map<String, Object>> list = new ArrayList<>();
for (DbData dbdata : dbdatas) {
Map<String, Object> map = new LinkedHashMap<>();
map.put("设备编号", dbdata.getSensorid());
map.put("设备名称", dbdata.getSensorname());
map.put("测量时间", dbdata.getTime());
map.put("干滩长度", dbdata.getLenth());
map.put("坡度角", dbdata.getAngle());
map.put("安全超高", dbdata.getSafeheight());
map.put("是否报警", dbdata.getState() == 0 ? "否" : "是");
list.add(map);
}
FileUtil.downloadExcel(list, response);
}
public String deal(Date date) throws ParseException {
......
......@@ -3,19 +3,15 @@ package me.zhengjie.gemho.service.data.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import me.zhengjie.gemho.datavo.DataVo;
import me.zhengjie.gemho.datavo.NameVo;
import me.zhengjie.gemho.datavo.RealDataVo;
import me.zhengjie.gemho.datavo.Result;
import me.zhengjie.gemho.entity.data.DmData;
import me.zhengjie.gemho.entity.tab.Drybeachequipinfor;
import me.zhengjie.gemho.mapper.data.DmDataMapper;
import me.zhengjie.gemho.mapper.tab.DrybeachequipinforMapper;
import me.zhengjie.gemho.service.data.DmDataService;
import me.zhengjie.gemho.util.DataUtil;
import me.zhengjie.gemho.util.DateUtil;
import me.zhengjie.gemho.util.ReadJsonFileUtil;
import me.zhengjie.gemho.util.ServiceUtil;
import me.zhengjie.gemho.util.*;
import me.zhengjie.gemho.x_datavo.DataVo;
import me.zhengjie.gemho.x_datavo.NameVo;
import me.zhengjie.gemho.x_datavo.RealDataVo;
import me.zhengjie.gemho.x_datavo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -54,46 +50,47 @@ public class DmDataServiceImpl extends ServiceImpl<DmDataMapper, DmData> impleme
QueryWrapper<DmData> dbDataQueryWrapper = new QueryWrapper<>();
dbDataQueryWrapper.eq("sensorid", deviceid).orderByDesc("time").last("limit 1");
DmData dmData = dmDataMapper.selectOne(dbDataQueryWrapper);
//获取最新时间
Date time = dmData.getTime();
try {
HashMap<String, String> map = DateUtil.getdayDate(time);
String start = map.get("start");
String s = start + ":00:00";
String end = map.get("end");
String s1 = end + ":59:59";
//获取时间范围的实时数据
QueryWrapper<DmData> dbDataQueryWrapper1 = new QueryWrapper<>();
dbDataQueryWrapper1.ge("time", sdf1.parse(s)).le("time", sdf1.parse(s1)).eq("datasource", 1).eq("deviceid", deviceid);
List<DmData> dmData1 = dmDataMapper.selectList(dbDataQueryWrapper1);
//获取时间范围的人工巡检的数据
QueryWrapper<DmData> dbDataQueryWrapper2 = new QueryWrapper<>();
dbDataQueryWrapper2.ge("time", sdf1.parse(s)).le("time", sdf1.parse(s1)).eq("datasource", 0).eq("deviceid", deviceid);
List<DmData> dmData2 = dmDataMapper.selectList(dbDataQueryWrapper1);
List<String> strings = DateUtil.getdayBetweenDates(start, end);
for (String string : strings) {
Result result = new Result();
HashMap<String, Double> hashMap = new HashMap<>();
for (String dmdatum : dmdata) {
hashMap.put(dmdatum, 0.0);
hashMap.put("p_" + dmdatum, 0.0);
}
if (!dmData1.isEmpty()) {
for (DmData data1 : dmData1) {
String format = sdf2.format(data1.getTime());
if (string.equals(format)) {
for (Field field : data1.getClass().getDeclaredFields()) {
for (String dmdatum : dmdata) {
if (dmdatum.equals(field.getName())) {
hashMap.put(dmdatum, Double.parseDouble((String) field.get(data1)));
if (dmData != null) {
//获取最新时间
Date time = dmData.getTime();
try {
HashMap<String, String> map = DateUtil.getdayDate(time);
String start = map.get("start");
String s = start + ":00:00";
String end = map.get("end");
String s1 = end + ":59:59";
//获取时间范围的实时数据
QueryWrapper<DmData> dbDataQueryWrapper1 = new QueryWrapper<>();
dbDataQueryWrapper1.ge("time", sdf1.parse(s)).le("time", sdf1.parse(s1)).eq("datasource", 1).eq("sensorid", deviceid);
List<DmData> dmData1 = dmDataMapper.selectList(dbDataQueryWrapper1);
//获取时间范围的人工巡检的数据
/* QueryWrapper<DmData> dbDataQueryWrapper2 = new QueryWrapper<>();
dbDataQueryWrapper2.ge("time", sdf1.parse(s)).le("time", sdf1.parse(s1)).eq("datasource", 0).eq("sensorid", deviceid);
List<DmData> dmData2 = dmDataMapper.selectList(dbDataQueryWrapper1);*/
List<String> strings = DateUtil.getdayBetweenDates(start, end);
for (String string : strings) {
Result result = new Result();
HashMap<String, Double> hashMap = new HashMap<>();
for (String dmdatum : dmdata) {
hashMap.put(dmdatum, 0.0);
//hashMap.put("p_" + dmdatum, 0.0);
}
if (!dmData1.isEmpty()) {
for (DmData data1 : dmData1) {
String format = sdf2.format(data1.getTime());
if (string.equals(format)) {
for (Field field : data1.getClass().getDeclaredFields()) {
for (String dmdatum : dmdata) {
if (dmdatum.equals(field.getName())) {
hashMap.put(dmdatum, Double.parseDouble((String) field.get(data1)));
}
}
}
break;
}
break;
}
}
}
if (!dmData2.isEmpty()) {
/*if (!dmData2.isEmpty()) {
for (DmData data2 : dmData2) {
String format = sdf2.format(data2.getTime());
if (string.equals(format)) {
......@@ -108,24 +105,23 @@ public class DmDataServiceImpl extends ServiceImpl<DmDataMapper, DmData> impleme
break;
}
}
}*/
Date parse = sdf1.parse(string + ":00:00");
result.setValues(hashMap);
result.setDate(parse);
result.setDateUnit(string);
results.add(result);
}
Date parse = sdf1.parse(string + ":00:00");
result.setValues(hashMap);
result.setDate(parse);
result.setDateUnit(string.substring(string.length() - 2, string.length()) + "时");
results.add(result);
}
Drybeachequipinfor dealalarm = DataUtil.dealalarm(deviceid);
dataVo.setAlarm1(dealalarm.getOnelevelalarm().toString());
dataVo.setAlarm2(dealalarm.getTwolevelalarm().toString());
dataVo.setAlarm3(dealalarm.getThreelevelalarm().toString());
dataVo.setAlarm4(dealalarm.getFourlevelalarm().toString());
dataVo.setLists(results);
dataVo.setDevid(deviceid);
dataVo.setNames(nameVos);
HashMap<String, Object> dealalarm = DataUtil.dealalarm(deviceid);
dataVo.setAlarm(dealalarm);
dataVo.setLists(results);
dataVo.setDevid(deviceid);
dataVo.setNames(nameVos);
} catch (Exception e) {
e.printStackTrace();
} catch (Exception e) {
System.out.println(e);
e.printStackTrace();
}
}
return dataVo;
}
......@@ -145,43 +141,44 @@ public class DmDataServiceImpl extends ServiceImpl<DmDataMapper, DmData> impleme
QueryWrapper<DmData> dbDataQueryWrapper = new QueryWrapper<>();
dbDataQueryWrapper.eq("sensorid", deviceid).orderByDesc("time").last("limit 1");
DmData dmData = dmDataMapper.selectOne(dbDataQueryWrapper);
//获取最新时间
Date time = dmData.getTime();
try {
HashMap<String, String> map = DateUtil.getweekDate(time);
String start = map.get("start");
String s = start + " 00:00:00";
String end = map.get("end");
String s1 = end + " 23:59:59";
//获取时间范围的实时数据
List<DmData> dmData1 = dmDataMapper.dealmonth(deviceid, s, s1, 1);
//获取时间范围的人工巡检的数据
List<DmData> dmData2 = dmDataMapper.dealmonth(deviceid, s, s1, 0);
List<String> strings = DateUtil.getWeekBetweenDates(start, end);
for (String string : strings) {
Result result = new Result();
HashMap<String, Double> hashMap = new HashMap<>();
for (String dmdatum : dmdata) {
hashMap.put(dmdatum, 0.0);
hashMap.put("p_" + dmdatum, 0.0);
}
if (!dmData1.isEmpty()) {
for (DmData data1 : dmData1) {
String format = sdf.format(data1.getTime());
if (string.equals(format)) {
for (Field field : data1.getClass().getDeclaredFields()) {
for (String dmdatum : dmdata) {
String name = field.getName();
if (dmdatum.equals(name)) {
hashMap.put(dmdatum, Double.parseDouble((String) field.get(data1)));
if (dmData != null) {
//获取最新时间
Date time = dmData.getTime();
try {
HashMap<String, String> map = DateUtil.getweekDate(time);
String start = map.get("start");
String s = start + " 00:00:00";
String end = map.get("end");
String s1 = end + " 23:59:59";
//获取时间范围的实时数据
List<DmData> dmData1 = dmDataMapper.dealmonth(deviceid, s, s1, 1);
//获取时间范围的人工巡检的数据
// List<DmData> dmData2 = dmDataMapper.dealmonth(deviceid, s, s1, 0);
List<String> strings = DateUtil.getWeekBetweenDates(start, end);
for (String string : strings) {
Result result = new Result();
HashMap<String, Double> hashMap = new HashMap<>();
for (String dmdatum : dmdata) {
hashMap.put(dmdatum, 0.0);
//hashMap.put("p_" + dmdatum, 0.0);
}
if (!dmData1.isEmpty()) {
for (DmData data1 : dmData1) {
String format = sdf.format(data1.getTime());
if (string.equals(format)) {
for (Field field : data1.getClass().getDeclaredFields()) {
for (String dmdatum : dmdata) {
String name = field.getName();
if (dmdatum.equals(name)) {
hashMap.put(dmdatum, Double.parseDouble((String) field.get(data1)));
}
}
}
break;
}
break;
}
}
}
if (!dmData2.isEmpty()) {
/*if (!dmData2.isEmpty()) {
for (DmData data2 : dmData2) {
String format = sdf.format(data2.getTime());
if (string.equals(format)) {
......@@ -196,24 +193,22 @@ public class DmDataServiceImpl extends ServiceImpl<DmDataMapper, DmData> impleme
break;
}
}
}*/
Date parse = sdf1.parse(string + " 00:00:00");
result.setValues(hashMap);
result.setDate(parse);
String deal = deal(parse);
result.setDateUnit(string.split("-")[1] + "-" + string.split("-")[2]);
results.add(result);
}
Date parse = sdf1.parse(string + " 00:00:00");
result.setValues(hashMap);
result.setDate(parse);
String deal = deal(parse);
result.setDateUnit(deal);
results.add(result);
HashMap<String, Object> dealalarm = DataUtil.dealalarm(deviceid);
dataVo.setAlarm(dealalarm);
dataVo.setLists(results);
dataVo.setDevid(deviceid);
dataVo.setNames(nameVos);
} catch (Exception e) {
e.printStackTrace();
}
Drybeachequipinfor dealalarm = DataUtil.dealalarm(deviceid);
dataVo.setAlarm1(dealalarm.getOnelevelalarm().toString());
dataVo.setAlarm2(dealalarm.getTwolevelalarm().toString());
dataVo.setAlarm3(dealalarm.getThreelevelalarm().toString());
dataVo.setAlarm4(dealalarm.getFourlevelalarm().toString());
dataVo.setLists(results);
dataVo.setDevid(deviceid);
dataVo.setNames(nameVos);
} catch (Exception e) {
e.printStackTrace();
}
return dataVo;
}
......@@ -244,14 +239,14 @@ public class DmDataServiceImpl extends ServiceImpl<DmDataMapper, DmData> impleme
//获取时间范围的实时数据
List<DmData> dmData1 = dmDataMapper.dealmonth(deviceid, s, s1, 1);
//获取时间范围的人工巡检的数据
List<DmData> dmData2 = dmDataMapper.dealmonth(deviceid, s, s1, 0);
// List<DmData> dmData2 = dmDataMapper.dealmonth(deviceid, s, s1, 0);
List<String> strings = DateUtil.getMonthBetweenDates(start, end);
for (String string : strings) {
Result result = new Result();
HashMap<String, Double> hashMap = new HashMap<>();
for (String dmdatum : dmdata) {
hashMap.put(dmdatum, 0.0);
hashMap.put("p_" + dmdatum, 0.0);
//hashMap.put("p_" + dmdatum, 0.0);
}
if (!dmData1.isEmpty()) {
for (DmData data1 : dmData1) {
......@@ -268,7 +263,7 @@ public class DmDataServiceImpl extends ServiceImpl<DmDataMapper, DmData> impleme
}
}
}
if (!dmData2.isEmpty()) {
/* if (!dmData2.isEmpty()) {
for (DmData data2 : dmData2) {
String format = sdf.format(data2.getTime());
if (string.equals(format)) {
......@@ -282,18 +277,15 @@ public class DmDataServiceImpl extends ServiceImpl<DmDataMapper, DmData> impleme
break;
}
}
}
}*/
Date parse = sdf1.parse(string + " 00:00:00");
result.setValues(hashMap);
result.setDate(parse);
result.setDateUnit(string.split("-")[1] + "-" + string.split("-")[2]);
results.add(result);
}
Drybeachequipinfor dealalarm = DataUtil.dealalarm(deviceid);
dataVo.setAlarm1(dealalarm.getOnelevelalarm().toString());
dataVo.setAlarm2(dealalarm.getTwolevelalarm().toString());
dataVo.setAlarm3(dealalarm.getThreelevelalarm().toString());
dataVo.setAlarm4(dealalarm.getFourlevelalarm().toString());
HashMap<String, Object> dealalarm = DataUtil.dealalarm(deviceid);
dataVo.setAlarm(dealalarm);
dataVo.setLists(results);
dataVo.setDevid(deviceid);
dataVo.setNames(nameVos);
......@@ -316,16 +308,33 @@ public class DmDataServiceImpl extends ServiceImpl<DmDataMapper, DmData> impleme
}
@Override
public RealDataVo real(String equipno) {
HashMap<String, Object> real = dmDataMapper.real(equipno);
public List<RealDataVo> real(String equipno1) {
String tailInfoNo = TailNoForInfoUtil.getTailInfoNo();
List<HashMap<String, Object>> reals = dmDataMapper.real(tailInfoNo);
Map dbdata = ReadJsonFileUtil.getMap("realdata");
Object keys1 = dbdata.get("dmdata");
RealDataVo realDataVo = new RealDataVo();
realDataVo.setData(real);
realDataVo.setKeys(keys1);
String getdrytype = drybeachequipinforMapper.getdrytype(equipno);
realDataVo.setType(getdrytype);
return realDataVo;
ArrayList<RealDataVo> realDataVos = new ArrayList<>();
for (int i = 0; i < reals.size(); i++) {
HashMap<String, Object> real = reals.get(i);
String sensorname = (String) real.get("sensorname");
String eqdanwei = (String) real.get("eqdanwei");
String equipno = (String) real.get("equipno");
String time = (String) real.get("time");
real.remove("time");
real.remove("equipno");
real.remove("sensorname");
real.remove("eqdanwei");
RealDataVo realDataVo = new RealDataVo();
realDataVo.setTime(time);
realDataVo.setEquipno(equipno);
realDataVo.setData(real);
realDataVo.setKeys(keys1);
realDataVo.setName(sensorname);
realDataVo.setType(equipno1);
realDataVo.setEqdanwei(eqdanwei);
realDataVos.add(realDataVo);
}
return realDataVos;
}
public String deal(Date date) throws ParseException {
......
......@@ -3,19 +3,15 @@ package me.zhengjie.gemho.service.data.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import me.zhengjie.gemho.datavo.DataVo;
import me.zhengjie.gemho.datavo.NameVo;
import me.zhengjie.gemho.datavo.RealDataVo;
import me.zhengjie.gemho.datavo.Result;
import me.zhengjie.gemho.entity.data.MpData;
import me.zhengjie.gemho.entity.tab.Drybeachequipinfor;
import me.zhengjie.gemho.mapper.data.MpDataMapper;
import me.zhengjie.gemho.mapper.tab.DrybeachequipinforMapper;
import me.zhengjie.gemho.service.data.MpDataService;
import me.zhengjie.gemho.util.DataUtil;
import me.zhengjie.gemho.util.DateUtil;
import me.zhengjie.gemho.util.ReadJsonFileUtil;
import me.zhengjie.gemho.util.ServiceUtil;
import me.zhengjie.gemho.util.*;
import me.zhengjie.gemho.x_datavo.DataVo;
import me.zhengjie.gemho.x_datavo.NameVo;
import me.zhengjie.gemho.x_datavo.RealDataVo;
import me.zhengjie.gemho.x_datavo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -70,15 +66,15 @@ public class MpDataServiceImpl extends ServiceImpl<MpDataMapper, MpData> impleme
mpDataQueryWrapper1.ge("time", sdf1.parse(s)).le("time", sdf1.parse(s1)).eq("datasource", 1).eq("sensorid", deviceid);
List<MpData> mpData1 = mpDataMapper.selectList(mpDataQueryWrapper1);
//获取时间区间的人工巡检数据
QueryWrapper<MpData> mpDataQueryWrapper2 = new QueryWrapper<MpData>();
/* QueryWrapper<MpData> mpDataQueryWrapper2 = new QueryWrapper<MpData>();
mpDataQueryWrapper2.ge("time", sdf1.parse(s)).le("time", sdf1.parse(s1)).eq("datasource", 0).eq("sensorid", deviceid);
List<MpData> mpData2 = mpDataMapper.selectList(mpDataQueryWrapper2);
List<MpData> mpData2 = mpDataMapper.selectList(mpDataQueryWrapper2);*/
for (String string : strings) {
Result result = new Result();
HashMap<String, Double> hashMap = new HashMap<>();
for (String mpdata : mpdatas) {
hashMap.put(mpdata, 0.0);
hashMap.put("p_" + mpdata, 0.0);
//hashMap.put("p_" + mpdata, 0.0);
}
//遍历实时数据
if (!mpData1.isEmpty()) {
......@@ -97,33 +93,31 @@ public class MpDataServiceImpl extends ServiceImpl<MpDataMapper, MpData> impleme
}
}
if (!mpData2.isEmpty()) {
/* if (!mpData2.isEmpty()) {
for (MpData data2 : mpData2) {
String format = sdf2.format(data2.getTime());
if (string.equals(format)) {
for (String mpdata : mpdatas) {
for (Field field : data2.getClass().getDeclaredFields()) {
if (mpdata.equals(field.getName())) {
hashMap.put(mpdata, Double.parseDouble((String) field.get(data2)));
hashMap.put("p_" + mpdata, Double.parseDouble((String) field.get(data2)));
}
}
}
break;
}
}
}
}*/
Date parse = sdf1.parse(string + ":00:00");
result.setDate(parse);
result.setDateUnit(string.substring(string.length() - 2, string.length()) + "时");
//result.setDateUnit(string.substring(string.length() - 2, string.length()) + "时");
result.setDateUnit(string);
result.setValues(hashMap);
results.add(result);
}
Drybeachequipinfor dealalarm = DataUtil.dealalarm(deviceid);
dataVo.setAlarm1(dealalarm.getOnelevelalarm().toString());
dataVo.setAlarm2(dealalarm.getTwolevelalarm().toString());
dataVo.setAlarm3(dealalarm.getThreelevelalarm().toString());
dataVo.setAlarm4(dealalarm.getFourlevelalarm().toString());
HashMap<String, Object> dealalarm = DataUtil.dealalarm(deviceid);
dataVo.setAlarm(dealalarm);
dataVo.setNames(nameVos);
dataVo.setDevid(deviceid);
dataVo.setLists(results);
......@@ -159,18 +153,18 @@ public class MpDataServiceImpl extends ServiceImpl<MpDataMapper, MpData> impleme
String start = map.get("start");
String s = start + " 00:00:00";
String end = map.get("end");
String s1 = end + "23:59:59";
String s1 = end + " 23:59:59";
List<String> weekBetweenDates = DateUtil.getWeekBetweenDates(start, end);
//获取时间区间的实时数据
List<MpData> mpData1 = mpDataMapper.dealmonth(deviceid, s, s1, 1);
//获取时间区间的人工巡检数据
List<MpData> mpData2 = mpDataMapper.dealmonth(deviceid, s, s1, 0);
//List<MpData> mpData2 = mpDataMapper.dealmonth(deviceid, s, s1, 0);
for (String weekBetweenDate : weekBetweenDates) {
Result result = new Result();
HashMap<String, Double> hashMap = new HashMap<>();
for (String mpdata : mpdatas) {
hashMap.put(mpdata, 0.0);
hashMap.put("p_" + mpdata, 0.0);
//hashMap.put("p_" + mpdata, 0.0);
}
//遍历 处理实时数据
if (mpData1.size() > 0) {
......@@ -189,34 +183,31 @@ public class MpDataServiceImpl extends ServiceImpl<MpDataMapper, MpData> impleme
}
}
//遍历处理人工巡检数据
if (mpData2.size() > 0) {
/* if (mpData2.size() > 0) {
for (MpData data2 : mpData2) {
String format = sdf2.format(data2.getTime());
String format = sdf.format(data2.getTime());
if (weekBetweenDate.equals(format)) {
for (String mpdata : mpdatas) {
for (Field field : data2.getClass().getDeclaredFields()) {
if (mpdata.equals(field.getName())) {
hashMap.put(mpdata, Double.parseDouble((String) field.get(data2)));
hashMap.put("p_" + mpdata, Double.parseDouble((String) field.get(data2)));
}
}
}
break;
}
}
}
}*/
Date parse = sdf.parse(weekBetweenDate);
String deal = deal(parse);
result.setDate(parse);
result.setValues(hashMap);
result.setDateUnit(deal);
result.setDateUnit(weekBetweenDate.split("-")[1] + "-" + weekBetweenDate.split("-")[2]);
//result.setDateUnit(weekBetweenDate.split("-")[1] + "-" + weekBetweenDate.split("-")[2] + "日");
results.add(result);
}
Drybeachequipinfor dealalarm = DataUtil.dealalarm(deviceid);
dataVo.setAlarm1(dealalarm.getOnelevelalarm().toString());
dataVo.setAlarm2(dealalarm.getTwolevelalarm().toString());
dataVo.setAlarm3(dealalarm.getThreelevelalarm().toString());
dataVo.setAlarm4(dealalarm.getFourlevelalarm().toString());
HashMap<String, Object> dealalarm = DataUtil.dealalarm(deviceid);
dataVo.setAlarm(dealalarm);
dataVo.setLists(results);
dataVo.setDevid(deviceid);
dataVo.setNames(nameVos);
......@@ -256,13 +247,13 @@ public class MpDataServiceImpl extends ServiceImpl<MpDataMapper, MpData> impleme
//获取时间区间的实时数据
List<MpData> mpData1 = mpDataMapper.dealmonth(deviceid, s, s1, 1);
//获取时间区间的人工巡检数据
List<MpData> mpData2 = mpDataMapper.dealmonth(deviceid, s, s1, 0);
//List<MpData> mpData2 = mpDataMapper.dealmonth(deviceid, s, s1, 0);
for (String weekBetweenDate : weekBetweenDates) {
Result result = new Result();
HashMap<String, Double> hashMap = new HashMap<>();
for (String mpdata : mpdatas) {
hashMap.put(mpdata, 0.0);
hashMap.put("p_" + mpdata, 0.0);
// hashMap.put("p_" + mpdata, 0.0);
}
//遍历 处理实时数据
if (mpData1.size() > 0) {
......@@ -281,32 +272,29 @@ public class MpDataServiceImpl extends ServiceImpl<MpDataMapper, MpData> impleme
}
}
//遍历处理人工巡检数据
if (mpData2.size() > 0) {
/* if (mpData2.size() > 0) {
for (MpData data2 : mpData2) {
String format = sdf2.format(data2.getTime());
String format = sdf.format(data2.getTime());
if (weekBetweenDate.equals(format)) {
for (String mpdata : mpdatas) {
for (Field field : data2.getClass().getDeclaredFields()) {
if (mpdata.equals(field.getName())) {
hashMap.put(mpdata, Double.parseDouble((String) field.get(data2)));
hashMap.put("p_" + mpdata, Double.parseDouble((String) field.get(data2)));
}
}
}
break;
}
}
}
}*/
Date parse = sdf.parse(weekBetweenDate);
result.setDate(parse);
result.setValues(hashMap);
result.setDateUnit(weekBetweenDate.split("-")[1] + "-" + weekBetweenDate.split("-")[2]);
results.add(result);
}
Drybeachequipinfor dealalarm = DataUtil.dealalarm(deviceid);
dataVo.setAlarm1(dealalarm.getOnelevelalarm().toString());
dataVo.setAlarm2(dealalarm.getTwolevelalarm().toString());
dataVo.setAlarm3(dealalarm.getThreelevelalarm().toString());
dataVo.setAlarm4(dealalarm.getFourlevelalarm().toString());
HashMap<String, Object> dealalarm = DataUtil.dealalarm(deviceid);
dataVo.setAlarm(dealalarm);
dataVo.setLists(results);
dataVo.setDevid(deviceid);
dataVo.setNames(nameVos);
......@@ -337,16 +325,33 @@ public class MpDataServiceImpl extends ServiceImpl<MpDataMapper, MpData> impleme
}
@Override
public RealDataVo real(String equipno) {
HashMap<String, Object> real = mpDataMapper.real(equipno);
public List<RealDataVo> real(String equipno1) {
String tailInfoNo = TailNoForInfoUtil.getTailInfoNo();
List<HashMap<String, Object>> reals = mpDataMapper.real(tailInfoNo);
Map dbdata = ReadJsonFileUtil.getMap("realdata");
Object keys1 = dbdata.get("mpdata");
RealDataVo realDataVo = new RealDataVo();
realDataVo.setData(real);
realDataVo.setKeys(keys1);
String getdrytype = drybeachequipinforMapper.getdrytype(equipno);
realDataVo.setType(getdrytype);
return realDataVo;
ArrayList<RealDataVo> realDataVos = new ArrayList<>();
for (int i = 0; i < reals.size(); i++) {
HashMap<String, Object> real = reals.get(i);
String sensorname = (String) real.get("sensorname");
String eqdanwei = (String) real.get("eqdanwei");
String equipno = (String) real.get("equipno");
String time =(String) real.get("time");
real.remove("time");
real.remove("equipno");
real.remove("sensorname");
real.remove("eqdanwei");
RealDataVo realDataVo = new RealDataVo();
realDataVo.setTime(time);
realDataVo.setEquipno(equipno);
realDataVo.setData(real);
realDataVo.setKeys(keys1);
realDataVo.setName(sensorname);
realDataVo.setType(equipno1);
realDataVo.setEqdanwei(eqdanwei);
realDataVos.add(realDataVo);
}
return realDataVos;
}
public String deal(Date date) throws ParseException {
......
package me.zhengjie.gemho.service.tab.impl;
package me.zhengjie.gemho.service.data.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import me.zhengjie.gemho.entity.tab.Monitoring;
import me.zhengjie.gemho.mapper.tab.TbMonitoringMapper;
import me.zhengjie.gemho.service.tab.MonitoringService;
import me.zhengjie.gemho.entity.data.Pdata;
import me.zhengjie.gemho.mapper.data.PdataMapper;
import me.zhengjie.gemho.service.data.PdataService;
import org.springframework.stereotype.Service;
/**
* <p>
* 监测点 服务实现类
* 人工检测数据表 服务实现类
* </p>
*
* @author llj
* @since 2022-02-11
* @since 2022-03-04
*/
@Service
public class TbMonitoringServiceImpl extends ServiceImpl<TbMonitoringMapper, Monitoring> implements MonitoringService {
public class PdataServiceImpl extends ServiceImpl<PdataMapper, Pdata> implements PdataService {
}
......@@ -3,19 +3,15 @@ package me.zhengjie.gemho.service.data.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import me.zhengjie.gemho.datavo.DataVo;
import me.zhengjie.gemho.datavo.NameVo;
import me.zhengjie.gemho.datavo.RealDataVo;
import me.zhengjie.gemho.datavo.Result;
import me.zhengjie.gemho.entity.data.PslData;
import me.zhengjie.gemho.entity.tab.Drybeachequipinfor;
import me.zhengjie.gemho.mapper.data.PslDataMapper;
import me.zhengjie.gemho.mapper.tab.DrybeachequipinforMapper;
import me.zhengjie.gemho.service.data.PslDataService;
import me.zhengjie.gemho.util.DataUtil;
import me.zhengjie.gemho.util.DateUtil;
import me.zhengjie.gemho.util.ReadJsonFileUtil;
import me.zhengjie.gemho.util.ServiceUtil;
import me.zhengjie.gemho.util.*;
import me.zhengjie.gemho.x_datavo.DataVo;
import me.zhengjie.gemho.x_datavo.NameVo;
import me.zhengjie.gemho.x_datavo.RealDataVo;
import me.zhengjie.gemho.x_datavo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -68,16 +64,16 @@ public class PslDataServiceImpl extends ServiceImpl<PslDataMapper, PslData> impl
pslDataQueryWrapper1.ge("time", sdf1.parse(s)).le("time", sdf1.parse(s1)).eq("sensorid", deviceid).eq("datasource", 1);
List<PslData> pslData1 = pslDataMapper.selectList(pslDataQueryWrapper1);
//获取时间区间的人工巡检的数据
QueryWrapper<PslData> pslDataQueryWrapper2 = new QueryWrapper<>();
/*QueryWrapper<PslData> pslDataQueryWrapper2 = new QueryWrapper<>();
pslDataQueryWrapper2.ge("time", sdf1.parse(s)).le("time", sdf1.parse(s1)).eq("sensorid", deviceid).eq("datasource", 0);
List<PslData> pslData2 = pslDataMapper.selectList(pslDataQueryWrapper2);
List<PslData> pslData2 = pslDataMapper.selectList(pslDataQueryWrapper2);*/
//获取时间区间的时间
List<String> strings = DateUtil.getdayBetweenDates(start, end);
for (String string : strings) {
Result result = new Result();
HashMap<String, Double> hashMap = new HashMap<>();
hashMap.put(psldata, 0.0);
hashMap.put("p_" + psldata, 0.0);
//hashMap.put("p_" + psldata, 0.0);
if (!pslData1.isEmpty()) {
for (PslData data1 : pslData1) {
String format = sdf2.format(data1.getTime());
......@@ -91,7 +87,7 @@ public class PslDataServiceImpl extends ServiceImpl<PslDataMapper, PslData> impl
}
}
}
if (!pslData2.isEmpty()) {
/* if (!pslData2.isEmpty()) {
for (PslData data2 : pslData2) {
String format = sdf2.format(data2.getTime());
if (string.equals(format)) {
......@@ -103,19 +99,16 @@ public class PslDataServiceImpl extends ServiceImpl<PslDataMapper, PslData> impl
break;
}
}
}
}*/
Date parse = sdf1.parse(s);
result.setDate(parse);
result.setValues(hashMap);
result.setDateUnit(string.substring(string.length() - 2, string.length()) + "时");
result.setDateUnit(string);
results.add(result);
}
nameVos = DataUtil.psldatanames(nameVos, subitem);
Drybeachequipinfor dealalarm = DataUtil.dealalarm(deviceid);
dataVo.setAlarm1(dealalarm.getOnelevelalarm().toString());
dataVo.setAlarm2(dealalarm.getTwolevelalarm().toString());
dataVo.setAlarm3(dealalarm.getThreelevelalarm().toString());
dataVo.setAlarm4(dealalarm.getFourlevelalarm().toString());
HashMap<String, Object> dealalarm = DataUtil.dealalarm(deviceid);
dataVo.setAlarm(dealalarm);
dataVo.setDevid(deviceid);
dataVo.setNames(nameVos);
dataVo.setDevid(deviceid);
......@@ -152,13 +145,13 @@ public class PslDataServiceImpl extends ServiceImpl<PslDataMapper, PslData> impl
//获取时间区间的实时数据
List<PslData> pslData1 = pslDataMapper.dealmonth(deviceid, s, s1, 1);
//获取时间区间的人工巡检的数据
List<PslData> pslData2 = pslDataMapper.dealmonth(deviceid, s, s1, 0);
//List<PslData> pslData2 = pslDataMapper.dealmonth(deviceid, s, s1, 0);
List<String> strings = DateUtil.getWeekBetweenDates(start, end);
for (String string : strings) {
Result result = new Result();
HashMap<String, Double> hashMap = new HashMap<>();
hashMap.put(psldata, 0.0);
hashMap.put("p_" + psldata, 0.0);
//hashMap.put("p_" + psldata, 0.0);
if (!pslData1.isEmpty()) {
for (PslData data1 : pslData1) {
String format = sdf.format(data1.getTime());
......@@ -172,7 +165,7 @@ public class PslDataServiceImpl extends ServiceImpl<PslDataMapper, PslData> impl
}
}
}
if (!pslData2.isEmpty()) {
/* if (!pslData2.isEmpty()) {
for (PslData data2 : pslData2) {
String format = sdf.format(data2.getTime());
if (string.equals(format)) {
......@@ -184,21 +177,17 @@ public class PslDataServiceImpl extends ServiceImpl<PslDataMapper, PslData> impl
break;
}
}
}
}*/
Date parse = sdf1.parse(string + " 00:00:00");
result.setDate(parse);
result.setValues(hashMap);
String deal = deal(parse);
result.setDateUnit(deal);
result.setDateUnit(string.split("-")[1] + "-" + string.split("-")[2]);
results.add(result);
}
nameVos = DataUtil.psldatanames(nameVos, subitem);
Drybeachequipinfor dealalarm = DataUtil.dealalarm(deviceid);
dataVo.setAlarm1(dealalarm.getOnelevelalarm().toString());
dataVo.setAlarm2(dealalarm.getTwolevelalarm().toString());
dataVo.setAlarm3(dealalarm.getThreelevelalarm().toString());
dataVo.setAlarm4(dealalarm.getFourlevelalarm().toString());
dataVo.setDevid(deviceid);
HashMap<String, Object> dealalarm = DataUtil.dealalarm(deviceid);
dataVo.setAlarm(dealalarm);
dataVo.setNames(nameVos);
dataVo.setDevid(deviceid);
dataVo.setLists(results);
......@@ -274,11 +263,8 @@ public class PslDataServiceImpl extends ServiceImpl<PslDataMapper, PslData> impl
results.add(result);
}
nameVos = DataUtil.psldatanames(nameVos, subitem);
Drybeachequipinfor dealalarm = DataUtil.dealalarm(deviceid);
dataVo.setAlarm1(dealalarm.getOnelevelalarm().toString());
dataVo.setAlarm2(dealalarm.getTwolevelalarm().toString());
dataVo.setAlarm3(dealalarm.getThreelevelalarm().toString());
dataVo.setAlarm4(dealalarm.getFourlevelalarm().toString());
HashMap<String, Object> dealalarm = DataUtil.dealalarm(deviceid);
dataVo.setAlarm(dealalarm);
dataVo.setDevid(deviceid);
dataVo.setNames(nameVos);
dataVo.setDevid(deviceid);
......@@ -302,16 +288,33 @@ public class PslDataServiceImpl extends ServiceImpl<PslDataMapper, PslData> impl
}
@Override
public RealDataVo real(String equipno) {
HashMap<String, Object> real = pslDataMapper.real(equipno);
public List<RealDataVo> real(String equipno1) {
String tailInfoNo = TailNoForInfoUtil.getTailInfoNo();
List<HashMap<String, Object>> reals = pslDataMapper.real(tailInfoNo);
Map dbdata = ReadJsonFileUtil.getMap("realdata");
Object keys1 = dbdata.get("psldata");
RealDataVo realDataVo = new RealDataVo();
realDataVo.setData(real);
realDataVo.setKeys(keys1);
String getdrytype = drybeachequipinforMapper.getdrytype(equipno);
realDataVo.setType(getdrytype);
return realDataVo;
ArrayList<RealDataVo> realDataVos = new ArrayList<>();
for (int i = 0; i < reals.size(); i++) {
HashMap<String, Object> real = reals.get(i);
String sensorname = (String) real.get("sensorname");
String eqdanwei = (String) real.get("eqdanwei");
String equipno = (String) real.get("equipno");
String time =(String) real.get("time");
real.remove("time");
real.remove("equipno");
real.remove("sensorname");
real.remove("eqdanwei");
RealDataVo realDataVo = new RealDataVo();
realDataVo.setTime(time);
realDataVo.setEquipno(equipno);
realDataVo.setData(real);
realDataVo.setKeys(keys1);
realDataVo.setName(sensorname);
realDataVo.setType(equipno1);
realDataVo.setEqdanwei(eqdanwei);
realDataVos.add(realDataVo);
}
return realDataVos;
}
......
......@@ -3,19 +3,15 @@ package me.zhengjie.gemho.service.data.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import me.zhengjie.gemho.datavo.DataVo;
import me.zhengjie.gemho.datavo.NameVo;
import me.zhengjie.gemho.datavo.RealDataVo;
import me.zhengjie.gemho.datavo.Result;
import me.zhengjie.gemho.entity.data.RgData;
import me.zhengjie.gemho.entity.tab.Drybeachequipinfor;
import me.zhengjie.gemho.mapper.data.RgDataMapper;
import me.zhengjie.gemho.mapper.tab.DrybeachequipinforMapper;
import me.zhengjie.gemho.service.data.RgDataService;
import me.zhengjie.gemho.util.DataUtil;
import me.zhengjie.gemho.util.DateUtil;
import me.zhengjie.gemho.util.ReadJsonFileUtil;
import me.zhengjie.gemho.util.ServiceUtil;
import me.zhengjie.gemho.util.*;
import me.zhengjie.gemho.x_datavo.DataVo;
import me.zhengjie.gemho.x_datavo.NameVo;
import me.zhengjie.gemho.x_datavo.RealDataVo;
import me.zhengjie.gemho.x_datavo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -80,15 +76,15 @@ public class RgDataServiceImpl extends ServiceImpl<RgDataMapper, RgData> impleme
rgDataQueryWrapper1.ge("time", starttime).le("time", endtime).eq("datasource", 1).eq("sensorid", deviceid);
List<RgData> rgData1 = rgDataMapper.selectList(rgDataQueryWrapper1);
//获取人工巡检的数据
QueryWrapper<RgData> rgDataQueryWrapper2 = new QueryWrapper<>();
/*QueryWrapper<RgData> rgDataQueryWrapper2 = new QueryWrapper<>();
rgDataQueryWrapper2.ge("time", starttime).le("time", endtime).eq("datasource", 0).eq("sensorid", deviceid);
List<RgData> rgData2 = rgDataMapper.selectList(rgDataQueryWrapper2);
List<RgData> rgData2 = rgDataMapper.selectList(rgDataQueryWrapper2);*/
//获取时间区间内所有的时间
List<String> list = DateUtil.getWeekBetweenDates(map.get("start"), map.get("end"));
for (String s : list) {
Result rg = new Result();
double value1 = 0.0;
double value2 = 0.0;
//double value2 = 0.0;
//循环所有数据 (实时数据)
if (!rgData1.isEmpty()) {
for (RgData data : rgData1) {
......@@ -101,7 +97,7 @@ public class RgDataServiceImpl extends ServiceImpl<RgDataMapper, RgData> impleme
}
}
}
//循环所有数据(人工巡检)
/* //循环所有数据(人工巡检)
if (!rgData2.isEmpty()) {
for (RgData data2 : rgData2) {
String format = sdf.format(data2.getTime());
......@@ -112,26 +108,23 @@ public class RgDataServiceImpl extends ServiceImpl<RgDataMapper, RgData> impleme
break;
}
}
}
}*/
//为返回值赋值
HashMap<String, Double> hashMap = new HashMap<>();
hashMap.put("name1", value1);
hashMap.put("name2", value2);
//hashMap.put("name2", value2);
rg.setValues(hashMap);
Date parse = sdf.parse(s);
rg.setDate(parse);
String deal = deal(parse);
rg.setDateUnit(deal);
rg.setDateUnit(s.split("-")[1] + "-" + s.split("-")[2]);
rgs.add(rg);
}
nameVos.add(new NameVo().setKey("name1").setName("实时数据"));
nameVos.add(new NameVo().setKey("name2").setName("人工巡检数据"));
Drybeachequipinfor dealalarm = DataUtil.dealalarm(deviceid);
dataVo.setAlarm1(dealalarm.getOnelevelalarm().toString());
dataVo.setAlarm2(dealalarm.getTwolevelalarm().toString());
dataVo.setAlarm3(dealalarm.getThreelevelalarm().toString());
dataVo.setAlarm4(dealalarm.getFourlevelalarm().toString());
HashMap<String, Object> dealalarm = DataUtil.dealalarm(deviceid);
dataVo.setAlarm(dealalarm);
dataVo.setNames(nameVos);
dataVo.setRange("week");
dataVo.setLists(rgs);
......@@ -184,15 +177,15 @@ public class RgDataServiceImpl extends ServiceImpl<RgDataMapper, RgData> impleme
rgDataQueryWrapper1.ge("time", starttime).le("time", endtime).eq("datasource", 1).eq("sensorid", deviceid);
List<RgData> rgData1 = rgDataMapper.selectList(rgDataQueryWrapper1);
//获取人工巡检的数据
QueryWrapper<RgData> rgDataQueryWrapper2 = new QueryWrapper<>();
/* QueryWrapper<RgData> rgDataQueryWrapper2 = new QueryWrapper<>();
rgDataQueryWrapper2.ge("time", starttime).le("time", endtime).eq("datasource", 0).eq("sensorid", deviceid);
List<RgData> rgData2 = rgDataMapper.selectList(rgDataQueryWrapper2);
List<RgData> rgData2 = rgDataMapper.selectList(rgDataQueryWrapper2);*/
//获取时间区间内所有的时间
List<String> list = DateUtil.getMonthBetweenDates(map.get("start"), map.get("end"));
for (String s : list) {
Result rg = new Result();
double value1 = 0.0;
double value2 = 0.0;
//double value2 = 0.0;
//循环所有数据 (实时数据)
if (!rgData1.isEmpty()) {
for (RgData data : rgData1) {
......@@ -206,7 +199,7 @@ public class RgDataServiceImpl extends ServiceImpl<RgDataMapper, RgData> impleme
}
}
//循环所有数据(人工巡检)
/* //循环所有数据(人工巡检)
if (!rgData2.isEmpty()) {
for (RgData data2 : rgData2) {
String format = sdf.format(data2.getTime());
......@@ -218,12 +211,12 @@ public class RgDataServiceImpl extends ServiceImpl<RgDataMapper, RgData> impleme
}
}
}
*/
//为返回值赋值
HashMap<String, Double> hashMap = new HashMap<>();
hashMap.put("name1", value1);
hashMap.put("name2", value2);
//hashMap.put("name2", value2);
rg.setValues(hashMap);
rg.setDate(sdf.parse(s));
rg.setDateUnit(s.split("-")[1] + "-" + s.split("-")[2]);
......@@ -231,11 +224,8 @@ public class RgDataServiceImpl extends ServiceImpl<RgDataMapper, RgData> impleme
}
nameVos.add(new NameVo().setKey("name1").setName("实时数据"));
nameVos.add(new NameVo().setKey("name2").setName("人工巡检数据"));
Drybeachequipinfor dealalarm = DataUtil.dealalarm(deviceid);
dataVo.setAlarm1(dealalarm.getOnelevelalarm().toString());
dataVo.setAlarm2(dealalarm.getTwolevelalarm().toString());
dataVo.setAlarm3(dealalarm.getThreelevelalarm().toString());
dataVo.setAlarm4(dealalarm.getFourlevelalarm().toString());
HashMap<String, Object> dealalarm = DataUtil.dealalarm(deviceid);
dataVo.setAlarm(dealalarm);
dataVo.setNames(nameVos);
dataVo.setRange("month");
dataVo.setLists(rgs);
......@@ -260,16 +250,33 @@ public class RgDataServiceImpl extends ServiceImpl<RgDataMapper, RgData> impleme
}
@Override
public RealDataVo real(String equipno) {
HashMap<String, Object> real = rgDataMapper.real(equipno);
public List<RealDataVo> real(String equipno1) {
String tailInfoNo = TailNoForInfoUtil.getTailInfoNo();
List<HashMap<String, Object>> reals = rgDataMapper.real(tailInfoNo);
Map dbdata = ReadJsonFileUtil.getMap("realdata");
Object keys1 = dbdata.get("rgdata");
RealDataVo realDataVo = new RealDataVo();
realDataVo.setData(real);
realDataVo.setKeys(keys1);
String getdrytype = drybeachequipinforMapper.getdrytype(equipno);
realDataVo.setType(getdrytype);
return realDataVo;
ArrayList<RealDataVo> realDataVos = new ArrayList<>();
for (int i = 0; i < reals.size(); i++) {
HashMap<String, Object> real = reals.get(i);
String sensorname = (String) real.get("sensorname");
String eqdanwei = (String) real.get("eqdanwei");
String equipno = (String) real.get("equipno");
String time =(String) real.get("time");
real.remove("time");
real.remove("equipno");
real.remove("sensorname");
real.remove("eqdanwei");
RealDataVo realDataVo = new RealDataVo();
realDataVo.setTime(time);
realDataVo.setEquipno(equipno);
realDataVo.setData(real);
realDataVo.setKeys(keys1);
realDataVo.setName(sensorname);
realDataVo.setType(equipno1);
realDataVo.setEqdanwei(eqdanwei);
realDataVos.add(realDataVo);
}
return realDataVos;
}
/**
......@@ -320,7 +327,7 @@ public class RgDataServiceImpl extends ServiceImpl<RgDataMapper, RgData> impleme
Result rg = new Result();
HashMap<String, Double> hashMap = new HashMap<>();
double value1 = 0.0;
double value2 = 0.0;
//double value2 = 0.0;
//遍历实时数据
if (!rgData1.isEmpty()) {
for (RgData data : rgData1) {
......@@ -332,7 +339,7 @@ public class RgDataServiceImpl extends ServiceImpl<RgDataMapper, RgData> impleme
}
}
}
//遍历人工巡检数据
/* //遍历人工巡检数据
if (!rgData2.isEmpty()) {
for (RgData data2 : rgData2) {
String format1 = sdf2.format(data2.getTime());
......@@ -342,11 +349,11 @@ public class RgDataServiceImpl extends ServiceImpl<RgDataMapper, RgData> impleme
break;
}
}
}
}*/
//
hashMap.put("name1", value1);
hashMap.put("name2", value2);
//hashMap.put("name2", value2);
rg.setValues(hashMap);
rg.setDate(sdf2.parse(string));
rg.setDateUnit(string.substring(string.length() - 2, string.length()) + "时");
......@@ -354,11 +361,8 @@ public class RgDataServiceImpl extends ServiceImpl<RgDataMapper, RgData> impleme
}
nameVos.add(new NameVo().setKey("name1").setName("实时数据"));
nameVos.add(new NameVo().setKey("name2").setName("人工巡检数据"));
Drybeachequipinfor dealalarm = DataUtil.dealalarm(deviceid);
dataVo.setAlarm1(dealalarm.getOnelevelalarm().toString());
dataVo.setAlarm2(dealalarm.getTwolevelalarm().toString());
dataVo.setAlarm3(dealalarm.getThreelevelalarm().toString());
dataVo.setAlarm4(dealalarm.getFourlevelalarm().toString());
HashMap<String, Object> dealalarm = DataUtil.dealalarm(deviceid);
dataVo.setAlarm(dealalarm);
dataVo.setNames(nameVos);
dataVo.setRange("day");
dataVo.setLists(rgs);
......
......@@ -3,19 +3,15 @@ package me.zhengjie.gemho.service.data.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import me.zhengjie.gemho.datavo.DataVo;
import me.zhengjie.gemho.datavo.NameVo;
import me.zhengjie.gemho.datavo.RealDataVo;
import me.zhengjie.gemho.datavo.Result;
import me.zhengjie.gemho.entity.data.SlData;
import me.zhengjie.gemho.entity.tab.Drybeachequipinfor;
import me.zhengjie.gemho.mapper.data.SlDataMapper;
import me.zhengjie.gemho.mapper.tab.DrybeachequipinforMapper;
import me.zhengjie.gemho.service.data.SlDataService;
import me.zhengjie.gemho.util.DataUtil;
import me.zhengjie.gemho.util.DateUtil;
import me.zhengjie.gemho.util.ReadJsonFileUtil;
import me.zhengjie.gemho.util.ServiceUtil;
import me.zhengjie.gemho.util.*;
import me.zhengjie.gemho.x_datavo.DataVo;
import me.zhengjie.gemho.x_datavo.NameVo;
import me.zhengjie.gemho.x_datavo.RealDataVo;
import me.zhengjie.gemho.x_datavo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -76,16 +72,16 @@ public class SlDataServiceImpl extends ServiceImpl<SlDataMapper, SlData> impleme
slDataQueryWrapper1.ge("time", sdf1.parse(s)).le("time", sdf1.parse(s1)).eq("sensorid", deviceid).eq("datasource", 1);
List<SlData> slData1 = slDataMapper.selectList(slDataQueryWrapper1);
//获取时间区间的人工巡检
QueryWrapper<SlData> slDataQueryWrapper2 = new QueryWrapper<>();
/* QueryWrapper<SlData> slDataQueryWrapper2 = new QueryWrapper<>();
slDataQueryWrapper2.ge("time", sdf1.parse(s)).le("time", sdf1.parse(s1)).eq("sensorid", deviceid).eq("datasource", 1);
List<SlData> slData2 = slDataMapper.selectList(slDataQueryWrapper2);
List<SlData> slData2 = slDataMapper.selectList(slDataQueryWrapper2);*/
//获取时间区间的时间
List<String> strings = DateUtil.getdayBetweenDates(start, end);
for (String string : strings) {
Result result = new Result();
HashMap<String, Double> hashMap = new HashMap<>();
hashMap.put(sldata, 0.0);
hashMap.put("p_" + sldata, 0.0);
// hashMap.put("p_" + sldata, 0.0);
if (!slData1.isEmpty()) {
for (SlData data1 : slData1) {
String format = sdf2.format(data1.getTime());
......@@ -99,7 +95,7 @@ public class SlDataServiceImpl extends ServiceImpl<SlDataMapper, SlData> impleme
}
}
}
if (!slData2.isEmpty()) {
/* if (!slData2.isEmpty()) {
for (SlData data2 : slData2) {
String format = sdf2.format(data2.getTime());
if (string.equals(format)) {
......@@ -111,19 +107,16 @@ public class SlDataServiceImpl extends ServiceImpl<SlDataMapper, SlData> impleme
break;
}
}
}
}*/
Date parse = sdf1.parse(string + ":00:00");
result.setDate(parse);
result.setDateUnit(string.substring(string.length() - 2, string.length()) + "时");
result.setDateUnit(string);
result.setValues(hashMap);
results.add(result);
}
nameVos = DataUtil.sldatanames(nameVos, subitem);
Drybeachequipinfor dealalarm = DataUtil.dealalarm(deviceid);
dataVo.setAlarm1(dealalarm.getOnelevelalarm().toString());
dataVo.setAlarm2(dealalarm.getTwolevelalarm().toString());
dataVo.setAlarm3(dealalarm.getThreelevelalarm().toString());
dataVo.setAlarm4(dealalarm.getFourlevelalarm().toString());
HashMap<String, Object> dealalarm = DataUtil.dealalarm(deviceid);
dataVo.setAlarm(dealalarm);
dataVo.setDevid(deviceid);
dataVo.setLists(results);
dataVo.setNames(nameVos);
......@@ -168,14 +161,14 @@ public class SlDataServiceImpl extends ServiceImpl<SlDataMapper, SlData> impleme
//获取时间区间的实时数据
List<SlData> slData1 = slDataMapper.dealmonth(deviceid, s, s1, 1);
//获取时间区间的人工巡检
List<SlData> slData2 = slDataMapper.dealmonth(deviceid, s, s1, 0);
// List<SlData> slData2 = slDataMapper.dealmonth(deviceid, s, s1, 0);
//获取时间区间的时间
List<String> strings = DateUtil.getWeekBetweenDates(start, end);
for (String string : strings) {
Result result = new Result();
HashMap<String, Double> hashMap = new HashMap<>();
hashMap.put(sldata, 0.0);
hashMap.put("p_" + sldata, 0.0);
//hashMap.put("p_" + sldata, 0.0);
if (!slData1.isEmpty()) {
for (SlData data1 : slData1) {
String format = sdf.format(data1.getTime());
......@@ -189,7 +182,7 @@ public class SlDataServiceImpl extends ServiceImpl<SlDataMapper, SlData> impleme
}
}
}
if (!slData2.isEmpty()) {
/* if (!slData2.isEmpty()) {
for (SlData data2 : slData2) {
String format = sdf.format(data2.getTime());
if (string.equals(format)) {
......@@ -201,20 +194,17 @@ public class SlDataServiceImpl extends ServiceImpl<SlDataMapper, SlData> impleme
break;
}
}
}
}*/
Date parse = sdf1.parse(string + " 00:00:00");
result.setDate(parse);
String deal = deal(parse);
result.setDateUnit(deal);
result.setDateUnit(string.split("-")[1] + "-" + string.split("-")[2]);
result.setValues(hashMap);
results.add(result);
}
nameVos = DataUtil.sldatanames(nameVos, subitem);
Drybeachequipinfor dealalarm = DataUtil.dealalarm(deviceid);
dataVo.setAlarm1(dealalarm.getOnelevelalarm().toString());
dataVo.setAlarm2(dealalarm.getTwolevelalarm().toString());
dataVo.setAlarm3(dealalarm.getThreelevelalarm().toString());
dataVo.setAlarm4(dealalarm.getFourlevelalarm().toString());
HashMap<String, Object> dealalarm = DataUtil.dealalarm(deviceid);
dataVo.setAlarm(dealalarm);
dataVo.setDevid(deviceid);
dataVo.setLists(results);
dataVo.setNames(nameVos);
......@@ -259,14 +249,14 @@ public class SlDataServiceImpl extends ServiceImpl<SlDataMapper, SlData> impleme
//获取时间区间的实时数据
List<SlData> slData1 = slDataMapper.dealmonth(deviceid, s, s1, 1);
//获取时间区间的人工巡检
List<SlData> slData2 = slDataMapper.dealmonth(deviceid, s, s1, 0);
//List<SlData> slData2 = slDataMapper.dealmonth(deviceid, s, s1, 0);
//获取时间区间的时间
List<String> strings = DateUtil.getMonthBetweenDates(start, end);
for (String string : strings) {
Result result = new Result();
HashMap<String, Double> hashMap = new HashMap<>();
hashMap.put(sldata, 0.0);
hashMap.put("p_" + sldata, 0.0);
//hashMap.put("p_" + sldata, 0.0);
if (!slData1.isEmpty()) {
for (SlData data1 : slData1) {
String format = sdf.format(data1.getTime());
......@@ -280,7 +270,7 @@ public class SlDataServiceImpl extends ServiceImpl<SlDataMapper, SlData> impleme
}
}
}
if (!slData2.isEmpty()) {
/* if (!slData2.isEmpty()) {
for (SlData data2 : slData2) {
String format = sdf.format(data2.getTime());
if (string.equals(format)) {
......@@ -292,7 +282,7 @@ public class SlDataServiceImpl extends ServiceImpl<SlDataMapper, SlData> impleme
break;
}
}
}
}*/
Date parse = sdf1.parse(string + " 00:00:00");
result.setDate(parse);
result.setDateUnit(string.split("-")[1] + "-" + string.split("-")[2]);
......@@ -300,11 +290,8 @@ public class SlDataServiceImpl extends ServiceImpl<SlDataMapper, SlData> impleme
results.add(result);
}
nameVos = DataUtil.sldatanames(nameVos, subitem);
Drybeachequipinfor dealalarm = DataUtil.dealalarm(deviceid);
dataVo.setAlarm1(dealalarm.getOnelevelalarm().toString());
dataVo.setAlarm2(dealalarm.getTwolevelalarm().toString());
dataVo.setAlarm3(dealalarm.getThreelevelalarm().toString());
dataVo.setAlarm4(dealalarm.getFourlevelalarm().toString());
HashMap<String, Object> dealalarm = DataUtil.dealalarm(deviceid);
dataVo.setAlarm(dealalarm);
dataVo.setDevid(deviceid);
dataVo.setLists(results);
dataVo.setNames(nameVos);
......@@ -327,16 +314,33 @@ public class SlDataServiceImpl extends ServiceImpl<SlDataMapper, SlData> impleme
}
@Override
public RealDataVo real(String equipno) {
HashMap<String, Object> real = slDataMapper.real(equipno);
public List<RealDataVo> real(String equipno1) {
String tailInfoNo = TailNoForInfoUtil.getTailInfoNo();
List<RealDataVo> realDataVos = new ArrayList<>();
List<HashMap<String, Object>> reals = slDataMapper.real(tailInfoNo);
Map dbdata = ReadJsonFileUtil.getMap("realdata");
Object keys1 = dbdata.get("sldata");
RealDataVo realDataVo = new RealDataVo();
realDataVo.setData(real);
realDataVo.setKeys(keys1);
String getdrytype = drybeachequipinforMapper.getdrytype(equipno);
realDataVo.setType(getdrytype);
return realDataVo;
for (int i = 0; i < reals.size(); i++) {
HashMap<String, Object> real = reals.get(i);
String sensorname = (String) real.get("sensorname");
String eqdanwei = (String) real.get("eqdanwei");
String equipno = (String) real.get("equipno");
String time =(String) real.get("time");
real.remove("time");
real.remove("equipno");
real.remove("sensorname");
real.remove("eqdanwei");
RealDataVo realDataVo = new RealDataVo();
realDataVo.setTime(time);
realDataVo.setEquipno(equipno);
realDataVo.setData(real);
realDataVo.setKeys(keys1);
realDataVo.setName(sensorname);
realDataVo.setType(equipno1);
realDataVo.setEqdanwei(eqdanwei);
realDataVos.add(realDataVo);
}
return realDataVos;
}
public String deal(Date date) throws ParseException {
......
......@@ -3,19 +3,15 @@ package me.zhengjie.gemho.service.data.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import me.zhengjie.gemho.datavo.DataVo;
import me.zhengjie.gemho.datavo.NameVo;
import me.zhengjie.gemho.datavo.RealDataVo;
import me.zhengjie.gemho.datavo.Result;
import me.zhengjie.gemho.entity.data.StData;
import me.zhengjie.gemho.entity.tab.Drybeachequipinfor;
import me.zhengjie.gemho.mapper.data.StDataMapper;
import me.zhengjie.gemho.mapper.tab.DrybeachequipinforMapper;
import me.zhengjie.gemho.service.data.StDataService;
import me.zhengjie.gemho.util.DataUtil;
import me.zhengjie.gemho.util.DateUtil;
import me.zhengjie.gemho.util.ReadJsonFileUtil;
import me.zhengjie.gemho.util.ServiceUtil;
import me.zhengjie.gemho.util.*;
import me.zhengjie.gemho.x_datavo.DataVo;
import me.zhengjie.gemho.x_datavo.NameVo;
import me.zhengjie.gemho.x_datavo.RealDataVo;
import me.zhengjie.gemho.x_datavo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -66,16 +62,16 @@ public class StDataServiceImpl extends ServiceImpl<StDataMapper, StData> impleme
stDataQueryWrapper1.ge("time", sdf1.parse(s)).le("time", sdf1.parse(s1)).eq("sensorid", deviceid).eq("datasource", 1);
List<StData> stData1 = stDataMapper.selectList(stDataQueryWrapper1);
//获取时间区间的人工巡检数据
QueryWrapper<StData> stDataQueryWrapper2 = new QueryWrapper<>();
/* QueryWrapper<StData> stDataQueryWrapper2 = new QueryWrapper<>();
stDataQueryWrapper2.ge("time", sdf1.parse(s)).le("time", sdf1.parse(s1)).eq("sensorid", deviceid).eq("datasource", 0);
List<StData> stData2 = stDataMapper.selectList(stDataQueryWrapper2);
List<StData> stData2 = stDataMapper.selectList(stDataQueryWrapper2);*/
//获取时间区间的时间
List<String> strings = DateUtil.getdayBetweenDates(start, end);
for (String string : strings) {
Result result = new Result();
HashMap<String, Double> hashMap = new HashMap<>();
hashMap.put(stdata, 0.0);
hashMap.put("p_" + stdata, 0.0);
// hashMap.put("p_" + stdata, 0.0);
if (!stData1.isEmpty()) {
for (StData data1 : stData1) {
String format = sdf2.format(data1.getTime());
......@@ -89,7 +85,7 @@ public class StDataServiceImpl extends ServiceImpl<StDataMapper, StData> impleme
}
}
}
if (!stData2.isEmpty()) {
/* if (!stData2.isEmpty()) {
for (StData data2 : stData2) {
String format = sdf2.format(data2.getTime());
if (string.equals(format)) {
......@@ -101,19 +97,16 @@ public class StDataServiceImpl extends ServiceImpl<StDataMapper, StData> impleme
break;
}
}
}
}*/
Date parse = sdf1.parse(string + ":00:00");
result.setValues(hashMap);
result.setDate(parse);
result.setDateUnit(string.substring(string.length() - 2, string.length()) + "时");
result.setDateUnit(string);
results.add(result);
}
nameVos = DataUtil.stdatanames(nameVos, subitem);
Drybeachequipinfor dealalarm = DataUtil.dealalarm(deviceid);
dataVo.setAlarm1(dealalarm.getOnelevelalarm().toString());
dataVo.setAlarm2(dealalarm.getTwolevelalarm().toString());
dataVo.setAlarm3(dealalarm.getThreelevelalarm().toString());
dataVo.setAlarm4(dealalarm.getFourlevelalarm().toString());
HashMap<String, Object> dealalarm = DataUtil.dealalarm(deviceid);
dataVo.setAlarm(dealalarm);
dataVo.setNames(nameVos);
dataVo.setDevid(deviceid);
dataVo.setLists(results);
......@@ -148,14 +141,14 @@ public class StDataServiceImpl extends ServiceImpl<StDataMapper, StData> impleme
//获取时间区间的实时数据
List<StData> stData1 = stDataMapper.dealmonth(deviceid, s, s1, 1);
//获取时间区间的人工巡检数据
List<StData> stData2 = stDataMapper.dealmonth(deviceid, s, s1, 0);
//List<StData> stData2 = stDataMapper.dealmonth(deviceid, s, s1, 0);
//获取时间区间的时间
List<String> strings = DateUtil.getWeekBetweenDates(start, end);
for (String string : strings) {
Result result = new Result();
HashMap<String, Double> hashMap = new HashMap<>();
hashMap.put(stdata, 0.0);
hashMap.put("p_" + stdata, 0.0);
//hashMap.put("p_" + stdata, 0.0);
if (!stData1.isEmpty()) {
for (StData data1 : stData1) {
String format = sdf.format(data1.getTime());
......@@ -169,7 +162,7 @@ public class StDataServiceImpl extends ServiceImpl<StDataMapper, StData> impleme
}
}
}
if (!stData2.isEmpty()) {
/*if (!stData2.isEmpty()) {
for (StData data2 : stData2) {
String format = sdf.format(data2.getTime());
if (string.equals(format)) {
......@@ -181,20 +174,17 @@ public class StDataServiceImpl extends ServiceImpl<StDataMapper, StData> impleme
break;
}
}
}
}*/
Date parse = sdf1.parse(string + " 00:00:00");
result.setValues(hashMap);
result.setDate(parse);
String deal = deal(parse);
result.setDateUnit(deal);
//String deal = deal(parse);
result.setDateUnit(string.split("-")[1] + "-" + string.split("-")[2]);
results.add(result);
}
nameVos = DataUtil.stdatanames(nameVos, subitem);
Drybeachequipinfor dealalarm = DataUtil.dealalarm(deviceid);
dataVo.setAlarm1(dealalarm.getOnelevelalarm().toString());
dataVo.setAlarm2(dealalarm.getTwolevelalarm().toString());
dataVo.setAlarm3(dealalarm.getThreelevelalarm().toString());
dataVo.setAlarm4(dealalarm.getFourlevelalarm().toString());
HashMap<String, Object> dealalarm = DataUtil.dealalarm(deviceid);
dataVo.setAlarm(dealalarm);
dataVo.setNames(nameVos);
dataVo.setDevid(deviceid);
dataVo.setLists(results);
......@@ -229,14 +219,14 @@ public class StDataServiceImpl extends ServiceImpl<StDataMapper, StData> impleme
//获取时间区间的实时数据
List<StData> stData1 = stDataMapper.dealmonth(deviceid, s, s1, 1);
//获取时间区间的人工巡检数据
List<StData> stData2 = stDataMapper.dealmonth(deviceid, s, s1, 0);
//List<StData> stData2 = stDataMapper.dealmonth(deviceid, s, s1, 0);
//获取时间区间的时间
List<String> strings = DateUtil.getMonthBetweenDates(start, end);
for (String string : strings) {
Result result = new Result();
HashMap<String, Double> hashMap = new HashMap<>();
hashMap.put(stdata, 0.0);
hashMap.put("p_" + stdata, 0.0);
// hashMap.put("p_" + stdata, 0.0);
if (!stData1.isEmpty()) {
for (StData data1 : stData1) {
String format = sdf.format(data1.getTime());
......@@ -250,7 +240,7 @@ public class StDataServiceImpl extends ServiceImpl<StDataMapper, StData> impleme
}
}
}
if (!stData2.isEmpty()) {
/*if (!stData2.isEmpty()) {
for (StData data2 : stData2) {
String format = sdf.format(data2.getTime());
if (string.equals(format)) {
......@@ -262,7 +252,7 @@ public class StDataServiceImpl extends ServiceImpl<StDataMapper, StData> impleme
break;
}
}
}
}*/
Date parse = sdf1.parse(string + " 00:00:00");
result.setValues(hashMap);
result.setDate(parse);
......@@ -270,11 +260,8 @@ public class StDataServiceImpl extends ServiceImpl<StDataMapper, StData> impleme
results.add(result);
}
nameVos = DataUtil.stdatanames(nameVos, subitem);
Drybeachequipinfor dealalarm = DataUtil.dealalarm(deviceid);
dataVo.setAlarm1(dealalarm.getOnelevelalarm().toString());
dataVo.setAlarm2(dealalarm.getTwolevelalarm().toString());
dataVo.setAlarm3(dealalarm.getThreelevelalarm().toString());
dataVo.setAlarm4(dealalarm.getFourlevelalarm().toString());
HashMap<String, Object> dealalarm = DataUtil.dealalarm(deviceid);
dataVo.setAlarm(dealalarm);
dataVo.setNames(nameVos);
dataVo.setDevid(deviceid);
dataVo.setLists(results);
......@@ -297,16 +284,33 @@ public class StDataServiceImpl extends ServiceImpl<StDataMapper, StData> impleme
}
@Override
public RealDataVo real(String equipno) {
HashMap<String, Object> real = stDataMapper.real(equipno);
public List<RealDataVo> real(String equipno1) {
String tailInfoNo = TailNoForInfoUtil.getTailInfoNo();
List<HashMap<String, Object>> reals = stDataMapper.real(tailInfoNo);
Map dbdata = ReadJsonFileUtil.getMap("realdata");
Object keys1 = dbdata.get("stdata");
RealDataVo realDataVo = new RealDataVo();
realDataVo.setData(real);
realDataVo.setKeys(keys1);
String getdrytype = drybeachequipinforMapper.getdrytype(equipno);
realDataVo.setType(getdrytype);
return realDataVo;
ArrayList<RealDataVo> realDataVos = new ArrayList<>();
for (int i = 0; i < reals.size(); i++) {
HashMap<String, Object> real = reals.get(i);
String sensorname = (String) real.get("sensorname");
String eqdanwei = (String) real.get("eqdanwei");
String equipno = (String) real.get("equipno");
String time =(String) real.get("time");
real.remove("time");
real.remove("equipno");
real.remove("sensorname");
real.remove("eqdanwei");
RealDataVo realDataVo = new RealDataVo();
realDataVo.setTime(time);
realDataVo.setEquipno(equipno);
realDataVo.setData(real);
realDataVo.setKeys(keys1);
realDataVo.setName(sensorname);
realDataVo.setType(equipno1);
realDataVo.setEqdanwei(eqdanwei);
realDataVos.add(realDataVo);
}
return realDataVos;
}
public String deal(Date date) throws ParseException {
......
......@@ -3,14 +3,15 @@ package me.zhengjie.gemho.service.data.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import me.zhengjie.gemho.datavo.DataVo;
import me.zhengjie.gemho.datavo.NameVo;
import me.zhengjie.gemho.datavo.Result;
import me.zhengjie.gemho.entity.data.SzData;
import me.zhengjie.gemho.mapper.data.SzDataMapper;
import me.zhengjie.gemho.mapper.tab.DrybeachequipinforMapper;
import me.zhengjie.gemho.service.data.SzDataService;
import me.zhengjie.gemho.util.ServiceUtil;
import me.zhengjie.gemho.util.TailNoForInfoUtil;
import me.zhengjie.gemho.x_datavo.DataVo;
import me.zhengjie.gemho.x_datavo.NameVo;
import me.zhengjie.gemho.x_datavo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -59,7 +60,8 @@ public class SzDataServiceImpl extends ServiceImpl<SzDataMapper, SzData> impleme
@Override
public ArrayList<HashMap<String, Object>> real(String deviceid) {
ArrayList<HashMap<String, Object>> real = szDataMapper.real();
String tailInfoNo = TailNoForInfoUtil.getTailInfoNo();
ArrayList<HashMap<String, Object>> real = szDataMapper.real(tailInfoNo);
/* //获取最新数据
DataVo dataVo = new DataVo();
ArrayList<Result> results = new ArrayList<>();
......@@ -87,10 +89,10 @@ public class SzDataServiceImpl extends ServiceImpl<SzDataMapper, SzData> impleme
nameVos.add(new NameVo().setKey("value").setName("实时数据"));
nameVos.add(new NameVo().setKey("p_value").setName("人工巡检实时数据"));
Drybeachequipinfor dealalarm = DataUtil.dealalarm(deviceid);
dataVo.setAlarm1(dealalarm.getOnelevelalarm().toString());
dataVo.setAlarm2(dealalarm.getTwolevelalarm().toString());
dataVo.setAlarm3(dealalarm.getThreelevelalarm().toString());
dataVo.setAlarm4(dealalarm.getFourlevelalarm().toString());
dataVo.setAlarm1(dealalarm.getOnelevelalarm());
dataVo.setAlarm2(dealalarm.getTwolevelalarm());
dataVo.setAlarm3(dealalarm.getThreelevelalarm());
dataVo.setAlarm4(dealalarm.getFourlevelalarm());
dataVo.setLists(results);
dataVo.setDevid(deviceid);
dataVo.setNames(nameVos);
......
......@@ -3,19 +3,15 @@ package me.zhengjie.gemho.service.data.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import me.zhengjie.gemho.datavo.DataVo;
import me.zhengjie.gemho.datavo.NameVo;
import me.zhengjie.gemho.datavo.RealDataVo;
import me.zhengjie.gemho.datavo.Result;
import me.zhengjie.gemho.entity.data.WtData;
import me.zhengjie.gemho.entity.tab.Drybeachequipinfor;
import me.zhengjie.gemho.mapper.data.WtDataMapper;
import me.zhengjie.gemho.mapper.tab.DrybeachequipinforMapper;
import me.zhengjie.gemho.service.data.WtDataService;
import me.zhengjie.gemho.util.DataUtil;
import me.zhengjie.gemho.util.DateUtil;
import me.zhengjie.gemho.util.ReadJsonFileUtil;
import me.zhengjie.gemho.util.ServiceUtil;
import me.zhengjie.gemho.util.*;
import me.zhengjie.gemho.x_datavo.DataVo;
import me.zhengjie.gemho.x_datavo.NameVo;
import me.zhengjie.gemho.x_datavo.RealDataVo;
import me.zhengjie.gemho.x_datavo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -67,16 +63,16 @@ public class WtDataServiceImpl extends ServiceImpl<WtDataMapper, WtData> impleme
wtDataQueryWrapper1.ge("time", sdf1.parse(s)).le("time", sdf1.parse(s1)).eq("sensorid", deviceid).eq("datasource", 1);
List<WtData> wtData1 = wtDataMapper.selectList(wtDataQueryWrapper1);
//获取时间区间的人工巡检数据
QueryWrapper<WtData> wtDataQueryWrapper2 = new QueryWrapper<>();
/* QueryWrapper<WtData> wtDataQueryWrapper2 = new QueryWrapper<>();
wtDataQueryWrapper2.ge("time", sdf1.parse(s)).le("time", sdf1.parse(s1)).eq("sensorid", deviceid).eq("datasource", 0);
List<WtData> wtData2 = wtDataMapper.selectList(wtDataQueryWrapper2);
List<WtData> wtData2 = wtDataMapper.selectList(wtDataQueryWrapper2);*/
//获取时间区间
List<String> strings = DateUtil.getdayBetweenDates(start, end);
for (String string : strings) {
Result result = new Result();
HashMap<String, Double> hashMap = new HashMap<>();
hashMap.put(wtdata, 0.0);
hashMap.put("p_" + wtdata, 0.0);
//hashMap.put("p_" + wtdata, 0.0);
if (!wtData1.isEmpty()) {
for (WtData data1 : wtData1) {
String format = sdf2.format(data1.getTime());
......@@ -90,7 +86,7 @@ public class WtDataServiceImpl extends ServiceImpl<WtDataMapper, WtData> impleme
}
}
if (!wtData2.isEmpty()) {
/* if (!wtData2.isEmpty()) {
for (WtData data2 : wtData2) {
String format = sdf2.format(data2.getTime());
if (string.equals(format)) {
......@@ -101,19 +97,16 @@ public class WtDataServiceImpl extends ServiceImpl<WtDataMapper, WtData> impleme
}
}
}
}
}*/
Date parse = sdf1.parse(string + ":00:00");
result.setDate(parse);
result.setValues(hashMap);
result.setDateUnit(string.substring(string.length() - 2, string.length()) + "时");
result.setDateUnit(string);
results.add(result);
}
nameVos = DataUtil.wtdatanames(nameVos, subitem);
Drybeachequipinfor dealalarm = DataUtil.dealalarm(deviceid);
dataVo.setAlarm1(dealalarm.getOnelevelalarm().toString());
dataVo.setAlarm2(dealalarm.getTwolevelalarm().toString());
dataVo.setAlarm3(dealalarm.getThreelevelalarm().toString());
dataVo.setAlarm4(dealalarm.getFourlevelalarm().toString());
HashMap<String, Object> dealalarm = DataUtil.dealalarm(deviceid);
dataVo.setAlarm(dealalarm);
dataVo.setNames(nameVos);
dataVo.setLists(results);
dataVo.setDevid(deviceid);
......@@ -149,14 +142,14 @@ public class WtDataServiceImpl extends ServiceImpl<WtDataMapper, WtData> impleme
//获取时间区间的实时数据
List<WtData> wtData1 = wtDataMapper.dealmonth(deviceid, s, s1, 1);
//获取时间区间的人工巡检数据
List<WtData> wtData2 = wtDataMapper.dealmonth(deviceid, s, s1, 0);
//List<WtData> wtData2 = wtDataMapper.dealmonth(deviceid, s, s1, 0);
//获取时间区间
List<String> strings = DateUtil.getWeekBetweenDates(start, end);
for (String string : strings) {
Result result = new Result();
HashMap<String, Double> hashMap = new HashMap<>();
hashMap.put(wtdata, 0.0);
hashMap.put("p_" + wtdata, 0.0);
//hashMap.put(wtdata, 0.0);
//hashMap.put("p_" + wtdata, 0.0);
if (!wtData1.isEmpty()) {
for (WtData data1 : wtData1) {
String format = sdf.format(data1.getTime());
......@@ -170,7 +163,7 @@ public class WtDataServiceImpl extends ServiceImpl<WtDataMapper, WtData> impleme
}
}
if (!wtData2.isEmpty()) {
/* if (!wtData2.isEmpty()) {
for (WtData data2 : wtData2) {
String format = sdf.format(data2.getTime());
if (string.equals(format)) {
......@@ -181,20 +174,17 @@ public class WtDataServiceImpl extends ServiceImpl<WtDataMapper, WtData> impleme
}
}
}
}
}*/
Date parse = sdf1.parse(string + " 00:00:00");
result.setDate(parse);
result.setValues(hashMap);
String deal = deal(parse);
result.setDateUnit(deal);
result.setDateUnit(string.split("-")[1] + "-" + string.split("-")[2]);
results.add(result);
}
nameVos = DataUtil.wtdatanames(nameVos, subitem);
Drybeachequipinfor dealalarm = DataUtil.dealalarm(deviceid);
dataVo.setAlarm1(dealalarm.getOnelevelalarm().toString());
dataVo.setAlarm2(dealalarm.getTwolevelalarm().toString());
dataVo.setAlarm3(dealalarm.getThreelevelalarm().toString());
dataVo.setAlarm4(dealalarm.getFourlevelalarm().toString());
HashMap<String, Object> dealalarm = DataUtil.dealalarm(deviceid);
dataVo.setAlarm(dealalarm);
dataVo.setNames(nameVos);
dataVo.setLists(results);
dataVo.setDevid(deviceid);
......@@ -230,14 +220,14 @@ public class WtDataServiceImpl extends ServiceImpl<WtDataMapper, WtData> impleme
//获取时间区间的实时数据
List<WtData> wtData1 = wtDataMapper.dealmonth(deviceid, s, s1, 1);
//获取时间区间的人工巡检数据
List<WtData> wtData2 = wtDataMapper.dealmonth(deviceid, s, s1, 0);
//List<WtData> wtData2 = wtDataMapper.dealmonth(deviceid, s, s1, 0);
//获取时间区间
List<String> strings = DateUtil.getMonthBetweenDates(start, end);
for (String string : strings) {
Result result = new Result();
HashMap<String, Double> hashMap = new HashMap<>();
hashMap.put(wtdata, 0.0);
hashMap.put("p_" + wtdata, 0.0);
//hashMap.put("p_" + wtdata, 0.0);
String value = null;
String p_value = null;
if (!wtData1.isEmpty()) {
......@@ -253,7 +243,7 @@ public class WtDataServiceImpl extends ServiceImpl<WtDataMapper, WtData> impleme
}
}
}
if (!wtData2.isEmpty()) {
/*if (!wtData2.isEmpty()) {
for (WtData data2 : wtData2) {
String format = sdf.format(data2.getTime());
if (string.equals(format)) {
......@@ -265,7 +255,7 @@ public class WtDataServiceImpl extends ServiceImpl<WtDataMapper, WtData> impleme
break;
}
}
}
}*/
Date parse = sdf1.parse(string + " 00:00:00");
result.setDate(parse);
result.setValues(hashMap);
......@@ -273,11 +263,8 @@ public class WtDataServiceImpl extends ServiceImpl<WtDataMapper, WtData> impleme
results.add(result);
}
nameVos = DataUtil.wtdatanames(nameVos, subitem);
Drybeachequipinfor dealalarm = DataUtil.dealalarm(deviceid);
dataVo.setAlarm1(dealalarm.getOnelevelalarm().toString());
dataVo.setAlarm2(dealalarm.getTwolevelalarm().toString());
dataVo.setAlarm3(dealalarm.getThreelevelalarm().toString());
dataVo.setAlarm4(dealalarm.getFourlevelalarm().toString());
HashMap<String, Object> dealalarm = DataUtil.dealalarm(deviceid);
dataVo.setAlarm(dealalarm);
dataVo.setNames(nameVos);
dataVo.setLists(results);
dataVo.setDevid(deviceid);
......@@ -300,16 +287,33 @@ public class WtDataServiceImpl extends ServiceImpl<WtDataMapper, WtData> impleme
}
@Override
public RealDataVo real(String equipno) {
HashMap<String, Object> real = wtDataMapper.real(equipno);
public List<RealDataVo> real(String equipno1) {
String tailInfoNo = TailNoForInfoUtil.getTailInfoNo();
List<HashMap<String, Object>> reals = wtDataMapper.real(tailInfoNo);
Map dbdata = ReadJsonFileUtil.getMap("realdata");
Object keys1 = dbdata.get("wtdata");
RealDataVo realDataVo = new RealDataVo();
realDataVo.setData(real);
realDataVo.setKeys(keys1);
String getdrytype = drybeachequipinforMapper.getdrytype(equipno);
realDataVo.setType(getdrytype);
return realDataVo;
ArrayList<RealDataVo> realDataVos = new ArrayList<>();
for (int i = 0; i < reals.size(); i++) {
HashMap<String, Object> real = reals.get(i);
String sensorname = (String) real.get("sensorname");
String eqdanwei = (String) real.get("eqdanwei");
String equipno = (String) real.get("equipno");
String time = (String) real.get("time");
real.remove("time");
real.remove("equipno");
real.remove("sensorname");
real.remove("eqdanwei");
RealDataVo realDataVo = new RealDataVo();
realDataVo.setTime(time);
realDataVo.setEquipno(equipno);
realDataVo.setData(real);
realDataVo.setKeys(keys1);
realDataVo.setName(sensorname);
realDataVo.setType(equipno1);
realDataVo.setEqdanwei(eqdanwei);
realDataVos.add(realDataVo);
}
return realDataVos;
}
public String deal(Date date) throws ParseException {
......
package me.zhengjie.gemho.service.demo;
import com.baomidou.mybatisplus.extension.service.IService;
import me.zhengjie.gemho.entity.demo.MonitorChart;
import java.util.HashMap;
/**
* <p>
* 服务类
* </p>
*
* @author llj
* @since 2022-04-02
*/
public interface MonitorChartService extends IService<MonitorChart> {
/**
* 分页列表
* @param searchName
* @param searchValue
* @param limit
* @param timeSpace
* @param sort
* @param page
* @param size
* @return
*/
HashMap<String, Object> list(String searchName, String searchValue, String limit, String timeSpace, String sort,String page,String size);
/**
* 新增
* @param param 根据需要进行传值
* @return
*/
boolean add(MonitorChart param);
/**
* 修改
* @param param 根据需要进行传值
* @return
*/
boolean modify(MonitorChart param);
}
package me.zhengjie.gemho.service.demo;
import com.baomidou.mybatisplus.extension.service.IService;
import me.zhengjie.gemho.entity.demo.MonitorPoints;
import java.util.HashMap;
/**
* <p>
* 服务类
* </p>
*
* @author llj
* @since 2022-04-02
*/
public interface MonitorPointsService extends IService<MonitorPoints> {
/**
* 分页列表
* @param searchName
* @param searchValue
* @param limit
* @param timeSpace
* @param sort
* @param page
* @param size
* @return
*/
HashMap<String, Object> list(String searchName, String searchValue, String limit, String timeSpace, String sort,String page,String size);
/**
* 新增
* @param param 根据需要进行传值
* @return
*/
boolean add(MonitorPoints param);
/**
* 修改
* @param param 根据需要进行传值
* @return
*/
boolean modify(MonitorPoints param);
}
package me.zhengjie.gemho.service.demo.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import me.zhengjie.gemho.entity.demo.MonitorChart;
import me.zhengjie.gemho.mapper.demo.MonitorChartMapper;
import me.zhengjie.gemho.service.demo.MonitorChartService;
import me.zhengjie.gemho.util.ServiceUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.List;
/**
* <p>
* 服务实现类
* </p>
*
* @author llj
* @since 2022-04-02
*/
@Service
public class MonitorChartServiceImpl extends ServiceImpl<MonitorChartMapper, MonitorChart> implements MonitorChartService {
@Autowired
private MonitorChartMapper monitorChartMapper;
/**
* 分页列表
*
* @param searchName
* @param searchValue
* @param limit
* @param timeSpace
* @param sort
* @param page
* @param size
* @return
*/
@Override
public HashMap<String, Object> list(String searchName, String searchValue, String limit, String timeSpace, String sort, String page, String size) {
long l1 = Long.parseLong(page) + 1;
long l2 = Long.parseLong(size);
Page<MonitorChart> MonitorChartPage = new Page<>(l1, l2);
QueryWrapper<MonitorChart> queryWrapper = new QueryWrapper<>();
ServiceUtil.query(queryWrapper, searchName, searchValue, limit, timeSpace, sort);
MonitorChartPage = monitorChartMapper.selectPage(MonitorChartPage, queryWrapper);
List<MonitorChart> records = MonitorChartPage.getRecords();
long total = MonitorChartPage.getTotal();
HashMap<String, Object> map = new HashMap<>();
map.put("list", records);
map.put("total", total);
return map;
}
/**
* 新增
*
* @param param 根据需要进行传值
* @return
*/
@Override
public boolean add(MonitorChart param) {
int result = monitorChartMapper.insert(param);
if (result > 0) {
return true;
}
return false;
}
/**
* 修改
*
* @param param 根据需要进行传值
* @return
*/
@Override
public boolean modify(MonitorChart param) {
QueryWrapper<MonitorChart> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("id", param.getId());
int result = monitorChartMapper.update(param, queryWrapper);
if (result > 0) {
return true;
}
return false;
}
}
package me.zhengjie.gemho.service.demo.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import me.zhengjie.gemho.entity.demo.MonitorPoints;
import me.zhengjie.gemho.mapper.demo.MonitorPointsMapper;
import me.zhengjie.gemho.service.demo.MonitorPointsService;
import me.zhengjie.gemho.util.ServiceUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.List;
/**
* <p>
* 服务实现类
* </p>
*
* @author llj
* @since 2022-04-02
*/
@Service
public class MonitorPointsServiceImpl extends ServiceImpl<MonitorPointsMapper, MonitorPoints> implements MonitorPointsService {
@Autowired
private MonitorPointsMapper monitorPointsMapper;
/**
* 分页列表
* @param searchName
* @param searchValue
* @param limit
* @param timeSpace
* @param sort
* @param page
* @param size
* @return
*/
@Override
public HashMap<String, Object> list(String searchName, String searchValue, String limit, String timeSpace, String sort,String page,String size) {
long l1 = Long.parseLong(page) + 1;
long l2 = Long.parseLong(size);
Page<MonitorPoints> MonitorPointsPage = new Page<>(l1, l2);
QueryWrapper<MonitorPoints> queryWrapper = new QueryWrapper<>();
ServiceUtil.query(queryWrapper, searchName, searchValue, limit, timeSpace, sort);
MonitorPointsPage=monitorPointsMapper.selectPage(MonitorPointsPage, queryWrapper);
List<MonitorPoints> records = MonitorPointsPage.getRecords();
long total = MonitorPointsPage.getTotal();
HashMap<String, Object> map = new HashMap<>();
map.put("list", records);
map.put("total", total);
return map;
}
/**
* 新增
* @param param 根据需要进行传值
* @return
*/
@Override
public boolean add(MonitorPoints param) {
int result =monitorPointsMapper.insert(param);
if(result>0){
return true;
}
return false;
}
/**
* 修改
* @param param 根据需要进行传值
* @return
*/
@Override
public boolean modify(MonitorPoints param) {
QueryWrapper<MonitorPoints> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("id",param.getId());
int result = monitorPointsMapper.update(param,queryWrapper);
if(result>0){
return true;
}
return false;
}}
package me.zhengjie.gemho.service.dic;
import com.baomidou.mybatisplus.extension.service.IService;
import me.zhengjie.gemho.entity.dic.Jcjd;
/**
* <p>
* 检测项_字典 服务类
* </p>
*
* @author llj
* @since 2022-04-25
*/
public interface IJcjdService extends IService<Jcjd> {
}
package me.zhengjie.gemho.service.dic;
import com.baomidou.mybatisplus.extension.service.IService;
import me.zhengjie.gemho.entity.dic.Jczx;
/**
* <p>
* 检测子项_字典 服务类
* </p>
*
* @author llj
* @since 2022-04-25
*/
public interface IJczxService extends IService<Jczx> {
}
package me.zhengjie.gemho.service.dic.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import me.zhengjie.gemho.mapper.dic.JcjdMapper;
import me.zhengjie.gemho.service.dic.IJcjdService;
import org.springframework.stereotype.Service;
/**
* <p>
* 检测项_字典 服务实现类
* </p>
*
* @author llj
* @since 2022-04-25
*/
@Service
public class JcjdServiceImpl extends ServiceImpl<JcjdMapper, Jcjd> implements IJcjdService {
}
package me.zhengjie.gemho.service.dic.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import me.zhengjie.gemho.mapper.dic.JczxMapper;
import me.zhengjie.gemho.service.dic.IJczxService;
import org.springframework.stereotype.Service;
/**
* <p>
* 检测子项_字典 服务实现类
* </p>
*
* @author llj
* @since 2022-04-25
*/
@Service
public class JczxServiceImpl extends ServiceImpl<JczxMapper, Jczx> implements IJczxService {
}
......@@ -21,4 +21,6 @@ public interface SysSelectService extends IService<SysSelect> {
boolean shanchu(HashMap<String, Object> map);
List<SysArea> visual();
List<SysSelect> getbytail(String gettailno);
}
......@@ -14,10 +14,12 @@ import java.util.HashMap;
* @since 2021-12-30
*/
public interface SysSummaryService extends IService<SysSummary> {
HashMap<String, Object> getall(String page, String size);
HashMap<String, Object> getall(String page, String size, String searchName, String searchValue);
HashMap<String, Object> getcode(String mdcode);
//判断是否是设备类型
boolean iszero(String type);
boolean deletebyid(int id);
}
package me.zhengjie.gemho.service.sys;
import com.baomidou.mybatisplus.extension.service.IService;
import me.zhengjie.gemho.datavo.sys.SysVo;
import me.zhengjie.gemho.entity.sys.SysType;
import me.zhengjie.gemho.x_datavo.sys.SysVo;
/**
* <p>
......
......@@ -54,7 +54,7 @@ public class SysSelectServiceImpl extends ServiceImpl<SysSelectMapper, SysSelect
String idss = StringUtils.join(objects, ",");
Integer areid = (Integer) map.get("mdcode");
QueryWrapper<SysSelect> sysSelectQueryWrapper = new QueryWrapper<>();
sysSelectQueryWrapper.eq("mdcode", areid.toString()).eq("tailno",tailingno);
sysSelectQueryWrapper.eq("mdcode", areid.toString()).eq("tailno", tailingno);
int delete = sysSelectMapper.delete(sysSelectQueryWrapper);
String selsql = "select id,title from sys_summary where id in (" + idss + ")";
List<Map<String, Object>> mapList = sysSummaryMapper.getall(selsql);
......@@ -136,4 +136,10 @@ public class SysSelectServiceImpl extends ServiceImpl<SysSelectMapper, SysSelect
return sysAreas;
}
@Override
public List<SysSelect> getbytail(String gettailno) {
List<SysSelect> getbytail = sysSelectMapper.getbytail(gettailno);
return getbytail;
}
}
\ No newline at end of file
......@@ -48,7 +48,7 @@ public class SysSummaryServiceImpl extends ServiceImpl<SysSummaryMapper, SysSumm
private SysTypeMapper sysTypeMapper;
@Override
public HashMap<String, Object> getall(String page, String size) {
public HashMap<String, Object> getall(String page, String size, String searchName, String searchValue) {
//创建返回用对象
ArrayList<SysSummary> sysSummaries = new ArrayList<>();
long l = Long.parseLong(page);
......@@ -60,12 +60,15 @@ public class SysSummaryServiceImpl extends ServiceImpl<SysSummaryMapper, SysSumm
//获取当前登录用户,获取尾矿库编号
String username = SecurityUtils.getCurrentUser().getUsername();
String tailingno = onlineUserService.gettailno(username);
//根据尾矿库编号获取设备编号
ArrayList<String> getno = drybeachequipinforMapper.getno(tailingno);
Page<SysSummary> getbyeqno = null;
//根据设备编号获取相关的检测项
//sysSummaryQueryWrapper.in("deviceid", getno);
//sysSummaryQueryWrapper.orderByDesc("createtime");
Page<SysSummary> getbyeqno = sysSummaryMapper.getbyeqno(sysSummaryPage, tailingno);
if (searchValue != null) {
getbyeqno = sysSummaryMapper.getbyeqnobyseach(sysSummaryPage, tailingno, searchValue);
} else {
getbyeqno = sysSummaryMapper.getbyeqno(sysSummaryPage, tailingno);
}
//Page<SysSummary> getbyeqno1 = sysSummaryMapper.getbyeqno1(sysSummaryPage1, tailingno);
//Page<SysSummary> getbyeqno2 = sysSummaryMapper.getbyeqno2(sysSummaryPage2, tailingno);
//sysSummaryPage = sysSummaryMapper.selectPage(sysSummaryPage, sysSummaryQueryWrapper);
......@@ -73,6 +76,7 @@ public class SysSummaryServiceImpl extends ServiceImpl<SysSummaryMapper, SysSumm
List<SysSummary> records = getbyeqno.getRecords();
//List<SysSummary> records1 = getbyeqno1.getRecords();
//List<SysSummary> records2 = getbyeqno2.getRecords();
sysSummaries.addAll(records);
//sysSummaries.addAll(records1);
//sysSummaries.addAll(records2);
......@@ -113,6 +117,15 @@ public class SysSummaryServiceImpl extends ServiceImpl<SysSummaryMapper, SysSumm
return true;
}
@Override
public boolean deletebyid(int id) {
int deletebyid = sysSummaryMapper.deletebyid(id);
if (deletebyid > 0) {
return true;
}
return false;
}
public static void main(String[] args) {
List<Object> objects = new ArrayList<>();
objects.add("1");
......
......@@ -2,7 +2,6 @@ package me.zhengjie.gemho.service.sys.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import me.zhengjie.gemho.datavo.sys.*;
import me.zhengjie.gemho.entity.sys.SysType;
import me.zhengjie.gemho.entity.tab.Drybeachequipinfor;
import me.zhengjie.gemho.mapper.sys.SysDaterangeMapper;
......@@ -12,6 +11,7 @@ import me.zhengjie.gemho.mapper.sys.SysValueMapper;
import me.zhengjie.gemho.mapper.tab.DrybeachequipinforMapper;
import me.zhengjie.gemho.mapper.tab.MonitorvideoMapper;
import me.zhengjie.gemho.service.sys.SysTypeService;
import me.zhengjie.gemho.x_datavo.sys.*;
import me.zhengjie.modules.security.service.OnlineUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......
......@@ -5,6 +5,7 @@ import me.zhengjie.gemho.entity.tab.Drybeachequipinfor;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
/**
* <p>
......@@ -22,4 +23,36 @@ public interface DrybeachequipinforService extends IService<Drybeachequipinfor>
ArrayList<HashMap<String, String>> getDryCode();
HashMap<String, Integer> getdyinfo();
/**
* 删除设备并且删除检测项和配置信息
*
* @param equipno
* @return
*/
boolean deleteall(String equipno);
/**
* 查询当前尾矿库下的设备编码
*
* @param tailno
* @return
*/
List<String> getequipno(String tailno);
/**
* 获取设备的报警级别
*
* @return
*/
HashMap<String, Object> level(String searchName, String searchValue, String limit, String timeSpace, String sort, long page, long size);
/**
* 修改设备报警级别
*/
void dealLevel(HashMap<String, String> map);
/**
* 设备在线状态统计
*/
List<HashMap<String, Object>> dryStateCount();
}
package me.zhengjie.gemho.service.tab;
import com.baomidou.mybatisplus.extension.service.IService;
import me.zhengjie.gemho.entity.tab.MonDrybeachequipinfor;
import java.util.ArrayList;
import java.util.HashMap;
/**
* <p>
* 服务类
* </p>
*
* @author llj
* @since 2022-02-11
*/
public interface MonDrybeachequipinforService extends IService<MonDrybeachequipinfor> {
ArrayList<HashMap<String ,String>> getBymon(String monitoringno);
}
......@@ -3,6 +3,10 @@ package me.zhengjie.gemho.service.tab;
import com.baomidou.mybatisplus.extension.service.IService;
import me.zhengjie.gemho.entity.tab.Abnormal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
/**
* <p>
* 测点异常数据信息表 服务类
......@@ -12,6 +16,41 @@ import me.zhengjie.gemho.entity.tab.Abnormal;
* @since 2021-12-22
*/
public interface TabAbnormalService extends IService<Abnormal> {
boolean jcbj(String equipno,String time,String reason);
boolean jcbj(String equipno, String time, String reason, String jcreason);
/**
* 获取最新未解除报警的报警信息
*
* @return
*/
ArrayList<HashMap<String, Object>> getAbnormal();
/**
* 年统计各检测项 报警数量
*
* @return
*/
List<HashMap<String, Object>> statistics(String date);
/**
* 未解除报警数量统计
*
* @return
*/
List<HashMap<String, Object>> statistics1();
/**
* 检测线风向等级列表
*
* @return
*/
List<HashMap<String, Object>> typelist();
/**
* 各风险等级月统计
*
* @return
*/
List<HashMap<String, Object>> monthtj();
}
......@@ -5,6 +5,7 @@ import me.zhengjie.gemho.entity.tab.Tailpondinfor;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
/**
* <p>
......@@ -28,5 +29,18 @@ public interface TailpondinforService extends IService<Tailpondinfor> {
boolean updataDefaultno(String username, String tailingno);
ArrayList<HashMap<String,Object>> usertailpon();
List<Tailpondinfor> usertailpon();
HashMap<String, Object> getzuobiao(String tailingno);
/**
* 获取大屏标题
* @return
*/
String getScreenTitle();
/**
* 修改大屏标题
*/
void updateTitle(String title);
}
......@@ -4,16 +4,21 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import me.zhengjie.gemho.entity.tab.Drybeachequipinfor;
import me.zhengjie.gemho.mapper.sys.SysSelectMapper;
import me.zhengjie.gemho.mapper.sys.SysSummaryMapper;
import me.zhengjie.gemho.mapper.tab.DrybeachequipinforMapper;
import me.zhengjie.gemho.service.tab.DrybeachequipinforService;
import me.zhengjie.gemho.util.ServiceUtil;
import me.zhengjie.gemho.util.TailNoForInfoUtil;
import me.zhengjie.modules.security.service.OnlineUserService;
import me.zhengjie.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
/**
* <p>
......@@ -28,6 +33,10 @@ public class DrybeachequipinforServiceImpl extends ServiceImpl<Drybeachequipinfo
@Autowired
private DrybeachequipinforMapper drybeachequipinforMapper;
@Autowired
private SysSelectMapper sysSelectMapper;
@Autowired
private SysSummaryMapper sysSummaryMapper;
@Autowired
private OnlineUserService onlineUserService;
@Override
......@@ -58,7 +67,6 @@ public class DrybeachequipinforServiceImpl extends ServiceImpl<Drybeachequipinfo
System.out.println(e);
return false;
}
}
@Override
......@@ -69,12 +77,13 @@ public class DrybeachequipinforServiceImpl extends ServiceImpl<Drybeachequipinfo
@Override
public HashMap<String, Integer> getdyinfo() {
String tailInfoNo = TailNoForInfoUtil.getTailInfoNo();
int onlinecount = 0;
ArrayList<Integer> getonlinecount = drybeachequipinforMapper.getonlinecount();
ArrayList<Integer> getonlinecount = drybeachequipinforMapper.getonlinecount(tailInfoNo);
for (Integer integer : getonlinecount) {
onlinecount += integer;
}
int getallcount = drybeachequipinforMapper.getallcount();
int getallcount = drybeachequipinforMapper.getallcount(tailInfoNo);
int unlinecount = getallcount - onlinecount;
HashMap<String, Integer> map = new HashMap<>();
map.put("online", onlinecount);
......@@ -82,4 +91,51 @@ public class DrybeachequipinforServiceImpl extends ServiceImpl<Drybeachequipinfo
map.put("all", getallcount);
return map;
}
@Transactional(rollbackFor = Exception.class)
@Override
public boolean deleteall(String equipno) {
int deleteall = drybeachequipinforMapper.deleteall(equipno);
if (deleteall > 0) {
return true;
}
return false;
}
@Override
public List<String> getequipno(String tailno) {
List<String> getequipno = drybeachequipinforMapper.getequipno(tailno);
return getequipno;
}
@Override
public HashMap<String, Object> level(String searchName, String searchValue, String limit, String timeSpace, String sort, long page, long size) {
HashMap<String, Object> map = new HashMap<>();
//获取当前尾矿库编码
String tailingid = TailNoForInfoUtil.getTailInfoNo();
Page<HashMap<String, Object>> drybeachequipinforPage = new Page<>(page + 1, size);
Page<HashMap<String, Object>> page1 = drybeachequipinforMapper.level(drybeachequipinforPage, tailingid, searchName, searchValue);
List records = page1.getRecords();
long total = page1.getTotal();
map.put("list", records);
map.put("total", total);
return map;
}
@Override
public void dealLevel(HashMap<String, String> map) {
String equipno = map.get("equipno");
String onelevelalarm = map.get("onelevelalarm");
String twolevelalarm = map.get("twolevelalarm");
String threelevelalarm = map.get("threelevelalarm");
String fourlevelalarm = map.get("fourlevelalarm");
drybeachequipinforMapper.dealLevel(equipno, onelevelalarm, twolevelalarm, threelevelalarm, fourlevelalarm);
}
@Override
public List<HashMap<String, Object>> dryStateCount() {
String tailInfoNo = TailNoForInfoUtil.getTailInfoNo();
List<HashMap<String, Object>> hashMaps = drybeachequipinforMapper.dryStateCount(tailInfoNo);
return hashMaps;
}
}
package me.zhengjie.gemho.service.tab.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import me.zhengjie.gemho.entity.tab.Abnormal;
import me.zhengjie.gemho.mapper.tab.DrybeachequipinforMapper;
import me.zhengjie.gemho.mapper.tab.TabAbnormalMapper;
import me.zhengjie.gemho.service.tab.TabAbnormalService;
import me.zhengjie.gemho.util.TailNoForInfoUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.text.SimpleDateFormat;
import java.util.*;
/**
* <p>
......@@ -22,26 +24,89 @@ import java.util.Date;
public class TabAbnormalServiceImpl extends ServiceImpl<TabAbnormalMapper, Abnormal> implements TabAbnormalService {
@Autowired
private TabAbnormalMapper tabAbnormalMapper;
@Autowired
private DrybeachequipinforMapper drybeachequipinforMapper;
@Override
public boolean jcbj(String equipno, String time, String reason, String jcreason) {
Date nowDate = new Date(System.currentTimeMillis());
Calendar c = Calendar.getInstance();
c.setTime(nowDate); //设置时间
c.add(Calendar.HOUR, Integer.parseInt(time)); //日期分钟加1,Calendar.DATE(天),Calendar.HOUR(小时)
Date date = c.getTime(); //结果
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String jcbjtime = format.format(date);
//解除报警表的信息
int jcbj = tabAbnormalMapper.jcbj(jcreason, jcbjtime, reason, equipno);
//解除设备的报警状态
int jcbj1 = drybeachequipinforMapper.jcbj(equipno);
if (jcbj > 0 && jcbj1 > 0) {
return true;
}
return false;
}
@Override
public boolean jcbj(String equipno, String time, String reason) {
QueryWrapper<Abnormal> tabAbnormalQueryWrapper = new QueryWrapper<>();
tabAbnormalQueryWrapper.eq("equipno", equipno).orderByDesc("time").last("limit 1");
Abnormal tabAbnormal = tabAbnormalMapper.selectOne(tabAbnormalQueryWrapper);
tabAbnormal.setJcbjtime(new Date());
tabAbnormal.setJcreason(reason);
tabAbnormal.setJchours(time);
try {
int update = tabAbnormalMapper.update(tabAbnormal, null);
if (update > 0) {
return true;
public ArrayList<HashMap<String, Object>> getAbnormal() {
ArrayList<HashMap<String, Object>> getalarminfo = tabAbnormalMapper.getalarminfo();
return getalarminfo;
}
@Override
public List<HashMap<String, Object>> statistics(String date) {
String tailInfoNo = TailNoForInfoUtil.getTailInfoNo();
List<HashMap<String, Object>> statistics = null;
if (date == null) {
statistics = tabAbnormalMapper.statistics(tailInfoNo);
} else {
if (date.equals("year")) {
statistics = tabAbnormalMapper.statistics(tailInfoNo);
} else {
return false;
statistics = tabAbnormalMapper.monthequipno(tailInfoNo);
}
} catch (Exception e) {
e.printStackTrace();
return false;
}
return statistics;
}
@Override
public List<HashMap<String, Object>> statistics1() {
String tailInfoNo = TailNoForInfoUtil.getTailInfoNo();
List<HashMap<String, Object>> statistics1 = tabAbnormalMapper.statistics1(tailInfoNo);
return statistics1;
}
@Override
public List<HashMap<String, Object>> typelist() {
String tailInfoNo = TailNoForInfoUtil.getTailInfoNo();
List<HashMap<String, Object>> maps = tabAbnormalMapper.gettypelist(tailInfoNo);
return maps;
}
@Override
public List<HashMap<String, Object>> monthtj() {
String tailInfoNo = TailNoForInfoUtil.getTailInfoNo();
List<String> strings = new ArrayList<>();
List<String> strings1 = new ArrayList<>();
strings.add("red");
strings.add("orange");
strings.add("yellow");
strings.add("blue");
List<HashMap<String, Object>> monthtj = tabAbnormalMapper.monthtj(tailInfoNo);
for (HashMap<String, Object> stringObjectHashMap : monthtj) {
String alarmlevel = (String) stringObjectHashMap.get("alarmlevel");
strings1.add(alarmlevel);
}
for (String string : strings) {
if (!strings1.contains(string)) {
HashMap<String, Object> map = new HashMap<>();
map.put("alarmlevel", string);
map.put("count", 0);
monthtj.add(map);
}
}
return monthtj;
}
}
......@@ -8,6 +8,7 @@ import me.zhengjie.gemho.mapper.tab.TailpondinforMapper;
import me.zhengjie.gemho.mapper.tab.UserTailponMapper;
import me.zhengjie.gemho.service.tab.TailpondinforService;
import me.zhengjie.gemho.util.ServiceUtil;
import me.zhengjie.gemho.util.TailNoForInfoUtil;
import me.zhengjie.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -45,6 +46,7 @@ public class TailpondinforServiceImpl extends ServiceImpl<TailpondinforMapper, T
Page<Tailpondinfor> tailpondinforPage = new Page<>(page + 1, size);
tailpondinforPage = tailpondinforMapper.selectPage(tailpondinforPage, tailpondinforQueryWrapper);
List<Tailpondinfor> records = tailpondinforPage.getRecords();
//获取默认尾矿库编号
String gettailnobyuser = tailpondinforMapper.gettailnobyuser(currentUsername);
for (Tailpondinfor record : records) {
if (record.getTailingno().equals(gettailnobyuser)) {
......@@ -58,13 +60,7 @@ public class TailpondinforServiceImpl extends ServiceImpl<TailpondinforMapper, T
@Override
public Tailpondinfor getByUser(String username) {
String tailno = tailpondinforMapper.gettailnobyuser(username);
if (tailno != null) {
QueryWrapper<Tailpondinfor> tailpondinforQueryWrapper = new QueryWrapper<>();
tailpondinforQueryWrapper.eq("tailingno", tailno);
Tailpondinfor one = tailpondinforMapper.selectOne(tailpondinforQueryWrapper);
return one;
}
/* //判断是否是admin
if (username.equals("admin")) {
QueryWrapper<Tailpondinfor> tailpondinforQueryWrapper = new QueryWrapper<>();
tailpondinforQueryWrapper.orderByDesc("id");
......@@ -72,28 +68,19 @@ public class TailpondinforServiceImpl extends ServiceImpl<TailpondinforMapper, T
if (!selectList.isEmpty()) {
return selectList.get(0);
}
return null;
}
ArrayList<Tailpondinfor> tailpondinfors = tailpondinforMapper.getByUsername(username);
return tailpondinfors.get(tailpondinfors.size() - 1);
/* if (username.equals("admin")) {
tailpondinforQueryWrapper.eq("`default`", 1);
Tailpondinfor tailpondinfor = tailpondinforMapper.selectOne(tailpondinforQueryWrapper);
return null;*/
//获取默认的尾矿库编码
Tailpondinfor tailpondinfor = tailpondinforMapper.gettailnoinfobyuser(username);
if (tailpondinfor != null) {
return tailpondinfor;
}
tailpondinforQueryWrapper.clear();
tailpondinforQueryWrapper.orderByDesc("id").last("limit 1");
Tailpondinfor tailpondinfor1 = tailpondinforMapper.selectOne(tailpondinforQueryWrapper);
tailpondinfor1.setDefaults(1);
tailpondinforQueryWrapper.clear();
tailpondinforQueryWrapper.eq("id", tailpondinfor1.getId());
tailpondinforMapper.update(tailpondinfor1, tailpondinforQueryWrapper);
return tailpondinfor1;
}
ArrayList<Tailpondinfor> tailpondinfors = tailpondinforMapper.getByUsername(username);
return tailpondinfors.get(tailpondinfors.size() - 1);*/
ArrayList<Tailpondinfor> tailpondinfors = tailpondinforMapper.getByUsername(username);
if (tailpondinfors.isEmpty()) {
return null;
}
return tailpondinfors.get(tailpondinfors.size() - 1);
}
@Override
......@@ -124,13 +111,32 @@ public class TailpondinforServiceImpl extends ServiceImpl<TailpondinforMapper, T
}
@Override
public ArrayList<HashMap<String, Object>> usertailpon() {
public List<Tailpondinfor> usertailpon() {
String username = SecurityUtils.getCurrentUsername();
if (username.equals("admin")) {
ArrayList<HashMap<String, Object>> tailpons = tailpondinforMapper.tailpons();
List<Tailpondinfor> tailpons = tailpondinforMapper.tailpons();
return tailpons;
}
ArrayList<HashMap<String, Object>> usertailpon = userTailponMapper.usertailpon(username);
return usertailpon;
List<Tailpondinfor> tailpondinfors = userTailponMapper.usertailpon(username);
return tailpondinfors;
}
@Override
public HashMap<String, Object> getzuobiao(String tailingno) {
HashMap<String, Object> getzuobiao = tailpondinforMapper.getzuobiao(tailingno);
return getzuobiao;
}
@Override
public String getScreenTitle() {
String tailInfoNo = TailNoForInfoUtil.getTailInfoNo();
String screenTitle = tailpondinforMapper.getScreenTitle(tailInfoNo);
return screenTitle;
}
@Override
public void updateTitle(String title) {
String tailInfoNo = TailNoForInfoUtil.getTailInfoNo();
tailpondinforMapper.updateTitle(title,tailInfoNo);
}
}
package me.zhengjie.gemho.service.tab.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import me.zhengjie.gemho.entity.tab.MonDrybeachequipinfor;
import me.zhengjie.gemho.mapper.tab.MonDrybeachequipinforMapper;
import me.zhengjie.gemho.service.tab.MonDrybeachequipinforService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.HashMap;
/**
* <p>
* 服务实现类
* </p>
*
* @author llj
* @since 2022-02-11
*/
@Service
public class TbMonDrybeachequipinforServiceImpl extends ServiceImpl<MonDrybeachequipinforMapper, MonDrybeachequipinfor> implements MonDrybeachequipinforService {
@Autowired
private MonDrybeachequipinforMapper monDrybeachequipinforMapper;
@Override
public ArrayList<HashMap<String, String>> getBymon(String monitoringno) {
ArrayList<HashMap<String, String>> bymo = monDrybeachequipinforMapper.getBymo(monitoringno);
return null;
}
}
package me.zhengjie.gemho.service.web;
import com.baomidou.mybatisplus.extension.service.IService;
import me.zhengjie.gemho.entity.web.WebMonitorChart;
import me.zhengjie.gemho.x_datavo.web.MonitorChartVo;
/**
* <p>
* 服务类
* </p>
*
* @author llj
* @since 2022-03-28
*/
public interface IWebMonitorChartService extends IService<WebMonitorChart> {
/**
* 新增或修改监测点模块
*
* @return
*/
boolean deal(WebMonitorChart webMonitorChart);
/**
* 清空检测项的图片
*
* @param id
* @return
*/
boolean depic(int id);
/**
* 获取监测点信息
*
* @return
*/
MonitorChartVo getmonbase();
/**
* 获取监测点信息
*
* @return
*/
MonitorChartVo getmonbasevisual();
/**
* 根据当前尾矿库获取chart
* @return
*/
WebMonitorChart getbytailno();
void updatehw(int height, int width, int id);
}
package me.zhengjie.gemho.service.web;
import com.baomidou.mybatisplus.extension.service.IService;
import me.zhengjie.gemho.entity.web.WebMonitorIcon;
/**
* <p>
* 服务类
* </p>
*
* @author llj
* @since 2022-03-28
*/
public interface IWebMonitorIconService extends IService<WebMonitorIcon> {
}
package me.zhengjie.gemho.service.web;
import com.baomidou.mybatisplus.extension.service.IService;
import me.zhengjie.gemho.entity.web.WebMonitorLink;
import java.util.List;
/**
* <p>
* 服务类
* </p>
*
* @author llj
* @since 2022-03-28
*/
public interface IWebMonitorLinkService extends IService<WebMonitorLink> {
boolean pinsert(List<WebMonitorLink> webMonitorLinks);
boolean removebyguids(List<String> guids);
}
package me.zhengjie.gemho.service.web;
import com.baomidou.mybatisplus.extension.service.IService;
import me.zhengjie.gemho.entity.web.WebMonitorPoints;
import me.zhengjie.gemho.x_datavo.web.MonitorChartRq;
import java.util.ArrayList;
/**
* <p>
* 服务类
* </p>
*
* @author llj
* @since 2022-03-28
*/
public interface IWebMonitorPointsService extends IService<WebMonitorPoints> {
boolean deletePoints(String id);
void pchuli(ArrayList<WebMonitorPoints> webMonitorPoints );
void deal(MonitorChartRq monitorChartVo);
}
package me.zhengjie.gemho.service.web.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import me.zhengjie.gemho.entity.web.WebMonitorChart;
import me.zhengjie.gemho.entity.web.WebMonitorIcon;
import me.zhengjie.gemho.mapper.tab.DrybeachequipinforMapper;
import me.zhengjie.gemho.mapper.tab.TabAbnormalMapper;
import me.zhengjie.gemho.mapper.web.WebMonitorChartMapper;
import me.zhengjie.gemho.mapper.web.WebMonitorIconMapper;
import me.zhengjie.gemho.mapper.web.WebMonitorLinkMapper;
import me.zhengjie.gemho.mapper.web.WebMonitorPointsMapper;
import me.zhengjie.gemho.service.tab.DrybeachequipinforService;
import me.zhengjie.gemho.service.web.IWebMonitorChartService;
import me.zhengjie.gemho.x_datavo.RealDataVo;
import me.zhengjie.gemho.x_datavo.web.MonitorChartVo;
import me.zhengjie.gemho.x_datavo.web.WebMonitorPointsVo;
import me.zhengjie.modules.security.service.OnlineUserService;
import me.zhengjie.utils.RedisUtils;
import me.zhengjie.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.*;
/**
* <p>
* 服务实现类
* </p>
*
* @author llj
* @since 2022-03-28
*/
@Transactional
@Service
public class WebMonitorChartServiceImpl extends ServiceImpl<WebMonitorChartMapper, WebMonitorChart> implements IWebMonitorChartService {
@Autowired
private WebMonitorChartMapper webMonitorChartMapper;
@Autowired
private WebMonitorIconMapper webMonitorIconMapper;
@Autowired
private WebMonitorPointsMapper webMonitorPointsMapper;
@Autowired
private WebMonitorLinkMapper webMonitorLinkMapper;
@Autowired
private DrybeachequipinforMapper drybeachequipinforMapper;
@Autowired
private OnlineUserService onlineUserService;
@Autowired
private TabAbnormalMapper tabAbnormalMapper;
@Autowired
private RedisUtils redisUtils;
@Autowired
private DrybeachequipinforService drybeachequipinforService;
@Override
public boolean deal(WebMonitorChart webMonitorChart) {
boolean result = false;
String currentUsername = SecurityUtils.getCurrentUsername();
String tailno = onlineUserService.gettailno(currentUsername);
webMonitorChart.setTailingno(tailno);
//判断是否存在
QueryWrapper<WebMonitorChart> webMonitorChartQueryWrapper = new QueryWrapper<>();
webMonitorChartQueryWrapper.eq("tailingno", tailno);
WebMonitorChart monitorChart = webMonitorChartMapper.selectOne(webMonitorChartQueryWrapper);
if (monitorChart != null) {
int update = webMonitorChartMapper.update(webMonitorChart, webMonitorChartQueryWrapper);
if (update > 0) {
result = true;
}
} else {
int insert = webMonitorChartMapper.insert(webMonitorChart);
if (insert > 0) {
result = true;
}
}
return result;
}
@Override
public boolean depic(int id) {
int delpic = webMonitorChartMapper.delpic(id);
if (delpic > 0) {
return true;
}
return false;
}
@Override
public MonitorChartVo getmonbase() {
//获取当前尾矿库编码
String currentUsername = SecurityUtils.getCurrentUsername();
String tailno = onlineUserService.gettailno(currentUsername);
//构建返回结构
MonitorChartVo monitorChartVo = new MonitorChartVo();
//获取监测点图标
List<WebMonitorIcon> webMonitorIcons = webMonitorIconMapper.selectList(null);
monitorChartVo.setIcons(webMonitorIcons);
//获取可配置的设备列表
List<HashMap<String, Object>> device = drybeachequipinforMapper.getDevice(tailno);
monitorChartVo.setDevices(device);
//获取对应尾矿库的图片
WebMonitorChart webMonitorChart = webMonitorChartMapper.getpic(tailno);
HashMap<String, Integer> id1 = webMonitorChartMapper.getId(tailno);
if (id1 != null) {
Integer cid = id1.get("id");
monitorChartVo.setChart(webMonitorChart);
//获取对应检测项配置的监测点信息
List<WebMonitorPointsVo> webMonitorPointsVos = webMonitorPointsMapper.getbycid(cid);
if (webMonitorPointsVos != null) {
List<HashMap<String, Object>> links = webMonitorLinkMapper.getByChartId(cid);
if (links != null) {
//遍历监测信息
for (WebMonitorPointsVo webMonitorPointsVo : webMonitorPointsVos) {
List<HashMap<String, Object>> hashMaps = new ArrayList<>();
Integer id = webMonitorPointsVo.getId();
String guid = webMonitorPointsVo.getGuid();
//遍历监测点和设备关系
for (HashMap<String, Object> link : links) {
String pointid = (String) link.get("pointid");
if (pointid.equals(guid)) {
hashMaps.add(link);
}
}
webMonitorPointsVo.setItems(hashMaps);
}
}
monitorChartVo.setPoints(webMonitorPointsVos);
}
}
return monitorChartVo;
}
public MonitorChartVo getsimplemonbase() {
//获取当前尾矿库编码
String currentUsername = SecurityUtils.getCurrentUsername();
String tailno = onlineUserService.gettailno(currentUsername);
//构建返回结构
MonitorChartVo monitorChartVo = new MonitorChartVo();
//获取对应尾矿库的图片
WebMonitorChart webMonitorChart = webMonitorChartMapper.getpic(tailno);
HashMap<String, Integer> id1 = webMonitorChartMapper.getId(tailno);
if (id1 != null) {
Integer cid = id1.get("id");
monitorChartVo.setChart(webMonitorChart);
//获取对应检测项配置的监测点信息
List<WebMonitorPointsVo> webMonitorPointsVos = webMonitorPointsMapper.getbycid(cid);
if (webMonitorPointsVos != null) {
List<HashMap<String, Object>> links = webMonitorLinkMapper.getByChartId(cid);
if (links != null) {
//遍历监测信息
for (WebMonitorPointsVo webMonitorPointsVo : webMonitorPointsVos) {
List<HashMap<String, Object>> hashMaps = new ArrayList<>();
Integer id = webMonitorPointsVo.getId();
String guid = webMonitorPointsVo.getGuid();
//遍历监测点和设备关系
for (HashMap<String, Object> link : links) {
String pointid = (String) link.get("pointid");
if (pointid.equals(guid)) {
hashMaps.add(link);
}
}
webMonitorPointsVo.setItems(hashMaps);
}
}
monitorChartVo.setPoints(webMonitorPointsVos);
}
}
return monitorChartVo;
}
@Override
public MonitorChartVo getmonbasevisual() {
//获取设备的状态
List<HashMap<String, Object>> hashMaps = drybeachequipinforService.dryStateCount();
//获取所有设备的实时数据
List<RealDataVo> realData = (List<RealDataVo>) redisUtils.get("realData");
//获取设备的实时报警状态
List<HashMap<String, Object>> realalarm = tabAbnormalMapper.realalarm();
MonitorChartVo monitorChartVo = getsimplemonbase();
List<WebMonitorPointsVo> points = monitorChartVo.getPoints();
for (WebMonitorPointsVo point : points) {
List<HashMap<String, Object>> items = point.getItems();
for (HashMap<String, Object> item : items) {
String id1 = (String) item.get("id");
for (HashMap<String, Object> hashMap : hashMaps) {
String equipno = (String) hashMap.get("equipno");
if (equipno.equals(id1)) {
Long state = (Long) hashMap.get("state");
item.put("state", state);
break;
}
;
}
String id = (String) item.get("id");
for (HashMap<String, Object> map : realalarm) {
String equipno = (String) map.get("equipno");
if (equipno.equals(id)) {
item.put("alarmlevel", map.get("alarmlevel"));
break;
}
}
for (RealDataVo realDataVo : realData) {
if (realDataVo.getEquipno().equals(id)) {
List<Map> keys = (List<Map>) realDataVo.getKeys();
HashMap<String, Object> data = realDataVo.getData();
Set<String> strings = data.keySet();
for (Map key : keys) {
Set keyset1 = key.keySet();
for (Object o : keyset1) {
String s = (String) key.get(o.toString());
for (String string : strings) {
if (s.equals(string)) {
key.put(o.toString(), data.get(string));
}
}
}
}
item.put("realdata", keys);
}
}
}
}
return monitorChartVo;
}
@Override
public WebMonitorChart getbytailno() {
String currentUsername = SecurityUtils.getCurrentUsername();
String gettailno = onlineUserService.gettailno(currentUsername);
QueryWrapper<WebMonitorChart> webMonitorChartQueryWrapper = new QueryWrapper<>();
webMonitorChartQueryWrapper.eq("tailingno", gettailno);
WebMonitorChart webMonitorChart = webMonitorChartMapper.selectOne(webMonitorChartQueryWrapper);
return webMonitorChart;
}
@Override
public void updatehw(int height, int width, int id) {
}
}
package me.zhengjie.gemho.service.tab.impl;
package me.zhengjie.gemho.service.web.impl;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import me.zhengjie.gemho.entity.tab.MonDrybeachequipinfor;
import me.zhengjie.gemho.mapper.tab.MonDrybeachequipinforMapper;
import me.zhengjie.gemho.entity.web.WebMonitorIcon;
import me.zhengjie.gemho.mapper.web.WebMonitorIconMapper;
import me.zhengjie.gemho.service.web.IWebMonitorIconService;
import org.springframework.stereotype.Service;
/**
......@@ -12,9 +12,9 @@ import org.springframework.stereotype.Service;
* </p>
*
* @author llj
* @since 2022-02-14
* @since 2022-03-28
*/
@Service
public class MonDrybeachequipinforServiceImpl extends ServiceImpl<MonDrybeachequipinforMapper, MonDrybeachequipinfor> implements IService<MonDrybeachequipinfor> {
public class WebMonitorIconServiceImpl extends ServiceImpl<WebMonitorIconMapper, WebMonitorIcon> implements IWebMonitorIconService {
}
package me.zhengjie.gemho.service.web.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import me.zhengjie.gemho.entity.web.WebMonitorLink;
import me.zhengjie.gemho.mapper.web.WebMonitorLinkMapper;
import me.zhengjie.gemho.service.web.IWebMonitorLinkService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* <p>
* 服务实现类
* </p>
*
* @author llj
* @since 2022-03-28
*/
@Service
public class WebMonitorLinkServiceImpl extends ServiceImpl<WebMonitorLinkMapper, WebMonitorLink> implements IWebMonitorLinkService {
@Autowired
private WebMonitorLinkMapper webMonitorLinkMapper;
@Override
public boolean pinsert(List<WebMonitorLink> webMonitorLinks) {
try {
webMonitorLinkMapper.batchinsert(webMonitorLinks);
} catch (Exception e) {
e.printStackTrace();
return false;
}
return true;
}
@Override
public boolean removebyguids(List<String> guids) {
int removebyids = webMonitorLinkMapper.removebyids(guids);
if (removebyids>0){
return true;
}
return false;
}
}
package me.zhengjie.gemho.service.web.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import me.zhengjie.gemho.entity.web.WebMonitorChart;
import me.zhengjie.gemho.entity.web.WebMonitorLink;
import me.zhengjie.gemho.entity.web.WebMonitorPoints;
import me.zhengjie.gemho.mapper.web.WebMonitorChartMapper;
import me.zhengjie.gemho.mapper.web.WebMonitorLinkMapper;
import me.zhengjie.gemho.mapper.web.WebMonitorPointsMapper;
import me.zhengjie.gemho.service.web.IWebMonitorChartService;
import me.zhengjie.gemho.service.web.IWebMonitorLinkService;
import me.zhengjie.gemho.service.web.IWebMonitorPointsService;
import me.zhengjie.gemho.x_datavo.web.MonitorChartRq;
import me.zhengjie.gemho.x_datavo.web.WebMonitorPointsRq;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
/**
* <p>
* 服务实现类
* </p>
*
* @author llj
* @since 2022-03-28
*/
@Service
public class WebMonitorPointsServiceImpl extends ServiceImpl<WebMonitorPointsMapper, WebMonitorPoints> implements IWebMonitorPointsService {
@Autowired
private WebMonitorPointsMapper webMonitorPointsMapper;
@Autowired
private WebMonitorLinkMapper webMonitorLinkMapper;
@Autowired
private IWebMonitorChartService iWebMonitorChartService;
@Autowired
private IWebMonitorPointsService webMonitorPointsService;
@Autowired
private IWebMonitorLinkService iWebMonitorLinkService;
@Autowired
private WebMonitorChartMapper webMonitorChartMapper;
@Override
public boolean deletePoints(String guid) {
int deletepoints = 0;
List<WebMonitorLink> getallbypid = webMonitorLinkMapper.getallbypid(guid);
if (!getallbypid.isEmpty()) {
deletepoints = webMonitorPointsMapper.deletepoints(guid);
} else {
QueryWrapper<WebMonitorPoints> webMonitorPointsQueryWrapper = new QueryWrapper<>();
webMonitorPointsQueryWrapper.eq("guid", guid);
deletepoints = webMonitorPointsMapper.delete(webMonitorPointsQueryWrapper);
}
if (deletepoints > 0) {
return true;
}
return false;
}
@Override
public void pchuli(ArrayList<WebMonitorPoints> webMonitorPoints) {
webMonitorPointsMapper.batchinsert(webMonitorPoints);
}
@Override
public void deal(MonitorChartRq monitorChartVo) {
long start = System.currentTimeMillis();
Page<Object> objectPage = new Page<>();
ArrayList<WebMonitorLink> webMonitorLinks = new ArrayList<>();
ArrayList<WebMonitorPoints> webMonitorPoints = new ArrayList<>();
ArrayList<WebMonitorPoints> newebMonitorPoints = new ArrayList<>();
ArrayList<String> guids = new ArrayList<>();
//添加监测点项 信息
WebMonitorChart chart = monitorChartVo.getChart();
if (chart == null) {
chart = iWebMonitorChartService.getbytailno();
}
//修改chart信息
webMonitorChartMapper.updatehw(chart.getHeight(), chart.getWidth(), chart.getId());
long end = System.currentTimeMillis();
System.out.println("运行用时" + (end - start) + "ms");
// iWebMonitorChartService.saveOrUpdate(chart);
//添加监测点详细信息和link关系表信息
if (chart != null) {
List<WebMonitorPointsRq> points = monitorChartVo.getPoints();
for (WebMonitorPointsRq point : points) {
WebMonitorPoints webMonitorPoint = new WebMonitorPoints();
BeanUtils.copyProperties(point, webMonitorPoint);
webMonitorPoint.setChartid(chart.getId());
String guid = point.getGuid();
guids.add(guid);
webMonitorPoints.add(webMonitorPoint);
List<String> items = point.getItems();
for (String item : items) {
WebMonitorLink webMonitorLink = new WebMonitorLink();
webMonitorLink.setPointid(guid);
webMonitorLink.setDeviceid(item);
webMonitorLinks.add(webMonitorLink);
}
}
//清空监测点信息
QueryWrapper<WebMonitorPoints> webMonitorPointsQueryWrapper = new QueryWrapper<>();
webMonitorPointsQueryWrapper.eq("chartid", chart.getId());
webMonitorPointsService.remove(webMonitorPointsQueryWrapper);
webMonitorPointsService.pchuli(webMonitorPoints);
//清空关联设备
QueryWrapper<WebMonitorLink> webMonitorLinkQueryWrapper = new QueryWrapper<>();
webMonitorLinkQueryWrapper.in("pointid", guids);
iWebMonitorLinkService.removebyguids(guids);
iWebMonitorLinkService.pinsert(webMonitorLinks);
}
}
}
package me.zhengjie.gemho.util;
import lombok.SneakyThrows;
import java.time.Instant;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.Date;
public class DataToLocaDate {
public static Date toDate(LocalDate localDate) {
ZoneId zone = ZoneId.systemDefault();
Instant instant = localDate.atStartOfDay().atZone(zone).toInstant();
java.util.Date date = Date.from(instant);
return date;
}
public static LocalDate toLocalDate(Date date) {
ZoneId zone = ZoneId.systemDefault();
Instant instant = date.toInstant();
LocalDate localDate = instant.atZone(zone).toLocalDate();
return localDate;
}
@SneakyThrows
public static void main(String[] args) {
String s = LocalDateTime.now().toString();
System.out.println(s
);
}
}
......@@ -2,9 +2,10 @@ package me.zhengjie.gemho.util;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import lombok.Data;
import me.zhengjie.gemho.datavo.NameVo;
import me.zhengjie.gemho.entity.tab.Drybeachequipinfor;
import me.zhengjie.gemho.mapper.tab.DrybeachequipinforMapper;
import me.zhengjie.gemho.mapper.tab.TabAbnormalMapper;
import me.zhengjie.gemho.x_datavo.NameVo;
import me.zhengjie.utils.SpringContextHolder;
import java.util.ArrayList;
......@@ -25,13 +26,13 @@ public class DataUtil {
if (subitem.equals("1")) {
nameVos.add(new NameVo().setKey("lenth").setName("长度"));
nameVos.add(new NameVo().setKey("p_lenth").setName("人工巡检长度"));
// nameVos.add(new NameVo().setKey("p_lenth").setName("人工检查长度"));
} else if (subitem.equals("2")) {
nameVos.add(new NameVo().setKey("angle").setName("坡度"));
nameVos.add(new NameVo().setKey("p_angle").setName("人工巡检坡度"));
//nameVos.add(new NameVo().setKey("p_angle").setName("人工检查坡度"));
} else if (subitem.equals("3")) {
nameVos.add(new NameVo().setKey("safeheight").setName("安全超高"));
nameVos.add(new NameVo().setKey("p_safeheight").setName("人工巡检安全超高"));
//nameVos.add(new NameVo().setKey("p_safeheight").setName("人工检查安全超高"));
}
return nameVos;
}
......@@ -39,8 +40,8 @@ public class DataUtil {
/* 内部位移数据*/
public static ArrayList<String> dmdata(String code) {
HashMap<String, String> map = new HashMap<>();
map.put("a", "dispA");
map.put("b", "dispB");
map.put("水平", "dispA");
map.put("竖向", "dispB");
ArrayList<String> strings = new ArrayList<>();
String[] split = code.split(",");
for (String s : split) {
......@@ -53,12 +54,12 @@ public class DataUtil {
public static ArrayList<NameVo> dmdatanames(ArrayList<NameVo> nameVos, String values) {
String[] split = values.split(",");
for (String s : split) {
if (s.equals("a")) {
if (s.equals("水平")) {
nameVos.add(new NameVo().setKey("dispA").setName("水平变化量"));
nameVos.add(new NameVo().setKey("p_dispA").setName("人工巡检水平变化量"));
} else if (s.equals("b")) {
// nameVos.add(new NameVo().setKey("p_dispA").setName("人工检查水平变化量"));
} else if (s.equals("竖向")) {
nameVos.add(new NameVo().setKey("dispB").setName("竖向变化量"));
nameVos.add(new NameVo().setKey("p_dispB").setName("人工巡检竖向变化量"));
//nameVos.add(new NameVo().setKey("p_dispB").setName("人工检查竖向变化量"));
}
}
return nameVos;
......@@ -84,13 +85,13 @@ public class DataUtil {
for (int i = 0; i < split.length; i++) {
if (split[i].equals("x")) {
nameVos.add(new NameVo().setKey("dispx").setName("x变化量"));
nameVos.add(new NameVo().setKey("p_dispx").setName("人工巡检x"));
//nameVos.add(new NameVo().setKey("p_dispx").setName("人工检查x"));
} else if (split[i].equals("y")) {
nameVos.add(new NameVo().setKey("dispy").setName("y变化量"));
nameVos.add(new NameVo().setKey("p_dispy").setName("人工巡检y"));
//nameVos.add(new NameVo().setKey("p_dispy").setName("人工检查y"));
} else if (split[i].equals("z")) {
nameVos.add(new NameVo().setKey("disph").setName("z变化量"));
nameVos.add(new NameVo().setKey("p_disph").setName("人工巡检z"));
//nameVos.add(new NameVo().setKey("p_disph").setName("人工检查z"));
}
}
return nameVos;
......@@ -106,7 +107,7 @@ public class DataUtil {
public static ArrayList<NameVo> psldatanames(ArrayList<NameVo> nameVos, String subitem) {
if (subitem.equals("0")) {
nameVos.add(new NameVo().setKey("pslvalue").setName("实时数据"));
nameVos.add(new NameVo().setKey("p_pslvalue").setName("人工巡检实时数据"));
//nameVos.add(new NameVo().setKey("p_pslvalue").setName("人工检查实时数据"));
}
return nameVos;
}
......@@ -121,7 +122,7 @@ public class DataUtil {
public static ArrayList<NameVo> sldatanames(ArrayList<NameVo> nameVos, String subitem) {
if (subitem.equals("0")) {
nameVos.add(new NameVo().setKey("sllvalue").setName("实时数据"));
nameVos.add(new NameVo().setKey("p_sllvalue").setName("人工巡检实时数据"));
//nameVos.add(new NameVo().setKey("p_sllvalue").setName("人工检查实时数据"));
}
return nameVos;
}
......@@ -137,10 +138,10 @@ public class DataUtil {
public static ArrayList<NameVo> stdatanames(ArrayList<NameVo> nameVos, String subitem) {
if (subitem.equals("4")) {
nameVos.add(new NameVo().setKey("stage").setName("水位实时数据"));
nameVos.add(new NameVo().setKey("p_stage").setName("水位人工巡检数据"));
//nameVos.add(new NameVo().setKey("p_stage").setName("水位人工检查数据"));
} else if (subitem.equals("5")) {
nameVos.add(new NameVo().setKey("depth").setName("埋深实时数据"));
nameVos.add(new NameVo().setKey("p_depth").setName("埋深人工巡检数据"));
//nameVos.add(new NameVo().setKey("p_depth").setName("埋深人工检查数据"));
}
return nameVos;
}
......@@ -155,15 +156,43 @@ public class DataUtil {
public static ArrayList<NameVo> wtdatanames(ArrayList<NameVo> nameVos, String subitem) {
if (subitem.equals("0")) {
nameVos.add(new NameVo().setKey("stage").setName("实时数据"));
nameVos.add(new NameVo().setKey("p_stage").setName("人工巡检实时数据"));
//nameVos.add(new NameVo().setKey("p_stage").setName("人工检查实时数据"));
}
return nameVos;
}
public static Drybeachequipinfor dealalarm(String deviceid) {
public static HashMap<String, Object> dealalarm(String deviceid) {
DrybeachequipinforMapper drybeachequipinforMapper = (DrybeachequipinforMapper) SpringContextHolder.getBean("drybeachequipinforMapper");
TabAbnormalMapper tabAbnormalMapper = SpringContextHolder.getBean(TabAbnormalMapper.class);
QueryWrapper<Drybeachequipinfor> drybeachequipinforQueryWrapper = new QueryWrapper<>();
drybeachequipinforQueryWrapper.eq("equipno", deviceid);
Drybeachequipinfor drybeachequipinfor = drybeachequipinforMapper.selectOne(drybeachequipinforQueryWrapper);
return drybeachequipinfor;
//根据报警状态返回报警值
//在报警表中查询该设备的报警状态
Integer alarmLevel = tabAbnormalMapper.getalarmlevel(drybeachequipinfor.getEquipno());
/* if (alarmLevel != null) {
if (alarmLevel == 2 || alarmLevel == 1) {
drybeachequipinfor.setThreelevelalarm(0.0);
drybeachequipinfor.setFourlevelalarm(0.0);
}
if (alarmLevel == 3) {
drybeachequipinfor.setOnelevelalarm(0.0);
drybeachequipinfor.setFourlevelalarm(0.0);
}
} else {
drybeachequipinfor.setOnelevelalarm(0.0);
drybeachequipinfor.setTwolevelalarm(0.0);
drybeachequipinfor.setThreelevelalarm(0.0);
}*/
HashMap<String, Object> map = new HashMap<>();
HashMap<String, Double> alarm = new HashMap<>();
alarm.put("value",0.0);
alarm.put("red", drybeachequipinfor.getOnelevelalarm());
alarm.put("orange", drybeachequipinfor.getTwolevelalarm());
alarm.put("yellow", drybeachequipinfor.getThreelevelalarm());
alarm.put("blue", drybeachequipinfor.getFourlevelalarm());
map.put("value",alarm);
map.put("alarmLevel",alarmLevel);
return map;
}
}
package me.zhengjie.gemho.util;
import java.util.HashMap;
public class MapUtil {
public static HashMap<String, String> db() {
HashMap<String, String> map = new HashMap<>();
return map;
}
}
......@@ -3,7 +3,6 @@ package me.zhengjie.gemho.util;
import lombok.Data;
import java.util.List;
import java.util.Map;
@Data
public class PageResult {
......@@ -25,7 +24,7 @@ public class PageResult {
this.msg = msg;
}
public PageResult success(Map<String, ?> map) {
public PageResult success(Object map) {
return new PageResult(200, map, "");
}
......
package me.zhengjie.gemho.util;
import lombok.Data;
import me.zhengjie.gemho.datavo.DataVo;
import me.zhengjie.gemho.x_datavo.DataVo;
@Data
public class RealVo {
......
package me.zhengjie.gemho.util;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import me.zhengjie.gemho.x_datavo.data.DataQueryCriteria;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
public class ServiceUtil {
public static Date toDate(String date) {
Date parse = null;
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
parse = format.parse(date);
} catch (ParseException e) {
......@@ -60,7 +65,8 @@ public class ServiceUtil {
}
}
public static void dbquery(QueryWrapper<?> queryWrapper, String searchName, String searchValue, String limit, String timeSpace, String sort,String datasource) {
public static void dbquery(QueryWrapper<?> queryWrapper, String searchName, String searchValue, String limit, String timeSpace, String sort, String datasource) {
//精准查询还是模糊查询
//起止时间
int limit1 = 0;
......@@ -81,7 +87,9 @@ public class ServiceUtil {
if (limit != null) {
limit1 = Integer.parseInt(limit);
}
queryWrapper.eq("datasource",Integer.parseInt(datasource));
if (datasource != null) {
queryWrapper.eq("datasource", Integer.parseInt(datasource));
}
//判断是否有条件
if (searchName != null && searchValue != null) {
if (limit1 == 0) {
......@@ -100,6 +108,116 @@ public class ServiceUtil {
} else {
queryWrapper.orderByAsc("time");
}
}
public static void dbquery(QueryWrapper<?> queryWrapper, String searchName, String searchValue, String limit, String timeSpace, String sort, String datasource, String state) {
//精准查询还是模糊查询
//起止时间
int limit1 = 0;
Date start = new Date();
Date end = new Date();
String starttime = null;
String endtime = null;
boolean check = false;
String desc = sort;
//检查是否有起止时间
if (timeSpace != null) {
starttime = timeSpace.split(",")[0];
endtime = timeSpace.split(",")[1];
start = toDate(starttime + " 00:00:00");
end = toDate(endtime + " 23:59:59");
check = true;
}
if (limit != null) {
limit1 = Integer.parseInt(limit);
}
if (datasource != null) {
queryWrapper.eq("datasource", Integer.parseInt(datasource));
}
//判断是否有条件
if (searchName != null && searchValue != null) {
if (limit1 == 0) {
queryWrapper.like(searchName, searchValue);
} else {
queryWrapper.eq(searchName, searchValue);
}
}
//是否报警
if (state != null && !"".equals(state)) {
Integer integer = Integer.valueOf(state);
queryWrapper.eq("state", integer);
}
//是否需时间查询
if (check) {
queryWrapper.ge("time", start).le("time", end);
}
//正序还是倒叙
if ("desc".equals(desc)) {
queryWrapper.orderByDesc("time");
} else {
queryWrapper.orderByAsc("time");
}
}
public static void dataQuery(QueryWrapper<?> queryWrapper, DataQueryCriteria dataQueryCriteria) {
//定义字段判断是否需要人工数据
boolean check = true;
//获取精确查询字段
String exact1 = dataQueryCriteria.getExact();
if (exact1 != null) {
HashMap exact = JSON.parseObject(exact1, HashMap.class);
//HashMap<String, Object> exact = dataQueryCriteria.getExact();
//处理精确查询字段
Set<String> strings = exact.keySet();
if (!strings.isEmpty()) {
for (String string : strings) {
if (string.equals("datasource")) {
check = false;
continue;
}
queryWrapper.eq(string, exact.get(string));
}
}
}
//处理是否需要人工数据
if (check) {
queryWrapper.eq("datasource", 1);
}
//获取模糊查询字段
String vague1 = dataQueryCriteria.getVague();
if (vague1 != null) {
Map vague = JSON.parseObject(vague1, Map.class);
Set<String> strings1 = vague.keySet();
if (!strings1.isEmpty()) {
for (String s : strings1) {
queryWrapper.like(s, vague.get(s));
}
}
}
//判断是否有时间字段
String timeSpace = dataQueryCriteria.getDaterange();
if (timeSpace != null) {
if (timeSpace.contains(",")) {
String starttime = timeSpace.split(",")[0] + " 00:00:00";
String endtime = timeSpace.split(",")[1] + " 23:59:59";
Date start = toDate(starttime);
Date end = toDate(endtime);
queryWrapper.ge("time", start).le("time", end);
} else {
Date start = toDate(timeSpace + " 00:00:00");
Date end = toDate(timeSpace + " 23:59:59");
queryWrapper.ge("time", start).le("time", end);
}
}
//正序倒序
String sort = dataQueryCriteria.getSort();
String s = sort.split(",")[1];
if (s.equals("desc")) {
queryWrapper.orderByDesc("time");
} else {
queryWrapper.orderByAsc("time");
}
}
}
package me.zhengjie.gemho.util;
import me.zhengjie.modules.security.service.OnlineUserService;
import me.zhengjie.utils.SecurityUtils;
import me.zhengjie.utils.SpringContextHolder;
public class TailNoForInfoUtil {
public static String getTailInfoNo() {
String currentUsername = SecurityUtils.getCurrentUsername();
OnlineUserService onlineUserService = SpringContextHolder.getBean(OnlineUserService.class);
String tailno = onlineUserService.gettailno(currentUsername);
return tailno;
}
}
......@@ -2,7 +2,7 @@ package me.zhengjie.gemho.util;
import cn.hutool.http.HttpRequest;
import com.alibaba.fastjson.JSON;
import me.zhengjie.gemho.datavo.weather.WeatherVo;
import me.zhengjie.gemho.x_datavo.weather.WeatherVo;
public class WeatherUtil {
public static void main(String[] args) {
......
package me.zhengjie.gemho.datavo;
package me.zhengjie.gemho.x_datavo;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import java.util.HashMap;
import java.util.List;
@ApiModel(value = "实时数据返回实体类")
......@@ -11,10 +12,7 @@ public class DataVo {
private String title;
private String range;
private String devid;
private String alarm1;
private String alarm2;
private String alarm3;
private String alarm4;
private HashMap<String,Object> alarm;
private List<NameVo> names;
private List<Result> lists;
}
package me.zhengjie.gemho.datavo;
package me.zhengjie.gemho.x_datavo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
......
package me.zhengjie.gemho.datavo;
package me.zhengjie.gemho.x_datavo;
import lombok.Data;
import lombok.experimental.Accessors;
......
package me.zhengjie.gemho.datavo;
package me.zhengjie.gemho.x_datavo;
import lombok.Data;
......@@ -8,6 +8,9 @@ import java.util.HashMap;
public class RealDataVo {
private String type;
private String name;
private String equipno;
private Object keys;
private String eqdanwei;
private Object time;
private HashMap<String, Object> data;
}
package me.zhengjie.gemho.datavo;
package me.zhengjie.gemho.x_datavo;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
......
package me.zhengjie.gemho.x_datavo.data;
import lombok.Data;
@Data
public class DataQueryCriteria {
//模糊
private String vague;
//精确
private String exact;
private long page;
private long size;
//排序
private String sort;
private String daterange;
}
package me.zhengjie.gemho.datavo.sys;
package me.zhengjie.gemho.x_datavo.sys;
import io.swagger.annotations.ApiModel;
import lombok.Data;
......
package me.zhengjie.gemho.x_datavo.web;
import lombok.Data;
import me.zhengjie.gemho.entity.web.WebMonitorChart;
import me.zhengjie.gemho.entity.web.WebMonitorIcon;
import java.util.HashMap;
import java.util.List;
@Data
public class MonitorChartRq {
private WebMonitorChart chart;
private List<WebMonitorIcon> icons;
private List<WebMonitorPointsRq> points;
private List<HashMap<String, Object>> devices;
}
package me.zhengjie.gemho.x_datavo.web;
import lombok.Data;
import me.zhengjie.gemho.entity.web.WebMonitorChart;
import me.zhengjie.gemho.entity.web.WebMonitorIcon;
import java.util.HashMap;
import java.util.List;
@Data
public class MonitorChartVo {
private WebMonitorChart chart;
private List<WebMonitorIcon> icons;
private List<WebMonitorPointsVo> points;
private List<HashMap<String, Object>> devices;
}
package me.zhengjie.gemho.x_datavo.web;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
@Data
public class WebMonitorPointsRq {
/**
* 主键,自增
*/
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
@ApiModelProperty(value = "图表ID")
@TableId(value = "chartid", type = IdType.AUTO)
private Integer chartid;
@ApiModelProperty(value = "监测点类型")
private String type;
@ApiModelProperty(value = "编号")
private String guid;
@ApiModelProperty(value = "监测点名称")
private String name;
@ApiModelProperty(value = "x位置")
private Double x;
@ApiModelProperty(value = "y位置")
private Double y;
@ApiModelProperty(value = "高度")
private Double height;
@ApiModelProperty(value = "宽度")
private Double width;
@ApiModelProperty(value = "角度")
private Double angle;
@ApiModelProperty(value = "信息框位置")
private String infoseat;
@ApiModelProperty(value = "备注")
private String remark;
private List<String> items;
}
package me.zhengjie.gemho.x_datavo.web;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.HashMap;
import java.util.List;
@Data
public class WebMonitorPointsVo {
/**
* 主键,自增
*/
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
@ApiModelProperty(value = "图表ID")
@TableId(value = "chartid", type = IdType.AUTO)
private Integer chartid;
@ApiModelProperty(value = "监测点类型")
private String type;
@ApiModelProperty(value = "编号")
private String guid;
@ApiModelProperty(value = "监测点名称")
private String name;
@ApiModelProperty(value = "x位置")
private Double x;
@ApiModelProperty(value = "y位置")
private Double y;
@ApiModelProperty(value = "高度")
private Double height;
@ApiModelProperty(value = "宽度")
private Double width;
@ApiModelProperty(value = "角度")
private Double angle;
@ApiModelProperty(value = "信息框位置")
private String infoseat;
@ApiModelProperty(value = "备注")
private String remark;
private List<HashMap<String, Object>> items;
}
package me.zhengjie.gemho.generato;
package me.zhengjie.gemho.x_generato;
import com.baomidou.mybatisplus.generator.FastAutoGenerator;
import com.baomidou.mybatisplus.generator.config.DataSourceConfig;
......@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.generator.config.OutputFile;
import com.baomidou.mybatisplus.generator.config.converts.MySqlTypeConvert;
import com.baomidou.mybatisplus.generator.config.querys.MySqlQuery;
import com.baomidou.mybatisplus.generator.config.rules.DateType;
import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine;
import com.baomidou.mybatisplus.generator.keywords.MySqlKeyWordsHandler;
import java.util.ArrayList;
......@@ -21,12 +22,14 @@ import java.util.List;
public class MyGenerator {
public static void main(String[] args) {
List<String> tables = new ArrayList<>();
tables.add("tb_mon_drybeachequipinfor");
tables.add("web_monitor_points");
tables.size();
FastAutoGenerator.create(
//数据源配置,url需要修改
new DataSourceConfig.Builder("jdbc:mysql://8.142.46.126:3306/mdm_1_db?serverTimezone=Asia/Shanghai", "root", "jinghe2021//")
new DataSourceConfig.Builder("jdbc:mysql://8.142.46.126:3306/mdm_1_db?serverTimezone=Asia/Shanghai",
"root",
"jinghe2021//")
.dbQuery(new MySqlQuery())
//.schema("postgres")
.typeConvert(new MySqlTypeConvert())
......@@ -45,14 +48,14 @@ public class MyGenerator {
//包配置
.packageConfig(builder -> {
builder.parent("me.zhengjie.jinghe") // 设置父包名,根据实制项目路径修改
builder.parent("me.zhengjie.gemho") // 设置父包名,根据实制项目路径修改
//.moduleName("sys")
.entity("entity.tab")
.service("service.tab")
.serviceImpl("service.tab.impl")
.mapper("mapper.tab")
.xml("mapper.xml")
.controller("controller.tab")
.entity("entity.demo")
.service("service.demo")
.serviceImpl("service.demo.impl")
.mapper("mapper.demo")
//.xml("mapper.xml")
.controller("controller.demo")
//.other("other")
.pathInfo(Collections.singletonMap(OutputFile.mapperXml, System.getProperty("user.dir") + "/src/main/resources/mapper"));
})
......@@ -60,7 +63,7 @@ public class MyGenerator {
//策略配置
.strategyConfig(builder -> {
builder.addInclude(tables) // 设置需要生成的表名 可以为集合 一次生成多个
.addTablePrefix("tb_")//过滤表名 如表名为tab_user 实体类名为 user
.addTablePrefix("web_")//过滤表名 如表名为tab_user 实体类名为 user
.serviceBuilder()
.formatServiceFileName("%sService")//service 名称
.formatServiceImplFileName("%sServiceImpl") // serviceImpl 名称
......@@ -75,7 +78,12 @@ public class MyGenerator {
.enableBaseResultMap()//启用 BaseResultMap 生成
.enableBaseColumnList();//启用 BaseColumnList
})
//.templateEngine(new FreemarkerTemplateEngine()) // 使用Freemarker引擎模板,默认的是Velocity引擎模板
.templateEngine(new FreemarkerTemplateEngine()) // 使用Freemarker引擎模板,默认的是Velocity引擎模板
.templateConfig(builder -> {
builder.controller("/templates/controller.java")
.service("/templates/service.java")
.serviceImpl("/templates/serviceImpl.java");
})
.execute();
//HttpRequest.post("").body("").execute().body();
System.out.println(System.getProperty("user.dir") );
......
......@@ -15,12 +15,13 @@
*/
package me.zhengjie.modules.mnt.domain;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import me.zhengjie.base.BaseEntity;
import javax.persistence.*;
import java.io.Serializable;
......
......@@ -15,13 +15,17 @@
*/
package me.zhengjie.modules.mnt.domain;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import me.zhengjie.base.BaseEntity;
import javax.persistence.*;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
/**
......
......@@ -15,12 +15,13 @@
*/
package me.zhengjie.modules.mnt.domain;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import me.zhengjie.base.BaseEntity;
import javax.persistence.*;
import java.io.Serializable;
import java.util.Set;
......
......@@ -15,13 +15,17 @@
*/
package me.zhengjie.modules.mnt.domain;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.CreationTimestamp;
import javax.persistence.*;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.sql.Timestamp;
......
......@@ -15,12 +15,13 @@
*/
package me.zhengjie.modules.mnt.domain;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import me.zhengjie.base.BaseEntity;
import javax.persistence.*;
import java.io.Serializable;
import java.util.Objects;
......
......@@ -28,6 +28,7 @@ import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Set;
......
......@@ -33,6 +33,7 @@ import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
......@@ -54,7 +55,7 @@ public class DatabaseController {
@ApiOperation("导出数据库数据")
@GetMapping(value = "/download")
@PreAuthorize("@el.check('database:list')")
//@PreAuthorize("@el.check('database:list')")
public void exportDatabase(HttpServletResponse response, DatabaseQueryCriteria criteria) throws IOException {
databaseService.download(databaseService.queryAll(criteria), response);
}
......
......@@ -31,6 +31,7 @@ import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
......
......@@ -26,6 +26,7 @@ import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Set;
......
......@@ -28,6 +28,7 @@ import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Set;
......
......@@ -18,6 +18,7 @@ package me.zhengjie.modules.mnt.service.dto;
import lombok.Getter;
import lombok.Setter;
import me.zhengjie.base.BaseDTO;
import java.io.Serializable;
/**
......
......@@ -17,6 +17,7 @@ package me.zhengjie.modules.mnt.service.dto;
import lombok.Data;
import me.zhengjie.annotation.Query;
import java.sql.Timestamp;
import java.util.List;
......
......@@ -18,6 +18,7 @@ package me.zhengjie.modules.mnt.service.dto;
import lombok.Getter;
import lombok.Setter;
import me.zhengjie.base.BaseDTO;
import java.io.Serializable;
/**
......
......@@ -17,6 +17,7 @@ package me.zhengjie.modules.mnt.service.dto;
import lombok.Data;
import me.zhengjie.annotation.Query;
import java.sql.Timestamp;
import java.util.List;
......
......@@ -19,6 +19,7 @@ import cn.hutool.core.collection.CollectionUtil;
import lombok.Getter;
import lombok.Setter;
import me.zhengjie.base.BaseDTO;
import java.io.Serializable;
import java.util.Objects;
import java.util.Set;
......
......@@ -16,6 +16,7 @@
package me.zhengjie.modules.mnt.service.dto;
import lombok.Data;
import java.io.Serializable;
import java.sql.Timestamp;
......
......@@ -17,6 +17,7 @@ package me.zhengjie.modules.mnt.service.dto;
import lombok.Data;
import me.zhengjie.annotation.Query;
import java.sql.Timestamp;
import java.util.List;
......
......@@ -17,6 +17,7 @@ package me.zhengjie.modules.mnt.service.dto;
import lombok.Data;
import me.zhengjie.annotation.Query;
import java.sql.Timestamp;
import java.util.List;
......
......@@ -18,6 +18,7 @@ package me.zhengjie.modules.mnt.service.dto;
import lombok.Getter;
import lombok.Setter;
import me.zhengjie.base.BaseDTO;
import java.io.Serializable;
import java.util.Objects;
......
......@@ -17,6 +17,7 @@ package me.zhengjie.modules.mnt.service.dto;
import lombok.Data;
import me.zhengjie.annotation.Query;
import java.sql.Timestamp;
import java.util.List;
......
......@@ -31,6 +31,7 @@ import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.*;
......
......@@ -33,6 +33,7 @@ import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.*;
......
......@@ -31,6 +31,7 @@ import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.*;
......
......@@ -43,6 +43,7 @@ import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.*;
......
......@@ -31,6 +31,7 @@ import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.*;
......
......@@ -21,7 +21,9 @@ import com.jcraft.jsch.JSch;
import com.jcraft.jsch.Session;
import lombok.extern.slf4j.Slf4j;
import java.io.*;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Vector;
/**
......
......@@ -20,13 +20,17 @@ import com.alibaba.druid.util.StringUtils;
import com.google.common.collect.Lists;
import lombok.extern.slf4j.Slf4j;
import me.zhengjie.utils.CloseUtil;
import javax.sql.DataSource;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
import java.sql.*;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.List;
/**
......
......@@ -19,6 +19,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import me.zhengjie.base.BaseEntity;
import javax.persistence.*;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
......
......@@ -18,6 +18,7 @@ package me.zhengjie.modules.quartz.domain;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.annotations.CreationTimestamp;
import javax.persistence.*;
import java.io.Serializable;
import java.sql.Timestamp;
......
......@@ -18,6 +18,7 @@ package me.zhengjie.modules.quartz.repository;
import me.zhengjie.modules.quartz.domain.QuartzJob;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import java.util.List;
/**
......
......@@ -30,6 +30,7 @@ import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Set;
......
......@@ -19,6 +19,7 @@ import me.zhengjie.modules.quartz.domain.QuartzJob;
import me.zhengjie.modules.quartz.domain.QuartzLog;
import me.zhengjie.modules.quartz.service.dto.JobQueryCriteria;
import org.springframework.data.domain.Pageable;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
......
......@@ -17,6 +17,7 @@ package me.zhengjie.modules.quartz.service.dto;
import lombok.Data;
import me.zhengjie.annotation.Query;
import java.sql.Timestamp;
import java.util.List;
......
......@@ -32,6 +32,7 @@ import org.springframework.data.domain.Pageable;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.*;
......
......@@ -34,8 +34,14 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.quartz.QuartzJobBean;
import java.util.*;
import java.util.concurrent.*;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
/**
* 参考人人开源,https://gitee.com/renrenio/renren-security
......
......@@ -20,10 +20,11 @@ import me.zhengjie.exception.BadRequestException;
import me.zhengjie.modules.quartz.domain.QuartzJob;
import org.quartz.*;
import org.quartz.impl.triggers.CronTriggerImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.Date;
import static org.quartz.TriggerBuilder.newTrigger;
/**
......
......@@ -19,6 +19,7 @@ import lombok.extern.slf4j.Slf4j;
import me.zhengjie.utils.SpringContextHolder;
import org.apache.commons.lang3.StringUtils;
import org.springframework.util.ReflectionUtils;
import java.lang.reflect.Method;
import java.util.concurrent.Callable;
......
......@@ -18,7 +18,10 @@ package me.zhengjie.modules.security.config;
import lombok.RequiredArgsConstructor;
import me.zhengjie.annotation.AnonymousAccess;
import me.zhengjie.modules.security.config.bean.SecurityProperties;
import me.zhengjie.modules.security.security.*;
import me.zhengjie.modules.security.security.JwtAccessDeniedHandler;
import me.zhengjie.modules.security.security.JwtAuthenticationEntryPoint;
import me.zhengjie.modules.security.security.TokenConfigurer;
import me.zhengjie.modules.security.security.TokenProvider;
import me.zhengjie.modules.security.service.OnlineUserService;
import me.zhengjie.modules.security.service.UserCacheClean;
import me.zhengjie.utils.enums.RequestMethodEnum;
......@@ -40,6 +43,7 @@ import org.springframework.web.filter.CorsFilter;
import org.springframework.web.method.HandlerMethod;
import org.springframework.web.servlet.mvc.method.RequestMappingInfo;
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping;
import java.util.*;
/**
......@@ -133,7 +137,7 @@ public class SpringSecurityConfig extends WebSecurityConfigurerAdapter {
// 所有类型的接口都放行
.antMatchers(anonymousUrls.get(RequestMethodEnum.ALL.getType()).toArray(new String[0])).permitAll()
// 所有请求都需要认证
.anyRequest().authenticated()
//.anyRequest().authenticated()
.and().apply(securityConfigurerAdapter());
}
......
......@@ -25,6 +25,7 @@ import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Set;
......
......@@ -18,9 +18,9 @@ package me.zhengjie.modules.security.security;
import cn.hutool.core.util.StrUtil;
import io.jsonwebtoken.ExpiredJwtException;
import me.zhengjie.modules.security.config.bean.SecurityProperties;
import me.zhengjie.modules.security.service.OnlineUserService;
import me.zhengjie.modules.security.service.UserCacheClean;
import me.zhengjie.modules.security.service.dto.OnlineUserDto;
import me.zhengjie.modules.security.service.OnlineUserService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.security.core.Authentication;
......
......@@ -29,9 +29,11 @@ import org.springframework.security.authentication.UsernamePasswordAuthenticatio
import org.springframework.security.core.Authentication;
import org.springframework.security.core.userdetails.User;
import org.springframework.stereotype.Component;
import javax.servlet.http.HttpServletRequest;
import java.security.Key;
import java.util.*;
import java.util.ArrayList;
import java.util.Date;
import java.util.concurrent.TimeUnit;
/**
......
......@@ -207,11 +207,22 @@ public class OnlineUserService {
* @param username
*/
public void saveWKKBase(String username) {
Long currentUserId = SecurityUtils.getCurrentUserId();
TailpondinforService tailpondinforService1 = SpringContextHolder.getBean(TailpondinforService.class);
Tailpondinfor tailpondinfor = tailpondinforService1.getByUser(username);
Long tokenValidityInSeconds = properties.getTokenValidityInSeconds();
System.out.println("++++++++++++++++++++++++++++++++++++++++++++++++++++"+tokenValidityInSeconds);
redisUtils.set(username + "wkk", tailpondinfor.getTailingno(), properties.getTokenValidityInSeconds() / 1000);
System.out.println("++++++++++++++++++++++++++++++++++++++++++++++++++++" + tokenValidityInSeconds);
redisUtils.set(username + "wkk", tailpondinfor.getTailingno(), (properties.getTokenValidityInSeconds() / 1000) * 2);
//清空 菜单的缓存
redisUtils.del("menu::user:" + currentUserId);
}
/**
* 清空菜单缓存
*/
public void clearMenu() {
Long currentUserId = SecurityUtils.getCurrentUserId();
redisUtils.del("menu::user:" + currentUserId);
}
/**
......@@ -222,7 +233,7 @@ public class OnlineUserService {
*/
@Async
public void changeWkkBase(String username, String tailingno) {
redisUtils.set(username + "wkk", tailingno, properties.getTokenValidityInSeconds() / 1000);
redisUtils.set(username + "wkk", tailingno, (properties.getTokenValidityInSeconds() / 1000) * 2);
}
/**
......
......@@ -17,6 +17,7 @@ package me.zhengjie.modules.security.service.dto;
import lombok.Getter;
import lombok.Setter;
import javax.validation.constraints.NotBlank;
/**
......
......@@ -21,6 +21,7 @@ import lombok.Getter;
import me.zhengjie.modules.system.service.dto.UserDto;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
......
......@@ -18,6 +18,7 @@ package me.zhengjie.modules.security.service.dto;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;
/**
......
......@@ -20,6 +20,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import me.zhengjie.base.BaseEntity;
import javax.persistence.*;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
......
......@@ -19,6 +19,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import me.zhengjie.base.BaseEntity;
import javax.persistence.*;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
......
......@@ -19,6 +19,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import me.zhengjie.base.BaseEntity;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
......
......@@ -19,6 +19,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import me.zhengjie.base.BaseEntity;
import javax.persistence.*;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
......
......@@ -17,6 +17,7 @@ package me.zhengjie.modules.system.domain.vo;
import lombok.AllArgsConstructor;
import lombok.Data;
import java.io.Serializable;
/**
......
......@@ -20,6 +20,7 @@ import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import java.util.List;
import java.util.Set;
......
......@@ -20,6 +20,7 @@ import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
......
......@@ -20,6 +20,7 @@ import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import java.util.Date;
import java.util.List;
import java.util.Set;
......
......@@ -31,6 +31,7 @@ import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.*;
......
......@@ -29,6 +29,7 @@ import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Set;
......
......@@ -32,6 +32,7 @@ import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......
......@@ -29,6 +29,7 @@ import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Set;
......
......@@ -20,8 +20,8 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import me.zhengjie.annotation.Log;
import me.zhengjie.modules.system.domain.Menu;
import me.zhengjie.exception.BadRequestException;
import me.zhengjie.modules.system.domain.Menu;
import me.zhengjie.modules.system.service.MenuService;
import me.zhengjie.modules.system.service.dto.MenuDto;
import me.zhengjie.modules.system.service.dto.MenuQueryCriteria;
......
......@@ -22,7 +22,9 @@ import me.zhengjie.modules.system.service.MonitorService;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @author Zheng Jie
......
......@@ -20,8 +20,8 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import me.zhengjie.annotation.Log;
import me.zhengjie.modules.system.domain.Role;
import me.zhengjie.exception.BadRequestException;
import me.zhengjie.modules.system.domain.Role;
import me.zhengjie.modules.system.service.RoleService;
import me.zhengjie.modules.system.service.dto.RoleDto;
import me.zhengjie.modules.system.service.dto.RoleQueryCriteria;
......@@ -33,6 +33,7 @@ import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Collections;
......
......@@ -21,21 +21,19 @@ import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import me.zhengjie.annotation.Log;
import me.zhengjie.config.RsaProperties;
import me.zhengjie.exception.BadRequestException;
import me.zhengjie.gemho.controller.tab.UserTailponController;
import me.zhengjie.gemho.service.tab.UserTailponService;
import me.zhengjie.modules.system.domain.Dept;
import me.zhengjie.modules.system.service.DataService;
import me.zhengjie.modules.system.domain.User;
import me.zhengjie.exception.BadRequestException;
import me.zhengjie.modules.system.domain.vo.UserPassVo;
import me.zhengjie.modules.system.service.DeptService;
import me.zhengjie.modules.system.service.RoleService;
import me.zhengjie.modules.system.service.*;
import me.zhengjie.modules.system.service.dto.RoleSmallDto;
import me.zhengjie.modules.system.service.dto.UserDto;
import me.zhengjie.modules.system.service.dto.UserQueryCriteria;
import me.zhengjie.modules.system.service.VerifyService;
import me.zhengjie.utils.*;
import me.zhengjie.modules.system.service.UserService;
import me.zhengjie.utils.PageUtil;
import me.zhengjie.utils.RsaUtils;
import me.zhengjie.utils.SecurityUtils;
import me.zhengjie.utils.enums.CodeEnum;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Pageable;
......
......@@ -19,13 +19,14 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import me.zhengjie.domain.vo.EmailVo;
import me.zhengjie.service.EmailService;
import me.zhengjie.modules.system.service.VerifyService;
import me.zhengjie.service.EmailService;
import me.zhengjie.utils.enums.CodeBiEnum;
import me.zhengjie.utils.enums.CodeEnum;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import java.util.Objects;
/**
......
......@@ -16,6 +16,7 @@
package me.zhengjie.modules.system.service;
import me.zhengjie.modules.system.service.dto.UserDto;
import java.util.List;
/**
......
......@@ -18,6 +18,7 @@ package me.zhengjie.modules.system.service;
import me.zhengjie.modules.system.domain.Dept;
import me.zhengjie.modules.system.service.dto.DeptDto;
import me.zhengjie.modules.system.service.dto.DeptQueryCriteria;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
......
......@@ -19,6 +19,7 @@ import me.zhengjie.modules.system.domain.DictDetail;
import me.zhengjie.modules.system.service.dto.DictDetailDto;
import me.zhengjie.modules.system.service.dto.DictDetailQueryCriteria;
import org.springframework.data.domain.Pageable;
import java.util.List;
import java.util.Map;
......
......@@ -19,6 +19,7 @@ import me.zhengjie.modules.system.domain.Dict;
import me.zhengjie.modules.system.service.dto.DictDto;
import me.zhengjie.modules.system.service.dto.DictQueryCriteria;
import org.springframework.data.domain.Pageable;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
......
......@@ -19,6 +19,7 @@ import me.zhengjie.modules.system.domain.Job;
import me.zhengjie.modules.system.service.dto.JobDto;
import me.zhengjie.modules.system.service.dto.JobQueryCriteria;
import org.springframework.data.domain.Pageable;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
......
......@@ -22,6 +22,7 @@ import me.zhengjie.modules.system.service.dto.RoleSmallDto;
import me.zhengjie.modules.system.service.dto.UserDto;
import org.springframework.data.domain.Pageable;
import org.springframework.security.core.GrantedAuthority;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
......
......@@ -20,6 +20,7 @@ import me.zhengjie.modules.system.service.dto.UserDto;
import me.zhengjie.modules.system.service.dto.UserQueryCriteria;
import org.springframework.data.domain.Pageable;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
......
......@@ -19,6 +19,7 @@ import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Getter;
import lombok.Setter;
import me.zhengjie.base.BaseDTO;
import java.io.Serializable;
import java.util.List;
import java.util.Objects;
......
......@@ -18,6 +18,7 @@ package me.zhengjie.modules.system.service.dto;
import lombok.Data;
import me.zhengjie.annotation.DataPermission;
import me.zhengjie.annotation.Query;
import java.sql.Timestamp;
import java.util.List;
......
......@@ -16,6 +16,7 @@
package me.zhengjie.modules.system.service.dto;
import lombok.Data;
import java.io.Serializable;
/**
......
......@@ -18,6 +18,7 @@ package me.zhengjie.modules.system.service.dto;
import lombok.Getter;
import lombok.Setter;
import me.zhengjie.base.BaseDTO;
import java.io.Serializable;
/**
......
......@@ -18,6 +18,7 @@ package me.zhengjie.modules.system.service.dto;
import lombok.Getter;
import lombok.Setter;
import me.zhengjie.base.BaseDTO;
import java.io.Serializable;
import java.util.List;
......
......@@ -17,6 +17,7 @@ package me.zhengjie.modules.system.service.dto;
import lombok.Getter;
import lombok.Setter;
import java.io.Serializable;
/**
......
......@@ -18,6 +18,7 @@ package me.zhengjie.modules.system.service.dto;
import lombok.Data;
import lombok.NoArgsConstructor;
import me.zhengjie.annotation.Query;
import java.sql.Timestamp;
import java.util.List;
......
......@@ -17,6 +17,7 @@ package me.zhengjie.modules.system.service.dto;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
......
......@@ -18,6 +18,7 @@ package me.zhengjie.modules.system.service.dto;
import lombok.Getter;
import lombok.Setter;
import me.zhengjie.base.BaseDTO;
import java.io.Serializable;
import java.util.List;
import java.util.Objects;
......
......@@ -17,6 +17,7 @@ package me.zhengjie.modules.system.service.dto;
import lombok.Data;
import me.zhengjie.annotation.Query;
import java.sql.Timestamp;
import java.util.List;
......
......@@ -18,6 +18,7 @@ package me.zhengjie.modules.system.service.dto;
import lombok.Getter;
import lombok.Setter;
import me.zhengjie.base.BaseDTO;
import java.io.Serializable;
import java.util.Objects;
import java.util.Set;
......
......@@ -16,6 +16,7 @@
package me.zhengjie.modules.system.service.dto;
import lombok.Data;
import java.io.Serializable;
/**
......
......@@ -19,6 +19,7 @@ import com.alibaba.fastjson.annotation.JSONField;
import lombok.Getter;
import lombok.Setter;
import me.zhengjie.base.BaseDTO;
import java.io.Serializable;
import java.util.Date;
import java.util.Set;
......
......@@ -17,6 +17,7 @@ package me.zhengjie.modules.system.service.dto;
import lombok.Data;
import me.zhengjie.annotation.Query;
import java.io.Serializable;
import java.sql.Timestamp;
import java.util.HashSet;
......
......@@ -26,6 +26,7 @@ import me.zhengjie.utils.enums.DataScopeEnum;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import java.util.*;
/**
......
......@@ -21,20 +21,21 @@ import lombok.RequiredArgsConstructor;
import me.zhengjie.exception.BadRequestException;
import me.zhengjie.modules.system.domain.Dept;
import me.zhengjie.modules.system.domain.User;
import me.zhengjie.modules.system.repository.DeptRepository;
import me.zhengjie.modules.system.repository.RoleRepository;
import me.zhengjie.modules.system.repository.UserRepository;
import me.zhengjie.modules.system.service.DeptService;
import me.zhengjie.modules.system.service.dto.DeptDto;
import me.zhengjie.modules.system.service.dto.DeptQueryCriteria;
import me.zhengjie.utils.*;
import me.zhengjie.modules.system.repository.DeptRepository;
import me.zhengjie.modules.system.service.DeptService;
import me.zhengjie.modules.system.service.mapstruct.DeptMapper;
import me.zhengjie.utils.*;
import me.zhengjie.utils.enums.DataScopeEnum;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.domain.Sort;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.lang.reflect.Field;
......
......@@ -18,19 +18,20 @@ package me.zhengjie.modules.system.service.impl;
import lombok.RequiredArgsConstructor;
import me.zhengjie.modules.system.domain.Dict;
import me.zhengjie.modules.system.domain.DictDetail;
import me.zhengjie.modules.system.repository.DictRepository;
import me.zhengjie.modules.system.service.dto.DictDetailQueryCriteria;
import me.zhengjie.utils.*;
import me.zhengjie.modules.system.repository.DictDetailRepository;
import me.zhengjie.modules.system.repository.DictRepository;
import me.zhengjie.modules.system.service.DictDetailService;
import me.zhengjie.modules.system.service.dto.DictDetailDto;
import me.zhengjie.modules.system.service.dto.DictDetailQueryCriteria;
import me.zhengjie.modules.system.service.mapstruct.DictDetailMapper;
import me.zhengjie.utils.*;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.Map;
......
......@@ -18,18 +18,19 @@ package me.zhengjie.modules.system.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import lombok.RequiredArgsConstructor;
import me.zhengjie.modules.system.domain.Dict;
import me.zhengjie.modules.system.service.dto.DictDetailDto;
import me.zhengjie.modules.system.service.dto.DictQueryCriteria;
import me.zhengjie.utils.*;
import me.zhengjie.modules.system.repository.DictRepository;
import me.zhengjie.modules.system.service.DictService;
import me.zhengjie.modules.system.service.dto.DictDetailDto;
import me.zhengjie.modules.system.service.dto.DictDto;
import me.zhengjie.modules.system.service.dto.DictQueryCriteria;
import me.zhengjie.modules.system.service.mapstruct.DictMapper;
import me.zhengjie.utils.*;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.*;
......
......@@ -19,13 +19,13 @@ import lombok.RequiredArgsConstructor;
import me.zhengjie.exception.BadRequestException;
import me.zhengjie.exception.EntityExistException;
import me.zhengjie.modules.system.domain.Job;
import me.zhengjie.modules.system.repository.UserRepository;
import me.zhengjie.modules.system.service.dto.JobQueryCriteria;
import me.zhengjie.utils.*;
import me.zhengjie.modules.system.repository.JobRepository;
import me.zhengjie.modules.system.repository.UserRepository;
import me.zhengjie.modules.system.service.JobService;
import me.zhengjie.modules.system.service.dto.JobDto;
import me.zhengjie.modules.system.service.dto.JobQueryCriteria;
import me.zhengjie.modules.system.service.mapstruct.JobMapper;
import me.zhengjie.utils.*;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
......@@ -33,6 +33,7 @@ import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.*;
......
......@@ -18,13 +18,15 @@ package me.zhengjie.modules.system.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil;
import lombok.RequiredArgsConstructor;
import me.zhengjie.exception.BadRequestException;
import me.zhengjie.exception.EntityExistException;
import me.zhengjie.gemho.mapper.sys.SysTypeMapper;
import me.zhengjie.modules.security.service.OnlineUserService;
import me.zhengjie.modules.system.domain.Menu;
import me.zhengjie.modules.system.domain.Role;
import me.zhengjie.modules.system.domain.User;
import me.zhengjie.modules.system.domain.vo.MenuMetaVo;
import me.zhengjie.modules.system.domain.vo.MenuVo;
import me.zhengjie.exception.BadRequestException;
import me.zhengjie.exception.EntityExistException;
import me.zhengjie.modules.system.repository.MenuRepository;
import me.zhengjie.modules.system.repository.UserRepository;
import me.zhengjie.modules.system.service.MenuService;
......@@ -39,6 +41,7 @@ import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.domain.Sort;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.lang.reflect.Field;
......@@ -100,6 +103,22 @@ public class MenuServiceImpl implements MenuService {
List<RoleSmallDto> roles = roleService.findByUsersId(currentUserId);
Set<Long> roleIds = roles.stream().map(RoleSmallDto::getId).collect(Collectors.toSet());
LinkedHashSet<Menu> menus = menuRepository.findByRoleIdsAndTypeNot(roleIds, 2);
OnlineUserService onlineUserService = SpringContextHolder.getBean(OnlineUserService.class);
SysTypeMapper sysTypeMapper = SpringContextHolder.getBean(SysTypeMapper.class);
String gettailno = onlineUserService.gettailno(SecurityUtils.getCurrentUsername());
List<String> list = sysTypeMapper.getbytailno(gettailno);
List<String> list1 = sysTypeMapper.getname();
Iterator<Menu> iterator = menus.iterator();
while (iterator.hasNext()){
Menu menu = iterator.next();
String title = menu.getTitle();
if (list1.contains(title)){
if (!list.contains(title)){
menu.setHidden(true);
}
}
}
return menus.stream().map(menuMapper::toDto).collect(Collectors.toList());
}
......
......@@ -18,10 +18,10 @@ package me.zhengjie.modules.system.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import lombok.RequiredArgsConstructor;
import me.zhengjie.exception.BadRequestException;
import me.zhengjie.exception.EntityExistException;
import me.zhengjie.modules.security.service.UserCacheClean;
import me.zhengjie.modules.system.domain.Menu;
import me.zhengjie.modules.system.domain.Role;
import me.zhengjie.exception.EntityExistException;
import me.zhengjie.modules.system.domain.User;
import me.zhengjie.modules.system.repository.RoleRepository;
import me.zhengjie.modules.system.repository.UserRepository;
......
......@@ -18,11 +18,11 @@ package me.zhengjie.modules.system.service.impl;
import lombok.RequiredArgsConstructor;
import me.zhengjie.config.FileProperties;
import me.zhengjie.exception.BadRequestException;
import me.zhengjie.exception.EntityExistException;
import me.zhengjie.exception.EntityNotFoundException;
import me.zhengjie.modules.security.service.OnlineUserService;
import me.zhengjie.modules.security.service.UserCacheClean;
import me.zhengjie.modules.system.domain.User;
import me.zhengjie.exception.EntityExistException;
import me.zhengjie.exception.EntityNotFoundException;
import me.zhengjie.modules.system.repository.UserRepository;
import me.zhengjie.modules.system.service.UserService;
import me.zhengjie.modules.system.service.dto.JobSmallDto;
......@@ -38,6 +38,7 @@ import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import javax.validation.constraints.NotBlank;
import java.io.File;
......
......@@ -29,6 +29,7 @@ import me.zhengjie.utils.RedisUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Collections;
/**
......
......@@ -7,6 +7,7 @@ spring:
url: jdbc:log4jdbc:mysql://${DB_HOST:8.142.46.126}:${DB_PORT:3306}/${DB_NAME:mdm_1_db}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&rewriteBatchedStatements=true
username: ${DB_USER:root}
password: ${DB_PWD:jinghe2021//}
#password: ${DB_PWD:123456}
# 初始连接数
initial-size: 5
# 最小连接数
......
......@@ -4,7 +4,7 @@ spring:
druid:
db-type: com.alibaba.druid.pool.DruidDataSource
driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
url: jdbc:log4jdbc:mysql://${DB_HOST:localhost}:${DB_PORT:3306}/${DB_NAME:eladmin}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false
url: jdbc:log4jdbc:mysql://${DB_HOST:localhost}:${DB_PORT:3306}/${DB_NAME:mdm_1_db}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false
username: ${DB_USER:root}
password: ${DB_PWD:123456}
# 初始连接数
......
<?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="me.zhengjie.gemho.mapper.artificial.ArtificialDataMapper">
</mapper>
<?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="me.zhengjie.gemho.mapper.dic.JcjdMapper">
</mapper>
<?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="me.zhengjie.gemho.mapper.dic.JcnrjyqMapper">
</mapper>
<?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="me.zhengjie.gemho.mapper.artificial.ArtificialPointMapper">
</mapper>
<?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="me.zhengjie.gemho.mapper.dic.JcyqMapper">
</mapper>
<?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="me.zhengjie.gemho.mapper.dic.JczxMapper">
</mapper>
<?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="me.zhengjie.gemho.mapper.tab.MonDrybeachequipinforMapper">
</mapper>
<?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="me.zhengjie.jinghe.mapper.data.PdataMapper">
</mapper>
<?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="me.zhengjie.gemho.mapper.tab.DrybeachequipinforMapper">
<delete id="deleteall">
DELETE
td.*,sy.*,ss.* from tb_drybeachequipinfor td left join sys_summary sy on td.equipno = sy.deviceid left join sys_select ss on sy.id= ss.sumid where td.equipno=
#{equipno}
</delete>
<update id="dealLevel">
update tb_drybeachequipinfor
set onelevelalarm=#{onelevelalarm},
twolevelalarm=#{twolevelalarm},
threelevelalarm=#{threelevelalarm},
fourlevelalarm=#{fourlevelalarm}
where equipno = #{equipno}
</update>
<select id="dryStateCount" resultType="hashmap">
SELECT equipno,
case
when DATE_FORMAT(datarealtime, '%Y-%m-%d %H:%m:%s') >=
DATE_FORMAT(DATE_SUB(NOW(), INTERVAL 30 MINUTE), '%Y-%m-%d %H:%m:%s') then 0
else 1 end as `state`
FROM `tb_drybeachequipinfor`
where tailingid = #{tailingid}
</select>
</mapper>
<?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="me.zhengjie.gemho.mapper.tab.TabAbnormalMapper">
<select id="realalarm" resultType="hashmap">
SELECT b.equipno,
case
when a.alarmlevel is null then 0
else a.alarmlevel end as alarmlevel
FROM (SELECT c.*
FROM (SELECT * from tab_abnormal ORDER BY time DESC) c
where state = 1
GROUP BY c.equipno) a
right join tb_drybeachequipinfor b on a.equipno = b.equipno
</select>
</mapper>
\ No newline at end of file
<?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="me.zhengjie.gemho.mapper.web.WebMonitorChartMapper">
</mapper>
<?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="me.zhengjie.gemho.mapper.web.WebMonitorIconMapper">
</mapper>
<?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="me.zhengjie.gemho.mapper.web.WebMonitorLinkMapper">
<insert id="batchinsert">
insert into web_monitor_link (pointid,deviceid,remark) values
<foreach collection="webMonitorLinks" item="link" separator=",">
(#{link.pointid},
#{link.deviceid},
#{link.remark})
</foreach>
</insert>
<delete id="removebyids">
delete from web_monitor_link where pointid in
<foreach collection="guids" item="guid" index="index" open="(" close=")" separator=",">
#{guid}
</foreach>
</delete>
</mapper>
<?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="me.zhengjie.gemho.mapper.web.WebMonitorPointsMapper">
<insert id="batchinsert">
insert into web_monitor_points (chartid,type,guid,name,x,y,height,width,angle,infoseat,remark) values
<foreach collection="webMonitorPoints" item="monitorPoint" separator=",">
(#{monitorPoint.chartid},
#{monitorPoint.type},
#{monitorPoint.guid},
#{monitorPoint.name},
#{monitorPoint.x},
#{monitorPoint.y},
#{monitorPoint.height},
#{monitorPoint.width},
#{monitorPoint.angle},
#{monitorPoint.infoseat},
#{monitorPoint.remark}
)
</foreach>
</insert>
<delete id="deletepoints" parameterType="string">
DELETE
a.*,b.* from web_monitor_points a left JOIN web_monitor_link b on a.guid = b.pointid where a.guid=
#{guid}
</delete>
</mapper>
......@@ -107,14 +107,13 @@
</template>
<script>
import crud${className} from '@/api/${changeClassName}'
import CRUD, { presenter, header, form, crud } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import crudOperation from '@crud/CRUD.operation'
import udOperation from '@crud/UD.operation'
import pagination from '@crud/Pagination'
import CRUD, {crud, form, header, presenter} from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import crudOperation from '@crud/CRUD.operation'
import udOperation from '@crud/UD.operation'
import pagination from '@crud/Pagination'
const defaultForm = { <#if columns??><#list columns as column>${column.changeColumnName}: null<#if column_has_next>, </#if></#list></#if> }
const defaultForm = { <#if columns??><#list columns as column>${column.changeColumnName}: null<#if column_has_next>, </#if></#list></#if> }
export default {
name: '${className}',
components: { pagination, crudOperation, rrOperation, udOperation },
......
package ${package.Controller};
import ${package.Entity}.${entity};
import ${package.Service}.${table.serviceName};
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import me.zhengjie.gemho.util.PageResult;
import me.zhengjie.gemho.util.PostOrPutResult;
import org.springframework.http.HttpStatus;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
<#if restControllerStyle>
<#else>
import org.springframework.stereotype.Controller;
</#if>
<#if superControllerClassPackage??>
import ${superControllerClassPackage};
</#if>
import java.util.HashMap;
import javax.validation.Valid;
import java.util.List;
/**
* <p>
* ${table.comment} 前端控制器
* </p>
*
* @author ${author}
* @since ${date}
*/
@Api(tags = "${table.comment}")
<#if restControllerStyle>
@RestController
<#else>
@Controller
</#if>
@RequestMapping("<#if package.ModuleName??>/${package.ModuleName}</#if>/<#if controllerMappingHyphenStyle??>${controllerMappingHyphen}<#else>${table.entityPath}</#if>")
<#if kotlin>
class ${table.controllerName}<#if superControllerClass??> : ${superControllerClass}()</#if>
<#else>
<#if superControllerClass??>
public class ${table.controllerName} extends ${superControllerClass} {
<#else>
public class ${table.controllerName} {
</#if>
@Autowired
private ${table.serviceName} ${table.serviceName?uncap_first};
@ApiOperation(value = "${table.comment}分页列表", response = ${entity}.class)
@GetMapping(value = "/page")
public ResponseEntity<Object> list(@ApiParam(value = "分页参数,页数") String page,
@ApiParam(value = "分页参数,数量") String size,
@ApiParam(value = "查询条件字段") String searchName,
@ApiParam(value = "查询条件数值") String searchValue,
@ApiParam(value = "查询条件精准或者模糊") String limit,
@ApiParam(value = "查询条件时间区间") String timeSpace,
@ApiParam(value = "查询条件正序或者倒序") String sort) {
HashMap<String, Object> data = ${table.serviceName?uncap_first}.list(searchName, searchValue, limit, timeSpace, sort, page, size);
return new ResponseEntity<>(new PageResult().success(data), HttpStatus.OK);
}
@ApiOperation(value = "${table.comment}新增")
@PostMapping()
public Object add(@Valid @RequestBody ${entity} param) {
boolean result = ${table.serviceName?uncap_first}.add(param);
if (result) {
return new ResponseEntity<>(new PostOrPutResult().success(), HttpStatus.OK);
} else {
return new ResponseEntity<>(new PostOrPutResult().failed(), HttpStatus.INTERNAL_SERVER_ERROR);
}
}
@ApiOperation(value = "${table.comment}修改")
@PutMapping()
public Object modify(@Valid @RequestBody ${entity} param) {
boolean result = ${table.serviceName?uncap_first}.modify(param);
if (result) {
return new ResponseEntity<>(new PostOrPutResult().success(), HttpStatus.OK);
} else {
return new ResponseEntity<>(new PostOrPutResult().failed(), HttpStatus.INTERNAL_SERVER_ERROR);
}
}
@ApiOperation(value = "${table.comment}删除(单个条目)")
@DeleteMapping()
public Object remove(@RequestBody HashMap<String, Object> map) {
Integer id = Integer.valueOf(map.get("id").toString());
boolean result = ${table.serviceName?uncap_first}.removeById(id);
if (result) {
return new ResponseEntity<>(new PostOrPutResult().success(), HttpStatus.OK);
} else {
return new ResponseEntity<>(new PostOrPutResult().failed(), HttpStatus.INTERNAL_SERVER_ERROR);
}
}
}
</#if>
package ${package.Service};
import ${package.Entity}.${entity};
import ${superServiceClassPackage};
import java.util.HashMap;
import com.baomidou.mybatisplus.core.metadata.IPage;
import java.util.List;
/**
* <p>
* ${table.comment!} 服务类
* </p>
*
* @author ${author}
* @since ${date}
*/
<#if kotlin>
interface ${table.serviceName} : ${superServiceClass}<${entity}>
<#else>
public interface ${table.serviceName} extends ${superServiceClass}<${entity}> {
/**
* ${table.comment!}分页列表
* @param searchName
* @param searchValue
* @param limit
* @param timeSpace
* @param sort
* @param page
* @param size
* @return
*/
HashMap<String, Object> list(String searchName, String searchValue, String limit, String timeSpace, String sort,String page,String size);
/**
* ${table.comment!}新增
* @param param 根据需要进行传值
* @return
*/
boolean add(${entity} param);
/**
* ${table.comment!}修改
* @param param 根据需要进行传值
* @return
*/
boolean modify(${entity} param);
}
</#if>
package ${package.ServiceImpl};
import ${package.Entity}.${entity};
import ${package.Mapper}.${table.mapperName};
import ${package.Service}.${table.serviceName};
import ${superServiceImplClassPackage};
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import me.zhengjie.gemho.util.ServiceUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.List;
/**
* <p>
* ${table.comment!} 服务实现类
* </p>
*
* @author ${author}
* @since ${date}
*/
@Service
<#if kotlin>
open class ${table.serviceImplName} : ${superServiceImplClass}<${table.mapperName}, ${entity}>(), ${table.serviceName} {
}
<#else>
public class ${table.serviceImplName} extends ${superServiceImplClass}<${table.mapperName}, ${entity}> implements ${table.serviceName} {
@Autowired
private ${table.mapperName} ${table.mapperName?uncap_first};
/**
* ${table.comment!}分页列表
* @param searchName
* @param searchValue
* @param limit
* @param timeSpace
* @param sort
* @param page
* @param size
* @return
*/
@Override
public HashMap<String, Object> list(String searchName, String searchValue, String limit, String timeSpace, String sort,String page,String size) {
long l1 = Long.parseLong(page) + 1;
long l2 = Long.parseLong(size);
Page<${entity}> ${entity}Page = new Page<>(l1, l2);
QueryWrapper<${entity}> queryWrapper = new QueryWrapper<>();
ServiceUtil.query(queryWrapper, searchName, searchValue, limit, timeSpace, sort);
${entity}Page=${table.mapperName?uncap_first}.selectPage(${entity}Page, queryWrapper);
List<${entity}> records = ${entity}Page.getRecords();
long total = ${entity}Page.getTotal();
HashMap<String, Object> map = new HashMap<>();
map.put("list", records);
map.put("total", total);
return map;
}
/**
* ${table.comment!}新增
* @param param 根据需要进行传值
* @return
*/
@Override
public boolean add(${entity} param) {
int result =${table.mapperName?uncap_first}.insert(param);
if(result>0){
return true;
}
return false;
}
/**
* ${table.comment!}修改
* @param param 根据需要进行传值
* @return
*/
@Override
public boolean modify(${entity} param) {
QueryWrapper<${entity}> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("id",param.getId());
int result = ${table.mapperName?uncap_first}.update(param,queryWrapper);
if(result>0){
return true;
}
return false;
}}
</#if>
......@@ -18,6 +18,7 @@ package me.zhengjie.config;
import org.springframework.boot.web.servlet.MultipartConfigFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import javax.servlet.MultipartConfigElement;
import java.io.File;
......
......@@ -17,7 +17,11 @@ package me.zhengjie.domain;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.persistence.*;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
......
......@@ -17,7 +17,11 @@ package me.zhengjie.domain;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.persistence.*;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
......
......@@ -15,11 +15,14 @@
*/
package me.zhengjie.domain;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import me.zhengjie.base.BaseEntity;
import javax.persistence.*;
import java.io.Serializable;
......
......@@ -17,7 +17,11 @@ package me.zhengjie.domain;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.persistence.*;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
......
......@@ -18,6 +18,7 @@ package me.zhengjie.domain;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.annotations.UpdateTimestamp;
import javax.persistence.*;
import java.io.Serializable;
import java.sql.Timestamp;
......
......@@ -18,6 +18,7 @@ package me.zhengjie.domain.vo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import java.util.List;
......
......@@ -17,6 +17,7 @@ package me.zhengjie.domain.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.sql.Date;
import java.sql.Timestamp;
......
......@@ -22,11 +22,11 @@ import lombok.extern.slf4j.Slf4j;
import me.zhengjie.annotation.AnonymousAccess;
import me.zhengjie.annotation.Log;
import me.zhengjie.annotation.rest.AnonymousGetMapping;
import me.zhengjie.domain.vo.TradeVo;
import me.zhengjie.domain.AlipayConfig;
import me.zhengjie.domain.vo.TradeVo;
import me.zhengjie.service.AliPayService;
import me.zhengjie.utils.AliPayStatusEnum;
import me.zhengjie.utils.AlipayUtils;
import me.zhengjie.service.AliPayService;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
......
......@@ -19,8 +19,8 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import me.zhengjie.annotation.Log;
import me.zhengjie.domain.vo.EmailVo;
import me.zhengjie.domain.EmailConfig;
import me.zhengjie.domain.vo.EmailVo;
import me.zhengjie.service.EmailService;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
......
......@@ -15,6 +15,8 @@
*/
package me.zhengjie.rest;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import me.zhengjie.annotation.Log;
import me.zhengjie.domain.LocalStorage;
......@@ -28,8 +30,8 @@ import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import io.swagger.annotations.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
......
......@@ -22,14 +22,15 @@ import lombok.extern.slf4j.Slf4j;
import me.zhengjie.annotation.Log;
import me.zhengjie.domain.QiniuConfig;
import me.zhengjie.domain.QiniuContent;
import me.zhengjie.service.dto.QiniuQueryCriteria;
import me.zhengjie.service.QiNiuService;
import me.zhengjie.service.dto.QiniuQueryCriteria;
import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.HashMap;
......
......@@ -15,8 +15,8 @@
*/
package me.zhengjie.service;
import me.zhengjie.domain.vo.TradeVo;
import me.zhengjie.domain.AlipayConfig;
import me.zhengjie.domain.vo.TradeVo;
/**
* @author Zheng Jie
......
......@@ -15,8 +15,8 @@
*/
package me.zhengjie.service;
import me.zhengjie.domain.vo.EmailVo;
import me.zhengjie.domain.EmailConfig;
import me.zhengjie.domain.vo.EmailVo;
/**
* @author Zheng Jie
......
......@@ -20,6 +20,7 @@ import me.zhengjie.service.dto.LocalStorageDto;
import me.zhengjie.service.dto.LocalStorageQueryCriteria;
import org.springframework.data.domain.Pageable;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
......
......@@ -18,6 +18,7 @@ package me.zhengjie.service.dto;
import lombok.Getter;
import lombok.Setter;
import me.zhengjie.base.BaseDTO;
import java.io.Serializable;
/**
......
......@@ -16,11 +16,11 @@
package me.zhengjie.service.dto;
import lombok.Data;
import me.zhengjie.annotation.Query;
import java.sql.Timestamp;
import java.util.List;
import me.zhengjie.annotation.Query;
/**
* @author Zheng Jie
* @date 2019-09-05
......
......@@ -17,6 +17,7 @@ package me.zhengjie.service.dto;
import lombok.Data;
import me.zhengjie.annotation.Query;
import java.sql.Timestamp;
import java.util.List;
......
......@@ -20,8 +20,8 @@ import com.alipay.api.DefaultAlipayClient;
import com.alipay.api.request.AlipayTradePagePayRequest;
import com.alipay.api.request.AlipayTradeWapPayRequest;
import lombok.RequiredArgsConstructor;
import me.zhengjie.domain.vo.TradeVo;
import me.zhengjie.domain.AlipayConfig;
import me.zhengjie.domain.vo.TradeVo;
import me.zhengjie.exception.BadRequestException;
import me.zhengjie.repository.AliPayRepository;
import me.zhengjie.service.AliPayService;
......@@ -30,6 +30,7 @@ import org.springframework.cache.annotation.CachePut;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Optional;
/**
......
......@@ -29,6 +29,7 @@ import org.springframework.cache.annotation.CachePut;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Optional;
/**
......
......@@ -19,25 +19,26 @@ import cn.hutool.core.util.ObjectUtil;
import lombok.RequiredArgsConstructor;
import me.zhengjie.config.FileProperties;
import me.zhengjie.domain.LocalStorage;
import me.zhengjie.exception.BadRequestException;
import me.zhengjie.repository.LocalStorageRepository;
import me.zhengjie.service.LocalStorageService;
import me.zhengjie.service.dto.LocalStorageDto;
import me.zhengjie.service.dto.LocalStorageQueryCriteria;
import me.zhengjie.service.mapstruct.LocalStorageMapper;
import me.zhengjie.exception.BadRequestException;
import me.zhengjie.utils.*;
import me.zhengjie.repository.LocalStorageRepository;
import me.zhengjie.service.LocalStorageService;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
/**
* @author Zheng Jie
......
......@@ -27,16 +27,12 @@ import com.qiniu.util.Auth;
import lombok.RequiredArgsConstructor;
import me.zhengjie.domain.QiniuConfig;
import me.zhengjie.domain.QiniuContent;
import me.zhengjie.repository.QiniuContentRepository;
import me.zhengjie.service.dto.QiniuQueryCriteria;
import me.zhengjie.utils.QiNiuUtil;
import me.zhengjie.exception.BadRequestException;
import me.zhengjie.repository.QiNiuConfigRepository;
import me.zhengjie.repository.QiniuContentRepository;
import me.zhengjie.service.QiNiuService;
import me.zhengjie.utils.FileUtil;
import me.zhengjie.utils.PageUtil;
import me.zhengjie.utils.QueryHelp;
import me.zhengjie.utils.ValidationUtil;
import me.zhengjie.service.dto.QiniuQueryCriteria;
import me.zhengjie.utils.*;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.CachePut;
......@@ -45,6 +41,7 @@ import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.*;
......
......@@ -16,8 +16,8 @@
package me.zhengjie.service.mapstruct;
import me.zhengjie.base.BaseMapper;
import me.zhengjie.service.dto.LocalStorageDto;
import me.zhengjie.domain.LocalStorage;
import me.zhengjie.service.dto.LocalStorageDto;
import org.mapstruct.Mapper;
import org.mapstruct.ReportingPolicy;
......
......@@ -19,6 +19,7 @@ import com.alipay.api.AlipayApiException;
import com.alipay.api.internal.util.AlipaySignature;
import me.zhengjie.domain.AlipayConfig;
import org.springframework.stereotype.Component;
import javax.servlet.http.HttpServletRequest;
import java.text.SimpleDateFormat;
import java.util.Date;
......
......@@ -16,6 +16,7 @@
package me.zhengjie.utils;
import com.qiniu.storage.Region;
import java.text.SimpleDateFormat;
import java.util.Date;
......
......@@ -15,7 +15,6 @@
<module>eladmin-system</module>
<module>eladmin-tools</module>
<module>eladmin-generator</module>
<module>eladmin-MineTRS</module>
</modules>
<name>EL-ADMIN 后台管理</name>
......
<?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="me.zhengjie.gemho.mapper.demo.MonitorChartMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="me.zhengjie.gemho.entity.demo.MonitorChart">
<id column="id" property="id" />
<result column="tailingno" property="tailingno" />
<result column="picture" property="picture" />
<result column="height" property="height" />
<result column="width" property="width" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id, tailingno, picture, height, width
</sql>
</mapper>
<?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="me.zhengjie.gemho.mapper.demo.MonitorPointsMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="me.zhengjie.gemho.entity.demo.MonitorPoints">
<id column="id" property="id" />
<result column="chartid" property="chartid" />
<result column="type" property="type" />
<result column="guid" property="guid" />
<result column="name" property="name" />
<result column="x" property="x" />
<result column="y" property="y" />
<result column="height" property="height" />
<result column="width" property="width" />
<result column="angle" property="angle" />
<result column="infoseat" property="infoseat" />
<result column="remark" property="remark" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id, chartid, `type`, guid, `name`, x, y, height, width, angle, infoseat, remark
</sql>
</mapper>
<?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="me.zhengjie.jinghe.mapper.demo.WebMonitorChartMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="me.zhengjie.jinghe.entity.demo.WebMonitorChart">
<id column="id" property="id" />
<result column="tailingno" property="tailingno" />
<result column="picture" property="picture" />
<result column="height" property="height" />
<result column="width" property="width" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id, tailingno, picture, height, width
</sql>
</mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment