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
0211a33b
Commit
0211a33b
authored
Jan 02, 2020
by
蒋勇
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'taskexecutor' of gitlab.gongsibao.com:jiangyong/zhichan into taskexecutor
parents
d439ccf1
98bd527e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
11 deletions
+33
-11
taskexecutor/app/base/db/task/rpt/parseRptTask.js
+10
-1
taskexecutor/test.js
+23
-10
No files found.
taskexecutor/app/base/db/task/rpt/parseRptTask.js
View file @
0211a33b
...
...
@@ -52,7 +52,16 @@ async readxls(path) {
var
result
=
await
this
.
ossC
.
downfile
(
keystr
);
var
localpath
=
"/tmp/"
+
keystr
;
var
wb
=
await
this
.
readxls
(
localpath
);
var
parserByCode
=
require
(
"./rptHandler/"
+
rptCode
);
var
ind
=
rptCode
.
lastIndexOf
(
"_"
);
var
parsefunc
=
rptCode
;
if
(
ind
>=
0
){
var
st2
=
rptCode
.
substring
(
ind
+
1
);
if
(
st2
==
"N"
){
//是非必传的文件
parsefunc
=
rptCode
.
substring
(
0
,
ind
);
}
}
var
parserByCode
=
require
(
"./rptHandler/"
+
parsefunc
);
var
rows
=
await
parserByCode
(
wb
);
console
.
log
(
JSON
.
stringify
(
rows
));
this
.
apiCallWithAk
(
settings
.
fkweb
(),{
...
...
taskexecutor/test.js
View file @
0211a33b
var
http
=
require
(
'http'
);
var
server
=
http
.
createServer
((
req
,
res
)
=>
{
//设置 HTTP 头部,状态码是 200,文件类型是 html,字符集是 utf-8
res
.
writeHead
(
200
,{
"Content-Type"
:
"text/html;charset='utf-8'"
});
res
.
write
(
'<h1>Node.js</h1>'
);
res
.
end
(
'Hello World
\\
n'
);
})
server
.
listen
(
3000
);
//监听端口号是3000的服务器
console
.
log
(
"end"
);
\ No newline at end of file
// var http = require('http');
// var server = http.createServer((req,res) => {
// //设置 HTTP 头部,状态码是 200,文件类型是 html,字符集是 utf-8
// res.writeHead(200,{"Content-Type":"text/html;charset='utf-8'"});
// res.write('<h1>Node.js</h1>');
// res.end('Hello World\\n');
// })
// server.listen(3000);//监听端口号是3000的服务器
// console.log("end");
var
str
=
"sdfd_xxx"
;
var
ind
=
str
.
lastIndexOf
(
"_"
);
if
(
ind
>=
0
){
var
st2
=
str
.
substring
(
ind
+
1
);
if
(
st2
==
"N"
){
var
st1
=
str
.
substring
(
0
,
ind
);
console
.
log
(
st1
);
}
else
{
console
.
log
(
str
);
}
}
\ 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