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
4548d93d
Commit
4548d93d
authored
Sep 10, 2020
by
zhangkb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加根据指标目录idPath获取idPath的中文路径描述接口
parent
671213ea
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
1 deletion
+30
-1
DriveIndCatalog.java
...e/indicators/model/entity/indicators/DriveIndCatalog.java
+3
-0
DriveIndCatalogService.java
.../indicators/service/hytobacco/DriveIndCatalogService.java
+27
-1
No files found.
src/main/java/com/keymobile/indicators/model/entity/indicators/DriveIndCatalog.java
View file @
4548d93d
...
@@ -6,6 +6,7 @@ import javax.persistence.GeneratedValue;
...
@@ -6,6 +6,7 @@ import javax.persistence.GeneratedValue;
import
javax.persistence.GenerationType
;
import
javax.persistence.GenerationType
;
import
javax.persistence.Id
;
import
javax.persistence.Id
;
import
javax.persistence.Table
;
import
javax.persistence.Table
;
import
javax.persistence.Transient
;
import
com.keymobile.indicators.utils.DateUtils
;
import
com.keymobile.indicators.utils.DateUtils
;
...
@@ -28,4 +29,6 @@ public class DriveIndCatalog {
...
@@ -28,4 +29,6 @@ public class DriveIndCatalog {
private
String
code
;
//目录编码
private
String
code
;
//目录编码
private
String
lastUpdater
;
private
String
lastUpdater
;
private
String
lastUpdateTime
=
DateUtils
.
formatDate
(
new
Date
(),
"yyyy-MM-dd HH:mm:ss"
);
private
String
lastUpdateTime
=
DateUtils
.
formatDate
(
new
Date
(),
"yyyy-MM-dd HH:mm:ss"
);
@Transient
private
String
idPathDesc
;
}
}
src/main/java/com/keymobile/indicators/service/hytobacco/DriveIndCatalogService.java
View file @
4548d93d
...
@@ -126,6 +126,32 @@ public class DriveIndCatalogService {
...
@@ -126,6 +126,32 @@ public class DriveIndCatalogService {
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"type"
,
type
);
paramMap
.
put
(
"type"
,
type
);
paramMap
.
put
(
"codes"
,
codes
);
paramMap
.
put
(
"codes"
,
codes
);
return
driveIndCatalogMapper
.
findByCatalogTypeAndCode
(
paramMap
);
List
<
DriveIndCatalog
>
catalogs
=
driveIndCatalogMapper
.
findByCatalogTypeAndCode
(
paramMap
);
List
<
DriveIndCatalog
>
results
=
new
ArrayList
<>();
for
(
DriveIndCatalog
catalog
:
catalogs
)
{
catalog
.
setIdPathDesc
(
this
.
getCatalogIdPathDesc
(
catalog
.
getIdPath
()));
results
.
add
(
catalog
);
}
return
results
;
}
public
String
getCatalogIdPathDesc
(
String
idPath
){
String
idPathDesc
=
""
;
if
(
StringUtils
.
isNotBlank
(
idPath
))
{
//去掉idPath中的最后一个分号
idPath
=
idPath
.
substring
(
0
,
idPath
.
length
()-
1
);
String
[]
ids
=
idPath
.
split
(
";"
);
if
(
ids
.
length
>
0
)
{
for
(
String
id
:
ids
)
{
//根据id获取对标指标目录
DriveIndCatalog
catalog
=
driveIndCatalogMapper
.
selectByPrimaryKey
(
Integer
.
parseInt
(
id
));
if
(
catalog
!=
null
)
{
idPathDesc
+=
catalog
.
getCatalogName
()+
";"
;
}
}
}
}
return
idPathDesc
;
}
}
}
}
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