From ef6fcf9df6709f7fc29d5791d5d46a2e488c9b75 Mon Sep 17 00:00:00 2001 From: jjLv <1981429112@qq.com> Date: Thu, 7 Aug 2025 16:21:48 +0800 Subject: [PATCH] =?UTF-8?q?bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../canteen/adapter/DocumentOutAdapter.java | 40 +- .../canteen/adapter/EnterDetailAdapter.java | 8 +- .../bonus/canteen/adapter/GoodsAdapter.java | 11 + .../canteen/adapter/OutDetailAdapter.java | 4 +- .../bonus/canteen/entity/DocumentBean.java | 11 +- .../bonus/canteen/entity/DocumentOutBean.java | 8 +- .../bonus/canteen/entity/EnterRecordBean.java | 10 +- .../com/bonus/canteen/entity/GoodsBean.java | 45 ++- .../bonus/canteen/entity/GoodsUploadBean.java | 362 ++++++++++++++++++ .../bonus/canteen/entity/OutRecordBean.java | 10 +- 10 files changed, 462 insertions(+), 47 deletions(-) create mode 100644 app/src/main/java/com/bonus/canteen/entity/GoodsUploadBean.java diff --git a/app/src/main/java/com/bonus/canteen/adapter/DocumentOutAdapter.java b/app/src/main/java/com/bonus/canteen/adapter/DocumentOutAdapter.java index 564dc9a..66244dc 100644 --- a/app/src/main/java/com/bonus/canteen/adapter/DocumentOutAdapter.java +++ b/app/src/main/java/com/bonus/canteen/adapter/DocumentOutAdapter.java @@ -95,23 +95,33 @@ public class DocumentOutAdapter extends BaseAdapter { holder.quantity.setText(bean.getTotalNum()); holder.alreadyClaimedNum.setText(bean.getOutNum()); holder.operation.setText("出库"); - holder.operation.setTextColor(Color.parseColor("#006e6b")); - holder.operation.setOnClickListener(new DebounceClickListener() { - @Override - public void onDebouncedClick(View v) { - selectGoodsDetails(bean, new ResponseCallBack() { - @Override - public void onSuccess() { + BigDecimal outNum = new BigDecimal(bean.getOutNum()); + BigDecimal totalNum = new BigDecimal(bean.getTotalNum()); + Log.e(TAG, "outNum==" + outNum); + Log.e(TAG, "totalNum==" + totalNum); + if (totalNum.compareTo(outNum) == 0) { + holder.operation.setTextColor(Color.parseColor("#808080")); + holder.operation.setEnabled(false); + }else{ + holder.operation.setTextColor(Color.parseColor("#006e6b")); + holder.operation.setOnClickListener(new DebounceClickListener() { + @Override + public void onDebouncedClick(View v) { + selectGoodsDetails(bean, new ResponseCallBack() { + @Override + public void onSuccess() { - } + } + + @Override + public void onFail(String msg) { + XToastUtils.error(msg); + } + }); + } + }); + } - @Override - public void onFail(String msg) { - XToastUtils.error(msg); - } - }); - } - }); return convertView; } diff --git a/app/src/main/java/com/bonus/canteen/adapter/EnterDetailAdapter.java b/app/src/main/java/com/bonus/canteen/adapter/EnterDetailAdapter.java index d23952c..a81b4e4 100644 --- a/app/src/main/java/com/bonus/canteen/adapter/EnterDetailAdapter.java +++ b/app/src/main/java/com/bonus/canteen/adapter/EnterDetailAdapter.java @@ -88,11 +88,9 @@ public class EnterDetailAdapter extends BaseAdapter { holder.name = convertView.findViewById(R.id.name); holder.type = convertView.findViewById(R.id.type); holder.unit = convertView.findViewById(R.id.unit); - holder.num = convertView.findViewById(R.id.num); holder.price = convertView.findViewById(R.id.price); holder.subTotal = convertView.findViewById(R.id.sub_total); holder.inspectedGoodsNum = convertView.findViewById(R.id.inspected_goods_num); - holder.enterWarehouseNum = convertView.findViewById(R.id.enter_warehouse_num); convertView.setTag(holder); } else { holder = (ViewHolder) convertView.getTag(); @@ -105,11 +103,9 @@ public class EnterDetailAdapter extends BaseAdapter { holder.name.setText(bean.getMaterialName()); holder.type.setText(bean.getMaterialTypeName()); holder.unit.setText(bean.getUnitName()); - holder.num.setText(bean.getMaterialTotalNum()); holder.price.setText(bean.getUnitPrice()); + holder.inspectedGoodsNum.setText(bean.getInventoryNum()); holder.subTotal.setText(bean.getTotalPrice()); - holder.inspectedGoodsNum.setText(bean.getTotalQualifiedNum()); - holder.enterWarehouseNum.setText(bean.getIntoNum()); return convertView; } private class ViewHolder { @@ -118,11 +114,9 @@ public class EnterDetailAdapter extends BaseAdapter { TextView code; TextView type; TextView unit; - TextView num; TextView price; TextView subTotal; TextView inspectedGoodsNum; - TextView enterWarehouseNum; } } diff --git a/app/src/main/java/com/bonus/canteen/adapter/GoodsAdapter.java b/app/src/main/java/com/bonus/canteen/adapter/GoodsAdapter.java index 93cc39e..dfecf87 100644 --- a/app/src/main/java/com/bonus/canteen/adapter/GoodsAdapter.java +++ b/app/src/main/java/com/bonus/canteen/adapter/GoodsAdapter.java @@ -38,6 +38,7 @@ import com.bonus.canteen.utils.listener.DebounceClickListener; import org.easydarwin.easypusher.R; import java.lang.ref.WeakReference; +import java.math.BigDecimal; import java.util.List; public class GoodsAdapter extends BaseAdapter { @@ -121,6 +122,16 @@ public class GoodsAdapter extends BaseAdapter { @Override public void onDebouncedClick(View v) { if (StringHelper.isEmptyAndNull(bean.getIsSelect()) || !bean.getIsSelect().equals("1")) { + //判断当前库存是否大于0 + if (pageType.equals("out")){ + if (StringHelper.isEmptyAndNull(bean.getMaterialTotalNum()) || new BigDecimal(bean.getMaterialTotalNum()).compareTo(BigDecimal.valueOf(0)) <= 0) { + ProductSelectionFragment tempFragment = productSelectionFragment.get(); + if(tempFragment != null && !tempFragment.isDetached()){ + tempFragment.showToast("当前商品库存不足,无法选择!"); + } + return; + } + } finalHolder.isSelect.setVisibility(View.VISIBLE); bean.setIsSelect("1"); selectedGoodsIdList.add(bean.getMaterialId()); diff --git a/app/src/main/java/com/bonus/canteen/adapter/OutDetailAdapter.java b/app/src/main/java/com/bonus/canteen/adapter/OutDetailAdapter.java index 1bfc2b5..0b168fe 100644 --- a/app/src/main/java/com/bonus/canteen/adapter/OutDetailAdapter.java +++ b/app/src/main/java/com/bonus/canteen/adapter/OutDetailAdapter.java @@ -96,8 +96,8 @@ public class OutDetailAdapter extends BaseAdapter { holder.name.setText(bean.getMaterialName()); holder.type.setText(bean.getMaterialTypeName()); holder.unit.setText(bean.getUnitName()); - holder.num.setText(bean.getMaterialTotalNum()); - holder.collectedNum.setText(bean.getOutCount()); + holder.num.setText(bean.getInventoryNum()); + holder.collectedNum.setText(bean.getFetchNum()); return convertView; } private class ViewHolder { diff --git a/app/src/main/java/com/bonus/canteen/entity/DocumentBean.java b/app/src/main/java/com/bonus/canteen/entity/DocumentBean.java index 97d5af0..645cf45 100644 --- a/app/src/main/java/com/bonus/canteen/entity/DocumentBean.java +++ b/app/src/main/java/com/bonus/canteen/entity/DocumentBean.java @@ -17,6 +17,8 @@ package com.bonus.canteen.entity; +import android.annotation.SuppressLint; + import com.bonus.canteen.utils.StringHelper; import com.google.gson.annotations.SerializedName; @@ -84,8 +86,9 @@ public class DocumentBean { this.title = title; } + @SuppressLint("DefaultLocale") public String getTotalIntoNum() { - return totalIntoNum; + return StringHelper.isEmptyAndNullOrZero(totalIntoNum) ? "0" : String.format("%.2f", Double.parseDouble(totalIntoNum)); } public void setTotalIntoNum(String totalIntoNum) { @@ -96,16 +99,18 @@ public class DocumentBean { this.supplier = supplier; } + @SuppressLint("DefaultLocale") public String getNum() { - return num; + return StringHelper.isEmptyAndNullOrZero(num) ? "0" : String.format("%.2f", Double.parseDouble(num)); } public void setNum(String num) { this.num = num; } + @SuppressLint("DefaultLocale") public String getAmount() { - return StringHelper.isEmptyAndNull(amount) ? "0" : amount; + return StringHelper.isEmptyAndNullOrZero(amount) ? "0" : String.format("%.2f", Double.parseDouble(amount)); } public void setAmount(String amount) { diff --git a/app/src/main/java/com/bonus/canteen/entity/DocumentOutBean.java b/app/src/main/java/com/bonus/canteen/entity/DocumentOutBean.java index a68b209..80b10df 100644 --- a/app/src/main/java/com/bonus/canteen/entity/DocumentOutBean.java +++ b/app/src/main/java/com/bonus/canteen/entity/DocumentOutBean.java @@ -17,6 +17,8 @@ package com.bonus.canteen.entity; +import android.annotation.SuppressLint; + import com.bonus.canteen.utils.StringHelper; import com.google.gson.annotations.SerializedName; @@ -87,8 +89,9 @@ public class DocumentOutBean { this.title = title; } + @SuppressLint("DefaultLocale") public String getTotalNum() { - return StringHelper.isEmptyAndNull(totalNum) ? "0" : totalNum; + return StringHelper.isEmptyAndNullOrZero(totalNum) ? "0" : String.format("%.2f", Double.parseDouble(totalNum)); } public void setTotalNum(String totalNum) { @@ -96,8 +99,9 @@ public class DocumentOutBean { } + @SuppressLint("DefaultLocale") public String getOutNum() { - return StringHelper.isEmptyAndNull(outNum) ? "0" : outNum; + return StringHelper.isEmptyAndNullOrZero(outNum) ? "0" : String.format("%.2f", Double.parseDouble(outNum)); } public void setOutNum(String outNum) { diff --git a/app/src/main/java/com/bonus/canteen/entity/EnterRecordBean.java b/app/src/main/java/com/bonus/canteen/entity/EnterRecordBean.java index 97acf0e..5fb0efb 100644 --- a/app/src/main/java/com/bonus/canteen/entity/EnterRecordBean.java +++ b/app/src/main/java/com/bonus/canteen/entity/EnterRecordBean.java @@ -1,6 +1,10 @@ package com.bonus.canteen.entity; +import android.annotation.SuppressLint; + +import com.bonus.canteen.utils.StringHelper; + /** * 入库记录对象 ims_into_inventory * @@ -90,8 +94,9 @@ public class EnterRecordBean { this.intoDate = intoDate; } + @SuppressLint("DefaultLocale") public String getTotalNum() { - return totalNum; + return StringHelper.isEmptyAndNullOrZero(totalNum) ? "0" : String.format("%.2f", Double.parseDouble(totalNum)); } public void setTotalNum(String totalNum) { @@ -130,8 +135,9 @@ public class EnterRecordBean { this.relateDeliveryGoodsId = relateDeliveryGoodsId; } + @SuppressLint("DefaultLocale") public String getTotalAmount() { - return totalAmount; + return StringHelper.isEmptyAndNullOrZero(totalAmount) ? "0" : String.format("%.2f", Double.parseDouble(totalAmount)); } public void setTotalAmount(String totalAmount) { diff --git a/app/src/main/java/com/bonus/canteen/entity/GoodsBean.java b/app/src/main/java/com/bonus/canteen/entity/GoodsBean.java index 8d1e53e..d2b92cb 100644 --- a/app/src/main/java/com/bonus/canteen/entity/GoodsBean.java +++ b/app/src/main/java/com/bonus/canteen/entity/GoodsBean.java @@ -17,10 +17,14 @@ package com.bonus.canteen.entity; +import android.annotation.SuppressLint; + import com.bonus.canteen.utils.StringHelper; import com.google.gson.annotations.SerializedName; -public class GoodsBean { +import java.io.Serializable; + +public class GoodsBean implements Serializable { @SerializedName("materialId") private String materialId; @SerializedName("materialName") @@ -61,8 +65,9 @@ public class GoodsBean { private String outNum; private String outCount; private String ifFillInventory; + @SuppressLint("DefaultLocale") public String getTotalQualifiedNum() { - return StringHelper.isEmptyAndNull(totalQualifiedNum) ? "0" : totalQualifiedNum; + return StringHelper.isEmptyAndNullOrZero(totalQualifiedNum) ? "0" : String.format("%.2f", Double.parseDouble(totalQualifiedNum)); } public String getWarehouseId() { @@ -89,8 +94,9 @@ public class GoodsBean { this.fetchDetailId = fetchDetailId; } + @SuppressLint("DefaultLocale") public String getIntoNum() { - return StringHelper.isEmptyAndNull(intoNum) ? "0" : intoNum; + return StringHelper.isEmptyAndNullOrZero(intoNum) ? "0" : String.format("%.2f", Double.parseDouble(intoNum)); } public void setIntoNum(String intoNum) { @@ -101,28 +107,32 @@ public class GoodsBean { this.totalQualifiedNum = totalQualifiedNum; } + @SuppressLint("DefaultLocale") public String getFetchNum() { - return StringHelper.isEmptyAndNull(fetchNum) ? "0" : fetchNum; + return StringHelper.isEmptyAndNullOrZero(fetchNum) ? "0" : String.format("%.2f", Double.parseDouble(fetchNum)); } + @SuppressLint("DefaultLocale") public String getDeliveryNum() { - return StringHelper.isEmptyAndNull(deliveryNum) ? "0" : deliveryNum; + return StringHelper.isEmptyAndNullOrZero(deliveryNum) ? "0" : String.format("%.2f", Double.parseDouble(deliveryNum)); } public void setDeliveryNum(String deliveryNum) { this.deliveryNum = deliveryNum; } + @SuppressLint("DefaultLocale") public String getOutNum() { - return StringHelper.isEmptyAndNull(outNum) ? "0" : outNum; + return StringHelper.isEmptyAndNullOrZero(outNum) ? "0" : String.format("%.2f", Double.parseDouble(outNum)); } public void setOutNum(String outNum) { this.outNum = outNum; } + @SuppressLint("DefaultLocale") public String getOutCount() { - return StringHelper.isEmptyAndNull(outCount) ? "0" : outCount; + return StringHelper.isEmptyAndNullOrZero(outCount) ? "0" : String.format("%.2f", Double.parseDouble(outCount)); } public void setOutCount(String outCount) { @@ -189,8 +199,9 @@ public class GoodsBean { this.unitName = unitName; } + @SuppressLint("DefaultLocale") public String getUnitPrice() { - return StringHelper.isEmptyAndNull(unitPrice) ? "0.00" : unitPrice; + return StringHelper.isEmptyAndNullOrZero(unitPrice) ? "0" : String.format("%.2f", Double.parseDouble(unitPrice)); } public void setUnitPrice(String unitPrice) { @@ -205,8 +216,9 @@ public class GoodsBean { this.imgUrl = imgUrl; } + @SuppressLint("DefaultLocale") public String getMaterialTotalNum() { - return StringHelper.isEmptyAndNull(materialTotalNum) ? "0" : materialTotalNum; + return StringHelper.isEmptyAndNullOrZero(materialTotalNum) ? "0" : String.format("%.2f", Double.parseDouble(materialTotalNum)); } public void setMaterialTotalNum(String materialTotalNum) { @@ -245,32 +257,36 @@ public class GoodsBean { this.supplierName = supplierName; } + @SuppressLint("DefaultLocale") public String getTotalPrice() { - return StringHelper.isEmptyAndNull(totalPrice) ? "0.00" : totalPrice; + return StringHelper.isEmptyAndNullOrZero(totalPrice) ? "0" : String.format("%.2f", Double.parseDouble(totalPrice)); } public void setTotalPrice(String totalPrice) { this.totalPrice = totalPrice; } + @SuppressLint("DefaultLocale") public String getPurNum() { - return StringHelper.isEmptyAndNull(purNum) ? "0" : purNum; + return StringHelper.isEmptyAndNullOrZero(purNum) ? "0" : String.format("%.2f", Double.parseDouble(purNum)); } public void setPurNum(String purNum) { this.purNum = purNum; } + @SuppressLint("DefaultLocale") public String getUnqualifiedNum() { - return StringHelper.isEmptyAndNull(unqualifiedNum) ? "0" : unqualifiedNum; + return StringHelper.isEmptyAndNullOrZero(unqualifiedNum) ? "0" : String.format("%.2f", Double.parseDouble(unqualifiedNum)); } public void setUnqualifiedNum(String unqualifiedNum) { this.unqualifiedNum = unqualifiedNum; } + @SuppressLint("DefaultLocale") public String getInventoryNum() { - return StringHelper.isEmptyAndNull(inventoryNum) ? "0" : inventoryNum; + return StringHelper.isEmptyAndNullOrZero(inventoryNum) ? "0" : String.format("%.2f", Double.parseDouble(inventoryNum)); } public void setInventoryNum(String inventoryNum) { @@ -285,8 +301,9 @@ public class GoodsBean { this.expireTime = expireTime; } + @SuppressLint("DefaultLocale") public String getWeight() { - return StringHelper.isEmptyAndNull(weight) ? "0" : weight; + return StringHelper.isEmptyAndNullOrZero(weight) ? "0" : String.format("%.2f", Double.parseDouble(weight)); } public void setWeight(String weight) { diff --git a/app/src/main/java/com/bonus/canteen/entity/GoodsUploadBean.java b/app/src/main/java/com/bonus/canteen/entity/GoodsUploadBean.java new file mode 100644 index 0000000..c31c647 --- /dev/null +++ b/app/src/main/java/com/bonus/canteen/entity/GoodsUploadBean.java @@ -0,0 +1,362 @@ +/* + * Copyright (C) 2025 xuexiangjys(xuexiangjys@163.com) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package com.bonus.canteen.entity; + +import android.annotation.SuppressLint; + +import com.bonus.canteen.utils.StringHelper; +import com.google.gson.annotations.SerializedName; + +import java.io.Serializable; + +public class GoodsUploadBean implements Serializable { + @SerializedName("materialId") + private String materialId; + @SerializedName("materialName") + private String materialName; + @SerializedName("materialCode") + private String materialCode; + private String materialTypeId; + @SerializedName("materialTypeName") + private String materialTypeName; + @SerializedName("unitId") + private String unitId; + @SerializedName("unitName") + private String unitName; + @SerializedName(value = "unitPrice", alternate = {"singlePrice"}) + private String unitPrice; + private String imgUrl; + @SerializedName(value = "materialTotalNum", alternate = {"orderNum","materialNum"}) + private String materialTotalNum; + private String isSelect; + + private String inventoryId; + private String fetchDetailId; + private String supplierId; + private String supplierName; + private String totalPrice; + private String purNum; + private String deliveryNum; + private String fetchNum; + 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; + private String outNum; + private String outCount; + private String ifFillInventory; + @SuppressLint("DefaultLocale") + public String getTotalQualifiedNum() { + return StringHelper.isEmptyAndNullOrZero(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; + } + + public void setFetchDetailId(String fetchDetailId) { + this.fetchDetailId = fetchDetailId; + } + + @SuppressLint("DefaultLocale") + public String getIntoNum() { + return StringHelper.isEmptyAndNullOrZero(intoNum) ? "0" : intoNum; + } + + public void setIntoNum(String intoNum) { + this.intoNum = intoNum; + } + + public void setTotalQualifiedNum(String totalQualifiedNum) { + this.totalQualifiedNum = totalQualifiedNum; + } + + @SuppressLint("DefaultLocale") + public String getFetchNum() { + return StringHelper.isEmptyAndNullOrZero(fetchNum) ? "0" : fetchNum; + } + + @SuppressLint("DefaultLocale") + public String getDeliveryNum() { + return StringHelper.isEmptyAndNullOrZero(deliveryNum) ? "0" : deliveryNum; + } + + public void setDeliveryNum(String deliveryNum) { + this.deliveryNum = deliveryNum; + } + + @SuppressLint("DefaultLocale") + public String getOutNum() { + return StringHelper.isEmptyAndNullOrZero(outNum) ? "0" : outNum; + } + + public void setOutNum(String outNum) { + this.outNum = outNum; + } + + @SuppressLint("DefaultLocale") + public String getOutCount() { + return StringHelper.isEmptyAndNullOrZero(outCount) ? "0" : outCount; + } + + public void setOutCount(String outCount) { + this.outCount = outCount; + } + + public void setFetchNum(String fetchNum) { + this.fetchNum = fetchNum; + } + + public String getMaterialId() { + return materialId; + } + + public void setMaterialId(String materialId) { + this.materialId = materialId; + } + + public String getMaterialName() { + return materialName; + } + + public void setMaterialName(String materialName) { + this.materialName = materialName; + } + + public String getMaterialCode() { + return materialCode; + } + + public void setMaterialCode(String materialCode) { + this.materialCode = materialCode; + } + + public String getMaterialTypeId() { + return materialTypeId; + } + + public void setMaterialTypeId(String materialTypeId) { + this.materialTypeId = materialTypeId; + } + + public String getMaterialTypeName() { + return materialTypeName; + } + + public void setMaterialTypeName(String materialTypeName) { + this.materialTypeName = materialTypeName; + } + + public String getUnitId() { + return unitId; + } + + public void setUnitId(String unitId) { + this.unitId = unitId; + } + + public String getUnitName() { + return unitName; + } + + public void setUnitName(String unitName) { + this.unitName = unitName; + } + + @SuppressLint("DefaultLocale") + public String getUnitPrice() { + return StringHelper.isEmptyAndNullOrZero(unitPrice) ? "0" : unitPrice; + } + + public void setUnitPrice(String unitPrice) { + this.unitPrice = unitPrice; + } + + public String getImgUrl() { + return StringHelper.isEmptyAndNull(imgUrl) ? "" : imgUrl; + } + + public void setImgUrl(String imgUrl) { + this.imgUrl = imgUrl; + } + + @SuppressLint("DefaultLocale") + public String getMaterialTotalNum() { + return StringHelper.isEmptyAndNullOrZero(materialTotalNum) ? "0" : materialTotalNum; + } + + public void setMaterialTotalNum(String materialTotalNum) { + this.materialTotalNum = materialTotalNum; + } + + public String getIsSelect() { + return isSelect; + } + + public void setIsSelect(String isSelect) { + this.isSelect = isSelect; + } + + public String getInventoryId() { + return inventoryId; + } + + public void setInventoryId(String inventoryId) { + this.inventoryId = inventoryId; + } + + public String getSupplierId() { + return supplierId; + } + + public void setSupplierId(String supplierId) { + this.supplierId = supplierId; + } + + public String getSupplierName() { + return supplierName; + } + + public void setSupplierName(String supplierName) { + this.supplierName = supplierName; + } + + @SuppressLint("DefaultLocale") + public String getTotalPrice() { + return StringHelper.isEmptyAndNullOrZero(totalPrice) ? "0" : totalPrice; + } + + public void setTotalPrice(String totalPrice) { + this.totalPrice = totalPrice; + } + + @SuppressLint("DefaultLocale") + public String getPurNum() { + return StringHelper.isEmptyAndNullOrZero(purNum) ? "0" : purNum; + } + + public void setPurNum(String purNum) { + this.purNum = purNum; + } + + @SuppressLint("DefaultLocale") + public String getUnqualifiedNum() { + return StringHelper.isEmptyAndNullOrZero(unqualifiedNum) ? "0" : unqualifiedNum; + } + + public void setUnqualifiedNum(String unqualifiedNum) { + this.unqualifiedNum = unqualifiedNum; + } + + @SuppressLint("DefaultLocale") + public String getInventoryNum() { + return StringHelper.isEmptyAndNullOrZero(inventoryNum) ? "0" : inventoryNum; + } + + public void setInventoryNum(String inventoryNum) { + this.inventoryNum = inventoryNum; + } + + public String getExpireTime() { + return expireTime; + } + + public void setExpireTime(String expireTime) { + this.expireTime = expireTime; + } + + @SuppressLint("DefaultLocale") + public String getWeight() { + return StringHelper.isEmptyAndNullOrZero(weight) ? "0" : weight; + } + + public void setWeight(String weight) { + this.weight = weight; + } + + public String getTakePhoto() { + return takePhoto; + } + + public void setTakePhoto(String takePhoto) { + this.takePhoto = takePhoto; + } + + public String getIfFillInventory() { + return ifFillInventory; + } + + public void setIfFillInventory(String ifFillInventory) { + this.ifFillInventory = ifFillInventory; + } + + @Override + public String toString() { + return "GoodsBean{" + + "materialId='" + materialId + '\'' + + ", materialName='" + materialName + '\'' + + ", materialCode='" + materialCode + '\'' + + ", materialTypeId='" + materialTypeId + '\'' + + ", materialTypeName='" + materialTypeName + '\'' + + ", unitId='" + unitId + '\'' + + ", unitName='" + unitName + '\'' + + ", unitPrice='" + unitPrice + '\'' + + ", imgUrl='" + imgUrl + '\'' + + ", materialTotalNum='" + materialTotalNum + '\'' + + ", isSelect='" + isSelect + '\'' + + ", inventoryId='" + inventoryId + '\'' + + ", fetchDetailId='" + fetchDetailId + '\'' + + ", supplierId='" + supplierId + '\'' + + ", supplierName='" + supplierName + '\'' + + ", totalPrice='" + totalPrice + '\'' + + ", intoNum='" + intoNum + '\'' + + ", purNum='" + purNum + '\'' + + ", deliveryNum='" + deliveryNum + '\'' + + ", fetchNum='" + fetchNum + '\'' + + ", totalQualifiedNum='" + totalQualifiedNum + '\'' + + ", unqualifiedNum='" + unqualifiedNum + '\'' + + ", inventoryNum='" + inventoryNum + '\'' + + ", expireTime='" + expireTime + '\'' + + ", productDate='" + productDate + '\'' + + ", weight='" + weight + '\'' + + ", takePhoto='" + takePhoto + '\'' + + ", ifFillInventory='" + ifFillInventory + '\'' + + '}'; + } +} diff --git a/app/src/main/java/com/bonus/canteen/entity/OutRecordBean.java b/app/src/main/java/com/bonus/canteen/entity/OutRecordBean.java index 121c7fb..571bff0 100644 --- a/app/src/main/java/com/bonus/canteen/entity/OutRecordBean.java +++ b/app/src/main/java/com/bonus/canteen/entity/OutRecordBean.java @@ -1,6 +1,10 @@ package com.bonus.canteen.entity; +import android.annotation.SuppressLint; + +import com.bonus.canteen.utils.StringHelper; + /** * 出库记录对象 ims_out_inventory * @@ -96,8 +100,9 @@ public class OutRecordBean{ this.fetchUserId = fetchUserId; } + @SuppressLint("DefaultLocale") public String getTotalNum() { - return totalNum; + return StringHelper.isEmptyAndNullOrZero(totalNum) ? "0" : String.format("%.2f", Double.parseDouble(totalNum)); } public void setTotalNum(String totalNum) { @@ -128,8 +133,9 @@ public class OutRecordBean{ this.orderId = orderId; } + @SuppressLint("DefaultLocale") public String getTotalAmount() { - return totalAmount; + return StringHelper.isEmptyAndNullOrZero(totalAmount) ? "0" : String.format("%.2f", Double.parseDouble(totalAmount)); } public void setTotalAmount(String totalAmount) {