Commit e0646743 by 庄冰

gsbh5

parent fb7aa8a9
...@@ -13,6 +13,7 @@ class ChannelPushApi{ ...@@ -13,6 +13,7 @@ class ChannelPushApi{
constructor(){ constructor(){
this.orderSve=System.getObject("service.orderSve"); this.orderSve=System.getObject("service.orderSve");
this.tmflowSve = System.getObject("service.tmflowSve"); this.tmflowSve = System.getObject("service.tmflowSve");
this.channelreceiveSve = System.getObject("service.channelreceiveSve");
// this.userSve=System.getObject("service.userSve"); // this.userSve=System.getObject("service.userSve");
// this.appSve=System.getObject("service.appSve"); // this.appSve=System.getObject("service.appSve");
// this.channelSve=System.getObject("service.channelSve"); // this.channelSve=System.getObject("service.channelSve");
...@@ -314,9 +315,34 @@ class ChannelPushApi{ ...@@ -314,9 +315,34 @@ class ChannelPushApi{
// officialType:"1", // officialType:"1",
// tmRegistNum:"111111", // tmRegistNum:"111111",
// officialFileName:"商标注册申请书", // officialFileName:"商标注册申请书",
// officialFileUrl:"http://www.baidu.com", // officialFileUrl:"http://www.baidu.com", pushChannelAssistTmData
// }; // };pushEditChannelAssistTmData
// return this.tmflowSve.pushTmOfficialData(pushObj); // var co = {
// "org_name":"汉唐信通",
// "operator_name":"庄冰",
// "order_pay_state":"待付款",
// "order_state":"办理中",
// "order_company_name":"北京联大共享科技有限公司",
// "customer_phone":"13075556693",
// "customer_name":"测试李四",
// "customer_email":"2577638904@qq.com",
// "order_price":0.01,
// "payOneClassCount":1,
// "needId":"OT18202003312235gT1S",
// "order_no_class_count":[
// {
// "class_count":10,
// "order_no":"100173202"
// }
// ],
// "threeClassCount":10,
// "order_nos":[
// "100173202"
// ],
// "oneClassCount":1,
// "payThreeClassCount":10
// };
// return this.channelreceiveSve.pushEditChannelAssistTmData("4u31585290678404","dbsbzc",co);
} }
} }
module.exports=ChannelPushApi; module.exports=ChannelPushApi;
\ No newline at end of file
...@@ -204,5 +204,40 @@ class ChannelReceiveApi { ...@@ -204,5 +204,40 @@ class ChannelReceiveApi {
return { code: -200, msg: "操作失败", err: e.stack }; return { code: -200, msg: "操作失败", err: e.stack };
} }
} }
//渠道商标方案确认
async channelTmConfirm(pobj, obj) {
// var userInfo = obj.userInfo;
var appInfo = obj.appInfo;
if (!appInfo || !appInfo.app_code) {
return { code: -1, msg: "appInfo参数错误" };
}
try {
var app = await this.appSve.dao.model.findOne({
where: { appid: "2e787bbaacda4c6488b9fae58fff30ba", isEnabled: 1 },
raw: true
});
if (app) {
obj["app"] = app
} else {
return { code: -100, msg: "未知应用" };
}
var channel = await this.channelSve.getChannelItem(appInfo.app_code);
if (channel) {
obj["channel"] = channel
} else {
return { code: -101, msg: "未知渠道" };
}
// var user = await this.getUserInfo(userInfo, appInfo,app);
// if (user) {
// obj["user"] = user;
// } else {
// return { code: -102, msg: "未知用户" };
// }
return await this.channelreceiveSve.channelTmConfirm(obj);
} catch (e) {
return { code: -200, msg: "操作失败", err: e.stack };
}
}
} }
module.exports = ChannelReceiveApi; module.exports = ChannelReceiveApi;
\ No newline at end of file
...@@ -8,10 +8,6 @@ class ChannelReceiveDao { ...@@ -8,10 +8,6 @@ class ChannelReceiveDao {
//推送渠道商标状态修改信息(同步商标注册号|商标状态|推送商标回执) //推送渠道商标状态修改信息(同步商标注册号|商标状态|推送商标回执)
async updateChannelTmStatus(obj) { async updateChannelTmStatus(obj) {
try { try {
// var tbCode = obj.tbCode;
// if (!tbCode) {
// return { code: -100, msg: "tbCode参数错误" };
// }
var channelApiUrl = this.channelApiUrl; var channelApiUrl = this.channelApiUrl;
channelApiUrl = settings.channelApiUrl("gsbh5"); channelApiUrl = settings.channelApiUrl("gsbh5");
var reqUrl = channelApiUrl + "/notifyaction/internalCallsNotify/updateTmStatus"; var reqUrl = channelApiUrl + "/notifyaction/internalCallsNotify/updateTmStatus";
...@@ -21,14 +17,13 @@ class ChannelReceiveDao { ...@@ -21,14 +17,13 @@ class ChannelReceiveDao {
if(rtn && rtn.stdout){ if(rtn && rtn.stdout){
rtn = JSON.parse(rtn.stdout); rtn = JSON.parse(rtn.stdout);
} }
console.log(rtn,"11111111111111111111111111111");
if (rtn.status == 0) { if (rtn.status == 0) {
await this.oplogSve.createDb({ await this.oplogSve.createDb({
logLevel: "info", logLevel: "info",
optitle: "gsbh5商标状态修改---成功", optitle: "gsbh5商标状态修改---成功",
op: reqUrl, op: reqUrl,
content: JSON.stringify(obj), content: JSON.stringify(obj),
result: JSON.stringify(rtn), resultinfo: JSON.stringify(rtn),
clientIp: "" clientIp: ""
}); });
} else { } else {
...@@ -37,7 +32,7 @@ class ChannelReceiveDao { ...@@ -37,7 +32,7 @@ class ChannelReceiveDao {
optitle: "gsbh5商标状态修改---失败", optitle: "gsbh5商标状态修改---失败",
op: reqUrl, op: reqUrl,
content: JSON.stringify(obj), content: JSON.stringify(obj),
result: JSON.stringify(rtn), resultinfo: JSON.stringify(rtn),
clientIp: "" clientIp: ""
}); });
return { code: -200 }; return { code: -200 };
...@@ -48,14 +43,106 @@ class ChannelReceiveDao { ...@@ -48,14 +43,106 @@ class ChannelReceiveDao {
await this.oplogSve.createDb({ await this.oplogSve.createDb({
logLevel: "error", logLevel: "error",
optitle: "渠道商标状态修改---异常", optitle: "渠道商标状态修改---异常",
op: "trademarkSve/updateChannelTmStatus", op: "app/base/db/impl/channelreceiveDao.js",
content: JSON.stringify(obj),
resultinfo: JSON.stringify(e.stack),
clientIp: ""
});
return { code: -400, msg: "操作失败", err: e.stack };
}
}
//推送辅助、担保商标注册数据
async pushChannelAssistTmData(obj){
try {
var channelApiUrl = this.channelApiUrl;
channelApiUrl = settings.channelApiUrl("gsbh5");
var reqUrl = channelApiUrl + "/notifyaction/internalCallsNotify/nbtzreceiveAssistTmData";
var rc = system.getObject("util.execClient");
var rtn = await rc.execPost(obj, reqUrl);
if(rtn && rtn.stdout){
rtn = JSON.parse(rtn.stdout);
}
if (rtn.status == 0) {
await this.oplogSve.createDb({
logLevel: "info",
optitle: "gsbh5辅助、担保商标注册数据推送---成功",
op: reqUrl,
content: JSON.stringify(obj),
resultinfo: JSON.stringify(rtn),
clientIp: ""
});
} else {
await this.oplogSve.createDb({
logLevel: "error",
optitle: "gsbh5辅助、担保商标注册数据推送---失败",
op: reqUrl,
content: JSON.stringify(obj),
resultinfo: JSON.stringify(rtn),
clientIp: ""
});
return { code: -200 };
}
return { code: 1 };
} catch (e) {
console.log(e.stack);
await this.oplogSve.createDb({
logLevel: "error",
optitle: "gsbh5辅助、担保商标注册数据推送---异常",
op: "app/base/db/impl/channelreceiveDao.js",
content: JSON.stringify(obj),
resultinfo: JSON.stringify(e.stack),
clientIp: ""
});
return { code: -400, msg: "操作失败", err: e.stack };
}
}
//推送辅助、担保商标注册修改数据
async pushEditChannelAssistTmData(obj){
try {
var channelApiUrl = this.channelApiUrl;
channelApiUrl = settings.channelApiUrl("gsbh5");
var reqUrl = channelApiUrl + "/notifyaction/internalCallsNotify/nbtzreceiveEditAssistTmData";
var rc = system.getObject("util.execClient");
var rtn = await rc.execPost(obj, reqUrl);
if(rtn && rtn.stdout){
rtn = JSON.parse(rtn.stdout);
}
if (rtn.status == 0) {
await this.oplogSve.createDb({
logLevel: "info",
optitle: "gsbh5辅助、担保商标注册修改数据推送---成功",
op: reqUrl,
content: JSON.stringify(obj),
result: JSON.stringify(rtn),
clientIp: ""
});
} else {
await this.oplogSve.createDb({
logLevel: "error",
optitle: "gsbh5辅助、担保商标注册修改数据推送---失败",
op: reqUrl,
content: JSON.stringify(obj),
result: JSON.stringify(rtn),
clientIp: ""
});
return { code: -200 };
}
return { code: 1 };
} catch (e) {
console.log(e.stack);
await this.oplogSve.createDb({
logLevel: "error",
optitle: "gsbh5辅助、担保商标注册修改数据推送---异常",
op: "app/base/db/impl/channelreceiveDao.js",
content: JSON.stringify(e.stack), content: JSON.stringify(e.stack),
clientIp: "" clientIp: ""
}); });
return { code: -400, msg: "操作失败", err: e.stack }; return { code: -400, msg: "操作失败", err: e.stack };
} }
} }
} }
module.exports=ChannelReceiveDao; module.exports=ChannelReceiveDao;
// var task = new ChannelReceiveDao(); // var task = new ChannelReceiveDao();
......
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