|
|
@@ -23,12 +23,14 @@ import com.huntersun.vkyes.etcopencard.project.api.bean.SendTheVerificationCodeB |
|
|
|
import com.huntersun.vkyes.etcopencard.project.bluetooth.BluetoothWriteCardWriteTab; |
|
|
|
import com.huntersun.vkyes.etcopencard.project.dialog.ConfirmDialog; |
|
|
|
import com.huntersun.vkyes.etcopencard.project.tool.MyShared; |
|
|
|
import com.huntersun.vkyes.etcopencard.project.utils.Constants; |
|
|
|
import com.huntersun.vkyes.etcopencard.project.tool.Utils; |
|
|
|
import com.huntersun.vkyes.etcopencard.project.utils.FunHelper; |
|
|
|
import com.huntersun.vkyes.etcopencard.src.aop.SingleClick; |
|
|
|
import com.huntersun.vkyes.etcopencard.src.app.AppActivity; |
|
|
|
import com.huntersun.vkyes.etcopencard.src.other.CodeCountDown; |
|
|
|
import com.huntersun.vkyes.etcopencard.src.other.AppConfig; |
|
|
|
import com.hjq.toast.ToastUtils; |
|
|
|
|
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.Map; |
|
|
@@ -75,6 +77,11 @@ public class LogoutEtcStep3Activity extends AppActivity { |
|
|
|
private String agentIdCardFrontUrl; |
|
|
|
private String agentIdCardBackUrl; |
|
|
|
private String agentProxyDocUrl; |
|
|
|
|
|
|
|
// 其他必要参数 |
|
|
|
private String customerId; |
|
|
|
private String userName; |
|
|
|
private String vehicleId; |
|
|
|
|
|
|
|
@Override |
|
|
|
protected View getLayoutView() { |
|
|
@@ -108,6 +115,11 @@ public class LogoutEtcStep3Activity extends AppActivity { |
|
|
|
agentIdCardBackUrl = getIntent().getStringExtra("agentIdCardBackUrl"); |
|
|
|
agentProxyDocUrl = getIntent().getStringExtra("agentProxyDocUrl"); |
|
|
|
|
|
|
|
// 接收其他必要参数 |
|
|
|
customerId = getIntent().getStringExtra("customerId"); |
|
|
|
userName = getIntent().getStringExtra("userName"); |
|
|
|
vehicleId = getIntent().getStringExtra("vehicleId"); |
|
|
|
|
|
|
|
curBizContent = JSONObject.parseObject(getIntent().getStringExtra("content"), ResultBean.BizContent.class); |
|
|
|
} catch (JsonParseException e) { |
|
|
|
// toast("json数据加载错误"); |
|
|
@@ -188,39 +200,37 @@ public class LogoutEtcStep3Activity extends AppActivity { |
|
|
|
@Override |
|
|
|
@SingleClick |
|
|
|
public void onClick(View view) { |
|
|
|
sendCode(); |
|
|
|
sendSmsCode(); |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
binding.btnNext.setOnClickListener(new View.OnClickListener() { |
|
|
|
@Override |
|
|
|
public void onClick(View view) { |
|
|
|
checkParams(); |
|
|
|
checkSmsCode(); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
private void checkParams() { |
|
|
|
private void checkSmsCode() { |
|
|
|
|
|
|
|
if (FunHelper.isEmpty(FunHelper.getText(binding.etCode))) { |
|
|
|
toast("请输入验证码!"); |
|
|
|
ToastUtils.show("请输入验证码!"); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
checkUser(); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 校验用户 |
|
|
|
*/ |
|
|
|
private void checkUser() { |
|
|
|
Map<String, String> params = new HashMap<>(); |
|
|
|
params.put("mobile", curBizContent.getCustomerTel()); |
|
|
|
if (AppConfig.isMockDataEnabled()) { |
|
|
|
params.put("mobile", "13161414015"); |
|
|
|
} else { |
|
|
|
params.put("mobile", curBizContent.getCustomerTel()); |
|
|
|
} |
|
|
|
params.put("businessType", "5"); |
|
|
|
params.put("code", FunHelper.getText(binding.etCode)); |
|
|
|
MyRetrofit.newInstanceGZ(this,IFCode.IFCODE966, params, new MyRetrofit.ReturnResult() { |
|
|
|
MyRetrofit.newInstanceGZ(this,IFCode.IFCODE967, params, new MyRetrofit.ReturnResult() { |
|
|
|
@Override |
|
|
|
public void onSuccess(ResultBean resultBean, ResultBean.BizContent bizContent) { |
|
|
|
doLogoutEtc(); |
|
|
|
submitLogoutEtcApply(); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
@@ -261,9 +271,9 @@ public class LogoutEtcStep3Activity extends AppActivity { |
|
|
|
/** |
|
|
|
* 发送验证码 |
|
|
|
*/ |
|
|
|
private void sendCode() { |
|
|
|
Log.i("sendCode", "curBizContent.getCustomerTel():" + curBizContent.getCustomerTel()); |
|
|
|
Log.i("sendCode", "curBizContent:" + JSONObject.toJSONString(curBizContent)); |
|
|
|
private void sendSmsCode() { |
|
|
|
Log.i(this.getClass().getSimpleName(), "curBizContent.getCustomerTel():" + curBizContent.getCustomerTel()); |
|
|
|
Log.i(this.getClass().getSimpleName(), "curBizContent:" + JSONObject.toJSONString(curBizContent)); |
|
|
|
Map<String, String> params = new HashMap<>(); |
|
|
|
if (AppConfig.isMockDataEnabled()) { |
|
|
|
params.put("mobile", "13161414015"); |
|
|
@@ -274,7 +284,7 @@ public class LogoutEtcStep3Activity extends AppActivity { |
|
|
|
MyRetrofit.newInstanceGZ(this,IFCode.IFCODE2, params, new MyRetrofit.ReturnResult() { |
|
|
|
@Override |
|
|
|
public void onSuccess(ResultBean resultBean, ResultBean.BizContent bizContent) { |
|
|
|
toast("验证码发送成功!"); |
|
|
|
ToastUtils.show("验证码发送成功!"); |
|
|
|
mCountDownTimerUtils = new CodeCountDown(LogoutEtcStep3Activity.this, binding.mGetCodeBtn, 60000, 1000); |
|
|
|
mCountDownTimerUtils.start(); |
|
|
|
} |
|
|
@@ -286,29 +296,66 @@ public class LogoutEtcStep3Activity extends AppActivity { |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 注销ETC |
|
|
|
* 提交注销ETC申请 |
|
|
|
*/ |
|
|
|
private void doLogoutEtc() { |
|
|
|
private void submitLogoutEtcApply() { |
|
|
|
HashMap<String, Object> params = new HashMap<>(); |
|
|
|
|
|
|
|
// 基础认证信息 |
|
|
|
params.put("accessToken", MyShared.getInstance().get(MyShared.ACCESSTOKEN, "")); |
|
|
|
params.put("loginSource", Constants.LOGIN_SOURCE); |
|
|
|
params.put("staffId", MyShared.getInstance().get(MyShared.STAFFID, "")); |
|
|
|
|
|
|
|
// 办理人信息 |
|
|
|
params.put("agentName", agentName); |
|
|
|
params.put("agentIdNum", agentIdNum); |
|
|
|
params.put("agentIdType", 101); // 身份证类型,固定为101 |
|
|
|
params.put("agentIdVld", agentIdVld); |
|
|
|
params.put("agentAddress", agentAddress); |
|
|
|
params.put("agentTel", agentTel); |
|
|
|
params.put("agentPosImgUrl", agentIdCardFrontUrl); // 身份证正面 |
|
|
|
params.put("agentNegImgUrl", agentIdCardBackUrl); // 身份证反面 |
|
|
|
params.put("proxyUrl", agentProxyDocUrl); // 委托书 |
|
|
|
|
|
|
|
// 卡签信息 |
|
|
|
params.put("cardId", curBizContent.getCardId()); |
|
|
|
params.put("obuId", curBizContent.getObuId()); |
|
|
|
params.put("cosProvider", isDamage == 2 ? "1" : "0"); |
|
|
|
params.put("hasCard", hasCard); |
|
|
|
params.put("hasObu", hasOBU); |
|
|
|
params.put("licenseFrontUrl", imgUrl1); |
|
|
|
params.put("cancelImgUrl", "111111"); |
|
|
|
params.put("licenseReverseUrl", imgUrl2); |
|
|
|
params.put("serviceType", 3); |
|
|
|
params.put("signId", getIntent().getStringExtra("signId")); |
|
|
|
params.put("signReason", FunHelper.getText(binding.tvReason).equals("其他") ? FunHelper.getText(binding.etReason) : FunHelper.getText(binding.tvReason)); |
|
|
|
MyRetrofit.newInstanceGZ(this, IFCode.IFCODE_CANCLE_APPLY, params, new MyRetrofit.ReturnResult() { |
|
|
|
params.put("cardType", curBizContent.getIsValueCard()); // CHARGE_CARD, STORED_VALUE_CARD等 |
|
|
|
params.put("hasDevice", isDamage == 2); // 能否连接设备,根据是否损坏判断 |
|
|
|
|
|
|
|
// 车辆信息 |
|
|
|
params.put("vehicleId", vehicleId); |
|
|
|
params.put("vehPosImgUrl", imgUrl1); // 行驶证正面 |
|
|
|
params.put("vehNegImgUrl", imgUrl2); // 行驶证反面 |
|
|
|
|
|
|
|
// 用户信息 |
|
|
|
params.put("customerId", customerId); |
|
|
|
params.put("userName", userName); |
|
|
|
params.put("userMobile", curBizContent.getCustomerTel()); |
|
|
|
|
|
|
|
// 注销信息 |
|
|
|
params.put("reason", FunHelper.getText(binding.tvReason).equals("其他") ? FunHelper.getText(binding.etReason) : FunHelper.getText(binding.tvReason)); |
|
|
|
params.put("operateType", "BANK"); // 退款方式,记账卡默认银行退款 |
|
|
|
|
|
|
|
// 银行信息(记账卡需要) |
|
|
|
if ("CHARGE_CARD".equals(curBizContent.getIsValueCard())) { |
|
|
|
params.put("bankName", bank); |
|
|
|
params.put("bankBranchName", bankBranch); |
|
|
|
params.put("bankIdCode", bankNum); |
|
|
|
params.put("bankProvince", ""); // 需要从银行信息中获取省份 |
|
|
|
} |
|
|
|
|
|
|
|
Log.i(this.getClass().getSimpleName(), "设备注销申请 请求参数:" + JSONObject.toJSONString(params)); |
|
|
|
MyRetrofit.newInstanceGZ(this, IFCode.IFCODE_DEVICE_CANCEL_APPLY, params, new MyRetrofit.ReturnResult() { |
|
|
|
@Override |
|
|
|
public void onSuccess(ResultBean resultBean, ResultBean.BizContent bizContent) { |
|
|
|
Log.i(this.getClass().getSimpleName(), "设备注销申请 响应数据:" + JSONObject.toJSONString(resultBean)); |
|
|
|
confirmLogoutEtc(0); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public void onError(Response<Result> resp) { |
|
|
|
Log.e(this.getClass().getSimpleName(), "设备注销申请失败: " + (resp != null ? resp.message() : "未知错误")); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
@@ -326,25 +373,25 @@ public class LogoutEtcStep3Activity extends AppActivity { |
|
|
|
/** |
|
|
|
* 写卡->确认注销 |
|
|
|
*/ |
|
|
|
private void toWriteCommand(ResultBean.BizContent bizContent) { |
|
|
|
BluetoothWriteCardWriteTab.writeCommandToCardWithCode51( |
|
|
|
this, true, bizContent.getCommand(), curBizContent.getCardId(), |
|
|
|
9, bizContent.getCosRecordId(), new BluetoothWriteCardWriteTab.Callback() { |
|
|
|
public void success(int Plk) { |
|
|
|
confirmLogoutEtc(20); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public void fail(String str) { |
|
|
|
new ConfirmDialog.Builder(LogoutEtcStep3Activity.this).setMsg(str, "", "确定", "", R.mipmap.icon_lotgout_etc_hint, 0, true) |
|
|
|
.onClick(new ConfirmDialog.Result() { |
|
|
|
@Override |
|
|
|
public void confirm() { |
|
|
|
} |
|
|
|
}).show(); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
// private void toWriteCommand(ResultBean.BizContent bizContent) { |
|
|
|
// BluetoothWriteCardWriteTab.writeCommandToCardWithCode51( |
|
|
|
// this, true, bizContent.getCommand(), curBizContent.getCardId(), |
|
|
|
// 9, bizContent.getCosRecordId(), new BluetoothWriteCardWriteTab.Callback() { |
|
|
|
// public void success(int Plk) { |
|
|
|
// confirmLogoutEtc(20); |
|
|
|
// } |
|
|
|
|
|
|
|
// @Override |
|
|
|
// public void fail(String str) { |
|
|
|
// new ConfirmDialog.Builder(LogoutEtcStep3Activity.this).setMsg(str, "", "确定", "", R.mipmap.icon_lotgout_etc_hint, 0, true) |
|
|
|
// .onClick(new ConfirmDialog.Result() { |
|
|
|
// @Override |
|
|
|
// public void confirm() { |
|
|
|
// } |
|
|
|
// }).show(); |
|
|
|
// } |
|
|
|
// }); |
|
|
|
// } |
|
|
|
|
|
|
|
@Override |
|
|
|
protected void initData() { |