| | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | import com.zy.core.enums.CommandType; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | @TableName("wcs_command_info_log") |
| | | @TableName("\"SOURCE\".\"wcs_command_info_log\"") |
| | | public class CommandInfoLog implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | @TableId(value = "ID", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | /** |
| | | * 工作号 |
| | | */ |
| | | @ApiModelProperty(value= "工作号") |
| | | @TableField("wrk_no") |
| | | @TableField("WRK_NO") |
| | | private Integer wrkNo; |
| | | |
| | | /** |
| | | * 起点位置 |
| | | */ |
| | | @ApiModelProperty(value= "起点位置") |
| | | @TableField("start_pos") |
| | | @TableField("START_POS") |
| | | private String startPos; |
| | | |
| | | /** |
| | | * 终点位置 |
| | | */ |
| | | @ApiModelProperty(value= "终点位置") |
| | | @TableField("end_pos") |
| | | @TableField("END_POS") |
| | | private String endPos; |
| | | |
| | | /** |
| | | * 指令状态 1: 创建 2: 执行 3: 完成 |
| | | */ |
| | | @ApiModelProperty(value= "指令状态 1: 创建 2: 执行 3: 完成 ") |
| | | @TableField("command_status") |
| | | @TableField("COMMAND_STATUS") |
| | | private Integer commandStatus; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @ApiModelProperty(value= "创建时间") |
| | | @TableField("start_time") |
| | | @TableField("START_TIME") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date startTime; |
| | | |
| | |
| | | * 指令类型 |
| | | */ |
| | | @ApiModelProperty(value= "指令类型") |
| | | @TableField("command_type") |
| | | @TableField("COMMAND_TYPE") |
| | | private Integer commandType; |
| | | |
| | | /** |
| | | * 设备 |
| | | */ |
| | | @ApiModelProperty(value= "设备") |
| | | @TableField("DEVICE") |
| | | private String device; |
| | | |
| | | /** |
| | | * 设备执行信息 |
| | | */ |
| | | @ApiModelProperty(value= "设备执行信息") |
| | | @TableField("device_log") |
| | | @TableField("DEVICE_LOG") |
| | | private String deviceLog; |
| | | |
| | | /** |
| | | * 命令描述 |
| | | */ |
| | | @ApiModelProperty(value= "命令描述") |
| | | @TableField("command_desc") |
| | | @TableField("COMMAND_DESC") |
| | | private String commandDesc; |
| | | |
| | | /** |
| | | * 命令JSON |
| | | */ |
| | | @ApiModelProperty(value= "命令JSON") |
| | | @TableField("COMMAND") |
| | | private String command; |
| | | |
| | | /** |
| | | * 任务号 |
| | | */ |
| | | @ApiModelProperty(value= "任务号") |
| | | @TableField("task_no") |
| | | @TableField("TASK_NO") |
| | | private String taskNo; |
| | | |
| | | /** |
| | | * 执行时间 |
| | | */ |
| | | @ApiModelProperty(value= "执行时间") |
| | | @TableField("execute_time") |
| | | @TableField("EXECUTE_TIME") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date executeTime; |
| | | |
| | |
| | | * 完成时间 |
| | | */ |
| | | @ApiModelProperty(value= "完成时间") |
| | | @TableField("complete_time") |
| | | @TableField("COMPLETE_TIME") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date completeTime; |
| | | |
| | |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.completeTime); |
| | | } |
| | | |
| | | /** |
| | | * 获取持续时间 |
| | | */ |
| | | public String getDurationTime() { |
| | | if (Cools.isEmpty(this.startTime)) { |
| | | return ""; |
| | | } |
| | | |
| | | Date endDate = new Date(); |
| | | if (!Cools.isEmpty(this.completeTime)) { |
| | | endDate = this.completeTime; |
| | | } |
| | | |
| | | //用来获取两个时间相差的毫秒数 |
| | | long l = this.startTime.getTime() - endDate.getTime(); |
| | | |
| | | //分别计算相差的天、小时、分、秒 |
| | | long day = l / (24 * 60 * 60 * 1000); |
| | | long hour = (l / (60 * 60 * 1000) - day * 24); |
| | | long min = ((l / (60 * 1000)) - day * 24 * 60 - hour * 60); |
| | | long s = (l / 1000 - day * 24 * 60 * 60 - hour * 60 * 60 - min * 60); |
| | | |
| | | return Math.abs(day) + "天" + Math.abs(hour) + "小时" + Math.abs(min) + "分" + Math.abs(s) + "秒"; |
| | | } |
| | | |
| | | public String getCommandType$() { |
| | | if (Cools.isEmpty(this.commandType)) { |
| | | return ""; |
| | | } |
| | | return CommandType.get(this.commandType).desc; |
| | | } |
| | | |
| | | |
| | | } |