Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zhichan
Overview
Overview
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
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
蒋勇
zhichan
Commits
7ee5ffc4
Commit
7ee5ffc4
authored
May 27, 2020
by
蒋勇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d
parent
d8eee4ab
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
13 deletions
+20
-13
taskexecutor/app/base/db/task/rpt/parseRptTask.js
+9
-2
taskexecutor/app/base/utils/test.js
+11
-11
No files found.
taskexecutor/app/base/db/task/rpt/parseRptTask.js
View file @
7ee5ffc4
...
@@ -3,7 +3,8 @@ const settings=require("../../../../config/settings");
...
@@ -3,7 +3,8 @@ const settings=require("../../../../config/settings");
var
excel
=
require
(
'exceljs'
);
var
excel
=
require
(
'exceljs'
);
const
system
=
require
(
"../../../system"
);
const
system
=
require
(
"../../../system"
);
const
fs
=
require
(
'fs'
);
const
fs
=
require
(
'fs'
);
const
uuid4
=
require
(
"uuid4"
)
const
uuidv4
=
require
(
'uuid/v4'
);
class
ParseRptTask
extends
TaskBase
{
class
ParseRptTask
extends
TaskBase
{
constructor
(){
constructor
(){
super
(
TaskBase
.
getServiceName
(
ParseRptTask
));
super
(
TaskBase
.
getServiceName
(
ParseRptTask
));
...
@@ -11,6 +12,11 @@ class ParseRptTask extends TaskBase{
...
@@ -11,6 +12,11 @@ class ParseRptTask extends TaskBase{
this
.
restData
=
[];
this
.
restData
=
[];
this
.
ossC
=
system
.
getObject
(
"util.ossClient"
);
this
.
ossC
=
system
.
getObject
(
"util.ossClient"
);
}
}
getUUID
()
{
var
uuid
=
uuidv4
();
var
u
=
uuid
.
replace
(
/
\-
/g
,
""
);
return
u
;
}
async
subBeforeTask
(
params
){
async
subBeforeTask
(
params
){
console
.
log
(
"前置操作......"
,
this
.
serviceName
);
console
.
log
(
"前置操作......"
,
this
.
serviceName
);
//this.isThrough=true;
//this.isThrough=true;
...
@@ -58,7 +64,8 @@ async readxls(path) {
...
@@ -58,7 +64,8 @@ async readxls(path) {
//下载文件
//下载文件
var
keyindex
=
urldownload
.
lastIndexOf
(
"/"
);
var
keyindex
=
urldownload
.
lastIndexOf
(
"/"
);
var
keystr
=
urldownload
.
substring
(
keyindex
+
1
);
var
keystr
=
urldownload
.
substring
(
keyindex
+
1
);
var
destfile
=
keystr
.
replace
(
/
\s
/g
,
''
)
var
extfile
=
keystr
.
substring
(
keystr
.
lastIndexOf
(
"."
))
var
destfile
=
this
.
getUUID
()
+
extfile
var
result
=
await
this
.
ossC
.
downfile
(
keystr
,
destfile
);
var
result
=
await
this
.
ossC
.
downfile
(
keystr
,
destfile
);
var
localpath
=
"/tmp/"
+
destfile
var
localpath
=
"/tmp/"
+
destfile
try
{
try
{
...
...
taskexecutor/app/base/utils/test.js
View file @
7ee5ffc4
...
@@ -13,16 +13,16 @@
...
@@ -13,16 +13,16 @@
// return promise;
// return promise;
// }
// }
// (async ()=>{
// (async ()=>{
// var wb= await readxls("
./GT
.xlsx");
// var wb= await readxls("
/tmp/f2b9b12ea5bf4bc79568acc5aa907f83
.xlsx");
// var sheet = wb.getWorksheet(1);
// var sheet = wb.getWorksheet(1);
// sheet.eachRow({ includeEmpty: true }, function(row, rowNumber) {
//
//
sheet.eachRow({ includeEmpty: true }, function(row, rowNumber) {
// if(rowNumber>=10 && rowNumber<=10){
//
//
if(rowNumber>=10 && rowNumber<=10){
// row.eachCell({ includeEmpty: true }, function(cell, colNumber) {
//
//
row.eachCell({ includeEmpty: true }, function(cell, colNumber) {
// if(colNumber==28){
//
//
if(colNumber==28){
// var sval=cell.value?(typeof cell.value=="object"?cell.value.result:cell.value):"0";
//
//
var sval=cell.value?(typeof cell.value=="object"?cell.value.result:cell.value):"0";
// console.log(sval);
//
//
console.log(sval);
// }
//
//
}
// });
//
//
});
// }
//
//
}
// });
//
//
});
// })()
// })()
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