Browse Source

-add textview for message
-change model and expand

ilhamitubagoes 4 years ago
parent
commit
75f5eb2887

+ 41 - 0
app/src/main/java/com/fusi24/rfid/data/entity/DataCategory.java

@@ -0,0 +1,41 @@
1
+package com.fusi24.rfid.data.entity;
2
+
3
+public class DataCategory {
4
+
5
+    private Integer id;
6
+    private String name;
7
+    private String description;
8
+    private String updateDate;
9
+
10
+    public Integer getId() {
11
+        return id;
12
+    }
13
+
14
+    public void setId(Integer id) {
15
+        this.id = id;
16
+    }
17
+
18
+    public String getName() {
19
+        return name;
20
+    }
21
+
22
+    public void setName(String name) {
23
+        this.name = name;
24
+    }
25
+
26
+    public String getDescription() {
27
+        return description;
28
+    }
29
+
30
+    public void setDescription(String description) {
31
+        this.description = description;
32
+    }
33
+
34
+    public String getUpdateDate() {
35
+        return updateDate;
36
+    }
37
+
38
+    public void setUpdateDate(String updateDate) {
39
+        this.updateDate = updateDate;
40
+    }
41
+}

+ 18 - 0
app/src/main/java/com/fusi24/rfid/data/entity/DataDocumentType.java

@@ -3,6 +3,8 @@ package com.fusi24.rfid.data.entity;
3
 public class DataDocumentType {
3
 public class DataDocumentType {
4
 
4
 
5
     private Integer id;
5
     private Integer id;
6
+    private DataCategory category;
7
+    private DataGroup group;
6
     private String name;
8
     private String name;
7
     private String description;
9
     private String description;
8
     private String updateDate;
10
     private String updateDate;
@@ -15,6 +17,22 @@ public class DataDocumentType {
15
         this.id = id;
17
         this.id = id;
16
     }
18
     }
17
 
19
 
20
+    public DataCategory getCategory() {
21
+        return category;
22
+    }
23
+
24
+    public void setCategory(DataCategory category) {
25
+        this.category = category;
26
+    }
27
+
28
+    public DataGroup getGroup() {
29
+        return group;
30
+    }
31
+
32
+    public void setGroup(DataGroup group) {
33
+        this.group = group;
34
+    }
35
+
18
     public String getName() {
36
     public String getName() {
19
         return name;
37
         return name;
20
     }
38
     }

+ 41 - 0
app/src/main/java/com/fusi24/rfid/data/entity/DataGroup.java

@@ -0,0 +1,41 @@
1
+package com.fusi24.rfid.data.entity;
2
+
3
+public class DataGroup {
4
+
5
+    private Integer id;
6
+    private String name;
7
+    private String description;
8
+    private boolean isActive;
9
+
10
+    public Integer getId() {
11
+        return id;
12
+    }
13
+
14
+    public void setId(Integer id) {
15
+        this.id = id;
16
+    }
17
+
18
+    public String getName() {
19
+        return name;
20
+    }
21
+
22
+    public void setName(String name) {
23
+        this.name = name;
24
+    }
25
+
26
+    public String getDescription() {
27
+        return description;
28
+    }
29
+
30
+    public void setDescription(String description) {
31
+        this.description = description;
32
+    }
33
+
34
+    public boolean isActive() {
35
+        return isActive;
36
+    }
37
+
38
+    public void setActive(boolean active) {
39
+        isActive = active;
40
+    }
41
+}

+ 9 - 0
app/src/main/java/com/fusi24/rfid/data/entity/DataProblems.java

@@ -5,6 +5,7 @@ import java.io.Serializable;
5
 public class DataProblems implements Serializable {
5
 public class DataProblems implements Serializable {
6
 
6
 
7
     private DataDocumentType documentType;
7
     private DataDocumentType documentType;
8
+    private String alertType;
8
     private String reason;
9
     private String reason;
9
     private String expiryDate;
10
     private String expiryDate;
10
 
11
 
@@ -16,6 +17,14 @@ public class DataProblems implements Serializable {
16
         this.documentType = documentType;
17
         this.documentType = documentType;
17
     }
18
     }
18
 
19
 
20
+    public String getAlertType() {
21
+        return alertType;
22
+    }
23
+
24
+    public void setAlertType(String alertType) {
25
+        this.alertType = alertType;
26
+    }
27
+
19
     public String getReason() {
28
     public String getReason() {
20
         return reason;
29
         return reason;
21
     }
30
     }

+ 5 - 2
app/src/main/java/com/fusi24/rfid/ui/scanresult/ScanResultActivity.java

@@ -108,7 +108,7 @@ public class ScanResultActivity extends BaseActivity implements ScanResultView {
108
 
108
 
109
     private void loadingdata() {
109
     private void loadingdata() {
110
         problemsList.clear();
110
         problemsList.clear();
111
-        String[] expand = {"employee.company, employee.structuralPosition, employee.functionalPosition"};
111
+        String[] expand = {"employee.company, employee.structuralPosition, employee.functionalPosition, problems.documentType.category,problems.documentType.group"};
112
         presenter.checkRfidCard(numberRfid, Integer.valueOf(idPermit), idDevice, Integer.valueOf(idCheckType), longLat, expand);
112
         presenter.checkRfidCard(numberRfid, Integer.valueOf(idPermit), idDevice, Integer.valueOf(idCheckType), longLat, expand);
113
     }
113
     }
114
 
114
 
@@ -180,7 +180,10 @@ public class ScanResultActivity extends BaseActivity implements ScanResultView {
180
         }
180
         }
181
 
181
 
182
         if (dataResultRfid.getMessage() != null) {
182
         if (dataResultRfid.getMessage() != null) {
183
-            Toast.makeText(this, dataResultRfid.getMessage(), Toast.LENGTH_SHORT).show();
183
+            binding.tvMessage.setVisibility(View.VISIBLE);
184
+            binding.tvMessage.setText(dataResultRfid.getMessage());
185
+        } else {
186
+            binding.tvMessage.setVisibility(View.GONE);
184
         }
187
         }
185
 
188
 
186
         problemsList = dataResultRfid.getProblems();
189
         problemsList = dataResultRfid.getProblems();

+ 15 - 2
app/src/main/res/layout/activity_scan_result_new.xml

@@ -136,12 +136,25 @@
136
 
136
 
137
             </LinearLayout>
137
             </LinearLayout>
138
 
138
 
139
+            <TextView
140
+                android:id="@+id/tv_message"
141
+                style="@style/CommonText"
142
+                android:layout_width="match_parent"
143
+                android:layout_height="wrap_content"
144
+                android:textColor="@color/colorBlack"
145
+                android:layout_below="@id/ll_profile_status"
146
+                android:layout_margin="16dp"
147
+                android:padding="8dp"
148
+                android:gravity="center"
149
+                android:visibility="gone"
150
+                tools:text="Karyawan ini sudah login pada pukul 16.32 WIB" />
151
+
139
             <androidx.recyclerview.widget.RecyclerView
152
             <androidx.recyclerview.widget.RecyclerView
140
                 android:id="@+id/rv_document_problem"
153
                 android:id="@+id/rv_document_problem"
141
                 android:layout_width="match_parent"
154
                 android:layout_width="match_parent"
142
                 android:layout_height="wrap_content"
155
                 android:layout_height="wrap_content"
143
-                android:layout_margin="16dp"
144
-                android:layout_below="@+id/ll_profile_status"
156
+                android:layout_margin="8dp"
157
+                android:layout_below="@+id/tv_message"
145
                 tools:listitem="@layout/row_document"
158
                 tools:listitem="@layout/row_document"
146
                 tools:itemCount="2"/>
159
                 tools:itemCount="2"/>
147
 
160