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
cfb73cd2
Commit
cfb73cd2
authored
Jun 27, 2018
by
eddie.woo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
merge ken
parent
0a4c945f
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
544 additions
and
541 deletions
+544
-541
.gitignore
.gitignore
+12
-11
AppCachePool.java
atms-api/src/main/java/pwc/taxtech/atms/AppCachePool.java
+35
-35
EnumInputInvoiceEntityType.java
...xtech/atms/constant/enums/EnumInputInvoiceEntityType.java
+21
-21
EnumInputInvoiceRefundReason.java
...ech/atms/constant/enums/EnumInputInvoiceRefundReason.java
+26
-26
EnumInputInvoiceSourceType.java
...xtech/atms/constant/enums/EnumInputInvoiceSourceType.java
+21
-21
EnumInputInvoiceStatusType.java
...xtech/atms/constant/enums/EnumInputInvoiceStatusType.java
+35
-35
EnumInputInvoiceType.java
...pwc/taxtech/atms/constant/enums/EnumInputInvoiceType.java
+18
-18
EnumInputInvoiceUploadType.java
...xtech/atms/constant/enums/EnumInputInvoiceUploadType.java
+21
-21
EnumIsIncludedInTaxAmountType.java
...ch/atms/constant/enums/EnumIsIncludedInTaxAmountType.java
+30
-30
EnumProductionServiceType.java
...axtech/atms/constant/enums/EnumProductionServiceType.java
+32
-32
EnumProductionType.java
...a/pwc/taxtech/atms/constant/enums/EnumProductionType.java
+31
-31
InputInvoiceImportController.java
...taxtech/atms/controller/InputInvoiceImportController.java
+102
-102
InvoiceDictionaryDto.java
...java/pwc/taxtech/atms/dto/input/InvoiceDictionaryDto.java
+18
-18
InvoiceFilterDto.java
...ain/java/pwc/taxtech/atms/dto/input/InvoiceFilterDto.java
+85
-84
sqlMapConfig.xml
atms-api/src/main/resources/sqlMapConfig.xml
+57
-56
No files found.
.gitignore
View file @
cfb73cd2
.*
rebel.xml
!.gitignore
!.mvn
/tmp
/temp
/target
/build
/logs
/atms-web/src/main/webapp/node_modules
**/*.iml
.*
rebel.xml
!.gitignore
!.mvn
/tmp
/temp
/target
/build
/logs
/atms-web/src/main/webapp/node_modules
**/*.iml
**/.idea/
/bin/
atms-api/src/main/java/pwc/taxtech/atms/AppCachePool.java
View file @
cfb73cd2
package
pwc
.
taxtech
.
atms
;
import
pwc.taxtech.atms.dto.user.UserDto
;
import
pwc.taxtech.atms.service.OperationLogService
;
import
java.util.HashMap
;
import
java.util.Map
;
public
class
AppCachePool
{
private
static
Map
<
String
,
UserDto
>
CACHED_USERS
=
null
;
private
static
Object
_locker
=
new
Object
();
static
{
CACHED_USERS
=
new
HashMap
<>();
}
public
static
UserDto
getCachedUser
(
String
name
)
{
String
userName
=
name
.
toLowerCase
();
synchronized
(
_locker
)
{
if
(!
CACHED_USERS
.
containsKey
(
userName
))
{
UserDto
dto
=
new
UserDto
();
//TODO:should fixed to load from db (neo)
dto
.
setUserName
(
"cach_test"
);
dto
.
setID
(
"1"
);
CACHED_USERS
.
put
(
userName
,
dto
);
}
return
CACHED_USERS
.
get
(
userName
);
}
}
}
package
pwc
.
taxtech
.
atms
;
import
pwc.taxtech.atms.dto.user.UserDto
;
import
pwc.taxtech.atms.service.OperationLogService
;
import
java.util.HashMap
;
import
java.util.Map
;
public
class
AppCachePool
{
private
static
Map
<
String
,
UserDto
>
CACHED_USERS
=
null
;
private
static
Object
_locker
=
new
Object
();
static
{
CACHED_USERS
=
new
HashMap
<>();
}
public
static
UserDto
getCachedUser
(
String
name
)
{
String
userName
=
name
.
toLowerCase
();
synchronized
(
_locker
)
{
if
(!
CACHED_USERS
.
containsKey
(
userName
))
{
UserDto
dto
=
new
UserDto
();
//TODO:should fixed to load from db (neo)
dto
.
setUserName
(
"cach_test"
);
dto
.
setID
(
"1"
);
CACHED_USERS
.
put
(
userName
,
dto
);
}
return
CACHED_USERS
.
get
(
userName
);
}
}
}
atms-api/src/main/java/pwc/taxtech/atms/constant/enums/EnumInputInvoiceEntityType.java
View file @
cfb73cd2
package
pwc
.
taxtech
.
atms
.
constant
.
enums
;
public
enum
EnumInputInvoiceEntityType
{
InvoicePaperTicket
(
1
,
"纸票"
),
InvoiceElectronicTicket
(
2
,
"电子票"
),
InvoiceUnKnown
(
99
,
"未知"
);
private
int
code
;
private
String
name
;
public
int
getCode
()
{
return
code
;
}
public
String
getName
()
{
return
name
;
}
EnumInputInvoiceEntityType
(
int
code
,
String
name
)
{
this
.
code
=
code
;
this
.
name
=
name
;
}
}
package
pwc
.
taxtech
.
atms
.
constant
.
enums
;
public
enum
EnumInputInvoiceEntityType
{
InvoicePaperTicket
(
1
,
"纸票"
),
InvoiceElectronicTicket
(
2
,
"电子票"
),
InvoiceUnKnown
(
99
,
"未知"
);
private
int
code
;
private
String
name
;
public
int
getCode
()
{
return
code
;
}
public
String
getName
()
{
return
name
;
}
EnumInputInvoiceEntityType
(
int
code
,
String
name
)
{
this
.
code
=
code
;
this
.
name
=
name
;
}
}
atms-api/src/main/java/pwc/taxtech/atms/constant/enums/EnumInputInvoiceRefundReason.java
View file @
cfb73cd2
package
pwc
.
taxtech
.
atms
.
constant
.
enums
;
/**退票原因
*
* @author Ken Q You
*
*/
public
enum
EnumInputInvoiceRefundReason
{
FakeInvoice
(
1
),
InvoicePackage
(
2
),
InvoiceStampIncorrect
(
3
),
OtherReason
(
4
);
private
Integer
code
;
public
Integer
getCode
()
{
return
code
;
}
EnumInputInvoiceRefundReason
(
Integer
code
)
{
this
.
code
=
code
;
}
}
package
pwc
.
taxtech
.
atms
.
constant
.
enums
;
/**退票原因
*
* @author Ken Q You
*
*/
public
enum
EnumInputInvoiceRefundReason
{
FakeInvoice
(
1
),
InvoicePackage
(
2
),
InvoiceStampIncorrect
(
3
),
OtherReason
(
4
);
private
Integer
code
;
public
Integer
getCode
()
{
return
code
;
}
EnumInputInvoiceRefundReason
(
Integer
code
)
{
this
.
code
=
code
;
}
}
atms-api/src/main/java/pwc/taxtech/atms/constant/enums/EnumInputInvoiceSourceType.java
View file @
cfb73cd2
package
pwc
.
taxtech
.
atms
.
constant
.
enums
;
public
enum
EnumInputInvoiceSourceType
{
InvoiceRawMaterialPurchase
(
1
,
"原料采购"
),
InvoiceNonRawMaterialPurchase
(
2
,
"非原料集中采购"
),
InvoiceClaim
(
3
,
"报销"
),
InvoiceStampIncorrect
(
4
,
"发票章错误"
),
InvoiceUnKnown
(
99
,
"未知"
);
private
int
code
;
private
String
name
;
public
int
getCode
()
{
return
code
;
}
public
String
getName
()
{
return
name
;
}
EnumInputInvoiceSourceType
(
int
code
,
String
name
)
{
this
.
code
=
code
;
this
.
name
=
name
;
}
}
package
pwc
.
taxtech
.
atms
.
constant
.
enums
;
public
enum
EnumInputInvoiceSourceType
{
InvoiceRawMaterialPurchase
(
1
,
"原料采购"
),
InvoiceNonRawMaterialPurchase
(
2
,
"非原料集中采购"
),
InvoiceClaim
(
3
,
"报销"
),
InvoiceStampIncorrect
(
4
,
"发票章错误"
),
InvoiceUnKnown
(
99
,
"未知"
);
private
int
code
;
private
String
name
;
public
int
getCode
()
{
return
code
;
}
public
String
getName
()
{
return
name
;
}
EnumInputInvoiceSourceType
(
int
code
,
String
name
)
{
this
.
code
=
code
;
this
.
name
=
name
;
}
}
atms-api/src/main/java/pwc/taxtech/atms/constant/enums/EnumInputInvoiceStatusType.java
View file @
cfb73cd2
package
pwc
.
taxtech
.
atms
.
constant
.
enums
;
public
enum
EnumInputInvoiceStatusType
{
InvoiceHasUpload
(
1
,
"已上传"
),
InvoiceUnrecognize
(
3
,
"无法识别"
),
InvoiceHasRefund
(
4
,
"已退票"
),
InvoiceVerifyFailure
(
6
,
"验真失败"
),
InvoicePendingMatc
(
7
,
"待匹配"
),
InvoiceHasMatch
(
8
,
"已匹配"
),
InvoicePendingVerify
(
9
,
"待认证"
),
InvoiceHasVerify
(
10
,
"已认证"
),
InvoiceUnableVerify
(
11
,
"无法认证"
),
InvoiceHasClean
(
13
,
"已清理"
),
InvoiceHasExpired
(
14
,
"已失效"
),
InvoicePendingRefund
(
16
,
"待退票"
),
InvoiceDuplicate
(
18
,
"已重复"
),
InvoiceRecognizeInProgress
(
100
,
"正在识别"
);
private
int
code
;
private
String
name
;
public
int
getCode
()
{
return
code
;
}
public
String
getName
()
{
return
name
;
}
EnumInputInvoiceStatusType
(
int
code
,
String
name
)
{
this
.
code
=
code
;
this
.
name
=
name
;
}
}
package
pwc
.
taxtech
.
atms
.
constant
.
enums
;
public
enum
EnumInputInvoiceStatusType
{
InvoiceHasUpload
(
1
,
"已上传"
),
InvoiceUnrecognize
(
3
,
"无法识别"
),
InvoiceHasRefund
(
4
,
"已退票"
),
InvoiceVerifyFailure
(
6
,
"验真失败"
),
InvoicePendingMatc
(
7
,
"待匹配"
),
InvoiceHasMatch
(
8
,
"已匹配"
),
InvoicePendingVerify
(
9
,
"待认证"
),
InvoiceHasVerify
(
10
,
"已认证"
),
InvoiceUnableVerify
(
11
,
"无法认证"
),
InvoiceHasClean
(
13
,
"已清理"
),
InvoiceHasExpired
(
14
,
"已失效"
),
InvoicePendingRefund
(
16
,
"待退票"
),
InvoiceDuplicate
(
18
,
"已重复"
),
InvoiceRecognizeInProgress
(
100
,
"正在识别"
);
private
int
code
;
private
String
name
;
public
int
getCode
()
{
return
code
;
}
public
String
getName
()
{
return
name
;
}
EnumInputInvoiceStatusType
(
int
code
,
String
name
)
{
this
.
code
=
code
;
this
.
name
=
name
;
}
}
atms-api/src/main/java/pwc/taxtech/atms/constant/enums/EnumInputInvoiceType.java
View file @
cfb73cd2
package
pwc
.
taxtech
.
atms
.
constant
.
enums
;
public
enum
EnumInputInvoiceType
{
VatInvoiceSpecialTicket
(
1
,
"增值税专用发票"
),
VatInvoiceOrdinaryTicketl
(
2
,
"增值税普通发票"
);
private
int
code
;
private
String
name
;
public
int
getCode
()
{
return
code
;
}
public
String
getName
()
{
return
name
;
}
private
EnumInputInvoiceType
(
int
code
,
String
name
)
{
this
.
code
=
code
;
this
.
name
=
name
;
}
}
package
pwc
.
taxtech
.
atms
.
constant
.
enums
;
public
enum
EnumInputInvoiceType
{
VatInvoiceSpecialTicket
(
1
,
"增值税专用发票"
),
VatInvoiceOrdinaryTicketl
(
2
,
"增值税普通发票"
);
private
int
code
;
private
String
name
;
public
int
getCode
()
{
return
code
;
}
public
String
getName
()
{
return
name
;
}
private
EnumInputInvoiceType
(
int
code
,
String
name
)
{
this
.
code
=
code
;
this
.
name
=
name
;
}
}
atms-api/src/main/java/pwc/taxtech/atms/constant/enums/EnumInputInvoiceUploadType.java
View file @
cfb73cd2
package
pwc
.
taxtech
.
atms
.
constant
.
enums
;
public
enum
EnumInputInvoiceUploadType
{
InvoiceModePDF
(
1
,
"PDF上传"
),
InvoiceModeScan
(
2
,
"扫描上传"
),
InvoiceModeMobileDevice
(
3
,
"扫描枪上传"
),
InvoiceFromAPI
(
4
,
"未认证发票来自接口"
);
private
int
code
;
private
String
name
;
public
int
getCode
()
{
return
code
;
}
public
String
getName
()
{
return
name
;
}
EnumInputInvoiceUploadType
(
int
code
,
String
name
)
{
this
.
code
=
code
;
this
.
name
=
name
;
}
}
package
pwc
.
taxtech
.
atms
.
constant
.
enums
;
public
enum
EnumInputInvoiceUploadType
{
InvoiceModePDF
(
1
,
"PDF上传"
),
InvoiceModeScan
(
2
,
"扫描上传"
),
InvoiceModeMobileDevice
(
3
,
"扫描枪上传"
),
InvoiceFromAPI
(
4
,
"未认证发票来自接口"
);
private
int
code
;
private
String
name
;
public
int
getCode
()
{
return
code
;
}
public
String
getName
()
{
return
name
;
}
EnumInputInvoiceUploadType
(
int
code
,
String
name
)
{
this
.
code
=
code
;
this
.
name
=
name
;
}
}
atms-api/src/main/java/pwc/taxtech/atms/constant/enums/EnumIsIncludedInTaxAmountType.java
View file @
cfb73cd2
package
pwc
.
taxtech
.
atms
.
constant
.
enums
;
import
org.joda.time.Years
;
/**
* 是否计入进项税额
* @author Ken Q You
*
*/
public
enum
EnumIsIncludedInTaxAmountType
{
Year
(
1
,
"是"
),
No
(
2
,
"否"
),
NotRecognized
(
3
,
"未识别"
),
Partial
(
4
,
"部分计入进项税额"
);
private
int
code
;
private
String
name
;
public
int
getCode
()
{
return
code
;
}
public
String
getName
()
{
return
name
;
}
EnumIsIncludedInTaxAmountType
(
int
code
,
String
name
)
{
this
.
code
=
code
;
this
.
name
=
name
;
}
}
package
pwc
.
taxtech
.
atms
.
constant
.
enums
;
import
org.joda.time.Years
;
/**
* 是否计入进项税额
* @author Ken Q You
*
*/
public
enum
EnumIsIncludedInTaxAmountType
{
Year
(
1
,
"是"
),
No
(
2
,
"否"
),
NotRecognized
(
3
,
"未识别"
),
Partial
(
4
,
"部分计入进项税额"
);
private
int
code
;
private
String
name
;
public
int
getCode
()
{
return
code
;
}
public
String
getName
()
{
return
name
;
}
EnumIsIncludedInTaxAmountType
(
int
code
,
String
name
)
{
this
.
code
=
code
;
this
.
name
=
name
;
}
}
atms-api/src/main/java/pwc/taxtech/atms/constant/enums/EnumProductionServiceType.java
View file @
cfb73cd2
package
pwc
.
taxtech
.
atms
.
constant
.
enums
;
/**
* 服务类型
* @author Ken Q You
*
*/
public
enum
EnumProductionServiceType
{
AcquireIntangibleAssets
(
1
,
"取得无形资产"
),
TheRightToUseTheLand
(
2
,
"受让土地使用权"
),
TransportService
(
3
,
"运输服务"
),
TelecommunicationsService
(
4
,
"电信服务"
),
PhysicalAndCommercialLeasing
(
5
,
"有形动产租赁"
),
ImmovablePropertyLeasing
(
6
,
"不动产租赁"
),
BuildingInstallationService
(
7
,
"建筑安装服务"
),
FinancialInsuranceService
(
8
,
"金融保险服务"
),
ServiceForLife
(
9
,
"生活服务"
);
private
int
code
;
private
String
name
;
public
int
getCode
()
{
return
code
;
}
public
String
getName
()
{
return
name
;
}
EnumProductionServiceType
(
int
code
,
String
name
)
{
this
.
code
=
code
;
this
.
name
=
name
;
}
}
package
pwc
.
taxtech
.
atms
.
constant
.
enums
;
/**
* 服务类型
* @author Ken Q You
*
*/
public
enum
EnumProductionServiceType
{
AcquireIntangibleAssets
(
1
,
"取得无形资产"
),
TheRightToUseTheLand
(
2
,
"受让土地使用权"
),
TransportService
(
3
,
"运输服务"
),
TelecommunicationsService
(
4
,
"电信服务"
),
PhysicalAndCommercialLeasing
(
5
,
"有形动产租赁"
),
ImmovablePropertyLeasing
(
6
,
"不动产租赁"
),
BuildingInstallationService
(
7
,
"建筑安装服务"
),
FinancialInsuranceService
(
8
,
"金融保险服务"
),
ServiceForLife
(
9
,
"生活服务"
);
private
int
code
;
private
String
name
;
public
int
getCode
()
{
return
code
;
}
public
String
getName
()
{
return
name
;
}
EnumProductionServiceType
(
int
code
,
String
name
)
{
this
.
code
=
code
;
this
.
name
=
name
;
}
}
atms-api/src/main/java/pwc/taxtech/atms/constant/enums/EnumProductionType.java
View file @
cfb73cd2
package
pwc
.
taxtech
.
atms
.
constant
.
enums
;
/**
* 商品类型
* @author Ken Q You
*
*/
public
enum
EnumProductionType
{
RawMaterialForProduce
(
1
,
"用于生产的原材料"
),
RawMaterialForSale
(
2
,
"用于直接销售的原材料"
),
FixedAssetsMovable
(
3
,
"固定资产-动产"
),
FixedAssetsNonmoveable
(
4
,
"固定资产-不动产"
),
EmployeeBenefit
(
5
,
"员工福利"
),
PromotionalProducts
(
6
,
"促销品"
),
TaxControlSystemEquipmentAndMaintenanceCosts
(
7
,
"税控系统设备及维护费用"
),
Service
(
8
,
"服务"
),
GoodsAndProcessingRepairAndRepairServices
(
9
,
"货物及加工修理修配劳务"
),
Other
(
10
,
"其他"
);
private
int
code
;
private
String
name
;
public
int
getCode
()
{
return
code
;
}
public
String
getName
()
{
return
name
;
}
EnumProductionType
(
int
code
,
String
name
)
{
this
.
code
=
code
;
this
.
name
=
name
;
}
}
package
pwc
.
taxtech
.
atms
.
constant
.
enums
;
/**
* 商品类型
* @author Ken Q You
*
*/
public
enum
EnumProductionType
{
RawMaterialForProduce
(
1
,
"用于生产的原材料"
),
RawMaterialForSale
(
2
,
"用于直接销售的原材料"
),
FixedAssetsMovable
(
3
,
"固定资产-动产"
),
FixedAssetsNonmoveable
(
4
,
"固定资产-不动产"
),
EmployeeBenefit
(
5
,
"员工福利"
),
PromotionalProducts
(
6
,
"促销品"
),
TaxControlSystemEquipmentAndMaintenanceCosts
(
7
,
"税控系统设备及维护费用"
),
Service
(
8
,
"服务"
),
GoodsAndProcessingRepairAndRepairServices
(
9
,
"货物及加工修理修配劳务"
),
Other
(
10
,
"其他"
);
private
int
code
;
private
String
name
;
public
int
getCode
()
{
return
code
;
}
public
String
getName
()
{
return
name
;
}
EnumProductionType
(
int
code
,
String
name
)
{
this
.
code
=
code
;
this
.
name
=
name
;
}
}
atms-api/src/main/java/pwc/taxtech/atms/controller/InputInvoiceImportController.java
View file @
cfb73cd2
package
pwc
.
taxtech
.
atms
.
controller
;
import
org.apache.http.HttpStatus
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.MediaType
;
import
org.springframework.web.bind.annotation.*
;
import
pwc.taxtech.atms.dto.PagingResultDto
;
import
pwc.taxtech.atms.dto.vatdto.*
;
import
pwc.taxtech.atms.thirdparty.ExcelSheet
;
import
pwc.taxtech.atms.thirdparty.ExcelUtil
;
import
pwc.taxtech.atms.vat.service.InputInvoiceDataImportService
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.IOException
;
import
java.io.OutputStream
;
import
java.util.*
;
@RestController
@RequestMapping
(
value
=
"api/v1/inputInvoiceImport"
)
public
class
InputInvoiceImportController
{
@Autowired
InputInvoiceDataImportService
inputInvoiceDataImportService
;
@RequestMapping
(
value
=
"inputInvoicePreviewList"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
@ResponseBody
PagingResultDto
<
InputVATInvoiceDto
>
getInputInvoiceTreeViewData
(
@RequestBody
InputInvoicePreviewQueryParam
paras
)
{
return
inputInvoiceDataImportService
.
getInputInvoiceTreeViewData
(
paras
);
}
@RequestMapping
(
value
=
"exportQueryData/get"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
void
downloadInvoiceQueryData
(
@RequestBody
InputInvoicePreviewQueryParam
paras
,
HttpServletResponse
response
)
{
response
.
setContentType
(
"application/vnd.ms-excel;charset=utf-8"
);
response
.
setHeader
(
"Content-Disposition"
,
"attachment;filename="
+
UUID
.
randomUUID
()
+
".xlsx"
);
response
.
setHeader
(
"x-file-name"
,
UUID
.
randomUUID
()
+
".xlsx"
);
OutputStream
os
=
null
;
try
{
os
=
response
.
getOutputStream
();
int
count
=
getDownloadFilePath
(
paras
,
os
);
if
(
count
==
0
)
{
response
.
setStatus
(
HttpStatus
.
SC_NO_CONTENT
);
}
else
{
response
.
setStatus
(
HttpStatus
.
SC_OK
);
}
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
private
int
getDownloadFilePath
(
InputInvoicePreviewQueryParam
paras
,
OutputStream
outputStream
)
{
List
<
InputVATInvoiceDto
>
list
=
inputInvoiceDataImportService
.
getInputInvoiceTreeViewData
(
paras
).
getList
();
if
(
list
.
size
()
==
0
)
{
//return 0;
}
Map
<
String
,
String
>
header
=
new
HashMap
<>();
header
.
put
(
"PeriodID"
,
"期间"
);
header
.
put
(
"InvoiceDate"
,
"开票日期"
);
header
.
put
(
"InvoiceCode"
,
"发票代码"
);
header
.
put
(
"InvoiceNumber"
,
"发票号码"
);
header
.
put
(
"SellerTaxNumber"
,
"供货方税号"
);
header
.
put
(
"InvoiceTypeName"
,
"发票类型"
);
header
.
put
(
"Amount"
,
"金额"
);
header
.
put
(
"TaxAmount"
,
"税额"
);
header
.
put
(
"CertificationDate"
,
"认证日期"
);
ExcelSheet
excelSheetA
=
new
ExcelSheet
<>();
excelSheetA
.
setHeaders
(
header
);
excelSheetA
.
setDataset
(
list
);
excelSheetA
.
setSheetName
(
"sheetA"
);
Map
<
String
,
String
>
header2
=
new
HashMap
<>();
header2
.
put
(
"PeriodID"
,
"期间"
);
header2
.
put
(
"InvoiceCode"
,
"发票代码"
);
header2
.
put
(
"InvoiceNumber"
,
"发票号码"
);
header2
.
put
(
"Amount"
,
"金额"
);
header2
.
put
(
"TaxAmount"
,
"税额"
);
header2
.
put
(
"TaxRate"
,
"税率"
);
header2
.
put
(
"ProductionName"
,
"货物名称"
);
ExcelSheet
excelSheetB
=
new
ExcelSheet
<>();
excelSheetB
.
setHeaders
(
header2
);
excelSheetB
.
setSheetName
(
"sheetB"
);
List
<
InputVATInvoiceItemDto
>
inputInvoiceItemList
=
new
ArrayList
<>();
for
(
InputVATInvoiceDto
item
:
list
)
{
List
<
InputVATInvoiceItemDto
>
tempResult
=
inputInvoiceDataImportService
.
getInputInvoiceItemTreeViewData
(
item
.
getID
());
for
(
InputVATInvoiceItemDto
r
:
tempResult
)
{
inputInvoiceItemList
.
add
(
r
);
}
}
excelSheetB
.
setDataset
(
inputInvoiceItemList
);
List
<
ExcelSheet
<
InputVATInvoiceBaseDto
>>
sheets
=
new
ArrayList
<>();
sheets
.
add
(
excelSheetA
);
sheets
.
add
(
excelSheetB
);
ExcelUtil
.
exportExcel
(
sheets
,
outputStream
);
return
list
.
size
();
}
}
package
pwc
.
taxtech
.
atms
.
controller
;
import
org.apache.http.HttpStatus
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.MediaType
;
import
org.springframework.web.bind.annotation.*
;
import
pwc.taxtech.atms.dto.PagingResultDto
;
import
pwc.taxtech.atms.dto.vatdto.*
;
import
pwc.taxtech.atms.thirdparty.ExcelSheet
;
import
pwc.taxtech.atms.thirdparty.ExcelUtil
;
import
pwc.taxtech.atms.vat.service.InputInvoiceDataImportService
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.IOException
;
import
java.io.OutputStream
;
import
java.util.*
;
@RestController
@RequestMapping
(
value
=
"api/v1/inputInvoiceImport"
)
public
class
InputInvoiceImportController
{
@Autowired
InputInvoiceDataImportService
inputInvoiceDataImportService
;
@RequestMapping
(
value
=
"inputInvoicePreviewList"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
@ResponseBody
PagingResultDto
<
InputVATInvoiceDto
>
getInputInvoiceTreeViewData
(
@RequestBody
InputInvoicePreviewQueryParam
paras
)
{
return
inputInvoiceDataImportService
.
getInputInvoiceTreeViewData
(
paras
);
}
@RequestMapping
(
value
=
"exportQueryData/get"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
void
downloadInvoiceQueryData
(
@RequestBody
InputInvoicePreviewQueryParam
paras
,
HttpServletResponse
response
)
{
response
.
setContentType
(
"application/vnd.ms-excel;charset=utf-8"
);
response
.
setHeader
(
"Content-Disposition"
,
"attachment;filename="
+
UUID
.
randomUUID
()
+
".xlsx"
);
response
.
setHeader
(
"x-file-name"
,
UUID
.
randomUUID
()
+
".xlsx"
);
OutputStream
os
=
null
;
try
{
os
=
response
.
getOutputStream
();
int
count
=
getDownloadFilePath
(
paras
,
os
);
if
(
count
==
0
)
{
response
.
setStatus
(
HttpStatus
.
SC_NO_CONTENT
);
}
else
{
response
.
setStatus
(
HttpStatus
.
SC_OK
);
}
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
private
int
getDownloadFilePath
(
InputInvoicePreviewQueryParam
paras
,
OutputStream
outputStream
)
{
List
<
InputVATInvoiceDto
>
list
=
inputInvoiceDataImportService
.
getInputInvoiceTreeViewData
(
paras
).
getList
();
if
(
list
.
size
()
==
0
)
{
//return 0;
}
Map
<
String
,
String
>
header
=
new
HashMap
<>();
header
.
put
(
"PeriodID"
,
"期间"
);
header
.
put
(
"InvoiceDate"
,
"开票日期"
);
header
.
put
(
"InvoiceCode"
,
"发票代码"
);
header
.
put
(
"InvoiceNumber"
,
"发票号码"
);
header
.
put
(
"SellerTaxNumber"
,
"供货方税号"
);
header
.
put
(
"InvoiceTypeName"
,
"发票类型"
);
header
.
put
(
"Amount"
,
"金额"
);
header
.
put
(
"TaxAmount"
,
"税额"
);
header
.
put
(
"CertificationDate"
,
"认证日期"
);
ExcelSheet
excelSheetA
=
new
ExcelSheet
<>();
excelSheetA
.
setHeaders
(
header
);
excelSheetA
.
setDataset
(
list
);
excelSheetA
.
setSheetName
(
"sheetA"
);
Map
<
String
,
String
>
header2
=
new
HashMap
<>();
header2
.
put
(
"PeriodID"
,
"期间"
);
header2
.
put
(
"InvoiceCode"
,
"发票代码"
);
header2
.
put
(
"InvoiceNumber"
,
"发票号码"
);
header2
.
put
(
"Amount"
,
"金额"
);
header2
.
put
(
"TaxAmount"
,
"税额"
);
header2
.
put
(
"TaxRate"
,
"税率"
);
header2
.
put
(
"ProductionName"
,
"货物名称"
);
ExcelSheet
excelSheetB
=
new
ExcelSheet
<>();
excelSheetB
.
setHeaders
(
header2
);
excelSheetB
.
setSheetName
(
"sheetB"
);
List
<
InputVATInvoiceItemDto
>
inputInvoiceItemList
=
new
ArrayList
<>();
for
(
InputVATInvoiceDto
item
:
list
)
{
List
<
InputVATInvoiceItemDto
>
tempResult
=
inputInvoiceDataImportService
.
getInputInvoiceItemTreeViewData
(
item
.
getID
());
for
(
InputVATInvoiceItemDto
r
:
tempResult
)
{
inputInvoiceItemList
.
add
(
r
);
}
}
excelSheetB
.
setDataset
(
inputInvoiceItemList
);
List
<
ExcelSheet
<
InputVATInvoiceBaseDto
>>
sheets
=
new
ArrayList
<>();
sheets
.
add
(
excelSheetA
);
sheets
.
add
(
excelSheetB
);
ExcelUtil
.
exportExcel
(
sheets
,
outputStream
);
return
list
.
size
();
}
}
atms-api/src/main/java/pwc/taxtech/atms/dto/input/InvoiceDictionaryDto.java
View file @
cfb73cd2
package
pwc
.
taxtech
.
atms
.
dto
.
input
;
public
class
InvoiceDictionaryDto
{
private
Integer
id
;
private
String
value
;
public
Integer
getId
()
{
return
id
;
}
public
void
setId
(
Integer
id
)
{
this
.
id
=
id
;
}
public
String
getValue
()
{
return
value
;
}
public
void
setValue
(
String
value
)
{
this
.
value
=
value
;
}
}
package
pwc
.
taxtech
.
atms
.
dto
.
input
;
public
class
InvoiceDictionaryDto
{
private
Integer
id
;
private
String
value
;
public
Integer
getId
()
{
return
id
;
}
public
void
setId
(
Integer
id
)
{
this
.
id
=
id
;
}
public
String
getValue
()
{
return
value
;
}
public
void
setValue
(
String
value
)
{
this
.
value
=
value
;
}
}
atms-api/src/main/java/pwc/taxtech/atms/dto/input/InvoiceFilterDto.java
View file @
cfb73cd2
package
pwc
.
taxtech
.
atms
.
dto
.
input
;
import
java.util.List
;
import
pwc.taxtech.atms.entitiy.User
;
public
class
InvoiceFilterDto
{
private
List
<
InvoiceDictionaryDto
>
invoiceStatusList
;
private
List
<
InvoiceDictionaryDto
>
invoiceEntityList
;
private
List
<
InvoiceDictionaryDto
>
invoiceTypeList
;
private
List
<
InvoiceDictionaryDto
>
invoiceSourceList
;
private
List
<
InvoiceDictionaryDto
>
invoiceUploadTypeList
;
private
List
<
InvoiceDictionaryDto
>
invoiceRefundReasonList
;
private
List
<
InvoiceDictionaryDto
>
invoiceProductionTypeList
;
private
List
<
InvoiceDictionaryDto
>
invoiceServiceTypeList
;
private
List
<
InvoiceDictionaryDto
>
isIncludedInTaxAmountTypeList
;
private
List
<
User
>
allUserList
;
public
List
<
InvoiceDictionaryDto
>
getInvoiceStatusList
()
{
return
invoiceStatusList
;
}
public
void
setInvoiceStatusList
(
List
<
InvoiceDictionaryDto
>
invoiceStatusList
)
{
this
.
invoiceStatusList
=
invoiceStatusList
;
}
public
List
<
InvoiceDictionaryDto
>
getInvoiceEntityList
()
{
return
invoiceEntityList
;
}
public
void
setInvoiceEntityList
(
List
<
InvoiceDictionaryDto
>
invoiceEntityList
)
{
this
.
invoiceEntityList
=
invoiceEntityList
;
}
public
List
<
InvoiceDictionaryDto
>
getInvoiceTypeList
()
{
return
invoiceTypeList
;
}
public
void
setInvoiceTypeList
(
List
<
InvoiceDictionaryDto
>
invoiceTypeList
)
{
this
.
invoiceTypeList
=
invoiceTypeList
;
}
public
List
<
InvoiceDictionaryDto
>
getInvoiceSourceList
()
{
return
invoiceSourceList
;
}
public
void
setInvoiceSourceList
(
List
<
InvoiceDictionaryDto
>
invoiceSourceList
)
{
this
.
invoiceSourceList
=
invoiceSourceList
;
}
public
List
<
InvoiceDictionaryDto
>
getInvoiceUploadTypeList
()
{
return
invoiceUploadTypeList
;
}
public
void
setInvoiceUploadTypeList
(
List
<
InvoiceDictionaryDto
>
invoiceUploadTypeList
)
{
this
.
invoiceUploadTypeList
=
invoiceUploadTypeList
;
}
public
List
<
InvoiceDictionaryDto
>
getInvoiceRefundReasonList
()
{
return
invoiceRefundReasonList
;
}
public
void
setInvoiceRefundReasonList
(
List
<
InvoiceDictionaryDto
>
invoiceRefundReasonList
)
{
this
.
invoiceRefundReasonList
=
invoiceRefundReasonList
;
}
public
List
<
InvoiceDictionaryDto
>
getInvoiceProductionTypeList
()
{
return
invoiceProductionTypeList
;
}
public
void
setInvoiceProductionTypeList
(
List
<
InvoiceDictionaryDto
>
invoiceProductionTypeList
)
{
this
.
invoiceProductionTypeList
=
invoiceProductionTypeList
;
}
public
List
<
InvoiceDictionaryDto
>
getInvoiceServiceTypeList
()
{
return
invoiceServiceTypeList
;
}
public
void
setInvoiceServiceTypeList
(
List
<
InvoiceDictionaryDto
>
invoiceServiceTypeList
)
{
this
.
invoiceServiceTypeList
=
invoiceServiceTypeList
;
}
public
List
<
InvoiceDictionaryDto
>
getIsIncludedInTaxAmountTypeList
()
{
return
isIncludedInTaxAmountTypeList
;
}
public
void
setIsIncludedInTaxAmountTypeList
(
List
<
InvoiceDictionaryDto
>
isIncludedInTaxAmountTypeList
)
{
this
.
isIncludedInTaxAmountTypeList
=
isIncludedInTaxAmountTypeList
;
}
public
List
<
User
>
getAllUserList
()
{
return
allUserList
;
}
public
void
setAllUserList
(
List
<
User
>
allUserList
)
{
this
.
allUserList
=
allUserList
;
}
}
package
pwc
.
taxtech
.
atms
.
dto
.
input
;
import
java.util.List
;
import
pwc.taxtech.atms.entitiy.User
;
public
class
InvoiceFilterDto
{
private
List
<
InvoiceDictionaryDto
>
invoiceStatusList
;
private
List
<
InvoiceDictionaryDto
>
invoiceEntityList
;
private
List
<
InvoiceDictionaryDto
>
invoiceTypeList
;
private
List
<
InvoiceDictionaryDto
>
invoiceSourceList
;
private
List
<
InvoiceDictionaryDto
>
invoiceUploadTypeList
;
private
List
<
InvoiceDictionaryDto
>
invoiceRefundReasonList
;
private
List
<
InvoiceDictionaryDto
>
invoiceProductionTypeList
;
private
List
<
InvoiceDictionaryDto
>
invoiceServiceTypeList
;
private
List
<
InvoiceDictionaryDto
>
isIncludedInTaxAmountTypeList
;
private
List
<
User
>
allUserList
;
public
List
<
InvoiceDictionaryDto
>
getInvoiceStatusList
()
{
return
invoiceStatusList
;
}
public
void
setInvoiceStatusList
(
List
<
InvoiceDictionaryDto
>
invoiceStatusList
)
{
this
.
invoiceStatusList
=
invoiceStatusList
;
}
public
List
<
InvoiceDictionaryDto
>
getInvoiceEntityList
()
{
return
invoiceEntityList
;
}
public
void
setInvoiceEntityList
(
List
<
InvoiceDictionaryDto
>
invoiceEntityList
)
{
this
.
invoiceEntityList
=
invoiceEntityList
;
}
public
List
<
InvoiceDictionaryDto
>
getInvoiceTypeList
()
{
return
invoiceTypeList
;
}
public
void
setInvoiceTypeList
(
List
<
InvoiceDictionaryDto
>
invoiceTypeList
)
{
this
.
invoiceTypeList
=
invoiceTypeList
;
}
public
List
<
InvoiceDictionaryDto
>
getInvoiceSourceList
()
{
return
invoiceSourceList
;
}
public
void
setInvoiceSourceList
(
List
<
InvoiceDictionaryDto
>
invoiceSourceList
)
{
this
.
invoiceSourceList
=
invoiceSourceList
;
}
public
List
<
InvoiceDictionaryDto
>
getInvoiceUploadTypeList
()
{
return
invoiceUploadTypeList
;
}
public
void
setInvoiceUploadTypeList
(
List
<
InvoiceDictionaryDto
>
invoiceUploadTypeList
)
{
this
.
invoiceUploadTypeList
=
invoiceUploadTypeList
;
}
public
List
<
InvoiceDictionaryDto
>
getInvoiceRefundReasonList
()
{
return
invoiceRefundReasonList
;
}
public
void
setInvoiceRefundReasonList
(
List
<
InvoiceDictionaryDto
>
invoiceRefundReasonList
)
{
this
.
invoiceRefundReasonList
=
invoiceRefundReasonList
;
}
public
List
<
InvoiceDictionaryDto
>
getInvoiceProductionTypeList
()
{
return
invoiceProductionTypeList
;
}
public
void
setInvoiceProductionTypeList
(
List
<
InvoiceDictionaryDto
>
invoiceProductionTypeList
)
{
this
.
invoiceProductionTypeList
=
invoiceProductionTypeList
;
}
public
List
<
InvoiceDictionaryDto
>
getInvoiceServiceTypeList
()
{
return
invoiceServiceTypeList
;
}
public
void
setInvoiceServiceTypeList
(
List
<
InvoiceDictionaryDto
>
invoiceServiceTypeList
)
{
this
.
invoiceServiceTypeList
=
invoiceServiceTypeList
;
}
public
List
<
InvoiceDictionaryDto
>
getIsIncludedInTaxAmountTypeList
()
{
return
isIncludedInTaxAmountTypeList
;
}
public
void
setIsIncludedInTaxAmountTypeList
(
List
<
InvoiceDictionaryDto
>
isIncludedInTaxAmountTypeList
)
{
this
.
isIncludedInTaxAmountTypeList
=
isIncludedInTaxAmountTypeList
;
}
public
List
<
User
>
getAllUserList
()
{
return
allUserList
;
}
public
void
setAllUserList
(
List
<
User
>
allUserList
)
{
this
.
allUserList
=
allUserList
;
}
}
\ No newline at end of file
atms-api/src/main/resources/sqlMapConfig.xml
View file @
cfb73cd2
<!DOCTYPE configuration
PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
<!-- 全局setting配置,根据需要添加 -->
<settings>
<setting
name=
"logImpl"
value=
"LOG4J"
/>
</settings>
<!-- 配置别名 -->
<typeAliases>
<package
name=
"pwc.taxtech.atms.entitiy"
/>
</typeAliases>
<!-- 插件 -->
<plugins>
<plugin
interceptor=
"com.github.pagehelper.PageInterceptor"
>
<!-- 4.0.0以后版本可以不设置该参数 -->
<property
name=
"diaect"
value=
"mysql"
/>
<!--
该参数默认为false
设置为true时,会将RowBounds第一个参数offset当成pageNum页码使用
和startPage中的pageNum效果一样
-->
<property
name=
"offsetAsPageNum"
value=
"true"
/>
<!--
该参数默认为false
设置为true时,使用RowBounds分页会进行count查询
-->
<property
name=
"rowBoundsWithCount"
value=
"true"
/>
<!--
设置为true时,如果pageSize=0或者RowBounds.limit=0就会查询出全部的结果
(相当于没有执行分页查询,只是返回结果仍然是Page类型)
-->
<property
name=
"pageSizeZero"
value=
"true"
/>
<!--
3.3.0版本可用-分页参数合理化,默认false禁用
启用合理化时,如果pageNum<1会查询第一页,如果pageNum>pages会查询最后一页
禁用合理化时,如果pageNum<1或pages会返回空数据
-->
<property
name=
"reasonable"
value=
"true"
/>
<!--
3.5.0版本可用-为了支持startPage(Object params)方法
增加了一个'params'参数来配置参数映射,用于从Map或ServletRequest中取值
可以配置pageNum,pageSize,count,pageSizeZero,reasonable,orderBy,不配置映射的用默认值
不理解该含义的前提下,不要随便复制该配置
-->
<property
name=
"params"
value=
"pageNum=start;pageSize=limit;"
/>
<!-- 支持通过Mapper接口参数来传递分页参数 -->
<property
name=
"supportMethodsArguments"
value=
"true"
/>
<!-- always重视返回PageInfo类型,check检查返回类型是否为PageInfo,none返回Page -->
<property
name=
"returnPageInfo"
value=
"check"
/>
</plugin>
</plugins>
<!DOCTYPE configuration
PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
<!-- 全局setting配置,根据需要添加 -->
<settings>
<setting
name=
"logImpl"
value=
"LOG4J"
/>
</settings>
<!-- 配置别名 -->
<typeAliases>
<package
name=
"pwc.taxtech.atms.entitiy"
/>
</typeAliases>
<!-- 插件 -->
<plugins>
<plugin
interceptor=
"com.github.pagehelper.PageInterceptor"
>
<!-- 4.0.0以后版本可以不设置该参数 -->
<property
name=
"diaect"
value=
"mysql"
/>
<!--
该参数默认为false
设置为true时,会将RowBounds第一个参数offset当成pageNum页码使用
和startPage中的pageNum效果一样
-->
<property
name=
"offsetAsPageNum"
value=
"true"
/>
<!--
该参数默认为false
设置为true时,使用RowBounds分页会进行count查询
-->
<property
name=
"rowBoundsWithCount"
value=
"true"
/>
<!--
设置为true时,如果pageSize=0或者RowBounds.limit=0就会查询出全部的结果
(相当于没有执行分页查询,只是返回结果仍然是Page类型)
-->
<property
name=
"pageSizeZero"
value=
"true"
/>
<!--
3.3.0版本可用-分页参数合理化,默认false禁用
启用合理化时,如果pageNum<1会查询第一页,如果pageNum>pages会查询最后一页
禁用合理化时,如果pageNum<1或pages会返回空数据
-->
<property
name=
"reasonable"
value=
"true"
/>
<!--
3.5.0版本可用-为了支持startPage(Object params)方法
增加了一个'params'参数来配置参数映射,用于从Map或ServletRequest中取值
可以配置pageNum,pageSize,count,pageSizeZero,reasonable,orderBy,不配置映射的用默认值
不理解该含义的前提下,不要随便复制该配置
-->
<property
name=
"params"
value=
"pageNum=start;pageSize=limit;"
/>
<!-- 支持通过Mapper接口参数来传递分页参数 -->
<property
name=
"supportMethodsArguments"
value=
"true"
/>
<!-- always重视返回PageInfo类型,check检查返回类型是否为PageInfo,none返回Page -->
<property
name=
"returnPageInfo"
value=
"check"
/>
</plugin>
</plugins>
</configuration>
\ No newline at end of file
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