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
73da29b8
Commit
73da29b8
authored
Jun 20, 2018
by
neo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[DEV] serios data import query
parent
2e04d14f
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
280 additions
and
0 deletions
+280
-0
VatImportType.java
...n/java/pwc/taxtech/atms/constant/enums/VatImportType.java
+22
-0
JournalEntryImportController.java
...taxtech/atms/controller/JournalEntryImportController.java
+27
-0
QueryJeDto.java
...src/main/java/pwc/taxtech/atms/dto/vatdto/QueryJeDto.java
+24
-0
VoucherDto.java
...src/main/java/pwc/taxtech/atms/dto/vatdto/VoucherDto.java
+46
-0
JournalEntryImportMapper.java
...va/pwc/taxtech/atms/vat/dao/JournalEntryImportMapper.java
+75
-0
JournalEntryImportService.java
...c/taxtech/atms/vat/service/JournalEntryImportService.java
+9
-0
JournalEntryImportServiceImpl.java
.../atms/vat/service/impl/JournalEntryImportServiceImpl.java
+77
-0
No files found.
atms-api/src/main/java/pwc/taxtech/atms/constant/enums/VatImportType.java
0 → 100644
View file @
73da29b8
package
pwc
.
taxtech
.
atms
.
constant
.
enums
;
public
enum
VatImportType
{
ERP
(
1
),
//财务数据导入
IncomeInvoice
(
2
),
JournalEntry
(
3
),
//序时账导入
OutputInvoice
(
4
),
TB
(
5
),
//TB导入
Mapping
(
6
),
AuditAdjust
(
7
),
Voucher
(
8
);
private
int
code
;
VatImportType
(
int
code
)
{
this
.
code
=
code
;
}
public
int
getCode
()
{
return
code
;
}
}
atms-api/src/main/java/pwc/taxtech/atms/controller/JournalEntryImportController.java
0 → 100644
View file @
73da29b8
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
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RestController
;
import
pwc.taxtech.atms.dto.vatdto.QueryJeDto
;
import
pwc.taxtech.atms.vat.service.JournalEntryImportService
;
@RestController
@RequestMapping
(
value
=
"/api/v1/journalEntryImport"
)
public
class
JournalEntryImportController
{
@Autowired
private
JournalEntryImportService
journalEntryDataImportService
;
@ApiOperation
(
value
=
"queryJournalEntryData"
,
notes
=
""
)
@RequestMapping
(
value
=
"/queryJournalEntryData"
,
method
=
RequestMethod
.
POST
)
public
ResponseEntity
queryJournalEntryData
(
@RequestBody
QueryJeDto
queryJeDto
)
{
return
ResponseEntity
.
ok
(
journalEntryDataImportService
.
qeryJournalEntryData
(
queryJeDto
));
}
}
atms-api/src/main/java/pwc/taxtech/atms/dto/vatdto/QueryJeDto.java
0 → 100644
View file @
73da29b8
package
pwc
.
taxtech
.
atms
.
dto
.
vatdto
;
import
pwc.taxtech.atms.dto.PagingDto
;
public
class
QueryJeDto
{
private
PagingDto
pageInfo
;
private
int
periodId
;
public
PagingDto
getPageInfo
()
{
return
pageInfo
;
}
public
void
setPageInfo
(
PagingDto
pageInfo
)
{
this
.
pageInfo
=
pageInfo
;
}
public
int
getPeriodId
()
{
return
periodId
;
}
public
void
setPeriodId
(
int
periodId
)
{
this
.
periodId
=
periodId
;
}
}
atms-api/src/main/java/pwc/taxtech/atms/dto/vatdto/VoucherDto.java
View file @
73da29b8
...
...
@@ -47,6 +47,12 @@ public class VoucherDto {
private
String
stdCodeAndNameShow
;
//界面显示
private
String
groupShow
;
//界面显示
private
int
vIDCount
;
//凭证总数
private
int
itemIDCount
;
//分录总数
private
BigDecimal
debitSum
;
private
BigDecimal
creditSum
;
private
int
auditCount
;
//审计调整总数
public
String
getVoucherID
()
{
return
voucherID
;
}
...
...
@@ -350,4 +356,44 @@ public class VoucherDto {
public
void
setGroupShow
(
String
groupShow
)
{
this
.
groupShow
=
groupShow
;
}
public
int
getvIDCount
()
{
return
vIDCount
;
}
public
void
setvIDCount
(
int
vIDCount
)
{
this
.
vIDCount
=
vIDCount
;
}
public
int
getItemIDCount
()
{
return
itemIDCount
;
}
public
void
setItemIDCount
(
int
itemIDCount
)
{
this
.
itemIDCount
=
itemIDCount
;
}
public
BigDecimal
getDebitSum
()
{
return
debitSum
;
}
public
void
setDebitSum
(
BigDecimal
debitSum
)
{
this
.
debitSum
=
debitSum
;
}
public
BigDecimal
getCreditSum
()
{
return
creditSum
;
}
public
void
setCreditSum
(
BigDecimal
creditSum
)
{
this
.
creditSum
=
creditSum
;
}
public
int
getAuditCount
()
{
return
auditCount
;
}
public
void
setAuditCount
(
int
auditCount
)
{
this
.
auditCount
=
auditCount
;
}
}
atms-api/src/main/java/pwc/taxtech/atms/vat/dao/JournalEntryImportMapper.java
0 → 100644
View file @
73da29b8
package
pwc
.
taxtech
.
atms
.
vat
.
dao
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Select
;
import
pwc.taxtech.atms.MyVatMapper
;
import
pwc.taxtech.atms.dto.PagingDto
;
import
pwc.taxtech.atms.vat.entity.Voucher
;
import
java.util.List
;
@Mapper
public
interface
JournalEntryImportMapper
extends
MyVatMapper
{
@Select
(
"<script>"
+
"SELECT "
+
" `VoucherID`, "
+
" `VID`, "
+
" `Date`, "
+
" `Group`, "
+
" `Period`, "
+
" `CustomerCode`, "
+
" `CustomerName`, "
+
" `Summary`, "
+
" `AcctCode`, "
+
" `Debit`, "
+
" `Credit`, "
+
" `Attach`, "
+
" `ItemID`, "
+
" `CreateTime`, "
+
" `ImportType`, "
+
" `CreatorID`, "
+
" `MonthID`, "
+
" `OriginalPeriod`, "
+
" `Status`, "
+
" `PartBilledPeriod`, "
+
" `BilledPeriod`, "
+
" `StdCode`, "
+
" `MappingReason`, "
+
" `MappingUser`, "
+
" `MappingTime`, "
+
" `RemapId` "
+
"FROM "
+
" Voucher "
+
"WHERE "
+
" 1 = 1 "
+
" AND `ImportType` = #{importType} AND `Period` = #{period} "
+
" ORDER BY `Period`,`Group`,`VID`,`ItemID`"
+
" LIMIT #{start},#{size}"
+
"</script>"
)
List
<
Voucher
>
pageQuery
(
@Param
(
"importType"
)
int
code
,
@Param
(
"period"
)
int
periodId
,
@Param
(
"start"
)
int
start
,
@Param
(
"size"
)
int
size
);
@Select
(
"<script>"
+
"SELECT "
+
" COUNT(1) "
+
"FROM "
+
" Voucher "
+
"WHERE "
+
" 1 = 1"
+
" AND `ImportType` = #{importType} AND `Period` = #{period}"
+
"</script>"
)
Integer
pageQueryCount
(
@Param
(
"importType"
)
int
code
,
@Param
(
"period"
)
int
periodId
);
@Select
(
"<script>"
+
"SELECT "
+
" COUNT(1) "
+
"FROM "
+
" Voucher "
+
"WHERE "
+
" 1 = 1"
+
" AND `ImportType` = #{importType} AND `Period` = #{period}"
+
" GROUP BY `VID` ,`Group`,`Period`"
+
"</script>"
)
Integer
pageVIDCount
(
@Param
(
"importType"
)
int
code
,
@Param
(
"period"
)
int
periodId
);
}
atms-api/src/main/java/pwc/taxtech/atms/vat/service/JournalEntryImportService.java
0 → 100644
View file @
73da29b8
package
pwc
.
taxtech
.
atms
.
vat
.
service
;
import
pwc.taxtech.atms.dto.PagingResultDto
;
import
pwc.taxtech.atms.dto.vatdto.QueryJeDto
;
import
pwc.taxtech.atms.dto.vatdto.VoucherDto
;
public
interface
JournalEntryImportService
{
PagingResultDto
<
VoucherDto
>
qeryJournalEntryData
(
QueryJeDto
queryJeDto
);
}
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/JournalEntryImportServiceImpl.java
0 → 100644
View file @
73da29b8
package
pwc
.
taxtech
.
atms
.
vat
.
service
.
impl
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
pwc.taxtech.atms.constant.enums.VatImportType
;
import
pwc.taxtech.atms.dto.FieldsMapper
;
import
pwc.taxtech.atms.dto.PagingResultDto
;
import
pwc.taxtech.atms.dto.vatdto.QueryJeDto
;
import
pwc.taxtech.atms.dto.vatdto.VoucherDto
;
import
pwc.taxtech.atms.vat.dao.JournalEntryImportMapper
;
import
pwc.taxtech.atms.vat.entity.Voucher
;
import
pwc.taxtech.atms.vat.service.JournalEntryImportService
;
import
java.math.BigDecimal
;
import
java.util.ArrayList
;
import
java.util.List
;
@Service
public
class
JournalEntryImportServiceImpl
implements
JournalEntryImportService
{
@Autowired
JournalEntryImportMapper
journalEntryImportMapper
;
@Override
public
PagingResultDto
<
VoucherDto
>
qeryJournalEntryData
(
QueryJeDto
queryJeDto
)
{
PagingResultDto
<
VoucherDto
>
qResult
=
new
PagingResultDto
<
VoucherDto
>();
qResult
.
setPageInfo
(
queryJeDto
.
getPageInfo
());
qResult
.
setList
(
new
ArrayList
<>());
qResult
.
setCalculateData
(
new
VoucherDto
());
List
<
Voucher
>
pageResultList
=
journalEntryImportMapper
.
pageQuery
(
VatImportType
.
JournalEntry
.
getCode
(),
queryJeDto
.
getPeriodId
(),
queryJeDto
.
getPageInfo
().
getPageIndex
()*
queryJeDto
.
getPageInfo
().
getPageSize
(),
queryJeDto
.
getPageInfo
().
getPageSize
());
Integer
pageCount
=
journalEntryImportMapper
.
pageQueryCount
(
VatImportType
.
JournalEntry
.
getCode
(),
queryJeDto
.
getPeriodId
());
Integer
vIDCount
=
journalEntryImportMapper
.
pageVIDCount
(
VatImportType
.
JournalEntry
.
getCode
(),
queryJeDto
.
getPeriodId
());
//查询结果总数
qResult
.
getPageInfo
().
setTotalCount
(
pageCount
);
//分录总数
qResult
.
getCalculateData
().
setItemIDCount
(
pageCount
==
null
?
0
:
pageCount
);
//凭证总数
qResult
.
getCalculateData
().
setvIDCount
(
vIDCount
==
null
?
0
:
vIDCount
);
//所有凭证的借贷方sum
BigDecimal
debitSum
=
new
BigDecimal
(
0
);
BigDecimal
creditSum
=
new
BigDecimal
(
0
);
int
MonthID
=
0
,
Summary
=
0
;
for
(
Voucher
voucher
:
pageResultList
)
{
debitSum
.
add
(
voucher
.
getDebit
()
!=
null
?
voucher
.
getDebit
()
:
new
BigDecimal
(
0
));
creditSum
.
add
(
voucher
.
getDebit
()
!=
null
?
voucher
.
getCredit
()
:
new
BigDecimal
(
0
));
if
(
voucher
.
getMonthID
()
!=
null
)
MonthID
=
1
;
if
(
voucher
.
getSummary
()
!=
null
)
Summary
=
1
;
}
for
(
Voucher
voucher
:
pageResultList
)
{
if
(
voucher
.
getMonthID
()
==
null
&&
MonthID
==
1
)
voucher
.
setMonthID
(
0
);
if
(
voucher
.
getSummary
()
==
null
&&
Summary
==
1
)
voucher
.
setSummary
(
""
);
VoucherDto
voucherDto
=
new
VoucherDto
();
try
{
FieldsMapper
.
map
(
voucher
,
voucherDto
);
}
catch
(
ClassNotFoundException
e
)
{
//TODO replace exception filter (neo)
e
.
printStackTrace
();
}
catch
(
IllegalAccessException
e
)
{
e
.
printStackTrace
();
}
qResult
.
getList
().
add
(
voucherDto
);
}
return
qResult
;
}
}
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