|
@@ -329,61 +329,60 @@ public class DoubleVerifyActivityHelp {
|
|
|
private void startQrTimer() {
|
|
private void startQrTimer() {
|
|
|
if (null != qrTimer) {
|
|
if (null != qrTimer) {
|
|
|
qrTimer.cancel();
|
|
qrTimer.cancel();
|
|
|
- qrTimer.start();
|
|
|
|
|
- } else {
|
|
|
|
|
- qrTimer = new CountDownTimer(3000, 1000) {
|
|
|
|
|
- @Override
|
|
|
|
|
- public void onTick(long millisUntilFinished) {
|
|
|
|
|
|
|
+ qrTimer = null;
|
|
|
|
|
+ }
|
|
|
|
|
+ qrTimer = new CountDownTimer(3000, 1000) {
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void onTick(long millisUntilFinished) {
|
|
|
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- @Override
|
|
|
|
|
- public void onFinish() {
|
|
|
|
|
- if (activity.detectType != DetectType.SCAN_DETECT) {
|
|
|
|
|
- qrTimer.cancel();
|
|
|
|
|
- qrTimer = null;
|
|
|
|
|
- } else {
|
|
|
|
|
- ThreadUtils.executeByCached(new ThreadUtils.SimpleTask<UserValidationBean>() {
|
|
|
|
|
- @Override
|
|
|
|
|
- public UserValidationBean doInBackground() throws Throwable {
|
|
|
|
|
- List<HxpCabinetDoorVo> planAddDataDoorList = activity.planAddData.getDoorList();
|
|
|
|
|
- List<String> doorIdList = new ArrayList<>();
|
|
|
|
|
- if (null != planAddDataDoorList && !planAddDataDoorList.isEmpty()) {
|
|
|
|
|
- for (int i = 0; i < planAddDataDoorList.size(); i++) {
|
|
|
|
|
- doorIdList.add(String.valueOf(planAddDataDoorList.get(i).getDoorId()));
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void onFinish() {
|
|
|
|
|
+ if (activity.detectType != DetectType.SCAN_DETECT) {
|
|
|
|
|
+ qrTimer.cancel();
|
|
|
|
|
+ qrTimer = null;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ ThreadUtils.executeByCached(new ThreadUtils.SimpleTask<UserValidationBean>() {
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public UserValidationBean doInBackground() throws Throwable {
|
|
|
|
|
+ List<HxpCabinetDoorVo> planAddDataDoorList = activity.planAddData.getDoorList();
|
|
|
|
|
+ List<String> doorIdList = new ArrayList<>();
|
|
|
|
|
+ if (null != planAddDataDoorList && !planAddDataDoorList.isEmpty()) {
|
|
|
|
|
+ for (int i = 0; i < planAddDataDoorList.size(); i++) {
|
|
|
|
|
+ doorIdList.add(String.valueOf(planAddDataDoorList.get(i).getDoorId()));
|
|
|
}
|
|
}
|
|
|
- Response response = HttpTool.aioScanLogin1(qrScanTime, ChemicalApp.subjectId, doorIdList);
|
|
|
|
|
- if (response.isSuccessful()) {
|
|
|
|
|
- String json = response.body().string();
|
|
|
|
|
- JSONObject jsonObject = new JSONObject(json);
|
|
|
|
|
- int code = jsonObject.getInt("code");
|
|
|
|
|
- if (200 == code) {
|
|
|
|
|
- return GsonUtils.fromJson(jsonObject.getJSONObject("data").toString(), UserValidationBean.class);
|
|
|
|
|
- } else {
|
|
|
|
|
- PopTip.show(jsonObject.getString("message"));
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+ Response response = HttpTool.aioScanLogin1(qrScanTime, ChemicalApp.subjectId, doorIdList);
|
|
|
|
|
+ if (response.isSuccessful()) {
|
|
|
|
|
+ String json = response.body().string();
|
|
|
|
|
+ JSONObject jsonObject = new JSONObject(json);
|
|
|
|
|
+ int code = jsonObject.getInt("code");
|
|
|
|
|
+ if (200 == code) {
|
|
|
|
|
+ return GsonUtils.fromJson(jsonObject.getJSONObject("data").toString(), UserValidationBean.class);
|
|
|
} else {
|
|
} else {
|
|
|
- PopTip.show(response.message());
|
|
|
|
|
|
|
+ PopTip.show(jsonObject.getString("message"));
|
|
|
}
|
|
}
|
|
|
- return null;
|
|
|
|
|
|
|
+ } else {
|
|
|
|
|
+ PopTip.show(response.message());
|
|
|
}
|
|
}
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- @Override
|
|
|
|
|
- public void onSuccess(UserValidationBean result) {
|
|
|
|
|
- if (null != result) {
|
|
|
|
|
- qrTimer.cancel();
|
|
|
|
|
- qrTimer = null;
|
|
|
|
|
- verifyProcess(result);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void onSuccess(UserValidationBean result) {
|
|
|
|
|
+ if (null != result) {
|
|
|
|
|
+ qrTimer.cancel();
|
|
|
|
|
+ qrTimer = null;
|
|
|
|
|
+ verifyProcess(result);
|
|
|
}
|
|
}
|
|
|
- });
|
|
|
|
|
- qrTimer.start();
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ qrTimer.start();
|
|
|
}
|
|
}
|
|
|
- };
|
|
|
|
|
- qrTimer.start();
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+ };
|
|
|
|
|
+ qrTimer.start();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private void switchDetectUi(DetectType detectType, boolean isFirst) {
|
|
private void switchDetectUi(DetectType detectType, boolean isFirst) {
|