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
7baee921
Commit
7baee921
authored
Jun 20, 2018
by
neo.wang
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev_neo2' into 'dev'
Dev neo2 See merge request root/atms!28
parents
cebaf261
b9b317ba
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
235 additions
and
5 deletions
+235
-5
Constant.java
...api/src/main/java/pwc/taxtech/atms/constant/Constant.java
+6
-0
TbImportType.java
...in/java/pwc/taxtech/atms/constant/enums/TbImportType.java
+18
-0
JournalEntryImportController.java
...taxtech/atms/controller/JournalEntryImportController.java
+6
-0
ProjectInfoController.java
...va/pwc/taxtech/atms/controller/ProjectInfoController.java
+9
-0
TBDataImportController.java
...a/pwc/taxtech/atms/controller/TBDataImportController.java
+5
-1
ValidationInfoDto.java
...n/java/pwc/taxtech/atms/dto/vatdto/ValidationInfoDto.java
+115
-0
ProjectInfoService.java
...ain/java/pwc/taxtech/atms/service/ProjectInfoService.java
+2
-0
ProjectInfoServiceImpl.java
...pwc/taxtech/atms/service/impl/ProjectInfoServiceImpl.java
+28
-0
NPOIHelper.java
...-api/src/main/java/pwc/taxtech/atms/utils/NPOIHelper.java
+3
-0
JournalEntryImportService.java
...c/taxtech/atms/vat/service/JournalEntryImportService.java
+5
-0
JournalEntryImportServiceImpl.java
.../atms/vat/service/impl/JournalEntryImportServiceImpl.java
+38
-4
No files found.
atms-api/src/main/java/pwc/taxtech/atms/constant/Constant.java
View file @
7baee921
...
...
@@ -28,4 +28,9 @@ public final class Constant {
public
static
final
String
CURRENT_USER_UPLOAD_FOLDER
=
CURRENT_USER_HOME
+
File
.
separator
+
UPLOAD_FOLDER_NAME
;
public
static
final
boolean
DEFAULT_RESULT
=
true
;
public
static
final
int
FIRST_OR_DEFAULT
=
0
;
public
static
final
int
HEADER_ROW_INDEX
=
0
;
public
static
final
boolean
DEFAULT_HAS_HEADER
=
true
;
}
\ No newline at end of file
atms-api/src/main/java/pwc/taxtech/atms/constant/enums/TbImportType.java
0 → 100644
View file @
7baee921
package
pwc
.
taxtech
.
atms
.
constant
.
enums
;
public
enum
TbImportType
{
UnImported
(
0
),
TbImported
(
1
),
ErpImported
(
2
);
private
Integer
code
;
TbImportType
(
Integer
code
)
{
this
.
code
=
code
;
}
public
Integer
getCode
()
{
return
code
;
}
}
atms-api/src/main/java/pwc/taxtech/atms/controller/JournalEntryImportController.java
View file @
7baee921
...
...
@@ -23,5 +23,11 @@ public class JournalEntryImportController {
public
ResponseEntity
queryJournalEntryData
(
@RequestBody
QueryJeDto
queryJeDto
)
{
return
ResponseEntity
.
ok
(
journalEntryDataImportService
.
qeryJournalEntryData
(
queryJeDto
));
}
@ApiOperation
(
value
=
"getValidationInfo"
,
notes
=
""
)
@RequestMapping
(
value
=
"getValidationInfo/{type}/{period}"
,
method
=
RequestMethod
.
GET
)
public
ResponseEntity
getValidationInfo
(
@PathVariable
Integer
type
,
@PathVariable
Integer
period
)
{
return
ResponseEntity
.
ok
(
journalEntryDataImportService
.
getValidationInfoList
(
type
,
period
));
}
}
atms-api/src/main/java/pwc/taxtech/atms/controller/ProjectInfoController.java
View file @
7baee921
...
...
@@ -2,6 +2,7 @@ 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
;
...
...
@@ -47,4 +48,11 @@ public class ProjectInfoController {
queryImportType
.
getServiceTypeId
()
,
identityService
.
getIdentityUser
().
getID
());
}
@ApiOperation
(
value
=
"getImportType"
,
notes
=
""
)
@RequestMapping
(
value
=
"getImportType/{projectID}/{periodID}/{serviceType}"
,
method
=
RequestMethod
.
GET
)
public
ResponseEntity
getImportType
(
@PathVariable
String
projectID
,
@PathVariable
Integer
periodID
,
@PathVariable
Integer
serviceType
)
{
return
ResponseEntity
.
ok
().
body
(
projectInfoService
.
getImportType
(
projectID
,
periodID
,
serviceType
));
}
}
\ No newline at end of file
atms-api/src/main/java/pwc/taxtech/atms/controller/TBDataImportController.java
View file @
7baee921
...
...
@@ -30,6 +30,9 @@ import java.math.BigDecimal;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
static
pwc
.
taxtech
.
atms
.
constant
.
Constant
.
DEFAULT_HAS_HEADER
;
import
static
pwc
.
taxtech
.
atms
.
constant
.
Constant
.
HEADER_ROW_INDEX
;
@RequestMapping
(
value
=
"api/v1/DataImport"
)
@RestController
public
class
TBDataImportController
{
...
...
@@ -455,7 +458,8 @@ public class TBDataImportController {
String
fullFilePath
=
fileUploadAdapter
.
getLastFilePathByFileName
(
tempFileName
);
if
(
fullFilePath
!=
null
)
{
try
(
FileInputStream
fis
=
new
FileInputStream
(
new
File
(
fullFilePath
));)
{
dataImportModel
=
NPOIHelper
.
renderTBDataTableFromExcel
(
fis
,
selectedSheetIndex
,
0
,
true
,
topRowNumber
);
dataImportModel
=
NPOIHelper
.
renderTBDataTableFromExcel
(
fis
,
selectedSheetIndex
,
HEADER_ROW_INDEX
,
DEFAULT_HAS_HEADER
,
topRowNumber
);
dataImportModel
.
setSelectedSheetIndex
(
selectedSheetIndex
);
return
ResponseEntity
.
ok
(
dataImportModel
);
}
catch
(
FileNotFoundException
e
)
{
//TODO: replace exception filter (neo)
...
...
atms-api/src/main/java/pwc/taxtech/atms/dto/vatdto/ValidationInfoDto.java
0 → 100644
View file @
7baee921
package
pwc
.
taxtech
.
atms
.
dto
.
vatdto
;
import
java.util.Date
;
public
class
ValidationInfoDto
{
private
String
ID
;
private
Integer
importTypeId
;
private
String
validationResult
;
private
String
validationDetails
;
private
String
validationTips
;
private
Integer
number
;
private
String
creatorId
;
private
Date
createTime
;
private
Integer
periodId
;
private
Integer
erpCheckTypeId
;
private
Integer
errorLevel
;
public
String
getID
()
{
return
ID
;
}
public
void
setID
(
String
ID
)
{
this
.
ID
=
ID
;
}
public
Integer
getImportTypeId
()
{
return
importTypeId
;
}
public
void
setImportTypeId
(
Integer
importTypeId
)
{
this
.
importTypeId
=
importTypeId
;
}
public
String
getValidationResult
()
{
return
validationResult
;
}
public
void
setValidationResult
(
String
validationResult
)
{
this
.
validationResult
=
validationResult
;
}
public
String
getValidationDetails
()
{
return
validationDetails
;
}
public
void
setValidationDetails
(
String
validationDetails
)
{
this
.
validationDetails
=
validationDetails
;
}
public
String
getValidationTips
()
{
return
validationTips
;
}
public
void
setValidationTips
(
String
validationTips
)
{
this
.
validationTips
=
validationTips
;
}
public
Integer
getNumber
()
{
return
number
;
}
public
void
setNumber
(
Integer
number
)
{
this
.
number
=
number
;
}
public
String
getCreatorId
()
{
return
creatorId
;
}
public
void
setCreatorId
(
String
creatorId
)
{
this
.
creatorId
=
creatorId
;
}
public
Date
getCreateTime
()
{
return
createTime
;
}
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
public
Integer
getPeriodId
()
{
return
periodId
;
}
public
void
setPeriodId
(
Integer
periodId
)
{
this
.
periodId
=
periodId
;
}
public
Integer
getErpCheckTypeId
()
{
return
erpCheckTypeId
;
}
public
void
setErpCheckTypeId
(
Integer
erpCheckTypeId
)
{
this
.
erpCheckTypeId
=
erpCheckTypeId
;
}
public
Integer
getErrorLevel
()
{
return
errorLevel
;
}
public
void
setErrorLevel
(
Integer
errorLevel
)
{
this
.
errorLevel
=
errorLevel
;
}
public
Integer
getIsShowDetail
()
{
return
isShowDetail
;
}
public
void
setIsShowDetail
(
Integer
isShowDetail
)
{
this
.
isShowDetail
=
isShowDetail
;
}
private
Integer
isShowDetail
;
}
atms-api/src/main/java/pwc/taxtech/atms/service/ProjectInfoService.java
View file @
7baee921
...
...
@@ -11,4 +11,6 @@ public interface ProjectInfoService {
OperationResultDto
<
Boolean
>
isProjectImportedData
(
String
projectId
,
Integer
importTypeId
);
OperationResultDto
<
List
<
PeriodInfoDto
>>
getProjectImportType
(
String
projectId
,
List
<
Integer
>
periods
,
Integer
serviceTypeId
,
String
id
);
Integer
getImportType
(
String
projectID
,
Integer
periodID
,
Integer
serviceType
);
}
atms-api/src/main/java/pwc/taxtech/atms/service/impl/ProjectInfoServiceImpl.java
View file @
7baee921
...
...
@@ -4,6 +4,7 @@ import org.slf4j.Logger;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
pwc.taxtech.atms.constant.enums.TbImportType
;
import
pwc.taxtech.atms.dao.PeriodInfoMapper
;
import
pwc.taxtech.atms.dto.OperationResultDto
;
import
pwc.taxtech.atms.dto.taxadmin.PeriodInfoDto
;
...
...
@@ -11,8 +12,11 @@ import pwc.taxtech.atms.entitiy.PeriodInfo;
import
pwc.taxtech.atms.entitiy.PeriodInfoExample
;
import
pwc.taxtech.atms.service.ProjectInfoService
;
import
java.util.Date
;
import
java.util.List
;
import
static
pwc
.
taxtech
.
atms
.
constant
.
Constant
.
FIRST_OR_DEFAULT
;
@Service
public
class
ProjectInfoServiceImpl
implements
ProjectInfoService
{
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
ProjectServiceImpl
.
class
);
...
...
@@ -50,4 +54,28 @@ public class ProjectInfoServiceImpl implements ProjectInfoService {
public
OperationResultDto
<
List
<
PeriodInfoDto
>>
getProjectImportType
(
String
projectId
,
List
<
Integer
>
periods
,
Integer
serviceTypeId
,
String
id
)
{
return
null
;
}
@Override
public
Integer
getImportType
(
String
projectID
,
Integer
periodID
,
Integer
serviceType
)
{
PeriodInfoExample
example
=
new
PeriodInfoExample
();
example
.
createCriteria
().
andProjectIDEqualTo
(
projectID
).
andProjectIDEqualTo
(
projectID
).
andServiceTypeEqualTo
(
serviceType
);
List
<
PeriodInfo
>
periodInfoList
=
periodInfoMapper
.
selectByExample
(
example
);
if
(
periodInfoList
==
null
||
periodInfoList
.
size
()==
0
){
PeriodInfo
periodInfo
=
new
PeriodInfo
();
periodInfo
.
setProjectID
(
projectID
);
periodInfo
.
setPeriod
(
periodID
);
periodInfo
.
setStatus
(
0
);
periodInfo
.
setImportType
(
TbImportType
.
UnImported
.
getCode
());
periodInfo
.
setServiceType
(
serviceType
);
periodInfo
.
setCreateTime
(
new
Date
());
periodInfo
.
setUpdateTime
(
new
Date
());
periodInfoMapper
.
insert
(
periodInfo
);
return
TbImportType
.
UnImported
.
getCode
();
}
else
{
return
periodInfoList
.
get
(
FIRST_OR_DEFAULT
).
getImportType
();
}
}
}
atms-api/src/main/java/pwc/taxtech/atms/utils/NPOIHelper.java
View file @
7baee921
...
...
@@ -80,7 +80,10 @@ public class NPOIHelper {
if
(
topRowNumber
>
0
)
{
//第一行为列头的话就多输出一行
int
topNum
=
haveHeader
?
topRowNumber
+
1
:
topRowNumber
;
if
(
topNum
<
dataImportModel
.
getDataList
().
size
())
dataImportModel
.
setDataList
(
dataImportModel
.
getDataList
().
subList
(
0
,
topNum
));
// dataImportModel.setDataList(dataImportModel.getDataList().subList(0,topRowNumber));
}
return
dataImportModel
;
...
...
atms-api/src/main/java/pwc/taxtech/atms/vat/service/JournalEntryImportService.java
View file @
7baee921
...
...
@@ -2,8 +2,13 @@ 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.ValidationInfoDto
;
import
pwc.taxtech.atms.dto.vatdto.VoucherDto
;
import
java.util.List
;
public
interface
JournalEntryImportService
{
PagingResultDto
<
VoucherDto
>
qeryJournalEntryData
(
QueryJeDto
queryJeDto
);
List
<
ValidationInfoDto
>
getValidationInfoList
(
Integer
type
,
Integer
period
);
}
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/JournalEntryImportServiceImpl.java
View file @
7baee921
...
...
@@ -6,8 +6,12 @@ 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.ValidationInfoDto
;
import
pwc.taxtech.atms.dto.vatdto.VoucherDto
;
import
pwc.taxtech.atms.vat.dao.JournalEntryImportMapper
;
import
pwc.taxtech.atms.vat.dao.ValidationInfoMapper
;
import
pwc.taxtech.atms.vat.entity.ValidationInfo
;
import
pwc.taxtech.atms.vat.entity.ValidationInfoExample
;
import
pwc.taxtech.atms.vat.entity.Voucher
;
import
pwc.taxtech.atms.vat.service.JournalEntryImportService
;
...
...
@@ -15,11 +19,16 @@ import java.math.BigDecimal;
import
java.util.ArrayList
;
import
java.util.List
;
import
static
pwc
.
taxtech
.
atms
.
constant
.
Constant
.
WholeYear
;
@Service
public
class
JournalEntryImportServiceImpl
implements
JournalEntryImportService
{
@Autowired
JournalEntryImportMapper
journalEntryImportMapper
;
@Autowired
ValidationInfoMapper
validationInfoMapper
;
@Override
public
PagingResultDto
<
VoucherDto
>
qeryJournalEntryData
(
QueryJeDto
queryJeDto
)
{
PagingResultDto
<
VoucherDto
>
qResult
=
new
PagingResultDto
<
VoucherDto
>();
...
...
@@ -28,7 +37,7 @@ public class JournalEntryImportServiceImpl implements JournalEntryImportService
qResult
.
setCalculateData
(
new
VoucherDto
());
List
<
Voucher
>
pageResultList
=
journalEntryImportMapper
.
pageQuery
(
VatImportType
.
JournalEntry
.
getCode
(),
queryJeDto
.
getPeriodId
(),
queryJeDto
.
getPageInfo
().
getPageIndex
()
*
queryJeDto
.
getPageInfo
().
getPageSize
(),
queryJeDto
.
getPeriodId
(),
queryJeDto
.
getPageInfo
().
getPageIndex
()
*
queryJeDto
.
getPageInfo
().
getPageSize
(),
queryJeDto
.
getPageInfo
().
getPageSize
());
Integer
pageCount
=
journalEntryImportMapper
.
pageQueryCount
(
VatImportType
.
JournalEntry
.
getCode
(),
...
...
@@ -41,9 +50,9 @@ public class JournalEntryImportServiceImpl implements JournalEntryImportService
//查询结果总数
qResult
.
getPageInfo
().
setTotalCount
(
pageCount
);
//分录总数
qResult
.
getCalculateData
().
setItemIDCount
(
pageCount
==
null
?
0
:
pageCount
);
qResult
.
getCalculateData
().
setItemIDCount
(
pageCount
==
null
?
0
:
pageCount
);
//凭证总数
qResult
.
getCalculateData
().
setvIDCount
(
vIDCount
==
null
?
0
:
vIDCount
);
qResult
.
getCalculateData
().
setvIDCount
(
vIDCount
==
null
?
0
:
vIDCount
);
//所有凭证的借贷方sum
BigDecimal
debitSum
=
new
BigDecimal
(
0
);
BigDecimal
creditSum
=
new
BigDecimal
(
0
);
...
...
@@ -63,7 +72,7 @@ public class JournalEntryImportServiceImpl implements JournalEntryImportService
VoucherDto
voucherDto
=
new
VoucherDto
();
try
{
FieldsMapper
.
map
(
voucher
,
voucherDto
);
FieldsMapper
.
map
(
voucher
,
voucherDto
);
}
catch
(
ClassNotFoundException
e
)
{
//TODO replace exception filter (neo)
e
.
printStackTrace
();
}
catch
(
IllegalAccessException
e
)
{
...
...
@@ -74,4 +83,29 @@ public class JournalEntryImportServiceImpl implements JournalEntryImportService
return
qResult
;
}
@Override
public
List
<
ValidationInfoDto
>
getValidationInfoList
(
Integer
type
,
Integer
period
)
{
ValidationInfoExample
validationInfoExample
=
new
ValidationInfoExample
();
if
(
period
.
intValue
()
!=
WholeYear
)
validationInfoExample
.
createCriteria
().
andImportTypeIdEqualTo
(
type
).
andPeriodIdEqualTo
(
period
);
else
validationInfoExample
.
createCriteria
().
andImportTypeIdEqualTo
(
type
);
List
<
ValidationInfo
>
result
=
validationInfoMapper
.
selectByExample
(
validationInfoExample
);
List
<
ValidationInfoDto
>
validationInfoDtos
=
new
ArrayList
<>(
result
.
size
());
result
.
forEach
(
m
->{
ValidationInfoDto
dto
=
new
ValidationInfoDto
();
try
{
FieldsMapper
.
map
(
result
,
dto
);
}
catch
(
ClassNotFoundException
e
)
{
e
.
printStackTrace
();
}
catch
(
IllegalAccessException
e
)
{
e
.
printStackTrace
();
}
});
return
validationInfoDtos
;
}
}
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