|
|
|
@ -2,10 +2,7 @@ package com.example.haiwei_mom.ipc;
|
|
|
|
|
|
|
|
|
|
import android.annotation.SuppressLint;
|
|
|
|
|
import android.os.Bundle;
|
|
|
|
|
import android.util.Log;
|
|
|
|
|
import android.view.View;
|
|
|
|
|
import android.view.inputmethod.EditorInfo;
|
|
|
|
|
import android.widget.Toast;
|
|
|
|
|
|
|
|
|
|
import androidx.databinding.DataBindingUtil;
|
|
|
|
|
|
|
|
|
@ -16,8 +13,6 @@ import com.example.haiwei_mom.base.MyResult;
|
|
|
|
|
import com.example.haiwei_mom.databinding.ActivityFeedingMaterialsBinding;
|
|
|
|
|
import com.example.haiwei_mom.ipc.data.MachinePlan;
|
|
|
|
|
import com.example.haiwei_mom.uitls.SharedPreferencesUtils;
|
|
|
|
|
|
|
|
|
|
import com.google.android.material.snackbar.Snackbar;
|
|
|
|
|
import com.google.gson.reflect.TypeToken;
|
|
|
|
|
import com.lzy.okgo.OkGo;
|
|
|
|
|
import com.lzy.okgo.model.Response;
|
|
|
|
@ -32,7 +27,8 @@ public class FeedingMaterialsActivity extends BaseActivity {
|
|
|
|
|
private ActivityFeedingMaterialsBinding binding;
|
|
|
|
|
private MachinePlan machinePlan;
|
|
|
|
|
private String machineNo;
|
|
|
|
|
private String from;
|
|
|
|
|
private String from;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
protected void onCreate(Bundle savedInstanceState) {
|
|
|
|
|
super.onCreate(savedInstanceState);
|
|
|
|
@ -43,11 +39,13 @@ public class FeedingMaterialsActivity extends BaseActivity {
|
|
|
|
|
machineNo = SharedPreferencesUtils.getstring("machineNo", null);
|
|
|
|
|
binding.feedingCode.setText(machineNo);
|
|
|
|
|
initRequest();
|
|
|
|
|
selectMachineStationList();
|
|
|
|
|
binding.feedingBarCode.setOnEditorActionListener((v, actionId, event) -> {
|
|
|
|
|
feedingCodeSubmit(null);
|
|
|
|
|
return true;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 获取计划
|
|
|
|
|
private void initRequest() {
|
|
|
|
|
Map map = new HashMap();
|
|
|
|
@ -65,16 +63,17 @@ public class FeedingMaterialsActivity extends BaseActivity {
|
|
|
|
|
machinePlan = gson.fromJson(body.getDataJson(), MachinePlan.class);
|
|
|
|
|
binding.setMachineState(body.getMsg());
|
|
|
|
|
binding.setData(machinePlan);
|
|
|
|
|
selectMachineStationList();
|
|
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
myToastUitls.show(body.getMsg());
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
private void selectMachineStationList(){
|
|
|
|
|
|
|
|
|
|
private void selectMachineStationList() {
|
|
|
|
|
OkGo.<MyResult>post(url + "/wms/pda/selectMachineStationList")
|
|
|
|
|
.params("machineId", SharedPreferencesUtils.getstring("machineId",""))
|
|
|
|
|
.params("machineId", SharedPreferencesUtils.getLong("machineId", 0L))
|
|
|
|
|
|
|
|
|
|
.execute(new MyRecultCall(dialog, this) {
|
|
|
|
|
@Override
|
|
|
|
@ -82,7 +81,8 @@ public class FeedingMaterialsActivity extends BaseActivity {
|
|
|
|
|
super.onSuccess(response);
|
|
|
|
|
var body = response.body();
|
|
|
|
|
if (body.getCode() == 200) {
|
|
|
|
|
List<String> list=gson.fromJson(body.getDataJson(),new TypeToken<List<String>>(){}.getType());
|
|
|
|
|
List<String> list = gson.fromJson(body.getDataJson(), new TypeToken<List<String>>() {
|
|
|
|
|
}.getType());
|
|
|
|
|
binding.setList(list);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
@ -94,14 +94,14 @@ public class FeedingMaterialsActivity extends BaseActivity {
|
|
|
|
|
@Override
|
|
|
|
|
public void getScannerData(String data) {
|
|
|
|
|
super.getScannerData(data);
|
|
|
|
|
if (machinePlan==null){
|
|
|
|
|
if (machinePlan == null) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
machinePlan.setFrom(from);
|
|
|
|
|
// if (from.equals("4")){
|
|
|
|
|
// machinePlan.setWorkCode(data);
|
|
|
|
|
// }else {
|
|
|
|
|
machinePlan.setBarCode(data);
|
|
|
|
|
machinePlan.setBarCode(data);
|
|
|
|
|
// }
|
|
|
|
|
machinePlan.setStationCode(binding.feedingSelectStation.getSelectedItem().toString());
|
|
|
|
|
OkGo.<MyResult>post("http://" + SharedPreferencesUtils.getstring("machineIp", null) +
|
|
|
|
|