lrf 2 年之前
父节点
当前提交
120f070e58

+ 5 - 6
app/controller/apply/config/.tempLessonApply.js

@@ -1,6 +1,6 @@
 module.exports = {
 module.exports = {
   create: {
   create: {
-    requestBody: ['money', 'pay_id', 'school_id', 'lesson_id', 'student_id', 'coach_id', 'result', 'reason', 'img_url'],
+    requestBody: ['openid', 'school_id', 'lesson_id', 'coach_id', 'student_id', 'name', 'phone', 'file', 'is_pay', 'pay_id'],
   },
   },
   destroy: {
   destroy: {
     params: ['!id'],
     params: ['!id'],
@@ -8,7 +8,7 @@ module.exports = {
   },
   },
   update: {
   update: {
     params: ['!id'],
     params: ['!id'],
-    requestBody: ['money', 'pay_id', 'school_id', 'lesson_id', 'student_id', 'coach_id', 'result', 'reason', 'img_url'],
+    requestBody: ['school_id', 'lesson_id', 'coach_id', 'student_id', 'name', 'phone', 'file', 'is_pay', 'pay_id'],
   },
   },
   show: {
   show: {
     parameters: {
     parameters: {
@@ -25,7 +25,9 @@ module.exports = {
         lesson_id: 'lesson_id',
         lesson_id: 'lesson_id',
         student_id: 'student_id',
         student_id: 'student_id',
         coach_id: 'coach_id',
         coach_id: 'coach_id',
-        result: 'result',
+        name: 'name',
+        phone: 'phone',
+        is_pay: 'is_pay',
         pay_id: 'pay_id',
         pay_id: 'pay_id',
       },
       },
       // options: {
       // options: {
@@ -40,7 +42,4 @@ module.exports = {
       count: true,
       count: true,
     },
     },
   },
   },
-  toPay: {
-    requestBody: ['!id', '!payer_id'],
-  },
 };
 };

+ 1 - 7
app/controller/business/config/.payOrder.js

@@ -41,14 +41,8 @@ module.exports = {
   closeOrder: {
   closeOrder: {
     requestBody: ['!id'],
     requestBody: ['!id'],
   },
   },
-  toRefund: {
-    requestBody: ['!id'],
-  },
-  toRePay: {
-    requestBody: ['!id'],
-  },
   toPayNative: {
   toPayNative: {
-    requestBody: ['!school_id', 'pay_for', 'from_id', 'money', 'time', 'desc', 'config'],
+    requestBody: ['!school_id',  'lesson_id', 'money'],
   },
   },
   payCallBack: {
   payCallBack: {
     requestBody: ['result'],
     requestBody: ['result'],

+ 9 - 5
app/model/apply/tempLessonApply.js

@@ -7,9 +7,12 @@ const moneyPlugin = require('naf-framework-mongoose-free/lib/model/type-money-pl
 const tempLessonApply = {
 const tempLessonApply = {
   school_id: { type: String, required: false, zh: '学校id', ref: 'School', getProp: [ 'name' ] }, //
   school_id: { type: String, required: false, zh: '学校id', ref: 'School', getProp: [ 'name' ] }, //
   lesson_id: { type: String, required: false, zh: '课程id', ref: 'Lesson', getProp: [ 'title' ] }, //
   lesson_id: { type: String, required: false, zh: '课程id', ref: 'Lesson', getProp: [ 'title' ] }, //
-  student_id: { type: String, required: false, zh: '学员id', ref: 'Student', getProp: [ 'name', 'icon', ' phone' ] }, //
   coach_id: { type: String, required: false, zh: '教练id', ref: 'Coach', getProp: [ 'name' ] }, //
   coach_id: { type: String, required: false, zh: '教练id', ref: 'Coach', getProp: [ 'name' ] }, //
-  img_url: { type: Array, required: false, zh: '证据' }, //
+  student_id: { type: String, required: false, zh: '学员id', ref: 'Student', getProp: [ 'name', 'icon', ' phone' ] }, //
+  name: { type: String, required: false, zh: '学员姓名' }, //
+  phone: { type: String, required: false, zh: '学员电话' }, //
+  file: { type: Array, required: false, zh: '证据' }, //
+  is_pay: { type: String, default: '0', zh: '是否已支付' }, // 0:未支付;1:已支付:-1:支付失败:-3已退款
   pay_id: { type: String, required: false, zh: '支付id', ref: 'PayOrder' }, //
   pay_id: { type: String, required: false, zh: '支付id', ref: 'PayOrder' }, //
 };
 };
 const schema = new Schema(tempLessonApply, { toJSON: { getters: true, virtuals: true } });
 const schema = new Schema(tempLessonApply, { toJSON: { getters: true, virtuals: true } });
@@ -17,13 +20,14 @@ schema.index({ id: 1 });
 schema.index({ 'meta.createdAt': 1 });
 schema.index({ 'meta.createdAt': 1 });
 schema.index({ school_id: 1 });
 schema.index({ school_id: 1 });
 schema.index({ lesson_id: 1 });
 schema.index({ lesson_id: 1 });
-schema.index({ student_id: 1 });
 schema.index({ coach_id: 1 });
 schema.index({ coach_id: 1 });
-schema.index({ result: 1 });
+schema.index({ student_id: 1 });
+schema.index({ name: 1 });
+schema.index({ phone: 1 });
 schema.index({ pay_id: 1 });
 schema.index({ pay_id: 1 });
 
 
 schema.plugin(metaPlugin);
 schema.plugin(metaPlugin);
-schema.plugin(moneyPlugin({ zh: '金额' }));
+schema.plugin(moneyPlugin({ zh: '缴费金额' }));
 module.exports = app => {
 module.exports = app => {
   const { mongoose } = app;
   const { mongoose } = app;
   return mongoose.model('TempLessonApply', schema, 'tempLessonApply');
   return mongoose.model('TempLessonApply', schema, 'tempLessonApply');

+ 80 - 36
app/service/apply/tempLessonApply.js

@@ -4,49 +4,93 @@ const { BusinessError, ErrorCode } = require('naf-core').Error;
 const _ = require('lodash');
 const _ = require('lodash');
 const assert = require('assert');
 const assert = require('assert');
 const moment = require('moment');
 const moment = require('moment');
+const Transaction = require('mongoose-transactions');
 //
 //
 class TempLessonApplyService extends CrudService {
 class TempLessonApplyService extends CrudService {
   constructor(ctx) {
   constructor(ctx) {
     super(ctx, 'templessonapply');
     super(ctx, 'templessonapply');
     this.model = this.ctx.model.Apply.TempLessonApply;
     this.model = this.ctx.model.Apply.TempLessonApply;
-    this.payOrderService = this.ctx.service.business.payOrder;
-    this.lessonStudentService = this.ctx.service.business.lessonStudent;
+    this.payOrderModel = this.ctx.model.Business.PayOrder;
+    this.rssModel = this.ctx.model.Relation.RelationStudentSchool;
+    this.tran = new Transaction();
   }
   }
 
 
-  async beforeCreate(data) {
-    const query = _.pick(data, [ 'school_id', 'lesson_id', 'student_id', 'coach_id' ]);
-    const num = await this.model.count(query);
-    if (num > 0) throw new BusinessError(ErrorCode.DATA_EXISTED, '学生已申请临时参加课程');
-    return data;
-  }
-
-  // 去支付,生成支付单
-  async toPay({ id, payer_id }) {
-    const data = await this.model.findById(id);
-    if (!data) throw new BusinessError(ErrorCode.DATA_NOT_EXIST, '未找到临时上课的申请,无法进行支付');
-    const { student_id, coach_id, lesson_id, school_id, money } = data;
-    const payer_role = payer_id === student_id ? 'Student' : payer_id === coach_id ? 'Coach' : null;
-    if (!payer_role) throw new BusinessError(ErrorCode.DATA_INVALID, '该支付用户不是学生也不是教练');
-    const obj = { payer_id, payer_role, pay_for: 'Lesson', from_id: lesson_id, school_id, money, time: moment().format('YYYY-MM-DD HH:mm:ss'), desc: '私教课' };
-    // 找openid
-    const user = await this.ctx.model.User[payer_role].findById(payer_id).populate('user_id');
-    if (!user) throw new BusinessError(ErrorCode.DATA_NOT_EXIST, '未找到用户信息');
-    const openid = _.get(user, 'user_id.openid');
-    if (!openid) throw new BusinessError(ErrorCode.DATA_NOT_EXIST, '未找到用户微信信息');
-    obj.openid = openid;
-    const res = await this.payOrderService.create(obj);
-    return res;
-  }
-
-  // 处理审核成功的情况
-  async afterUpdate(filter, body, data) {
-    const { pay_id } = data;
-    if (pay_id.status !== '1') return data;
-    // 付款成功,去添加课程与学生关联
-    const obj = _.pick(data, [ 'school_id', 'lesson_id', 'student_id', 'money', 'is_pay', 'pay_id' ]);
-    obj.is_pay = '1';
-    await this.lessonStudentService.create(obj);
-    return data;
+  async create(data) {
+    try {
+      // 创建数据
+      const id = await this.tran.insert('TempLessonApply', data);
+      // 组织payOrder的数据,使用native支付
+      const payData = {
+        school_id: _.get(data, 'school_id'),
+        pay_for: 'TempLessonApply',
+        from_id: id,
+        time: moment().format('YYYY-MM-DD HH:mm:ss'),
+        desc: '临时上课缴费',
+        money: _.get(data, 'money'),
+        order_no: this.ctx.service.business.payOrder.getOrderNo(),
+      };
+      // 有学生信息就把学生信息补上
+      // 再查询学生是否有余额
+      let needPay = true;
+      let result = 'ok';
+      let billId;
+      if (data.student_id) {
+        payData.payer_id = data.student_id;
+        payData.payer_role = 'Student';
+        const rss = await this.rssModel.findOne({ school_id: data.school_id, student_id: data.student_id });
+        if (rss) {
+          // 有学生信息,将信息填充,因为传student_id可能不会传name和phone
+          const student = await this.studentModel.findById(data.student_id);
+          const name = _.get(student, 'name');
+          const phone = _.get(student, 'phone');
+          if (name && phone) this.tran.update('TempLessonApply', id, { name, phone });
+          const surplus = _.get(rss, 'money');
+          const newMoney = this.ctx.minus(surplus, data.money);
+          if (newMoney >= 0) {
+            needPay = false;
+            this.tran.update('RelationStudentSchool', data.student_id, { money: newMoney });
+            // 生成账单
+            const billData = {
+              school_id: _.get(data, 'school_id'),
+              payer_role: 'Student',
+              payer_id: data.student_id,
+              pay_for: 'TempLessonApply',
+              from_id: id,
+              type: '-2',
+              is_pay: '1',
+              time: moment().format('YYYY-MM-DD HH:mm:ss'),
+            };
+            billId = this.tran.insert('Bill', billData);
+            // 生成付款单数据,但是不需要支付
+            payData.status = '1';
+            payData.config = {
+              useSurplus: true,
+              bill: billId,
+              money: _.get(data, 'money'),
+            };
+          }
+        }
+      }
+      // 需要支付,不会生成账单,native支付处生成payOrder数据
+      if (needPay) {
+        // 获取支付二维码和生成的支付信息,再修改进去
+        const { pay_id, qrcode } = await this.ctx.service.business.payOrder.toPayNative(payData, this.tran);
+        this.tran.update('TempLessonApply', id, { pay_id });
+        result = qrcode;
+      } else {
+        // 不需要支付的情况,直接将支付单生成,然后将临时课程和账单的pay_id&is_pay都修改了
+        const pay_id = this.tran.insert('PayOrder', payData);
+        this.tran.update('TempLessonApply', id, { pay_id, is_pay: '1' });
+        this.tran.update('Bill', billId, { pay_id, is_pay: '1' });
+      }
+      await this.tran.run();
+      // 返回结果
+      return result;
+    } catch (error) {
+      await this.tran.rollback();
+    } finally {
+      this.tran.clean();
+    }
   }
   }
 }
 }
 
 

+ 0 - 1
app/service/business/lessonStudent.js

@@ -23,7 +23,6 @@ class LessonStudentService extends CrudService {
     this.payService = this.ctx.service.wxpay;
     this.payService = this.ctx.service.wxpay;
     this.tran = new Transaction();
     this.tran = new Transaction();
   }
   }
-
   async checkCanUse({ school_id, student_id, lesson_id }) {
   async checkCanUse({ school_id, student_id, lesson_id }) {
     const num = await this.model.count({ school_id, student_id, lesson_id, $or: [{ is_try: '0', is_pay: { $and: [{ $ne: '-3' }, { $ne: '-1' }] } }, { is_try: '1' }] });
     const num = await this.model.count({ school_id, student_id, lesson_id, $or: [{ is_try: '0', is_pay: { $and: [{ $ne: '-3' }, { $ne: '-1' }] } }, { is_try: '1' }] });
     if (num > 0) throw new BusinessError(ErrorCode.DATA_EXISTED, '已存在有效的报名信息');
     if (num > 0) throw new BusinessError(ErrorCode.DATA_EXISTED, '已存在有效的报名信息');

+ 45 - 142
app/service/business/payOrder.js

@@ -106,140 +106,6 @@ class PayOrderService extends CrudService {
     await this.syncData(data);
     await this.syncData(data);
     return data;
     return data;
   }
   }
-  /**
-   * 支付同步
-   * @param {Object} data 支付单数据
-   */
-  async syncData(data) {
-    const pay_for = _.get(data, 'pay_for');
-    // 不知道该去同步哪个表的支付状态,不处理
-    if (!pay_for) return;
-    const { from_id: _id, status: is_pay, money, _id: pay_id, config } = data;
-    if (pay_for === 'lessonStudent') {
-      // 因为上课产生的支付,去找lessonStudent,修改指定学生的支付状态
-      await this.lessonStudentModel.updateOne({ _id }, { is_pay, pay_id });
-      // 检查下各种记录
-      await this.makeRecord(data);
-    } else if (pay_for === 'tempLessonApply') {
-      // 私教课临时上课,需要到临时申请那找到相关数据
-      const tempApply = await this.tempLessonApplyModel.findById(_id);
-      if (!tempApply) return;
-      tempApply.pay_id = pay_id;
-      await tempApply.save();
-      // 修改完申请,再创建 lessonStudent
-      if (is_pay === '1') {
-        const { lesson_id, student_id, school_id } = tempApply;
-        const obj = { lesson_id, student_id, school_id, is_pay, pay_id, config, money };
-        await this.lessonStudentService.create(obj);
-      }
-      await this.makeRecord(data);
-    } else if (pay_for === 'Bill' && is_pay !== '0') {
-      // 充值记录,找到充值记录,没有就生成
-      const billData = await this.billModel.findOne({ pay_id });
-      if (billData) {
-        // 有就修改
-        billData.is_pay = is_pay;
-        await billData.save();
-      } else {
-        const obj = _.pick(data, [ 'school_id', 'payer_id', 'payer_role' ]);
-        await this.billModel.create({ ...obj, pay_for: 'Bill', pay_id, is_pay, time: moment().format('YYYY-MM-DD HH:mm:ss'), type: '1' });
-      }
-    }
-  }
-  // 检查记录
-  async makeRecord(data) {
-    const { config, _id: pay_id, status: is_pay, pay_for, from_id } = data;
-    let billData;
-    let wxBill;
-    // 检查是否有本次微信支付部分的账单
-    wxBill = await this.billModel.findOne({ pay_id });
-    if (!wxBill) {
-      // 没有微信支付账单,需要创建
-      const obj = _.pick(data, [ 'school_id', 'payer_id', 'payer_role', 'pay_for', 'from_id', 'time', 'money' ]);
-      obj.type = '-1';
-      obj.pay_id = data._id;
-      obj.is_pay = is_pay;
-      wxBill = await this.billModel.create(obj);
-    }
-
-    // 使用余额的处理
-    if (_.get(config, 'useSurplus')) {
-      const { bill } = config;
-      // 使用了余额,但是余额记录不是直接生成的,需要检查下bill是否为ObjectId
-      // 如果是ObjectId,说明余额记录已经生成.无需操作
-      if (_.isObject(bill)) {
-        // 是数据,生成账单记录
-        billData = await this.billModel.create({ ...bill, is_pay, pay_for, from_id, time: moment().format('YYYY-MM-DD HH:mm:ss') });
-        if (billData) data.config.bill = ObjectId(billData._id).toString();
-        await this.model.updateOne({ _id: data._id }, data);
-        // 创建账单后,扣余额
-        const { type, payer_role, payer_id, money, school_id } = billData;
-        if (type === '-2') {
-          let relation;
-          if (payer_role === 'Student') relation = await this.rssModel.findOne({ student_id: payer_id, school_id });
-          else if (payer_role === 'Coach') relation = await this.rcsModel.findOne({ coach_id: payer_id, school_id });
-          relation.money = relation.money - money;
-          await relation.save();
-        }
-      }
-    }
-  }
-
-  /**
-   * 重新支付; 弃用
-   * @param {String} body 参数体
-   * @property {String} id 数据id
-   */
-  async toRePay({ id }) {
-    const data = await this.model.findById(id);
-    if (!data) throw new BusinessError(ErrorCode.DATA_NOT_EXIST, '未找到支付的信息');
-    // 找到这个订单,然后获取到订单号
-    const { order_no } = data;
-    // 利用订单号去查询微信那边,该订单是否还存在
-    const wxOrder = await this.payService.search(order_no);
-    let wxSign;
-    if (_.get(wxOrder, 'trade_state') === 'NOTPAY') {
-      // 未支付就用原数据,去支付
-      wxSign = await this.payService.create(data);
-    } else if (_.get(wxOrder, 'trade_state') === 'SUCCESS') {
-      throw new BusinessError(ErrorCode.SERVICE_FAULT, '订单已支付,无需重复支付');
-    } else if (_.get(wxOrder, 'trade_state') === 'USERPAYING') {
-      throw new BusinessError(ErrorCode.SERVICE_FAULT, '订单支付中');
-    } else {
-      await this.payService.close(order_no);
-      // 其他情况就关闭订单.直接新订单
-      const newNo = this.getOrderNo();
-      data.order_no = newNo;
-      await data.save();
-      wxSign = await this.payService.create(data);
-    }
-    return { pay_id: id, wxSign };
-  }
-
-  /**
-   * 申请退款,弃用
-   * @param {Object} body 参数体
-   * @property {String} id 支付单的数据id
-   */
-  async toRefund({ id }) {
-    // 查询支付
-    const data = await this.model.findById(id);
-    if (!data) throw new BusinessError(ErrorCode.DATA_NOT_EXIST, '未找到要退款的支付数据');
-    const wxOrderReq = await this.payService.search(data.order_no);
-    if (wxOrderReq) {
-      if (!wxOrderReq) throw new BusinessError(ErrorCode.DATA_NOT_EXIST, '未查询到微信支付订单');
-      const wxRefundReq = await this.payService.refund(data.order_no, '退赛');
-      if (wxRefundReq) {
-        if (wxRefundReq.status !== 'REFUND') throw new BusinessError(ErrorCode.SERVICE_FAULT, '退款失败');
-        // 退款成功
-        data.status = '-3';
-        await data.save();
-        await this.syncData(data);
-        return 'ok';
-      }
-    }
-    throw new BusinessError(ErrorCode.SERVICE_FAULT, '查询微信支付订单失败');
-  }
 
 
   /**
   /**
    * 关闭订单
    * 关闭订单
@@ -258,11 +124,11 @@ class PayOrderService extends CrudService {
   }
   }
 
 
   // 二维码扫码
   // 二维码扫码
-  async toPayNative(body) {
-    body = await this.beforeCreate(body);
-    const data = await this.model.create(body);
+  async toPayNative(body, tran) {
+    if (!body.order_no) body.order_no = this.getOrderNo();
+    const pay_id = tran.insert('PayOrder', body);
     const qrcode = await this.payService.createNative({ ...body, notice_url: '/newCourt/v2/api/payOrder/nativeReturn' });
     const qrcode = await this.payService.createNative({ ...body, notice_url: '/newCourt/v2/api/payOrder/nativeReturn' });
-    return qrcode;
+    return { pay_id, qrcode };
   }
   }
   // 二维码扫码回调
   // 二维码扫码回调
   async nativeReturn(body) {
   async nativeReturn(body) {
@@ -273,8 +139,47 @@ class PayOrderService extends CrudService {
     if (trade_state === 'SUCCESS') obj.status = '1';
     if (trade_state === 'SUCCESS') obj.status = '1';
     else if (trade_state === 'REFUND') obj.status = '-3';
     else if (trade_state === 'REFUND') obj.status = '-3';
     const openid = _.get(payer, 'openid');
     const openid = _.get(payer, 'openid');
+    // 查找支付用户
+    const payerInfo = await this.findPayerByOpenid(openid);
+    const data = await this.model.findOne({ order_no });
+    // 数据修改
+    try {
+      // 修改支付单数据
+      this.tran.update('PayOrder', data._id, { ...payerInfo, ...obj });
+      if (_.get(data, 'pay_for') === 'TempLessonApply') {
+        // 临时上课的支付信息,需要修改 TempLessonApply 表的支付状态,生成账单
+        // 修改临时上课表的数据
+        this.tran.update('TempLessonApply', data.from_id, { is_pay: obj.status });
+        // 生成账单
+        const billData = {
+          school_id: _.get(data, 'school_id'),
+          pay_for: 'TempLessonApply',
+          from_id: data.from_id,
+          type: '-1',
+          is_pay: obj.status,
+          time: moment().format('YYYY-MM-DD HH:mm:ss'),
+        };
+        const payer_id = _.get(payerInfo, 'payer_id');
+        const payer_role = _.get(payerInfo, 'payer_role');
+        if (payer_id && payer_role) {
+          billData.payer_id = payer_id;
+          billData.payer_role = payer_role;
+        }
+        this.tran.insert('Bill', billData);
+      }
+
+      await this.tran.run();
+    } catch (error) {
+      await this.tran.rollback();
+      console.error(error);
+    } finally {
+      this.tran.clean();
+    }
+  }
+  // 根据openid查找支付用户
+  async findPayerByOpenid(openid) {
+    const obj = { openid };
     if (openid) {
     if (openid) {
-      obj.openid = openid;
       // 找payer_id的信息,学员,教练
       // 找payer_id的信息,学员,教练
       const user = await this.userModel.findOne({ openid });
       const user = await this.userModel.findOne({ openid });
       if (user) {
       if (user) {
@@ -292,9 +197,7 @@ class PayOrderService extends CrudService {
         }
         }
       }
       }
     }
     }
-    await this.model.updateOne({ order_no }, obj);
-    const data = await this.model.findOne({ order_no });
-    await this.syncData(data);
+    return obj;
   }
   }
 }
 }
 
 

+ 0 - 1
app/z_router/apply/tempLessonApply.js

@@ -7,7 +7,6 @@ const rkey = 'tempLessonApply';
 const ckey = 'apply.tempLessonApply';
 const ckey = 'apply.tempLessonApply';
 const keyZh = '临时上课申请';
 const keyZh = '临时上课申请';
 const routes = [
 const routes = [
-  { method: 'post', path: `${rkey}/toPay`, controller: `${ckey}.toPay`, name: `${ckey}ToPay`, zh: `${keyZh}-支付` },
   { method: 'get', path: `${rkey}`, controller: `${ckey}.index`, name: `${ckey}Query`, zh: `${keyZh}列表查询` },
   { method: 'get', path: `${rkey}`, controller: `${ckey}.index`, name: `${ckey}Query`, zh: `${keyZh}列表查询` },
   { method: 'get', path: `${rkey}/:id`, controller: `${ckey}.show`, name: `${ckey}Show`, zh: `${keyZh}查询` },
   { method: 'get', path: `${rkey}/:id`, controller: `${ckey}.show`, name: `${ckey}Show`, zh: `${keyZh}查询` },
   { method: 'post', path: `${rkey}`, controller: `${ckey}.create`, middleware: ['password'], name: `${ckey}Create`, zh: `创建${keyZh}` },
   { method: 'post', path: `${rkey}`, controller: `${ckey}.create`, middleware: ['password'], name: `${ckey}Create`, zh: `创建${keyZh}` },

+ 0 - 3
app/z_router/business/payOrder.js

@@ -10,10 +10,7 @@ const routes = [
   { method: 'post', path: `${rkey}/toCharge`, controller: `${ckey}.toCharge`, name: `${ckey}toCharge`, zh: `${keyZh}-充值` },
   { method: 'post', path: `${rkey}/toCharge`, controller: `${ckey}.toCharge`, name: `${ckey}toCharge`, zh: `${keyZh}-充值` },
   { method: 'post', path: `${rkey}/payCallBack`, controller: `${ckey}.payCallBack`, name: `${ckey}payCallBack`, zh: `${keyZh}-正常支付回调` },
   { method: 'post', path: `${rkey}/payCallBack`, controller: `${ckey}.payCallBack`, name: `${ckey}payCallBack`, zh: `${keyZh}-正常支付回调` },
   { method: 'post', path: `${rkey}/nativeReturn`, controller: `${ckey}.nativeReturn`, name: `${ckey}nativeReturn`, zh: `${keyZh}-二维码支付回调` },
   { method: 'post', path: `${rkey}/nativeReturn`, controller: `${ckey}.nativeReturn`, name: `${ckey}nativeReturn`, zh: `${keyZh}-二维码支付回调` },
-  { method: 'post', path: `${rkey}/toPayNative`, controller: `${ckey}.toPayNative`, name: `${ckey}toPayNative`, zh: `${keyZh}-二维码支付` },
-  // { method: 'post', path: `${rkey}/toRePay`, controller: `${ckey}.toRePay`, name: `${ckey}toRePay`, zh: `${keyZh}-重新支付订单` },
   { method: 'post', path: `${rkey}/closeOrder`, controller: `${ckey}.closeOrder`, name: `${ckey}CloseOrder`, zh: `${keyZh}-关闭订单` },
   { method: 'post', path: `${rkey}/closeOrder`, controller: `${ckey}.closeOrder`, name: `${ckey}CloseOrder`, zh: `${keyZh}-关闭订单` },
-  // { method: 'post', path: `${rkey}/toRefund`, controller: `${ckey}.toRefund`, name: `${ckey}ToRefund`, zh: `${keyZh}-退款` },
   { method: 'get', path: `${rkey}`, controller: `${ckey}.index`, name: `${ckey}Query`, zh: `${keyZh}列表查询` },
   { method: 'get', path: `${rkey}`, controller: `${ckey}.index`, name: `${ckey}Query`, zh: `${keyZh}列表查询` },
   { method: 'get', path: `${rkey}/:id`, controller: `${ckey}.show`, name: `${ckey}Show`, zh: `${keyZh}查询` },
   { method: 'get', path: `${rkey}/:id`, controller: `${ckey}.show`, name: `${ckey}Show`, zh: `${keyZh}查询` },
   { method: 'post', path: `${rkey}`, controller: `${ckey}.create`, name: `${ckey}Create`, zh: `创建${keyZh}` },
   { method: 'post', path: `${rkey}`, controller: `${ckey}.create`, name: `${ckey}Create`, zh: `创建${keyZh}` },