|
|
@@ -98,6 +98,7 @@ public class LogoutEtcStep3Activity extends AppActivity { |
|
|
|
|
|
|
|
// 设备相关 |
|
|
|
private boolean hasDevice = false; // 是否有设备需要注销 |
|
|
|
private int currentStepNo = 1; // 当前步骤号,从1开始 |
|
|
|
|
|
|
|
@Override |
|
|
|
protected View getLayoutView() { |
|
|
@@ -471,6 +472,9 @@ public class LogoutEtcStep3Activity extends AppActivity { |
|
|
|
*/ |
|
|
|
private void executeLogoutCommand() { |
|
|
|
Log.i(this.getClass().getSimpleName(), "开始执行注销指令流程"); |
|
|
|
// 重置步骤号 |
|
|
|
currentStepNo = 1; |
|
|
|
Log.i(this.getClass().getSimpleName(), "重置步骤号为: " + currentStepNo); |
|
|
|
// 第一步:指令初始化 |
|
|
|
initLogoutCommand(); |
|
|
|
} |
|
|
@@ -573,11 +577,11 @@ public class LogoutEtcStep3Activity extends AppActivity { |
|
|
|
params.put("cmd", command); // 指令 |
|
|
|
params.put("cmdResult", result); // 指令结果 |
|
|
|
params.put("customerId", customerId); // 客户ID |
|
|
|
params.put("stepNo", 1); // 步骤号,从1开始(表示第一步) |
|
|
|
params.put("stepNo", currentStepNo); // 当前步骤号 |
|
|
|
params.put("transOrderId", transOrderId); // 指令编号 |
|
|
|
|
|
|
|
Log.i(this.getClass().getSimpleName(), "指令回传 请求参数:" + JSONObject.toJSONString(params)); |
|
|
|
Log.i(this.getClass().getSimpleName(), "指令回传 指令:" + command + ", 指令编号:" + transOrderId + ", 指令结果:" + result); |
|
|
|
Log.i(this.getClass().getSimpleName(), "指令回传 当前步骤:" + currentStepNo + ", 指令:" + command + ", 指令编号:" + transOrderId + ", 指令结果:" + result); |
|
|
|
|
|
|
|
MyRetrofit.newInstanceGZ(this, IFCode.IFCODE_DEVICE_CANCEL_INST_CALLBACK, params, new MyRetrofit.ReturnResult() { |
|
|
|
@Override |
|
|
@@ -602,12 +606,13 @@ public class LogoutEtcStep3Activity extends AppActivity { |
|
|
|
// 检查是否需要继续写卡(根据stepNo判断) |
|
|
|
// stepNo是"下一步骤号",如果大于0表示还有下一步,如果为0或null表示完成 |
|
|
|
if (stepNo != null && stepNo > 0) { |
|
|
|
// 需要继续写卡,递归调用 |
|
|
|
Log.i(this.getClass().getSimpleName(), "需要继续写卡,下一步骤号: " + stepNo); |
|
|
|
// 需要继续写卡,更新当前步骤号并递归调用 |
|
|
|
currentStepNo = stepNo; |
|
|
|
Log.i(this.getClass().getSimpleName(), "需要继续写卡,下一步骤号: " + stepNo + ",当前步骤号更新为: " + currentStepNo + ",开始下一轮循环"); |
|
|
|
executeWriteCard(cmd, transOrderId); |
|
|
|
} else { |
|
|
|
// 写卡完成,注销成功 |
|
|
|
Log.i(this.getClass().getSimpleName(), "写卡完成,注销成功,步骤号: " + stepNo); |
|
|
|
Log.i(this.getClass().getSimpleName(), "写卡完成,注销成功,步骤号: " + stepNo + ",循环结束"); |
|
|
|
confirmLogoutEtc(20); |
|
|
|
} |
|
|
|
} else { |