Commit 6f9c865e by 王悦

update

parent 0370dca2
...@@ -51,7 +51,7 @@ class TrademarkCtl extends CtlBase { ...@@ -51,7 +51,7 @@ class TrademarkCtl extends CtlBase {
} }
let rtn = await this.execClient.execPost(query, tmurl); let rtn = await this.execClient.execPost(query, tmurl);
let data = JSON.parse(rtn.stdout); let data = JSON.parse(rtn.stdout);
return system.getResultList(data.totalCount, data.data||[]) return system.getResultList(data.totalCount, data.data || [])
} }
/** /**
...@@ -89,26 +89,20 @@ class TrademarkCtl extends CtlBase { ...@@ -89,26 +89,20 @@ class TrademarkCtl extends CtlBase {
*/ */
async publish(p, q, req) { async publish(p, q, req) {
let body = { let body = {
"actionType": "tmBatchUpload", "tm": p
"actionBody": {
"tm": p
}
}; };
let rtn = await this.execClient.execPost(body, tmurl); let upload = await this.uploadSve.create({
let data = JSON.parse(rtn.stdout); total: p.length
if (data.status == 1) { });
let upload = await this.uploadSve.create({ body.upload_id = upload.id;
total: p.length, let rtn = await pushClient(body);
success: data.data.successCount || 0, if (rtn.status == 1) {
fail: p.length - data.data.successCount || 0,
status: 1
});
let tradedb = []; let tradedb = [];
data.data.tm.map(db => tradedb.push({ p.map(db => tradedb.push({
opath: p.opath, opath: p.opath,
user_id: p.userid, user_id: p.userid,
company_id: p.company_id, company_id: p.company_id,
trademark_id: db.id, // trademark_id: db.id,
tm_code: db.code, tm_code: db.code,
upload_id: upload.id upload_id: upload.id
})); }));
...@@ -186,8 +180,9 @@ class TrademarkCtl extends CtlBase { ...@@ -186,8 +180,9 @@ class TrademarkCtl extends CtlBase {
let res = await this.service.dao.model.bulkCreate(tradedb, {updateOnDuplicate: ["tm_code"]}); let res = await this.service.dao.model.bulkCreate(tradedb, {updateOnDuplicate: ["tm_code"]});
return system.getResult(res) return system.getResult(res)
} }
async getidlist(p, q, req){
let list = await this.service.findAll({upload_id:p.upload_id}); async getidlist(p, q, req) {
let list = await this.service.findAll({upload_id: p.upload_id});
return system.getResult(list) return system.getResult(list)
} }
} }
......
...@@ -72,9 +72,9 @@ var settings = { ...@@ -72,9 +72,9 @@ var settings = {
}, },
serviceurl: function () { serviceurl: function () {
if (this.env == "dev") { if (this.env == "dev") {
return "http://192.168.200.181:3003"; return "http://192.168.201.208:3003";
} else { } else {
return "http://jiaxiya.gongsibao.com"; return "http://jiaxiya-service.newtime";
} }
}, },
pmappid: 1, pmappid: 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