Commit bf9f1979 by linboxuan

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

parents 654250ec cb038ba0
......@@ -118,6 +118,9 @@ class AccessAuthAPI extends WEBBase {
case "getLoginInfo"://通过userpin获取用户登录信息
opResult = await this.utilsAuthSve.getLoginInfo(pobj, pobj.actionBody);
break;
case "channelUserLogin":
opResult = await this.utilsAuthSve.channelUserLogin(pobj,pobj.actionBody,req);
break;
case "logout"://用户退出
opResult = await this.utilsAuthSve.userLogout(pobj, pobj.actionBody);
break;
......
......@@ -39,9 +39,9 @@ class PaymentAPI extends WEBBase {
case "queryOrderStatus"://通联支付查询
opResult = await this.utilsOrderSve.queryOrderStatus(pobj, pobj.actionBody);
break;
case "getQrCode"://获取pc端支付二维码--不跟订单关联
opResult = await this.utilsOrderSve.getQrCode(pobj, pobj.actionBody);
break;
// case "getQrCode"://获取pc端支付二维码--不跟订单关联
// opResult = await this.utilsOrderSve.getQrCode(pobj, pobj.actionBody);
// break;
case "queryOrder"://通联支付查询
opResult = await this.utilsOrderSve.queryOrder(pobj, pobj.actionBody);
break;
......
......@@ -306,7 +306,8 @@ class CenterorderService extends AppServiceBase {
orderNo: pobj.actionBody.channelOrder.channelOrderNo,
orderPrice: Number(pobj.actionBody.orderPrice / 100),
phone: pobj.actionBody.publishMobile,
needId: solutiondata.data.channelNeedNo
needId: solutiondata.data.channelNeedNo,
companyName:solutiondata.data.solutionContent.solution.CompanyName || ''
},
appInfo: pobj.appInfo
}
......
......@@ -84,7 +84,7 @@ class ToolService extends AppServiceBase {
}
async getOssConfig(pobj, req) {//获取oss信息
var reqUrl = settings.centerAppUrl() + "auth/accessAuth/getOssInfo";
var reqUrl = settings.reqZcApi() + "api/tool/toolApi/getOssConfig";
var result = await this.restPostUrl(pobj, reqUrl);
return result;
}
......
......@@ -159,5 +159,48 @@ class UtilsAuthService extends AppServiceBase {
return applogout;
}
/**
* 官网首页跳转自主注册
* @param pobj
* @param actionBody
* @param req
* @returns {Promise<void>}
*/
async channelUserLogin(pobj,actionBody,req){
//官网登录地址
let skipUrl = 'http://gsbweb.qifu.gongsibao.com';
let opResult = system.getResult(null, "req Failure");
//----通过Authorization 获取用户信息
let Authorization = req.headers["authorization"] || "";
if(!Authorization){
opResult =system.getResultFail(-99,'用户未登录',{redirectUrl:'skipUrl'});
return opResult;
}
let icCompanyUrl = 'https://icompanytest.gongsibao.com/api/tUserInfo/info';
let subData = {
Authorization:Authorization
}
let rtn = await this.execClient.execFqGet(subData,icCompanyUrl);
if (!rtn || !rtn.stdout) {
return system.getResult(null, "execPost data is empty");
}
var userInfo = JSON.parse(rtn.stdout);
//----结束
//---渠道用户登录,有则返回userpin ,没有则注册用户并返回userpin
let channelUserId = userInfo.mobile;
actionBody.channelUserId = channelUserId;
let loginRt = await this.getLoginByUserName(pobj,actionBody);
if (loginRt.status != 0 && loginRt.status != 2060) {
return loginRt;
}
opResult.data={ userpin: pobj.actionBody.userpin }
if (loginRt.status == 2060) {
opResult.msg = loginRt.msg;
opResult.data.userpin = loginRt.data.userpin;
}
return opResult;
}
}
module.exports = UtilsAuthService;
var system = require("../../../system");
const AppServiceBase = require("../../app.base");
var settings = require("../../../../config/settings");
const { json } = require("sequelize");
//此类用来db中配置来进行调用-主要功能是推送蜂擎业务
class UtilsFqAliyunService extends AppServiceBase {
......@@ -9,6 +10,7 @@ class UtilsFqAliyunService extends AppServiceBase {
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;
......@@ -33,7 +35,8 @@ class UtilsFqAliyunService extends AppServiceBase {
}
var interface_params_info = verifyResult.data;
console.log("推送的业务员手机号为:",this.ucommuneOperatorPhone)
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)
......@@ -45,13 +48,13 @@ class UtilsFqAliyunService extends AppServiceBase {
orderPrice: orderInfo.totalSum,// 是 订单金额
productId: productInfo.price_item.service_code,// 是 产品 ID
productQuantity: orderInfo.quantity,// 是 产品数量
operator_phone: this.ucommuneOperatorPhone, // 2020 0704 推送fq 必填字段 这里以下为新增 7.7修改由写死改为从settings获取
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//付款人账号
pay_payer_bank_no: orderInfo.pay_payer_bank_no//付款人账号
};
// 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);
......
......@@ -53,6 +53,7 @@ class UtilsPushService extends AppServiceBase {
}
async pushBusInfo(pobj, opType, isDelProductInfo) {//推送业务总入口,不在db中做配置进行调用
console.log(JSON.stringify(pobj),".......pushBusInfo.........................");
var interface_list = pobj.interface_info ? pobj.interface_info : pobj.actionBody.product_info.interface_info;
if (!interface_list) {
return system.getResult(null, "暂无推送配置");
......
......@@ -77,6 +77,12 @@ class ExecClient {
console.log(cmd);
return cmd;
}
FetchFqGetCmd(subData, url) {
var cmd = this.cmdFeishuGetPattern.replace(/\{url\}/g, url).replace(/\{Authorization\}/g, "Bearer "+subData.Authorization);
console.log(cmd);
return cmd;
}
//飞书小程序GET请求
FetchFeishuGetCmd(subData, url) {
var cmd = this.cmdFeishuGetPattern.replace(
......@@ -96,6 +102,14 @@ class ExecClient {
var result = await this.exec(cmd);
return result;
}
async execFqGet(subData,url){
let cmd = this.FetchFqGetCmd(subData,url);
console.log(cmd);
var result = await this.exec(cmd);
return result;
}
async execGet2(subData, url) {
let cmd = this.FetchGetCmd(subData, url);
console.log(cmd);
......
......@@ -200,7 +200,7 @@ module.exports = function (app) {
});
app.use('/orderNotify/channelPayNotify', async function (req, res) {
try{
try {
var client_ip = system.get_client_ip(req);
var result = await utilsOrderSve.channelPayNotify(req.body, client_ip);
logCtl.info({
......@@ -213,7 +213,7 @@ module.exports = function (app) {
return res.end("FAIL");
}
return res.end("success");
}catch (e) {
} catch (e) {
var client_ip = system.get_client_ip(req);
logCtl.error({
optitle: (new Date()).Format("yyyy-MM-dd hh:mm:ss") + "渠道订单支付通知处理异常",
......@@ -237,8 +237,15 @@ module.exports = function (app) {
return;
}
// 2020 0812 lin 只去掉了check,因为要记录智能诊断的返回值,其他接口暂时未去掉
if (["getAppTokenByHosts", "getAppTokenByAppKey", "test", "getIndustries", "getSecondIndustries", "getQualificationByIndustry", "counselling","queryTradeProduceList"].indexOf(req.body.actionType) >= 0) {
if (["getAppTokenByHosts", "getAppTokenByAppKey", "test", "getIndustries", "getSecondIndustries", "getQualificationByIndustry", "counselling", "queryTradeProduceList"].indexOf(req.body.actionType) >= 0) {
req.body.actionBody.appHosts = req.host;
next();
return;
}
if (req.originalUrl.indexOf("/action/tmQuery") >= 0 || req.originalUrl.indexOf("/action/tmTools") >= 0) {
req.body.actionProcess="test-code";
req.body.actionBody.appHosts = req.host;
req.body.appInfo ={id:1}
next();
return;
}
......@@ -273,8 +280,8 @@ module.exports = function (app) {
"getNeedListUser",
"manualEvaluation", "diagnosisInfo", "check", "enterpriseInfo", "diagnosisDetail",
"submitIcpIntention", "queryIntentionList", "confirmIcpIntention",
"tmAccept", "tmStatus",
"needBatchUpload"
"tmAccept", "tmStatus",
"needBatchUpload"
];
if (lst.indexOf(req.body.actionType) >= 0) {
var userpin = req.headers["userpin"] || "";
......
<a name="menu" href="/doc">返回主目录</a>
1. [获取pc端支付二维码--不跟订单关联](#getQrCode)
1. [pc端订单支付二维码生成](#getOrderQrCode)
1. [pc端查询订单是否支付成功](#getOrderQrCode)
1. [获取H5支付链接](#getH5PayUrl)
## **<a name="getQrCode"> 获取pc端支付二维码--不跟订单关联</a>**
[返回到目录](#menu)
##### URL
[/web/payment/paymentApi/springBoard]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 渠道执行的类型 actionType:getQrCode
``` javascript
{
"uapp_id": "1", //平台渠道ID
"order_num": "1", //支付单号
"total_fee": "1",   //支付金额  分
"body_desc": "1",    //产品名称
"opType": "1", // 支付方式  alipay阿里  wx微信
}
```
#### 返回结果
```javascript
{
"status": 0,  //0 成功 小于0  失败
"msg": "SUCCESS",
"data": {
"payinfo": "https://syb.allinpay.com/apiweb/h5unionpay/native?key=l6lfPuHDErJrTW%2FN7WxSlg4n", //二维码url
"reqsn": "dfghrtjjn_1",  ////商户订单号_appid
"chnltrxid": "112094120001042656", // 支付渠道交易单号,如支付宝,微信平台的交易单号
"trxid": "112094120001042656",  // 交易单号,平台的交易流水号
"trxstatus": "0000"   // 交易状态,0000:交易成功、1001:交易不存在、
},
"requestId": "058244807fff4ab388bbda79afc04b28"
  }
```
## **<a name="getOrderQrCode"> pc端订单支付二维码生成</a>**
[返回到目录](#menu)
##### URL
......@@ -71,6 +37,29 @@
}
```
## **<a name="queryOrderStatus"> pc端查询订单是否支付成功</a>**
[返回到目录](#menu)
##### URL
[/web/payment/paymentApi/springBoard]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 渠道执行的类型 actionType:queryOrderStatus
``` javascript
{
"orderNo": "TM22202008042050Pmex",//订单号
"opType": "wx"// 支付方式  alipay阿里  wx微信
}
```
#### 返回结果
``` javascript
{
"status": 0,// 0为成功,否则失败
"msg": "success",
"data": null,
"requestId": "07dedd4ffd4441dcac54c6d8a0f91653"
}
```
## **<a name="getH5PayUrl"> 获取H5支付链接</a>**
[返回到目录](#menu)
......
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