Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
P
plant
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
qinhu
plant
Commits
554a8aed
Commit
554a8aed
authored
Sep 11, 2020
by
shulidong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
趋势图添加kkscode字段
parent
45f69e61
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
321 additions
and
85 deletions
+321
-85
pom.xml
power-bussiness/pom.xml
+7
-1
PowerPlantApplication.java
...sc/energy/power/plant/business/PowerPlantApplication.java
+2
-2
SwaggerConfig.java
...cn/wise/sc/energy/power/plant/business/SwaggerConfig.java
+66
-66
DataPower.java
...n/wise/sc/energy/power/plant/business/bean/DataPower.java
+5
-0
CharacterParamController.java
...r/plant/business/controller/CharacterParamController.java
+17
-0
EntityEnclosureController.java
.../plant/business/controller/EntityEnclosureController.java
+2
-0
TendencyQuery.java
.../sc/energy/power/plant/business/domain/TendencyQuery.java
+6
-0
WaveAnalysis.java
...wise/sc/energy/power/plant/business/jni/WaveAnalysis.java
+1
-1
CharacterParamServiceImpl.java
...lant/business/service/impl/CharacterParamServiceImpl.java
+2
-0
FastDFSUtils.java
...c/energy/power/plant/business/utils/dfs/FastDFSUtils.java
+3
-3
logback-spring.xml
power-bussiness/src/main/resources/logback-spring.xml
+200
-0
pom.xml
power-common/common-core/pom.xml
+10
-12
No files found.
power-bussiness/pom.xml
View file @
554a8aed
...
@@ -157,6 +157,12 @@
...
@@ -157,6 +157,12 @@
<groupId>
io.jsonwebtoken
</groupId>
<groupId>
io.jsonwebtoken
</groupId>
<artifactId>
jjwt-jackson
</artifactId>
<artifactId>
jjwt-jackson
</artifactId>
</dependency>
</dependency>
<dependency>
<groupId>
com.github.xiaoymin
</groupId>
<artifactId>
knife4j-spring-ui
</artifactId>
<version>
2.0.4
</version>
</dependency>
<!-- Spring Boot HBase 依赖 -->
<!-- Spring Boot HBase 依赖 -->
<dependency>
<dependency>
<groupId>
com.spring4all
</groupId>
<groupId>
com.spring4all
</groupId>
...
@@ -173,7 +179,7 @@
...
@@ -173,7 +179,7 @@
<dependency>
<dependency>
<groupId>
com.google.guava
</groupId>
<groupId>
com.google.guava
</groupId>
<artifactId>
guava
</artifactId>
<artifactId>
guava
</artifactId>
<version>
16.0.1
</version>
<version>
20.0
</version>
</dependency>
</dependency>
<!-- https://mvnrepository.com/artifact/net.oschina.zcx7878/fastdfs-client-java -->
<!-- https://mvnrepository.com/artifact/net.oschina.zcx7878/fastdfs-client-java -->
<dependency>
<dependency>
...
...
power-bussiness/src/main/java/cn/wise/sc/energy/power/plant/business/PowerPlantApplication.java
View file @
554a8aed
...
@@ -17,8 +17,8 @@ public class PowerPlantApplication {
...
@@ -17,8 +17,8 @@ public class PowerPlantApplication {
System
.
out
.
println
(
"===========调用开始================"
);
System
.
out
.
println
(
"===========调用开始================"
);
System
.
out
.
println
(
"参数从信息:==="
);
System
.
out
.
println
(
"参数从信息:==="
);
System
.
out
.
println
(
str
);
System
.
out
.
println
(
str
);
String
s
=
WaveAnalysis
.
INSTANCE
.
WaveAnalysisModel
(
str
);
//
String s = WaveAnalysis.INSTANCE.WaveAnalysisModel(str);
System
.
out
.
println
(
"==========================="
);
System
.
out
.
println
(
"==========================="
);
System
.
out
.
println
(
"结果:"
+
s
);
//
System.out.println("结果:" + s);
}
}
}
}
power-bussiness/src/main/java/cn/wise/sc/energy/power/plant/business/SwaggerConfig.java
View file @
554a8aed
//
//
package cn.wise.sc.energy.power.plant.business;
package
cn
.
wise
.
sc
.
energy
.
power
.
plant
.
business
;
//
//
import org.springframework.context.annotation.Bean;
import
org.springframework.context.annotation.Bean
;
//
import org.springframework.context.annotation.Configuration;
import
org.springframework.context.annotation.Configuration
;
//
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import
org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry
;
//
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
import
org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter
;
//
import springfox.documentation.builders.ApiInfoBuilder;
import
springfox.documentation.builders.ApiInfoBuilder
;
//
import springfox.documentation.builders.PathSelectors;
import
springfox.documentation.builders.PathSelectors
;
//
import springfox.documentation.builders.RequestHandlerSelectors;
import
springfox.documentation.builders.RequestHandlerSelectors
;
//
import springfox.documentation.service.ApiInfo;
import
springfox.documentation.service.ApiInfo
;
//
import springfox.documentation.spi.DocumentationType;
import
springfox.documentation.spi.DocumentationType
;
//
import springfox.documentation.spring.web.plugins.Docket;
import
springfox.documentation.spring.web.plugins.Docket
;
//
import springfox.documentation.swagger2.annotations.EnableSwagger2;
import
springfox.documentation.swagger2.annotations.EnableSwagger2
;
//
//
/
//
**
/**
//
* @Auther: yangjing
* @Auther: yangjing
//
* @Date: 2020/3/29 12:17
* @Date: 2020/3/29 12:17
//
* @ClassName: PACKAGE_NAME
* @ClassName: PACKAGE_NAME
//
* @Description: TODO
* @Description: TODO
//
*/
*/
//
//
@Configuration
@Configuration
//
@EnableSwagger2
@EnableSwagger2
//
public class SwaggerConfig extends WebMvcConfigurerAdapter {
public
class
SwaggerConfig
extends
WebMvcConfigurerAdapter
{
//
//
@Bean
@Bean
//
public Docket createRestApi() {// 创建API基本信息
public
Docket
createRestApi
()
{
// 创建API基本信息
//
return new Docket(DocumentationType.SWAGGER_2)
return
new
Docket
(
DocumentationType
.
SWAGGER_2
)
//
.apiInfo(apiInfo())
.
apiInfo
(
apiInfo
())
//
.select()
.
select
()
//
.apis(RequestHandlerSelectors.basePackage("cn.wise.sc.energy.power.plant"))// 扫描该包下的所有需要在Swagger中展示的API,@ApiIgnore注解标注的除外
.
apis
(
RequestHandlerSelectors
.
basePackage
(
"cn.wise.sc.energy.power.plant"
))
// 扫描该包下的所有需要在Swagger中展示的API,@ApiIgnore注解标注的除外
//
.paths(PathSelectors.any())//egex("/api/.*") 拦截的接口路径
.
paths
(
PathSelectors
.
any
())
//egex("/api/.*") 拦截的接口路径
//
.build();
.
build
();
//
}
}
//
//
private ApiInfo apiInfo() {// 创建API的基本信息,这些信息会在Swagger UI中进行显示
private
ApiInfo
apiInfo
()
{
// 创建API的基本信息,这些信息会在Swagger UI中进行显示
//
return new ApiInfoBuilder()
return
new
ApiInfoBuilder
()
//
.title("swagger-api")// API 标题
.
title
(
"swagger-api"
)
// API 标题
// .description("系统接口测试对接
api")// API描述
.
description
(
"上海电气
api"
)
// API描述
// .contact("杨**
")// 联系人
.
contact
(
"shulidong
"
)
// 联系人
//
// .license("Apache License Version 2.0")// 开源协议
// .license("Apache License Version 2.0")// 开源协议
//
.version("1.0")// 版本号
.
version
(
"1.0"
)
// 版本号
//
.build();
.
build
();
//
}
}
//
//
//
/**
/**
//
* 重定向静态资源的路径,千万不要注释 不然 你们在访问api的时候会404的
* 重定向静态资源的路径,千万不要注释 不然 你们在访问api的时候会404的
//
* @param registry
* @param registry
//
*/
*/
//
//
@Override
@Override
//
public void addResourceHandlers(ResourceHandlerRegistry registry) {
public
void
addResourceHandlers
(
ResourceHandlerRegistry
registry
)
{
//
registry.addResourceHandler("/static/**").addResourceLocations("classpath:/static/");
registry
.
addResourceHandler
(
"/static/**"
).
addResourceLocations
(
"classpath:/static/"
);
//
registry.addResourceHandler("swagger-ui.html") .addResourceLocations("classpath:/META-INF/resources/");
registry
.
addResourceHandler
(
"swagger-ui.html"
)
.
addResourceLocations
(
"classpath:/META-INF/resources/"
);
//
registry.addResourceHandler("/webjars/**") .addResourceLocations("classpath:/META-INF/resources/webjars/");
registry
.
addResourceHandler
(
"/webjars/**"
)
.
addResourceLocations
(
"classpath:/META-INF/resources/webjars/"
);
//
//
//下面是图片的虚拟路径配置
// //下面是图片的虚拟路径配置
//
//
registry.addResourceHandler(fileVirtualPath+"**").
// registry.addResourceHandler(fileVirtualPath+"**").
//
//
addResourceLocations("file:"+fileRealPath);
// addResourceLocations("file:"+fileRealPath);
//
}
}
//
//
//
}
}
//
power-bussiness/src/main/java/cn/wise/sc/energy/power/plant/business/bean/DataPower.java
View file @
554a8aed
...
@@ -34,6 +34,11 @@ public class DataPower {
...
@@ -34,6 +34,11 @@ public class DataPower {
* 测点名
* 测点名
*/
*/
private
String
name
;
private
String
name
;
/**
* kks code
*/
private
String
kksCode
;
/**
/**
* 颜色
* 颜色
*/
*/
...
...
power-bussiness/src/main/java/cn/wise/sc/energy/power/plant/business/controller/CharacterParamController.java
View file @
554a8aed
...
@@ -6,6 +6,11 @@ import cn.wise.sc.energy.power.plant.business.domain.vo.EntityVo;
...
@@ -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.business.service.ICharacterParamService
;
import
cn.wise.sc.energy.power.plant.common.core.bean.BaseResponse
;
import
cn.wise.sc.energy.power.plant.common.core.bean.BaseResponse
;
import
com.spring4all.spring.boot.starter.hbase.api.HbaseTemplate
;
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.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.CrossOrigin
;
import
org.springframework.web.bind.annotation.CrossOrigin
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
...
@@ -34,6 +39,7 @@ import java.util.Map;
...
@@ -34,6 +39,7 @@ import java.util.Map;
@Validated
@Validated
@RestController
@RestController
@RequestMapping
(
"characterParam/"
)
@RequestMapping
(
"characterParam/"
)
@Api
(
tags
=
"测点特征api"
)
public
class
CharacterParamController
{
public
class
CharacterParamController
{
final
final
...
@@ -47,19 +53,30 @@ public class CharacterParamController {
...
@@ -47,19 +53,30 @@ public class CharacterParamController {
this
.
hbaseTemplate
=
hbaseTemplate
;
this
.
hbaseTemplate
=
hbaseTemplate
;
}
}
@ApiOperation
(
value
=
"获取机组所有特征值"
)
@ApiImplicitParams
(
value
=
{
@ApiImplicitParam
(
name
=
"unitNo"
,
value
=
"机组编号"
,
paramType
=
"query"
,
dataType
=
"String"
)
})
@GetMapping
(
"{unitNo}"
)
@GetMapping
(
"{unitNo}"
)
public
BaseResponse
<
List
<
EntityVo
>>
getUnitAllCharacterParams
(
public
BaseResponse
<
List
<
EntityVo
>>
getUnitAllCharacterParams
(
@PathVariable
(
"unitNo"
)
@NotEmpty
(
message
=
"unitNo不能为空!"
)
String
unitNo
)
{
@PathVariable
(
"unitNo"
)
@NotEmpty
(
message
=
"unitNo不能为空!"
)
String
unitNo
)
{
return
BaseResponse
.
okData
(
iCharacterParamService
.
getUnitAllCharacterParams
(
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"
)
@GetMapping
(
"/3d"
)
public
BaseResponse
<
Map
<
String
,
Map
<
String
,
HashMap
<
Long
,
Number
>>>>
get3DCharacter
(
String
deviceId
,
public
BaseResponse
<
Map
<
String
,
Map
<
String
,
HashMap
<
Long
,
Number
>>>>
get3DCharacter
(
String
deviceId
,
String
fileName
)
{
String
fileName
)
{
return
iCharacterParamService
.
get3DCharacter
(
deviceId
,
fileName
);
return
iCharacterParamService
.
get3DCharacter
(
deviceId
,
fileName
);
}
}
@ApiOperation
(
value
=
"获取趋势图"
)
@PostMapping
(
"/tendency"
)
@PostMapping
(
"/tendency"
)
//todo 加kks
public
BaseResponse
<
DataPower
>
getTendency
(
@RequestBody
TendencyQuery
tendencyQuery
)
{
public
BaseResponse
<
DataPower
>
getTendency
(
@RequestBody
TendencyQuery
tendencyQuery
)
{
return
iCharacterParamService
.
getTendency
(
tendencyQuery
.
getKeys
(),
return
iCharacterParamService
.
getTendency
(
tendencyQuery
.
getKeys
(),
tendencyQuery
.
getTimeModelQuery
(),
tendencyQuery
.
getStatus
());
tendencyQuery
.
getTimeModelQuery
(),
tendencyQuery
.
getStatus
());
...
...
power-bussiness/src/main/java/cn/wise/sc/energy/power/plant/business/controller/EntityEnclosureController.java
View file @
554a8aed
...
@@ -8,6 +8,7 @@ import cn.wise.sc.energy.power.plant.common.core.bean.BaseResponse;
...
@@ -8,6 +8,7 @@ import cn.wise.sc.energy.power.plant.common.core.bean.BaseResponse;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
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.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
@@ -27,6 +28,7 @@ import java.util.Map;
...
@@ -27,6 +28,7 @@ import java.util.Map;
* 附件管理Controller
* 附件管理Controller
* @author ztw
* @author ztw
*/
*/
@CrossOrigin
@RestController
@RestController
@RequestMapping
(
"/enclosure"
)
@RequestMapping
(
"/enclosure"
)
public
class
EntityEnclosureController
{
public
class
EntityEnclosureController
{
...
...
power-bussiness/src/main/java/cn/wise/sc/energy/power/plant/business/domain/TendencyQuery.java
View file @
554a8aed
package
cn
.
wise
.
sc
.
energy
.
power
.
plant
.
business
.
domain
;
package
cn
.
wise
.
sc
.
energy
.
power
.
plant
.
business
.
domain
;
import
cn.wise.sc.energy.power.plant.business.bean.TimeModelQuery
;
import
cn.wise.sc.energy.power.plant.business.bean.TimeModelQuery
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.io.Serializable
;
...
@@ -12,9 +14,13 @@ import java.util.List;
...
@@ -12,9 +14,13 @@ import java.util.List;
* @create: 2020-08-18 16:53
* @create: 2020-08-18 16:53
**/
**/
@Data
@Data
@ApiModel
(
"趋势查询"
)
public
class
TendencyQuery
implements
Serializable
{
public
class
TendencyQuery
implements
Serializable
{
@ApiModelProperty
(
"kkscode"
)
List
<
String
>
keys
;
List
<
String
>
keys
;
@ApiModelProperty
(
"时间查询对象"
)
TimeModelQuery
timeModelQuery
;
TimeModelQuery
timeModelQuery
;
@ApiModelProperty
(
"状态"
)
Integer
status
;
Integer
status
;
}
}
power-bussiness/src/main/java/cn/wise/sc/energy/power/plant/business/jni/WaveAnalysis.java
View file @
554a8aed
...
@@ -9,7 +9,7 @@ import com.sun.jna.Native;
...
@@ -9,7 +9,7 @@ import com.sun.jna.Native;
* @create: 2020-08-24 19:40
* @create: 2020-08-24 19:40
**/
**/
public
interface
WaveAnalysis
extends
Library
{
public
interface
WaveAnalysis
extends
Library
{
//
String
dllPath
=
"libGMWaveAnalysisModel.so"
;
String
dllPath
=
"libGMWaveAnalysisModel.so"
;
WaveAnalysis
INSTANCE
=
Native
.
load
(
dllPath
,
WaveAnalysis
.
class
);
WaveAnalysis
INSTANCE
=
Native
.
load
(
dllPath
,
WaveAnalysis
.
class
);
...
...
power-bussiness/src/main/java/cn/wise/sc/energy/power/plant/business/service/impl/CharacterParamServiceImpl.java
View file @
554a8aed
...
@@ -602,6 +602,8 @@ public class CharacterParamServiceImpl extends BaseServiceImpl<String, Character
...
@@ -602,6 +602,8 @@ public class CharacterParamServiceImpl extends BaseServiceImpl<String, Character
DataPower
.
PowerPoints
powerPoints
=
new
DataPower
.
PowerPoints
();
DataPower
.
PowerPoints
powerPoints
=
new
DataPower
.
PowerPoints
();
dataPower
.
getDataList
().
add
(
powerPoints
);
dataPower
.
getDataList
().
add
(
powerPoints
);
powerPoints
.
setName
(
cpName
);
powerPoints
.
setName
(
cpName
);
powerPoints
.
setKksCode
(
characterParamInfo
.
getKksCode
());
//关联报警点数
//关联报警点数
CharacterParamInfo
.
Alert
alert
=
buildAlert
(
characterParamInfo
);
CharacterParamInfo
.
Alert
alert
=
buildAlert
(
characterParamInfo
);
powerPoints
.
setColor
(
JSON
.
toJSONString
(
alert
,
SerializerFeature
.
IgnoreNonFieldGetter
));
powerPoints
.
setColor
(
JSON
.
toJSONString
(
alert
,
SerializerFeature
.
IgnoreNonFieldGetter
));
...
...
power-bussiness/src/main/java/cn/wise/sc/energy/power/plant/business/utils/dfs/FastDFSUtils.java
View file @
554a8aed
...
@@ -30,8 +30,8 @@ public class FastDFSUtils {
...
@@ -30,8 +30,8 @@ public class FastDFSUtils {
static
{
static
{
try
{
try
{
ClientGlobal
.
initByProperties
(
FastDFSUtils
.
class
.
getClassLoader
().
getResource
(
"fastdfs-client.properties"
).
getPath
());
//
ClientGlobal.initByProperties(FastDFSUtils.class.getClassLoader().getResource("fastdfs-client.properties").getPath());
//
ClientGlobal.initByProperties("fastdfs-client.properties");
ClientGlobal
.
initByProperties
(
"fastdfs-client.properties"
);
}
catch
(
FileNotFoundException
e
)
{
}
catch
(
FileNotFoundException
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
...
@@ -155,7 +155,7 @@ public class FastDFSUtils {
...
@@ -155,7 +155,7 @@ public class FastDFSUtils {
//操作文档保存
//操作文档保存
document
.
save
(
outputFile
.
getAbsolutePath
(),
com
.
aspose
.
words
.
SaveFormat
.
PDF
);
document
.
save
(
outputFile
.
getAbsolutePath
(),
com
.
aspose
.
words
.
SaveFormat
.
PDF
);
FileReader
fileReader
=
new
FileReader
(
outputFile
.
getAbsolutePath
());
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
)
{
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
...
...
power-bussiness/src/main/resources/logback-spring.xml
0 → 100644
View file @
554a8aed
<?xml version="1.0" encoding="UTF-8"?>
<!-- 日志级别从低到高分为TRACE < DEBUG < INFO < WARN < ERROR < FATAL,如果设置为WARN,则低于WARN的信息都不会输出 -->
<!-- scan:当此属性设置为true时,配置文档如果发生改变,将会被重新加载,默认值为true -->
<!-- scanPeriod:设置监测配置文档是否有修改的时间间隔,如果没有给出时间单位,默认单位是毫秒。
当scan为true时,此属性生效。默认的时间间隔为1分钟。 -->
<!-- debug:当此属性设置为true时,将打印出logback内部日志信息,实时查看logback运行状态。默认值为false。 -->
<configuration
scan=
"true"
scanPeriod=
"10 seconds"
>
<contextName>
logback-spring
</contextName>
<!-- name的值是变量的名称,value的值时变量定义的值。通过定义的值会被插入到logger上下文中。定义后,可以使“${}”来使用变量。 -->
<property
name=
"logging.path"
value=
"./../wise-came/logs"
/>
<!--0. 日志格式和颜色渲染 -->
<!-- 彩色日志依赖的渲染类 -->
<conversionRule
conversionWord=
"clr"
converterClass=
"org.springframework.boot.logging.logback.ColorConverter"
/>
<conversionRule
conversionWord=
"wex"
converterClass=
"org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter"
/>
<conversionRule
conversionWord=
"wEx"
converterClass=
"org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter"
/>
<!-- 彩色日志格式 -->
<property
name=
"CONSOLE_LOG_PATTERN"
value=
"${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"
/>
<!--1. 输出到控制台-->
<appender
name=
"CONSOLE"
class=
"ch.qos.logback.core.ConsoleAppender"
>
<!--此日志appender是为开发使用,只配置最底级别,控制台输出的日志级别是大于或等于此级别的日志信息-->
<filter
class=
"ch.qos.logback.classic.filter.ThresholdFilter"
>
<level>
debug
</level>
</filter>
<encoder>
<Pattern>
${CONSOLE_LOG_PATTERN}
</Pattern>
<!-- 设置字符集 -->
<charset>
UTF-8
</charset>
</encoder>
</appender>
<!--2. 输出到文档-->
<!-- 2.1 level为 DEBUG 日志,时间滚动输出 -->
<appender
name=
"DEBUG_FILE"
class=
"ch.qos.logback.core.rolling.RollingFileAppender"
>
<!-- 正在记录的日志文档的路径及文档名 -->
<file>
${logging.path}/debug.log
</file>
<!--日志文档输出格式-->
<encoder>
<pattern>
%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n
</pattern>
<charset>
UTF-8
</charset>
<!-- 设置字符集 -->
</encoder>
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<rollingPolicy
class=
"ch.qos.logback.core.rolling.TimeBasedRollingPolicy"
>
<!-- 日志归档 -->
<fileNamePattern>
${logging.path}/debug-%d{yyyy-MM-dd}.%i.log
</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy
class=
"ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"
>
<maxFileSize>
100MB
</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!--日志文档保留天数-->
<maxHistory>
15
</maxHistory>
</rollingPolicy>
<!-- 此日志文档只记录debug级别的 -->
<filter
class=
"ch.qos.logback.classic.filter.LevelFilter"
>
<level>
debug
</level>
<onMatch>
ACCEPT
</onMatch>
<onMismatch>
DENY
</onMismatch>
</filter>
</appender>
<!-- 2.2 level为 INFO 日志,时间滚动输出 -->
<appender
name=
"INFO_FILE"
class=
"ch.qos.logback.core.rolling.RollingFileAppender"
>
<!-- 正在记录的日志文档的路径及文档名 -->
<file>
${logging.path}/info.log
</file>
<!--日志文档输出格式-->
<encoder>
<pattern>
%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n
</pattern>
<charset>
UTF-8
</charset>
</encoder>
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<rollingPolicy
class=
"ch.qos.logback.core.rolling.TimeBasedRollingPolicy"
>
<!-- 每天日志归档路径以及格式 -->
<fileNamePattern>
${logging.path}/info-%d{yyyy-MM-dd}.%i.log
</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy
class=
"ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"
>
<maxFileSize>
100MB
</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!--日志文档保留天数-->
<maxHistory>
15
</maxHistory>
</rollingPolicy>
<!-- 此日志文档只记录info级别的 -->
<filter
class=
"ch.qos.logback.classic.filter.LevelFilter"
>
<level>
info
</level>
<onMatch>
ACCEPT
</onMatch>
<onMismatch>
DENY
</onMismatch>
</filter>
</appender>
<!-- 2.3 level为 WARN 日志,时间滚动输出 -->
<appender
name=
"WARN_FILE"
class=
"ch.qos.logback.core.rolling.RollingFileAppender"
>
<!-- 正在记录的日志文档的路径及文档名 -->
<file>
${logging.path}/warn.log
</file>
<!--日志文档输出格式-->
<encoder>
<pattern>
%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n
</pattern>
<charset>
UTF-8
</charset>
<!-- 此处设置字符集 -->
</encoder>
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<rollingPolicy
class=
"ch.qos.logback.core.rolling.TimeBasedRollingPolicy"
>
<fileNamePattern>
${logging.path}/warn-%d{yyyy-MM-dd}.%i.log
</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy
class=
"ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"
>
<maxFileSize>
100MB
</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!--日志文档保留天数-->
<maxHistory>
15
</maxHistory>
</rollingPolicy>
<!-- 此日志文档只记录warn级别的 -->
<filter
class=
"ch.qos.logback.classic.filter.LevelFilter"
>
<level>
warn
</level>
<onMatch>
ACCEPT
</onMatch>
<onMismatch>
DENY
</onMismatch>
</filter>
</appender>
<!-- 2.4 level为 ERROR 日志,时间滚动输出 -->
<appender
name=
"ERROR_FILE"
class=
"ch.qos.logback.core.rolling.RollingFileAppender"
>
<!-- 正在记录的日志文档的路径及文档名 -->
<file>
${logging.path}/error.log
</file>
<!--日志文档输出格式-->
<encoder>
<pattern>
%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n
</pattern>
<charset>
UTF-8
</charset>
<!-- 此处设置字符集 -->
</encoder>
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<rollingPolicy
class=
"ch.qos.logback.core.rolling.TimeBasedRollingPolicy"
>
<fileNamePattern>
${logging.path}/error-%d{yyyy-MM-dd}.%i.log
</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy
class=
"ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"
>
<maxFileSize>
100MB
</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!--日志文档保留天数-->
<maxHistory>
15
</maxHistory>
</rollingPolicy>
<!-- 此日志文档只记录ERROR级别的 -->
<filter
class=
"ch.qos.logback.classic.filter.LevelFilter"
>
<level>
ERROR
</level>
<onMatch>
ACCEPT
</onMatch>
<onMismatch>
DENY
</onMismatch>
</filter>
</appender>
<!--
<logger>用来设置某一个包或者具体的某一个类的日志打印级别、
以及指定<appender>。<logger>仅有一个name属性,
一个可选的level和一个可选的addtivity属性。
name:用来指定受此logger约束的某一个包或者具体的某一个类。
level:用来设置打印级别,大小写无关:TRACE, DEBUG, INFO, WARN, ERROR, ALL 和 OFF,
还有一个特俗值INHERITED或者同义词NULL,代表强制执行上级的级别。
如果未设置此属性,那么当前logger将会继承上级的级别。
addtivity:是否向上级logger传递打印信息。默认是true。
<logger name="org.springframework.web" level="info"/>
<logger name="org.springframework.scheduling.annotation.ScheduledAnnotationBeanPostProcessor" level="INFO"/>
-->
<!--
使用mybatis的时候,sql语句是debug下才会打印,而这里我们只配置了info,所以想要查看sql语句的话,有以下两种操作:
第一种把<root level="info">改成<root level="DEBUG">这样就会打印sql,不过这样日志那边会出现很多其他消息
第二种就是单独给dao下目录配置debug模式,代码如下,这样配置sql语句会打印,其他还是正常info级别:
【logging.level.org.mybatis=debug logging.level.dao=debug】
-->
<!--
root节点是必选节点,用来指定最基础的日志输出级别,只有一个level属性
level:用来设置打印级别,大小写无关:TRACE, DEBUG, INFO, WARN, ERROR, ALL 和 OFF,
不能设置为INHERITED或者同义词NULL。默认是DEBUG
可以包含零个或多个元素,标识这个appender将会添加到这个logger。
-->
<!--过滤掉spring和mybatis的一些无用的DEBUG信息-->
<logger
name=
"org.springframework"
level=
"WARN"
></logger>
<logger
name=
"org.springframework.web.servlet.mvc.method.annotation"
level=
"WARN"
></logger>
<logger
name=
"org.mybatis"
level=
"WARN"
></logger>
<logger
name=
"com.zaxxer.hikari"
level=
"ERROR"
></logger>
<logger
name=
"com.baomidou"
level=
"WARN"
></logger>
<logger
name=
"io.netty"
level=
"WARN"
></logger>
<!--<logger name="org.apache.zookeeper" level="INFO"></logger>-->
<!-- 4. 最终的策略 -->
<!-- 4.1 开发环境:打印控制台-->
<springProfile
name=
"dev"
>
<logger
name=
"cn.wise.sc.cement.business.controller"
level=
"debug"
/>
<!-- 修改此处扫描包名 -->
</springProfile>
<root
level=
"debug"
>
<appender-ref
ref=
"CONSOLE"
/>
<appender-ref
ref=
"DEBUG_FILE"
/>
<appender-ref
ref=
"INFO_FILE"
/>
<appender-ref
ref=
"WARN_FILE"
/>
<appender-ref
ref=
"ERROR_FILE"
/>
</root>
<!--4.2 生产环境:输出到文档-->
<springProfile
name=
"pro"
>
<root
level=
"info"
>
<appender-ref
ref=
"CONSOLE"
/>
<appender-ref
ref=
"DEBUG_FILE"
/>
<appender-ref
ref=
"INFO_FILE"
/>
<appender-ref
ref=
"ERROR_FILE"
/>
<appender-ref
ref=
"WARN_FILE"
/>
</root>
</springProfile>
</configuration>
\ No newline at end of file
power-common/common-core/pom.xml
View file @
554a8aed
...
@@ -18,22 +18,20 @@
...
@@ -18,22 +18,20 @@
<hutool.version>
4.6.8
</hutool.version>
<hutool.version>
4.6.8
</hutool.version>
<lombok.version>
1.18.10
</lombok.version>
<lombok.version>
1.18.10
</lombok.version>
<fastjson.version>
1.2.62
</fastjson.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-bootstrap-ui.version>
1.9.3
</swagger-bootstrap-ui.version>
<swagger.fox.version>
2.9.2
</swagger.fox.version>
<swagger.fox.version>
2.9.2
</swagger.fox.version>
</properties>
</properties>
<dependencies>
<dependencies>
<!--swagger-->
<dependency>
<!-- <dependency>-->
<groupId>
io.springfox
</groupId>
<!-- <groupId>io.springfox</groupId>-->
<artifactId>
springfox-swagger2
</artifactId>
<!-- <artifactId>springfox-swagger2</artifactId>-->
<version>
${swagger.fox.version}
</version>
<!-- <version>${swagger.fox.version}</version>-->
</dependency>
<!-- </dependency>-->
<dependency>
<!-- <dependency>-->
<groupId>
io.springfox
</groupId>
<!-- <groupId>io.springfox</groupId>-->
<artifactId>
springfox-swagger-ui
</artifactId>
<!-- <artifactId>springfox-swagger-ui</artifactId>-->
<version>
${swagger.fox.version}
</version>
<!-- <version>${swagger.fox.version}</version>-->
</dependency>
<!-- </dependency>-->
<!--jackson模块-->
<!--jackson模块-->
<dependency>
<dependency>
<groupId>
com.fasterxml.jackson.module
</groupId>
<groupId>
com.fasterxml.jackson.module
</groupId>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment