Skip to content

运费迭代

运费迭代

需要改动查询逻辑的地方

  1. station
序号 类名 url
1 CreateOrderView ^openapi/order/create$
2 OrderCreateView ^order/create$
3 OrderBatchCreateView ^order/batch/create$
4 OrderCreateOldView ^order/create_old$
5 FreightSearchView ^freight/search$
6 FreightEditView ^freight/edit$
7 FreightDeleteView ^freight/delete$
8 FreightAddressView ^freight/address$
9 FreightSetDefaultView ^freight/setdefault$
10 OrderServiceTimeView ^order/service_time$
  1. manage
序号 类名 url
1 tools/bind_address_salemenu.py
2 tools/celery_tasks/batch_update_customer.py
3 EditView ^custommanage/edit$
4 CustomerDetailView ^customer/detail
  1. bshop
序号 类名 url
1 AddAdressView ^address/add$
2 RegisterSalemenuView ^salemenu/add$
3 GetOrderCartView ^cart$
4 ConfirmOrderView ^confirm$
5 SubmitOrderView ^submit$
  1. order
序号 类名 url
1 OrderCreateV1View ^create$
2 OrderSupplyUpdate supply/update$
3 OrderDetailsUpdateV1View ^detail/update$
4 OrderDetailsCalculate ^detail/calculate

mongodb-base-xnn_core_product_2-freight改动

原来:

{
    "_id" : "Y002752",
    "edit_user_id" : 3578,
    "id" : "",
    "edit_user_name" : "qucaigou01",
    "name" : "12312",
    "section" : [ 
        {
            "freight" : 20,
            "max" : 200,
            "min" : 0
        }, 
        {
            "freight" : 0,
            "max" : 0,
            "min" : 200
        }
    ],
    "service_station_id" : "T7442",
    "default" : false,
    "group_id" : 339,
    "min_total_price" : 0,
    "edit_time" : ISODate("2019-10-14T18:03:46.896Z")
}

现在:

{
    "_id" : "Y002752",
    "edit_user_id" : 3578,
    "id" : "",
    "edit_user_name" : "qucaigou01",
    "name" : "12312",
    "section" : [ 
        {
            "freight" : 20,
            "max" : 200,
            "min" : 0
        }, 
        {
            "freight" : 0,
            "max" : 0,
            "min" : 200
        }
    ],
    "service_station_id" : "T7442",
    "default" : false,
    "group_id" : 339,
    "min_total_price" : 0,
    "edit_time" : ISODate("2019-10-14T18:03:46.896Z"),
    "pick_up_freight": {         #新增
        "section" : [ 
            {
                "freight" : 20,
                "max" : 200,
                "min" : 0
            }, 
            {
                "freight" : 0,
                "max" : 0,
                "min" : 200
            }
        ],
        "min_total_price" : 0,
    },
    "creator_name" : "qucaigou01",
    "create_time" : ISODate("2019-10-14T18:03:46.896Z"),
}

增加权限(xnn_core_product_2-auth_permissions):

INSERT INTO auth_permission ( `name`, `name_en`, `content_type_id`, `codename`, `level2_id` )
VALUES
    ( '新建运费模板', 'Add Freight', 51, 'add_freight', 17 ),
    ( '删除运费模板', 'Delete Freight', 51, 'delete_freight', 17 );
UPDATE auth_permission 
SET `name` = '编辑运费模板' 
WHERE
    id = 209;
UPDATE auth_permission 
SET `name` = '查看运费模板' 
WHERE
    id = 208;

新增接口:

  1. /station/freight/list 运费模板列表
Method:
    GET
请求:
    无
响应:
    code    M   int     返回码,0表示成功,其他表示错误
    msg     M   string  错误信息
    data    M    dict
        id            M     str     运费模板id             
        name          M     str     运费模版名称
        create_time   M    str      创建时间
        creator_name  M    str      创建者名称
        edit_user_name   M    str    最后编辑者名称
        edit_time     M     str      最后编辑时间
        default       M     bool     是否为默认模板
  1. /station/freight/address/list 运费模板商户列表
Method:
    GET
请求:
    无  
响应:
    code    M   int     返回码,0表示成功,其他表示错误
    msg     M   string  错误信息
    data    M    list
        {
        address_id       M     int        商户id
        address_name     M     str        商户名字
        region_code      M     int        市id
        region_name      M     str        市名
        area_id          M     int        区id
        area_name        M     str        区名
        freight_id       M     str        运费id
        freight_name     M     str        运费名
        }

  1. /station/freight/detail 运费详情
Method:
    GET
请求:
    id      M   str      运费模板的id  
响应:
    code    M   int     返回码,0表示成功,其他表示错误
    msg     M   string  错误信息
    data    M    dict
        "id": Y000001             
        "name": 默认运费模版
        "default": True
        "delivery_freight": {       M       配送运费
            "section" : [                 运费区间
                {
                    "freight" : 20,        运费
                    "max" : 200,           运费区间上限价格
                    "min" : 0              运费区间下限价格
                }, 
            ],
            "min_total_price" : 0,          起送金额
        },
        "pick_up_freight": {         M       自提运费
            "section" : [ 
                {
                    "freight" : 20,
                    "max" : 200,
                    "min" : 0
                }, 
            ],
            "min_total_price" : 0,
        }, 
  1. /station/freight/edit_new 修改运费模板
Method:
    POST
请求:
    "id": Y000001             
    "name": 默认运费模版
    "delivery_freight": {       M
        "section" : [ 
            {
                "freight" : 20,
                "max" : 200,
                "min" : 0
            }, 
        ],
        "min_total_price" : 0,
    },
    "pick_up_freight": {         M
        "section" : [ 
            {
                "freight" : 20,
                "max" : 200,
                "min" : 0
            }, 
        ],
        "min_total_price" : 0,
    }, 
    "address_ids": [123123,21312312]
响应:
    code    M   int     返回码,0表示成功,其他表示错误
    msg     M   string  错误信息
    data    M   null
  1. /station/freight/create 创建运费模板
Method:
    POST
请求:          
    "name": 默认运费模版
    "delivery_freight": {       M
        "section" : [ 
            {
                "freight" : 20,
                "max" : 200,
                "min" : 0
            }, 
        ],
        "min_total_price" : 0,
    },
    "pick_up_freight": {         M
        "section" : [ 
            {
                "freight" : 20,
                "max" : 200,
                "min" : 0
            }, 
        ],
        "min_total_price" : 0,
    }, 
    "address_ids": [123123,21312312]
响应:
    code    M   int     返回码,0表示成功,其他表示错误
    msg     M   string  错误信息
    data    M   null
  1. /station/freight/address/bind 运费模板绑定商户
Method:
    POST
请求:
    freight_id      M   str      运费模板的id
    address_ids     M   list     商户id
响应:
    code    M   int     返回码,0表示成功,其他表示错误
    msg     M   string  错误信息
    data    M   null

开发时间

1. 改动查询逻辑    4天
2. 接口开发        2.5天
3. 刷数据脚本      1天
总计6.5天