@@ -40,9 +40,9 @@ import retrofit2.converter.scalars.ScalarsConverterFactory; | |||
public class MyRetrofit { | |||
//是否设置缓存 | |||
private static final boolean Cache = false; | |||
private final String BaseUrl = "http://192.168.100.63:8087/ifzt/api/"; | |||
// private final String BaseUrl = "http://192.168.100.63:8087/ifzt/api/"; | |||
// private final String BaseUrl = "http://58.16.58.161:19002/ifzt/api/"; | |||
// private final String BaseUrl = "http://222.85.144.89:19002/ifzt/api/"; | |||
private final String BaseUrl = "http://222.85.144.89:19002/ifzt/api/"; | |||
private final String appId = "admin001"; | |||
private final String IFCODE = ""; | |||
private final String bizContent = ""; |
@@ -2,6 +2,7 @@ package com.huntersun.vkyes.etcopencard.project.copapply; | |||
import android.annotation.SuppressLint; | |||
import android.content.Context; | |||
import android.text.TextUtils; | |||
import android.util.Log; | |||
import com.google.gson.Gson; | |||
@@ -170,8 +171,12 @@ public class ObuActivateRequester implements ToastAction { | |||
@SuppressLint("CheckResult") | |||
private void sendApduEsam(ResultBean.BizRemarks body) { | |||
Observable.create((ObservableOnSubscribe<ServiceStatus>) emitter -> { | |||
emitter.onNext(MethodManager.sendApduEsam(body.getAPDU())); | |||
emitter.onComplete(); | |||
if (!TextUtils.isEmpty(body.getAPDU())){ | |||
emitter.onNext(MethodManager.sendApduEsam(body.getAPDU())); | |||
emitter.onComplete(); | |||
} else { | |||
toast("APDU为空"); | |||
} | |||
}).observeOn(AndroidSchedulers.mainThread()).subscribeOn(Schedulers.io()).subscribe(ss -> { | |||
if (0 == ss.getServiceCode() && checkApdu(ss)) { | |||
obuSetConfirm(); //安装确认 |
@@ -219,6 +219,7 @@ public class HomeListInfo extends AppActivity implements StatusAction { | |||
case "8": { //快速发货 | |||
Intent intent = new Intent(); | |||
intent.putExtra("id", bizContent1.getId()); | |||
intent.putExtra("isValueCard", bizContent1.getIsValueCard()); | |||
intent.setClass(HomeListInfo.this, FormDeliveryActivity.class); | |||
startActivity(intent); | |||
finish(); |
@@ -3,9 +3,12 @@ package com.huntersun.vkyes.etcopencard.project.ui.activity.mail; | |||
import androidx.appcompat.app.AppCompatActivity; | |||
import android.os.Bundle; | |||
import android.text.TextUtils; | |||
import android.util.Log; | |||
import android.view.View; | |||
import com.google.gson.Gson; | |||
import com.huntersun.vky.obublelib.box.BoxManagers; | |||
import com.huntersun.vkyes.etcopencard.R; | |||
import com.huntersun.vkyes.etcopencard.databinding.ActivityFormDeliveryBinding; | |||
import com.huntersun.vkyes.etcopencard.project.api.Api; | |||
@@ -17,10 +20,13 @@ import com.huntersun.vkyes.etcopencard.project.api.bean.IFCode; | |||
import com.huntersun.vkyes.etcopencard.project.api.bean.ResultBean; | |||
import com.huntersun.vkyes.etcopencard.project.api.bean.SendTheVerificationCodeBean; | |||
import com.huntersun.vkyes.etcopencard.project.dialog.MenuMailDialog; | |||
import com.huntersun.vkyes.etcopencard.project.tool.Utils; | |||
import com.huntersun.vkyes.etcopencard.src.aop.SingleClick; | |||
import com.huntersun.vkyes.etcopencard.src.app.AppActivity; | |||
import com.jeremyliao.liveeventbus.LiveEventBus; | |||
import java.util.Objects; | |||
import retrofit2.Response; | |||
/** | |||
@@ -28,6 +34,8 @@ import retrofit2.Response; | |||
*/ | |||
public class FormDeliveryActivity extends AppActivity { | |||
private ActivityFormDeliveryBinding binding; | |||
private String isValueCard = ""; | |||
private String CardType = ""; | |||
@Override | |||
protected View getLayoutView() { | |||
@@ -38,6 +46,21 @@ public class FormDeliveryActivity extends AppActivity { | |||
@Override | |||
protected void initView() { | |||
setTitle("发货录入"); | |||
isValueCard = getIntent().getStringExtra("isValueCard"); | |||
bluetoothLink(new Currency() { | |||
@Override | |||
public void success() { | |||
//储值卡22 记账卡23 | |||
CardType = Long.valueOf(BoxManagers.mCardInfoBean.getCard_type(), 16) + ""; | |||
binding.text3.setText(BoxManagers.mCardInfoBean.getCard_No()); //卡号 | |||
binding.text4.setText(BoxManagers.mDecryptVehicleApduBean.getContractNo()); //签号 | |||
binding.text5.setText(CardType); //卡类型 | |||
} | |||
@Override | |||
public void close() { | |||
} | |||
}); | |||
} | |||
@Override | |||
@@ -57,34 +80,41 @@ public class FormDeliveryActivity extends AppActivity { | |||
@Override | |||
@SingleClick | |||
public void onClick(View v) { | |||
SendTheVerificationCodeBean bizContent = new SendTheVerificationCodeBean(); | |||
bizContent.setId(getIntent().getStringExtra("id")); | |||
bizContent.setTrackingNumber(binding.text1.getText().toString()); | |||
bizContent.setCourierCompany(binding.text2.getText().toString()); | |||
bizContent.setCardId(binding.text3.getText().toString()); | |||
bizContent.setObuId(binding.text4.getText().toString()); | |||
if (isSky(binding.text1.getText().toString(), "快递单号", binding.text1) || | |||
isSky(binding.text2.getText().toString(), "快递公司", binding.text2) || | |||
isSky(binding.text3.getText() + "", "ETC卡号", binding.text3) || | |||
isSky(binding.text4.getText() + "", "OBU 号", binding.text4)) { | |||
return; | |||
} | |||
RequestParameters parameters = | |||
new RequestParameters(IFCode.IFCODE31, new Gson().toJson(bizContent)); | |||
new MyRetrofit().getRetrofit().create(Api.class).message2(parameters).enqueue(new Converter<Result>(FormDeliveryActivity.this) { | |||
@Override | |||
protected void onSuccess(ResultBean resultBean, ResultBean.BizContent bizContent) { | |||
LiveEventBus.get("homeOneUpdateData").post(""); | |||
LiveEventBus.get("ListDeliveryActivityData").post("刷新"); | |||
toast(resultBean.getErrorMsg()); | |||
finish(); | |||
} | |||
//判断订单号中的卡类型是否与当前卡类型相同 1 记账卡 2 储值卡 | |||
if (!TextUtils.isEmpty(isValueCard) && | |||
((Objects.equals(isValueCard, "1") && Objects.equals(CardType, "23")) || | |||
(Objects.equals(isValueCard, "2") && Objects.equals(CardType, "22")))) { | |||
SendTheVerificationCodeBean bizContent = new SendTheVerificationCodeBean(); | |||
bizContent.setId(getIntent().getStringExtra("id")); | |||
bizContent.setTrackingNumber(binding.text1.getText().toString()); | |||
bizContent.setCourierCompany(binding.text2.getText().toString()); | |||
bizContent.setCardId(binding.text3.getText().toString()); | |||
bizContent.setObuId(binding.text4.getText().toString()); | |||
RequestParameters parameters = new RequestParameters(IFCode.IFCODE31, new Gson().toJson(bizContent)); | |||
new MyRetrofit().getRetrofit().create(Api.class).message2(parameters).enqueue(new Converter<Result>(FormDeliveryActivity.this) { | |||
@Override | |||
protected void onSuccess(ResultBean resultBean, ResultBean.BizContent bizContent) { | |||
LiveEventBus.get("homeOneUpdateData").post(""); | |||
LiveEventBus.get("ListDeliveryActivityData").post("刷新"); | |||
toast(resultBean.getErrorMsg()); | |||
finish(); | |||
} | |||
@Override | |||
public void onError(String err, Response<Result> resp) { | |||
super.onError(err, resp); | |||
} | |||
}); | |||
@Override | |||
public void onError(String err, Response<Result> resp) { | |||
super.onError(err, resp); | |||
} | |||
}); | |||
} else { | |||
new Utils().showMessDialog(getActivity(), "请确认当前卡类型是否与订单中的卡类型一致!", dialog -> { | |||
}); | |||
} | |||
} | |||
}); | |||
} |
@@ -41,6 +41,7 @@ public class InfoTabActivity extends AppActivity { | |||
CardInfoBean card = BoxManagers.mCardInfoBean; | |||
DecryptVehicleApduBean obu = BoxManagers.mDecryptVehicleApduBean; | |||
List<EnumBean> enumBeans = new ArrayList<>(); | |||
enumBeans.add(new EnumBean("ETC卡号", BoxManagers.mCardInfoBean.getCard_No())); | |||
enumBeans.add(new EnumBean("用户姓名", BoxManagers.mUserBean.getUserName())); | |||
enumBeans.add(new EnumBean("身份证号", BoxManagers.mUserBean.getIdCardNo())); |
@@ -38,7 +38,6 @@ public class ListDeliveryActivity extends AppActivity implements OnRefreshLoadMo | |||
private ActivityListDeliveryBinding binding; | |||
private int Page = 1; | |||
@Override | |||
protected View getLayoutView() { | |||
binding = ActivityListDeliveryBinding.inflate(getLayoutInflater()); | |||
@@ -115,6 +114,7 @@ public class ListDeliveryActivity extends AppActivity implements OnRefreshLoadMo | |||
public void onClick(View v) { | |||
Intent intent = new Intent(); | |||
intent.putExtra("id", item.getId()); | |||
intent.putExtra("isValueCard", item.getIsValueCard()); | |||
intent.setClass(ListDeliveryActivity.this, FormDeliveryActivity.class); | |||
startActivity(intent); | |||
} |
@@ -92,11 +92,11 @@ | |||
<TextView | |||
android:id="@+id/text2" | |||
style="@style/EditTextStyle" | |||
android:gravity="center_vertical" | |||
android:layout_width="0dp" | |||
android:layout_height="match_parent" | |||
android:layout_weight="1" | |||
android:background="@color/white" | |||
android:gravity="center_vertical" | |||
android:hint="请选择快递公司" | |||
android:paddingHorizontal="@dimen/dp_20" /> | |||
@@ -128,14 +128,48 @@ | |||
android:textSize="@dimen/sp_14" | |||
tools:ignore="UseCompatTextViewDrawableXml" /> | |||
<com.hjq.widget.view.ClearEditText | |||
<TextView | |||
android:id="@+id/text3" | |||
style="@style/EditTextStyle" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:background="@color/white" | |||
android:drawablePadding="@dimen/dp_15" | |||
android:hint="请输入ETC卡号" | |||
android:gravity="center_vertical" | |||
android:minHeight="@dimen/dp_45" | |||
android:paddingHorizontal="@dimen/dp_20" /> | |||
</LinearLayout> | |||
<View | |||
style="@style/VerticalLineStyle" | |||
android:layout_width="wrap_content" | |||
android:layout_height="1dp" | |||
android:layout_marginHorizontal="@dimen/dp_10" /> | |||
<LinearLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:background="#FFFFFF" | |||
android:minHeight="@dimen/dp_45"> | |||
<TextView | |||
android:layout_width="@dimen/dp_90" | |||
android:layout_height="match_parent" | |||
android:drawableLeft="@mipmap/must" | |||
android:gravity="center_vertical" | |||
android:text="ETC卡类型" | |||
android:textSize="@dimen/sp_14" | |||
tools:ignore="UseCompatTextViewDrawableXml" /> | |||
<TextView | |||
android:id="@+id/text5" | |||
style="@style/EditTextStyle" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:background="@color/white" | |||
android:drawablePadding="@dimen/dp_15" | |||
android:gravity="center_vertical" | |||
android:minHeight="@dimen/dp_45" | |||
android:paddingHorizontal="@dimen/dp_20" /> | |||
@@ -163,14 +197,14 @@ | |||
android:textSize="@dimen/sp_14" | |||
tools:ignore="UseCompatTextViewDrawableXml" /> | |||
<com.hjq.widget.view.ClearEditText | |||
<TextView | |||
android:id="@+id/text4" | |||
style="@style/EditTextStyle" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:background="@color/white" | |||
android:drawablePadding="@dimen/dp_15" | |||
android:hint="请输入OBU 号" | |||
android:gravity="center_vertical" | |||
android:minHeight="@dimen/dp_45" | |||
android:paddingHorizontal="@dimen/dp_20" /> | |||