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}" />