chore: 【ops】实体类新增
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
package com.viewsh.module.ops.environment.dal.dataobject;
|
||||
|
||||
import com.viewsh.module.ops.dal.dataobject.dto.OpsOrderCreateReqDTO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import jakarta.validation.constraints.Min;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* 保洁自动工单创建请求 DTO
|
||||
*
|
||||
* @author lzh
|
||||
*/
|
||||
@Schema(description = "管理后台 - 保洁自动工单创建 Request DTO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class CleanOrderAutoCreateReqDTO extends OpsOrderCreateReqDTO {
|
||||
|
||||
@Schema(description = "预计作业时长(分钟)", requiredMode = Schema.RequiredMode.REQUIRED, example = "30")
|
||||
@NotNull(message = "预计作业时长不能为空")
|
||||
@Min(value = 1, message = "预计作业时长必须大于0")
|
||||
private Integer expectedDuration;
|
||||
|
||||
@Schema(description = "保洁类型(ROUTINE=日常/DEEP=深度/SPOT=点状/EMERGENCY=应急)", example = "ROUTINE")
|
||||
private String cleaningType;
|
||||
|
||||
@Schema(description = "难度等级(1-5级)", example = "3")
|
||||
@Min(value = 1, message = "难度等级必须大于0")
|
||||
private Integer difficultyLevel;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.viewsh.module.ops.environment.dal.dataobject;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* 保洁工单暂停请求 DTO
|
||||
*
|
||||
* @author lzh
|
||||
*/
|
||||
@Schema(description = "管理后台 - 保洁工单暂停 Request DTO")
|
||||
@Data
|
||||
public class CleanOrderPauseReqDTO {
|
||||
|
||||
@Schema(description = "工单ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1001")
|
||||
@NotNull(message = "工单ID不能为空")
|
||||
private Long orderId;
|
||||
|
||||
@Schema(description = "保洁员ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "2001")
|
||||
@NotNull(message = "保洁员ID不能为空")
|
||||
private Long cleanerId;
|
||||
|
||||
@Schema(description = "暂停原因", requiredMode = Schema.RequiredMode.REQUIRED, example = "P0紧急工单插队")
|
||||
@NotBlank(message = "暂停原因不能为空")
|
||||
private String pauseReason;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.viewsh.module.ops.environment.dal.dataobject;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* 保洁工单恢复请求 DTO
|
||||
*
|
||||
* @author lzh
|
||||
*/
|
||||
@Schema(description = "管理后台 - 保洁工单恢复 Request DTO")
|
||||
@Data
|
||||
public class CleanOrderResumeReqDTO {
|
||||
|
||||
@Schema(description = "工单ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1001")
|
||||
@NotNull(message = "工单ID不能为空")
|
||||
private Long orderId;
|
||||
|
||||
@Schema(description = "保洁员ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "2001")
|
||||
@NotNull(message = "保洁员ID不能为空")
|
||||
private Long cleanerId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,150 @@
|
||||
package com.viewsh.module.ops.api.queue;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 工单队列 DTO
|
||||
* 用于跨模块传输工单队列数据
|
||||
*
|
||||
* @author lzh
|
||||
*/
|
||||
@Data
|
||||
public class OrderQueueDTO {
|
||||
|
||||
/**
|
||||
* 队列记录ID
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 保洁员用户ID(执行人员ID)
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 工单ID
|
||||
*/
|
||||
private Long opsOrderId;
|
||||
|
||||
/**
|
||||
* 队列顺序(1表示最高优先级)
|
||||
*/
|
||||
private Integer queueIndex;
|
||||
|
||||
/**
|
||||
* 优先级(0=P0紧急, 1=P1重要, 2=P2普<32><E699AE>)
|
||||
*/
|
||||
private Integer priority;
|
||||
|
||||
/**
|
||||
* 队列分数(用于排序)
|
||||
* 计算公式:优先级分数 + 时间戳
|
||||
* - P0: 0 + timestamp
|
||||
* - P1: 1000000 + timestamp
|
||||
* - P2: 2000000 + timestamp
|
||||
* - P3: 3000000 + timestamp
|
||||
*
|
||||
* 用于数据库层面的排序,优先级高的排在前面,同优先级按时间排序
|
||||
*/
|
||||
private Double queueScore;
|
||||
|
||||
/**
|
||||
* 队列状态(WAITING/EXECUTING/PAUSED/CANCELLED)
|
||||
*/
|
||||
private String queueStatus;
|
||||
|
||||
/**
|
||||
* 入队时间
|
||||
*/
|
||||
private LocalDateTime enqueueTime;
|
||||
|
||||
/**
|
||||
* 出队时间(工单开始执行时间)
|
||||
*/
|
||||
private LocalDateTime dequeueTime;
|
||||
|
||||
/**
|
||||
* 累计暂停时长(秒)
|
||||
*/
|
||||
private Integer pausedDuration;
|
||||
|
||||
/**
|
||||
* 工牌设备ID
|
||||
*/
|
||||
private Long deviceId;
|
||||
|
||||
/**
|
||||
* 可读日志内容
|
||||
*/
|
||||
private String eventMessage;
|
||||
|
||||
/**
|
||||
* 结构化上下文(JSON格式)
|
||||
*/
|
||||
private String eventPayload;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
// ========== 兼容旧字段名的getter方法 ==========
|
||||
|
||||
/**
|
||||
* 兼容旧代码:getOrderId() 实际返回 opsOrderId
|
||||
*/
|
||||
public Long getOrderId() {
|
||||
return opsOrderId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 兼容旧代码:getStatus() 实际返回 queueStatus
|
||||
*/
|
||||
public String getStatus() {
|
||||
return queueStatus;
|
||||
}
|
||||
|
||||
/**
|
||||
* 兼容旧代码:getAssigneeId() 实际返回 userId
|
||||
*/
|
||||
public Long getAssigneeId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
// ========== 业<><E4B89A>方法 ==========
|
||||
|
||||
/**
|
||||
* 判断是否为紧急任务(P0)
|
||||
*/
|
||||
public boolean isUrgent() {
|
||||
return priority != null && priority == 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否可取消
|
||||
*/
|
||||
public boolean canCancel() {
|
||||
return "WAITING".equals(queueStatus);
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否正在执行
|
||||
*/
|
||||
public boolean isExecuting() {
|
||||
return "EXECUTING".equals(queueStatus);
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否已暂停
|
||||
*/
|
||||
public boolean isPaused() {
|
||||
return "PAUSED".equals(queueStatus);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
package com.viewsh.module.ops.dal.dataobject.area;
|
||||
|
||||
import com.viewsh.framework.mybatis.core.dataobject.BaseDO;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.*;
|
||||
|
||||
/**
|
||||
* 业务区域 DO
|
||||
*
|
||||
* @author lzh
|
||||
*/
|
||||
@TableName("ops_bus_area")
|
||||
@KeySequence("ops_bus_area_seq")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class OpsBusAreaDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 区域ID,主键
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 父级区域ID,用于构建区域树
|
||||
*/
|
||||
private Long parentId;
|
||||
/**
|
||||
* 父级路径(如:1/2/3,便于查询所有子区域)
|
||||
*/
|
||||
private String parentPath;
|
||||
/**
|
||||
* 区域名称
|
||||
*/
|
||||
private String areaName;
|
||||
/**
|
||||
* 区域业务编码(可选,全局唯一)
|
||||
*/
|
||||
private String areaCode;
|
||||
/**
|
||||
* 区域层级类型(PARK=园区/BUILDING=楼栋/FLOOR=楼层/FUNCTION=功能区域)
|
||||
*
|
||||
* 枚举 {@link com.viewsh.module.ops.enums.AreaTypeEnum}
|
||||
*/
|
||||
private String areaType;
|
||||
/**
|
||||
* 功能类型(MALE_TOILET=男卫/FEMALE_TOILET=女卫/PUBLIC=公共区/ELEVATOR=电梯厅等)
|
||||
*
|
||||
* 枚举 {@link com.viewsh.module.ops.enums.FunctionTypeEnum}
|
||||
*/
|
||||
private String functionType;
|
||||
/**
|
||||
* 楼层号(如:2、-1)
|
||||
*/
|
||||
private Integer floorNo;
|
||||
/**
|
||||
* 保洁频率(次/天)
|
||||
*/
|
||||
private Integer cleaningFrequency;
|
||||
/**
|
||||
* 标准保洁时长(分钟)
|
||||
*/
|
||||
private Integer standardDuration;
|
||||
/**
|
||||
* 区域等级(HIGH=高优先级/MEDIUM=中/LOW=低)
|
||||
*/
|
||||
private String areaLevel;
|
||||
/**
|
||||
* 是否启用
|
||||
*/
|
||||
private Boolean isActive;
|
||||
/**
|
||||
* 显示排序
|
||||
*/
|
||||
private Integer sort;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
package com.viewsh.module.ops.dal.dataobject.cleaner;
|
||||
|
||||
import com.viewsh.framework.mybatis.core.dataobject.BaseDO;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 保洁员绩效月度汇总 DO
|
||||
*
|
||||
* @author lzh
|
||||
*/
|
||||
@TableName("ops_cleaner_performance_monthly")
|
||||
@KeySequence("ops_cleaner_performance_monthly_seq")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class OpsCleanerPerformanceMonthlyDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 汇总ID
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 保洁员用户ID
|
||||
*/
|
||||
private Long userId;
|
||||
/**
|
||||
* 年月(2025-01)
|
||||
*/
|
||||
private String yearMonth;
|
||||
/**
|
||||
* 总工单数
|
||||
*/
|
||||
private Integer totalOrders;
|
||||
/**
|
||||
* P0紧急工单数
|
||||
*/
|
||||
private Integer p0Orders;
|
||||
/**
|
||||
* P1重要工单数
|
||||
*/
|
||||
private Integer p1Orders;
|
||||
/**
|
||||
* P2普通工单数
|
||||
*/
|
||||
private Integer p2Orders;
|
||||
/**
|
||||
* 平均响应时长(秒)
|
||||
*/
|
||||
private Integer avgResponseSeconds;
|
||||
/**
|
||||
* 平均完成时长(秒)
|
||||
*/
|
||||
private Integer avgCompletionSeconds;
|
||||
/**
|
||||
* 平均质量评分(1-5)
|
||||
*/
|
||||
private BigDecimal avgQualityScore;
|
||||
/**
|
||||
* 总作业时长(秒)
|
||||
*/
|
||||
private Long totalWorkSeconds;
|
||||
/**
|
||||
* 总暂停时长(秒)
|
||||
*/
|
||||
private Long totalPauseSeconds;
|
||||
/**
|
||||
* 出勤率(百分比)
|
||||
*/
|
||||
private BigDecimal attendanceRate;
|
||||
/**
|
||||
* 绩效总分
|
||||
*/
|
||||
private BigDecimal performanceScore;
|
||||
/**
|
||||
* 团队排名
|
||||
*/
|
||||
private Integer rankInTeam;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,142 @@
|
||||
package com.viewsh.module.ops.dal.dataobject.cleaner;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.viewsh.framework.mybatis.core.dataobject.BaseDO;
|
||||
import com.viewsh.module.ops.enums.CleanerStatusEnum;
|
||||
import lombok.*;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 保洁员实时状态 DO
|
||||
*
|
||||
* @author lzh
|
||||
*/
|
||||
@TableName("ops_cleaner_status")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class OpsCleanerStatusDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 保洁员用户ID
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 保洁员姓名
|
||||
*/
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 工牌设备ID(关联iot_device表)
|
||||
*/
|
||||
private Long deviceId;
|
||||
|
||||
/**
|
||||
* 工牌设备编码
|
||||
*/
|
||||
private String deviceCode;
|
||||
|
||||
/**
|
||||
* 当前状态(IDLE=空闲/BUSY=忙碌/OFFLINE=离线/PAUSED=暂停)
|
||||
*
|
||||
* 枚举 {@link com.viewsh.module.ops.enums.CleanerStatusEnum}
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 当前位置区域ID
|
||||
*
|
||||
* 关联 {@link com.viewsh.module.ops.dal.dataobject.area.OpsBusAreaDO#getId()}
|
||||
*/
|
||||
private Long currentAreaId;
|
||||
|
||||
/**
|
||||
* 当前位置区域名称
|
||||
*/
|
||||
private String currentAreaName;
|
||||
|
||||
/**
|
||||
* 当前正在执行的工单ID
|
||||
*
|
||||
* 关联 {@link com.viewsh.module.ops.dal.dataobject.workorder.OpsOrderDO#getId()}
|
||||
*/
|
||||
private Long currentOpsOrderId;
|
||||
|
||||
/**
|
||||
* 当前正在执行的工单编号
|
||||
*/
|
||||
private String currentOpsOrderCode;
|
||||
|
||||
/**
|
||||
* 工牌电量(0-100)
|
||||
*/
|
||||
private Integer batteryLevel;
|
||||
|
||||
/**
|
||||
* 最后心跳时间
|
||||
*/
|
||||
private LocalDateTime lastHeartbeatTime;
|
||||
|
||||
/**
|
||||
* 最后一次同步设备状态时间
|
||||
*/
|
||||
private LocalDateTime lastDeviceSyncTime;
|
||||
|
||||
/**
|
||||
* 状态变更时间
|
||||
*/
|
||||
private LocalDateTime statusChangeTime;
|
||||
|
||||
/**
|
||||
* 离线原因
|
||||
*/
|
||||
private String offlineReason;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 删除标记
|
||||
*/
|
||||
@TableLogic
|
||||
private Boolean deleted;
|
||||
|
||||
/**
|
||||
* 获取状态枚举
|
||||
*/
|
||||
public CleanerStatusEnum getStatusEnum() {
|
||||
return CleanerStatusEnum.fromCode(this.status);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置状态枚举
|
||||
*/
|
||||
public void setStatusEnum(CleanerStatusEnum statusEnum) {
|
||||
this.status = statusEnum.getCode();
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否可以接新单
|
||||
*/
|
||||
public boolean canAcceptNewOrder() {
|
||||
CleanerStatusEnum statusEnum = getStatusEnum();
|
||||
return statusEnum != null && statusEnum.isCanAcceptNewOrder();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.viewsh.module.ops.dal.dataobject.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
/**
|
||||
* 工单分配请求 DTO
|
||||
*
|
||||
* @author lzh
|
||||
*/
|
||||
@Schema(description = "管理后台 - 工单分配 Request DTO")
|
||||
@Data
|
||||
public class OpsOrderAssignReqDTO {
|
||||
|
||||
@Schema(description = "工单ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1001")
|
||||
@NotNull(message = "工单ID不能为空")
|
||||
private Long orderId;
|
||||
|
||||
@Schema(description = "执行人ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "2001")
|
||||
@NotNull(message = "执行人ID不能为空")
|
||||
private Long assigneeId;
|
||||
|
||||
@Schema(description = "分配备注", example = "张师傅负责该区域")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.viewsh.module.ops.dal.dataobject.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 工单完成请求 DTO
|
||||
*
|
||||
* @author lzh
|
||||
*/
|
||||
@Schema(description = "管理后台 - 工单完成 Request DTO")
|
||||
@Data
|
||||
public class OpsOrderCompleteReqDTO {
|
||||
|
||||
@Schema(description = "工单ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1001")
|
||||
@NotNull(message = "工单ID不能为空")
|
||||
private Long orderId;
|
||||
|
||||
@Schema(description = "完成备注", example = "已完成清洁")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package com.viewsh.module.ops.dal.dataobject.dto;
|
||||
|
||||
import com.viewsh.framework.common.validation.InEnum;
|
||||
import com.viewsh.module.ops.enums.PriorityEnum;
|
||||
import com.viewsh.module.ops.enums.SourceTypeEnum;
|
||||
import com.viewsh.module.ops.enums.WorkOrderTypeEnum;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
/**
|
||||
* 工单创建请求 DTO
|
||||
*
|
||||
* @author lzh
|
||||
*/
|
||||
@Schema(description = "管理后台 - 工单创建 Request DTO")
|
||||
@Data
|
||||
public class OpsOrderCreateReqDTO {
|
||||
|
||||
@Schema(description = "工单类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "CLEAN")
|
||||
@NotBlank(message = "工单类型不能为空")
|
||||
private String orderType;
|
||||
|
||||
@Schema(description = "工单来源", example = "MANUAL")
|
||||
@InEnum(value = SourceTypeEnum.class, message = "工单来源必须是 {value}")
|
||||
private String sourceType;
|
||||
|
||||
@Schema(description = "工单标题", requiredMode = Schema.RequiredMode.REQUIRED, example = "2楼电梯厅有水渍")
|
||||
@NotBlank(message = "工单标题不能为空")
|
||||
private String title;
|
||||
|
||||
@Schema(description = "工单描述/详情", example = "2楼电梯厅发现大量水渍,需要紧急处理")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "优先级(0=P0紧急 1=P1重要 2=P2普通)", example = "2")
|
||||
@InEnum(value = PriorityEnum.class, message = "优先级必须是 {value}")
|
||||
private Integer priority;
|
||||
|
||||
@Schema(description = "区域ID", example = "100")
|
||||
private Long areaId;
|
||||
|
||||
@Schema(description = "具体位置描述", example = "2楼电梯厅")
|
||||
private String location;
|
||||
|
||||
@Schema(description = "加急原因", example = "有安全隐患")
|
||||
private String urgentReason;
|
||||
|
||||
@Schema(description = "巡检员ID(发起人)", example = "1001")
|
||||
private Long inspectorId;
|
||||
|
||||
@Schema(description = "指定执行人ID(可选,用于手动指派)", example = "2001")
|
||||
private Long assigneeId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package com.viewsh.module.ops.dal.dataobject.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 工单详情响应 DTO(包含扩展信息)
|
||||
*
|
||||
* @author lzh
|
||||
*/
|
||||
@Schema(description = "管理后台 - 工单详情 Response DTO")
|
||||
@Data
|
||||
public class OpsOrderDetailRespDTO extends OpsOrderRespDTO {
|
||||
|
||||
@Schema(description = "保洁扩展信息")
|
||||
private CleanExtInfo cleanExt;
|
||||
|
||||
@Schema(description = "最近3条事件记录")
|
||||
private java.util.List<OpsOrderEventRespDTO> recentEvents;
|
||||
|
||||
/**
|
||||
* 保洁扩展信息
|
||||
*/
|
||||
@Data
|
||||
public static class CleanExtInfo {
|
||||
|
||||
@Schema(description = "是否自动工单", example = "1")
|
||||
private Integer isAuto;
|
||||
|
||||
@Schema(description = "预计作业时长(分钟)", example = "30")
|
||||
private Integer expectedDuration;
|
||||
|
||||
@Schema(description = "实际到岗时间")
|
||||
private LocalDateTime arrivedTime;
|
||||
|
||||
@Schema(description = "实际完成时间")
|
||||
private LocalDateTime completedTime;
|
||||
|
||||
@Schema(description = "累计暂停时长(秒)", example = "300")
|
||||
private Integer totalPauseSeconds;
|
||||
|
||||
@Schema(description = "保洁类型", example = "ROUTINE")
|
||||
private String cleaningType;
|
||||
|
||||
@Schema(description = "难度等级(1-5级)", example = "3")
|
||||
private Integer difficultyLevel;
|
||||
|
||||
@Schema(description = "实际作业时长(秒)", example = "1800")
|
||||
private Integer actualDuration;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package com.viewsh.module.ops.dal.dataobject.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 工单事件响应 DTO
|
||||
*
|
||||
* @author lzh
|
||||
*/
|
||||
@Schema(description = "管理后台 - 工单事件 Response DTO")
|
||||
@Data
|
||||
public class OpsOrderEventRespDTO {
|
||||
|
||||
@Schema(description = "事件ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "10001")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "工单ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1001")
|
||||
private Long opsOrderId;
|
||||
|
||||
@Schema(description = "工单编号", example = "WO202501040001")
|
||||
private String orderCode;
|
||||
|
||||
@Schema(description = "原状态", example = "PENDING")
|
||||
private String fromStatus;
|
||||
|
||||
@Schema(description = "新状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "ASSIGNED")
|
||||
private String toStatus;
|
||||
|
||||
@Schema(description = "事件类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "ASSIGN")
|
||||
private String eventType;
|
||||
|
||||
@Schema(description = "操作人类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "SYSTEM")
|
||||
private String operatorType;
|
||||
|
||||
@Schema(description = "操作人ID", example = "1001")
|
||||
private Long operatorId;
|
||||
|
||||
@Schema(description = "操作人姓名", example = "张师傅")
|
||||
private String operatorName;
|
||||
|
||||
@Schema(description = "事件时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private LocalDateTime eventTime;
|
||||
|
||||
@Schema(description = "说明", example = "系统自动分配")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.viewsh.module.ops.dal.dataobject.dto;
|
||||
|
||||
import com.viewsh.framework.common.pojo.PageParam;
|
||||
import com.viewsh.framework.common.validation.InEnum;
|
||||
import com.viewsh.module.ops.enums.PriorityEnum;
|
||||
import com.viewsh.module.ops.enums.WorkOrderStatusEnum;
|
||||
import com.viewsh.module.ops.enums.WorkOrderTypeEnum;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 工单分页查询请求 DTO
|
||||
*
|
||||
* @author lzh
|
||||
*/
|
||||
@Schema(description = "管理后台 - 工单分页 Request DTO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class OpsOrderPageReqDTO extends PageParam {
|
||||
|
||||
@Schema(description = "工单类型", example = "CLEAN")
|
||||
private String orderType;
|
||||
|
||||
@Schema(description = "工单状态", example = "PENDING")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "优先级", example = "0")
|
||||
@InEnum(value = PriorityEnum.class, message = "优先级必须是 {value}")
|
||||
private Integer priority;
|
||||
|
||||
@Schema(description = "区域ID", example = "100")
|
||||
private Long areaId;
|
||||
|
||||
@Schema(description = "执行人ID", example = "2001")
|
||||
private Long assigneeId;
|
||||
|
||||
@Schema(description = "巡检员ID", example = "1001")
|
||||
private Long inspectorId;
|
||||
|
||||
@Schema(description = "创建时间", example = "[]")
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
package com.viewsh.module.ops.dal.dataobject.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 工单响应 DTO
|
||||
*
|
||||
* @author lzh
|
||||
*/
|
||||
@Schema(description = "管理后台 - 工单 Response DTO")
|
||||
@Data
|
||||
public class OpsOrderRespDTO {
|
||||
|
||||
@Schema(description = "工单ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1001")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "工单编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "WO202501040001")
|
||||
private String orderCode;
|
||||
|
||||
@Schema(description = "工单类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "CLEAN")
|
||||
private String orderType;
|
||||
|
||||
@Schema(description = "工单来源", example = "MANUAL")
|
||||
private String sourceType;
|
||||
|
||||
@Schema(description = "工单标题", requiredMode = Schema.RequiredMode.REQUIRED, example = "2楼电梯厅有水渍")
|
||||
private String title;
|
||||
|
||||
@Schema(description = "工单描述", example = "2楼电梯厅发现大量水渍")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "优先级(0=P0紧急 1=P1重要 2=P2普通)", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
private Integer priority;
|
||||
|
||||
@Schema(description = "工单状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "PENDING")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "区域ID", example = "100")
|
||||
private Long areaId;
|
||||
|
||||
@Schema(description = "区域名称", example = "2楼电梯厅")
|
||||
private String areaName;
|
||||
|
||||
@Schema(description = "具体位置描述", example = "2楼电梯厅")
|
||||
private String location;
|
||||
|
||||
@Schema(description = "加急原因", example = "有安全隐患")
|
||||
private String urgentReason;
|
||||
|
||||
@Schema(description = "执行人ID", example = "2001")
|
||||
private Long assigneeId;
|
||||
|
||||
@Schema(description = "执行人姓名", example = "张师傅")
|
||||
private String assigneeName;
|
||||
|
||||
@Schema(description = "巡检员ID", example = "1001")
|
||||
private Long inspectorId;
|
||||
|
||||
@Schema(description = "巡检员姓名", example = "李巡检")
|
||||
private String inspectorName;
|
||||
|
||||
@Schema(description = "工单开始时间")
|
||||
private LocalDateTime startTime;
|
||||
|
||||
@Schema(description = "工单结束时间")
|
||||
private LocalDateTime endTime;
|
||||
|
||||
@Schema(description = "验收评分(1-5星)", example = "5")
|
||||
private Integer qualityScore;
|
||||
|
||||
@Schema(description = "验收评语", example = "完成质量很好")
|
||||
private String qualityComment;
|
||||
|
||||
@Schema(description = "响应耗时(秒)", example = "180")
|
||||
private Integer responseSeconds;
|
||||
|
||||
@Schema(description = "完成耗时(秒)", example = "600")
|
||||
private Integer completionSeconds;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.viewsh.module.ops.dal.dataobject.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
/**
|
||||
* 工单更新请求 DTO
|
||||
*
|
||||
* @author lzh
|
||||
*/
|
||||
@Schema(description = "管理后台 - 工单更新 Request DTO")
|
||||
@Data
|
||||
public class OpsOrderUpdateReqDTO {
|
||||
|
||||
@Schema(description = "工单ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1001")
|
||||
@NotNull(message = "工单ID不能为空")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "工单标题", example = "2楼电梯厅有水渍")
|
||||
private String title;
|
||||
|
||||
@Schema(description = "工单描述/详情", example = "2楼电梯厅发现大量水渍,需要紧急处理")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "优先级(0=P0紧急 1=P1重要 2=P2普通)", example = "0")
|
||||
private Integer priority;
|
||||
|
||||
@Schema(description = "加急原因", example = "有安全隐患")
|
||||
private String urgentReason;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
package com.viewsh.module.ops.dal.dataobject.log;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.viewsh.framework.mybatis.core.dataobject.BaseDO;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 保洁业务日志 DO
|
||||
*
|
||||
* @author lzh
|
||||
*/
|
||||
@TableName(value = "ops_order_clean_log", autoResultMap = true)
|
||||
@KeySequence("ops_order_clean_log_seq")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class OpsOrderCleanLogDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 日志ID
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 事件发生时间
|
||||
*/
|
||||
private LocalDateTime eventTime;
|
||||
/**
|
||||
* 日志级别(INFO=信息/WARN=警告/ERROR=错误)
|
||||
*/
|
||||
private String eventLevel;
|
||||
/**
|
||||
* 领域(RULE=规则引擎/DISPATCH=调度/BADGE=工牌/BEACON=信标/SYSTEM=系统)
|
||||
*
|
||||
* 枚举 {@link com.viewsh.module.ops.enums.EventDomainEnum}
|
||||
*/
|
||||
private String eventDomain;
|
||||
/**
|
||||
* 事件类型
|
||||
*/
|
||||
private String eventType;
|
||||
/**
|
||||
* 关联工单ID
|
||||
*
|
||||
* 关联 {@link com.viewsh.module.ops.dal.dataobject.workorder.OpsOrderDO#getId()}
|
||||
*/
|
||||
private Long opsOrderId;
|
||||
/**
|
||||
* 区域ID
|
||||
*
|
||||
* 关联 {@link com.viewsh.module.ops.dal.dataobject.area.OpsBusAreaDO#getId()}
|
||||
*/
|
||||
private Long areaId;
|
||||
/**
|
||||
* 保洁员ID
|
||||
*/
|
||||
private Long cleanerId;
|
||||
/**
|
||||
* 设备ID(工牌/信标)
|
||||
*/
|
||||
private Long deviceId;
|
||||
/**
|
||||
* 可读日志内容
|
||||
*/
|
||||
private String eventMessage;
|
||||
/**
|
||||
* 结构化上下文
|
||||
*/
|
||||
@TableField(typeHandler = JacksonTypeHandler.class)
|
||||
private Map<String, Object> eventPayload;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,188 @@
|
||||
package com.viewsh.module.ops.dal.dataobject.queue;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.viewsh.framework.mybatis.core.dataobject.BaseDO;
|
||||
import com.viewsh.module.ops.enums.OrderQueueStatusEnum;
|
||||
import com.viewsh.module.ops.enums.PriorityEnum;
|
||||
import lombok.*;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 工单队列 DO
|
||||
* 用于管理工单的派单队列,支持优先级排序、紧急插队等智能调度功能
|
||||
*
|
||||
* @author lzh
|
||||
*/
|
||||
@TableName("ops_order_queue")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class OpsOrderQueueDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 队列ID(主键)
|
||||
*/
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 保洁员用户ID(执行人员ID)
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 工单ID
|
||||
*
|
||||
* 关联 {@link com.viewsh.module.ops.dal.dataobject.workorder.OpsOrderDO#getId()}
|
||||
*/
|
||||
@TableField("ops_order_id")
|
||||
private Long opsOrderId;
|
||||
|
||||
/**
|
||||
* 队列顺序(1表示最高优先级)
|
||||
* 用于同优先级工单的排序
|
||||
*/
|
||||
@TableField("queue_index")
|
||||
private Integer queueIndex;
|
||||
|
||||
/**
|
||||
* 优先级
|
||||
* 0=P0紧急, 1=P1重要, 2=P2普通
|
||||
*
|
||||
* 枚举 {@link PriorityEnum}
|
||||
*/
|
||||
private Integer priority;
|
||||
|
||||
/**
|
||||
* 队列分数(用于排序)
|
||||
* 计算公式:优先级分数 + 时间戳
|
||||
* - P0: 0 + timestamp
|
||||
* - P1: 1000000 + timestamp
|
||||
* - P2: 2000000 + timestamp
|
||||
* - P3: 3000000 + timestamp
|
||||
*
|
||||
* 用于数据库层面的排序,优先级高的排在前面,同优先级按时间排序
|
||||
*/
|
||||
@TableField("queue_score")
|
||||
private Double queueScore;
|
||||
|
||||
/**
|
||||
* 队列状态
|
||||
* WAITING=等待中, EXECUTING=执行中, PAUSED=已暂停, CANCELLED=已取消
|
||||
*
|
||||
* 枚举 {@link OrderQueueStatusEnum}
|
||||
*/
|
||||
@TableField("queue_status")
|
||||
private String queueStatus;
|
||||
|
||||
/**
|
||||
* 入队时间
|
||||
*/
|
||||
@TableField("enqueue_time")
|
||||
private LocalDateTime enqueueTime;
|
||||
|
||||
/**
|
||||
* 出队时间(工单开始执行时间)
|
||||
*/
|
||||
@TableField("dequeue_time")
|
||||
private LocalDateTime dequeueTime;
|
||||
|
||||
/**
|
||||
* 累计暂停时长(秒)
|
||||
*/
|
||||
@TableField("paused_duration")
|
||||
private Integer pausedDuration;
|
||||
|
||||
/**
|
||||
* 工牌设备ID
|
||||
*/
|
||||
private Long deviceId;
|
||||
|
||||
/**
|
||||
* 可读日志内容
|
||||
* 用于记录队列操作日志,如"工单入队"、"优先级提升"等
|
||||
*/
|
||||
@TableField("event_message")
|
||||
private String eventMessage;
|
||||
|
||||
/**
|
||||
* 结构化上下文(JSON格式)
|
||||
* 存储扩展信息,如区域ID、技能要求、派单策略等
|
||||
*/
|
||||
@TableField("event_payload")
|
||||
private String eventPayload;
|
||||
|
||||
// ========== 业务方法 ==========
|
||||
|
||||
/**
|
||||
* 获取优先级枚举
|
||||
*/
|
||||
public PriorityEnum getPriorityEnum() {
|
||||
return PriorityEnum.fromPriority(this.priority);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置优先级枚举
|
||||
*/
|
||||
public void setPriorityEnum(PriorityEnum priorityEnum) {
|
||||
this.priority = priorityEnum.getPriority();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取队列状态枚举
|
||||
*/
|
||||
public OrderQueueStatusEnum getStatusEnum() {
|
||||
// 直接匹配枚举值
|
||||
for (OrderQueueStatusEnum statusEnum : OrderQueueStatusEnum.values()) {
|
||||
if (statusEnum.getStatus().equalsIgnoreCase(this.queueStatus)) {
|
||||
return statusEnum;
|
||||
}
|
||||
}
|
||||
// 默认返回 WAITING
|
||||
return OrderQueueStatusEnum.WAITING;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置队列状态枚举
|
||||
*/
|
||||
public void setStatusEnum(OrderQueueStatusEnum statusEnum) {
|
||||
this.queueStatus = statusEnum.getStatus().toUpperCase();
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否为紧急任务(P0)
|
||||
*/
|
||||
public boolean isUrgent() {
|
||||
return getPriorityEnum().isUrgent();
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否可取消(只有 WAITING 状态可以取消)
|
||||
*/
|
||||
public boolean canCancel() {
|
||||
return OrderQueueStatusEnum.WAITING.getStatus().equalsIgnoreCase(this.queueStatus);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 判断是否已暂停
|
||||
*/
|
||||
public boolean isPaused() {
|
||||
return OrderQueueStatusEnum.PAUSED.getStatus().equalsIgnoreCase(this.queueStatus);
|
||||
}
|
||||
|
||||
/**
|
||||
* 增加暂停时长
|
||||
*/
|
||||
public void addPausedDuration(int seconds) {
|
||||
this.pausedDuration = (this.pausedDuration == null ? 0 : this.pausedDuration) + seconds;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
package com.viewsh.module.ops.dal.dataobject.workorder;
|
||||
|
||||
import com.viewsh.framework.mybatis.core.dataobject.BaseDO;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 保洁工单扩展 DO
|
||||
*
|
||||
* @author lzh
|
||||
*/
|
||||
@TableName("ops_order_clean_ext")
|
||||
@KeySequence("ops_order_clean_ext_seq")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class OpsOrderCleanExtDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 工单ID
|
||||
*
|
||||
* 关联 {@link OpsOrderDO#getId()}
|
||||
*/
|
||||
private Long opsOrderId;
|
||||
/**
|
||||
* 是否自动工单(1=自动 0=手动)
|
||||
*/
|
||||
private Integer isAuto;
|
||||
/**
|
||||
* 预计作业时长(分钟)
|
||||
*/
|
||||
private Integer expectedDuration;
|
||||
/**
|
||||
* 实际到岗时间
|
||||
*/
|
||||
private LocalDateTime arrivedTime;
|
||||
/**
|
||||
* 实际完成时间
|
||||
*/
|
||||
private LocalDateTime completedTime;
|
||||
/**
|
||||
* 暂停开始时间
|
||||
*/
|
||||
private LocalDateTime pauseStartTime;
|
||||
/**
|
||||
* 暂停结束时间
|
||||
*/
|
||||
private LocalDateTime pauseEndTime;
|
||||
/**
|
||||
* 累计暂停时长(秒)
|
||||
*/
|
||||
private Integer totalPauseSeconds;
|
||||
/**
|
||||
* 保洁类型(ROUTINE=日常/DEEP=深度/SPOT=点状/EMERGENCY=应急)
|
||||
*/
|
||||
private String cleaningType;
|
||||
/**
|
||||
* 难度等级(1-5级)
|
||||
*/
|
||||
private Integer difficultyLevel;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,122 @@
|
||||
package com.viewsh.module.ops.dal.dataobject.workorder;
|
||||
|
||||
import com.viewsh.framework.mybatis.core.dataobject.BaseDO;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 通用工单 DO
|
||||
*
|
||||
* @author lzh
|
||||
*/
|
||||
@TableName("ops_order")
|
||||
@KeySequence("ops_order_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class OpsOrderDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 工单ID
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 工单编号(WO202501040001)
|
||||
*/
|
||||
private String orderCode;
|
||||
/**
|
||||
* 工单类型(CLEAN=保洁/REPAIR=维修/SECURITY=安保/SERVICE=客服)
|
||||
*
|
||||
* 枚举 {@link com.viewsh.module.ops.enums.WorkOrderTypeEnum}
|
||||
*/
|
||||
private String orderType;
|
||||
/**
|
||||
* 来源(TRAFFIC=系统触发/INSPECTION=巡检发现/MANUAL=手动创建/SCHEDULE=定时排班)
|
||||
*
|
||||
* 枚举 {@link com.viewsh.module.ops.enums.SourceTypeEnum}
|
||||
*/
|
||||
private String sourceType;
|
||||
/**
|
||||
* 工单标题
|
||||
*/
|
||||
private String title;
|
||||
/**
|
||||
* 工单描述/详情
|
||||
*/
|
||||
private String description;
|
||||
/**
|
||||
* 优先级(0=P0紧急 1=P1重要 2=P2普通)
|
||||
*
|
||||
* 枚举 {@link com.viewsh.module.ops.enums.PriorityEnum}
|
||||
*/
|
||||
private Integer priority;
|
||||
/**
|
||||
* 工单状态(PENDING待分配/ASSIGNED已分配/ARRIVED已到岗/PAUSED已暂停/COMPLETED已完成/CANCELLED已取消)
|
||||
*
|
||||
* 枚举 {@link com.viewsh.module.ops.enums.WorkOrderStatusEnum}
|
||||
*/
|
||||
private String status;
|
||||
/**
|
||||
* 区域ID
|
||||
*
|
||||
* 关联 {@link com.viewsh.module.ops.dal.dataobject.area.OpsBusAreaDO#getId()}
|
||||
*/
|
||||
private Long areaId;
|
||||
/**
|
||||
* 具体位置描述(冗余,便于查询)
|
||||
*/
|
||||
private String location;
|
||||
/**
|
||||
* 加急原因
|
||||
*/
|
||||
private String urgentReason;
|
||||
/**
|
||||
* 当前执行人ID
|
||||
*/
|
||||
private Long assigneeId;
|
||||
/**
|
||||
* 巡检员ID(发起人)
|
||||
*/
|
||||
private Long inspectorId;
|
||||
/**
|
||||
* 工单开始时间(ARRIVED状态时间)
|
||||
*/
|
||||
private LocalDateTime startTime;
|
||||
/**
|
||||
* 工单结束时间(COMPLETED状态时间)
|
||||
*/
|
||||
private LocalDateTime endTime;
|
||||
/**
|
||||
* 巡检员验收时间
|
||||
*/
|
||||
private LocalDateTime inspectorAcceptTime;
|
||||
/**
|
||||
* 验收评分(1-5星)
|
||||
*/
|
||||
private Integer qualityScore;
|
||||
/**
|
||||
* 验收评语
|
||||
*/
|
||||
private String qualityComment;
|
||||
/**
|
||||
* 响应耗时(秒,派单到接单)
|
||||
*/
|
||||
private Integer responseSeconds;
|
||||
/**
|
||||
* 完成耗时(秒,接单到完成)
|
||||
*/
|
||||
private Integer completionSeconds;
|
||||
/**
|
||||
* Flowable流程实例ID(预留)
|
||||
*/
|
||||
private String flowInstanceId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
package com.viewsh.module.ops.dal.dataobject.workorder;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.viewsh.framework.mybatis.core.dataobject.BaseDO;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 工单分派决策 DO
|
||||
*
|
||||
* @author lzh
|
||||
*/
|
||||
@TableName(value = "ops_order_dispatch", autoResultMap = true)
|
||||
@KeySequence("ops_order_dispatch_seq")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class OpsOrderDispatchDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 派单ID
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 工单ID
|
||||
*
|
||||
* 关联 {@link OpsOrderDO#getId()}
|
||||
*/
|
||||
private Long opsOrderId;
|
||||
/**
|
||||
* 保洁员用户ID
|
||||
*/
|
||||
private Long userId;
|
||||
/**
|
||||
* 优先级(0=P0紧急 1=P1重要 2=P2普通)
|
||||
*
|
||||
* 枚举 {@link com.viewsh.module.ops.enums.PriorityEnum}
|
||||
*/
|
||||
private Integer priority;
|
||||
/**
|
||||
* 派单模式(NORMAL=普通/SILENT=静默/URGENT=紧急插队)
|
||||
*
|
||||
* 枚举 {@link com.viewsh.module.ops.enums.DispatchModeEnum}
|
||||
*/
|
||||
private String dispatchMode;
|
||||
/**
|
||||
* 派单原因(AUTO=自动派单/INSPECT_URGE=巡检催办/MANUAL=手动指派)
|
||||
*/
|
||||
private String dispatchReason;
|
||||
/**
|
||||
* 派单时间
|
||||
*/
|
||||
private LocalDateTime dispatchTime;
|
||||
/**
|
||||
* 接单时间
|
||||
*/
|
||||
private LocalDateTime acceptedTime;
|
||||
/**
|
||||
* 响应耗时(秒)
|
||||
*/
|
||||
private Integer responseSeconds;
|
||||
/**
|
||||
* 工牌设备ID
|
||||
*/
|
||||
private Long deviceId;
|
||||
/**
|
||||
* 工牌响应时间(播报/震动)
|
||||
*/
|
||||
private LocalDateTime deviceResponseTime;
|
||||
/**
|
||||
* 通知方式(VOICE_ONLY=仅语音/VIBRATE_ONLY=仅震动/BOTH=语音+震动)
|
||||
*/
|
||||
private String notificationMethod;
|
||||
/**
|
||||
* 可读日志内容
|
||||
*/
|
||||
private String eventMessage;
|
||||
/**
|
||||
* 结构化上下文
|
||||
*/
|
||||
@TableField(typeHandler = JacksonTypeHandler.class)
|
||||
private Map<String, Object> eventPayload;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
package com.viewsh.module.ops.dal.dataobject.workorder;
|
||||
|
||||
import com.viewsh.framework.mybatis.core.dataobject.BaseDO;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* FSM 事件流 DO
|
||||
*
|
||||
* @author lzh
|
||||
*/
|
||||
@TableName("ops_order_event")
|
||||
@KeySequence("ops_order_event_seq")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class OpsOrderEventDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 事件ID
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 工单ID
|
||||
*
|
||||
* 关联 {@link OpsOrderDO#getId()}
|
||||
*/
|
||||
private Long opsOrderId;
|
||||
/**
|
||||
* 原状态
|
||||
*
|
||||
* 枚举 {@link com.viewsh.module.ops.enums.WorkOrderStatusEnum}
|
||||
*/
|
||||
private String fromStatus;
|
||||
/**
|
||||
* 新状态
|
||||
*
|
||||
* 枚举 {@link com.viewsh.module.ops.enums.WorkOrderStatusEnum}
|
||||
*/
|
||||
private String toStatus;
|
||||
/**
|
||||
* 事件类型(CREATE/ASSIGN/ACCEPT/ARRIVE/PAUSE/RESUME/COMPLETE/CANCEL)
|
||||
*/
|
||||
private String eventType;
|
||||
/**
|
||||
* 操作人类型(SYSTEM=系统/CLEANER=保洁员/INSPECTOR=巡检员)
|
||||
*
|
||||
* 枚举 {@link com.viewsh.module.ops.enums.OperatorTypeEnum}
|
||||
*/
|
||||
private String operatorType;
|
||||
/**
|
||||
* 操作人ID
|
||||
*/
|
||||
private Long operatorId;
|
||||
/**
|
||||
* 操作人姓名(冗余)
|
||||
*/
|
||||
private String operatorName;
|
||||
/**
|
||||
* 发生时间
|
||||
*/
|
||||
private LocalDateTime eventTime;
|
||||
/**
|
||||
* 说明
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
package com.viewsh.module.ops.dal.dataobject.workorder;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.viewsh.framework.mybatis.core.dataobject.BaseDO;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 工单排队队列 DO
|
||||
*
|
||||
* @author lzh
|
||||
*/
|
||||
@TableName(value = "ops_order_queue", autoResultMap = true)
|
||||
@KeySequence("ops_order_queue_seq")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class OpsOrderQueueDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 队列ID
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 保洁员用户ID
|
||||
*/
|
||||
private Long userId;
|
||||
/**
|
||||
* 工单ID
|
||||
*
|
||||
* 关联 {@link OpsOrderDO#getId()}
|
||||
*/
|
||||
private Long opsOrderId;
|
||||
/**
|
||||
* 队列顺序(1表示最高优先级)
|
||||
*/
|
||||
private Integer queueIndex;
|
||||
/**
|
||||
* 优先级(0=P0紧急 1=P1重要 2=P2普通)
|
||||
*
|
||||
* 枚举 {@link com.viewsh.module.ops.enums.PriorityEnum}
|
||||
*/
|
||||
private Integer priority;
|
||||
/**
|
||||
* 队列状态(WAITING=等待中/EXECUTING=执行中/PAUSED=已暂停/CANCELLED=已取消)
|
||||
*/
|
||||
private String queueStatus;
|
||||
/**
|
||||
* 入队时间
|
||||
*/
|
||||
private LocalDateTime enqueueTime;
|
||||
/**
|
||||
* 出队时间(工单开始执行)
|
||||
*/
|
||||
private LocalDateTime dequeueTime;
|
||||
/**
|
||||
* 累计暂停时长(秒)
|
||||
*/
|
||||
private Integer pausedDuration;
|
||||
/**
|
||||
* 工牌设备ID
|
||||
*/
|
||||
private Long deviceId;
|
||||
/**
|
||||
* 可读日志内容
|
||||
*/
|
||||
private String eventMessage;
|
||||
/**
|
||||
* 结构化上下文
|
||||
*/
|
||||
@TableField(typeHandler = JacksonTypeHandler.class)
|
||||
private Map<String, Object> eventPayload;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user