Commit 15996149 by 王昆

Merge branch 'xgg-saas-merchant' of gitlab.gongsibao.com:jiangyong/zhichan into xgg-saas-merchant

parents 6b3bcfa0 e301b893
......@@ -33,7 +33,7 @@ class InvoiceCtl extends CtlBase {
try {
params.unInvoice = 1;
params.order_type = params.fee_type;
params.trade_status_array = ["00","02"];
params.trade_status_array = ["00"];
this.doTimeCondition(params, ["createBegin", "createEnd"]);
return await this.tradeSve.itemPage(params);
} catch (error) {
......
......@@ -114,5 +114,10 @@ class MerchantCtl extends CtlBase {
}
}
async getFeeTypeWithCache(params, pobj2, req){
let res = await this.merchantSve.getFeeTypeWithCache(params);
return system.getResult({type: res});
}
}
module.exports = MerchantCtl;
......@@ -194,10 +194,10 @@ class System {
merchant: dev + ":3101" + path,
// 订单服务
order: local + ":3103" + path,
order: dev + ":3103" + path,
// 发票服务
invoice: local + ":3105" + path,
invoice: dev + ":3105" + path,
// 用户服务
uc: dev + ":3106" + path,
......
......@@ -17,7 +17,7 @@ class MerchantApplet extends AppletBase {
this.businessmenSve = system.getObject("service.saas.businessmenSve");
this.tradeSve = system.getObject("service.trade.tradeSve");
this.saasInvoiceSve = system.getObject("service.saas.invoiceSve");
this.redisClient = system.getObject("util.redisClient");
}
async test(o, obj, req) {
......@@ -79,6 +79,12 @@ class MerchantApplet extends AppletBase {
// 保存订单信息
async saveOrder(gobj, pobj, req, loginUser) {
try {
let verificationCodeRes = await this.verificationCode(pobj.bank_mobile,pobj.msgCode)
if(!verificationCodeRes){
return this.returnFail("短信验证码错误");
}
//TODO: 银行卡四要数验证
let rs = await this.buildOrder(pobj);
if (rs.code === 0) {
return rs;
......@@ -346,6 +352,30 @@ class MerchantApplet extends AppletBase {
}
}
/**
* 获取验证码
* @param pobj1
* @param pobj2
* @param req
* @returns {Promise<void>}
*/
async getVerificationCode(pobj1, pobj2, req){
let code = await this.redisClient.setWithEx(`merchantAppletMsg:${pobj1.mobile}`,"123456", 60 * 1);
return this.returnSuccess("123456");
}
/**
* 驗證验证码
* @param pobj1
* @param pobj2
* @param req
* @returns {Promise<void>}
*/
async verificationCode(mobile,code){
let value = await this.redisClient.get(`merchantAppletMsg:${mobile}`);
console.log("小程序验证码"+value);
return value == code ? true:false;
}
}
module.exports = MerchantApplet;
\ 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