Commit 2c4cf9c4 by 王悦

Revert "Revert "fix 不使用sytxpublic-msgq""

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