Bladeren bron

feat: 设备激活照片存储接口联调

master
huting 2 jaren geleden
bovenliggende
commit
022446a427

+ 3
- 1
app/src/main/java/com/huntersun/vkyes/etcopencard/project/api/bean/IFCode.java Bestand weergeven

public static final String IFCODE33 = "33"; //单位信息变更 public static final String IFCODE33 = "33"; //单位信息变更
public static final String IFCODE34 = "34"; //车辆信息变更 public static final String IFCODE34 = "34"; //车辆信息变更


public static final String IFCODE914 = "914"; //订单产品选择
public static final String IFCODE914 = "914"; //下单-订单产品选择


public static final String IFCODE_TRANSFER_APPLY = "47631d58945642afa053e07c306e99e6"; //过户接口 public static final String IFCODE_TRANSFER_APPLY = "47631d58945642afa053e07c306e99e6"; //过户接口
public static final String IFCODE_TRANSFER_CHECK = "54dafed574f5475ea88b50eed9c58486"; //过户检测接口 public static final String IFCODE_TRANSFER_CHECK = "54dafed574f5475ea88b50eed9c58486"; //过户检测接口
public static final String IFCODE_TRANSFER_CONFIRM = "b1e66d22fb6f400f915458f5c50c7118"; //操作接口 public static final String IFCODE_TRANSFER_CONFIRM = "b1e66d22fb6f400f915458f5c50c7118"; //操作接口

public static final String IFCODE_ACTIVE_OBUIMG = "4a95e1d90e824ee8a50aa9826617e736"; //设备激活照片上传
} }

+ 9
- 6
app/src/main/java/com/huntersun/vkyes/etcopencard/project/ui/activity/DefrayActivity.java Bestand weergeven

* *
* @author admin * @author admin
*/ */
public class DefrayActivity extends AppActivity implements StatusAction {
public class DefrayActivity extends AppActivity {//implements StatusAction


private ActivityDefrayBinding binding; private ActivityDefrayBinding binding;


fatherBean.bizContent.setPayConfigId(Constants.PAY_CONFIG_ID); //支付配置编号 fatherBean.bizContent.setPayConfigId(Constants.PAY_CONFIG_ID); //支付配置编号
// 15885137270 // 15885137270
Log.e("okhttp", "打印标题:" + new Gson().toJson(fatherBean)); Log.e("okhttp", "打印标题:" + new Gson().toJson(fatherBean));
showLoading();
//提交车辆信息 //提交车辆信息
//showLoading();
showDialog("请稍后...");
RequestParameters parameters1 = new RequestParameters(IFCode.IFCODE56, new Gson().toJson(fatherBean.bizContent)); RequestParameters parameters1 = new RequestParameters(IFCode.IFCODE56, new Gson().toJson(fatherBean.bizContent));
new MyRetrofit().getRetrofit().create(Api.class).message2(parameters1).enqueue(new Converter<Result>(this) { new MyRetrofit().getRetrofit().create(Api.class).message2(parameters1).enqueue(new Converter<Result>(this) {
@SuppressLint("SetTextI18n") @SuppressLint("SetTextI18n")
@Override @Override
protected void onSuccess(ResultBean resultBean, ResultBean.BizContent bizContent1) { protected void onSuccess(ResultBean resultBean, ResultBean.BizContent bizContent1) {
hideDialog(); hideDialog();
showComplete();
//showComplete();
//二维码生成 //二维码生成
Bitmap bitmap = QRCode.createQRCodeBitmap(bizContent1.getCodeUrl(), 800, 800, Bitmap bitmap = QRCode.createQRCodeBitmap(bizContent1.getCodeUrl(), 800, 800,
"UTF-8", "H", "1", Color.BLACK, Color.WHITE); "UTF-8", "H", "1", Color.BLACK, Color.WHITE);
@Override @Override
public void onError(String err, Response<Result> resp) { public void onError(String err, Response<Result> resp) {
super.onError(err, resp); super.onError(err, resp);
showError(layout -> initData());
//showError(layout -> initData());
hideDialog();
} }
}); });
} }
}); });
} }


@Override
/*@Override
public StatusLayout getStatusLayout() { public StatusLayout getStatusLayout() {
return binding.hlStatusHint; return binding.hlStatusHint;
}
}*/
} }

+ 18
- 0
app/src/main/java/com/huntersun/vkyes/etcopencard/project/ui/activity/obu/ObuActivationBLESearchActivity.java Bestand weergeven

import com.huntersun.vkyes.etcopencard.project.copapply.ObuActivateRequester; import com.huntersun.vkyes.etcopencard.project.copapply.ObuActivateRequester;
import com.huntersun.vkyes.etcopencard.project.copapply.ObuActivation; import com.huntersun.vkyes.etcopencard.project.copapply.ObuActivation;
import com.huntersun.vkyes.etcopencard.project.dialog.ConfirmDialog; import com.huntersun.vkyes.etcopencard.project.dialog.ConfirmDialog;
import com.huntersun.vkyes.etcopencard.project.tool.Utils;
import com.huntersun.vkyes.etcopencard.project.ui.activity.after.PetCardToAccountCardStep4Activity; import com.huntersun.vkyes.etcopencard.project.ui.activity.after.PetCardToAccountCardStep4Activity;
import com.huntersun.vkyes.etcopencard.project.utils.FunHelper;
import com.huntersun.vkyes.etcopencard.src.app.AppActivity; import com.huntersun.vkyes.etcopencard.src.app.AppActivity;
import com.jeremyliao.liveeventbus.LiveEventBus; import com.jeremyliao.liveeventbus.LiveEventBus;




private String vehicleId; //车牌编号 private String vehicleId; //车牌编号
private String orderId; //订单ID private String orderId; //订单ID
private String cardId; //卡ID
private String obuId; //obuId


//蓝牙链接状态 //蓝牙链接状态
private boolean isConnect; private boolean isConnect;


vehicleId = getIntent().getStringExtra("vehicleId"); vehicleId = getIntent().getStringExtra("vehicleId");
orderId = getIntent().getStringExtra("orderId"); orderId = getIntent().getStringExtra("orderId");
cardId = getIntent().getStringExtra("cardId");
obuId = getIntent().getStringExtra("obuId");


LiveEventBus.get("closeActiveSearchBluetooth", Boolean.class) .observe(this, s -> { LiveEventBus.get("closeActiveSearchBluetooth", Boolean.class) .observe(this, s -> {
finish(); finish();
BluetoothReadUtils.readCardAndObuInfo(this, new BluetoothReadUtils.INReadResultCallback() { BluetoothReadUtils.readCardAndObuInfo(this, new BluetoothReadUtils.INReadResultCallback() {
@Override @Override
public void readResultSuccess(BluetoothReadUtils.CardObuIfoBean cardObuIfoBean) {//读取成功 public void readResultSuccess(BluetoothReadUtils.CardObuIfoBean cardObuIfoBean) {//读取成功
if (!FunHelper.isEmpty(cardId) && !cardObuIfoBean.cardId.equals(cardId)){
new Utils().showMessDialog(ObuActivationBLESearchActivity.this,
"当前连接的卡和订单绑定的卡不一致,请更换成该订单绑定的卡", dialog -> { });
return;
}

if (!FunHelper.isEmpty(obuId) && !cardObuIfoBean.obuId.equals(obuId)){
new Utils().showMessDialog(ObuActivationBLESearchActivity.this,
"当前连接的OBU设备和订单绑定的OBU设备不一致,请更换成该订单绑定的OBU设备", dialog -> { });
return;
}

if (isConnect){ if (isConnect){
toActive(); toActive();
}else{ }else{

+ 6
- 0
app/src/main/java/com/huntersun/vkyes/etcopencard/project/ui/activity/obu/ObuActivationHintActivity.java Bestand weergeven



private String orderId; private String orderId;
private String curVehicleId; private String curVehicleId;
private String cardId;
private String obuId;


@Override @Override
protected View getLayoutView() { protected View getLayoutView() {


curVehicleId = getIntent().getStringExtra("vehicleId"); curVehicleId = getIntent().getStringExtra("vehicleId");
orderId = getIntent().getStringExtra("orderId"); orderId = getIntent().getStringExtra("orderId");
cardId = getIntent().getStringExtra("cardId");
obuId = getIntent().getStringExtra("obuId");
} }


@Override @Override
Bundle bundle = new Bundle(); Bundle bundle = new Bundle();
bundle.putString("vehicleId",curVehicleId); bundle.putString("vehicleId",curVehicleId);
bundle.putString("orderId",orderId); bundle.putString("orderId",orderId);
bundle.putString("obuId",obuId);
bundle.putString("cardId",cardId);
jumpToPage(ObuActivationUploadActivity.class,bundle); jumpToPage(ObuActivationUploadActivity.class,bundle);
finish(); finish();
} }

+ 2
- 0
app/src/main/java/com/huntersun/vkyes/etcopencard/project/ui/activity/obu/ObuActivationHintCheckOrderActivity.java Bestand weergeven

public void onClick(View view) { public void onClick(View view) {
Bundle bundle = new Bundle(); Bundle bundle = new Bundle();
bundle.putString("orderId", curBizContent.getOrderId()); bundle.putString("orderId", curBizContent.getOrderId());
bundle.putString("cardId", curBizContent.getCardId());
bundle.putString("obuId", curBizContent.getObuId());
bundle.putString("vehicleId", curVehicleId); bundle.putString("vehicleId", curVehicleId);
jumpToPage(ObuActivationHintActivity.class, bundle); jumpToPage(ObuActivationHintActivity.class, bundle);
finish(); finish();

+ 17
- 13
app/src/main/java/com/huntersun/vkyes/etcopencard/project/ui/activity/obu/ObuActivationUploadActivity.java Bestand weergeven

import com.huntersun.vkyes.etcopencard.project.api.bean.SendTheVerificationCodeBean; import com.huntersun.vkyes.etcopencard.project.api.bean.SendTheVerificationCodeBean;
import com.huntersun.vkyes.etcopencard.project.copapply.ObuActivateRequester; import com.huntersun.vkyes.etcopencard.project.copapply.ObuActivateRequester;
import com.huntersun.vkyes.etcopencard.project.copapply.ObuActivation; import com.huntersun.vkyes.etcopencard.project.copapply.ObuActivation;
import com.huntersun.vkyes.etcopencard.project.tool.MyShared;
import com.huntersun.vkyes.etcopencard.project.tool.QRCode; import com.huntersun.vkyes.etcopencard.project.tool.QRCode;
import com.huntersun.vkyes.etcopencard.project.utils.Constants;
import com.huntersun.vkyes.etcopencard.project.utils.FunHelper; import com.huntersun.vkyes.etcopencard.project.utils.FunHelper;
import com.huntersun.vkyes.etcopencard.src.app.AppActivity; import com.huntersun.vkyes.etcopencard.src.app.AppActivity;
import com.huntersun.vkyes.etcopencard.src.http.glide.GlideApp; import com.huntersun.vkyes.etcopencard.src.http.glide.GlideApp;


private String vehicleId; //车牌编号 private String vehicleId; //车牌编号
private String orderId; //订单ID private String orderId; //订单ID
private String cardId; //卡ID
private String obuId; //签ID


private String ivImg1; private String ivImg1;
private String ivImg2; private String ivImg2;
setTitle("激活设备"); setTitle("激活设备");
vehicleId = getIntent().getStringExtra("vehicleId"); vehicleId = getIntent().getStringExtra("vehicleId");
orderId = getIntent().getStringExtra("orderId"); orderId = getIntent().getStringExtra("orderId");
cardId = getIntent().getStringExtra("cardId");
obuId = getIntent().getStringExtra("obuId");


binding.btnNext.setOnClickListener(this); binding.btnNext.setOnClickListener(this);
binding.ivImg1.setOnClickListener(this); binding.ivImg1.setOnClickListener(this);
* 上传图片信息 * 上传图片信息
*/ */
private void toSubmitData(){ private void toSubmitData(){
showDialog("图片上传中...");
showDialog("信息上传中...");
Map<String, String> params = new HashMap<>(); Map<String, String> params = new HashMap<>();
params.put("img1", ivImg1);
params.put("img2", ivImg2);
params.put("img3", ivImg3);
params.put("vehicleHeadImgUrl", ivImg1); //车头
params.put("vehicleBodyImgUrl", ivImg2); //车身45°
params.put("installImgUrl", ivImg3); //安装照
params.put("orderSource", Constants.SOURCE);
params.put("orderId", orderId); params.put("orderId", orderId);
//TODO 暂时没有这个接口
/*MyRetrofit.newInstance(IFCode.IFCODE966, params, new MyRetrofit.ReturnResult() {
params.put("openId", (String) MyShared.getInstance().get(MyShared.OPENID, ""));
MyRetrofit.newInstance(IFCode.IFCODE_ACTIVE_OBUIMG, params, new MyRetrofit.ReturnResult() {
@Override @Override
public void onSuccess(ResultBean resultBean, ResultBean.BizContent bizContent) { public void onSuccess(ResultBean resultBean, ResultBean.BizContent bizContent) {
hideDialog(); hideDialog();

Bundle bundle = new Bundle(); Bundle bundle = new Bundle();
bundle.putString("vehicleId",vehicleId); bundle.putString("vehicleId",vehicleId);
bundle.putString("orderId",orderId); bundle.putString("orderId",orderId);
bundle.putString("obuId",obuId);
bundle.putString("cardId",cardId);
jumpToPage(ObuActivationBLESearchActivity.class,bundle); jumpToPage(ObuActivationBLESearchActivity.class,bundle);
finish(); finish();
} }
public void onError(Response<Result> resp) { public void onError(Response<Result> resp) {
hideDialog(); hideDialog();
} }
});*/

Bundle bundle = new Bundle();
bundle.putString("vehicleId",vehicleId);
bundle.putString("orderId",orderId);
jumpToPage(ObuActivationBLESearchActivity.class,bundle);
finish();
});
} }


/** /**

+ 3
- 3
app/src/main/res/layout/activity_defray.xml Bestand weergeven

app:lineVisible="false" app:lineVisible="false"
app:titleColor="#FFFFFF" /> app:titleColor="#FFFFFF" />


<com.huntersun.vkyes.etcopencard.src.widget.StatusLayout
<!-- <com.huntersun.vkyes.etcopencard.src.widget.StatusLayout
android:id="@+id/hl_status_hint" android:id="@+id/hl_status_hint"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_weight="1"> android:layout_weight="1">
-->
<FrameLayout <FrameLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"


</FrameLayout> </FrameLayout>


</com.huntersun.vkyes.etcopencard.src.widget.StatusLayout>
<!-- </com.huntersun.vkyes.etcopencard.src.widget.StatusLayout>-->




</LinearLayout> </LinearLayout>

Laden…
Annuleren
Opslaan