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
b3ec20cc
Commit
b3ec20cc
authored
Jul 03, 2018
by
frank.xa.zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add new api for report generate with work flow and data save
parent
444ed5a1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
136 additions
and
89 deletions
+136
-89
vatGeneratorConfig.xml
atms-api/etc/generator/vatGeneratorConfig.xml
+5
-4
vat_run.bat
atms-api/etc/generator/vat_run.bat
+1
-1
POIUtil.java
atms-api/src/main/java/pwc/taxtech/atms/common/POIUtil.java
+9
-5
ReportController.java
...in/java/pwc/taxtech/atms/controller/ReportController.java
+5
-0
ReportMapper.java
.../src/main/java/pwc/taxtech/atms/vat/dao/ReportMapper.java
+14
-14
CellData.java
...i/src/main/java/pwc/taxtech/atms/vat/entity/CellData.java
+8
-8
CellDataExample.java
...ain/java/pwc/taxtech/atms/vat/entity/CellDataExample.java
+20
-40
Report.java
...api/src/main/java/pwc/taxtech/atms/vat/entity/Report.java
+0
-0
ReportExample.java
.../main/java/pwc/taxtech/atms/vat/entity/ReportExample.java
+0
-0
ReportGenerator.java
...in/java/pwc/taxtech/atms/vat/service/ReportGenerator.java
+7
-0
ReportService.java
...main/java/pwc/taxtech/atms/vat/service/ReportService.java
+2
-0
ReportGeneratorImpl.java
...wc/taxtech/atms/vat/service/impl/ReportGeneratorImpl.java
+0
-0
ReportServiceImpl.java
.../pwc/taxtech/atms/vat/service/impl/ReportServiceImpl.java
+49
-2
VatAbstractService.java
...pwc/taxtech/atms/vat/service/impl/VatAbstractService.java
+3
-0
CellDataMapper.xml
...ain/resources/pwc/taxtech/atms/vat/dao/CellDataMapper.xml
+13
-13
ReportMapper.xml
.../main/resources/pwc/taxtech/atms/vat/dao/ReportMapper.xml
+0
-0
POITest.java
atms-api/src/test/java/pwc/taxtech/atms/common/POITest.java
+0
-2
No files found.
atms-api/etc/generator/vatGeneratorConfig.xml
View file @
b3ec20cc
...
...
@@ -297,10 +297,7 @@
<columnOverride
column=
"Path"
javaType=
"java.lang.String"
jdbcType=
"VARCHAR"
/>
</table>
<table
tableName=
"Report"
domainObjectName=
"Report"
>
<property
name=
"useActualColumnNames"
value=
"true"
/>
<property
name=
"ignoreQualifiersAtRuntime"
value=
"true"
/>
</table>
<table
tableName=
"StandardAccount"
domainObjectName=
"VatStandardAccount"
>
<property
name=
"useActualColumnNames"
value=
"true"
/>
...
...
@@ -376,5 +373,8 @@
<columnOverride
column=
"is_system_type"
javaType=
"java.lang.Boolean"
/>
<columnOverride
column=
"is_active_association"
javaType=
"java.lang.Boolean"
/>
</table>
<table
tableName=
"report"
domainObjectName=
"Report"
>
<property
name=
"ignoreQualifiersAtRuntime"
value=
"true"
/>
</table>
</context>
</generatorConfiguration>
\ No newline at end of file
atms-api/etc/generator/vat_run.bat
View file @
b3ec20cc
rem see http://www.mybatis.org/generator/running/runningFromCmdLine.html
cd /d %~dp0
call java -classpath .;./* org.mybatis.generator.api.ShellRunner -configfile vatGeneratorConfig.xml -overwrite -verbose -tables
period_cell_template_config
call java -classpath .;./* org.mybatis.generator.api.ShellRunner -configfile vatGeneratorConfig.xml -overwrite -verbose -tables
cell_data
echo @@@@@@@@@@@ DONE @@@@@@@@@@@
pause
atms-api/src/main/java/pwc/taxtech/atms/common/POIUtil.java
View file @
b3ec20cc
...
...
@@ -2,14 +2,18 @@ package pwc.taxtech.atms.common;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.poi.hssf.usermodel.HSSFWorkbook
;
import
org.apache.poi.ss.usermodel.Cell
;
import
org.apache.poi.ss.usermodel.Row
;
import
org.apache.poi.ss.usermodel.Sheet
;
import
org.apache.poi.ss.usermodel.Workbook
;
import
org.apache.poi.openxml4j.exceptions.InvalidFormatException
;
import
org.apache.poi.ss.usermodel.*
;
import
org.apache.poi.xssf.usermodel.XSSFWorkbook
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
java.io.File
;
import
java.io.FileInputStream
;
import
java.io.FileNotFoundException
;
import
java.io.IOException
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Optional
;
public
class
POIUtil
{
...
...
@@ -42,7 +46,7 @@ public class POIUtil {
Row
targetRow
=
targetSheet
.
createRow
(
r
);
for
(
int
c
=
row
.
getFirstCellNum
();
c
<=
row
.
getLastCellNum
();
c
++)
{
Cell
cell
=
row
.
getCell
(
c
);
if
(
null
==
cell
){
if
(
null
==
cell
)
{
continue
;
}
Cell
targetCell
=
targetRow
.
createCell
(
c
);
...
...
atms-api/src/main/java/pwc/taxtech/atms/controller/ReportController.java
View file @
b3ec20cc
...
...
@@ -25,4 +25,9 @@ public class ReportController {
public
OperationResultDto
updateConfig
(
@PathVariable
String
projectId
,
@PathVariable
Integer
period
,
@RequestParam
String
generator
)
{
return
reportService
.
updateConfig
(
projectId
,
period
,
generator
);
}
@RequestMapping
(
value
=
"generateByTotal/{projectId}/{ifDeleteManualDataSource}/{period}"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
OperationResultDto
generateAllData
(
@PathVariable
String
projectId
,
@PathVariable
Boolean
ifDeleteManualDataSource
,
@PathVariable
Integer
period
,
@RequestParam
String
generator
){
return
reportService
.
generateData
(
projectId
,
EnumServiceType
.
VAT
,
ifDeleteManualDataSource
,
period
,
null
,
generator
);
}
}
atms-api/src/main/java/pwc/taxtech/atms/vat/dao/ReportMapper.java
View file @
b3ec20cc
...
...
@@ -12,7 +12,7 @@ import pwc.taxtech.atms.vat.entity.ReportExample;
public
interface
ReportMapper
extends
MyVatMapper
{
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table
R
eport
* This method corresponds to the database table
r
eport
*
* @mbg.generated
*/
...
...
@@ -20,7 +20,7 @@ public interface ReportMapper extends MyVatMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table
R
eport
* This method corresponds to the database table
r
eport
*
* @mbg.generated
*/
...
...
@@ -28,15 +28,15 @@ public interface ReportMapper extends MyVatMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table
R
eport
* This method corresponds to the database table
r
eport
*
* @mbg.generated
*/
int
deleteByPrimaryKey
(
String
ID
);
int
deleteByPrimaryKey
(
Long
id
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table
R
eport
* This method corresponds to the database table
r
eport
*
* @mbg.generated
*/
...
...
@@ -44,7 +44,7 @@ public interface ReportMapper extends MyVatMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table
R
eport
* This method corresponds to the database table
r
eport
*
* @mbg.generated
*/
...
...
@@ -52,7 +52,7 @@ public interface ReportMapper extends MyVatMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table
R
eport
* This method corresponds to the database table
r
eport
*
* @mbg.generated
*/
...
...
@@ -60,7 +60,7 @@ public interface ReportMapper extends MyVatMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table
R
eport
* This method corresponds to the database table
r
eport
*
* @mbg.generated
*/
...
...
@@ -68,15 +68,15 @@ public interface ReportMapper extends MyVatMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table
R
eport
* This method corresponds to the database table
r
eport
*
* @mbg.generated
*/
Report
selectByPrimaryKey
(
String
ID
);
Report
selectByPrimaryKey
(
Long
id
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table
R
eport
* This method corresponds to the database table
r
eport
*
* @mbg.generated
*/
...
...
@@ -84,7 +84,7 @@ public interface ReportMapper extends MyVatMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table
R
eport
* This method corresponds to the database table
r
eport
*
* @mbg.generated
*/
...
...
@@ -92,7 +92,7 @@ public interface ReportMapper extends MyVatMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table
R
eport
* This method corresponds to the database table
r
eport
*
* @mbg.generated
*/
...
...
@@ -100,7 +100,7 @@ public interface ReportMapper extends MyVatMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table
R
eport
* This method corresponds to the database table
r
eport
*
* @mbg.generated
*/
...
...
atms-api/src/main/java/pwc/taxtech/atms/vat/entity/CellData.java
View file @
b3ec20cc
...
...
@@ -27,7 +27,7 @@ public class CellData implements Serializable {
*
* @mbg.generated
*/
private
Stri
ng
reportId
;
private
Lo
ng
reportId
;
/**
*
...
...
@@ -36,7 +36,7 @@ public class CellData implements Serializable {
*
* @mbg.generated
*/
private
Stri
ng
cellTemplateId
;
private
Lo
ng
cellTemplateId
;
/**
*
...
...
@@ -132,7 +132,7 @@ public class CellData implements Serializable {
*
* @mbg.generated
*/
public
Stri
ng
getReportId
()
{
public
Lo
ng
getReportId
()
{
return
reportId
;
}
...
...
@@ -144,8 +144,8 @@ public class CellData implements Serializable {
*
* @mbg.generated
*/
public
void
setReportId
(
Stri
ng
reportId
)
{
this
.
reportId
=
reportId
==
null
?
null
:
reportId
.
trim
()
;
public
void
setReportId
(
Lo
ng
reportId
)
{
this
.
reportId
=
reportId
;
}
/**
...
...
@@ -156,7 +156,7 @@ public class CellData implements Serializable {
*
* @mbg.generated
*/
public
Stri
ng
getCellTemplateId
()
{
public
Lo
ng
getCellTemplateId
()
{
return
cellTemplateId
;
}
...
...
@@ -168,8 +168,8 @@ public class CellData implements Serializable {
*
* @mbg.generated
*/
public
void
setCellTemplateId
(
Stri
ng
cellTemplateId
)
{
this
.
cellTemplateId
=
cellTemplateId
==
null
?
null
:
cellTemplateId
.
trim
()
;
public
void
setCellTemplateId
(
Lo
ng
cellTemplateId
)
{
this
.
cellTemplateId
=
cellTemplateId
;
}
/**
...
...
atms-api/src/main/java/pwc/taxtech/atms/vat/entity/CellDataExample.java
View file @
b3ec20cc
...
...
@@ -265,62 +265,52 @@ public class CellDataExample {
return
(
Criteria
)
this
;
}
public
Criteria
andReportIdEqualTo
(
Stri
ng
value
)
{
public
Criteria
andReportIdEqualTo
(
Lo
ng
value
)
{
addCriterion
(
"report_id ="
,
value
,
"reportId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andReportIdNotEqualTo
(
Stri
ng
value
)
{
public
Criteria
andReportIdNotEqualTo
(
Lo
ng
value
)
{
addCriterion
(
"report_id <>"
,
value
,
"reportId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andReportIdGreaterThan
(
Stri
ng
value
)
{
public
Criteria
andReportIdGreaterThan
(
Lo
ng
value
)
{
addCriterion
(
"report_id >"
,
value
,
"reportId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andReportIdGreaterThanOrEqualTo
(
Stri
ng
value
)
{
public
Criteria
andReportIdGreaterThanOrEqualTo
(
Lo
ng
value
)
{
addCriterion
(
"report_id >="
,
value
,
"reportId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andReportIdLessThan
(
Stri
ng
value
)
{
public
Criteria
andReportIdLessThan
(
Lo
ng
value
)
{
addCriterion
(
"report_id <"
,
value
,
"reportId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andReportIdLessThanOrEqualTo
(
Stri
ng
value
)
{
public
Criteria
andReportIdLessThanOrEqualTo
(
Lo
ng
value
)
{
addCriterion
(
"report_id <="
,
value
,
"reportId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andReportIdLike
(
String
value
)
{
addCriterion
(
"report_id like"
,
value
,
"reportId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andReportIdNotLike
(
String
value
)
{
addCriterion
(
"report_id not like"
,
value
,
"reportId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andReportIdIn
(
List
<
String
>
values
)
{
public
Criteria
andReportIdIn
(
List
<
Long
>
values
)
{
addCriterion
(
"report_id in"
,
values
,
"reportId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andReportIdNotIn
(
List
<
Stri
ng
>
values
)
{
public
Criteria
andReportIdNotIn
(
List
<
Lo
ng
>
values
)
{
addCriterion
(
"report_id not in"
,
values
,
"reportId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andReportIdBetween
(
String
value1
,
Stri
ng
value2
)
{
public
Criteria
andReportIdBetween
(
Long
value1
,
Lo
ng
value2
)
{
addCriterion
(
"report_id between"
,
value1
,
value2
,
"reportId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andReportIdNotBetween
(
String
value1
,
Stri
ng
value2
)
{
public
Criteria
andReportIdNotBetween
(
Long
value1
,
Lo
ng
value2
)
{
addCriterion
(
"report_id not between"
,
value1
,
value2
,
"reportId"
);
return
(
Criteria
)
this
;
}
...
...
@@ -335,62 +325,52 @@ public class CellDataExample {
return
(
Criteria
)
this
;
}
public
Criteria
andCellTemplateIdEqualTo
(
Stri
ng
value
)
{
public
Criteria
andCellTemplateIdEqualTo
(
Lo
ng
value
)
{
addCriterion
(
"cell_template_id ="
,
value
,
"cellTemplateId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCellTemplateIdNotEqualTo
(
Stri
ng
value
)
{
public
Criteria
andCellTemplateIdNotEqualTo
(
Lo
ng
value
)
{
addCriterion
(
"cell_template_id <>"
,
value
,
"cellTemplateId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCellTemplateIdGreaterThan
(
Stri
ng
value
)
{
public
Criteria
andCellTemplateIdGreaterThan
(
Lo
ng
value
)
{
addCriterion
(
"cell_template_id >"
,
value
,
"cellTemplateId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCellTemplateIdGreaterThanOrEqualTo
(
Stri
ng
value
)
{
public
Criteria
andCellTemplateIdGreaterThanOrEqualTo
(
Lo
ng
value
)
{
addCriterion
(
"cell_template_id >="
,
value
,
"cellTemplateId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCellTemplateIdLessThan
(
Stri
ng
value
)
{
public
Criteria
andCellTemplateIdLessThan
(
Lo
ng
value
)
{
addCriterion
(
"cell_template_id <"
,
value
,
"cellTemplateId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCellTemplateIdLessThanOrEqualTo
(
Stri
ng
value
)
{
public
Criteria
andCellTemplateIdLessThanOrEqualTo
(
Lo
ng
value
)
{
addCriterion
(
"cell_template_id <="
,
value
,
"cellTemplateId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCellTemplateIdLike
(
String
value
)
{
addCriterion
(
"cell_template_id like"
,
value
,
"cellTemplateId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCellTemplateIdNotLike
(
String
value
)
{
addCriterion
(
"cell_template_id not like"
,
value
,
"cellTemplateId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCellTemplateIdIn
(
List
<
String
>
values
)
{
public
Criteria
andCellTemplateIdIn
(
List
<
Long
>
values
)
{
addCriterion
(
"cell_template_id in"
,
values
,
"cellTemplateId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCellTemplateIdNotIn
(
List
<
Stri
ng
>
values
)
{
public
Criteria
andCellTemplateIdNotIn
(
List
<
Lo
ng
>
values
)
{
addCriterion
(
"cell_template_id not in"
,
values
,
"cellTemplateId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCellTemplateIdBetween
(
String
value1
,
Stri
ng
value2
)
{
public
Criteria
andCellTemplateIdBetween
(
Long
value1
,
Lo
ng
value2
)
{
addCriterion
(
"cell_template_id between"
,
value1
,
value2
,
"cellTemplateId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCellTemplateIdNotBetween
(
String
value1
,
Stri
ng
value2
)
{
public
Criteria
andCellTemplateIdNotBetween
(
Long
value1
,
Lo
ng
value2
)
{
addCriterion
(
"cell_template_id not between"
,
value1
,
value2
,
"cellTemplateId"
);
return
(
Criteria
)
this
;
}
...
...
atms-api/src/main/java/pwc/taxtech/atms/vat/entity/Report.java
View file @
b3ec20cc
This diff is collapsed.
Click to expand it.
atms-api/src/main/java/pwc/taxtech/atms/vat/entity/ReportExample.java
View file @
b3ec20cc
This diff is collapsed.
Click to expand it.
atms-api/src/main/java/pwc/taxtech/atms/vat/service/ReportGenerator.java
0 → 100644
View file @
b3ec20cc
package
pwc
.
taxtech
.
atms
.
vat
.
service
;
import
java.util.List
;
public
interface
ReportGenerator
{
String
generateData
(
String
projectId
,
List
<
Long
>
templateIds
,
Boolean
ifDeleteManualDataSource
,
List
<
String
>
exceptCellTemplates
,
Integer
periodParam
,
String
generator
);
}
atms-api/src/main/java/pwc/taxtech/atms/vat/service/ReportService.java
View file @
b3ec20cc
...
...
@@ -10,4 +10,6 @@ public interface ReportService {
OperationResultDto
<
List
<
ReportDto
>>
getReportTemplate
(
String
projectID
,
EnumServiceType
serviceType
,
Integer
period
);
OperationResultDto
updateConfig
(
String
projectId
,
Integer
period
,
String
generator
);
OperationResultDto
generateData
(
String
projectId
,
EnumServiceType
serviceType
,
Boolean
ifDeleteManualDataSource
,
Integer
periodParam
,
Integer
reportType
,
String
generator
);
}
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/ReportGeneratorImpl.java
0 → 100644
View file @
b3ec20cc
This diff is collapsed.
Click to expand it.
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/ReportServiceImpl.java
View file @
b3ec20cc
...
...
@@ -10,8 +10,10 @@ import pwc.taxtech.atms.entitiy.*;
import
pwc.taxtech.atms.vat.entity.PeriodCellTemplate
;
import
pwc.taxtech.atms.vat.entity.PeriodCellTemplateConfig
;
import
pwc.taxtech.atms.vat.entity.PeriodTemplate
;
import
pwc.taxtech.atms.vat.entity.PeriodTemplateExample
;
import
pwc.taxtech.atms.vat.service.ReportService
;
import
javax.ws.rs.NotSupportedException
;
import
java.util.*
;
import
java.util.stream.Collectors
;
...
...
@@ -219,4 +221,50 @@ public class ReportServiceImpl extends VatAbstractService implements ReportServi
}
return
null
;
}
}
\ No newline at end of file
@Override
public
OperationResultDto
generateData
(
String
projectId
,
EnumServiceType
serviceType
,
Boolean
ifDeleteManualDataSource
,
Integer
periodParam
,
Integer
reportType
,
String
generator
)
{
OperationResultDto
operationResultDto
=
new
OperationResultDto
();
if
(
serviceType
.
equals
(
EnumServiceType
.
VAT
)
&&
(
periodParam
==
null
&&
periodParam
<=
0
))
{
operationResultDto
.
setResultMsg
(
"PeriodRequiredForVAT"
);
return
operationResultDto
;
}
if
(
serviceType
!=
EnumServiceType
.
VAT
)
{
// 暂不支持非CIT/VAT service批量后端生成报表
throw
new
NotSupportedException
();
}
int
period
=
periodParam
!=
null
?
periodParam
:
0
;
String
serviceTypeStr
=
serviceType
.
getCode
().
toString
();
ProjectServiceTypeExample
projectServiceTypeExample
=
new
ProjectServiceTypeExample
();
projectServiceTypeExample
.
createCriteria
().
andServiceTypeIDEqualTo
(
serviceTypeStr
).
andProjectIDEqualTo
(
projectId
);
Optional
<
Long
>
templateGroupID
=
projectServiceTypeMapper
.
selectByExample
(
projectServiceTypeExample
).
stream
().
map
(
ProjectServiceType:
:
getTemplateGroupID
).
findFirst
();
if
(
templateGroupID
==
null
)
{
operationResultDto
.
setResultMsg
(
"TemplateGroupNotExist"
);
return
operationResultDto
;
}
List
<
Long
>
templateIds
;
if
(
reportType
!=
null
)
{
PeriodTemplateExample
periodTemplateExample
=
new
PeriodTemplateExample
();
periodTemplateExample
.
createCriteria
().
andTemplateGroupIdEqualTo
(
templateGroupID
.
get
()).
andPeriodEqualTo
(
period
).
andIsActiveAssociationEqualTo
(
true
).
andReportTypeEqualTo
(
reportType
);
templateIds
=
periodTemplateMapper
.
selectByExample
(
periodTemplateExample
).
stream
().
map
(
PeriodTemplate:
:
getId
).
collect
(
Collectors
.
toList
());
}
else
{
PeriodTemplateExample
periodTemplateExample
=
new
PeriodTemplateExample
();
periodTemplateExample
.
createCriteria
().
andTemplateGroupIdEqualTo
(
templateGroupID
.
get
()).
andPeriodEqualTo
(
period
).
andIsActiveAssociationEqualTo
(
true
);
templateIds
=
periodTemplateMapper
.
selectByExample
(
periodTemplateExample
).
stream
().
map
(
PeriodTemplate:
:
getId
).
collect
(
Collectors
.
toList
());
}
String
rslt
=
reportGenerator
.
generateData
(
projectId
,
templateIds
,
ifDeleteManualDataSource
,
null
,
periodParam
,
generator
);
if
(
StringUtils
.
isBlank
(
rslt
))
{
operationResultDto
.
setResultMsg
(
"ReportGenerateFailed!"
);
return
operationResultDto
;
}
operationResultDto
.
setResult
(
true
);
return
operationResultDto
;
}
}
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/VatAbstractService.java
View file @
b3ec20cc
...
...
@@ -6,6 +6,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
pwc.taxtech.atms.dao.*
;
import
pwc.taxtech.atms.service.impl.DistributedIDService
;
import
pwc.taxtech.atms.vat.dao.*
;
import
pwc.taxtech.atms.vat.service.ReportGenerator
;
public
class
VatAbstractService
{
protected
final
Logger
logger
=
LoggerFactory
.
getLogger
(
this
.
getClass
());
...
...
@@ -52,5 +53,7 @@ public class VatAbstractService {
CellTemplateConfigMapper
cellTemplateConfigMapper
;
@Autowired
EnterpriseAccountMapper
enterpriseAccountMapper
;
@Autowired
ReportGenerator
reportGenerator
;
}
atms-api/src/main/resources/pwc/taxtech/atms/vat/dao/CellDataMapper.xml
View file @
b3ec20cc
...
...
@@ -7,8 +7,8 @@
This element is automatically generated by MyBatis Generator, do not modify.
-->
<id
column=
"id"
jdbcType=
"BIGINT"
property=
"id"
/>
<result
column=
"report_id"
jdbcType=
"
VARCHAR
"
property=
"reportId"
/>
<result
column=
"cell_template_id"
jdbcType=
"
VARCHAR
"
property=
"cellTemplateId"
/>
<result
column=
"report_id"
jdbcType=
"
BIGINT
"
property=
"reportId"
/>
<result
column=
"cell_template_id"
jdbcType=
"
BIGINT
"
property=
"cellTemplateId"
/>
<result
column=
"data"
jdbcType=
"VARCHAR"
property=
"data"
/>
<result
column=
"formula_exp"
jdbcType=
"VARCHAR"
property=
"formulaExp"
/>
<result
column=
"create_by"
jdbcType=
"VARCHAR"
property=
"createBy"
/>
...
...
@@ -145,7 +145,7 @@
"data", formula_exp, create_by,
create_time, update_by, update_time
)
values (#{id,jdbcType=BIGINT}, #{reportId,jdbcType=
VARCHAR}, #{cellTemplateId,jdbcType=VARCHAR
},
values (#{id,jdbcType=BIGINT}, #{reportId,jdbcType=
BIGINT}, #{cellTemplateId,jdbcType=BIGINT
},
#{data,jdbcType=VARCHAR}, #{formulaExp,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}
)
...
...
@@ -190,10 +190,10 @@
#{id,jdbcType=BIGINT},
</if>
<if
test=
"reportId != null"
>
#{reportId,jdbcType=
VARCHAR
},
#{reportId,jdbcType=
BIGINT
},
</if>
<if
test=
"cellTemplateId != null"
>
#{cellTemplateId,jdbcType=
VARCHAR
},
#{cellTemplateId,jdbcType=
BIGINT
},
</if>
<if
test=
"data != null"
>
#{data,jdbcType=VARCHAR},
...
...
@@ -236,10 +236,10 @@
id = #{record.id,jdbcType=BIGINT},
</if>
<if
test=
"record.reportId != null"
>
report_id = #{record.reportId,jdbcType=
VARCHAR
},
report_id = #{record.reportId,jdbcType=
BIGINT
},
</if>
<if
test=
"record.cellTemplateId != null"
>
cell_template_id = #{record.cellTemplateId,jdbcType=
VARCHAR
},
cell_template_id = #{record.cellTemplateId,jdbcType=
BIGINT
},
</if>
<if
test=
"record.data != null"
>
"data" = #{record.data,jdbcType=VARCHAR},
...
...
@@ -271,8 +271,8 @@
-->
update cell_data
set id = #{record.id,jdbcType=BIGINT},
report_id = #{record.reportId,jdbcType=
VARCHAR
},
cell_template_id = #{record.cellTemplateId,jdbcType=
VARCHAR
},
report_id = #{record.reportId,jdbcType=
BIGINT
},
cell_template_id = #{record.cellTemplateId,jdbcType=
BIGINT
},
"data" = #{record.data,jdbcType=VARCHAR},
formula_exp = #{record.formulaExp,jdbcType=VARCHAR},
create_by = #{record.createBy,jdbcType=VARCHAR},
...
...
@@ -291,10 +291,10 @@
update cell_data
<set>
<if
test=
"reportId != null"
>
report_id = #{reportId,jdbcType=
VARCHAR
},
report_id = #{reportId,jdbcType=
BIGINT
},
</if>
<if
test=
"cellTemplateId != null"
>
cell_template_id = #{cellTemplateId,jdbcType=
VARCHAR
},
cell_template_id = #{cellTemplateId,jdbcType=
BIGINT
},
</if>
<if
test=
"data != null"
>
"data" = #{data,jdbcType=VARCHAR},
...
...
@@ -323,8 +323,8 @@
This element is automatically generated by MyBatis Generator, do not modify.
-->
update cell_data
set report_id = #{reportId,jdbcType=
VARCHAR
},
cell_template_id = #{cellTemplateId,jdbcType=
VARCHAR
},
set report_id = #{reportId,jdbcType=
BIGINT
},
cell_template_id = #{cellTemplateId,jdbcType=
BIGINT
},
"data" = #{data,jdbcType=VARCHAR},
formula_exp = #{formulaExp,jdbcType=VARCHAR},
create_by = #{createBy,jdbcType=VARCHAR},
...
...
atms-api/src/main/resources/pwc/taxtech/atms/vat/dao/ReportMapper.xml
View file @
b3ec20cc
This diff is collapsed.
Click to expand it.
atms-api/src/test/java/pwc/taxtech/atms/common/POITest.java
View file @
b3ec20cc
package
pwc
.
taxtech
.
atms
.
common
;
import
org.apache.poi.openxml4j.exceptions.InvalidFormatException
;
import
org.apache.poi.ss.formula.eval.ValueEval
;
import
org.apache.poi.ss.formula.functions.FreeRefFunction
;
import
org.apache.poi.ss.formula.udf.AggregatingUDFFinder
;
import
org.apache.poi.ss.formula.udf.DefaultUDFFinder
;
import
org.apache.poi.ss.formula.udf.UDFFinder
;
import
org.apache.poi.ss.usermodel.*
;
import
org.apache.poi.ss.util.CellReference
;
import
java.io.*
;
...
...
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