Commit 81d28907 by linboxuan

submitNeed push / submitIcpProgramme push

parents d2b4c9df 8560e894
...@@ -34,7 +34,7 @@ class PaymentAPI extends WEBBase { ...@@ -34,7 +34,7 @@ class PaymentAPI extends WEBBase {
opResult = await this.utilsOrderSve.getH5PayUrl(pobj, pobj.actionBody); opResult = await this.utilsOrderSve.getH5PayUrl(pobj, pobj.actionBody);
break; break;
case "getOrderQrCode"://pc端订单支付二维码生成 case "getOrderQrCode"://pc端订单支付二维码生成
opResult = await this.utilsOrderSve.getQrCodeInfo(pobj, pobj.actionBody); opResult = await this.utilsOrderSve.getOrderQrCode(pobj, pobj.actionBody);
break; break;
case "queryOrderStatus"://通联支付查询 case "queryOrderStatus"://通联支付查询
opResult = await this.utilsOrderSve.queryOrderStatus(pobj, pobj.actionBody); opResult = await this.utilsOrderSve.queryOrderStatus(pobj, pobj.actionBody);
......
...@@ -56,6 +56,7 @@ class QcCenterOrderService extends AppServiceBase { ...@@ -56,6 +56,7 @@ class QcCenterOrderService extends AppServiceBase {
//推送方案 //推送方案
await this.pushIcpSolution(pushObj, needsolution.solutionNo, pobj.appInfo, self); await this.pushIcpSolution(pushObj, needsolution.solutionNo, pobj.appInfo, self);
<<<<<<< HEAD
// 2020 0806 lin 新增推送 // 2020 0806 lin 新增推送
var reqParams = { var reqParams = {
actionType: "produceData",// Y 功能名称 actionType: "produceData",// Y 功能名称
...@@ -71,6 +72,8 @@ class QcCenterOrderService extends AppServiceBase { ...@@ -71,6 +72,8 @@ class QcCenterOrderService extends AppServiceBase {
} }
this.opQueuePushClientPost(pobj, this.opPushQueueUrl, reqParams); this.opQueuePushClientPost(pobj, this.opPushQueueUrl, reqParams);
=======
>>>>>>> 8560e89423a2072bbcaa023809d8b0a6f8a1b0c1
return system.getResultSuccess(); return system.getResultSuccess();
} }
return res; return res;
...@@ -96,13 +99,13 @@ class QcCenterOrderService extends AppServiceBase { ...@@ -96,13 +99,13 @@ class QcCenterOrderService extends AppServiceBase {
var confirmRes = await self.aliclient.reqbyget({ action: "ConfirmIntention", reqbody: { BizId: pushObj.IntentionBizId }, apiVersion: "2019-05-08" }); var confirmRes = await self.aliclient.reqbyget({ action: "ConfirmIntention", reqbody: { BizId: pushObj.IntentionBizId }, apiVersion: "2019-05-08" });
if (confirmRes && confirmRes.status == 0 && confirmRes.data) { if (confirmRes && confirmRes.status == 0 && confirmRes.data) {
var confirmResData = confirmRes.data; var confirmResData = confirmRes.data;
if (confirmResData.confirmUrl) { if (confirmResData.ConfirmUrl) {
var reqObj3 = { var reqObj3 = {
actionType: "receiveIcpConfirmUrl", actionType: "receiveIcpConfirmUrl",
appInfo: appInfo, appInfo: appInfo,
actionBody: { actionBody: {
solutionNo: solutionNo, solutionNo: solutionNo,
confirmUrl: confirmResData.confirmUrl confirmUrl: confirmResData.ConfirmUrl
} }
}; };
var a = await self.reqCenterOrderApi(reqObj3);//保存用户确认方案url var a = await self.reqCenterOrderApi(reqObj3);//保存用户确认方案url
......
...@@ -82,12 +82,12 @@ class UtilsNeedService extends AppServiceBase { ...@@ -82,12 +82,12 @@ class UtilsNeedService extends AppServiceBase {
if (reqUrl) { if (reqUrl) {
var url = this.centerOrderUrl + reqUrl; var url = this.centerOrderUrl + reqUrl;
} }
var self=this; var self = this;
pobj.actionType = "receiveIcpFeedback"; pobj.actionType = "receiveIcpFeedback";
// 2020 0803 lin 修改; // 2020 0803 lin 修改;
if(pobj.intentionStatus) { if (pobj.intentionStatus) {
// 如果需求当前字段为5(已关闭)则通知fq // 如果需求当前字段为5(已关闭)则通知fq
if(pobj.intentionStatus == 5) { if (pobj.intentionStatus == 5) {
self.utilsPushSve.aliBusiness2Fq(pobj, "pushCloseICPNeed"); self.utilsPushSve.aliBusiness2Fq(pobj, "pushCloseICPNeed");
} }
} }
...@@ -232,7 +232,7 @@ class UtilsNeedService extends AppServiceBase { ...@@ -232,7 +232,7 @@ class UtilsNeedService extends AppServiceBase {
} }
} }
// 推送ali // 推送ali
var a=await self.aliclient.reqbyget({ action: "CloseIntention", reqbody: { BizId: actionBody.channelNeedNo, Note: actionBody.note }, apiVersion: "2019-05-08" }); var a = await self.aliclient.reqbyget({ action: "CloseIntention", reqbody: { BizId: actionBody.channelNeedNo, Note: actionBody.note }, apiVersion: "2019-05-08" });
console.log(a); console.log(a);
self.utilsPushSve.aliBusiness2Fq(pobj, "pushCloseICPNeed"); self.utilsPushSve.aliBusiness2Fq(pobj, "pushCloseICPNeed");
return system.getResultSuccess(); return system.getResultSuccess();
...@@ -331,10 +331,10 @@ class UtilsNeedService extends AppServiceBase { ...@@ -331,10 +331,10 @@ class UtilsNeedService extends AppServiceBase {
var fileName = tmpFileName.substr(tmpFileName.lastIndexOf("/") + 1, tmpFileName.lenght); var fileName = tmpFileName.substr(tmpFileName.lastIndexOf("/") + 1, tmpFileName.lenght);
// 2020 0803 lin 修改; // 2020 0803 lin 修改;
var urlJson = this.urlSplit(docUrl); var urlJson = this.urlSplit(docUrl);
if(urlJson["Expires"]){ if (urlJson["Expires"]) {
// url中过期时间与服务器时间对比结果为已过期 // url中过期时间与服务器时间对比结果为已过期
if(urlJson["Expires"] < new Date().getTime()) { if (urlJson["Expires"] < new Date().getTime()) {
return "http://gsb-zc.oss-cn-beijing.aliyuncs.com/"+fileName; return "http://gsb-zc.oss-cn-beijing.aliyuncs.com/" + fileName;
} }
} }
//解码后的文件全名:xxx.pdf //解码后的文件全名:xxx.pdf
...@@ -401,8 +401,7 @@ class UtilsNeedService extends AppServiceBase { ...@@ -401,8 +401,7 @@ class UtilsNeedService extends AppServiceBase {
var self = this; var self = this;
var reqUrl = this.centerOrderUrl + "action/need/springBoard"; var reqUrl = this.centerOrderUrl + "action/need/springBoard";
var result = await this.restPostUrl(pobj, reqUrl); var result = await this.restPostUrl(pobj, reqUrl);
let res = await self.aliclient.reqbyget({ action: "WriteCommunicationLog", reqbody: { BizId: pobj.actionBody.intentionBizId, Note: pobj.actionBody.note }, apiVersion: "2019-05-08" }); await self.aliclient.reqbyget({ action: "WriteCommunicationLog", reqbody: { BizId: pobj.actionBody.intentionBizId, Note: pobj.actionBody.note }, apiVersion: "2019-05-08" });
console.log(res);
return system.getResultSuccess(); return system.getResultSuccess();
} }
...@@ -423,17 +422,16 @@ class UtilsNeedService extends AppServiceBase { ...@@ -423,17 +422,16 @@ class UtilsNeedService extends AppServiceBase {
PageSize: pobj.actionBody.pageSize || 10, PageSize: pobj.actionBody.pageSize || 10,
}, apiVersion: "2019-05-08" }, apiVersion: "2019-05-08"
}); });
console.log(res);
return system.getResultSuccess(res); return system.getResultSuccess(res);
} }
urlSplit(url) { urlSplit(url) {
var arr=url.split("?")[1]; //根据?跟个url var arr = url.split("?")[1]; //根据?跟个url
var arr2=arr[1].split("&"); //根据&重新分割参数 var arr2 = arr[1].split("&"); //根据&重新分割参数
var jsonarr={}; //定义一个json对象放置url 参数 var jsonarr = {}; //定义一个json对象放置url 参数
for(var i=0;i<arr2.length;i++){ //循环将参数放到json里面 for (var i = 0; i < arr2.length; i++) { //循环将参数放到json里面
jsonarr[arr2[i].substring(0,1)]=arr2[i].substring(2,3); jsonarr[arr2[i].substring(0, 1)] = arr2[i].substring(2, 3);
} }
return jsonarr; return jsonarr;
} }
......
...@@ -203,18 +203,18 @@ class UtilsOrderService extends AppServiceBase { ...@@ -203,18 +203,18 @@ class UtilsOrderService extends AppServiceBase {
//查询支付流水号是否已经支付 //查询支付流水号是否已经支付
var receiptVoucher = orderResult.data.receiptVoucher; var receiptVoucher = orderResult.data.receiptVoucher;
pobj.actionType = "queryOrderStatus"; pobj.actionType = "queryOrderStatus";
var url = this.centerAppUrl + "payment/paymentApi/queryOrder"; var url = this.centerAppUrl + "payment/paymentApi/springBoard";
if (receiptVoucher.busPayOrderCode != receiptVoucher.wxPayOrderCode) { if (receiptVoucher.busPayOrderCode != receiptVoucher.wxPayOrderCode) {
pobj.actionBody.trxid = wxPayOrderCode; pobj.actionBody.trxid = receiptVoucher.wxPayOrderCode;
var wxPayStatus = await this.restPostUrl(pobj, url); var wxPayStatus = await this.restPostUrl(pobj, url);
if (wxPayStatus && wxPayStatus.code == 1 && wxPayStatus.data.trxstatus == "0000") { if (wxPayStatus && wxPayStatus.status == 0 && wxPayStatus.data.trxstatus == "0000") {
return system.getResultFail(-100130, "订单已支付,请勿重复付款,100130"); return system.getResultFail(-100130, "订单已支付,请勿重复付款,100130");
} }
} }
if (receiptVoucher.busPayOrderCode != receiptVoucher.aliPayOrderCode) { if (receiptVoucher.busPayOrderCode != receiptVoucher.aliPayOrderCode) {
pobj.actionBody.trxid = aliPayOrderCode; pobj.actionBody.trxid = receiptVoucher.aliPayOrderCode;
var aliPayStatus = await this.restPostUrl(pobj, url); var aliPayStatus = await this.restPostUrl(pobj, url);
if (aliPayStatus && aliPayStatus.code == 1 && aliPayStatus.data.trxstatus == "0000") { if (aliPayStatus && aliPayStatus.status == 0 && aliPayStatus.data.trxstatus == "0000") {
return system.getResultFail(-100140, "订单已支付,请勿重复付款,100140"); return system.getResultFail(-100140, "订单已支付,请勿重复付款,100140");
} }
} }
...@@ -233,21 +233,21 @@ class UtilsOrderService extends AppServiceBase { ...@@ -233,21 +233,21 @@ class UtilsOrderService extends AppServiceBase {
//更新DB付款信息 //更新DB付款信息
var isPut = 0; var isPut = 0;
var setField = {}; var setField = {};
if (opType == "wx") { if (actionBody.opType == "wx") {
if (actionBody.trxid != receiptVoucher.wxPayOrderCode) { if (actionBody.trxid != receiptVoucher.wxPayOrderCode) {
setField.wxPayOrderCode = tResult.data.trxid; setField.wxPayOrderCode = result.data.trxid;
receiptVoucher.wxPayOrderCode = tResult.data.trxid; receiptVoucher.wxPayOrderCode = result.data.trxid;
isPut = 1; isPut = 1;
} }
} else { } else {
//支付宝 //支付宝
if (actionBody.trxid != receiptVoucher.aliPayOrderCode) { if (actionBody.trxid != receiptVoucher.aliPayOrderCode) {
setField.aliPayOrderCode = tResult.data.trxid; setField.aliPayOrderCode = result.data.trxid;
receiptVoucher.aliPayOrderCode = tResult.data.trxid; receiptVoucher.aliPayOrderCode = result.data.trxid;
isPut = 1; isPut = 1;
} }
} }
pobj.actionBody.isPut; pobj.actionBody.isPut=isPut;
pobj.actionBody.setField = setField; pobj.actionBody.setField = setField;
pobj.actionBody.receiptVoucherId = receiptVoucher.id; pobj.actionBody.receiptVoucherId = receiptVoucher.id;
pobj.actionBody.trxid = result.data.trxid; pobj.actionBody.trxid = result.data.trxid;
......
...@@ -27,7 +27,7 @@ module.exports = function (app) { ...@@ -27,7 +27,7 @@ module.exports = function (app) {
app.all('*', function (req, res, next) { app.all('*', function (req, res, next) {
req.objs = system; req.objs = system;
res.header('Access-Control-Allow-Origin', '*'); res.header('Access-Control-Allow-Origin', '*');
res.header('Access-Control-Allow-Headers', 'Content-Type, Content-Length, Authorization, Accept, X-Requested-With , yourHeaderFeild'); res.header('Access-Control-Allow-Headers', 'Content-Type, Content-Length, Authorization, Accept, X-Requested-With , yourHeaderFeild,Authorization,XAPPKEY,XFROMAPPKEY,XFROMCOMPANYKEY,XREGROLE,XBIZPATH,token');
res.header('Access-Control-Allow-Methods', 'PUT, POST, GET, DELETE, OPTIONS'); res.header('Access-Control-Allow-Methods', 'PUT, POST, GET, DELETE, OPTIONS');
// res.header('Access-Control-Allow-Credentials', 'true'); // res.header('Access-Control-Allow-Credentials', 'true');
res.header('content-type', 'text/html;charset=UTF-8'); res.header('content-type', 'text/html;charset=UTF-8');
......
<a name="menu" href="/doc">返回主目录</a> <a name="menu" href="/doc">返回主目录</a>
1. [获取pc端支付二维码--不跟订单关联](#getQrCode) 1. [获取pc端支付二维码--不跟订单关联](#getQrCode)
1. [pc端订单支付二维码生成](#getOrderQrCode)
1. [获取H5支付链接](#getH5PayUrl) 1. [获取H5支付链接](#getH5PayUrl)
## **<a name="getQrCode"> 获取pc端支付二维码--不跟订单关联</a>** ## **<a name="getQrCode"> 获取pc端支付二维码--不跟订单关联</a>**
...@@ -36,6 +37,41 @@ ...@@ -36,6 +37,41 @@
  }   }
``` ```
## **<a name="getOrderQrCode"> pc端订单支付二维码生成</a>**
[返回到目录](#menu)
##### URL
[/web/payment/paymentApi/springBoard]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 渠道执行的类型 actionType:getOrderQrCode
``` javascript
{
"orderNo": "TM22202008042050Pmex",//订单号
"opType": "wx"// 支付方式  alipay阿里  wx微信
}
```
#### 返回结果
``` javascript
{
"status": 0,
"msg": "success",
"data": {
"payinfo": "https://syb.allinpay.com/apiweb/h5unionpay/native?key=BMFvrMDcrqzLnJ04YV%2B02uX0",
"reqsn": "qftTM22202008042050Pmex_22",
"chnltrxid": "122005790000133940",
"trxid": "122005790000133940",
"trxstatus": "0000",
"notify_url": "https://igirl.gongsibao.com/api/tl/zxNotify"
},
"requestId": "07dedd4ffd4441dcac54c6d8a0f91653",
"wxPayOrderCode": "122005790000133596",
"aliPayOrderCode": "TM22202008042050Pmex"
}
```
## **<a name="getH5PayUrl"> 获取H5支付链接</a>** ## **<a name="getH5PayUrl"> 获取H5支付链接</a>**
[返回到目录](#menu) [返回到目录](#menu)
##### URL ##### URL
......
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