Commit 143cbd42 by 宋毅

tj

parent 661803d9
...@@ -35,6 +35,12 @@ class AccessAuthAPI extends APIBase { ...@@ -35,6 +35,12 @@ class AccessAuthAPI extends APIBase {
return system.getResultSuccess() return system.getResultSuccess()
} }
break; break;
case "getLoginByUserName"://通过账户登录
opResult = await this.utilsAuthSve.getLoginByUserName(pobj, pobj.actionBody);
if (opResult.status == 0) {
return system.getResultSuccess({ userpin: pobj.actionBody.userpin })
}
break;
case "userPinByLgoin"://通过账户和密码登录 case "userPinByLgoin"://通过账户和密码登录
opResult = await this.utilsAuthSve.getReqUserPinByLgoin(pobj, pobj.actionBody); opResult = await this.utilsAuthSve.getReqUserPinByLgoin(pobj, pobj.actionBody);
if (opResult.status == 0) { if (opResult.status == 0) {
......
...@@ -28,9 +28,12 @@ class ProductAPI extends APIBase { ...@@ -28,9 +28,12 @@ class ProductAPI extends APIBase {
case "addOrder"://创建订单 case "addOrder"://创建订单
opResult = await this.utilsOrderSve.addOrder(pobj, pobj.actionBody); opResult = await this.utilsOrderSve.addOrder(pobj, pobj.actionBody);
break; break;
case "getIcbcOrderDetails"://获取工商详情 case "getOrderInfo"://获取订单列表信息
opResult = await this.utilsOrderSve.addOrder(pobj, pobj.actionBody); opResult = await this.utilsOrderSve.getOrderInfo(pobj, pobj.actionBody);
break; break;
// case "getIcbcOrderDetails"://获取工商详情
// opResult = await this.utilsOrderSve.addOrder(pobj, pobj.actionBody);
// break;
default: default:
opResult = system.getResult(null, "action_type参数错误"); opResult = system.getResult(null, "action_type参数错误");
break; break;
......
...@@ -16,7 +16,7 @@ class AppTokenByHostsCache extends CacheBase { ...@@ -16,7 +16,7 @@ class AppTokenByHostsCache extends CacheBase {
var actionBody = val; var actionBody = val;
var acckapp = await this.restClient.execPost(actionBody, settings.centerAppUrl() + "auth/accessAuth/getTokenByHosts"); var acckapp = await this.restClient.execPost(actionBody, settings.centerAppUrl() + "auth/accessAuth/getTokenByHosts");
var result = acckapp.stdout; var result = acckapp.stdout;
console.log(acckapp.stdout, "AppTokenByHostsCache............. acckapp.stdout..........") console.log(acckapp.stdout, "AppTokenByHostsCache............. acckapp.stdout..........");
if (result) { if (result) {
var tmp = JSON.parse(result); var tmp = JSON.parse(result);
return tmp; return tmp;
......
...@@ -31,6 +31,24 @@ class UtilsAuthSve extends AppServiceBase { ...@@ -31,6 +31,24 @@ class UtilsAuthSve extends AppServiceBase {
return result; return result;
} }
/** /**
* 通过账户登录
* @param {*} pobj
* @param {*} actionBody {userName:XX}
*/
async getLoginByUserName(pobj, actionBody) {//通过账户获取用户信息--------------actionBody.userName
if (!actionBody.userName) {
return system.getResult(null, "actionBody.userName can not be empty");
}
var acckapp = await this.restClient.execPost(pobj, settings.centerAppUrl() + "auth/accessAuth/getLoginByUserName");
var result = acckapp.stdout;
if (result) {
var tmp = JSON.parse(result);
return tmp;
}
return system.getResult(null, "data is empty");
}
/**
* 通过账户和密码登录 * 通过账户和密码登录
* @param {*} pobj * @param {*} pobj
* @param {*} actionBody {userName:XX,password:XXX} * @param {*} actionBody {userName:XX,password:XXX}
......
...@@ -22,7 +22,15 @@ class UtilsOrderService extends AppServiceBase { ...@@ -22,7 +22,15 @@ class UtilsOrderService extends AppServiceBase {
return system.getResult(null, "支付价格payCode信息有误,10110"); return system.getResult(null, "支付价格payCode信息有误,10110");
} }
var totalSum = Number(product_price[0].price) * Number(actionBody.quantity); var totalSum = Number(product_price[0].price) * Number(actionBody.quantity);
if (Number(actionBody.totalSum) < totalSum) { var buyTotalSum = Number(actionBody.totalSum || 0);
var buyPayTotalSum = Number(actionBody.payTotalSum || 0);
if (buyTotalSum == 0) {
actionBody.totalSum = totalSum;
}
if (buyPayTotalSum == 0) {
actionBody.payTotalSum = totalSum;
}
if (Number(actionBody.totalSum || 0) < totalSum) {
return system.getResult(null, "订单金额有误,10130"); return system.getResult(null, "订单金额有误,10130");
} }
pobj.actionBody.product_info.price_item = product_price[0]; pobj.actionBody.product_info.price_item = product_price[0];
...@@ -56,11 +64,11 @@ class UtilsOrderService extends AppServiceBase { ...@@ -56,11 +64,11 @@ class UtilsOrderService extends AppServiceBase {
} }
pobj.actionType = "getProductInterface"; pobj.actionType = "getProductInterface";
pobj.actionBody.productId = productItemResult.data.id; pobj.actionBody.productPriceId = pobj.actionBody.product_info.price_item.id;
var productItemInterfaceResult = await this.restPostUrl(pobj, url); var productItemInterfaceResult = await this.restPostUrl(pobj, url);
if (productItemInterfaceResult.status != 0) { // if (productItemInterfaceResult.status != 0) {
return productItemInterfaceResult; // return productItemInterfaceResult;
} // }
productItemResult.data.interface_info = productItemInterfaceResult.data; productItemResult.data.interface_info = productItemInterfaceResult.data;
pobj.actionType = "addOrder"; pobj.actionType = "addOrder";
...@@ -69,6 +77,11 @@ class UtilsOrderService extends AppServiceBase { ...@@ -69,6 +77,11 @@ class UtilsOrderService extends AppServiceBase {
var result = await this.restPostUrl(pobj, reqUrl); var result = await this.restPostUrl(pobj, reqUrl);
return result; return result;
} }
async getOrderInfo(pobj, actionBody) {
var reqUrl = this.centerOrderUrl + "action/order/springBoard";
var result = await this.restPostUrl(pobj, reqUrl);
return result;
}
/** /**
* 获取H5支付地址 * 获取H5支付地址
* @param {*} pobj * @param {*} pobj
......
...@@ -49,7 +49,7 @@ module.exports = function (app) { ...@@ -49,7 +49,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 = [
"addOrder", "getH5PayUrl","getOrderQrCode", "queryOrderStatus", "addOrder", "getH5PayUrl", "getOrderQrCode", "queryOrderStatus", "getOrderInfo",
"getTmNclList", "getNeedInfo", "getTmNclList", "getNeedInfo",
"tmConfirm", "updateTmInfo", "tmConfirm", "updateTmInfo",
"updateNclInfo", "updateContacts", "updateNclInfo", "updateContacts",
...@@ -91,7 +91,7 @@ module.exports = function (app) { ...@@ -91,7 +91,7 @@ module.exports = function (app) {
classPath = gname + "." + classPath; classPath = gname + "." + classPath;
var tClientIp = system.get_client_ip(req); var tClientIp = system.get_client_ip(req);
req.clientIp = tClientIp;req req.clientIp = tClientIp; req
req.uagent = req.headers["user-agent"]; req.uagent = req.headers["user-agent"];
req.classname = classPath; req.classname = classPath;
...@@ -104,7 +104,7 @@ module.exports = function (app) { ...@@ -104,7 +104,7 @@ module.exports = function (app) {
var p = null; var p = null;
var invokeObj = system.getObject("api." + classPath); var invokeObj = system.getObject("api." + classPath);
if (invokeObj["doexecMethod"]) { if (invokeObj["doexecMethod"]) {
p = invokeObj["doexecMethod"].apply(invokeObj, params);req p = invokeObj["doexecMethod"].apply(invokeObj, params); req
} }
p.then(r => { p.then(r => {
res.end(JSON.stringify(r)); res.end(JSON.stringify(r));
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
1. [下商标订单](#addOrder) 1. [下商标订单](#addOrder)
1. [下其他订单](#addOtherOrder) 1. [下其他订单](#addOtherOrder)
1. [获取H5支付链接](#getH5PayUrl) 1. [获取H5支付链接](#getH5PayUrl)
1. [获取订单列表信息](#getOrderInfo)
## **<a name="addOrder"> 下商标订单</a>** ## **<a name="addOrder"> 下商标订单</a>**
...@@ -167,7 +168,10 @@ ...@@ -167,7 +168,10 @@
"payTotalSum":699, // Y 订单付款总金额 "payTotalSum":699, // Y 订单付款总金额
"channelOrder":{ "channelOrder":{
"channelServiceNo":"",// N 服务单号(即渠道服务单号) "channelServiceNo":"",// N 服务单号(即渠道服务单号)
"channelOrderNo":[],// N 服务订单号(即渠道服务订单号[XX1,XX2]) "channelOrderNo":"",// N 服务订单号(即渠道服务订单号,格式为: XX1,XX2)
"needNo":"",// N 需求单号(即渠道需求单号)
"needNoOrderNo":[],// N 需求订单号(即渠道需求订单号,格式为: XX1,XX2)
"buyerMoblie":"15010929366",// N 购买者手机号
"payTime":"",// N 渠道需求单号支付时间 "payTime":"",// N 渠道需求单号支付时间
"orderStatus":1,// N 渠道需求单号支付支付状态 1: 待付款, 2: 已付款 "orderStatus":1,// N 渠道需求单号支付支付状态 1: 待付款, 2: 已付款
"channelParams":""// N 渠道参数(自定义参数) "channelParams":""// N 渠道参数(自定义参数)
...@@ -215,4 +219,82 @@ ...@@ -215,4 +219,82 @@
"requestId": "ac22e84d8ebc4df09629c0aff2bb1fe9" "requestId": "ac22e84d8ebc4df09629c0aff2bb1fe9"
} }
```
## **<a name="getOrderInfo"> 获取订单列表信息</a>**
[返回到目录](#menu)
##### URL
[/web/opaction/order/springBoard]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 请求头中需要增加userpin(用户登录后的凭证)的值
#### 渠道执行的类型 actionType:getOrderInfo
``` javascript
{
"pageIndex":1,// Y 当前页
"pageSize":20,// Y 每页大小,最大为50
"channelItemName":"",// N 产品名称
"channelServiceNo":"",// N 渠道订单号
"orderStatus":""// N 订单状态
}
```
#### 返回结果
```javascript
{
"status": 0,// 0为成功,否则失败
"msg": "success",
"data": [
{
"orderNo": "OT31202002191443AVlJ",// 订单号
"channelServiceNo": "",//渠道服务号
"channelOrderNo": "",//渠道订单号列表,格式:XX1,XX2
"channelUserId": "15010929366",//渠道用户Id
"ownerUserId": "15010929366",//拥有者Id
"payTime": null,//支付时间
"quantity": 1,//订单数量
"serviceQuantity": 0,//订单服务数量
"orderStatusName": "待付款",//订单状态名称
"orderStatus": 1,//订单状态编码: 1: 待付款, 2: 已付款, 4: 待服务, 8: 已完成
"totalSum": "10.00",//订单金额
"payTotalSum": "10.00",//订单支付金额
"refundSum": "0.00",//退款金额
"invoiceApplyStatus": "00",//发票申请状态
"opNotes": "",//操作备注
"channelItemCode": "FW_GOODS-582221-1",//渠道产品编码
"channelItemName": "京东云PLUS公司注册(北京市)",//渠道产品名称
"serviceItemCode": null,//服务产品编码
"picUrl": null//产品图片地址
},
{
"orderNo": "OT31202002191456tDU7",
"channelServiceNo": "0001",
"channelOrderNo": "",{
"status": 0,// 0为成功,否则失败
"payUrl": "https://syb.allinpay.com/apiweb/h5unionpay/unionorder?appid=00172286&body=%E5%95%86%E6%A0%87%E6%B3%A8%E5%86%8C%E3%80%90%E4%B8%93%E5%AE%B6%E8%BE%85%E5%8A%A9%E7%94%B3%E8%AF%B7%E3%80%91&charset=UTF-8&cusid=560595073992Z6G&notify_url=http%3A%2F%2Fgsb.qifu.gongsibao.com%3A4012%2Ftlpay%2Fnotify&randomstr=1581758584924&remark=h5paypagesywdy&reqsn=OT26202002151649kPgs&returl=http%3A%2F%2Fgsb.qifu.gongsibao.com%3A4012%2Ftlpay%2Fnotify&sign=439FA9F49D365DC32FE1CA712F5AD848&trxamt=69900&version=12", // H5支付链接
"requestId": "ac22e84d8ebc4df09629c0aff2bb1fe9"
}
"channelUserId": "15010929366",
"ownerUserId": "15010929366",
"payTime": "2020",
"quantity": 1,
"serviceQuantity": 0,
"orderStatusName": "已付款",
"orderStatus": 2,
"totalSum": "10.00",
"payTotalSum": "10.00",
"refundSum": "0.00",
"invoiceApplyStatus": "00",
"opNotes": "",
"channelItemCode": "FW_GOODS-582221-1",
"channelItemName": "京东云PLUS公司注册(北京市)",
"serviceItemCode": null,
"picUrl": null
}
],
"requestId": "92ced0cb4d地址cb4125a4b515227f3eabe1"
}
``` ```
\ No newline at end of file
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