Skip to content

分拣绩效

数据库

物料表 material [mongodb]

{
    _id string 物料ID
    name string 物料名
    std_unit_name string 基本单位
    desc string 物料描述
    group_id int group ID
    status int 状态 (1:删除;2:正常)
    create_time datetime 创建时间
    modify_time datetime 修改时间
}

物料成品表 material_product [mongodb]

{
    _id string 成品ID
    name string 成品名
    std_unit_name string 基本单位
    sale_unit_name string 成品单位
    desc string 成品描述
    station_id int 站点ID
    sale_ratio float 规格
    quality string 品质
    level string 级别
    status int 状态 (1:删除;2:正常)
    create_time datetime 创建时间
    modify_time datetime 修改时间
}

领料记录表 material_requisition [mongodb]

{
    _id ObjectId ID
    cycle_start_date datetime 周期开始时间所属日期
    time_config_id string 时间配置ID
    station_id string 站点ID
    material_id string 物料id
    material_name string 物料名
    material_unit_name string 物料单位
    amount int 领取数量
    receiptor int 领取人ID
    operator int 操作员ID
    create_time datetime 领取时间
    modify_time datetime 修改时间
    remark string 备注
    status int 状态(1:删除;2:正常)
}

领料退还表 material_return [mongodb]

{
    _id ObjectId ID
    cycle_start_date datetime 周期开始时间所属日期
    time_config_id string 时间配置ID
    station_id string 站点ID
    material_id string 物料id
    material_name string 物料名
    material_unit_name string 物料单位
    amount int 退还数量
    returnee int 归还者ID
    operator int 操作员ID
    reason string 退还原因
    create_time datetime 领取时间
    modify_time datetime 修改时间
    status int 状态(1:删除;2:正常)
}

称重数据表 material_weigh [mongodb]

{
    _id string 编号
    cycle_start_date datetime 周期开始时间所属日期
    time_config_id string 时间配置ID
    station_id string 站点ID
    material_id string 物料id
    material_name string 物料名
    material_unit_name string 物料单位
    product_id string 成品ID
    product_name string 成品名称
    product_unit_name 成品单位
    product_ratio 成品规格
    weight int 称重数
    operator int 操作员ID
    remark string 备注(存放产区信息)
    create_time datetime 称重时间
    modify_time datetime 修改时间
    inspector string 验收员
    inspect_time datetime 验收时间
    status int 状态 (1:删除;2:正常;3:已验收)
}

接口

已有接口

/station/login 登录接口

接口名: /station/login
Method: POST
请求:
    username M string 用户名
    password M string 密码
响应:
    code M int 0为成功,其它为失败
    msg M string 提示信息

/station/logout 退出

接口名: /station/logout
Method: POST
请求:
    无
响应:
    code M int 0为成功,其它为失败
    msg M string 提示信息

/station/service_time 拉取站点服务时间配置

/station/service_time 见station接口下的服务时间配置接口

/station/service_time 拉取服务时间配置的具体下单时间

/station/service_time?date_detail=true&cycle_days=2&id=ST001 见station接口下的服务时间配置接口

/station/users 拉取站点用户

接口名: /station/users
Method: GET
请求:
    无
响应:
    code M int 0为成功,其它为失败
    msg M string 错误提示信息
    data M string 站点的用户数据
示例:
    /station/users
    {
        code: 0,
        msg: "ok",
        data: [{
            is_active: 1, 是否有效
            name: "", 用户名
            id: 2, 用户ID
            telephone: "", 电话
            department_id: null, 部门ID
            role_id: null, 角色ID
            email: "", 邮箱
            username: "k10admin" 用户名
        }]
    }

物料管理

/material/create 创建物料

接口名: /material/create
Method: POST
请求:
    name M string 物料名称
    desc M string 物料描述
    std_unit_name M string 基本单位
响应:
    code M int 0为成功,其它为失败
    msg M string 错误提示信息
    data M string 物料ID

/material/update 更新物料

接口名: /material/update
Method: POST
请求:
    id M string 物料 ID
    name O string 物料名称
    desc O string 物料描述
响应:
    code M int 0为成功,其它为失败
    msg M string 错误提示信息

/material/delete 删除物料

接口名: /material/delete
Method: POST
请求:
    id M string 物料ID
响应:
    code M int 0为成功,其它为失败
    msg M string 错误提示信息

/material/index 获取物料首页

接口名: /material/index
Method: GET
请求:
    text O string 物料名
响应:
    code M int 0为成功,其它为失败
    msg M string 错误提示信息
    data M list 返回的物料信息
    [{
        'id' M string 物料ID
        'name' M string 物料名
        'desc' M string 描述
        'std_unit_name' M string 单位
        'product_num' M int 成品规格数
    }]

/material/list 获取物料列表

接口名: /material/list
Method: GET
请求:
   无
响应:
   code M int 0为成功,其它为失败
   msg M string 错误提示信息
   data M list 返回的物料信息
   [{
       'id' M string 物料ID
       'name' M string 物料名
       'desc' M string 描述
       'std_unit_name' M string 单位
   }]

成品管理

/material/product/create 创建成品

接口名: /material/product/create
Method: POST
请求:
    name M string 成品名称
    desc M string 成品描述
    material_id M string 物料ID
    sale_unit_name M string 单位
    sale_ratio M float 规格
    quality M string 品质
    level M string 级别
响应:
    code M int 0为成功,其它为失败
    msg M string 错误提示信息
    data M string 成品ID

/material/product/update 更新成品

接口名: /material/product/update
Method: POST
请求:
    id M string 物料 ID
    name O string 物料名称
    desc O string 物料描述
    sale_unit_name O string 单位
    sale_ratio O float 规格
    quality O string 品质
    level O string 级别
响应:
    code M int 0为成功,其它为失败
    msg M string 错误提示信息

/material/product/delete 删除成品

接口名: /material/product/delete
Method: POST
请求:
    id M string 成品ID
响应:
    code M int 0为成功,其它为失败
    msg M string 错误提示信息

/material/product/list 获取成品列表

接口名: /material/product/list
Method: GET
请求:
    material_id M string 成品ID
响应:
    code M int 0为成功,其它为失败
    msg M string 错误提示信息
    data M list 返回的物料信息
    [{
        'id' M string 成品ID
        'name' M string 成品名
        'desc' M string 描述
        'material_id' M string 物料ID
        'std_unit_name' M string 基本单位
        'sale_unit_name' M string 单位
        'sale_ratio' M float 规格
        'quality' M string 品质
        'level' M string 级别
    }]

/material/product/export 导出成品信息

接口名: /material/product/export
Method: GET
请求:
    text O string 成品名
响应:
    Excel文件

领料记录

/material/requisition/create 创建领料记录

接口名: /material/requisition/create
Method: POST
请求:
    cycle_start_time M string 周期开始时间
    time_config_id M string 服务时间配置id
    material_id M string 物料ID
    amount M int 领取数量
    receiptor M int 领取人ID
    remark O string 备注信息
响应:
    code M int 0为成功,其它为失败
    msg M string 错误提示信息
    data M string 创建的领料记录ID
逻辑:
    验证material_id receiptor是否有效
    创建领取记录
    返回领料记录ID

/material/requisition/update 修改领料记录

接口名: /material/requisition/update
Method: POST
请求:
    id M string 领料记录ID
    amount M int 新的领取数量
响应:
    code M int 0为成功,其它为失败
    msg M string 错误提示信息
逻辑:
    查询领料记录是否存在
    不存在返回错误提示 领取记录不存在
    存在则判断领取数量是增大还是减小
    减小时需要删除对应的称重记录和退还记录
    修改领取数量
    返回修改结果

/material/requisition/search 搜索领料记录

接口名: /material/requisition/search
Method: GET
请求:
    cycle_start_time M string 周期开始时间
    time_config_id M string 服务时间配置id
    text M string 物料名或领取人
响应:
    code M int 0为成功,其它为失败
    msg M string 错误提示信息
    data M list 领取记录列表
    [{
        id M string 记录ID
        material_id M string 物料ID
        material_name M string 物料名称
        material_unit_name M string 物料单位
        amount M int 领取数量
        receiptor_id M int 领取人ID
        receiptor_name M string 领取人名称
        operator_id M int 操作员ID
        operator_name M string 操作员名称
        create_time M string 领取时间
    }]

/material/requisition/get 获取领料记录

接口名: /material/requisition/get
Method: GET
请求:
    cycle_start_time M string 周期开始时间
    time_config_id M string 服务时间配置id
响应:
    code M int 0为成功,其它为失败
    msg M string 错误提示信息
    data M list 领取记录列表
    [{
        id M string 记录ID
        material_id M string 物料ID
        material_name M string 物料名称
        material_unit_name M string 物料单位
        amount M int 领取数量
        weight M int 称重数
        remarks M list 备注信息列表
        receiptor_id M int 领取人ID
        receiptor_name M string 领取人名称
        operator_id M int 操作员ID
        operator_name M string 操作员名称
        create_time M string 领取时间
    }]
逻辑:
    获取登录用户的领取记录

/material/requisition/statistics 领料记录统计

接口名: /material/requisition/statistics
Method: GET
请求:
    start_time M string 周期开始时间
    start_time M string 结束时间
    time_config_id M string 服务时间配置id
    type M string 类型(whole整体数据;user按人员查看
响应:
    code M int 0为成功,其它为失败
    msg M string 错误提示信息
    data M list 领取记录列表
    [{
        cycle_date M string 周期时间
        material_id M string 物料ID
        material_name M string 物料名称
        material_unit_name M string 物料单位
        amount M int 领取数量
        weight M int 产出数量
        receiptor_id O int 领取人ID
        receiptor_name O string 领取人名称
    }]

/material/requisition/delete 删除领料记录

接口名: /material/requisition/delete
Method: POST
请求:
    id M string 领料记录ID
响应:
    code M int 0为成功,其它为失败
    msg M string 错误提示信息
逻辑:
    查询领料记录是否存在
    不存在返回错误提示 领取记录不存在
    删除对应的称重记录和退还记录
    返回修改结果

退还记录

/material/return/create 新建退还记录

接口名: /material/return/create
Method: POST
请求:
    cycle_start_time M string 周期开始时间
    time_config_id M string 服务时间配置id
    material_id M string 物料id
    amount M int 退还数量
    returnee M int 退还人
    reason O string 退还原因
响应:
    code M int 0为成功,其它为失败
    msg M string 错误提示信息
    data M string 创建的退还记录ID
逻辑:
    验证对应的领料记录是否存在
    不存在提示错误  领取记录不存在
    存在则查询退还记录是否存在
    存在则两次退还数量相加,判断退还数量是否大于领取数量-称重数量
    大于提示错误,否则更新退还记录
    返回退还记录ID

/material/return/update 修改退还记录

接口名: /material/return/update
Method: POST
请求:
    id M string 退还记录ID
    amount M int 退还数量
响应:
    code M int 0为成功,其它为失败
    msg M string 错误提示信息
逻辑:
    查询退还记录是否存在
    不存在返回错误提示
    存在则两次退还数量相加,判断退还数量是否大于领取数量
    大于提示错误,否则更新退还记录

/material/return/search 搜索退还记录

接口名: /material/return/search
Method: GET
请求:
    cycle_start_time M string 周期开始时间
    time_config_id M string 服务时间配置id
    text M string 物料名或退还人
响应:
    code M int 0为成功,其它为失败
    msg M string 错误提示信息
    data M list 领取记录列表
    [{
        id M string 记录ID
        material_id M string 物料ID
        material_name M string 物料名称
        material_unit_name M string 物料单位
        amount M int 退还数量
        returnee_id M int 退还人ID
        returnee_name M string 退还人名称
        operator_id M int 操作员ID
        operator_name M string 操作员名称
        create_time M string 退还时间
    }]

/material/return/delete 删除退货记录

接口名: /material/return/delete
Method: POST
请求:
    id M string 退还记录ID
响应:
    code M int 0为成功,其它为失败
    msg M string 错误提示信息
逻辑:
    查询退还记录是否存在
    不存在返回错误提示 退还记录不存在
    删除退还记录

称重记录

/material/weigh/create 新建称重记录

接口名: /material/weigh/create
Method: POST
请求:
    cycle_start_time M string 周期开始时间
    time_config_id M string 服务时间配置id
    material_id M string 物料id
    product_id M string 规格ID
    weight M int 称重数量
    inspector O string 验收员
    remark O string 备注信息(产地信息)
    times O int 次数(默认值1)
响应:
    code M int 0为成功,其它为失败
    msg M string 错误提示信息
    data M list 创建的称重编码列表
逻辑:
    验证对应的领料记录是否存在
    不存在提示错误  领取记录不存在
    判断称重记录的称重数是否大于领取数
    创建称重记录
    返回称重编码

/material/weigh/update 修改称重记录

接口名: /material/weigh/update
Method: POST
请求:
    id M string 称重编码id
    weight M int 称重数量
响应:
    code M int 0为成功,其它为失败
    msg M string 错误提示信息
逻辑:
    验证对应的称重记录是否存在
    不存在提示错误  称重记录不存在
    判断称重记录的称重数是否大于领取数
    更新称重记录,已验收的记录不能修改,提示错误

/material/weigh/search 搜索称重记录

接口名: /material/weigh/search
Method: GET
请求:
    cycle_start_time M string 周期开始时间
    time_config_id M string 服务时间配置id
    material_id O string 物料id
    operator_id O int 作业人ID
响应:
    code M int 0为成功,其它为失败
    msg M string 错误提示信息
    data M list 称重记录列表
    [{
        id M string 记录ID
        product_id M string 成品ID
        product_name M string 成品名称
        product_unit_name M string 成品单位
        product_ratio M int 成品规格
        product_quality M string 成品品质
        product_level M string 成品级别
        material_id M string 物料ID
        material_name M string 物料名称
        material_unit_name M string 物料名称
        status M int 状态(2:正常;3:已验收)
        operator_id M int 操作员ID
        operator_name M string 操作员名称
        weight M int 称重数量
    }]
逻辑:
    搜索称重记录

/material/weigh/get 获取称重记录

接口名: /material/weigh/get
Method: GET
请求:
    cycle_start_time M string 周期开始时间
    time_config_id M string 服务时间配置id
    material_id M string 物料id
响应:
    code M int 0为成功,其它为失败
    msg M string 错误提示信息
    data M dict 称重记录列表
    {
        total_amount M int 总的领料数
        total_weight M int 总的称重数
        list M list 称重数据列表
        [{
            id M string 记录ID
            product_id M string 成品ID
            product_name M string 成品名称
            product_unit_name M string 成品单位
            product_ratio M int 成品规格
            product_quality M string 成品品质
            product_level M string 成品级别
            material_id M string 物料ID
            material_name M string 物料名称
            material_unit_name M string 物料名称
            operator_id M int 操作员ID
            operator_name M string 操作员名称
            weight M int 称重数量
            remark M string 备注信息
        }]
    }
逻辑:
    获取登录用户的称重记录

/material/weigh/statistics 称重记录统计

接口名: /material/weigh/statistics
Method: GET
请求:
    start_time M string 开始周期
    end_time M string 结束周期
    time_config_id M string 服务时间配置id
响应:
    code M int 0为成功,其它为失败
    msg M string 错误提示信息
    data M list 称重记录列表
    [{
        cycle_date M string 周期日期
        product_id M string 成品ID
        product_name M string 成品名称
        product_unit_name M string 成品单位
        product_ratio M int 成品规格
        product_quality M string 成品品质
        product_level M string 成品级别
        product_num M int 成品数量
        product_weight M int 称重数量
        material_id M string 物料ID
        material_name M string 物料名称
        material_unit_name M string 物料名称
        operator_id M int 操作员ID
        operator_name M string 操作员名称
    }]
逻辑:
    称重记录统计

/material/weigh/query 查询称重记录

接口名: /material/weigh/query
Method: GET
请求:
    id M string 标签编码
响应:
    code M int 0为成功,其它为失败
    msg M string 错误提示信息
    data M list 称重记录
    {
        id M string 记录ID
        product_id M string 成品ID
        product_name M string 成品名称
        product_unit_name M string 成品单位
        product_ratio M int 成品规格
        product_quality M string 成品品质
        product_level M string 成品级别
        material_id M string 物料ID
        material_name M string 物料名称
        material_unit_name M string 物料名称
        status M int 状态(1:删除;2:正常;3:已验收)
        operator_id M int 操作员ID
        operator_name M string 操作员名称
        weight M int 称重数量
        inspector M string 验收人
        remark M string 备注信息
    }

/material/weigh/check 验收称重记录

接口名: /material/weigh/check
Method: POST
请求:
    ids M list 称重记录ID列表
响应:
    code M int 0为成功,其它为失败
    msg M string 错误提示信息
逻辑:
    查询称重记录是否存在
    不存在返回错误提示 称重记录不存在
    修改称重记录状态为已验收

/material/weigh/delete 删除称重记录

接口名: /material/weigh/delete
Method: POST
请求:
    id M string 称重记录ID
响应:
    code M int 0为成功,其它为失败
    msg M string 错误提示信息
逻辑:
    查询称重记录是否存在
    不存在返回错误提示 称重记录不存在
    删除称重记录,已验收的记录不能删除,提示错误