1 package fr.ifremer.tutti.service.pupitri.csv;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25 import fr.ifremer.tutti.persistence.entities.data.FishingOperation;
26 import fr.ifremer.tutti.service.pupitri.BoxType;
27 import fr.ifremer.tutti.service.pupitri.Directions;
28 import fr.ifremer.tutti.service.pupitri.Signs;
29 import org.apache.commons.lang3.time.DateUtils;
30
31 import java.io.Serializable;
32 import java.util.Date;
33
34
35
36
37
38 public class CarrouselRow implements Serializable {
39
40 private static final long serialVersionUID = 1L;
41
42 public static final String PROPERTY_FILE_ORIGIN = "fileOrigin";
43
44 public static final String PROPERTY_DATE = "date";
45
46 public static final String PROPERTY_TIME = "time";
47
48 public static final String PROPERTY_BALANCE_ID = "balanceId";
49
50 public static final String PROPERTY_TO_CONFIRM = "toConfirm";
51
52 public static final String PROPERTY_OPERATION_CODE = "operationCode";
53
54 public static final String PROPERTY_RIG_NUMBER = "rigNumber";
55
56 public static final String PROPERTY_BOX_TYPE = "boxType";
57
58 public static final String PROPERTY_SPECIES_ID = "speciesId";
59
60 public static final String PROPERTY_SIGN = "sign";
61
62 public static final String PROPERTY_DIRECTION = "direction";
63
64 public static final String PROPERTY_WEIGHT = "weight";
65
66 protected String operationCode;
67
68 protected Date date;
69
70 protected String speciesId;
71
72 protected Signs sign;
73
74 protected Directions direction;
75
76 protected Float weight;
77
78 protected BoxType boxType;
79
80 public boolean acceptOperation(FishingOperation operation) {
81 return operationCode.equals(operation.getStationNumber())
82 && DateUtils.isSameDay(date, operation.getGearShootingStartDate());
83 }
84
85 public String getOperationCode() {
86 return operationCode;
87 }
88
89 public void setOperationCode(String operationCode) {
90 this.operationCode = operationCode;
91 }
92
93 public Date getDate() {
94 return date;
95 }
96
97 public void setDate(Date date) {
98 this.date = date;
99 }
100
101 public String getSpeciesId() {
102 return speciesId;
103 }
104
105 public void setSpeciesId(String speciesId) {
106 this.speciesId = speciesId;
107 }
108
109 public Signs getSign() {
110 return sign;
111 }
112
113 public void setSign(Signs sign) {
114 if (Signs.UNSORTED.equals(sign)) {
115
116
117 sign = Signs.DEFAULT;
118 }
119 this.sign = sign;
120 }
121
122 public Directions getDirection() {
123 return direction;
124 }
125
126 public void setDirection(Directions direction) {
127 this.direction = direction;
128 }
129
130 public Float getWeight() {
131 return weight;
132 }
133
134 public void setWeight(Float weight) {
135 this.weight = weight;
136 }
137
138 public boolean isSorted() {
139
140 return Directions.VAT == direction;
141
142 }
143
144 public BoxType getBoxType() {
145 return boxType;
146 }
147
148 public void setBoxType(BoxType boxType) {
149 this.boxType = boxType;
150 }
151 }