加入生产日期等
This commit is contained in:
parent
5c581e85ca
commit
e8ce790f3b
|
|
@ -52,7 +52,9 @@ public class GoodsBean {
|
|||
private String unqualifiedNum;
|
||||
private String totalQualifiedNum;
|
||||
private String inventoryNum;
|
||||
private String warehouseId;
|
||||
private String expireTime;
|
||||
private String productDate;
|
||||
private String weight;
|
||||
private String takePhoto;
|
||||
private String intoNum;
|
||||
|
|
@ -63,6 +65,22 @@ public class GoodsBean {
|
|||
return StringHelper.isEmptyAndNull(totalQualifiedNum) ? "0" : totalQualifiedNum;
|
||||
}
|
||||
|
||||
public String getWarehouseId() {
|
||||
return warehouseId;
|
||||
}
|
||||
|
||||
public void setWarehouseId(String warehouseId) {
|
||||
this.warehouseId = warehouseId;
|
||||
}
|
||||
|
||||
public String getProductDate() {
|
||||
return productDate;
|
||||
}
|
||||
|
||||
public void setProductDate(String productDate) {
|
||||
this.productDate = productDate;
|
||||
}
|
||||
|
||||
public String getFetchDetailId() {
|
||||
return fetchDetailId;
|
||||
}
|
||||
|
|
@ -318,6 +336,7 @@ public class GoodsBean {
|
|||
", unqualifiedNum='" + unqualifiedNum + '\'' +
|
||||
", inventoryNum='" + inventoryNum + '\'' +
|
||||
", expireTime='" + expireTime + '\'' +
|
||||
", productDate='" + productDate + '\'' +
|
||||
", weight='" + weight + '\'' +
|
||||
", takePhoto='" + takePhoto + '\'' +
|
||||
", ifFillInventory='" + ifFillInventory + '\'' +
|
||||
|
|
|
|||
|
|
@ -148,7 +148,7 @@ public class InspectionWarehousingFragment extends BaseFragment<ActivityInspecti
|
|||
// 去皮命令
|
||||
private static final String COMMAND_PEELED = "3C 54 41 52 E7 3E";
|
||||
private final Handler mHandler = new Handler(Looper.getMainLooper());
|
||||
private TimePickerView mDatePicker;
|
||||
private TimePickerView mDatePicker, mDatePicker1;
|
||||
private SurfaceView mSurfaceView;
|
||||
private static final int REQUEST_CAMERA_PERMISSION = 100;
|
||||
// 相机相关变量
|
||||
|
|
@ -185,6 +185,17 @@ public class InspectionWarehousingFragment extends BaseFragment<ActivityInspecti
|
|||
.setType(true, true, true, false, false, false)
|
||||
.build();
|
||||
}
|
||||
private void showDatePickerDialog1(OnDateSelectedListener listener) {
|
||||
mDatePicker1 = new TimePickerBuilder(requireContext(), (date, v) -> {
|
||||
String dayTime = DateTimeHelper.format(date, "yyyy-MM-dd");
|
||||
if (listener != null) {
|
||||
listener.onDateSelected(dayTime);
|
||||
}
|
||||
}).setTimeSelectChangeListener(date -> Log.i("pvTime", "onTimeSelectChanged"))
|
||||
.setTitleText("日期选择")
|
||||
.setType(true, true, true, false, false, false)
|
||||
.build();
|
||||
}
|
||||
List<GoodsBean> goodsList = new ArrayList<>();
|
||||
List<SupplierBean> supplierList = new ArrayList<>();
|
||||
String pageType;
|
||||
|
|
@ -204,6 +215,20 @@ public class InspectionWarehousingFragment extends BaseFragment<ActivityInspecti
|
|||
Log.e(TAG, "Current page is null.");
|
||||
}
|
||||
});
|
||||
showDatePickerDialog1(date -> {
|
||||
//针对当前选择的tab进行日期复制
|
||||
if (mDestPage != null) {
|
||||
View view = mPageMap.getOrDefault(mDestPage.getDisplayName(), null);
|
||||
if (view != null) {
|
||||
TextView dateTextView = view.findViewById(R.id.productionDate);
|
||||
dateTextView.setText(date);
|
||||
} else {
|
||||
Log.e(TAG, "View for current page not found.");
|
||||
}
|
||||
} else {
|
||||
Log.e(TAG, "Current page is null.");
|
||||
}
|
||||
});
|
||||
//接收传入的参数
|
||||
Bundle args = getArguments();
|
||||
String selectedGoods = null;
|
||||
|
|
@ -284,10 +309,12 @@ public class InspectionWarehousingFragment extends BaseFragment<ActivityInspecti
|
|||
TextView weightView = view.findViewById(R.id.weight);
|
||||
TextView subtotal = view.findViewById(R.id.subtotal);
|
||||
EditText dueDateEdit = view.findViewById(R.id.dueDate);
|
||||
EditText productionDate = view.findViewById(R.id.productionDate);
|
||||
MaterialSpinner supplierSpinner = view.findViewById(R.id.supplier_spinner);
|
||||
weightView.setText("0");
|
||||
subtotal.setText("0");
|
||||
dueDateEdit.setText("");
|
||||
productionDate.setText("");
|
||||
supplierSpinner.setSelectedIndex(0); // 重置为第一个供应商
|
||||
GoodsBean goodsBean = goodsList.stream()
|
||||
.filter(goods -> goods.getMaterialName().equals(pages[currentTabIndex]))
|
||||
|
|
@ -298,6 +325,7 @@ public class InspectionWarehousingFragment extends BaseFragment<ActivityInspecti
|
|||
goodsBean.setPurNum("0");
|
||||
goodsBean.setTotalPrice("0");
|
||||
goodsBean.setExpireTime("");
|
||||
goodsBean.setProductDate("");
|
||||
goodsBean.setSupplierId("");
|
||||
goodsBean.setSupplierName("");
|
||||
goodsBean.setImgUrl(""); // 清空图片路径
|
||||
|
|
@ -395,7 +423,7 @@ public class InspectionWarehousingFragment extends BaseFragment<ActivityInspecti
|
|||
// return false;
|
||||
// }
|
||||
// if (StringHelper.isEmptyAndNull(goods.getExpireTime())) {
|
||||
// XToastUtils.info("货品:" + goods.getMaterialName() + "必须选择过期日期!");
|
||||
// XToastUtils.info("货品:" + goods.getMaterialName() + "必须选择到期日期!");
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
|
|
@ -545,12 +573,19 @@ public class InspectionWarehousingFragment extends BaseFragment<ActivityInspecti
|
|||
view = LayoutInflater.from(getContext()).inflate(R.layout.item_inspection_warehousing, null);
|
||||
ImageView del_goods = view.findViewById(R.id.del_goods);
|
||||
EditText dueDateEdit = view.findViewById(R.id.dueDate);
|
||||
EditText productionDate = view.findViewById(R.id.productionDate);
|
||||
dueDateEdit.setOnClickListener(new DebounceClickListener() {
|
||||
@Override
|
||||
public void onDebouncedClick(View v) {
|
||||
mDatePicker.show();
|
||||
}
|
||||
});
|
||||
productionDate.setOnClickListener(new DebounceClickListener() {
|
||||
@Override
|
||||
public void onDebouncedClick(View v) {
|
||||
mDatePicker1.show();
|
||||
}
|
||||
});
|
||||
TextView name = view.findViewById(R.id.name);
|
||||
TextView code = view.findViewById(R.id.code);
|
||||
TextView type = view.findViewById(R.id.type);
|
||||
|
|
@ -785,27 +820,35 @@ public class InspectionWarehousingFragment extends BaseFragment<ActivityInspecti
|
|||
BigDecimal priceValue = new BigDecimal(goodsBean.getUnitPrice());
|
||||
if (unit.getText().toString().equals("斤")) {
|
||||
weightView.setText(String.valueOf(weight * 2));
|
||||
BigDecimal rate = BigDecimal.valueOf(100).subtract(new BigDecimal(paramSettingInfo.getWeighDownwardRatio())).divide(BigDecimal.valueOf(100));
|
||||
BigDecimal unInspectedGoodsNum = new BigDecimal(goodsBean.getTotalQualifiedNum()).subtract(new BigDecimal(goodsBean.getIntoNum()));
|
||||
BigDecimal originalNum = unInspectedGoodsNum.multiply(rate);
|
||||
Log.e(TAG, "Weight: " + weight + ", Original number: " + originalNum.doubleValue() + ", Uninspected goods unInspectedGoodsNum: " + unInspectedGoodsNum);
|
||||
if (weight * 2 >= originalNum.doubleValue()) {
|
||||
enterWeight.setText(unInspectedGoodsNum + "");
|
||||
} else {
|
||||
if ("enter".equals(pageType)){
|
||||
enterWeight.setText(String.valueOf(weight * 2));
|
||||
}else{
|
||||
BigDecimal rate = BigDecimal.valueOf(100).subtract(new BigDecimal(paramSettingInfo.getWeighDownwardRatio())).divide(BigDecimal.valueOf(100));
|
||||
BigDecimal unInspectedGoodsNum = new BigDecimal(goodsBean.getTotalQualifiedNum()).subtract(new BigDecimal(goodsBean.getIntoNum()));
|
||||
BigDecimal originalNum = unInspectedGoodsNum.multiply(rate);
|
||||
Log.e(TAG, "Weight: " + weight + ", Original number: " + originalNum.doubleValue() + ", Uninspected goods unInspectedGoodsNum: " + unInspectedGoodsNum);
|
||||
if (weight * 2 >= originalNum.doubleValue()) {
|
||||
enterWeight.setText(unInspectedGoodsNum + "");
|
||||
} else {
|
||||
enterWeight.setText(String.valueOf(weight * 2));
|
||||
}
|
||||
}
|
||||
BigDecimal subtotalValue = new BigDecimal(enterWeight.getText().toString()).multiply(priceValue).divide(BigDecimal.valueOf(100));
|
||||
subtotal.setText(subtotalValue + "");
|
||||
}else{
|
||||
weightView.setText(String.valueOf(weight));
|
||||
BigDecimal rate = BigDecimal.valueOf(100).subtract(new BigDecimal(paramSettingInfo.getWeighDownwardRatio())).divide(BigDecimal.valueOf(100));
|
||||
BigDecimal unInspectedGoodsNum = new BigDecimal(goodsBean.getTotalQualifiedNum()).subtract(new BigDecimal(goodsBean.getIntoNum()));
|
||||
BigDecimal originalNum = unInspectedGoodsNum.multiply(rate);
|
||||
Log.e(TAG, "Weight: " + weight + ", Original number: " + originalNum.doubleValue() + ", Uninspected goods unInspectedGoodsNum: " + unInspectedGoodsNum);
|
||||
if (weight >= originalNum.doubleValue()) {
|
||||
enterWeight.setText(unInspectedGoodsNum + "");
|
||||
} else {
|
||||
enterWeight.setText(String.valueOf(weight));
|
||||
if ("enter".equals(pageType)){
|
||||
enterWeight.setText(String.valueOf(weight * 2));
|
||||
}else{
|
||||
BigDecimal rate = BigDecimal.valueOf(100).subtract(new BigDecimal(paramSettingInfo.getWeighDownwardRatio())).divide(BigDecimal.valueOf(100));
|
||||
BigDecimal unInspectedGoodsNum = new BigDecimal(goodsBean.getTotalQualifiedNum()).subtract(new BigDecimal(goodsBean.getIntoNum()));
|
||||
BigDecimal originalNum = unInspectedGoodsNum.multiply(rate);
|
||||
Log.e(TAG, "Weight: " + weight + ", Original number: " + originalNum.doubleValue() + ", Uninspected goods unInspectedGoodsNum: " + unInspectedGoodsNum);
|
||||
if (weight >= originalNum.doubleValue()) {
|
||||
enterWeight.setText(unInspectedGoodsNum + "");
|
||||
} else {
|
||||
enterWeight.setText(String.valueOf(weight));
|
||||
}
|
||||
}
|
||||
BigDecimal subtotalValue = new BigDecimal(enterWeight.getText().toString()).multiply(priceValue).divide(BigDecimal.valueOf(100));
|
||||
subtotal.setText(subtotalValue + "");
|
||||
|
|
@ -919,6 +962,7 @@ public class InspectionWarehousingFragment extends BaseFragment<ActivityInspecti
|
|||
View view = mPageMap.getOrDefault(mDestPage.getDisplayName(), null);
|
||||
if (view != null) {
|
||||
TextView dateTextView = view.findViewById(R.id.dueDate);
|
||||
TextView productionDate = view.findViewById(R.id.productionDate);
|
||||
TextView weightView = view.findViewById(R.id.weight);
|
||||
TextView enterWeight = view.findViewById(R.id.enter_weight);
|
||||
TextView subtotal = view.findViewById(R.id.subtotal);
|
||||
|
|
@ -936,9 +980,14 @@ public class InspectionWarehousingFragment extends BaseFragment<ActivityInspecti
|
|||
XToastUtils.warning("请先称重");
|
||||
return;
|
||||
}
|
||||
if (productionDate.getText().toString().isEmpty()) {
|
||||
dialog.dismiss();
|
||||
XToastUtils.warning("请选择生产日期");
|
||||
return;
|
||||
}
|
||||
if (dateTextView.getText().toString().isEmpty()) {
|
||||
dialog.dismiss();
|
||||
XToastUtils.warning("请选择日期");
|
||||
XToastUtils.warning("请选择到期日期");
|
||||
return;
|
||||
}
|
||||
if (subtotal.getText().toString().isEmpty()) {
|
||||
|
|
@ -957,6 +1006,7 @@ public class InspectionWarehousingFragment extends BaseFragment<ActivityInspecti
|
|||
goodsBean.setPurNum(enterWeight.getText().toString());
|
||||
goodsBean.setTotalPrice(String.valueOf(new BigDecimal(subtotal.getText().toString()).multiply(BigDecimal.valueOf(100)).setScale(0, RoundingMode.DOWN).toPlainString()));
|
||||
goodsBean.setExpireTime(dateTextView.getText().toString());
|
||||
goodsBean.setProductDate(productionDate.getText().toString());
|
||||
goodsBean.setImgUrl(goodsBean.getTakePhoto() != null ? goodsBean.getTakePhoto() : "");
|
||||
goodsBean.setSupplierId(supplierList.get(((MaterialSpinner) view.findViewById(R.id.supplier_spinner)).getSelectedIndex()).getSupplierId());
|
||||
goodsBean.setSupplierName(supplierList.get(((MaterialSpinner) view.findViewById(R.id.supplier_spinner)).getSelectedIndex()).getSupplierName());
|
||||
|
|
|
|||
|
|
@ -557,6 +557,9 @@ public class InspectionWarehousingOutFragment extends BaseFragment<ActivityInspe
|
|||
private void uploadOutWarehouseData(List<GoodsBean> selectedGoods, ResponseCallBack callback) {
|
||||
ThreadPoolManager.getExecutor().execute(() -> {
|
||||
String url = WorkConfig.getBaseUrl() + "/ims_fetch_material/app/outInventory";
|
||||
if ("out".equals(pageType)){
|
||||
url = WorkConfig.getBaseUrl() + "/ims/out-inventory";
|
||||
}
|
||||
BigDecimal totalNum = BigDecimal.ZERO;
|
||||
BigDecimal totalAmount = BigDecimal.ZERO;
|
||||
for (GoodsBean goods : selectedGoods) {
|
||||
|
|
@ -718,39 +721,62 @@ public class InspectionWarehousingOutFragment extends BaseFragment<ActivityInspe
|
|||
TextView tvWeightView = view.findViewById(R.id.tv_weight);
|
||||
TextView weightView = view.findViewById(R.id.weight);
|
||||
TextView enterWeight = view.findViewById(R.id.enter_weight);
|
||||
TextView num = view.findViewById(R.id.num);
|
||||
if (unit.getText().toString().equals("斤")) {
|
||||
tvWeightView.setText(String.valueOf(weight * 2));
|
||||
BigDecimal unInspectedGoodsNum = new BigDecimal(goodsBean.getTotalQualifiedNum()).subtract(new BigDecimal(goodsBean.getOutCount()));
|
||||
BigDecimal rate = BigDecimal.valueOf(100).subtract(new BigDecimal(paramSettingInfo.getWeighDownwardRatio())).divide(BigDecimal.valueOf(100));
|
||||
BigDecimal originalNum = unInspectedGoodsNum.multiply(rate);
|
||||
Log.e(TAG,"unInspectedGoodsNum=" + unInspectedGoodsNum);
|
||||
Log.e(TAG,"weight=" + weight);
|
||||
Log.e(TAG,"originalNum=" + originalNum);
|
||||
if (weight * 2 >= originalNum.doubleValue()) {
|
||||
enterWeight.setText(unInspectedGoodsNum + "");
|
||||
weightView.setText(unInspectedGoodsNum + "");
|
||||
} else {
|
||||
enterWeight.setText(String.valueOf(weight * 2));
|
||||
weightView.setText(String.valueOf(weight * 2));
|
||||
if ("out".equals(pageType)){
|
||||
if (new BigDecimal(weight * 2).compareTo(new BigDecimal(num.getText().toString())) > 0) {
|
||||
enterWeight.setText(num.getText().toString());
|
||||
weightView.setText(String.valueOf(weight * 2));
|
||||
}else{
|
||||
enterWeight.setText(String.valueOf(weight * 2));
|
||||
weightView.setText(String.valueOf(weight * 2));
|
||||
}
|
||||
} else{
|
||||
BigDecimal unInspectedGoodsNum = new BigDecimal(goodsBean.getTotalQualifiedNum()).subtract(new BigDecimal(goodsBean.getOutCount()));
|
||||
BigDecimal rate = BigDecimal.valueOf(100).subtract(new BigDecimal(paramSettingInfo.getWeighDownwardRatio())).divide(BigDecimal.valueOf(100));
|
||||
BigDecimal originalNum = unInspectedGoodsNum.multiply(rate);
|
||||
Log.e(TAG,"unInspectedGoodsNum=" + unInspectedGoodsNum);
|
||||
Log.e(TAG,"weight=" + weight);
|
||||
Log.e(TAG,"originalNum=" + originalNum);
|
||||
if (weight * 2 >= originalNum.doubleValue()) {
|
||||
enterWeight.setText(unInspectedGoodsNum + "");
|
||||
weightView.setText(unInspectedGoodsNum + "");
|
||||
} else {
|
||||
enterWeight.setText(String.valueOf(weight * 2));
|
||||
weightView.setText(String.valueOf(weight * 2));
|
||||
}
|
||||
}
|
||||
|
||||
}else{
|
||||
tvWeightView.setText(String.valueOf(weight));
|
||||
BigDecimal unInspectedGoodsNum = new BigDecimal(goodsBean.getMaterialTotalNum()).subtract(new BigDecimal(goodsBean.getOutCount()));
|
||||
BigDecimal rate = BigDecimal.valueOf(100).subtract(new BigDecimal(paramSettingInfo.getWeighDownwardRatio())).divide(BigDecimal.valueOf(100));
|
||||
BigDecimal originalNum = unInspectedGoodsNum.multiply(rate);
|
||||
Log.e(TAG,"goodsBean=" + goodsBean);
|
||||
Log.e(TAG,"getTotalQualifiedNum=" + goodsBean.getTotalQualifiedNum());
|
||||
Log.e(TAG,"getOutCount=" + goodsBean.getOutCount());
|
||||
Log.e(TAG,"unInspectedGoodsNum=" + unInspectedGoodsNum);
|
||||
Log.e(TAG,"weight=" + weight);
|
||||
Log.e(TAG,"originalNum=" + originalNum);
|
||||
if (weight >= originalNum.doubleValue()) {
|
||||
enterWeight.setText(unInspectedGoodsNum + "");
|
||||
weightView.setText(unInspectedGoodsNum + "");
|
||||
} else {
|
||||
enterWeight.setText(String.valueOf(weight));
|
||||
weightView.setText(String.valueOf(weight));
|
||||
if ("out".equals(pageType)){
|
||||
if (new BigDecimal(weight * 2).compareTo(new BigDecimal(num.getText().toString())) > 0) {
|
||||
enterWeight.setText(num.getText().toString());
|
||||
weightView.setText(String.valueOf(weight));
|
||||
}else{
|
||||
enterWeight.setText(String.valueOf(weight));
|
||||
weightView.setText(String.valueOf(weight));
|
||||
}
|
||||
}else{
|
||||
BigDecimal unInspectedGoodsNum = new BigDecimal(goodsBean.getMaterialTotalNum()).subtract(new BigDecimal(goodsBean.getOutCount()));
|
||||
BigDecimal rate = BigDecimal.valueOf(100).subtract(new BigDecimal(paramSettingInfo.getWeighDownwardRatio())).divide(BigDecimal.valueOf(100));
|
||||
BigDecimal originalNum = unInspectedGoodsNum.multiply(rate);
|
||||
Log.e(TAG,"goodsBean=" + goodsBean);
|
||||
Log.e(TAG,"getTotalQualifiedNum=" + goodsBean.getTotalQualifiedNum());
|
||||
Log.e(TAG,"getOutCount=" + goodsBean.getOutCount());
|
||||
Log.e(TAG,"unInspectedGoodsNum=" + unInspectedGoodsNum);
|
||||
Log.e(TAG,"weight=" + weight);
|
||||
Log.e(TAG,"originalNum=" + originalNum);
|
||||
if (weight >= originalNum.doubleValue()) {
|
||||
enterWeight.setText(unInspectedGoodsNum + "");
|
||||
weightView.setText(unInspectedGoodsNum + "");
|
||||
} else {
|
||||
enterWeight.setText(String.valueOf(weight));
|
||||
weightView.setText(String.valueOf(weight));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
|
|
|||
|
|
@ -100,10 +100,13 @@ public class ProductSelectionFragment extends BaseFragment<ActivityProductSelect
|
|||
binding.nextStep.setVisibility(View.GONE);
|
||||
initData();
|
||||
} else {
|
||||
binding.areaSpinner.setVisibility(View.VISIBLE);
|
||||
binding.areaSpinner.setVisibility(View.GONE);
|
||||
if (AppConstants.ENTER.equals(pageType)) {
|
||||
binding.nextStep.setText("验货入库");
|
||||
binding.warehouseSpinner.setVisibility(View.GONE);
|
||||
} else {
|
||||
binding.warehouseSpinner.setVisibility(View.VISIBLE);
|
||||
initWarehouseSpinner("");
|
||||
binding.nextStep.setText("验货出库");
|
||||
}
|
||||
initAreaSpinner();
|
||||
|
|
@ -165,11 +168,24 @@ public class ProductSelectionFragment extends BaseFragment<ActivityProductSelect
|
|||
List<GoodsBean> filteredList = goodsList.stream()
|
||||
.filter(goods -> goods.getMaterialName().contains(searchText) || goods.getMaterialCode().contains(searchText))
|
||||
.collect(Collectors.toList());
|
||||
if (pageType.equals("out")) {
|
||||
String warehouseId = binding.warehouseSpinner.getSelectedItem() != null ? ((WarehouseBean) binding.warehouseSpinner.getSelectedItem()).getWarehouseId() : null;
|
||||
Log.e(TAG, "Selected warehouseId: " + warehouseId);
|
||||
filteredList = filteredList.stream()
|
||||
.filter(goods -> {
|
||||
if (StringHelper.isEmptyAndNull(goods.getWarehouseId()))
|
||||
return false;
|
||||
assert warehouseId != null;
|
||||
return warehouseId.equals(goods.getWarehouseId());
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
List<GoodsBean> finalFilteredList = filteredList;
|
||||
requireActivity().runOnUiThread(() -> {
|
||||
closeDialog();
|
||||
if (isDestroyed || !isAdded()) return;
|
||||
goodsAdapter.updateGoodsList(filteredList);
|
||||
if (filteredList.isEmpty()) {
|
||||
goodsAdapter.updateGoodsList(finalFilteredList);
|
||||
if (finalFilteredList.isEmpty()) {
|
||||
binding.linearGoodsList.setVisibility(View.GONE);
|
||||
binding.noData.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
|
@ -179,7 +195,21 @@ public class ProductSelectionFragment extends BaseFragment<ActivityProductSelect
|
|||
requireActivity().runOnUiThread(() -> {
|
||||
closeDialog();
|
||||
if (isDestroyed || !isAdded()) return;
|
||||
goodsAdapter = new GoodsAdapter(getContext(), goodsList, this, selectedGoodsIdList, pageType);
|
||||
String warehouseId = binding.warehouseSpinner.getSelectedItem() != null ? ((WarehouseBean) binding.warehouseSpinner.getSelectedItem()).getWarehouseId() : null;
|
||||
if (pageType.equals("out") && !StringHelper.isEmptyAndNull(warehouseId)) {
|
||||
Log.e(TAG, "Selected warehouseId: " + warehouseId);
|
||||
List<GoodsBean> filteredList = goodsList.stream()
|
||||
.filter(goods -> {
|
||||
if (StringHelper.isEmptyAndNull(goods.getWarehouseId()))
|
||||
return false;
|
||||
assert warehouseId != null;
|
||||
return warehouseId.equals(goods.getWarehouseId());
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
goodsAdapter = new GoodsAdapter(getContext(), filteredList, this, selectedGoodsIdList, pageType);
|
||||
}else{
|
||||
goodsAdapter = new GoodsAdapter(getContext(), goodsList, this, selectedGoodsIdList, pageType);
|
||||
}
|
||||
gridView.setAdapter(goodsAdapter);
|
||||
if (goodsList.isEmpty()) {
|
||||
binding.linearGoodsList.setVisibility(View.GONE);
|
||||
|
|
@ -216,6 +246,7 @@ public class ProductSelectionFragment extends BaseFragment<ActivityProductSelect
|
|||
public void onDebouncedClick(View v) {
|
||||
selectedGoodsIdList = new ArrayList<>();
|
||||
binding.keyword.setText("");
|
||||
binding.warehouseSpinner.setSelectedIndex(0);
|
||||
binding.alreadySelectedNum.setText("已选择:0");
|
||||
initData();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -147,7 +147,25 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="320dp"
|
||||
android:orientation="vertical">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="80dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="5dp"
|
||||
android:gravity="center_vertical"
|
||||
android:text="生产日期" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/productionDate"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:background="@drawable/edittext_border"
|
||||
android:editable="false"
|
||||
android:hint="请选择日期" />
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="80dp">
|
||||
|
|
|
|||
Loading…
Reference in New Issue