|
|
|
@ -23,6 +23,7 @@ import okhttp3.RequestBody;
|
|
|
|
|
public class MainActivity extends BaseActivity {
|
|
|
|
|
private MainVm mainVm;
|
|
|
|
|
private AlertDialog alertDialog;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
protected void onCreate(Bundle savedInstanceState) {
|
|
|
|
|
super.onCreate(savedInstanceState);
|
|
|
|
@ -47,17 +48,20 @@ public class MainActivity extends BaseActivity {
|
|
|
|
|
*/
|
|
|
|
|
return false;
|
|
|
|
|
});
|
|
|
|
|
alertDialog=new AlertDialog.Builder(this)
|
|
|
|
|
alertDialog = new AlertDialog.Builder(this)
|
|
|
|
|
.setTitle("投料提示")
|
|
|
|
|
.setMessage("选择投料类型").setNegativeButton("取消",null)
|
|
|
|
|
.setMessage("是否开仓投料")
|
|
|
|
|
.setNegativeButton("取消", null)
|
|
|
|
|
.setPositiveButton("投料", new DialogInterface.OnClickListener() {
|
|
|
|
|
@Override
|
|
|
|
|
public void onClick(DialogInterface dialog, int which) {
|
|
|
|
|
ingredientInfo.setIsOpen(1);
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.setNeutralButton("保存数据", new DialogInterface.OnClickListener() {
|
|
|
|
|
@Override
|
|
|
|
|
public void onClick(DialogInterface dialog, int which) {
|
|
|
|
|
ingredientInfo.setIsOpen(2);
|
|
|
|
|
}
|
|
|
|
|
}).create();
|
|
|
|
|
}
|
|
|
|
@ -94,14 +98,17 @@ public class MainActivity extends BaseActivity {
|
|
|
|
|
san_info = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private IngredientInfo ingredientInfo;
|
|
|
|
|
|
|
|
|
|
public void submit1(View view) {
|
|
|
|
|
IngredientInfo ingredientInfo = new IngredientInfo();
|
|
|
|
|
|
|
|
|
|
ingredientInfo = new IngredientInfo();
|
|
|
|
|
ingredientInfo.setCanNumber(mainVm.getTankCode());
|
|
|
|
|
ingredientInfo.setMaterialBarcode(mainVm.getTrayCode());
|
|
|
|
|
try {
|
|
|
|
|
ingredientInfo.setInputQuantity(Integer.parseInt(mainVm.getInputNuber()));
|
|
|
|
|
ingredientInfo.setInputWeight(Double.parseDouble(mainVm.getInputWeight()));
|
|
|
|
|
}catch (Exception e){
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
Toast.makeText(this, "必填数据没有填写", Toast.LENGTH_SHORT).show();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
@ -110,11 +117,11 @@ public class MainActivity extends BaseActivity {
|
|
|
|
|
if (type) {
|
|
|
|
|
ingredientInfo.setRemainder(mainVm.isResidueYes());
|
|
|
|
|
var residueNum = mainVm.getResidueNum();
|
|
|
|
|
if (residueNum!=null){
|
|
|
|
|
if (residueNum != null) {
|
|
|
|
|
ingredientInfo.setRemainderQuantity(Integer.parseInt(residueNum));
|
|
|
|
|
}
|
|
|
|
|
var residueWeight = mainVm.getResidueWeight();
|
|
|
|
|
if (residueWeight!=null){
|
|
|
|
|
if (residueWeight != null) {
|
|
|
|
|
ingredientInfo.setRemainderWeight(Double.parseDouble(residueWeight));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|