Files
Environment-Monitoring-System/Report/temp1.md
ChuXun 02a830145e 1
2025-10-25 19:18:43 +08:00

7.9 KiB

@startuml
skinparam classAttributeIconSize 0

' --- Enumeration classes (declaration-only for max compatibility) ---
enum Gender {
    MALE,
    FEMALE,
    OTHER
}
enum Role {
     PUBLIC_SUPERVISOR,
     SUPERVISOR, 
     GRID_WORKER,
     ADMIN, 
     DECISION_MAKER

}
enum UserStatus 
enum PollutionType 
enum SeverityLevel 
enum FeedbackStatus 
enum TaskStatus 
enum AssignmentStatus 
enum AssignmentMethod 
enum OperationType 


' --- Entity classes with full attributes and methods ---
class UserAccount {
  - Long id
  - String name
  - String phone
  - String email
  - String password
  - Gender gender
  - Role role
  - UserStatus status
  - Integer gridX
  - Integer gridY
  + isValid()
}
class Feedback {
  - Long id
  - String eventId
  - String title
  - PollutionType pollutionType
  - SeverityLevel severityLevel
  - FeedbackStatus status
  - Long submitterId
  + process()
  + approve()
}
class Task {
  - Long id
  - String title
  - String description
  - PollutionType pollutionType
  - SeverityLevel severityLevel
  - TaskStatus status
  - String textAddress
  - Integer gridX
  - Integer gridY
  - LocalDateTime assignedAt
  - LocalDateTime completedAt
  + assignTo(workerId)
  + complete()
  + approve()
}
class Assignment {
  - Long id
  - String remarks
  - LocalDateTime assignmentTime
  - LocalDateTime deadline
  - AssignmentStatus status
}
class TaskHistory {
  - Long id
  - TaskStatus oldStatus
  - TaskStatus newStatus
  - String comments
  - LocalDateTime changedAt
}
class TaskSubmission {
  - Long id
  - String notes
  - LocalDateTime submittedAt
}
class Attachment {
  - Long id
  - String fileName
  - String fileType
  - String storedFileName
  - Long fileSize
  - LocalDateTime uploadDate
}
class Grid {
  - Long id
  - Integer gridX
  - Integer gridY
  - String cityName
  - String districtName
  - String description
  - boolean isObstacle
}
class MapGrid {
  - Long id
  - int x
  - int y
  - String cityName
  - boolean isObstacle
  - String terrainType
}
class PasswordResetToken {
  - Long id
  - String token
  - LocalDateTime expiryDate
  + isExpired()
}
class OperationLog {
  - Long id
  - OperationType operationType
  - String description
  - String targetId
  - String targetType
  - String ipAddress
  - LocalDateTime createdAt
}
class AqiData {
  - Long id
  - Integer aqiValue
  - Double pm25
  - Double pm10
  - String primaryPollutant
  - LocalDateTime recordTime
}
class AqiRecord {
  - Long id
  - String cityName
  - Integer aqiValue
  - Double pm25
  - Double pm10
  - LocalDateTime recordTime
}
class AssignmentRecord {
    - Long id
    - AssignmentMethod assignmentMethod
    - String algorithmDetails
    - AssignmentStatus status
    - LocalDateTime createdAt
}
class PollutantThreshold {
    - Long id
    - PollutionType pollutionType
    - String pollutantName
    - Double threshold
    - String unit
}

' --- Relationships (kept simple for compatibility) ---
UserAccount --> Gender
UserAccount --> Role
UserAccount --> UserStatus
Feedback --> PollutionType
Feedback --> SeverityLevel
Feedback --> FeedbackStatus
Task --> TaskStatus
Assignment --> AssignmentStatus
AssignmentRecord --> AssignmentMethod
OperationLog --> OperationType
PollutantThreshold --> PollutionType
Task --> Feedback
Task -- Assignment
Task -- TaskHistory
Task -- TaskSubmission
Feedback -- Attachment
TaskSubmission -- Attachment
AssignmentRecord --> Feedback
UserAccount --> Feedback
UserAccount --> Task
Task -- UserAccount
Assignment --> UserAccount
TaskHistory --> UserAccount
AssignmentRecord --> UserAccount
OperationLog --> UserAccount
PasswordResetToken --> UserAccount
AqiData --> UserAccount
Task ..> Grid
UserAccount ..> Grid
AqiData --> Grid
AqiRecord --> Grid
@enduml

@startuml
title EMS系统模型全景图 (Detailed View)

skinparam classAttributeIconSize 0

' --- Enumeration classes (declaration-only for max compatibility) ---
enum Gender 
enum Role 
enum UserStatus 
enum PollutionType 
enum SeverityLevel 
enum FeedbackStatus 
enum TaskStatus
enum AssignmentStatus 
enum AssignmentMethod 
enum OperationType


' --- Entity classes with full attributes and methods ---
class UserAccount {
  - Long id
  - String name
  - String phone
  - String email
  - String password
  - Gender gender
  - Role role
  - UserStatus status
  - Integer gridX
  - Integer gridY
  + isValid()
}
class Feedback {
  - Long id
  - String eventId
  - String title
  - PollutionType pollutionType
  - SeverityLevel severityLevel
  - FeedbackStatus status
  - Long submitterId
  + process()
  + approve()
}
class Task {
  - Long id
  - String title
  - String description
  - PollutionType pollutionType
  - SeverityLevel severityLevel
  - TaskStatus status
  - String textAddress
  - Integer gridX
  - Integer gridY
  - LocalDateTime assignedAt
  - LocalDateTime completedAt
  + assignTo(workerId)
  + complete()
  + approve()
}
class Assignment {
  - Long id
  - String remarks
  - LocalDateTime assignmentTime
  - LocalDateTime deadline
  - AssignmentStatus status
}
class TaskHistory {
  - Long id
  - TaskStatus oldStatus
  - TaskStatus newStatus
  - String comments
  - LocalDateTime changedAt
}
class TaskSubmission {
  - Long id
  - String notes
  - LocalDateTime submittedAt
}
class Attachment {
  - Long id
  - String fileName
  - String fileType
  - String storedFileName
  - Long fileSize
  - LocalDateTime uploadDate
}
class Grid {
  - Long id
  - Integer gridX
  - Integer gridY
  - String cityName
  - String districtName
  - String description
  - boolean isObstacle
}
class MapGrid {
  - Long id
  - int x
  - int y
  - String cityName
  - boolean isObstacle
  - String terrainType
}
class PasswordResetToken {
  - Long id
  - String token
  - LocalDateTime expiryDate
  + isExpired()
}
class OperationLog {
  - Long id
  - OperationType operationType
  - String description
  - String targetId
  - String targetType
  - String ipAddress
  - LocalDateTime createdAt
}
class AqiData {
  - Long id
  - Integer aqiValue
  - Double pm25
  - Double pm10
  - String primaryPollutant
  - LocalDateTime recordTime
}
class AqiRecord {
  - Long id
  - String cityName
  - Integer aqiValue
  - Double pm25
  - Double pm10
  - LocalDateTime recordTime
}
class AssignmentRecord {
    - Long id
    - AssignmentMethod assignmentMethod
    - String algorithmDetails
    - AssignmentStatus status
    - LocalDateTime createdAt
}
class PollutantThreshold {
    - Long id
    - PollutionType pollutionType
    - String pollutantName
    - Double threshold
    - String unit
}

' --- Relationships with Full Details ---

' --- Composition with Enums ---
UserAccount "1" *-- "1" Gender
UserAccount "1" *-- "1" Role
UserAccount "1" *-- "1" UserStatus
Feedback "1" *-- "1" PollutionType
Feedback "1" *-- "1" SeverityLevel
Feedback "1" *-- "1" FeedbackStatus
Task "1" *-- "1" TaskStatus
Assignment "1" *-- "1" AssignmentStatus
AssignmentRecord "1" *-- "1" AssignmentMethod
OperationLog "1" *-- "1" OperationType
PollutantThreshold "1" *-- "1" PollutionType

' --- Aggregation & Association ---
Task "1" --> "1" Feedback : "generated from"
Task "1" o-- "1" Assignment : "has"
Task "1" o-- "0..*" TaskHistory : "logs"
Task "1" o-- "0..*" TaskSubmission : "receives"
Feedback "1" o-- "0..*" Attachment : "has"
TaskSubmission "1" o-- "0..*" Attachment : "has"
AssignmentRecord "1" --> "1" Feedback : "for"
UserAccount "1" --> "0..*" Feedback : "submits"
UserAccount "1" --> "0..*" Task : "creates"
Task "0..*" o-- "1" UserAccount : "assigned to"
Assignment "1" --> "1" UserAccount : "assigned by"
TaskHistory "1" --> "1" UserAccount : "changed by"
AssignmentRecord "1" --> "1" UserAccount : "assigned to"
AssignmentRecord "1" --> "1" UserAccount : "assigned by"
OperationLog "1" --> "1" UserAccount : "performed by"
PasswordResetToken "1" --> "1" UserAccount : "for"
AqiData "1" --> "1" UserAccount : "reported by"

' --- Dependency & Other Associations ---
Task "1" ..> "1" Grid : "located in"
UserAccount "1" ..> "1" Grid : "operates in"
AqiData "1" --> "1" Grid : "recorded at"
AqiRecord "1" --> "1" Grid : "related to"

@enduml