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
e3456e49
Commit
e3456e49
authored
Apr 22, 2019
by
chase
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
merge档案管理
parent
8aed3bca
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
52 additions
and
52 deletions
+52
-52
TaxDocumentServiceImpl.java
...pwc/taxtech/atms/service/impl/TaxDocumentServiceImpl.java
+2
-9
tax-document-list.ctrl.js
...ocumentManage/tax-document-list/tax-document-list.ctrl.js
+31
-36
tax-document-list.html
...axDocumentManage/tax-document-list/tax-document-list.html
+4
-6
tax-document-list.svc.js
...DocumentManage/tax-document-list/tax-document-list.svc.js
+15
-1
No files found.
atms-api/src/main/java/pwc/taxtech/atms/service/impl/TaxDocumentServiceImpl.java
View file @
e3456e49
...
...
@@ -311,16 +311,9 @@ public class TaxDocumentServiceImpl {
public
boolean
editFilesType
(
TaxDocument
taxDocument
)
{
try
{
TaxDocumentExample
taxDocumentExample
=
new
TaxDocumentExample
();
taxDocumentExample
.
createCriteria
().
andFileNameEqualTo
(
taxDocument
.
getFileName
());
List
<
TaxDocument
>
list
=
taxDocumentMapper
.
selectByExample
(
taxDocumentExample
);
if
(
list
.
size
()
>
0
)
{
return
false
;
}
//更新上传时间和文件名称
taxDocument
.
setUpdateTime
(
new
Date
());
taxDocument
.
setUploadTime
(
new
Date
());
int
num
=
taxDocumentMapper
.
updateByPrimaryKey
(
taxDocument
);
if
(
num
>
0
)
{
OperationLogTaxDocument
actionEntity
=
buildOperationLogTaxDocument
();
...
...
atms-web/src/main/webapp/app/taxDocumentManage/tax-document-list/tax-document-list.ctrl.js
View file @
e3456e49
...
...
@@ -341,7 +341,7 @@ taxDocumentManageModule.controller('taxDocumentListController',
var
row_height
=
$
(
"table"
).
find
(
"tr"
).
height
();
if
(
row_height
)
{
return
{
height
:
(
row_height
*
12
)
+
"px"
height
:
(
row_height
*
12
+
18
)
+
"px"
}
}
};
...
...
@@ -1576,13 +1576,13 @@ taxDocumentManageModule.directive('pdfPreview', function () {
restrict
:
'EA'
,
controller
:
[
'$scope'
,
'taxDocumentListService'
,
function
(
$scope
,
taxDocumentListService
)
{
window
.
PDFJS
.
workerSrc
=
'./bundles/pdf.worker.js'
;
var
canvas
=
document
.
getElementById
(
'the-canvas'
);
var
context
=
canvas
.
getContext
(
'2d'
);
var
pdfCurPageIndex
=
1
;
var
pdfSumPages
=
1
;
//
var canvas = document.getElementById('the-canvas');
//
var context = canvas.getContext('2d');
//
var pdfCurPageIndex = 1;
//
var pdfSumPages = 1;
var
container
=
document
.
getElementById
(
"pdfLayoutDialog"
);
var
pdfPromise
=
null
;
var
cacheUrl
=
null
;
//
var pdfPromise = null;
//
var cacheUrl = null;
$scope
.
openPdfPreviewPop_bak
=
function
(
url
)
{
container
.
style
.
display
=
"block"
;
if
(
cacheUrl
!==
url
)
{
...
...
@@ -1593,37 +1593,32 @@ taxDocumentManageModule.directive('pdfPreview', function () {
renderPdf
(
pdf
)
})
};
$scope
.
openPdfPreviewPop
=
function
(
url
)
{
container
.
style
.
display
=
"block"
;
function
start
()
{
return
new
Promise
(
function
(
resolve
,
reject
){
resolve
(
'start'
);
});
}
start
().
then
(
function
(
data
)
{
console
.
log
(
'result of start: '
,
data
);
return
taxDocumentListService
.
readPDF
({
path
:
url
});
}).
then
(
function
(
dataURL
)
{
var
pdfData
=
null
;
if
(
typeof
dataURL
==
"string"
){
pdfData
=
convertDataURIToBinary
(
dataURL
);
$scope
.
openPdfPreviewPop
=
function
(
url
)
{
var
params
=
{
path
:
url
};
taxDocumentListService
.
readPDF
(
params
).
then
(
function
(
data
,
status
,
headers
)
{
if
(
status
===
204
){
SweetAlert
.
warning
(
"没有数据可以下载"
);
return
;
}
console
.
log
(
pdfData
);
return
window
.
PDFJS
.
getDocument
({
data
:
pdfData
});
}).
then
(
function
(
data
)
{
pdfSumPages
=
data
.
numPages
;
return
data
.
getPage
(
pdfCurPageIndex
);
}).
then
(
function
(
page
){
var
scale
=
1.5
;
var
viewport
=
page
.
getViewport
(
scale
);
canvas
.
height
=
viewport
.
height
;
canvas
.
width
=
viewport
.
width
;
var
renderContext
=
{
canvasContext
:
context
,
viewport
:
viewport
container
.
style
.
display
=
"block"
;
var
blob
=
data
;
var
img
=
document
.
createElement
(
'img'
);
var
myBlob
=
new
window
.
Blob
([
blob
],
{
type
:
'image/png'
});
console
.
log
(
myBlob
);
var
qrUrl
=
window
.
URL
.
createObjectURL
(
myBlob
);
img
.
src
=
qrUrl
;
img
.
onload
=
function
()
{
window
.
URL
.
revokeObjectURL
(
qrUrl
);
$
(
"div.busy-indicator-container"
).
removeClass
(
"busy-indicator-container"
);
$
(
".TDL-content-container"
)[
0
].
style
.
display
=
"none"
;
$
(
".TDL-header"
)[
0
].
style
.
display
=
"none"
;
$
(
".navbar-custom-top"
)[
0
].
style
.
display
=
"none"
;
container
.
append
(
img
);
};
page
.
render
(
renderContext
);
});
},
function
()
{
SweetAlert
.
error
(
$translate
.
instant
(
'PleaseContactAdministrator'
));
})
};
function
convertDataURIToBinary
(
dataURI
)
{
//将encodeBase64解码
var
raw
=
window
.
atob
(
dataURI
);
...
...
atms-web/src/main/webapp/app/taxDocumentManage/tax-document-list/tax-document-list.html
View file @
e3456e49
...
...
@@ -306,6 +306,8 @@
}
.TDL-pdf-layout-dialog
{
text-align
:
center
;
float
:
top
;
display
:
none
;
}
...
...
@@ -1462,14 +1464,10 @@
</div>
</div>
<div
class=
"TDL-pdf-layout-dialog"
id=
"pdfLayoutDialog"
pdf-preview
>
<div
class=
"wrapper TDL-pdf-preview-pop"
id=
"pdfContainer
"
>
<div
class=
"TDL-pdf-layout-dialog"
id=
"pdfLayoutDialog"
pdf-preview
>
<div
id=
"pdfContainer"
style=
"width:0px;height:0px;overflow: hidden;
"
>
<canvas
id=
"the-canvas"
></canvas>
</div>
<button
class=
"TDL-pdf-preview-pop-close-btn"
ng-click=
"closePdfPop()"
>
×
</button>
<button
class=
"TDL-pdf-paging-btn TDL-pdf-paging-btn-prev"
ng-click=
"prevPaging()"
title=
"上一页"
>
<
</button>
<button
class=
"TDL-pdf-paging-btn TDL-pdf-paging-btn-next"
ng-click=
"nextPaging()"
title=
"下一页"
>
>
</button>
</div>
<div
class=
"modal fade"
id=
"imgLayoutDialog"
img-preview
tabindex=
"-1"
role=
"dialog"
aria-labelledby=
"myModal"
...
...
atms-web/src/main/webapp/app/taxDocumentManage/tax-document-list/tax-document-list.svc.js
View file @
e3456e49
...
...
@@ -134,7 +134,21 @@ taxDocumentManageModule.factory('taxDocumentListService',
return
jqFetch
.
post
(
apiInterceptor
.
webApiHostUrl
+
'/taxDoc/previewExcelToJson'
,
params
);
},
readPDF
:
function
(
params
){
return
jqFetch
.
post
(
apiInterceptor
.
webApiHostUrl
+
'/taxDoc/previewPDF'
,
params
);
$
(
'#busy-indicator-container'
).
show
();
var
defer
=
$q
.
defer
();
var
xhr
=
new
XMLHttpRequest
();
xhr
.
onload
=
function
(
result
)
{
if
(
this
.
status
==
200
)
{
var
blob
=
this
.
response
;
defer
.
resolve
(
blob
,
xhr
.
status
,
xhr
.
getAllResponseHeaders
());
}
};
xhr
.
open
(
"post"
,
apiInterceptor
.
webApiHostUrl
+
"/taxDoc/previewPDF"
,
true
);
xhr
.
setRequestHeader
(
"Authorization"
,
apiInterceptor
.
tokenType
+
' '
+
apiInterceptor
.
apiToken
());
xhr
.
setRequestHeader
(
"Content-Type"
,
'application/json;charset=UTF-8'
);
xhr
.
responseType
=
"blob"
;
xhr
.
send
(
JSON
.
stringify
(
params
));
return
defer
.
promise
;
},
getBinaryData
:
function
(
url
){
var
defer
=
$q
.
defer
();
...
...
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