Skip to content

迭代版本

数据库改动

把原来的采购任务条目表改名叫采购任务 原来采购任务表去掉

CREATE TABLE `tbl_purchase_task` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `order_id` varchar(20) DEFAULT '' COMMENT '订单号',
  `sku_id` varchar(20) NOT NULL,
  `sale_sku_id` varchar(20) DEFAULT NULL,
  `status` int(11) NOT NULL COMMENT '状态码',
  `release_id` int(11) NOT NULL COMMENT '发布ID',
  `plan_amount` float NOT NULL COMMENT '计划采购量',
  `purchase_amount` float NOT NULL DEFAULT '0' COMMENT '已采购',
  `create_time` datetime NOT NULL COMMENT '创建时间',
  `modify_time` datetime NOT NULL COMMENT '编辑时间',
  `extra_1` int(11) DEFAULT NULL COMMENT '预留字段1',
  `extra_2` varchar(128) DEFAULT NULL COMMENT '预留字段2',
  `station_id` varchar(16) NOT NULL DEFAULT '',
  `time_config_id` varchar(16) NOT NULL DEFAULT '',
  `cycle_start_time` datetime NOT NULL,
  `release_time` datetime DEFAULT NULL COMMENT '编辑时间',
  `purchase_sheet_id` varchar(64) DEFAULT NULL,
  `settle_supplier_id` varchar(20) DEFAULT NULL,
  `address_id` varchar(16) DEFAULT NULL,
  `resname` varchar(100) DEFAULT NULL,
  `sale_unit_name` varchar(16) DEFAULT NULL,
  `std_unit_name` varchar(16) DEFAULT NULL,
  `sale_ratio` float DEFAULT NULL,
  `sku_name` varchar(32) DEFAULT NULL,
  `spu_name` varchar(32) DEFAULT NULL,
  `price` int(11) DEFAULT NULL,
  `remark` varchar(128) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=355735 DEFAULT CHARSET=utf8 COMMENT='采购任务表';

接口改动

  1. 采购任务搜索 /station/task/purchase/search

    • 增加过滤项:订单状态(多选)
    • 展示改为SKU聚合,以SKU ID排序分页

      Method GET 请求 category1_ids O list 一级分类 category2_ids O list 二级分类 pinlei_ids O list 品类 settle_supplier_id O string 供应商ID time_config_id M string 时间配置ID cycle_start_time M datetime 周期开始时间 status O int 任务状态 order_status O list 订单状态 from O string 分页cursor limit O int 分页每页数量,默认10 reverse O bool 是否向前翻页 q O string 搜索内容 响应 code M int 返回码,0表示成功,其他表示错误 msg M string 错误信息 data M string 返回json数据

      [
          {
              "__cursor"  M   string  分页cursor
              "sku_id"    M   string  sku_id
              "name"  M   string  sku名
              "category1_name"    M   string  一级分类名
              "category2_name"    M   string  二级分类名
              "pinlei_name"   M   string  品类名
              "std_unit_name" M   string  基本单位
              "sale_ratio"    M   float   销售比例
              "sale_unit_name"    M   string  销售单位名
              "plan_purchase_amount"   M   float   计划采购量
              "already_purchase_amount"   M   float    已采购量
              "release_time"   O   datetime   发布时间
              "release_id"   O   int   发布ID
              "status"    M   int 状态码 1未发布,2已发布,3已完成,4已删除
              "price" M   float   报价
              "settle_supplier_id"    M   供应商ID
              "settle_supplier_name"  M   供应商名字
              "purchaser_name"    O   采购员名字
              "tasks": [ M   list   采购任务
                  "resname"   O   商户名
                  "order_id"  O   订单号
                  "order_status"  O   订单状态
                  "plan_purchase_amount"  O   计划采购量
                  "remark"    O   备注
                  "settle_supplier_id"    M   供应商ID
                  "settle_supplier_name"  M   供应商名字
                  "purchaser_name"    O   采购员名字
              ]
          }
      ]
      
  2. 采购任务导出 /station/task/purchase/export

    Method
        GET
    请求
        category1_ids   O   list    一级分类
        category2_ids   O   list    二级分类
        pinlei_ids   O   list    品类
        settle_supplier_id  O   string  供应商ID
        time_config_id    M   string  时间配置ID
        cycle_start_time  M   datetime  周期开始时间
        status  O   int 任务状态
        order_status    O   int 订单状态
        type    M   导出类型1:默认导出,2:二维表导出,3按供应商导出
    响应
        code    M   int     返回码,0表示成功,其他表示错误
        msg     M   string  错误信息
        data    M   string  返回excel与现有表格一致
    
  3. 采购任务打印 /station/task/purchase/print

    Method
        GET
    请求
        category1_ids   O   list    一级分类
        category2_ids   O   list    二级分类
        pinlei_ids   O   list    品类
        settle_supplier_id  O   string  供应商ID
        time_config_id    M   string  时间配置ID
        cycle_start_time  M   datetime  周期开始时间
        status  O   int 任务状态
        order_status    O   int 订单状态
        type    M   导出类型1:默认打印,2:打印明细
    响应
        code    M   int     返回码,0表示成功,其他表示错误
        msg     M   string  错误信息
        data    M   string  返回数据与现有接口一致
    
  4. 采购条目大接口 /station/task/purchase/item

    Method
        GET
    请求
        sku_id  M   string  sku ID
        "time_config_id"    M   string  时间配置ID
        "cycle_start_time"  M   datetime  周期开始时间
    响应
        code    M   int     返回码,0表示成功,其他表示错误
        msg     M   string  错误信息
        data    M   string  返回数据与现有接口一致
    
  5. 生成采购单 /station/task/purchase/create_sheet

    Method
        POST
    请求
        time_config_id    M   string  时间配置ID
        cycle_start_time  M   datetime  周期开始时间
        release_ids   O   list    选中任务的发布ID
        [int 任务ID]
    响应
        code    M   int     返回码,0表示成功,其他表示错误
        msg     M   string  错误信息
        data    M   string  返回json数据
        [   M   list    采购单ID列表
            int 采购单ID
        ]
    
  6. 修改供应商可选项 /station/task/purchase/settle_suppliers_can_change

    Method
        GET
    请求
        sku_id  M   string  sku ID
        "time_config_id"    M   string  时间配置ID
        "cycle_start_time"  M   datetime  周期开始时间
    响应
        code    M   int     返回码,0表示成功,其他表示错误
        msg     M   string  错误信息
        data    M   string  返回数据与现有接口一致
        [
            {
                "id"    M   string  供应商ID
                "name"  M   string  供应商名
            }
        ]