Commit 11ed4f89 by 王悦

Revert "fix 不使用sytxpublic-msgq"

This reverts commit c97b26fc
parent c97b26fc
...@@ -133,29 +133,16 @@ class TrademarkCtl extends CtlBase { ...@@ -133,29 +133,16 @@ class TrademarkCtl extends CtlBase {
async publish(p, q, req) { async publish(p, q, req) {
try { try {
let body = { let body = {
"actionType": "tmBatchUpload", "tm": p.data
"actionBody": {
"tm": p.data
}
}; };
let uploadid; let uploadid;
if (q && q.upload_id) { if (q && q.upload_id) {
uploadid = q.upload_id; uploadid = q.upload_id;
body.upload_id = uploadid; body.upload_id = uploadid;
} }
let rtn = await this.execClient.execPost(body, pushurl); let rtn = await pushClient(body, pushurl, notifyurl);
if (rtn.status == 1) { if (rtn.status == 1) {
let tradedb = []; let tradedb = [];
this.notify({
actionBody: {
resultInfo: {
data: rtn.data
},
messageBody: {
upload_id:uploadid
}
}
},q,req)
p.data.map(db => tradedb.push({ p.data.map(db => tradedb.push({
opath: p.opath, opath: p.opath,
user_id: p.userid, user_id: p.userid,
...@@ -210,7 +197,6 @@ class TrademarkCtl extends CtlBase { ...@@ -210,7 +197,6 @@ class TrademarkCtl extends CtlBase {
} }
upload.total = data.length; upload.total = data.length;
await upload.save(); await upload.save();
let pros = []
for (let i = 0; i < data.length; i += 20) { for (let i = 0; i < data.length; i += 20) {
let item = data.slice(i, i + 20); let item = data.slice(i, i + 20);
item.forEach(e => { item.forEach(e => {
...@@ -224,9 +210,8 @@ class TrademarkCtl extends CtlBase { ...@@ -224,9 +210,8 @@ class TrademarkCtl extends CtlBase {
pushd.userid = p.actionBody.userid; pushd.userid = p.actionBody.userid;
pushd.company_id = p.actionBody.company_id; pushd.company_id = p.actionBody.company_id;
pushd.channel_name = p.actionBody.channel_name; pushd.channel_name = p.actionBody.channel_name;
pros.push(this.publish(pushd, {upload_id: uploadid})) await this.publish(pushd, {upload_id: uploadid})
} }
await Promise.all(pros)
return { return {
status: 1, status: 1,
msg: "ok" msg: "ok"
...@@ -249,15 +234,18 @@ class TrademarkCtl extends CtlBase { ...@@ -249,15 +234,18 @@ class TrademarkCtl extends CtlBase {
name: p.name, name: p.name,
file_url: p.file_url file_url: p.file_url
}); });
this.process({actionBody:{ let rtn = await pushClient({
upload_id: upload.id, upload_id: upload.id,
file_url: p.file_url, file_url: p.file_url,
opath: p.opath, opath: p.opath,
userid: p.userid, userid: p.userid,
channel_name: p.channel_name, channel_name: p.channel_name,
company_id: p.company_id company_id: p.company_id
},q,req}) }, pushmyurl);
return system.getResultSuccess(rtn) if (rtn.status == 1) {
return system.getResult(rtn)
}
return system.getResultFail(-1, rtn.msg, rtn)
} catch (e) { } catch (e) {
return system.getResultFail(-2, e) return system.getResultFail(-2, e)
} }
......
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