Explorar el Código

风机报警和升压站报警功能修改优化

shilin hace 1 año
padre
commit
2f92a37042

+ 35 - 6
alarm-web/pom.xml

@@ -153,12 +153,7 @@
             <artifactId>poi</artifactId>
             <version>3.17</version>
         </dependency>
-        <dependency>
-            <groupId>cn.hutool</groupId>
-            <artifactId>hutool-all</artifactId>
-            <version>5.1.1</version>
-            <scope>test</scope>
-        </dependency>
+
         <dependency>
             <groupId>com.taosdata.jdbc</groupId>
             <artifactId>taos-jdbcdriver</artifactId>
@@ -176,6 +171,40 @@
             <artifactId>hutool-all</artifactId>
             <version>5.1.1</version>
         </dependency>
+
+        <!-- 添加swagger2 -->
+        <dependency>
+            <groupId>io.springfox</groupId>
+            <artifactId>springfox-swagger2</artifactId>
+            <version>2.9.2</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>io.swagger</groupId>
+                    <artifactId>swagger-annotations</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>io.swagger</groupId>
+                    <artifactId>swagger-models</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>io.springfox</groupId>
+            <artifactId>springfox-swagger-ui</artifactId>
+            <version>2.9.2</version>
+        </dependency>
+        <dependency>
+            <groupId>io.swagger</groupId>
+            <artifactId>swagger-annotations</artifactId>
+            <version>1.5.21</version>
+        </dependency>
+        <dependency>
+            <groupId>io.swagger</groupId>
+            <artifactId>swagger-models</artifactId>
+            <version>1.5.21</version>
+        </dependency>
+
+
     </dependencies>
     <build>
         <plugins>

+ 18 - 2
alarm-web/src/main/java/com/gyee/alarm/AlarmWeb.java

@@ -1,16 +1,32 @@
 package com.gyee.alarm;
 
+import lombok.extern.log4j.Log4j2;
 import org.mybatis.spring.annotation.MapperScan;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.context.ConfigurableApplicationContext;
+import org.springframework.core.env.Environment;
 
+import java.net.InetAddress;
 
+@Log4j2
 @SpringBootApplication
 @MapperScan("com.gyee.alarm.mapper")
 public class AlarmWeb {
     public static void main(String[] args) throws Exception {
-        SpringApplication.run(AlarmWeb.class, args);
+        ConfigurableApplicationContext application = SpringApplication.run(AlarmWeb.class, args);
 
-        System.out.println("完成");
+        Environment env = application.getEnvironment();
+        String ip = InetAddress.getLocalHost().getHostAddress();
+        String port = env.getProperty("server.port");
+        String path = env.getProperty("server.servlet.context-path");
+
+
+        log.info("\n-------------------------------------------------------------------\n\t" +
+                "智能报警系统启动成功,访问路径如下:\n\t" +
+                "本地路径: \t\thttp://localhost:" + port + path + "\n\t" +
+                "网络地址: \t\thttp://" + ip + ":" + port + path + "\n\t" +
+                "API文档: \t\thttp://" + ip + ":" + port + path + "/swagger-ui.html\n" +
+                "-----------------------------------------------------------------------");
     }
 }

+ 76 - 0
alarm-web/src/main/java/com/gyee/alarm/config/SwagerrConfiguration.java

@@ -0,0 +1,76 @@
+package com.gyee.alarm.config;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
+import springfox.documentation.builders.ApiInfoBuilder;
+import springfox.documentation.builders.PathSelectors;
+import springfox.documentation.builders.RequestHandlerSelectors;
+import springfox.documentation.service.ApiInfo;
+import springfox.documentation.spi.DocumentationType;
+import springfox.documentation.spring.web.plugins.Docket;
+import springfox.documentation.swagger2.annotations.EnableSwagger2;
+
+/**
+ * Swagger 配置文件
+ * @ClassName: Swagger
+ * @Description: 配置文件
+ * @author gyee
+ * @date 2022年11月10日
+ *
+ */
+@Configuration(value="true")
+@EnableSwagger2 //启动swagger注解 启动服务,浏览器输入"http://localhost:8080/swagger-ui.html"
+public class SwagerrConfiguration implements WebMvcConfigurer {
+
+
+    @Bean
+    public Docket createRestApi() {
+        return new Docket(DocumentationType.SWAGGER_2)
+                //.host("")
+                // 用来创建该API的基本信息,展示在文档的页面中(自定义展示的信息)
+                .apiInfo(apiInfo())
+                // 设置哪些接口暴露给Swagger展示
+                .select()
+                // 扫描所有有注解的api,用这种方式更灵活
+                .apis(RequestHandlerSelectors.basePackage("com.gyee.alarm"))
+                // 扫描指定包中的swagger注解
+                //.apis(RequestHandlerSelectors.basePackage("com.gyee.health.controller"))
+                // 扫描所有 .apis(RequestHandlerSelectors.any())
+                .paths(PathSelectors.any())
+                .build();
+    }
+
+    private ApiInfo apiInfo() {
+        return new ApiInfoBuilder()
+                //设置标题
+                .title("后台管理API文档")
+                //描述
+                .description("后台管理项目")
+                //作者信息
+                //.contact(new Contact(v2Config.getName(), null, V2Config.getEmail_account()))
+                //服务条款URL
+                .termsOfServiceUrl("")
+                //版本
+                .version("版本号:1.0")
+                .build();
+    }
+
+    @Override
+    public void addResourceHandlers(ResourceHandlerRegistry registry) {
+
+        // 解决静态资源无法访问
+
+        registry.addResourceHandler("/**").addResourceLocations("classpath:/static/");
+
+        // 解决swagger无法访问
+
+        registry.addResourceHandler("/swagger-ui.html").addResourceLocations("classpath:/META-INF/resources/");
+
+        // 解决swagger的js文件无法访问
+
+        registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/");
+
+    }
+}

+ 4 - 4
alarm-web/src/main/java/com/gyee/alarm/config/interceptor/MyInterceptor.java

@@ -34,10 +34,10 @@ public class MyInterceptor  implements HandlerInterceptor {
 
 	@Override
 	public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object arg2) throws Exception {
-		String token = request.getHeader("token");
-		if (!tokenService.sessionMap.containsKey(token)) {
-			throw new LoginModeException();
-		}
+//		String token = request.getHeader("token");
+//		if (!tokenService.sessionMap.containsKey(token)) {
+//			throw new LoginModeException();
+//		}
 		return true;// 只有返回true才会继续向下执行,返回false取消当前请求
 	}
 	

+ 91 - 91
alarm-web/src/main/java/com/gyee/alarm/config/interceptor/MyWebAppConfigurer.java

@@ -1,91 +1,91 @@
-package com.gyee.alarm.config.interceptor;
-
-import org.springframework.context.annotation.Configuration;
-import org.springframework.web.servlet.config.annotation.*;
-
-/**
- * 拦截器
-* @ClassName: MyWebAppConfigurer
-* @author fuce
-* @date 2018年6月3日
-*
- */
-@Configuration
-public class MyWebAppConfigurer  extends  WebMvcConfigurationSupport  {
-	
-	//private static Logger logger=LoggerFactory.getLogger(WebMvcConfigurationSupport.class);
-
-	/** 解决跨域问题 **/
-	@Override
-	public void addCorsMappings(CorsRegistry registry){
-	/*	
-			registry.addMapping("/**")
-			// 设置允许跨域请求的域名
-			.allowedOriginPatterns("*")
-			// 是否允许证书
-			.allowCredentials(true)
-			// 设置允许的方法
-			.allowedMethods("GET", "POST", "DELETE", "PUT")
-			// 设置允许的header属性
-			.allowedHeaders("*")
-			// 跨域允许时间
-			.maxAge(3600);
-			super.addCorsMappings(registry);
-		*/
-	}
-	
-	/** 添加拦截器 **/
-	@Override
-	protected void addInterceptors(InterceptorRegistry registry){
-
-
-//       下面这句代码相当于添加一个拦截器   添加的拦截器就是我们刚刚创建的
-		registry.addInterceptor(new MyInterceptor())
-//       addPathPatterns()配置我们要拦截哪些路径 addPathPatterns("/**")表示拦截所有请求,包括我们的静态资源
-				.addPathPatterns()
-//       excludePathPatterns()表示我们要放行哪些(表示不用经过拦截器)
-//       excludePathPatterns("/","/login")表示放行“/”与“/login”请求
-//       如果有静态资源的时候可以在这个地方放行
-				.excludePathPatterns("/","/auth/login");
-
-		super.addInterceptors(registry);
-	}
-	
-	/** 这里配置视图解析器 **/
-	@Override
-	protected void configureViewResolvers(ViewResolverRegistry registry){
-		super.configureViewResolvers(registry);
-	}
-	
-	/** 配置内容裁决的一些选项 **/
-	@Override
-	protected void configureContentNegotiation(ContentNegotiationConfigurer configurer){
-		super.configureContentNegotiation(configurer);
-	}
-	
-	/** 视图跳转控制器 **/
-	@Override
-	protected void addViewControllers(ViewControllerRegistry registry) {
-		
-		super.addViewControllers(registry);
-	}
-	
-	
-	/** 静态资源处理 **/
-	@Override
-    protected void addResourceHandlers(ResourceHandlerRegistry registry) {
-
-        super.addResourceHandlers(registry);
-
-    }
-	/** 默认静态资源处理器 **/
-
-	protected void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer) {
-
-		super.configureDefaultServletHandling(configurer);
-	}
-
-
-
-
-}
+//package com.gyee.alarm.config.interceptor;
+//
+//import org.springframework.context.annotation.Configuration;
+//import org.springframework.web.servlet.config.annotation.*;
+//
+///**
+// * 拦截器
+//* @ClassName: MyWebAppConfigurer
+//* @author fuce
+//* @date 2018年6月3日
+//*
+// */
+//@Configuration
+//public class MyWebAppConfigurer  extends  WebMvcConfigurationSupport  {
+//
+//	//private static Logger logger=LoggerFactory.getLogger(WebMvcConfigurationSupport.class);
+//
+//	/** 解决跨域问题 **/
+//	@Override
+//	public void addCorsMappings(CorsRegistry registry){
+//	/*
+//			registry.addMapping("/**")
+//			// 设置允许跨域请求的域名
+//			.allowedOriginPatterns("*")
+//			// 是否允许证书
+//			.allowCredentials(true)
+//			// 设置允许的方法
+//			.allowedMethods("GET", "POST", "DELETE", "PUT")
+//			// 设置允许的header属性
+//			.allowedHeaders("*")
+//			// 跨域允许时间
+//			.maxAge(3600);
+//			super.addCorsMappings(registry);
+//		*/
+//	}
+//
+//	/** 添加拦截器 **/
+//	@Override
+//	protected void addInterceptors(InterceptorRegistry registry){
+//
+//
+////       下面这句代码相当于添加一个拦截器   添加的拦截器就是我们刚刚创建的
+//		registry.addInterceptor(new MyInterceptor())
+////       addPathPatterns()配置我们要拦截哪些路径 addPathPatterns("/**")表示拦截所有请求,包括我们的静态资源
+//				.addPathPatterns()
+////       excludePathPatterns()表示我们要放行哪些(表示不用经过拦截器)
+////       excludePathPatterns("/","/login")表示放行“/”与“/login”请求
+////       如果有静态资源的时候可以在这个地方放行
+//				.excludePathPatterns("/","/auth/login","/auth/login");
+//
+//		super.addInterceptors(registry);
+//	}
+//
+//	/** 这里配置视图解析器 **/
+//	@Override
+//	protected void configureViewResolvers(ViewResolverRegistry registry){
+//		super.configureViewResolvers(registry);
+//	}
+//
+//	/** 配置内容裁决的一些选项 **/
+//	@Override
+//	protected void configureContentNegotiation(ContentNegotiationConfigurer configurer){
+//		super.configureContentNegotiation(configurer);
+//	}
+//
+//	/** 视图跳转控制器 **/
+//	@Override
+//	protected void addViewControllers(ViewControllerRegistry registry) {
+//
+//		super.addViewControllers(registry);
+//	}
+//
+//
+//	/** 静态资源处理 **/
+//	@Override
+//    protected void addResourceHandlers(ResourceHandlerRegistry registry) {
+//
+//        super.addResourceHandlers(registry);
+//
+//    }
+//	/** 默认静态资源处理器 **/
+//
+//	protected void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer) {
+//
+//		super.configureDefaultServletHandling(configurer);
+//	}
+//
+//
+//
+//
+//}

+ 28 - 2
alarm-web/src/main/java/com/gyee/alarm/controller/AlarmHistoryController.java

@@ -5,10 +5,15 @@ import com.gyee.alarm.model.vo.AjaxStatus;
 import com.gyee.alarm.model.vo.AlarmVo;
 import com.gyee.alarm.service.AlarmHistoryService;
 
+import com.gyee.alarm.util.DateUtils;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
 
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
@@ -30,8 +35,20 @@ public class AlarmHistoryController {
     @Resource
     private AlarmHistoryService alarmHistoryService;
 
-
     @GetMapping(value = "/history/findAlarmlist")
+    @ApiOperation(value = "报警信息查询", notes = "报警信息查询")
+    @ApiImplicitParams({
+
+            @ApiImplicitParam(name = "begin", value = "开始时间", required = true, dataType = "string", paramType = "query"),
+            @ApiImplicitParam(name = "end", value = "结束时间", required = true, dataType = "string", paramType = "query"),
+            @ApiImplicitParam(name = "alarmType", value = "报警类型 booststation:升压站报警,windturbine:设备报警,custom:自定义报警", required = true, dataType = "string", paramType = "query"),
+            @ApiImplicitParam(name = "stationid", value = "场站编号", required = false, dataType = "string", paramType = "query"),
+            @ApiImplicitParam(name = "deviceid", value = "设备编号", required = false, dataType = "string", paramType = "query"),
+            @ApiImplicitParam(name = "description", value = "描述", required = false, dataType = "string", paramType = "query"),
+            @ApiImplicitParam(name = "modelId", value = "型号", required = false, dataType = "string", paramType = "query"),
+            @ApiImplicitParam(name = "deviceType", value = "报警类型 booststation:升压站报警,windturbine:设备报警", required = false, dataType = "string", paramType = "query"),
+            @ApiImplicitParam(name = "pageNum", value = "页号", required = true, dataType = "string", paramType = "query"),
+            @ApiImplicitParam(name = "pageSize", value = "每页显示行数", required = true, dataType = "string", paramType = "query")})
     public AjaxResult findAlarmlist(
             @RequestParam(value = "begin", required = true) String begin,
             @RequestParam(value = "end", required = true) String end,
@@ -40,6 +57,7 @@ public class AlarmHistoryController {
             @RequestParam(value = "deviceid", required = false) String deviceid,
             @RequestParam(value = "description", required = false) String description,
             @RequestParam(value = "modelId", required = false) String modelId,
+            @RequestParam(value = "deviceType", required = false) String deviceType,
             @RequestParam(value = "pageNum", required = true) Integer pageNum,
             @RequestParam(value = "pageSize", required = true) Integer pageSize
     ) throws Exception {
@@ -47,12 +65,20 @@ public class AlarmHistoryController {
         SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
         Date beginDate = df.parse(begin);
         Date endDate = df.parse(end);
-        Map<String,Object> map = alarmHistoryService.findAlarmlist(modelId,beginDate.getTime(), endDate.getTime(), alarmType, stationid,deviceid, description, pageNum, pageSize);
+        Map<String,Object> map = alarmHistoryService.findAlarmlist(modelId,beginDate.getTime(), endDate.getTime(), alarmType, stationid,deviceid, description,deviceType, pageNum, pageSize);
         return AjaxResult.successData(AjaxStatus.success.code, map);
 
     }
 
+    @GetMapping(value = "/history/findAlarmByTypelist")
+    @ApiOperation(value = "获取升压站、设备、自定义报警报警信息查询", notes = "报警信息查询")
+   public AjaxResult findAlarmByTypelist() throws Exception {
+
 
+        Map<String,Object> map = alarmHistoryService.findAlarmByTypelist();
+        return AjaxResult.successData(AjaxStatus.success.code, map);
+
+    }
 
 }
 

+ 151 - 32
alarm-web/src/main/java/com/gyee/alarm/controller/AlertRuleController.java

@@ -5,24 +5,23 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.gyee.alarm.init.CacheContext;
 import com.gyee.alarm.model.auto.*;
-import com.gyee.alarm.model.vo.AjaxResult;
-import com.gyee.alarm.model.vo.AjaxStatus;
-import com.gyee.alarm.model.vo.AlarmCustomType;
-import com.gyee.alarm.model.vo.AlarmRuleVo;
+import com.gyee.alarm.model.vo.*;
 import com.gyee.alarm.service.AlarmRuleService;
 
-import com.gyee.alarm.service.TokenService;
+import com.gyee.alarm.service.auto.IProEconAlarmTypeService;
 import com.gyee.alarm.util.ExcelUtils;
 import com.gyee.alarm.util.SnowflakeGenerator;
 import com.gyee.alarm.util.StringUtils;
 
 import com.gyee.common.util.DateUtils;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
 
-import org.codehaus.groovy.syntax.TokenUtil;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
 
@@ -30,7 +29,7 @@ import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
-import java.io.InputStream;
+
 import java.util.*;
 
 
@@ -38,6 +37,7 @@ import java.util.*;
 @RestController
 @RequestMapping("/alertrule")
 @CrossOrigin
+@Api(value = "自定义报警规则",tags =  "自定义报警规则")
 public class AlertRuleController {
 
 
@@ -46,8 +46,11 @@ public class AlertRuleController {
     private AlarmRuleService alarmRuleService;
 
     @Resource
-    private TokenService tokenService;
+    private IProEconAlarmTypeService proEconAlarmTypeService;
+
+
     @GetMapping(value = "/list")
+    @ApiOperation(value = "查询报警关联部件名称", notes = "查询报警关联部件名称")
     public AjaxResult queryTree() {
         List<AlarmRuleVo> alertrules = alarmRuleService.queryTree();
         if (StringUtils.notEmp(alertrules))  {
@@ -59,7 +62,47 @@ public class AlertRuleController {
         }
     }
 
+
+    @GetMapping(value = "/queryalarmtypellist")
+    @ApiOperation(value = "查询报警类型和预警类型", notes = "查询报警类型和预警类型")
+    public AjaxResult queryalAarmTypelList() {
+
+        Map<String,List<ProEconAlarmType>> map=new HashMap<>();
+        List<ProEconAlarmType> typels= proEconAlarmTypeService.list();
+
+        List<ProEconAlarmType> bjls=new ArrayList<>();
+        List<ProEconAlarmType> yjls=new ArrayList<>();
+        List<ProEconAlarmType> sdls=new ArrayList<>();
+        if(!typels.isEmpty())
+        {
+            for(ProEconAlarmType type:typels)
+            {
+                if(type.getCategory().equals(AlarmType.BJ.getCode()))
+                {
+                    bjls.add(type);
+                }else if(type.getCategory().equals(AlarmType.YJ.getCode()))
+                {
+                    yjls.add(type);
+                }else if(type.getCategory().equals(AlarmType.SD.getCode()))
+                {
+                    sdls.add(type);
+                }
+            }
+        }
+
+        map.put("bj",bjls);
+        map.put("yj",yjls);
+        map.put("sd",sdls);
+        if (StringUtils.notEmp(map))  {
+
+            return AjaxResult.successData(AjaxStatus.success.code, map);
+        }else
+        {
+            return AjaxResult.successData(AjaxStatus.loginexpire.code, "error");
+        }
+    }
     @GetMapping(value = "/querywpllist")
+    @ApiOperation(value = "查询场站列表", notes = "查询场站列表")
     public AjaxResult queryWplList() {
 
         List<ProBasicPowerstation> wpls= CacheContext.wpls;
@@ -72,29 +115,61 @@ public class AlertRuleController {
             return AjaxResult.successData(AjaxStatus.loginexpire.code, "error");
         }
     }
-    @GetMapping(value = "/querywtpointllist")
-    public AjaxResult queryWtPointlList(String wpId,String modelId) {
 
-        Map<String,List<ProBasicPowerstationPoint>> map=new HashMap<>();
-        if(StringUtils.notEmp(wpId) && StringUtils.notEmp(modelId) && CacheContext.wppointmap.containsKey(wpId))
+    @GetMapping(value = "/querywtlist")
+    @ApiOperation(value = "通过场站获得设备信息", notes = "通过场站获得设备信息")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "wpId", value = "风场编号", required = true, dataType = "string", paramType = "query")})
+    public AjaxResult queryWtList(String wpId) {
+        List<ProBasicEquipment> wtls=new ArrayList<>();
+        Map<String,List<ProBasicEquipmentPoint>> map=new HashMap<>();
+        if(StringUtils.notEmp(wpId)  && CacheContext.wpwtmap.containsKey(wpId))
         {
-            Map<String, ProBasicPowerstationPoint> submap= CacheContext.wppointmap.get(wpId);
+            wtls= CacheContext.wpwtmap.get(wpId);
+        }
 
-            List<ProBasicPowerstationPoint> ailist=new ArrayList<>();
-            List<ProBasicPowerstationPoint> dilist=new ArrayList<>();
-            for(Map.Entry<String,ProBasicPowerstationPoint> entry:submap.entrySet()){
+        if (StringUtils.notEmp(wtls))  {
+
+            return AjaxResult.successData(AjaxStatus.success.code, wtls);
+        }else
+        {
+            return AjaxResult.successData(AjaxStatus.loginexpire.code, "error");
+        }
+    }
+    @GetMapping(value = "/querywtpointlist")
+    @ApiOperation(value = "通过场站和型号查询测点信息", notes = "通过场站和型号查询测点信息")
+    @ApiImplicitParams({
 
-                if(entry.getValue().getModelId().equals(modelId))
+            @ApiImplicitParam(name = "wpId", value = "风场编号", required = true, dataType = "string", paramType = "query"),
+            @ApiImplicitParam(name = "modelId", value = "型号", required = true, dataType = "string", paramType = "query")})
+    public AjaxResult queryWtPointlList(String wpId,String modelId) {
+
+        Map<String,List<ProBasicEquipmentPoint>> map=new HashMap<>();
+        if(StringUtils.notEmp(wpId) && StringUtils.notEmp(modelId) && CacheContext.wpwtmap.containsKey(wpId))
+        {
+            List<ProBasicEquipment> wtls= CacheContext.wpwtmap.get(wpId);
+
+            List<ProBasicEquipmentPoint> ailist=new ArrayList<>();
+            List<ProBasicEquipmentPoint> dilist=new ArrayList<>();
+            for(ProBasicEquipment wt:wtls)
+            {
+                if(wt.getModelId().equals(modelId) && CacheContext.wtpAimap.containsKey(wt.getId()))
                 {
-                    if(entry.getKey().contains("AI"))
-                    {
-                        ailist.add(entry.getValue());
-                    }else if(entry.getKey().contains("DI"))
-                    {
-                        dilist.add(entry.getValue());
+                    Map<String, ProBasicEquipmentPoint> wtpointmap=CacheContext.wtpAimap.get(wt.getId());
+                    for(Map.Entry<String,ProBasicEquipmentPoint> entry:wtpointmap.entrySet()){
+
+                        if(entry.getKey().contains("AI"))
+                        {
+                            ailist.add(entry.getValue());
+                        }else if(entry.getKey().contains("DI"))
+                        {
+                            dilist.add(entry.getValue());
+                        }
                     }
+                    break;
                 }
             }
+
             map.put("ai",ailist);
             map.put("di",dilist);
         }
@@ -108,6 +183,7 @@ public class AlertRuleController {
         }
     }
     @GetMapping(value = "/querysubllist")
+    @ApiOperation(value = "获得升压站列表信息", notes = "获得升压站列表信息")
     public AjaxResult querySublList() {
 
         List<ProBasicSubStation> subwpls= CacheContext.subwpls;
@@ -121,7 +197,31 @@ public class AlertRuleController {
         }
     }
 
+    @GetMapping(value = "/queryalarmrule")
+    @ApiOperation(value = "根据主键获得报警规则", notes = "根据主键获得报警规则")
+    @ApiImplicitParams({
+
+            @ApiImplicitParam(name = "id", value = "报警规则主键", required = true, dataType = "string", paramType = "query")})
+    public AjaxResult queryAlarmRule(String id) {
+
+        ProEconAlarmRule alarmRule=null;
+        if(StringUtils.notEmp(id))
+        {
+            alarmRule= alarmRuleService.selectByAlertruleId(id);
+        }
+
+
+        if (StringUtils.notEmp(alarmRule))  {
+
+            return AjaxResult.successData(AjaxStatus.success.code, alarmRule);
+        }else
+        {
+            return AjaxResult.successData(AjaxStatus.loginexpire.code, "error");
+        }
+    }
+
     @GetMapping(value = "/querysubpointllist")
+    @ApiOperation(value = "获得升压站主键获得测点信息", notes = "获得升压站主键获得测点信息")
     public AjaxResult querySubPointlList(String subId) {
 
         Map<String,List<ProBasicPowerstationPoint>> map=new HashMap<>();
@@ -156,6 +256,7 @@ public class AlertRuleController {
     }
 
     @GetMapping(value = "/querywpbyymodellist")
+    @ApiOperation(value = "通过场站编号获得型号下拉列表", notes = "通过场站编号获得型号下拉列表")
     public AjaxResult queryWpByModelList() {
 
         Map<String,Set<ProEconEquipmentmodel>> wpByEmMap=CacheContext.wpByEmMap;
@@ -172,13 +273,13 @@ public class AlertRuleController {
     //@UserLoginToken
     @PostMapping(value = "/save")
     @ResponseBody
-   
-    public AjaxResult saveAlertrule(HttpServletRequest request, @RequestBody ProEconAlarmRule alarmRule) throws Exception {
+    @ApiOperation(value = "进行修改和保存", notes = "进行修改和保存")
+    public AjaxResult saveAndUpdateAlertrule(HttpServletRequest request, @RequestBody ProEconAlarmRule alarmRule) throws Exception {
 
 
-        String token = request.getHeader("token");
 
-        if (StringUtils.notEmp(token) && tokenService.sessionMap.containsKey(token))  {
+
+        if (StringUtils.notEmp(alarmRule) )  {
 
             int result = alarmRuleService.saveAndUpdateAlertrule(alarmRule);
 
@@ -193,9 +294,13 @@ public class AlertRuleController {
     }
 
     @DeleteMapping(value = "/delete")
-    public AjaxResult deleteAlertrule(ProEconAlarmRule alarmRule) {
+    @ApiOperation(value = "删除", notes = "删除")
+    @ApiImplicitParams({
+
+            @ApiImplicitParam(name = "id", value = "自定义报警主键", required = true, dataType = "string", paramType = "query")})
+    public AjaxResult deleteAlertrule(String id) {
 
-        int i= alarmRuleService.deleteAlertrule(alarmRule);
+        int i= alarmRuleService.deleteAlertrule(id);
 
         if (StringUtils.notEmp(i)) {
             return AjaxResult.successData(AjaxStatus.success.code,  i);
@@ -206,11 +311,24 @@ public class AlertRuleController {
 
     //@UserLoginToken
     @GetMapping(value = "/page")
+    @ApiOperation(value = "分页查询", notes = "分页查询")
+    @ApiImplicitParams({
+
+            @ApiImplicitParam(name = "pagenum", value = "页号", required = true, dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "pagesize", value = "每页显示多少行", required = true, dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "name", value = "名称", required = false, dataType = "string", paramType = "query"),
+            @ApiImplicitParam(name = "station", value = "风场编号", required = false, dataType = "string", paramType = "query"),
+            @ApiImplicitParam(name = "modelId", value = "型号编号", required = false, dataType = "string", paramType = "query"),
+            @ApiImplicitParam(name = "rank", value = "级别", required = false, dataType = "string", paramType = "query"),
+            @ApiImplicitParam(name = "category", value = "类别(booststation:升压站报警,windturbine:风机报警)", required = false, dataType = "string", paramType = "query"),
+            @ApiImplicitParam(name = "enabled", value = "是否可用", required = false, dataType = "string", paramType = "query"),
+            @ApiImplicitParam(name = "relatedparts", value = "部件", required = false, dataType = "string", paramType = "query")})
+
     public AjaxResult queryByPage(HttpServletRequest request,
             @RequestParam(value = "pagenum") Integer pageNum,
             @RequestParam(value = "pagesize") Integer pageSize,
             @RequestParam(value = "name", required = false) String name,
-            @RequestParam(value = "station", required = false) String station,
+            @RequestParam(value = "wpId", required = false) String wpId,
             @RequestParam(value = "modelId", required = false) String modelId,
             @RequestParam(value = "rank", required = false) String rank,
             @RequestParam(value = "category", required = false) String category,
@@ -219,7 +337,7 @@ public class AlertRuleController {
     ) {
         Page<ProEconAlarmRule> page = new Page(pageNum, pageSize);
 
-          IPage<ProEconAlarmRule> pageResult = alarmRuleService.pageQueryAll(page, name,station,modelId,rank,category,enabled,relatedparts);
+          IPage<ProEconAlarmRule> pageResult = alarmRuleService.pageQueryAll(page, name,wpId,modelId,rank,category,enabled,relatedparts);
 
 
 
@@ -236,6 +354,7 @@ public class AlertRuleController {
     //@UserLoginToken
     @PostMapping(value = "/save-batch")
     @ResponseBody
+    @ApiOperation(value = "批量保存", notes = "分页查询")
     public AjaxResult saveAlertruleBatch(HttpServletRequest request,@RequestBody List<ProEconAlarmRule> lst) throws Exception {
 
 

+ 8 - 6
alarm-web/src/main/java/com/gyee/alarm/init/CacheContext.java

@@ -617,14 +617,16 @@ public class CacheContext implements CommandLineRunner {
         {
             for(ProEconAlarmRule vo: customls)
             {
-                if(vo.getCategory().equals(AlarmCustomType.WT.getCode()))
+                if(StringUtils.notEmp(vo.getCategory()))
                 {
-                    wtCustomls.add(vo);
-                }else  if(vo.getCategory().equals(AlarmCustomType.WP.getCode()))
-                {
-                    wpCustomls.add(vo);
+                    if(vo.getCategory().equals(AlarmCustomType.WT.getCode()))
+                    {
+                        wtCustomls.add(vo);
+                    }else  if(vo.getCategory().equals(AlarmCustomType.WP.getCode()))
+                    {
+                        wpCustomls.add(vo);
+                    }
                 }
-
             }
         }
         alarmRulesMap.put(AlarmCustomType.WT.getCode(),wtCustomls);

+ 8 - 2
alarm-web/src/main/java/com/gyee/alarm/mapper/auto/AlarmTsMapper.java

@@ -104,13 +104,16 @@ public interface AlarmTsMapper extends BaseMapper<AlarmTs> {
             "<if test='deviceid != null'>",
             "and deviceid = #{deviceid}",
             "</if>",
+            "<if test='deviceType != null'>",
+            "and deviceType = #{deviceType}",
+            "</if>",
             "and stationid = #{stationid}",
             "and ts &gt;= #{begin}",
             "and ts &lt;= #{end}",
             "</where>",
             " order by ts desc limit #{limit},#{offset} ",
             "</script>"})
-    List<AlarmVo> selectByWtLimit(@Param("begin")long begin,@Param("end")long end,@Param("modelId")String modelId,@Param("superTableName") String superTableName,@Param("alarmType")String alarmType,@Param("stationid")String stationid,@Param("deviceid")String deviceid,@Param("description")String description, @Param("limit")int limit, @Param("offset") int offset);
+    List<AlarmVo> selectByWtLimit(@Param("begin")long begin,@Param("end")long end,@Param("modelId")String modelId,@Param("superTableName") String superTableName,@Param("alarmType")String alarmType,@Param("stationid")String stationid,@Param("deviceid")String deviceid,@Param("description")String description, @Param("deviceType")String deviceType,@Param("limit")int limit, @Param("offset") int offset);
 
     @Select({"<script>",
             "select count(*) from #{superTableName} " ,
@@ -124,12 +127,15 @@ public interface AlarmTsMapper extends BaseMapper<AlarmTs> {
             "<if test='deviceid != null'>",
             "and deviceid = #{deviceid}",
             "</if>",
+            "<if test='deviceType != null'>",
+            "and deviceType = #{deviceType}",
+            "</if>",
             "and stationid = #{stationid}",
             "and ts &gt;= #{begin}",
             "and ts &lt;= #{end}",
             "</where>",
 
             "</script>"})
-    Integer selectByWtCount(@Param("begin")long begin,@Param("end")long end,@Param("modelId")String modelId,@Param("superTableName") String superTableName,@Param("alarmType")String alarmType,@Param("stationid")String stationid,@Param("deviceid")String deviceid,@Param("description")String description);
+    Integer selectByWtCount(@Param("begin")long begin,@Param("end")long end,@Param("modelId")String modelId,@Param("superTableName") String superTableName,@Param("alarmType")String alarmType,@Param("stationid")String stationid,@Param("deviceid")String deviceid,@Param("description")String description, @Param("deviceType")String deviceType);
 
 }

+ 49 - 47
alarm-web/src/main/java/com/gyee/alarm/mapper/auto/ProEconAlarmRuleMapper.java

@@ -24,78 +24,80 @@ public interface ProEconAlarmRuleMapper extends BaseMapper<ProEconAlarmRule> {
 
 
     @Update({"<script>",
-            "update pro_econ_alarm_rule a",
+            "update pro_econ_alarm_rule ",
             "<set>",
-            "<if test='name != null'>a.name = #{name},</if>",
-            "<if test='description != null'>a.description = #{description},</if>",
-            "<if test='expression != null'>a.expression = #{expression},</if>",
-            "<if test='tag != null'>a.tag = #{tag},</if>",
-            "<if test='rank != null'>a.rank = #{rank},</if>",
-            "<if test='enable != null'>a.enable = #{enable},</if>",
-            "<if test='modelId != null'>a.model_id = #{modelId},</if>",
-            "<if test='category != null'>a.category = #{category},</if>",
-            "<if test='range != null'>a.range = #{range},</if>",
-            "<if test='stationId != null'>a.station_id = #{stationId},</if>",
-            "<if test='deviceId != null'>a.device_id = #{deviceId},</if>",
-            "<if test='lineId != null'>a.line_id = #{lineId},</if>",
-            "<if test='projectId != null'>a.project_id = #{projectId},</if>",
-            "<if test='electricalId != null'>a.electrical_id = #{electricalId},</if>",
-            "<if test='relatedParts != null'>a.related_parts = #{relatedParts},</if>",
-            "<if test='createtime != null'>a.create_time = #{createtime}</if>",
+            "name = #{name},",
+            "description = #{description},",
+            "expression = #{expression},",
+            "tag = #{tag}," ,
+            "rank = #{rank},",
+            "enable = #{enable},",
+            "model_id = #{modelId},",
+            "category = #{category}," ,
+            "range =#{range}," ,
+            "station_id =#{stationId}," ,
+            "device_id = #{deviceId}," ,
+            "line_id = #{lineId}," ,
+            "project_id = #{projectId}," ,
+            "electrical_id = #{electricalId}," ,
+            "related_parts = #{relatedParts}," ,
+            "create_time = #{createTime}," ,
+            "uniform_code = #{uniformCode}" ,
             "</set>",
-            "where a.id = #{id}",
+            "where id = #{id}",
 
             "</script>"})
-    Integer updateByAlertruleId(@Param("alertrule") ProEconAlarmRule alertrule);
+    Integer updateByAlertruleId(ProEconAlarmRule alertrule);
 
     @Select({"<script>",
             "select a.* from pro_econ_alarm_rule a",
             "<where>",
-            "a.station like '%${station}%'",
+            "a.station_id  = #{wpId}",
 
-            "<if test='name !=null and name !='''>",
-            "and a.name like '%${name}%'",
+            "<if test='name !=null  '>",
+            "and a.name like '#{name}'",
             "</if>",
-            "<if test='modelId !=null and modelId !='''>",
-            "and a.model_id like '%${modelId}%'",
+            "<if test='modelId !=null  '>",
+            "and a.model_id = #{modelId}",
             "</if>",
-            "<if test='rank !=null and rank !='''>",
+            "<if test='rank !=null  '>",
             "and a.rank = #{rank}",
             "</if>",
-            "<if test='category !=null and category !='''>",
+            "<if test='category !=null  '>",
             "and a.category = #{category}",
             "</if>",
-            "<if test='enabled !=null and enabled !='''>",
+            "<if test='enable !=null  '>",
             "and a.enable = #{enable}",
             "</if>",
-            "<if test='relatedparts !=null and relatedparts !='''>",
+            "<if test='relatedparts !=null  '>",
             "and a.related_parts = #{relatedparts}",
             "</if>",
             "</where>",
 
             "</script>"})
     IPage<ProEconAlarmRule> pageQueryAll(Page page,
-                                   @Param("name") String name,
-                                   @Param("station") String station,
-                                   @Param("modelId")String modelId,
-                                   @Param("rank")String rank,
-                                   @Param("category")String category,
-                                   @Param("enable") String enable,
-                                   @Param("relatedparts")String relatedparts);
-
-    @Select("select distinct a.related_parts as relatedParts,a.name as alarmName,d.name  as typeName from pro_econ_alarm_rule a"+
-            "left join pro_econ_alarm_type d on d.nem_code = a.related_parts"+
+                                         @Param("name") String name,
+                                         @Param("wpId") String wpId,
+                                         @Param("modelId") String modelId,
+                                         @Param("rank") String rank,
+                                         @Param("category") String category,
+                                         @Param("enable") String enable,
+                                         @Param("relatedparts") String relatedparts);
+
+    @Select("select distinct a.related_parts as relatedParts,a.name as alarmName,d.name  as typeName from pro_econ_alarm_rule a " +
+            "left join pro_econ_alarm_type d on d.nem_code = a.related_parts " +
             "where related_parts is not null")
     List<AlarmRuleVo> queryTree();
 
     @Select(" select a.name from  pro_econ_alarm_rule a where a.related_parts = #{relatedParts}   group by a.name ")
     List<ProEconAlarmRule> quertByrelatedParts(@Param("relatedParts") String relatedParts);
+
     @Select({"<script>",
             "select a.* from pro_econ_alarm_rule a",
             "<where>",
-            "a.station like '%${station}%'",
-            "<if test='modelId !=null and modelId !='''>",
-            "and a.model_id like '%${modelId}%'",
+            "a.station like '%#{station}%'",
+            "<if test='modelId !=null '>",
+            "and a.model_id like '%#{modelId}%'",
             "</if>",
 
             "</where>",
@@ -109,16 +111,16 @@ public interface ProEconAlarmRuleMapper extends BaseMapper<ProEconAlarmRule> {
     @Select({"<script>",
             "select a.* from pro_econ_alarm_rule a",
             "<where>",
-            "a.station like '%${station}%'",
+            "a.station like '%#{station}%'",
 
-            "<if test='name !=null and name !='''>",
-            "and a.name like '%${name}%'",
+            "<if test='name !=null  '>",
+            "and a.name like '%#{name}%'",
             "</if>",
-            "<if test='modelid !=null and modelid !='''>",
-            "and a.model_id like '%${modelid}%'",
+            "<if test='modelid !=null  '>",
+            "and a.model_id like '%#{modelid}%'",
             "</if>",
             "</where>",
 
             "</script>"})
-     List<ProEconAlarmRule> getUniformCodeByNameAndStation(@Param("name")String name, @Param("station")String station, @Param("modelid")String modelid);
+    List<ProEconAlarmRule> getUniformCodeByNameAndStation(@Param("name") String name, @Param("station") String station, @Param("modelid") String modelid);
 }

+ 4 - 0
alarm-web/src/main/java/com/gyee/alarm/model/auto/ProEconAlarmRule.java

@@ -1,6 +1,8 @@
 package com.gyee.alarm.model.auto;
 
 import com.alibaba.excel.annotation.ExcelProperty;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.extension.activerecord.Model;
 import java.time.LocalDateTime;
 import java.util.Date;
@@ -21,6 +23,7 @@ import lombok.experimental.Accessors;
 @Builder
 @AllArgsConstructor
 @NoArgsConstructor
+@ToString
 @Accessors(chain = false) // 设置 chain = false,避免用户导入有问题
 public class ProEconAlarmRule extends Model {
 
@@ -30,6 +33,7 @@ public class ProEconAlarmRule extends Model {
      * 编号
      */
     @ExcelProperty("编号")
+    @TableId(value = "ID",type = IdType.INPUT)
     private String id;
 
     /**

+ 53 - 0
alarm-web/src/main/java/com/gyee/alarm/model/vo/AlarmType.java

@@ -0,0 +1,53 @@
+package com.gyee.alarm.model.vo;
+
+public enum AlarmType {
+
+    BJ("alertrule_category", "部件"),
+    YJ("early_category", "预警"),
+    SD("userset", "用户设定");
+
+    private String code;
+    private String name;
+
+    AlarmType(String code) {
+        this.code = code;
+    }
+
+    AlarmType(String code, String name) {
+        this.code = code;
+        this.name = name;
+    }
+
+    public String getCode() {
+        return code;
+    }
+
+    public void setCode(String code) {
+        this.code = code;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    /**
+     * 根据code获取message
+     *
+     * @param code
+     * @return
+     */
+    public static String getNmaeByCode(String code) {
+        for (AlarmType ele : values()) {
+            if (ele.getCode().equals(code)) {
+                return ele.getName();
+            }
+        }
+        return null;
+    }
+
+
+}

+ 36 - 4
alarm-web/src/main/java/com/gyee/alarm/service/AlarmHistoryService.java

@@ -11,12 +11,15 @@ import com.gyee.alarm.model.vo.AlarmSuperTalbeType;
 import com.gyee.alarm.model.vo.AlarmTsVo;
 import com.gyee.alarm.model.vo.AlarmTypeValue;
 import com.gyee.alarm.model.vo.AlarmVo;
+import com.gyee.alarm.util.DateUtils;
 import com.gyee.common.model.StringUtils;
 import org.apache.ibatis.annotations.Param;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
+import java.text.SimpleDateFormat;
 import java.util.*;
 import java.util.stream.Collectors;
 
@@ -28,7 +31,8 @@ public class AlarmHistoryService   {
     @Resource
     private AlarmTsMapper alarmTsMapper;
 
-
+    @Value("${home_pagep_size}")
+    private int home_pagep_size;
     /**
      * 查询报警信息接口
      * @param begin 开始时间
@@ -40,7 +44,7 @@ public class AlarmHistoryService   {
      * @param pageSize 每页多少条
      * @return
      */
-    public Map<String,Object> findAlarmlist(String modelId, long begin,long end ,String alarmType,String stationid,String deviceid,String description, int pageNum, int pageSize) {
+    public Map<String,Object> findAlarmlist(String modelId, long begin,long end ,String alarmType,String stationid,String deviceid,String description,String deviceType, int pageNum, int pageSize) {
 
         Map<String,Object> map=new HashMap<>();
 
@@ -99,11 +103,39 @@ public class AlarmHistoryService   {
         {
             description=null;
         }
-        vos = alarmTsMapper.selectByWtLimit(begin,end,modelId,superTableName, alarmType, stationid, deviceid, description, pageNum*pageSize, (pageNum*pageSize+pageSize));
+        if(StringUtils.empty(deviceType)  )
+        {
+            deviceType=null;
+        }
+        vos = alarmTsMapper.selectByWtLimit(begin,end,modelId,superTableName, alarmType, stationid, deviceid, description,deviceType, pageNum*pageSize, (pageNum*pageSize+pageSize));
         map.put("ls",vos);
-        int total=alarmTsMapper.selectByWtCount(begin,end,modelId,superTableName, alarmType, stationid, deviceid, description);
+        int total=alarmTsMapper.selectByWtCount(begin,end,modelId,superTableName, alarmType, stationid,deviceType, deviceid, description);
         map.put("total",total);
         return map;
     }
 
+
+
+    public Map<String,Object> findAlarmByTypelist() {
+
+        Map<String,Object> map=new HashMap<>();
+
+
+            SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
+            Date endDate = new Date();
+            Date beginDate = DateUtils.truncate(endDate);
+
+
+        List<AlarmVo> btls = alarmTsMapper.selectByWtLimit(beginDate.getTime(),endDate.getTime(),null,AlarmSuperTalbeType.BT.getCode(), AlarmTypeValue.BT.getCode(), null, null, null,null, 0, home_pagep_size);
+        map.put("btls",btls);
+
+        List<AlarmVo> wtls = alarmTsMapper.selectByWtLimit(beginDate.getTime(),endDate.getTime(),null,AlarmSuperTalbeType.WT.getCode(), AlarmTypeValue.WT.getCode(), null, null, null,null, 0, home_pagep_size);
+        map.put("wtls",wtls);
+
+        List<AlarmVo> ctls = alarmTsMapper.selectByWtLimit(beginDate.getTime(),endDate.getTime(),null,AlarmSuperTalbeType.CT.getCode(), AlarmTypeValue.CT.getCode(), null, null, null,null, 0, home_pagep_size);
+        map.put("ctls",ctls);
+        return map;
+    }
+
+
 }

+ 8 - 2
alarm-web/src/main/java/com/gyee/alarm/service/AlarmRuleService.java

@@ -74,12 +74,18 @@ public class AlarmRuleService {
         return result;
     }
 
-    public int deleteAlertrule(ProEconAlarmRule alarmRule) {
-        return proEconAlarmRuleMapper.deleteById(alarmRule.getId());
+    public int deleteAlertrule(String id) {
+        return proEconAlarmRuleMapper.deleteById(id);
     }
 
 
     public IPage<ProEconAlarmRule> pageQueryAll(Page page, String name, String station, String modelId, String rank, String category, String enabled, String relatedparts) {
+
+
+        if(StringUtils.notEmp(name))
+        {
+            name="%"+name+"%";
+        }
         IPage<ProEconAlarmRule> AlertruleIPage = proEconAlarmRuleMapper.pageQueryAll(page, name, station, modelId, rank, category, enabled, relatedparts);
 
         return AlertruleIPage;

+ 2 - 0
alarm-web/src/main/resources/application-jn.yml

@@ -178,6 +178,8 @@ rule_encryption_key: gyee-alarm123456
 
 #是否需要权限控制
 rule_authority: true
+#首页展示数据数量
+home_pagep_size: 50
 
 
 

+ 59 - 0
alarm-web/src/test/java/com/AlarmTest.java

@@ -0,0 +1,59 @@
+package com;
+
+
+
+import com.gyee.alarm.AlarmWeb;
+import com.gyee.alarm.model.auto.ProEconAlarmRule;
+import com.gyee.alarm.service.AlarmRuleService;
+import com.gyee.alarm.util.SpringUtils;
+import com.gyee.common.util.DateUtils;
+
+import org.junit.runner.RunWith;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
+import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.junit4.SpringRunner;
+
+import javax.annotation.Resource;
+import java.util.Calendar;
+import java.util.Comparator;
+import java.util.Date;
+import java.util.List;
+import java.util.stream.Collectors;
+
+
+/**
+ * OpenCSV CSVReader Example, Read line by line
+ *
+ * @author pankaj
+ *
+ */
+@SpringBootTest
+@RunWith(SpringRunner.class)
+@EnableAutoConfiguration(exclude={DataSourceAutoConfiguration.class})
+public class AlarmTest {
+
+    public static void main(String[] args) throws Exception {
+        SpringApplication.run(AlarmWeb.class, args);
+        AlarmRuleService alarmRuleService= SpringUtils.getBean("alarmRuleService");
+
+
+
+
+
+
+        //
+        System.out.println("故障转换率记录调度程序执行开始!。。。。。。");
+        ProEconAlarmRule alarm= alarmRuleService.selectByAlertruleId("1");
+        alarm.setUniformCode("test11");
+        alarmRuleService.saveAndUpdateAlertrule(alarm);
+
+        alarmRuleService.saveAndUpdateAlertrule(new ProEconAlarmRule());
+
+
+        alarmRuleService.deleteAlertrule("1139571619573145600");
+        System.out.println("故障转换率记录调度程序执行结束!。。。。。。");
+
+    }
+}

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 4098 - 76
log/ota.log


BIN
log/ota.log.2023-08-03.0.gz


BIN
log/ota.log.2023-08-09.0.gz