Skip to content

用户管理

用户管理 custommanage

/custommanage/ 商户管理首页商户数据获取

接口:
    /custommanage/
class:
    website/custommanage/views/custommanage.py/IndexView
方法:
    GET
请求:
    无
响应:
    code         M    Int        状态码
    msg          M    String     状态消息
    data         M    Dict       响应内容
        {
            area                M    Dict           层级化的area
                {
                    area_level1_id    M    Dict    一级地理标签id
                        {
                            child            M    List<Dict>  二级地理标签信息列表
                                [
                                    {
                                        area_level2_id: area_level2_name
                                             M                M
                                         二级地理标签id     二级地理标签名称
                                    },
                                    ...
                                ]
                            district_code    M    String      邮政编码
                            name             M    String      一级地理标签名称
                        },
                        ...
                }
            city                M    Dict           城市信息
                {
                    district_code    M    Dict      邮政编码
                        {
                            name     M    String    城市名称
                            area     M    Dict      城市区域信息
                                {
                                    name      M    String        一级区域名称
                                    street    M    List<Dict>    街道信息
                                        [
                                            {
                                                area_level2_id: area_level2_name
                                                       M                M
                                                 二级地理标签id     二级地理标签名称
                                            },
                                            ...
                                        ]
                                }
                        },
                        ...
                }
            station             M    Dict           地区内stations
                {
                    station_id    M    Dict         站点id
                        {
                            distribute_city_ids    M    List<String>    分布的城市邮政编码
                                [
                                    city_id        M    String          城市邮政编码
                                ]
                            district_code          M    String          城市邮政编码
                            key_url                M    String          cms_key
                            name                   M    String          站点名称
                        },
                        ...
                }
            district            M    List<Dict>     地区列表
                [
                    {
                        code    M    String         城市邮政编码
                        name    M    String         城市名称
                    },
                    ...
                ]
            create_employee     M    Dict           区域内的销售经理(信息平台用户)
                {
                    user_id     M    Dict           用户 id
                        {
                            name             M    String          用户名称
                            district_code    M    String/None     城市邮政编码
                        }
                }
            sale_employee       M    Dict           域内的员工
                {
                    user_id     M    Dict           用户 id
                        {
                            name             M    String          用户名称
                            district_code    M    String/None     城市邮政编码
                        }
                }
            salemenu            M    Dict           区域内的销售单
                {
                    salemenu_id: salemenu_name
                        M             M
                    报价单 id     报价单名称
                    ...
                }
            station_salemenu    M    List<Dict>     站点报价单列表
                [
                    {
                        stations_id      M    String     站点 id
                        stations_name    M    String     站点名称
                        salemenu_id      M    String     报价单 id
                        salemenu_name    M    String     报价单名称
                    },
                    ...
                ]
        }
示例:
    请求:
        无
    响应:
        {
    "data":{
        "sale_employee":{
            "2011":{
                "district_code":null,
                "name":"喵喵总仓"
            },
            ...
        },
        "district":[
            {
                "code":"110000",
                "name":"北京市"
            },
            ...
        ],
        "station":{
            "T12469":{
                "distribute_city_ids":[
                    "440300",
                    "441900",
                    "110000"
                ],
                "key_url":"xscs",
                "district_code":"440300",
                "name":"喵喵分仓二"
            },
            ...
        },
        "create_employee":{
            "2011":{
                "district_code":null,
                "name":"喵喵总仓"
            },
            ...
        },
        "city":{
            "110000":{
                "area":{
                    "150100000000":{
                        "street":[
                            {
                                "150100100000":"百善"
                            },
                            ...
                        ],
                        "name":"昌平区"
                    },
                    ...
                },
                "name":"北京市"
            },
            ...
        },
        "station_salemenu":[
            {
                "stations_id":"T12469",
                "salemenu_id":"S8443",
                "salemenu_name":"蔬菜报价单",
                "stations_name":"喵喵分仓二"
            },
            ...
        ],
        "salemenu":{
            "S8443":"蔬菜报价单",
            ...
        },
        "area":{
            "30100000000":{
                "child":[
                    {
                        "30100100000":"华强北"
                    },
                    ...
                ],
                "district_code":"440300",
                "name":"福田区"
            },
            ...
        }
    },
    "msg":"ok",
    "code":0
}
说明:

/custommanage/list (GET) 商户管理-店铺查询

接口:
    /custommanage/list
class:
    website/custommanage/views/custommanage.py/SearchView
描述
    商户管理页面、按照条件查询商户
    绑定本group下的报价单即为本group的商户
方法:
    GET
请求:
    firstMenu           O   Bigint      一级标签
    secondMenu          O   Bigint      二级标签
    stationMenu         O   String      站点id
    num                 O   Int         返回数据量
    page                O   Int         页数
    check_out           O   Int         审核状态
    city                O   Int         城市district_code
    crtManeger          O   Int         开户经理
    saleManager         O   Int         销售经理
    salemenu            O   String      销售单id
    pay_method          O   Int         结算周期
    settle_way          O   Int         结款方式
    search_text         O   String      搜索关键字
    customer_type       O   Int         商户类型(1:店铺,2:个人)
    address_label_id    O   Int         商户标签(无:-1)
    export              O   Int         是否导出excel(1为导出)
响应:
    code                M   Int         返回码、0:成功、其他:失败。
    count               M   Int         返回商户数量
    data                M   List<Dict>  商户信息
        [
            {
                KID                         M   String         商户账户id(user_id)
                cname                       M   String         公司名
                SID                         M   String         商户id(address_id)
                create_time                 M   String         商户注册日期
                username                    M   String         登录账号
                resname                     M   String         店铺名
                settle_way                  M   Int            结款方式
                pay_method                  M   Int            结算周期
                city                        M   String         城市名
                area_l1                     M   String         一级区域     
                area_l2                     M   String         二级区域
                addr_detail                 M   String         店铺地址
                name                        M   String         店铺联系人
                telephone                   M   String         电话
                create_employee_name        M   String         开户经理
                create_employee_phone       M   String         开户经理电话
                sales_employee_name         M   String         销售经理 
                sales_employee_phone        M   String         销售经理电话
                whitelist                   M   Int            是否白名单
                balance                     M   Float          余额
                service_station             M   String         从属站点列表
                address_label               M   String/None    商户标签
                customer_type               M   Int            商户类型(1:店铺,2:个人)
                point                       M   Int            积分
            },
            ...
        ]

示例:
    请求:
        {
            export: 0
            firstMenu: 0
            secondMenu: 0
            stationMenu: 0
            page: 1
            city: 0
            saleMenu: 0
            num: 10
            search_text: 
            address_label_id: 0
        }
    响应:
        {
            "code": 0,
            "data": [{
                "check_out": 1,
                "user_id": 73655,
                "address_label": null,
                "create_time": "2019-08-19",
                "KID": "K073655",
                "customer_type": 1,
                "cname": "商户1",
                "create_employee_phone": "--",
                "resname": "1",
                "telephone": "134",
                "pay_method": "周结",
                "sales_employee_phone": "--",
                "addr_detail": "123",
                "settle_way": "先货后款",
                "create_employee_name": "--",
                "finance_status": 0,
                "whitelist": 1,
                "keycustomer": 0,
                "area_l2": "下沙村",
                "city": "东莞市",
                "area_l1": "石排镇",
                "sales_employee_name": "(待定)",
                "service_station": ["喵喵总仓"],
                "username": "mmsh01",
                "point": 0,
                "balance": 6885.93,
                "name": "测试删除",
                "SID": "S281196"
            }],
            "count": 1
        }

/custommanage/edit 编辑商户信息

接口:
    /custommanage/edit
class:
    website/custommanage/views/custommanage.py/EditView
方法:
    POST
请求:
    id                    M    String    店铺id
    new_cname             O    String    公司名
    telephone             O    String    手机号码
    settle_way            O    Int       结款方式
    paymentName           M    String    结算人
    paymentTelephone      M    String    结算人电话
    check_out             O    Int       审核状态
    freezeState           M    Int       冻结状态  0非冻结 1冻结
    white                 M    Int       白名单状态  0关闭 1开启
    shopName              M    String    店铺名称
    address_label_id      O    Int       商户标签
    receiver              M    String    收货人     
    receiverPhone         M    String    收货人电话
    originalArea          M    Int       邮政编码
    firstArea             M    Bigint    一级地址id
    secondArea            M    Bigint    二级地址id
    shopAddress           M    String    收货地址
    lat                   O    Float     纬度
    lng                   O    Float     经度
    map_address           O    String    地理位置   
    creatEmployeeValue    O    Int       开户经理
    saleEmployeeValue     O    Int       销售经理
    is_credit             O    Int       账期方式  0按周期 1按额度
    # 账期方式按额度
    credit_limit          O    Float     授信额度
    # 账期方式按周期
    effective_date        O    Date      生效时间
    begin_day             O    Int       起始日
    settle_day            O    Int       结算日
    settle_date_type      O    Int       日期纬度  1按下单日期 2按收货日期
    pay_method            O    Int       结款周期 
    settle_remind         O    Int       结算提醒  -1表示不开启,1-7天表示结算日前几天提醒

    status:               O    String    报价单修改状态  编辑和删除
    service_station_id    O    Sting     配送站点
    salemenu_id           O    String    报报价单id
响应:
    code                  M    Int       状态码
    msg                   M    String    状态消息
示例:
    请求:
        {
            id: S312206
            new_cname: 商户1
            telephone: 
            settle_way: 1
            paymentName: 测试删除
            paymentTelephone: 134
            check_out: 1
            freezeState: 0
            white: 1
            shopName: zzz
            address_label_id: -1
            receiver: zzz
            receiverPhone: 13112345678
            originalArea: 440300
            firstArea: 30300000000
            secondArea: 30300500000
            shopAddress: 广东省深圳市福田区华强北街道华新村交行大厦(红荔路)
            lat: 22.549475
            lng: 114.085846
            map_address: 广东省深圳市福田区华强北街道华新村交行大厦(红荔路)
            creatEmployeeValue: 2011
            saleEmployeeValue: 2011
            settle_date_type: 2
            pay_method: 3
            begin_day: 1
            settle_day: 1
            effective_date: 2019-09-16
            settle_remind: -1
            is_credit: 0
        }

        {
            status: deleteSSM
            record_id: 530223
            id: S312206 
        }
    响应:
        {
            code: 0
            msg: "success"
        }
说明:
    该接口再编辑商户信息时,针对不同的内容会分别进行调用

/custommanage/restaurant/add 新建店铺

接口:
    /custommanage/restaurant/add
class:
    website/custommanage/views/custommanage.py/RestaurantAddView
方法:
    POST
请求
    kid                    O    String          user_id
    username               O    String          用户名
    password               O    String          密码
    payer_name             O    String          结算人
    payer_telephone        O    String          结算电话
    telephone              O    String          手机号
    pay_method             O    Int             结算周期
    settle_way             O    Int             结款方式
    finance_status         O    Int             财务状况  0未冻结 1冻结 2未知 -99删除
    whitelist              O    Int             是否白名单
    company_name           O    String          公司名
    restaurant_name        M    String          店铺名称
    receiver_name          M    String          收货人
    receiver_telephone     M    String          收货电话
    district_code          M    String          城市code
    area_level1            M    Int             一级地址id
    area_level2            M    Int             二级地址id
    restaurant_address     M    String          店铺地址
    create_employee_id     O    String          开户经理id
    sale_employee_id       O    String          销售经理id
    salemenu_ids           O    List<String>    报价单id列表
    check_out              O    Bool            审核状态
    is_credit              O    Int             是否授信
    credit_limit           O    Float           授信额度
    lat                    O    Float           纬度  
    lng                    O    Float           经度
    map_address            O    String          地图地址
    settle_date_type       O    Int             结款方式
    address_label_id       O    Int             商户标签id
响应:
    code                   M    Int             状态码
    msg                    M    String          状态消息
    data                   M    Dict            响应内容
        {
            KID            M    String          账户id
            SID            M    String          店铺id
        }
示例:
    请求:
        {
            username: mmsh01
            KID: K073655
            company_name: 商户1
            isEditPassword: false
            telephone: 
            customer_type: 0
            kid: K073655
            settle_way: 1
            payer_name: 测试删除
            payer_telephone: 134
            finance_status: 0
            whitelist: 1
            check_out: 1
            pay_method: 2
            settle_date_type: 1
            is_credit: 0
            lng: 114.088007
            lat: 22.548645
            address_label_id: 1911
            map_address: 广东省深圳市福田区华强北街道红荔路185群星广场
            restaurant_name: zzz
            receiver_name: zzz
            receiver_telephone: 13112345678
            district_code: 440300
            area_level1: 30300000000
            area_level2: 30300500000
            restaurant_address: 广东省深圳市福田区华强北街道红荔路185群星广场
            create_employee_id: 2011
            sale_employee_id: 2011
            salemenu_ids: ["S21329"]
        }
    响应:
        {
            code: 0,
            msg: 'ok',
            data: {
                KID: "K073655"
                SID: "S312206"
            }
        }
说明:

/custommanage/edit


/custommanage/edit


/custommanage/edit


/custommanage/edit


/custommanage/edit


/custommanage/edit