|
|
|
|
@ -21,7 +21,7 @@ public class ShuangqianActivity extends BaseActivity implements MyScannerCall {
|
|
|
|
|
|
|
|
|
|
private ActivityShuangqianBinding binding;
|
|
|
|
|
private MyScannerReceiver myReceiver;
|
|
|
|
|
|
|
|
|
|
private String uriLastStr;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
protected void onCreate(Bundle savedInstanceState) {
|
|
|
|
|
@ -35,8 +35,10 @@ public class ShuangqianActivity extends BaseActivity implements MyScannerCall {
|
|
|
|
|
IntentFilter intentFilter = new IntentFilter();
|
|
|
|
|
intentFilter.addAction("com.rfid.SCAN");
|
|
|
|
|
registerReceiver(myReceiver, intentFilter);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
boolean type = getIntent().getBooleanExtra("type", true);
|
|
|
|
|
binding.setTitle(type ? "MES轮胎绑定" : "解绑");
|
|
|
|
|
binding.setType(type);
|
|
|
|
|
uriLastStr = type ? "barcodeAndRFIDBinding" : "unBinding";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 读取
|
|
|
|
|
@ -65,30 +67,38 @@ public class ShuangqianActivity extends BaseActivity implements MyScannerCall {
|
|
|
|
|
// callWebService(buildSoapRequest(epc, code));//双钱
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void haohuaSubmit(String epc, String code) {
|
|
|
|
|
OkGo.<MyResult>post("http://192.168.26.26:5050/UMInterface/RFID/barcodeAndRFIDBinding")
|
|
|
|
|
.params("rfid", epc).params("barCode", code).execute(new MyRecultCall(dialog, this) {
|
|
|
|
|
@Override
|
|
|
|
|
public void onSuccess(Response<MyResult> response) {
|
|
|
|
|
super.onSuccess(response);
|
|
|
|
|
MyResult body = response.body();
|
|
|
|
|
try {
|
|
|
|
|
if (body.getCode() == 200) {
|
|
|
|
|
tipsDialog.setTip(true, body.getInfo());
|
|
|
|
|
tipsDialog.show();
|
|
|
|
|
binding.socketBarcode.setText(null);
|
|
|
|
|
binding.socketEpc.setText(null);
|
|
|
|
|
} else {
|
|
|
|
|
tipsDialog.setTip(false, body.getInfo());
|
|
|
|
|
tipsDialog.show();
|
|
|
|
|
}
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
tipsDialog.setTip(false, "接口返回信息异常");
|
|
|
|
|
tipsDialog.show();
|
|
|
|
|
}
|
|
|
|
|
// 解绑
|
|
|
|
|
public void unBindingSubmit(View view) {
|
|
|
|
|
String epc = binding.socketEpc.getText().toString();
|
|
|
|
|
String code = binding.socketBarcode.getText().toString();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
haohuaSubmit(epc, code);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void haohuaSubmit(String epc, String code) {
|
|
|
|
|
OkGo.<MyResult>post("http://192.168.26.26:5050/UMInterface/RFID/" + uriLastStr)
|
|
|
|
|
.params("rfid", epc).params("barCode", code).execute(new MyRecultCall(dialog, this) {
|
|
|
|
|
@Override
|
|
|
|
|
public void onSuccess(Response<MyResult> response) {
|
|
|
|
|
super.onSuccess(response);
|
|
|
|
|
MyResult body = response.body();
|
|
|
|
|
try {
|
|
|
|
|
if (body.getCode() == 200) {
|
|
|
|
|
tipsDialog.setTip(true, body.getInfo());
|
|
|
|
|
tipsDialog.show();
|
|
|
|
|
binding.socketBarcode.setText(null);
|
|
|
|
|
binding.socketEpc.setText(null);
|
|
|
|
|
} else {
|
|
|
|
|
tipsDialog.setTip(false, body.getInfo());
|
|
|
|
|
tipsDialog.show();
|
|
|
|
|
}
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
tipsDialog.setTip(false, "接口返回信息异常");
|
|
|
|
|
tipsDialog.show();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|