Commit 2b229d6d by 王悦

fix

parent 5a630754
......@@ -88,32 +88,27 @@ class TrademarkCtl extends CtlBase {
* {"error": ""}
*/
async publish(p, q, req) {
try {
let body = {
"tm": p
};
let upload = await this.uploadSve.create({
total: p.length
});
body.upload_id = upload.id;
let rtn = await pushClient(body);
if (rtn.status == 1) {
let tradedb = [];
p.map(db => tradedb.push({
opath: p.opath,
user_id: p.userid,
company_id: p.company_id,
// trademark_id: db.id,
tm_code: db.code,
upload_id: upload.id
}));
rtn = await this.service.bulkCreate(tradedb);
}
return system.getResult(rtn)
}catch (e) {
return system.getResult(e)
let body = {
"tm": p
};
let upload = await this.uploadSve.create({
total: p.length
});
body.upload_id = upload.id;
let rtn = await pushClient(body);
if (rtn.status == 1) {
let tradedb = [];
p.map(db => tradedb.push({
opath: p.opath,
user_id: p.userid,
company_id: p.company_id,
// trademark_id: db.id,
tm_code: db.code,
upload_id: upload.id
}));
rtn = await this.service.bulkCreate(tradedb);
}
return system.getResult(rtn)
}
/**
......@@ -168,6 +163,7 @@ class TrademarkCtl extends CtlBase {
//接受队列返回消息
async notify(p, q, req) {
console.log("=====================>接受队列消息",p);
let update = [];
let upload_id = p.actionBody.messageBody.upload_id;
let upload = await this.uploadSve.findOne({
......@@ -182,7 +178,7 @@ class TrademarkCtl extends CtlBase {
trademark_id: db.id,
tm_code: db.code
}));
let res = await this.service.dao.model.bulkCreate(tradedb, {updateOnDuplicate: ["tm_code"]});
let res = await this.service.dao.model.bulkCreate(update, {updateOnDuplicate: ["tm_code"]});
return system.getResult(res)
}
......
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