增加 盘点

master
wanghao 4 months ago
parent f17efc3484
commit e21b2942d1

@ -15,6 +15,15 @@
android:theme="@style/Theme.Haiweimom"
android:usesCleartextTraffic="true"
tools:targetApi="31">
<activity
android:name=".wms.raw.CheckWorkActivity"
android:exported="false" />
<activity
android:name=".wms.raw.StoreCheckActivity"
android:exported="false" />
<activity
android:name=".ipc.FeedingMaterialsActivity"
android:exported="false" />
<activity
android:name=".ClassItemActivity"
android:exported="false" />

@ -4,7 +4,9 @@ import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
public class ConfigActivity extends AppCompatActivity {
import com.example.haiwei_mom.base.BaseActivity;
public class ConfigActivity extends BaseActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {

@ -13,6 +13,7 @@ import com.example.haiwei_mom.base.MyResult;
import com.example.haiwei_mom.data.MenuBeen;
import com.example.haiwei_mom.data.PdaRouters;
import com.example.haiwei_mom.databinding.ActivityHomePageBinding;
import com.example.haiwei_mom.ipc.FeedingMaterialsActivity;
import com.example.haiwei_mom.qm.CheckActivity;
import com.example.haiwei_mom.uitls.SharedPreferencesUtils;
import com.example.haiwei_mom.wms.product.BindVehicleActivity;
@ -21,6 +22,7 @@ import com.example.haiwei_mom.wms.product.ProductOutActivity;
import com.example.haiwei_mom.wms.raw.RawInActivity;
import com.example.haiwei_mom.wms.raw.RawOutActivity;
import com.example.haiwei_mom.wms.raw.RawReturnActivity;
import com.example.haiwei_mom.wms.raw.StoreCheckActivity;
import com.example.haiwei_mom.wms.semi.SemiInActivity;
import com.example.haiwei_mom.wms.semi.SemiOutActivity;
import com.google.gson.reflect.TypeToken;
@ -53,15 +55,20 @@ public class HomePageActivity extends BaseActivity implements ItemClickCall {
map = new HashMap<>();
map.put("半成品入库", SemiInActivity.class);
map.put("半成品出库", SemiOutActivity.class);
// map.put("半成品移库", SemiOutActivity.class);
// map.put("半成品盘点", SemiOutActivity.class);
map.put("入库工装绑定", BindVehicleActivity.class);
map.put("成品批量入库", ProductInActivity.class);
map.put("成品出库", ProductOutActivity.class);
map.put("原材料入库", RawInActivity.class);
map.put("原材料出库", RawOutActivity.class);
map.put("原材料盘点", RawReturnActivity.class);
map.put("原材料盘点", StoreCheckActivity.class);
map.put("原材料退库", RawReturnActivity.class);
map.put("制品质检", CheckActivity.class);
map.put("制品复检", CheckActivity.class);
map.put("机台投料", FeedingMaterialsActivity.class);
map.put("工装验证", FeedingMaterialsActivity.class);
// map.put("产出工装绑定", CheckActivity.class);
map.put("系统配置", ConfigActivity.class);
map.put("班组管理", ClassItemActivity.class);
}
@ -108,6 +115,7 @@ public class HomePageActivity extends BaseActivity implements ItemClickCall {
var cls = map.get(menuName);
if (cls == null) return;
var intent = new Intent(this, cls);
intent.putExtra("title",menuName);
startActivity(intent);
}
}

@ -0,0 +1,74 @@
package com.example.haiwei_mom.adapter;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.databinding.DataBindingUtil;
import androidx.recyclerview.widget.RecyclerView;
import com.example.haiwei_mom.BR;
import com.example.haiwei_mom.R;
import com.example.haiwei_mom.data.WmsBaseLocationVo;
import com.example.haiwei_mom.databinding.ItemLayoutBinding;
import com.example.haiwei_mom.databinding.ItemStoreCheckLocationBinding;
import com.example.haiwei_mom.qm.data.DefectBeen;
import java.util.List;
/**
* @author wanghao
* @date 2023/11/17 17:15
*/
public class CheckStoreSelectLocationAdapter extends RecyclerView.Adapter<CheckStoreSelectLocationAdapter.CheckAdapterVH> {
private Context context;
private List<WmsBaseLocationVo> list;
private LayoutInflater from;
public CheckStoreSelectLocationAdapter(Context context) {
this.context = context;
from = LayoutInflater.from(context);
}
public void setList(List<WmsBaseLocationVo> list) {
this.list = list;
}
@NonNull
@Override
public CheckAdapterVH onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
ItemStoreCheckLocationBinding inflate1 = DataBindingUtil.inflate(from, R.layout.item_store_check_location, parent, false);
return new CheckAdapterVH(inflate1);
}
@Override
public void onBindViewHolder(@NonNull CheckAdapterVH holder, int position) {
var item = list.get(position);
item.setIndex(position + 1);
var databing = CheckAdapterVH.binding;
databing.setItem(item);
// databing.setVariable(BR.item, item);
databing.executePendingBindings();
}
@Override
public int getItemCount() {
return list == null ? 0 : list.size();
}
static class CheckAdapterVH extends RecyclerView.ViewHolder {
private static ItemStoreCheckLocationBinding binding;
public CheckAdapterVH(ItemStoreCheckLocationBinding binding) {
super(binding.getRoot());
this.binding = binding;
}
}
}

@ -0,0 +1,73 @@
package com.example.haiwei_mom.adapter;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.databinding.DataBindingUtil;
import androidx.recyclerview.widget.RecyclerView;
import com.example.haiwei_mom.R;
import com.example.haiwei_mom.data.WmsBaseLocationVo;
import com.example.haiwei_mom.data.WmsInventoryVo;
import com.example.haiwei_mom.databinding.ItemCheckWorkInventoryBinding;
import com.example.haiwei_mom.databinding.ItemStoreCheckLocationBinding;
import java.util.List;
/**
* @author wanghao
* @date 2023/11/17 17:15
*/
public class CheckWorkAdapter extends RecyclerView.Adapter<CheckWorkAdapter.CheckAdapterVH> {
private Context context;
private List<WmsInventoryVo> list;
private LayoutInflater from;
public CheckWorkAdapter(Context context) {
this.context = context;
from = LayoutInflater.from(context);
}
public void setList(List<WmsInventoryVo> list) {
this.list = list;
}
@NonNull
@Override
public CheckAdapterVH onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
ItemCheckWorkInventoryBinding binding = DataBindingUtil.inflate(from, R.layout.item_check_work_inventory, parent, false);
return new CheckAdapterVH(binding);
}
@Override
public void onBindViewHolder(@NonNull CheckAdapterVH holder, int position) {
var item = list.get(position);
var databing = CheckAdapterVH.binding;
databing.setVm(item);
// databing.setVariable(BR.item, item);
databing.executePendingBindings();
}
@Override
public int getItemCount() {
return list == null ? 0 : list.size();
}
static class CheckAdapterVH extends RecyclerView.ViewHolder {
private static ItemCheckWorkInventoryBinding binding;
public CheckAdapterVH(ItemCheckWorkInventoryBinding binding) {
super(binding.getRoot());
this.binding = binding;
}
}
}

@ -0,0 +1,148 @@
package com.example.haiwei_mom.data;
import androidx.databinding.BaseObservable;
import java.math.BigDecimal;
/**
* wms_inventory_check_record
*
* @author LionLi
* @date 2025-01-10
*/
public class CheckRecordVo extends BaseObservable {
/**
*
*/
private String materialCategories;
/**
*
*/
private String checkCode;
/**
*
*/
private String batchCode;
/**
* id
*/
private Long materialId;
/**
*
*/
private String locationCode;
/**
*
*/
private String materialCode;
/**
*
*/
private String materialName;
/**
*
*/
private BigDecimal inventoryQty;
/**
*
*/
private String checkQty;
/**
* (01)
*/
private String checkStatus;
/**
* erp
*/
private String erpSynchronousStatus;
public String getCheckCode() {
return checkCode;
}
public void setCheckCode(String checkCode) {
this.checkCode = checkCode;
}
public String getBatchCode() {
return batchCode;
}
public void setBatchCode(String batchCode) {
this.batchCode = batchCode; notifyChange();
}
public Long getMaterialId() {
return materialId;
}
public void setMaterialId(Long materialId) {
this.materialId = materialId;
}
public String getLocationCode() {
return locationCode;
}
public void setLocationCode(String locationCode) {
this.locationCode = locationCode;
}
public String getMaterialCode() {
return materialCode;
}
public void setMaterialCode(String materialCode) {
this.materialCode = materialCode;
}
public String getMaterialName() {
return materialName;
}
public void setMaterialName(String materialName) {
this.materialName = materialName;
}
public BigDecimal getInventoryQty() {
return inventoryQty;
}
public void setInventoryQty(BigDecimal inventoryQty) {
this.inventoryQty = inventoryQty;
}
public String getCheckQty() {
return checkQty;
}
public void setCheckQty(String checkQty) {
this.checkQty = checkQty; notifyChange();
}
}

@ -0,0 +1,64 @@
package com.example.haiwei_mom.data;
import androidx.databinding.BaseObservable;
public class RawOutSubmitBeen extends BaseObservable {
/**
*
*/
private String outstockCode;
/**
*
*/
private String batchCode;
/**
*
*/
private String locationCode;
/**
*
*/
private String outstockQty;
public String getOutstockCode() {
return outstockCode;
}
public void setOutstockCode(String outstockCode) {
this.outstockCode = outstockCode;
}
public String getBatchCode() {
return batchCode;
}
public void setBatchCode(String batchCode) {
this.batchCode = batchCode;
notifyChange();
}
public String getLocationCode() {
return locationCode;
}
public void setLocationCode(String locationCode) {
this.locationCode = locationCode;
notifyChange();
}
public String getOutstockQty() {
return outstockQty;
}
public void setOutstockQty(String outstockQty) {
this.outstockQty = outstockQty;
notifyChange();
}
}

@ -0,0 +1,33 @@
package com.example.haiwei_mom.data;
public class StoreInfoVo {
private Long id;
private String code;
private String name;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
name = name;
}
}

@ -0,0 +1,77 @@
package com.example.haiwei_mom.data;
import androidx.databinding.BaseObservable;
public class WmsBaseLocationVo extends BaseObservable {
private int index;
private Long locationId;
/**
*
*/
private Long warehouseId;
/**
*
*/
private String locationCode;
private boolean state;
public Long getLocationId() {
return locationId;
}
public void setLocationId(Long locationId) {
this.locationId = locationId;
}
public Long getWarehouseId() {
return warehouseId;
}
public void setWarehouseId(Long warehouseId) {
this.warehouseId = warehouseId;
}
public String getLocationCode() {
return locationCode;
}
public void setLocationCode(String locationCode) {
this.locationCode = locationCode;
}
public boolean isState() {
return state;
}
public void setState(boolean state) {
this.state = state;
notifyChange();
}
public int getIndex() {
return index;
}
public void setIndex(int index) {
this.index = index;
}
@Override
public String toString() {
return "WmsBaseLocationVo{" +
"index=" + index +
", locationId=" + locationId +
", state=" + state +
'}';
}
}

@ -0,0 +1,71 @@
package com.example.haiwei_mom.data;
import java.util.Date;
/**
* wms_inventory_check
*
* @author LionLi
* @date 2025-01-10
*/
public class WmsInventoryCheck {
private static final long serialVersionUID = 1L;
/**
*
*/
private Long inventoryCheckId;
/**
*
*/
private String checkCode;
/**
*
*/
private String materialCategories;
/**
* ID
*/
private Long planWarehouseId;
/**
* 123
*/
private String checkType;
/**
* 023
*/
private String checkStatus;
/**
* (0,1,2)
*/
private String auditStatus;
/**
*
*/
private String auditComments;
/**
*
*/
private Date beginTime;
/**
*
*/
private Date endTime;
public String getCheckCode() {
return checkCode;
}
}

@ -0,0 +1,185 @@
package com.example.haiwei_mom.data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* wms_inventory
*
* @author LionLi
* @date 2025-01-07
*/
public class WmsInventoryVo {
/**
*
*/
private Long inventoryId;
/**
*
*/
private String batchCode;
/**
* id
*/
private Long materialId;
/**
*
*/
private String locationCode;
/**
*
*/
private Long materialCategories;
/**
*
*/
private BigDecimal inventoryQty;
/**
* 01
*/
private String lockState;
/**
* 001
*/
private String inventoryStatus;
/**
* ID
*/
private Long storeId;
private String warehouseCode;//字段映射
private String materialCode;//字段映射
private String materialName;//字段映射
private String warehouseId;
public Long getInventoryId() {
return inventoryId;
}
public void setInventoryId(Long inventoryId) {
this.inventoryId = inventoryId;
}
public String getBatchCode() {
return batchCode;
}
public void setBatchCode(String batchCode) {
this.batchCode = batchCode;
}
public Long getMaterialId() {
return materialId;
}
public void setMaterialId(Long materialId) {
this.materialId = materialId;
}
public String getLocationCode() {
return locationCode;
}
public void setLocationCode(String locationCode) {
this.locationCode = locationCode;
}
public Long getMaterialCategories() {
return materialCategories;
}
public void setMaterialCategories(Long materialCategories) {
this.materialCategories = materialCategories;
}
public BigDecimal getInventoryQty() {
return inventoryQty;
}
public void setInventoryQty(BigDecimal inventoryQty) {
this.inventoryQty = inventoryQty;
}
public String getLockState() {
return lockState;
}
public void setLockState(String lockState) {
this.lockState = lockState;
}
public String getInventoryStatus() {
return inventoryStatus;
}
public void setInventoryStatus(String inventoryStatus) {
this.inventoryStatus = inventoryStatus;
}
public Long getStoreId() {
return storeId;
}
public void setStoreId(Long storeId) {
this.storeId = storeId;
}
public String getWarehouseCode() {
return warehouseCode;
}
public void setWarehouseCode(String warehouseCode) {
this.warehouseCode = warehouseCode;
}
public String getMaterialCode() {
return materialCode;
}
public void setMaterialCode(String materialCode) {
this.materialCode = materialCode;
}
public String getMaterialName() {
return materialName;
}
public void setMaterialName(String materialName) {
this.materialName = materialName;
}
public String getWarehouseId() {
return warehouseId;
}
public void setWarehouseId(String warehouseId) {
this.warehouseId = warehouseId;
}
}

@ -0,0 +1,22 @@
package com.example.haiwei_mom.ipc;
import androidx.appcompat.app.AppCompatActivity;
import androidx.databinding.DataBindingUtil;
import androidx.databinding.ViewDataBinding;
import android.os.Bundle;
import com.example.haiwei_mom.R;
import com.example.haiwei_mom.base.BaseActivity;
import com.example.haiwei_mom.databinding.ActivityFeedingMaterialsBinding;
public class FeedingMaterialsActivity extends BaseActivity {
private ActivityFeedingMaterialsBinding binding;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
binding = DataBindingUtil.setContentView(this, R.layout.activity_feeding_materials);
String title = getIntent().getStringExtra("title");
binding.setTitle(title);
}
}

@ -0,0 +1,114 @@
package com.example.haiwei_mom.wms.raw;
import androidx.appcompat.app.AppCompatActivity;
import androidx.databinding.DataBindingUtil;
import android.annotation.SuppressLint;
import android.content.Intent;
import android.graphics.NinePatch;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.Toast;
import com.example.haiwei_mom.R;
import com.example.haiwei_mom.adapter.CheckWorkAdapter;
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.CheckRecordVo;
import com.example.haiwei_mom.data.WmsInventoryCheck;
import com.example.haiwei_mom.data.WmsInventoryVo;
import com.example.haiwei_mom.databinding.ActivityCheckWorkBinding;
import com.google.gson.reflect.TypeToken;
import com.lzy.okgo.OkGo;
import com.lzy.okgo.model.Response;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
import okhttp3.RequestBody;
public class CheckWorkActivity extends BaseActivity {
private List<String> list;
private List<WmsInventoryVo> inventorylist;
private CheckWorkAdapter checkWorkAdapter;
private CheckRecordVo checkRecordVo;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ActivityCheckWorkBinding binding = DataBindingUtil.setContentView(this, R.layout.activity_check_work);
Intent intent = getIntent();
list = Arrays.asList(intent.getStringArrayExtra("list"));
binding.setList(list);
String checkCode = intent.getStringExtra("code");
binding.setCode(checkCode);
binding.workListSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
selectInventory(list.get(position));
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
}
});
checkWorkAdapter=new CheckWorkAdapter(this);
binding.setAdapter(checkWorkAdapter);
checkRecordVo=new CheckRecordVo();
checkRecordVo.setCheckCode(checkCode);
binding.setData(checkRecordVo);
}
private void selectInventory(String locationCode) {
OkGo.<MyResult>post(url + "/wms/pda/storeCheck/selectInventory")
.params("locationCode", locationCode)
.execute(new MyRecultCall(dialog, this) {
@SuppressLint("NotifyDataSetChanged")
@Override
public void onSuccess(Response<MyResult> response) {
super.onSuccess(response);
var body = response.body();
if (body.getCode() == 200) {
inventorylist = gson.fromJson(body.getDataJson(), new TypeToken<List<WmsInventoryVo>>() {
}.getType());
checkWorkAdapter.setList(inventorylist);
checkWorkAdapter.notifyDataSetChanged();
return;
}
myToastUitls.show(body.getMsg());
}
});
}
public void storeCheckWork(View view){
String batchCode = checkRecordVo.getBatchCode();
WmsInventoryVo wmsInventoryVo= inventorylist.stream().filter(t->t.getBatchCode().equals(batchCode)).findFirst().get();
checkRecordVo.setMaterialCode(wmsInventoryVo.getMaterialCode());
checkRecordVo.setLocationCode(wmsInventoryVo.getLocationCode());
checkRecordVo.setInventoryQty(wmsInventoryVo.getInventoryQty());
checkRecordVo.setMaterialName(wmsInventoryVo.getMaterialName());
OkGo.<MyResult>post(url + "/wms/pda/storeCheck/submitCheckRecord")
.upRequestBody(RequestBody.create(JSON,gson.toJson(checkRecordVo)))
.execute(new MyRecultCall(dialog, this) {
@Override
public void onSuccess(Response<MyResult> response) {
super.onSuccess(response);
var body = response.body();
if (body.getCode() == 200) {
checkRecordVo.setCheckQty("");
checkRecordVo.setBatchCode("");
Toast.makeText(CheckWorkActivity.this, "提交成功", Toast.LENGTH_SHORT).show();
return;
}
myToastUitls.show(body.getMsg());
}
});
}
}

@ -15,6 +15,7 @@ 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.OutDetail;
import com.example.haiwei_mom.data.RawOutSubmitBeen;
import com.example.haiwei_mom.databinding.ActivityRawOutBinding;
import com.google.gson.reflect.TypeToken;
import com.lzy.okgo.OkGo;
@ -22,6 +23,8 @@ import com.lzy.okgo.model.Response;
import java.util.List;
import okhttp3.RequestBody;
public class RawOutActivity extends BaseActivity implements View.OnFocusChangeListener {
private ActivityRawOutBinding binding;
private RawOutDetailAdapter rawOutDetailAdapter;
@ -30,7 +33,7 @@ public class RawOutActivity extends BaseActivity implements View.OnFocusChangeLi
private EditText rawOutGoodsView;
private EditText focusView;
private boolean sanState = true;
private RawOutSubmitBeen submitBeen;
@SuppressLint("ClickableViewAccessibility")
@Override
protected void onCreate(Bundle savedInstanceState) {
@ -57,6 +60,8 @@ public class RawOutActivity extends BaseActivity implements View.OnFocusChangeLi
rawOutDetailAdapter = new RawOutDetailAdapter(this);
binding.setDetailAdapter(rawOutDetailAdapter);
submitBeen=new RawOutSubmitBeen();
binding.setSubBeen(submitBeen);
}
private void selectOutOrderCode(String orderCode) {
@ -93,30 +98,13 @@ public class RawOutActivity extends BaseActivity implements View.OnFocusChangeLi
rawOutLocationView.setText(data);
} else if (focusView == rawOutGoodsView) {
rawOutGoodsView.setText(data);
selectBacthCode(data, rawOutLocationView.getText().toString());
// selectBacthCode(data, rawOutLocationView.getText().toString());
}
}
// 查询物料
private void selectBacthCode(String bacthCode, String locationCode) {
OkGo.<MyResult>post(url + "/wms/pda/raw/selectInVentoryByBatchCode").params("bacthCode", bacthCode).params("locationCode", locationCode).execute(new MyRecultCall(dialog, this) {
@Override
public void onSuccess(Response<MyResult> response) {
super.onSuccess(response);
var body = response.body();
if (body.getCode() == 200) {
List<OutDetail> list = gson.fromJson(body.getDataJson(), new TypeToken<List<OutDetail>>() {
}.getType());
rawOutDetailAdapter.setList(list);
rawOutDetailAdapter.notifyDataSetChanged();
return;
}
myToastUitls.show(body.getMsg());
}
});
}
@Override
public void onFocusChange(View v, boolean hasFocus) {
@ -124,4 +112,27 @@ public class RawOutActivity extends BaseActivity implements View.OnFocusChangeLi
focusView = (EditText) v;
}
}
public void rawOutSubmit(View view){
if (submitBeen.getLocationCode()==null||submitBeen.getBatchCode()==null||submitBeen.getOutstockQty()==null) {
return;
}
OkGo.<MyResult>post(url + "/wms/pda/raw/selectInVentoryByBatchCode")
.upRequestBody(RequestBody.create(JSON,gson.toJson(submitBeen)))
.execute(new MyRecultCall(dialog, this) {
@SuppressLint("NotifyDataSetChanged")
@Override
public void onSuccess(Response<MyResult> response) {
super.onSuccess(response);
var body = response.body();
if (body.getCode() == 200) {
rawOutLocationView.setText(null);
rawOutGoodsView.setText(null);
rawOutDetailAdapter.notifyDataSetChanged();
return;
}
myToastUitls.show(body.getMsg());
}
});
}
}

@ -0,0 +1,147 @@
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.util.Log;
import android.view.View;
import android.widget.AdapterView;
import com.example.haiwei_mom.R;
import com.example.haiwei_mom.adapter.CheckStoreSelectLocationAdapter;
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.SemiInVo;
import com.example.haiwei_mom.data.StoreInfoVo;
import com.example.haiwei_mom.data.WmsBaseLocationVo;
import com.example.haiwei_mom.data.WmsInventoryCheck;
import com.example.haiwei_mom.databinding.ActivityStoreCheckBinding;
import com.google.gson.reflect.TypeToken;
import com.lzy.okgo.OkGo;
import com.lzy.okgo.model.Response;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
public class StoreCheckActivity extends BaseActivity {
private List<StoreInfoVo> list;
private List<WmsBaseLocationVo> locationList;
private ActivityStoreCheckBinding binding;
private CheckStoreSelectLocationAdapter adapter;
private Intent intent;
private Long storeId;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
binding = DataBindingUtil.setContentView(this, R.layout.activity_store_check);
String type = "原材料盘点";
initSelectStore(type);
binding.storeListSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
StoreInfoVo storeInfoVo = list.get(position);
storeId = storeInfoVo.getId();
selectLocation(type, storeId);
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
}
});
adapter=new CheckStoreSelectLocationAdapter(this);
binding.setAdapter(adapter);
intent = new Intent(this, CheckWorkActivity.class);
}
private boolean selectState=true;
private void selectLocation(String type, Long storeId) {
// Log.e("TAG", "selectLocation:" + selectState);
// if (selectState){
// selectState=false;
// return;
// }
OkGo.<MyResult>post(url + "/wms/pda/storeCheck/selectInventorLocationList")
.params("type", type)
.params("storeId", storeId)
.execute(new MyRecultCall(dialog, this) {
@Override
public void onSuccess(Response<MyResult> response) {
super.onSuccess(response);
var body = response.body();
if (body.getCode() == 200) {
locationList = gson.fromJson(body.getDataJson(), new TypeToken<List<WmsBaseLocationVo>>() {
}.getType());
adapter.setList(locationList);
adapter.notifyDataSetChanged();
return;
}
myToastUitls.show(body.getMsg());
}
});
}
private void initSelectStore(String type) {
OkGo.<MyResult>post(url + "/wms/pda/selectStoreInfo")
.params("type", type)
.execute(new MyRecultCall(dialog, this) {
@Override
public void onSuccess(Response<MyResult> response) {
super.onSuccess(response);
var body = response.body();
if (body.getCode() == 200) {
list = gson.fromJson(body.getDataJson(), new TypeToken<List<StoreInfoVo>>() {
}.getType());
if (list != null && !list.isEmpty()) {
List<String> strings = new ArrayList<>();
list.forEach(t -> strings.add(t.getName()));
binding.setList(strings);
}
return;
}
myToastUitls.show(body.getMsg());
}
});
}
public void storeCheck1(View view){
List<String> collect = locationList.stream().map(WmsBaseLocationVo::getLocationCode).collect(Collectors.toList());
submitOrder(collect);
}
public void storeCheck2(View view){
Log.e("TAG", "storeCheck2:" + locationList.toString());
List<String> resultList = locationList.stream().filter(WmsBaseLocationVo::isState).map(WmsBaseLocationVo::getLocationCode).collect(Collectors.toList());
submitOrder(resultList);
}
private void submitOrder(List<String> list){
OkGo.<MyResult>post(url + "/wms/pda/storeCheck/submitOrder")
.params("storeId",storeId)
.addUrlParams("location",list)
.execute(new MyRecultCall(dialog, this) {
@Override
public void onSuccess(Response<MyResult> response) {
super.onSuccess(response);
var body = response.body();
if (body.getCode() == 200) {
WmsInventoryCheck wmsInventoryCheck=gson.fromJson(body.getDataJson(),WmsInventoryCheck.class);
String[] array = list.toArray(new String[0]);
intent.putExtra("list",array);
intent.putExtra("code",wmsInventoryCheck.getCheckCode());
startActivity(intent);
return;
}
myToastUitls.show(body.getMsg());
}
});
}
}

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="3dp"/>
<solid android:color="@color/white"/>
</shape>

@ -0,0 +1,141 @@
<?xml version="1.0" encoding="utf-8"?>
<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">
<data>
<variable
name="title"
type="String" />
<variable
name="code"
type="String" />
<variable
name="list"
type="java.util.List" />
<variable
name="adapter"
type="com.example.haiwei_mom.adapter.CheckWorkAdapter" />
<variable
name="data"
type="com.example.haiwei_mom.data.CheckRecordVo" />
</data>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".wms.raw.CheckWorkActivity">
<include
layout="@layout/toolbar"
app:title='@{title??"物料盘点"}' />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="45dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="4dp">
<TextView
style="@style/text_title"
android:layout_width="100dp"
android:layout_height="match_parent"
android:text="盘点单号:" />
<TextView
style="@style/text_info"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text='@{code}' />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="45dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="4dp">
<TextView
style="@style/text_title"
android:layout_width="100dp"
android:layout_height="match_parent"
android:text="选择库位:" />
<Spinner
android:id="@+id/work_list_spinner"
style="@style/spinner_style"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:entries="@{list}" />
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:layout_marginTop="5dp"
android:background="@color/white"
android:adapter="@{adapter}"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="45dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="4dp">
<TextView
style="@style/text_title"
android:layout_width="100dp"
android:layout_height="match_parent"
android:text="扫描物料:" />
<EditText
style="@style/text_san"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@={data.batchCode}" />
<!-- android:text="@{vo.materialName}"-->
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="45dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="4dp">
<TextView
style="@style/text_title"
android:layout_width="100dp"
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.checkQty}' />
</LinearLayout>
<Button
style="@style/button_style"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginStart="12dp"
android:layout_marginEnd="12dp"
android:onClick="storeCheckWork"
android:text="提交" />
<Button
style="@style/button_style"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="12dp"
android:onClick="storeCheck2"
android:text="完成盘点" />
</LinearLayout>
</layout>

@ -0,0 +1,80 @@
<?xml version="1.0" encoding="utf-8"?>
<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">
<data>
<variable
name="title"
type="String" />
</data>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".ipc.FeedingMaterialsActivity">
<include
layout="@layout/toolbar"
app:title='@{title}' />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="45dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="4dp">
<TextView
style="@style/text_title"
android:layout_width="100dp"
android:layout_height="match_parent"
android:text="选择机台:" />
<TextView
style="@style/text_info"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="45dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="4dp">
<TextView
style="@style/text_title"
android:layout_width="100dp"
android:layout_height="match_parent"
android:text="当前计划:" />
<TextView
style="@style/text_info"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="45dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="4dp">
<TextView
style="@style/text_title"
android:layout_width="100dp"
android:layout_height="match_parent"
android:text="物料名称:" />
<TextView
style="@style/text_info"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
</layout>

@ -12,6 +12,10 @@
<variable
name="detailAdapter"
type="com.example.haiwei_mom.adapter.RawOutDetailAdapter" />
<variable
name="subBeen"
type="com.example.haiwei_mom.data.RawOutSubmitBeen" />
</data>
<LinearLayout
@ -41,7 +45,8 @@
style="@style/text_san"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:drawableRight="@mipmap/icon_chaxun" />
android:drawableRight="@mipmap/icon_chaxun"
android:text="@={subBeen.outstockCode}"/>
</LinearLayout>
@ -79,7 +84,8 @@
style="@style/text_san"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="45dp" />
android:minHeight="45dp"
android:text="@={subBeen.locationCode}"/>
</LinearLayout>
@ -99,7 +105,8 @@
android:id="@+id/raw_out_goods"
style="@style/text_san"
android:layout_width="match_parent"
android:layout_height="match_parent" />
android:layout_height="match_parent"
android:text="@={subBeen.batchCode}"/>
</LinearLayout>
<LinearLayout
@ -118,7 +125,8 @@
style="@style/text_info"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:inputType="numberDecimal"/>
android:inputType="numberDecimal"
android:text="@={subBeen.outstockQty}"/>
</LinearLayout>
<Button
@ -126,7 +134,7 @@
android:layout_width="match_parent"
android:layout_height="55dp"
android:layout_margin="12dp"
android:onClick="rawinSubmit"
android:onClick="rawOutSubmit"
android:text="提交" />
</LinearLayout>

@ -0,0 +1,122 @@
<?xml version="1.0" encoding="utf-8"?>
<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">
<data>
<variable
name="title"
type="String" />
<variable
name="list"
type="java.util.List" />
<variable
name="adapter"
type="com.example.haiwei_mom.adapter.CheckStoreSelectLocationAdapter" />
</data>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".wms.raw.StoreCheckActivity">
<include
layout="@layout/toolbar"
app:title='@{title??"创建盘点单"}' />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="45dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="4dp">
<TextView
style="@style/text_title"
android:layout_width="100dp"
android:layout_height="match_parent"
android:text="选择仓库:" />
<Spinner
android:id="@+id/store_list_spinner"
style="@style/spinner_style"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:entries="@{list}" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="30dp"
android:layout_marginTop="5dp"
android:background="@drawable/bg_3db"
android:paddingStart="10dp"
android:paddingEnd="10dp">
<TextView
style="@style/item_title_blue"
android:layout_width="50dp"
android:layout_height="match_parent"
android:text="选择" />
<View
style="@style/view_18dp"
android:layout_width="1dp"
android:layout_height="18dp" />
<TextView
style="@style/item_title_blue"
android:layout_width="80dp"
android:layout_height="match_parent"
android:text="序号" />
<View
style="@style/view_18dp"
android:layout_width="1dp"
android:layout_height="18dp" />
<TextView
style="@style/item_title_blue"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="库位编码" />
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:adapter="@{adapter}"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="55dp"
android:layout_marginBottom="10dp">
<Button
android:layout_width="150dp"
android:layout_height="match_parent"
android:layout_marginStart="10dp"
android:onClick="storeCheck1"
android:text="一键全选"
android:textSize="20sp" />
<Button
style="@style/button_style"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginStart="25dp"
android:layout_marginEnd="10dp"
android:onClick="storeCheck2"
android:text="开始盘点" />
</LinearLayout>
</LinearLayout>
</layout>

@ -0,0 +1,104 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android">
<data>
<variable
name="vm"
type="com.example.haiwei_mom.data.WmsInventoryVo" />
</data>
<LinearLayout
android:id="@+id/device_inspection_click"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/san_text_bg"
android:orientation="vertical"
android:layout_marginTop="5dp"
android:padding="5dp">
<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.materialCode}" />
<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.materialName}" />
</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='@{String.valueOf(vm.inventoryQty)}' />
<!-- <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.outSum)}" />-->
</LinearLayout>
</LinearLayout>
</layout>

@ -0,0 +1,49 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android">
<data>
<variable
name="item"
type="com.example.haiwei_mom.data.WmsBaseLocationVo" />
</data>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginTop="1dp"
android:paddingStart="10dp"
android:paddingEnd="10dp"
android:background="@drawable/bg_3db">
<CheckBox
android:layout_width="50dp"
android:layout_height="match_parent"
android:gravity="center"
android:checked="@={item.state}"
style="@style/item_title_blue" />
<View
android:layout_width="1dp"
android:layout_height="18dp"
style="@style/view_18dp" />
<TextView
android:layout_width="80dp"
android:layout_height="match_parent"
android:text="@{String.valueOf(item.index)}"
style="@style/item_title_blue" />
<View
android:layout_width="1dp"
android:layout_height="18dp"
style="@style/view_18dp" />
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@{item.locationCode}"
android:layout_weight="1"
style="@style/item_title_blue" />
</LinearLayout>
</layout>

@ -70,4 +70,10 @@
<item name="android:textAlignment">center</item>
<item name="android:background">@drawable/spinner_bg</item>
</style>
<style name="view_18dp">
<item name="android:background">#e1e1e1</item>
<item name="android:layout_gravity">center</item>
</style>
</resources>
Loading…
Cancel
Save