增加 原材料入库
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;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.EditText;
|
||||
|
||||
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
|
||||
protected void onCreate(Bundle 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());
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
@ -1,151 +1,168 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
tools:context=".wms.raw.RawInActivity">
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<include
|
||||
layout="@layout/toolbar"
|
||||
app:title='@{title??"半成品出库"}' />
|
||||
<data>
|
||||
|
||||
<variable
|
||||
name="title"
|
||||
type="String" />
|
||||
<variable
|
||||
name="data"
|
||||
type="com.example.haiwei_mom.data.RawInstock" />
|
||||
</data>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="45dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginEnd="4dp">
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
tools:context=".wms.raw.RawInActivity">
|
||||
|
||||
<TextView
|
||||
style="@style/text_title"
|
||||
android:layout_width="110dp"
|
||||
android:layout_height="match_parent"
|
||||
android:text="扫描批次码:" />
|
||||
<include
|
||||
layout="@layout/toolbar"
|
||||
app:title='@{title??"半成品出库"}' />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/material_in_goods"
|
||||
style="@style/text_san"
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
android:layout_height="45dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginEnd="4dp">
|
||||
|
||||
</LinearLayout>
|
||||
<TextView
|
||||
style="@style/text_title"
|
||||
android:layout_width="110dp"
|
||||
android:layout_height="match_parent"
|
||||
android:text="扫描批次码:" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="45dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginEnd="4dp">
|
||||
<EditText
|
||||
android:id="@+id/material_in_goods"
|
||||
style="@style/text_san"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<TextView
|
||||
style="@style/text_title"
|
||||
android:layout_width="110dp"
|
||||
android:layout_height="match_parent"
|
||||
android:text="物料编码:" />
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
style="@style/text_info"
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:text="@{data.materialCode}" />
|
||||
<!-- android:text="@{vo.materialName}"-->
|
||||
android:layout_height="45dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginEnd="4dp">
|
||||
|
||||
</LinearLayout>
|
||||
<TextView
|
||||
style="@style/text_title"
|
||||
android:layout_width="110dp"
|
||||
android:layout_height="match_parent"
|
||||
android:text="物料编码:" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="45dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginEnd="4dp">
|
||||
<TextView
|
||||
style="@style/text_info"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:text="@{data.materialCode}" />
|
||||
<!-- android:text="@{vo.materialName}"-->
|
||||
|
||||
<TextView
|
||||
style="@style/text_title"
|
||||
android:layout_width="110dp"
|
||||
android:layout_height="match_parent"
|
||||
android:text="物料规格:" />
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
style="@style/text_info"
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:text="@{data.materialSpec}" />
|
||||
android:layout_height="45dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginEnd="4dp">
|
||||
|
||||
</LinearLayout>
|
||||
<TextView
|
||||
style="@style/text_title"
|
||||
android:layout_width="110dp"
|
||||
android:layout_height="match_parent"
|
||||
android:text="物料规格:" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="45dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginEnd="4dp">
|
||||
<TextView
|
||||
style="@style/text_info"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:text="@{data.materialSpe}" />
|
||||
|
||||
<TextView
|
||||
style="@style/text_title"
|
||||
android:layout_width="110dp"
|
||||
android:layout_height="match_parent"
|
||||
android:text="批次数量:" />
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
style="@style/text_info"
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:layout_weight="1"
|
||||
android:text='@{String.valueOf(data.instockNum)??"0"}' />
|
||||
android:layout_height="45dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginEnd="4dp">
|
||||
|
||||
<TextView
|
||||
style="@style/text_info"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="match_parent" />
|
||||
<TextView
|
||||
style="@style/text_title"
|
||||
android:layout_width="110dp"
|
||||
android:layout_height="match_parent"
|
||||
android:text="批次数量:" />
|
||||
|
||||
</LinearLayout>
|
||||
<TextView
|
||||
style="@style/text_info"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:layout_weight="1"
|
||||
android:text='@{String.valueOf(data.materialQty)??"0"}' />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginEnd="4dp">
|
||||
<TextView
|
||||
style="@style/text_info"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="match_parent"
|
||||
android:text="@{data.unitName}"/>
|
||||
|
||||
<TextView
|
||||
style="@style/text_title"
|
||||
android:layout_width="110dp"
|
||||
android:layout_height="match_parent"
|
||||
android:text="目标库位:" />
|
||||
<!-- -->
|
||||
<EditText
|
||||
android:id="@+id/material_in_location"
|
||||
style="@style/text_san"
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="45dp" />
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginEnd="4dp">
|
||||
|
||||
</LinearLayout>
|
||||
<TextView
|
||||
style="@style/text_title"
|
||||
android:layout_width="110dp"
|
||||
android:layout_height="match_parent"
|
||||
android:text="目标库位:" />
|
||||
<!-- -->
|
||||
<EditText
|
||||
android:id="@+id/material_in_location"
|
||||
style="@style/text_san"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="45dp"
|
||||
android:text="@={data.locationCode}"
|
||||
/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="45dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginEnd="4dp">
|
||||
|
||||
<TextView
|
||||
style="@style/text_title"
|
||||
android:layout_width="110dp"
|
||||
android:layout_height="match_parent"
|
||||
android:text="入库数量:" />
|
||||
|
||||
<EditText
|
||||
style="@style/text_info"
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:inputType="numberDecimal" />
|
||||
android:layout_height="45dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginEnd="4dp">
|
||||
|
||||
<TextView
|
||||
style="@style/text_title"
|
||||
android:layout_width="110dp"
|
||||
android:layout_height="match_parent"
|
||||
android:text="入库数量:" />
|
||||
|
||||
<EditText
|
||||
style="@style/text_info"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:inputType="numberDecimal"
|
||||
android:text="@={data.instockQty}"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<Button
|
||||
style="@style/button_style"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="55dp"
|
||||
android:layout_margin="20dp"
|
||||
android:onClick="rawinSubmit"
|
||||
android:text="提交" />
|
||||
</LinearLayout>
|
||||
|
||||
<Button
|
||||
style="@style/button_style"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="55dp"
|
||||
android:layout_margin="20dp"
|
||||
android:onClick="semiInSubmit"
|
||||
android:text="提交" />
|
||||
</LinearLayout>
|
||||
</layout>
|
Loading…
Reference in New Issue