Commit 5d7dbd9b by 王悦

专家辅助注册

parent 450e3803
...@@ -70,10 +70,13 @@ class Need extends APIBase { ...@@ -70,10 +70,13 @@ class Need extends APIBase {
break; break;
case "icpNotify"://icp方案更新 case "icpNotify"://icp方案更新
opResult = await this.utilsNeedSve.icpNotify(pobj, pobj.actionBody); opResult = await this.utilsNeedSve.icpNotify(pobj, pobj.actionBody);
if (opResult.status == 0 && pobj.actionBody.status == 1) { if (!pobj.actionBody.bizId.startsWith("TM_") && opResult.status == 0 && (pobj.actionBody.status == 1||pobj.actionBody.status == 0)) {
opResult = await self.centerorderSve.icppaysuccess(pobj, pobj.actionBody); opResult = await self.centerorderSve.icppaysuccess(pobj, pobj.actionBody);
} }
break; break;
case "tmNotifySub"://tm建案成功
opResult = await self.centerorderSve.tmsave(pobj, pobj.actionBody);
break;
case "writeCommunicationLog"://icp接收方案反馈信息 case "writeCommunicationLog"://icp接收方案反馈信息
opResult = await this.utilsNeedSve2.writeCommunicationLog(pobj); opResult = await this.utilsNeedSve2.writeCommunicationLog(pobj);
break; break;
......
...@@ -500,5 +500,17 @@ class AppServiceBase { ...@@ -500,5 +500,17 @@ class AppServiceBase {
} }
return system.getResultSuccess(); return system.getResultSuccess();
} }
async getFQbossSign(pobj){
var signArr = [];
var keys = Object.keys(pobj).sort();
for (let k = 0; k < keys.length; k++) {
const tKey = keys[k];
if (tKey != "sign" && pobj[tKey]) {
signArr.push(tKey + "=" + pobj[tKey]);
}
}
var resultSignStr = signArr.join("&") + "&key=" + "9c83f5f5c41347fc9bb47951fef3199b";
return md5(resultSignStr).toUpperCase();
}
} }
module.exports = AppServiceBase; module.exports = AppServiceBase;
...@@ -234,7 +234,14 @@ class CenterorderService extends AppServiceBase { ...@@ -234,7 +234,14 @@ class CenterorderService extends AppServiceBase {
} }
return system.getResultSuccess(data.data); return system.getResultSuccess(data.data);
} }
//商标保存tm_、创建方案
async tmsave(pobj){
pobj.actionType = "addOrderDelivery"
let url = this.centerOrderUrl + "action/tmreview/springBoard";
let result = await this.restPostUrl(pobj, url);
return result;
}
//状态更新
async icppaysuccess(pobj) { async icppaysuccess(pobj) {
var sobj = { var sobj = {
actionType: "getaliicpProduce", actionType: "getaliicpProduce",
......
...@@ -29,6 +29,8 @@ class UtilsNeedService extends AppServiceBase { ...@@ -29,6 +29,8 @@ class UtilsNeedService extends AppServiceBase {
if (actionBody.type == "esp.wangwen" || actionBody.type == "esp.food") { if (actionBody.type == "esp.wangwen" || actionBody.type == "esp.food") {
actionBody.area = this.wangwenAreaChange(actionBody.area) actionBody.area = this.wangwenAreaChange(actionBody.area)
} }
if(!actionBody.type && actionBody.consultType)
actionBody.type = actionBody.consultType
if (!actionBody.intentionBizId) { if (!actionBody.intentionBizId) {
return system.getResult(null, "actionBody.intentionBizId can not be empty,100380"); return system.getResult(null, "actionBody.intentionBizId can not be empty,100380");
} }
...@@ -54,6 +56,10 @@ class UtilsNeedService extends AppServiceBase { ...@@ -54,6 +56,10 @@ class UtilsNeedService extends AppServiceBase {
pobj.actionBody.type = "ali.edi"; pobj.actionBody.type = "ali.edi";
} else if (pobj.actionBody.channel_type_code == "tmjy") { } else if (pobj.actionBody.channel_type_code == "tmjy") {
pobj.actionBody.type = "ali.tmd"; pobj.actionBody.type = "ali.tmd";
}else if (pobj.actionBody.channel_type_code == 1) {
pobj.actionBody.type = "ali.tmd";
}else if (pobj.actionBody.channel_type_code == 2) {
pobj.actionBody.type = "ali.tm";
} }
...@@ -82,6 +88,9 @@ class UtilsNeedService extends AppServiceBase { ...@@ -82,6 +88,9 @@ class UtilsNeedService extends AppServiceBase {
if (pobj.actionBody.channel_type_code == "esp.companyreg") { if (pobj.actionBody.channel_type_code == "esp.companyreg") {
this.utilsPushSve.aliBusiness2Fq(pobj, "pushNeedBusiness"); this.utilsPushSve.aliBusiness2Fq(pobj, "pushNeedBusiness");
} else { } else {
if (["ali.tm","ali.tmd"].includes(pobj.actionBody.type)){
this.utilsPushSve.aliBusiness2Fq(pobj, "pushNeedTMBusiness");
}else {
var reqParams = { var reqParams = {
actionBody: pobj.actionBody, actionBody: pobj.actionBody,
appInfo: pobj.appInfo appInfo: pobj.appInfo
...@@ -95,6 +104,7 @@ class UtilsNeedService extends AppServiceBase { ...@@ -95,6 +104,7 @@ class UtilsNeedService extends AppServiceBase {
this.utilsPushSve.aliBusiness2Fq(pobj, "pushNeedICPBusiness"); this.utilsPushSve.aliBusiness2Fq(pobj, "pushNeedICPBusiness");
} }
} }
}
return result; return result;
} }
...@@ -111,6 +121,16 @@ class UtilsNeedService extends AppServiceBase { ...@@ -111,6 +121,16 @@ class UtilsNeedService extends AppServiceBase {
pobj.intentionStatus = pobj.actionBody.intentionStatus; pobj.intentionStatus = pobj.actionBody.intentionStatus;
} }
var rtn = await this.execClient.execPost(pobj, url); var rtn = await this.execClient.execPost(pobj, url);
var data = JSON.parse(rtn.stdout);
if (data.data.channelTypeCode == 1||data.data.channelTypeCode == 2) {//商标
this.execPostUrl({
"actionProcess": "AliTm",
"appCode": "100099",
"sign": await this.getFQbossSign(pobj.actionBody),
actionBody: pobj.actionBody
}, settings.fqbossTmUrl())
self.utilsPushSve.aliBusiness2Fq(pobj, "pushTMFeedback");
}else
// 2020 0803 lin 修改; // 2020 0803 lin 修改;
if (pobj.intentionStatus) { if (pobj.intentionStatus) {
// 如果需求当前字段为5(已关闭)则通知fq // 如果需求当前字段为5(已关闭)则通知fq
...@@ -118,7 +138,6 @@ class UtilsNeedService extends AppServiceBase { ...@@ -118,7 +138,6 @@ class UtilsNeedService extends AppServiceBase {
self.utilsPushSve.aliBusiness2Fq(pobj, "pushCloseICPNeed"); self.utilsPushSve.aliBusiness2Fq(pobj, "pushCloseICPNeed");
} }
} }
var data = JSON.parse(rtn.stdout);
return data; return data;
} }
...@@ -197,8 +216,10 @@ class UtilsNeedService extends AppServiceBase { ...@@ -197,8 +216,10 @@ class UtilsNeedService extends AppServiceBase {
if (!actionBody.bizId) { if (!actionBody.bizId) {
return system.getResult(null, "actionBody.bizId can not be empty,100390"); return system.getResult(null, "actionBody.bizId can not be empty,100390");
} }
let obj = {...pobj}
obj.actionType = "getSolutionByChannelSolutionNo"
var reqUrl = this.centerOrderUrl + "action/need/springBoard"; var reqUrl = this.centerOrderUrl + "action/need/springBoard";
var itemResult = await this.restPostUrl(pobj, reqUrl); var itemResult = await this.restPostUrl(obj, reqUrl);
return itemResult; return itemResult;
} }
/** /**
...@@ -352,6 +373,19 @@ class UtilsNeedService extends AppServiceBase { ...@@ -352,6 +373,19 @@ class UtilsNeedService extends AppServiceBase {
if (!actionBody.bizId) { if (!actionBody.bizId) {
return system.getResult(null, "actionBody.bizId can not be empty,100495"); return system.getResult(null, "actionBody.bizId can not be empty,100495");
} }
let isTM = actionBody.bizId.startsWith("TM_")
if (isTM){//商标
let result = await this.getSolutionByChannelSolutionNo(pobj, pobj.actionBody);
if (result.status !== 0){
console.log(result)
return system.getResult(null, result);
}
actionBody.orderNo = result.data.orderNo;
actionBody.intentionBizId = result.data.channelNeedNo
if (actionBody.fileUrl) {
actionBody.fileUrl = await self.opDownFileInfo(actionBody.fileUrl);
}
}else {
actionBody.BizId = actionBody.bizId; actionBody.BizId = actionBody.bizId;
if (!actionBody.status) { if (!actionBody.status) {
return system.getResult(null, "actionBody.status can not be empty,100495"); return system.getResult(null, "actionBody.status can not be empty,100495");
...@@ -386,6 +420,7 @@ class UtilsNeedService extends AppServiceBase { ...@@ -386,6 +420,7 @@ class UtilsNeedService extends AppServiceBase {
} }
actionBody.newuserOtherList = newuserOtherList; actionBody.newuserOtherList = newuserOtherList;
} }
}
if (actionBody.isDirectBuy === "true" && (actionBody.status == 1 || actionBody.status == 0)) {//已支付直购不调用 if (actionBody.isDirectBuy === "true" && (actionBody.status == 1 || actionBody.status == 0)) {//已支付直购不调用
return system.getResultSuccess(); return system.getResultSuccess();
} }
...@@ -393,6 +428,16 @@ class UtilsNeedService extends AppServiceBase { ...@@ -393,6 +428,16 @@ class UtilsNeedService extends AppServiceBase {
var url = settings.centerOrderUrl() + "action/qcapi/springBoard"; var url = settings.centerOrderUrl() + "action/qcapi/springBoard";
var rtn = await this.restPostUrl(pobj, url); var rtn = await this.restPostUrl(pobj, url);
console.log("receiveIcpStatusNotify-->",rtn) console.log("receiveIcpStatusNotify-->",rtn)
if (isTM){
if (actionBody.status == "0"|| actionBody.status =="23") {//付款状态,受理通知书推云服
this.utilsPushSve.aliBusiness2Fq(pobj, "pushTMpaySuccess");
}
if (actionBody.status =="4" || actionBody.status =="22") {//付款失败状态,商标局不受理推云服
this.utilsPushSve.aliBusiness2Fq(pobj, "pushTMpayRefund");
}
//通知fqboss
this.execPostUrl({ "actionProcess": "AliTm", "appCode": "100099", "sign": await this.getFQbossSign(actionBody), actionBody },settings.fqbossTmUrl())
}else {
if (actionBody.status == 2) { if (actionBody.status == 2) {
var deliveryObj = { var deliveryObj = {
actionBody: { actionBody: {
...@@ -429,6 +474,7 @@ class UtilsNeedService extends AppServiceBase { ...@@ -429,6 +474,7 @@ class UtilsNeedService extends AppServiceBase {
self.utilsPushSve.aliBusiness2Fq(tmpObj, "pushOrderICPClose"); self.utilsPushSve.aliBusiness2Fq(tmpObj, "pushOrderICPClose");
} }
}//通知更新状态 }//通知更新状态
}
return rtn; return rtn;
} }
/** /**
......
...@@ -271,6 +271,13 @@ var settings = { ...@@ -271,6 +271,13 @@ var settings = {
return "https://fqgirl.gongsibao.com/"; return "https://fqgirl.gongsibao.com/";
} }
}, },
fqbossTmUrl: function(){
if (this.env == "dev") {
return "https://fqgirlstage.gongsibao.com/api/tmsub/channelTmNotify"
} else {
return "https://fqgirl.gongsibao.com/api/tmsub/channelTmNotify"
}
},
ucommuneUrl: function () { ucommuneUrl: function () {
if (this.env == "dev") { if (this.env == "dev") {
return "https://m-dev.ucommune.com/"// 优客测试环境 return "https://m-dev.ucommune.com/"// 优客测试环境
......
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