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
606f4439
Commit
606f4439
authored
Mar 21, 2019
by
chase
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
税金计算表功能开发
parent
7fc4b237
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
69 additions
and
52 deletions
+69
-52
ReportServiceImpl.java
.../pwc/taxtech/atms/vat/service/impl/ReportServiceImpl.java
+14
-5
KPSR.java
.../taxtech/atms/vat/service/impl/report/functions/KPSR.java
+6
-6
WPNAME.java
...axtech/atms/vat/service/impl/report/functions/WPNAME.java
+1
-1
tax-report-cell-detail-modal.ctrl.js
...rt-cell-detail-modal/tax-report-cell-detail-modal.ctrl.js
+20
-12
tax-report-cell-detail-modal.html
...eport-cell-detail-modal/tax-report-cell-detail-modal.html
+8
-8
vat-report-view.ctrl.js
...p/common/controls/vat-report-view/vat-report-view.ctrl.js
+4
-4
vat-layout.ctrl.js
...web/src/main/webapp/app/vat/vat-layout/vat-layout.ctrl.js
+16
-16
No files found.
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/ReportServiceImpl.java
View file @
606f4439
...
...
@@ -365,7 +365,8 @@ public class ReportServiceImpl extends BaseService {
}
@Transactional
public
void
assemblePeriodTemplate
(
Template
template
,
Workbook
workbook
,
String
projectId
,
Integer
period
,
Integer
addRowIndex
)
throws
ServiceException
{
public
void
assemblePeriodTemplate
(
Template
template
,
Workbook
workbook
,
String
projectId
,
Integer
period
,
List
<
Long
>
configIds
)
throws
ServiceException
{
int
addRowIndex
=
configIds
.
size
();
List
<
Integer
>
hasHandDatas
=
Arrays
.
asList
(
TaxesCalculateReportEnum
.
Column
.
Column_5
.
getIndex
(),
TaxesCalculateReportEnum
.
Column
.
Column_6
.
getIndex
(),
...
...
@@ -394,7 +395,11 @@ public class ReportServiceImpl extends BaseService {
}
if
(
r
<=
addRowIndex
+
1
)
{
String
cellId
=
projectId
+
template
.
getId
()+
period
+
r
+
c
;
if
((
r
-
1
)>=
0
&&(
r
-
1
)<
configIds
.
size
()){
cellId
+=
configIds
.
get
(
r
-
1
);
}
Long
cellTemplateId
=
Long
.
valueOf
(
cellId
.
hashCode
());
cellTemplateId
=
cellTemplateId
<
0
?
cellTemplateId:
(
cellTemplateId
*-
1
);
PeriodCellTemplate
cellTemplate
=
new
PeriodCellTemplate
();
cellTemplate
.
setPeriod
(
period
);
cellTemplate
.
setRowName
(
POIUtil
.
getCellFormulaString
(
cell
));
...
...
@@ -728,6 +733,7 @@ public class ReportServiceImpl extends BaseService {
String
queryDate
=
project
.
getYear
()+
"-"
+(
period
>=
10
?
period:
(
"0"
+
period
));
example
.
createCriteria
().
andOrgIdEqualTo
(
project
.
getOrganizationId
()).
andStartDateLessThanOrEqualTo
(
queryDate
).
andEndDateGreaterThanOrEqualTo
(
queryDate
).
andStatusEqualTo
(
0
);
example
.
setOrderByClause
(
" create_time "
);
List
<
RevenueConfig
>
dataList
=
revenueConfigMapper
.
selectByExample
(
example
);
//合计项map
Map
<
Integer
,
List
<
String
>>
sumMap
=
new
HashMap
<>();
...
...
@@ -736,14 +742,17 @@ public class ReportServiceImpl extends BaseService {
sumMap
.
put
(
TaxesCalculateReportEnum
.
Column
.
Column_7
.
getIndex
(),
new
ArrayList
<>());
sumMap
.
put
(
TaxesCalculateReportEnum
.
Column
.
Column_8
.
getIndex
(),
new
ArrayList
<>());
sumMap
.
put
(
TaxesCalculateReportEnum
.
Column
.
Column_10
.
getIndex
(),
new
ArrayList
<>());
List
<
Long
>
configIds
=
new
ArrayList
<>();
if
(
CollectionUtils
.
isNotEmpty
(
dataList
))
{
int
rowIndex
=
1
;
Row
sourceRow
=
sheet
.
getRow
(
3
);
for
(
RevenueConfig
config
:
dataList
)
{
configIds
.
add
(
config
.
getId
());
Row
row
=
POIUtil
.
createAndCloneRow
(
tWorkbook
,
sheet
,
1
,
sourceRow
);
row
.
getCell
(
TaxesCalculateReportEnum
.
Column
.
Column_1
.
getIndex
()).
setCellValue
(
"1-"
+
rowIndex
);
row
.
getCell
(
TaxesCalculateReportEnum
.
Column
.
Column_1
.
getIndex
()).
setCellValue
(
"1-"
+
(
dataList
.
size
()+
1
-
rowIndex
)
);
row
.
getCell
(
TaxesCalculateReportEnum
.
Column
.
Column_2
.
getIndex
()).
setCellValue
(
config
.
getName
());
row
.
getCell
(
TaxesCalculateReportEnum
.
Column
.
Column_3
.
getIndex
()).
setCellValue
(
""
);
row
.
getCell
(
TaxesCalculateReportEnum
.
Column
.
Column_4
.
getIndex
()).
setCellValue
(
"PC(\"FilterDate1\",2)"
);
...
...
@@ -764,13 +773,13 @@ public class ReportServiceImpl extends BaseService {
if
(
1
==
config
.
getTaxBase
())
{
//账载
row
.
getCell
(
TaxesCalculateReportEnum
.
Column
.
Column_8
.
getIndex
()).
setCellValue
(
"WPNAME(\"VAT020\",\"B\",\""
+
config
.
getName
()+
"\",\"E\")"
);
}
else
if
(
2
==
config
.
getTaxBase
())
{
//开票收入
row
.
getCell
(
TaxesCalculateReportEnum
.
Column
.
Column_8
.
getIndex
()).
setCellValue
(
"WPNAME(\"VAT020\",\"B\",\""
+
config
.
getName
()+
"\",\"F\")+"
+
"WPNAME(\"VAT020\",\"B\",\""
+
config
.
getName
()+
"\",\"G\")"
);
}
else
if
(
3
==
config
.
getTaxBase
())
{
//手工录入
}
else
if
(
4
==
config
.
getTaxBase
())
{
//借方发生额
row
.
getCell
(
TaxesCalculateReportEnum
.
Column
.
Column_8
.
getIndex
()).
setCellValue
(
"JFFS(\""
+
config
.
getTbSegment3
()
+
"\","
+
project
.
getYear
()
+
","
+
period
+
",1,,)"
);
}
else
if
(
5
==
config
.
getTaxBase
())
{
//贷方发生额
row
.
getCell
(
TaxesCalculateReportEnum
.
Column
.
Column_8
.
getIndex
()).
setCellValue
(
"DFFS(\""
+
config
.
getTbSegment3
()
+
"\","
+
project
.
getYear
()
+
","
+
period
+
",1,,)"
);
}
else
{
row
.
getCell
(
TaxesCalculateReportEnum
.
Column
.
Column_8
.
getIndex
()).
setCellValue
(
""
);
...
...
@@ -791,7 +800,7 @@ public class ReportServiceImpl extends BaseService {
//组装合计项数据
assembleSumRow
(
sheet
.
getRow
(
rowIndex
),
sumMap
);
}
assemblePeriodTemplate
(
template
,
tWorkbook
,
projectId
,
period
,
dataList
.
size
()
);
assemblePeriodTemplate
(
template
,
tWorkbook
,
projectId
,
period
,
configIds
);
return
tWorkbook
;
}
...
...
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/report/functions/KPSR.java
View file @
606f4439
package
pwc
.
taxtech
.
atms
.
vat
.
service
.
impl
.
report
.
functions
;
import
com.google.common.collect.Lists
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.poi.ss.formula.OperationEvaluationContext
;
import
org.apache.poi.ss.formula.eval.NumberEval
;
...
...
@@ -20,6 +19,7 @@ import pwc.taxtech.atms.vat.entity.RevenueTypeMapping;
import
pwc.taxtech.atms.vat.entity.RevenueTypeMappingExample
;
import
java.math.BigDecimal
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.stream.Collectors
;
...
...
@@ -42,17 +42,17 @@ public class KPSR extends FunctionBase implements FreeRefFunction {
Integer
billType
=
getIntParam
(
args
[
1
],
ec
);
//发票类型
String
formulaExpression
=
"KPSR(\""
+
revenueTypeName
+
"\","
+
billType
+
")"
;
logger
.
debug
(
formulaExpression
);
List
<
OutputInvoiceDataSourceDto
>
dataSource
=
Lists
.
newArrayList
();
double
result
=
countForTrialBalance
(
revenueTypeName
,
dataSource
,
billType
,
ec
);
Long
dataSoureId
=
saveDataSource
(
ec
,
Collections
.
singletonList
(
dataSource
),
FormulaDataSourceDetailType
.
InputInvoiceDataSourceDto
,
new
BigDecimal
(
result
),
formulaContext
.
getPeriod
(),
List
<
OutputInvoiceDataSourceDto
>
dataSource
=
new
ArrayList
<>();
double
result
=
assembleData
(
revenueTypeName
,
dataSource
,
billType
,
ec
);
Long
dataSoureId
=
saveDataSource
(
ec
,
Collections
.
singletonList
(
dataSource
),
FormulaDataSourceDetailType
.
OutputInvoiceDataSourceDto
,
new
BigDecimal
(
result
),
formulaContext
.
getPeriod
(),
formulaContext
.
getReportTemplateGroupId
(),
formulaContext
.
getProjectId
());
saveFormulaBlock
(
formulaContext
.
getPeriod
(),
ec
,
formulaExpression
,
new
BigDecimal
(
result
),
dataSoureId
,
formulaContext
.
getProjectId
());
return
new
NumberEval
(
result
);
}
private
double
countForTrialBalance
(
String
revenueTypeName
,
List
<
OutputInvoiceDataSourceDto
>
contain
,
Integer
billType
,
OperationEvaluationContext
ec
)
{
private
double
assembleData
(
String
revenueTypeName
,
List
<
OutputInvoiceDataSourceDto
>
contain
,
Integer
billType
,
OperationEvaluationContext
ec
)
{
String
queryDate
=
formulaContext
.
getYear
()+(
formulaContext
.
getPeriod
()<
10
?(
"0"
+
formulaContext
.
getPeriod
()):(
formulaContext
.
getPeriod
()+
""
));
RevenueTypeMappingExample
typeMappingExample
=
new
RevenueTypeMappingExample
();
typeMappingExample
.
createCriteria
().
andOrgIdEqualTo
(
formulaContext
.
getOrganizationId
())
...
...
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/report/functions/WPNAME.java
View file @
606f4439
...
...
@@ -70,7 +70,7 @@ public class WPNAME extends FunctionBase implements FreeRefFunction {
throw
e
;
}
finally
{
LOGGER
.
warn
(
"[BB_Exception] error for bb cacls for {}"
,
bo
.
toString
());
Long
dataSourceId
=
saveDataSource
(
ec
,
dataSource
,
FormulaDataSourceType
.
Other
,
FormulaDataSourceDetailType
.
Tax
CellDataSourceDto
,
Long
dataSourceId
=
saveDataSource
(
ec
,
dataSource
,
FormulaDataSourceType
.
Report
,
FormulaDataSourceDetailType
.
Report
CellDataSourceDto
,
cellValue
,
formulaContext
.
getPeriod
(),
formulaContext
.
getReportTemplateGroupId
(),
cellTemplateData
.
getColumnIndex
(),
cellTemplateData
.
getRowIndex
(),
formulaContext
.
getProjectId
());
...
...
atms-web/src/main/webapp/app/common/controls/tax-report-cell-detail-modal/tax-report-cell-detail-modal.ctrl.js
View file @
606f4439
...
...
@@ -696,13 +696,21 @@
+
' '
+
evalVal
.
formatAmount
(
precition
));
}
else
{
// For 报表数据源 and BSPL数据源
if
(
$scope
.
detail
.
dataGridSource
&&
$scope
.
detail
.
dataGridSource
.
length
>
0
)
{
evalVal
=
_
.
reduce
(
$scope
.
detail
.
dataGridSource
,
function
(
memo
,
x
)
{
return
memo
+
x
.
cellValue
;
},
0
);
//判断是否是动态生成sheet
if
(
new
Number
(
$scope
.
detail
.
cellTemplateId
)
<
0
){
$
(
"#dataGridFooterSummary"
).
html
(
""
);
}
else
{
evalVal
=
_
.
reduce
(
$scope
.
detail
.
dataGridSource
,
function
(
memo
,
x
)
{
return
memo
+
x
.
cellValue
;
},
0
);
$
(
"#dataGridFooterSummary"
).
html
(
$translate
.
instant
(
'Conclusion'
)
+
' '
+
evalVal
.
formatAmount
(
precition
));
}
$
(
"#dataGridFooterSummary"
).
html
(
$translate
.
instant
(
'Conclusion'
)
+
' '
+
evalVal
.
formatAmount
(
precition
));
}
else
{
var
summaryExp
=
''
;
...
...
@@ -1209,13 +1217,13 @@
alignment
:
'left'
,
width
:
'16%'
},
{
dataField
:
'project'
,
caption
:
$translate
.
instant
(
'Project'
),
alignment
:
'left'
,
width
:
'25%'
},
{
dataField
:
'reportColumn'
,
caption
:
$translate
.
instant
(
'TaxReportColumn'
),
alignment
:
'left'
,
width
:
'17%'
},
//
{dataField: 'project', caption: $translate.instant('Project'), alignment: 'left', width: '25%'},
//
{
//
dataField: 'reportColumn',
//
caption: $translate.instant('TaxReportColumn'),
//
alignment: 'left',
//
width: '17%'
//
},
{
dataField
:
'cellName'
,
caption
:
$translate
.
instant
(
'CellColumn'
),
...
...
atms-web/src/main/webapp/app/common/controls/tax-report-cell-detail-modal/tax-report-cell-detail-modal.html
View file @
606f4439
...
...
@@ -34,14 +34,14 @@
<label
class=
"cell-info-subject-label"
>
{{'CellColumn' | translate}}:
</label>
{{numToExcelChar(detail.rowIndex, detail.columnIndex)}}
</div>
<
div
class=
"cell-info-subject"
>
<
label
class=
"cell-info-subject-label"
>
{{'RowName' | translate}}:
</label
>
{{detail.cellInfo.project}}
<
/div
>
<
div
class=
"cell-info-subject"
>
<
label
class=
"cell-info-subject-label"
>
{{'ColumnName' | translate}}:
</label
>
{{detail.cellInfo.column}}
<
/div
>
<
!--<div class="cell-info-subject">--
>
<
!--<label class="cell-info-subject-label">{{'RowName' | translate}}:</label>--
>
<!--{{detail.cellInfo.project}}-->
<
!--</div>--
>
<
!--<div class="cell-info-subject">--
>
<
!--<label class="cell-info-subject-label">{{'ColumnName' | translate}}:</label>--
>
<!--{{detail.cellInfo.column}}-->
<
!--</div>--
>
<div
class=
"cell-info-subject"
>
<label
class=
"cell-info-subject-label"
>
{{'Formula' | translate}}
</label>
<formula-translator
formula-list=
"formulaList"
key-value-list=
"keyValueList"
include-optional=
"false"
...
...
atms-web/src/main/webapp/app/common/controls/vat-report-view/vat-report-view.ctrl.js
View file @
606f4439
...
...
@@ -620,12 +620,12 @@
//todo: according to element to get the detail data
var
outItems
;
var
convert
=
false
;
if
(
element
.
items
.
length
===
1
)
{
outItems
=
JSON
.
parse
(
element
.
items
[
0
]);
}
else
{
//
if (element.items.length === 1) {
//
outItems = JSON.parse(element.items[0]);
//
} else {
outItems
=
element
.
items
;
convert
=
true
;
}
//
}
//todo: according to element to get the detail data
angular
.
forEach
(
outItems
,
function
(
jsonData
)
{
...
...
atms-web/src/main/webapp/app/vat/vat-layout/vat-layout.ctrl.js
View file @
606f4439
...
...
@@ -385,14 +385,14 @@ function ($scope, $rootScope, $q, $log, $timeout, $state, $translate, projectSer
}
if
(
data
[
constant
.
vatPermission
.
dataAnalysis
.
modelAnalysisCode
])
{
$scope
.
menus
.
push
({
name
:
'analyzeLayout'
,
state
:
'analyzeLayout'
,
num
:
5
,
permission
:
constant
.
vatPermission
.
dataAnalysis
.
dataAnalysisCode
,
url
:
'#/vat/analyzeLayout'
});
subMenus
.
push
({
name
:
'analyzeLayout.analyzeReport'
,
state
:
'analyzeLayout.analyzeReport'
,
num
:
5
,
permission
:
constant
.
vatPermission
.
dataAnalysis
.
modelAnalysisCode
,
url
:
'#/vat/analyzeLayout/analyzeReport'
});
//
$scope.menus.push({
//
name: 'analyzeLayout', state: 'analyzeLayout', num: 5,
//
permission: constant.vatPermission.dataAnalysis.dataAnalysisCode, url: '#/vat/analyzeLayout'
//
});
//
subMenus.push({
//
name: 'analyzeLayout.analyzeReport', state: 'analyzeLayout.analyzeReport', num: 5,
//
permission: constant.vatPermission.dataAnalysis.modelAnalysisCode, url: '#/vat/analyzeLayout/analyzeReport'
//
});
}
//else if (data[constant.vatPermission.dataAnalysis.dashboard.dashboardCode]) {
// $scope.menus.push({
...
...
@@ -406,14 +406,14 @@ function ($scope, $rootScope, $q, $log, $timeout, $state, $translate, projectSer
//}
else
{
//data[constant.vatPermission.dataAnalysis.vatTaxDifferenceCode]
$scope
.
menus
.
push
({
name
:
'analyzeLayout'
,
state
:
'analyzeLayout'
,
num
:
5
,
permission
:
constant
.
vatPermission
.
dataAnalysis
.
dataAnalysisCode
,
url
:
'#/vat/analyzeLayout'
});
subMenus
.
push
({
name
:
'analyzeLayout.vatTaxDifference'
,
state
:
'analyzeLayout.vatTaxDifference'
,
num
:
5
,
permission
:
constant
.
vatPermission
.
dataAnalysis
.
vatTaxDifferenceCode
,
url
:
'#/analyzeLayout/vatTaxDifference'
});
//
$scope.menus.push({
//
name: 'analyzeLayout', state: 'analyzeLayout', num: 5,
//
permission: constant.vatPermission.dataAnalysis.dataAnalysisCode, url: '#/vat/analyzeLayout'
//
});
//
subMenus.push({
//
name: 'analyzeLayout.vatTaxDifference', state: 'analyzeLayout.vatTaxDifference', num: 5,
//
permission: constant.vatPermission.dataAnalysis.vatTaxDifferenceCode, url: '#/analyzeLayout/vatTaxDifference'
//
});
}
}
});
...
...
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