完成 pda更换

master
wanghao 1 month ago
parent 361b366f32
commit 812e872573

@ -117,7 +117,7 @@ public class LoadScanActivity extends BaseActivity implements CargoListAdapter.C
public void clickCargoInfo(int index) {
cargoInfoTag = cargoInfoList.get(index);
Log.e("TAG", "clickCargoInfo:" + cargoInfoTag.toString());
// Log.e("TAG", "clickCargoInfo:" + cargoInfoTag.toString());
loadOperations = LitePal.where("cargoId =? and type = ? and (state IS NULL or state = '修改') ",
String.valueOf(cargoInfoTag.getId()), "正常")
.find(LoadOperation.class);
@ -149,6 +149,13 @@ public class LoadScanActivity extends BaseActivity implements CargoListAdapter.C
loadInfoAdapter.notifyDataSetChanged();
}
public void loadOverupdate(View view) {
CargoInfo cargoInfo=new CargoInfo();
cargoInfo.setState("装载中");
cargoInfo.updateAll();
}
// 装载完毕
@SuppressLint("NotifyDataSetChanged")
public void loadOver(View view) {

@ -2,6 +2,7 @@ package com.example.as_trak.adapter;
import android.annotation.SuppressLint;
import android.content.Context;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.ViewGroup;
import android.widget.TextView;
@ -74,11 +75,14 @@ public class CargoListAdapter extends RecyclerView.Adapter<CargoListAdapter.MyVi
if (tag!=-1){
bgList.set(tag,false);
notifyItemChanged(tag);
Log.e("TAG", "上次点击:" +tag );
}
bgList.set(position,true);
call.clickCargoInfo(position);
tag=position;
notifyItemChanged(position);
Log.e("TAG", "本次点击:" +position );
});
}

@ -24,7 +24,7 @@ public class BaseActivity extends AppCompatActivity {
public void initScan() {
myReceiver = new MyScanCodeBroad();
IntentFilter intentFilter = new IntentFilter();
intentFilter.addAction("android.intent.action.SCANRESULT");
intentFilter.addAction("android.intent.ACTION_DECODE_DATA");
registerReceiver(myReceiver, intentFilter);
}
@ -37,7 +37,7 @@ public class BaseActivity extends AppCompatActivity {
private class MyScanCodeBroad extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
String value = intent.getStringExtra("value");
String value = intent.getStringExtra("barcode_string");
Log.e("TAG", "onReceive:" + value);
sanCodeResult(value);
}

@ -184,9 +184,22 @@
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:text="装载完毕"
android:textSize="19sp"
android:textStyle="bold"
android:onClick="loadOver"
android:letterSpacing="0.5" />
<Button
android:layout_width="300dp"
android:layout_height="48dp"
android:layout_gravity="center"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:text="update"
android:textSize="19sp"
android:textStyle="bold"
android:onClick="loadOverupdate"
android:visibility="gone"
android:letterSpacing="0.5" />
</LinearLayout>
</layout>
Loading…
Cancel
Save