软件工程实验6 UML图

组长&组员 0107

1.UML类图

类描述

类名 属性 方法
User user_id, username, password_hash, email, phone, role, warehouses register(), login(), updateUserInfo(), deleteUser()
Warehouse warehouse_id, warehouse_name, warehouse_location, user, inventories createWarehouse(), updateWarehouse(), deleteWarehouse(), listWarehouses()
Product product_id, product_name, product_code, product_description, inventories addProduct(), updateProduct(), deleteProduct(), listProducts()
Inventory inventory_id, warehouse, product, quantity, threshold, stockMovements, barcodeScans, inventoryAlerts addInventoryRecord(), updateInventoryRecord(), deleteInventoryRecord(), listInventory()
StockMovement movement_id, warehouse, product, movement_type, quantity, operator, movement_date addStockMovement(), listStockMovements()
BarcodeScan scan_id, warehouse, product, scan_type, operator, scan_date addBarcodeScan(), listBarcodeScans()
InventoryAlert alert_id, inventory, alert_message, alert_date addInventoryAlert(), listInventoryAlerts(), clearInventoryAlert()
manages
1
0..*
contains
1
0..*
tracks
1
1
logs
1
0..*
scans
1
0..*
alerts
1
0..*
User
-int user_id
-String username
-String password_hash
-String email
-String phone
-String role
-List warehouses
+register()
+login()
+updateUserInfo()
+deleteUser()
Warehouse
-int warehouse_id
-String warehouse_name
-String warehouse_location
-User user
-List inventories
+createWarehouse()
+updateWarehouse()
+deleteWarehouse()
+listWarehouses()
Product
-int product_id
-String product_name
-String product_code
-String product_description
-List inventories
+addProduct()
+updateProduct()
+deleteProduct()
+listProducts()
Inventory
-int inventory_id
-Warehouse warehouse
-Product product
-int quantity
-int threshold
-List stockMovements
-List barcodeScans
-List inventoryAlerts
+addInventoryRecord()
+updateInventoryRecord()
+deleteInventoryRecord()
+listInventory()
StockMovement
-int movement_id
-Warehouse warehouse
-Product product
-String movement_type
-int quantity
-String operator
-Timestamp movement_date
+addStockMovement()
+listStockMovements()
BarcodeScan
-int scan_id
-Warehouse warehouse
-Product product
-String scan_type
-String operator
-Timestamp scan_date
+addBarcodeScan()
+listBarcodeScans()
InventoryAlert
-int alert_id
-Inventory inventory
-String alert_message
-Timestamp alert_date
+addInventoryAlert()
+listInventoryAlerts()
+clearInventoryAlert()
用户类:用于存储系统用户信息,包括店长和操作员。
仓库类:用于管理仓库信息。
商品类:用于管理商品信息。
库存类:用于管理每个仓库中的商品库存信息。
出入库记录类:用于记录每次商品的出库和入库情况。
条码扫描记录类:用于记录每次条码扫描的情况。
库存预警类:用于存储库存预警信息。
用户管理仓库。
仓库包含库存。
库存跟踪商品。
库存记录出入库情况。
库存记录条码扫描情况。
库存生成预警信息。

2.UML顺序图

流程描述

  1. 用户输入用户名和密码:用户输入用户名和密码进行登录。
  2. 登录失败:
    • 用户系统验证登录信息,登录失败后返回失败消息。
  3. 登录成功:
    • 用户系统验证登录信息,登录成功后返回成功消息。
    • 用户创建一个新的仓库,仓库系统返回仓库创建成功的消息。
    • 用户添加一个新的商品,商品系统返回商品添加成功的消息。
    • 用户为指定仓库添加商品的库存记录,库存系统返回库存记录添加成功的消息。
    • 库存系统检查库存是否低于设定的阈值,如果低于阈值,库存预警系统生成预警并通知用户。
库存预警系统库存系统商品系统仓库系统用户系统库存预警系统库存系统商品系统仓库系统用户系统alt[登录失败][登录成功]用户输入用户名和密码用户名或者密码错误登录成功创建仓库仓库创建成功添加商品商品添加成功添加库存记录库存记录添加成功检查库存阈值库存低于阈值通知库存预警用户

3.UML用例图

仓库库存管理系统
include
include
include
include
include
include
include
include
include
extend
用户注册
用户登录
更新用户信息
用户注销
创建仓库
更新仓库信息
删除仓库
查看仓库列表
添加商品
更新商品信息
删除商品
查看商品列表
添加库存记录
更新库存记录
删除库存记录
查看库存列表
设置库存阈值
查看库存预警
添加出入库记录
查看出入库记录
添加条码扫描记录
查看条码扫描记录
清除库存预警
用户👤
店长👤
操作员👤