Browse Source

Merge branch 'dev'

lrf 2 years ago
parent
commit
48cf09bf19

+ 13 - 0
app/controller/trade/actOrder.js

@@ -0,0 +1,13 @@
+'use strict';
+const meta = require('./config/.actOrder.js');
+const Controller = require('egg').Controller;
+const { CrudController } = require('naf-framework-mongoose-free/lib/controller');
+
+// 
+class ActOrderController extends Controller {
+  constructor(ctx) {
+    super(ctx);
+    this.service = this.ctx.service.trade.actOrder;
+  }
+}
+module.exports = CrudController(ActOrderController, meta);

+ 48 - 0
app/controller/trade/config/.actOrder.js

@@ -0,0 +1,48 @@
+module.exports = {
+  create: {
+    requestBody: ['platform_act', 'order_detail', 'is_deal', 'goods'],
+  },
+  destroy: {
+    params: ['!id'],
+    service: 'delete',
+  },
+  update: {
+    params: ['!id'],
+    requestBody: ['platform_act', 'order_detail', 'is_deal', 'goods'],
+  },
+  show: {
+    parameters: {
+      params: ['!id'],
+    },
+    service: 'fetch',
+  },
+  index: {
+    parameters: {
+      query: {
+        'meta.createdAt@start': 'meta.createdAt@start',
+        'meta.createdAt@end': 'meta.createdAt@end',
+        platform_act: 'platform_act',
+        order_detail: 'order_detail',
+        is_deal: 'is_deal',
+        goods: 'goods',
+      },
+      // options: {
+      //   "meta.state": 0 // 默认条件
+      // },
+    },
+    service: 'query',
+    options: {
+      query: ['skip', 'limit'],
+      sort: ['meta.createdAt'],
+      desc: true,
+      count: true,
+    },
+  },
+  grmm: {
+    params: ['!id'],
+    service: 'getRefundMaxMoney',
+  },
+  toRefund: {
+    requestBody: ['data'],
+  },
+};

+ 1 - 1
app/controller/trade/config/.orderDetail.js

@@ -68,7 +68,7 @@ module.exports = {
     },
   },
   sot: {
-    params: ['!id'],
+    requestBody: ['!id','goods_id'],
     service: 'searchOrderTransport',
   },
 };

+ 24 - 0
app/model/trade/actOrder.js

@@ -0,0 +1,24 @@
+'use strict';
+const Schema = require('mongoose').Schema;
+const metaPlugin = require('naf-framework-mongoose-free/lib/model/meta-plugin');
+
+// 平台活动-订单
+const actOrder = {
+  platform_act: { type: String, required: false, zh: '平台活动', ref: 'System.PlatformAct' }, //
+  order_detail: { type: String, required: false, zh: '拆分后的订单', ref: 'Trade.Order' }, //
+  is_deal: { type: String, required: false, default: '0', zh: '是否处理' }, // 字典:is_deal
+  goods: { type: Array, required: false, zh: '影响的商品' }, //
+};
+const schema = new Schema(actOrder, { toJSON: { getters: true, virtuals: true } });
+schema.index({ id: 1 });
+schema.index({ 'meta.createdAt': 1 });
+schema.index({ platform_act: 1 });
+schema.index({ order_detail: 1 });
+schema.index({ is_deal: 1 });
+
+schema.plugin(metaPlugin);
+
+module.exports = app => {
+  const { mongoose } = app;
+  return mongoose.model('ActOrder', schema, 'actOrder');
+};

+ 20 - 1
app/model/trade/orderDetail.js

@@ -3,6 +3,25 @@ const transport = {
   shop_transport_no: '运单号',
   shop_transport_type: '快递公司类型',
 };
+const discount_detail = {
+  // key:value形式
+  key: '领取的优惠券id',
+  value: 'key:value形式:key:规格id ; value:分配的价格',
+};
+
+const act = {
+  // [object]形式
+  act_id: { type: String, zh: '活动id' },
+  money: { type: Number, zh: '返现金额' },
+  time: { type: String, zh: '返现时间' },
+  data: { type: Object, zh: '退款数据' },
+};
+const total_detail = {
+  goods_total: { type: Number, zh: '商品总价' },
+  freight_total: { type: Number, zh: '运费总价' },
+  discount_detail: { type: Object, zh: '优惠券明细' },
+  act: { type: Array, zh: '活动相关' },
+};
 
 const Schema = require('mongoose').Schema;
 const metaPlugin = require('naf-framework-mongoose-free/lib/model/meta-plugin');
@@ -18,7 +37,7 @@ const orderDetail = {
   customer: { type: String, required: false, zh: '顾客', ref: 'User.User' }, //
   address: { type: Object, required: false, zh: '邮寄地址' }, //
   no: { type: String, required: false, zh: '订单号' }, //
-  transport: { type: Object, required: false, zh: '快递' }, // {no:运单号,type:快递公司编码}
+  transport: { type: Array, required: false, zh: '快递' }, // {no:运单号,type:快递公司编码}
   goods: { type: Array, required: false, zh: '商品快照清单' }, // 下单时,商品的属性设置:[{商品规格,商品信息}]
   total_detail: { type: Object, required: false, zh: '金额明细' }, // 本单的:{货物总价,运费总价,优惠详情:{优惠券id:{规格id:优惠金额}}}
   buy_time: { type: String, required: false, zh: '下单时间' }, //

+ 7 - 0
app/service/shop/goodsJoinAct.js

@@ -10,6 +10,13 @@ class GoodsJoinActService extends CrudService {
     super(ctx, 'goodsjoinact');
     this.model = this.ctx.model.Shop.GoodsJoinAct;
   }
+  async beforeCreate(data) {
+    const { goods, shop, platformAct } = data;
+    const num = await this.model.count({ goods, shop, platformAct });
+    if (num > 0) throw new BusinessError(ErrorCode.DATA_EXISTED, '该商品已添加进当前活动中');
+    return data;
+  }
+
   async query(filter, { skip = 0, limit, sort, desc, projection } = {}) {
     // 处理排序
     if (sort && _.isString(sort)) {

+ 231 - 0
app/service/trade/actOrder.js

@@ -0,0 +1,231 @@
+'use strict';
+const { CrudService } = require('naf-framework-mongoose-free/lib/service');
+const { BusinessError, ErrorCode } = require('naf-core').Error;
+const _ = require('lodash');
+const assert = require('assert');
+const { ObjectId } = require('mongoose').Types;
+const Transaction = require('mongoose-transactions');
+const moment = require('moment');
+//
+class ActOrderService extends CrudService {
+  constructor(ctx) {
+    super(ctx, 'actorder');
+    this.model = this.ctx.model.Trade.ActOrder;
+    this.orderDetailModel = this.ctx.model.Trade.OrderDetail;
+    this.orderModel = this.ctx.model.Trade.Order;
+    this.platformActModel = this.ctx.model.System.PlatformAct;
+    this.gjaModel = this.ctx.model.Shop.GoodsJoinAct;
+    this.tran = new Transaction();
+  }
+
+  /**
+   * 创建订单与活动的关系
+   * @param {String} id 订单id
+   * @param {Object} data 订单数据
+   * @param {Transaction} tran 数据库事务实例
+   */
+  async create(id, data, tran) {
+    // 检查活动类型为1的 活动,再查下面的商品
+    const actList = await this.platformActModel.find({ is_use: '0', type: { $ne: '0' } }, { _id: 1 });
+    if (actList.length <= 0) return;
+    // 整理出订单内的商品id
+    const odGoods = data.goods.map(i => {
+      const { _id: spec_id, goods } = i;
+      const goods_id = _.get(goods, '_id');
+      return { spec_id, goods_id };
+    });
+    const actOrderList = [];
+    // 循环所有活动,找当前购买的商品,是否出现在这些活动之中,如果出现,就需要添加关系
+    for (const act of actList) {
+      const { _id: platformAct } = act;
+      const query = { goods: odGoods.map(i => i.goods_id), platformAct };
+      const goodsList = await this.gjaModel.find(query);
+      // 获取受影响的商品
+      const influenceGoods = goodsList.map(i => i.goods);
+      if (influenceGoods.length <= 0) continue;
+      const actOrder = { platform_act: platformAct, order_detail: id };
+      // 用受影响的 商品id, 在 odGoods 中 找到对应的数据作为 actOrder的goods
+      actOrder.goods = odGoods.filter(f => influenceGoods.includes(f.goods_id));
+      actOrderList.push(actOrder);
+    }
+    for (const data of actOrderList) {
+      tran.insert('ActOrder', data);
+    }
+  }
+  // 改为聚合查询
+  async query(filter, { skip = 0, limit, sort, desc, projection } = {}) {
+    const { platform_act, order_detail, is_deal, goods } = filter;
+    const pipeline = [];
+    const modelMatch = {};
+    if (platform_act) modelMatch.platform_act = platform_act;
+    if (order_detail) modelMatch.order_detail = order_detail;
+    if (is_deal) modelMatch.is_deal = is_deal;
+    if (Object.keys(modelMatch).length > 0) pipeline.push({ $match: modelMatch });
+    // 表关联
+
+    pipeline.push({ $addFields: { order_detail_id: { $toObjectId: '$order_detail' } } });
+    const odLookUp = {
+      from: 'orderDetail',
+      localField: 'order_detail_id',
+      foreignField: '_id',
+      as: 'odi',
+    };
+    // 加入查询条件, 限制下订单状态
+    const odPipeline = [{ $match: { status: { $in: [ '1', '2-', '2', '3' ] } } }];
+    if (goods) {
+      odPipeline.push({ $match: { 'goods.goods.name': new RegExp(goods) } });
+    }
+    odPipeline.push({ $project: { name: 1, pay_time: 1, no: 1, customer: 1, shop: 1, status: 1, address: { name: 1, phone: 1, address: 1 } } });
+    odPipeline.push({ $addFields: { shop_id: { $toObjectId: '$shop' } } });
+    odPipeline.push({
+      $lookup: {
+        from: 'shop',
+        localField: 'shop_id',
+        foreignField: '_id',
+        pipeline: [{ $project: { name: 1 } }],
+        as: 'shopInfo',
+      },
+    });
+    odPipeline.push({ $addFields: { customer_id: { $toObjectId: '$customer' } } });
+    odPipeline.push({
+      $lookup: {
+        from: 'user',
+        localField: 'customer_id',
+        foreignField: '_id',
+        pipeline: [{ $project: { name: 1 } }],
+        as: 'cInfo',
+      },
+    });
+    odPipeline.push({
+      $project: {
+        _id: 0,
+        order_detail: '$_id',
+        name: 1,
+        pay_time: 1,
+        no: 1,
+        custumer_name: { $first: '$cInfo.name' },
+        shop_name: { $first: '$shopInfo.name' },
+        status: 1,
+        address: { name: 1, phone: 1, address: 1 },
+      },
+    });
+    odLookUp.pipeline = odPipeline;
+    pipeline.push({ $lookup: odLookUp });
+    pipeline.push({ $unwind: '$odi' });
+    pipeline.push({ $replaceRoot: { newRoot: { $mergeObjects: [ '$$ROOT', '$$ROOT.odi' ] } } });
+    pipeline.push({ $project: { odi: 0 } });
+    // 查询管道
+    const fp = _.cloneDeep(pipeline);
+    pipeline.push({ $sort: { pay_time: 1 } });
+    if (_.isNumber(skip) && skip > 0) pipeline.push(skip);
+    if (_.isNumber(limit) && limit > 0) pipeline.push(limit);
+    const data = await this.model.aggregate(fp);
+    // 总数管道
+    const tp = _.cloneDeep(pipeline);
+    tp.push({ $count: 'total' });
+    const tr = await this.model.aggregate(tp);
+    return { data, total: _.get(_.head(tr), 'total', 0) };
+  }
+
+  /**
+   * 获取本单最大退款金额
+   * @param {String} id 数据id
+   */
+  async getRefundMaxMoney({ id }) {
+    const data = await this.model.findById(id);
+    if (!data) throw new BusinessError(ErrorCode.DATA_NOT_EXIST, '未找到活动订单');
+    const { order_detail, goods } = data;
+    const orderDetail = await this.orderDetailModel.findById(order_detail);
+    if (!orderDetail) throw new BusinessError(ErrorCode.DATA_NOT_EXIST, '未找到订单信息');
+    const moneyDetail = this.ctx.service.util.orderDetail.moneyDetail(orderDetail);
+    let maxMoney = 0;
+    // 判断订单类型,取出不同的实付价格
+    let priceKey;
+    if (_.get(orderDetail, 'type', '0') === '1') priceKey = 'ggrp';
+    else priceKey = 'grp';
+
+    for (const g of goods) {
+      // 该规格总价明细
+      const detail = _.get(moneyDetail, g.spec_id);
+      if (!detail) continue;
+      // 改规格实际支付价格
+      const rp = _.get(detail, priceKey, 0);
+      maxMoney = this.ctx.plus(maxMoney, rp);
+    }
+    // 找total_detail中的act字段,减掉 活动相关 已经退款的金额;
+    const act = _.get(orderDetail, 'total_detail.act', []);
+    const isRefundParts = act.reduce((p, n) => this.ctx.plus(p, n.money), 0);
+    const canRefundParts = this.ctx.minus(maxMoney, isRefundParts);
+    return canRefundParts;
+  }
+
+  /**
+   * 批量返现
+   * @param {Object} body 参数体
+   * @param {Array} body.data 返现数组数据
+   * @property {Number} money 退款金额
+   * @property {String} id 数据id
+   */
+  async toRefund({ data }) {
+    for (const i of data) {
+      const { id, money, no } = i;
+      const max = await this.getRefundMaxMoney({ id });
+      if (this.ctx.minus(max, money) < 0) throw new BusinessError(ErrorCode.DATA_INVALID, `订单号:${no} 超过最大退款金额`);
+
+    }
+    try {
+      const failed = [];
+      for (const i of data) {
+        const { id: act_id, money } = i;
+        const obj = { act_id, money, time: moment().format('YYYY-MM-DD HH:mm:ss') };
+        const actOrder = await this.model.findById(act_id, 'order_detail');
+        const { order_detail } = actOrder;
+        const orderDetail = await this.orderDetailModel.findById(order_detail, 'total_detail');
+        const total_detail = _.get(orderDetail, 'total_detail', {});
+        // 组织退款信息 {order_no,out_refund_no,money,reson}
+        const refundData = await this.toMakeRefundData(i);
+        obj.data = refundData;
+        total_detail.act = [ ..._.get(total_detail, 'act', []), obj ];
+        try {
+          // 退款
+          await this.ctx.service.trade.pay.refund(refundData);
+          this.tran.update('OrderDetail', order_detail, { total_detail });
+        } catch (error) {
+          // next
+          failed.push(obj);
+          console.log(error);
+        }
+      }
+      await this.tran.run();
+    } catch (error) {
+      await this.tran.rollback();
+    } finally {
+      this.tran.clean();
+    }
+
+
+  }
+
+  /**
+   * 根据促销返现数据生成退款数据
+   * @param {Object} data 前端退款数据
+   */
+  async toMakeRefundData(data) {
+    const { id, money } = data;
+    const obj = { money, reason: '促销返现' };
+    const actOrder = await this.model.findById(id);
+    if (!actOrder) throw new BusinessError(ErrorCode.DATA_NOT_EXIST, '未找到活动订单');
+    const orderDetail = await this.orderDetailModel.findById(actOrder.order_detail, 'order');
+    if (!orderDetail) throw new BusinessError(ErrorCode.DATA_NOT_EXIST, '未找到订单信息');
+    const order = await this.orderModel.findById(orderDetail.order, 'pay');
+    if (!order) throw new BusinessError(ErrorCode.DATA_NOT_EXIST, '未找到支付订单信息');
+    const order_no = _.get(order, 'pay.pay_no');
+    if (!order_no) throw new BusinessError(ErrorCode.DATA_NOT_EXIST, '未找到支付单号');
+    obj.order_no = order_no;
+    const out_refund_no = `${order_no}-r-${_.random(10000, 99999)}`;
+    obj.out_refund_no = out_refund_no;
+    return obj;
+  }
+}
+
+module.exports = ActOrderService;

+ 25 - 7
app/service/trade/orderDetail.js

@@ -17,14 +17,30 @@ class OrderDetailService extends CrudService {
     this.afterSaleModel = this.ctx.model.Trade.AfterSale;
     this.tran = new Transaction();
   }
-  async searchOrderTransport({ id }) {
+  async searchOrderTransport({ id, goods_id }) {
     const orderDetail = await this.model.findById(id);
     if (!id) throw new BusinessError(ErrorCode.DATA_NOT_EXIST, '未找到订单信息');
-    const { transport = {} } = orderDetail;
-    const { shop_transport_no: no, shop_transport_type: type } = transport;
-    if (!no || !type) throw new BusinessError(ErrorCode.DATA_NOT_EXIST, '缺少快递信息');
-    const res = await this.ctx.service.util.kd100.search({ no, type });
-    return res;
+    const { transport = [] } = orderDetail;
+    let toSearch = [];
+    if (goods_id) {
+      // 传来指定商品,查有该商品的订单,但是如果没有,就查每一项中是否有 shop_transport_no 和 shop_transport_type
+      // 如果有这俩属性,说明也有单子,也查出来
+      toSearch = transport.filter(f => _.isArray(f.goods) && f.goods.find(fg => fg.goods_id === goods_id));
+      console.log(toSearch);
+      if (toSearch.length <= 0) {
+        toSearch = transport.filter(f => f.shop_transport_no && f.shop_transport_type);
+      }
+    } else {
+      toSearch = transport;
+    }
+    const result = [];
+    for (const t of toSearch) {
+      const { shop_transport_no: no, shop_transport_type: type } = t;
+      if (!no || !type) throw new BusinessError(ErrorCode.DATA_NOT_EXIST, '缺少快递信息');
+      const res = await this.ctx.service.util.kd100.search({ no, type });
+      result.push(res);
+    }
+    return result;
   }
 
   /**
@@ -76,8 +92,10 @@ class OrderDetailService extends CrudService {
         }
       }
       // #endregion
-      tran.insert('OrderDetail', obj);
+      const orderDetail_id = tran.insert('OrderDetail', obj);
       // arr.push(obj);
+      // 添加该商品是否和平台活动有关,做记录
+      await this.ctx.service.trade.actOrder.create(orderDetail_id, obj, tran);
     }
     // await this.model.insertMany(arr);
   }

+ 27 - 21
app/service/util/orderDetail.js

@@ -20,34 +20,37 @@ class OrderDetailService extends CrudService {
     if (_.get(data, 'type', '0') === '1') priceKey = 'ggrp';
     else priceKey = 'grp';
     let detail = this.moneyDetail(data);
+    const at = _.get(detail, 'at', 0);
+    delete detail.at;
     detail = Object.values(detail);
-    const realPay = detail.reduce((p, n) => this.ctx.plus(p, _.get(n, priceKey, 0)), 0);
+    let realPay = detail.reduce((p, n) => this.ctx.plus(p, _.get(n, priceKey, 0)), 0);
+    realPay = this.ctx.minus(realPay, at);
     return realPay;
   }
   /**
    * 按商品计算该订单详情的价格明细
    * @param {Object} data 订单详情数据
    * @return {Object} 返回{
-   *  规格id:{
-   *    sm: 规格正常销售价格(sell_money),
-   *    f: 规格运费(freight),
-   *    bn: 购买数量(buy_num),
-   *    st: 规格正常销售总价(sell_total: sm * bn)
-   *    ft: 规格运费总价(freight_total: f * bn)
-   *    gt: 商品支付原价(goods_total: st + ft)
-   *    dd: {
-   *      key:优惠券id,
-   *      value:优惠价格
-   *    },
-   *    dt: 优惠总价(d_detail的value之和)
-   *    grp:商品实际支付价格(goods_real_pay: gt - dt)
-   *    gsm:规格团购销售价格(group_sell_money)
-   *    gst: 规格团购销售总价(group_sell_total: gsm * bn)
-   *    ggt: 商品团购支付原价(goods_group_total: gst + ft)
-   *    ggrp: 商品团购实际支付价格(goods_group_real_pay: ggt - dt)
-   *
-   *  }
-   * }
+   **  规格id:{
+   **    sm: 规格正常销售价格(sell_money),
+   **    f: 规格运费(freight),
+   **    bn: 购买数量(buy_num),
+   **    st: 规格正常销售总价(sell_total: sm * bn)
+   **    ft: 规格运费总价(freight_total: f * bn)
+   **    gt: 商品支付原价(goods_total: st + ft)
+   **    dd: {
+   **      key:优惠券id,
+   **      value:优惠价格
+   **    },
+   **    dt: 优惠总价(d_detail的value之和)
+   **    grp:商品实际支付价格(goods_real_pay: gt - dt)
+   **    gsm:规格团购销售价格(group_sell_money)
+   **    gst: 规格团购销售总价(group_sell_total: gsm * bn)
+   **    ggt: 商品团购支付原价(goods_group_total: gst + ft)
+   **    ggrp: 商品团购实际支付价格(goods_group_real_pay: ggt - dt)
+   **  },
+   **  at: 活动返现总价(act.reduce)
+   ** }
    */
   moneyDetail(data) {
     if (!data) throw new BusinessError(ErrorCode.DATA_NOT_EXIST, '未找到订单信息');
@@ -78,6 +81,9 @@ class OrderDetailService extends CrudService {
       }
       result[_id] = obj;
     }
+    const act = _.get(data, 'total_detail.act', []);
+    const at = act.reduce((p, n) => this.ctx.plus(p, n.money), 0);
+    result.at = at;
     return result;
   }
 }

+ 2 - 1
app/service/util/rabbitMq.js

@@ -35,7 +35,7 @@ class RabbitmqService extends Service {
       // 声明正常交换器
       await ch.assertExchange(this.task.ex, 'direct', { durable: true });
       // 声明正常队列(配置死信队列设置)
-      const q = await ch.assertQueue(this.task.queue, { exclusive: false, deadLetterExchange: this.task.deadEx, deadLetterRoutingKey: this.task.deadLetterRoutingKey });
+      const q = await ch.assertQueue(this.task.queue, { durable: true, exclusive: false, deadLetterExchange: this.task.deadEx, deadLetterRoutingKey: this.task.deadLetterRoutingKey });
       // 正常队里绑定至正常交换器
       await ch.bindQueue(q.queue, this.task.ex);
     } catch (error) {
@@ -52,6 +52,7 @@ class RabbitmqService extends Service {
       const ch = await mq.conn.createChannel();
       await ch.assertExchange(this.task.deadEx, 'direct', { durable: true });
       const qr = await ch.assertQueue(this.task.deadQueue, {
+        durable: true,
         exclusive: false,
       });
       await ch.bindQueue(qr.queue, this.task.deadEx, this.task.deadLetterRoutingKey);

+ 21 - 0
app/z_router/trade/actOrder.js

@@ -0,0 +1,21 @@
+'use strict';
+// 路由配置
+const path = require('path');
+const regPath = path.resolve('app', 'public', 'routerRegister');
+const routerRegister = require(regPath);
+const rkey = 'actOrder';
+const ckey = 'trade.actOrder';
+const keyZh = '平台活动-订单';
+const routes = [
+  { method: 'post', path: `${rkey}/toRefund`, controller: `${ckey}.toRefund`, name: `${ckey}toRefund`, zh: `${keyZh}批量返现` },
+  { method: 'get', path: `${rkey}/grmm/:id`, controller: `${ckey}.grmm`, name: `${ckey}grmm`, zh: `${keyZh}计算本单最大可以返现的金额` },
+  { method: 'get', path: `${rkey}`, middleware: [ 'dealQuery' ], controller: `${ckey}.index`, name: `${ckey}Query`, 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}/:id`, controller: `${ckey}.update`, name: `${ckey}Update`, zh: `修改${keyZh}` },
+  // { method: 'delete', path: `${rkey}/:id`, controller: `${ckey}.destroy`, name: `${ckey}Delete`, zh: `删除${keyZh}` },
+];
+
+module.exports = app => {
+  routerRegister(app, routes, keyZh, rkey, ckey);
+};

+ 1 - 0
app/z_router/trade/index.js

@@ -7,4 +7,5 @@ module.exports = app => {
   require('./afterSale')(app); // 售后
   require('./cart')(app); // 购物车
   require('./coupon')(app); // 优惠券
+  require('./actOrder')(app); // 活动-订单
 };

+ 2 - 2
app/z_router/trade/orderDetail.js

@@ -7,10 +7,10 @@ const rkey = 'orderDetail';
 const ckey = 'trade.orderDetail';
 const keyZh = '订单详情';
 const routes = [
-  { method: 'get', path: `${rkey}/sot/:id`, controller: `${ckey}.sot`, name: `${ckey}sot`, zh: `${keyZh}查询物流` },
+  { method: 'post', path: `${rkey}/sot`, controller: `${ckey}.sot`, name: `${ckey}sot`, zh: `${keyZh}查询物流` },
   { method: 'get', path: `${rkey}`, controller: `${ckey}.index`, middleware: [ 'dealQuery' ], name: `${ckey}Query`, 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}` },
   { method: 'post', path: `${rkey}/:id`, controller: `${ckey}.update`, name: `${ckey}Update`, zh: `修改${keyZh}` },
   // { method: 'delete', path: `${rkey}/:id`, controller: `${ckey}.destroy`, name: `${ckey}Delete`, zh: `删除${keyZh}` },
 ];