Commit 88adcd00 by 王悦

fix

parent 11fb5cf8
...@@ -94,33 +94,37 @@ class TrademarkCtl extends CtlBase { ...@@ -94,33 +94,37 @@ class TrademarkCtl extends CtlBase {
* {"error": ""} * {"error": ""}
*/ */
async publish(p, q, req) { async publish(p, q, req) {
let body = { try {
"tm": p let body = {
}; "tm": p
let uploadid; };
if (q && q.upload_id) let uploadid;
uploadid = q.upload_id; if (q && q.upload_id)
else { uploadid = q.upload_id;
let upload = await this.uploadSve.create({ else {
total: p.length let upload = await this.uploadSve.create({
}); total: p.length
uploadid = upload.id; });
} uploadid = upload.id;
body.upload_id = uploadid; }
let rtn = await pushClient(body, pushurl, notifyurl); body.upload_id = uploadid;
if (rtn.status == 1) { let rtn = await pushClient(body, pushurl, notifyurl);
let tradedb = []; if (rtn.status == 1) {
p.map(db => tradedb.push({ let tradedb = [];
opath: p.opath, p.map(db => tradedb.push({
user_id: p.userid, opath: p.opath,
company_id: p.company_id, user_id: p.userid,
// trademark_id: db.id, company_id: p.company_id,
tm_code: db.code, // trademark_id: db.id,
upload_id: uploadid tm_code: db.code,
})); upload_id: uploadid
rtn = await this.service.bulkCreate(tradedb); }));
rtn = await this.service.bulkCreate(tradedb);
}
return system.getResult(rtn)
}catch (e) {
return system.getResultFail(-2,e)
} }
return system.getResult(rtn)
} }
async process(p, q, req) { async process(p, q, req) {
...@@ -153,15 +157,19 @@ class TrademarkCtl extends CtlBase { ...@@ -153,15 +157,19 @@ class TrademarkCtl extends CtlBase {
} }
async excelpublish(p, q, req) { async excelpublish(p, q, req) {
let upload = await this.uploadSve.create({ try {
name: p.name, let upload = await this.uploadSve.create({
file_url: p.file_url name: p.name,
}); file_url: p.file_url
let rtn = await pushClient({upload_id: upload.id, file_url: p.file_url}, pushmyurl); });
if (rtn.status == 1) { let rtn = await pushClient({upload_id: upload.id, file_url: p.file_url}, pushmyurl);
return system.getResult(rtn) if (rtn.status == 1) {
return system.getResult(rtn)
}
return system.getResultFail(-1, rtn.msg, rtn)
}catch (e) {
return system.getResultFail(-2, e)
} }
return system.getResultFail(-1, rtn.msg, rtn)
} }
/** /**
......
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