Commit c724e93a by 王昆

gsb

parent 1c4b8c1c
...@@ -205,5 +205,10 @@ class MerchantService extends ServiceBase { ...@@ -205,5 +205,10 @@ class MerchantService extends ServiceBase {
row.merchant = map[row.saas_merchant_id] || {}; row.merchant = map[row.saas_merchant_id] || {};
} }
} }
async addConsumeLog(params) {
let rs = await this.callms("merchant", "addConsumeLog", params);
return rs;
}
} }
module.exports = MerchantService; module.exports = MerchantService;
...@@ -191,7 +191,7 @@ class System { ...@@ -191,7 +191,7 @@ class System {
common: dev + ":3102" + path, common: dev + ":3102" + path,
// 商户服务 // 商户服务
merchant: dev + ":3101" + path, merchant: local + ":3101" + path,
// 订单服务 // 订单服务
order: dev + ":3103" + path, order: dev + ":3103" + path,
...@@ -203,7 +203,7 @@ class System { ...@@ -203,7 +203,7 @@ class System {
uc: dev + ":3106" + path, uc: dev + ":3106" + path,
// 交易 // 交易
trade: local + ":3107" + path, trade: dev + ":3107" + path,
} }
} else { } else {
return { return {
......
...@@ -20,10 +20,10 @@ class MerchantApplet extends AppletBase { ...@@ -20,10 +20,10 @@ class MerchantApplet extends AppletBase {
this.idcardClient = system.getObject("util.idcardClient"); this.idcardClient = system.getObject("util.idcardClient");
this.merchantappletuserSve = system.getObject("service.uc.merchantappletuserSve"); this.merchantappletuserSve = system.getObject("service.uc.merchantappletuserSve");
this.orderSve = system.getObject("service.saas.orderSve"); this.orderSve = system.getObject("service.saas.orderSve");
this.merchantId = 1;
this.businessmenSve = system.getObject("service.saas.businessmenSve"); this.businessmenSve = system.getObject("service.saas.businessmenSve");
this.tradeSve = system.getObject("service.trade.tradeSve"); this.tradeSve = system.getObject("service.trade.tradeSve");
this.saasInvoiceSve = system.getObject("service.saas.invoiceSve"); this.saasInvoiceSve = system.getObject("service.saas.invoiceSve");
this.merchantSve = system.getObject("service.saas.merchantSve");
this.redisClient = system.getObject("util.redisClient"); this.redisClient = system.getObject("util.redisClient");
this.smsClient = system.getObject("util.smsClient"); this.smsClient = system.getObject("util.smsClient");
...@@ -86,6 +86,13 @@ class MerchantApplet extends AppletBase { ...@@ -86,6 +86,13 @@ class MerchantApplet extends AppletBase {
return this.returnSuccess(user); return this.returnSuccess(user);
} }
async addLog(pobj, consume_type) {
let user = await this.getLoginUser(pobj.merchant_id, pobj.openid);
let log = {saas_id: user.saas_id, saas_merchant_id: user.saas_merchant_id, consume_type: consume_type, consume_id: user.id};
let rs = await this.merchantSve.addConsumeLog({log: log});
console.log("log rs : ", rs);
}
// 保存订单信息 // 保存订单信息
async saveOrder(gobj, pobj, req, loginUser) { async saveOrder(gobj, pobj, req, loginUser) {
try { try {
...@@ -101,6 +108,7 @@ class MerchantApplet extends AppletBase { ...@@ -101,6 +108,7 @@ class MerchantApplet extends AppletBase {
userBankNo: bminfo.bank_no, userBankNo: bminfo.bank_no,
userMobile: bminfo.bank_mobile, userMobile: bminfo.bank_mobile,
}); });
this.addLog(pobj, "bankfour");
if (bf.code !== 0) { if (bf.code !== 0) {
return this.returnFail(rs.msg || "银行卡四要素验证失败,请检查法人姓名,身份证,银行卡号,银行卡预留手机号正确"); return this.returnFail(rs.msg || "银行卡四要素验证失败,请检查法人姓名,身份证,银行卡号,银行卡预留手机号正确");
} }
...@@ -179,13 +187,13 @@ class MerchantApplet extends AppletBase { ...@@ -179,13 +187,13 @@ class MerchantApplet extends AppletBase {
return this.returnFail("请填写短信验证码"); return this.returnFail("请填写短信验证码");
} }
let vcode = await this.redisClient.get(this.SMS_BANKMOBILE_KEY + obj.bank_mobile); // let vcode = await this.redisClient.get(this.SMS_BANKMOBILE_KEY + obj.bank_mobile);
if (!vcode) { // if (!vcode) {
return this.returnFail("短信验证码已过期,请重新发送"); // return this.returnFail("短信验证码已过期,请重新发送");
} // }
if (vcode != noteCode) { // if (vcode != noteCode) {
return this.returnFail("短信验证码错误,请重新填写"); // return this.returnFail("短信验证码错误,请重新填写");
} // }
let bminfo = { let bminfo = {
idcard_front: obj.idcard_front, idcard_front: obj.idcard_front,
idcard_back: obj.idcard_back, idcard_back: obj.idcard_back,
...@@ -403,6 +411,7 @@ class MerchantApplet extends AppletBase { ...@@ -403,6 +411,7 @@ class MerchantApplet extends AppletBase {
await this.redisClient.setWithEx(key + "t", vcode, 60); await this.redisClient.setWithEx(key + "t", vcode, 60);
let msg = "您的个体户注册手机验证码为" + vcode + ", (切勿将验证码告知别人, 请在5分钟内输入完成验证, 如有问题请联系客服。)"; let msg = "您的个体户注册手机验证码为" + vcode + ", (切勿将验证码告知别人, 请在5分钟内输入完成验证, 如有问题请联系客服。)";
let rs = await this.smsClient.sendMsg(mobile, msg); let rs = await this.smsClient.sendMsg(mobile, msg);
this.addLog(pobj, "sms");
console.log(rs); console.log(rs);
} }
return this.returnSuccess(1); return this.returnSuccess(1);
......
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