master
wangh 1 year ago
parent 6a059fa2b9
commit 9faa3c70be

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

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

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

@ -38,8 +38,6 @@ public class X1Activity extends BaseActivity {
TextView x1Code; TextView x1Code;
@BindView(R.id.x1_recycler_view) @BindView(R.id.x1_recycler_view)
RecyclerView x1RecyclerView; RecyclerView x1RecyclerView;
@BindView(R.id.x1_tong) @BindView(R.id.x1_tong)
TextView x1Tong; TextView x1Tong;
@BindView(R.id.x1_goods_code) @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) { public void onClick(View view) {
switch (view.getId()) { switch (view.getId()) {
case R.id.info_title_back: case R.id.info_title_back:
@ -110,36 +108,47 @@ public class X1Activity extends BaseActivity {
break; break;
case R.id.x1_submit: case R.id.x1_submit:
if (entrySubmit == null) return; if (entrySubmit == null) return;
dialog.show(); submit(entrySubmit,1);
RequestBody requestBody = RequestBody.create(MediaType.parse("application/json;"),
JSONObject.toJSONString(entrySubmit));
OkGo.<Resust>post("http://" + SharedPreferencesUtils.getstring("ip", null) + "/api/Warehouse/ExecPlcState")
.upRequestBody(requestBody)
.execute(new MyOkGoCallback() {
@Override
public void onSuccess(Response<Resust> response) {
super.onSuccess(response);
dialog.dismiss();
Toast.makeText(X1Activity.this, response.body().getMsg(), Toast.LENGTH_SHORT).show();
if (response.body().isSuccess()) {
finish();
}
}
@Override
public void onError(Response<Resust> response) {
super.onError(response);
dialog.dismiss();
}
});
break; break;
case R.id.x1_submit2:
if (entrySubmit == null) return;
submit(entrySubmit,0);
break;
} }
} }
private String kcode; private String kcode;
private int station; 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")
.upRequestBody(requestBody)
.execute(new MyOkGoCallback() {
@Override
public void onSuccess(Response<Resust> response) {
super.onSuccess(response);
dialog.dismiss();
Toast.makeText(X1Activity.this, response.body().getMsg(), Toast.LENGTH_SHORT).show();
if (response.body().isSuccess()) {
finish();
}
}
@Override
public void onError(Response<Resust> response) {
super.onError(response);
dialog.dismiss();
}
});
}
//查询 釜 //查询 釜
private void getF(String info) { private void getF(String info) {
OkGo.<Resust>get("http://" + SharedPreferencesUtils.getstring("ip", null) + "/api/Warehouse/GetByCode") OkGo.<Resust>get("http://" + SharedPreferencesUtils.getstring("ip", null) + "/api/Warehouse/GetByCode")
@ -154,6 +163,7 @@ public class X1Activity extends BaseActivity {
station = x1.getID();// station = x1.getID();//
kcode = x1.getBarCode();// kcode = x1.getBarCode();//
items = x1.getChildren(); items = x1.getChildren();
pianId=x1.getPlanId();
adapter.setList(items); adapter.setList(items);
x1RecyclerView.setAdapter(adapter); x1RecyclerView.setAdapter(adapter);
scanStates = false;//扫描 scanStates = false;//扫描

@ -37,6 +37,24 @@ public class PlanView {
private String WholeMaterial; private String WholeMaterial;
private int State; 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() { public int getMid() {
return Mid; return Mid;

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

@ -11,7 +11,18 @@ public class X1Submit {
private double matWeight;//物料重量 private double matWeight;//物料重量
private String matType;// 物料类型:整包、散装 private String matType;// 物料类型:整包、散装
private int state;//状态 0:未扫描 1:匹配 2:报警 private int state;//状态 0:未扫描 1:匹配 2:报警
private String wholePackage; 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() { public int getStation() {
return station; return station;
} }
@ -56,6 +67,20 @@ private String wholePackage;
return state; 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() { public String getWholePackage() {
return wholePackage; return wholePackage;
} }
@ -64,7 +89,4 @@ private String wholePackage;
this.wholePackage = wholePackage; this.wholePackage = wholePackage;
} }
public void setState(int state) {
this.state = state;
}
} }

@ -100,6 +100,27 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginLeft="10dp" /> android:layout_marginLeft="10dp" />
</LinearLayout> </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 <Button

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