Commit 3d4e0959 by 宋毅

增加产品id

parent dfea7fbf
......@@ -217,13 +217,15 @@ class RegCenterOrderService extends AppServiceBase {
var url = settings.centerAppUrl() + "action/opProduct/springBoard";
var rtn = await this.execClient.execPost(sobj, url);
if (!rtn || !rtn.stdout) {
return system.getResultFail(-5015, "需求型查询失败");
return system.getResultFail(-5015, "需求型查询失败");
}
var data = JSON.parse(rtn.stdout);
if (data.status != 0) {
return system.getResultFail(-5016, "需求型查询失败");
return system.getResultFail(-5016, "需求型查询失败");
}
pobj.actionBody.service_product_id= data.data.service_product_id;
pobj.actionBody.productId = data.data.service_product_id;
pobj.actionBody.appName = pobj.appInfo.app_name;
pobj.actionBody.type_code = data.data.type_code;
pobj.actionBody.type_name = data.data.type_name;
pobj.actionBody.channel_type_code = data.data.channel_type_code;
......@@ -263,8 +265,6 @@ class RegCenterOrderService extends AppServiceBase {
pobj.actionBody.idempotentId = pobj.actionBody.intentionBizId;
// pobj.actionBody.idempotentSource = pobj.actionBody.type;
pobj.actionBody.customerName = pobj.actionBody.userName;
//2021-1-21 laolan add new
pobj.actionBody.appName = pobj.appInfo.app_name || '',
this.utilsPushSve.baiduBusiness2Fq(pobj, "pushNeedICPBusinessNew");
}
return result;
......
var system = require("../../../system");
const AppServiceBase = require("../../app.base");
var settings = require("../../../../config/settings");
const { json } = require("sequelize");
const {json} = require("sequelize");
const {AREACOMM} = require("../../../../config/businessConfig");
//此类用来db中配置来进行调用-主要功能是推送蜂擎业务
class UtilsFqAliyunService extends AppServiceBase {
constructor() {
super();
this.ucommuneOperatorPhone = settings.ucommuneOperatorPhone()
}
async pushOrderBusinessByProductCode2Fq(pobj) {//推送自定义产品码的订单商机到峰擎(订单已经支付成功才推送)
console.log(JSON.stringify(pobj), ".................pushOrderBusinessByProductCode2Fq...............pobj");
var verifyResult = await this.verifyParam(pobj);
var orderInfo = pobj.actionBody.order_info;
var orderContact = pobj.actionBody.order_contact ? pobj.actionBody.order_contact : pobj.actionBody.delivery_content.orderContact;
var productInfo = pobj.actionBody.product_info;
if (!orderInfo) {
verifyResult = system.getResult(null, "orderInfo can not be empty,100420");
}
if (!orderInfo.orderStatus || orderInfo.orderStatus < 2) {
verifyResult = system.getResult(null, "orderInfo status must be paid,100423");
}
if (!orderContact || !orderContact.mobile) {
verifyResult = system.getResult(null, "orderInfo.orderContact.mobile can not be empty,100425");
}
if (!productInfo || !productInfo.service_business_code) {
verifyResult = system.getResult(null, "orderInfo.productInfo.service_business_code can not be empty,100427");
}
if (!['360.icp', '360.edi'].includes(productInfo.service_business_code)) {
if (!productInfo || !productInfo.price_item || !productInfo.price_item.service_code) {
verifyResult = system.getResult(null, "orderInfo.productInfo.price_item.service_code can not be empty,100430");
}
}
if (verifyResult.status != 0) {
return await this.disposePushResultFail(pobj, verifyResult, "fq->pushOrderBusinessByProductCode2Fq->verifyResult", this.pushlogFailType.FQ);
constructor() {
super();
this.centerOrderUrl = settings.centerOrderUrl();
this.ucommuneOperatorPhone = settings.ucommuneOperatorPhone()
}
var interface_params_info = verifyResult.data;
var ucommuneOperatorPhone = pobj.appInfo && pobj.appInfo.contact_mobile ? pobj.appInfo.contact_mobile : this.ucommuneOperatorPhone
console.log("推送的业务员手机号为:", ucommuneOperatorPhone)
var params = {
idempotentId: orderInfo.orderNo,// 是 业务 ID
idempotentSource: productInfo.service_business_code,// 是 业务来源(ic_jdyun、ic_ali)
idempotentSourceName: productInfo.service_business_name || productInfo.service_business_code,// 是 京东云应用、阿里云应用
area: productInfo.price_item.price_desc,// 否 所属城市
phone: orderContact.mobile,// 是 手机号
userId: orderInfo.channelUserId,// 否 用户 ID
companyName: "",// 否 公司名称
orderNo:orderInfo.orderNo,
orderPrice: orderInfo.totalSum,// 是 订单金额
productId: productInfo.price_item.service_code,// 是 产品 ID
productQuantity: orderInfo.quantity,// 是 产品数量
operator_phone: ucommuneOperatorPhone, // 2020 0704 推送fq 必填字段 这里以下为新增 7.7修改由写死改为从settings获取
createdat: orderInfo.created_at,// 2020 0722 lin新增 张超推送文档新增必填字段
thirdPartyCustomerId: orderInfo.channelUserId,
pay_flow_no: orderInfo.pay_flow_no,// 支付流水号
pay_channel: orderInfo.pay_channel,// 支付渠道(微信、支付宝)(必填)
pay_time: orderInfo.pay_time,//付款时间
pay_payer_bank_no: orderInfo.pay_payer_bank_no,//付款人账号
sku: productInfo.price_item.service_code,
appName: pobj.appInfo.app_name
};
// var result = await this.opAliyunClientPost(pobj, "pushOrderBusiness", interface_params_info.opUrl, interface_params_info.key, interface_params_info.secret, params);
var result = await this.opAliyunClientPost(pobj, interface_params_info.opUrl, interface_params_info.key, interface_params_info.secret, params);
return await this.disposePushResult(pobj, result, "fq->pushOrderBusinessByProductCode2Fq->result", this.pushlogFailType.FQ);
}
async pushOrderBusinessByProductCode2Fq(pobj) {//推送自定义产品码的订单商机到峰擎(订单已经支付成功才推送)
console.log(JSON.stringify(pobj), ".................pushOrderBusinessByProductCode2Fq...............pobj");
var verifyResult = await this.verifyParam(pobj);
var orderInfo = pobj.actionBody.order_info;
var orderContact = pobj.actionBody.order_contact ? pobj.actionBody.order_contact : pobj.actionBody.delivery_content.orderContact;
var productInfo = pobj.actionBody.product_info;
if (!orderInfo) {
verifyResult = system.getResult(null, "orderInfo can not be empty,100420");
}
if (!orderInfo.orderStatus || orderInfo.orderStatus < 2) {
verifyResult = system.getResult(null, "orderInfo status must be paid,100423");
}
if (!orderContact || !orderContact.mobile) {
verifyResult = system.getResult(null, "orderInfo.orderContact.mobile can not be empty,100425");
}
if (!productInfo || !productInfo.service_business_code) {
verifyResult = system.getResult(null, "orderInfo.productInfo.service_business_code can not be empty,100427");
}
if (!['360.icp', '360.edi'].includes(productInfo.service_business_code)) {
if (!productInfo || !productInfo.price_item || !productInfo.price_item.service_code) {
verifyResult = system.getResult(null, "orderInfo.productInfo.price_item.service_code can not be empty,100430");
}
}
if (verifyResult.status != 0) {
return await this.disposePushResultFail(pobj, verifyResult, "fq->pushOrderBusinessByProductCode2Fq->verifyResult", this.pushlogFailType.FQ);
}
/**
* 推送阿里信息操作到峰擎
* 阿里操作的信息不变外加增加组装的一些参数(推送工商需求商机、推送工商订单商机、推送关闭工商需求)
* @param {*} pobj
*/
async pushAliBusiness2Fq(pobj) {//推送阿里信息操作到峰擎
var verifyResult = await this.verifyParam(pobj);
if (verifyResult.status != 0) {
return await this.disposePushResultFail(pobj, verifyResult, "fq->pushAliBusiness2Fq->verifyResult", this.pushlogFailType.FQ);
var interface_params_info = verifyResult.data;
var ucommuneOperatorPhone = pobj.appInfo && pobj.appInfo.contact_mobile ? pobj.appInfo.contact_mobile : this.ucommuneOperatorPhone
console.log("推送的业务员手机号为:", ucommuneOperatorPhone)
var params = {
idempotentId: orderInfo.orderNo,// 是 业务 ID
idempotentSource: productInfo.service_business_code,// 是 业务来源(ic_jdyun、ic_ali)
idempotentSourceName: productInfo.service_business_name || productInfo.service_business_code,// 是 京东云应用、阿里云应用
area: productInfo.price_item.price_desc,// 否 所属城市
phone: orderContact.mobile,// 是 手机号
userId: orderInfo.channelUserId,// 否 用户 ID
companyName: "",// 否 公司名称
orderNo: orderInfo.orderNo,
orderPrice: orderInfo.totalSum,// 是 订单金额
productId: productInfo.price_item.service_code,// 是 产品 ID
productQuantity: orderInfo.quantity,// 是 产品数量
operator_phone: ucommuneOperatorPhone, // 2020 0704 推送fq 必填字段 这里以下为新增 7.7修改由写死改为从settings获取
createdat: orderInfo.created_at,// 2020 0722 lin新增 张超推送文档新增必填字段
thirdPartyCustomerId: orderInfo.channelUserId,
pay_flow_no: orderInfo.pay_flow_no,// 支付流水号
pay_channel: orderInfo.pay_channel,// 支付渠道(微信、支付宝)(必填)
pay_time: orderInfo.pay_time,//付款时间
pay_payer_bank_no: orderInfo.pay_payer_bank_no,//付款人账号
sku: productInfo.price_item.service_code,
appName: pobj.appInfo.app_name
};
// var result = await this.opAliyunClientPost(pobj, "pushOrderBusiness", interface_params_info.opUrl, interface_params_info.key, interface_params_info.secret, params);
var result = await this.opAliyunClientPost(pobj, interface_params_info.opUrl, interface_params_info.key, interface_params_info.secret, params);
return await this.disposePushResult(pobj, result, "fq->pushOrderBusinessByProductCode2Fq->result", this.pushlogFailType.FQ);
}
var interface_params_info = verifyResult.data;
var result = await this.opAliyunClientPost(pobj, interface_params_info.opUrl, interface_params_info.key, interface_params_info.secret, pobj.actionBody);
return await this.disposePushResult(pobj, result, "fq->pushAliBusiness2Fq->result", this.pushlogFailType.FQ);
}
//--------------------------------------------------内部辅助方法-------------------start-----------------
/**
* 推送阿里信息操作到峰擎
* 阿里操作的信息不变外加增加组装的一些参数(推送工商需求商机、推送工商订单商机、推送关闭工商需求)
* @param {*} pobj
*/
async pushAliBusiness2Fq(pobj) {//推送阿里信息操作到峰擎
var verifyResult = await this.verifyParam(pobj);
if (verifyResult.status != 0) {
return await this.disposePushResultFail(pobj, verifyResult, "fq->pushAliBusiness2Fq->verifyResult", this.pushlogFailType.FQ);
}
var interface_params_info = verifyResult.data;
if (interface_params_info.opUrl.indexOf("/cts-open-agency/crm/opportunity/submit") >= 0) {
async opAliyunClientPost(pobj, url, key, secret, params) {
try {
var rc = system.getObject("util.aliyunClient");
var rtn = await rc.post(url, key, secret, params);
this.logCtl.info({
appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "",
appkey: pobj.appInfo ? pobj.appInfo.uapp_key || "" : "",
requestId: pobj.requestId || "",
op: "service/impl/utilsSve/opAliyunClientPost.js/opAliyunClientPost",
content: rtn,
// clientIp: pobj.clientIp,
optitle: pobj.opType + "推送结果1->fq->opAliyunClientPost",
});
// typeof element === 'string' || typeof element === 'number'
if (typeof rtn.code === 'number' && rtn.code != 200 && rtn.success != true) {
return system.getResult(null, "推送失败,失败原因11:" + JSON.stringify(rtn));
}
if (typeof rtn.code === 'string' && rtn.code != "200" && rtn.success != true) {
return system.getResult(null, "推送失败,失败原因12:" + JSON.stringify(rtn));
}
return system.getResultSuccess(rtn.data, "推送成功");
} catch (e) {
//日志记录
this.logCtl.error({
appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "",
appkey: pobj.appInfo ? pobj.appInfo.uapp_key || "" : "",
requestId: pobj.requestId || "",
op: "service/impl/utilsSve/opAliyunClientPost.js/opAliyunClientPost",
content: "error:" + e.stack,
// clientIp: pobj.clientIp,
optitle: pobj.opType + "推送操作异常->fq->opAliyunClientPost",
});
return system.getResult(null, "推送操作异常->fq->opAliyunClientPost->error:" + e.stack);
}
var result = await this.opAliyunClientPost(pobj, interface_params_info.opUrl, interface_params_info.key, interface_params_info.secret, pobj.actionBody);
return await this.disposePushResult(pobj, result, "fq->pushAliBusiness2Fq->result", this.pushlogFailType.FQ);
}
}
async opICClientPost(pobj, url, key, secret, params) {
try {
var rc = system.getObject("util.aliyunClient");
var rtn = await rc.post(url, key, secret, params);
this.logCtl.info({
appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "",
appkey: pobj.appInfo ? pobj.appInfo.uapp_key || "" : "",
requestId: pobj.requestId || "",
op: "service/impl/utilsSve/opAliyunClientPost.js/opAliyunClientPost",
content: rtn,
// clientIp: pobj.clientIp,
optitle: pobj.opType + "推送结果2->fq->opAliyunClientPost",
});
if (typeof rtn.code === 'number' && rtn.code != 200 && rtn.success != true) {
return system.getResult(null, "推送失败,失败原因21:" + JSON.stringify(rtn));
}
if (typeof rtn.code === 'string' && rtn.code != "200" && rtn.success != true) {
return system.getResult(null, "推送失败,失败原因22:" + JSON.stringify(rtn));
}
return system.getResultSuccess(rtn.data, "推送成功");
} catch (e) {
//日志记录
this.logCtl.error({
appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "",
appkey: pobj.appInfo ? pobj.appInfo.uapp_key || "" : "",
requestId: pobj.requestId || "",
op: "service/impl/utilsSve/opAliyunClientPost.js/opAliyunClientPost",
content: "error:" + e.stack,
// clientIp: pobj.clientIp,
optitle: pobj.opType + "推送操作异常->fq->opAliyunClientPost",
});
return system.getResult(null, "推送操作异常->fq->opAliyunClientPost->error:" + e.stack);
async transformNeedActionBody(pobj) {
if (!pobj.actionBody.area) {
pobj.actionBody.area = "全国";
}
if (pobj.actionBody.area != "全国" && pobj.actionBody.area.indexOf("市") < 0 && pobj.actionBody.area.indexOf("省") < 0) {
pobj.actionBody.area = AREACOMM.areaTransform[pobj.actionBody.area] || pobj.actionBody.area;
}
if (pobj.actionBody.intentionBizId && (!pobj.actionBody.appName || !pobj.actionBody.productId)) {
//获取需求信息
let tmpActionBody = {
actionBody: {needNo: pobj.actionBody.intentionBizId}
}
var reqUrl = this.centerOrderUrl + "action/need/getNeedItemByChannelNeedNo";
var itemResult = await this.restPostUrl(tmpActionBody, reqUrl);
if (itemResult.status == 0 && itemResult.data) {
pobj.actionBody.appName = itemResult.data.appName;
pobj.actionBody.productId = itemResult.data.serviceProductId;
}
}
}
}
//--------------------------------------------------内部辅助方法-------------------start-----------------
async verifyParam(pobj) {//参数信息验证
var verify = system.getResultSuccess();
if (!pobj.interface_params) {
verify = system.getResult(null, "interface_params can not be empty,100400");
}
var interface_params_info = JSON.parse(pobj.interface_params);
if (!interface_params_info || !interface_params_info.opUrl || !interface_params_info.key || !interface_params_info.secret) {
verify = system.getResult(null, "interface_params(opUrl、key、secret) can not be empty,100410");
async opAliyunClientPost(pobj, url, key, secret, params) {
try {
var rc = system.getObject("util.aliyunClient");
var rtn = await rc.post(url, key, secret, params);
this.logCtl.info({
appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "",
appkey: pobj.appInfo ? pobj.appInfo.uapp_key || "" : "",
requestId: pobj.requestId || "",
op: "service/impl/utilsSve/opAliyunClientPost.js/opAliyunClientPost",
content: rtn,
// clientIp: pobj.clientIp,
optitle: pobj.opType + "推送结果1->fq->opAliyunClientPost",
});
// typeof element === 'string' || typeof element === 'number'
if (typeof rtn.code === 'number' && rtn.code != 200 && rtn.success != true) {
return system.getResult(null, "推送失败,失败原因11:" + JSON.stringify(rtn));
}
if (typeof rtn.code === 'string' && rtn.code != "200" && rtn.success != true) {
return system.getResult(null, "推送失败,失败原因12:" + JSON.stringify(rtn));
}
return system.getResultSuccess(rtn.data, "推送成功");
} catch (e) {
//日志记录
this.logCtl.error({
appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "",
appkey: pobj.appInfo ? pobj.appInfo.uapp_key || "" : "",
requestId: pobj.requestId || "",
op: "service/impl/utilsSve/opAliyunClientPost.js/opAliyunClientPost",
content: "error:" + e.stack,
// clientIp: pobj.clientIp,
optitle: pobj.opType + "推送操作异常->fq->opAliyunClientPost",
});
return system.getResult(null, "推送操作异常->fq->opAliyunClientPost->error:" + e.stack);
}
}
verify.data = interface_params_info;
return verify;
}
//下订单到ic
async pushOrder2IC(pobj, opType) {
console.log(JSON.stringify(pobj), ".................pushOrderBusinessByProductCode2Fq...............pobj");
var interface_list = pobj.interface_info ? pobj.interface_info : pobj.actionBody.product_info.interface_info;
if (!interface_list) {
return system.getResult(null, "暂无推送配置");
async opICClientPost(pobj, url, key, secret, params) {
try {
var rc = system.getObject("util.aliyunClient");
var rtn = await rc.post(url, key, secret, params);
this.logCtl.info({
appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "",
appkey: pobj.appInfo ? pobj.appInfo.uapp_key || "" : "",
requestId: pobj.requestId || "",
op: "service/impl/utilsSve/opAliyunClientPost.js/opAliyunClientPost",
content: rtn,
// clientIp: pobj.clientIp,
optitle: pobj.opType + "推送结果2->fq->opAliyunClientPost",
});
if (typeof rtn.code === 'number' && rtn.code != 200 && rtn.success != true) {
return system.getResult(null, "推送失败,失败原因21:" + JSON.stringify(rtn));
}
if (typeof rtn.code === 'string' && rtn.code != "200" && rtn.success != true) {
return system.getResult(null, "推送失败,失败原因22:" + JSON.stringify(rtn));
}
return system.getResultSuccess(rtn.data, "推送成功");
} catch (e) {
//日志记录
this.logCtl.error({
appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "",
appkey: pobj.appInfo ? pobj.appInfo.uapp_key || "" : "",
requestId: pobj.requestId || "",
op: "service/impl/utilsSve/opAliyunClientPost.js/opAliyunClientPost",
content: "error:" + e.stack,
// clientIp: pobj.clientIp,
optitle: pobj.opType + "推送操作异常->fq->opAliyunClientPost",
});
return system.getResult(null, "推送操作异常->fq->opAliyunClientPost->error:" + e.stack);
}
}
var interface_list_temp = interface_list.filter(f => f.op_type == opType)
if (!interface_list_temp || interface_list_temp.length == 0) {
return system.getResult(null, "暂无【" + opType + "】的推送配置");
}
var verifyResult = system.getResultSuccess();
var productInfo = pobj.actionBody.product_info;
if (!productInfo || !productInfo.service_business_code) {
verifyResult = system.getResult(null, "orderInfo.productInfo.service_business_code can not be empty,100427");
}
if (!productInfo || !productInfo.price_item || !productInfo.price_item.service_code) {
verifyResult = system.getResult(null, "orderInfo.productInfo.price_item.service_code can not be empty,100430");
async verifyParam(pobj) {//参数信息验证
var verify = system.getResultSuccess();
if (!pobj.interface_params) {
verify = system.getResult(null, "interface_params can not be empty,100400");
}
var interface_params_info = JSON.parse(pobj.interface_params);
if (!interface_params_info || !interface_params_info.opUrl || !interface_params_info.key || !interface_params_info.secret) {
verify = system.getResult(null, "interface_params(opUrl、key、secret) can not be empty,100410");
}
verify.data = interface_params_info;
return verify;
}
var interface_params_info = JSON.parse(interface_list_temp[0].params);
//新增订单(商标自助注册) IC
let icOrderParams = {
"idempotentSource": "pcwebsbzc",// 来源编号,写死:pcwebsbzc,必填
"idempotentSourceName": "PC官网",// 来源编号,写死:PC官网,必填
"product_img_url": pobj.actionBody.deliveryData.tm.picUrl,//产品图片
"productId": productInfo.price_item.service_code,// 云服产品skuid,必填
"goodsId": pobj.actionBody.goodsId,// 官网产品id
"customerId": pobj.actionBody.customerId, //客户Id,必填
"product_item": pobj.actionBody.product_item,
"device_token": pobj.actionBody.device_token //设备编号参数
//下订单到ic
async pushOrder2IC(pobj, opType) {
console.log(JSON.stringify(pobj), ".................pushOrderBusinessByProductCode2Fq...............pobj");
var interface_list = pobj.interface_info ? pobj.interface_info : pobj.actionBody.product_info.interface_info;
if (!interface_list) {
return system.getResult(null, "暂无推送配置");
}
var interface_list_temp = interface_list.filter(f => f.op_type == opType)
if (!interface_list_temp || interface_list_temp.length == 0) {
return system.getResult(null, "暂无【" + opType + "】的推送配置");
}
var verifyResult = system.getResultSuccess();
var productInfo = pobj.actionBody.product_info;
if (!productInfo || !productInfo.service_business_code) {
verifyResult = system.getResult(null, "orderInfo.productInfo.service_business_code can not be empty,100427");
}
if (!productInfo || !productInfo.price_item || !productInfo.price_item.service_code) {
verifyResult = system.getResult(null, "orderInfo.productInfo.price_item.service_code can not be empty,100430");
}
var interface_params_info = JSON.parse(interface_list_temp[0].params);
//新增订单(商标自助注册) IC
let icOrderParams = {
"idempotentSource": "pcwebsbzc",// 来源编号,写死:pcwebsbzc,必填
"idempotentSourceName": "PC官网",// 来源编号,写死:PC官网,必填
"product_img_url": pobj.actionBody.deliveryData.tm.picUrl,//产品图片
"productId": productInfo.price_item.service_code,// 云服产品skuid,必填
"goodsId": pobj.actionBody.goodsId,// 官网产品id
"customerId": pobj.actionBody.customerId, //客户Id,必填
"product_item": pobj.actionBody.product_item,
"device_token": pobj.actionBody.device_token //设备编号参数
}
pobj.params = icOrderParams;
var result = await this.opICClientPost(pobj, interface_params_info.opUrl, interface_params_info.key, interface_params_info.secret, icOrderParams);
return await this.disposePushResult(pobj, result, "fq->pushOrder2IC->result", this.pushlogFailType.FQ);
}
pobj.params = icOrderParams;
var result = await this.opICClientPost(pobj, interface_params_info.opUrl, interface_params_info.key, interface_params_info.secret, icOrderParams);
return await this.disposePushResult(pobj, result, "fq->pushOrder2IC->result", this.pushlogFailType.FQ);
}
//--------------------------------------------------内部辅助方法-------------------end-----------------
//--------------------------------------------------内部辅助方法-------------------end-----------------
}
module.exports = UtilsFqAliyunService;
var system = require("../../../system");
var settings = require("../../../../config/settings");
const AppServiceBase = require("../../app.base");
const fs = require("fs");
const {json} = require("sequelize");
const {getResult, getResultSuccess} = require("../../../system");
//需求操作类----操作类型-公用的
class UtilsNeedCommService extends AppServiceBase {
constructor() {
super();
this.centerOrderUrl = settings.centerOrderUrl();
this.utilsPushSve = system.getObject("service.utilsSve.utilsPushSve");
this.aliclient = system.getObject("util.aliyunClient");
this.ossClient = system.getObject("util.ossClient");
this.restClient = system.getObject("util.restClient");
this.utilsOrderSve = system.getObject("service.utilsSve.utilsOrderSve");
this.qcCenterOrderSve = system.getObject("service.common.qcCenterOrderSve");
this.opPushQueueUrl = settings.opPushQueueUrl();
this.utilsAuthSve = system.getObject("service.utilsSve.utilsAuthSve");
}
/**
* 提交需求
* @param {*} pobj
* @param {*} actionBody
*/
async submitNeed(pobj, actionBody) {
if (actionBody.type == "esp.wangwen" || actionBody.type == "esp.food") {
actionBody.area = this.wangwenAreaChange(actionBody.area)
}
if (!actionBody.type && actionBody.consultType)
actionBody.type = actionBody.consultType
if (!actionBody.intentionBizId) {
return system.getResult(null, "actionBody.intentionBizId can not be empty,100380");
}
var sobj = pobj;
sobj.actionType = "getProductTypeInfo";
var url = settings.centerAppUrl() + "action/opProduct/springBoard";
var rtn = await this.execClient.execPost(sobj, url);
if (!rtn || !rtn.stdout) {
return system.getResultFail(-5015, "需求类型查询失败");
}
var data = JSON.parse(rtn.stdout);
if (data.status != 0) {
return system.getResultFail(-5015, "需求类型查询失败");
}
pobj.actionBody.service_product_id = data.data.service_product_id;
pobj.actionBody.productId = data.data.service_product_id;
pobj.actionBody.appName = pobj.appInfo.app_name;
pobj.actionBody.type_code = data.data.type_code;
pobj.actionBody.type_name = data.data.type_name;
pobj.actionBody.channel_type_code = data.data.channel_type_code;
pobj.actionBody.channel_type_name = data.data.channel_type_name;
pobj.actionBody.type = pobj.actionBody.channel_type_code;
pobj.actionBody.phone = pobj.actionBody.phone || pobj.actionBody.mobile;
pobj.actionBody.idempotentId = pobj.actionBody.intentionBizId;
pobj.actionBody.idempotentSourceName = pobj.appInfo.app_name;
pobj.actionType = "submitNeed";
var reqUrl = this.centerOrderUrl + "action/need/springBoard";
var result = await this.restPostUrl(pobj, reqUrl);
if (result.status == 0) {
//做推送信息
}
return result;
}
}
module.exports = UtilsNeedCommService;
......@@ -39,19 +39,21 @@ class UtilsNeedService extends AppServiceBase {
var url = settings.centerAppUrl() + "action/opProduct/springBoard";
var rtn = await this.execClient.execPost(sobj, url);
if (!rtn || !rtn.stdout) {
return system.getResultFail(-5015, "需求型查询失败");
return system.getResultFail(-5015, "需求型查询失败");
}
var data = JSON.parse(rtn.stdout);
if (data.status != 0) {
return system.getResultFail(-5015, "需求型查询失败");
return system.getResultFail(-5015, "需求型查询失败");
}
pobj.actionBody.service_product_id= data.data.service_product_id;
pobj.actionBody.productId = data.data.service_product_id;
pobj.actionBody.appName = pobj.appInfo.app_name;
pobj.actionBody.type_code = data.data.type_code;
pobj.actionBody.type_name = data.data.type_name;
pobj.actionBody.channel_type_code = data.data.channel_type_code;
pobj.actionBody.channel_type_name = data.data.channel_type_name;
pobj.actionBody.type = pobj.actionBody.channel_type_code;
pobj.actionBody.phone = pobj.actionBody.phone || pobj.actionBody.mobile;
pobj.actionBody.appName = pobj.appInfo.app_name;
pobj.actionBody.idempotentId = pobj.actionBody.intentionBizId;
pobj.actionBody.idempotentSourceName = pobj.appInfo.app_name;
if (pobj.actionBody.channel_type_code == 5) {
......@@ -145,13 +147,15 @@ class UtilsNeedService extends AppServiceBase {
if (data.status != 0) {
return system.getResultFail(-5015, "需求类型查询失败");
}
pobj.actionBody.service_product_id= data.data.service_product_id;
pobj.actionBody.productId = data.data.service_product_id;
pobj.actionBody.appName = pobj.appInfo.app_name;
pobj.actionBody.type_code = data.data.type_code;
pobj.actionBody.type_name = data.data.type_name;
pobj.actionBody.channel_type_code = data.data.channel_type_code;
pobj.actionBody.channel_type_name = data.data.channel_type_name;
pobj.actionBody.type = pobj.actionBody.channel_type_code;
pobj.actionBody.phone = pobj.actionBody.phone || pobj.actionBody.mobile;
pobj.actionBody.appName = pobj.appInfo.app_name;
pobj.actionBody.idempotentId = pobj.actionBody.intentionBizId;
pobj.actionBody.idempotentSourceName = pobj.appInfo.app_name;
if (pobj.actionBody.channel_type_code == 5) {
......@@ -294,6 +298,9 @@ class UtilsNeedService extends AppServiceBase {
if (data.status != 0) {
return system.getResultFail(-5015, "需求类型查询失败");
}
pobj.actionBody.service_product_id= data.data.service_product_id;
pobj.actionBody.productId = data.data.service_product_id;
pobj.actionBody.appName = pobj.appInfo.app_name;
pobj.actionBody.type_code = data.data.type_code;
pobj.actionBody.type_name = data.data.type_name;
pobj.actionBody.channel_type_code = data.data.channel_type_code;
......@@ -1533,6 +1540,9 @@ class UtilsNeedService extends AppServiceBase {
if (data.status != 0) {
return system.getResultFail(-5015, "需求類型查询失败");
}
pobj.actionBody.service_product_id= data.data.service_product_id;
pobj.actionBody.productId = data.data.service_product_id;
pobj.actionBody.appName = pobj.appInfo.app_name;
pobj.actionBody.type_code = data.data.type_code;
pobj.actionBody.type_name = data.data.type_name;
pobj.actionBody.channel_type_code = data.data.channel_type_code;
......@@ -1607,8 +1617,6 @@ class UtilsNeedService extends AppServiceBase {
pobj.actionBody.idempotentId = pobj.actionBody.intentionBizId;
// pobj.actionBody.idempotentSource = pobj.actionBody.type;
pobj.actionBody.customerName = pobj.actionBody.userName;
//2021-1-21 laolan add new
pobj.actionBody.appName = pobj.appInfo.app_name || '',
this.utilsPushSve.baiduBusiness2Fq(pobj, "pushNeedICPBusinessNew");
}
}
......
......@@ -53,12 +53,14 @@ class UtilsNeedService2 extends AppServiceBase {
if (data.status != 0) {
return system.getResultFail(-5015, "需求類型查询失败");
}
pobj.actionBody.service_product_id= data.data.service_product_id;
pobj.actionBody.productId = data.data.service_product_id;
pobj.actionBody.appName = pobj.appInfo.app_name;
pobj.actionBody.type_code = data.data.type_code;
pobj.actionBody.type_name = data.data.type_name;
pobj.actionBody.channel_type_code = data.data.channel_type_code;
pobj.actionBody.channel_type_name = data.data.channel_type_name;
pobj.actionBody.type = pobj.actionBody.channel_type_code;
pobj.actionBody.appName = pobj.appInfo.app_name;
if (pobj.actionBody.channel_type_code == 5) {
pobj.actionBody.type = "ali.icp";
} else if (pobj.actionBody.channel_type_code == 7) {
......@@ -147,6 +149,9 @@ class UtilsNeedService2 extends AppServiceBase {
if (data.status != 0) {
return system.getResultFail(-5015, "需求类型查询失败");
}
pobj.actionBody.service_product_id= data.data.service_product_id;
pobj.actionBody.productId = data.data.service_product_id;
pobj.actionBody.appName = pobj.appInfo.app_name;
pobj.actionBody.type_code = data.data.type_code;
pobj.actionBody.type_name = data.data.type_name;
pobj.actionBody.channel_type_code = data.data.channel_type_code;
......@@ -1401,18 +1406,20 @@ class UtilsNeedService2 extends AppServiceBase {
var url = settings.centerAppUrl() + "action/opProduct/springBoard";
var rtn = await this.execClient.execPost(sobj, url);
if (!rtn || !rtn.stdout) {
return system.getResultFail(-5015, "需求型查询失败");
return system.getResultFail(-5015, "需求型查询失败");
}
var data = JSON.parse(rtn.stdout);
if (data.status != 0) {
return system.getResultFail(-5015, "需求型查询失败");
return system.getResultFail(-5015, "需求型查询失败");
}
pobj.actionBody.service_product_id= data.data.service_product_id;
pobj.actionBody.productId = data.data.service_product_id;
pobj.actionBody.appName = pobj.appInfo.app_name;
pobj.actionBody.type_code = data.data.type_code;
pobj.actionBody.type_name = data.data.type_name;
pobj.actionBody.channel_type_code = data.data.channel_type_code;
pobj.actionBody.channel_type_name = data.data.channel_type_name;
pobj.actionBody.type = pobj.actionBody.channel_type_code;
pobj.actionBody.appName = pobj.appInfo.app_name;
if (pobj.actionBody.channel_type_code == 5) {
pobj.actionBody.type = "baidu.icp";
} else if (pobj.actionBody.channel_type_code == 7) {
......
......@@ -18,7 +18,7 @@ class UtilsOpNeedService extends AppServiceBase {
}
/**
* 提交需求 h5/pc 通用
* 提交需求 h5/pc 通用提交需求接口
* @param {*} pobj
* @param {*} actionBody
*/
......@@ -32,18 +32,20 @@ class UtilsOpNeedService extends AppServiceBase {
if (opResult.status != 0) {
return system.getResultFail(-5015, "需求类型查询失败");
}
pobj.actionBody.service_product_id= opResult.data.service_product_id;
pobj.actionBody.productId = opResult.data.service_product_id;
pobj.actionBody.appName = pobj.appInfo.app_name;
pobj.actionBody.type_code = opResult.data.type_code;
pobj.actionBody.type_name = opResult.data.type_name;
pobj.actionBody.channel_type_code = opResult.data.channel_type_code;
pobj.actionBody.channel_type_name = opResult.data.channel_type_name;
pobj.actionBody.appName = pobj.appInfo.app_name;
}
// 提交需求 暂未做推送
pobj.actionType = "opSubmitNeed";
var reqUrl = this.centerOrderUrl + "action/opNeed/springBoard";
var result = await this.restPostUrl(pobj, reqUrl);
if (result.status == 0) {
if (pobj.actionBody.channel_type_code == "esp.companyreg") {
if (pobj.actionBody.channel_type_code == "esp.companyreg" || pobj.actionBody.channel_type_code == "esp.companyreg_cloud") {
this.utilsPushSve.aliBusiness2Fq(pobj, "pushNeedBusiness");
}
}
......
......@@ -808,7 +808,7 @@ class UtilsOrderService extends AppServiceBase {
}
}
async opH5AliDingPayBackNotify(parmas, client_ip) { //操作回调业务逻辑
async opH5AliDingPayBackNotify(parmas, client_ip) { //操作回调业务逻辑-钉钉接入的搁浅
try {
//日志记录
this.logCtl.info({
......
......@@ -17,25 +17,25 @@ module.exports = {
"ncSubmitMaterial", "ncNotification", "ncSubmitSolution", "ncCloseNeed", "ncClosePlan",
"rtSubmitMaterial", "rtNotification", "rtSubmitSolution", "rtCloseNeed", "rtClosePlan",
"getParamsFor360", "addOrderWeb", "getPayRecords", "getLoginInfo", "putUserMobileByVcode",
"putUserPwdByMobile", "icpNotifyNew","getOrderStatisticsByUappId","getOrderStatisticsByProduct","getOrdersComparison","getOrdersComparisonList",
"importOrders","importNeeds","receiveAliTmOrder","receiveAliTmOrderRefund",
"putUserPwdByMobile", "icpNotifyNew", "getOrderStatisticsByUappId", "getOrderStatisticsByProduct", "getOrdersComparison", "getOrdersComparisonList",
"importOrders", "importNeeds", "receiveAliTmOrder", "receiveAliTmOrderRefund",
//百度工商注册
"regGetInfoByChannelNeedNo","submitRegNeed","regFeedbackSubmit","regOrderStatus","regOrderClose",
"getSolutionByChannelOrderNo","regSubmitSolution","regNeedClose",
"regWriteCommunicationLog","regQueryExpertCommunicationLogs","regUpdateOrderStatus","regPaySuccess",
"regGetInfoByChannelNeedNo", "submitRegNeed", "regFeedbackSubmit", "regOrderStatus", "regOrderClose",
"getSolutionByChannelOrderNo", "regSubmitSolution", "regNeedClose",
"regWriteCommunicationLog", "regQueryExpertCommunicationLogs", "regUpdateOrderStatus", "regPaySuccess",
//yiming/ename
"eNameCloseOrder",
],
apiMustUserpinList: [
"icpOrderClose",
"submitNeed", "paySuccess", "icpNotify", "getLoginInfo", "icpNotifyNew", "submitIcpProgramme","serviceProviderSubmitMaterial","abolishIcpProgramme",
"submitService","serviceProviderNotification",
"ncSubmitMaterial","ncNotification","ncSubmitSolution","ncCloseNeed","ncClosePlan",
"rtSubmitMaterial","rtNotification","rtSubmitSolution","rtCloseNeed","rtClosePlan",
"submitNeed", "paySuccess", "icpNotify", "getLoginInfo", "icpNotifyNew", "submitIcpProgramme", "serviceProviderSubmitMaterial", "abolishIcpProgramme",
"submitService", "serviceProviderNotification",
"ncSubmitMaterial", "ncNotification", "ncSubmitSolution", "ncCloseNeed", "ncClosePlan",
"rtSubmitMaterial", "rtNotification", "rtSubmitSolution", "rtCloseNeed", "rtClosePlan",
//百度工商注册
"regGetInfoByChannelNeedNo","submitRegNeed","regFeedbackSubmit","regOrderStatus","regOrderClose",
"getSolutionByChannelOrderNo","regSubmitSolution","regNeedClose",
"regWriteCommunicationLog","regQueryExpertCommunicationLogs","regUpdateOrderStatus","regPaySuccess",
"regGetInfoByChannelNeedNo", "submitRegNeed", "regFeedbackSubmit", "regOrderStatus", "regOrderClose",
"getSolutionByChannelOrderNo", "regSubmitSolution", "regNeedClose",
"regWriteCommunicationLog", "regQueryExpertCommunicationLogs", "regUpdateOrderStatus", "regPaySuccess",
//yiming/ename
"eNameCloseOrder",
],
......@@ -59,5 +59,81 @@ module.exports = {
"/api/tm/tmcase/nbtzreceiveAssistTmData",
"/api/tm/tmcase/nbtzreceiveEditAssistTmData"
]
},
AREACOMM: {
areaTransform: {
"上海": "上海市",
"东莞": "东莞市",
"佛山": "佛山市",
"北京": "北京市",
"南京": "南京市",
"南昌": "南昌市",
"南通": "南通市",
"台州": "台州市",
"合肥": "合肥市",
"嘉兴": "嘉兴市",
"大连": "大连市",
"天津": "天津市",
"太原": "太原市",
"宁波": "宁波市",
"常州": "常州市",
"广州": "广州市",
"徐州": "徐州市",
"成都": "成都市",
"扬州": "扬州市",
"无锡": "无锡市",
"昆明": "昆明市",
"杭州": "杭州市",
"武汉": "武汉市",
"沈阳": "沈阳市",
"济南": "济南市",
"深圳": "深圳市",
"温州": "温州市",
"烟台": "烟台市",
"福州": "福州市",
"绍兴": "绍兴市",
"苏州": "苏州市",
"西安": "西安市",
"贵阳": "贵阳市",
"郑州": "郑州市",
"重庆": "重庆市",
"金华": "金华市",
"长春": "长春市",
"长沙": "长沙市",
"青岛": "青岛市",
"开封": "开封市",
"哈尔滨": "哈尔滨市",
"石家庄": "石家庄市",
"福建": "福建省",
"广西": "广西",
"广东": "广东省",
"安徽": "安徽省",
"河南": "河南省",
"湖北": "湖北省",
"浙江": "浙江省",
"江苏": "江苏省",
"山东": "山东省",
"陕西": "陕西省",
"宁夏": "宁夏",
"甘肃": "甘肃省",
"新疆": "新疆",
"青海": "青海省",
"河北": "河北省",
"山西": "山西省",
"辽宁": "辽宁省",
"吉林": "吉林省",
"黑龙江": "黑龙江省",
"江西": "江西省",
"湖南": "湖南省",
"四川": "四川省",
"贵州": "贵州省",
"云南": "云南省",
"内蒙古": "内蒙古",
"西藏": "西藏",
"含外资": "含外资",
"全外资": "全外资",
"香港": "香港",
"海南": "海南省",
}
}
}
......@@ -12,7 +12,7 @@ const settings = require("../../config/settings");
module.exports = function (app) {
//-----------------------新的模式---------web---------开始
app.use('/tlpay/aliPayNotify', async function (req, res) {
app.use('/tlpay/aliPayNotify', async function (req, res) {//钉钉接入的搁浅
try {
var client_ip = system.get_client_ip(req);
var result = await utilsOrderSve.opH5AliDingPayBackNotify(req.body, client_ip);
......
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