|
|
|
@ -77,9 +77,10 @@ public class UpActivity extends AllBaseActivity implements AdapterView.OnItemSel
|
|
|
|
private Toast toast;
|
|
|
|
private Toast toast;
|
|
|
|
private KeyReceiver keyReceiver;
|
|
|
|
private KeyReceiver keyReceiver;
|
|
|
|
private boolean dataType;
|
|
|
|
private boolean dataType;
|
|
|
|
|
|
|
|
private List<String> locationList;
|
|
|
|
// 用于存储最后一次扫描到的 EPC
|
|
|
|
// 用于存储最后一次扫描到的 EPC
|
|
|
|
private String lastScannedEpc;
|
|
|
|
private String lastScannedEpc;
|
|
|
|
|
|
|
|
private BaseTyre baseTyreResult;
|
|
|
|
// 用于处理防抖逻辑的 Handler
|
|
|
|
// 用于处理防抖逻辑的 Handler
|
|
|
|
private Handler debounceHandler = new Handler(new Handler.Callback() {
|
|
|
|
private Handler debounceHandler = new Handler(new Handler.Callback() {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
@ -146,11 +147,16 @@ public class UpActivity extends AllBaseActivity implements AdapterView.OnItemSel
|
|
|
|
// 从保养跳转过来的
|
|
|
|
// 从保养跳转过来的
|
|
|
|
binding.azlw.setText(intent.getStringExtra("location"));
|
|
|
|
binding.azlw.setText(intent.getStringExtra("location"));
|
|
|
|
binding.car.setText(intent.getStringExtra("carNo"));
|
|
|
|
binding.car.setText(intent.getStringExtra("carNo"));
|
|
|
|
;
|
|
|
|
|
|
|
|
binding.start.setText(intent.getStringExtra("licheng"));
|
|
|
|
binding.start.setText(intent.getStringExtra("licheng"));
|
|
|
|
;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
locationList = new ArrayList<>() {{
|
|
|
|
|
|
|
|
add("左前轮");
|
|
|
|
|
|
|
|
add("右前轮");
|
|
|
|
|
|
|
|
add("右内轮");
|
|
|
|
|
|
|
|
add("右外轮");
|
|
|
|
|
|
|
|
add("左内轮");
|
|
|
|
|
|
|
|
add("左外轮");
|
|
|
|
|
|
|
|
}};
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -337,6 +343,7 @@ public class UpActivity extends AllBaseActivity implements AdapterView.OnItemSel
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void onNothingSelected(AdapterView<?> parent) {
|
|
|
|
public void onNothingSelected(AdapterView<?> parent) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 提交函数
|
|
|
|
// 提交函数
|
|
|
|
private void up_insert(String rfid, String carNo, String millage, String wheel, String selfNo) {
|
|
|
|
private void up_insert(String rfid, String carNo, String millage, String wheel, String selfNo) {
|
|
|
|
OkGo.<String>post(MyUrl.url + "/tyre/install/PdaInstallTyre")
|
|
|
|
OkGo.<String>post(MyUrl.url + "/tyre/install/PdaInstallTyre")
|
|
|
|
@ -386,6 +393,20 @@ public class UpActivity extends AllBaseActivity implements AdapterView.OnItemSel
|
|
|
|
new CommonDialog(this).setMessage(result.getMsg()).show();
|
|
|
|
new CommonDialog(this).setMessage(result.getMsg()).show();
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case "0":
|
|
|
|
case "0":
|
|
|
|
|
|
|
|
// 新增轮换
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
int i = locationList.indexOf(binding.azlw.getText().toString());
|
|
|
|
|
|
|
|
int size = locationList.size();
|
|
|
|
|
|
|
|
if (i < size ) {
|
|
|
|
|
|
|
|
i++;
|
|
|
|
|
|
|
|
binding.azlw.setText(locationList.get(i));
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
|
|
|
binding.azlw.setText(locationList.get(0));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}catch (Exception e){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
new CommonDialog(this).setMessage(result.getMsg()).show();
|
|
|
|
new CommonDialog(this).setMessage(result.getMsg()).show();
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -414,7 +435,7 @@ public class UpActivity extends AllBaseActivity implements AdapterView.OnItemSel
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
private BaseTyre baseTyreResult;
|
|
|
|
|
|
|
|
// 基本信息查询
|
|
|
|
// 基本信息查询
|
|
|
|
private void find(String epc) {
|
|
|
|
private void find(String epc) {
|
|
|
|
OkGo.<String>post(MyUrl.url + "/tyre/tyre/pdaQueryTyreInfo").tag(this).params("tyreEpc", epc).execute(new StringCallback() {
|
|
|
|
OkGo.<String>post(MyUrl.url + "/tyre/tyre/pdaQueryTyreInfo").tag(this).params("tyreEpc", epc).execute(new StringCallback() {
|
|
|
|
@ -427,7 +448,7 @@ public class UpActivity extends AllBaseActivity implements AdapterView.OnItemSel
|
|
|
|
BaseTyre baseTyre = gson.fromJson(body, BaseTyre.class);
|
|
|
|
BaseTyre baseTyre = gson.fromJson(body, BaseTyre.class);
|
|
|
|
|
|
|
|
|
|
|
|
if (baseTyre != null) {
|
|
|
|
if (baseTyre != null) {
|
|
|
|
baseTyreResult=baseTyre;
|
|
|
|
baseTyreResult = baseTyre;
|
|
|
|
// 空值处理:若字段为 null 则显示空字符串
|
|
|
|
// 空值处理:若字段为 null 则显示空字符串
|
|
|
|
String TyreNo = safeGetString(baseTyre.getTyreNo());
|
|
|
|
String TyreNo = safeGetString(baseTyre.getTyreNo());
|
|
|
|
th.setText(TyreNo);
|
|
|
|
th.setText(TyreNo);
|
|
|
|
|