Commit d1bb47fc by 龙明普

[null-null]①更新最新的现场的配置文件 ②去除无效的引用

parent 86fe6265
...@@ -2,7 +2,6 @@ package com.jln.common.RedisUtil; ...@@ -2,7 +2,6 @@ package com.jln.common.RedisUtil;
import com.fasterxml.jackson.annotation.JsonAutoDetect; import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.PropertyAccessor; import com.fasterxml.jackson.annotation.PropertyAccessor;
import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.MapperFeature; import com.fasterxml.jackson.databind.MapperFeature;
......
...@@ -12,7 +12,6 @@ import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateSerializer; ...@@ -12,7 +12,6 @@ import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateSerializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer; import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalTimeSerializer; import com.fasterxml.jackson.datatype.jsr310.ser.LocalTimeSerializer;
import com.jln.common.constant.LocalDateTimeConst; import com.jln.common.constant.LocalDateTimeConst;
import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.core.convert.converter.Converter; import org.springframework.core.convert.converter.Converter;
......
...@@ -13,7 +13,6 @@ import javax.annotation.PostConstruct; ...@@ -13,7 +13,6 @@ import javax.annotation.PostConstruct;
import java.time.LocalDate; import java.time.LocalDate;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.LocalTime; import java.time.LocalTime;
import java.util.List;
/** /**
* @author 86180 * @author 86180
......
package com.jln.common.config; package com.jln.common.config;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.converter.HttpMessageConverter; import org.springframework.http.converter.HttpMessageConverter;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport; import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
......
package com.jln.common.entity; package com.jln.common.entity;
import com.jln.common.enums.ResultCodeEnum; import com.jln.common.enums.ResultCodeEnum;
import com.jln.common.utils.JsonUtils;
/** /**
* @author 86180 * @author 86180
......
...@@ -4,7 +4,6 @@ import com.jln.system.web.action.sm.sm1001.entity.SysRole; ...@@ -4,7 +4,6 @@ import com.jln.system.web.action.sm.sm1001.entity.SysRole;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.io.Serializable;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.List; import java.util.List;
......
package com.jln.common.enums; package com.jln.common.enums;
import com.baomidou.mybatisplus.core.enums.IEnum;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
......
...@@ -5,29 +5,14 @@ import com.jln.common.enums.ResultCodeEnum; ...@@ -5,29 +5,14 @@ import com.jln.common.enums.ResultCodeEnum;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.http.converter.HttpMessageNotReadableException;
import org.springframework.validation.BindException;
import org.springframework.validation.ObjectError; import org.springframework.validation.ObjectError;
import org.springframework.web.HttpMediaTypeNotSupportedException;
import org.springframework.web.HttpRequestMethodNotSupportedException;
import org.springframework.web.bind.MethodArgumentNotValidException; import org.springframework.web.bind.MethodArgumentNotValidException;
import org.springframework.web.bind.MissingServletRequestParameterException;
import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestControllerAdvice; import org.springframework.web.bind.annotation.RestControllerAdvice;
import org.springframework.web.multipart.support.MissingServletRequestPartException;
import org.springframework.web.servlet.NoHandlerFoundException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.validation.ConstraintViolation;
import javax.validation.ConstraintViolationException;
import javax.validation.ValidationException;
import java.sql.SQLException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Set;
@RestControllerAdvice(basePackages = "com.jln.system.web.action.sybg.controller") @RestControllerAdvice(basePackages = "com.jln.system.web.action.sybg.controller")
......
...@@ -8,7 +8,6 @@ import com.jln.common.utils.StringUtils; ...@@ -8,7 +8,6 @@ import com.jln.common.utils.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import org.springframework.validation.ObjectError; import org.springframework.validation.ObjectError;
import org.springframework.web.bind.MethodArgumentNotValidException; import org.springframework.web.bind.MethodArgumentNotValidException;
import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.bind.annotation.ExceptionHandler;
......
package com.jln.common.interceptor; package com.jln.common.interceptor;
import com.jln.common.RedisUtil.RedisUtil;
import com.jln.common.annotation.LoginUser; import com.jln.common.annotation.LoginUser;
import com.jln.common.entity.User; import com.jln.common.entity.User;
import com.jln.common.utils.JwtUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.MethodParameter; import org.springframework.core.MethodParameter;
import org.springframework.web.bind.support.WebDataBinderFactory; import org.springframework.web.bind.support.WebDataBinderFactory;
import org.springframework.web.context.request.NativeWebRequest; import org.springframework.web.context.request.NativeWebRequest;
...@@ -14,12 +11,6 @@ import org.springframework.web.method.support.ModelAndViewContainer; ...@@ -14,12 +11,6 @@ import org.springframework.web.method.support.ModelAndViewContainer;
//@Component //@Component
public class LoginUserHandlerMethodArgumentResolver implements HandlerMethodArgumentResolver { public class LoginUserHandlerMethodArgumentResolver implements HandlerMethodArgumentResolver {
@Autowired
private RedisUtil redisUtil;
@Autowired
private JwtUtils jwtUtils;
@Override @Override
public boolean supportsParameter(MethodParameter parameter) { public boolean supportsParameter(MethodParameter parameter) {
// TODO Auto-generated method stub // TODO Auto-generated method stub
...@@ -29,34 +20,6 @@ public class LoginUserHandlerMethodArgumentResolver implements HandlerMethodArgu ...@@ -29,34 +20,6 @@ public class LoginUserHandlerMethodArgumentResolver implements HandlerMethodArgu
@Override @Override
public Object resolveArgument(MethodParameter parameter, ModelAndViewContainer mavContainer, public Object resolveArgument(MethodParameter parameter, ModelAndViewContainer mavContainer,
NativeWebRequest webRequest, WebDataBinderFactory binderFactory) throws Exception { NativeWebRequest webRequest, WebDataBinderFactory binderFactory) throws Exception {
// TODO Auto-generated method stub
/*Object sysUseroid = webRequest.getHeader("api_key");
*//**1. 判断用户信息是否存在,不存在则将远程用户数据更新到本地
* 2. 判断远程用户信息是否更改,更改则将远程用户信息更新到本地(先不做考虑)
* *//*
if(sysUseroid == null){
throw new CustomException(-1,"用户信息不存在");
}
Claims claimByToken = jwtUtils.getClaimByToken(sysUseroid.toString());
if(claimByToken == null || jwtUtils.isTokenExpired(claimByToken.getExpiration())){
throw new CustomException(ResultCodeEnum.Expire_TOKEN);
}
String subject = claimByToken.getSubject();
*//**1. 判断用户信息是否存在,不存在则将远程用户数据更新到本地
* 2. 判断远程用户信息是否更改,更改则将远程用户信息更新到本地(先不做考虑)
* *//*
Object o = redisUtil.get(TokenCacheConst.TOKEN_USER_INFO + "::" + subject);
if(EmptyUtil.isEmpty(o)){
return createDeflt();
}
User user = new User();
user.setEmployeeOid( Long.valueOf(subject));
UserInfo userInfo = JacksonUtil.toBean(JacksonUtil.toString(o), UserInfo.class);
BeanUtils.copyProperties(userInfo,user);
//重新生成用户数据
user.setEmployeeName(userInfo.getEmployeeName());
user.setSysRoles(userInfo.getSysRoles());
return user;*/
return null; return null;
} }
......
package com.jln.common.request; package com.jln.common.request;
import com.jln.common.utils.HttpHelper; import com.jln.common.utils.HttpHelper;
import javax.servlet.ReadListener;
import javax.servlet.ServletInputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequestWrapper;
import java.io.BufferedReader; import java.io.BufferedReader;
import java.io.ByteArrayInputStream; import java.io.ByteArrayInputStream;
import java.io.IOException; import java.io.IOException;
import java.io.InputStreamReader; import java.io.InputStreamReader;
import java.nio.charset.Charset; import java.nio.charset.Charset;
import javax.servlet.ReadListener;
import javax.servlet.ServletInputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequestWrapper;
public class RequestReaderHttpServletRequestWrapper extends HttpServletRequestWrapper{ public class RequestReaderHttpServletRequestWrapper extends HttpServletRequestWrapper{
private final byte[] body; private final byte[] body;
......
package com.jln.common.utils; package com.jln.common.utils;
import java.lang.reflect.Type;
/** /**
* @ClassName: 判断当前对象是否是指定类型 * @ClassName: 判断当前对象是否是指定类型
* @Description: * @Description:
......
package com.jln.common.utils; package com.jln.common.utils;
import com.alibaba.fastjson.JSONObject;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.io.BufferedReader; import java.io.BufferedReader;
import java.io.IOException; import java.io.IOException;
......
package com.jln.common.utils; package com.jln.common.utils;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource; import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
......
package com.jln.common.utils;
/**
* @ClassName: 雪花算法生成ID
* @Description:
* @Author:三刀 Date:2020/9/15 15:05
* Version:1.0
**/
public class SnowflakeIdUtils {
public static Long generate(){
String classname = new Exception().getStackTrace()[1].getClassName();
//SnowflakeIdWorker worker = new SnowflakeIdWorker(12, 230L);
return UniqueIdGenerator.getInstance().genUniqueId(classname);
}
}
package com.jln.common.utils; package com.jln.common.utils;
import org.springframework.util.Assert; import org.springframework.util.Assert;
import java.io.*; import java.io.*;
/** /**
......
package com.jln.common.utils; package com.jln.common.utils;
import com.jln.common.utils.Tree;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
......
package com.jln.common.utils;
import com.jln.common.RedisUtil.RedisUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
/**
* <p>
*
* </p>
*
* @author 龙明普
* @version 1.0
* @date 2020/9/6 13:04
*/
@Component
public class UniqueIdGenerator {
@Autowired
private RedisUtil redisUtil;
private static UniqueIdGenerator instance;
//当前节点的唯一标识
//private static String uuid;
//redis号段的key
private static String redisKey = "UniqueIdGenerator:";
//起始号段
private long sectionStart = -1;
//最大编号
private int sectionNum = 1000;
//当前编号
private int usedNum = -1;
private UniqueIdGenerator() {
}
@PostConstruct
public void init() {
instance = this;
instance.redisUtil = this.redisUtil;
}
public static synchronized UniqueIdGenerator getInstance() {
if (instance == null) {
instance = new UniqueIdGenerator();
//uuid = UUIDHexGenerator.generate();
}
return instance;
}
/**
* 获取唯一id
* @param redisUtil redis实例,因为无法在工具类里面引用,需要在外面传参
* @param name redis key的名称,用于支持不同表的id生成
* @return
*/
public long genUniqueId(String name) {
synchronized(UniqueIdGenerator.class){
if (usedNum == -1 || usedNum >= sectionNum) {
//从redis获取号码段的起始值和号码段的长度, 此数据需要redis存起来,保证不能丢失
if(EmptyUtil.isEmpty(redisUtil.get(redisKey+name))){
//redis没有初始化过号段,开始初始化(此步骤需要走数据库获取数据)
redisUtil.set(redisKey+name,0);
}
//每次取1000号段
sectionStart = redisUtil.incr(redisKey+name,sectionNum);
usedNum = 0;
}
return sectionStart + usedNum++;
}
}
}
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<?import java.lang.*?> <?import javafx.scene.layout.AnchorPane?>
<?import java.util.*?>
<?import javafx.scene.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<AnchorPane xmlns="http://javafx.com/javafx" <AnchorPane xmlns="http://javafx.com/javafx"
xmlns:fx="http://javafx.com/fxml" xmlns:fx="http://javafx.com/fxml"
fx:controller="$CONTROLLER_NAME$" fx:controller="$CONTROLLER_NAME$"
......
...@@ -2,7 +2,6 @@ package com.jln.system.web.action.mqtt; ...@@ -2,7 +2,6 @@ package com.jln.system.web.action.mqtt;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.jln.common.utils.EmptyUtil; import com.jln.common.utils.EmptyUtil;
import com.jln.system.web.action.mqtt.pojo.dto.JsonDataDto; import com.jln.system.web.action.mqtt.pojo.dto.JsonDataDto;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
...@@ -12,6 +11,7 @@ import org.springframework.data.domain.Sort; ...@@ -12,6 +11,7 @@ import org.springframework.data.domain.Sort;
import org.springframework.data.mongodb.core.MongoTemplate; import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.data.mongodb.core.query.Query; import org.springframework.data.mongodb.core.query.Query;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.time.LocalDate; import java.time.LocalDate;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.util.*; import java.util.*;
......
...@@ -2,42 +2,33 @@ package com.jln.system.web.action.mqtt; ...@@ -2,42 +2,33 @@ package com.jln.system.web.action.mqtt;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.serializer.SerializerFeature; import com.alibaba.fastjson.serializer.SerializerFeature;
import com.jln.system.web.action.mqtt.pojo.dto.*; import com.jln.system.web.action.mqtt.pojo.dto.JsonDataDto;
import com.jln.system.web.action.mqtt.pojo.vo.StaticData; import com.jln.system.web.action.mqtt.pojo.vo.StaticData;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.PropertySource; import org.springframework.context.annotation.PropertySource;
import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.ClassPathResource;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.io.*; import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.*; import java.util.*;
@Service @Service
@PropertySource("classpath:application.properties") @PropertySource("classpath:application.properties")
public class MqttStartClient { public class MqttStartClient {
@Value("${carcertPath}")
private String carcertPath;
@Value("${sleepTime}")
private Long sleepTime;
@Value("${redis.separate}") @Value("${redis.separate}")
private Integer separate; private Integer separate;
@Value("${public.flag}") @Value("${public.flag}")
private Boolean flag; private Boolean flag;
@Value("${commonSk}")
private String commonSk;
@Autowired @Autowired
private Base64decrypt base64decrypt; private Base64decrypt base64decrypt;
private static Logger logger = LoggerFactory.getLogger(MqttStartClient.class);
/** /**
* 解析sk文件并且放入map集合中固定的 * 解析sk文件并且放入map集合中固定的
* *
...@@ -58,11 +49,11 @@ public class MqttStartClient { ...@@ -58,11 +49,11 @@ public class MqttStartClient {
*/ */
public String readSkFileToList(String skFileUrl) { public String readSkFileToList(String skFileUrl) {
List<String> filelist = new ArrayList(); List<String> filelist = new ArrayList();
// if (flag) { //true读取jar包同级的路径 // if (flag) { //true读取jar包同级的路径
// filelist = readJarSkFile(skFileUrl); // filelist = readJarSkFile(skFileUrl);
// } else { //false读取resources下的路径 // } else { //false读取resources下的路径
filelist = readResourcesSkFile(skFileUrl); filelist = readResourcesSkFile(skFileUrl);
// } // }
String info = ""; String info = "";
if (filelist.isEmpty()) { if (filelist.isEmpty()) {
...@@ -145,15 +136,15 @@ public class MqttStartClient { ...@@ -145,15 +136,15 @@ public class MqttStartClient {
/** /**
* 机器人测试 * 机器人测试
*/ */
public void jqr( JsonDataDto jsonDataDto, XBMqttDataUtil xbMqttDataUtil) { public void jqr(JsonDataDto jsonDataDto, XBMqttDataUtil xbMqttDataUtil) {
try { try {
long millis = System.currentTimeMillis() / 1000; long millis = System.currentTimeMillis() / 1000;
//解析sk证书信息 //解析sk证书信息
Integer version= resolveSk(jsonDataDto.getSkurl()); Integer version = resolveSk(jsonDataDto.getSkurl());
//reportDto.put("productKey", "PaintRobot"); //reportDto.put("productKey", "PaintRobot");
//解析设备txt文本获取静态属性值 //解析设备txt文本获取静态属性值
Map<String ,Object> reportDto = new LinkedHashMap<>(); Map<String, Object> reportDto = new LinkedHashMap<>();
Map<String, Object> fileSitesMap = readTxtFileToMap(jsonDataDto.getTxtFileUrl()); Map<String, Object> fileSitesMap = readTxtFileToMap(jsonDataDto.getTxtFileUrl());
Map<String, Object> sites = new HashMap<>(); Map<String, Object> sites = new HashMap<>();
if (!fileSitesMap.isEmpty()) { if (!fileSitesMap.isEmpty()) {
...@@ -164,28 +155,28 @@ public class MqttStartClient { ...@@ -164,28 +155,28 @@ public class MqttStartClient {
reportDto.put("productKey", jsonDataDto.getProductKey()); //必填,表示设备类型,设备类型在IoT平台上维护 reportDto.put("productKey", jsonDataDto.getProductKey()); //必填,表示设备类型,设备类型在IoT平台上维护
reportDto.put("clientUuid", jsonDataDto.getClientUuid()); //TODO 上报到客户那边数据中必要的参数值 reportDto.put("clientUuid", jsonDataDto.getClientUuid()); //TODO 上报到客户那边数据中必要的参数值
sites.put("DeviceID",fileSitesMap.get("设备ID")); sites.put("DeviceID", fileSitesMap.get("设备ID"));
sites.put("CompanyNo",fileSitesMap.get("公司编码")); sites.put("CompanyNo", fileSitesMap.get("公司编码"));
sites.put("factoryNo",fileSitesMap.get("工厂编码")); sites.put("factoryNo", fileSitesMap.get("工厂编码"));
//sites.put("AssetNo",""); //sites.put("AssetNo","");
sites.put("DeviceName",fileSitesMap.get("设备名称")); sites.put("DeviceName", fileSitesMap.get("设备名称"));
sites.put("DeviceType",fileSitesMap.get("设备类型")); sites.put("DeviceType", fileSitesMap.get("设备类型"));
//sites.put("CncType",""); //sites.put("CncType","");
} }
//1 redis和mqtt分开 //1 redis和mqtt分开
if (separate == 1) { if (separate == 1) {
//TODO 同时MQTT上报和推送前端数据 //TODO 同时MQTT上报和推送前端数据
Map<String, Object> objectMap = base64decrypt.jqrSendString( jsonDataDto,sites, millis ,reportDto); Map<String, Object> objectMap = base64decrypt.jqrSendString(jsonDataDto, sites, millis, reportDto);
String str = JSONObject.toJSONString(objectMap, SerializerFeature.WriteMapNullValue); String str = JSONObject.toJSONString(objectMap, SerializerFeature.WriteMapNullValue);
System.out.println("IOT上报数据:"+str); System.out.println("IOT上报数据:" + str);
xbMqttDataUtil.publish( str); xbMqttDataUtil.publish(str);
} else if (separate == 2) { } else if (separate == 2) {
// TODO 只推送前端数据 // TODO 只推送前端数据
Map<String, Object> objectMap = base64decrypt.jqrSendString( jsonDataDto,sites,millis,reportDto); Map<String, Object> objectMap = base64decrypt.jqrSendString(jsonDataDto, sites, millis, reportDto);
StaticData.data.put(jsonDataDto.getMongdbTableb(),objectMap); StaticData.data.put(jsonDataDto.getMongdbTableb(), objectMap);
} else if (separate == 3) { } else if (separate == 3) {
//TODO 只发送mqtt //TODO 只发送mqtt
Map<String, Object> objectMap = base64decrypt.jqrSendString( jsonDataDto,sites,millis,reportDto); Map<String, Object> objectMap = base64decrypt.jqrSendString(jsonDataDto, sites, millis, reportDto);
String str = JSONObject.toJSONString(objectMap, SerializerFeature.WriteMapNullValue); String str = JSONObject.toJSONString(objectMap, SerializerFeature.WriteMapNullValue);
xbMqttDataUtil.publish(str); xbMqttDataUtil.publish(str);
} }
......
...@@ -2,12 +2,14 @@ package com.jln.system.web.action.mqtt; ...@@ -2,12 +2,14 @@ package com.jln.system.web.action.mqtt;
import com.jln.common.enums.MqttEnum; import com.jln.common.enums.MqttEnum;
import com.jln.system.web.action.mqtt.mqttService.SSL; import com.jln.system.web.action.mqtt.mqttService.SSL;
import org.eclipse.paho.client.mqttv3.*; import org.eclipse.paho.client.mqttv3.MqttClient;
import org.eclipse.paho.client.mqttv3.MqttConnectOptions;
import org.eclipse.paho.client.mqttv3.MqttException;
import org.eclipse.paho.client.mqttv3.MqttMessage;
import org.eclipse.paho.client.mqttv3.persist.MemoryPersistence; import org.eclipse.paho.client.mqttv3.persist.MemoryPersistence;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import java.io.File;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.io.InputStream; import java.io.InputStream;
import java.util.Map; import java.util.Map;
......
...@@ -12,6 +12,7 @@ import io.swagger.annotations.ApiOperation; ...@@ -12,6 +12,7 @@ import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import java.io.IOException; import java.io.IOException;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
......
...@@ -6,9 +6,10 @@ import com.baomidou.mybatisplus.annotation.TableId; ...@@ -6,9 +6,10 @@ import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
import lombok.Data;
@ApiModel(value="EoStatistics") @ApiModel(value="EoStatistics")
@Data @Data
......
package com.jln.system.web.action.mqtt.server; package com.jln.system.web.action.mqtt.server;
import com.jln.system.web.action.mqtt.pojo.entity.EoStatistics;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.jln.system.web.action.mqtt.pojo.entity.EoStatistics;
import java.util.Map; import java.util.Map;
......
package com.jln.system.web.action.mqtt.server.impl; package com.jln.system.web.action.mqtt.server.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.locks.ReentrantLock;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jln.system.web.action.mqtt.mappermes.EoStatisticsMapper; import com.jln.system.web.action.mqtt.mappermes.EoStatisticsMapper;
import com.jln.system.web.action.mqtt.pojo.entity.EoStatistics; import com.jln.system.web.action.mqtt.pojo.entity.EoStatistics;
import com.jln.system.web.action.mqtt.server.EoStatisticsService; import com.jln.system.web.action.mqtt.server.EoStatisticsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.locks.ReentrantLock;
@Service @Service
public class EoStatisticsServiceImpl extends ServiceImpl<EoStatisticsMapper, EoStatistics> implements EoStatisticsService{ public class EoStatisticsServiceImpl extends ServiceImpl<EoStatisticsMapper, EoStatistics> implements EoStatisticsService{
......
...@@ -12,7 +12,11 @@ import lombok.extern.slf4j.Slf4j; ...@@ -12,7 +12,11 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.io.*;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*; import java.util.*;
@Service @Service
...@@ -23,57 +27,6 @@ public class SendMqttServerImpl implements SendMqttServer { ...@@ -23,57 +27,6 @@ public class SendMqttServerImpl implements SendMqttServer {
@Autowired @Autowired
private ScadaBiMapper scadaMapper; private ScadaBiMapper scadaMapper;
@Value("${jg.btqgjTxt}")
private String btqgjTxt;
@Value("${jqr.ptjqr1}")
private String ptjqr1;
@Value("${zlhc.xgjxcTxt}")
private String xgjxcTxt;
@Value("${qtxl.blxTxt}")
private String blxTxt;
@Value("${dlz.mse52Txt}")
private String mse52Txt;
@Value("${dlz.mse53Txt}")
private String mse53Txt;
@Value("${xxj.xpjTxt}")
private String xpjTxt;
@Value("${zwj.400zwjTxt}")
private String zwj400Txt;
@Value("${zwj.800zwjTxt}")
private String zwj800Txt;
@Value("${djpk.djpk01Txt}")
private String djpk01Txt;
@Value("${djpk.djpk02Txt}")
private String djpk02Txt;
@Value("${lmx.bjTxt}")
private String lmxBjTxt;
@Value("${lmx.bjxx}")
private String bjxx;
@Value("${pmz.bjTxt}")
private String pmzBjTxt;
@Value("${commonSk}") @Value("${commonSk}")
private String commonSk; private String commonSk;
@Value("${carcertPath}") @Value("${carcertPath}")
......
...@@ -3,6 +3,7 @@ package com.jln.system.web.action.mqtt.util; ...@@ -3,6 +3,7 @@ package com.jln.system.web.action.mqtt.util;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import java.io.*; import java.io.*;
public class FlieUrlUtil { public class FlieUrlUtil {
......
package com.jln.system.web.action.sm.user.mapper; package com.jln.system.web.action.sm.user.mapper;
import com.jln.system.web.action.sm.user.entity.SysEmployee;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.jln.system.web.action.sm.user.entity.SysEmployee;
/** /**
* <p> * <p>
......
package com.jln.system.web.action.sm.user.service; package com.jln.system.web.action.sm.user.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.jln.common.entity.Result; import com.jln.common.entity.Result;
import com.jln.common.utils.PageParameter; import com.jln.common.utils.PageParameter;
import com.jln.system.web.action.sm.user.entity.SysEmployee; import com.jln.system.web.action.sm.user.entity.SysEmployee;
import com.baomidou.mybatisplus.extension.service.IService;
import com.jln.system.web.action.sm.user.pojo.vo.EmpListVo; import com.jln.system.web.action.sm.user.pojo.vo.EmpListVo;
/** /**
......
...@@ -2,6 +2,7 @@ package com.jln.system.web.action.sm.user.service.impl; ...@@ -2,6 +2,7 @@ package com.jln.system.web.action.sm.user.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jln.common.entity.Result; import com.jln.common.entity.Result;
import com.jln.common.utils.EmptyUtil; import com.jln.common.utils.EmptyUtil;
import com.jln.common.utils.PageParameter; import com.jln.common.utils.PageParameter;
...@@ -9,7 +10,6 @@ import com.jln.system.web.action.sm.user.entity.SysEmployee; ...@@ -9,7 +10,6 @@ import com.jln.system.web.action.sm.user.entity.SysEmployee;
import com.jln.system.web.action.sm.user.mapper.SysEmployeeMapper; import com.jln.system.web.action.sm.user.mapper.SysEmployeeMapper;
import com.jln.system.web.action.sm.user.pojo.vo.EmpListVo; import com.jln.system.web.action.sm.user.pojo.vo.EmpListVo;
import com.jln.system.web.action.sm.user.service.SysEmployeeService; import com.jln.system.web.action.sm.user.service.SysEmployeeService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
......
package com.jln.system.web.config; package com.jln.system.web.config;
import com.baomidou.mybatisplus.autoconfigure.MybatisPlusProperties;
import com.baomidou.mybatisplus.core.MybatisConfiguration; import com.baomidou.mybatisplus.core.MybatisConfiguration;
import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor; import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import com.baomidou.mybatisplus.extension.spring.MybatisSqlSessionFactoryBean; import com.baomidou.mybatisplus.extension.spring.MybatisSqlSessionFactoryBean;
import com.jln.system.web.interceptor.MyInterceptor;
import org.apache.ibatis.session.SqlSessionFactory; import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.SqlSessionFactoryBean;
import org.mybatis.spring.SqlSessionTemplate; import org.mybatis.spring.SqlSessionTemplate;
import org.mybatis.spring.annotation.MapperScan; import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary; import org.springframework.context.annotation.Primary;
......
...@@ -3,12 +3,10 @@ package com.jln.system.web.config; ...@@ -3,12 +3,10 @@ package com.jln.system.web.config;
import com.baomidou.mybatisplus.extension.spring.MybatisSqlSessionFactoryBean; import com.baomidou.mybatisplus.extension.spring.MybatisSqlSessionFactoryBean;
import org.apache.ibatis.session.SqlSessionFactory; import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.SqlSessionTemplate; import org.mybatis.spring.SqlSessionTemplate;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.jdbc.DataSourceBuilder; import org.springframework.boot.jdbc.DataSourceBuilder;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.io.support.PathMatchingResourcePatternResolver; import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
import org.springframework.jdbc.datasource.DataSourceTransactionManager; import org.springframework.jdbc.datasource.DataSourceTransactionManager;
......
...@@ -2,7 +2,6 @@ package com.jln.system.web.config; ...@@ -2,7 +2,6 @@ package com.jln.system.web.config;
import com.baomidou.mybatisplus.extension.plugins.OptimisticLockerInterceptor; import com.baomidou.mybatisplus.extension.plugins.OptimisticLockerInterceptor;
import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor; import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import com.baomidou.mybatisplus.extension.plugins.pagination.optimize.JsqlParserCountOptimize;
import com.jln.system.web.interceptor.MyInterceptor; import com.jln.system.web.interceptor.MyInterceptor;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
......
package com.jln.system.web.interceptor; package com.jln.system.web.interceptor;
import com.jln.common.RedisUtil.RedisUtil;
import com.jln.common.annotation.PermissionAop; import com.jln.common.annotation.PermissionAop;
import com.jln.common.entity.UserID; import com.jln.common.entity.UserID;
import com.jln.system.web.utils.Actionrule; import com.jln.system.web.utils.Actionrule;
...@@ -41,9 +40,8 @@ import java.util.Properties; ...@@ -41,9 +40,8 @@ import java.util.Properties;
args = {MappedStatement.class, Object.class, RowBounds.class, ResultHandler.class} args = {MappedStatement.class, Object.class, RowBounds.class, ResultHandler.class}
) )
) )
public class MyInterceptor implements Interceptor{ public class MyInterceptor implements Interceptor {
/** /**
*
* @param invocation { 代理对象,被监控方法对象,当前被监控方法运行时需要的实参 } * @param invocation { 代理对象,被监控方法对象,当前被监控方法运行时需要的实参 }
* @return * @return
* @throws Throwable * @throws Throwable
...@@ -51,8 +49,6 @@ public class MyInterceptor implements Interceptor{ ...@@ -51,8 +49,6 @@ public class MyInterceptor implements Interceptor{
private ApplicationContext beanFactory; private ApplicationContext beanFactory;
private RedisUtil redisUtil;
private UserID userID; private UserID userID;
Logger LOGGER = LoggerFactory.getLogger(MyInterceptor.class); Logger LOGGER = LoggerFactory.getLogger(MyInterceptor.class);
...@@ -66,16 +62,16 @@ public class MyInterceptor implements Interceptor{ ...@@ -66,16 +62,16 @@ public class MyInterceptor implements Interceptor{
//获取了sql执行所需的参数 //获取了sql执行所需的参数
Object parameterObject = args[1]; Object parameterObject = args[1];
BoundSql boundSql = statement.getBoundSql(parameterObject); BoundSql boundSql = statement.getBoundSql(parameterObject);
Class<?> classType = Class.forName(statement.getId().substring(0,statement.getId().lastIndexOf("."))); Class<?> classType = Class.forName(statement.getId().substring(0, statement.getId().lastIndexOf(".")));
PermissionAop annotation = classType.getAnnotation(PermissionAop.class); PermissionAop annotation = classType.getAnnotation(PermissionAop.class);
if (annotation != null){ if (annotation != null) {
return invocation.proceed(); return invocation.proceed();
} }
//从预编译中取出的sql //从预编译中取出的sql
String sql = boundSql.getSql(); String sql = boundSql.getSql();
String replace = processSelectSql(sql); String replace = processSelectSql(sql);
// 改变sql语句 // 改变sql语句
BoundSql newBoundSql = new BoundSql(statement.getConfiguration(),replace,boundSql.getParameterMappings(), boundSql.getParameterObject()); BoundSql newBoundSql = new BoundSql(statement.getConfiguration(), replace, boundSql.getParameterMappings(), boundSql.getParameterObject());
MappedStatement newMs = copyFromMappedStatement(statement, new BoundSqlSqlSource(newBoundSql)); MappedStatement newMs = copyFromMappedStatement(statement, new BoundSqlSqlSource(newBoundSql));
//将新的sql装入到执行器中 如果是批量查询将导致参数的重复循环 //将新的sql装入到执行器中 如果是批量查询将导致参数的重复循环
invocation.getArgs()[0] = newMs; invocation.getArgs()[0] = newMs;
...@@ -84,8 +80,8 @@ public class MyInterceptor implements Interceptor{ ...@@ -84,8 +80,8 @@ public class MyInterceptor implements Interceptor{
/** /**
* @param target 表示被拦截的对象,此处为 Executor 的实例对象 * @param target 表示被拦截的对象,此处为 Executor 的实例对象
* 作用:如果被拦截对象所在的类有实现接口,就为当前拦截对象生成一个代理对象 * 作用:如果被拦截对象所在的类有实现接口,就为当前拦截对象生成一个代理对象
* 如果被拦截对象所在的类没有指定接口,这个对象之后的行为就不会被代理操作 * 如果被拦截对象所在的类没有指定接口,这个对象之后的行为就不会被代理操作
* @return * @return
*/ */
@Override @Override
...@@ -100,12 +96,13 @@ public class MyInterceptor implements Interceptor{ ...@@ -100,12 +96,13 @@ public class MyInterceptor implements Interceptor{
/** /**
* 判断 * 判断
*
* @param sql * @param sql
* @return * @return
* @throws JSQLParserException * @throws JSQLParserException
*/ */
public String processSelectSql(String sql) throws JSQLParserException { public String processSelectSql(String sql) throws JSQLParserException {
LOGGER.info("sql语句:"+sql); LOGGER.info("sql语句:" + sql);
String replaceSql = null; String replaceSql = null;
Select select = null; Select select = null;
try { try {
...@@ -125,42 +122,42 @@ public class MyInterceptor implements Interceptor{ ...@@ -125,42 +122,42 @@ public class MyInterceptor implements Interceptor{
// 主体添加限制 // 主体添加限制
List<Actionrule> manacles = getroleactoinList(mainTable); List<Actionrule> manacles = getroleactoinList(mainTable);
List<List<Actionrule>> lists = new ArrayList<>(); List<List<Actionrule>> lists = new ArrayList<>();
if (!StringUtils.isEmpty(selectBody.getJoins())){ if (!StringUtils.isEmpty(selectBody.getJoins())) {
for(Join jointable : selectBody.getJoins()){ for (Join jointable : selectBody.getJoins()) {
String jointablename = ((Table)jointable.getRightItem()).getName(); String jointablename = ((Table) jointable.getRightItem()).getName();
if (getroleactoinList(jointablename) == null){ if (getroleactoinList(jointablename) == null) {
continue; continue;
} }
lists.add(getroleactoinList(jointablename)); lists.add(getroleactoinList(jointablename));
} }
} }
if (manacles == null && lists.size() == 0){ if (manacles == null && lists.size() == 0) {
return sql; return sql;
} }
if (manacles != null){ if (manacles != null) {
for(Actionrule actionrule :manacles) { for (Actionrule actionrule : manacles) {
condExpr = mainTable+"."+actionrule.getColumnName()+actionrule.getOperation()+" '"+actionrule.getValue()+"'"; condExpr = mainTable + "." + actionrule.getColumnName() + actionrule.getOperation() + " '" + actionrule.getValue() + "'";
if(selectBody.getWhere()==null) { if (selectBody.getWhere() == null) {
selectBody.setWhere(CCJSqlParserUtil.parseCondExpression(condExpr)); selectBody.setWhere(CCJSqlParserUtil.parseCondExpression(condExpr));
}else { } else {
AndExpression and = new AndExpression(selectBody.getWhere(), CCJSqlParserUtil.parseCondExpression(condExpr)); AndExpression and = new AndExpression(selectBody.getWhere(), CCJSqlParserUtil.parseCondExpression(condExpr));
selectBody.setWhere(and); selectBody.setWhere(and);
} }
} }
} }
if (lists.size() != 0){ if (lists.size() != 0) {
// 获取join表信息 // 获取join表信息
for(Join jointable : selectBody.getJoins()) { for (Join jointable : selectBody.getJoins()) {
String jointablename = ((Table)jointable.getRightItem()).getName(); String jointablename = ((Table) jointable.getRightItem()).getName();
List<Actionrule> actionrules = getroleactoinList(jointablename); List<Actionrule> actionrules = getroleactoinList(jointablename);
if (actionrules == null){ if (actionrules == null) {
continue; continue;
} }
for(Actionrule actionrule :actionrules) { for (Actionrule actionrule : actionrules) {
condExpr = mainTable+"."+actionrule.getColumnName()+actionrule.getOperation()+"'"+actionrule.getValue()+"'"; condExpr = mainTable + "." + actionrule.getColumnName() + actionrule.getOperation() + "'" + actionrule.getValue() + "'";
if(selectBody.getWhere()==null) { if (selectBody.getWhere() == null) {
selectBody.setWhere(CCJSqlParserUtil.parseCondExpression(condExpr)); selectBody.setWhere(CCJSqlParserUtil.parseCondExpression(condExpr));
}else { } else {
AndExpression and = new AndExpression(selectBody.getWhere(), CCJSqlParserUtil.parseCondExpression(condExpr)); AndExpression and = new AndExpression(selectBody.getWhere(), CCJSqlParserUtil.parseCondExpression(condExpr));
selectBody.setWhere(and); selectBody.setWhere(and);
} }
...@@ -178,18 +175,11 @@ public class MyInterceptor implements Interceptor{ ...@@ -178,18 +175,11 @@ public class MyInterceptor implements Interceptor{
} }
return sql; return sql;
} }
public List<Actionrule> getroleactoinList(String tablename){
StringBuffer stringBuffer = new StringBuffer(); public List<Actionrule> getroleactoinList(String tablename) {
Object sys_employee = redisUtil.get(stringBuffer.append(userID.getId()).append(":").append("sys_employee").toString()); return null;
Object o = redisUtil.get(stringBuffer.append(userID.getId()).append(":").append(tablename).toString());
Actionrule actionrule = (Actionrule) o;
List<Actionrule> actionrules = new ArrayList<>();
if (actionrule == null){
return null;
}
actionrules.add(actionrule);
return actionrules;
} }
private MappedStatement copyFromMappedStatement(MappedStatement ms, SqlSource newSqlSource) { private MappedStatement copyFromMappedStatement(MappedStatement ms, SqlSource newSqlSource) {
MappedStatement.Builder builder = new MappedStatement.Builder(ms.getConfiguration(), ms.getId(), newSqlSource, ms.getSqlCommandType()); MappedStatement.Builder builder = new MappedStatement.Builder(ms.getConfiguration(), ms.getId(), newSqlSource, ms.getSqlCommandType());
builder.resource(ms.getResource()); builder.resource(ms.getResource());
...@@ -211,9 +201,11 @@ public class MyInterceptor implements Interceptor{ ...@@ -211,9 +201,11 @@ public class MyInterceptor implements Interceptor{
public static class BoundSqlSqlSource implements SqlSource { public static class BoundSqlSqlSource implements SqlSource {
private BoundSql boundSql; private BoundSql boundSql;
public BoundSqlSqlSource(BoundSql boundSql) { public BoundSqlSqlSource(BoundSql boundSql) {
this.boundSql = boundSql; this.boundSql = boundSql;
} }
@Override @Override
public BoundSql getBoundSql(Object parameterObject) { public BoundSql getBoundSql(Object parameterObject) {
return boundSql; return boundSql;
...@@ -223,13 +215,10 @@ public class MyInterceptor implements Interceptor{ ...@@ -223,13 +215,10 @@ public class MyInterceptor implements Interceptor{
private void loadService() { private void loadService() {
if (null == beanFactory) { if (null == beanFactory) {
beanFactory = ApplicationContextHelper.getApplicationContext(); beanFactory = ApplicationContextHelper.getApplicationContext();
if(null == beanFactory){ if (null == beanFactory) {
return; return;
} }
} }
if (redisUtil == null) {
redisUtil = beanFactory.getBean(RedisUtil.class);
}
if (userID == null) { if (userID == null) {
userID = beanFactory.getBean(UserID.class); userID = beanFactory.getBean(UserID.class);
} }
......
package com.jln.system.web.utils; package com.jln.system.web.utils;
import java.util.Map;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import java.util.Map;
/** /**
* @author 86180 * @author 86180
* @version : PropertiesUtil, v 0.1 2020/1/31 10:52 * @version : PropertiesUtil, v 0.1 2020/1/31 10:52
......
...@@ -8,50 +8,21 @@ spring.datasource.mysqlmes.druid.max-active=30 ...@@ -8,50 +8,21 @@ spring.datasource.mysqlmes.druid.max-active=30
spring.datasource.mysqlmes.druid.max-wait=50000 spring.datasource.mysqlmes.druid.max-wait=50000
spring.datasource.mysql.driver-class-name=com.mysql.cj.jdbc.Driver spring.datasource.mysql.driver-class-name=com.mysql.cj.jdbc.Driver
#spring.datasource.mysql.jdbc-url=jdbc:mysql://127.0.0.1:3306/gscada?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Hongkong
spring.datasource.mysql.jdbc-url=jdbc:mysql://127.0.0.1:3306/gscada-v2?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Hongkong spring.datasource.mysql.jdbc-url=jdbc:mysql://127.0.0.1:3306/gscada-v2?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Hongkong
spring.datasource.mysql.username=root spring.datasource.mysql.username=root
#spring.datasource.mysql.password=sany666
spring.datasource.mysql.password=123456 spring.datasource.mysql.password=123456
spring.datasource.mysql.druid.initial-size=2 spring.datasource.mysql.druid.initial-size=2
spring.datasource.mysql.druid.min-idle=5 spring.datasource.mysql.druid.min-idle=5
spring.datasource.mysql.druid.max-active=30 spring.datasource.mysql.druid.max-active=30
spring.datasource.mysql.druid.max-wait=50000 spring.datasource.mysql.druid.max-wait=50000
#\uFFFD\uFFFD\uFFFD\uFFFD
project.package.name=com.jln.system.web.action
# thymeleaf
spring.thymeleaf.prefix=classpath:/templates/
spring.thymeleaf.suffix=.html
spring.thymeleaf.encoding=UTF-8
spring.thymeleaf.cache=false
#mongodb #mongodb
#spring.data.mongodb.host=121.37.133.11
spring.data.mongodb.host=127.0.0.1 spring.data.mongodb.host=127.0.0.1
spring.data.mongodb.port=27017 spring.data.mongodb.port=27017
#spring.data.mongodb.username=dev
spring.data.mongodb.username=admin spring.data.mongodb.username=admin
spring.data.mongodb.password=123456 spring.data.mongodb.password=123456
spring.data.mongodb.database=gscada spring.data.mongodb.database=gscada
#spring.data.mongodb.authentication-database=admin
#redis
spring.redis.database=10
#spring.redis.host=127.0.0.1
#spring.redis.host=192.168.1.188
spring.redis.host=39.99.231.15
#spring.redis.cluster.nodes=172.16.12.13:6380,172.16.12.13:6381,172.16.12.13:6382,172.16.12.13:6383,172.16.12.13:6384,172.16.12.13:6385
#spring.redis.host=172.16.12.13
spring.redis.port=63790
#spring.redis.password=ljj123456
spring.redis.password=123456
spring.redis.jedis.pool.max-active=8
spring.redis.jedis.pool.max-wait=8
spring.redis.jedis.pool.max-idle=8
spring.redis.jedis.pool.min-idle=0
spring.redis.timeout=800
spring.datasource.mysqlmes.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.mysqlmes.jdbc-url=jdbc:mysql://127.0.0.1:3306/gscada?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Hongkong
spring.datasource.mysqlmes.username=root
spring.datasource.mysqlmes.password=123456
spring.datasource.mysqlmes.druid.initial-size=2
spring.datasource.mysqlmes.druid.min-idle=5
spring.datasource.mysqlmes.druid.max-active=30
spring.datasource.mysqlmes.druid.max-wait=50000
spring.datasource.mysql.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.mysql.jdbc-url=jdbc:mysql://127.0.0.1:3306/gscada-v2?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Hongkong
spring.datasource.mysql.username=root
spring.datasource.mysql.password=123456
spring.datasource.mysql.druid.initial-size=2
spring.datasource.mysql.druid.min-idle=5
spring.datasource.mysql.druid.max-active=30
spring.datasource.mysql.druid.max-wait=50000
#mongodb
spring.data.mongodb.host=127.0.0.1
spring.data.mongodb.port=27017
spring.data.mongodb.database=gscada
#数据库设置
spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver
spring.datasource.url=jdbc:mysql://115.29.202.246:3306/devmes?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Hongkong
spring.datasource.username=root
spring.datasource.password=jlnsoft
#包名
project.package.name=com.jln.system.web.action
#二维码存放路径
imgUrL=/file/imges/QR
# thymeleaf
spring.thymeleaf.prefix=classpath:/templates/
spring.thymeleaf.suffix=.html
spring.thymeleaf.encoding=UTF-8
spring.thymeleaf.cache=false
Qr.URL=http://115.29.202.246
spring.redis.database=0
spring.redis.host=39.99.231.15
#spring.redis.cluster.nodes=172.16.12.13:6380,172.16.12.13:6381,172.16.12.13:6382,172.16.12.13:6383,172.16.12.13:6384,172.16.12.13:6385
#spring.redis.host=172.16.12.13
spring.redis.port=63790
spring.redis.password=123456
spring.redis.jedis.pool.max-active=8
spring.redis.jedis.pool.max-wait=8
spring.redis.jedis.pool.max-idle=8
spring.redis.jedis.pool.min-idle=0
spring.redis.timeout=800
\ No newline at end of file
...@@ -16,46 +16,6 @@ userName=uid ...@@ -16,46 +16,6 @@ userName=uid
passWord=pwd passWord=pwd
carcertPath=\\cacert\\cacert.cer carcertPath=\\cacert\\cacert.cer
jg.btqgjTxt=\\cacert\\jgqgj.txt
jg.btqgjSk=\\cacert\\jgqgj.sk
qtxl.blxTxt=\\cacert\\blx.txt
qtxl.blxSk=\\cacert\\blx.sk
zlhc.xgjxcTxt=\\cacert\\xgjxc.txt
zlhc.xgjxcSk=\\cacert\\xgjxc.sk
dlz.mse52Txt=\\cacert\\mse52.txt
dlz.mse52Sk=\\cacert\\mse52.sk
dlz.mse53Txt=\\cacert\\mse53.txt
dlz.mse53Sk=\\cacert\\mse53.sk
xxj.xpjTxt=\\cacert\\xpj.txt
xxj.xpjSk=\\cacert\\xpj.sk
zwj.400zwjTxt=\\cacert\\400zwj.txt
zwj.400zwjSk=\\cacert\\400zwj.sk
zwj.800zwjTxt=\\cacert\\800zwj.txt
zwj.800zwjSk=\\cacert\\800zwj.sk
djpk.djpk01Txt=\\cacert\\djpk01.txt
djpk.djpk01Sk=\\cacert\\djpk01.sk
djpk.djpk02Txt=\\cacert\\djpk02.txt
djpk.djpk02Sk=\\cacert\\djpk02.sk
lmx.bjTxt=\\cacert\\sklmx.txt
lmx.bjSk=\\cacert\\sklmx.sk
lmx.bjxx=\\cacert\\sklmx-bjxx.txt
pmz.bjTxt=\\cacert\\skpmz.txt
pmz.bjSk=\\cacert\\skpmz.sk
#���ز�����false,��ʽ������true,�������jar�������ͬ����cacert�ļ��� #���ز�����false,��ʽ������true,�������jar�������ͬ����cacert�ļ���
#���������ij�true #���������ij�true
...@@ -80,6 +40,24 @@ btTopic=huangqiang ...@@ -80,6 +40,24 @@ btTopic=huangqiang
#���Ϊ 1 ����ǰ��ҳ���mqttͬʱ 2 redis��mqttͳһ 3 ֻ����redis 4 ֻ����mqtt #���Ϊ 1 ����ǰ��ҳ���mqttͬʱ 2 redis��mqttͳһ 3 ֻ����redis 4 ֻ����mqtt
redis.separate=1 redis.separate=1
commonSk=\\cacert\\test.sk commonSk=\\cacert\\test.sk
jqr.ptjqr1=\\cacert\\ptjqr1.txt
logging.config=classpath:logback-gidea.xml logging.config=classpath:logback-gidea.xml
\ No newline at end of file
#\uFFFD\uFFFD\uFFFD\uFFFD
project.package.name=com.jln.system.web.action
# thymeleaf
spring.thymeleaf.prefix=classpath:/templates/
spring.thymeleaf.suffix=.html
spring.thymeleaf.encoding=UTF-8
spring.thymeleaf.cache=false
#redis 该项目没有使用redis,保留配置
spring.redis.database=0
spring.redis.host=127.0.0.1
spring.redis.port=63790
spring.redis.password=123456
spring.redis.jedis.pool.max-active=8
spring.redis.jedis.pool.max-wait=8
spring.redis.jedis.pool.max-idle=8
spring.redis.jedis.pool.min-idle=0
spring.redis.timeout=800
\ No newline at end of file
设备ID=5099800634
公司编码=2R00
工厂编码=2R01
设备名称=动臂斗杆面漆保温段烘干设备
设备类型=S0605
设备ID=5099800617
公司编码=2R00
工厂编码=2R01
设备名称=平台车架面漆保温段烘干设备
设备类型=S0605
\ No newline at end of file
设备ID=5099800621
公司编码=2R00
工厂编码=2R01
设备名称=平台车架底漆闪干烘干炉
设备类型=S0605
设备ID=5099800620
公司编码=2R00
工厂编码=2R01
设备名称=平台车架底漆空调
设备类型=S0609
设备ID=5003820060
公司编码=2R00
工厂编码=2R01
设备名称=平台车架底漆喷涂机器人1
设备类型=S0603
设备ID=5003820061
公司编码=2R00
工厂编码=2R01
设备名称=平台车架底漆喷涂机器人2
设备类型=S0603
设备ID=5003820065
公司编码=2R00
工厂编码=2R01
设备名称=平台车架底漆喷涂机器人3
设备类型=S0603
设备ID=5003820064
公司编码=2R00
工厂编码=2R01
设备名称=平台车架底漆喷涂机器人4
设备类型=S0603
设备ID=5099800621
公司编码=2R00
工厂编码=2R01
设备名称=车架斗杆底漆闪干烘干炉
设备类型=S0605
设备ID=5003820062
公司编码=2R00
工厂编码=2R01
设备名称=平台车架底漆自动调漆设备2
设备类型=S0608
设备ID=5099800616
公司编码=2R00
工厂编码=2R01
设备名称=平台车架面漆二段烘干设备
设备类型=S0605
\ No newline at end of file
设备ID=5099800619
公司编码=2R00
工厂编码=2R01
设备名称=平台车架面漆二段强冷设备
设备类型=S0609
\ No newline at end of file
设备ID=5099800624
公司编码=2R00
工厂编码=2R01
设备名称=平台车架工位送风空调
设备类型=S0609
设备ID=5099800654
公司编码=2R00
工厂编码=2R01
设备名称=平台车架红外触媒
设备类型=S0699
\ No newline at end of file
设备ID=5099800628
公司编码=2R00
工厂编码=2R01
设备名称=平台车架冷冻水机组
设备类型=S0699
\ No newline at end of file
设备ID=5099800632
公司编码=2R00
工厂编码=2R01
设备名称=平台车架面漆空调
设备类型=S0609
\ No newline at end of file
设备ID=5003820068
公司编码=2R00
工厂编码=2R01
设备名称=平台车架面漆喷涂机器人1
设备类型=S0603
设备ID=5003820069
公司编码=2R00
工厂编码=2R01
设备名称=平台车架面漆喷涂机器人2
设备类型=S0603
设备ID=5003820070
公司编码=2R00
工厂编码=2R01
设备名称=平台车架面漆喷涂机器人3
设备类型=S0603
设备ID=5003820071
公司编码=2R00
工厂编码=2R01
设备名称=平台车架面漆喷涂机器人4
设备类型=S0603
设备ID=5003820072
公司编码=2R00
工厂编码=2R01
设备名称=平台车架面漆自动调漆设备1
设备类型=S0608
设备ID=5003820073
公司编码=2R00
工厂编码=2R01
设备名称=平台车架面漆自动调漆设备2
设备类型=S0608
设备ID=5099800623
公司编码=2R00
工厂编码=2R01
设备名称=平台车架腻子烘干设备
设备类型=S0605
\ No newline at end of file
设备ID=5099800622
公司编码=2R00
工厂编码=2R01
设备名称=平台车架腻子强冷设备
设备类型=S0609
\ No newline at end of file
设备ID=5002000142
公司编码=2R00
工厂编码=2R01
设备名称=平台车架抛丸设备
设备类型=S0602
设备ID=8002888966
公司编码=2R00
工厂编码=2R01
设备名称=平台车架空吊具转挂RGV
设备类型=S1504
\ No newline at end of file
设备ID=8002888967
公司编码=2R00
工厂编码=2R01
设备名称=平台车架转挂RGV
设备类型=S1504
\ No newline at end of file
设备ID=8099820539
公司编码=2R00
工厂编码=2R01
设备名称=平台车架涂装废气处理设备
设备类型=S0902
\ No newline at end of file
设备ID=5099800625
公司编码=2R00
工厂编码=2R01
设备名称=平台车架水分烘干设备
设备类型=S0605
设备ID=8002888991
公司编码=2R00
工厂编码=2R01
设备名称=平台车架上件升降机1
设备类型=S0699
\ No newline at end of file
设备ID=8002888990
公司编码=2R00
工厂编码=2R01
设备名称=平台车架上件升降机2
设备类型=S0699
\ No newline at end of file
设备ID=8002888994
公司编码=2R00
工厂编码=2R01
设备名称=平台车架输送链1
设备类型=S1401
\ No newline at end of file
设备ID=8002888993
公司编码=2R00
工厂编码=2R01
设备名称=平台车架输送链2
设备类型=S1401
\ No newline at end of file
设备ID=8002888992
公司编码=2R00
工厂编码=2R01
设备名称=平台车架输送链3
设备类型=S1401
\ No newline at end of file
设备ID=8002888975
公司编码=2R00
工厂编码=2R01
设备名称=平台车架下件升降机
设备类型=S0699
\ No newline at end of file
设备ID=5099800633
公司编码=2R00
工厂编码=2R01
设备名称=平台车架面漆一段烘干设备
设备类型=S0605
\ No newline at end of file
设备ID=5099800618
公司编码=2R00
工厂编码=2R01
设备名称=平台车架面漆一段强冷设备
设备类型=S0609
\ No newline at end of file
设备ID=5099800653
公司编码=2R00
工厂编码=2R01
设备名称=动臂斗杆红外触媒
设备类型=S0699
\ No newline at end of file
设备ID=5099800645
公司编码=2R00
工厂编码=2R01
设备名称=动臂斗杆冷冻水机组
设备类型=S0699
\ No newline at end of file
设备ID=8099820535
公司编码=2R00
工厂编码=2R01
设备名称=动臂斗杆涂装废气处理设备
设备类型=S0902
\ No newline at end of file
设备ID=5099800621
公司编码=2R00
工厂编码=2R01
设备名称=平台车架底漆闪干烘干炉
设备类型=S0605
设备ID=5099800638
公司编码=2R00
工厂编码=2R01
设备名称=动臂斗杆底漆空调
设备类型=S0609
设备ID=5003820060
公司编码=2R00
工厂编码=2R01
设备名称=平台车架底漆喷涂机器人1
设备类型=S0603
设备ID=5003820061
公司编码=2R00
工厂编码=2R01
设备名称=平台车架底漆喷涂机器人2
设备类型=S0603
设备ID=5003820065
公司编码=2R00
工厂编码=2R01
设备名称=平台车架底漆喷涂机器人3
设备类型=S0603
设备ID=5003820064
公司编码=2R00
工厂编码=2R01
设备名称=平台车架底漆喷涂机器人4
设备类型=S0603
设备ID=5099800637
公司编码=2R00
工厂编码=2R01
设备名称=动臂斗杆底漆闪干烘干炉
设备类型=S0605
设备ID=5003820063
公司编码=2R00
工厂编码=2R01
设备名称=平台车架底漆自动调漆设备1
设备类型=S0608
设备ID=5003820062
公司编码=2R00
工厂编码=2R01
设备名称=平台车架底漆自动调漆设备2
设备类型=S0608
设备ID=5099800652
公司编码=2R00
工厂编码=2R01
设备名称=动臂斗杆面漆二段烘干设备
设备类型=S0605
\ No newline at end of file
设备ID=5099800636
公司编码=2R00
工厂编码=2R01
设备名称=动臂斗杆二段强冷设备
设备类型=S0614
\ No newline at end of file
设备ID=5099800639
公司编码=2R00
工厂编码=2R01
设备名称=动臂斗杆工位送风空调
设备类型=S0609
设备ID=5099800650
公司编码=2R00
工厂编码=2R01
设备名称=动臂斗杆面漆空调
设备类型=S0604
\ No newline at end of file
设备ID=5003820078
公司编码=2R00
工厂编码=2R01
设备名称=动臂斗杆面漆喷涂机器人1
设备类型=S0603
\ No newline at end of file
设备ID=5003820079
公司编码=2R00
工厂编码=2R01
设备名称=动臂斗杆面漆喷涂机器人2
设备类型=S0603
\ No newline at end of file
设备ID=5003820070
公司编码=2R00
工厂编码=2R01
设备名称=平台车架面漆喷涂机器人3
设备类型=S0603
设备ID=5003820071
公司编码=2R00
工厂编码=2R01
设备名称=平台车架面漆喷涂机器人4
设备类型=S0603
设备ID=5003820080
公司编码=2R00
工厂编码=2R01
设备名称=动臂斗杆面漆自动调漆设备1
设备类型=S0608
设备ID=5003820073
公司编码=2R00
工厂编码=2R01
设备名称=平台车架面漆自动调漆设备2
设备类型=S0608
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论