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
8a9b7856
Commit
8a9b7856
authored
Jul 20, 2018
by
neo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[DEV] project info impl
parent
f84d9a66
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
38 additions
and
88 deletions
+38
-88
ProjectInfoController.java
...va/pwc/taxtech/atms/controller/ProjectInfoController.java
+4
-3
PeriodInfoDto.java
...ain/java/pwc/taxtech/atms/dto/taxadmin/PeriodInfoDto.java
+0
-76
ProjectInfoService.java
...ain/java/pwc/taxtech/atms/service/ProjectInfoService.java
+2
-2
ProjectInfoServiceImpl.java
...pwc/taxtech/atms/service/impl/ProjectInfoServiceImpl.java
+32
-7
No files found.
atms-api/src/main/java/pwc/taxtech/atms/controller/ProjectInfoController.java
View file @
8a9b7856
...
...
@@ -10,8 +10,8 @@ import org.springframework.web.bind.annotation.RequestMethod;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.bind.annotation.RestController
;
import
pwc.taxtech.atms.dto.OperationResultDto
;
import
pwc.taxtech.atms.dto.taxadmin.PeriodInfoDto
;
import
pwc.taxtech.atms.dto.vatdto.QueryImportType
;
import
pwc.taxtech.atms.entitiy.PeriodInfo
;
import
pwc.taxtech.atms.service.IdentityService
;
import
pwc.taxtech.atms.service.ProjectInfoService
;
...
...
@@ -43,7 +43,7 @@ public class ProjectInfoController {
@ApiOperation
(
value
=
"getProjectImportType"
,
notes
=
""
)
@RequestMapping
(
value
=
"getProjectImportType"
,
method
=
RequestMethod
.
GET
)
public
OperationResultDto
<
List
<
PeriodInfo
Dto
>>
getProjectImportType
(
@RequestBody
QueryImportType
queryImportType
)
{
public
OperationResultDto
<
List
<
PeriodInfo
>>
getProjectImportType
(
@RequestBody
QueryImportType
queryImportType
)
{
return
projectInfoService
.
getProjectImportType
(
queryImportType
.
getProjectId
(),
queryImportType
.
getPeriods
(),
queryImportType
.
getServiceTypeId
()
,
identityService
.
getIdentityUser
().
getID
());
...
...
@@ -53,6 +53,6 @@ public class ProjectInfoController {
@RequestMapping
(
value
=
"getImportType/{projectID}/{periodID}/{serviceType}"
,
method
=
RequestMethod
.
GET
)
public
ResponseEntity
getImportType
(
@PathVariable
String
projectID
,
@PathVariable
Integer
periodID
,
@PathVariable
Integer
serviceType
)
{
return
ResponseEntity
.
ok
().
body
(
projectInfoService
.
getImportType
(
projectID
,
periodID
,
identityService
.
getIdentityUser
().
getID
(),
serviceType
));
return
ResponseEntity
.
ok
().
body
(
projectInfoService
.
getImportType
(
projectID
,
periodID
,
identityService
.
getIdentityUser
().
getID
(),
serviceType
));
}
}
\ No newline at end of file
atms-api/src/main/java/pwc/taxtech/atms/dto/taxadmin/PeriodInfoDto.java
deleted
100644 → 0
View file @
f84d9a66
package
pwc
.
taxtech
.
atms
.
dto
.
taxadmin
;
public
class
PeriodInfoDto
{
private
String
iD
;
private
String
projectID
;
private
Integer
period
;
private
Integer
status
;
private
String
creatorID
;
private
String
projectInfo
;
private
Integer
importType
;
private
Integer
serviceType
;
public
String
getiD
()
{
return
iD
;
}
public
void
setiD
(
String
iD
)
{
this
.
iD
=
iD
;
}
public
String
getProjectID
()
{
return
projectID
;
}
public
void
setProjectID
(
String
projectID
)
{
this
.
projectID
=
projectID
;
}
public
Integer
getPeriod
()
{
return
period
;
}
public
void
setPeriod
(
Integer
period
)
{
this
.
period
=
period
;
}
public
Integer
getStatus
()
{
return
status
;
}
public
void
setStatus
(
Integer
status
)
{
this
.
status
=
status
;
}
public
String
getCreatorID
()
{
return
creatorID
;
}
public
void
setCreatorID
(
String
creatorID
)
{
this
.
creatorID
=
creatorID
;
}
public
String
getProjectInfo
()
{
return
projectInfo
;
}
public
void
setProjectInfo
(
String
projectInfo
)
{
this
.
projectInfo
=
projectInfo
;
}
public
Integer
getImportType
()
{
return
importType
;
}
public
void
setImportType
(
Integer
importType
)
{
this
.
importType
=
importType
;
}
public
Integer
getServiceType
()
{
return
serviceType
;
}
public
void
setServiceType
(
Integer
serviceType
)
{
this
.
serviceType
=
serviceType
;
}
}
atms-api/src/main/java/pwc/taxtech/atms/service/ProjectInfoService.java
View file @
8a9b7856
package
pwc
.
taxtech
.
atms
.
service
;
import
pwc.taxtech.atms.dto.OperationResultDto
;
import
pwc.taxtech.atms.
dto.taxadmin.PeriodInfoDt
o
;
import
pwc.taxtech.atms.
entitiy.PeriodInf
o
;
import
java.util.List
;
...
...
@@ -10,7 +10,7 @@ public interface ProjectInfoService {
OperationResultDto
<
Boolean
>
isProjectImportedData
(
String
projectId
,
Integer
importTypeId
);
OperationResultDto
<
List
<
PeriodInfo
Dto
>>
getProjectImportType
(
String
projectId
,
List
<
Integer
>
periods
,
Integer
serviceTypeId
,
String
id
);
OperationResultDto
<
List
<
PeriodInfo
>>
getProjectImportType
(
String
projectId
,
List
<
Integer
>
periods
,
Integer
serviceTypeId
,
String
id
);
Integer
getImportType
(
String
projectID
,
Integer
periodID
,
String
id
,
Integer
serviceType
);
}
atms-api/src/main/java/pwc/taxtech/atms/service/impl/ProjectInfoServiceImpl.java
View file @
8a9b7856
...
...
@@ -7,7 +7,6 @@ import org.springframework.stereotype.Service;
import
pwc.taxtech.atms.constant.enums.TbImportType
;
import
pwc.taxtech.atms.dao.PeriodInfoMapper
;
import
pwc.taxtech.atms.dto.OperationResultDto
;
import
pwc.taxtech.atms.dto.taxadmin.PeriodInfoDto
;
import
pwc.taxtech.atms.entitiy.PeriodInfo
;
import
pwc.taxtech.atms.entitiy.PeriodInfoExample
;
import
pwc.taxtech.atms.service.ProjectInfoService
;
...
...
@@ -52,8 +51,34 @@ public class ProjectInfoServiceImpl implements ProjectInfoService {
}
@Override
public
OperationResultDto
<
List
<
PeriodInfoDto
>>
getProjectImportType
(
String
projectId
,
List
<
Integer
>
periods
,
Integer
serviceTypeId
,
String
id
)
{
return
null
;
public
OperationResultDto
<
List
<
PeriodInfo
>>
getProjectImportType
(
String
projectId
,
List
<
Integer
>
periods
,
Integer
serviceTypeId
,
String
id
)
{
PeriodInfoExample
example
=
new
PeriodInfoExample
();
example
.
createCriteria
().
andProjectIDEqualTo
(
projectId
).
andPeriodIn
(
periods
);
List
<
PeriodInfo
>
existed
=
periodInfoMapper
.
selectByExample
(
example
);
periods
.
forEach
(
m
->
{
if
(!
existed
.
stream
().
anyMatch
(
n
->
{
return
n
.
getPeriod
().
intValue
()
==
m
.
intValue
();
}))
{
PeriodInfo
info
=
new
PeriodInfo
();
info
.
setID
(
UUID
.
randomUUID
().
toString
());
info
.
setProjectID
(
projectId
);
info
.
setPeriod
(
m
);
info
.
setStatus
(
0
);
info
.
setCreatorID
(
id
);
info
.
setImportType
(
TbImportType
.
UnImported
.
getCode
());
info
.
setServiceType
(
serviceTypeId
);
info
.
setCreateTime
(
new
Date
());
info
.
setUpdateTime
(
new
Date
());
periodInfoMapper
.
insert
(
info
);
}
});
example
.
createCriteria
().
andProjectIDEqualTo
(
projectId
).
andServiceTypeEqualTo
(
serviceTypeId
);
OperationResultDto
<
List
<
PeriodInfo
>>
resultDto
=
new
OperationResultDto
();
resultDto
.
setResult
(
true
);
resultDto
.
setResultMsg
(
""
);
resultDto
.
setData
(
periodInfoMapper
.
selectByExample
(
example
));
return
resultDto
;
}
@Override
...
...
@@ -61,8 +86,8 @@ public class ProjectInfoServiceImpl implements ProjectInfoService {
PeriodInfoExample
example
=
new
PeriodInfoExample
();
example
.
createCriteria
().
andProjectIDEqualTo
(
projectID
).
andProjectIDEqualTo
(
projectID
).
andServiceTypeEqualTo
(
serviceType
);
List
<
PeriodInfo
>
periodInfoList
=
periodInfoMapper
.
selectByExample
(
example
);
if
(
periodInfoList
==
null
||
periodInfoList
.
size
()==
0
)
{
List
<
PeriodInfo
>
periodInfoList
=
periodInfoMapper
.
selectByExample
(
example
);
if
(
periodInfoList
==
null
||
periodInfoList
.
size
()
==
0
)
{
PeriodInfo
periodInfo
=
new
PeriodInfo
();
periodInfo
.
setID
(
UUID
.
randomUUID
().
toString
());
periodInfo
.
setProjectID
(
projectID
);
...
...
@@ -76,8 +101,8 @@ public class ProjectInfoServiceImpl implements ProjectInfoService {
periodInfoMapper
.
insert
(
periodInfo
);
return
TbImportType
.
UnImported
.
getCode
();
}
else
{
return
periodInfoList
.
get
(
FIRST_OR_DEFAULT
).
getImportType
();
}
else
{
return
periodInfoList
.
get
(
FIRST_OR_DEFAULT
).
getImportType
();
}
}
...
...
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