Skip to content

冲账优化(MA)

tpad : https://www.tapd.cn/20029161/prong/stories/view/1120029161001000416

新增到账信息(修改)

新增过滤逻辑:取kid,查询这些kid的所有station_id,和本账号可见站点对比,全部都可用,就添加成功,否则返回哪些kid不能用
接口名:/strike/balance/add
Method:POST
请求:
    arrival_id          M       str     到账账号
    arrival_method      M       str     到账渠道
    arrival_money       M       str     到账金额
    arrival_time        M       str     到账日期
    deal_code           M       str     到账凭证号
    kid                 M       str     kid
    remark              M       str     备注


响应:
    code    M   int     返回码,0表示成功,其他表示错误
    msg     M   string  错误信息
    data    M   list    数据;
示例:
request: http://manage.dev.guanmai.cn/finance/strike/balance/add
post:
    {
        "arrival_time": "2017-08-23",
        "arrival_method": "微信对私",
        "arrival_id": "wechat",
        "deal_code": "4009732001201708013940321961",
        "kid": "44981",
        "remark": "1",
        "arrival_money": "1"
    }

response:

    {"code": 0, "msg": "ok", "data": null}
    {"code": 1, "msg": "存在不是本账号的kids:['K0123', 'K0234']", "data": null}

冲账订单查询(修改)

新增过滤逻辑:增加查询订单条件,时间和本账号的可见站点
接口名:/finance/order/can_strike_balance
Method:GET
请求:
    kids                M       str     kid
    (新增)start_time      M       date    开始时间,格式要求:年-月-日 例如:2017-06-01
    (新增)end_time        M       date    结束时间,格式要求:年-月-日 例如:2017-06-01
    (新增)type            M       str     1:下单时间,2:收货时间


响应:
    code    M   int     返回码,0表示成功,其他表示错误
    msg     M   string  错误信息
    data    M   list    数据;
示例:

response:

{
  "code": 0,
  "msg": "ok",
  "data": {
    "orders": [
      {
        "total_price": 1438.14,
        "station_id": "T3217",
        "origin_total_price": 1438.14,
        "real_price": 1445.83,
        "freight": 0.0,
        "customer": {
          "receiver_phone": "18998507773",
          "address_sign_id": "30600300000",
          "receiver_name": "陈",
          "receive_end_time": "2017-08-21 08:30",
          "extender": "{\"order_pay_method\": 2, \"resname\": \"HJ\"}",
          "uid": "44981",
          "receive_begin_time": "2017-08-21 08:00",  # 收货时间。
          "supply_station_id": "T3217",
          "address": "福城街道办",
          "address_id": "39070"
        },
        "status": 5,
        "details": [
          {
            "version": 138,
            "id": "D1931255"
          }
        ],
        "remark": null,
        "district_code": "440300",
        "total_pay": 1445.83,
        "date_time": "2017-08-20T21:49:48.312", # 下单时间
        "id": "PL636603",
        "sale_money": 1445.83,
        "abnormal_money": 0.0,
        "margin": -1445.83,
        "real_pay": 0.0
      },
      ]
    }
}