Commit b796f665 by 王昆

gsb

parent de0c1656
......@@ -458,6 +458,15 @@ class BpoSDPJApi {
if (rs.data.code === 0) {
cashInfo.trade_status = "01";
cashInfo.trade_desc = "提现申请成功";
try {
let actual_amt = await this.esettleSve.findAmtByOutTradeNo({
busi_id:param.mchtId,
out_trade_no: param.outTradeNo
});
cashInfo.actual_amt = actual_amt;
} catch (eeee) {
console.log(eeee);
}
await cashInfo.save();
this.ccashinfoSve.formatStatus(resData, cashInfo);
......@@ -476,7 +485,7 @@ class BpoSDPJApi {
}
}
async getUidStr(len, radix) {
async getUidStr(len, radix) {z
var chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'.split('');
var uuid = [],
i;
......
......@@ -113,13 +113,13 @@ class CcashinfoService extends ServiceBase {
} else{
resData.redirect_code = 2;//跳转到领取结果
resData.trade_status = bean.trade_status;
if(resData.trade_status=="00"){
if (resData.trade_status == "00") {
resData.amt = system.f2y(bean.amt);
resData.actual_amt = system.f2y(bean.actual_amt);
}else if(resData.trade_status=="02"){
} else if (resData.trade_status == "02") {
resData.trade_desc = bean.trade_desc;
} else if (resData.trade_status == "01") {
resData.trade_desc = bean.trade_desc;
}else if(resData.trade_status=="01"){
resData.trade_desc =bean.trade_desc;
}
}
}
......
......@@ -684,6 +684,19 @@ class EsettleService extends ServiceBase {
return list && list.length > 0 ? list[0] : null;
}
async findAmtByOutTradeNo(params) {
let sql = [];
//
sql.push("SELECT");
sql.push("SUM(actual_amt) AS actual_amt");
sql.push("FROM tbl_order WHERE busi_id = :busi_id AND out_trade_no = :out_trade_no'");
let list = await this.settledb.query(sql.join(" "), {replacements: params});
if (list && list.length > 0) {
list = list[0, 0] || [];
}
return (!list || list.length == 0) ? 0 : (list[0].actual_amt || 0);
}
async findMchtApiInfo(params) {
if (!params.mchtId) {
return null;
......
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