#
luxiaotao1123
2021-06-03 958b12cccc9e0043eb0c6b9bb84ebdf554ebe1a1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
package com.zy.common.model.agv;
 
import com.alibaba.fastjson.annotation.JSONField;
import com.core.common.Cools;
import com.zy.asrs.entity.BasAgv;
import com.zy.common.model.enums.AgvStatusType;
import lombok.Data;
 
import java.io.Serializable;
import java.util.Date;
 
/**
 * Created by vincent on 2021/5/19
 */
@Data
public class AgvInfo implements Cloneable, Serializable {
 
    private static final long serialVersionUID = 1L;
 
    // 小车编号
    private Integer Id;
 
    // 是否启用(true:启用,false:禁用)
    private Boolean IsUse;
 
    // 当前位置点位
    private String CurrentNode;
 
    // 当前电量
    private String Power;
 
    // 一般状态(01:前往取货点,02:取货点取货,03:前往送货点,04:送货点放货,05:任务完成,06:空闲,07:故障,08:充电中,09:手动,10:失联,11:离线,12:行走)
    private String Status;
 
    @JSONField(serialize = false)
    private transient AgvStatusType agvStatus;
 
    // 故障码
    private String Fault;
 
    // 任务号
    private String taskcode;
 
    // 任务点
    private String Point_Number;
 
    // 任务类型(1:行走,2:取货,3:放货,4:充电)
    private String ActionType;
 
 
    @Override
    public AgvInfo clone() {
        try {
            return (AgvInfo) super.clone();
        } catch (CloneNotSupportedException e) {
            e.printStackTrace();
        }
        return null;
    }
 
    public BasAgv toSqlModel(){
        BasAgv basAgv = new BasAgv();
        basAgv.setAgvId(this.getId());
        basAgv.setIsUser(this.getIsUse()?1:0);
        basAgv.setCurrentNode(this.getCurrentNode());
        basAgv.setPower(this.getPower());
        basAgv.setStatus(Cools.isEmpty(this.getAgvStatus())?0:Integer.parseInt(this.getAgvStatus().id));
        basAgv.setFault(this.getFault());
        basAgv.setTaskCode(this.getTaskcode());
        basAgv.setEndLoc(this.getPoint_Number());
        basAgv.setAction(Cools.isEmpty(this.getActionType())?0:Integer.parseInt(this.getActionType()));
        basAgv.setModiTime(new Date());
        return basAgv;
    }
 
}