chore: 【ops】迁移cleaner相关实体到environment模块
This commit is contained in:
@@ -0,0 +1,88 @@
|
||||
package com.viewsh.module.ops.environment.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,141 @@
|
||||
package com.viewsh.module.ops.environment.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 java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 保洁员实时状态 DO
|
||||
*
|
||||
* @author lzh
|
||||
*/
|
||||
@TableName("ops_cleaner_status")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@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();
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.viewsh.module.ops.environment.service.cleaner;
|
||||
|
||||
import com.viewsh.module.ops.dal.dataobject.cleaner.OpsCleanerStatusDO;
|
||||
import com.viewsh.module.ops.environment.dal.dataobject.cleaner.OpsCleanerStatusDO;
|
||||
import com.viewsh.module.ops.enums.CleanerStatusEnum;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package com.viewsh.module.ops.environment.service.cleaner;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.viewsh.module.ops.dal.dataobject.cleaner.OpsCleanerStatusDO;
|
||||
import com.viewsh.module.ops.dal.mysql.cleaner.OpsCleanerStatusMapper;
|
||||
import com.viewsh.module.ops.environment.dal.dataobject.cleaner.OpsCleanerStatusDO;
|
||||
import com.viewsh.module.ops.environment.dal.mysql.cleaner.OpsCleanerStatusMapper;
|
||||
|
||||
import com.viewsh.module.ops.enums.CleanerStatusEnum;
|
||||
import jakarta.annotation.Resource;
|
||||
|
||||
Reference in New Issue
Block a user