调试 退库

master
wanghao 3 months ago
parent 71e1564379
commit 6df4754edb

@ -3,6 +3,7 @@ package com.example.haiwei_mom.data;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
@ -59,6 +60,90 @@ public class OutDetail {
private String materialName; private String materialName;
private String batchCode;
private String locationCode;
private BigDecimal inventoryQty;
public Long getOutstockDetailId() {
return outstockDetailId;
}
public void setOutstockDetailId(Long outstockDetailId) {
this.outstockDetailId = outstockDetailId;
}
public String getOutstockCode() {
return outstockCode;
}
public void setOutstockCode(String outstockCode) {
this.outstockCode = outstockCode;
}
public Long getOutstockId() {
return outstockId;
}
public void setOutstockId(Long outstockId) {
this.outstockId = outstockId;
}
public Long getMaterialId() {
return materialId;
}
public void setMaterialId(Long materialId) {
this.materialId = materialId;
}
public void setOutstockQty(double outstockQty) {
this.outstockQty = outstockQty;
}
public void setOutSum(double outSum) {
this.outSum = outSum;
}
public String getMaterialCategories() {
return materialCategories;
}
public void setMaterialCategories(String materialCategories) {
this.materialCategories = materialCategories;
}
public void setMaterialCode(String materialCode) {
this.materialCode = materialCode;
}
public void setMaterialName(String materialName) {
this.materialName = materialName;
}
public String getBatchCode() {
return batchCode;
}
public void setBatchCode(String batchCode) {
this.batchCode = batchCode;
}
public String getLocationCode() {
return locationCode;
}
public void setLocationCode(String locationCode) {
this.locationCode = locationCode;
}
public BigDecimal getInventoryQty() {
return inventoryQty;
}
public void setInventoryQty(BigDecimal inventoryQty) {
this.inventoryQty = inventoryQty;
}
public double getOutstockQty() { public double getOutstockQty() {
return outstockQty; return outstockQty;
} }

@ -76,9 +76,36 @@ public class RawInstock extends BaseObservable {
private String inspectionRequest; private String inspectionRequest;
private String inspectionType;
private String inspectionTypeName;
private String title; private String title;
public String getInspectionTypeName() {
if (inspectionType==null){
return "";
}else if (inspectionType.equals("0")){
return "未发起";
}else if (inspectionType.equals("1")){
return "质检中";
}else if (inspectionType.equals("2")){
return "合格";
}else if (inspectionType.equals("3")){
return "不合格";
}
return inspectionTypeName;
}
public String getInspectionType() {
return inspectionType;
}
public void setInspectionType(String inspectionType) {
this.inspectionType = inspectionType;
}
public String getTitle() { public String getTitle() {
return title; return title;
} }

@ -15,7 +15,6 @@ public class RawOutSubmitBeen extends BaseObservable {
private String batchCode; private String batchCode;
/** /**
* *
*/ */
@ -61,4 +60,12 @@ public class RawOutSubmitBeen extends BaseObservable {
this.outstockQty = outstockQty; this.outstockQty = outstockQty;
notifyChange(); notifyChange();
} }
public void clear() {
batchCode = "";
locationCode = "";
outstockQty = "";
notifyChange();
}
} }

@ -1,14 +1,12 @@
package com.example.haiwei_mom.wms.raw; package com.example.haiwei_mom.wms.raw;
import androidx.appcompat.app.AppCompatActivity;
import androidx.databinding.DataBindingUtil;
import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.view.View; import android.view.View;
import android.widget.EditText; import android.widget.EditText;
import android.widget.Toast; import android.widget.Toast;
import androidx.databinding.DataBindingUtil;
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.BaseActivity;
import com.example.haiwei_mom.base.MyRecultCall; import com.example.haiwei_mom.base.MyRecultCall;
@ -24,7 +22,8 @@ public class RawInActivity extends BaseActivity implements View.OnFocusChangeLis
private RawInstock rawInstock; private RawInstock rawInstock;
private ActivityRawInBinding binding; private ActivityRawInBinding binding;
private EditText editTextView; private EditText editTextView;
private String title; private String title;
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
@ -35,7 +34,7 @@ private String title;
binding.materialInLocation.setOnFocusChangeListener(this); binding.materialInLocation.setOnFocusChangeListener(this);
binding.materialInGoods.setOnFocusChangeListener(this); binding.materialInGoods.setOnFocusChangeListener(this);
binding.materialInGoods.setOnEditorActionListener((v, actionId, event) -> { binding.materialInGoods.setOnEditorActionListener((v, actionId, event) -> {
selectGoods( binding.materialInGoods.getText().toString()); selectGoods(binding.materialInGoods.getText().toString());
return true; return true;
}); });
} }
@ -54,7 +53,7 @@ private String title;
} }
private void selectGoods(String data){ private void selectGoods(String data) {
OkGo.<MyResult>post(url + "/wms/pda/raw/inSelectCode") OkGo.<MyResult>post(url + "/wms/pda/raw/inSelectCode")
.params("code", data) .params("code", data)
.params("type", title) .params("type", title)
@ -65,6 +64,9 @@ private String title;
var body = response.body(); var body = response.body();
if (body.getCode() == 200) { if (body.getCode() == 200) {
rawInstock = gson.fromJson(body.getDataJson(), RawInstock.class); rawInstock = gson.fromJson(body.getDataJson(), RawInstock.class);
if (title.equals("质检入库")) {
rawInstock.setInstockQty(String.valueOf(rawInstock.getMaterialQty()));
}
binding.setData(rawInstock); binding.setData(rawInstock);
return; return;
} }
@ -80,28 +82,71 @@ private String title;
} }
} }
public void rawinSubmit(View view) { // 入库
if (rawInstock == null) { public void rawinSubmit1(View view) {
if (!inCheck()) {
return; return;
} }
// 必检
if (rawInstock.getInspectionRequest().equals("0")) {
// 必检有结果
if (rawInstock.getInspectionType().equals("0") || rawInstock.getInspectionType().equals("1")) {
Toast.makeText(context, "检验完成前不能入库", Toast.LENGTH_SHORT).show();
return;
}
}
rawinSubmit();
}
// 质检
public void rawinSubmit2(View view) {
if (!inCheck()) {
return;
}
String inspectionType = rawInstock.getInspectionType();
if (!inspectionType.equals("0")) {
Toast.makeText(context, "必检物料先放入待检区,检验完成后正常入库", Toast.LENGTH_SHORT).show();
return;
}
rawinSubmit();
}
// 提交验证
private boolean inCheck() {
if (rawInstock == null) {
return false;
}
var instockQty = rawInstock.getInstockQty(); var instockQty = rawInstock.getInstockQty();
if (instockQty == null || instockQty.isEmpty()) return; if (instockQty == null || instockQty.isEmpty()) return false;
var parseDouble = Double.parseDouble(instockQty); var parseDouble = Double.parseDouble(instockQty);
if (parseDouble > rawInstock.getMaterialQty()) { if (parseDouble > rawInstock.getMaterialQty()) {
myToastUitls.show("输入数量不能超过条码数量"); myToastUitls.show("输入数量不能超过条码数量");
return; return false;
} }
return true;
}
public void rawinSubmit() {
rawInstock.setTitle(title); rawInstock.setTitle(title);
OkGo.<MyResult>post(url + "/wms/pda/raw/inSubmit").upRequestBody(RequestBody.create(JSON, gson.toJson(rawInstock))).execute(new MyRecultCall(dialog, this) { OkGo.<MyResult>post(url + "/wms/pda/raw/inSubmit").upRequestBody(RequestBody.create(JSON, gson.toJson(rawInstock))).execute(new MyRecultCall(dialog, this) {
@Override @Override
public void onSuccess(Response<MyResult> response) { public void onSuccess(Response<MyResult> response) {
super.onSuccess(response); super.onSuccess(response);
var body = response.body(); var body = response.body();
if (body.getCode() == 200) { if (body.getCode() == 200) {
rawInstock.setInstockQty(null);
rawInstock.setLocationCode(null); rawInstock.setLocationCode(null);
rawInstock.setMaterialQty(rawInstock.getMaterialQty() - parseDouble); rawInstock.setMaterialQty(rawInstock.getMaterialQty() - Double.parseDouble(rawInstock.getInstockQty()));
rawInstock.setInstockQty(null);
// finish(); // finish();
Toast.makeText(RawInActivity.this, "入库成功", Toast.LENGTH_SHORT).show(); Toast.makeText(RawInActivity.this, "入库成功", Toast.LENGTH_SHORT).show();
return; return;

@ -116,6 +116,7 @@ public class RawOutActivity extends BaseActivity implements View.OnFocusChangeLi
if (submitBeen.getLocationCode() == null || submitBeen.getBatchCode() == null || submitBeen.getOutstockQty() == null) { if (submitBeen.getLocationCode() == null || submitBeen.getBatchCode() == null || submitBeen.getOutstockQty() == null) {
return; return;
} }
OkGo.<MyResult>post(url + "/wms/pda/raw/selectInVentoryByBatchCode") OkGo.<MyResult>post(url + "/wms/pda/raw/selectInVentoryByBatchCode")
.upRequestBody(RequestBody.create(JSON, gson.toJson(submitBeen))) .upRequestBody(RequestBody.create(JSON, gson.toJson(submitBeen)))
.execute(new MyRecultCall(dialog, this) { .execute(new MyRecultCall(dialog, this) {

@ -36,7 +36,7 @@ public class RawReturnActivity extends BaseActivity {
String title = intent.getStringExtra("title"); String title = intent.getStringExtra("title");
binding.setTitle(title); binding.setTitle(title);
assert title != null; assert title != null;
if (title.equals("原材料退库")) { if (title.equals("退库申请")) {
type = 1; type = 1;
} else if (title.equals("半成品退库")) { } else if (title.equals("半成品退库")) {
type = 2; type = 2;

@ -1,6 +1,7 @@
package com.example.haiwei_mom.wms.raw; package com.example.haiwei_mom.wms.raw;
import android.os.Bundle; import android.os.Bundle;
import android.util.Log;
import android.view.View; import android.view.View;
import androidx.databinding.DataBindingUtil; import androidx.databinding.DataBindingUtil;
@ -9,14 +10,19 @@ import com.example.haiwei_mom.R;
import com.example.haiwei_mom.base.BaseActivity; import com.example.haiwei_mom.base.BaseActivity;
import com.example.haiwei_mom.base.MyRecultCall; import com.example.haiwei_mom.base.MyRecultCall;
import com.example.haiwei_mom.base.MyResult; import com.example.haiwei_mom.base.MyResult;
import com.example.haiwei_mom.data.RawReturnSubmitBeen;
import com.example.haiwei_mom.data.WmsReturnOrderVo; import com.example.haiwei_mom.data.WmsReturnOrderVo;
import com.example.haiwei_mom.databinding.ActivityReturn2Binding; import com.example.haiwei_mom.databinding.ActivityReturn2Binding;
import com.lzy.okgo.OkGo; import com.lzy.okgo.OkGo;
import com.lzy.okgo.model.Response; import com.lzy.okgo.model.Response;
import java.math.BigDecimal;
import okhttp3.RequestBody;
public class Return2Activity extends BaseActivity { public class Return2Activity extends BaseActivity {
private ActivityReturn2Binding binding; private ActivityReturn2Binding binding;
private WmsReturnOrderVo params;
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
@ -36,7 +42,8 @@ public class Return2Activity extends BaseActivity {
super.onSuccess(response); super.onSuccess(response);
var body = response.body(); var body = response.body();
if (body.getCode() == 200) { if (body.getCode() == 200) {
WmsReturnOrderVo params = gson.fromJson(body.getDataJson(), WmsReturnOrderVo.class);
params = gson.fromJson(body.getDataJson(), WmsReturnOrderVo.class);
binding.setData(params); binding.setData(params);
return; return;
} }
@ -46,5 +53,23 @@ public class Return2Activity extends BaseActivity {
}); });
} }
public void returnInSubmit(View view) {
if (params==null|| params.getReturnLocationCode()==null) return;
OkGo.<MyResult>post(url + "/wms/pda/returnInstore/submit")
.upRequestBody(RequestBody.create(JSON, gson.toJson(params)))
.execute(new MyRecultCall(dialog, context) {
@Override
public void onSuccess(Response<MyResult> response) {
super.onSuccess(response);
var body = response.body();
if (body.getCode() == 200) {
finish();
// return;
}
myToastUitls.show(body.getMsg());
}
});
}
} }

@ -3,6 +3,7 @@ package com.example.haiwei_mom.wms.raw;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.os.Bundle; import android.os.Bundle;
import android.view.View; import android.view.View;
import android.widget.Toast;
import androidx.databinding.DataBindingUtil; import androidx.databinding.DataBindingUtil;
@ -37,7 +38,8 @@ public class SpecialOutActivity extends BaseActivity {
super.onSuccess(response); super.onSuccess(response);
var body = response.body(); var body = response.body();
if (body.getCode() == 200) { if (body.getCode() == 200) {
submitBeen.clear();
Toast.makeText(SpecialOutActivity.this, "出库成功", Toast.LENGTH_SHORT).show();
return; return;
} }
myToastUitls.show(body.getMsg()); myToastUitls.show(body.getMsg());

@ -152,7 +152,7 @@
style="@style/text_info" style="@style/text_info"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:text="@{data.materialSpe}" /> android:text="@{data.getInspectionTypeName}" />
</LinearLayout> </LinearLayout>
@ -206,7 +206,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="55dp" android:layout_height="55dp"
android:layout_margin="20dp" android:layout_margin="20dp"
android:onClick="rawinSubmit" android:onClick="rawinSubmit1"
android:text="入库提交" android:text="入库提交"
android:visibility='@{title.equals("入库")?View.VISIBLE:View.GONE}' /> android:visibility='@{title.equals("入库")?View.VISIBLE:View.GONE}' />
@ -215,7 +215,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="55dp" android:layout_height="55dp"
android:layout_margin="20dp" android:layout_margin="20dp"
android:onClick="rawinSubmit" android:onClick="rawinSubmit2"
android:text="质检提交" android:text="质检提交"
android:visibility='@{title.equals("质检入库")?View.VISIBLE:View.GONE}' /> android:visibility='@{title.equals("质检入库")?View.VISIBLE:View.GONE}' />
@ -224,7 +224,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="55dp" android:layout_height="55dp"
android:layout_margin="20dp" android:layout_margin="20dp"
android:onClick="rawinSubmit" android:onClick="rawinSubmit1"
android:text="AGV任务发起" android:text="AGV任务发起"
android:visibility='@{title.equals("AGV入库")?View.VISIBLE:View.GONE}' /> android:visibility='@{title.equals("AGV入库")?View.VISIBLE:View.GONE}' />

@ -149,7 +149,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="55dp" android:layout_height="55dp"
android:layout_margin="20dp" android:layout_margin="20dp"
android:onClick="rawinSubmit" android:onClick="returnInSubmit"
android:text="提交" /> android:text="提交" />
</LinearLayout> </LinearLayout>
</layout> </layout>

@ -79,6 +79,57 @@
android:layout_weight="1" android:layout_weight="1"
android:text="@{String.valueOf(vm.outSum)}" /> android:text="@{String.valueOf(vm.outSum)}" />
</LinearLayout> <LinearLayout
android:layout_width="match_parent"
android:layout_height="40dp">
<TextView
style="@style/item_title_blue"
android:layout_width="70dp"
android:layout_height="match_parent"
android:text="推荐批次:" />
<TextView
style="@style/item_text_13"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:text='@{vm.batchCode}' />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="40dp">
<TextView
style="@style/item_title_blue"
android:layout_width="70dp"
android:layout_height="match_parent"
android:text="库位编码:" />
<TextView
style="@style/item_text_13"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:text='@{vm.locationCode}' />
<TextView
style="@style/item_title_blue"
android:layout_width="70dp"
android:layout_height="match_parent"
android:text="库存:" />
<TextView
style="@style/item_text_13"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="@{String.valueOf(vm.inventoryQty)}" />
</LinearLayout> </LinearLayout>

Loading…
Cancel
Save