Commit 35f235c4 by 王悦

fix

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