Commit 0a3cbbec by linboxuan

utilsOrderSve add tmAccept,tmRefuse

parent 6aadfce9
...@@ -25,6 +25,7 @@ class ProductAPI extends WEBBase { ...@@ -25,6 +25,7 @@ class ProductAPI extends WEBBase {
async opActionProcess(pobj, action_type, req) { async opActionProcess(pobj, action_type, req) {
pobj.requestId = req.requestId; pobj.requestId = req.requestId;
var opResult = null; var opResult = null;
console.log("11111",opResult)
switch (action_type) { switch (action_type) {
case "tmAccept"://2020 0828 lin 新增 ali商标交易 创建订单接口 case "tmAccept"://2020 0828 lin 新增 ali商标交易 创建订单接口
opResult = await this.utilsOrderSve.tmAccept(pobj, pobj.actionBody); opResult = await this.utilsOrderSve.tmAccept(pobj, pobj.actionBody);
...@@ -39,6 +40,7 @@ class ProductAPI extends WEBBase { ...@@ -39,6 +40,7 @@ class ProductAPI extends WEBBase {
opResult = system.getResult(null, "action_type参数错误"); opResult = system.getResult(null, "action_type参数错误");
break; break;
} }
console.log(opResult)
return opResult; return opResult;
} }
......
...@@ -800,15 +800,13 @@ class UtilsOrderService extends AppServiceBase { ...@@ -800,15 +800,13 @@ class UtilsOrderService extends AppServiceBase {
async tmAccept(pobj) {// 2020 0828 lin 新增 ali商标交易 创建订单接口 async tmAccept(pobj) {// 2020 0828 lin 新增 ali商标交易 创建订单接口
try { try {
var actionBody = pobj.actionBody; var actionBody = pobj.actionBody;
actionBody.channelItemCode = "sbjy"
actionBody.quantity = 1;
pobj.actionType = "getProductDetail"; pobj.actionType = "getProductDetail";
var url = settings.centerAppUrl() + "action/opProduct/springBoard"; var url = settings.centerAppUrl() + "action/opProduct/springBoard";
var productItemResult = await this.restPostUrl(pobj, url); var productItemResult = await this.restPostUrl(pobj, url);
if (productItemResult.status != 0) { if (productItemResult.status != 0) {
return productItemResult; return productItemResult;
} }
productItemResult.data.price_list[0]["price"] = actionBody.price;
pobj.actionBody.product_info = productItemResult.data; pobj.actionBody.product_info = productItemResult.data;
var verifyResult = await this.isOrderVerify(pobj, pobj.actionBody); var verifyResult = await this.isOrderVerify(pobj, pobj.actionBody);
if (verifyResult.status != 0) { if (verifyResult.status != 0) {
...@@ -821,32 +819,61 @@ class UtilsOrderService extends AppServiceBase { ...@@ -821,32 +819,61 @@ class UtilsOrderService extends AppServiceBase {
pobj.actionType = "addOrder"; pobj.actionType = "addOrder";
var reqUrl = this.centerOrderUrl + "action/order/springBoard"; var reqUrl = this.centerOrderUrl + "action/order/springBoard";
// console.log(pobj);
var result = await this.restPostUrl(pobj, reqUrl); var result = await this.restPostUrl(pobj, reqUrl);
result.totalSum = actionBody.totalSum;
return result;
if(result) { if(result) {
var result = { var tmResult = {
"errorCode": "error", "errorCode": "OK",
"errorMsg": orderinfo.msg, "errorMsg": "操作成功",
"module": { "orderId": "" }, "module": { "orderNumber": result.data.orderNo },
"requestId": req.requestId, "requestId": pobj.requestId,
"success": false "success": true
} }
return result; console.log("utils",tmResult)
return tmResult;
} }
} catch (e) { } catch (e) {
var result = { var result = {
"errorCode": "error", "errorCode": "error",
"errorMsg": e, "errorMsg": e,
"module": { "orderNumber": "" }, "module": { "orderNumber": "" },
"requestId": req.requestId, "requestId": pobj.requestId,
"success": false "success": false
} }
return result; return result;
} }
}
async tmRefuse(pobj) {// 2020 0828 lin 新增 ali商标交易 关闭订单接口
try {
var reqUrl = this.centerOrderUrl + "action/tmOrder/springBoard";
var result = await this.restPostUrl(pobj, reqUrl);
// 如果返回值正常
if(result.status == 0) {
var tmResult = {
"errorCode": "OK",
"errorMsg": "操作成功",
"requestId": pobj.requestId,
"success": true
}
return tmResult;
}
var tmResult = {
"errorCode": "error",
"errorMsg": result.msg,
"requestId": pobj.requestId,
"success": false
}
return tmResult;
} catch (e) {
var result = {
"ErrorCode": "error",
"ErrorMsg": e,
"Module": { "orderNumber": "" },
"RequestId": pobj.requestId,
"Success": false
}
return result;
}
} }
} }
module.exports = UtilsOrderService; module.exports = UtilsOrderService;
...@@ -248,7 +248,7 @@ module.exports = function (app) { ...@@ -248,7 +248,7 @@ module.exports = function (app) {
"getNeedListUser", "getNeedListUser",
"manualEvaluation", "diagnosisInfo", "check", "enterpriseInfo", "diagnosisDetail", "manualEvaluation", "diagnosisInfo", "check", "enterpriseInfo", "diagnosisDetail",
"submitIcpIntention", "queryIntentionList", "confirmIcpIntention", "submitIcpIntention", "queryIntentionList", "confirmIcpIntention",
"tmAccept", "tmRefuse", "tmStatus" "tmAccept", "tmStatus"
]; ];
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