Commit 8b2f0047 by 王栋源

wdy

parent cbf9e2ab
...@@ -7,6 +7,7 @@ class TmtransactionApi extends ApiBase { ...@@ -7,6 +7,7 @@ class TmtransactionApi extends ApiBase {
super(); super();
this.trademarktransactionSve = System.getObject("service.trademarktransactionSve"); this.trademarktransactionSve = System.getObject("service.trademarktransactionSve");
this.companyS = System.getObject("service.companySve"); this.companyS = System.getObject("service.companySve");
this.utilstmtasktradeSve = System.getObject("service.utilstmtasktradeSve");
}; };
//获取某类型的交易商标 post //获取某类型的交易商标 post
async findByTmType(obj){ async findByTmType(obj){
...@@ -26,5 +27,22 @@ class TmtransactionApi extends ApiBase { ...@@ -26,5 +27,22 @@ class TmtransactionApi extends ApiBase {
return {code:-200,msg:"操作失败"}; return {code:-200,msg:"操作失败"};
} }
} }
async tmAuditData() {//商标交易录入es
try {
var kk = await this.utilstmtasktradeSve.opAuditData();
console.log(kk, "kk...................");
return kk;
} catch (e) {
//日志记录
logCtl.error({
optitle: "test_tmAuditData错误",
op: "/igirl-web/app/base/api/impl/testApi.js",
content: "error:" + JSON.stringify(e.stack),
clientIp: ""
});
console.log(e.stack, "ttttttttt...............");
}
}
} }
module.exports = TmtransactionApi; module.exports = TmtransactionApi;
...@@ -63,6 +63,8 @@ module.exports = (db, DataTypes) => { ...@@ -63,6 +63,8 @@ module.exports = (db, DataTypes) => {
this.setDataValue("trademark_type_name", uiconfig.config.pdict.tm_transaction_type[val]); this.setDataValue("trademark_type_name", uiconfig.config.pdict.tm_transaction_type[val]);
} }
}, },
tm_regist_day:DataTypes.STRING(200),
tm_ncl_third:DataTypes.STRING(200),
}, { }, {
paranoid: true,//假的删除 paranoid: true,//假的删除
underscored: true, underscored: true,
......
...@@ -12,6 +12,7 @@ class UtilsTmTaskTradeService { ...@@ -12,6 +12,7 @@ class UtilsTmTaskTradeService {
this.tmTransactionUrl = settings.apiconfig.tmTransactionUrl(); this.tmTransactionUrl = settings.apiconfig.tmTransactionUrl();
this.trademarktransactionDao = System.getObject("db.trademarktransactionDao"); this.trademarktransactionDao = System.getObject("db.trademarktransactionDao");
this.orderSve = System.getObject("service.orderSve"); this.orderSve = System.getObject("service.orderSve");
this.tmNclUrl = settings.apiconfig.tmNclUrl();
} }
async getAuditList(pageIndex, pageSize) { async getAuditList(pageIndex, pageSize) {
//publish_status===:tm_transaction_publish_status": { "audit": "审核中", "fail": "审核不通过", "success": "审核通过", "uppershelf": "上架", "lowershelf": "下架" } //publish_status===:tm_transaction_publish_status": { "audit": "审核中", "fail": "审核不通过", "success": "审核通过", "uppershelf": "上架", "lowershelf": "下架" }
...@@ -37,7 +38,7 @@ class UtilsTmTaskTradeService { ...@@ -37,7 +38,7 @@ class UtilsTmTaskTradeService {
async opAuditData() { async opAuditData() {
var self = this; var self = this;
var rc = System.getObject("util.execClient"); var rc = System.getObject("util.execClient");
var list = await self.getAuditList(1, 1000); var list = await self.getAuditList(1, 101);
if (!list || list.rows.length == 0) { if (!list || list.rows.length == 0) {
return "no"; return "no";
} }
...@@ -81,7 +82,8 @@ class UtilsTmTaskTradeService { ...@@ -81,7 +82,8 @@ class UtilsTmTaskTradeService {
"tm_end_day", "tm_end_day",
"ncl_two_codes", "ncl_two_codes",
"cn_count", "cn_count",
"en_name_count" "en_name_count",
"regist_notice_day"
] ]
}; };
logCtl.info({ logCtl.info({
...@@ -169,8 +171,40 @@ class UtilsTmTaskTradeService { ...@@ -169,8 +171,40 @@ class UtilsTmTaskTradeService {
if (putIndex < 0) { if (putIndex < 0) {
return; return;
} }
//商标小项查询
var params2 = {
"query": {
"term": {
"reg_num": esItem.tm_regist_num
}
},
"from": 0,
"size": 500,
"_source": [
"ncl_last"
]
};
var nclthird = [];
var esData2 = await self.returnResult(params2, this.tmNclUrl, "UtilsTmTaskTradeService", "opEsQuery");
if (esData2.status == 0 && esData2.data.length > 0) {
for (let l = 0; l < esData2.data.length; l++) {
if (esData2.data[l].ncl_last.indexOf(":") != -1) {
var sptirdncl = esData2.data[l].ncl_last.split(":")[1];
if (nclthird.indexOf(sptirdncl) < 0) {
nclthird.push(sptirdncl);
}
}
else {
if (nclthird.indexOf(esData2.data[l].ncl_last) < 0) {
nclthird.push(esData2.data[l].ncl_last);
}
}
}
}
var filterTmListr = auditData.filter(f => f.code === esItem.tm_regist_num );
var filterTmList = auditData.filter(f => f.code === esItem.tm_regist_num && f.ncl_one_code === esItem.ncl_one_codes); var filterTmList = auditData.filter(f => f.code === esItem.tm_regist_num && f.ncl_one_code === esItem.ncl_one_codes);
if (filterTmList && filterTmList.length > 0) { if ((!filterTmListr || filterTmListr.length ==0) &&(!filterTmList || filterTmList.length ==0)) {
var addParams = { var addParams = {
code: esItem.tm_regist_num, code: esItem.tm_regist_num,
ncl_one_code: esItem.ncl_one_codes, ncl_one_code: esItem.ncl_one_codes,
...@@ -184,9 +218,11 @@ class UtilsTmTaskTradeService { ...@@ -184,9 +218,11 @@ class UtilsTmTaskTradeService {
tm_structure_name: auditData[putIndex].tm_structure_name, tm_structure_name: auditData[putIndex].tm_structure_name,
tm_introduction: auditData[putIndex].tm_introduction, tm_introduction: auditData[putIndex].tm_introduction,
publish_status: "uppershelf", publish_status: "uppershelf",
createcompany_id: auditList[0].createcompany_id, createcompany_id: auditData[0].createcompany_id,
createuser_id: auditList[0].createuser_id, createuser_id: auditData[0].createuser_id,
notes: "add_new", notes: "add_new",
tm_regist_day: esItem.regist_notice_day,
tm_ncl_third: JSON.stringify(nclthird)
}; };
if (esItem.original_regist_notice_day && esItem.original_regist_notice_day != null) { if (esItem.original_regist_notice_day && esItem.original_regist_notice_day != null) {
addParams.tm_start_day = self.convertDate(esItem.original_regist_notice_day); addParams.tm_start_day = self.convertDate(esItem.original_regist_notice_day);
......
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