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
16de9d38
Commit
16de9d38
authored
Jan 02, 2020
by
王栋源
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wdy
parent
2f79a9bb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
13 deletions
+20
-13
jiaxiya/app/base/controller/impl/transfer/tmjsonfileCtl.js
+2
-4
jiaxiya/app/base/service/impl/transfer/tmjsonfileSve.js
+18
-9
No files found.
jiaxiya/app/base/controller/impl/transfer/tmjsonfileCtl.js
View file @
16de9d38
...
...
@@ -17,13 +17,11 @@ class TmjsonfileCtl extends CtlBase {
console
.
log
(
rtn
);
if
(
rtn
.
status
>
-
1
)
{
var
newdate
=
new
Date
();
var
m
=
newdate
.
getMonth
()
+
1
;
var
d
=
newdate
.
getDate
();
var
strdate
=
""
if
(
newdate
.
getHours
()
>
12
)
{
strdate
=
newdate
.
getFullYear
()
+
""
+
m
+
d
+
"_2.json"
;
strdate
=
newdate
.
toISOString
().
split
(
"T"
)[
0
].
replace
(
/
\-
/g
,
""
)
+
"_2.json"
;
}
else
{
strdate
=
newdate
.
getFullYear
()
+
""
+
m
+
d
+
"_1.json"
;
strdate
=
newdate
.
toISOString
().
split
(
"T"
)[
0
].
replace
(
/
\-
/g
,
""
)
+
"_1.json"
;
}
var
self
=
this
;;
var
gobj
=
{
...
...
jiaxiya/app/base/service/impl/transfer/tmjsonfileSve.js
View file @
16de9d38
...
...
@@ -13,23 +13,34 @@ class TmjsonfileService extends ServiceBase {
}
async
createjsonfile
()
{
var
lastsql
=
"select * from tm_jsonfile order by id desc limit 1"
;
var
lastinfo
=
await
this
.
dao
.
customQuery
(
lastsql
);
var
lasttime
=
0
if
(
lastinfo
){
lasttime
=
lastinfo
[
0
].
updated_at
.
toISOString
().
split
(
"T"
)[
0
];
}
// var sql = "select * from bi_trademarktransaction where updated_at>='"+lasttime+"'";
var
sql
=
"select * from bi_trademarktransaction where id=175342"
;
var
tminfos
=
await
this
.
connectionigirl
.
query
(
sql
);
var
sources
=
[];
if
(
tminfos
[
0
])
{
for
(
var
i
=
0
;
i
<
tminfos
[
0
].
length
;
i
++
)
{
var
tmg
=
tminfos
[
0
][
i
].
tm_group
;
var
status
=
1
;
if
(
tminfos
[
0
][
i
].
deleted_at
||
"lowershelf"
==
tminfos
[
0
][
i
].
publish_status
){
status
=
0
;
}
var
strlist
=
null
;
if
(
tmg
)
{
strlist
=
tmg
.
replace
(
/"/g
,
""
).
replace
(
/
\[
/g
,
""
).
replace
(
/
\]
/g
,
""
).
split
(
","
);
for
(
var
n
=
0
;
n
<
strlist
.
length
;
n
++
)
{
for
(
var
n
=
0
;
n
<
strlist
.
length
;
n
++
)
{
if
(
!
strlist
[
n
])
{
strlist
.
shift
();
}
}
}
var
des
=
""
;
if
(
tminfos
[
0
][
i
].
tm_ncl_third
)
{
if
(
tminfos
[
0
][
i
].
tm_ncl_third
)
{
des
=
tminfos
[
0
][
i
].
tm_ncl_third
.
replace
(
/
\[
/g
,
""
).
replace
(
/
\]
/g
,
""
).
replace
(
/
\'
/g
,
""
);
}
var
source
=
{
...
...
@@ -38,13 +49,13 @@ class TmjsonfileService extends ServiceBase {
description
:
des
,
endTime
:
1668089537981
,
label
:
"商标标签"
,
originalPrice
:
parseInt
(
tminfos
[
0
][
i
].
platform_quoted_price
)
,
originalPrice
:
parseInt
(
tminfos
[
0
][
i
].
platform_quoted_price
)
,
ownerEnName
:
""
,
ownerName
:
tminfos
[
0
][
i
].
tm_applier
,
partnerCode
:
"gong_si_bao"
,
regAnnDate
:
tminfos
[
0
][
i
].
tm_regist_day
*
1000
,
secondaryClassification
:
strlist
,
status
:
1
,
status
:
status
,
thirdClassification
:
tminfos
[
0
][
i
].
tm_ncl_third
,
tmIcon
:
tminfos
[
0
][
i
].
pic_url
,
tmName
:
tminfos
[
0
][
i
].
name
,
...
...
@@ -53,17 +64,15 @@ class TmjsonfileService extends ServiceBase {
sources
.
push
(
source
);
}
var
newdate
=
new
Date
();
var
m
=
newdate
.
getMonth
()
+
1
;
var
d
=
newdate
.
getDate
();
var
strdate
=
""
if
(
newdate
.
getHours
()
>
12
)
{
strdate
=
newdate
.
getFullYear
()
+
""
+
m
+
d
+
"_2.json"
;
strdate
=
newdate
.
toISOString
().
split
(
"T"
)[
0
].
replace
(
/
\-
/g
,
""
)
+
"_2.json"
;
}
else
{
strdate
=
newdate
.
getFullYear
()
+
""
+
m
+
d
+
"_1.json"
;
strdate
=
newdate
.
toISOString
().
split
(
"T"
)[
0
].
replace
(
/
\-
/g
,
""
)
+
"_1.json"
;
}
var
jsonstr
=
JSON
.
stringify
(
sources
,
null
,
"
\
t"
);
return
new
Promise
(
function
(
resv
,
rej
)
{
fs
.
writeFile
(
'/tmp/'
+
strdate
,
jsonstr
,
function
(
err
)
{
fs
.
writeFile
(
'/tmp/'
+
strdate
,
jsonstr
,
function
(
err
)
{
if
(
err
)
{
console
.
error
(
err
);
}
...
...
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