增加 小料重量核对

master
wangh 1 year ago
parent 9ef7e50fa6
commit 6a059fa2b9

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

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

@ -42,7 +42,7 @@ public class X2Activity extends BaseActivity {
ButterKnife.bind(this);
sanType = true;
}
//1A000001、000524
@Override
public void scanInfo(String info) {
if (sanType) {
@ -94,7 +94,7 @@ public class X2Activity extends BaseActivity {
if (state == 0) return;
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("state",state)
.execute(new MyOkGoCallback() {

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

Loading…
Cancel
Save