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
6913e0dc
Commit
6913e0dc
authored
Nov 12, 2018
by
sherlock
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
inputInvoice export
template import
parent
caacb89a
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
280 additions
and
17 deletions
+280
-17
InputInvoiceImportController.java
...taxtech/atms/controller/InputInvoiceImportController.java
+44
-6
InputInvoiceDetailExportDto.java
.../taxtech/atms/dto/vatdto/InputInvoiceDetailExportDto.java
+86
-0
InputInvoiceExportDto.java
...va/pwc/taxtech/atms/dto/vatdto/InputInvoiceExportDto.java
+123
-0
TemplateServiceImpl.java
...va/pwc/taxtech/atms/service/impl/TemplateServiceImpl.java
+21
-6
OutputInvoiceServiceImpl.java
...xtech/atms/vat/service/impl/OutputInvoiceServiceImpl.java
+2
-1
OutputInvoiceExtendsMapper.xml
...xtech/atms/invoice/extends/OutputInvoiceExtendsMapper.xml
+1
-1
vatExportService.js
...rc/main/webapp/app/common/vatservices/vatExportService.js
+1
-1
vat-report-layout.ctrl.js
...pp/vat/report/vat-report-layout/vat-report-layout.ctrl.js
+2
-2
No files found.
atms-api/src/main/java/pwc/taxtech/atms/controller/InputInvoiceImportController.java
View file @
6913e0dc
package
pwc
.
taxtech
.
atms
.
controller
;
import
com.github.pagehelper.PageInfo
;
import
com.google.common.collect.Lists
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.MediaType
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.*
;
import
pwc.taxtech.atms.dto.vatdto.ImportInputInvoiceDto
;
import
pwc.taxtech.atms.dto.vatdto.ImportInputInvoiceItemDto
;
import
pwc.taxtech.atms.dto.vatdto.InputVATInvoiceBaseDto
;
import
pwc.taxtech.atms.dto.vatdto.*
;
import
pwc.taxtech.atms.service.impl.IdentityServiceImpl
;
import
pwc.taxtech.atms.thirdparty.ExcelSheet
;
import
pwc.taxtech.atms.thirdparty.ExcelUtil
;
...
...
@@ -76,11 +76,38 @@ public class InputInvoiceImportController {
return
ResponseEntity
.
ok
().
body
(
inputInvoiceDataImportService
.
getInputInvoiceItemList
(
fpid
));
}
private
String
getFplx
(
String
fplx
){
if
(
StringUtils
.
isBlank
(
fplx
))
return
""
;
switch
(
fplx
){
case
"004"
:
return
"增值税专票"
;
case
"007"
:
return
"普票"
;
case
"026"
:
return
"电子发票"
;
default
:
return
fplx
;
}
}
private
int
getDownloadFilePath
(
InputInvoicePreviewQueryParam
paras
,
OutputStream
outputStream
,
String
projectId
)
{
List
<
InputInvoice
>
list
=
inputInvoiceDataImportService
.
getInputInvoiceTreeViewData
(
paras
,
projectId
).
getList
();
if
(
list
.
size
()
==
0
)
{
return
0
;
}
List
<
InputInvoiceExportDto
>
inputInvoiceExportDtos
=
Lists
.
newArrayList
();
for
(
InputInvoice
inputInvoice
:
list
){
InputInvoiceExportDto
inputInvoiceExportDto
=
new
InputInvoiceExportDto
();
inputInvoiceExportDto
.
setAmount
(
inputInvoice
.
getHJJE
());
inputInvoiceExportDto
.
setCertificationDate
(
inputInvoice
.
getRZSJ
());
inputInvoiceExportDto
.
setInvoiceCode
(
inputInvoice
.
getFPDM
());
inputInvoiceExportDto
.
setInvoiceDate
(
inputInvoice
.
getKPRQ
());
inputInvoiceExportDto
.
setInvoiceNumber
(
inputInvoice
.
getFPHM
());
inputInvoiceExportDto
.
setInvoiceTypeName
(
getFplx
(
inputInvoice
.
getFPLX
()));
inputInvoiceExportDto
.
setPeriodId
(
Integer
.
parseInt
(
inputInvoice
.
getRZSJ
().
substring
(
5
,
7
)));
inputInvoiceExportDto
.
setSellerTaxNumber
(
inputInvoice
.
getXFSH
());
inputInvoiceExportDto
.
setTaxAmount
(
inputInvoice
.
getHJSE
());
inputInvoiceExportDtos
.
add
(
inputInvoiceExportDto
);
}
Map
<
String
,
String
>
header
=
new
HashMap
<>();
header
.
put
(
"PeriodId"
,
"期间"
);
header
.
put
(
"InvoiceDate"
,
"开票日期"
);
...
...
@@ -94,7 +121,7 @@ public class InputInvoiceImportController {
ExcelSheet
excelSheetA
=
new
ExcelSheet
<>();
excelSheetA
.
setHeaders
(
header
);
excelSheetA
.
setDataset
(
list
);
excelSheetA
.
setDataset
(
inputInvoiceExportDtos
);
excelSheetA
.
setSheetName
(
"sheetA"
);
...
...
@@ -111,9 +138,20 @@ public class InputInvoiceImportController {
excelSheetB
.
setHeaders
(
header2
);
excelSheetB
.
setSheetName
(
"sheetB"
);
List
<
InputInvoiceDetail
>
inputInvoiceItemList
=
new
ArrayList
<>();
List
<
InputInvoiceDetail
ExportDto
>
inputInvoiceItemList
=
new
ArrayList
<>();
for
(
InputInvoice
item
:
list
)
{
inputInvoiceItemList
.
addAll
(
inputInvoiceDataImportService
.
getInputInvoiceItemList
(
item
.
getID
()));
List
<
InputInvoiceDetail
>
inputInvoiceDetailList
=
inputInvoiceDataImportService
.
getInputInvoiceItemList
(
item
.
getID
());
for
(
InputInvoiceDetail
inputInvoiceDetail
:
inputInvoiceDetailList
){
InputInvoiceDetailExportDto
inputInvoiceDetailExportDto
=
new
InputInvoiceDetailExportDto
();
inputInvoiceDetailExportDto
.
setAmount
(
inputInvoiceDetail
.
getJE
());
inputInvoiceDetailExportDto
.
setInvoiceCode
(
inputInvoiceDetail
.
getFPDM
());
inputInvoiceDetailExportDto
.
setInvoiceNumber
(
inputInvoiceDetail
.
getFPHM
());
inputInvoiceDetailExportDto
.
setPeriodId
(
Integer
.
parseInt
(
item
.
getRZSJ
().
substring
(
5
,
7
)));
inputInvoiceDetailExportDto
.
setProductionName
(
inputInvoiceDetail
.
getSPMC
());
inputInvoiceDetailExportDto
.
setTaxAmount
(
inputInvoiceDetail
.
getSE
());
inputInvoiceDetailExportDto
.
setTaxRate
(
inputInvoiceDetail
.
getSLV
());
inputInvoiceItemList
.
add
(
inputInvoiceDetailExportDto
);
}
}
excelSheetB
.
setDataset
(
inputInvoiceItemList
);
List
<
ExcelSheet
<
InputVATInvoiceBaseDto
>>
sheets
=
new
ArrayList
<>();
...
...
atms-api/src/main/java/pwc/taxtech/atms/dto/vatdto/InputInvoiceDetailExportDto.java
0 → 100644
View file @
6913e0dc
package
pwc
.
taxtech
.
atms
.
dto
.
vatdto
;
import
pwc.taxtech.atms.thirdparty.ExcelCell
;
import
java.io.Serializable
;
public
class
InputInvoiceDetailExportDto
implements
Serializable
{
@ExcelCell
(
index
=
5
)
private
Integer
periodId
;
@ExcelCell
(
index
=
4
)
private
String
invoiceCode
;
@ExcelCell
(
index
=
6
)
private
String
invoiceNumber
;
@ExcelCell
(
index
=
2
)
private
String
amount
;
@ExcelCell
(
index
=
1
)
private
String
taxAmount
;
@ExcelCell
(
index
=
3
)
private
String
taxRate
;
@ExcelCell
(
index
=
7
)
private
String
productionName
;
public
Integer
getPeriodId
()
{
return
periodId
;
}
public
void
setPeriodId
(
Integer
periodId
)
{
this
.
periodId
=
periodId
;
}
public
String
getInvoiceCode
()
{
return
invoiceCode
;
}
public
void
setInvoiceCode
(
String
invoiceCode
)
{
this
.
invoiceCode
=
invoiceCode
;
}
public
String
getInvoiceNumber
()
{
return
invoiceNumber
;
}
public
void
setInvoiceNumber
(
String
invoiceNumber
)
{
this
.
invoiceNumber
=
invoiceNumber
;
}
public
String
getAmount
()
{
return
amount
;
}
public
void
setAmount
(
String
amount
)
{
this
.
amount
=
amount
;
}
public
String
getTaxAmount
()
{
return
taxAmount
;
}
public
void
setTaxAmount
(
String
taxAmount
)
{
this
.
taxAmount
=
taxAmount
;
}
public
String
getTaxRate
()
{
return
taxRate
;
}
public
void
setTaxRate
(
String
taxRate
)
{
this
.
taxRate
=
taxRate
;
}
public
String
getProductionName
()
{
return
productionName
;
}
public
void
setProductionName
(
String
productionName
)
{
this
.
productionName
=
productionName
;
}
}
\ No newline at end of file
atms-api/src/main/java/pwc/taxtech/atms/dto/vatdto/InputInvoiceExportDto.java
0 → 100644
View file @
6913e0dc
package
pwc
.
taxtech
.
atms
.
dto
.
vatdto
;
import
pwc.taxtech.atms.thirdparty.ExcelCell
;
import
java.io.Serializable
;
public
class
InputInvoiceExportDto
implements
Serializable
{
@ExcelCell
(
index
=
6
)
private
int
periodId
;
@ExcelCell
(
index
=
7
)
private
String
invoiceDate
;
@ExcelCell
(
index
=
5
)
private
String
invoiceCode
;
@ExcelCell
(
index
=
8
)
private
String
invoiceNumber
;
@ExcelCell
(
index
=
9
)
private
String
sellerTaxNumber
;
@ExcelCell
(
index
=
3
)
private
String
invoiceTypeName
;
@ExcelCell
(
index
=
4
)
private
String
amount
;
@ExcelCell
(
index
=
1
)
private
String
taxAmount
;
@ExcelCell
(
index
=
2
)
private
String
certificationDate
;
public
int
getPeriodId
()
{
return
periodId
;
}
public
void
setPeriodId
(
int
periodId
)
{
this
.
periodId
=
periodId
;
}
public
String
getInvoiceDate
()
{
return
invoiceDate
;
}
public
void
setInvoiceDate
(
String
invoiceDate
)
{
this
.
invoiceDate
=
invoiceDate
;
}
public
String
getInvoiceCode
()
{
return
invoiceCode
;
}
public
void
setInvoiceCode
(
String
invoiceCode
)
{
this
.
invoiceCode
=
invoiceCode
;
}
public
String
getInvoiceNumber
()
{
return
invoiceNumber
;
}
public
void
setInvoiceNumber
(
String
invoiceNumber
)
{
this
.
invoiceNumber
=
invoiceNumber
;
}
public
String
getSellerTaxNumber
()
{
return
sellerTaxNumber
;
}
public
void
setSellerTaxNumber
(
String
sellerTaxNumber
)
{
this
.
sellerTaxNumber
=
sellerTaxNumber
;
}
public
String
getInvoiceTypeName
()
{
return
invoiceTypeName
;
}
public
void
setInvoiceTypeName
(
String
invoiceTypeName
)
{
this
.
invoiceTypeName
=
invoiceTypeName
;
}
public
String
getAmount
()
{
return
amount
;
}
public
void
setAmount
(
String
amount
)
{
this
.
amount
=
amount
;
}
public
String
getTaxAmount
()
{
return
taxAmount
;
}
public
void
setTaxAmount
(
String
taxAmount
)
{
this
.
taxAmount
=
taxAmount
;
}
public
String
getCertificationDate
()
{
return
certificationDate
;
}
public
void
setCertificationDate
(
String
certificationDate
)
{
this
.
certificationDate
=
certificationDate
;
}
@Override
public
String
toString
()
{
return
"InputInvoice{"
+
"periodId="
+
periodId
+
", invoiceDate='"
+
invoiceDate
+
'\''
+
", invoiceCode='"
+
invoiceCode
+
'\''
+
", invoiceNumber='"
+
invoiceNumber
+
'\''
+
", sellerTaxNumber='"
+
sellerTaxNumber
+
'\''
+
", invoiceTypeName='"
+
invoiceTypeName
+
'\''
+
", amount='"
+
amount
+
'\''
+
", taxAmount='"
+
taxAmount
+
'\''
+
", certificationDate='"
+
certificationDate
+
'\''
+
'}'
;
}
}
\ No newline at end of file
atms-api/src/main/java/pwc/taxtech/atms/service/impl/TemplateServiceImpl.java
View file @
6913e0dc
...
...
@@ -3,6 +3,7 @@ package pwc.taxtech.atms.service.impl;
import
com.google.common.collect.Lists
;
import
com.grapecity.documents.excel.C
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Transactional
;
...
...
@@ -14,6 +15,8 @@ import pwc.taxtech.atms.dpo.TemplateUniqDto;
import
pwc.taxtech.atms.dto.*
;
import
pwc.taxtech.atms.dto.vatdto.TemplateByGroupDto
;
import
pwc.taxtech.atms.entity.*
;
import
pwc.taxtech.atms.vat.dao.PeriodTemplateMapper
;
import
pwc.taxtech.atms.vat.entity.PeriodTemplateExample
;
import
java.util.*
;
import
java.util.stream.Collectors
;
...
...
@@ -23,6 +26,9 @@ import static java.util.stream.Collectors.groupingBy;
@Service
public
class
TemplateServiceImpl
extends
AbstractService
{
@Autowired
private
PeriodTemplateMapper
periodTemplateMapper
;
public
void
addExistTemplate
(
TemplateAddExistDto
templateAddExistDto
){
TemplateExample
t
=
new
TemplateExample
();
t
.
createCriteria
().
andTemplateGroupIdEqualTo
(
templateAddExistDto
.
getTemplateGroupId
());
...
...
@@ -31,8 +37,10 @@ public class TemplateServiceImpl extends AbstractService {
TemplateExample
templateExample
=
new
TemplateExample
();
templateExample
.
createCriteria
().
andIdIn
(
templateAddExistDto
.
getTemplateIdList
());
List
<
Template
>
templates
=
templateMapper
.
selectByExample
(
templateExample
);
List
<
CellTemplateConfig
>
cellTemplateConfigList
=
Lists
.
newArrayList
();
for
(
Template
x
:
templates
){
// 复制添加template
Long
originTemplateId
=
x
.
getId
();
x
.
setId
(
distributedIdService
.
nextId
());
x
.
setTemplateGroupId
(
templateAddExistDto
.
getTemplateGroupId
());
...
...
@@ -43,15 +51,16 @@ public class TemplateServiceImpl extends AbstractService {
CellTemplateExample
cellTemplateExample
=
new
CellTemplateExample
();
cellTemplateExample
.
createCriteria
().
andReportTemplateIdEqualTo
(
originTemplateId
);
List
<
CellTemplate
>
cellTemplates
=
cellTemplateMapper
.
selectByExample
(
cellTemplateExample
);
List
<
CellTemplateConfig
>
cellTemplateConfigList
=
Lists
.
newArrayList
();
if
(
cellTemplates
.
isEmpty
())
return
;
cellTemplates
.
forEach
(
cellTemplate
->
{
cellTemplate
.
setId
(
distributedIdService
.
nextId
());
cellTemplate
.
setReportTemplateId
(
x
.
getId
());
// 复制添加cellTemplateConfig
CellTemplateConfigExample
cellTemplateConfigExample
=
new
CellTemplateConfigExample
();
cellTemplateConfigExample
.
createCriteria
().
andCellTemplateIdEqualTo
(
cellTemplate
.
getId
())
.
andReportTemplateIdEqualTo
(
x
.
getId
()
);
.
andReportTemplateIdEqualTo
(
originTemplateId
);
List
<
CellTemplateConfig
>
cellTemplateConfigs
=
cellTemplateConfigMapper
.
selectByExample
(
cellTemplateConfigExample
);
cellTemplate
.
setId
(
distributedIdService
.
nextId
());
cellTemplate
.
setReportTemplateId
(
x
.
getId
());
if
(
CollectionUtils
.
isNotEmpty
(
cellTemplateConfigs
)){
CellTemplateConfig
cellTemplateConfig
=
cellTemplateConfigs
.
get
(
0
);
cellTemplateConfig
.
setId
(
distributedIdService
.
nextId
());
...
...
@@ -61,8 +70,9 @@ public class TemplateServiceImpl extends AbstractService {
}
});
cellTemplateMapper
.
batchInsert2
(
cellTemplates
);
cellTemplateConfigMapper
.
batchInsert2
(
cellTemplateConfigList
);
}
if
(
cellTemplateConfigList
.
isEmpty
())
return
;
cellTemplateConfigMapper
.
batchInsert2
(
cellTemplateConfigList
);
}
public
List
<
TemplateDto
>
get
(
Long
templateGroupId
,
Integer
reportType
)
{
...
...
@@ -297,7 +307,12 @@ public class TemplateServiceImpl extends AbstractService {
taxReturnGroup
.
setId
(
templateGroupId
);
taxReturnGroup
.
setName
(
TemplateGroupType
.
TaxReturn
.
name
());
List
<
TemplateDto
>
templateDtos2
=
new
ArrayList
<>();
templates
.
stream
().
filter
(
x
->
x
.
getTemplateGroupId
().
equals
(
templateGroupId
)).
collect
(
Collectors
.
toList
()).
forEach
(
a
->
{
templates
.
stream
().
filter
(
x
->
{
PeriodTemplateExample
periodTemplateExample
=
new
PeriodTemplateExample
();
periodTemplateExample
.
createCriteria
().
andTemplateGroupIdEqualTo
(
templateGroupId
)
.
andTemplateIdEqualTo
(
x
.
getId
());
return
x
.
getTemplateGroupId
().
equals
(
templateGroupId
)
&&
periodTemplateMapper
.
selectByExample
(
periodTemplateExample
).
size
()
>
0
;
}).
collect
(
Collectors
.
toList
()).
forEach
(
a
->
{
TemplateDto
templateDto
=
new
TemplateDto
();
CommonUtils
.
copyProperties
(
a
,
templateDto
);
templateDtos2
.
add
(
templateDto
);
...
...
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/OutputInvoiceServiceImpl.java
View file @
6913e0dc
...
...
@@ -266,7 +266,8 @@ public class OutputInvoiceServiceImpl {
OutputInvoiceExample
e
=
new
OutputInvoiceExample
();
e
.
createCriteria
().
andXFSHEqualTo
(
organization
.
getTaxPayerNumber
());
List
<
String
>
fpqqlshList
=
outputInvoiceMapper
.
selectByExample
(
e
).
stream
().
map
(
OutputInvoice:
:
getFPQQLSH
).
collect
(
Collectors
.
toList
());
rList
.
stream
().
filter
(
a
->
fpqqlshList
.
contains
(
a
.
getFpqqlsh
())).
forEach
(
x
->
{
rList
=
rList
.
stream
().
filter
(
a
->
fpqqlshList
.
contains
(
a
.
getFpqqlsh
())).
collect
(
Collectors
.
toList
());
rList
.
forEach
(
x
->
{
CAL
.
setTime
(
x
.
getInvoiceDate
());
x
.
setPeriodId
(
CAL
.
get
(
Calendar
.
MONTH
)
+
1
);
});
...
...
atms-dao/src/main/resources/pwc/taxtech/atms/invoice/extends/OutputInvoiceExtendsMapper.xml
View file @
6913e0dc
...
...
@@ -108,7 +108,7 @@
<if
test=
"productName!=null and productName!=''"
>
AND OI.SPMC LIKE concat (
'%',
#{
productName,jdbcType=VARCHAR,'%'}
#{productName,jdbcType=VARCHAR,'%'}
)
</if>
</select>
...
...
atms-web/src/main/webapp/app/common/vatservices/vatExportService.js
View file @
6913e0dc
...
...
@@ -8,7 +8,7 @@
$
(
'#busy-indicator-container'
).
show
();
var
defer
=
$q
.
defer
();
var
octetStreamMime
=
'application/
octet-stream
'
;
var
octetStreamMime
=
'application/
vnd.ms-excel
'
;
var
success
=
false
;
// Get the headers
...
...
atms-web/src/main/webapp/app/vat/report/vat-report-layout/vat-report-layout.ctrl.js
View file @
6913e0dc
...
...
@@ -5,7 +5,7 @@
$log
.
debug
(
'VatReportLayoutController.ctor()...'
);
$scope
.
$on
(
'refreshGenerateReport'
,
function
(
event
,
data
)
{
//$scope.selectedTemplateId = data.templateId;
//
$scope.selectedTemplateId = data.templateId;
loadTemplateMenu
();
});
var
loadTemplateMenu
=
function
()
{
...
...
@@ -18,7 +18,7 @@
//房地产
//projectID = '0cf0945f-d41c-4df3-8235-ae693d5e724d';
$q
.
all
([
templateGroupService
.
getGroupTemplateByGroupID
(
6390933830635520
,
projectID
),
templateGroupService
.
getGroupTemplateByGroupID
(
48372654336679936
,
projectID
),
vatReportService
.
getTemplate
(
vatSessionService
.
project
.
id
,
constant
.
serviceType
.
VAT
,
vatSessionService
.
month
)
]).
then
(
function
(
result
)
{
if
(
!
_
.
isEmpty
(
result
[
0
])
&&
!
_
.
isEmpty
(
result
[
0
].
data
)
&&
!
_
.
isEmpty
(
result
[
0
].
data
.
data
)
...
...
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