Commit 18e7fae8 by linboxuan

Merge branch 'center-tmtransaction' of…

Merge branch 'center-tmtransaction' of http://gitlab.gongsibao.com/jiangyong/zhichan into center-tmtransaction
parents aea9429c 6c510a4c
......@@ -225,7 +225,7 @@ class TrademarktransactionService extends ServiceBase {
// 2020 0909 lin 新增功能 查询code是否存在如果价格 高于之前的code 就价格异常
// count作为插入成功数量
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({
where: {
channel_code: objlist[i].channel_code,
......@@ -237,8 +237,8 @@ class TrademarktransactionService extends ServiceBase {
],
raw: true
});
if(tmInfo) {
if(tmInfo.business_quoted_price < objlist[i].business_quoted_price) {
if (tmInfo) {
if (tmInfo.business_quoted_price < objlist[i].business_quoted_price) {
objlist[i]["publish_status"] = "fail"
continue;
}
......@@ -249,7 +249,7 @@ class TrademarktransactionService extends ServiceBase {
}
let res = await this.dao.model.bulkCreate(objlist);
var data = {
tm : res,
tm: res,
successCount: count
}
return system.getResultSuccess(data);
......@@ -639,14 +639,14 @@ class TrademarktransactionService extends ServiceBase {
if (!objlist || objlist.length < 1) {
return system.getResultFail(-106, "参数错误");
}
if (objlist[0].pic_url) {
// await this.addEsData(objlist);
} else {
// if (objlist[0].pic_url) {
// // await this.addEsData(objlist);
// } else {
var codeList = []
for (let i = 0; i < objlist.length; i++) {
codeList.push(objlist[i].code);
}
}
// }
var params = {
"query": {
"terms": {
......@@ -753,7 +753,7 @@ class TrademarktransactionService extends ServiceBase {
var tminfos = await this.dao.customQuery(sql);
var sources = [];
if (tminfos) {
if(tminfos.length<1){
if (tminfos.length < 1) {
return null;
}
for (var i = 0; i < tminfos.length; i++) {
......@@ -803,7 +803,7 @@ class TrademarktransactionService extends ServiceBase {
strdate = newdate.toISOString().split("T")[0].replace(/\-/g, "") + "_1.json";
}
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) {
if (err) {
console.error(err);
......@@ -813,11 +813,11 @@ class TrademarktransactionService extends ServiceBase {
})
}
)
var rtn=await this.ossClient.upfile(strdate, "/tmp/" + strdate);
var rtn = await this.ossClient.upfile(strdate, "/tmp/" + strdate);
return {
status:1,
msg:"",
data:rtn
status: 1,
msg: "",
data: rtn
};
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment