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
41515c6b
Commit
41515c6b
authored
Apr 19, 2019
by
kevin
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev_mysql' of
https://gitee.com/Memorydoc/atms
into dev_mysql
parents
96dd4241
64f0208c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
10 deletions
+36
-10
ErrorMessage.java
...in/java/pwc/taxtech/atms/common/message/ErrorMessage.java
+1
-1
AnalysisServiceImpl.java
...va/pwc/taxtech/atms/service/impl/AnalysisServiceImpl.java
+21
-6
DataImportService.java
...java/pwc/taxtech/atms/service/impl/DataImportService.java
+14
-3
No files found.
atms-api/src/main/java/pwc/taxtech/atms/common/message/ErrorMessage.java
View file @
41515c6b
...
...
@@ -12,7 +12,7 @@ public class ErrorMessage {
public
static
final
String
NoSelectSheet
=
"NoSelectSheet"
;
public
static
final
String
DIDNOTSELECTPERIOD
=
"You should select period!"
;
public
static
final
String
ImportFailed
=
"
ImportFailed
!"
;
public
static
final
String
ImportFailed
=
"
导入失败
!"
;
public
static
final
String
ImportNotMatch
=
"导入文件与选择机构或期间不匹配!"
;
public
static
final
String
ExportFailed
=
"ExportFailed!"
;
public
static
final
String
NoData
=
"无数据!"
;
...
...
atms-api/src/main/java/pwc/taxtech/atms/service/impl/AnalysisServiceImpl.java
View file @
41515c6b
...
...
@@ -307,7 +307,7 @@ public class AnalysisServiceImpl extends BaseService {
return
null
;
}
public
Organization
getOrg
(
String
organizationId
)
{
public
Organization
getOrg
ById
(
String
organizationId
)
{
OrganizationExample
organizationExample
=
new
OrganizationExample
();
organizationExample
.
createCriteria
().
andIdEqualTo
(
organizationId
);
List
<
Organization
>
organizations
=
organizationMapper
.
selectByExample
(
organizationExample
);
...
...
@@ -316,6 +316,15 @@ public class AnalysisServiceImpl extends BaseService {
return
null
;
}
public
Organization
getOrgByCompanyName
(
String
companyName
)
{
OrganizationExample
organizationExample
=
new
OrganizationExample
();
organizationExample
.
createCriteria
().
andNameEqualTo
(
companyName
);
List
<
Organization
>
organizations
=
organizationMapper
.
selectByExample
(
organizationExample
);
if
(
organizations
.
size
()
!=
0
)
return
organizations
.
get
(
0
);
return
null
;
}
private
void
importAnalysisReturnTaxExcelFile
(
MultipartFile
file
,
String
periodDate
)
{
try
{
...
...
@@ -401,6 +410,12 @@ public class AnalysisServiceImpl extends BaseService {
continue
;
}
model
.
setCompanyName
(
getCellStringValue
(
sheet
.
getRow
(
j
).
getCell
(
0
)));
try
{
model
.
setSeqNo
(
getSeqNoByPeriod
(
getOrgByCompanyName
(
getCellStringValue
(
sheet
.
getRow
(
j
).
getCell
(
0
))).
getId
(),
selectedPer
));
}
catch
(
Exception
e
)
{
logger
.
warn
(
getCellStringValue
(
sheet
.
getRow
(
j
).
getCell
(
0
))
+
"公司名称匹配不成功"
);
continue
;
}
model
.
setFullTimeAmount
(
getCellBigDecimalValue
(
sheet
.
getRow
(
j
).
getCell
(
1
)));
model
.
setInternAmount
(
getCellBigDecimalValue
(
sheet
.
getRow
(
j
).
getCell
(
2
)));
model
.
setVendorAmount
(
getCellBigDecimalValue
(
sheet
.
getRow
(
j
).
getCell
(
3
)));
...
...
@@ -552,12 +567,12 @@ public class AnalysisServiceImpl extends BaseService {
model
.
setId
(
idService
.
nextId
());
model
.
setPeriod
(
selectedPer
);
model
.
setOrganizationId
(
organizationId
);
model
.
setCompanyName
(
getOrg
(
organizationId
).
getName
());
model
.
setCompanyName
(
getOrg
ById
(
organizationId
).
getName
());
model
.
setCountry
(
country
);
try
{
model
.
setSeqNo
(
getSeqNoByPeriod
(
organizationId
,
DateUtils
.
strToPeriod
(
periodDate
)));
}
catch
(
Exception
e
)
{
model
.
setSeqNo
(
getSeqNoByPeriod
(
organizationId
,
DateUtils
.
strToPeriod
(
periodDate
)));
}
catch
(
Exception
e
)
{
continue
;
}
model
.
setTaxCategory
(
getCellStringValue
(
sheet
.
getRow
(
j
).
getCell
(
0
)));
...
...
@@ -605,8 +620,8 @@ public class AnalysisServiceImpl extends BaseService {
model
.
setCountry
(
country
);
Cell
cell1
=
sheet
.
getRow
(
j
).
getCell
(
0
);
try
{
model
.
setSeqNo
(
getSeqNoByPeriod
(
organizationId
,
DateUtils
.
strToPeriod
(
periodDate
)));
}
catch
(
Exception
e
)
{
model
.
setSeqNo
(
getSeqNoByPeriod
(
organizationId
,
DateUtils
.
strToPeriod
(
periodDate
)));
}
catch
(
Exception
e
)
{
continue
;
}
model
.
setGmv
(
getCellBigDecimalValue
(
cell1
));
...
...
atms-api/src/main/java/pwc/taxtech/atms/service/impl/DataImportService.java
View file @
41515c6b
...
...
@@ -962,10 +962,13 @@ public class DataImportService extends BaseService {
rlits
.
stream
().
collect
(
Collectors
.
groupingBy
(
RedLetterInfoTable:
:
getSubjectNum
));
atsGroupRes
.
forEach
((
k
,
v
)
->
processRlits
(
k
,
v
,
orgIds
,
tmsPeriod
,
importType
,
dataImportLogs
));
}
if
(
dataImportLogs
.
size
()
==
0
)
return
OperationResultDto
.
error
(
ErrorMessage
.
NoData
);
addDataImportLog
(
dataImportLogs
);
int
isSuccess
=
(
int
)
dataImportLogs
.
stream
().
filter
(
di
->
Boolean
.
TRUE
.
equals
(
di
.
getImportResult
())).
count
();
if
(
isSuccess
<
1
)
{
return
OperationResultDto
.
error
(
ErrorMessage
.
NoData
);
return
OperationResultDto
.
error
(
ErrorMessage
.
ImportNotMatch
);
}
return
operationResultDto
.
success
();
}
catch
(
Exception
e
)
{
...
...
@@ -1068,6 +1071,8 @@ public class DataImportService extends BaseService {
atsGroupRes
.
forEach
((
k
,
v
)
->
processAts
(
k
,
v
,
orgIds
,
tmsPeriod
,
importType
,
dataImportLogs
));
}
addDataImportLog
(
dataImportLogs
);
if
(
dataImportLogs
.
size
()
==
0
)
return
OperationResultDto
.
error
(
ErrorMessage
.
NoData
);
int
isSuccess
=
(
int
)
dataImportLogs
.
stream
().
filter
(
di
->
Boolean
.
TRUE
.
equals
(
di
.
getImportResult
())).
count
();
if
(
isSuccess
<
1
)
{
return
OperationResultDto
.
error
(
ErrorMessage
.
ImportNotMatch
);
...
...
@@ -1172,9 +1177,12 @@ public class DataImportService extends BaseService {
atsGroupRes
.
forEach
((
k
,
v
)
->
processCprs
(
k
,
v
,
orgIds
,
tmsPeriod
,
importType
,
dataImportLogs
));
}
int
isSuccess
=
(
int
)
dataImportLogs
.
stream
().
filter
(
di
->
Boolean
.
TRUE
.
equals
(
di
.
getImportResult
())).
count
();
if
(
dataImportLogs
.
size
()
==
0
)
return
OperationResultDto
.
error
(
ErrorMessage
.
NoData
);
addDataImportLog
(
dataImportLogs
);
if
(
isSuccess
<
1
)
{
return
OperationResultDto
.
error
(
ErrorMessage
.
NoData
);
return
OperationResultDto
.
error
(
ErrorMessage
.
ImportNotMatch
);
}
return
OperationResultDto
.
success
();
}
catch
(
ServiceException
e
)
{
...
...
@@ -1458,10 +1466,13 @@ public class DataImportService extends BaseService {
irs
.
stream
().
collect
(
Collectors
.
groupingBy
(
InvoiceRecord:
:
getBillingBody
));
atsGroupRes
.
forEach
((
k
,
v
)
->
processIrs
(
k
,
v
,
orgIds
,
tmsPeriod
,
importType
,
dataImportLogs
));
}
if
(
dataImportLogs
.
size
()
==
0
)
return
OperationResultDto
.
error
(
ErrorMessage
.
NoData
);
int
isSuccess
=
(
int
)
dataImportLogs
.
stream
().
filter
(
di
->
Boolean
.
TRUE
.
equals
(
di
.
getImportResult
())).
count
();
addDataImportLog
(
dataImportLogs
);
if
(
isSuccess
<
1
)
{
return
OperationResultDto
.
error
(
ErrorMessage
.
NoData
);
return
OperationResultDto
.
error
(
ErrorMessage
.
ImportNotMatch
);
}
return
OperationResultDto
.
success
();
}
catch
(
ServiceException
e
)
{
...
...
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