Commit c6a716e1 by 王昆

gsb

parent b9a08d3d
......@@ -36,7 +36,11 @@ class BpoSDPJApi {
this.redisLock = system.getObject("util.redisLock");
this.bankthreelogSve = system.getObject("service.bankthreelogSve");
this.etemplateSve = system.getObject("service.etemplateSve")
this.etemplateSve = system.getObject("service.etemplateSve");
this.dictionary = system.getObject("util.dictionary");
this.resultMap = {
0: "操作成功",
1: "操作失败",
......@@ -201,6 +205,24 @@ class BpoSDPJApi {
return system.decryption(no);
}
getWxResult(msg) {
console.log("------------------wxResult-msg0----------------", msg);
if(!msg) {
return "";
}
let map = this.dictionary.getDic("WX_RESULT_MAP") || {};
for (let k in map) {
let v = map[k];
if (msg.indexOf(k) != -1) {
console.log("------------------wxResult-msg-return1----------------", v);
return v;
}
}
console.log("------------------wxResult-msg-return2----------------", msg);
return msg;
}
async qrcodeDesc(obj, req) {
try {
let params = {
......@@ -431,7 +453,7 @@ class BpoSDPJApi {
app_id: obj.app_id
});
if (doAuthRes.status !== 0) {
return this.getBaseResult(1, doAuthRes.msg || "姓名或身份证错误");
return this.getBaseResult(1, "填写姓名和身份证不匹配");
}
if (!cashUser.id) {
......@@ -574,7 +596,7 @@ class BpoSDPJApi {
return this.getCodeResult(0, {redirect_code: 5});
}
console.log("张娇要看的时间发起提现---------------------------", cashInfo.outTradeNo, new Date().getTime());
console.log(`张娇要看的时间发起提现${cashInfo.outTradeNo}---------------------------`, new Date().getTime());
// 发起交易
let bizContent = [];
bizContent.push({
......@@ -646,9 +668,10 @@ class BpoSDPJApi {
} else {
cashInfo.trade_status = "02";
cashInfo.trade_desc = rs.data.msg || "";
let tip = this.getWxResult(cashInfo.trade_desc);
await cashInfo.save();
this.notifyCash(cashInfo.id);
return this.getSuccessResult(cashInfo.trade_desc, {redirect_code: 6});
return this.getSuccessResult(tip, {redirect_code: 6});
}
} catch (error) {
console.log(error);
......@@ -685,7 +708,8 @@ class BpoSDPJApi {
rc = 6;
trade_desc = item.respDesc || "";
}
return this.getBaseResult(0, trade_desc, {
let tip = this.getWxResult(trade_desc);
return this.getBaseResult(0, tip, {
redirect_code: rc,
trade_desc: cashInfo.trade_desc,
complete: true,
......@@ -761,7 +785,7 @@ class BpoSDPJApi {
}
async wxnotify(obj, req) {
console.log("张娇要看的时间发起提现后回调时间---------------------------", obj.outTradeNo, new Date().getTime());
console.log(`张娇要看的时间发起提现${cashInfo.outTradeNo}回调时间---------------------------`, new Date().getTime());
console.log("------------- wx-sdpj转账回调 --------------", obj);
try {
// 1. 获取转账二维码信息
......
class Dictionary {
constructor() {
this.WX_RESULT_MAP = {
"NO_AUTH": "没有该接口权限",
"AMOUNT_LIMIT": "金额超限",
"PARAM_ERROR": "参数错误",
"OPENID_ERROR": "Openid错误",
"SEND_FAILED": "哎呀,出错了,从新获取二维码领取试试吧~",
"NOTENOUGH": "抱歉,商户余额不足,请联系您的客户经理",
"SYSTEMERROR": "哎呀,微信出错了,重新获取二维码领取试试吧",
"NAME_MISMATCH": "填写身份信息与微信实名信息不一致",
"SIGN_ERROR": "签名错误",
"XML_ERROR": "Post内容出错",
"FATAL_ERROR": "两次请求参数不一致",
"FREQ_LIMIT": "超过频率限制,请稍后再试。",
"MONEY_LIMIT": "今日奖励领取额度已达上限5000元",
"CA_ERROR": "商户API证书校验出错",
"V2_ACCOUNT_SIMPLE_BAN": "微信未实名认证,请实名后领取",
"PARAM_IS_NOT_UTF8": "请求参数中包含非utf8编码字符",
"SENDNUM_LIMIT": "没有该接口权限",
"RECV_ACCOUNT_NOT_ALLOWED": "收款账户不在收款账户列表",
"PAY_CHANNEL_NOT_ALLOWED": "本商户号未配置API发起能力",
"报文请求异常": "哎呀,微信出错了,重新获取二维码领取试试吧",
"银行客户端异常": "哎呀,微信出错了,重新获取二维码领取试试吧",
"系统内部错误": "哎呀,微信出错了,重新获取二维码领取试试吧",
};
}
getDic(dicName) {
if (!dicName) {
return;
}
let _dic = this[dicName];
let dic = {};
for (let k in _dic) {
dic[k] = _dic[k];
}
return dic;
}
}
module.exports = Dictionary;
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