Commit 9a78df1d by 任晓松

智能选择,全类推荐获取尼斯类

parent 74f34c2c
...@@ -27,6 +27,9 @@ class OrderAPI extends APIBase { ...@@ -27,6 +27,9 @@ class OrderAPI extends APIBase {
opResult = await this.orderinfoSve.tmRefuse(pobj); opResult = await this.orderinfoSve.tmRefuse(pobj);
break; break;
//--------------------------------ali订单交易 订单操作-----结束 //--------------------------------ali订单交易 订单操作-----结束
case "getNclByCode":
opResult = await this.orderinfoSve.getNclByCode(pobj);
break;
default: default:
opResult = system.getResult(null, "action_type参数错误"); opResult = system.getResult(null, "action_type参数错误");
break; break;
......
...@@ -20,5 +20,10 @@ class OpPayOrder extends APIBase { ...@@ -20,5 +20,10 @@ class OpPayOrder extends APIBase {
var result = await this.orderinfoSve.opOrderPayCallBackWX(pobj, pobj.appInfo); var result = await this.orderinfoSve.opOrderPayCallBackWX(pobj, pobj.appInfo);
return result; return result;
} }
async receivePayCallBackNotifyByChannel(pobj, qobj, req) {
var result = await this.orderinfoSve.opOrderPayCallBackChannel(pobj, pobj.appInfo);
return result;
}
} }
module.exports = OpPayOrder; module.exports = OpPayOrder;
\ No newline at end of file
...@@ -1616,6 +1616,67 @@ class OrderInfoService extends ServiceBase { ...@@ -1616,6 +1616,67 @@ class OrderInfoService extends ServiceBase {
} }
return system.getResultSuccess(resultParams); return system.getResultSuccess(resultParams);
} }
async opOrderPayCallBackChannel(parmas, appInfo) {//操作订单付款回调---微信
var item = await this.dao.getItemStatusByOrderNo(parmas.orderNo)
if (!item) {
return system.getResult(null, "order data is empty!");
}
if (item.orderStatus > 1) {
return system.getResult(null, "order status is pay!");
}
var self = this;
await self.db.transaction(async function (t) {
await self.dao.updateByWhere({ orderStatus: 2, payTime: parmas.time_end }, { where: { orderNo: parmas.orderNo } }, t);
var putFields = {
auditStatus: "tg",
accountType: parmas.pay_type,
passTradeNo: parmas.transaction_id || "",//通知校验ID
payOrderNo: parmas.payOrderNo || "",//支付凭证流水单号,如:微信支付凭证单号--该交易在支付宝系统中的交易流水号。最短16位,最长64位。
busPayOrderCode: parmas.out_trade_no || "",//业务支付订单号
buyerOpenId: parmas.appid || "",//用户在支付商户appid下的唯一标识或买家在支付宝的用户id
buyerAliLogonId: parmas.mch_id || "",//买家支付宝账号
updated_at: new Date(),//该笔交易的买家付款时间。格式为yyyy-MM-dd HH:mm:ss。
notes: parmas.gmt_create || ""//该笔交易创建的时间。格式为yyyy-MM-dd HH:mm:ss。
};
await self.orderReceiptVoucherDao.updateByWhere(putFields, { where: { sourceOrderNo: parmas.orderNo } }, t);
var orderLog = {
uapp_id: appInfo.uapp_id,
sourceOrderNo: parmas.orderNo,
opContent: "您成功支付了订单,请等待服务商服务",
isShow: 1
};
await self.flowlogDao.create(orderLog, t);
var moneyObj = {
uapp_id: appInfo.uapp_id,
sourceOrderNo: parmas.orderNo, // 来源单号
channelUserId: item.channelUserId,
ownerUserId: item.ownerUserId,
accountType: parmas.pay_type,//帐户类型( 支付类型):"cash": "现金", "bank": "银行" ,"wx":"微信","alipay":"支付宝","other":"其它"
directionType: "sr",//凭单类型,"sr": "收","zc": "支"
voucherDate: parmas.time_end || new Date(),//new Date(),//凭单时间
recvAmount: item.totalSum,//收总额
sourceType: "orderinfo",//来源类型 "orderinfo": "订单","expensevoucher": "费用单"
auditStatus: "tg",//审核状态"dsh": "待审核", "btg": "不通过", "tg": "通过"
};
await self.moneyJourneyDao.create(moneyObj, t);
});
item.orderStatus = 2;//已付款
var resultParams = {
order_info: item,
delivery_content: null,//包含订单联系人orderContact
product_info: null
};
var deliveryInfoResult = await this.getOrderDeliveryInfo(null, parmas);
if (deliveryInfoResult && deliveryInfoResult.status == 0) {
resultParams.delivery_content = deliveryInfoResult.data;
}
var orderProductItem = await this.orderproductDao.getItemInfoByOrderNo(parmas.orderNo);
if (orderProductItem) {
resultParams.product_info = JSON.parse(orderProductItem.serviceItemSnapshot);
}
return system.getResultSuccess(resultParams);
}
//-------------------------------服务商通知订单流程-------------end---------------- //-------------------------------服务商通知订单流程-------------end----------------
//商标方案确认 //商标方案确认
async tmConfirm(pobj) { async tmConfirm(pobj) {
...@@ -1739,5 +1800,13 @@ class OrderInfoService extends ServiceBase { ...@@ -1739,5 +1800,13 @@ class OrderInfoService extends ServiceBase {
// 注意这里 如果没有返回值 则会在api.base报错,拿不到requestId // 注意这里 如果没有返回值 则会在api.base报错,拿不到requestId
return system.getResultSuccess(); return system.getResultSuccess();
} }
//智能选择、全类保护 尼斯类获取
async getNclByCode(pobj){
var sql = "select `business_code`,`ncl_content` from b_business_ncl where business_code=:business_code LIMIT 1";
var paramWhere = { business_code: pobj.actionBody.businessCode };
var result = await this.customQuery(sql, paramWhere);
return system.getResult(result);
}
} }
module.exports = OrderInfoService; module.exports = OrderInfoService;
\ 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