|
|
|
@ -6,6 +6,7 @@ import android.app.AlertDialog;
|
|
|
|
|
import android.content.DialogInterface;
|
|
|
|
|
import android.content.Intent;
|
|
|
|
|
import android.os.Bundle;
|
|
|
|
|
import android.util.Log;
|
|
|
|
|
import android.view.View;
|
|
|
|
|
import android.widget.Toast;
|
|
|
|
|
|
|
|
|
@ -56,12 +57,14 @@ public class MainActivity extends BaseActivity {
|
|
|
|
|
@Override
|
|
|
|
|
public void onClick(DialogInterface dialog, int which) {
|
|
|
|
|
ingredientInfo.setIsOpen(1);
|
|
|
|
|
submitRequest();
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.setNeutralButton("保存数据", new DialogInterface.OnClickListener() {
|
|
|
|
|
@Override
|
|
|
|
|
public void onClick(DialogInterface dialog, int which) {
|
|
|
|
|
ingredientInfo.setIsOpen(2);
|
|
|
|
|
submitRequest();
|
|
|
|
|
}
|
|
|
|
|
}).create();
|
|
|
|
|
}
|
|
|
|
@ -113,7 +116,10 @@ public class MainActivity extends BaseActivity {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
alertDialog.show();
|
|
|
|
|
}
|
|
|
|
|
private void submitRequest(){
|
|
|
|
|
var type = mainVm.isType();
|
|
|
|
|
Log.e("TAG", "submitRequest:" + type);
|
|
|
|
|
if (type) {
|
|
|
|
|
ingredientInfo.setRemainder(mainVm.isResidueYes());
|
|
|
|
|
var residueNum = mainVm.getResidueNum();
|
|
|
|
@ -127,7 +133,7 @@ public class MainActivity extends BaseActivity {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
OkGo.<MyResult>post(url + "/api/IngCheck/" + (type ? "BigMaterial" : "SmallMaterial"))
|
|
|
|
|
OkGo.<MyResult>post(url + "/api/IngCheck/" + (type ?"SmallMaterial": "BigMaterial" ))
|
|
|
|
|
.tag(this)
|
|
|
|
|
.upRequestBody(RequestBody.create(JSON, gson.toJson(ingredientInfo)))
|
|
|
|
|
.execute(new MyRecultCall(dialog, this) {
|
|
|
|
@ -143,8 +149,6 @@ public class MainActivity extends BaseActivity {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void backAc(View view) {
|
|
|
|
|