Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
indicators
Overview
Overview
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
zhangkb
indicators
Commits
16277202
Commit
16277202
authored
Dec 30, 2020
by
hzc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化
parent
e7a21297
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
8 deletions
+19
-8
BaseIndDefMapper.java
.../indicators/model/mapper/indicators/BaseIndDefMapper.java
+2
-0
BaseIndDefService.java
...obile/indicators/service/hytobacco/BaseIndDefService.java
+1
-4
LoggingEventServiceImpl.java
...bile/indicators/service/impl/LoggingEventServiceImpl.java
+10
-4
BaseIndDefMapper.xml
src/main/resources/mybatis/mapping/BaseIndDefMapper.xml
+6
-0
No files found.
src/main/java/com/keymobile/indicators/model/mapper/indicators/BaseIndDefMapper.java
View file @
16277202
...
...
@@ -24,4 +24,6 @@ public interface BaseIndDefMapper extends BaseMapper<BaseIndDef>{
public
List
<
BaseIndDef
>
getByIdIn
(
@Param
(
"indIds"
)
List
<
String
>
indIds
);
public
void
deleteByIdIn
(
@Param
(
"indIds"
)
List
<
String
>
indIds
);
List
<
BaseIndDef
>
selectByCatalogIdAndIndName
(
@Param
(
"catalogId"
)
Integer
catalogId
,
@Param
(
"indName"
)
String
indName
);
}
src/main/java/com/keymobile/indicators/service/hytobacco/BaseIndDefService.java
View file @
16277202
...
...
@@ -30,10 +30,7 @@ public class BaseIndDefService {
String
catalogIdPath
,
String
user
,
String
isUpdate
,
String
code
)
throws
Exception
{
//判断名称是否重复
BaseIndDef
baseIndDefSql
=
new
BaseIndDef
();
baseIndDefSql
.
setCatalogId
(
catalogId
);
baseIndDefSql
.
setIndName
(
baseIndDef
.
getIndName
());
List
<
BaseIndDef
>
select
=
baseIndDefMapper
.
select
(
baseIndDef
);
List
<
BaseIndDef
>
select
=
baseIndDefMapper
.
selectByCatalogIdAndIndName
(
catalogId
,
baseIndDef
.
getIndName
());
if
(
select
!=
null
&&
select
.
size
()>
0
&&!
select
.
get
(
0
).
getIndId
().
equals
(
baseIndDef
.
getIndId
())){
throw
new
Exception
(
"数据项名称已存在,操作失败!!"
);
}
...
...
src/main/java/com/keymobile/indicators/service/impl/LoggingEventServiceImpl.java
View file @
16277202
...
...
@@ -21,12 +21,18 @@ public class LoggingEventServiceImpl implements LoggingEventService {
logQuery
.
setStartTime
(
this
.
getDateTime
(
logQuery
.
getStartDateStr
()));
logQuery
.
setEndTime
(
this
.
getDateTime
(
logQuery
.
getEndDateStr
()));
}
List
<
LogStatistics
>
LogStatisticsList
=
loggingEventMapper
.
findClassNameAndCount
(
logQuery
);
List
<
LogStatistics
>
logStatisticsList
=
loggingEventMapper
.
findClassNameAndCount
(
logQuery
);
Collections
.
sort
(
logStatisticsList
,
new
Comparator
<
LogStatistics
>()
{
@Override
public
int
compare
(
LogStatistics
o1
,
LogStatistics
o2
)
{
return
(
int
)
(
o2
.
getCount
()-
o1
.
getCount
());
}
});
//如果大于五个取五个
if
(
LogStatisticsList
!=
null
&&
L
ogStatisticsList
.
size
()>
5
){
return
L
ogStatisticsList
.
subList
(
0
,
5
);
if
(
logStatisticsList
!=
null
&&
l
ogStatisticsList
.
size
()>
5
){
return
l
ogStatisticsList
.
subList
(
0
,
5
);
}
return
L
ogStatisticsList
;
return
l
ogStatisticsList
;
}
@Override
...
...
src/main/resources/mybatis/mapping/BaseIndDefMapper.xml
View file @
16277202
...
...
@@ -64,4 +64,9 @@
#{id}
</foreach>
</delete>
<select
id=
"selectByCatalogIdAndIndName"
resultType=
"com.keymobile.indicators.model.entity.indicators.BaseIndDef"
>
select *
from base_ind_def
where catalog_id=#{catalogId} and ind_name=#{indName}
</select>
</mapper>
\ 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