增加 原材料入库
parent
affc7fa35c
commit
8c7bb7532f
@ -0,0 +1,132 @@
|
|||||||
|
package com.example.haiwei_mom.data;
|
||||||
|
|
||||||
|
|
||||||
|
import androidx.databinding.BaseObservable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 入库单-物料打印条码视图对象 wms_instock_print
|
||||||
|
*
|
||||||
|
* @author LionLi
|
||||||
|
* @date 2025-01-07
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class RawInstock extends BaseObservable {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 入库单子表主键
|
||||||
|
*/
|
||||||
|
|
||||||
|
private Long instockPrintId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 入库单号
|
||||||
|
*/
|
||||||
|
|
||||||
|
private String instockCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批次码
|
||||||
|
*/
|
||||||
|
|
||||||
|
private String batchCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 条码数量
|
||||||
|
*/
|
||||||
|
|
||||||
|
private double materialQty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分包数量
|
||||||
|
*/
|
||||||
|
|
||||||
|
private Long apportionQty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料id
|
||||||
|
*/
|
||||||
|
|
||||||
|
private Long materialId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料编码
|
||||||
|
*/
|
||||||
|
|
||||||
|
private String materialCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料名称
|
||||||
|
*/
|
||||||
|
|
||||||
|
private String materialName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料规格
|
||||||
|
*/
|
||||||
|
|
||||||
|
private String materialSpe;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计量单位名称
|
||||||
|
*/
|
||||||
|
|
||||||
|
private String unitName;
|
||||||
|
|
||||||
|
public double getMaterialQty() {
|
||||||
|
return materialQty;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料大类
|
||||||
|
*/
|
||||||
|
|
||||||
|
private String materialCategories;
|
||||||
|
|
||||||
|
public String getInstockCode() {
|
||||||
|
return instockCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getMaterialId() {
|
||||||
|
return materialId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMaterialCode() {
|
||||||
|
return materialCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMaterialName() {
|
||||||
|
return materialName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMaterialSpe() {
|
||||||
|
return materialSpe;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUnitName() {
|
||||||
|
return unitName;
|
||||||
|
}
|
||||||
|
private String locationCode;
|
||||||
|
private String instockQty;
|
||||||
|
|
||||||
|
public String getLocationCode() {
|
||||||
|
return locationCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLocationCode(String locationCode) {
|
||||||
|
this.locationCode = locationCode;
|
||||||
|
notifyChange();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getInstockQty() {
|
||||||
|
return instockQty;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInstockQty(String instockQty) {
|
||||||
|
this.instockQty = instockQty;
|
||||||
|
notifyChange();
|
||||||
|
}
|
||||||
|
}
|
@ -1,16 +1,84 @@
|
|||||||
package com.example.haiwei_mom.wms.raw;
|
package com.example.haiwei_mom.wms.raw;
|
||||||
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
import androidx.databinding.DataBindingUtil;
|
||||||
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.EditText;
|
||||||
|
|
||||||
import com.example.haiwei_mom.R;
|
import com.example.haiwei_mom.R;
|
||||||
|
import com.example.haiwei_mom.base.BaseActivity;
|
||||||
|
import com.example.haiwei_mom.base.MyRecultCall;
|
||||||
|
import com.example.haiwei_mom.base.MyResult;
|
||||||
|
import com.example.haiwei_mom.data.RawInstock;
|
||||||
|
import com.example.haiwei_mom.databinding.ActivityRawInBinding;
|
||||||
|
import com.lzy.okgo.OkGo;
|
||||||
|
import com.lzy.okgo.model.Response;
|
||||||
|
|
||||||
public class RawInActivity extends AppCompatActivity {
|
import okhttp3.RequestBody;
|
||||||
|
|
||||||
|
public class RawInActivity extends BaseActivity implements View.OnFocusChangeListener {
|
||||||
|
private RawInstock rawInstock;
|
||||||
|
private ActivityRawInBinding binding;
|
||||||
|
private EditText editTextView;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.activity_raw_in);
|
binding = DataBindingUtil.setContentView(this, R.layout.activity_raw_in);
|
||||||
|
binding.materialInLocation.setOnFocusChangeListener(this);
|
||||||
|
binding.materialInGoods.setOnFocusChangeListener(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void getScannerData(String data) {
|
||||||
|
super.getScannerData(data);
|
||||||
|
if (editTextView == binding.materialInLocation) {
|
||||||
|
editTextView.setText(data);
|
||||||
|
|
||||||
|
} else if (editTextView == binding.materialInGoods || rawInstock == null) {
|
||||||
|
binding.materialInGoods.setText(data);
|
||||||
|
OkGo.<MyResult>post(url + "/wms/pda/raw/inSelectCode").params("code", data).execute(new MyRecultCall(dialog, this) {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(Response<MyResult> response) {
|
||||||
|
super.onSuccess(response);
|
||||||
|
var body = response.body();
|
||||||
|
if (body.getCode() == 200) {
|
||||||
|
rawInstock = gson.fromJson(body.getDataJson(), RawInstock.class);
|
||||||
|
binding.setData(rawInstock);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
myToastUitls.show(body.getMsg());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFocusChange(View v, boolean hasFocus) {
|
||||||
|
if (hasFocus) {
|
||||||
|
editTextView = (EditText) v;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void rawinSubmit(View view) {
|
||||||
|
OkGo.<MyResult>post(url + "/wms/pda/semi/submitOutInfo")
|
||||||
|
.upRequestBody(RequestBody.create(JSON, gson.toJson(rawInstock)))
|
||||||
|
.execute(new MyRecultCall(dialog, this) {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(Response<MyResult> response) {
|
||||||
|
super.onSuccess(response);
|
||||||
|
var body = response.body();
|
||||||
|
if (body.getCode() == 200) {
|
||||||
|
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
myToastUitls.show(body.getMsg());
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue