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
0f2a1acd
Commit
0f2a1acd
authored
Jun 05, 2018
by
neo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[DEV] add project status manage impl
parent
c9fbd928
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
341 additions
and
0 deletions
+341
-0
AppCachePool.java
atms-api/src/main/java/pwc/taxtech/atms/AppCachePool.java
+35
-0
ProjectStatusManageController.java
...axtech/atms/controller/ProjectStatusManageController.java
+35
-0
ProjectImportSubStatusDto.java
.../taxtech/atms/dto/taxadmin/ProjectImportSubStatusDto.java
+85
-0
ProjectStatusManageDto.java
...pwc/taxtech/atms/dto/taxadmin/ProjectStatusManageDto.java
+79
-0
IdentityService.java
...c/main/java/pwc/taxtech/atms/service/IdentityService.java
+7
-0
ProjectStatusManageService.java
.../pwc/taxtech/atms/service/ProjectStatusManageService.java
+8
-0
IdentityServiceImpl.java
...va/pwc/taxtech/atms/service/impl/IdentityServiceImpl.java
+14
-0
ProjectStatusManageServiceImpl.java
...ech/atms/service/impl/ProjectStatusManageServiceImpl.java
+78
-0
No files found.
atms-api/src/main/java/pwc/taxtech/atms/AppCachePool.java
0 → 100644
View file @
0f2a1acd
package
pwc
.
taxtech
.
atms
;
import
pwc.taxtech.atms.dto.user.UserDto
;
import
pwc.taxtech.atms.service.OperationLogService
;
import
java.util.HashMap
;
import
java.util.Map
;
public
class
AppCachePool
{
private
static
Map
<
String
,
UserDto
>
CACHED_USERS
=
null
;
private
static
Object
_locker
=
new
Object
();
static
{
CACHED_USERS
=
new
HashMap
<>();
}
public
static
UserDto
getCachedUser
(
String
name
)
{
String
userName
=
name
.
toLowerCase
();
synchronized
(
_locker
)
{
if
(!
CACHED_USERS
.
containsKey
(
userName
))
{
UserDto
dto
=
new
UserDto
();
//TODO:should fixed to load from db (neo)
dto
.
setUserName
(
"cach_test"
);
dto
.
setID
(
"1"
);
CACHED_USERS
.
put
(
userName
,
dto
);
}
return
CACHED_USERS
.
get
(
userName
);
}
}
}
atms-api/src/main/java/pwc/taxtech/atms/controller/ProjectStatusManageController.java
0 → 100644
View file @
0f2a1acd
package
pwc
.
taxtech
.
atms
.
controller
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.MediaType
;
import
org.springframework.web.bind.annotation.RequestMapping
;
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.VMRegionDevTreeData
;
import
pwc.taxtech.atms.dto.navtree.DevTreeDto
;
import
pwc.taxtech.atms.dto.taxadmin.ProjectStatusManageDto
;
import
pwc.taxtech.atms.service.IdentityService
;
import
pwc.taxtech.atms.service.ProjectStatusManageService
;
import
java.util.List
;
@RestController
@RequestMapping
(
"/api/v1/ProjectStatusManage"
)
public
class
ProjectStatusManageController
{
@Autowired
private
ProjectStatusManageService
projectStatusManageService
;
private
IdentityService
identityService
;
@ApiOperation
(
value
=
"setProjectStatus"
,
notes
=
""
)
@RequestMapping
(
value
=
{
"/setProjectStatus/{dbName}/{periodId}/{status}"
},
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
@ResponseBody
public
OperationResultDto
<
ProjectStatusManageDto
>
setProjectStatus
(
String
dbName
,
Integer
periodId
,
Integer
status
)
{
return
projectStatusManageService
.
setProjectStatus
(
dbName
,
periodId
,
status
,
identityService
.
getIdentityUser
().
getID
());
}
}
atms-api/src/main/java/pwc/taxtech/atms/dto/taxadmin/ProjectImportSubStatusDto.java
0 → 100644
View file @
0f2a1acd
package
pwc
.
taxtech
.
atms
.
dto
.
taxadmin
;
public
class
ProjectImportSubStatusDto
{
private
Boolean
isAdjustImport
;
private
Boolean
isCustomInvoiceImport
;
private
Boolean
isEntryImport
;
private
Boolean
isErpImport
;
private
Boolean
isInputInvoiceImport
;
private
Boolean
isInvoiceMapImport
;
private
Boolean
isOutputInvoiceImport
;
private
Boolean
isTbImport
;
private
Boolean
isVoucherMapImport
;
public
Boolean
getAdjustImport
()
{
return
isAdjustImport
;
}
public
void
setAdjustImport
(
Boolean
adjustImport
)
{
isAdjustImport
=
adjustImport
;
}
public
Boolean
getCustomInvoiceImport
()
{
return
isCustomInvoiceImport
;
}
public
void
setCustomInvoiceImport
(
Boolean
customInvoiceImport
)
{
isCustomInvoiceImport
=
customInvoiceImport
;
}
public
Boolean
getEntryImport
()
{
return
isEntryImport
;
}
public
void
setEntryImport
(
Boolean
entryImport
)
{
isEntryImport
=
entryImport
;
}
public
Boolean
getErpImport
()
{
return
isErpImport
;
}
public
void
setErpImport
(
Boolean
erpImport
)
{
isErpImport
=
erpImport
;
}
public
Boolean
getInputInvoiceImport
()
{
return
isInputInvoiceImport
;
}
public
void
setInputInvoiceImport
(
Boolean
inputInvoiceImport
)
{
isInputInvoiceImport
=
inputInvoiceImport
;
}
public
Boolean
getInvoiceMapImport
()
{
return
isInvoiceMapImport
;
}
public
void
setInvoiceMapImport
(
Boolean
invoiceMapImport
)
{
isInvoiceMapImport
=
invoiceMapImport
;
}
public
Boolean
getOutputInvoiceImport
()
{
return
isOutputInvoiceImport
;
}
public
void
setOutputInvoiceImport
(
Boolean
outputInvoiceImport
)
{
isOutputInvoiceImport
=
outputInvoiceImport
;
}
public
Boolean
getTbImport
()
{
return
isTbImport
;
}
public
void
setTbImport
(
Boolean
tbImport
)
{
isTbImport
=
tbImport
;
}
public
Boolean
getVoucherMapImport
()
{
return
isVoucherMapImport
;
}
public
void
setVoucherMapImport
(
Boolean
voucherMapImport
)
{
isVoucherMapImport
=
voucherMapImport
;
}
}
atms-api/src/main/java/pwc/taxtech/atms/dto/taxadmin/ProjectStatusManageDto.java
0 → 100644
View file @
0f2a1acd
package
pwc
.
taxtech
.
atms
.
dto
.
taxadmin
;
import
java.util.Date
;
public
class
ProjectStatusManageDto
{
private
Date
createTime
;
private
String
creatorID
;
private
String
dbName
;
private
String
ID
;
private
ProjectImportSubStatusDto
importSubStatus
;
private
Integer
periodId
;
public
Date
getCreateTime
()
{
return
createTime
;
}
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
public
String
getCreatorID
()
{
return
creatorID
;
}
public
void
setCreatorID
(
String
creatorID
)
{
this
.
creatorID
=
creatorID
;
}
public
String
getDbName
()
{
return
dbName
;
}
public
void
setDbName
(
String
dbName
)
{
this
.
dbName
=
dbName
;
}
public
String
getID
()
{
return
ID
;
}
public
void
setID
(
String
ID
)
{
this
.
ID
=
ID
;
}
public
ProjectImportSubStatusDto
getImportSubStatus
()
{
return
importSubStatus
;
}
public
void
setImportSubStatus
(
ProjectImportSubStatusDto
importSubStatus
)
{
this
.
importSubStatus
=
importSubStatus
;
}
public
Integer
getPeriodId
()
{
return
periodId
;
}
public
void
setPeriodId
(
Integer
periodId
)
{
this
.
periodId
=
periodId
;
}
public
Integer
getStatus
()
{
return
status
;
}
public
void
setStatus
(
Integer
status
)
{
this
.
status
=
status
;
}
public
Date
getUpdateTime
()
{
return
updateTime
;
}
public
void
setUpdateTime
(
Date
updateTime
)
{
this
.
updateTime
=
updateTime
;
}
private
Integer
status
;
private
Date
updateTime
;
}
atms-api/src/main/java/pwc/taxtech/atms/service/IdentityService.java
0 → 100644
View file @
0f2a1acd
package
pwc
.
taxtech
.
atms
.
service
;
import
pwc.taxtech.atms.dto.user.UserDto
;
public
interface
IdentityService
{
UserDto
getIdentityUser
();
}
atms-api/src/main/java/pwc/taxtech/atms/service/ProjectStatusManageService.java
0 → 100644
View file @
0f2a1acd
package
pwc
.
taxtech
.
atms
.
service
;
import
pwc.taxtech.atms.dto.OperationResultDto
;
import
pwc.taxtech.atms.dto.taxadmin.ProjectStatusManageDto
;
public
interface
ProjectStatusManageService
{
OperationResultDto
<
ProjectStatusManageDto
>
setProjectStatus
(
String
dbName
,
Integer
periodId
,
Integer
status
,
String
id
);
}
atms-api/src/main/java/pwc/taxtech/atms/service/impl/IdentityServiceImpl.java
0 → 100644
View file @
0f2a1acd
package
pwc
.
taxtech
.
atms
.
service
.
impl
;
import
org.springframework.stereotype.Service
;
import
pwc.taxtech.atms.AppCachePool
;
import
pwc.taxtech.atms.dto.user.UserDto
;
import
pwc.taxtech.atms.service.IdentityService
;
@Service
public
class
IdentityServiceImpl
implements
IdentityService
{
@Override
public
UserDto
getIdentityUser
()
{
return
AppCachePool
.
getCachedUser
(
"cach_test"
);
//TODO:should fixed use session username
}
}
atms-api/src/main/java/pwc/taxtech/atms/service/impl/ProjectStatusManageServiceImpl.java
0 → 100644
View file @
0f2a1acd
package
pwc
.
taxtech
.
atms
.
service
.
impl
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
pwc.taxtech.atms.dao.ProjectStatusManageMapper
;
import
pwc.taxtech.atms.dto.FieldsMapper
;
import
pwc.taxtech.atms.dto.OperationResultDto
;
import
pwc.taxtech.atms.dto.taxadmin.ProjectStatusManageDto
;
import
pwc.taxtech.atms.entitiy.ProjectStatusManage
;
import
pwc.taxtech.atms.entitiy.ProjectStatusManageExample
;
import
pwc.taxtech.atms.service.ProjectStatusManageService
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.UUID
;
@Service
public
class
ProjectStatusManageServiceImpl
implements
ProjectStatusManageService
{
private
static
final
int
FIRST_OR_DFAULT
=
0
;
private
static
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
ProjectStatusManageServiceImpl
.
class
);
@Autowired
ProjectStatusManageMapper
projectStatusManageMapper
;
@Override
public
OperationResultDto
<
ProjectStatusManageDto
>
setProjectStatus
(
String
dbName
,
Integer
periodId
,
Integer
status
,
String
creatorId
)
{
try
{
ProjectStatusManageExample
example
=
new
ProjectStatusManageExample
();
example
.
createCriteria
().
andDbNameEqualTo
(
dbName
).
andPeriodIdEqualTo
(
periodId
);
List
<
ProjectStatusManage
>
psmList
=
projectStatusManageMapper
.
selectByExample
(
example
);
ProjectStatusManage
psm
=
null
;
if
(
psmList
!=
null
&&
!
psmList
.
isEmpty
())
{
psm
=
psmList
.
get
(
FIRST_OR_DFAULT
);
psm
.
setStatus
(
status
);
psm
.
setUpdateTime
(
new
Date
());
projectStatusManageMapper
.
updateByPrimaryKey
(
psm
);
}
else
{
psm
=
new
ProjectStatusManage
();
psm
.
setID
(
UUID
.
randomUUID
().
toString
());
psm
.
setDbName
(
dbName
);
psm
.
setPeriodId
(
periodId
);
psm
.
setStatus
(
status
);
psm
.
setCreatorID
(
creatorId
);
psm
.
setCreateTime
(
new
Date
());
psm
.
setUpdateTime
(
new
Date
());
projectStatusManageMapper
.
insert
(
psm
);
}
OperationResultDto
<
ProjectStatusManageDto
>
ord
=
new
OperationResultDto
<>();
ord
.
setResult
(
true
);
ord
.
setResultMsg
(
""
);
ProjectStatusManageDto
dto
=
new
ProjectStatusManageDto
();
try
{
FieldsMapper
.
map
(
psm
,
dto
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
LOGGER
.
warn
(
"cast filed some error"
,
e
);
}
ord
.
setData
(
dto
);
return
ord
;
}
catch
(
Exception
e
){
LOGGER
.
error
(
"ProjectStatusManageService,SetProjectStatus(string dbName, int periodId)发生错误: {}"
,
e
.
getMessage
());
OperationResultDto
<
ProjectStatusManageDto
>
ord
=
new
OperationResultDto
<>();
ord
.
setResult
(
false
);
ord
.
setResultMsg
(
e
.
getMessage
());
ord
.
setData
(
null
);
return
ord
;
}
}
}
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