Przeglądaj źródła

监视模块后台接口

shilin 3 lat temu
rodzic
commit
95a8ce3cc5

+ 3 - 1
src/main/java/com/gyee/frame/common/conf/AjaxStatus.java

@@ -3,7 +3,9 @@ package com.gyee.frame.common.conf;
 public enum  AjaxStatus {
     success(200),
     error(500),
-    logineroor(501);
+    logineroor(501),
+    loginexpire(502);
+
     public int code;
     AjaxStatus(int c) {
         code = c;

+ 5 - 11
src/main/java/com/gyee/frame/common/interceptor/MyWebAppConfigurer.java

@@ -1,17 +1,10 @@
 package com.gyee.frame.common.interceptor;
 
+import com.gyee.frame.common.conf.V2Config;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.context.annotation.Configuration;
-import org.springframework.web.servlet.config.annotation.ContentNegotiationConfigurer;
-import org.springframework.web.servlet.config.annotation.CorsRegistry;
-import org.springframework.web.servlet.config.annotation.DefaultServletHandlerConfigurer;
-import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
-import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
-import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
-import org.springframework.web.servlet.config.annotation.ViewResolverRegistry;
-import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
-import com.gyee.frame.common.conf.V2Config;
+import org.springframework.web.servlet.config.annotation.*;
 
 /**
  * 拦截器
@@ -44,7 +37,8 @@ public class MyWebAppConfigurer  extends  WebMvcConfigurationSupport  {
 	@Override
 	public void addCorsMappings(CorsRegistry registry){
 
-			registry.addMapping("/**")
+
+        registry.addMapping("/**")
 			// 设置允许跨域请求的域名
 			.allowedOrigins("*")
 			// 是否允许证书
@@ -53,7 +47,7 @@ public class MyWebAppConfigurer  extends  WebMvcConfigurationSupport  {
 			.allowedMethods("GET", "POST", "DELETE", "PUT")
 			// 设置允许的header属性
 			.allowedHeaders("*")
-			// 跨域允许时间
+				// 跨域允许时间
 			.maxAge(3600);
 			super.addCorsMappings(registry);
 

+ 151 - 30
src/main/java/com/gyee/frame/common/spring/Constant.java

@@ -130,39 +130,29 @@ public class Constant {
 
 
 
-	public static final String TPOINT_WT_FDJZS = "AI128";// 发电机转速
-	public static final String TPOINT_WT_U1YZWD = "AI045";// U1绕组温度
-	public static final String TPOINT_WT_V1YZWD = "AI047";// V1绕组温度
-	public static final String TPOINT_WT_W1YZWD = "AI049";// W1绕组温度
-	public static final String TPOINT_WT_YLZS = "AI012";// 叶轮转速
+
+
+
 	public static final String TPOINT_WT_FJJJJ = "AI085";// 风机浆距角
 	// public static final String TPOINT_WT_DWZWD = "AI071";// 低速轴温度
 	// public static final String TPOINT_WT_GWZWD = "AI072";// 高速轴温度
-	public static final String TPOINT_WT_DWZWD = "AI038";// shaft轴1温度
-	public static final String TPOINT_WT_GWZWD = "AI039";// shaft轴2温度
-	public static final String TPOINT_WT_CLXWD = "AI041";// 齿轮箱油温
-	public static final String TPOINT_WT_BJJD1 = "AI076";// 变桨角度1
+
+
+
 	public static final String TPOINT_WT_BJJD2 = "AI077";// 变桨角度2
 	public static final String TPOINT_WT_BJJD3 = "AI078";// 变桨角度3
-	public static final String TPOINT_WT_PHWZ = "AI034";// 偏航位置
 	public static final String TPOINT_WT_PJFS = "RPJFS"; // 日平均风速
-	public static final String TPOINT_WT_FJGL = "AI130";// 风机功率
 	public static final String TPOINT_WT_PJGL = "RPJGL";// 风机平均功率
-	public static final String TPOINT_WT_GLYS = "AI067";// 功率因数
 	public static final String TPOINT_WT_JCWWD = "AI056";// 机舱外温度
 	public static final String TPOINT_WT_JCWD = "AI057";// 机舱温度
 	public static final String TPOINT_WT_TDGWD = "AI069";// 塔底柜温度
 	public static final String TPOINT_WT_JCGWD = "AI070";// 机舱柜温度
 	public static final String TPOINT_WT_FJFX = "AI008";// 风机风向
-	public static final String TPOINT_WT_DFJD = "AI036";// 对风角度
 	public static final String TPOINT_WT_FJPL = "AI068";// 风机频率
 	public static final String TPOINT_WT_WGGL = "AI131";// 无功功率
 	public static final String TPOINT_WT_FJKYL = "AI001";// 风机可用率
 	public static final String TPOINT_WT_LQSW = "AI051"; // 冷却水温
-	public static final String TPOINT_WT_FJSSFS = "AI022";// 风机实时风速
 	public static final String TPOINT_WT_FJZSXZ = "AI178";// 风机转速限值
-	public static final String TPOINT_WT_FDJZCAWD = "AI052";// 发电机轴承A温度
-	public static final String TPOINT_WT_FDJZCBWD = "AI053";// 发电机轴承B温度
 	public static final String TPOINT_WT_ZJGD = "AI129"; // 转矩给定
 	public static final String TPOINT_WT_FJGLKZXZ = "AI426";// UP97 取值 功率控制限值
 	public static final String TPOINT_WT_LLGL = "BZGL";// 风机理论功率
@@ -172,15 +162,15 @@ public class Constant {
 	// 新增
 	public static final String TPOINT_WT_HDL = "AI197";// 耗电量
 	public static final String TPOINT_WT_SCZT = "AI427";// 刹车状态
-	public static final String TPOINT_WT_JLDZ = "AI402";// 解缆动作、正在偏航、解缆
+
 	public static final String TPOINT_WT_FQDDWD = "AI053";// 发电机非驱动端温度
 	public static final String TPOINT_WT_HXZD = "AI227_HB";// 横向振动
 	public static final String TPOINT_WT_ZXZD = "AI226_HB";// 纵向振动
 	public static final String TPOINT_WT_GZDM = "FJBJ";// 故障代码
 	public static final String TPOINT_WT_LQSWD = "AI042";// 齿轮箱冷却水温度
 	public static final String TPOINT_WT_ZZQDWD = "AI186_HB";// 主轴轴承前驱侧温度
-	public static final String TPOINT_WT_YYXTYY = "AI018";// 液压系统油压
-	public static final String TPOINT_WT_FDJLQSWD = "AI300";// 液压系统油压
+
+
 
 	// public static final String TPOINT_WT_RFDLBZ = "RFDLLL";//日理论发电量
 
@@ -372,30 +362,24 @@ public class Constant {
 	public static final String R4QFZT = "R4QFZT"; // 日4欠发电量
 
 
-	public static final String QSTPOINT_WT_FDJZS = "AI223";// 发电机转速
-	public static final String QSTPOINT_WT_U1YZWD = "AI188";// U1绕组温度
-	public static final String QSTPOINT_WT_V1YZWD = "AI189";// V1绕组温度
-	public static final String QSTPOINT_WT_W1YZWD = "AI190";// W1绕组温度
-	public static final String QSTPOINT_WT_BJJD1 = "AI184";// 青山变桨角度1
-	public static final String QSTPOINT_WT_PHWZ = "AI206";// 偏航位置
+
+
+
+
 /********************************************变桨*********************************************************************/
+
 	public static final String TPOINT_WT_RYBMQ1 = "AI088";// 冗余编码器1
 	public static final String TPOINT_WT_RYBMQ2 = "AI089";// 冗余编码器2
 	public static final String TPOINT_WT_RYBMQ3 = "AI090";// 冗余编码器3
-
 	public static final String TPOINT_WT_BJSD1 = "AI091";// 变桨速度1
 	public static final String TPOINT_WT_BJSD2 = "AI092";// 变桨速度2
 	public static final String TPOINT_WT_BJSD3 = "AI093";// 变桨速度3
-
 	public static final String QSTPOINT_WT_U1YZDL = "AI210";// U1项绕组电流
 	public static final String QSTPOINT_WT_U2YZDL = "AI211";// U2项绕组电流
 	public static final String QSTPOINT_WT_U3YZDL = "AI212";// U3项绕组电流
 	public static final String QSTPOINT_WT_U1YZDY = "AI207";// U1项绕组电压
 	public static final String QSTPOINT_WT_U2YZDY = "AI208";// U2项绕组电压
 	public static final String QSTPOINT_WT_U3YZDY = "AI209";// U3项绕组电压
-
-
-
 	public static final String TPOINT_WT_U1YZDL = "AI061";// U1项绕组电流
 	public static final String TPOINT_WT_U2YZDL = "AI062";// U2项绕组电流
 	public static final String TPOINT_WT_U3YZDL = "AI063";// U3项绕组电流
@@ -403,10 +387,147 @@ public class Constant {
 	public static final String TPOINT_WT_U2YZDY = "AI059";// U2项绕组电压
 	public static final String TPOINT_WT_U3YZDY = "AI060";// U3项绕组电压
 
+
+	public static final String TPOINT_WT_YP1XW91 = "DI032";// 叶片1的91度限位
+	public static final String TPOINT_WT_YP2XW91  = "DI033";// 叶片2的91度限位
+	public static final String TPOINT_WT_YP3XW91  = "DI034";// 叶片3的91度限位
+	public static final String TPOINT_WT_YP1XW95 = "DI657";// 叶片1的95度限位
+	public static final String TPOINT_WT_YP2XW95  = "DI658";// 叶片2的95度限位
+	public static final String TPOINT_WT_YP3XW95  = "DI659";// 叶片3的95度限位
+
 /********************************************变桨*********************************************************************/
 
 
+/********************************************齿轮箱*********************************************************************/
+
+	public static final String TPOINT_WT_RHYLWRKYL = "AI043";// 润滑油滤网入口压力
+	public static final String TPOINT_WT_RHYLWCKYL = "AI044";// 润滑油滤网出口压力
+	public static final String TPOINT_WT_CLXSRZ1WD = "AI038";// 齿轮箱输入轴1温度
+	public static final String TPOINT_WT_CLXSRZ2WD = "AI039";// 齿轮箱输入轴1温度
+	public static final String TPOINT_WT_CLXWD = "AI041";// 齿轮箱油温
+	public static final String TPOINT_WT_CLXRKYW = "AI301";// 齿轮箱入口油温
+
+
+
+	public static final String TPOINT_WT_CLXYW = "DI081";// 齿轮箱油位ok
+	public static final String TPOINT_WT_CLXRHYYL = "DI082";//齿轮箱润滑油压力ok
+	public static final String TPOINT_WT_CLXRHBDJBH  = "DI834";// 齿轮箱润滑泵电机保护ok
+	public static final String TPOINT_WT_CLXRHYJRBH = "DI272";//齿轮箱润滑油加热保护ok
+	public static final String TPOINT_WT_CLXRHYLWYC  = "DI087";//齿轮箱润滑油滤网压差ok
+	public static final String TPOINT_WT_CLXYJRQBH  = "DI249";//齿轮箱油加热器保护ok
+
+	public static final String TPOINT_WT_QDCLXRHJRQ = "DI840";// 启动齿轮箱润滑加热器
+	public static final String TPOINT_WT_QDCLXRHGSBA  = "DI844";//启动齿轮箱润滑高速泵a
+	public static final String TPOINT_WT_QDCLXRHGSBB  = "DI845";//启动齿轮箱润滑高速泵a
+	public static final String TPOINT_WT_QDCLXYBJRQ = "DI843";//启动齿轮箱油泵加热器
+
+
+/********************************************齿轮箱*********************************************************************/
+
+
+/********************************************发电机*********************************************************************/
+
+    public static final String TPOINT_WT_U1YZWD = "AI045";// U1绕组温度
+	public static final String TPOINT_WT_V1YZWD = "AI047";// V1绕组温度
+	public static final String TPOINT_WT_W1YZWD = "AI049";// W1绕组温度
+	public static final String QSTPOINT_WT_U1YZWD = "AI188";// U1绕组温度
+	public static final String QSTPOINT_WT_V1YZWD = "AI189";// V1绕组温度
+	public static final String QSTPOINT_WT_W1YZWD = "AI190";// W1绕组温度
+	public static final String TPOINT_WT_FDJZCAWD = "AI052";// 发电机轴承A温度
+	public static final String TPOINT_WT_FDJZCBWD = "AI053";// 发电机轴承B温度
+	public static final String TPOINT_WT_FDJLQFWD = "AI054";//发电机冷却风温度
+
+
+	public static final String TPOINT_WT_FDJJRQBHZC = "DI254";//发电机加热器保护正常
+	public static final String TPOINT_WT_QDFDJJRQ  = "DI827";//启动发电机加热器
+	public static final String TPOINT_WT_FDJDSMS  = "DI829";//发电机电刷磨损ok
+	public static final String TPOINT_WT_QDKLFS1 = "DI830";//启动空冷风扇1
+	public static final String TPOINT_WT_QDKLFS2  = "DI83Q";//启动空冷风扇2
+	public static final String TPOINT_WT_KLFSBH1  = "DI069";//空冷风扇保护1正常
+	public static final String TPOINT_WT_KLFSBH2 = "DI070";//空冷风扇保护2正常
+	public static final String TPOINT_WT_QDSLFS1  = "DI075";//启动水冷风扇1
+	public static final String TPOINT_WT_QDSLFSBH1  = "DI823";//水冷风扇保护1正常
+	public static final String TPOINT_WT_LQSYL = "DI248";//冷却水压力ok
+	public static final String TPOINT_WT_FDJRHYBYW  = "DI828";//发电机润滑油泵液位ok
+	public static final String TPOINT_WT_QDFDJRHYB = "DI833";//启动发电机润滑油泵
+
+/********************************************发电机*********************************************************************/
+
+	/********************************************偏航*********************************************************************/
+
+	public static final String TPOINT_WT_DFJD = "AI036";// 对风角度
+	public static final String TPOINT_WT_PHWZ = "AI034";// 偏航位置
+	public static final String QSTPOINT_WT_PHWZ = "AI206";// 偏航位置
+
+
+	public static final String TPOINT_WT_PHZJX = "DI110";//偏航左极限位置
+	public static final String TPOINT_WT_PHYJX  = "DI111";//偏航右极限位置
+	public static final String TPOINT_WT_PHRQDQZC  = "DI109";//偏航软启动器正常
+	public static final String TPOINT_WT_ZPHDZ = "DI112";//左偏航动作
+	public static final String TPOINT_WT_PHDSCDK  = "DI857";//偏航电刹车打开
+	public static final String TPOINT_WT_YPHDZ  = "DI113";//右偏航动作
+	public static final String TPOINT_WT_PHRQDQDZ = "DI121";//偏航软启动器动作
+	public static final String TPOINT_WT_PHRQDQSN  = "DI120";//偏航软启动器使能
+	public static final String TPOINT_WT_PHBMQZL = "DI860";//偏航编码器置零
+	public static final String TPOINT_WT_JLDZ = "DI012";//解缆动作
+	public static final String TPOINT_WT_PHCGQMTOK = "DI858";//偏航传感器mtOK
+	public static final String TPOINT_WT_PHCGQOK  = "DI859";//偏航传感器OK
+	public static final String TPOINT_WT_PHZCRHYW  = "DI853";//偏航轴承润滑液位ok
+	public static final String TPOINT_WT_PHRHBZCBH = "DI861";//偏航润滑泵轴承保护ok
+	public static final String TPOINT_WT_PHDJ1BH  = "DI854";//偏航电机1保护OK
+	public static final String TPOINT_WT_PHDJ2BH  = "DI855";//偏航电机2保护OK
+	public static final String TPOINT_WT_PHDJ3BH = "DI856";//偏航电机3保护OK
+	public static final String TPOINT_WT_PHDJ4BH  = "DI862";//偏航电机4保护OK
+
+/********************************************偏航*********************************************************************/
+
+
+
+/********************************************液压*********************************************************************/
+
+	public static final String TPOINT_WT_YYXTYY = "AI018";// 液压系统油压
+	public static final String TPOINT_WT_ZZSCXTYY = "AI019";// 转子刹车系统液压
+	public static final String TPOINT_WT_FDJLQSWD = "AI300";// 液压系统油压
+
+
+	public static final String TPOINT_WT_YYYWDCX  = "DI863";//液压油温度超限
+	public static final String TPOINT_WT_YYYYW = "DI129";//液压油液位ok
+	public static final String TPOINT_WT_YLSCYY  = "DI130";//叶轮刹车液压ok
+	public static final String TPOINT_WT_YYBDJBH = "DI131";//液压泵电机保护
+	public static final String TPOINT_WT_YYYJRQBH  = "DI132";//液压油加热器保护
+
+/********************************************液压*********************************************************************/
+	/********************************************机舱*********************************************************************/
+
+	public static final String TPOINT_WT_YPWZ1 = "AI085";// 叶片位置1
+	public static final String TPOINT_WT_YPWZ2 = "AI086";// 叶片位置2
+	public static final String TPOINT_WT_YPWZ3 = "AI087";// 叶片位置3
+
+	public static final String TPOINT_WT_FJSSFS = "AI022";// 风机实时风速
+	public static final String TPOINT_WT_FJGL = "AI130";// 风机功率
+	public static final String TPOINT_WT_GLYS = "AI067";// 功率因数
+
+	public static final String QSTPOINT_WT_BJJD1 = "AI184";// 青山变桨角度1
+	public static final String QSTPOINT_WT_FDJZS = "AI223";// 发电机转速
+
+	public static final String TPOINT_WT_BJJD1 = "AI076";// 变桨角度1
+	public static final String TPOINT_WT_FDJZS = "AI128";// 发电机转速
+
+	public static final String TPOINT_WT_YLZS = "AI012";// 叶轮转速
+
+
 
+	public static final String TPOINT_WT_YYYYW2 = "DI129";//液压油液位ok
+	public static final String TPOINT_WT_YYYWDCX2  = "DI863";//液压油温度超限
+	public static final String TPOINT_WT_YLSCYY2  = "DI130";//叶轮刹车液压ok
+	public static final String TPOINT_WT_YYBDJBH2 = "DI131";//液压泵电机保护
+	public static final String TPOINT_WT_YYYJRQBH2  = "DI132";//液压油加热器保护
+	public static final String TPOINT_WT_CLXYW2  = "DI081";//齿轮箱油位ok
+	public static final String TPOINT_WT_CLXRHYYL2 = "DI082";//齿轮箱润滑油压力ok
+	public static final String TPOINT_WT_CLXRHYJRBH2  = "DI272";//齿轮箱润滑油泵保护开关故障
+	public static final String TPOINT_WT_FDJJRQBHZC2 = "DI254";//发电机加热器保护正常
+	public static final String TPOINT_WT_LQSYL2 = "DI248";//冷却水压力ok
 
 
+/********************************************机舱*********************************************************************/
 }

+ 133 - 51
src/main/java/com/gyee/frame/controller/AdminController.java

@@ -10,6 +10,8 @@ import com.gyee.frame.model.auto.TsysUser;
 import com.gyee.frame.model.custom.BootstrapTree;
 import com.gyee.frame.model.custom.ElementNode;
 import com.gyee.frame.model.custom.TitleVo;
+import com.gyee.frame.model.custom.TokenUser;
+import com.gyee.frame.shiro.config.ShiroService;
 import com.gyee.frame.shiro.util.ShiroUtils;
 import com.gyee.frame.util.StringUtils;
 import io.swagger.annotations.Api;
@@ -22,16 +24,16 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.ModelMap;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.*;
 import org.springframework.web.servlet.mvc.support.RedirectAttributes;
 
+import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
-import java.util.Enumeration;
+import java.util.Date;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 /**
  * 后台方法
@@ -43,12 +45,16 @@ import java.util.List;
  */
 @Controller
 @RequestMapping("/admin")
+@CrossOrigin
 @Api(value = "后台管理接口" ,tags="后台管理接口")
 public class AdminController extends BaseController {
 	private static Logger logger = LoggerFactory.getLogger(AdminController.class);
 
 	private String prefix = "admin";
 
+	@Resource
+	private ShiroService shiroService;
+
 	@ApiOperation(value = "首页", notes = "首页")
 	@GetMapping("/index")
 	public String index(HttpServletRequest request) {
@@ -189,54 +195,107 @@ public class AdminController extends BaseController {
 
 			String userName = user.getUsername();
 			Subject currentUser = SecurityUtils.getSubject();
+			String customtoken = request.getHeader("authToken");
+
+				if(StringUtils.notEmp(customtoken))
+				{
+					TokenUser customuser = shiroService.findToken(customtoken);
+					/**
+					 * user == null 表示第一次登录
+					 */
+					if (customuser == null)
+					{
+						return initialLogin(user, userName, currentUser);
+					}else
+					{
+						long expireTime = customuser.getExpireTime();
+						long nowTime = new Date().getTime();
+						/**
+						 * 判断登录是否过期
+						 */
+						if (nowTime - expireTime > shiroService.EXPIRE)
+						{
+							return AjaxResult.error(AjaxStatus.loginexpire.code, "账号已过期请重新登录");
+						}else
+						{
+							Map<String, Object> result = new HashMap<>();
+							result.put("token", customtoken);
+							result.put("user", customuser);
+							return AjaxResult.successData(AjaxStatus.success.code, result);
+						}
 
-			// 是否验证通过
-			if (!currentUser.isAuthenticated()) {
-				UsernamePasswordToken token = new UsernamePasswordToken(userName, user.getPassword());
-				try {
-//					if (rememberMe) {
-					if (true) {
-						token.setRememberMe(true);
-					}
-					// 存入用户
-					currentUser.login(token);
-					if (StringUtils.isNotNull(ShiroUtils.getUser())) {
-						// 若为前后端分离版本,则可把sessionId返回,作为分离版本的请求头authToken
-						 String authToken = ShiroUtils.getSessionId();
-						 return AjaxResult.successData(AjaxStatus.success.code, authToken);
-//						return AjaxResult.success();
-					} else {
-						return AjaxResult.error(AjaxStatus.logineroor.code, "未知账户");
 					}
-				} catch (UnknownAccountException uae) {
-					logger.info("对用户[" + userName + "]进行登录验证..验证未通过,未知账户");
+				}else
+				{
+					return initialLogin(user, userName, currentUser);
+				}
+
+
+	}
+
+	private AjaxResult initialLogin(TsysUser user, String userName, Subject currentUser) {
+		// 是否验证通过
+		if (!currentUser.isAuthenticated()) {
+			UsernamePasswordToken token = new UsernamePasswordToken(userName, user.getPassword());
+			try {
+				token.setRememberMe(true);
+				// 存入用户
+				currentUser.login(token);
+
+				Map<String, Object> authToken = shiroService.createToken(ShiroUtils.getUser());
+
+				if(authToken.containsKey("token"))
+				{
+					return AjaxResult.successData(AjaxStatus.success.code, authToken);
+				}else
+				{
 					return AjaxResult.error(AjaxStatus.logineroor.code, "未知账户");
-				} catch (IncorrectCredentialsException ice) {
-					logger.info("对用户[" + userName + "]进行登录验证..验证未通过,错误的凭证");
-					return AjaxResult.error(AjaxStatus.logineroor.code, "用户名或密码不正确");
-				} catch (LockedAccountException lae) {
-					logger.info("对用户[" + userName + "]进行登录验证..验证未通过,账户已锁定");
-					return AjaxResult.error(AjaxStatus.logineroor.code, "账户已锁定");
-				} catch (ExcessiveAttemptsException eae) {
-					logger.info("对用户[" + userName + "]进行登录验证..验证未通过,错误次数过多");
-					return AjaxResult.error(AjaxStatus.logineroor.code, "用户名或密码错误次数过多");
-				} catch (AuthenticationException ae) {
-					// 通过处理Shiro的运行时AuthenticationException就可以控制用户登录失败或密码错误时的情景
-					logger.info("对用户[" + userName + "]进行登录验证..验证未通过,堆栈轨迹如下");
-					ae.printStackTrace();
-					return AjaxResult.error(AjaxStatus.logineroor.code, "用户名或密码不正确");
 				}
-			} else {
-				if (StringUtils.isNotNull(ShiroUtils.getUser())) {
-					// 跳转到 get请求的登陆方法
-					// view.setViewName("redirect:/"+prefix+"/index");
-					return AjaxResult.success();
-				} else {
+
+//							if (StringUtils.isNotNull(ShiroUtils.getUser())) {
+//
+//								// 若为前后端分离版本,则可把sessionId返回,作为分离版本的请求头authToken
+//								String sessionId = ShiroUtils.getSessionId();
+//								return AjaxResult.successData(AjaxStatus.success.code, sessionId);
+////
+//							} else {
+//								return AjaxResult.error(AjaxStatus.logineroor.code, "未知账户");
+//							}
+			} catch (UnknownAccountException uae) {
+				logger.info("对用户[" + userName + "]进行登录验证..验证未通过,未知账户");
+				return AjaxResult.error(AjaxStatus.logineroor.code, "未知账户");
+			} catch (IncorrectCredentialsException ice) {
+				logger.info("对用户[" + userName + "]进行登录验证..验证未通过,错误的凭证");
+				return AjaxResult.error(AjaxStatus.logineroor.code, "用户名或密码不正确");
+			} catch (LockedAccountException lae) {
+				logger.info("对用户[" + userName + "]进行登录验证..验证未通过,账户已锁定");
+				return AjaxResult.error(AjaxStatus.logineroor.code, "账户已锁定");
+			} catch (ExcessiveAttemptsException eae) {
+				logger.info("对用户[" + userName + "]进行登录验证..验证未通过,错误次数过多");
+				return AjaxResult.error(AjaxStatus.logineroor.code, "用户名或密码错误次数过多");
+			} catch (AuthenticationException ae) {
+				// 通过处理Shiro的运行时AuthenticationException就可以控制用户登录失败或密码错误时的情景
+				logger.info("对用户[" + userName + "]进行登录验证..验证未通过,堆栈轨迹如下");
+				ae.printStackTrace();
+				return AjaxResult.error(AjaxStatus.logineroor.code, "用户名或密码不正确");
+			}
+		} else {
+			if (StringUtils.isNotNull(ShiroUtils.getUser())) {
+				// 跳转到 get请求的登陆方法
+				// view.setViewName("redirect:/"+prefix+"/index");
+				Map<String, Object> authToken = shiroService.createToken(ShiroUtils.getUser());
+
+				if(authToken.containsKey("token"))
+				{
+					return AjaxResult.successData(AjaxStatus.success.code, authToken);
+				}else
+				{
 					return AjaxResult.error(AjaxStatus.logineroor.code, "未知账户");
 				}
+			} else {
+				return AjaxResult.error(AjaxStatus.logineroor.code, "未知账户");
 			}
-
-
+		}
 	}
 
 
@@ -244,12 +303,29 @@ public class AdminController extends BaseController {
 	@PostMapping("/usermenu")
 	@ResponseBody
 	public AjaxResult usermenu(HttpServletRequest request) {
-		Enumeration<String> headNames = request.getHeaderNames();
-		request.getParameter("authToken");
-		// 获取菜单栏
-		List<ElementNode> menuTree = sysPermissionService.getTreePerm(ShiroUtils.getUserId());
 
-		return AjaxResult.successData(200, menuTree);
+		//String authToken=request.getParameter("authToken");
+		String customtoken = request.getHeader("authToken");
+
+		if(StringUtils.notEmp(customtoken))
+		{
+			TokenUser customuser = shiroService.findToken(customtoken);
+
+			if(customuser ==null)
+			{
+				return AjaxResult.error(AjaxStatus.logineroor.code, "未知账户");
+			}else
+			{
+				// 获取菜单栏
+				List<ElementNode> menuTree = sysPermissionService.getTreePerm(customuser.getLaborNum());
+
+				return AjaxResult.successData(200, menuTree);
+			}
+
+		}else {
+			return AjaxResult.error(AjaxStatus.logineroor.code, "未知账户");
+		}
+
 	}
 	/**
 	 * 手机登录
@@ -352,6 +428,12 @@ public class AdminController extends BaseController {
 		Subject subject = SecurityUtils.getSubject();
 		// 注销
 		subject.logout();
+		String customtoken = request.getHeader("authToken");
+		if(StringUtils.notEmp(customtoken))
+		{
+			shiroService.logout(customtoken);
+		}
+
 		return AjaxResult.success();
 	}
 

+ 61 - 0
src/main/java/com/gyee/frame/model/custom/TokenUser.java

@@ -0,0 +1,61 @@
+package com.gyee.frame.model.custom;
+
+public class TokenUser {
+
+
+    private String laborNum;
+    private String laborName;
+    private String password;
+    private String department;
+    private Long updateTime;
+    private Long expireTime;
+
+
+    public String getLaborNum() {
+        return laborNum;
+    }
+
+    public void setLaborNum(String laborNum) {
+        this.laborNum = laborNum;
+    }
+
+    public String getLaborName() {
+        return laborName;
+    }
+
+    public void setLaborName(String laborName) {
+        this.laborName = laborName;
+    }
+
+    public String getPassword() {
+        return password;
+    }
+
+    public void setPassword(String password) {
+        this.password = password;
+    }
+
+    public String getDepartment() {
+        return department;
+    }
+
+    public void setDepartment(String department) {
+        this.department = department;
+    }
+
+    public Long getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Long updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    public Long getExpireTime() {
+        return expireTime;
+    }
+
+    public void setExpireTime(Long expireTime) {
+        this.expireTime = expireTime;
+    }
+}

+ 525 - 177
src/main/java/com/gyee/frame/service/websocket/WtInfoPushService.java

@@ -3,11 +3,10 @@ package com.gyee.frame.service.websocket;
 
 import com.gyee.frame.common.spring.Constant;
 import com.gyee.frame.common.spring.InitialRunner;
-import com.gyee.frame.model.auto.Equipmentmodel;
-import com.gyee.frame.model.auto.WindTurbineInfoDay;
-import com.gyee.frame.model.auto.Windturbine;
+import com.gyee.frame.model.auto.*;
 import com.gyee.frame.model.custom.PointData;
 import com.gyee.frame.service.WindTurbineTestingPointAiService;
+import com.gyee.frame.service.WindTurbineTestingPointDiService;
 import com.gyee.frame.service.WindturbineinfodayService;
 import com.gyee.frame.util.DateUtils;
 import com.gyee.frame.util.IRealTimeDataBaseUtil;
@@ -22,7 +21,8 @@ import java.util.*;
 @Service
 public class WtInfoPushService {
 
-
+    @Resource
+    private WindTurbineTestingPointDiService windTurbineTestingPointDiService;
     @Resource
     private WindTurbineTestingPointAiService windTurbineTestingPointAiService;
 
@@ -53,240 +53,546 @@ public class WtInfoPushService {
 
                 Windturbine wt = InitialRunner.wtmap.get(id);
 
-                map.put("model",wt.getModelid());
-                map.put("wpid",wt.getWindpowerstationid());
-                map.put("pjid",wt.getProjectid());
-                map.put("lnid",wt.getLineid());
+                map.put("model", wt.getModelid());
+                map.put("wpid", wt.getWindpowerstationid());
+                map.put("pjid", wt.getProjectid());
+                map.put("lnid", wt.getLineid());
 
                 Double sjgl = 0.0;
                 Double bzgl = 0.0;
                 Double yfgl = 0.0;
 
-/*************************************************基础指标*************************************************************/
+/*************************************************变桨*************************************************************/
 
 
-                Map<String, Double> jczbmap = new HashMap<>();
+                Map<String, Double> bjmap = new HashMap<>();
 
+                if (wt.getWindpowerstationid().equals(QS_FDC)) {
+
+                    totalWtAiPointMap(bjmap, id, Constant.TPOINT_WT_RYBMQ1, "RYBMQ1");
+                    totalWtAiPointMap(bjmap, id, Constant.TPOINT_WT_RYBMQ2, "RYBMQ2");
+                    totalWtAiPointMap(bjmap, id, Constant.TPOINT_WT_RYBMQ3, "RYBMQ3");
+                    totalWtAiPointMap(bjmap, id, Constant.TPOINT_WT_BJSD1, "BJSD1");
+                    totalWtAiPointMap(bjmap, id, Constant.TPOINT_WT_BJSD2, "BJSD2");
+                    totalWtAiPointMap(bjmap, id, Constant.TPOINT_WT_BJSD3, "BJSD3");
+
+
+                    totalWtAiPointMap(bjmap, id, Constant.QSTPOINT_WT_U1YZDL, "U1YZDL");
+                    totalWtAiPointMap(bjmap, id, Constant.QSTPOINT_WT_U2YZDL, "U2YZDL");
+                    totalWtAiPointMap(bjmap, id, Constant.QSTPOINT_WT_U3YZDL, "U3YZDL");
+                    totalWtAiPointMap(bjmap, id, Constant.QSTPOINT_WT_U1YZDY, "U1YZDY");
+                    totalWtAiPointMap(bjmap, id, Constant.QSTPOINT_WT_U2YZDY, "U2YZDY");
+                    totalWtAiPointMap(bjmap, id, Constant.QSTPOINT_WT_U3YZDY, "U3YZDY");
+                } else {
+                    totalWtAiPointMap(bjmap, id, Constant.TPOINT_WT_RYBMQ1, "RYBMQ1");
+                    totalWtAiPointMap(bjmap, id, Constant.TPOINT_WT_RYBMQ2, "RYBMQ2");
+                    totalWtAiPointMap(bjmap, id, Constant.TPOINT_WT_RYBMQ3, "RYBMQ3");
+                    totalWtAiPointMap(bjmap, id, Constant.TPOINT_WT_BJSD1, "BJSD1");
+                    totalWtAiPointMap(bjmap, id, Constant.TPOINT_WT_BJSD2, "BJSD2");
+                    totalWtAiPointMap(bjmap, id, Constant.TPOINT_WT_BJSD3, "BJSD3");
+
+                    totalWtAiPointMap(bjmap, id, Constant.TPOINT_WT_U1YZDL, "U1YZDL");
+                    totalWtAiPointMap(bjmap, id, Constant.TPOINT_WT_U2YZDL, "U2YZDL");
+                    totalWtAiPointMap(bjmap, id, Constant.TPOINT_WT_U3YZDL, "U3YZDL");
+                    totalWtAiPointMap(bjmap, id, Constant.TPOINT_WT_U1YZDY, "U1YZDY");
+                    totalWtAiPointMap(bjmap, id, Constant.TPOINT_WT_U2YZDY, "U2YZDY");
+                    totalWtAiPointMap(bjmap, id, Constant.TPOINT_WT_U3YZDY, "U3YZDY");
+                }
+
+                Map<String, String> namemap = new HashMap<>();
+
+                List<String> unicodels = new ArrayList<>();
+
+                unicodels.add(Constant.TPOINT_WT_YP1XW91);
+                unicodels.add(Constant.TPOINT_WT_YP2XW91);
+                unicodels.add(Constant.TPOINT_WT_YP3XW91);
+                unicodels.add(Constant.TPOINT_WT_YP1XW95);
+                unicodels.add(Constant.TPOINT_WT_YP2XW95);
+                unicodels.add(Constant.TPOINT_WT_YP3XW95);
+
+                namemap.put(Constant.TPOINT_WT_YP1XW91, "YP1XW91");
+                namemap.put(Constant.TPOINT_WT_YP2XW91, "YP2XW91");
+                namemap.put(Constant.TPOINT_WT_YP3XW91, "YP3XW91");
+                namemap.put(Constant.TPOINT_WT_YP1XW95, "YP1XW95");
+                namemap.put(Constant.TPOINT_WT_YP2XW95, "YP2XW95");
+                namemap.put(Constant.TPOINT_WT_YP3XW95, "YP3XW95");
+
+                List<WindTurbineTestingPointDi2> list = windTurbineTestingPointDiService.getWindTurbineTestingPointDi2List(id, unicodels);
+
+                if (!list.isEmpty()) {
+
+                    for (WindTurbineTestingPointDi2 di : list) {
+                        if (namemap.containsKey(di.getUniformcode())) {
+                            totalWtDiPointMap(bjmap, di.getId(), namemap.get(di.getUniformcode()));
+                        }
+
+                    }
+                }
+
+                map.put("bjmap", bjmap);
+
+
+/*************************************************变桨*************************************************************/
+
+
+/*************************************************齿轮箱*************************************************************/
+
+
+                Map<String, Double> clxmap = new HashMap<>();
+
+                totalWtAiPointMap(clxmap, id, Constant.TPOINT_WT_RHYLWRKYL, "RHYLWRKYL");
+                totalWtAiPointMap(clxmap, id, Constant.TPOINT_WT_RHYLWCKYL, "RHYLWCKYL");
+                totalWtAiPointMap(clxmap, id, Constant.TPOINT_WT_CLXSRZ1WD, "CLXSRZ1WD");
+                totalWtAiPointMap(clxmap, id, Constant.TPOINT_WT_CLXRHYJRBH, "CLXRHYJRBH");
+                totalWtAiPointMap(clxmap, id, Constant.TPOINT_WT_CLXRHYLWYC, "CLXRHYLWYC");
+                totalWtAiPointMap(clxmap, id, Constant.TPOINT_WT_CLXRKYW, "CLXRKYW");
+
+                namemap = new HashMap<>();
+
+                unicodels = new ArrayList<>();
+
+                unicodels.add(Constant.TPOINT_WT_CLXYW);
+                unicodels.add(Constant.TPOINT_WT_CLXRHYYL);
+                unicodels.add(Constant.TPOINT_WT_CLXRHBDJBH);
+                unicodels.add(Constant.TPOINT_WT_CLXRHYJRBH);
+                unicodels.add(Constant.TPOINT_WT_CLXRHYLWYC);
+                unicodels.add(Constant.TPOINT_WT_CLXYJRQBH);
+                unicodels.add(Constant.TPOINT_WT_QDCLXRHJRQ);
+                unicodels.add(Constant.TPOINT_WT_QDCLXRHGSBA);
+                unicodels.add(Constant.TPOINT_WT_QDCLXRHGSBB);
+                unicodels.add(Constant.TPOINT_WT_QDCLXYBJRQ);
+
+                namemap.put(Constant.TPOINT_WT_CLXYW, "CLXYW");
+                namemap.put(Constant.TPOINT_WT_CLXRHYYL, "CLXRHYYL");
+                namemap.put(Constant.TPOINT_WT_CLXRHBDJBH, "CLXRHBDJBH");
+                namemap.put(Constant.TPOINT_WT_CLXRHYJRBH, "CLXRHYJRBH");
+                namemap.put(Constant.TPOINT_WT_CLXRHYLWYC, "CLXRHYLWYC");
+                namemap.put(Constant.TPOINT_WT_CLXYJRQBH, "CLXYJRQBH");
+                namemap.put(Constant.TPOINT_WT_QDCLXRHJRQ, "QDCLXRHJRQ");
+                namemap.put(Constant.TPOINT_WT_QDCLXRHGSBA, "QDCLXRHGSBA");
+                namemap.put(Constant.TPOINT_WT_QDCLXRHGSBB, "QDCLXRHGSBB");
+                namemap.put(Constant.TPOINT_WT_QDCLXYBJRQ, "QDCLXYBJRQ");
+
+                list = windTurbineTestingPointDiService.getWindTurbineTestingPointDi2List(id, unicodels);
+
+                if (!list.isEmpty()) {
+
+                    for (WindTurbineTestingPointDi2 di : list) {
+                        if (namemap.containsKey(di.getUniformcode())) {
+                            totalWtDiPointMap(clxmap, di.getId(), namemap.get(di.getUniformcode()));
+                        }
+
+                    }
+                }
+
+                map.put("clxmap", clxmap);
 
-                List<String> jczbls = new ArrayList<>();
 
+/*************************************************齿轮箱*************************************************************/
+
+
+/*************************************************发电机*************************************************************/
+
+
+                Map<String, Double> fdjmap = new HashMap<>();
 
-                // 2MW风机转速上传的数据单位是rad/s,我们系统应该显示的是rpm,所以显示的时候应该加上公式 1rad/s =9.55rpm
                 if (wt.getWindpowerstationid().equals(QS_FDC)) {
-                    jczbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.QSTPOINT_WT_BJJD1).getId());// 变桨角度
-                    jczbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.QSTPOINT_WT_PHWZ).getId());// 偏航角度
-                    jczbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.QSTPOINT_WT_U1YZDL).getId());// 电流1
-                    jczbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.QSTPOINT_WT_U2YZDL).getId());// 电流2
-                    jczbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.QSTPOINT_WT_U3YZDL).getId());// 电流3
-                    jczbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.QSTPOINT_WT_U1YZDY).getId());// 电压1
-                    jczbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.QSTPOINT_WT_U2YZDY).getId());// 电压2
-                    jczbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.QSTPOINT_WT_U3YZDY).getId());// 电压3
-                    jczbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.QSTPOINT_WT_FDJZS).getId());// 发电机转速
-                    jczbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.QSTPOINT_WT_U1YZWD).getId());// 温度1
-                    jczbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.QSTPOINT_WT_V1YZWD).getId());// 温度2
-                    jczbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.QSTPOINT_WT_W1YZWD).getId());// 温度3
+
+
+                    totalWtAiPointMap(fdjmap, id, Constant.QSTPOINT_WT_U1YZWD, "U1YZWD");
+                    totalWtAiPointMap(fdjmap, id, Constant.QSTPOINT_WT_V1YZWD, "V1YZWD");
+                    totalWtAiPointMap(fdjmap, id, Constant.QSTPOINT_WT_W1YZWD, "W1YZWD");
+                    totalWtAiPointMap(fdjmap, id, Constant.TPOINT_WT_FDJZCAWD, "FDJZCAWD");
+                    totalWtAiPointMap(fdjmap, id, Constant.TPOINT_WT_FDJZCBWD, "FDJZCBWD");
+                    totalWtAiPointMap(fdjmap, id, Constant.TPOINT_WT_FDJLQFWD, "FDJLQFWD");
+
                 } else {
-                    jczbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.TPOINT_WT_BJJD1).getId());// 变桨角度
-                    jczbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.TPOINT_WT_PHWZ).getId());// 偏航角度
-                    jczbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.TPOINT_WT_U1YZDL).getId());// 电流1
-                    jczbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.TPOINT_WT_U2YZDL).getId());// 电流2
-                    jczbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.TPOINT_WT_U3YZDL).getId());// 电流3
-                    jczbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.TPOINT_WT_U1YZDY).getId());// 电压1
-                    jczbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.TPOINT_WT_U2YZDY).getId());// 电压2
-                    jczbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.TPOINT_WT_U3YZDY).getId());// 电压3
-                    jczbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.TPOINT_WT_FDJZS).getId());// 发电机转速
-                    jczbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.TPOINT_WT_U1YZWD).getId());// 温度1
-                    jczbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.TPOINT_WT_V1YZWD).getId());// 温度2
-                    jczbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.TPOINT_WT_W1YZWD).getId());// 温度3
+                    totalWtAiPointMap(fdjmap, id, Constant.TPOINT_WT_U1YZWD, "U1YZWD  ");
+                    totalWtAiPointMap(fdjmap, id, Constant.TPOINT_WT_V1YZWD, "V1YZWD  ");
+                    totalWtAiPointMap(fdjmap, id, Constant.TPOINT_WT_W1YZWD, "W1YZWD  ");
+                    totalWtAiPointMap(fdjmap, id, Constant.TPOINT_WT_FDJZCAWD, "FDJZCAWD");
+                    totalWtAiPointMap(fdjmap, id, Constant.TPOINT_WT_FDJZCBWD, "FDJZCBWD");
+                    totalWtAiPointMap(fdjmap, id, Constant.TPOINT_WT_FDJLQFWD, "FDJLQFWD");
+
                 }
 
-                List<PointData> jczblist = realApiUtil.getRealData(jczbls);
+                namemap = new HashMap<>();
+
+                unicodels = new ArrayList<>();
+
+                unicodels.add(Constant.TPOINT_WT_FDJJRQBHZC);
+                unicodels.add(Constant.TPOINT_WT_QDFDJJRQ);
+                unicodels.add(Constant.TPOINT_WT_FDJDSMS);
+                unicodels.add(Constant.TPOINT_WT_QDKLFS1);
+                unicodels.add(Constant.TPOINT_WT_QDKLFS2);
+                unicodels.add(Constant.TPOINT_WT_KLFSBH1);
+                unicodels.add(Constant.TPOINT_WT_KLFSBH2);
+                unicodels.add(Constant.TPOINT_WT_QDSLFS1);
+                unicodels.add(Constant.TPOINT_WT_QDSLFSBH1);
+                unicodels.add(Constant.TPOINT_WT_LQSYL);
+                unicodels.add(Constant.TPOINT_WT_FDJRHYBYW);
+                unicodels.add(Constant.TPOINT_WT_QDFDJRHYB);
+
+
+                namemap.put(Constant.TPOINT_WT_FDJJRQBHZC, "FDJJRQBHZC");
+                namemap.put(Constant.TPOINT_WT_QDFDJJRQ, "QDFDJJRQ");
+                namemap.put(Constant.TPOINT_WT_FDJDSMS, "FDJDSMS");
+                namemap.put(Constant.TPOINT_WT_QDKLFS1, "QDKLFS1");
+                namemap.put(Constant.TPOINT_WT_QDKLFS2, "QDKLFS2");
+                namemap.put(Constant.TPOINT_WT_KLFSBH1, "KLFSBH1");
+                namemap.put(Constant.TPOINT_WT_KLFSBH2, "KLFSBH2");
+                namemap.put(Constant.TPOINT_WT_QDSLFS1, "QDSLFS1");
+                namemap.put(Constant.TPOINT_WT_QDSLFSBH1, "QDSLFSBH1");
+                namemap.put(Constant.TPOINT_WT_LQSYL, "LQSYL");
+                namemap.put(Constant.TPOINT_WT_FDJRHYBYW, "FDJRHYBYW");
+                namemap.put(Constant.TPOINT_WT_QDFDJRHYB, "QDFDJRHYB");
+
+
+                list = windTurbineTestingPointDiService.getWindTurbineTestingPointDi2List(id, unicodels);
+
+                if (!list.isEmpty()) {
+
+                    for (WindTurbineTestingPointDi2 di : list) {
+                        if (namemap.containsKey(di.getUniformcode())) {
+                            totalWtDiPointMap(fdjmap, di.getId(), namemap.get(di.getUniformcode()));
+                        }
 
+                    }
+                }
 
-                if (!jczblist.isEmpty() && jczblist.size() == jczbls.size()) {
+                map.put("fdjmap", fdjmap);
 
 
-                    jczbmap.put("bjjd", MathUtil.twoBit(jczblist.get(0).getPointValueInDouble()));// 变桨角度
-                    jczbmap.put("phjd", MathUtil.twoBit(jczblist.get(1).getPointValueInDouble()));// 偏航角度
-                    jczbmap.put("dl1", MathUtil.twoBit(jczblist.get(2).getPointValueInDouble()));// 电流1
-                    jczbmap.put("dl2", MathUtil.twoBit(jczblist.get(3).getPointValueInDouble()));// 电流2
-                    jczbmap.put("dl3", MathUtil.twoBit(jczblist.get(4).getPointValueInDouble()));// 电流3
-                    jczbmap.put("dy1", MathUtil.twoBit(jczblist.get(5).getPointValueInDouble()));// 电压1
-                    jczbmap.put("dy2", MathUtil.twoBit(jczblist.get(6).getPointValueInDouble()));// 电压2
-                    jczbmap.put("dy3", MathUtil.twoBit(jczblist.get(7).getPointValueInDouble()));// 电压3
-                    jczbmap.put("wd1", MathUtil.twoBit(jczblist.get(8).getPointValueInDouble()));// 温度1
-                    jczbmap.put("wd2", MathUtil.twoBit(jczblist.get(9).getPointValueInDouble()));// 温度2
-                    jczbmap.put("wd3", MathUtil.twoBit(jczblist.get(10).getPointValueInDouble()));// 温度3
+/*************************************************发电机*************************************************************/
 
-                    Double fdjzs = MathUtil.twoBit(jczblist.get(11).getPointValueInDouble());
+/*************************************************偏航*************************************************************/
 
-                    if (InitialRunner.mlmap.containsKey(wt.getModelid())) {
-                        Equipmentmodel model = InitialRunner.mlmap.get(wt.getModelid());
 
+                Map<String, Double> phmap = new HashMap<>();
+
+                if (wt.getWindpowerstationid().equals(QS_FDC)) {
+
+
+                    totalWtAiPointMap(phmap, id, Constant.TPOINT_WT_DFJD, "DFJD");
+                    totalWtAiPointMap(phmap, id, Constant.QSTPOINT_WT_PHWZ, "PHWZ");
+
+
+                } else {
+                    totalWtAiPointMap(phmap, id, Constant.TPOINT_WT_DFJD, "DFJD");
+                    totalWtAiPointMap(phmap, id, Constant.TPOINT_WT_PHWZ, "PHWZ");
+
+
+                }
+
+                namemap = new HashMap<>();
+
+                unicodels = new ArrayList<>();
+
+                unicodels.add(Constant.TPOINT_WT_PHZJX);
+                unicodels.add(Constant.TPOINT_WT_PHYJX);
+                unicodels.add(Constant.TPOINT_WT_PHRQDQZC);
+                unicodels.add(Constant.TPOINT_WT_ZPHDZ);
+                unicodels.add(Constant.TPOINT_WT_PHDSCDK);
+                unicodels.add(Constant.TPOINT_WT_YPHDZ);
+                unicodels.add(Constant.TPOINT_WT_PHRQDQDZ);
+                unicodels.add(Constant.TPOINT_WT_PHRQDQSN);
+                unicodels.add(Constant.TPOINT_WT_PHBMQZL);
+                unicodels.add(Constant.TPOINT_WT_JLDZ);
+                unicodels.add(Constant.TPOINT_WT_PHCGQMTOK);
+                unicodels.add(Constant.TPOINT_WT_PHCGQOK);
+                unicodels.add(Constant.TPOINT_WT_PHZCRHYW);
+                unicodels.add(Constant.TPOINT_WT_PHRHBZCBH);
+                unicodels.add(Constant.TPOINT_WT_PHDJ1BH);
+                unicodels.add(Constant.TPOINT_WT_PHDJ2BH);
+                unicodels.add(Constant.TPOINT_WT_PHDJ3BH);
+                unicodels.add(Constant.TPOINT_WT_PHDJ4BH);
+
+
+                namemap.put(Constant.TPOINT_WT_PHZJX, "PHZJX");
+                namemap.put(Constant.TPOINT_WT_PHYJX, "PHYJX");
+                namemap.put(Constant.TPOINT_WT_PHRQDQZC, "PHRQDQZC");
+                namemap.put(Constant.TPOINT_WT_ZPHDZ, "ZPHDZ");
+                namemap.put(Constant.TPOINT_WT_PHDSCDK, "PHDSCDK");
+                namemap.put(Constant.TPOINT_WT_YPHDZ, "YPHDZ");
+                namemap.put(Constant.TPOINT_WT_PHRQDQDZ, "PHRQDQDZ");
+                namemap.put(Constant.TPOINT_WT_PHRQDQSN, "PHRQDQSN");
+                namemap.put(Constant.TPOINT_WT_PHBMQZL, "PHBMQZL");
+                namemap.put(Constant.TPOINT_WT_JLDZ, "JLDZ");
+                namemap.put(Constant.TPOINT_WT_PHCGQMTOK, "PHCGQMTOK");
+                namemap.put(Constant.TPOINT_WT_PHCGQOK, "PHCGQOK");
+                namemap.put(Constant.TPOINT_WT_PHZCRHYW, "PHZCRHYW");
+                namemap.put(Constant.TPOINT_WT_PHRHBZCBH, "PHRHBZCBH");
+                namemap.put(Constant.TPOINT_WT_PHDJ1BH, "PHDJ1BH");
+                namemap.put(Constant.TPOINT_WT_PHDJ2BH, "PHDJ2BH");
+                namemap.put(Constant.TPOINT_WT_PHDJ3BH, "PHDJ3BH");
+                namemap.put(Constant.TPOINT_WT_PHDJ4BH, "PHDJ4BH");
+
+
+                list = windTurbineTestingPointDiService.getWindTurbineTestingPointDi2List(id, unicodels);
+
+                if (!list.isEmpty()) {
+
+                    for (WindTurbineTestingPointDi2 di : list) {
+                        if (namemap.containsKey(di.getUniformcode())) {
+                            totalWtDiPointMap(phmap, di.getId(), namemap.get(di.getUniformcode()));
+                        }
+
+                    }
+                }
+
+                map.put("phmap", phmap);
+
+
+/*************************************************偏航*************************************************************/
+
+
+/*************************************************液压*************************************************************/
+
+
+                Map<String, Double> yymap = new HashMap<>();
+
+                totalWtAiPointMap(yymap, id, Constant.TPOINT_WT_YYXTYY, "YYXTYY");
+                totalWtAiPointMap(yymap, id, Constant.TPOINT_WT_ZZSCXTYY, "ZZSCXTYY");
+                totalWtAiPointMap(yymap, id, Constant.TPOINT_WT_FDJLQSWD, "FDJLQSWD");
+
+
+                namemap = new HashMap<>();
+
+                unicodels = new ArrayList<>();
+
+                unicodels.add(Constant.TPOINT_WT_YYYWDCX);
+                unicodels.add(Constant.TPOINT_WT_YYYYW);
+                unicodels.add(Constant.TPOINT_WT_YLSCYY);
+                unicodels.add(Constant.TPOINT_WT_YYBDJBH);
+                unicodels.add(Constant.TPOINT_WT_YYYJRQBH);
+
+
+                namemap.put(Constant.TPOINT_WT_YYYWDCX, "YYYWDCX");
+                namemap.put(Constant.TPOINT_WT_YYYYW, "YYYYW");
+                namemap.put(Constant.TPOINT_WT_YLSCYY, "YLSCYY");
+                namemap.put(Constant.TPOINT_WT_YYBDJBH, "YYBDJBH");
+                namemap.put(Constant.TPOINT_WT_YYYJRQBH, "YYYJRQBH");
+
+
+                list = windTurbineTestingPointDiService.getWindTurbineTestingPointDi2List(id, unicodels);
+
+                if (!list.isEmpty()) {
+
+                    for (WindTurbineTestingPointDi2 di : list) {
+                        if (namemap.containsKey(di.getUniformcode())) {
+                            totalWtDiPointMap(yymap, di.getId(), namemap.get(di.getUniformcode()));
+                        }
+
+                    }
+                }
+
+                map.put("yymap", yymap);
+
+
+/*************************************************液压*************************************************************/
+
+
+/*************************************************机舱*************************************************************/
+
+
+                Map<String, Double> jcmap = new HashMap<>();
+
+
+                if (wt.getWindpowerstationid().equals(QS_FDC)) {
+
+                    totalWtAiPointMap(jcmap, id, Constant.TPOINT_WT_YPWZ1, "YPWZ1");
+                    totalWtAiPointMap(jcmap, id, Constant.TPOINT_WT_YPWZ2, "YPWZ2");
+                    totalWtAiPointMap(jcmap, id, Constant.TPOINT_WT_YPWZ3, "YPWZ3");
+                    totalWtAiPointMap(jcmap, id, Constant.TPOINT_WT_FJSSFS, "FJSSFS");
+                    totalWtAiPointMap(jcmap, id, Constant.TPOINT_WT_FJGL, "FJGL");
+                    totalWtAiPointMap(jcmap, id, Constant.TPOINT_WT_GLYS, "GLYS");
+                    totalWtAiPointMap(jcmap, id, Constant.QSTPOINT_WT_BJJD1, "BJJD1");
+
+                    totalWtAiPointMap(jcmap, id, Constant.TPOINT_WT_FJPL, "FJPL");
+                    totalWtAiPointMap(jcmap, id, Constant.TPOINT_WT_WGGL, "WGGL");
+                    totalWtAiPointMap(jcmap, id, Constant.TPOINT_WT_FJFX, "FJFX");
+
+                    PointData po = getWtAiPointValue(id, Constant.QSTPOINT_WT_FDJZS);
+                    if (null != po) {
+                        Equipmentmodel model = InitialRunner.mlmap.get(wt.getModelid());
+                        Double fdjzs = po.getPointValueInDouble();
                         if (model.getPowerproduction() == 2000) {
-                            jczbmap.put("fdjzs", StringUtils.round(fdjzs * 9.55, 2));// 发电机转速
+                            jcmap.put("FDJZS", StringUtils.round(fdjzs * 9.55, 2));// 发电机转速
                         } else {
-                            jczbmap.put("fdjzs", fdjzs);// 发电机转速
+                            jcmap.put("FDJZS", fdjzs);// 发电机转速
                         }
                     }
 
+                    totalWtAiPointMap(jcmap, id, Constant.TPOINT_WT_YLZS, "YLZS");
+
+
                 } else {
-                    jczbmap.put("bjjd", 0.0);// 变桨角度
-                    jczbmap.put("phjd", 0.0);// 偏航角度
-                    jczbmap.put("dl1", 0.0);// 电流1
-                    jczbmap.put("dl2", 0.0);// 电流2
-                    jczbmap.put("dl3", 0.0);// 电流3
-                    jczbmap.put("dy1", 0.0);// 电压1
-                    jczbmap.put("dy2", 0.0);// 电压2
-                    jczbmap.put("dy3", 0.0);// 电压3
-                    jczbmap.put("wd1", 0.0);// 温度1
-                    jczbmap.put("wd2", 0.0);// 温度2
-                    jczbmap.put("wd3", 0.0);// 温度3
-                    jczbmap.put("fdjzs", 0.0);// 发电机转速
+                    totalWtAiPointMap(jcmap, id, Constant.TPOINT_WT_YPWZ1, "YPWZ1");
+                    totalWtAiPointMap(jcmap, id, Constant.TPOINT_WT_YPWZ2, "YPWZ2");
+                    totalWtAiPointMap(jcmap, id, Constant.TPOINT_WT_YPWZ3, "YPWZ3");
+                    totalWtAiPointMap(jcmap, id, Constant.TPOINT_WT_FJSSFS, "FJSSFS");
+                    totalWtAiPointMap(jcmap, id, Constant.TPOINT_WT_FJGL, "FJGL");
+                    totalWtAiPointMap(jcmap, id, Constant.TPOINT_WT_GLYS, "GLYS");
+                    totalWtAiPointMap(jcmap, id, Constant.TPOINT_WT_BJJD1, "BJJD1");
+
+                    totalWtAiPointMap(jcmap, id, Constant.TPOINT_WT_FJPL, "FJPL");
+                    totalWtAiPointMap(jcmap, id, Constant.TPOINT_WT_WGGL, "WGGL");
+                    totalWtAiPointMap(jcmap, id, Constant.TPOINT_WT_FJFX, "FJFX");
+
+                    PointData po = getWtAiPointValue(id, Constant.TPOINT_WT_FDJZS);
+                    if (null != po) {
+                        Equipmentmodel model = InitialRunner.mlmap.get(wt.getModelid());
+                        Double fdjzs = po.getPointValueInDouble();
+                        if (model.getPowerproduction() == 2000) {
+                            jcmap.put("FDJZS", StringUtils.round(fdjzs * 9.55, 2));// 发电机转速
+                        } else {
+                            jcmap.put("FDJZS", fdjzs);// 发电机转速
+                        }
+                    }
+                    totalWtAiPointMap(jcmap, id, Constant.TPOINT_WT_YLZS, "YLZS");
+                }
+
+
+                namemap = new HashMap<>();
+
+                unicodels = new ArrayList<>();
+
+                unicodels.add(Constant.TPOINT_WT_YYYYW2);
+                unicodels.add(Constant.TPOINT_WT_YYYWDCX2);
+                unicodels.add(Constant.TPOINT_WT_YLSCYY2);
+                unicodels.add(Constant.TPOINT_WT_YYBDJBH2);
+                unicodels.add(Constant.TPOINT_WT_YYYJRQBH2);
+                unicodels.add(Constant.TPOINT_WT_CLXYW2);
+                unicodels.add(Constant.TPOINT_WT_CLXRHYYL2);
+                unicodels.add(Constant.TPOINT_WT_CLXRHYJRBH2);
+                unicodels.add(Constant.TPOINT_WT_FDJJRQBHZC2);
+                unicodels.add(Constant.TPOINT_WT_LQSYL2);
+
+
+                namemap.put(Constant.TPOINT_WT_YYYYW2, "YYYYW2");
+                namemap.put(Constant.TPOINT_WT_YYYWDCX2, "YYYWDCX2");
+                namemap.put(Constant.TPOINT_WT_YLSCYY2, "YLSCYY2");
+                namemap.put(Constant.TPOINT_WT_YYBDJBH2, "YYBDJBH2");
+                namemap.put(Constant.TPOINT_WT_YYYJRQBH2, "YYYJRQBH2");
+                namemap.put(Constant.TPOINT_WT_CLXYW2, "CLXYW2");
+                namemap.put(Constant.TPOINT_WT_CLXRHYYL2, "CLXRHYYL2");
+                namemap.put(Constant.TPOINT_WT_CLXRHYJRBH2, "CLXRHYJRBH2");
+                namemap.put(Constant.TPOINT_WT_FDJJRQBHZC2, "FDJJRQBHZC2");
+                namemap.put(Constant.TPOINT_WT_LQSYL2, "LQSYL2");
+
+
+                list = windTurbineTestingPointDiService.getWindTurbineTestingPointDi2List(id, unicodels);
+
+                if (!list.isEmpty()) {
+
+                    for (WindTurbineTestingPointDi2 di : list) {
+                        if (namemap.containsKey(di.getUniformcode())) {
+                            totalWtDiPointMap(jcmap, di.getId(), namemap.get(di.getUniformcode()));
+                        }
 
+                    }
                 }
 
-                jczbls = new ArrayList<>();
+                map.put("jcmap", jcmap);
 
 
-                jczbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.TPOINT_WT_YLZS).getId());// 叶轮转速
-                jczbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.TPOINT_WT_DWZWD).getId());// 轴温1
-                jczbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.TPOINT_WT_GWZWD).getId());// 轴温2
-                jczbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.TPOINT_WT_CLXWD).getId());// 齿轮箱油温
+/*************************************************机舱*************************************************************/
+
+/*************************************************基础指标*************************************************************/
 
-                jczbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.TPOINT_WT_FJGL).getId());// 功率
-                jczbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.TPOINT_WT_FJSSFS).getId());// 风速
-                jczbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.TPOINT_WT_PJFS).getId());// 平均风速
-                jczbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.TPOINT_WT_GLYS).getId());// 功率因数
-                jczbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.TPOINT_WT_JCWWD).getId());// 环境温度
-                jczbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.TPOINT_WT_FJFX).getId());// 风向
-                jczbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.TPOINT_WT_FJPL).getId());// 风机频率
-                jczbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.TPOINT_WT_WGGL).getId());// 无功功率
-                jczbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.TPOINT_WT_FJKYL).getId());// 可利用率
-                jczbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.TPOINT_WT_RFDL).getId());// 日发电量
-                jczbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.TPOINT_WT_FDJZCAWD).getId());// 发电机轴承A温度
-                jczbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.TPOINT_WT_FDJZCBWD).getId());// 发电机轴承B温度
 
+                Map<String, Double> jczbmap = new HashMap<>();
 
+
+                List<String> jczbls = new ArrayList<>();
+
+
+                jczbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.TPOINT_WT_FJKYL).getId());// 可利用率
+                jczbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.TPOINT_WT_RFDL).getId());// 日发电量
                 jczbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.TPOINT_WT_LLGL).getId());// 风机理论功率
                 jczbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.TPOINT_WT_YFGL).getId());// 风机应发功率
                 jczbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.TPOINT_WT_RFDLBZ).getId());// 日理论发电量
                 jczbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.TPOINT_WT_RFDLZS).getId());//  日应发电量
-                jczbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.TPOINT_WT_JCWWD).getId());// 机舱外温度
-                jczbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.TPOINT_WT_JCWD).getId());//  机舱温度
-                jczbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.TPOINT_WT_TDGWD).getId());// 塔底柜温度
-                jczbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.TPOINT_WT_JCGWD).getId());// 机舱柜温度
                 jczbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.FJZT).getId());// 风机状态
-                jczbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.TPOINT_WT_DFJD).getId());// 对风角
                 jczbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.TPOINT_WT_PJGL).getId());// 平均风速功率
-
                 jczbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.RGZSSDL).getId());// 风机日故障损失电量
                 jczbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.RJXSSDL).getId());// 风机日检修损失电量
                 jczbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.RQFSSDL).getId());// 风机日欠发损失电量
                 jczbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.RXDSSDL).getId());// 风机日限电损失电量
-
                 jczbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.RGZSSDL).getId());// 日场内受累检修
                 jczbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.RJXSSDL).getId());// 日场内受累故障
                 jczbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.RQFSSDL).getId());// 日场外受累电网
                 jczbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.RXDSSDL).getId());// 日场外受累天气
 
 
-                jczblist = realApiUtil.getRealData(jczbls);
+                List<PointData> jczblist = realApiUtil.getRealData(jczbls);
 
 
                 if (!jczblist.isEmpty() && jczblist.size() == jczbls.size()) {
 
-                    jczbmap.put("ylzs", MathUtil.twoBit(jczblist.get(0).getPointValueInDouble()));// 叶轮转速
-                    jczbmap.put("zw1", MathUtil.twoBit(jczblist.get(1).getPointValueInDouble()));// 轴温1
-                    jczbmap.put("zw2", MathUtil.twoBit(jczblist.get(2).getPointValueInDouble()));// 轴温2
-                    jczbmap.put("clxwd", MathUtil.twoBit(jczblist.get(3).getPointValueInDouble()));// 齿轮箱油温
-                    jczbmap.put("gl", MathUtil.twoBit(jczblist.get(4).getPointValueInDouble()));// 功率
-                    jczbmap.put("fs", MathUtil.twoBit(jczblist.get(5).getPointValueInDouble()));// 风速
-                    jczbmap.put("pjfs", MathUtil.twoBit(jczblist.get(6).getPointValueInDouble()));// 平均风速
-                    jczbmap.put("glys", MathUtil.twoBit(jczblist.get(7).getPointValueInDouble()));// 功率因数
-                    jczbmap.put("hjwd", MathUtil.twoBit(jczblist.get(8).getPointValueInDouble()));// 环境温度
-                    jczbmap.put("fx", MathUtil.twoBit(jczblist.get(9).getPointValueInDouble()));// 风向
-                    jczbmap.put("fjpl", MathUtil.twoBit(jczblist.get(10).getPointValueInDouble()));// 风机频率
-                    jczbmap.put("wggl", MathUtil.twoBit(jczblist.get(11).getPointValueInDouble()));// 无功功率
-                    jczbmap.put("klyl", MathUtil.twoBit(jczblist.get(12).getPointValueInDouble()));// 可利用率
-                    double rfdl = MathUtil.twoBit(jczblist.get(13).getPointValueInDouble());
-                    jczbmap.put("rfdl", rfdl);// 日发电量
-                    jczbmap.put("zcwda", MathUtil.twoBit(jczblist.get(14).getPointValueInDouble()));// 发电机轴承A温度
-                    jczbmap.put("zcwdb", MathUtil.twoBit(jczblist.get(15).getPointValueInDouble()));// 发电机轴承B温度
-
-                    jczbmap.put("llgl", MathUtil.twoBit(jczblist.get(16).getPointValueInDouble()));// 风机理论功率
-                    jczbmap.put("yfgl", MathUtil.twoBit(jczblist.get(17).getPointValueInDouble()));// 风机应发功率
-                    jczbmap.put("rlldl", MathUtil.twoBit(jczblist.get(18).getPointValueInDouble()));// 日理论发电量
-                    jczbmap.put("ryfdl", MathUtil.twoBit(jczblist.get(19).getPointValueInDouble()));// 日应发电量
-                    jczbmap.put("jcwwd", MathUtil.twoBit(jczblist.get(20).getPointValueInDouble()));// 机舱外温度
-                    jczbmap.put("jcwd", MathUtil.twoBit(jczblist.get(21).getPointValueInDouble()));// 机舱温度
-                    jczbmap.put("tdwd", MathUtil.twoBit(jczblist.get(22).getPointValueInDouble()));// 塔底柜温度
-                    jczbmap.put("jcgwd", MathUtil.twoBit(jczblist.get(23).getPointValueInDouble()));// 机舱柜温度
-                    jczbmap.put("fjzt", MathUtil.twoBit(jczblist.get(24).getPointValueInDouble()));// 风机状态
-                    jczbmap.put("dfjd", MathUtil.twoBit(jczblist.get(25).getPointValueInDouble()));// 对风角度
-
-
-                    jczbmap.put("rpjgl", MathUtil.twoBit(jczblist.get(26).getPointValueInDouble()));// 平均风速功率
+
+                    jczbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.TPOINT_WT_RFDLBZ).getId());// 日理论发电量
+                    jczbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.TPOINT_WT_RFDLZS).getId());//  日应发电量
+                    jczbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.FJZT).getId());// 风机状态
+                    jczbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.TPOINT_WT_PJGL).getId());// 平均风速功率
+                    jczbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.RGZSSDL).getId());// 风机日故障损失电量
+                    jczbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.RJXSSDL).getId());// 风机日检修损失电量
+                    jczbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.RQFSSDL).getId());// 风机日欠发损失电量
+                    jczbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.RXDSSDL).getId());// 风机日限电损失电量
+                    jczbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.RGZSSDL).getId());// 日场内受累检修
+                    jczbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.RJXSSDL).getId());// 日场内受累故障
+                    jczbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.RQFSSDL).getId());// 日场外受累电网
+                    jczbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.RXDSSDL).getId());// 日场外受累天气
+
+
+                    jczbmap.put("FJKYL", MathUtil.twoBit(jczblist.get(0).getPointValueInDouble()));// 可利用率
+                    double rfdl = MathUtil.twoBit(jczblist.get(1).getPointValueInDouble());
+                    jczbmap.put("RFDL", rfdl);// 日发电量
+                    jczbmap.put("LLGL", MathUtil.twoBit(jczblist.get(2).getPointValueInDouble()));// 风机理论功率
+                    jczbmap.put("YFGL", MathUtil.twoBit(jczblist.get(3).getPointValueInDouble()));// 风机应发功率
+                    jczbmap.put("RFDLZS", MathUtil.twoBit(jczblist.get(4).getPointValueInDouble()));// 日应发电量
+                    jczbmap.put("FJZT", MathUtil.twoBit(jczblist.get(5).getPointValueInDouble()));// 风机状态
+                    jczbmap.put("PJGL", MathUtil.twoBit(jczblist.get(6).getPointValueInDouble()));// 平均风速功率
                     double rssdl = 0.0;
-                    double rgzss = MathUtil.twoBit(jczblist.get(27).getPointValueInDouble());
-                    double rjxss = MathUtil.twoBit(jczblist.get(28).getPointValueInDouble());
-                    double rxnss = MathUtil.twoBit(jczblist.get(29).getPointValueInDouble());
-                    double rxdss = MathUtil.twoBit(jczblist.get(30).getPointValueInDouble());
+                    double rgzss = MathUtil.twoBit(jczblist.get(7).getPointValueInDouble());
+                    double rjxss = MathUtil.twoBit(jczblist.get(8).getPointValueInDouble());
+                    double rxnss = MathUtil.twoBit(jczblist.get(9).getPointValueInDouble());
+                    double rxdss = MathUtil.twoBit(jczblist.get(10).getPointValueInDouble());
 
-                    double rlzssdl = MathUtil.twoBit(jczblist.get(31).getPointValueInDouble()); // 日场内受累检修
-                    double rszssdl = MathUtil.twoBit(jczblist.get(32).getPointValueInDouble()); // 日场内受累故障
-                    double rwzssdl = MathUtil.twoBit(jczblist.get(33).getPointValueInDouble()); // 日场外受累电网
-                    double rtzssdl = MathUtil.twoBit(jczblist.get(34).getPointValueInDouble()); // 日场外受累天气
+                    double rlzssdl = MathUtil.twoBit(jczblist.get(11).getPointValueInDouble()); // 日场内受累检修
+                    double rszssdl = MathUtil.twoBit(jczblist.get(12).getPointValueInDouble()); // 日场内受累故障
+                    double rwzssdl = MathUtil.twoBit(jczblist.get(13).getPointValueInDouble()); // 日场外受累电网
+                    double rtzssdl = MathUtil.twoBit(jczblist.get(14).getPointValueInDouble()); // 日场外受累天气
 
-                    jczbmap.put("rxnss", rxnss);// 日欠发损失电量
-                    jczbmap.put("rgzss", StringUtils.round(rgzss + rlzssdl, 2));// 日故障损失电量
-                    jczbmap.put("rwhss", StringUtils.round(rjxss + rszssdl, 2));// 日维护损失电量
-                    jczbmap.put("rxdss", rxdss);// 日限电损失电量
-                    jczbmap.put("rslss", StringUtils.round(rwzssdl + rtzssdl, 2));// 日受累损失电量
+                    jczbmap.put("RXNSSDL", rxnss);// 日欠发损失电量
+                    jczbmap.put("RGZSSDL", StringUtils.round(rgzss + rlzssdl, 2));// 日故障损失电量
+                    jczbmap.put("RJXSSDL", StringUtils.round(rjxss + rszssdl, 2));// 日维护损失电量
+                    jczbmap.put("RXDSSDL", rxdss);// 日限电损失电量
+                    jczbmap.put("RSLSSDL", StringUtils.round(rwzssdl + rtzssdl, 2));// 日受累损失电量
 
 
                     rssdl = rgzss + rjxss + rxnss + rxdss + rwzssdl + rtzssdl + rszssdl + rlzssdl;
 
-                    jczbmap.put("rssdl", StringUtils.round(rssdl, 2));// 风机日损失电量
+                    jczbmap.put("RSSDL", StringUtils.round(rssdl, 2));// 风机日损失电量
 
-                    jczbmap.put("rlldl", StringUtils.round(rssdl + rfdl, 2));// 风机日理论电量
+                    jczbmap.put("RLLFDL", StringUtils.round(rssdl + rfdl, 2));// 风机日理论电量
                 } else {
-                    jczbmap.put("ylzs", 0.0);// 叶轮转速
-                    jczbmap.put("zw1", 0.0);// 轴温1
-                    jczbmap.put("zw2", 0.0);// 轴温2
-                    jczbmap.put("clxwd", 0.0);// 齿轮箱油温
-                    jczbmap.put("gl", 0.0);// 功率
-                    jczbmap.put("fs", 0.0);// 风速
-                    jczbmap.put("pjfs", 0.0);// 平均风速
-                    jczbmap.put("glys", 0.0);// 功率因数
-                    jczbmap.put("hjwd", 0.0);// 环境温度
-                    jczbmap.put("fx", 0.0);// 风向
-                    jczbmap.put("fjpl", 0.0);// 风机频率
-                    jczbmap.put("wggl", 0.0);// 无功功率
-                    jczbmap.put("klyl", 0.0);// 可利用率
-                    jczbmap.put("rfdl", 0.0);// 日发电量
-                    jczbmap.put("zcwda", 0.0);// 发电机轴承A温度
-                    jczbmap.put("zcwdb", 0.0);// 发电机轴承B温度
-
-                    jczbmap.put("llgl", 0.0);// 风机理论功率
-                    jczbmap.put("yfgl", 0.0);// 风机应发功率
-                    jczbmap.put("rlldl", 0.0);// 日理论发电量
-                    jczbmap.put("ryfdl", 0.0);// 日应发电量
-                    jczbmap.put("jcwwd", 0.0);// 机舱外温度
-                    jczbmap.put("jcwd", 0.0);// 机舱温度
-                    jczbmap.put("tdwd", 0.0);// 塔底柜温度
-                    jczbmap.put("jcgwd", 0.0);// 机舱柜温度
-                    jczbmap.put("fjzt", 0.0);// 风机状态
-                    jczbmap.put("dfjd", 0.0);// 对风角度
-
-                    jczbmap.put("rpjgl", 0.0);// 平均风速功率
-                    jczbmap.put("rxnss", 0.0);// 日欠发损失电量
-                    jczbmap.put("rgzss", 0.0);// 日故障损失电量
-                    jczbmap.put("rwhss", 0.0);// 日维护损失电量
-                    jczbmap.put("rxdss", 0.0);// 日限电损失电量
-                    jczbmap.put("rslss", 0.0);// 日受累损失电量
-                    jczbmap.put("rssdl", 0.0);// 风机日损失电量
-                    jczbmap.put("rlldl", 0.0);// 风机日理论电量
+                    jczbmap.put("FJKYL",0.0);// 可利用率
+                    jczbmap.put("RFDL", 0.0);// 日发电量
+                    jczbmap.put("LLGL", 0.0);// 风机理论功率
+                    jczbmap.put("YFGL", 0.0);// 风机应发功率
+                    jczbmap.put("RFDLZS",0.0);// 日应发电量
+                    jczbmap.put("FJZT",0.0);// 风机状态
+                    jczbmap.put("PJGL",0.0);// 平均风速功率
+
+                    jczbmap.put("RXNSSDL", 0.0);// 日欠发损失电量
+                    jczbmap.put("RGZSSDL", 0.0);// 日故障损失电量
+                    jczbmap.put("RJXSSDL", 0.0);// 日维护损失电量
+                    jczbmap.put("RXDSSDL", 0.0);// 日限电损失电量
+                    jczbmap.put("RSLSSDL", 0.0);// 日受累损失电量
+
+                    jczbmap.put("RSSDL", 0.0);// 风机日损失电量
+                    jczbmap.put("RLLFDL", 0.0);// 风机日理论电量
                 }
 
                 map.put("jczbmap", jczbmap);
@@ -294,14 +600,15 @@ public class WtInfoPushService {
 
 /*************************************************基础指标*************************************************************/
 
-        }
+
+            }
 
 
 /*************************************************关系库指标**************************************************************/
 
             Map<String, Double> gxkmap = new HashMap<>();
-            Date date=DateUtils.truncate(new Date());
-            List<WindTurbineInfoDay> wtdls = windturbineinfodayService.getWindturbineinfo(id,date);
+            Date date = DateUtils.truncate(new Date());
+            List<WindTurbineInfoDay> wtdls = windturbineinfodayService.getWindturbineinfo(id, date);
             if (!wtdls.isEmpty()) {
                 WindTurbineInfoDay wd = wtdls.get(0);
                 gxkmap.put("ndxkyss", wd.getYeardxkyxs());
@@ -323,16 +630,57 @@ public class WtInfoPushService {
                 gxkmap.put("yyxxs", 0.0);
                 gxkmap.put("ygzxs", 0.0);
                 gxkmap.put("yjxxs", 0.0);
-                gxkmap.put("ytjxs",0.0);
+                gxkmap.put("ytjxs", 0.0);
             }
 
             map.put("gxkmap", gxkmap);
         }
 /*************************************************关系库指标**************************************************************/
 
+
+        return map;
+    }
+
+    private PointData getWtAiPointValue(String id, String unicode) throws Exception {
+
+        PointData pointData = null;
+        if (StringUtils.notEmp(id) && StringUtils.notEmp(unicode)) {
+            WindTurbineTestingPointAi2 point = windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, unicode);
+            if (StringUtils.notEmp(point.getId())) {
+                pointData = realApiUtil.getRealData(point.getId());
+
+            }
+        }
+
+        return pointData;
+    }
+
+    private Map<String, Double> totalWtAiPointMap(Map<String, Double> map, String id, String unicode, String name) throws Exception {
+
+
+        if (StringUtils.notEmp(map) && StringUtils.notEmp(id) && StringUtils.notEmp(unicode) && StringUtils.notEmp(name)) {
+            WindTurbineTestingPointAi2 point = windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, unicode);
+            if (StringUtils.notEmp(point.getId())) {
+                PointData pointData = realApiUtil.getRealData(point.getId());
+                if (StringUtils.notEmp(pointData)) {
+                    map.put(name, StringUtils.round(pointData.getPointValueInDouble(), 2));
+                }
+            }
+        }
+
         return map;
     }
 
+    private Map<String, Double> totalWtDiPointMap(Map<String, Double> map, String pointId, String name) throws Exception {
+
+
+        PointData pointData = realApiUtil.getRealData(pointId);
+        if (StringUtils.notEmp(pointData)) {
+            map.put(name, StringUtils.round(pointData.getPointValueInDouble(), 2));
+        }
+
+        return map;
+    }
 
 }
 

+ 30 - 3
src/main/java/com/gyee/frame/shiro/config/ShiroConfig.java

@@ -1,5 +1,6 @@
 package com.gyee.frame.shiro.config;
 
+import at.pollux.thymeleaf.shiro.dialect.ShiroDialect;
 import com.gyee.frame.shiro.service.MyShiroRealm;
 import org.apache.shiro.authc.credential.HashedCredentialsMatcher;
 import org.apache.shiro.cache.CacheManager;
@@ -17,7 +18,7 @@ import org.apache.shiro.web.session.mgt.DefaultWebSessionManager;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 
-import at.pollux.thymeleaf.shiro.dialect.ShiroDialect;
+import java.util.concurrent.ConcurrentHashMap;
 
 
 /**
@@ -30,6 +31,10 @@ import at.pollux.thymeleaf.shiro.dialect.ShiroDialect;
 @Configuration
 public class ShiroConfig {
 
+
+	public static ConcurrentHashMap<String, ConcurrentHashMap<String,Object>> usercacheMap = new ConcurrentHashMap();
+
+
 	/**
 	 * 这是shiro的大管家,相当于mybatis里的SqlSessionFactoryBean
 	 * @param securityManager
@@ -73,9 +78,22 @@ public class ShiroConfig {
 	 * @author gyee
 	 * @Date 2019年11月2日 下午12:49:49
 	 */
+//	@Bean
+//	public  DefaultWebSessionManager sessionManager() {
+//		DefaultWebSessionManager defaultWebSessionManager=new DefaultWebSessionManager();
+//		// 设置session过期时间3600s
+//		Long timeout=60L*1000*60;//毫秒级别
+//		defaultWebSessionManager.setGlobalSessionTimeout(timeout);
+//		return defaultWebSessionManager;
+//	}
+
+
 	@Bean
-	public  DefaultWebSessionManager sessionManager() {
-		DefaultWebSessionManager defaultWebSessionManager=new DefaultWebSessionManager();
+	public DefaultWebSessionManager sessionManager() {
+		DefaultWebSessionManager defaultWebSessionManager = new DefaultWebSessionManager();
+		Cookie cookie = defaultWebSessionManager.getSessionIdCookie();
+		cookie.setSecure(false);
+		cookie.setName("MySessionId");
 		// 设置session过期时间3600s
 		Long timeout=60L*1000*60;//毫秒级别
 		defaultWebSessionManager.setGlobalSessionTimeout(timeout);
@@ -102,7 +120,16 @@ public class ShiroConfig {
 		Cookie cookie = new SimpleCookie("rememberMe");
         cookie.setHttpOnly(true);//通过js脚本将无法读取到cookie信息
         cookie.setMaxAge(60 * 60 * 24 * 30);//cookie保存30天
+		cookie.setSecure(false);
 		CookieRememberMeManager manager=new CookieRememberMeManager();
+
+		//rememberme cookie加密的密钥 建议每个项目都不一样 默认AES算法 密钥长度(128 256 512 位),通过以下代码可以获取
+		//KeyGenerator keygen = KeyGenerator.getInstance("AES");
+		//SecretKey deskey = keygen.generateKey();
+		//System.out.println(Base64.encodeToString(deskey.getEncoded()));
+//		byte[] cipherKey = Base64.decode("wGiHplamyXlVB11UXWol8g==");
+//		manager.setCipherKey(cipherKey);
+
 		manager.setCookie(cookie);
 		return manager;
 	}

+ 1 - 0
src/main/java/com/gyee/frame/shiro/config/ShiroFilterMapFactory.java

@@ -40,6 +40,7 @@ user:例如/admins/user/**=user没有参数表示必须存在用户,当登入
 		//对所有用户认证
 		filterChainDefinitionMap.put("/static/**", "anon");
 		filterChainDefinitionMap.put("/admin/login", "anon");
+		filterChainDefinitionMap.put("/admin/usermenu", "anon");
 		filterChainDefinitionMap.put("/admin/logout", "logout");
 		//放验证码
 		filterChainDefinitionMap.put("/captcha/**", "anon");

+ 58 - 0
src/main/java/com/gyee/frame/shiro/config/ShiroService.java

@@ -0,0 +1,58 @@
+package com.gyee.frame.shiro.config;
+
+
+import com.gyee.frame.model.auto.TsysUser;
+import com.gyee.frame.model.custom.TokenUser;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+
+@Service
+public class ShiroService {
+
+
+    @Resource
+    TokenCache tokenCache;
+
+    //10天后过期
+    public final long EXPIRE = 10 * 24 * 60 * 60;
+
+    public Map<String, Object> createToken(TsysUser user){
+        Map<String, Object> result = new HashMap<>();
+        if (user == null)
+            return result;
+
+        //生成一个token id
+        String token = TokenGenerator.generateValue();
+        //当前时间
+        Date now = new Date();
+        //过期时间
+        long expireTime = now.getTime() + EXPIRE * 1000;
+
+        TokenUser tokenUser = new TokenUser();
+        tokenUser.setLaborNum(user.getId());
+        tokenUser.setLaborName(user.getUsername());
+        tokenUser.setPassword(user.getPassword());
+        tokenUser.setDepartment(user.getDepName());
+        tokenUser.setExpireTime(expireTime);
+
+        // 保存并更新token
+        tokenCache.saveToken(token, tokenUser);
+
+        result.put("token", token);
+        result.put("user", tokenUser);
+
+        return result;
+    }
+
+    public void logout(String token) {
+       tokenCache.removeToken(token);
+    }
+
+    public TokenUser findToken(String token) {
+        return tokenCache.findUserByToken(token);
+    }
+}

+ 47 - 0
src/main/java/com/gyee/frame/shiro/config/TokenCache.java

@@ -0,0 +1,47 @@
+package com.gyee.frame.shiro.config;
+
+
+import com.gyee.frame.model.custom.TokenUser;
+import org.springframework.stereotype.Component;
+
+import java.util.HashMap;
+import java.util.Map;
+
+@Component
+public class TokenCache {
+
+    private Map<String, TokenUser> tokenMap = new HashMap<>();
+
+    public TokenUser getToken(String tokenId) {
+        TokenUser data = null;
+        if (tokenMap.containsKey(tokenId)) {
+            data = tokenMap.get(tokenId);
+        }
+        return data;
+    }
+
+    public boolean saveToken(String token, TokenUser user) {
+        if (tokenMap.containsKey(token)){
+            return false;
+        }
+        tokenMap.put(token, user);
+
+        return  true;
+    }
+
+    public boolean removeToken(String token){
+       if (tokenMap.containsKey(token)){
+           tokenMap.remove(token);
+           return true;
+       }
+       return false;
+    }
+
+    public TokenUser findUserByToken(String token){
+        TokenUser user = null;
+        if (tokenMap.containsKey(token))
+            user = tokenMap.get(token);
+
+        return user;
+    }
+}

+ 44 - 0
src/main/java/com/gyee/frame/shiro/config/TokenGenerator.java

@@ -0,0 +1,44 @@
+package com.gyee.frame.shiro.config;
+
+import java.security.MessageDigest;
+import java.util.UUID;
+
+public class TokenGenerator {
+
+    private TokenGenerator(){}
+
+    public static String generateValue() {
+        return generateValue(UUID.randomUUID().toString());
+    }
+
+    private static final char[] hexCode = "0123456789abcdefgh".toCharArray();
+
+    private static String toHexString(byte[] data) {
+        if (data == null) {
+            return null;
+        }
+        StringBuilder r = new StringBuilder(data.length * 2);
+        for (byte b : data) {
+            r.append(hexCode[(b >> 4) & 0xF]);
+            r.append(hexCode[(b & 0xF)]);
+        }
+        return r.toString();
+    }
+
+    /**
+     * 生成Token
+     * @param param
+     * @return
+     */
+    private static String generateValue(String param) {
+        try {
+            MessageDigest algorithm = MessageDigest.getInstance("MD5");
+            algorithm.reset();
+            algorithm.update(param.getBytes());
+            byte[] messageDigest = algorithm.digest();
+            return toHexString(messageDigest);
+        } catch (Exception e) {
+            throw new RuntimeException("生成Token失败");
+        }
+    }
+}

+ 18 - 6
src/main/java/com/gyee/frame/shiro/util/ShiroUtils.java

@@ -1,15 +1,18 @@
 package com.gyee.frame.shiro.util;
 
+import com.gyee.frame.model.auto.TsysUser;
+import com.gyee.frame.shiro.config.ShiroConfig;
+import com.gyee.frame.shiro.service.MyShiroRealm;
+import com.gyee.frame.util.BeanUtils;
+import com.gyee.frame.util.StringUtils;
 import org.apache.shiro.SecurityUtils;
 import org.apache.shiro.mgt.RealmSecurityManager;
 import org.apache.shiro.session.Session;
 import org.apache.shiro.subject.PrincipalCollection;
 import org.apache.shiro.subject.SimplePrincipalCollection;
 import org.apache.shiro.subject.Subject;
-import com.gyee.frame.model.auto.TsysUser;
-import com.gyee.frame.shiro.service.MyShiroRealm;
-import com.gyee.frame.util.BeanUtils;
-import com.gyee.frame.util.StringUtils;
+
+import java.util.concurrent.ConcurrentHashMap;
 
 
 /**
@@ -65,8 +68,17 @@ public class ShiroUtils {
         Object obj = getSubjct().getPrincipal();
         if (StringUtils.isNotNull(obj))
         {
-            user = new TsysUser();
-            BeanUtils.copyBeanProp(user, obj);
+            if(ShiroConfig.usercacheMap.containsKey(getSessionId()))
+            {
+                ConcurrentHashMap<String,Object> cmap=ShiroConfig.usercacheMap.get(getSessionId());
+                user =(TsysUser)cmap.get("user");
+                BeanUtils.copyBeanProp(user, obj);
+            }else
+            {
+                user = new TsysUser();
+                BeanUtils.copyBeanProp(user, obj);
+            }
+
         }
         return user;
     }