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
aab60a50
Commit
aab60a50
authored
Apr 06, 2019
by
Memorydoc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#
parent
9e20505d
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
68 additions
and
76 deletions
+68
-76
ReportController.java
...in/java/pwc/taxtech/atms/controller/ReportController.java
+0
-0
TemplateController.java
.../java/pwc/taxtech/atms/controller/TemplateController.java
+3
-11
TemplateServiceImpl.java
...va/pwc/taxtech/atms/service/impl/TemplateServiceImpl.java
+5
-0
ReportServiceImpl.java
.../pwc/taxtech/atms/vat/service/impl/ReportServiceImpl.java
+15
-0
table-report-sheet.js
...ain/webapp/app/analysis/table/sheet/table-report-sheet.js
+2
-0
tb-ebit-form.ctrl.js
...b/src/main/webapp/app/analysis/table/tb-ebit-form.ctrl.js
+34
-60
tb-ebit-form.html
...-web/src/main/webapp/app/analysis/table/tb-ebit-form.html
+1
-1
tb-ebit-form.less
...-web/src/main/webapp/app/analysis/table/tb-ebit-form.less
+1
-1
vatReportService.js
...rc/main/webapp/app/common/vatservices/vatReportService.js
+7
-3
No files found.
atms-api/src/main/java/pwc/taxtech/atms/controller/ReportController.java
View file @
aab60a50
This diff is collapsed.
Click to expand it.
atms-api/src/main/java/pwc/taxtech/atms/controller/TemplateController.java
View file @
aab60a50
...
...
@@ -289,7 +289,7 @@ public class TemplateController extends BaseController {
@RequestMapping
(
value
=
"getPeriodTemplateJsonOrg"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_OCTET_STREAM_VALUE
)
public
@ResponseBody
void
getPeriodTemplateJsonOrg
(
@RequestParam
(
name
=
"templateId"
)
Long
templateId
,
void
getPeriodTemplateJsonOrg
(
@RequestParam
(
name
=
"templateId"
)
Long
templateId
,
@RequestParam
(
name
=
"period"
)
Integer
period
,
@RequestParam
(
name
=
"orgId"
)
String
orgId
,
HttpServletResponse
response
)
throws
URISyntaxException
{
...
...
@@ -359,17 +359,9 @@ public class TemplateController extends BaseController {
}
}
}
List
<
PeriodTemplate
>
templates
=
Lists
.
newArrayList
();
if
(
projectId
==
null
||
""
.
equals
(
projectId
))
{
templates
=
templateService
.
getTemplates
(
templateId
);
}
else
{
templates
=
templateService
.
getPeriodTemplates
(
templateId
,
period
,
projectId
);
}
if
(
templates
.
size
()
==
0
){
templates
=
templateService
.
getTemplates
(
templateId
);
}
List
<
Template
>
templates
=
templateService
.
getTL
(
templateId
);
MyAsserts
.
assertNotEmpty
(
templates
,
new
NotFoundException
());
Period
Template
template
=
templates
.
get
(
0
);
Template
template
=
templates
.
get
(
0
);
String
templatePath
=
template
.
getPath
();
MyAsserts
.
assertNotEmpty
(
templatePath
,
new
NotFoundException
());
filePath
=
this
.
getClass
().
getResource
(
""
).
toURI
().
getPath
();
...
...
atms-api/src/main/java/pwc/taxtech/atms/service/impl/TemplateServiceImpl.java
View file @
aab60a50
...
...
@@ -128,6 +128,11 @@ public class TemplateServiceImpl extends AbstractService {
example
.
createCriteria
().
andTemplateIdEqualTo
(
templateId
);
return
periodTemplateMapper
.
selectByExample
(
example
);
}
public
List
<
Template
>
getTL
(
Long
templateId
){
TemplateExample
example
=
new
TemplateExample
();
example
.
createCriteria
().
andIdEqualTo
(
templateId
);
return
templateMapper
.
selectByExample
(
example
);
}
public
String
getTemplatePath
(
Long
templateId
)
{
...
...
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/ReportServiceImpl.java
View file @
aab60a50
...
...
@@ -20,6 +20,7 @@ import org.slf4j.Logger;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.jdbc.core.JdbcTemplate
;
import
org.springframework.stereotype.Component
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.multipart.MultipartFile
;
...
...
@@ -2457,6 +2458,20 @@ public class ReportServiceImpl extends BaseService {
example
.
createCriteria
().
andIdEqualTo
(
orgId
);
return
organizationMapper
.
selectByExample
(
example
).
get
(
0
).
getName
();
}
@Autowired
private
JdbcTemplate
jdbcTemplate
;
//获取利润表模板Id
public
String
getlxbId
()
throws
Exception
{
try
{
String
sql
=
"select * from template t where t.name = '利润表'"
;
Map
<
String
,
Object
>
stringObjectMap
=
new
HashMap
<>();
stringObjectMap
=
jdbcTemplate
.
queryForList
(
"select * from template t where t.name = '利润表' "
).
get
(
0
);
return
stringObjectMap
.
get
(
"id"
).
toString
();
}
catch
(
Exception
e
){
e
.
printStackTrace
();
throw
new
Exception
(
"获取EBIT利润表模板失败"
);
}
}
/* private String getCellStringValue(Cell cell) {
if (cell.getCellTypeEnum().equals(CellType.STRING)) {
...
...
atms-web/src/main/webapp/app/analysis/table/sheet/table-report-sheet.js
View file @
aab60a50
...
...
@@ -106,6 +106,8 @@
if
(
scope
.
relation
.
orgId
==
undefined
){
scope
.
relation
.
orgId
=
null
;
}
if
(
templateId
==
undefined
)
return
;
return
templateService
.
getPeriodTemplateJsonByOrg
(
templateId
,
scope
.
relation
.
period
,
scope
.
relation
.
orgId
).
then
(
function
(
reportSpread
)
{
var
spreadCtrl
=
getSpreadControl
();
if
(
spreadCtrl
)
{
...
...
atms-web/src/main/webapp/app/analysis/table/tb-ebit-form.ctrl.js
View file @
aab60a50
...
...
@@ -1100,6 +1100,10 @@
};
var
getReportData
=
function
(
period
)
{
if
(
$scope
.
relation
.
orgId
==
null
||
$scope
.
relation
.
orgId
==
undefined
){
$scope
.
relation
.
loadSheet
(
$scope
.
templateId
);
return
;
}
vatReportService
.
getReportEbitData
(
$scope
.
reportId
,
$scope
.
relation
.
orgId
,
period
!=
undefined
?
period
:
(
$scope
.
relation
.
period
==
undefined
?
period
:
$scope
.
relation
.
period
)).
success
(
function
(
reportData
)
{
if
(
reportData
&&
reportData
.
data
&&
reportData
.
data
.
cellData
)
{
_
.
each
(
reportData
.
data
.
cellData
,
function
(
x
)
{
...
...
@@ -1129,9 +1133,9 @@
//todo: according to templateId and period get reportId
period
=
Number
(
period
);
//转成Number类型
vatReportService
.
getReportByTemplateIdEbit
(
$scope
.
templateId
,
period
,
orgId
).
success
(
function
(
report
)
{
if
(
report
.
data
)
{
if
(
report
.
data
)
{
$scope
.
reportId
=
report
.
data
.
id
;
}
else
{
}
else
{
$scope
.
reportData
=
[];
$scope
.
formulaBlocks
=
[];
$scope
.
manualDataSources
=
[];
...
...
@@ -2832,34 +2836,6 @@
//--------------------------------------kevin insert -------------------------------------
$scope
.
relation
=
{};
/* var loadIndustry = function () {
vatReportService.getOrgLists().success(function (industryData) {
var _data = industryData.data;
$scope.relation.orgId = _data[0].id;
if (_data && _data.length > 0) {
//配置行业下拉列表
$scope.dataSourceIndustryList = {
dataSource: new DevExpress.data.ArrayStore({
data: _data
}),
displayExpr: 'name',
valueExpr: "id",
value: _data[0].id,
itemTemplate: 'orgList',
onItemClick: function (e) {
loadCellData($scope.relation.period, e.itemData.id,function(){
$scope.relation.orgId = e.itemData.id;
});
},
onInitialized: function (e) {
$scope.dataSourceIndustryListInstance = e.component;
}
}
$scope.curIndustry = _data[0];
$('#dx-select-industry').dxSelectBox('instance').option('value', $scope.relation.id);
}
});
};*/
$scope
.
changeDate
=
function
(
e
)
{
if
(
e
&&
e
.
date
)
{
...
...
@@ -2899,10 +2875,25 @@
$scope
.
changeDate
(
e
);
});
ele1
.
datepicker
(
"setDate"
,
$scope
.
selectedDate
);
$scope
.
templateId
=
"100610523201314816"
;
//这里先写死 todo 这里先写死利润表模板,后续会修改模板id
var
webApiHostUrl
=
loginContext
.
apiHost
+
constant
.
webapi
.
prefix
;
$
.
ajax
({
url
:
webApiHostUrl
+
"/Report/getlxbId"
,
type
:
"POST"
,
headers
:
{
'Access-Control-Allow-Origin'
:
'*'
,
Authorization
:
apiInterceptor
.
tokenType
+
' '
+
apiInterceptor
.
apiToken
(),
},
success
:
function
(
res
)
{
if
(
res
.
data
)
{
$scope
.
templateId
=
res
.
data
;
loadCellData
(
$scope
.
selectedDate
,
$scope
.
relation
.
orgId
);
}
else
{
SweetAlert
.
error
(
res
.
resultMsg
);
}
}
});
//初始化
$scope
.
relation
.
period
=
year
.
toString
()
+
monthRevert
(
mon
);
loadCellData
(
$scope
.
selectedDate
,
$scope
.
relation
.
orgId
);
//初始化数据,默认是当前period
};
var
monthRevert
=
function
(
mon
)
{
...
...
@@ -2924,7 +2915,7 @@
}
//数字校验
var
reg
=
/^
[
0-9
]
+
([
.
]{1}[
0-9
]
+
){0,1}
$/
;
if
(
!
reg
.
test
(
specialConsiderations
)
&&
specialConsiderations
!=
""
)
{
if
(
!
reg
.
test
(
specialConsiderations
)
&&
specialConsiderations
!=
""
)
{
SweetAlert
.
error
(
"请输入正确的特殊因素考虑值"
);
return
;
...
...
@@ -2952,23 +2943,6 @@
});
}
var
spreadTODb
=
function
()
{
/*//spread序列化参数
var serializationOption = {
ignoreFormula: false, // indicate to ignore the style when convert workbook to json, default value is false
ignoreStyle: false, // indicate to ignore the formula when convert workbook to json, default value is false
rowHeadersAsFrozenColumns: false, // indicate to treat the row headers as frozen columns when convert workbook to json, default value is false
columnHeadersAsFrozenRows: false // indicate to treat the column headers as frozen rows when convert workbook to json, default value is false
}
var jsonString = JSON.stringify($scope.spread.toJSON(serializationOption));
var obj = {
period : $scope.relation.period != undefined ? $scope.relation.period : null,
orgId : $scope.relation.orgId,
jsonString : jsonString
}
$http.post('/Report/spreadToDb', obj ,function(res){
if(!res.result)
SweetAlert.error("保存表单到数据库失败");
});*/
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
;
...
...
@@ -3159,24 +3133,24 @@
}, 500);*/
vatReportService
.
manyExport
(
param
);
};
/* $scope.relation._orgId = null;
$scope.$watch('relation._orgId', function (n, o) {
if (n != undefined)
$scope.relation.orgId = n.pop();
});*/
/* $scope.relation._orgId = null;
$scope.$watch('relation._orgId', function (n, o) {
if (n != undefined)
$scope.relation.orgId = n.pop();
});*/
var
initCompanyList
=
function
()
{
var
joinText
=
" <option value=''>请选择机构</option>"
;
vatReportService
.
getOrgLists
().
success
(
function
(
data
)
{
if
(
data
)
{
/*$scope.companyList = data.data;*/
for
(
var
a
=
0
;
a
<
data
.
data
.
length
;
a
++
)
{
joinText
+=
"<option value ="
+
data
.
data
[
a
].
id
+
" ng-bind = 'relation.orgId' data-id ="
+
data
.
data
[
a
].
id
+
" >"
+
data
.
data
[
a
].
name
+
"</option>"
;
for
(
var
a
=
0
;
a
<
data
.
data
.
length
;
a
++
)
{
joinText
+=
"<option value ="
+
data
.
data
[
a
].
id
+
" ng-bind = 'relation.orgId' data-id ="
+
data
.
data
[
a
].
id
+
" >"
+
data
.
data
[
a
].
name
+
"</option>"
;
}
$
(
'#orgList'
).
html
(
joinText
);
$
(
'.selectpicker'
).
selectpicker
();
setTimeout
(
function
()
{
$
(
'.dropdown-menu'
).
css
({
"min-width"
:
"0!important;"
,
"width"
:
"100%"
})
setTimeout
(
function
()
{
$
(
'.dropdown-menu'
).
css
({
"min-width"
:
"0!important;"
,
"width"
:
"100%"
})
},
1000
);
}
});
...
...
@@ -3184,7 +3158,7 @@
};
$
(
'.selectpicker'
).
on
(
'changed.bs.select'
,
function
(
e
,
clickedIndex
,
isSelected
,
value
)
{
$scope
.
relation
.
orgId
=
e
.
currentTarget
[
clickedIndex
].
value
;
$scope
.
relation
.
orgId
=
e
.
currentTarget
[
clickedIndex
].
value
;
loadCellData
(
$scope
.
relation
.
period
,
e
.
currentTarget
[
clickedIndex
].
value
);
});
...
...
atms-web/src/main/webapp/app/analysis/table/tb-ebit-form.html
View file @
aab60a50
<div
class=
"vat-report-view"
style=
"overflow-y: scroll"
>
<!--Report SpreadJS-->
<div
class=
"row"
style=
" height: 53px; background: #
ccc
;"
>
<div
class=
"row"
style=
" height: 53px; background: #
f5f5f5
;"
>
<div
class=
"col-sm-7 navLeft "
style=
" margin-top: 10px;"
>
<div
class=
"col-sm-8"
>
<span
class=
"text-bold"
translate=
"SelectedOrganization"
></span><span>
:
</span>
...
...
atms-web/src/main/webapp/app/analysis/table/tb-ebit-form.less
View file @
aab60a50
...
...
@@ -124,7 +124,7 @@
}
@media screen and (min-width:1400px) {
.navRight{
right: -
8
%!important;
right: -
7
%!important;
}
...
...
atms-web/src/main/webapp/app/common/vatservices/vatReportService.js
View file @
aab60a50
...
...
@@ -70,7 +70,7 @@
return
$http
.
post
(
'/Report/reportEbitData'
,
param
,
apiConfig
.
createVat
({
contentType
:
"application/json"
}));
},
manyExport
:
function
(
param
)
{
var
toParam
=
JSON
.
stringify
(
param
);
var
toParam
=
JSON
.
stringify
(
param
);
return
$http
.
post
(
'/Report/manyExport'
,
toParam
,
apiConfig
.
createVat
({
responseType
:
'arraybuffer'
})).
then
(
function
(
response
)
{
var
a
=
document
.
createElement
(
'a'
);
...
...
@@ -237,8 +237,12 @@
if
(
!
_
.
isNumber
(
period
))
{
period
=
0
;
}
return
$http
.
get
(
'/Report/getReportByTemplateEbit/'
+
templateId
+
'/'
+
period
+
'/'
+
orgId
,
apiConfig
.
createVat
());
var
param
=
{
templateId
:
templateId
,
period
:
period
,
orgId
:
orgId
}
return
$http
.
post
(
"/Report/getReportByTemplateEbit"
,
JSON
.
stringify
(
param
),
apiConfig
.
createVat
());
},
getDataSourceDetailList
:
function
(
dataSourceId
)
{
return
$http
.
get
(
'/Report/getDataSourceDetailList/'
+
dataSourceId
,
apiConfig
.
createVat
());
...
...
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