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
f8f0ae8f
Commit
f8f0ae8f
authored
Apr 08, 2019
by
Memorydoc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#
parent
3e4f7a27
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
193 additions
and
32 deletions
+193
-32
ReportController.java
...in/java/pwc/taxtech/atms/controller/ReportController.java
+4
-7
ReportServiceImpl.java
.../pwc/taxtech/atms/vat/service/impl/ReportServiceImpl.java
+0
-0
vatGeneratorConfig.xml
atms-dao/etc/generator-mysql/vatGeneratorConfig.xml
+1
-1
ProfitLossStatementEbitMapper.java
...c/taxtech/atms/vat/dao/ProfitLossStatementEbitMapper.java
+109
-0
ProfitLossStatementEbit.java
.../pwc/taxtech/atms/vat/entity/ProfitLossStatementEbit.java
+0
-0
ProfitLossStatementEbitExample.java
...xtech/atms/vat/entity/ProfitLossStatementEbitExample.java
+0
-0
ProfitLossStatementEbitMapper.xml
...wc/taxtech/atms/vat/dao/ProfitLossStatementEbitMapper.xml
+0
-0
table-report-sheet.js
...ain/webapp/app/analysis/table/sheet/table-report-sheet.js
+10
-11
tb-ebit-form.ctrl.js
...b/src/main/webapp/app/analysis/table/tb-ebit-form.ctrl.js
+69
-13
No files found.
atms-api/src/main/java/pwc/taxtech/atms/controller/ReportController.java
View file @
f8f0ae8f
...
...
@@ -336,25 +336,22 @@ public class ReportController {
}
@RequestMapping
(
value
=
"saveAndRefresh"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
OperationResultDto
saveAndRefresh
(
/*@RequestParam(value = "orgId") String orgId,
/*
@RequestMapping(value = "saveAndRefresh", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public OperationResultDto saveAndRefresh(
*/
/*@RequestParam(value = "orgId") String orgId,
@RequestParam(value = "period") Integer period,
@RequestParam(value = "specialConsiderations", defaultValue = "0") Integer specialConsiderations,
@RequestParam(value = "ebitRate", defaultValue = "1") String ebitRate,
@RequestParam(value = "reportId") Long reportId,*/
@RequestBody
RequestParameterDto
requestParameterDto
)
{
@RequestParam(value = "reportId") Long reportId,*/
/*
@RequestBody RequestParameterDto requestParameterDto) {
OperationResultDto operationResultDto = new OperationResultDto();
String projId = getProjId(requestParameterDto.getOrgId(), requestParameterDto.getPeriod());
try {
operationResultDto.setData(reportService.loadEbitData(requestParameterDto.getOrgId(), requestParameterDto.getPeriod(), requestParameterDto.getSpecialConsiderations(), requestParameterDto.getEbitRate()));
/* new Thread(()->{
reportService.saveDatasource(orgId, period, specialConsiderations, ebitRate, operationResultDto, reportService.getCellData(Long.parseLong(requestParameterDto.getReportId()),projId ).getData().getCellData());
}).start();*/
} catch (Exception e) {
return operationResultDto.error();
}
operationResultDto.setResultMsg("success");
return operationResultDto;
}
}
*/
@RequestMapping
(
"getlxbId"
)
public
OperationResultDto
getlxbId
()
{
...
...
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/ReportServiceImpl.java
View file @
f8f0ae8f
This diff is collapsed.
Click to expand it.
atms-dao/etc/generator-mysql/vatGeneratorConfig.xml
View file @
f8f0ae8f
...
...
@@ -40,7 +40,7 @@
<javaClientGenerator
type=
"XMLMAPPER"
targetPackage=
"pwc.taxtech.atms.vat.dao"
targetProject=
"../../src/main/java"
>
<property
name=
"rootInterface"
value=
"pwc.taxtech.atms.MyVatMapper"
/>
</javaClientGenerator>
<table
tableName=
"
ebit_spread_data"
domainObjectName=
"EbitSpreadData
"
>
<table
tableName=
"
profit_loss_statement_ebit"
domainObjectName=
"ProfitLossStatementEbit
"
>
<property
name=
"useActualColumnNames"
value=
"false"
/>
<property
name=
"ignoreQualifiersAtRuntime"
value=
"true"
/>
</table>
...
...
atms-dao/src/main/java/pwc/taxtech/atms/vat/dao/ProfitLossStatementEbitMapper.java
0 → 100644
View file @
f8f0ae8f
package
pwc
.
taxtech
.
atms
.
vat
.
dao
;
import
java.util.List
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.session.RowBounds
;
import
pwc.taxtech.atms.MyVatMapper
;
import
pwc.taxtech.atms.vat.entity.ProfitLossStatementEbit
;
import
pwc.taxtech.atms.vat.entity.ProfitLossStatementEbitExample
;
@Mapper
public
interface
ProfitLossStatementEbitMapper
extends
MyVatMapper
{
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table profit_loss_statement_ebit
*
* @mbg.generated
*/
long
countByExample
(
ProfitLossStatementEbitExample
example
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table profit_loss_statement_ebit
*
* @mbg.generated
*/
int
deleteByExample
(
ProfitLossStatementEbitExample
example
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table profit_loss_statement_ebit
*
* @mbg.generated
*/
int
deleteByPrimaryKey
(
Long
id
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table profit_loss_statement_ebit
*
* @mbg.generated
*/
int
insert
(
ProfitLossStatementEbit
record
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table profit_loss_statement_ebit
*
* @mbg.generated
*/
int
insertSelective
(
ProfitLossStatementEbit
record
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table profit_loss_statement_ebit
*
* @mbg.generated
*/
List
<
ProfitLossStatementEbit
>
selectByExampleWithRowbounds
(
ProfitLossStatementEbitExample
example
,
RowBounds
rowBounds
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table profit_loss_statement_ebit
*
* @mbg.generated
*/
List
<
ProfitLossStatementEbit
>
selectByExample
(
ProfitLossStatementEbitExample
example
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table profit_loss_statement_ebit
*
* @mbg.generated
*/
ProfitLossStatementEbit
selectByPrimaryKey
(
Long
id
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table profit_loss_statement_ebit
*
* @mbg.generated
*/
int
updateByExampleSelective
(
@Param
(
"record"
)
ProfitLossStatementEbit
record
,
@Param
(
"example"
)
ProfitLossStatementEbitExample
example
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table profit_loss_statement_ebit
*
* @mbg.generated
*/
int
updateByExample
(
@Param
(
"record"
)
ProfitLossStatementEbit
record
,
@Param
(
"example"
)
ProfitLossStatementEbitExample
example
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table profit_loss_statement_ebit
*
* @mbg.generated
*/
int
updateByPrimaryKeySelective
(
ProfitLossStatementEbit
record
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table profit_loss_statement_ebit
*
* @mbg.generated
*/
int
updateByPrimaryKey
(
ProfitLossStatementEbit
record
);
}
\ No newline at end of file
atms-dao/src/main/java/pwc/taxtech/atms/vat/entity/ProfitLossStatementEbit.java
0 → 100644
View file @
f8f0ae8f
This diff is collapsed.
Click to expand it.
atms-dao/src/main/java/pwc/taxtech/atms/vat/entity/ProfitLossStatementEbitExample.java
0 → 100644
View file @
f8f0ae8f
This diff is collapsed.
Click to expand it.
atms-dao/src/main/resources/pwc/taxtech/atms/vat/dao/ProfitLossStatementEbitMapper.xml
0 → 100644
View file @
f8f0ae8f
This diff is collapsed.
Click to expand it.
atms-web/src/main/webapp/app/analysis/table/sheet/table-report-sheet.js
View file @
f8f0ae8f
...
...
@@ -99,7 +99,7 @@
//var prokjectId = vatSessionService.project.id;
//var period = vatSessionService.month;
/* if (!init) {
addEbitRow();
scope.relation.
addEbitRow();
setData(init)
return;
}*/
...
...
@@ -195,7 +195,7 @@
scope
.
spread
=
spread
;
setColWidth
(
sheet
);
if
(
sheet
.
getRowCount
()
<=
38
)
addEbitRow
(
sheet
)
scope
.
relation
.
addEbitRow
(
sheet
)
if
(
scope
.
templateId
&&
scope
.
reportSource
)
{
setData
();
}
...
...
@@ -204,10 +204,9 @@
return
$q
.
when
(
spread
);
};
var
addEbitRow
=
function
(
sheet
)
{
scope
.
relation
.
addEbitRow
=
function
(
sheet
)
{
if
(
sheet
==
undefined
||
sheet
==
null
)
sheet
=
scope
.
spread
.
getActiveSheet
();
//添加单元格
if
(
sheet
.
getRowCount
()
>
43
)
return
;
...
...
@@ -218,10 +217,10 @@
sheet
.
addRows
(
sheet
.
getRowCount
(
scope
.
relation
.
sheetArea
.
viewport
),
1
);
sheet
.
setValue
(
i
+
37
,
0
,
profileList
[
i
]);
}
lockCell
(
scope
.
spread
);
scope
.
relation
.
lockCell
(
scope
.
spread
);
}
var
lockCell
=
function
(
spread
)
{
scope
.
relation
.
lockCell
=
function
(
spread
)
{
//todo:注册之后这里去掉注释
var
sheet
;
if
(
constant
.
regesterInformation
.
active
)
{
...
...
@@ -321,9 +320,9 @@
return;
}*/
if
(
upload
){
//上传上来的文件也要动态添加行
addEbitRow
(
sheet
);
scope
.
relation
.
addEbitRow
(
sheet
);
scope
.
relation
.
loadEbitCell
(
sheet
);
lockCell
(
scope
.
spread
);
scope
.
relation
.
lockCell
(
scope
.
spread
);
setColWidth
(
sheet
);
scope
.
spread
.
resumePaint
();
return
...
...
@@ -335,13 +334,13 @@
//spreadJsTipService.initialize(sheet);
/*if (!scope.isReadOnly) {
lockCell(scope.spread, false, true);
scope.relation.
lockCell(scope.spread, false, true);
}*/
scope
.
spread
.
suspendPaint
();
/* if (scope.reportSource.length == 0 && scope.relation.emptyData && scope.relation.emptyData == true) {
_init(scope.templateId, true);///如果没有数据,需要重新加载
lockCell(scope.spread);
scope.relation.
lockCell(scope.spread);
return;
}
*/
...
...
@@ -367,7 +366,7 @@
}
}
}
lockCell
(
scope
.
spread
);
scope
.
relation
.
lockCell
(
scope
.
spread
);
scope
.
spread
.
resumePaint
();
scope
.
relation
.
saveToDbFlag
=
Math
.
random
();
...
...
atms-web/src/main/webapp/app/analysis/table/tb-ebit-form.ctrl.js
View file @
f8f0ae8f
...
...
@@ -1100,7 +1100,7 @@
};
var
getReportData
=
function
(
period
)
{
if
(
$scope
.
relation
.
orgId
==
null
||
$scope
.
relation
.
orgId
==
undefined
)
{
if
(
$scope
.
relation
.
orgId
==
null
||
$scope
.
relation
.
orgId
==
undefined
)
{
$scope
.
relation
.
loadSheet
(
$scope
.
templateId
);
return
;
}
...
...
@@ -2931,16 +2931,23 @@
SweetAlert
.
error
(
"请输入正确的EBIT Rate"
);
}
vatReportService
.
saveAndRefresh
(
$scope
.
relation
.
orgId
,
$scope
.
relation
.
period
,
specialConsiderations
,
ebitRate
).
success
(
function
(
res
)
{
if
(
res
.
resultMsg
==
"success"
)
{
if
(
res
.
data
)
$scope
.
relation
.
data
=
res
.
data
;
$scope
.
relation
.
setData
(
true
);
spreadTODb
();
}
}).
error
(
function
(
error
)
{
});
/* vatReportService.saveAndRefresh($scope.relation.orgId, $scope.relation.period, specialConsiderations, ebitRate).success(function (res) {
if (res.resultMsg == "success") {
if (res.data) $scope.relation.data = res.data;
$scope.relation.setData(true);
}
}).error(function (error) {
});*/
calculateEbitAndInsert
(
$scope
.
sheet
,
true
);
spreadTODb
();
}
var
spreadTODb
=
function
()
{
if
(
$scope
.
relation
.
period
==
undefined
||
$scope
.
relation
.
period
==
null
)
{
SweetAlert
.
error
(
"请选择机构"
);
return
;
}
var
json
=
$scope
.
spread
.
toJSON
({
includeBindingSource
:
true
});
var
excelIo
=
new
GC
.
Spread
.
Excel
.
IO
();
var
url
=
apiInterceptor
.
webApiHostUrl
+
'/Report/spreadToDb?orgId='
+
$scope
.
relation
.
orgId
+
"&period="
+
$scope
.
relation
.
period
;
...
...
@@ -2979,8 +2986,13 @@
});
//上传模板
$scope
.
upload
=
function
(
file
)
{
if
(
file
==
undefined
||
file
==
null
||
file
.
length
==
0
)
return
if
(
$scope
.
relation
.
orgId
==
null
||
$scope
.
relation
.
orgId
==
undefined
)
{
SweetAlert
.
error
(
"请选择机构"
);
return
;
}
file
=
file
[
0
];
frontImport
(
file
);
//前端导入
/*if(file.length == 0)
...
...
@@ -3061,16 +3073,20 @@
excelIo
.
open
(
file
,
function
(
json
)
{
var
workbookObj
=
json
;
$scope
.
spread
.
fromJSON
(
workbookObj
);
vatReportService
.
saveAndRefresh
(
$scope
.
relation
.
orgId
,
$scope
.
relation
.
period
,
0
,
"1"
).
success
(
function
(
res
)
{
var
sheet
=
$scope
.
spread
.
sheets
[
0
];
/*vatReportService.saveAndRefresh($scope.relation.orgId, $scope.relation.period, 0, "1").success(function (res) {
if (res.resultMsg == "success") {
if (res.data) $scope.relation.data = res.data;
$scope.relation.setData(true);
}
}).error(function (error) {
});
});*/
//进行ebit计算,这里是前端计算
$scope
.
relation
.
addEbitRow
(
sheet
);
calculateEbitAndInsert
(
sheet
,
true
);
$scope
.
relation
.
lockCell
(
$scope
.
spread
);
spreadTODb
();
},
function
(
e
)
{
// process error
alert
(
e
.
errorMessage
);
if
(
e
.
errorCode
===
2
/*noPassword*/
||
e
.
errorCode
===
3
/*invalidPassword*/
)
{
...
...
@@ -3078,6 +3094,46 @@
});
}
}
$scope
.
_ebitResult
=
{};
//给String 对象添加replaceAll方法
String
.
prototype
.
replaceAll
=
function
(
s1
,
s2
)
{
return
this
.
replace
(
new
RegExp
(
s1
,
"gm"
),
s2
);
}
var
calculateEbitAndInsert
=
function
(
sheet
,
insert
)
{
var
yysr
=
Number
(
sheet
.
getValue
(
11
,
2
).
toString
().
replaceAll
(
","
,
""
));
//营业收入
var
yycb
=
Number
(
sheet
.
getValue
(
12
,
2
).
toString
().
replaceAll
(
","
,
""
));
//营业成本
var
yysjfj
=
Number
(
sheet
.
getValue
(
13
,
2
).
toString
().
replaceAll
(
","
,
""
));
//营业税金附加
var
xsfy
=
Number
(
sheet
.
getValue
(
14
,
2
).
toString
().
replaceAll
(
","
,
""
));
//销售费用
var
glfy
=
Number
(
sheet
.
getValue
(
15
,
2
).
toString
().
replaceAll
(
","
,
""
));
//管理费用
var
yffy
=
Number
(
sheet
.
getValue
(
16
,
2
).
toString
().
replaceAll
(
","
,
""
));
//研发费用
var
zcjzss
=
Number
(
sheet
.
getValue
(
18
,
2
).
toString
().
replaceAll
(
","
,
""
));
//资产减值损失
var
ts
=
(
sheet
.
getValue
(
38
,
2
)
==
""
||
sheet
.
getValue
(
38
,
2
)
==
null
)
==
true
?
0
:
sheet
.
getValue
(
40
,
2
);
var
rate
=
(
sheet
.
getValue
(
40
,
2
)
==
""
||
sheet
.
getValue
(
40
,
2
)
==
null
)
==
true
?
"1%"
:
sheet
.
getValue
(
40
,
2
);
$scope
.
_ebitResult
.
klzcjsz
=
Number
((
yysr
-
yycb
-
yysjfj
-
xsfy
-
glfy
-
yffy
-
zcjzss
).
toFixed
(
4
));
$scope
.
_ebitResult
.
tsyskl
=
Number
((
Number
(
ts
)).
toFixed
(
4
));
$scope
.
_ebitResult
.
kltsys
=
(
$scope
.
_ebitResult
.
klzcjsz
+
$scope
.
_ebitResult
.
tsyskl
).
toFixed
(
4
);
$scope
.
_ebitResult
.
rate
=
rate
;
if
(
$scope
.
_ebitResult
.
rate
.
indexOf
(
"%"
)
!=
-
1
){
$scope
.
_ebitResult
.
gljyye
=
Number
((
Number
(
$scope
.
_ebitResult
.
rate
.
replaceAll
(
"%"
,
""
))
*
$scope
.
_ebitResult
.
kltsys
).
toFixed
(
4
));
}
else
{
$scope
.
_ebitResult
.
gljyye
=
Number
((
$scope
.
_ebitResult
.
rate
*
$scope
.
_ebitResult
.
kltsys
).
toFixed
(
4
));
}
$scope
.
_ebitResult
.
sixAddtax
=
Number
((
0.06
*
$scope
.
_ebitResult
.
gljyye
).
toFixed
(
4
));
$scope
.
_ebitResult
.
tsklys
=
Number
((
$scope
.
_ebitResult
.
gljyye
*
0.106
).
toFixed
(
4
));
if
(
insert
)
{
sheet
.
setValue
(
37
,
2
,
$scope
.
_ebitResult
.
klzcjsz
);
sheet
.
setValue
(
38
,
2
,
$scope
.
_ebitResult
.
tsklys
);
sheet
.
setValue
(
39
,
2
,
$scope
.
_ebitResult
.
kltsys
);
sheet
.
setValue
(
40
,
2
,
$scope
.
_ebitResult
.
rate
);
sheet
.
setValue
(
41
,
2
,
$scope
.
_ebitResult
.
gljyye
);
sheet
.
setValue
(
42
,
2
,
$scope
.
_ebitResult
.
sixAddtax
);
sheet
.
setValue
(
43
,
2
,
$scope
.
_ebitResult
.
klzcjsz
);
}
}
$scope
.
singleExport
=
function
()
{
if
(
$scope
.
spread
!=
undefined
&&
$scope
.
spread
)
{
...
...
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