zhang
2025-05-20 1313906bb1eb983d3beece810035e7fc28d6a92f
zy-acs-manager/src/main/java/com/zy/acs/manager/manager/entity/AgvDetail.java
@@ -4,9 +4,10 @@
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.zy.acs.common.enums.AgvStatusType;
import com.zy.acs.framework.common.Cools;
import com.zy.acs.framework.common.SpringUtils;
import com.zy.acs.common.enums.AgvStatusType;
import com.zy.acs.manager.core.constant.MapDataConstant;
import com.zy.acs.manager.manager.service.AgvService;
import com.zy.acs.manager.manager.service.CodeService;
import io.swagger.annotations.ApiModelProperty;
@@ -14,6 +15,7 @@
import java.io.Serializable;
import java.util.Date;
import java.util.Optional;
@Data
@TableName("man_agv_detail")
@@ -170,13 +172,19 @@
     * 暂存数量
     */
    @ApiModelProperty(value= "暂存数量")
    private Integer tempQua;
    private String backpack;
    /**
     * 密码
     * 故障信息
     */
    @ApiModelProperty(value= "密码")
    private String password;
    @ApiModelProperty(value= "故障信息")
    private String error;
    /**
     * 故障时间
     */
    @ApiModelProperty(value= "故障时间")
    private Date errorTime;
    /**
     * 状态
@@ -231,76 +239,6 @@
    public AgvDetail() {}
    public AgvDetail(String uuid,Long agvId,String title,Long code,Long lastCode,String codeOffsert,Double straightVal,Double agvAngle,Double gyroAngle,Double encoderAngle,Integer high,Long sensorSts,Integer vol,Integer soc,Integer soh,Integer batteryFail,String tempe,String motorFail,String failSign,Integer bootTime,Integer workTime,Double workDistance,Integer tempQua,String password,Integer status,Integer deleted,Long tenantId,Long createBy,Date createTime,Long updateBy,Date updateTime,String memo) {
        this.uuid = uuid;
        this.agvId = agvId;
        this.title = title;
        this.code = code;
        this.lastCode = lastCode;
        this.codeOffsert = codeOffsert;
        this.straightVal = straightVal;
        this.agvAngle = agvAngle;
        this.gyroAngle = gyroAngle;
        this.encoderAngle = encoderAngle;
        this.high = high;
        this.sensorSts = sensorSts;
        this.vol = vol;
        this.soc = soc;
        this.soh = soh;
        this.batteryFail = batteryFail;
        this.tempe = tempe;
        this.motorFail = motorFail;
        this.failSign = failSign;
        this.bootTime = bootTime;
        this.workTime = workTime;
        this.workDistance = workDistance;
        this.tempQua = tempQua;
        this.password = password;
        this.status = status;
        this.deleted = deleted;
        this.tenantId = tenantId;
        this.createBy = createBy;
        this.createTime = createTime;
        this.updateBy = updateBy;
        this.updateTime = updateTime;
        this.memo = memo;
    }
//    AgvDetail agvDetail = new AgvDetail(
//            null,    // 编号
//            null,    // Agv[非空]
//            null,    // 标题
//            null,    // 条码
//            null,    // 邻接条码
//            null,    // 地面码偏移
//            null,    // 直行距离
//            null,    // 当前角度
//            null,    // 陀螺仪角度
//            null,    // 编码器角度
//            null,    // 当前高度
//            null,    // 传感器状态
//            null,    // 电压
//            null,    // 电量
//            null,    // 健康
//            null,    // 电池故障
//            null,    // 温度
//            null,    // 电机故障
//            null,    // 故障标识
//            null,    // 开机时间
//            null,    // 工作时间
//            null,    // 累计里程
//            null,    // 暂存数量
//            null,    // 密码
//            null,    // 状态[非空]
//            null,    // 是否删除[非空]
//            null,    // 租户
//            null,    // 添加人员
//            null,    // 添加时间[非空]
//            null,    // 修改人员
//            null,    // 修改时间
//            null    // 备注
//    );
    public String getAgvId$(){
        AgvService service = SpringUtils.getBean(AgvService.class);
        Agv agv = service.getById(this.agvId);
@@ -314,7 +252,7 @@
        CodeService service = SpringUtils.getBean(CodeService.class);
        Code code = service.getById(this.code);
        if (!Cools.isEmpty(code)){
            return String.valueOf(code.getUuid());
            return String.valueOf(code.getData());
        }
        return null;
    }
@@ -328,15 +266,15 @@
        return null;
    }
    public String getPos$(){
    public Boolean getPosBool(){
        if (null == this.pos){ return null; }
        switch (this.pos){
            case 1:
                return "是";
                return true;
            case 0:
                return "否";
                return false;
            default:
                return String.valueOf(this.status);
                return null;
        }
    }
@@ -345,13 +283,9 @@
        this.agvStatus = AgvStatusType.get(status);
    }
    public String getStatus$(){
        if (null == this.status){ return null; }
        if (null == this.agvStatus){ return null; }
        return this.agvStatus.desc;
    public String getStatusDesc(){
        return Optional.ofNullable(this.agvStatus).map(status -> status.desc).orElse("");
    }
    public Long getRecentCode() {
//        if (this.code != null) {
@@ -369,18 +303,12 @@
        return null;
    }
    public Boolean getStatusBool(){
        if (null == this.status){ return null; }
        switch (this.status){
            case 1:
                return true;
            case 0:
                return false;
            default:
                return null;
    public String realError() {
        if (!Cools.isEmpty(this.error) && !MapDataConstant.EMPTY_OF_ERROR.equals(this.error)) {
            return this.error;
        } else {
            return "";
        }
    }
}