Commit 8a4d2d49 by jason

食材数量 支持小数点

parent 044908ec
......@@ -64,7 +64,7 @@ public class ConfirmOrderBean {
@Data
public static class PurchaseOrderDetails {
private int purchaseFoodId;
private int foodQuantity;
private double foodQuantity;
private double foodPrice;
private int orderId;
}
......
......@@ -17,7 +17,7 @@ public class DishDetailBean {
private int restaurantId;// number 非必须
private int purchaseFoodId;// number 非必须 食材编号
private String foodName;// string 非必须 食材名称
private int consumeQuantity;// number 非必须 消耗个数
private double consumeQuantity;// number 非必须 消耗个数
private String basicUnitName;// string 非必须 配置单位
private String foodNo;// string 非必须 食材编号
private int type;// number 非必须 状态 0 食材 1 细项
......
......@@ -22,7 +22,7 @@ public class NewPurchaseOrderBean {
@Data
public static class NewPurchaseOrderDetailsBean {
private int foodId;
private int foodQuantity;
private double foodQuantity;
private double foodPrice;
private int supplierId;
}
......
......@@ -40,7 +40,7 @@ public class OrderWareHouseBean {
public static class PurchaseWarehousingOrderDetail {
private Integer orderDetailsId;
private Integer purchaseFoodId;
private int foodQuantity;
private double foodQuantity;
private double foodPrice;
private double totalPrice;
private int brandId;
......
......@@ -56,7 +56,7 @@ public class PurchaseFoodBean implements Serializable, QMUISection.Model<Purchas
*/
private String packingDescription;
private long createTime;
private int foodQuantity;
private double foodQuantity;
/**
* 最低採購金額,食品列表用
*/
......
......@@ -288,7 +288,7 @@ public class BuyIngredientsAdapter extends GroupedRecyclerViewAdapter<BuyIngredi
});
}
private void foodNumberChange(BaseViewHolder itemViewHolder, PurchaseFoodBean purchaseFoodBean, int groupPosition, int childPosition, int changeNum) {
private void foodNumberChange(BaseViewHolder itemViewHolder, PurchaseFoodBean purchaseFoodBean, int groupPosition, int childPosition, double changeNum) {
purchaseFoodBean.setFoodQuantity(purchaseFoodBean.getFoodQuantity() + changeNum);
itemViewHolder.setText(R.id.ed_food_ingredient_number, String.valueOf(purchaseFoodBean.getFoodQuantity()));
setSubAndNumShow(itemViewHolder, purchaseFoodBean.getFoodQuantity() <= 0);
......@@ -308,7 +308,7 @@ public class BuyIngredientsAdapter extends GroupedRecyclerViewAdapter<BuyIngredi
* @param beforeNum 之前的數量
* @param currentNum 現在的數量
*/
void onChange(PurchaseFoodBean purchaseFoodBean, int parentCategoryIndex, int categoryIndex, int beforeNum, int currentNum);
void onChange(PurchaseFoodBean purchaseFoodBean, int parentCategoryIndex, int categoryIndex, double beforeNum, double currentNum);
}
public void setOnFoodNumberChangeListener(OnFoodNumberChangeListener onFoodNumberChangeListener) {
......
......@@ -146,7 +146,7 @@ public class FoodListAdapter extends BaseQuickAdapter<PurchaseFoodBean, BaseView
* @param number 修改後的食品數量
* @param position 操作的食品下標
*/
void onChanged(int beforeNumber, int number, int position);
void onChanged(double beforeNumber, double number, int position);
}
public void setOnCheckedChangeListener(OnCheckedChangeListener onCheckedChangeListener) {
......
......@@ -297,7 +297,7 @@ public class ShoppingCartAdapter extends BaseQuickAdapter<ShoppingCartBean, Shop
* @param purchaseFoodBean 需要刪除的食品對象
* @return 是否刪除供應商
*/
private boolean deleteFood(int supplierPosition, BaseViewHolder viewHolder, TextView tvFoodTypeNumber, FoodListAdapter foodListAdapter, int beforeNumber, int position, PurchaseFoodBean purchaseFoodBean) {
private boolean deleteFood(int supplierPosition, BaseViewHolder viewHolder, TextView tvFoodTypeNumber, FoodListAdapter foodListAdapter, double beforeNumber, int position, PurchaseFoodBean purchaseFoodBean) {
foodListAdapter.removeAt(position);
//如果這個供應商沒有食品了,需要當前adapter刪除掉這個供應商
if (foodListAdapter.getItemCount() == 0) {
......@@ -328,7 +328,7 @@ public class ShoppingCartAdapter extends BaseQuickAdapter<ShoppingCartBean, Shop
* @param unitPrice 食品單價
* @param foodQuantity 食品數量
*/
private void minusFood(BaseViewHolder viewHolder, ShoppingCartBean cartBean, double unitPrice, int foodQuantity) {
private void minusFood(BaseViewHolder viewHolder, ShoppingCartBean cartBean, double unitPrice, double foodQuantity) {
int species = cartBean.getSelectSpeciesNum() - 1;
cartBean.setSelectSpeciesNum(species);
viewHolder.setText(R.id.tv_order_item_food_type_total, String.valueOf(species));
......@@ -342,7 +342,7 @@ public class ShoppingCartAdapter extends BaseQuickAdapter<ShoppingCartBean, Shop
* @param unitPrice 食品單價
* @param foodQuantity 食品數量
*/
private void addFood(BaseViewHolder viewHolder, ShoppingCartBean cartBean, double unitPrice, int foodQuantity) {
private void addFood(BaseViewHolder viewHolder, ShoppingCartBean cartBean, double unitPrice, double foodQuantity) {
int species = cartBean.getSelectSpeciesNum() + 1;
cartBean.setSelectSpeciesNum(species);
viewHolder.setText(R.id.tv_order_item_food_type_total, String.valueOf(species));
......@@ -357,7 +357,7 @@ public class ShoppingCartAdapter extends BaseQuickAdapter<ShoppingCartBean, Shop
* @param foodQuantity 食品數量
* @param species 需要增加的種類數量
*/
private void addTotalAmount(BaseViewHolder viewHolder, ShoppingCartBean cartBean, double unitPrice, int foodQuantity, int species) {
private void addTotalAmount(BaseViewHolder viewHolder, ShoppingCartBean cartBean, double unitPrice, double foodQuantity, int species) {
//供應商總價減去-這個食品的總價=等於現價
double currentPrice = MoneyUtil.sum(cartBean.getSelectFoodAmount(), MoneyUtil.priceCalculation(unitPrice, foodQuantity));
cartBean.setSelectFoodAmount(currentPrice);
......@@ -377,7 +377,7 @@ public class ShoppingCartAdapter extends BaseQuickAdapter<ShoppingCartBean, Shop
* @param foodQuantity 食品數量
* @param species 需要減少的種類數量
*/
private void minusTotalPrice(BaseViewHolder viewHolder, ShoppingCartBean cartBean, double unitPrice, int foodQuantity, int species) {
private void minusTotalPrice(BaseViewHolder viewHolder, ShoppingCartBean cartBean, double unitPrice, double foodQuantity, int species) {
//供應商總價減去-這個食品的總價=等於現價
double currentPrice = MoneyUtil.sub(cartBean.getSelectFoodAmount(), MoneyUtil.priceCalculation(unitPrice, foodQuantity));
//修改選中食品的金額
......
......@@ -54,7 +54,7 @@ public class DishDetailAdapter extends BaseQuickAdapter<DishDetailBean, BaseView
count.setText(String.valueOf(tag.getConsumeQuantity()));
count.setSelection(count.getText().toString().length());
}else {
tag.setConsumeQuantity(Integer.parseInt(s.toString()));
tag.setConsumeQuantity(Double.valueOf(s.toString()));
}
}
});
......
......@@ -158,7 +158,7 @@ public class FunctionListFragment extends BaseSupplyChainFragment<FunctionListPr
case "設置":
new XPopup.Builder(requireContext()).asCustom(new UpdateRestaurantInfoPop(requireContext())).show();
break;
case "菜品Boom":
case "菜品Bom":
start(DishesFragment.newInstance());
break;
default:
......
......@@ -655,7 +655,7 @@ public class BuyIngredientsFragment extends BaseSupplyChainFragment<BuyIngredien
* @param beforeNum 改变之前的数量
* @param currentNum 改变之后的数量
*/
private void foodNumberChanger(PurchaseFoodBean purchaseFoodBean, int parentCategoryIndex, int beforeNum, int currentNum) {
private void foodNumberChanger(PurchaseFoodBean purchaseFoodBean, int parentCategoryIndex, double beforeNum, double currentNum) {
BuyIngredientsBean firstCategory = mPresenter.getFirstCategoryByIndex(parentCategoryIndex);
if (firstCategory != null) {
int firstCategoryByIndex = firstLevelCategoryAdapter.getItemPosition(new OrderCategoryBean.FoodCategoryTrees(firstCategory.id, firstCategory.categoryName, firstCategory.parentId));
......
......@@ -667,7 +667,7 @@ public class OtherFunctionFragment extends BaseSupplyChainFragment<OtherFunction
* @param beforeNum 改变之前的数量
* @param currentNum 改变之后的数量
*/
private void foodNumberChanger(PurchaseFoodBean purchaseFoodBean, int parentCategoryIndex, int beforeNum, int currentNum) {
private void foodNumberChanger(PurchaseFoodBean purchaseFoodBean, int parentCategoryIndex, double beforeNum, double currentNum) {
BuyIngredientsBean firstCategory = mPresenter.getFirstCategoryByIndex(parentCategoryIndex);
if (firstCategory != null) {
int firstCategoryByIndex = firstLevelCategoryAdapter.getItemPosition(new OrderCategoryBean.FoodCategoryTrees(firstCategory.id, firstCategory.categoryName, firstCategory.parentId));
......
......@@ -156,7 +156,7 @@ public class GoodsDetailsPopup extends CenterPopupView {
});
}
private int hasFocusNum;
private double hasFocusNum;
public GoodsDetailsPopup setEditNumber(boolean editNumber) {
isEditNumber = editNumber;
......@@ -186,7 +186,7 @@ public class GoodsDetailsPopup extends CenterPopupView {
public void setLongClick(boolean addOrSub) {
//開啟線程
ThreadPoolManager.getInstence().putExecutableTasks(() -> {
int number = purchaseFoodBean.getFoodQuantity();
double number = purchaseFoodBean.getFoodQuantity();
delayTime = PurchaseConstant.LONG_CLICK_INIT_TIME;
if (addOrSub) {
//+
......@@ -228,7 +228,7 @@ public class GoodsDetailsPopup extends CenterPopupView {
});
}
private void foodNumberChange(int changeNum) {
private void foodNumberChange(double changeNum) {
if (changeNum == 0) {
return;
}
......
......@@ -54,7 +54,7 @@
android:textColor="@color/color_18"
android:background="@drawable/shape_border_bg_c8"
android:gravity="center"
android:inputType="numberDecimal"
android:inputType="numberDecimal|number"
android:maxLines="1"
android:textColorHighlight="@color/theme_color"
android:textCursorDrawable="@drawable/cursor_theme"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment