Commit 53a526b2 by 王栋源

wdy

parent 1bf9a945
...@@ -26,6 +26,7 @@ class utilsTlBankSve { ...@@ -26,6 +26,7 @@ class utilsTlBankSve {
this.customerinfoDao = System.getObject("db.customerinfoDao"); this.customerinfoDao = System.getObject("db.customerinfoDao");
this.moneyaccountDao = System.getObject("db.moneyaccountDao"); this.moneyaccountDao = System.getObject("db.moneyaccountDao");
this.tlorderDao = System.getObject("db.tlorderDao"); this.tlorderDao = System.getObject("db.tlorderDao");
this.centerChannelUrl = settings.centerChannelUrl();
} }
...@@ -349,38 +350,53 @@ class utilsTlBankSve { ...@@ -349,38 +350,53 @@ class utilsTlBankSve {
result = "回调cusorderid参数错误,没有_标识"; result = "回调cusorderid参数错误,没有_标识";
return result; return result;
} }
var tmpCompanyId = attachList.length == 2 ? attachList[1] : attachList[2]; if (attachList[0] && attachList[0].substr(0, 3) == "qft") {
var p = {
var payParam = await this.companypayparamDao.getOneByCompanyId(tmpCompanyId, 1); "actionProcess": "actionProcess参数不",
if (!payParam) { "actionType": "receiveCallBackNotify",
result.return_msg = "回调公司没有对应的支付凭证"; "actionBody": { "parmas": parmas },
return jsonBuilder.buildObject(result); "client_ip": client_ip
} };
var signResult = await this.resultSign(parmas, payParam.pay_key); var qftstr = await this.restClient.execPost(p, this.centerChannelUrl + "web/payment/paymentApi/springBoard");
if (signResult.code != 1) { var qftjson = JSON.parse(qftstr.stdout);
result = signResult.msg; if(qftjson.status>-1){
result="success"
}
return result; return result;
} } else {
//解析支付参数 var tmpCompanyId = attachList.length == 2 ? attachList[1] : attachList[2];
parmas.out_trade_no = attachList[0];
parmas.company_id = attachList.length == 2 ? attachList[1] : attachList[2]; var payParam = await this.companypayparamDao.getOneByCompanyId(tmpCompanyId, 1);
parmas.other_company_id = attachList.length == 2 ? "0" : attachList[1]; if (!payParam) {
//操作回调 result.return_msg = "回调公司没有对应的支付凭证";
if (parmas.other_company_id && Number(parmas.other_company_id) > 0) {
var otherPayParam = await this.companypayparamDao.getOneByCompanyId(parmas.other_company_id, 1);
if (!otherPayParam) {
result.return_msg = "回调其他公司公司没有对应的配置信息";
return jsonBuilder.buildObject(result); return jsonBuilder.buildObject(result);
} }
return await this.opOtherCompanyNotify(otherPayParam.notifyUrl, parmas, "通联回调"); var signResult = await this.resultSign(parmas, payParam.pay_key);
}//是别的公司则进行回调别的接口信息 if (signResult.code != 1) {
else { result = signResult.msg;
var backResult = await this.opBackNotify(parmas, "通联回调"); return result;
if (backResult.code != 1) { }
result = backResult.msg; //解析支付参数
parmas.out_trade_no = attachList[0];
parmas.company_id = attachList.length == 2 ? attachList[1] : attachList[2];
parmas.other_company_id = attachList.length == 2 ? "0" : attachList[1];
//操作回调
if (parmas.other_company_id && Number(parmas.other_company_id) > 0) {
var otherPayParam = await this.companypayparamDao.getOneByCompanyId(parmas.other_company_id, 1);
if (!otherPayParam) {
result.return_msg = "回调其他公司公司没有对应的配置信息";
return jsonBuilder.buildObject(result);
}
return await this.opOtherCompanyNotify(otherPayParam.notifyUrl, parmas, "通联回调");
}//是别的公司则进行回调别的接口信息
else {
var backResult = await this.opBackNotify(parmas, "通联回调");
if (backResult.code != 1) {
result = backResult.msg;
return result;
}
return result; return result;
} }
return result;
} }
} catch (e) { } catch (e) {
logCtl.error({ logCtl.error({
...@@ -445,8 +461,8 @@ class utilsTlBankSve { ...@@ -445,8 +461,8 @@ class utilsTlBankSve {
throw new Error(e.stack); throw new Error(e.stack);
} }
} }
async opOtherCompanyNotify(sveItemCode,orderNo){ async opOtherCompanyNotify(sveItemCode, orderNo) {
if(["zcdy3gy","zcdy6gy","zcdy1n"].indexOf(sveItemCode)>=0) { if (["zcdy3gy", "zcdy6gy", "zcdy1n"].indexOf(sveItemCode) >= 0) {
//TODO:操作别的公司回调 //TODO:操作别的公司回调
} }
} }
...@@ -514,7 +530,7 @@ class utilsTlBankSve { ...@@ -514,7 +530,7 @@ class utilsTlBankSve {
var sqlWheres = { code: obj.out_trade_no }; var sqlWheres = { code: obj.out_trade_no };
var orderItem = await this.orderDao.model.findOne({ var orderItem = await this.orderDao.model.findOne({
where: sqlWheres, where: sqlWheres,
attributes: ["id", "code", "name","sveItemCode", "busPayOrderCode", "totalSum", "orderStatus", "orderPayStatus", "company_id", "createuser_id", "sveItemCode", "sveItemName", "subType"], attributes: ["id", "code", "name", "sveItemCode", "busPayOrderCode", "totalSum", "orderStatus", "orderPayStatus", "company_id", "createuser_id", "sveItemCode", "sveItemName", "subType"],
include: [ include: [
{ model: this.orderDao.db.models.customerinfo, attributes: ["businessLicensePic", "customerType", "identityCardNo", "identityCardPic"] } { model: this.orderDao.db.models.customerinfo, attributes: ["businessLicensePic", "customerType", "identityCardNo", "identityCardPic"] }
] ]
...@@ -525,7 +541,7 @@ class utilsTlBankSve { ...@@ -525,7 +541,7 @@ class utilsTlBankSve {
return notifyResult; return notifyResult;
} }
//操作别的回调信息 //操作别的回调信息
this.opOtherCompanyNotify(orderItem.sveItemCode,obj.out_trade_no); this.opOtherCompanyNotify(orderItem.sveItemCode, obj.out_trade_no);
if (Number(orderItem.totalSum * 100) != Number(obj.trxamt)) { if (Number(orderItem.totalSum * 100) != Number(obj.trxamt)) {
notifyResult.code = -450; notifyResult.code = -450;
notifyResult.msg = "对应的订单支付金额不符"; notifyResult.msg = "对应的订单支付金额不符";
......
...@@ -47,6 +47,13 @@ var settings = { ...@@ -47,6 +47,13 @@ var settings = {
return "http://43.247.184.94:9200/"; return "http://43.247.184.94:9200/";
} }
}, },
centerChannelUrl: function () {
if (this.env == "dev") {
return "http://192.168.18.34:4011/";
} else {
return "https://center-channel/";
}
},
apiconfig: { apiconfig: {
zxyTransferAppId: function () {//智薪云应用id zxyTransferAppId: function () {//智薪云应用id
// return "1103817785";//线上 // return "1103817785";//线上
......
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