Browse Source

-Add id user who scan
-Fix device id using IMEI

ilhamitubagoes 4 years ago
parent
commit
77c1ed4408

+ 2 - 2
app/src/main/java/com/fusi24/rfid/data/DataManager.java

@@ -36,8 +36,8 @@ public class DataManager {
36
         return restService.getDataDevice(deviceId, expand);
36
         return restService.getDataDevice(deviceId, expand);
37
     }
37
     }
38
 
38
 
39
-    public Observable<DataResultRfid> checkRfidCard(String numberRfid, Integer permitId, String rfidDeviceId, Integer checkTypeId, String longLat, String[] expand) {
40
-        return restService.checkRfidCard(numberRfid, permitId, rfidDeviceId, checkTypeId, longLat, expand);
39
+    public Observable<DataResultRfid> checkRfidCard(String numberRfid, Integer permitId, String rfidDeviceId, Integer checkTypeId, String longLat, Integer userId, String[] expand) {
40
+        return restService.checkRfidCard(numberRfid, permitId, rfidDeviceId, checkTypeId, longLat, userId, expand);
41
     }
41
     }
42
 
42
 
43
 }
43
 }

+ 1 - 0
app/src/main/java/com/fusi24/rfid/data/api/RestService.java

@@ -43,6 +43,7 @@ public interface RestService {
43
                                              @Query("rfidDeviceId") String rfidDeviceId,
43
                                              @Query("rfidDeviceId") String rfidDeviceId,
44
                                              @Query("checkTypeId") Integer checkTypeId,
44
                                              @Query("checkTypeId") Integer checkTypeId,
45
                                              @Query("longLat") String longLat,
45
                                              @Query("longLat") String longLat,
46
+                                             @Query("checkedBy") Integer userId,
46
                                              @Query("expand") String[] expand);
47
                                              @Query("expand") String[] expand);
47
 
48
 
48
 }
49
 }

+ 1 - 1
app/src/main/java/com/fusi24/rfid/ui/home/HomeActivity.java

@@ -133,7 +133,7 @@ public class HomeActivity extends BaseActivity implements HomeView, StatusScanAd
133
     @SuppressLint("SetTextI18n")
133
     @SuppressLint("SetTextI18n")
134
     private void loadingData() {
134
     private void loadingData() {
135
         // Build.DISPLAY is different
135
         // Build.DISPLAY is different
136
-        idDevice = "RFID" + "-" + Build.ID + "-" + Build.DEVICE + "-" + uniqueId;
136
+        idDevice = "RFID" + "-" + Build.ID + "-" + uniqueId;
137
         binding.tvRfidGunId.setText(idDevice);
137
         binding.tvRfidGunId.setText(idDevice);
138
         binding.tvRfidCardNumber.setText(getSessionManager().getUserRfidNumber());
138
         binding.tvRfidCardNumber.setText(getSessionManager().getUserRfidNumber());
139
         binding.tvEmployeeName.setText(getSessionManager().getEmployeeName());
139
         binding.tvEmployeeName.setText(getSessionManager().getEmployeeName());

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

@@ -112,7 +112,11 @@ public class ScanResultActivity extends BaseActivity implements ScanResultView {
112
     private void loadingdata() {
112
     private void loadingdata() {
113
         problemsList.clear();
113
         problemsList.clear();
114
         String[] expand = {"employee.company, employee.structuralPosition, employee.functionalPosition, problems.documentType.category,problems.documentType.group"};
114
         String[] expand = {"employee.company, employee.structuralPosition, employee.functionalPosition, problems.documentType.category,problems.documentType.group"};
115
-        presenter.checkRfidCard(numberRfid, Integer.valueOf(idPermit), idDevice, Integer.valueOf(idCheckType), longLat, expand);
115
+
116
+        String bebas = "Location = " + longLat;
117
+        Toast.makeText(this, bebas, Toast.LENGTH_LONG).show();
118
+
119
+        presenter.checkRfidCard(numberRfid, Integer.valueOf(idPermit), idDevice, Integer.valueOf(idCheckType), longLat, getSessionManager().getUserId(), expand);
116
     }
120
     }
117
 
121
 
118
     private void initEvent() {
122
     private void initEvent() {

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

@@ -18,8 +18,8 @@ class ScanResultPresenter extends BasePresenter<ScanResultView> {
18
         this.processScheduler = processScheduler;
18
         this.processScheduler = processScheduler;
19
     }
19
     }
20
 
20
 
21
-    void checkRfidCard(String numberRfid, Integer permitId, String rfidDeviceId, Integer checkTypeId, String longLat, String[] expand) {
22
-        disposable.add(manager.checkRfidCard(numberRfid, permitId, rfidDeviceId, checkTypeId, longLat, expand)
21
+    void checkRfidCard(String numberRfid, Integer permitId, String rfidDeviceId, Integer checkTypeId, String longLat, Integer userId, String[] expand) {
22
+        disposable.add(manager.checkRfidCard(numberRfid, permitId, rfidDeviceId, checkTypeId, longLat, userId, expand)
23
                 .observeOn(androidScheduler)
23
                 .observeOn(androidScheduler)
24
                 .subscribeOn(processScheduler)
24
                 .subscribeOn(processScheduler)
25
                 .subscribe(dataRfid -> {
25
                 .subscribe(dataRfid -> {