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
0d95b3da
Commit
0d95b3da
authored
Oct 25, 2018
by
eddie.woo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modify
parent
4d9bda71
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
70 additions
and
1 deletion
+70
-1
InputInvoiceDataImportServiceImpl.java
...s/vat/service/impl/InputInvoiceDataImportServiceImpl.java
+6
-1
DataInitTest.java
...i/src/test/java/pwc/taxtech/atms/common/DataInitTest.java
+64
-0
No files found.
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/InputInvoiceDataImportServiceImpl.java
View file @
0d95b3da
...
...
@@ -10,10 +10,12 @@ import org.springframework.stereotype.Service;
import
pwc.taxtech.atms.common.util.DateUtils
;
import
pwc.taxtech.atms.constant.enums.EnumTbImportType
;
import
pwc.taxtech.atms.constant.enums.EnumValidationType
;
import
pwc.taxtech.atms.dao.OrganizationMapper
;
import
pwc.taxtech.atms.dao.ProjectMapper
;
import
pwc.taxtech.atms.dto.FieldsMapper
;
import
pwc.taxtech.atms.dto.OperationResultDto
;
import
pwc.taxtech.atms.dto.vatdto.InputVATInvoiceDto
;
import
pwc.taxtech.atms.entity.Organization
;
import
pwc.taxtech.atms.entity.Project
;
import
pwc.taxtech.atms.invoice.InputInvoiceDetailMapper
;
import
pwc.taxtech.atms.invoice.InputInvoiceMapper
;
...
...
@@ -46,11 +48,14 @@ public class InputInvoiceDataImportServiceImpl {
private
ProjectMapper
projectMapper
;
@Autowired
private
InputInvoiceDetailMapper
inputInvoiceDetailMapper
;
@Autowired
private
OrganizationMapper
organizationMapper
;
public
PageInfo
<
InputInvoice
>
getInputInvoiceTreeViewData
(
InputInvoicePreviewQueryParam
paras
,
String
projectId
)
{
Project
project
=
projectMapper
.
selectByPrimaryKey
(
projectId
);
Organization
organization
=
organizationMapper
.
selectByPrimaryKey
(
project
.
getOrganizationId
());
InputInvoiceExample
invoiceExample
=
new
InputInvoiceExample
();
invoiceExample
.
createCriteria
().
and
COMPANYIDEqualTo
(
project
.
getCode
()).
andRZSJBetween
(
DateUtils
.
getPeriodBegin
(
invoiceExample
.
createCriteria
().
and
GFSHEqualTo
(
organization
.
getTaxPayerNumber
()).
andRZSJBetween
(
DateUtils
.
getPeriodBegin
(
project
.
getYear
(),
paras
.
getPeriodStart
()),
DateUtils
.
getPeriodEnd
(
project
.
getYear
(),
paras
.
getPeriodEnd
()))
.
andRZJGEqualTo
(
INPUT_RZJG_SUCCESS
).
andRZZTEqualTo
(
INPUT_RZZT_OVER
);
...
...
atms-api/src/test/java/pwc/taxtech/atms/common/DataInitTest.java
0 → 100644
View file @
0d95b3da
package
pwc
.
taxtech
.
atms
.
common
;
import
org.apache.commons.io.FileUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.junit.Test
;
import
pwc.taxtech.atms.CommonIT
;
import
pwc.taxtech.atms.entity.StandardAccount
;
import
java.io.File
;
import
java.io.IOException
;
import
java.nio.charset.StandardCharsets
;
import
java.util.List
;
public
class
DataInitTest
extends
CommonIT
{
@Test
public
void
initStandardAccount
()
{
try
{
List
<
String
>
lines
=
FileUtils
.
readLines
(
new
File
(
"C:\\Users\\Eddie Wu\\Desktop\\隆基科目整理.csv"
),
StandardCharsets
.
UTF_8
);
lines
.
remove
(
0
);
String
[]
parent
=
null
;
for
(
String
line
:
lines
)
{
if
(
StringUtils
.
isBlank
(
line
))
{
continue
;
}
String
[]
cols
=
line
.
split
(
","
);
String
name
=
StringUtils
.
substringAfterLast
(
cols
[
7
],
"-"
);
StandardAccount
account
=
new
StandardAccount
();
account
.
setId
(
CommonUtils
.
getUUID
());
account
.
setCode
(
cols
[
6
]);
account
.
setName
(
StringUtils
.
isBlank
(
name
)
?
cols
[
7
]
:
name
);
if
(
StringUtils
.
isNotBlank
(
cols
[
0
]))
{
parent
=
cols
;
}
else
{
account
.
setParentCode
(
parent
[
6
]);
}
account
.
setFullName
(
cols
[
7
]);
account
.
setAcctProp
(
Integer
.
valueOf
(
cols
[
9
]));
int
acctLevel
=
1
;
if
(
StringUtils
.
isNotBlank
(
cols
[
1
]))
{
acctLevel
=
2
;
}
else
if
(
StringUtils
.
isNotBlank
(
cols
[
2
]))
{
acctLevel
=
3
;
}
else
if
(
StringUtils
.
isNotBlank
(
cols
[
3
]))
{
acctLevel
=
4
;
}
else
if
(
StringUtils
.
isNotBlank
(
cols
[
4
]))
{
acctLevel
=
5
;
}
account
.
setAcctLevel
(
acctLevel
);
account
.
setDirection
(
Integer
.
valueOf
(
cols
[
10
])
==
1
?
1
:
-
1
);
account
.
setIsLeaf
(
acctLevel
!=
1
);
account
.
setRuleType
(
2
);
account
.
setIsActive
(
true
);
account
.
setEnglishName
(
cols
[
8
]);
account
.
setIndustryId
(
"0"
);
standardAccountMapper
.
insertSelective
(
account
);
}
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
}
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