增加 小料重量核对

master
wangh 1 year ago
parent 9ef7e50fa6
commit 6a059fa2b9

@ -10,7 +10,7 @@ android {
applicationId "com.example.pulit" applicationId "com.example.pulit"
minSdkVersion 26 minSdkVersion 26
targetSdkVersion 30 targetSdkVersion 30
versionCode 2 versionCode 3
versionName "1.0" versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

@ -3,6 +3,9 @@ package com.example.pulit;
import android.os.Bundle; import android.os.Bundle;
import android.util.Log; import android.util.Log;
import android.view.View; import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.LinearLayout;
import android.widget.ListPopupWindow;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast; import android.widget.Toast;
@ -20,6 +23,7 @@ import com.example.pulit.util.SharedPreferencesUtils;
import com.lzy.okgo.OkGo; import com.lzy.okgo.OkGo;
import com.lzy.okgo.model.Response; import com.lzy.okgo.model.Response;
import java.util.Arrays;
import java.util.List; import java.util.List;
import butterknife.BindView; import butterknife.BindView;
@ -42,13 +46,15 @@ public class X1Activity extends BaseActivity {
TextView x1GoodsCode; TextView x1GoodsCode;
@BindView(R.id.x1_goods_Weight) @BindView(R.id.x1_goods_Weight)
TextView x1GoodsWeight; TextView x1GoodsWeight;
@BindView(R.id.x1_code1)
LinearLayout x1Code1;
private boolean scanStates; private boolean scanStates;
private List<Item> items; private List<Item> items;
private ItemAdapter adapter; private ItemAdapter adapter;
private X1Submit entrySubmit; private X1Submit entrySubmit;
private ListPopupWindow lpw;
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
@ -58,6 +64,10 @@ public class X1Activity extends BaseActivity {
scanStates = true; scanStates = true;
x1RecyclerView.setLayoutManager(new LinearLayoutManager(this)); x1RecyclerView.setLayoutManager(new LinearLayoutManager(this));
adapter = new ItemAdapter(this); adapter = new ItemAdapter(this);
lpw = new ListPopupWindow(this);
lpw.setAnchorView(x1Code1);
lpw.setAdapter(new ArrayAdapter(this, R.layout.support_simple_spinner_dropdown_item, Arrays.asList("B20230011", "B20230300", "B20230221", "B20230192", "B20230223")));
lpw.setOnItemClickListener((adapterView, view, i, l) -> lpw.dismiss());
} }
@Override @Override
@ -68,7 +78,6 @@ public class X1Activity extends BaseActivity {
dialog.show(); dialog.show();
//反应釜查询 //反应釜查询
getF(info); getF(info);
} else { } else {
x1Tong.setText(info); x1Tong.setText(info);
if (info.contains("kg")) { if (info.contains("kg")) {
@ -148,6 +157,7 @@ public class X1Activity extends BaseActivity {
adapter.setList(items); adapter.setList(items);
x1RecyclerView.setAdapter(adapter); x1RecyclerView.setAdapter(adapter);
scanStates = false;//扫描 scanStates = false;//扫描
lpw.show();
} else { } else {
Toast.makeText(X1Activity.this, "请求失败,条码不正确", Toast.LENGTH_SHORT).show(); Toast.makeText(X1Activity.this, "请求失败,条码不正确", Toast.LENGTH_SHORT).show();
} }

@ -42,7 +42,7 @@ public class X2Activity extends BaseActivity {
ButterKnife.bind(this); ButterKnife.bind(this);
sanType = true; sanType = true;
} }
//1A000001、000524
@Override @Override
public void scanInfo(String info) { public void scanInfo(String info) {
if (sanType) { if (sanType) {
@ -94,7 +94,7 @@ public class X2Activity extends BaseActivity {
if (state == 0) return; if (state == 0) return;
dialog.show(); dialog.show();
OkGo.<Resust>post("http://" + SharedPreferencesUtils.getstring("ip", null) + "/api/xl_material/ExecPlcCode") OkGo.<Resust>get("http://" + SharedPreferencesUtils.getstring("ip", null) + "/api/xl_material/ExecPlcCode")
.params("code",Bin_Serial) .params("code",Bin_Serial)
.params("state",state) .params("state",state)
.execute(new MyOkGoCallback() { .execute(new MyOkGoCallback() {

@ -30,6 +30,7 @@
<LinearLayout <LinearLayout
android:id="@+id/x1_code1"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="46dp" android:layout_height="46dp"
android:layout_marginStart="10dp" android:layout_marginStart="10dp"

Loading…
Cancel
Save