*
L
2026-04-22 18e03c72291dfcb9cebc3a21ab276bec4a0b262e
src/main/java/com/zy/asrs/entity/BasRgvErrLog.java
@@ -1,15 +1,19 @@
package com.zy.asrs.entity;
import com.core.common.Cools;import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.enums.IdType;
import com.baomidou.mybatisplus.annotations.TableField;
import com.core.common.Cools;import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import java.text.SimpleDateFormat;
import java.util.Date;
import com.core.common.SpringUtils;
import com.zy.asrs.mapper.BasRgvErrMapper;
import org.springframework.format.annotation.DateTimeFormat;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.List;
@Data
@TableName("asr_bas_rgv_err_log")
@@ -17,27 +21,27 @@
    private static final long serialVersionUID = 1L;
    @ApiModelProperty(value= "")
    @TableId(value = "id", type = IdType.INPUT)
    @Schema(description = "")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    /**
     * 编号
     */
    @ApiModelProperty(value= "编号")
    @Schema(description = "编号")
    private String uuid;
    /**
     * 工作号
     */
    @ApiModelProperty(value= "工作号")
    @Schema(description = "工作号")
    @TableField("wrk_no")
    private Integer wrkNo;
    /**
     * 发生时间
     */
    @ApiModelProperty(value= "发生时间")
    @Schema(description = "发生时间")
    @TableField("start_time")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date startTime;
@@ -45,7 +49,7 @@
    /**
     * 结束时间
     */
    @ApiModelProperty(value= "结束时间")
    @Schema(description = "结束时间")
    @TableField("end_time")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date endTime;
@@ -53,88 +57,88 @@
    /**
     * 工作状态
     */
    @ApiModelProperty(value= "工作状态")
    @Schema(description = "工作状态")
    @TableField("wrk_sts")
    private Long wrkSts;
    /**
     * 入出库类型
     */
    @ApiModelProperty(value= "入出库类型")
    @Schema(description = "入出库类型")
    @TableField("io_type")
    private Integer ioType;
    /**
     * 穿梭车
     */
    @ApiModelProperty(value= "穿梭车")
    @Schema(description = "穿梭车")
    @TableField("rgv_no")
    private Integer rgvNo;
    /**
     * plc
     */
    @ApiModelProperty(value= "plc")
    @Schema(description = "plc")
    @TableField("plc_no")
    private Integer plcNo;
    /**
     * 目标库位
     */
    @ApiModelProperty(value= "目标库位")
    @Schema(description = "目标库位")
    @TableField("loc_no")
    private String locNo;
    /**
     * 目标站
     */
    @ApiModelProperty(value= "目标站")
    @Schema(description = "目标站")
    @TableField("sta_no")
    private Integer staNo;
    /**
     * 源站
     */
    @ApiModelProperty(value= "源站")
    @Schema(description = "源站")
    @TableField("source_sta_no")
    private Integer sourceStaNo;
    /**
     * 源库位
     */
    @ApiModelProperty(value= "源库位")
    @Schema(description = "源库位")
    @TableField("source_loc_no")
    private String sourceLocNo;
    /**
     * 条码
     */
    @ApiModelProperty(value= "条码")
    @Schema(description = "条码")
    private String barcode;
    /**
     * 异常码
     */
    @ApiModelProperty(value= "异常码")
    @Schema(description = "异常码")
    @TableField("err_code")
    private Integer errCode;
    /**
     * 异常
     */
    @ApiModelProperty(value= "异常")
    @Schema(description = "异常")
    private String error;
    /**
     * 异常情况 1: 未处理  2: 已修复  
     */
    @ApiModelProperty(value= "异常情况 1: 未处理  2: 已修复  ")
    @Schema(description = "异常情况 1: 未处理  2: 已修复  ")
    private Integer status;
    /**
     * 添加时间
     */
    @ApiModelProperty(value= "添加时间")
    @Schema(description = "添加时间")
    @TableField("create_time")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date createTime;
@@ -142,14 +146,14 @@
    /**
     * 添加人员
     */
    @ApiModelProperty(value= "添加人员")
    @Schema(description = "添加人员")
    @TableField("create_by")
    private Long createBy;
    /**
     * 修改时间
     */
    @ApiModelProperty(value= "修改时间")
    @Schema(description = "修改时间")
    @TableField("update_time")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date updateTime;
@@ -157,18 +161,45 @@
    /**
     * 修改人员
     */
    @ApiModelProperty(value= "修改人员")
    @Schema(description = "修改人员")
    @TableField("update_by")
    private Long updateBy;
    /**
     * 备注
     */
    @ApiModelProperty(value= "备注")
    @Schema(description = "备注")
    private String memo;
    public BasRgvErrLog() {}
    public BasRgvErrLog(List<Integer> alarmLists , Short taskNo,Integer rgvNo) {
        BasRgvErrMapper basRgvErrMapper = SpringUtils.getBean(BasRgvErrMapper.class);
        StringBuilder alarmList = new StringBuilder();
        for (Integer alarm : alarmLists){
            BasRgvErr rgvErr = basRgvErrMapper.selectById(alarm);
            alarmList.append((rgvErr==null || rgvErr.getErrName()==null)? "未知异常:"+alarm:rgvErr.getErrName());
            if (alarm.equals(alarmLists.get(alarmLists.size() - 1))){
                this.errCode = alarm;
                break;
            }
            alarmList.append("---");
        }
        this.error = alarmList.toString();
        Date now = new Date();
        this.uuid = String.valueOf(now.getTime());
        this.wrkNo = taskNo.intValue();
        this.startTime = now;
        this.endTime = now;
        this.rgvNo = rgvNo;
        this.status = 1;
        this.createTime = now;
        this.createBy = 9999L;
        this.updateTime = now;
        this.updateBy = 9999L;
        this.memo = "异常自动记录";
    }
    public BasRgvErrLog(String uuid,Integer wrkNo,Date startTime,Date endTime,Long wrkSts,Integer ioType,Integer rgvNo,Integer plcNo,String locNo,Integer staNo,Integer sourceStaNo,String sourceLocNo,String barcode,Integer errCode,String error,Integer status,Date createTime,Long createBy,Date updateTime,Long updateBy,String memo) {
        this.uuid = uuid;
        this.wrkNo = wrkNo;