chore: 【ops】迁移cleaner相关实体到environment模块
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
package com.viewsh.module.ops.dal.dataobject.cleaner;
|
||||
package com.viewsh.module.ops.environment.dal.dataobject.cleaner;
|
||||
|
||||
import com.viewsh.framework.mybatis.core.dataobject.BaseDO;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.viewsh.module.ops.dal.dataobject.cleaner;
|
||||
package com.viewsh.module.ops.environment.dal.dataobject.cleaner;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
@@ -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;
|
||||
|
||||
@@ -1,82 +0,0 @@
|
||||
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;
|
||||
|
||||
}
|
||||
@@ -1,74 +0,0 @@
|
||||
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;
|
||||
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
package com.viewsh.module.ops.dal.mysql.cleaner;
|
||||
|
||||
import com.viewsh.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.viewsh.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.viewsh.module.ops.dal.dataobject.cleaner.OpsCleanerPerformanceMonthlyDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 保洁员绩效月度汇总 Mapper
|
||||
*
|
||||
* @author lzh
|
||||
*/
|
||||
@Mapper
|
||||
public interface OpsCleanerPerformanceMonthlyMapper extends BaseMapperX<OpsCleanerPerformanceMonthlyDO> {
|
||||
|
||||
/**
|
||||
* 根据用户ID和年月查询绩效
|
||||
*/
|
||||
default OpsCleanerPerformanceMonthlyDO selectByUserIdAndYearMonth(Long userId, String yearMonth) {
|
||||
return selectOne(new LambdaQueryWrapperX<OpsCleanerPerformanceMonthlyDO>()
|
||||
.eq(OpsCleanerPerformanceMonthlyDO::getUserId, userId)
|
||||
.eq(OpsCleanerPerformanceMonthlyDO::getYearMonth, yearMonth));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据年月查询所有人的绩效
|
||||
*/
|
||||
default List<OpsCleanerPerformanceMonthlyDO> selectListByYearMonth(String yearMonth) {
|
||||
return selectList(new LambdaQueryWrapperX<OpsCleanerPerformanceMonthlyDO>()
|
||||
.eq(OpsCleanerPerformanceMonthlyDO::getYearMonth, yearMonth)
|
||||
.orderByDesc(OpsCleanerPerformanceMonthlyDO::getPerformanceScore));
|
||||
}
|
||||
|
||||
// 注意:分页查询方法需要在Service层实现,这里只提供基础查询方法
|
||||
// 具体分页查询请参考Service实现
|
||||
|
||||
/**
|
||||
* 查询用户的历史绩效列表
|
||||
*/
|
||||
default List<OpsCleanerPerformanceMonthlyDO> selectListByUserId(Long userId) {
|
||||
return selectList(new LambdaQueryWrapperX<OpsCleanerPerformanceMonthlyDO>()
|
||||
.eq(OpsCleanerPerformanceMonthlyDO::getUserId, userId)
|
||||
.orderByDesc(OpsCleanerPerformanceMonthlyDO::getYearMonth));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,61 +0,0 @@
|
||||
package com.viewsh.module.ops.dal.mysql.cleaner;
|
||||
|
||||
import com.viewsh.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.viewsh.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.viewsh.module.ops.dal.dataobject.cleaner.OpsCleanerStatusDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 保洁员实时状态 Mapper
|
||||
*
|
||||
* @author lzh
|
||||
*/
|
||||
@Mapper
|
||||
public interface OpsCleanerStatusMapper extends BaseMapperX<OpsCleanerStatusDO> {
|
||||
|
||||
/**
|
||||
* 根据用户ID查询状态
|
||||
*/
|
||||
default OpsCleanerStatusDO selectByUserId(Long userId) {
|
||||
return selectOne(OpsCleanerStatusDO::getUserId, userId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据状态查询保洁员列表
|
||||
*/
|
||||
default List<OpsCleanerStatusDO> selectListByStatus(String status) {
|
||||
return selectList(new LambdaQueryWrapperX<OpsCleanerStatusDO>()
|
||||
.eq(OpsCleanerStatusDO::getStatus, status)
|
||||
.orderByDesc(OpsCleanerStatusDO::getStatusChangeTime));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据区域查询附近保洁员
|
||||
*/
|
||||
default List<OpsCleanerStatusDO> selectListByAreaId(Long areaId) {
|
||||
return selectList(new LambdaQueryWrapperX<OpsCleanerStatusDO>()
|
||||
.eq(OpsCleanerStatusDO::getCurrentAreaId, areaId)
|
||||
.ne(OpsCleanerStatusDO::getStatus, "OFFLINE")
|
||||
.orderByDesc(OpsCleanerStatusDO::getLastHeartbeatTime));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询离线保洁员(心跳超时)
|
||||
*/
|
||||
default List<OpsCleanerStatusDO> selectListByHeartbeatTimeout(LocalDateTime timeout) {
|
||||
return selectList(new LambdaQueryWrapperX<OpsCleanerStatusDO>()
|
||||
.lt(OpsCleanerStatusDO::getLastHeartbeatTime, timeout)
|
||||
.ne(OpsCleanerStatusDO::getStatus, "OFFLINE"));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据设备ID查询保洁员状态
|
||||
*/
|
||||
default OpsCleanerStatusDO selectByDeviceId(Long deviceId) {
|
||||
return selectOne(OpsCleanerStatusDO::getDeviceId, deviceId);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user