From 7cdc1bedff786dd3c2eba964a9b498e3cba6dda8 Mon Sep 17 00:00:00 2001 From: wangh <123456> Date: Thu, 1 Feb 2024 10:56:35 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=20=E5=BA=9F=E5=93=81?= =?UTF-8?q?=E5=85=A5=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/example/beijing_daxing/FpInActivity.java | 6 +++++- .../java/com/example/beijing_daxing/vm/FpInVm.java | 14 ++++++++++++++ app/src/main/res/layout/activity_fp_in.xml | 1 + 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/example/beijing_daxing/FpInActivity.java b/app/src/main/java/com/example/beijing_daxing/FpInActivity.java index e2fcaa5..540e81e 100644 --- a/app/src/main/java/com/example/beijing_daxing/FpInActivity.java +++ b/app/src/main/java/com/example/beijing_daxing/FpInActivity.java @@ -4,6 +4,7 @@ import androidx.appcompat.app.AppCompatActivity; import androidx.databinding.DataBindingUtil; import android.os.Bundle; +import android.util.Log; import android.view.View; import android.widget.Toast; @@ -44,6 +45,7 @@ public class FpInActivity extends BaseActivity { if (body.getCode()==0){ LedgerRfid ledgerRfid=gson.fromJson(body.getData().toString(),LedgerRfid.class); vm.setBichCode(ledgerRfid.getBatchCode()); + vm.setLocation(ledgerRfid.getLocationType()); vm.setLocationCode(ledgerRfid.getLocationCode()); vm.setState(ledgerRfid.getDictLabel()); @@ -56,12 +58,14 @@ public class FpInActivity extends BaseActivity { } public void fpin_submit(View view){ + Log.e("TAG", "onSuccess:" +vm.toString() ); + var state = vm.getState(); if (!state.equals("报废")){ Toast.makeText(this, "轮挡状态:"+state+",不能使用废品入库功能", Toast.LENGTH_SHORT).show(); return; } - if (!vm.getLocation().equals("仓库")){ + if (vm.getLocation().equals("仓库")){ Toast.makeText(this, "轮挡状态已在仓库", Toast.LENGTH_SHORT).show(); return; } diff --git a/app/src/main/java/com/example/beijing_daxing/vm/FpInVm.java b/app/src/main/java/com/example/beijing_daxing/vm/FpInVm.java index 7923439..8744f70 100644 --- a/app/src/main/java/com/example/beijing_daxing/vm/FpInVm.java +++ b/app/src/main/java/com/example/beijing_daxing/vm/FpInVm.java @@ -97,4 +97,18 @@ public class FpInVm extends BaseObservable { this.time = time; notifyChange(); } + + @Override + public String toString() { + return "FpInVm{" + + "epc='" + epc + '\'' + + ", bichCode='" + bichCode + '\'' + + ", location='" + location + '\'' + + ", locationCode='" + locationCode + '\'' + + ", state='" + state + '\'' + + ", time='" + time + '\'' + + ", submitCode='" + submitCode + '\'' + + ", list=" + list + + '}'; + } } diff --git a/app/src/main/res/layout/activity_fp_in.xml b/app/src/main/res/layout/activity_fp_in.xml index e8bb48b..7c95080 100644 --- a/app/src/main/res/layout/activity_fp_in.xml +++ b/app/src/main/res/layout/activity_fp_in.xml @@ -168,6 +168,7 @@ android:layout_height="45dp" android:textAlignment="center" android:entries="@{vm.list}" + android:onItemSelected="@{vm.selectLocation}" />