Commit 35f235c4 by 王悦

fix

parent 6a5d5649
...@@ -363,22 +363,26 @@ class TrademarkCtl extends CtlBase { ...@@ -363,22 +363,26 @@ class TrademarkCtl extends CtlBase {
async notify(p, q, req) { async notify(p, q, req) {
console.log("=====================>接受队列消息", p); console.log("=====================>接受队列消息", p);
let upload_id = p.actionBody.messageBody.upload_id; let upload_id = p.actionBody.messageBody.upload_id;
if (upload_id) {//excel上传人物更新任务数据 this.service.db.transaction(async (t)=>{
let upload = await this.uploadSve.findOne({ if (upload_id) {//excel上传人物更新任务数据
id: upload_id let upload = await this.service.db.models.upload.findOne({
}); where: {id: upload_id},
upload.success += p.actionBody.resultInfo.data.successCount || 0; lock:t.LOCK.UPDATE,
upload.fail += p.actionBody.resultInfo.data.failCount || 0; transaction: t
if (upload.total <= upload.success + upload.fail) });
upload.status = 1; upload.success += p.actionBody.resultInfo.data.successCount || 0;
await upload.save(); upload.fail += p.actionBody.resultInfo.data.failCount || 0;
} if (upload.total <= upload.success + upload.fail)
upload.status = 1;
await upload.save({transaction: t});
}
})
let tradedb = p.actionBody.resultInfo.data.tm; let tradedb = p.actionBody.resultInfo.data.tm;
tradedb.map(async db => { tradedb.map(db => {
await this.service.dao.model.update({ this.service.dao.model.update({
trademark_id: db.id, trademark_id: db.id,
tm_code: db.code tm_code: db.code
}, {where: {tm_code: db.code}}); }, {where: {tm_code: db.code}}).catch(e=>{});
}); });
return { return {
status: 1, status: 1,
......
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