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
e0e63ed2
Commit
e0e63ed2
authored
Sep 11, 2020
by
v_vdywang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wdy
parent
6b26daaf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
20 deletions
+20
-20
center-tmtransaction/app/base/service/impl/tm/trademarktransactionSve.js
+20
-20
No files found.
center-tmtransaction/app/base/service/impl/tm/trademarktransactionSve.js
View file @
e0e63ed2
...
@@ -225,10 +225,10 @@ class TrademarktransactionService extends ServiceBase {
...
@@ -225,10 +225,10 @@ class TrademarktransactionService extends ServiceBase {
// 2020 0909 lin 新增功能 查询code是否存在如果价格 高于之前的code 就价格异常
// 2020 0909 lin 新增功能 查询code是否存在如果价格 高于之前的code 就价格异常
// count作为插入成功数量
// count作为插入成功数量
var
count
=
0
;
var
count
=
0
;
for
(
var
i
=
0
;
i
<
objlist
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
objlist
.
length
;
i
++
)
{
var
tmInfo
=
await
this
.
dao
.
model
.
findOne
({
var
tmInfo
=
await
this
.
dao
.
model
.
findOne
({
where
:
{
where
:
{
channel_code
:
objlist
[
i
].
channel_code
,
channel_code
:
objlist
[
i
].
channel_code
,
code
:
objlist
[
i
].
code
,
code
:
objlist
[
i
].
code
,
},
},
attributes
:
[
attributes
:
[
...
@@ -237,8 +237,8 @@ class TrademarktransactionService extends ServiceBase {
...
@@ -237,8 +237,8 @@ class TrademarktransactionService extends ServiceBase {
],
],
raw
:
true
raw
:
true
});
});
if
(
tmInfo
)
{
if
(
tmInfo
)
{
if
(
tmInfo
.
business_quoted_price
<
objlist
[
i
].
business_quoted_price
)
{
if
(
tmInfo
.
business_quoted_price
<
objlist
[
i
].
business_quoted_price
)
{
objlist
[
i
][
"publish_status"
]
=
"fail"
objlist
[
i
][
"publish_status"
]
=
"fail"
continue
;
continue
;
}
}
...
@@ -247,7 +247,7 @@ class TrademarktransactionService extends ServiceBase {
...
@@ -247,7 +247,7 @@ class TrademarktransactionService extends ServiceBase {
}
}
let
res
=
await
this
.
dao
.
model
.
bulkCreate
(
objlist
);
let
res
=
await
this
.
dao
.
model
.
bulkCreate
(
objlist
);
var
data
=
{
var
data
=
{
tm
:
res
,
tm
:
res
,
successCount
:
count
successCount
:
count
}
}
return
system
.
getResultSuccess
(
data
);
return
system
.
getResultSuccess
(
data
);
...
@@ -509,14 +509,14 @@ class TrademarktransactionService extends ServiceBase {
...
@@ -509,14 +509,14 @@ class TrademarktransactionService extends ServiceBase {
if
(
!
objlist
||
objlist
.
length
<
1
)
{
if
(
!
objlist
||
objlist
.
length
<
1
)
{
return
system
.
getResultFail
(
-
106
,
"参数错误"
);
return
system
.
getResultFail
(
-
106
,
"参数错误"
);
}
}
if
(
objlist
[
0
].
pic_url
)
{
// if (objlist[0].pic_url) {
// await this.addEsData(objlist);
// // await this.addEsData(objlist);
}
else
{
// } else {
var
codeList
=
[]
var
codeList
=
[]
for
(
let
i
=
0
;
i
<
objlist
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
objlist
.
length
;
i
++
)
{
codeList
.
push
(
objlist
[
i
].
code
);
codeList
.
push
(
objlist
[
i
].
code
);
}
}
}
// }
var
params
=
{
var
params
=
{
"query"
:
{
"query"
:
{
"terms"
:
{
"terms"
:
{
...
@@ -623,9 +623,9 @@ class TrademarktransactionService extends ServiceBase {
...
@@ -623,9 +623,9 @@ class TrademarktransactionService extends ServiceBase {
var
tminfos
=
await
this
.
dao
.
customQuery
(
sql
);
var
tminfos
=
await
this
.
dao
.
customQuery
(
sql
);
var
sources
=
[];
var
sources
=
[];
if
(
tminfos
)
{
if
(
tminfos
)
{
if
(
tminfos
.
length
<
1
)
{
if
(
tminfos
.
length
<
1
)
{
return
null
;
return
null
;
}
}
for
(
var
i
=
0
;
i
<
tminfos
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
tminfos
.
length
;
i
++
)
{
var
tmg
=
tminfos
[
i
].
tm_group
;
var
tmg
=
tminfos
[
i
].
tm_group
;
var
status
=
1
;
var
status
=
1
;
...
@@ -673,7 +673,7 @@ class TrademarktransactionService extends ServiceBase {
...
@@ -673,7 +673,7 @@ class TrademarktransactionService extends ServiceBase {
strdate
=
newdate
.
toISOString
().
split
(
"T"
)[
0
].
replace
(
/
\-
/g
,
""
)
+
"_1.json"
;
strdate
=
newdate
.
toISOString
().
split
(
"T"
)[
0
].
replace
(
/
\-
/g
,
""
)
+
"_1.json"
;
}
}
var
jsonstr
=
JSON
.
stringify
(
sources
,
null
,
"
\
t"
);
var
jsonstr
=
JSON
.
stringify
(
sources
,
null
,
"
\
t"
);
var
a
=
await
new
Promise
(
function
(
resv
,
rej
)
{
var
a
=
await
new
Promise
(
function
(
resv
,
rej
)
{
fs
.
writeFile
(
"/tmp/"
+
strdate
,
jsonstr
,
function
(
err
)
{
fs
.
writeFile
(
"/tmp/"
+
strdate
,
jsonstr
,
function
(
err
)
{
if
(
err
)
{
if
(
err
)
{
console
.
error
(
err
);
console
.
error
(
err
);
...
@@ -683,11 +683,11 @@ class TrademarktransactionService extends ServiceBase {
...
@@ -683,11 +683,11 @@ class TrademarktransactionService extends ServiceBase {
})
})
}
}
)
)
var
rtn
=
await
this
.
ossClient
.
upfile
(
strdate
,
"/tmp/"
+
strdate
);
var
rtn
=
await
this
.
ossClient
.
upfile
(
strdate
,
"/tmp/"
+
strdate
);
return
{
return
{
status
:
1
,
status
:
1
,
msg
:
""
,
msg
:
""
,
data
:
rtn
data
:
rtn
};
};
}
}
...
...
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