|
|
|
@ -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,36 +108,47 @@ public class X1Activity extends BaseActivity {
|
|
|
|
|
break;
|
|
|
|
|
case R.id.x1_submit:
|
|
|
|
|
if (entrySubmit == null) return;
|
|
|
|
|
dialog.show();
|
|
|
|
|
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();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
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")
|
|
|
|
|
.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) {
|
|
|
|
|
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;//扫描
|
|
|
|
|