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
eff3e8a8
Commit
eff3e8a8
authored
May 21, 2018
by
eddie.woo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modify
parent
00ce6fbc
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
288 additions
and
18 deletions
+288
-18
EnterpriseAccountConstant.java
.../pwc/taxtech/atms/constant/EnterpriseAccountConstant.java
+18
-0
StdAccountEnum.java
.../java/pwc/taxtech/atms/constant/enums/StdAccountEnum.java
+13
-0
EnterpriseAccountManagerController.java
...h/atms/controller/EnterpriseAccountManagerController.java
+25
-6
StdAccountController.java
...ava/pwc/taxtech/atms/controller/StdAccountController.java
+17
-0
AccountMappingDao.java
...main/java/pwc/taxtech/atms/dao/dao/AccountMappingDao.java
+63
-5
AccountMappingManualDao.java
...ava/pwc/taxtech/atms/dao/dao/AccountMappingManualDao.java
+11
-0
EnterpriseAccountDao.java
...n/java/pwc/taxtech/atms/dao/dao/EnterpriseAccountDao.java
+15
-2
OrganizationDao.java
...c/main/java/pwc/taxtech/atms/dao/dao/OrganizationDao.java
+13
-0
StandardAccountDao.java
...ain/java/pwc/taxtech/atms/dao/dao/StandardAccountDao.java
+18
-0
AccountMapDto.java
...in/java/pwc/taxtech/atms/dto/epaccount/AccountMapDto.java
+58
-0
EnterpriseAccountService.java
...va/pwc/taxtech/atms/service/EnterpriseAccountService.java
+6
-5
StdAccountService.java
...main/java/pwc/taxtech/atms/service/StdAccountService.java
+3
-0
EnterpriseAccountServiceImpl.java
...xtech/atms/service/impl/EnterpriseAccountServiceImpl.java
+0
-0
StdAccountServiceImpl.java
.../pwc/taxtech/atms/service/impl/StdAccountServiceImpl.java
+28
-0
No files found.
atms-api/src/main/java/pwc/taxtech/atms/constant/EnterpriseAccountConstant.java
View file @
eff3e8a8
...
@@ -44,6 +44,24 @@ public class EnterpriseAccountConstant {
...
@@ -44,6 +44,24 @@ public class EnterpriseAccountConstant {
public
static
final
int
MaxAcctPropValue
=
6
;
public
static
final
int
MaxAcctPropValue
=
6
;
public
static
final
int
SpecialAcctPropValue
=
-
1
;
public
static
final
int
SpecialAcctPropValue
=
-
1
;
public
static
final
String
EnterpriceAccountRepeat
=
"EnterpriceAccountRepeat"
;
public
static
final
String
EnterpriceAccountParentDisable
=
"EnterpriceAccountParentDisable"
;
public
static
final
String
StdCodeIsNotExist
=
"StdCodeIsNotExist"
;
public
static
final
String
NoParentCode
=
"NoParentCode"
;
public
static
final
String
OrgNotExist
=
"OrgNotExist"
;
public
static
final
String
SystemError
=
"SystemError"
;
public
static
final
String
NoAccountNeedClear
=
"NoAccountNeedClear"
;
public
static
final
String
InputParamInComplete
=
"InputParamInComplete"
;
public
static
final
String
AccountSetNotExist
=
"AccountSetNotExist"
;
public
static
final
String
ExistMappedOrg
=
"ExistMappedOrg"
;
public
static
final
String
SubjectCorresponding
=
"SubjectCorresponding"
;
public
static
final
String
DirectionFormatError
=
"DirectionFormatError"
;
public
static
final
String
AcctPropFormatError
=
"AcctPropFormatError"
;
public
static
final
String
AcctPropNullError
=
"AcctPropNullError"
;
public
static
final
List
<
String
>
IgnoreFieldList
=
Arrays
.
asList
(
IsLeafField
,
AcctLevelField
,
FullNameField
);
public
static
final
List
<
String
>
IgnoreFieldList
=
Arrays
.
asList
(
IsLeafField
,
AcctLevelField
,
FullNameField
);
public
static
final
Map
<
String
,
String
>
DirectionMap
=
ImmutableMap
.<
String
,
String
>
builder
()
public
static
final
Map
<
String
,
String
>
DirectionMap
=
ImmutableMap
.<
String
,
String
>
builder
()
...
...
atms-api/src/main/java/pwc/taxtech/atms/constant/enums/StdAccountEnum.java
View file @
eff3e8a8
...
@@ -5,6 +5,19 @@ import java.util.Map;
...
@@ -5,6 +5,19 @@ import java.util.Map;
public
class
StdAccountEnum
{
public
class
StdAccountEnum
{
public
enum
RuleType
{
TWO
(
2
);
private
Integer
code
;
RuleType
(
Integer
code
)
{
this
.
code
=
code
;
}
public
Integer
getCode
()
{
return
code
;
}
}
public
enum
AcctProp
{
public
enum
AcctProp
{
Asset
(
"1"
,
"资产"
),
Asset
(
"1"
,
"资产"
),
Debt
(
"2"
,
"负债"
),
Debt
(
"2"
,
"负债"
),
...
...
atms-api/src/main/java/pwc/taxtech/atms/controller/EnterpriseAccountManagerController.java
View file @
eff3e8a8
...
@@ -34,12 +34,7 @@ import pwc.taxtech.atms.common.CommonUtils;
...
@@ -34,12 +34,7 @@ import pwc.taxtech.atms.common.CommonUtils;
import
pwc.taxtech.atms.common.message.ErrorMessage
;
import
pwc.taxtech.atms.common.message.ErrorMessage
;
import
pwc.taxtech.atms.constant.EnterpriseAccountConstant
;
import
pwc.taxtech.atms.constant.EnterpriseAccountConstant
;
import
pwc.taxtech.atms.dto.OperationResultDto
;
import
pwc.taxtech.atms.dto.OperationResultDto
;
import
pwc.taxtech.atms.dto.epaccount.AccountMappingDto
;
import
pwc.taxtech.atms.dto.epaccount.*
;
import
pwc.taxtech.atms.dto.epaccount.EnterpriseAccountAndValidateInfo
;
import
pwc.taxtech.atms.dto.epaccount.EnterpriseAccountDto
;
import
pwc.taxtech.atms.dto.epaccount.EnterpriseAccountSetDto
;
import
pwc.taxtech.atms.dto.epaccount.EnterpriseAccountSetOrgDto
;
import
pwc.taxtech.atms.dto.epaccount.EnterpriseAccountUploadDto
;
import
pwc.taxtech.atms.service.EnterpriseAccountService
;
import
pwc.taxtech.atms.service.EnterpriseAccountService
;
import
pwc.taxtech.atms.service.EnterpriseAccountSetService
;
import
pwc.taxtech.atms.service.EnterpriseAccountSetService
;
import
pwc.taxtech.atms.service.impl.FileService
;
import
pwc.taxtech.atms.service.impl.FileService
;
...
@@ -282,4 +277,28 @@ public class EnterpriseAccountManagerController {
...
@@ -282,4 +277,28 @@ public class EnterpriseAccountManagerController {
}
}
return
OperationResultDto
.
error
(
"自动对应失败"
);
return
OperationResultDto
.
error
(
"自动对应失败"
);
}
}
@ResponseBody
@ApiOperation
(
value
=
"手动对应"
)
@RequestMapping
(
value
=
"mapAccount"
,
method
=
RequestMethod
.
POST
)
public
OperationResultDto
mapAccount
(
@RequestBody
AccountMapDto
dto
)
{
try
{
return
enterpriseAccountService
.
mapAccount
(
dto
);
}
catch
(
Exception
e
)
{
logger
.
error
(
"mapAccount error."
,
e
);
}
return
OperationResultDto
.
error
(
"自动对应失败"
);
}
@ResponseBody
@ApiOperation
(
value
=
"取消对应"
)
@RequestMapping
(
value
=
"clearMap"
,
method
=
RequestMethod
.
POST
)
public
OperationResultDto
clearMap
(
@RequestBody
String
[]
epAccountIDs
,
@RequestParam
String
orgId
)
{
try
{
return
enterpriseAccountService
.
clearMap
(
epAccountIDs
,
orgId
);
}
catch
(
Exception
e
)
{
logger
.
error
(
"clearMap error."
,
e
);
}
return
OperationResultDto
.
error
(
"取消对应失败"
);
}
}
}
atms-api/src/main/java/pwc/taxtech/atms/controller/StdAccountController.java
View file @
eff3e8a8
...
@@ -4,6 +4,7 @@ import io.swagger.annotations.ApiOperation;
...
@@ -4,6 +4,7 @@ import io.swagger.annotations.ApiOperation;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
pwc.taxtech.atms.dto.stdaccount.StandardAccountDto
;
import
pwc.taxtech.atms.dto.stdaccount.StdAccountFancyTreeDto
;
import
pwc.taxtech.atms.dto.stdaccount.StdAccountFancyTreeDto
;
import
pwc.taxtech.atms.service.StdAccountService
;
import
pwc.taxtech.atms.service.StdAccountService
;
...
@@ -32,4 +33,20 @@ public class StdAccountController extends BaseController {
...
@@ -32,4 +33,20 @@ public class StdAccountController extends BaseController {
}
}
return
Collections
.
emptyList
();
return
Collections
.
emptyList
();
}
}
@ResponseBody
@ApiOperation
(
value
=
"查看对应关系"
)
@RequestMapping
(
value
=
"getStdAccountLinkEtsAccount"
,
method
=
RequestMethod
.
GET
)
public
List
<
StandardAccountDto
>
getStdAccountLinkEtsAccount
(
@RequestParam
String
orgID
,
@RequestParam
String
accountSetID
)
{
if
(
StringUtils
.
isAnyBlank
(
orgID
,
accountSetID
))
{
return
Collections
.
emptyList
();
}
try
{
return
stdAccountService
.
GetStdAccountLinkEtsAccount
(
orgID
,
accountSetID
);
}
catch
(
Exception
e
)
{
logger
.
error
(
"getStdAccountLinkEtsAccount error."
,
e
);
}
return
Collections
.
emptyList
();
}
}
}
atms-api/src/main/java/pwc/taxtech/atms/d
to/accountmapping
/AccountMappingDao.java
→
atms-api/src/main/java/pwc/taxtech/atms/d
ao/dao
/AccountMappingDao.java
View file @
eff3e8a8
package
pwc
.
taxtech
.
atms
.
d
to
.
accountmapping
;
package
pwc
.
taxtech
.
atms
.
d
ao
.
dao
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
...
@@ -7,19 +7,21 @@ import org.springframework.stereotype.Service;
...
@@ -7,19 +7,21 @@ import org.springframework.stereotype.Service;
import
pwc.taxtech.atms.common.CommonConstants
;
import
pwc.taxtech.atms.common.CommonConstants
;
import
pwc.taxtech.atms.common.CommonUtils
;
import
pwc.taxtech.atms.common.CommonUtils
;
import
pwc.taxtech.atms.dao.AccountMappingMapper
;
import
pwc.taxtech.atms.dao.AccountMappingMapper
;
import
pwc.taxtech.atms.dao.dao.EnterpriseAccountDao
;
import
pwc.taxtech.atms.entitiy.AccountMapping
;
import
pwc.taxtech.atms.entitiy.AccountMapping
;
import
pwc.taxtech.atms.entitiy.AccountMappingExample
;
import
pwc.taxtech.atms.entitiy.AccountMappingExample
;
import
pwc.taxtech.atms.entitiy.EnterpriseAccount
;
import
java.util.List
;
import
java.util.List
;
import
java.util.stream.Collectors
;
@Service
@Service
public
class
AccountMappingDao
{
public
class
AccountMappingDao
{
@Autowired
@Autowired
AccountMappingMapper
mapper
;
AccountMappingMapper
mapper
;
@Autowired
@Autowired
EnterpriseAccountDao
epAccountDao
;
EnterpriseAccountDao
epAccountDao
;
@Autowired
AccountMappingManualDao
mappingManualDao
;
public
void
delByEpAccountCodeList
(
List
<
String
>
codeList
)
{
public
void
delByEpAccountCodeList
(
List
<
String
>
codeList
)
{
if
(
CollectionUtils
.
isNotEmpty
(
codeList
))
{
if
(
CollectionUtils
.
isNotEmpty
(
codeList
))
{
...
@@ -70,7 +72,6 @@ public class AccountMappingDao {
...
@@ -70,7 +72,6 @@ public class AccountMappingDao {
stdAccountCode
=
CommonConstants
.
NullStdCode
;
stdAccountCode
=
CommonConstants
.
NullStdCode
;
//region 新逻辑
//region 新逻辑
if
(!
bOverwrite
)
{
if
(!
bOverwrite
)
{
if
(!
isStdExists
(
accountSetId
,
accountCode
,
industryID
,
orgId
))
{
if
(!
isStdExists
(
accountSetId
,
accountCode
,
industryID
,
orgId
))
{
updateToTable
(
accountCode
,
accountSetId
,
stdAccountCode
,
industryID
,
enterpriseAccountID
,
orgId
);
updateToTable
(
accountCode
,
accountSetId
,
stdAccountCode
,
industryID
,
enterpriseAccountID
,
orgId
);
...
@@ -78,8 +79,65 @@ public class AccountMappingDao {
...
@@ -78,8 +79,65 @@ public class AccountMappingDao {
}
else
{
}
else
{
updateToTable
(
accountCode
,
accountSetId
,
stdAccountCode
,
industryID
,
enterpriseAccountID
,
orgId
);
updateToTable
(
accountCode
,
accountSetId
,
stdAccountCode
,
industryID
,
enterpriseAccountID
,
orgId
);
}
}
//endregion
//endregion
}
public
List
<
AccountMapping
>
getAccountMapping
(
String
epAccountCode
,
String
epAccountSetID
,
String
orgID
)
{
AccountMappingExample
example
=
new
AccountMappingExample
();
AccountMappingExample
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andEnterpriseAccountCodeEqualTo
(
epAccountCode
);
criteria
.
andEnterpriseAccountSetIDEqualTo
(
epAccountSetID
);
criteria
.
andOrganizationIDEqualTo
(
orgID
);
return
mapper
.
selectByExample
(
example
);
}
public
void
delMapping
(
String
epAccountCode
,
String
epAccountSetID
,
String
orgID
,
String
industryID
)
{
AccountMappingExample
example
=
new
AccountMappingExample
();
AccountMappingExample
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andEnterpriseAccountCodeEqualTo
(
epAccountCode
);
criteria
.
andEnterpriseAccountSetIDEqualTo
(
epAccountSetID
);
criteria
.
andOrganizationIDEqualTo
(
orgID
);
criteria
.
andIndustryIDEqualTo
(
industryID
);
mapper
.
deleteByExample
(
example
);
}
public
void
delMapping
(
String
epAccountSetID
,
String
orgID
,
String
industryID
)
{
AccountMappingExample
example
=
new
AccountMappingExample
();
AccountMappingExample
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andEnterpriseAccountSetIDEqualTo
(
epAccountSetID
);
criteria
.
andOrganizationIDEqualTo
(
orgID
);
criteria
.
andIndustryIDEqualTo
(
industryID
);
mapper
.
deleteByExample
(
example
);
}
public
void
clearMapping
(
List
<
EnterpriseAccount
>
eaList
,
String
industryID
,
String
orgID
,
Boolean
isToClearAllMapping
)
{
if
(
CollectionUtils
.
isEmpty
(
eaList
))
{
return
;
}
List
<
String
>
codeList
=
eaList
.
stream
().
map
(
EnterpriseAccount:
:
getCode
).
collect
(
Collectors
.
toList
());
if
(!
isToClearAllMapping
)
{
for
(
EnterpriseAccount
ea
:
eaList
)
{
delMapping
(
ea
.
getCode
(),
ea
.
getEnterpriseAccountSetID
(),
industryID
,
orgID
);
//同时删除手动对应表的对应关系
mappingManualDao
.
delMapping
(
ea
.
getFullName
(),
ea
.
getEnterpriseAccountSetID
(),
industryID
,
orgID
);
clearChildMapping
(
ea
.
getCode
(),
ea
.
getEnterpriseAccountSetID
(),
industryID
,
orgID
,
codeList
);
}
}
else
{
delMapping
(
eaList
.
get
(
0
).
getEnterpriseAccountSetID
(),
industryID
,
orgID
);
}
}
private
void
clearChildMapping
(
String
eaCode
,
String
setId
,
String
industryID
,
String
orgID
,
List
<
String
>
codeList
)
{
List
<
EnterpriseAccount
>
list
=
epAccountDao
.
getEpAccountBy
(
eaCode
,
setId
);
for
(
EnterpriseAccount
row
:
list
)
{
String
code
=
row
.
getCode
();
//如果在本身的id里面包含了,说明第一次遍历的时候已经更新过数据库了,不需要再一次更新
if
(
codeList
.
contains
(
code
))
continue
;
//string updatesql = "UPDATE EnterpriseAccount SET StdCode=NULL WHERE ID=@ID";
delMapping
(
code
,
setId
,
orgID
,
industryID
);
clearChildMapping
(
row
.
getCode
(),
row
.
getEnterpriseAccountSetID
(),
industryID
,
orgID
,
codeList
);
}
}
}
}
}
atms-api/src/main/java/pwc/taxtech/atms/dao/dao/AccountMappingManualDao.java
View file @
eff3e8a8
package
pwc
.
taxtech
.
atms
.
dao
.
dao
;
package
pwc
.
taxtech
.
atms
.
dao
.
dao
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
pwc.taxtech.atms.dao.AccountMappingManualMapper
;
import
pwc.taxtech.atms.dao.AccountMappingManualMapper
;
...
@@ -18,4 +19,14 @@ public class AccountMappingManualDao {
...
@@ -18,4 +19,14 @@ public class AccountMappingManualDao {
AccountMappingManualExample
example
=
new
AccountMappingManualExample
();
AccountMappingManualExample
example
=
new
AccountMappingManualExample
();
return
Optional
.
ofNullable
(
mapper
.
selectByExample
(
example
));
return
Optional
.
ofNullable
(
mapper
.
selectByExample
(
example
));
}
}
public
void
delMapping
(
String
fullName
,
String
epAccountSetID
,
String
orgID
,
String
industryID
){
AccountMappingManualExample
example
=
new
AccountMappingManualExample
();
AccountMappingManualExample
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andFullNameEqualTo
(
fullName
);
criteria
.
andEnterpriseAccountSetIDEqualTo
(
epAccountSetID
);
criteria
.
andOrganizationIDEqualTo
(
StringUtils
.
defaultString
(
orgID
));
criteria
.
andIndustryIDEqualTo
(
StringUtils
.
defaultString
(
industryID
));
mapper
.
deleteByExample
(
example
);
}
}
}
atms-api/src/main/java/pwc/taxtech/atms/dao/dao/EnterpriseAccountDao.java
View file @
eff3e8a8
...
@@ -25,11 +25,24 @@ public class EnterpriseAccountDao {
...
@@ -25,11 +25,24 @@ public class EnterpriseAccountDao {
@Autowired
@Autowired
private
JdbcTemplate
jdbcTemplate
;
private
JdbcTemplate
jdbcTemplate
;
public
Optional
<
List
<
EnterpriseAccount
>>
getByEpAccountSetId
(
String
epAccountSetId
)
{
public
List
<
EnterpriseAccount
>
getAll
()
{
EnterpriseAccountExample
example
=
new
EnterpriseAccountExample
();
return
enterpriseAccountMapper
.
selectByExample
(
example
);
}
public
List
<
EnterpriseAccount
>
getByEpAccountSetId
(
String
epAccountSetId
)
{
EnterpriseAccountExample
example
=
new
EnterpriseAccountExample
();
EnterpriseAccountExample
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andEnterpriseAccountSetIDEqualTo
(
epAccountSetId
);
return
enterpriseAccountMapper
.
selectByExample
(
example
);
}
public
List
<
EnterpriseAccount
>
getEpAccountBy
(
String
parentCode
,
String
epAccountSetId
)
{
EnterpriseAccountExample
example
=
new
EnterpriseAccountExample
();
EnterpriseAccountExample
example
=
new
EnterpriseAccountExample
();
EnterpriseAccountExample
.
Criteria
criteria
=
example
.
createCriteria
();
EnterpriseAccountExample
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andParentCodeEqualTo
(
parentCode
);
criteria
.
andEnterpriseAccountSetIDEqualTo
(
epAccountSetId
);
criteria
.
andEnterpriseAccountSetIDEqualTo
(
epAccountSetId
);
return
Optional
.
ofNullable
(
enterpriseAccountMapper
.
selectByExample
(
example
)
);
return
enterpriseAccountMapper
.
selectByExample
(
example
);
}
}
public
Optional
<
EnterpriseAccount
>
getEpAccount
(
String
epAccountCode
,
String
epAccountSetId
)
{
public
Optional
<
EnterpriseAccount
>
getEpAccount
(
String
epAccountCode
,
String
epAccountSetId
)
{
...
...
atms-api/src/main/java/pwc/taxtech/atms/dao/dao/OrganizationDao.java
0 → 100644
View file @
eff3e8a8
package
pwc
.
taxtech
.
atms
.
dao
.
dao
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
pwc.taxtech.atms.dao.OrganizationMapper
;
import
pwc.taxtech.atms.entitiy.Organization
;
@Service
public
class
OrganizationDao
{
@Autowired
private
OrganizationMapper
organizationMapper
;
}
atms-api/src/main/java/pwc/taxtech/atms/dao/dao/StandardAccountDao.java
View file @
eff3e8a8
...
@@ -2,6 +2,7 @@ package pwc.taxtech.atms.dao.dao;
...
@@ -2,6 +2,7 @@ package pwc.taxtech.atms.dao.dao;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
pwc.taxtech.atms.constant.enums.StdAccountEnum
;
import
pwc.taxtech.atms.dao.StandardAccountMapper
;
import
pwc.taxtech.atms.dao.StandardAccountMapper
;
import
pwc.taxtech.atms.entitiy.StandardAccount
;
import
pwc.taxtech.atms.entitiy.StandardAccount
;
import
pwc.taxtech.atms.entitiy.StandardAccountExample
;
import
pwc.taxtech.atms.entitiy.StandardAccountExample
;
...
@@ -21,5 +22,22 @@ public class StandardAccountDao {
...
@@ -21,5 +22,22 @@ public class StandardAccountDao {
return
Optional
.
ofNullable
(
standardAccountMapper
.
selectByExample
(
example
));
return
Optional
.
ofNullable
(
standardAccountMapper
.
selectByExample
(
example
));
}
}
public
List
<
StandardAccount
>
getByCodeAndIndustryId
(
String
code
,
String
industryId
)
{
StandardAccountExample
example
=
new
StandardAccountExample
();
StandardAccountExample
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andCodeEqualTo
(
code
);
criteria
.
andIndustryIDEqualTo
(
industryId
);
return
standardAccountMapper
.
selectByExample
(
example
);
}
public
List
<
StandardAccount
>
getStdAccount
(
StdAccountEnum
.
RuleType
ruleType
,
String
industryId
,
Boolean
isActive
,
Boolean
isLeaf
)
{
StandardAccountExample
example
=
new
StandardAccountExample
();
StandardAccountExample
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andRuleTypeEqualTo
(
ruleType
.
getCode
());
criteria
.
andIndustryIDEqualTo
(
industryId
);
criteria
.
andIsActiveEqualTo
(
isActive
);
criteria
.
andIsLeafEqualTo
(
isLeaf
);
return
standardAccountMapper
.
selectByExample
(
example
);
}
}
}
atms-api/src/main/java/pwc/taxtech/atms/dto/epaccount/AccountMapDto.java
0 → 100644
View file @
eff3e8a8
package
pwc
.
taxtech
.
atms
.
dto
.
epaccount
;
import
com.alibaba.fastjson.annotation.JSONField
;
import
java.util.List
;
import
java.util.Map
;
public
class
AccountMapDto
{
public
String
orgID
;
@JSONField
(
name
=
"EnterpriseAccountCodes"
)
public
String
[]
enterpriseAccountCodes
;
@JSONField
(
name
=
"StandardAccountCode"
)
public
String
standardAccountCode
;
@JSONField
(
name
=
"ParentAccountMappingResult"
)
public
Map
<
String
,
List
<
String
>>
parentAccountMappingResult
;
@JSONField
(
name
=
"AccountSetID"
)
public
String
accountSetID
;
public
String
getOrgID
()
{
return
orgID
;
}
public
void
setOrgID
(
String
orgID
)
{
this
.
orgID
=
orgID
;
}
public
String
[]
getEnterpriseAccountCodes
()
{
return
enterpriseAccountCodes
;
}
public
void
setEnterpriseAccountCodes
(
String
[]
enterpriseAccountCodes
)
{
this
.
enterpriseAccountCodes
=
enterpriseAccountCodes
;
}
public
String
getStandardAccountCode
()
{
return
standardAccountCode
;
}
public
void
setStandardAccountCode
(
String
standardAccountCode
)
{
this
.
standardAccountCode
=
standardAccountCode
;
}
public
Map
<
String
,
List
<
String
>>
getParentAccountMappingResult
()
{
return
parentAccountMappingResult
;
}
public
void
setParentAccountMappingResult
(
Map
<
String
,
List
<
String
>>
parentAccountMappingResult
)
{
this
.
parentAccountMappingResult
=
parentAccountMappingResult
;
}
public
String
getAccountSetID
()
{
return
accountSetID
;
}
public
void
setAccountSetID
(
String
accountSetID
)
{
this
.
accountSetID
=
accountSetID
;
}
}
atms-api/src/main/java/pwc/taxtech/atms/service/EnterpriseAccountService.java
View file @
eff3e8a8
...
@@ -3,10 +3,7 @@ package pwc.taxtech.atms.service;
...
@@ -3,10 +3,7 @@ package pwc.taxtech.atms.service;
import
java.util.List
;
import
java.util.List
;
import
pwc.taxtech.atms.dto.OperationResultDto
;
import
pwc.taxtech.atms.dto.OperationResultDto
;
import
pwc.taxtech.atms.dto.epaccount.AccountMappingDto
;
import
pwc.taxtech.atms.dto.epaccount.*
;
import
pwc.taxtech.atms.dto.epaccount.EnterpriseAccountAndValidateInfo
;
import
pwc.taxtech.atms.dto.epaccount.EnterpriseAccountDto
;
import
pwc.taxtech.atms.dto.epaccount.EnterpriseAccountSetDto
;
import
pwc.taxtech.atms.entitiy.EnterpriseAccount
;
import
pwc.taxtech.atms.entitiy.EnterpriseAccount
;
public
interface
EnterpriseAccountService
{
public
interface
EnterpriseAccountService
{
...
@@ -103,6 +100,10 @@ public interface EnterpriseAccountService {
...
@@ -103,6 +100,10 @@ public interface EnterpriseAccountService {
List
<
EnterpriseAccountDto
>
getList
(
String
epAccountSetID
,
String
orgId
,
String
filterType
);
List
<
EnterpriseAccountDto
>
getList
(
String
epAccountSetID
,
String
orgId
,
String
filterType
);
OperationResultDto
autoMap
(
String
orgId
,
String
accountSetId
);
OperationResultDto
autoMap
(
String
orgId
,
String
accountSetId
);
OperationResultDto
mapAccount
(
AccountMapDto
accountMapDto
);
OperationResultDto
clearMap
(
String
[]
epAccountIDs
,
String
orgId
);
}
}
atms-api/src/main/java/pwc/taxtech/atms/service/StdAccountService.java
View file @
eff3e8a8
package
pwc
.
taxtech
.
atms
.
service
;
package
pwc
.
taxtech
.
atms
.
service
;
import
pwc.taxtech.atms.common.ServiceException
;
import
pwc.taxtech.atms.common.ServiceException
;
import
pwc.taxtech.atms.dto.stdaccount.StandardAccountDto
;
import
pwc.taxtech.atms.dto.stdaccount.StdAccountFancyTreeDto
;
import
pwc.taxtech.atms.dto.stdaccount.StdAccountFancyTreeDto
;
import
java.util.List
;
import
java.util.List
;
public
interface
StdAccountService
{
public
interface
StdAccountService
{
List
<
StdAccountFancyTreeDto
>
getStdAccountHierarchy
(
String
orgId
)
throws
ServiceException
;
List
<
StdAccountFancyTreeDto
>
getStdAccountHierarchy
(
String
orgId
)
throws
ServiceException
;
List
<
StandardAccountDto
>
GetStdAccountLinkEtsAccount
(
String
orgID
,
String
accountSetID
);
}
}
atms-api/src/main/java/pwc/taxtech/atms/service/impl/EnterpriseAccountServiceImpl.java
View file @
eff3e8a8
This diff is collapsed.
Click to expand it.
atms-api/src/main/java/pwc/taxtech/atms/service/impl/StdAccountServiceImpl.java
View file @
eff3e8a8
...
@@ -7,9 +7,13 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -7,9 +7,13 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
pwc.taxtech.atms.common.CommonUtils
;
import
pwc.taxtech.atms.common.CommonUtils
;
import
pwc.taxtech.atms.common.ServiceException
;
import
pwc.taxtech.atms.common.ServiceException
;
import
pwc.taxtech.atms.constant.EnterpriseAccountConstant
;
import
pwc.taxtech.atms.constant.enums.StdAccountEnum
;
import
pwc.taxtech.atms.constant.enums.StdAccountEnum
;
import
pwc.taxtech.atms.dao.OrganizationMapper
;
import
pwc.taxtech.atms.dao.OrganizationMapper
;
import
pwc.taxtech.atms.dao.StandardAccountMapper
;
import
pwc.taxtech.atms.dao.StandardAccountMapper
;
import
pwc.taxtech.atms.dao.dao.StandardAccountDao
;
import
pwc.taxtech.atms.dto.OperationResultDto
;
import
pwc.taxtech.atms.dto.stdaccount.StandardAccountDto
;
import
pwc.taxtech.atms.dto.stdaccount.StdAccountFancyTreeDto
;
import
pwc.taxtech.atms.dto.stdaccount.StdAccountFancyTreeDto
;
import
pwc.taxtech.atms.entitiy.Organization
;
import
pwc.taxtech.atms.entitiy.Organization
;
import
pwc.taxtech.atms.entitiy.StandardAccount
;
import
pwc.taxtech.atms.entitiy.StandardAccount
;
...
@@ -30,6 +34,8 @@ public class StdAccountServiceImpl extends BaseService implements StdAccountServ
...
@@ -30,6 +34,8 @@ public class StdAccountServiceImpl extends BaseService implements StdAccountServ
@Autowired
@Autowired
private
OrganizationMapper
organizationMapper
;
private
OrganizationMapper
organizationMapper
;
@Autowired
private
StandardAccountDao
standardAccountDao
;
@Override
@Override
public
List
<
StdAccountFancyTreeDto
>
getStdAccountHierarchy
(
String
orgId
)
throws
ServiceException
{
public
List
<
StdAccountFancyTreeDto
>
getStdAccountHierarchy
(
String
orgId
)
throws
ServiceException
{
...
@@ -73,6 +79,28 @@ public class StdAccountServiceImpl extends BaseService implements StdAccountServ
...
@@ -73,6 +79,28 @@ public class StdAccountServiceImpl extends BaseService implements StdAccountServ
return
resultList
;
return
resultList
;
}
}
@Override
public
List
<
StandardAccountDto
>
GetStdAccountLinkEtsAccount
(
String
orgID
,
String
accountSetID
)
{
if
(
StringUtils
.
isBlank
(
orgID
))
{
return
Collections
.
emptyList
();
}
//todo
Organization
organization
=
organizationMapper
.
selectByPrimaryKey
(
orgID
);
if
(
organization
==
null
)
{
return
Collections
.
emptyList
();
}
String
industryID
=
organization
.
getIndustryID
();
List
<
StandardAccount
>
stdAccounts
=
standardAccountDao
.
getStdAccount
(
StdAccountEnum
.
RuleType
.
TWO
,
industryID
,
true
,
true
);
if
(
CollectionUtils
.
isEmpty
(
stdAccounts
))
{
stdAccounts
=
standardAccountDao
.
getStdAccount
(
StdAccountEnum
.
RuleType
.
TWO
,
"0"
,
true
,
true
);
}
return
Collections
.
emptyList
();
}
private
void
getSubStdAccount
(
StdAccountFancyTreeDto
node
,
List
<
StandardAccount
>
allList
)
{
private
void
getSubStdAccount
(
StdAccountFancyTreeDto
node
,
List
<
StandardAccount
>
allList
)
{
List
<
StdAccountFancyTreeDto
>
childList
=
allList
.
stream
().
filter
(
x
->
StringUtils
.
equals
(
node
.
getCode
(),
x
.
getParentCode
()))
List
<
StdAccountFancyTreeDto
>
childList
=
allList
.
stream
().
filter
(
x
->
StringUtils
.
equals
(
node
.
getCode
(),
x
.
getParentCode
()))
.
map
(
this
::
rotateToDto
).
collect
(
Collectors
.
toList
());
.
map
(
this
::
rotateToDto
).
collect
(
Collectors
.
toList
());
...
...
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