Commit 554a8aed authored by shulidong's avatar shulidong

趋势图添加kkscode字段

parent 45f69e61
......@@ -157,6 +157,12 @@
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt-jackson</artifactId>
</dependency>
<dependency>
<groupId>com.github.xiaoymin</groupId>
<artifactId>knife4j-spring-ui</artifactId>
<version>2.0.4</version>
</dependency>
<!-- Spring Boot HBase 依赖 -->
<dependency>
<groupId>com.spring4all</groupId>
......@@ -173,7 +179,7 @@
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>16.0.1</version>
<version>20.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/net.oschina.zcx7878/fastdfs-client-java -->
<dependency>
......
......@@ -17,8 +17,8 @@ public class PowerPlantApplication {
System.out.println("===========调用开始================");
System.out.println("参数从信息:===");
System.out.println(str);
String s = WaveAnalysis.INSTANCE.WaveAnalysisModel(str);
//String s = WaveAnalysis.INSTANCE.WaveAnalysisModel(str);
System.out.println("===========================");
System.out.println("结果:" + s);
//System.out.println("结果:" + s);
}
}
//
//package cn.wise.sc.energy.power.plant.business;
//
//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.WebMvcConfigurerAdapter;
//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;
//
//
///**
// * @Auther: yangjing
// * @Date: 2020/3/29 12:17
// * @ClassName: PACKAGE_NAME
// * @Description: TODO
// */
//
//@Configuration
//@EnableSwagger2
//public class SwaggerConfig extends WebMvcConfigurerAdapter {
//
// @Bean
// public Docket createRestApi() {// 创建API基本信息
// return new Docket(DocumentationType.SWAGGER_2)
// .apiInfo(apiInfo())
// .select()
// .apis(RequestHandlerSelectors.basePackage("cn.wise.sc.energy.power.plant"))// 扫描该包下的所有需要在Swagger中展示的API,@ApiIgnore注解标注的除外
// .paths(PathSelectors.any())//egex("/api/.*") 拦截的接口路径
// .build();
// }
//
// private ApiInfo apiInfo() {// 创建API的基本信息,这些信息会在Swagger UI中进行显示
// return new ApiInfoBuilder()
// .title("swagger-api")// API 标题
// .description("系统接口测试对接api")// API描述
// .contact("杨**")// 联系人
// // .license("Apache License Version 2.0")// 开源协议
// .version("1.0")// 版本号
// .build();
// }
//
//
// /**
// * 重定向静态资源的路径,千万不要注释 不然 你们在访问api的时候会404的
// * @param registry
// */
//
// @Override
// public void addResourceHandlers(ResourceHandlerRegistry registry) {
// registry.addResourceHandler("/static/**").addResourceLocations("classpath:/static/");
// registry.addResourceHandler("swagger-ui.html") .addResourceLocations("classpath:/META-INF/resources/");
// registry.addResourceHandler("/webjars/**") .addResourceLocations("classpath:/META-INF/resources/webjars/");
//// //下面是图片的虚拟路径配置
//// registry.addResourceHandler(fileVirtualPath+"**").
//// addResourceLocations("file:"+fileRealPath);
// }
//
//
//}
//
package cn.wise.sc.energy.power.plant.business;
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.WebMvcConfigurerAdapter;
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;
/**
* @Auther: yangjing
* @Date: 2020/3/29 12:17
* @ClassName: PACKAGE_NAME
* @Description: TODO
*/
@Configuration
@EnableSwagger2
public class SwaggerConfig extends WebMvcConfigurerAdapter {
@Bean
public Docket createRestApi() {// 创建API基本信息
return new Docket(DocumentationType.SWAGGER_2)
.apiInfo(apiInfo())
.select()
.apis(RequestHandlerSelectors.basePackage("cn.wise.sc.energy.power.plant"))// 扫描该包下的所有需要在Swagger中展示的API,@ApiIgnore注解标注的除外
.paths(PathSelectors.any())//egex("/api/.*") 拦截的接口路径
.build();
}
private ApiInfo apiInfo() {// 创建API的基本信息,这些信息会在Swagger UI中进行显示
return new ApiInfoBuilder()
.title("swagger-api")// API 标题
.description("上海电气api")// API描述
.contact("shulidong")// 联系人
// .license("Apache License Version 2.0")// 开源协议
.version("1.0")// 版本号
.build();
}
/**
* 重定向静态资源的路径,千万不要注释 不然 你们在访问api的时候会404的
* @param registry
*/
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/static/**").addResourceLocations("classpath:/static/");
registry.addResourceHandler("swagger-ui.html") .addResourceLocations("classpath:/META-INF/resources/");
registry.addResourceHandler("/webjars/**") .addResourceLocations("classpath:/META-INF/resources/webjars/");
// //下面是图片的虚拟路径配置
// registry.addResourceHandler(fileVirtualPath+"**").
// addResourceLocations("file:"+fileRealPath);
}
}
......@@ -34,6 +34,11 @@ public class DataPower {
* 测点名
*/
private String name;
/**
* kks code
*/
private String kksCode;
/**
* 颜色
*/
......
......@@ -6,6 +6,11 @@ import cn.wise.sc.energy.power.plant.business.domain.vo.EntityVo;
import cn.wise.sc.energy.power.plant.business.service.ICharacterParamService;
import cn.wise.sc.energy.power.plant.common.core.bean.BaseResponse;
import com.spring4all.spring.boot.starter.hbase.api.HbaseTemplate;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
......@@ -34,6 +39,7 @@ import java.util.Map;
@Validated
@RestController
@RequestMapping("characterParam/")
@Api(tags = "测点特征api")
public class CharacterParamController {
final
......@@ -47,19 +53,30 @@ public class CharacterParamController {
this.hbaseTemplate = hbaseTemplate;
}
@ApiOperation(value = "获取机组所有特征值")
@ApiImplicitParams(value = {
@ApiImplicitParam(name = "unitNo",value = "机组编号",paramType = "query", dataType = "String")
})
@GetMapping("{unitNo}")
public BaseResponse<List<EntityVo>> getUnitAllCharacterParams(
@PathVariable("unitNo") @NotEmpty(message = "unitNo不能为空!") String unitNo) {
return BaseResponse.okData(iCharacterParamService.getUnitAllCharacterParams(unitNo));
}
@ApiOperation(value = "获取3d组件特征")
@ApiImplicitParams(value = {
@ApiImplicitParam(name = "deviceId",value="设备编号",paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "fileName",value="部件名称",paramType = "query", dataType = "String"),
})
@GetMapping("/3d")
public BaseResponse<Map<String, Map<String, HashMap<Long, Number>>>> get3DCharacter(String deviceId,
String fileName) {
return iCharacterParamService.get3DCharacter(deviceId, fileName);
}
@ApiOperation(value = "获取趋势图")
@PostMapping("/tendency")
//todo 加kks
public BaseResponse<DataPower> getTendency(@RequestBody TendencyQuery tendencyQuery) {
return iCharacterParamService.getTendency(tendencyQuery.getKeys(),
tendencyQuery.getTimeModelQuery(), tendencyQuery.getStatus());
......
......@@ -8,6 +8,7 @@ import cn.wise.sc.energy.power.plant.common.core.bean.BaseResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
......@@ -27,6 +28,7 @@ import java.util.Map;
* 附件管理Controller
* @author ztw
*/
@CrossOrigin
@RestController
@RequestMapping("/enclosure")
public class EntityEnclosureController {
......
package cn.wise.sc.energy.power.plant.business.domain;
import cn.wise.sc.energy.power.plant.business.bean.TimeModelQuery;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
......@@ -12,9 +14,13 @@ import java.util.List;
* @create: 2020-08-18 16:53
**/
@Data
@ApiModel("趋势查询")
public class TendencyQuery implements Serializable {
@ApiModelProperty("kkscode")
List<String> keys;
@ApiModelProperty("时间查询对象")
TimeModelQuery timeModelQuery;
@ApiModelProperty("状态")
Integer status;
}
......@@ -9,7 +9,7 @@ import com.sun.jna.Native;
* @create: 2020-08-24 19:40
**/
public interface WaveAnalysis extends Library {
//
String dllPath = "libGMWaveAnalysisModel.so";
WaveAnalysis INSTANCE = Native.load(dllPath, WaveAnalysis.class);
......
......@@ -602,6 +602,8 @@ public class CharacterParamServiceImpl extends BaseServiceImpl<String, Character
DataPower.PowerPoints powerPoints = new DataPower.PowerPoints();
dataPower.getDataList().add(powerPoints);
powerPoints.setName(cpName);
powerPoints.setKksCode(characterParamInfo.getKksCode());
//关联报警点数
CharacterParamInfo.Alert alert = buildAlert(characterParamInfo);
powerPoints.setColor(JSON.toJSONString(alert, SerializerFeature.IgnoreNonFieldGetter));
......
......@@ -30,8 +30,8 @@ public class FastDFSUtils {
static {
try {
ClientGlobal.initByProperties(FastDFSUtils.class.getClassLoader().getResource("fastdfs-client.properties").getPath());
// ClientGlobal.initByProperties("fastdfs-client.properties");
// ClientGlobal.initByProperties(FastDFSUtils.class.getClassLoader().getResource("fastdfs-client.properties").getPath());
ClientGlobal.initByProperties("fastdfs-client.properties");
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
......@@ -155,7 +155,7 @@ public class FastDFSUtils {
//操作文档保存
document.save(outputFile.getAbsolutePath(), com.aspose.words.SaveFormat.PDF);
FileReader fileReader = new FileReader(outputFile.getAbsolutePath());
filePath = uploadPic(fileReader.readBytes(), outputFile.getName(), outputFile.length());
filePath = uploadPic(fileReader.readBytes(), outputFile.getName(), outputFile.length());
} catch (IOException e) {
e.printStackTrace();
} catch (Exception e) {
......
This diff is collapsed.
......@@ -18,22 +18,20 @@
<hutool.version>4.6.8</hutool.version>
<lombok.version>1.18.10</lombok.version>
<fastjson.version>1.2.62</fastjson.version>
<swagger.fox.version>z</swagger.fox.version>
<swagger-bootstrap-ui.version>1.9.3</swagger-bootstrap-ui.version>
<swagger.fox.version>2.9.2</swagger.fox.version>
</properties>
<dependencies>
<!--swagger-->
<!-- <dependency>-->
<!-- <groupId>io.springfox</groupId>-->
<!-- <artifactId>springfox-swagger2</artifactId>-->
<!-- <version>${swagger.fox.version}</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>io.springfox</groupId>-->
<!-- <artifactId>springfox-swagger-ui</artifactId>-->
<!-- <version>${swagger.fox.version}</version>-->
<!-- </dependency>-->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>${swagger.fox.version}</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>${swagger.fox.version}</version>
</dependency>
<!--jackson模块-->
<dependency>
<groupId>com.fasterxml.jackson.module</groupId>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment