Subversion Repositories SmartDukaan

Rev

Rev 1061 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1061 Rev 1153
Line 3... Line 3...
3
import in.shop2020.metamodel.util.ReusableMetaModelComponent;
3
import in.shop2020.metamodel.util.ReusableMetaModelComponent;
4
 
4
 
5
import java.util.Calendar;
5
import java.util.Calendar;
6
import java.util.Date;
6
import java.util.Date;
7
 
7
 
-
 
8
/**
-
 
9
 * Entity state
-
 
10
 * @author rajveer
-
 
11
 *
-
 
12
 */
8
public class EntityState extends ReusableMetaModelComponent{
13
public class EntityState extends ReusableMetaModelComponent{
9
	
14
	
10
	/**
-
 
11
	 * 
-
 
12
	 */
-
 
13
	private static final long serialVersionUID = 1L;
15
	private static final long serialVersionUID = 1L;
14
	
16
	
15
	private EntityStatus status;
17
	private EntityStatus status;
16
	
18
	
17
	private String createdBy;
19
	private String createdBy;
Line 24... Line 26...
24
	private Date assignedOn;
26
	private Date assignedOn;
25
	private Date completedOn;
27
	private Date completedOn;
26
	private Date markedReadyOn;
28
	private Date markedReadyOn;
27
 
29
 
28
	
30
	
-
 
31
	private long categoryID;
-
 
32
	private String brand;
-
 
33
	private String modelNumber;
-
 
34
	private String modelName;
-
 
35
 
-
 
36
	
29
	/*
37
	/*
30
	private class ActionLog{
38
	private class ActionLog{
31
		Action action;
39
		Action action;
32
		String user;
40
		String user;
33
		Date date;
41
		Date date;
Line 45... Line 53...
45
	//this.currentAction = new ActionLog(Action.CREATE, createdBy);
53
	//this.currentAction = new ActionLog(Action.CREATE, createdBy);
46
	 * 
54
	 * 
47
	 * 	//this.currentAction = new ActionLog(Action.CREATE, createdBy);
55
	 * 	//this.currentAction = new ActionLog(Action.CREATE, createdBy);
48
	*/
56
	*/
49
	
57
	
50
	public EntityState(long newID, String createdBy){
58
	public EntityState(long newID, long categoryID, String createdBy){
51
		super(newID);
59
		super(newID);
52
		this.status = EntityStatus.UNASSIGNED;
60
		this.status = EntityStatus.UNASSIGNED;
53
		this.createdBy = createdBy;
61
		this.createdBy = createdBy;
54
		this.createdOn = getCurrentTime(); 
62
		this.createdOn = getCurrentTime(); 
-
 
63
		this.categoryID = categoryID;
55
	}
64
	}
56
	
65
	
-
 
66
	/**
-
 
67
	 * 
-
 
68
	 * @param assignedBy
-
 
69
	 * @param assignedTo
-
 
70
	 */
57
	public void assignEntity(String assignedBy, String assignedTo){
71
	public void assignEntity(String assignedBy, String assignedTo){
58
		this.status = EntityStatus.ASSIGNED;
72
		this.status = EntityStatus.ASSIGNED;
59
		this.assignedBy = assignedBy;
73
		this.assignedBy = assignedBy;
60
		this.assignedTo = assignedTo;
74
		this.assignedTo = assignedTo;
61
		this.assignedOn = getCurrentTime();
75
		this.assignedOn = getCurrentTime();
62
	}
76
	}
63
 
77
 
-
 
78
	/**
-
 
79
	 * 
-
 
80
	 * @param completedBy
-
 
81
	 */
64
	public void completeEntity(String completedBy) {
82
	public void completeEntity(String completedBy) {
65
		this.status = EntityStatus.COMPLETE;
83
		this.status = EntityStatus.COMPLETE;
66
		this.completedBy = completedBy;
84
		this.completedBy = completedBy;
67
		this.completedOn = getCurrentTime();
85
		this.completedOn = getCurrentTime();
68
	}
86
	}
69
	
87
	
-
 
88
	/**
-
 
89
	 * Set mark ready by
-
 
90
	 * @param markedReadyBy
-
 
91
	 */
70
	public void readyEntity(String markedReadyBy) {
92
	public void readyEntity(String markedReadyBy) {
71
		this.status = EntityStatus.READY;
93
		this.status = EntityStatus.READY;
72
		this.markedReadyBy = markedReadyBy;
94
		this.markedReadyBy = markedReadyBy;
73
		this.markedReadyOn = getCurrentTime();
95
		this.markedReadyOn = getCurrentTime();
74
	}
96
	}
75
	
97
	
-
 
98
	/**
-
 
99
	 * Set status
-
 
100
	 * @param status
-
 
101
	 */
76
	public void setStatus(EntityStatus status) {
102
	public void setStatus(EntityStatus status) {
77
		this.status = status;
103
		this.status = status;
78
	}
104
	}
79
	
105
	
-
 
106
	/**
-
 
107
	 * Get status
-
 
108
	 * @return
-
 
109
	 */
80
	public EntityStatus getStatus() {
110
	public EntityStatus getStatus() {
81
		return status;
111
		return status;
82
	}
112
	}
83
 
113
 
-
 
114
	/**
-
 
115
	 * Set created by
-
 
116
	 * @param createdBy
-
 
117
	 */
84
	public void setCreatedBy(String createdBy) {
118
	public void setCreatedBy(String createdBy) {
85
		this.createdBy = createdBy;
119
		this.createdBy = createdBy;
86
	}
120
	}
87
 
121
 
-
 
122
	/**
-
 
123
	 * Get createdBy
-
 
124
	 * @return
-
 
125
	 */
88
	public String getCreatedBy() {
126
	public String getCreatedBy() {
89
		return createdBy;
127
		return createdBy;
90
	}
128
	}
91
 
129
 
-
 
130
	/**
-
 
131
	 * Set assignedBy
-
 
132
	 * @param assignedBy
-
 
133
	 */
92
	public void setAssignedBy(String assignedBy) {
134
	public void setAssignedBy(String assignedBy) {
93
		this.assignedBy = assignedBy;
135
		this.assignedBy = assignedBy;
94
	}
136
	}
95
 
137
 
-
 
138
	/**
-
 
139
	 * Get assignedBy
-
 
140
	 * @return
-
 
141
	 */
96
	public String getAssignedBy() {
142
	public String getAssignedBy() {
97
		return assignedBy;
143
		return assignedBy;
98
	}
144
	}
99
 
145
 
-
 
146
	/**
-
 
147
	 * Set assignedTo
-
 
148
	 * @param assignedTo
-
 
149
	 */
100
	public void setAssignedTo(String assignedTo) {
150
	public void setAssignedTo(String assignedTo) {
101
		this.assignedTo = assignedTo;
151
		this.assignedTo = assignedTo;
102
	}
152
	}
103
 
153
 
-
 
154
	/**
-
 
155
	 * Get assignedTo
-
 
156
	 * @return
-
 
157
	 */
104
	public String getAssignedTo() {
158
	public String getAssignedTo() {
105
		return assignedTo;
159
		return assignedTo;
106
	}
160
	}
107
 
161
 
-
 
162
	/**
-
 
163
	 * Set completedBy
-
 
164
	 * @param completedBy
-
 
165
	 */
108
	public void setCompletedBy(String completedBy) {
166
	public void setCompletedBy(String completedBy) {
109
		this.completedBy = completedBy;
167
		this.completedBy = completedBy;
110
	}
168
	}
111
 
169
 
-
 
170
	/**
-
 
171
	 * get CompletedBy
-
 
172
	 * @return
-
 
173
	 */
112
	public String getCompletedBy() {
174
	public String getCompletedBy() {
113
		return completedBy;
175
		return completedBy;
114
	}
176
	}
115
 
177
 
-
 
178
	/**
-
 
179
	 * Set markReadyBy
-
 
180
	 * @param merkedReadyBy
-
 
181
	 */
116
	public void setMerkedReadyBy(String merkedReadyBy) {
182
	public void setMerkedReadyBy(String merkedReadyBy) {
117
		this.markedReadyBy = merkedReadyBy;
183
		this.markedReadyBy = merkedReadyBy;
118
	}
184
	}
119
 
185
 
-
 
186
	/**
-
 
187
	 * Get markReadyBy
-
 
188
	 * @return
-
 
189
	 */
120
	public String getMerkedReadyBy() {
190
	public String getMerkedReadyBy() {
121
		return markedReadyBy;
191
		return markedReadyBy;
122
	}
192
	}
123
 
193
 
124
	public void setCreatedOn(Date createdOn) {
194
	public void setCreatedOn(Date createdOn) {
Line 151... Line 221...
151
 
221
 
152
	public Date getMerkedReadyOn() {
222
	public Date getMerkedReadyOn() {
153
		return markedReadyOn;
223
		return markedReadyOn;
154
	}
224
	}
155
	
225
	
-
 
226
	/**
-
 
227
     * 
-
 
228
     * @return categoryID
-
 
229
     *     
-
 
230
     */
-
 
231
    public long getCategoryID() {
-
 
232
        return this.categoryID;
-
 
233
    }
-
 
234
 
-
 
235
    /**
-
 
236
     * 
-
 
237
     * @param value Category ID to set
-
 
238
     *     
-
 
239
     */
-
 
240
    public void setCategoryID(long value) {
-
 
241
        this.categoryID = value;
-
 
242
    }
-
 
243
 
-
 
244
    /**
-
 
245
     * 
-
 
246
     * @return brand
-
 
247
     *     
-
 
248
     */
-
 
249
    public String getBrand() {
-
 
250
        return this.brand;
-
 
251
    }
-
 
252
 
-
 
253
    /**
-
 
254
     * 
-
 
255
     * @param value Brand to set
-
 
256
     *     
-
 
257
     */
-
 
258
    public void setBrand(String value) {
-
 
259
        this.brand = value;
-
 
260
    }
-
 
261
 
-
 
262
    /**
-
 
263
     * 
-
 
264
     * @return modelNumber Model Number 
-
 
265
     *     
-
 
266
     */
-
 
267
    public String getModelNumber() {
-
 
268
        return this.modelNumber;
-
 
269
    }
-
 
270
 
-
 
271
    /**
-
 
272
     * 
-
 
273
     * @param value Model Number to set
-
 
274
     *     
-
 
275
     */
-
 
276
    public void setModelNumber(String value) {
-
 
277
        this.modelNumber = value;
-
 
278
    }
-
 
279
 
-
 
280
    /**
-
 
281
     * 
-
 
282
     * @return modelName Model Name
-
 
283
     *     
-
 
284
     */
-
 
285
    public String getModelName() {
-
 
286
        return this.modelName;
-
 
287
    }
-
 
288
 
-
 
289
    /**
-
 
290
     * 
-
 
291
     * @param value Model Name to set
-
 
292
     *     
-
 
293
     */
-
 
294
    public void setModelName(String value) {
-
 
295
        this.modelName = value;
-
 
296
    }
-
 
297
    
156
	private static Date getCurrentTime(){
298
	private static Date getCurrentTime(){
157
	    Calendar cal = Calendar.getInstance();
299
	    Calendar cal = Calendar.getInstance();
158
	    return cal.getTime();
300
	    return cal.getTime();
159
	}
301
	}
160
}
302
}