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
369d172a
Commit
369d172a
authored
Aug 02, 2019
by
frank.xa.zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
batch upload for template download -- frank
parent
0a59ae29
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
266 additions
and
22 deletions
+266
-22
EnumImportType.java
.../java/pwc/taxtech/atms/constant/enums/EnumImportType.java
+2
-1
org_import_template.xlsx
...in/resources/Document/DataImport/org_import_template.xlsx
+0
-0
organization-manage.ctrl.js
...astructure/organizationManage/organization-manage.ctrl.js
+5
-0
organization-manage.html
...nfrastructure/organizationManage/organization-manage.html
+8
-3
upload-org-modal.ctrl.js
...common/controls/upload-org-modal/upload-org-modal.ctrl.js
+152
-0
upload-org-modal.html
...pp/common/controls/upload-org-modal/upload-org-modal.html
+28
-0
upload-org-modal.js
.../app/common/controls/upload-org-modal/upload-org-modal.js
+16
-0
upload-org-modal.less
...pp/common/controls/upload-org-modal/upload-org-modal.less
+32
-0
constant.js
atms-web/src/main/webapp/app/common/utils/constant.js
+2
-1
template.svc.js
...eb/src/main/webapp/app/common/webservices/template.svc.js
+21
-17
No files found.
atms-api/src/main/java/pwc/taxtech/atms/constant/enums/EnumImportType.java
View file @
369d172a
...
...
@@ -17,7 +17,8 @@ public enum EnumImportType {
RevenueConfig
(
13
),
BacklogDetail
(
14
),
BacklogConfig
(
15
),
BacklogGroup
(
16
)
BacklogGroup
(
16
),
orgUpload
(
17
)
;
private
Integer
code
;
...
...
atms-api/src/main/resources/Document/DataImport/org_import_template.xlsx
0 → 100644
View file @
369d172a
File added
atms-web/src/main/webapp/app/admin/infrastructure/organizationManage/organization-manage.ctrl.js
View file @
369d172a
...
...
@@ -1651,6 +1651,11 @@
$scope
.
showPage1
=
function
()
{
showPage4
=
false
;
};
$scope
.
isShowUpload
=
false
;
$scope
.
importOrgs
=
function
()
{
$scope
.
isShowUpload
=
true
;
$scope
.
excelF
=
null
;
};
(
function
initialize
()
{
$log
.
debug
(
'organizationManageController.ctor()...'
);
...
...
atms-web/src/main/webapp/app/admin/infrastructure/organizationManage/organization-manage.html
View file @
369d172a
...
...
@@ -55,9 +55,13 @@
<button
type=
"button"
class=
"btn btn-in-grid"
style=
"width: 117px;"
ng-click=
"refreshOrg()"
id=
"orgListRefreshBtn"
>
<i
class=
"dx-icon-refresh"
></i>
{{'Refresh' | translate}}
</button>
<button
type=
"button"
id=
"organizationExportBtn"
class=
"btn btn-in-grid"
ng-click=
"exportOrgs()"
><i
class=
"dx-icon-export"
></i>
{{'Export'||translate}}
<!--<button type="button" id="organizationExportBtn"-->
<!--class="btn btn-in-grid" ng-click="exportOrgs()"><i-->
<!--class="dx-icon-export"></i>{{'Export'||translate}}-->
<!--</button>-->
<button
type=
"button"
id=
"organizationImportBtn"
class=
"btn btn-in-grid"
ng-click=
"importOrgs()"
><i
class=
"dx-icon-upload"
></i>
{{'Import'||translate}}
</button>
<span
class=
"right-operate"
></span>
</div>
...
...
@@ -397,6 +401,7 @@
on-save=
"saveShareholder2(shareholderEntity)"
></edit-organization-shareholder-modal>
<edit-organization-director-modal
is-show-d=
"isShowDirectorModal2"
parent-page=
".system-manage"
edit-model-d=
"gModel.editDirectorModel"
on-close=
"closeDirector2()"
on-save=
"saveDirector2(directorEntity)"
></edit-organization-director-modal>
<upload-org-modal
is-show=
"isShowUpload"
parent-page=
".system-manage"
import-excel-f=
"excelF"
></upload-org-modal>
<!--<edit-equity-modal operate-type="equityEditOperateType" is-update="isEquityUpdate"-->
<!--selected-organization="selectedOrg"></edit-equity-modal>-->
<!--<edit-equity-change-modal operate-type="equityChangeOperateType" is-update="isEquityChange"-->
...
...
atms-web/src/main/webapp/app/common/controls/upload-org-modal/upload-org-modal.ctrl.js
0 → 100644
View file @
369d172a
commonModule
.
controller
(
'uploadOrgModalController'
,
[
'$scope'
,
'$log'
,
'$translate'
,
'$timeout'
,
'apiInterceptor'
,
'Upload'
,
'ackUibModal'
,
'$q'
,
'SweetAlert'
,
'templateService'
,
function
(
$scope
,
$log
,
$translate
,
$timeout
,
apiInterceptor
,
Upload
,
ackUibModal
,
$q
,
SweetAlert
,
templateService
)
{
'use strict'
;
$log
.
debug
(
'uploadOrgModalController.ctor()...'
);
//模态框管理
$scope
.
modalManage
=
{
uploadOrgModal
:
{
open
:
function
()
{
$scope
.
modalInstance
=
ackUibModal
(
$scope
,
'upload-org-modal.html'
,
'upload-org-modal'
,
$scope
.
parentPage
,
'static'
,
function
()
{
$scope
.
isShow
=
false
;
ackMessageBox
.
close
();
});
$scope
.
modalInstance
.
open
();
},
close
:
function
()
{
$scope
.
modalInstance
.
close
();
},
cancel
:
function
()
{
$scope
.
modalInstance
.
cancel
();
}
}
};
$scope
.
upload
=
{
importExcelF
:
null
};
$scope
.
importRLITExcelFile
=
apiInterceptor
.
webApiHostUrl
+
'/DataImport/RLITExcelFile'
;
$scope
.
downloadTemplate
=
function
()
{
templateService
.
downloadTemplate
().
success
(
function
(
data
,
status
,
headers
)
{
var
octetStreamMime
=
'application/octet-stream'
;
var
contentType
=
headers
(
'content-type'
)
||
octetStreamMime
;
if
(
window
.
navigator
.
msSaveBlob
)
{
var
blob
=
new
Blob
([
data
],
{
type
:
contentType
});
navigator
.
msSaveBlob
(
blob
,
"org_import_template"
);
}
else
{
var
urlCreator
=
window
.
URL
||
window
.
webkitURL
||
window
.
mozURL
||
window
.
msURL
;
if
(
urlCreator
)
{
var
a
=
document
.
createElement
(
'a'
);
var
blob
=
new
Blob
([
data
],
{
type
:
contentType
});
var
url
=
urlCreator
.
createObjectURL
(
blob
);
a
.
href
=
url
;
a
.
target
=
'_blank'
;
a
.
download
=
"org_import_template.xlsx"
;
document
.
body
.
appendChild
(
a
);
a
.
click
();
}
}
}).
error
(
function
()
{
SweetAlert
.
error
(
$translate
.
instant
(
'PleaseContactAdministrator'
));
});
};
//导入事件
$scope
.
doUploadRLIT
=
function
(
importType
)
{
var
impExl
=
$scope
.
upload
.
importExcelF
;
var
deferred
=
$q
.
defer
();
var
token
=
$
(
'input[name="__RequestVerificationToken"]'
).
val
();
if
(
!
impExl
)
{
SweetAlert
.
warning
(
$translate
.
instant
(
'PleaseSelectFileFirst'
));
return
;
}
//列名对应验证
/*if (validationColumnMapping()) {
//数据类型验证
validationTbData().then(function (isSuccess) {
if (isSuccess) {
});
}*/
Upload
.
upload
({
url
:
$scope
.
importRLITExcelFile
,
data
:
{
importType
:
importType
},
file
:
impExl
,
headers
:
{
'Access-Control-Allow-Origin'
:
'*'
,
Authorization
:
apiInterceptor
.
tokenType
+
' '
+
apiInterceptor
.
apiToken
(),
__RequestVerificationToken
:
token
,
withCredentials
:
true
},
__RequestVerificationToken
:
token
,
withCredentials
:
true
}).
then
(
function
(
resp
)
{
var
ret
=
resp
.
data
;
$scope
.
fileName
=
''
;
$scope
.
upload
.
importExcelF
=
null
;
$
(
'#busy-indicator-container'
).
hide
();
deferred
.
resolve
();
if
(
ret
.
result
)
{
SweetAlert
.
success
(
$translate
.
instant
(
'ImportSuccess'
));
}
else
{
if
(
ret
.
resultMsg
&&
ret
.
resultMsg
.
length
>
0
)
{
SweetAlert
.
warning
(
$translate
.
instant
(
ret
.
resultMsg
));
}
else
{
SweetAlert
.
error
(
$translate
.
instant
(
'ImportNotMatch'
));
}
}
},
function
(
resp
)
{
deferred
.
resolve
();
if
(
resp
.
statusText
===
'HttpRequestValidationException'
)
{
SweetAlert
.
warning
(
$translate
.
instant
(
'HttpRequestValidationException'
));
}
else
{
SweetAlert
.
warning
(
'SaveFail'
);
}
SweetAlert
.
error
(
$translate
.
instant
(
'ImportFail'
));
console
.
log
(
'Error status: '
+
resp
.
status
);
},
function
(
evt
)
{
deferred
.
resolve
();
var
progressPercentage
=
parseInt
(
100.0
*
evt
.
loaded
/
evt
.
total
);
$log
.
debug
(
'progress: '
+
progressPercentage
+
'% '
+
evt
.
config
.
data
.
file
.
name
);
});
};
$scope
.
$watch
(
'isShow'
,
function
(
newValue
)
{
if
(
newValue
)
{
$scope
.
modalManage
.
uploadOrgModal
.
open
();
}
});
$scope
.
$watch
(
'upload.importExcelF'
,
function
(
newValue
,
oldValue
)
{
if
(
newValue
)
{
initImportFile
(
newValue
);
}
});
//加载文档后操作
var
initImportFile
=
function
(
fileName
)
{
var
arr
=
fileName
.
name
.
split
(
'.'
);
if
(
arr
[
arr
.
length
-
1
]
!==
'xls'
&&
arr
[
arr
.
length
-
1
]
!==
'xlsx'
)
{
SweetAlert
.
warning
(
$translate
.
instant
(
'ImportFileInvalidType'
));
return
;
}
$scope
.
fileName
=
fileName
.
name
;
};
}
]);
\ No newline at end of file
atms-web/src/main/webapp/app/common/controls/upload-org-modal/upload-org-modal.html
0 → 100644
View file @
369d172a
<div
class=
"upload-org-modal-wrapper"
>
<script
type=
"text/ng-template"
id=
"upload-org-modal.html"
>
<
div
class
=
"modal-header"
>
<
h4
class
=
"modal-title"
style
=
"margin-top: 5px;"
>
{{
'BatchUpload'
|
translate
}}
<
/h4
>
<
/div
>
<
div
class
=
"modal-body"
id
=
"modal-body"
style
=
"height:335px;width:600px"
>
<
div
class
=
"form-group"
>
<
button
ng
-
model
=
"upload.importExcelF"
ngf
-
select
=
""
accept
=
".xls,.xlsx"
ngf
-
allow
-
dir
=
"false"
class
=
"btn btn-vat-third"
>
{{
'SelectFile'
|
translate
}}
<
/button
>
<
button
type
=
"button"
class
=
"btn btn-vat-primary"
translate
=
"TemplateBtn"
ng
-
click
=
"downloadTemplate()"
><
/button
>
<!--<
button
type
=
"button"
class
=
"btn btn-vat-primary "
translate
=
"CoverImportBtn"
-->
<!--
ng
-
click
=
"doUploadRLIT(importEnum.CoverImport)"
><
/button>--
>
<
button
type
=
"button"
class
=
"btn btn-vat-primary "
translate
=
"AddImportBtn"
ng
-
click
=
"doUploadRLIT(importEnum.AddImport)"
><
/button
>
<
span
ng
-
show
=
"fileName"
class
=
"marTop"
title
=
"{{fileName}}"
>
{{
'FileName'
|
translate
}}{{
fileName
|
limitString
:
10
}}
<
/span
>
<
/div
>
<
/div
>
<
div
class
=
"modal-footer"
>
<
button
class
=
"btn btn-third"
type
=
"button"
ng
-
click
=
"modalManage.uploadOrgModal.cancel()"
translate
=
"Cancel"
><
/button
>
<
/div
>
</script>
</div>
\ No newline at end of file
atms-web/src/main/webapp/app/common/controls/upload-org-modal/upload-org-modal.js
0 → 100644
View file @
369d172a
commonModule
.
directive
(
'uploadOrgModal'
,
[
'$log'
,
function
(
$log
)
{
'use strict'
;
$log
.
debug
(
'uploadOrgModal constructor...'
);
return
{
restrict
:
"E"
,
templateUrl
:
'/app/common/controls/upload-org-modal/upload-org-modal.html'
+
'?_='
+
Math
.
random
(),
controller
:
'uploadOrgModalController'
,
scope
:
{
isShow
:
'=?'
,
parentPage
:
'@'
,
importExcelF
:
'='
},
replace
:
true
};
}]);
\ No newline at end of file
atms-web/src/main/webapp/app/common/controls/upload-org-modal/upload-org-modal.less
0 → 100644
View file @
369d172a
.upload-org-modal-wrapper {
height: 100%;
.modal-title {
font-family: 'Arial Bold', 'Arial';
font-weight: 700;
font-style: normal;
font-size: 16px;
color: #000000;
line-height: 20px;
}
.modal-dialog {
width: 653px;
height: 409px;
.modal-body {
height: 100%;
width: 100%;
.row {
height: 100%;
margin-bottom: 20px;
}
}
.modal-footer {
text-align: left;
}
}
}
\ No newline at end of file
atms-web/src/main/webapp/app/common/utils/constant.js
View file @
369d172a
...
...
@@ -1549,7 +1549,8 @@ constant.importFileType = {
ExtractFinancialData
:
10
,
ExtractInvoiceData
:
11
,
RevenueMapping
:
12
,
RevenueConfig
:
13
RevenueConfig
:
13
,
orgUpload
:
17
};
constant
.
citImportFileType
=
{
...
...
atms-web/src/main/webapp/app/common/webservices/template.svc.js
View file @
369d172a
...
...
@@ -13,16 +13,16 @@ webservices.factory('templateService', ['$log', '$http', '$q', 'apiConfig', 'htt
return
getJsonFromExcel
(
templateID
);
//}
};
var
getPeriodTemplateJson
=
function
(
templateId
,
period
,
projectId
)
{
return
getJsonFromExcelForPeriod
(
templateId
,
period
,
projectId
,
false
);
var
getPeriodTemplateJson
=
function
(
templateId
,
period
,
projectId
)
{
return
getJsonFromExcelForPeriod
(
templateId
,
period
,
projectId
,
false
);
};
var
getPeriodTemplateJsonByOrg
=
function
(
templateId
,
period
,
orgId
)
{
return
getJsonFromExcelForPeriodOrg
(
templateId
,
period
,
orgId
);
var
getPeriodTemplateJsonByOrg
=
function
(
templateId
,
period
,
orgId
)
{
return
getJsonFromExcelForPeriodOrg
(
templateId
,
period
,
orgId
);
};
var
getPeriodTemplateJsonByInit
=
function
(
templateId
,
period
,
orgId
)
{
return
getJsonFromExcelForPeriod
(
templateId
,
period
,
orgId
,
true
);
var
getPeriodTemplateJsonByInit
=
function
(
templateId
,
period
,
orgId
)
{
return
getJsonFromExcelForPeriod
(
templateId
,
period
,
orgId
,
true
);
};
var
getCookie
=
function
(
cname
)
{
...
...
@@ -49,7 +49,7 @@ webservices.factory('templateService', ['$log', '$http', '$q', 'apiConfig', 'htt
spread
.
options
.
scrollbarMaxAlign
=
true
;
spread
.
options
.
scrollbarShowMax
=
true
;
spread
.
options
.
tabNavigationVisible
=
true
;
if
(
constant
.
regesterInformation
.
active
)
{
if
(
constant
.
regesterInformation
.
active
)
{
spread
.
options
.
tabEditable
=
false
;
spread
.
options
.
tabStripVisible
=
false
;
spread
.
options
.
newTabVisible
=
false
;
...
...
@@ -115,10 +115,10 @@ webservices.factory('templateService', ['$log', '$http', '$q', 'apiConfig', 'htt
};
var
getJsonFromExcelForPeriod
=
function
(
templateID
,
period
,
projectIdOrOrgId
)
{
var
getJsonFromExcelForPeriod
=
function
(
templateID
,
period
,
projectIdOrOrgId
)
{
var
deferred
=
$q
.
defer
();
var
promise
=
deferred
.
promise
;
var
url
=
loginContext
.
apiHost
+
constant
.
webapi
.
prefix
+
'/template/getPeriodTemplateJson?templateId='
+
templateID
+
"&period="
+
period
+
"&projectId="
+
projectIdOrOrgId
;
var
url
=
loginContext
.
apiHost
+
constant
.
webapi
.
prefix
+
'/template/getPeriodTemplateJson?templateId='
+
templateID
+
"&period="
+
period
+
"&projectId="
+
projectIdOrOrgId
;
var
xhr
=
new
XMLHttpRequest
();
xhr
.
open
(
'POST'
,
url
,
true
);
// 也可以使用POST方式,根据接口
xhr
.
responseType
=
"blob"
;
// 返回类型blob
...
...
@@ -148,10 +148,10 @@ webservices.factory('templateService', ['$log', '$http', '$q', 'apiConfig', 'htt
};
var
getJsonFromExcelForPeriodOrg
=
function
(
templateID
,
period
,
orgId
)
{
var
getJsonFromExcelForPeriodOrg
=
function
(
templateID
,
period
,
orgId
)
{
var
deferred
=
$q
.
defer
();
var
promise
=
deferred
.
promise
;
var
url
=
loginContext
.
apiHost
+
constant
.
webapi
.
prefix
+
'/template/getPeriodTemplateJsonOrg?templateId='
+
templateID
+
"&period="
+
period
+
"&orgId="
+
orgId
;
var
url
=
loginContext
.
apiHost
+
constant
.
webapi
.
prefix
+
'/template/getPeriodTemplateJsonOrg?templateId='
+
templateID
+
"&period="
+
period
+
"&orgId="
+
orgId
;
var
xhr
=
new
XMLHttpRequest
();
xhr
.
open
(
'POST'
,
url
,
true
);
// 也可以使用POST方式,根据接口
xhr
.
responseType
=
"blob"
;
// 返回类型blob
...
...
@@ -202,17 +202,20 @@ webservices.factory('templateService', ['$log', '$http', '$q', 'apiConfig', 'htt
renderSpreadExcelSimple
:
renderSpreadExcelSimple
,
setRowColName
:
setRowColName
,
getTemplateJson
:
getTemplateJson
,
getPeriodTemplateJson
:
getPeriodTemplateJson
,
getPeriodTemplateJsonByOrg
:
getPeriodTemplateJsonByOrg
,
getPeriodTemplateJsonByInit
:
getPeriodTemplateJsonByInit
,
getPeriodTemplateJson
:
getPeriodTemplateJson
,
getPeriodTemplateJsonByOrg
:
getPeriodTemplateJsonByOrg
,
getPeriodTemplateJsonByInit
:
getPeriodTemplateJsonByInit
,
downloadTemplate
:
function
(
fileType
)
{
return
$http
.
get
(
'/template/file/downloadTemplate?fileType='
+
fileType
,
apiConfig
.
create
({
responseType
:
'arraybuffer'
}));
return
$http
.
get
(
'/template/file/downloadTemplate?fileType='
+
fileType
,
apiConfig
.
create
({
responseType
:
'arraybuffer'
}));
},
citDownloadTemplate
:
function
(
fileType
)
{
return
$http
.
get
(
'/template/file/downloadTemplate?fileType='
+
fileType
+
'&serviceType='
+
1
,
apiConfig
.
create
({
responseType
:
'arraybuffer'
}));
return
$http
.
get
(
'/template/file/downloadTemplate?fileType='
+
fileType
+
'&serviceType='
+
1
,
apiConfig
.
create
({
responseType
:
'arraybuffer'
}));
},
downloadAnalysisTemplate
:
function
(
fileType
)
{
return
$http
.
get
(
'/template/file/downloadAnalysisTemplate?fileType='
+
fileType
,
apiConfig
.
create
({
responseType
:
'arraybuffer'
}));
return
$http
.
get
(
'/template/file/downloadAnalysisTemplate?fileType='
+
fileType
,
apiConfig
.
create
({
responseType
:
'arraybuffer'
}));
},
downloadTemplate
:
function
()
{
return
$http
.
get
(
'/template/file/downloadTemplate'
,
apiConfig
.
create
({
responseType
:
'arraybuffer'
}));
}
};
}]);
\ No newline at end of file
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