Commit 03793972 by 宋毅

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

parents e88275e8 5fe7af1d
...@@ -581,7 +581,7 @@ class CenterorderService extends AppServiceBase { ...@@ -581,7 +581,7 @@ class CenterorderService extends AppServiceBase {
} }
pobj.actionBody.channelSolutionNo = pobj.actionBody.bizId; pobj.actionBody.channelSolutionNo = pobj.actionBody.bizId;
pobj.actionType = "receiveSolutionPayInfo"; pobj.actionType = "receiveSolutionPayInfoNew";
var url = settings.centerOrderUrl() + "action/icapi/springBoard"; var url = settings.centerOrderUrl() + "action/icapi/springBoard";
var solutionrtn = await this.execClient.execPost(pobj, url); var solutionrtn = await this.execClient.execPost(pobj, url);
if (!solutionrtn || !solutionrtn.stdout) { if (!solutionrtn || !solutionrtn.stdout) {
......
...@@ -1394,6 +1394,9 @@ class UtilsNeedService extends AppServiceBase { ...@@ -1394,6 +1394,9 @@ class UtilsNeedService extends AppServiceBase {
async icpNotifyNew(pobj) { async icpNotifyNew(pobj) {
var actionBody = pobj.actionBody; var actionBody = pobj.actionBody;
var self = this; var self = this;
if(actionBody.isDirectBuy && actionBody.isDirectBuy==1){
actionBody.bizId = actionBody.orderNo
}
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");
} }
...@@ -1401,7 +1404,7 @@ class UtilsNeedService extends AppServiceBase { ...@@ -1401,7 +1404,7 @@ class UtilsNeedService extends AppServiceBase {
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");
} }
pobj.actionType = "receiveIcpStatusNotify"; pobj.actionType = "receiveOrderStatusNotify";
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);
if (actionBody.status == 2) { if (actionBody.status == 2) {
......
...@@ -80,10 +80,12 @@ class UtilsOrderService extends AppServiceBase { ...@@ -80,10 +80,12 @@ class UtilsOrderService extends AppServiceBase {
return productItemResult; return productItemResult;
} }
pobj.actionBody.product_info = productItemResult.data; pobj.actionBody.product_info = productItemResult.data;
if(pobj.appInfo.app_code !="zc360"){
var verifyResult = await this.isOrderVerify(pobj, pobj.actionBody); var verifyResult = await this.isOrderVerify(pobj, pobj.actionBody);
if (verifyResult.status != 0) { if (verifyResult.status != 0) {
return verifyResult; return verifyResult;
} }
}
pobj.actionType = "getProductInterface"; pobj.actionType = "getProductInterface";
pobj.actionBody.product_id = pobj.actionBody.product_info.id; pobj.actionBody.product_id = pobj.actionBody.product_info.id;
var productItemInterfaceResult = await this.restPostUrl(pobj, url); var productItemInterfaceResult = await this.restPostUrl(pobj, url);
...@@ -951,7 +953,102 @@ class UtilsOrderService extends AppServiceBase { ...@@ -951,7 +953,102 @@ class UtilsOrderService extends AppServiceBase {
opOrderResult.data = null; opOrderResult.data = null;
return opOrderResult; return opOrderResult;
} catch (e) { } catch (e) {
await this.cacheManager["TlPayLocker"].release(params.orderNo); // await this.cacheManager["TlPayLocker"].release(params.orderNo);
this.logCtl.error({
optitle: "回调处理订单---error异常",
op: "center-app/app/base/service/impl/utilsSve/utilsOrderSve.js/channelPayNotify",
content: "参数=" + JSON.stringify(params) + ",error:" + e.stack,
clientIp: client_ip || ""
});
return system.getResultFail(-200, e.stack);
}
}
async channelPayNotify360(params, client_ip) {//渠道订单支付通知
try {
this.logCtl.info({
optitle: (new Date()).Format("yyyy-MM-dd hh:mm:ss") + "渠道订单支付回调参数信息",
op: "service/impl/utilsSve/utilsOrderSve.js/channelPayNotify",
content: JSON.stringify(params),
clientIp: client_ip || ""
});
if (!params.appkey) {
return system.getResult(null, 'appKey can be not null')
}
if (!params.orderNo) {
return system.getResult(null, 'orderNo can be not null')
}
if (!params.payTotalSum) {
return system.getResult(null, 'payTotalSum can be not null')
}
if (!params.signature) {
return system.getResult(null, 'signature can be not null')
}
if (!params.payType) {
return system.getResult(null, 'payType can be not null')
}
if (!params.payOrderNo) {
return system.getResult(null, 'payOrderNo can be not null')
}
let url = this.centerAppUrl + 'payment/paymentApi/getAppInfoByAppKey';
let appInfoRt = await this.restPostUrl({ appKey: params.appkey }, url);
if (appInfoRt.status != 0) {
appInfoRt.msg = appInfoRt.msg + ",100270";
return appInfoRt;
}
let singStr = params.appkey + params.orderNo + params.payTotalSum + appInfoRt.data.uapp_secret
let sign = md5(singStr).toUpperCase();
if (sign != params.signature) {
return system.getResultFail(-1, '验证签名失败')
}
var appInfo = appInfoRt.data;
params.appInfo = { uapp_id: appInfo.uapp_id };
params.pay_type = params.payType;
params.time_end = params.payTime;
//修改并返回订单支付状态,创建收款单
// 这里修改了order_info的状态(status/paytime等)
var orderUrl = this.centerOrderUrl + "opaction/opPayOrder/receivePayCallBackNotifyByChannel";
var opOrderResult = await this.restPostUrl(params, orderUrl);
if (opOrderResult.status != 0) {
opOrderResult.data = null;
return opOrderResult;
}
if(!opOrderResult.data){
return opOrderResult;
}
opOrderResult.data.appInfo = {
uapp_id: appInfo.uapp_id,
uapp_key: appInfo.uapp_key,
app_code: appInfo.app_code,
app_name: appInfo.app_name
};
opOrderResult.data.userInfo = {
channel_userid: opOrderResult.data.order_info.channelUserId,
channel_username: opOrderResult.data.order_info.channelUserId,
channel_nickname: opOrderResult.data.order_info.channelUserId
};
opOrderResult.data.orderNo = params.orderNo;
opOrderResult.data.order_info.pay_flow_no = params.trade_no || "";// 2020 0704 lin 新增 推送fq必填字段
opOrderResult.data.order_info.pay_channel = params.payType ||"";//付款方式
opOrderResult.data.order_info.pay_time = params.payTime;//付款时间
opOrderResult.data.order_info.pay_payer_bank_no = params.buyer_email || "";//付款账号
opOrderResult.data.order_contact = opOrderResult.data.delivery_content.orderContact;
var pobj = {
appInfo: opOrderResult.data.appInfo,
actionBody: opOrderResult.data
}
// 推送
this.utilsPushSve.pushBusInfo(pobj, "pushOrder", 0);
if(['icpsq','edisq'].includes(opOrderResult.data.product_info.channel_item_code)){
this.utilsPushSve.aliBusiness2Delivery(pobj, "pushDeliveryOrder");
}
opOrderResult.data = null;
return opOrderResult;
} catch (e) {
// await this.cacheManager["TlPayLocker"].release(params.orderNo);
this.logCtl.error({ this.logCtl.error({
optitle: "回调处理订单---error异常", optitle: "回调处理订单---error异常",
op: "center-app/app/base/service/impl/utilsSve/utilsOrderSve.js/channelPayNotify", op: "center-app/app/base/service/impl/utilsSve/utilsOrderSve.js/channelPayNotify",
......
...@@ -282,7 +282,7 @@ module.exports = function (app) { ...@@ -282,7 +282,7 @@ module.exports = function (app) {
"needBatchUpload", "needBatchUpload",
"serviceSubmitOption","submitWangwenSolution","closeNeed","recordLog","recordLogList", "serviceSubmitOption","submitWangwenSolution","closeNeed","recordLog","recordLogList",
"foodServiceSubmitOption","submitFoodSolution","foodCloseNeed","foodRecordLog","foodRecordLogList", "foodServiceSubmitOption","submitFoodSolution","foodCloseNeed","foodRecordLog","foodRecordLogList",
"getParamsFor360","addOrderWeb","getPayRecords", "getParamsFor360","addOrderWeb","getPayRecords","icpNotifyNew",
]; ];
if (lst.indexOf(req.body.actionType) >= 0) { if (lst.indexOf(req.body.actionType) >= 0) {
...@@ -407,7 +407,7 @@ module.exports = function (app) { ...@@ -407,7 +407,7 @@ module.exports = function (app) {
req.body.appInfo = result.data; req.body.appInfo = result.data;
req.body.actionProcess = result.data.app_code; req.body.actionProcess = result.data.app_code;
var lst = [ var lst = [
"submitNeed", "paySuccess", "icpNotify" "submitNeed", "paySuccess", "icpNotify","icpNotifyNew"
]; ];
if (lst.indexOf(req.body.actionType) >= 0) { if (lst.indexOf(req.body.actionType) >= 0) {
var userpin = req.headers["userpin"] || ""; var userpin = req.headers["userpin"] || "";
......
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