|
|
@@ -12,6 +12,7 @@ import android.widget.ImageView; |
|
|
|
import android.widget.RadioGroup; |
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.google.gson.internal.LinkedTreeMap; |
|
|
|
import com.huntersun.vky.obublelib.util.ToastUtil; |
|
|
|
import com.huntersun.vkyes.etcopencard.R; |
|
|
@@ -20,11 +21,13 @@ import com.huntersun.vkyes.etcopencard.project.api.MyRetrofit; |
|
|
|
import com.huntersun.vkyes.etcopencard.project.api.bean.EnumBean; |
|
|
|
import com.huntersun.vkyes.etcopencard.project.api.bean.IFCode; |
|
|
|
import com.huntersun.vkyes.etcopencard.project.api.bean.ResultBean; |
|
|
|
import com.huntersun.vkyes.etcopencard.project.dialog.ConfirmDialog; |
|
|
|
import com.huntersun.vkyes.etcopencard.project.dialog.EnumListDialog; |
|
|
|
import com.huntersun.vkyes.etcopencard.project.ocr.CameraActivity; |
|
|
|
import com.huntersun.vkyes.etcopencard.project.ocr.FileUtil; |
|
|
|
import com.huntersun.vkyes.etcopencard.project.tool.MyShared; |
|
|
|
import com.huntersun.vkyes.etcopencard.project.ui.activity.FillOutMessage; |
|
|
|
import com.huntersun.vkyes.etcopencard.project.ui.activity.RealUserAuthenticationActivity; |
|
|
|
import com.huntersun.vkyes.etcopencard.project.utils.FileUtils; |
|
|
|
import com.huntersun.vkyes.etcopencard.project.utils.FunHelper; |
|
|
|
import com.huntersun.vkyes.etcopencard.project.utils.ImgConfig; |
|
|
@@ -77,6 +80,18 @@ public class LicensePlateOccupationInfoUpActivity extends AppActivity { |
|
|
|
initClick(); |
|
|
|
} |
|
|
|
|
|
|
|
public void dwView(){ |
|
|
|
binding.lyDw.setVisibility(View.VISIBLE); |
|
|
|
binding.lyFbr.setVisibility(View.GONE); |
|
|
|
isSelf = 2; |
|
|
|
userType = 2; |
|
|
|
} |
|
|
|
|
|
|
|
public void notSelfView(){ |
|
|
|
binding.lyDw.setVisibility(View.GONE); |
|
|
|
binding.lyFbr.setVisibility(View.VISIBLE); |
|
|
|
isSelf = 2; |
|
|
|
} |
|
|
|
|
|
|
|
private void initClick() { |
|
|
|
binding.image1.setOnClickListener(this::onImage); |
|
|
@@ -89,38 +104,36 @@ public class LicensePlateOccupationInfoUpActivity extends AppActivity { |
|
|
|
binding.image8.setOnClickListener(this::onImage); |
|
|
|
binding.image9.setOnClickListener(this::onImage); |
|
|
|
|
|
|
|
binding.rgIsCompany.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() { |
|
|
|
@Override |
|
|
|
public void onCheckedChanged(RadioGroup radioGroup, int i) { |
|
|
|
switch (i) { |
|
|
|
case R.id.rb_gr: |
|
|
|
binding.lyDw.setVisibility(View.GONE); |
|
|
|
binding.lyIsSelf.setVisibility(View.VISIBLE); |
|
|
|
binding.rgIsSelf.check(R.id.rb_1); |
|
|
|
userType = 1; |
|
|
|
break; |
|
|
|
case R.id.rb_dw: |
|
|
|
binding.lyDw.setVisibility(View.VISIBLE); |
|
|
|
binding.lyIsSelf.setVisibility(View.GONE); |
|
|
|
binding.lyFbr.setVisibility(View.GONE); |
|
|
|
isSelf = 2; |
|
|
|
userType = 2; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
binding.rgIsSelf.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() { |
|
|
|
// binding.rgIsCompany.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() { |
|
|
|
// @Override |
|
|
|
// public void onCheckedChanged(RadioGroup radioGroup, int i) { |
|
|
|
// switch (i) { |
|
|
|
// case R.id.rb_gr: |
|
|
|
// binding.lyDw.setVisibility(View.GONE); |
|
|
|
// binding.lyIsSelf.setVisibility(View.VISIBLE); |
|
|
|
// binding.rgIsSelf.check(R.id.rb_1); |
|
|
|
// userType = 1; |
|
|
|
// break; |
|
|
|
// case R.id.rb_dw: |
|
|
|
// binding.lyDw.setVisibility(View.VISIBLE); |
|
|
|
// binding.lyIsSelf.setVisibility(View.GONE); |
|
|
|
// binding.lyFbr.setVisibility(View.GONE); |
|
|
|
// isSelf = 2; |
|
|
|
// userType = 2; |
|
|
|
// break; |
|
|
|
// } |
|
|
|
// } |
|
|
|
// }); |
|
|
|
// |
|
|
|
binding.rgIsDw.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() { |
|
|
|
@Override |
|
|
|
public void onCheckedChanged(RadioGroup radioGroup, int i) { |
|
|
|
switch (i) { |
|
|
|
case R.id.rb_1: |
|
|
|
binding.lyFbr.setVisibility(View.GONE); |
|
|
|
isSelf = 1; |
|
|
|
notSelfView(); |
|
|
|
break; |
|
|
|
case R.id.rb_2: |
|
|
|
binding.lyFbr.setVisibility(View.VISIBLE); |
|
|
|
isSelf = 2; |
|
|
|
dwView(); |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
@@ -189,13 +202,13 @@ public class LicensePlateOccupationInfoUpActivity extends AppActivity { |
|
|
|
params.put("proxyUrl", imgUrl9); |
|
|
|
} |
|
|
|
} else { |
|
|
|
params.put("unitId",binding.etCompanyIdNum.getText().toString().trim()); |
|
|
|
params.put("ownerIdNum",binding.etCompanyIdNum.getText().toString().trim()); |
|
|
|
params.put("proxyUrl", imgUrl6); |
|
|
|
params.put("unitIdType", "203"); |
|
|
|
params.put("unitImagesUrl", imgUrl5); |
|
|
|
params.put("unitName", binding.etCompanyName.getText().toString().trim()); |
|
|
|
params.put("ownerIdType", "203"); |
|
|
|
params.put("ownerPosImgUrl", imgUrl5); |
|
|
|
params.put("ownerName", binding.etCompanyName.getText().toString().trim()); |
|
|
|
} |
|
|
|
params.put("customerIdNum", binding.etApplyIdNum.getText().toString().trim()); |
|
|
|
params.put("userIdNum", binding.etApplyIdNum.getText().toString().trim()); |
|
|
|
params.put("isSelf", isSelf); |
|
|
|
params.put("mobile",binding.etPhone.getText().toString().trim()); |
|
|
|
params.put("name",binding.etApplyName.getText().toString().trim()); |
|
|
@@ -209,10 +222,24 @@ public class LicensePlateOccupationInfoUpActivity extends AppActivity { |
|
|
|
MyRetrofit.newInstanceGZ(this, IFCode.IFCODE_RELEASEPLATE, params, new MyRetrofit.ReturnResult() { |
|
|
|
@Override |
|
|
|
public void onSuccess(ResultBean resultBean, ResultBean.BizContent bizContent) { |
|
|
|
Intent intent = new Intent(); |
|
|
|
intent.setClass(LicensePlateOccupationInfoUpActivity.this,CommonDealSuccessActivity.class); |
|
|
|
startActivity(intent); |
|
|
|
finish(); |
|
|
|
LinkedTreeMap<String,Object> linkedTreeMap = JSONObject.parseObject(resultBean.getData().toString(),LinkedTreeMap.class); |
|
|
|
int flag = (int) linkedTreeMap.get("flag"); |
|
|
|
if (flag == 0) { |
|
|
|
Intent intent = new Intent(); |
|
|
|
intent.setClass(LicensePlateOccupationInfoUpActivity.this, CommonDealSuccessActivity.class); |
|
|
|
startActivity(intent); |
|
|
|
finish(); |
|
|
|
}else { |
|
|
|
new ConfirmDialog.Builder(LicensePlateOccupationInfoUpActivity.this).setMsg("需要上传车主信息", "", "确定", "", R.mipmap.icon_lotgout_etc_hint, 0, true) |
|
|
|
.onClick(new ConfirmDialog.Result() { |
|
|
|
@Override |
|
|
|
public void confirm() { |
|
|
|
} |
|
|
|
}).show(); |
|
|
|
binding.llOther.setVisibility(View.VISIBLE); |
|
|
|
binding.rgIsDw.check(R.id.rb_1); |
|
|
|
notSelfView(); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
@@ -232,9 +259,9 @@ public class LicensePlateOccupationInfoUpActivity extends AppActivity { |
|
|
|
if (!FunHelper.isEmpty(url)) { |
|
|
|
GlideApp.with(getActivity()).load(url).into((ImageView) view); |
|
|
|
if (view == binding.image6) { |
|
|
|
imgUrl6 = url; |
|
|
|
imgUrl6 = bizContent.data.getOssFilePath(); |
|
|
|
} else { |
|
|
|
imgUrl9 = url; |
|
|
|
imgUrl9 = bizContent.data.getOssFilePath(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@@ -252,8 +279,8 @@ public class LicensePlateOccupationInfoUpActivity extends AppActivity { |
|
|
|
public void onSuccess(ResultBean.BizContent bizContent, File file,String imagePath) { |
|
|
|
binding.etCompanyName.setText(bizContent.unitName); |
|
|
|
binding.etCompanyIdNum.setText(bizContent.screditCode); |
|
|
|
imgUrl5 = ImgConfig.ImgIPChange(bizContent.getImageUrl()); |
|
|
|
GlideApp.with(getActivity()).load(imgUrl5).into(binding.image5); |
|
|
|
imgUrl5 = imagePath; |
|
|
|
GlideApp.with(getActivity()).load(ImgConfig.ImgIPChange(bizContent.getImageUrl())).into(binding.image5); |
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
@@ -279,11 +306,11 @@ public class LicensePlateOccupationInfoUpActivity extends AppActivity { |
|
|
|
if (view == binding.image3) { |
|
|
|
binding.etPlateNum.setText(bizContent1.getPlate_a()); |
|
|
|
binding.etPlateOwnerName.setText(bizContent1.getMan()); |
|
|
|
imgUrl3 = ImgConfig.ImgIPChange(bizContent1.getImageUrl()); |
|
|
|
GlideApp.with(getActivity()).load(imgUrl3).into(binding.image3); |
|
|
|
imgUrl3 = imagePath; |
|
|
|
GlideApp.with(getActivity()).load(ImgConfig.ImgIPChange(bizContent1.getImageUrl())).into(binding.image3); |
|
|
|
} else { |
|
|
|
imgUrl4 = ImgConfig.ImgIPChange(bizContent1.getImageUrl()); |
|
|
|
GlideApp.with(getActivity()).load(imgUrl4).into(binding.image4); |
|
|
|
imgUrl4 = imagePath; |
|
|
|
GlideApp.with(getActivity()).load(ImgConfig.ImgIPChange(bizContent1.getImageUrl())).into(binding.image4); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
@@ -309,24 +336,24 @@ public class LicensePlateOccupationInfoUpActivity extends AppActivity { |
|
|
|
FileUtils.getInstance(this).uploadOcrIDCardNew(true, type, file1, params, new FileUtils.OnOcrUploadCallback() { |
|
|
|
@Override |
|
|
|
public void onSuccess(ResultBean.BizContent bizContent,String imagePath) { |
|
|
|
update15(bizContent, view); |
|
|
|
update15(bizContent, view,imagePath); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private void update15(ResultBean.BizContent bizContent, View view) { |
|
|
|
private void update15(ResultBean.BizContent bizContent, View view,String imagePath) { |
|
|
|
if (view == binding.image1) { |
|
|
|
if (!TextUtils.isEmpty(bizContent.getImageUrl())) { |
|
|
|
imgUrl1 = ImgConfig.ImgIPChange(bizContent.getImageUrl()); |
|
|
|
GlideApp.with(getActivity()).load(imgUrl1).into(binding.image1); |
|
|
|
imgUrl1 = imagePath ; |
|
|
|
GlideApp.with(getActivity()).load(ImgConfig.ImgIPChange(bizContent.getImageUrl())).into(binding.image1); |
|
|
|
} |
|
|
|
binding.etApplyName.setText(bizContent.getName()); |
|
|
|
binding.etApplyIdNum.setText(bizContent.getIdno()); |
|
|
|
} else if (view == binding.image7) { |
|
|
|
if (!TextUtils.isEmpty(bizContent.getImageUrl())) { |
|
|
|
imgUrl7 = ImgConfig.ImgIPChange(bizContent.getImageUrl()); |
|
|
|
GlideApp.with(getActivity()).load(imgUrl7).into(binding.image7); |
|
|
|
imgUrl7 = imagePath; |
|
|
|
GlideApp.with(getActivity()).load(ImgConfig.ImgIPChange(bizContent.getImageUrl())).into(binding.image7); |
|
|
|
} |
|
|
|
|
|
|
|
binding.etOwnerName.setText(bizContent.getName()); |
|
|
@@ -334,14 +361,14 @@ public class LicensePlateOccupationInfoUpActivity extends AppActivity { |
|
|
|
|
|
|
|
} else if (view == binding.image2) { |
|
|
|
if (!TextUtils.isEmpty(bizContent.getImageUrl())) { |
|
|
|
imgUrl2 = ImgConfig.ImgIPChange(bizContent.getImageUrl()); |
|
|
|
GlideApp.with(getActivity()).load(imgUrl2).into(binding.image2); |
|
|
|
imgUrl2 = imagePath; |
|
|
|
GlideApp.with(getActivity()).load(ImgConfig.ImgIPChange(bizContent.getImageUrl())).into(binding.image2); |
|
|
|
} |
|
|
|
|
|
|
|
} else if (view == binding.image8) { |
|
|
|
if (!TextUtils.isEmpty(bizContent.getImageUrl())) { |
|
|
|
imgUrl8 = ImgConfig.ImgIPChange(bizContent.getImageUrl()); |
|
|
|
GlideApp.with(getActivity()).load(imgUrl8).into(binding.image8); |
|
|
|
imgUrl8 = imagePath; |
|
|
|
GlideApp.with(getActivity()).load(ImgConfig.ImgIPChange(bizContent.getImageUrl())).into(binding.image8); |
|
|
|
} |
|
|
|
|
|
|
|
|