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
a6606e1a
Commit
a6606e1a
authored
Jun 05, 2018
by
neo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[DEV] V] query project all status impl
parent
2ed9ec79
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
45 additions
and
20 deletions
+45
-20
ProjectController.java
...n/java/pwc/taxtech/atms/controller/ProjectController.java
+12
-3
ProjectStatusManageController.java
...axtech/atms/controller/ProjectStatusManageController.java
+6
-7
ProjectMapper.java
...api/src/main/java/pwc/taxtech/atms/dao/ProjectMapper.java
+11
-0
ProjectService.java
...rc/main/java/pwc/taxtech/atms/service/ProjectService.java
+3
-0
ProjectServiceImpl.java
...ava/pwc/taxtech/atms/service/impl/ProjectServiceImpl.java
+12
-9
framework.js
atms-web/src/main/webapp/bundles/framework.js
+1
-1
No files found.
atms-api/src/main/java/pwc/taxtech/atms/controller/ProjectController.java
View file @
a6606e1a
package
pwc
.
taxtech
.
atms
.
controller
;
package
pwc
.
taxtech
.
atms
.
controller
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParam
;
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.PathVariable
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestMethod
;
...
@@ -59,7 +61,7 @@ public class ProjectController {
...
@@ -59,7 +61,7 @@ public class ProjectController {
@ApiOperation
(
value
=
"getAllProjectList"
,
notes
=
"Get All List"
)
@ApiOperation
(
value
=
"getAllProjectList"
,
notes
=
"Get All List"
)
@RequestMapping
(
value
=
"getAllProjectList"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"getAllProjectList"
,
method
=
RequestMethod
.
GET
)
public
@ResponseBody
public
@ResponseBody
List
<
ProjectDisplayDto
>
getAllProjectList
(
String
orgID
,
String
serviceID
,
Integer
projectYear
)
{
List
<
ProjectDisplayDto
>
getAllProjectList
(
String
orgID
,
String
serviceID
,
Integer
projectYear
)
{
logger
.
info
(
"/api/v1/project/getAllProjectList with orgID {} serviceID {}"
,
orgID
,
serviceID
);
logger
.
info
(
"/api/v1/project/getAllProjectList with orgID {} serviceID {}"
,
orgID
,
serviceID
);
return
projectService
.
getAllProjectList
(
orgID
,
serviceID
==
null
?
""
:
serviceID
,
projectYear
);
return
projectService
.
getAllProjectList
(
orgID
,
serviceID
==
null
?
""
:
serviceID
,
projectYear
);
}
}
...
@@ -68,9 +70,16 @@ public class ProjectController {
...
@@ -68,9 +70,16 @@ public class ProjectController {
@RequestMapping
(
value
=
"add"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"add"
,
method
=
RequestMethod
.
POST
)
@ApiImplicitParam
(
name
=
"projectDto"
,
value
=
"projectDto"
,
required
=
true
,
dataType
=
"ProjectDisplayDto"
)
@ApiImplicitParam
(
name
=
"projectDto"
,
value
=
"projectDto"
,
required
=
true
,
dataType
=
"ProjectDisplayDto"
)
public
@ResponseBody
public
@ResponseBody
AddProjectResult
AddProject
(
@RequestBody
ProjectDisplayDto
projectDto
,
String
userName
)
{
AddProjectResult
AddProject
(
@RequestBody
ProjectDisplayDto
projectDto
,
String
userName
)
{
if
(
userName
==
null
||
userName
.
isEmpty
())
userName
=
"test"
;
//TODO: should use session username future(neo)
if
(
userName
==
null
||
userName
.
isEmpty
())
userName
=
"test"
;
//TODO: should use session username future(neo)
return
projectService
.
addProject
(
projectDto
,
userName
);
return
projectService
.
addProject
(
projectDto
,
userName
);
}
}
@ApiOperation
(
value
=
"getProjectAllStatus"
,
notes
=
"get project all status"
)
@RequestMapping
(
value
=
"getProjectAllStatus/{dbName}"
,
method
=
RequestMethod
.
GET
)
public
@ResponseBody
Map
<
Integer
,
Integer
>
getProjectAllStatus
(
@PathVariable
String
dbName
)
{
return
projectService
.
getProjectAllStatus
(
dbName
);
}
}
}
atms-api/src/main/java/pwc/taxtech/atms/controller/ProjectStatusManageController.java
View file @
a6606e1a
...
@@ -3,6 +3,7 @@ package pwc.taxtech.atms.controller;
...
@@ -3,6 +3,7 @@ package pwc.taxtech.atms.controller;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.MediaType
;
import
org.springframework.http.MediaType
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.bind.annotation.ResponseBody
;
...
@@ -12,8 +13,6 @@ import pwc.taxtech.atms.dto.taxadmin.ProjectStatusManageDto;
...
@@ -12,8 +13,6 @@ import pwc.taxtech.atms.dto.taxadmin.ProjectStatusManageDto;
import
pwc.taxtech.atms.service.IdentityService
;
import
pwc.taxtech.atms.service.IdentityService
;
import
pwc.taxtech.atms.service.ProjectStatusManageService
;
import
pwc.taxtech.atms.service.ProjectStatusManageService
;
import
javax.ws.rs.PathParam
;
@RestController
@RestController
@RequestMapping
(
"/api/v1/ProjectStatusManage"
)
@RequestMapping
(
"/api/v1/ProjectStatusManage"
)
public
class
ProjectStatusManageController
{
public
class
ProjectStatusManageController
{
...
@@ -25,12 +24,12 @@ public class ProjectStatusManageController {
...
@@ -25,12 +24,12 @@ public class ProjectStatusManageController {
private
IdentityService
identityService
;
private
IdentityService
identityService
;
@ApiOperation
(
value
=
"setProjectStatus"
,
notes
=
""
)
@ApiOperation
(
value
=
"setProjectStatus"
,
notes
=
""
)
@RequestMapping
(
value
=
{
"/setProjectStatus/{dbName}/{periodId}/{status}"
},
method
=
RequestMethod
.
GET
,
@RequestMapping
(
value
=
{
"/setProjectStatus/{dbName}/{periodId}/{status}"
},
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
@ResponseBody
@ResponseBody
public
OperationResultDto
<
ProjectStatusManageDto
>
setProjectStatus
(
@Path
Param
(
"dbName"
)
String
dbName
,
public
OperationResultDto
<
ProjectStatusManageDto
>
setProjectStatus
(
@Path
Variable
(
"dbName"
)
String
dbName
,
@Path
Param
(
"periodId"
)
Integer
periodId
,
@Path
Variable
(
"periodId"
)
Integer
periodId
,
@Path
Param
(
"status"
)
Integer
status
)
{
@Path
Variable
(
"status"
)
Integer
status
)
{
return
projectStatusManageService
.
setProjectStatus
(
dbName
,
periodId
,
status
,
identityService
.
getIdentityUser
().
getID
());
return
projectStatusManageService
.
setProjectStatus
(
dbName
,
periodId
,
status
,
identityService
.
getIdentityUser
().
getID
());
}
}
}
}
atms-api/src/main/java/pwc/taxtech/atms/dao/ProjectMapper.java
View file @
a6606e1a
...
@@ -10,6 +10,7 @@ import pwc.taxtech.atms.MyMapper;
...
@@ -10,6 +10,7 @@ import pwc.taxtech.atms.MyMapper;
import
pwc.taxtech.atms.dto.taxadmin.ProjectDisplayDto
;
import
pwc.taxtech.atms.dto.taxadmin.ProjectDisplayDto
;
import
pwc.taxtech.atms.entitiy.Project
;
import
pwc.taxtech.atms.entitiy.Project
;
import
pwc.taxtech.atms.entitiy.ProjectExample
;
import
pwc.taxtech.atms.entitiy.ProjectExample
;
import
pwc.taxtech.atms.entitiy.ProjectStatusManage
;
@Mapper
@Mapper
public
interface
ProjectMapper
extends
MyMapper
{
public
interface
ProjectMapper
extends
MyMapper
{
...
@@ -221,4 +222,13 @@ public interface ProjectMapper extends MyMapper {
...
@@ -221,4 +222,13 @@ public interface ProjectMapper extends MyMapper {
"ORDER BY ea.EffectiveDate,org.Code"
+
"ORDER BY ea.EffectiveDate,org.Code"
+
"</script>"
)
"</script>"
)
List
<
ProjectDisplayDto
>
getProjectFromEnterpriseAccountSetOrg
(
@Param
(
"orgID"
)
String
orgID
,
@Param
(
"serviceID"
)
String
serviceID
);
List
<
ProjectDisplayDto
>
getProjectFromEnterpriseAccountSetOrg
(
@Param
(
"orgID"
)
String
orgID
,
@Param
(
"serviceID"
)
String
serviceID
);
@Select
(
"SELECT "
+
" PeriodId,Status "
+
"FROM "
+
" ProjectStatusManage p "
+
"WHERE "
+
" p.DbName = #{dbName} "
+
"ORDER BY PeriodId , Status"
)
List
<
ProjectStatusManage
>
selectProjectAllStatus
(
String
dbName
);
}
}
\ No newline at end of file
atms-api/src/main/java/pwc/taxtech/atms/service/ProjectService.java
View file @
a6606e1a
package
pwc
.
taxtech
.
atms
.
service
;
package
pwc
.
taxtech
.
atms
.
service
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
pwc.taxtech.atms.dto.ProjectClientDto
;
import
pwc.taxtech.atms.dto.ProjectClientDto
;
import
pwc.taxtech.atms.dto.ServiceTypeDto
;
import
pwc.taxtech.atms.dto.ServiceTypeDto
;
...
@@ -41,6 +42,8 @@ public interface ProjectService {
...
@@ -41,6 +42,8 @@ public interface ProjectService {
AddProjectResult
addProject
(
ProjectDisplayDto
projectDto
,
String
userName
);
AddProjectResult
addProject
(
ProjectDisplayDto
projectDto
,
String
userName
);
Map
<
Integer
,
Integer
>
getProjectAllStatus
(
String
dbName
);
// Map<Integer, Integer> getProjectAllStatus(String dbName);
// Map<Integer, Integer> getProjectAllStatus(String dbName);
}
}
atms-api/src/main/java/pwc/taxtech/atms/service/impl/ProjectServiceImpl.java
View file @
a6606e1a
...
@@ -22,16 +22,8 @@ import pwc.taxtech.atms.dto.TemplateGroupDto;
...
@@ -22,16 +22,8 @@ import pwc.taxtech.atms.dto.TemplateGroupDto;
import
pwc.taxtech.atms.dto.taxadmin.AddProjectResult
;
import
pwc.taxtech.atms.dto.taxadmin.AddProjectResult
;
import
pwc.taxtech.atms.dto.taxadmin.ProjectDisplayDto
;
import
pwc.taxtech.atms.dto.taxadmin.ProjectDisplayDto
;
import
pwc.taxtech.atms.dto.taxadmin.ProjectYearParam
;
import
pwc.taxtech.atms.dto.taxadmin.ProjectYearParam
;
import
pwc.taxtech.atms.entitiy.OrganizationServiceTemplateGroupExample
;
import
pwc.taxtech.atms.entitiy.*
;
import
pwc.taxtech.atms.entitiy.Project
;
import
pwc.taxtech.atms.entitiy.ProjectClient
;
import
pwc.taxtech.atms.entitiy.ProjectClientExample
;
import
pwc.taxtech.atms.entitiy.ProjectClientExample.Criteria
;
import
pwc.taxtech.atms.entitiy.ProjectClientExample.Criteria
;
import
pwc.taxtech.atms.entitiy.ProjectServiceType
;
import
pwc.taxtech.atms.entitiy.ServiceType
;
import
pwc.taxtech.atms.entitiy.ServiceTypeExample
;
import
pwc.taxtech.atms.entitiy.TemplateGroup
;
import
pwc.taxtech.atms.entitiy.TemplateGroupExample
;
import
pwc.taxtech.atms.service.OperationLogService
;
import
pwc.taxtech.atms.service.OperationLogService
;
import
pwc.taxtech.atms.service.ProjectService
;
import
pwc.taxtech.atms.service.ProjectService
;
...
@@ -229,6 +221,17 @@ public class ProjectServiceImpl implements ProjectService {
...
@@ -229,6 +221,17 @@ public class ProjectServiceImpl implements ProjectService {
}
}
@Override
public
Map
<
Integer
,
Integer
>
getProjectAllStatus
(
String
dbName
)
{
List
<
ProjectStatusManage
>
psmList
=
projectMapper
.
selectProjectAllStatus
(
dbName
);
Map
<
Integer
,
Integer
>
result
=
new
HashMap
<>(
psmList
.
size
());
psmList
.
forEach
(
m
->{
result
.
put
(
m
.
getPeriodId
(),
m
.
getStatus
());
});
return
result
;
}
private
String
generateDatabase
(
Project
project
,
String
accsetid
)
{
//TODO: should be impl future(neo)
private
String
generateDatabase
(
Project
project
,
String
accsetid
)
{
//TODO: should be impl future(neo)
return
"db_test"
;
return
"db_test"
;
}
}
...
...
atms-web/src/main/webapp/bundles/framework.js
View file @
a6606e1a
...
@@ -1697,7 +1697,7 @@ frameworkModule.controller('appOverviewController', ['$rootScope', '$scope', '$t
...
@@ -1697,7 +1697,7 @@ frameworkModule.controller('appOverviewController', ['$rootScope', '$scope', '$t
projectService
.
addProject
(
project
).
success
(
function
(
rsp
)
{
projectService
.
addProject
(
project
).
success
(
function
(
rsp
)
{
if
(
rsp
&&
rsp
.
result
)
{
if
(
rsp
&&
rsp
.
result
)
{
project
.
haveCreateProject
=
true
;
project
.
haveCreateProject
=
true
;
project
.
dbName
=
rsp
.
d
b
name
;
project
.
dbName
=
rsp
.
d
B
name
;
project
.
id
=
rsp
.
projectID
;
project
.
id
=
rsp
.
projectID
;
if
(
_
.
isNull
(
project
.
projectStatusList
))
{
//如果当前期间还没有导入任何数据的话,就添加一条未开始状态的记录
if
(
_
.
isNull
(
project
.
projectStatusList
))
{
//如果当前期间还没有导入任何数据的话,就添加一条未开始状态的记录
...
...
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