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
a33d964a
Commit
a33d964a
authored
Jun 20, 2018
by
neo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[DEV] add getProjectImportType impl
parent
cebaf261
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
60 additions
and
0 deletions
+60
-0
Constant.java
...api/src/main/java/pwc/taxtech/atms/constant/Constant.java
+3
-0
TbImportType.java
...in/java/pwc/taxtech/atms/constant/enums/TbImportType.java
+18
-0
ProjectInfoController.java
...va/pwc/taxtech/atms/controller/ProjectInfoController.java
+9
-0
ProjectInfoService.java
...ain/java/pwc/taxtech/atms/service/ProjectInfoService.java
+2
-0
ProjectInfoServiceImpl.java
...pwc/taxtech/atms/service/impl/ProjectInfoServiceImpl.java
+28
-0
No files found.
atms-api/src/main/java/pwc/taxtech/atms/constant/Constant.java
View file @
a33d964a
...
...
@@ -28,4 +28,6 @@ public final class Constant {
public
static
final
String
CURRENT_USER_UPLOAD_FOLDER
=
CURRENT_USER_HOME
+
File
.
separator
+
UPLOAD_FOLDER_NAME
;
public
static
final
boolean
DEFAULT_RESULT
=
true
;
public
static
final
int
FIRST_OR_DEFAULT
=
0
;
}
\ No newline at end of file
atms-api/src/main/java/pwc/taxtech/atms/constant/enums/TbImportType.java
0 → 100644
View file @
a33d964a
package
pwc
.
taxtech
.
atms
.
constant
.
enums
;
public
enum
TbImportType
{
UnImported
(
0
),
TbImported
(
1
),
ErpImported
(
2
);
private
Integer
code
;
TbImportType
(
Integer
code
)
{
this
.
code
=
code
;
}
public
Integer
getCode
()
{
return
code
;
}
}
atms-api/src/main/java/pwc/taxtech/atms/controller/ProjectInfoController.java
View file @
a33d964a
...
...
@@ -2,6 +2,7 @@ package pwc.taxtech.atms.controller;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
...
@@ -47,4 +48,11 @@ public class ProjectInfoController {
queryImportType
.
getServiceTypeId
()
,
identityService
.
getIdentityUser
().
getID
());
}
@ApiOperation
(
value
=
"getImportType"
,
notes
=
""
)
@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
,
serviceType
));
}
}
\ No newline at end of file
atms-api/src/main/java/pwc/taxtech/atms/service/ProjectInfoService.java
View file @
a33d964a
...
...
@@ -11,4 +11,6 @@ public interface ProjectInfoService {
OperationResultDto
<
Boolean
>
isProjectImportedData
(
String
projectId
,
Integer
importTypeId
);
OperationResultDto
<
List
<
PeriodInfoDto
>>
getProjectImportType
(
String
projectId
,
List
<
Integer
>
periods
,
Integer
serviceTypeId
,
String
id
);
Integer
getImportType
(
String
projectID
,
Integer
periodID
,
Integer
serviceType
);
}
atms-api/src/main/java/pwc/taxtech/atms/service/impl/ProjectInfoServiceImpl.java
View file @
a33d964a
...
...
@@ -4,6 +4,7 @@ import org.slf4j.Logger;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
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
;
...
...
@@ -11,8 +12,11 @@ import pwc.taxtech.atms.entitiy.PeriodInfo;
import
pwc.taxtech.atms.entitiy.PeriodInfoExample
;
import
pwc.taxtech.atms.service.ProjectInfoService
;
import
java.util.Date
;
import
java.util.List
;
import
static
pwc
.
taxtech
.
atms
.
constant
.
Constant
.
FIRST_OR_DEFAULT
;
@Service
public
class
ProjectInfoServiceImpl
implements
ProjectInfoService
{
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
ProjectServiceImpl
.
class
);
...
...
@@ -50,4 +54,28 @@ public class ProjectInfoServiceImpl implements ProjectInfoService {
public
OperationResultDto
<
List
<
PeriodInfoDto
>>
getProjectImportType
(
String
projectId
,
List
<
Integer
>
periods
,
Integer
serviceTypeId
,
String
id
)
{
return
null
;
}
@Override
public
Integer
getImportType
(
String
projectID
,
Integer
periodID
,
Integer
serviceType
)
{
PeriodInfoExample
example
=
new
PeriodInfoExample
();
example
.
createCriteria
().
andProjectIDEqualTo
(
projectID
).
andProjectIDEqualTo
(
projectID
).
andServiceTypeEqualTo
(
serviceType
);
List
<
PeriodInfo
>
periodInfoList
=
periodInfoMapper
.
selectByExample
(
example
);
if
(
periodInfoList
==
null
||
periodInfoList
.
size
()==
0
){
PeriodInfo
periodInfo
=
new
PeriodInfo
();
periodInfo
.
setProjectID
(
projectID
);
periodInfo
.
setPeriod
(
periodID
);
periodInfo
.
setStatus
(
0
);
periodInfo
.
setImportType
(
TbImportType
.
UnImported
.
getCode
());
periodInfo
.
setServiceType
(
serviceType
);
periodInfo
.
setCreateTime
(
new
Date
());
periodInfo
.
setUpdateTime
(
new
Date
());
periodInfoMapper
.
insert
(
periodInfo
);
return
TbImportType
.
UnImported
.
getCode
();
}
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