Commit a834e98f by 宋毅

Merge branch 'center-channel' of gitlab.gongsibao.com:jiangyong/zhichan into center-channel

parents 15f28344 ef7d92ea
...@@ -53,6 +53,12 @@ class ProductAPI extends WEBBase { ...@@ -53,6 +53,12 @@ class ProductAPI extends WEBBase {
case "getAllProducts": case "getAllProducts":
opResult = await this.utilsProductSve.getAllProducts(pobj); opResult = await this.utilsProductSve.getAllProducts(pobj);
break; break;
case "getProducts"://目前用作创建方案时获取当前app的商品(product)
opResult = await this.utilsProductSve.getProducts(pobj);
break;
case "getProductsPrice"://目前用作创建方案时获取当前app的商品的属性(product_price-price_desc)
opResult = await this.utilsProductSve.getProductsPrice(pobj);
break;
case "getAllProductType":// 获取产品大类 case "getAllProductType":// 获取产品大类
opResult = await this.utilsProductSve.getAllProductType(pobj); opResult = await this.utilsProductSve.getAllProductType(pobj);
break; break;
......
...@@ -13,15 +13,28 @@ class AccessAuthAPI extends APIBase { ...@@ -13,15 +13,28 @@ class AccessAuthAPI extends APIBase {
this.utilsNeedSve = system.getObject("service.utilsSve.utilsNeedSve"); this.utilsNeedSve = system.getObject("service.utilsSve.utilsNeedSve");
this.utilsOpOrderSve = system.getObject("service.utilsSve.utilsOpOrderSve"); this.utilsOpOrderSve = system.getObject("service.utilsSve.utilsOpOrderSve");
} }
/**
* 查询阿里商标优选留咨信息,定时任务调用
* @param pobj
* @param qobj
* @param req
* @return {Promise<{msg: *, data, status: number}|{msg: *, data: *, status: *}>}
* @constructor
*/
async QueryTradeIntentionUserList(pobj, qobj, req) { async QueryTradeIntentionUserList(pobj, qobj, req) {
pobj.appInfo={uapp_id:18} pobj.appInfo={uapp_id:18}
let start_time = await this.redisClient.get("start_time_18")
let endtime = Date.now(); let endtime = Date.now();
let starttime = Date.now() - 30 * 60 * 1000;//30分钟(毫秒) let starttime = start_time || (Date.now() - 30 * 60 * 1000);//30分钟(毫秒)
pobj.actionBody = { pobj.actionBody = {
Begin: starttime, Begin: starttime,
End: endtime End: endtime
}; };
return await this.utilsNeedSve.queryTradeIntentionUserList(pobj); let res = await this.utilsNeedSve.queryTradeIntentionUserList(pobj);
if (res.status === 0)
await this.redisClient.set("start_time_18",endtime+1)
return res
} }
async taskAliIcapi() { async taskAliIcapi() {
var rtn = await this.gatewaypushlogSve.taskAliIcapi(); var rtn = await this.gatewaypushlogSve.taskAliIcapi();
......
...@@ -44,7 +44,31 @@ var regCfg = { ...@@ -44,7 +44,31 @@ var regCfg = {
"370200":"青岛", "370200":"青岛",
"410200":"开封", "410200":"开封",
"230100":"哈尔滨", "230100":"哈尔滨",
"130100":"石家庄" "130100":"石家庄",
"350200":"厦门",
"360400":"九江",
"410300":"洛阳",
"411000":"许昌",
"411600":"周口",
"411300":"南阳",
"420500":"宜昌",
"420600":"襄阳",
"430600":"岳阳",
"430700":"常德",
"440700":"江门",
"440400":"珠海",
"440900":"茂名",
"441300":"惠州",
"442000":"中山",
"450100":"南宁",
"460100":"海口",
"460200":"三亚",
"510700":"绵阳",
"540100":"拉萨",
"130600":"保定",
"130200":"唐山",
"140200":"大同",
"1501":"呼和浩特"
}, },
baiduAreaCode : { baiduAreaCode : {
...@@ -89,7 +113,31 @@ var regCfg = { ...@@ -89,7 +113,31 @@ var regCfg = {
"青岛": "370200", "青岛": "370200",
"开封": "410200", "开封": "410200",
"哈尔滨":"230100", "哈尔滨":"230100",
"石家庄":"130100" "石家庄":"130100",
"厦门":"350200",
"九江":"360400",
"洛阳":"410300",
"许昌":"411000",
"周口":"411600",
"南阳":"411300",
"宜昌":"420500",
"襄阳":"420600",
"岳阳":"430600",
"常德":"430700",
"江门":"440700",
"珠海":"440400",
"茂名":"440900",
"惠州":"441300",
"中山":"442000",
"南宁":"450100",
"海口":"460100",
"三亚":"460200",
"绵阳":"510700",
"拉萨":"540100",
"保定":"130600",
"唐山":"130200",
"大同":"140200",
"呼和浩特":"150100"
}, },
channelTypeCode : { channelTypeCode : {
"GSREG" : "baidu.gsreg", "GSREG" : "baidu.gsreg",
...@@ -101,7 +149,8 @@ var regCfg = { ...@@ -101,7 +149,8 @@ var regCfg = {
}, },
//区分渠道的uappid //区分渠道的uappid
uappId : { uappId : {
'baidu':44 'baidu':44,
'zhogxiaowei': 38
}, },
//交付状态 //交付状态
deliverRegStatus:{ deliverRegStatus:{
......
...@@ -39,6 +39,9 @@ class Ic extends APIBase { ...@@ -39,6 +39,9 @@ class Ic extends APIBase {
case "orderClose"://阿里退款 case "orderClose"://阿里退款
opResult = await this.utilsOrderSve.orderClose(pobj); opResult = await this.utilsOrderSve.orderClose(pobj);
break; break;
case "pushOrderToDelivery"://直接推送资质宝
opResult= await this.centerorderSve.icOrderToDelievery(pobj);
break;
default: default:
opResult = system.getResult(null, "action_type参数错误"); opResult = system.getResult(null, "action_type参数错误");
break; break;
......
...@@ -74,9 +74,12 @@ class Need extends APIBase { ...@@ -74,9 +74,12 @@ class Need extends APIBase {
case "tmNotifySub"://tm建案成功 case "tmNotifySub"://tm建案成功
opResult = await self.centerorderSve.tmsave(pobj, pobj.actionBody); opResult = await self.centerorderSve.tmsave(pobj, pobj.actionBody);
break; break;
case "writeCommunicationLog"://icp接收方案反馈信息 case "writeCommunicationLog"://写入跟进记录。通用
opResult = await this.utilsNeedSve2.writeCommunicationLog(pobj); opResult = await this.utilsNeedSve2.writeCommunicationLog(pobj);
break; break;
case "queryCommunicationLog"://获取跟进记录。通用
opResult = await this.utilsNeedSve2.queryCommunicationLog(pobj);
break;
case "queryExpertApplyCommunicationLogs"://icp接收方案反馈信息 case "queryExpertApplyCommunicationLogs"://icp接收方案反馈信息
opResult = await this.utilsNeedSve2.queryExpertApplyCommunicationLogs(pobj); opResult = await this.utilsNeedSve2.queryExpertApplyCommunicationLogs(pobj);
break; break;
...@@ -120,6 +123,9 @@ class Need extends APIBase { ...@@ -120,6 +123,9 @@ class Need extends APIBase {
// opResult = await this.utilsNeedSve.getItemByChannelSolutionNo(pobj, pobj.actionBody); // opResult = await this.utilsNeedSve.getItemByChannelSolutionNo(pobj, pobj.actionBody);
// break; // break;
break; break;
case "getOrderInfoByChannelOrderNo"://根据渠道订单订单信息
opResult = await this.utilsNeedSve.getOrderInfoByChannelOrderNo(pobj, pobj.actionBody);
break;
//-----------接入百度ICP------end---------------------------------- //-----------接入百度ICP------end----------------------------------
case "importNeeds": case "importNeeds":
opResult = await this.utilsNeedSve.importNeeds(pobj,req); opResult = await this.utilsNeedSve.importNeeds(pobj,req);
......
...@@ -654,11 +654,21 @@ class CenterorderService extends AppServiceBase { ...@@ -654,11 +654,21 @@ class CenterorderService extends AppServiceBase {
} else if (pobj.actionBody.channelItemCode == '7') { } else if (pobj.actionBody.channelItemCode == '7') {
pobj.actionBody.regType = "yiming.edi"; pobj.actionBody.regType = "yiming.edi";
} }
else if (pobj.actionBody.channelItemCode == 'icpnb') { else if (pobj.actionBody.channelItemCode == 'ICPXQ') {
pobj.actionBody.regType = "yiming.icpxq";
}else if (pobj.actionBody.channelItemCode == 'EDIXQ') {
pobj.actionBody.regType = "yiming.edixq";
}
else if (pobj.actionBody.channelItemCode == 'ICPNB') {
pobj.actionBody.regType = "yiming.icpnb"; pobj.actionBody.regType = "yiming.icpnb";
}else if (pobj.actionBody.channelItemCode == 'edinb') { }else if (pobj.actionBody.channelItemCode == 'EDINB') {
pobj.actionBody.regType = "yiming.edinb"; pobj.actionBody.regType = "yiming.edinb";
} }
else if (pobj.actionBody.channelItemCode == 'ICPWZ') {
pobj.actionBody.regType = "yiming.icpwz";
}else if (pobj.actionBody.channelItemCode == 'EDIWZ') {
pobj.actionBody.regType = "yiming.ediwz";
}
} }
var fqobj = { var fqobj = {
actionBody: { actionBody: {
...@@ -721,153 +731,77 @@ class CenterorderService extends AppServiceBase { ...@@ -721,153 +731,77 @@ class CenterorderService extends AppServiceBase {
return system.getResultSuccess(); return system.getResultSuccess();
} }
async icOrderToDelievery(pobj) {
let orderNo = pobj.actionBody.orderNo;
pobj.actionBody.orderNo = orderNo;
pobj.actionType = "getSolutionByChannelOrderNo";
var url = settings.centerOrderUrl() + "action/need/springBoard";
var solutionrtn = await this.execClient.execPost(pobj, url);
if (!solutionrtn || !solutionrtn.stdout) {
return system.getResultFail(-5011, "方案查询失败");
}
var solutiondata = JSON.parse(solutionrtn.stdout);
if (solutiondata.status != 0) {
return system.getResultFail(-5011, "方案查询失败");
}
if (!solutiondata.data) {
return system.getResultFail(-5012, "方案查询数据为空");
}
var deliveryObj = {
actionBody: {
orderNo: solutiondata.data.orderNo,//pobj.actionBody.channelOrder.channelOrderNo,
needsolution: solutiondata.data.solutionContent,
channelNeedNo: solutiondata.data.channelNeedNo,
channelSolutionNo: solutiondata.data.channelSolutionNo,
skuCode: pobj.actionBody.payCode,
servicer: {
code: 'gsb',
name: '公司宝'
}
},
appInfo: pobj.appInfo
};
let finalRet = null;
if(pobj.actionBody.isDirectBuy && pobj.actionBody.isDirectBuy==1){//直接下单需执行添加订单业务员操作
if(baiduPushRes && baiduPushRes.status==0){
if(baiduPushRes.data && baiduPushRes.data.data){
var resData = baiduPushRes.data.data;
var salesmanInfo = {
salesmanName:resData.orderList && resData.orderList.length>0?resData.orderList[0].operatorName:"",
salesmanChannelId:resData.orderList && resData.orderList.length>0?resData.orderList[0].operator:"",
};
var salesmanObj={
appInfo:pobj.appInfo,
actionType:"addIcpSalesmanInfo",//添加业务员信息
actionBody:{salesmanInfo:salesmanInfo,orderNo:orderrtn.data.orderNo}
};
var url = settings.centerOrderUrl() + "action/qcapi/springBoard";
var addRes = await this.execClient.execPost(salesmanObj, url);
if (addRes && addRes.stdout) {
var salesmanRes = JSON.parse(addRes.stdout);
if (salesmanRes.status == 0) {
deliveryObj.actionBody.needsolution = salesmanRes.data;
await this.utilsPushSve.business2Channel(deliveryObj, "pushDeliveryOrder");
}
}
}
}
}else{
finalRet = await this.utilsPushSve.business2Channel(deliveryObj, "pushDeliveryOrder");
}
return finalRet;
}
//获取易名的icp产品信息 //获取易名的icp产品信息
async getymicpProduce(pobj) { async getymicpProduce(pobj) {
console.log('pobj.actionBody.channelItemCode--',pobj.actionBody.channelItemCode)
pobj.actionType = 'getymicpProduce' pobj.actionType = 'getymicpProduce'
let url = settings.centerAppUrl() + "action/opProduct/springBoard"; let url = settings.centerAppUrl() + "action/opProduct/springBoard";
return await this.restPostUrl(pobj, url); return await this.restPostUrl(pobj, url);
} }
async tmPaySuccess(pobj) {
// var sobj = {
// actionType: "getProduceByChannelItemCode",
// actionBody: { typeCode: pobj.actionBody.channelTypeCode},
// appInfo: pobj.appInfo,
// actionProcess: pobj.actionProcess
// }
// var url = settings.centerAppUrl() + "action/opProduct/springBoard";
// var rtn = await this.execClient.execPost(sobj, url);
// if (!rtn || !rtn.stdout) {
// return system.getResultFail(-5010, "产品查询失败");
// }
// var data = JSON.parse(rtn.stdout);
// if (data.status != 0) {
// return system.getResultFail(-5010, "产品查询失败");
// }
// pobj.actionBody.orderNo = pobj.actionBody.bizId;
// pobj.actionBody.totalSum = data.data.price;
// pobj.actionBody.orderPrice = data.data.price;
// pobj.actionBody.payTotalSum = data.data.price;
// pobj.actionBody.payCode = data.data.payCode;
// pobj.actionBody.channelItemCode = data.data.channelItemCode;
// pobj.actionBody.channelNeedNo = data.data.channelNeedNo;
// pobj.actionBody.needNo = data.data.needNo;
// pobj.actionBody.quantity = 1;
// pobj.actionBody.channelOrder = {
// channelServiceNo: pobj.actionBody.orderNo,
// channelOrderNo: pobj.actionBody.orderNo,
// orderStatus: 2
// }
// var orderrtn = await this.utilsOrderSve.addOrder(pobj, pobj.actionBody);
// if (orderrtn.status != 0 && orderrtn.status != -1) {
// return system.getResultFail(-5012, "订单创建失败");
// }
// if (orderrtn.data) {
// pobj.actionBody.orderNo = orderrtn.data.orderNo;
// }
// pobj.actionBody.channelSolutionNo = pobj.actionBody.bizId;
// pobj.actionType = "receiveSolutionPayInfoNew";
// var url = settings.centerOrderUrl() + "action/icapi/springBoard";
// var solutionrtn = await this.execClient.execPost(pobj, url);
// if (!solutionrtn || !solutionrtn.stdout) {
// return system.getResultFail(-5011, "方案查询失败");
// }
// var solutiondata = JSON.parse(solutionrtn.stdout);
// if (solutiondata.status != 0) {
// return system.getResultFail(-5011, "方案查询失败");
// }
// if (!solutiondata.data) {
// return system.getResultFail(-5012, "方案查询数据为空");
// }
// if (solutiondata.data && solutiondata.data.channelNeedNo) {
// pobj.actionBody.needId = solutiondata.data.channelNeedNo;
// }
// if (pobj.actionBody.channelItemCode == '5') {
// pobj.actionBody.regType = "baidu.icp";
// } else if (pobj.actionBody.channelItemCode == '7') {
// pobj.actionBody.regType = "baidu.edi";
// }
// else if (pobj.actionBody.channelItemCode == 'NC') {
// pobj.actionBody.regType = "baidu.wangwen";
// }
// else if (pobj.actionBody.channelItemCode == 'RT') {
// pobj.actionBody.regType = "baidu.radiotv";
// }
// if(pobj && pobj.appInfo && pobj.appInfo.uapp_id && pobj.appInfo.uapp_id=='52'){
// if (pobj.actionBody.channelItemCode == '5') {
// pobj.actionBody.regType = "yiming.icp";
// } else if (pobj.actionBody.channelItemCode == '7') {
// pobj.actionBody.regType = "yiming.edi";
// }
// else if (pobj.actionBody.channelItemCode == 'icpnb') {
// pobj.actionBody.regType = "yiming.icpnb";
// }else if (pobj.actionBody.channelItemCode == 'edinb') {
// pobj.actionBody.regType = "yiming.edinb";
// }
// }
// var fqobj = {
// actionBody: {
// area: pobj.actionBody.province,
// idempotentSource: pobj.actionBody.regType,
// orderNo: pobj.actionBody.channelOrder.channelOrderNo,
// orderPrice: Number(pobj.actionBody.orderPrice / 100),
// phone: pobj.actionBody.publishMobile,
// needId: solutiondata.data.channelNeedNo,
// companyName:solutiondata.data.solutionContent.solution.CompanyName || '',
// //2021-1-21 laolan add new
// appName:pobj.appInfo.app_name || '',
// sku:data.data.service_code || ''
// },
// appInfo: pobj.appInfo
// }
// var baiduPushRes = await this.utilsPushSve.baiduBusiness2Fq(fqobj, "pushOrderICPBusinessNew");
// var deliveryObj = {
// actionBody: {
// orderNo: orderrtn.data.orderNo,//pobj.actionBody.channelOrder.channelOrderNo,
// needsolution: solutiondata.data.solutionContent,
// channelNeedNo: solutiondata.data.channelNeedNo,
// channelSolutionNo: solutiondata.data.channelSolutionNo,
// skuCode: data.data.payCode,
// servicer: {
// code: 'gsb',
// name: '公司宝'
// }
// },
// appInfo: pobj.appInfo
// };
// if(pobj.actionBody.isDirectBuy && pobj.actionBody.isDirectBuy==1){//直接下单需执行添加订单业务员操作
// if(baiduPushRes && baiduPushRes.status==0){
// if(baiduPushRes.data && baiduPushRes.data.data){
// var resData = baiduPushRes.data.data;
// var salesmanInfo = {
// salesmanName:resData.orderList && resData.orderList.length>0?resData.orderList[0].operatorName:"",
// salesmanChannelId:resData.orderList && resData.orderList.length>0?resData.orderList[0].operator:"",
// };
// var salesmanObj={
// appInfo:pobj.appInfo,
// actionType:"addIcpSalesmanInfo",//添加业务员信息
// actionBody:{salesmanInfo:salesmanInfo,orderNo:orderrtn.data.orderNo}
// };
// var url = settings.centerOrderUrl() + "action/qcapi/springBoard";
// var addRes = await this.execClient.execPost(salesmanObj, url);
// if (addRes && addRes.stdout) {
// var salesmanRes = JSON.parse(addRes.stdout);
// if (salesmanRes.status == 0) {
// deliveryObj.actionBody.needsolution = salesmanRes.data;
// await this.utilsPushSve.baiduBusiness2Delivery(deliveryObj, "pushDeliveryOrder");
// }
// }
// }
// }
// }else{
// this.utilsPushSve.baiduBusiness2Delivery(deliveryObj, "pushDeliveryOrder");
// }
return system.getResultSuccess();
}
} }
module.exports = CenterorderService; module.exports = CenterorderService;
// var task = new CenterorderService(); // var task = new CenterorderService();
......
...@@ -462,6 +462,13 @@ class RegCenterOrderService extends AppServiceBase { ...@@ -462,6 +462,13 @@ class RegCenterOrderService extends AppServiceBase {
return system.getResultFail(-101, pushBaiduRegSolution.msg) return system.getResultFail(-101, pushBaiduRegSolution.msg)
} }
} }
if (needinfo.uapp_id == regCfg.uappId.zhogxiaowei) {
// 2021 1103 lin 等待推送方案地址。确定返回值是什么
var result = await this.restPostUrl(res.data.needsolutions[0], 'http://zhongxiaowei.com/createSolutions');
if (pushBaiduRegSolution.status != 0) {
return system.getResultFail(-101, pushBaiduRegSolution.msg)
}
}
this.logCtl.info({ this.logCtl.info({
appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "", appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "",
appkey: pobj.appInfo ? pobj.appInfo.uapp_key || "" : "", appkey: pobj.appInfo ? pobj.appInfo.uapp_key || "" : "",
......
...@@ -47,6 +47,7 @@ class UtilsDeliverSystemService extends AppServiceBase { ...@@ -47,6 +47,7 @@ class UtilsDeliverSystemService extends AppServiceBase {
try { try {
var rtn = await this.restPostUrl(reqParams, pushQueueUrl); var rtn = await this.restPostUrl(reqParams, pushQueueUrl);
if (rtn.status != 1) { if (rtn.status != 1) {
this.execClientNew.execLogs(`推送队列接收数据失败->opQueuePushClientPost`, pobj, "center-channel-utilsDeliverSystemSve-opQueuePushClientPost", rtn, JSON.stringify(rtn));
return system.getResult(null, "推送队列接收数据失败,失败原因:" + JSON.stringify(rtn)); return system.getResult(null, "推送队列接收数据失败,失败原因:" + JSON.stringify(rtn));
} }
return system.getResultSuccess(null, "推送成功"); return system.getResultSuccess(null, "推送成功");
......
...@@ -49,7 +49,7 @@ class UtilsNeedService extends AppServiceBase { ...@@ -49,7 +49,7 @@ class UtilsNeedService extends AppServiceBase {
} }
pobj.actionBody.service_product_id= data.data.service_product_id; pobj.actionBody.service_product_id= data.data.service_product_id;
pobj.actionBody.productId = data.data.service_product_id; pobj.actionBody.productId = data.data.service_product_id;
pobj.actionBody.appName = pobj.appInfo.app_name; pobj.actionBody.appName = pobj.appInfo.app_name||pobj.actionBody.appName;
pobj.actionBody.type_code = data.data.type_code; pobj.actionBody.type_code = data.data.type_code;
pobj.actionBody.type_name = data.data.type_name; pobj.actionBody.type_name = data.data.type_name;
pobj.actionBody.channel_type_code = data.data.channel_type_code; pobj.actionBody.channel_type_code = data.data.channel_type_code;
...@@ -393,6 +393,16 @@ class UtilsNeedService extends AppServiceBase { ...@@ -393,6 +393,16 @@ class UtilsNeedService extends AppServiceBase {
var itemResult = await this.restPostUrl(pobj, reqUrl); var itemResult = await this.restPostUrl(pobj, reqUrl);
return itemResult; return itemResult;
} }
//阿里icp退款新增
async getOrderInfoByChannelOrderNo(pobj, actionBody) {
if (!actionBody.orderNo) {
return system.getResult(null, "actionBody.orderNo can not be empty,1003901");
}
var reqUrl = this.centerOrderUrl + "action/need/springBoard";
var itemResult = await this.restPostUrl(pobj, reqUrl);
return itemResult;
}
/** /**
* 关闭需求 * 关闭需求
* @param {*} pobj * @param {*} pobj
...@@ -771,6 +781,7 @@ class UtilsNeedService extends AppServiceBase { ...@@ -771,6 +781,7 @@ class UtilsNeedService extends AppServiceBase {
pobj.actionBody.mobile = item.Mobile ? item.Mobile : ""; pobj.actionBody.mobile = item.Mobile ? item.Mobile : "";
//pobj.actionBody.Area = item.Area || "北京" //pobj.actionBody.Area = item.Area || "北京"
pobj.actionBody.area = '大陆地区 ' pobj.actionBody.area = '大陆地区 '
pobj.actionBody.appName="阿里云商机"
pobj.actionBody.userName = item.UserName ? item.UserName : ""; pobj.actionBody.userName = item.UserName ? item.UserName : "";
pobj.actionBody.description = item.RegisterNumber pobj.actionBody.description = item.RegisterNumber
pobj.notes = `${item.RegisterNumber ? "RegisterNumber:" + item.RegisterNumber : ""}${item.Classification ? "Classification:" + item.Classification : ""}`; pobj.notes = `${item.RegisterNumber ? "RegisterNumber:" + item.RegisterNumber : ""}${item.Classification ? "Classification:" + item.Classification : ""}`;
...@@ -1495,16 +1506,36 @@ class UtilsNeedService extends AppServiceBase { ...@@ -1495,16 +1506,36 @@ class UtilsNeedService extends AppServiceBase {
if (pobj.actionBody.channel_type_code == 5) { if (pobj.actionBody.channel_type_code == 5) {
pobj.actionBody.type = "yiming.icp"; pobj.actionBody.type = "yiming.icp";
pobj.actionBody.idempotentSource = "yiming.icp"; pobj.actionBody.idempotentSource = "yiming.icp";
} else if (pobj.actionBody.channel_type_code == 7) { }
else if (pobj.actionBody.channel_type_code == 7) {
pobj.actionBody.type = "yiming.edi"; pobj.actionBody.type = "yiming.edi";
pobj.actionBody.idempotentSource = "yiming.edi"; pobj.actionBody.idempotentSource = "yiming.edi";
} else if (pobj.actionBody.channel_type_code == "icpnb") { }
else if (pobj.actionBody.channel_type_code == "ICPNB") {
pobj.actionBody.type = "yiming.icpnb"; pobj.actionBody.type = "yiming.icpnb";
pobj.actionBody.idempotentSource = "yiming.icpnb"; pobj.actionBody.idempotentSource = "yiming.icpnb";
} else if (pobj.actionBody.channel_type_code == "edinb") { }
else if (pobj.actionBody.channel_type_code == "EDINB") {
pobj.actionBody.type = "yiming.edinb"; pobj.actionBody.type = "yiming.edinb";
pobj.actionBody.idempotentSource = "yiming.edinb"; pobj.actionBody.idempotentSource = "yiming.edinb";
} }
else if(pobj.actionBody.channel_type_code == "ICPXQ"){
pobj.actionBody.type = "yiming.icpxq";
pobj.actionBody.idempotentSource = "yiming.icpxq";
}
else if(pobj.actionBody.channel_type_code == "EDIXQ"){
pobj.actionBody.type = "yiming.edixq";
pobj.actionBody.idempotentSource = "yiming.edixq";
}
//外资暂时产品库未上架
else if(pobj.actionBody.channel_type_code == "ICPWZ"){
pobj.actionBody.type = "yiming.icpwz";
pobj.actionBody.idempotentSource = "yiming.icpwz";
}
else if(pobj.actionBody.channel_type_code == "EDIWZ"){
pobj.actionBody.type = "yiming.ediwz";
pobj.actionBody.idempotentSource = "yiming.ediwz";
}
} }
if (pobj.actionBody.description && pobj.actionBody.description.indexOf("备#") < 0) { if (pobj.actionBody.description && pobj.actionBody.description.indexOf("备#") < 0) {
pobj.actionBody.level = "A"; pobj.actionBody.level = "A";
...@@ -1631,7 +1662,7 @@ class UtilsNeedService extends AppServiceBase { ...@@ -1631,7 +1662,7 @@ class UtilsNeedService extends AppServiceBase {
var tmpObj2 = { var tmpObj2 = {
actionBody: { actionBody: {
orderNo: channelOrderNo, orderNo: channelOrderNo,
channelNeedNo: rtn.data.channelNeedNo, channelNeedNo: rtn.data.channelNeedNo || channelOrderNo,//做云服和企服通没有渠道需求号的兼容
needsolution: rtn.data.solutionContent needsolution: rtn.data.solutionContent
}, },
appInfo: pobj.appInfo appInfo: pobj.appInfo
......
...@@ -4,6 +4,7 @@ const AppServiceBase = require("../../app.base"); ...@@ -4,6 +4,7 @@ const AppServiceBase = require("../../app.base");
const fs = require("fs"); const fs = require("fs");
const { json } = require("sequelize"); const { json } = require("sequelize");
const { getResult, getResultSuccess } = require("../../../system"); const { getResult, getResultSuccess } = require("../../../system");
const { type } = require("os");
//区分渠道的uappid //区分渠道的uappid
const uappId = { const uappId = {
'ali': 18, //(阿里icp、edi) 'ali': 18, //(阿里icp、edi)
...@@ -185,7 +186,7 @@ class UtilsNeedService2 extends AppServiceBase { ...@@ -185,7 +186,7 @@ class UtilsNeedService2 extends AppServiceBase {
if (result.data.uapp_id == uappId.ename) {// yiming / ename if (result.data.uapp_id == uappId.ename) {// yiming / ename
console.log("queryExpertApplyCommunicationLogs---ename---pobj--", pobj) console.log("queryExpertApplyCommunicationLogs---ename---pobj--", pobj)
console.log('settings.enameClientUrl()+"queryExpertApplyCommunicationLogs"----',settings.enameClientUrl()+"queryExpertApplyCommunicationLogs") console.log('settings.enameClientUrl()+"queryExpertApplyCommunicationLogs"----',settings.enameClientUrl()+"queryExpertApplyCommunicationLogs")
var res = await self.execClient.execEnamePost({ var res = await this.execClient.execEnamePost({
BeginTime: pobj.actionBody.BeginTime ? pobj.actionBody.BeginTime : "", BeginTime: pobj.actionBody.BeginTime ? pobj.actionBody.BeginTime : "",
EndTime: pobj.actionBody.EndTime ? pobj.actionBody.EndTime : "", EndTime: pobj.actionBody.EndTime ? pobj.actionBody.EndTime : "",
BizId: pobj.actionBody.intentionBizId, BizId: pobj.actionBody.intentionBizId,
...@@ -196,13 +197,36 @@ class UtilsNeedService2 extends AppServiceBase { ...@@ -196,13 +197,36 @@ class UtilsNeedService2 extends AppServiceBase {
console.log('ename+++queryExpertApplyCommunicationLogs---res---', res) console.log('ename+++queryExpertApplyCommunicationLogs---res---', res)
} }
} }
//判断易名是否有写接口
if(res && res.stdout == ""){//先判断没有写接口的情况
if(result && result.status == 0 && result.data && result.data.followContent){
for (let i = 0; i < result.data.followContent.length; i++) {
if(typeof(result.data.followContent[i]) == 'string'){
if(result && result.data && result.data.followContent && (JSON.parse(result.data.followContent[i])[0].content).indexOf('提交方案') > -1){
result.data.followContent.splice(i,1);
}
}
}
result.data['Data'] = result.data.followContent;
}
return getResultSuccess(result);
}else{//正常易名有查询沟通记录
if(res && res.data && res.data.result){ if(res && res.data && res.data.result){
res.data['Data'] = res.data.result res.data['Data'] = res.data.result
} }
return getResultSuccess(res); return getResultSuccess(res);
} }
}
async queryCommunicationLog(pobj) {
var reqUrl = this.centerOrderUrl + "action/need/springBoard";
var result = await this.restPostUrl(pobj, reqUrl);
if(result && result.data && result.data.followContent){
return getResultSuccess(result.data.followContent);
}else{
return system.getResult(null, "未查到跟进记录 100500");
}
}
} }
module.exports = UtilsNeedService2; module.exports = UtilsNeedService2;
\ No newline at end of file
...@@ -18,7 +18,7 @@ class UtilsOpNeedService extends AppServiceBase { ...@@ -18,7 +18,7 @@ class UtilsOpNeedService extends AppServiceBase {
} }
/** /**
* 提交需求 h5/pc 通用提交需求接口 如果需求内容是具体sku价格项 则不适用 目前只有鑫创在用。 * 提交需求 h5/pc 通用提交需求接口 如果需求内容是具体sku价格项 则不适用 目前只有鑫创and中小微在用。
* @param {*} pobj * @param {*} pobj
* @param {*} actionBody * @param {*} actionBody
*/ */
...@@ -30,16 +30,12 @@ class UtilsOpNeedService extends AppServiceBase { ...@@ -30,16 +30,12 @@ class UtilsOpNeedService extends AppServiceBase {
var url = settings.centerAppUrl() + "action/opProduct/springBoard"; var url = settings.centerAppUrl() + "action/opProduct/springBoard";
var opResult = await this.restPostUrl(sobj, url); var opResult = await this.restPostUrl(sobj, url);
if (opResult.status != 0) { if (opResult.status != 0) {
return system.getResultFail(-5015, "需求类型查询失败"); return system.getResultFail(-5015, "产品类型查询失败");
} }
sobj.actionType = "getProductDetail"; if (!opResult.data) {
sobj.actionBody.channelItemCode = opResult.data.channel_type_code; return system.getResultFail(-5016, "请检查产品类型编码");
var url = settings.centerAppUrl() + "action/opProduct/springBoard";
var opDetailResult = await this.restPostUrl(sobj, url);
if (opResult.status != 0) {
return system.getResultFail(-5015, "需求类型查询失败");
} }
pobj.actionBody.service_product_id = opDetailResult.data.price_list[0].service_code;// 获取skuid skuid应在product price表 代表具体价格项 pobj.actionBody.service_product_id = opResult.data.service_product_id;// 获取skuid skuid应在product price表 代表具体价格项
pobj.actionBody.productId = opResult.data.service_product_id;// productId 注意这里与上面不是相等的值。 productId代表一类产品应在type里 pobj.actionBody.productId = opResult.data.service_product_id;// productId 注意这里与上面不是相等的值。 productId代表一类产品应在type里
pobj.actionBody.appName = pobj.appInfo.app_name; pobj.actionBody.appName = pobj.appInfo.app_name;
pobj.actionBody.type_code = opResult.data.type_code; pobj.actionBody.type_code = opResult.data.type_code;
...@@ -51,8 +47,8 @@ class UtilsOpNeedService extends AppServiceBase { ...@@ -51,8 +47,8 @@ class UtilsOpNeedService extends AppServiceBase {
// 提交需求 // 提交需求
pobj.actionType = "opSubmitNeed"; pobj.actionType = "opSubmitNeed";
var reqUrl = this.centerOrderUrl + "action/opNeed/springBoard"; var reqUrl = this.centerOrderUrl + "action/opNeed/springBoard";
this.execClientNew.execLogs(`推送蜂擎前创建需求信息->opSubmitNeed->channel(opSubmitNeed)`, pobj, "center-channel-UtilsOpNeedService-opSubmitNeed", result, null);
var result = await this.restPostUrl(pobj, reqUrl); var result = await this.restPostUrl(pobj, reqUrl);
this.execClientNew.execLogs(`推送蜂擎前创建需求信息->opSubmitNeed->channel(opSubmitNeed)`, pobj, "center-channel-UtilsOpNeedService-opSubmitNeed", result, null);
if (result.status == 0) { if (result.status == 0) {
pobj.actionBody.idempotentId = result.data.channelNeedNo; pobj.actionBody.idempotentId = result.data.channelNeedNo;
pobj.actionBody.idempotentSource = opResult.data.channel_type_code; pobj.actionBody.idempotentSource = opResult.data.channel_type_code;
......
...@@ -155,6 +155,26 @@ class UtilsProductService extends AppServiceBase { ...@@ -155,6 +155,26 @@ class UtilsProductService extends AppServiceBase {
} }
/** /**
* 目前用作创建方案时获取当前app的商品(product)
* @returns {Promise<{msg: string, data, bizmsg: *|string, status: number}|any>}
*/
async getProducts(pobj) {
let url = settings.centerAppUrl() + 'action/opProduct/springBoard';
let result = await this.restPostUrl(pobj, url);
return result;
}
/**
* 目前用作创建方案时获取当前app的商品的属性(product_price-price_desc)
* @returns {Promise<{msg: string, data, bizmsg: *|string, status: number}|any>}
*/
async getProductsPrice(pobj) {
let url = settings.centerAppUrl() + 'action/opProduct/springBoard';
let result = await this.restPostUrl(pobj, url);
return result;
}
/**
* 获取全部产品大类 * 获取全部产品大类
* @returns {Promise<{msg: string, data, bizmsg: *|string, status: number}|any>} * @returns {Promise<{msg: string, data, bizmsg: *|string, status: number}|any>}
*/ */
......
...@@ -34,7 +34,8 @@ module.exports = { ...@@ -34,7 +34,8 @@ module.exports = {
"rtSubmitMaterial", "rtNotification", "rtSubmitSolution", "rtCloseNeed", "rtClosePlan", "rtSubmitMaterial", "rtNotification", "rtSubmitSolution", "rtCloseNeed", "rtClosePlan",
//百度工商注册 //百度工商注册
"regGetInfoByChannelNeedNo", "submitRegNeed", "regFeedbackSubmit", "regOrderStatus", "regOrderClose", "regGetInfoByChannelNeedNo", "submitRegNeed", "regFeedbackSubmit", "regOrderStatus", "regOrderClose",
"getSolutionByChannelOrderNo", "regSubmitSolution", "regNeedClose", // "getSolutionByChannelOrderNo",
"regSubmitSolution", "regNeedClose",
"regWriteCommunicationLog", "regQueryExpertCommunicationLogs", "regUpdateOrderStatus", "regPaySuccess", "regWriteCommunicationLog", "regQueryExpertCommunicationLogs", "regUpdateOrderStatus", "regPaySuccess",
//yiming/ename //yiming/ename
"eNameCloseOrder", "eNameCloseOrder",
......
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