master
wangh 1 year ago
parent 6a059fa2b9
commit 9faa3c70be

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

@ -10,7 +10,7 @@
{
"type": "SINGLE",
"filters": [],
"versionCode": 2,
"versionCode": 4,
"versionName": "1.0",
"outputFile": "app-release.apk"
}

@ -3,7 +3,9 @@ package com.example.pulit;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.Spinner;
import android.widget.TextView;
import android.widget.Toast;
@ -31,6 +33,9 @@ public class SolventActivity extends BaseActivity {
TextView solventGoodsName;
@BindView(R.id.s2gion)
LinearLayout s2gion;
@BindView(R.id.solvent_db)
Spinner solventDb;
private boolean sanType;
@Override
@ -72,7 +77,11 @@ public class SolventActivity extends BaseActivity {
break;
case R.id.solvent_submit:
if (planView == null) return;
String dbaname = solventDb.getSelectedItem().toString();
String string = solventCode.getText().toString();
dialog.show();
planView.setWeighbridge(dbaname);
planView.setCylinderBarCode(string);
RequestBody requestBody = RequestBody.create(MediaType.parse("application/json;"),
JSONObject.toJSONString(planView));
OkGo.<Resust>post("http://" + SharedPreferencesUtils.getstring("ip", null) + "/api/Solvent/ExecPlcState")
@ -87,6 +96,7 @@ public class SolventActivity extends BaseActivity {
finish();
}
}
@Override
public void onError(Response<Resust> response) {
super.onError(response);

@ -38,8 +38,6 @@ public class X1Activity extends BaseActivity {
TextView x1Code;
@BindView(R.id.x1_recycler_view)
RecyclerView x1RecyclerView;
@BindView(R.id.x1_tong)
TextView x1Tong;
@BindView(R.id.x1_goods_code)
@ -99,7 +97,7 @@ public class X1Activity extends BaseActivity {
}
@OnClick({R.id.info_title_back, R.id.x1_scan, R.id.x1_submit})
@OnClick({R.id.info_title_back, R.id.x1_scan, R.id.x1_submit, R.id.x1_submit2})
public void onClick(View view) {
switch (view.getId()) {
case R.id.info_title_back:
@ -110,7 +108,24 @@ public class X1Activity extends BaseActivity {
break;
case R.id.x1_submit:
if (entrySubmit == null) return;
submit(entrySubmit,1);
break;
case R.id.x1_submit2:
if (entrySubmit == null) return;
submit(entrySubmit,0);
break;
}
}
private String kcode;
private int station;
private String pianId;
//提交
private void submit(X1Submit entrySubmit,int state){
dialog.show();
entrySubmit.setStates(state);
entrySubmit.setPlanId(pianId);
RequestBody requestBody = RequestBody.create(MediaType.parse("application/json;"),
JSONObject.toJSONString(entrySubmit));
OkGo.<Resust>post("http://" + SharedPreferencesUtils.getstring("ip", null) + "/api/Warehouse/ExecPlcState")
@ -133,13 +148,7 @@ public class X1Activity extends BaseActivity {
}
});
break;
}
}
private String kcode;
private int station;
//查询 釜
private void getF(String info) {
OkGo.<Resust>get("http://" + SharedPreferencesUtils.getstring("ip", null) + "/api/Warehouse/GetByCode")
@ -154,6 +163,7 @@ public class X1Activity extends BaseActivity {
station = x1.getID();//
kcode = x1.getBarCode();//
items = x1.getChildren();
pianId=x1.getPlanId();
adapter.setList(items);
x1RecyclerView.setAdapter(adapter);
scanStates = false;//扫描

@ -37,6 +37,24 @@ public class PlanView {
private String WholeMaterial;
private int State;
private String Weighbridge;//9.25新增 地磅
private String CylinderBarCode;//9.25新增 地磅
public String getCylinderBarCode() {
return CylinderBarCode;
}
public void setCylinderBarCode(String cylinderBarCode) {
CylinderBarCode = cylinderBarCode;
}
public String getWeighbridge() {
return Weighbridge;
}
public void setWeighbridge(String weighbridge) {
Weighbridge = weighbridge;
}
public int getMid() {
return Mid;

@ -9,6 +9,7 @@ import java.util.List;
public class X1 {
private int ID;
private String Name;
private String PlanId; //计划ID
private String BarCode;
private String CreateTime;
private List<Item> Children;
@ -17,6 +18,14 @@ public class X1 {
return ID;
}
public String getPlanId() {
return PlanId;
}
public void setPlanId(String planId) {
PlanId = planId;
}
public void setID(int ID) {
this.ID = ID;
}

@ -12,6 +12,17 @@ public class X1Submit {
private String matType;// 物料类型:整包、散装
private int state;//状态 0:未扫描 1:匹配 2:报警
private String wholePackage;
private String PlanId; //计划ID
private int State;
public String getPlanId() {
return PlanId;
}
public void setPlanId(String planId) {
PlanId = planId;
}
public int getStation() {
return station;
}
@ -56,6 +67,20 @@ private String wholePackage;
return state;
}
public void setState(int state) {
this.state = state;
}
public int getStateS() {
return State;
}
public void setStates(int state) {
this.State = state;
}
public String getWholePackage() {
return wholePackage;
}
@ -64,7 +89,4 @@ private String wholePackage;
this.wholePackage = wholePackage;
}
public void setState(int state) {
this.state = state;
}
}

@ -100,6 +100,27 @@
android:layout_height="match_parent"
android:layout_marginLeft="10dp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="46dp"
android:layout_marginStart="10dp"
android:layout_marginTop="20dp"
android:layout_marginEnd="10dp"
android:orientation="horizontal">
<TextView
style="@style/text_view"
android:layout_width="100dp"
android:layout_height="46dp"
android:text="地磅编号" />
<Spinner
android:id="@+id/solvent_db"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="10dp"
android:entries="@array/power"/>
</LinearLayout>
<Button

@ -138,17 +138,33 @@
android:layout_marginTop="22dp"
android:layout_marginEnd="20dp"
android:text="触发扫描" />
<Button
android:id="@+id/x1_submit"
style="@style/button_style2"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="54dp"
android:layout_marginStart="20dp"
android:layout_marginTop="22dp"
android:layout_marginEnd="20dp"
android:layout_marginBottom="22dp"
android:text="反应釜投料完毕" />
android:layout_marginBottom="22dp">
<Button
android:id="@+id/x1_submit"
style="@style/button_style2"
android:layout_width="match_parent"
android:layout_height="54dp"
android:layout_weight="1"
android:text="开启釜投料" />
<Button
android:id="@+id/x1_submit2"
style="@style/button_style2"
android:layout_width="match_parent"
android:layout_marginLeft="6dp"
android:layout_height="54dp"
android:layout_weight="1"
android:text="关闭反应釜" />
</LinearLayout>
</LinearLayout>

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string-array name="power" >
<item>1号地磅</item>
<item>2号地磅</item>
</string-array>
</resources>
Loading…
Cancel
Save