lrf402788946 4 years ago
parent
commit
307a59d866
3 changed files with 5 additions and 4 deletions
  1. 3 2
      app/service/order/bill.js
  2. 1 1
      app/service/order/order.js
  3. 1 1
      app/service/order/split.js

+ 3 - 2
app/service/order/bill.js

@@ -15,10 +15,11 @@ class BillService extends CrudService {
    * @param {Object} data 订单数据
    */
   async inBill(data) {
+    console.log(data);
     const { _id } = data;
     const res = await this.model.update({ _id: ObjectId(_id) }, data);
     try {
-      this.os.record(res._id, { method: 'in' });
+      this.os.record(_id, { method: 'in' });
     } catch (error) {
       this.logger.error(`订单id:${res.id}记录创建失败:${error.toString()}`);
     }
@@ -32,7 +33,7 @@ class BillService extends CrudService {
     const { _id } = data;
     const res = await this.model.update({ _id: ObjectId(_id) }, data);
     try {
-      this.os.record(res._id, { method: 'out' });
+      this.os.record(_id, { method: 'out' });
     } catch (error) {
       this.logger.error(`订单id:${res.id}记录创建失败:${error.toString()}`);
     }

+ 1 - 1
app/service/order/order.js

@@ -252,7 +252,7 @@ class OrderService extends CrudService {
    */
   async record(id, { method, message }) {
     const order = await this.model.findById(id);
-    if (!order) throw new BusinessError(ErrorCode.DATA_NOT_EXIST, '未找到订单');
+    if (!order) throw new BusinessError(ErrorCode.DATA_NOT_EXIST, `未找到订单,传入id:${id}`);
     const { authorization } = this.ctx.request.header;
     let user = decodeURI(authorization);
     if (!user) { throw new BusinessError(ErrorCode.USER_NOT_EXIST, '未找到操作人'); }

+ 1 - 1
app/service/order/split.js

@@ -17,7 +17,7 @@ class SplitService extends CrudService {
     const { _id } = data;
     const res = await this.model.update({ _id: ObjectId(_id) }, data);
     try {
-      this.os.record(res._id, { method: 'split' });
+      this.os.record(_id, { method: 'split' });
     } catch (error) {
       this.logger.error(`订单id:${res.id}记录创建失败:${error.toString()}`);
     }