#
Junjie
11 小时以前 aa710969e00e9d7e56a276066a239f74d5c49310
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
package com.zy.asrs.entity;
 
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.core.common.Cools;
import com.core.common.SpringUtils;
import com.zy.asrs.service.BasStationService;
import com.zy.asrs.service.BasWrkIotypeService;
import com.zy.asrs.service.BasWrkStatusService;
import com.zy.system.entity.User;
import com.zy.system.service.UserService;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
 
import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Date;
 
@Data
@TableName("asr_bas_station_err_log")
public class BasStationErrLog implements Serializable {
 
    private static final long serialVersionUID = 1L;
 
    @ApiModelProperty(value = "编号")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
 
    @ApiModelProperty(value = "工作号")
    @TableField("wrk_no")
    private Integer wrkNo;
 
    @ApiModelProperty(value = "发生时间")
    @TableField("start_time")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date startTime;
 
    @ApiModelProperty(value = "结束时间")
    @TableField("end_time")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date endTime;
 
    @ApiModelProperty(value = "工作状态")
    @TableField("wrk_sts")
    private Long wrkSts;
 
    @ApiModelProperty(value = "入出库类型")
    @TableField("io_type")
    private Integer ioType;
 
    @ApiModelProperty(value = "站点号")
    @TableField("station_id")
    private Integer stationId;
 
    @ApiModelProperty(value = "目标库位")
    @TableField("loc_no")
    private String locNo;
 
    @ApiModelProperty(value = "目标站")
    @TableField("sta_no")
    private Integer staNo;
 
    @ApiModelProperty(value = "源站")
    @TableField("source_sta_no")
    private Integer sourceStaNo;
 
    @ApiModelProperty(value = "源库位")
    @TableField("source_loc_no")
    private String sourceLocNo;
 
    @ApiModelProperty(value = "条码")
    private String barcode;
 
    @ApiModelProperty(value = "异常码")
    @TableField("err_code")
    private Integer errCode;
 
    @ApiModelProperty(value = "异常")
    private String error;
 
    @ApiModelProperty(value = "异常情况 1: 未处理  2: 已修复")
    private Integer status;
 
    @ApiModelProperty(value = "添加时间")
    @TableField("create_time")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;
 
    @ApiModelProperty(value = "添加人员")
    @TableField("create_by")
    private Long createBy;
 
    @ApiModelProperty(value = "修改时间")
    @TableField("update_time")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;
 
    @ApiModelProperty(value = "修改人员")
    @TableField("update_by")
    private Long updateBy;
 
    @ApiModelProperty(value = "备注")
    private String memo;
 
    @ApiModelProperty(value = "系统状态数据")
    @TableField("system_status")
    private String systemStatus;
 
    public String getStartTime$() {
        return formatDate(startTime);
    }
 
    public String getEndTime$() {
        return formatDate(endTime);
    }
 
    public String getWrkSts$() {
        if (wrkSts == null) {
            return null;
        }
        BasWrkStatusService service = SpringUtils.getBean(BasWrkStatusService.class);
        if (service == null) {
            return String.valueOf(wrkSts);
        }
        BasWrkStatus basWrkStatus = service.getById(wrkSts);
        return basWrkStatus == null ? String.valueOf(wrkSts) : basWrkStatus.getWrkDesc();
    }
 
    public String getIoType$() {
        if (ioType == null) {
            return null;
        }
        BasWrkIotypeService service = SpringUtils.getBean(BasWrkIotypeService.class);
        if (service == null) {
            return String.valueOf(ioType);
        }
        BasWrkIotype basWrkIotype = service.getById(ioType);
        return basWrkIotype == null ? String.valueOf(ioType) : basWrkIotype.getIoDesc();
    }
 
    public String getStationLabel$() {
        if (stationId == null) {
            return null;
        }
        BasStationService service = SpringUtils.getBean(BasStationService.class);
        if (service == null) {
            return String.valueOf(stationId);
        }
        BasStation basStation = service.getById(stationId);
        if (basStation == null || Cools.isEmpty(basStation.getStationAlias())) {
            return String.valueOf(stationId);
        }
        return stationId + " - " + basStation.getStationAlias();
    }
 
    public String getStatus$() {
        if (status == null) {
            return null;
        }
        switch (status) {
            case 1:
                return "未处理";
            case 2:
                return "已修复";
            default:
                return String.valueOf(status);
        }
    }
 
    public String getCreateTime$() {
        return formatDate(createTime);
    }
 
    public String getCreateBy$() {
        if (createBy == null) {
            return null;
        }
        UserService service = SpringUtils.getBean(UserService.class);
        if (service == null) {
            return String.valueOf(createBy);
        }
        User user = service.getById(createBy);
        return user == null ? String.valueOf(createBy) : String.valueOf(user.getId());
    }
 
    public String getUpdateTime$() {
        return formatDate(updateTime);
    }
 
    public String getUpdateBy$() {
        if (updateBy == null) {
            return null;
        }
        UserService service = SpringUtils.getBean(UserService.class);
        if (service == null) {
            return String.valueOf(updateBy);
        }
        User user = service.getById(updateBy);
        return user == null ? String.valueOf(updateBy) : String.valueOf(user.getId());
    }
 
    private String formatDate(Date value) {
        if (Cools.isEmpty(value)) {
            return "";
        }
        return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(value);
    }
}