Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
T
traffic-front
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangxiaoming
traffic-front
Commits
05a6d667
Commit
05a6d667
authored
Nov 11, 2018
by
neo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[DEV] add get project by id
parent
4a041590
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
37 deletions
+34
-37
ProjectController.java
...n/java/pwc/taxtech/atms/controller/ProjectController.java
+1
-1
ProjectServiceImpl.java
...ava/pwc/taxtech/atms/service/impl/ProjectServiceImpl.java
+13
-4
ProjectDisplayDto.java
...src/main/java/pwc/taxtech/atms/dpo/ProjectDisplayDto.java
+20
-32
No files found.
atms-api/src/main/java/pwc/taxtech/atms/controller/ProjectController.java
View file @
05a6d667
...
...
@@ -47,7 +47,7 @@ public class ProjectController {
@ApiOperation
(
value
=
"getProject"
,
notes
=
"Get Project"
)
@RequestMapping
(
value
=
"getProject"
,
method
=
RequestMethod
.
GET
)
public
@ResponseBody
List
<
ProjectDisplayDto
>
GetProjectById
(
String
projectId
)
{
ProjectDisplayDto
GetProjectById
(
String
projectId
)
{
return
projectService
.
getProjectById
(
projectId
);
}
...
...
atms-api/src/main/java/pwc/taxtech/atms/service/impl/ProjectServiceImpl.java
View file @
05a6d667
...
...
@@ -105,10 +105,19 @@ public class ProjectServiceImpl {
/**
* @TODO: this dmeo only for running,should change to query data from db (neo)
*/
public
List
<
ProjectDisplayDto
>
getProjectById
(
String
projectId
)
{
List
<
ProjectDisplayDto
>
displayDtos
=
new
ArrayList
<>();
displayDtos
.
add
(
new
ProjectDisplayDto
().
demo
());
return
displayDtos
;
public
ProjectDisplayDto
getProjectById
(
String
projectId
)
{
Project
project
=
projectMapper
.
selectByPrimaryKey
(
projectId
);
ProjectDisplayDto
dto
=
new
ProjectDisplayDto
();
dto
.
extractFromProject
(
project
);
List
<
ProjectStatusManage
>
manageStatus
=
projectMapper
.
getStatusesByProjectId
(
projectId
);
Map
<
Integer
,
Integer
>
dic
=
new
HashMap
<>();
manageStatus
.
forEach
(
m
->
{
dic
.
put
(
m
.
getPeriodId
(),
m
.
getStatus
());
});
dto
.
setProjectStatusList
(
dic
);
return
dto
;
}
public
List
<
ProjectDisplayDto
>
getAllProjectList
(
String
orgId
,
String
serviceId
,
Integer
projectYear
)
{
...
...
atms-dao/src/main/java/pwc/taxtech/atms/dpo/ProjectDisplayDto.java
View file @
05a6d667
package
pwc
.
taxtech
.
atms
.
dpo
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
pwc.taxtech.atms.entity.Project
;
import
java.util.ArrayList
;
import
java.util.Date
;
...
...
@@ -268,38 +269,6 @@ public class ProjectDisplayDto {
this
.
year
=
year
;
}
public
ProjectDisplayDto
demo
()
{
this
.
clientCode
=
"1"
;
this
.
code
=
"1"
;
this
.
createTime
=
new
Date
();
this
.
dbName
=
"db"
;
this
.
effectiveDate
=
new
Date
();
this
.
endPeriod
=
1
;
this
.
enterpriseAccountSetId
=
"1"
;
this
.
expiredDate
=
new
Date
();
this
.
haveCreateProject
=
true
;
this
.
id
=
"1"
;
this
.
industryId
=
"1"
;
this
.
industryName
=
"dname"
;
this
.
isActive
=
true
;
this
.
name
=
"na"
;
this
.
organizationId
=
"oid"
;
this
.
organizationName
=
"oname"
;
this
.
projectStatusList
=
null
;
this
.
regionId
=
"1"
;
this
.
regionName
=
"rn"
;
this
.
ruleType
=
1
;
this
.
serviceTypeId
=
"1"
;
this
.
serviceTypeIds
=
new
ArrayList
<>();
this
.
serviceTypeName
=
"sn"
;
this
.
serviceTypeTemplateGroupList
=
new
ArrayList
<>();
this
.
startPeriod
=
1
;
this
.
templateGroupId
=
"1"
;
this
.
templateGroupName
=
"tn"
;
this
.
upDate
=
new
Date
();
this
.
year
=
1
;
return
this
;
}
public
Map
<
Integer
,
Integer
>
getProjectStatusList
()
{
return
projectStatusList
;
...
...
@@ -308,4 +277,23 @@ public class ProjectDisplayDto {
public
void
setProjectStatusList
(
Map
<
Integer
,
Integer
>
projectStatusList
)
{
this
.
projectStatusList
=
projectStatusList
;
}
public
void
extractFromProject
(
Project
project
){
this
.
clientCode
=
project
.
getClientCode
();
this
.
code
=
project
.
getCode
();
this
.
createTime
=
project
.
getCreateTime
();
this
.
effectiveDate
=
new
Date
();
this
.
endPeriod
=
project
.
getEndPeriod
();
this
.
enterpriseAccountSetId
=
project
.
getEnterpriseAccountSetId
();
this
.
id
=
project
.
getId
();
this
.
industryId
=
project
.
getIndustryId
();
this
.
isActive
=
project
.
getIsActive
();
this
.
name
=
project
.
getName
();
this
.
organizationId
=
project
.
getOrganizationId
();
this
.
regionId
=
project
.
getRegionId
();
this
.
ruleType
=
project
.
getRuleType
();
this
.
startPeriod
=
project
.
getStartPeriod
();
this
.
upDate
=
project
.
getUpdateTime
();
this
.
year
=
project
.
getYear
();
}
}
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