|
|
@ -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;//扫描
|
|
|
|