更新日志
2023-06-09 (Draft)
徐州仓库条码枪逻辑
-
条码枪扫入钢板型号的二维码,通过 TCP 协议发送至 cranemagic-tcp-server。
-
cranemagic-servers-tcp 接收钢板型号后,生成发送给 MQTT Broker 的 Payload 如下:
JSON{ "type": "scanner_status", "steel_model": "xxxxxxxxx", "current_time": "%Y-%m-%d %H:%M:%S", "client_address": "IP:PORT" }其中
type字段为枚举值,当前值scanner_status是标识当前有扫码枪扫入钢板型号的行为,另一值为scanner_inputs,稍后详解其作用。将本 Payload 发送至 MQTT Broker 下的 2 个 Topic:
iot/scanner_inputs(用以与 cranmegic-service-mqtt 服务交互)和web/scanner_status(用以向前端报告当前有扫码枪扫入钢板型号的行为)。 -
针对 MQTT 消息的处理
-
前端处理
前端弹出 notification,报告当前有扫码枪扫入钢板型号的行为。
-
cranemagic-service-mqtt 处理
接收到条码枪扫入的钢板型号,验证钢板型号是否存在(目前的方式是查库位表中的
comment)。查询对中平台 In 的材料状况:
如果对中平台 In 没有材料,则:
-
向对中平台 In 新增相应钢板型号的材料。
-
获取该钢板型号对应的仓储位信息,请求 cranemagic-service-webapi 服务的
generateCraneTaskHandingWithoutAuth接口,得到生成路径。 -
并通过 MQTT Topic
web/scanner_status前端报告当前可以执行入库操作,具体 Payload 如下:JSON{ "type": "scanner_inputs", "steel_model": "xxxxxxxxx", "current_time": "%Y-%m-%d %H:%M:%S", "client_address": "IP:PORT", "action": "ready_for_inputs", "message": "", "crane_id": "85", "warehouse_id": "DP-Kunshan", "material_id": "idxxxxxxxx", "area_id": "kwxx", "crane_control_payload": { // Crane_Control 的 Payload } } -
前端弹出 notification,点击可请求 cranemagic-service-webapi 服务的
mqttPublishCraneControl接口快速执行入库操作。
如果对中平台 In 有且仅有 1 件材料,则:
-
若钢板型号一致,则不做改动;若钢板型号不一致,删除原先 In 库位中的钢板,并向对中平台 In 新增相应钢板型号的材料。
-
获取该钢板型号对应的仓储位信息,请求 cranemagic-service-webapi 服务的
generateCraneTaskHandingWithoutAuth接口,得到生成路径。 -
并通过 MQTT Topic
web/scanner_status前端报告当前可以执行入库操作,具体 Payload 如下:JSON{ "type": "scanner_inputs", "steel_model": "xxxxxxxxx", "current_time": "%Y-%m-%d %H:%M:%S", "client_address": "IP:PORT", "action": "ready_for_inputs", "message": "the same steel_model" / "removed the older material", "crane_id": "85", "warehouse_id": "DP-Kunshan", "material_id": "idxxxxxxxx", "area_id": "kwxx", "crane_control_payload": { // Crane_Control 的 Payload } } -
前端弹出 notification,点击可请求 cranemagic-service-webapi 服务的
mqttPublishCraneControl接口快速执行入库操作。
如果对中平台 In 有大于 1 件材料,则:
-
通过 MQTT Topic
web/scanner_status询问前端是否需要清除 In 库位的所有钢板,具体 Payload 如下: -
前端弹出 notification,...
-
-