Commit 59373c7c by 王悦

fix

parent 5d71b921
......@@ -99,15 +99,10 @@ class TrademarkCtl extends CtlBase {
"tm": p
};
let uploadid;
if (q && q.upload_id)
if (q && q.upload_id) {
uploadid = q.upload_id;
else {
let upload = await this.uploadSve.create({
total: p.length
});
uploadid = upload.id;
}
body.upload_id = uploadid;
}
let rtn = await pushClient(body, pushurl, notifyurl);
if (rtn.status == 1) {
let tradedb = [];
......@@ -152,7 +147,7 @@ class TrademarkCtl extends CtlBase {
for (let i = 0; i < data.length; i += 200) {
let pushd = data.slice(i, i + 200);
pushd.opath = p.actionBody.opath;
pushd.user_id = p.actionBody.userid;
pushd.user_id = p.actionBody.user_id;
pushd.company_id = p.actionBody.company_id;
await this.publish(pushd, {upload_id: uploadid})
}
......@@ -235,6 +230,7 @@ class TrademarkCtl extends CtlBase {
async notify(p, q, req) {
console.log("=====================>接受队列消息", p);
let upload_id = p.actionBody.messageBody.upload_id;
if (upload_id) {//excel上传人物更新任务数据
let upload = await this.uploadSve.findOne({
id: upload_id
});
......@@ -242,6 +238,7 @@ class TrademarkCtl extends CtlBase {
upload.fail = upload.total - p.actionBody.resultInfo.data.successCount || 0;
upload.status = 1;
await upload.save();
}
let tradedb = p.actionBody.resultInfo.data.tm;
tradedb.map(async db => {
await this.service.dao.model.update({
......@@ -249,7 +246,7 @@ class TrademarkCtl extends CtlBase {
tm_code: db.code
}, {where: {tm_code: db.code}});
});
return system.getResult("ok")
return system.getResult(1,"ok")
}
async getidlist(p, q, req) {
......
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