Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dex-basic-service-expand
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
INET-TWO
server
dex-basic-service-expand
Commits
b8335fc9
Commit
b8335fc9
authored
Sep 20, 2024
by
wangyangyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新版本
parent
61e116c4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
239 additions
and
8 deletions
+239
-8
ExtProgramServiceImpl.java
...de/dex/basic/core/service/impl/ExtProgramServiceImpl.java
+24
-8
logback-spring.xml
...e-expand-server/src/main/resources/log/logback-spring.xml
+215
-0
No files found.
dex-basic-service-expand-core/src/main/java/com/yonde/dex/basic/core/service/impl/ExtProgramServiceImpl.java
View file @
b8335fc9
...
...
@@ -2,14 +2,19 @@ package com.yonde.dex.basic.core.service.impl;
import
com.yonde.dex.basedata.data.search.SearchItem
;
import
com.yonde.dex.basedata.data.search.SearchQueryCondition
;
import
com.yonde.dex.basedata.entity.data.DxPageImpl
;
import
com.yonde.dex.basic.common.vo.ExtProgramProjectLinkVO
;
import
com.yonde.dex.basic.core.service.ExtProgramProjectLinkService
;
import
com.yonde.dex.basic.core.service.expand.ExtDxContextService
;
import
com.yonde.dex.basic.core.util.SearchUtil
;
import
com.yonde.dex.context.common.vo.DxContextProjectVO
;
import
com.yonde.dex.context.common.vo.DxContextVO
;
import
com.yonde.dex.context.core.service.shadow.DxContextProjectServiceShadow
;
import
org.springframework.stereotype.Service
;
import
io.swagger.annotations.ApiOperation
;
import
java.util.List
;
import
com.yonde.dex.basic.common.vo.ExtProgramVO
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -18,19 +23,21 @@ import org.springframework.web.bind.annotation.*;
import
com.yonde.dex.basic.core.service.ExtProgramService
;
import
com.yonde.dex.basic.core.repository.ExtProgramRepository
;
import
com.yonde.dex.basic.entity.po.ExtProgram
;
import
javax.annotation.Resource
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.PageImpl
;
/**
* @description: ExtProgram-ServiceImpl
* @author: dexadmin
* @version: V
* @date: 2024-9-20 10:26:39
**/
* @description: ExtProgram-ServiceImpl
* @author: dexadmin
* @version: V
* @date: 2024-9-20 10:26:39
**/
@Slf4j
@Service
(
ExtProgramServiceImpl
.
BEAN_NAME
)
public
class
ExtProgramServiceImpl
<
V
extends
ExtProgramVO
>
implements
ExtProgramService
<
V
>{
public
class
ExtProgramServiceImpl
<
V
extends
ExtProgramVO
>
implements
ExtProgramService
<
V
>
{
public
static
final
String
BEAN_NAME
=
"extProgramServiceImpl"
;
...
...
@@ -45,18 +52,27 @@ public class ExtProgramServiceImpl<V extends ExtProgramVO> implements ExtProgram
@Autowired
ExtDxContextService
extDxContextService
;
@Autowired
DxContextProjectServiceShadow
contextProjectServiceShadow
;
@Override
public
Page
<
V
>
searchProps
(
SearchQueryCondition
searchQueryCondition
)
{
Page
<
V
>
page
=
search
(
searchQueryCondition
);
if
(
page
.
hasContent
())
{
for
(
V
v
:
page
.
getContent
())
{
//设置项目子级
//设置项目子级
展开target的时候并没有展开,后续重新查询展开
SearchQueryCondition
queryCondition
=
SearchUtil
.
buildQueryWithOpenAttr
(
"sourceId"
,
SearchItem
.
Operator
.
EQ
,
v
.
getId
(),
"target"
);
List
<
ExtProgramProjectLinkVO
>
content
=
extProgramProjectLinkService
.
findRecursion
(
queryCondition
).
getContent
();
for
(
ExtProgramProjectLinkVO
linkVO
:
content
)
{
Long
targetId
=
linkVO
.
getTargetId
();
List
<
DxContextProjectVO
>
children
=
extDxContextService
.
getSingleChild
(
targetId
);
linkVO
.
getTarget
().
setChildren
(
children
);
//深度查询查不出来,以下方法查询也是有问题
// DxContextVO target = extDxContextService.getContextVoById(targetId);
DxContextVO
target
=
(
DxContextVO
)
extDxContextService
.
search
(
SearchUtil
.
buildQuery
(
"id"
,
SearchItem
.
Operator
.
EQ
,
targetId
)).
getContent
().
get
(
0
);
// DxContextVO target = (DxContextVO) contextProjectServiceShadow.get(targetId);
target
.
setChildren
(
children
);
linkVO
.
setTarget
(
target
);
// linkVO.getTarget().setChildren(children);
}
v
.
setExtProgramProjectLinks
(
content
);
}
...
...
dex-basic-service-expand-server/src/main/resources/log/logback-spring.xml
0 → 100644
View file @
b8335fc9
<?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"
>
<!--<include resource="org/springframework/boot/logging/logback/base.xml" />-->
<!-- log base path -->
<springProperty
scope=
"context"
name=
"log.path"
source=
"log.path"
defaultValue=
"logs"
/>
<contextName>
logback
</contextName>
<!-- 彩色日志 -->
<!-- 彩色日志依赖的渲染类 -->
<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}}"
/>
<!--输出到控制台-->
<appender
name=
"CONSOLE"
class=
"ch.qos.logback.core.ConsoleAppender"
>
<!--此日志appender是为开发使用,只配置最底级别,控制台输出的日志级别是大于或等于此级别的日志信息-->
<filter
class=
"ch.qos.logback.classic.filter.ThresholdFilter"
>
<level>
info
</level>
</filter>
<encoder>
<Pattern>
${CONSOLE_LOG_PATTERN}
</Pattern>
<!-- 设置字符集 -->
<charset>
UTF-8
</charset>
</encoder>
</appender>
<!--输出到文件-->
<!-- 时间滚动输出 level为 DEBUG 日志 -->
<appender
name=
"DEBUG_FILE"
class=
"ch.qos.logback.core.rolling.RollingFileAppender"
>
<!-- 正在记录的日志文件的路径及文件名 -->
<file>
${log.path}/log_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>
${log.path}/debug/log-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>
<!-- 时间滚动输出 level为 INFO 日志 -->
<appender
name=
"INFO_FILE"
class=
"ch.qos.logback.core.rolling.RollingFileAppender"
>
<!-- 正在记录的日志文件的路径及文件名 -->
<file>
${log.path}/log_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>
${log.path}/info/log-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>
<!-- 时间滚动输出 level为 WARN 日志 -->
<appender
name=
"WARN_FILE"
class=
"ch.qos.logback.core.rolling.RollingFileAppender"
>
<!-- 正在记录的日志文件的路径及文件名 -->
<file>
${log.path}/log_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>
${log.path}/warn/log-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>
<!-- 时间滚动输出 level为 ERROR 日志 -->
<appender
name=
"ERROR_FILE"
class=
"ch.qos.logback.core.rolling.RollingFileAppender"
>
<!-- 正在记录的日志文件的路径及文件名 -->
<file>
${log.path}/log_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>
${log.path}/error/log-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级别:
-->
<!--
root节点是必选节点,用来指定最基础的日志输出级别,只有一个level属性
level:用来设置打印级别,大小写无关:TRACE, DEBUG, INFO, WARN, ERROR, ALL 和 OFF,
不能设置为INHERITED或者同义词NULL。默认是DEBUG
可以包含零个或多个元素,标识这个appender将会添加到这个logger。
-->
<appender
name=
"ASYNC_CONSOLE"
class=
"ch.qos.logback.classic.AsyncAppender"
>
<!-- 添加附加的appender,最多只能添加一个,配置多个只生效第一个 -->
<appender-ref
ref=
"CONSOLE"
/>
<!-- 不丢失日志.默认的,如果队列的80%已满,则会丢弃TRACT、DEBUG、INFO级别的日志 -->
<!-- <discardingThreshold >0</discardingThreshold>-->
<!-- 更改默认的队列的深度,该值会影响性能.默认值为256 -->
<!-- <queueSize>512</queueSize>-->
</appender>
<appender
name=
"ASYNC_DEBUG_FILE"
class=
"ch.qos.logback.classic.AsyncAppender"
>
<appender-ref
ref=
"DEBUG_FILE"
/>
</appender>
<appender
name=
"ASYNC_INFO_FILE"
class=
"ch.qos.logback.classic.AsyncAppender"
>
<appender-ref
ref=
"INFO_FILE"
/>
</appender>
<appender
name=
"ASYNC_WARN_FILE"
class=
"ch.qos.logback.classic.AsyncAppender"
>
<appender-ref
ref=
"WARN_FILE"
/>
</appender>
<appender
name=
"ASYNC_ERROR_FILE"
class=
"ch.qos.logback.classic.AsyncAppender"
>
<appender-ref
ref=
"ERROR_FILE"
/>
</appender>
<!--开发环境:打印控制台-->
<springProfile
name=
"local,oracle"
>
<logger
name=
"com.nmys.view"
level=
"debug"
/>
<root
level=
"info"
>
<appender-ref
ref=
"ASYNC_CONSOLE"
/>
<appender-ref
ref=
"ASYNC_DEBUG_FILE"
/>
<appender-ref
ref=
"ASYNC_INFO_FILE"
/>
<appender-ref
ref=
"ASYNC_WARN_FILE"
/>
<appender-ref
ref=
"ASYNC_ERROR_FILE"
/>
</root>
</springProfile>
<!-- 生产环境:输出到文件-->
<springProfile
name=
"dev,test,prod,oracle"
>
<root
level=
"info"
>
<!--<appender-ref ref="ASYNC_CONSOLE"/>
<appender-ref ref="ASYNC_DEBUG_FILE"/>
<appender-ref ref="ASYNC_INFO_FILE"/>
<appender-ref ref="ASYNC_WARN_FILE"/>-->
<appender-ref
ref=
"ASYNC_ERROR_FILE"
/>
</root>
</springProfile>
</configuration>
\ No newline at end of file
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