Commit 2a495b3e by Wyh

1、PRJ打印顯示不完全問題修改

2、供應鏈代碼
parent 90f41b1d
...@@ -28,7 +28,7 @@ class HistoryFragment : BaseFragment(R.layout.fragment_other_order) { ...@@ -28,7 +28,7 @@ class HistoryFragment : BaseFragment(R.layout.fragment_other_order) {
override fun onActivityCreated(savedInstanceState: Bundle?) { override fun onActivityCreated(savedInstanceState: Bundle?) {
super.onActivityCreated(savedInstanceState) super.onActivityCreated(savedInstanceState)
viewModel = ViewModelProvider(activity!!.viewModelStore, InjectorUtil.getHistoryModelFactory())[HistoryOrderViewModel::class.java].apply { viewModel = ViewModelProvider(requireActivity().viewModelStore, InjectorUtil.getHistoryModelFactory())[HistoryOrderViewModel::class.java].apply {
historyData.observe(viewLifecycleOwner, Observer{ it -> historyData.observe(viewLifecycleOwner, Observer{ it ->
cancelDialogForLoading() cancelDialogForLoading()
refresh_layout.finishRefresh() refresh_layout.finishRefresh()
......
...@@ -18,7 +18,7 @@ import com.gingersoft.gsa.cloud.print.bean.PrjBean; ...@@ -18,7 +18,7 @@ import com.gingersoft.gsa.cloud.print.bean.PrjBean;
import com.joe.print.mvp.model.bean.HtmlLable; import com.joe.print.mvp.model.bean.HtmlLable;
import com.joe.print.mvp.print.common.HtmlContract; import com.joe.print.mvp.print.common.HtmlContract;
import com.joe.print.R; import com.joe.print.R;
import com.joe.print.mvp.ui.adapter.KitChenPrjPrintFoodAdapter; import com.joe.print.mvp.ui.view.KitChenPrjFoodView;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
...@@ -265,16 +265,18 @@ public class PrintPrjKitchen extends PrinterRoot { ...@@ -265,16 +265,18 @@ public class PrintPrjKitchen extends PrinterRoot {
TextView tvPeople = view.findViewById(R.id.tv_people); TextView tvPeople = view.findViewById(R.id.tv_people);
TextView tvOperator = view.findViewById(R.id.tv_operator); TextView tvOperator = view.findViewById(R.id.tv_operator);
TextView tvCurrentPageIndex = view.findViewById(R.id.tv_prj_page_index); TextView tvCurrentPageIndex = view.findViewById(R.id.tv_prj_page_index);
RecyclerView rvFood = view.findViewById(R.id.rv_kitchen_food); // RecyclerView rvFood = view.findViewById(R.id.rv_kitchen_food);
LinearLayout foodLayout = view.findViewById(R.id.layout_kitchen_food);
TextView tvTableNumber2 = view.findViewById(R.id.tv_kitchen_print_table_number2); TextView tvTableNumber2 = view.findViewById(R.id.tv_kitchen_print_table_number2);
TextView tvFirstOrder = view.findViewById(R.id.tv_kitchen_print_first_order); TextView tvFirstOrder = view.findViewById(R.id.tv_kitchen_print_first_order);
TextView tvPrintQuantity = view.findViewById(R.id.tv_kitchen_print_quantity); TextView tvPrintQuantity = view.findViewById(R.id.tv_kitchen_print_quantity);
LinearLayout layoutOpenTableTime = view.findViewById(R.id.layout_opening_table_time); LinearLayout layoutOpenTableTime = view.findViewById(R.id.layout_opening_table_time);
KitChenPrjPrintFoodAdapter foodAdapter = new KitChenPrjPrintFoodAdapter(data, printerDeviceBean); foodLayout.addView(new KitChenPrjFoodView(context, data, printerDeviceBean));
rvFood.setLayoutManager(new LinearLayoutManager(context)); // KitChenPrjPrintFoodAdapter foodAdapter = new KitChenPrjPrintFoodAdapter(data, printerDeviceBean);
rvFood.setAdapter(foodAdapter); // rvFood.setLayoutManager(new LinearLayoutManager(context));
// rvFood.setAdapter(foodAdapter);
//廚房位置 //廚房位置
if (!TextUtil.isEmptyOrNullOrUndefined(key) && !key.equals("-1")) { if (!TextUtil.isEmptyOrNullOrUndefined(key) && !key.equals("-1")) {
tvKitChenLocation.setText(key + "廚房");//.replace("*", "") tvKitChenLocation.setText(key + "廚房");//.replace("*", "")
......
...@@ -52,12 +52,12 @@ public class KitChenPrjPrintFoodAdapter extends BaseQuickAdapter<PrjBean.DataBea ...@@ -52,12 +52,12 @@ public class KitChenPrjPrintFoodAdapter extends BaseQuickAdapter<PrjBean.DataBea
if (languageType.contains(".")) { if (languageType.contains(".")) {
languageType = type.substring(0, type.indexOf(".")); languageType = type.substring(0, type.indexOf("."));
} }
if (languageType.equals("2")) { if (languageType.equals(PrinterDeviceBean.LANGUAGE_TWO)) {
//語言二 //語言二
if (TextUtil.isNotEmptyOrNullOrUndefined(item.getProductName2())) { if (TextUtil.isNotEmptyOrNullOrUndefined(item.getProductName2())) {
layout.addView(getOtherLanguageView(helper.getAdapterPosition(), item.getItemType(), item.getProductName2(), item.getNumber())); layout.addView(getOtherLanguageView(helper.getAdapterPosition(), item.getItemType(), item.getProductName2(), item.getNumber()));
} }
} else if (languageType.equals("3")) { } else if (languageType.equals(PrinterDeviceBean.LANGUAGE_THREE)) {
//語言三 //語言三
if (TextUtil.isNotEmptyOrNullOrUndefined(item.getProductName3())) { if (TextUtil.isNotEmptyOrNullOrUndefined(item.getProductName3())) {
layout.addView(getOtherLanguageView(helper.getAdapterPosition(), item.getItemType(), item.getProductName3(), item.getNumber())); layout.addView(getOtherLanguageView(helper.getAdapterPosition(), item.getItemType(), item.getProductName3(), item.getNumber()));
......
package com.joe.print.mvp.ui.view;
import android.content.Context;
import android.graphics.Typeface;
import android.util.AttributeSet;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.annotation.Nullable;
import com.gingersoft.gsa.cloud.common.utils.other.TextUtil;
import com.gingersoft.gsa.cloud.database.bean.PrinterDeviceBean;
import com.gingersoft.gsa.cloud.print.bean.PrjBean;
import com.joe.print.R;
import java.math.BigDecimal;
import java.util.List;
/**
* @author 宇航.
* User: admin
* Date: 2021/1/20
* Time: 14:45
* Use:
*/
public class KitChenPrjFoodView extends LinearLayout {
private int indentation = 0;
private int foodFontSize = 24;
private int modifierFontSize = 24;
private int foodIsBold;
private int modifierIsBold;
private int foodIsItalic;
private int modifierIsItalic;
private String[] languageTypes;
private List<PrjBean.DataBean.Bean> data;
public KitChenPrjFoodView(Context context, @Nullable List<PrjBean.DataBean.Bean> data, PrinterDeviceBean printerDeviceBean) {
super(context);
try {
this.foodFontSize = Integer.parseInt(printerDeviceBean.getFoodFont()) * 2;
this.modifierFontSize = Integer.parseInt(printerDeviceBean.getModifierFont()) * 2;
} catch (NumberFormatException e) {
e.printStackTrace();
}
this.foodIsBold = printerDeviceBean.getFoodIsBold();
this.modifierIsBold = printerDeviceBean.getModifierIsBold();
this.foodIsItalic = printerDeviceBean.getFoodIsItalic();
this.modifierIsItalic = printerDeviceBean.getModifierIsItalic();
this.data = data;
languageTypes = printerDeviceBean.getLanguageType().split(",");
init();
}
private void init() {
for (PrjBean.DataBean.Bean item : data) {
View view = View.inflate(getContext(), R.layout.print_kitchen_item_parent, null);
LinearLayout layout = view.findViewById(R.id.layout_print_kitchen_parent);
for (String type : languageTypes) {
String languageType = type;
if (languageType.contains(".")) {
languageType = type.substring(0, type.indexOf("."));
}
if (languageType.equals(PrinterDeviceBean.LANGUAGE_TWO)) {
//語言二
if (TextUtil.isNotEmptyOrNullOrUndefined(item.getProductName2())) {
layout.addView(getOtherLanguageView(item.getItemType(), item.getProductName2(), item.getNumber()));
}
} else if (languageType.equals(PrinterDeviceBean.LANGUAGE_THREE)) {
//語言三
if (TextUtil.isNotEmptyOrNullOrUndefined(item.getProductName3())) {
layout.addView(getOtherLanguageView(item.getItemType(), item.getProductName3(), item.getNumber()));
}
} else {
//語言一或其他
if (TextUtil.isNotEmptyOrNullOrUndefined(item.getProductName())) {
layout.addView(getOtherLanguageView(item.getItemType(), item.getProductName(), item.getNumber()));
}
}
}
}
}
private View getOtherLanguageView(int itemType, String foodName, int foodNumber) {
View view = View.inflate(getContext(), R.layout.print_kitchen_item_food, null);
TextView tvFoodName = view.findViewById(R.id.tv_food_name);
TextView tvFoodNum = view.findViewById(R.id.tv_food_number);
if (indentation == 0) {
//只第一次測量一下
indentation = BigDecimal.valueOf(tvFoodName.getPaint().measureText("哈")).setScale(0, BigDecimal.ROUND_HALF_UP).intValue();
}
boolean isBold, isItalic;
int paddingLeft;
if (itemType == PrjBean.DataBean.Bean.FOOD_SECONDARY) {
//細項,縮進
paddingLeft = indentation;
tvFoodName.setTextSize(modifierFontSize);
tvFoodNum.setTextSize(modifierFontSize);
isBold = modifierIsBold == 1;
isItalic = modifierIsItalic == 1;
} else if (itemType == PrjBean.DataBean.Bean.FOOD_THREE_LEVEL) {
//細項,縮進
paddingLeft = indentation * 2;
tvFoodName.setTextSize(modifierFontSize);
tvFoodNum.setTextSize(modifierFontSize);
isBold = modifierIsBold == 1;
isItalic = modifierIsItalic == 1;
} else {
paddingLeft = 0;
tvFoodName.setTextSize(foodFontSize);
tvFoodNum.setTextSize(foodFontSize);
isBold = foodIsBold == 1;
isItalic = foodIsItalic == 1;
}
tvFoodName.setPadding(paddingLeft, tvFoodName.getPaddingTop(), tvFoodName.getPaddingRight(), tvFoodName.getPaddingBottom());
tvFoodNum.setText(String.valueOf(foodNumber));
tvFoodName.setText(foodName);
if (isBold && isItalic) {
tvFoodName.setTypeface(null, Typeface.BOLD_ITALIC);
tvFoodNum.setTypeface(null, Typeface.BOLD_ITALIC);
} else if (isBold) {
tvFoodName.setTypeface(null, Typeface.BOLD);
tvFoodNum.setTypeface(null, Typeface.BOLD);
} else if (isItalic) {
tvFoodName.setTypeface(null, Typeface.ITALIC);
tvFoodNum.setTypeface(null, Typeface.ITALIC);
} else {
tvFoodName.setTypeface(null, Typeface.NORMAL);
tvFoodNum.setTypeface(null, Typeface.NORMAL);
}
return view;
}
}
...@@ -17,6 +17,7 @@ import lombok.Data; ...@@ -17,6 +17,7 @@ import lombok.Data;
@Data @Data
public class PurchaseFoodBean implements Serializable { public class PurchaseFoodBean implements Serializable {
private static final long serialVersionUID = 7084280906070243339L; private static final long serialVersionUID = 7084280906070243339L;
public static final String CATEGORY_DIVIDER = "-";
private int id; private int id;
private String supplierName; private String supplierName;
private String images; private String images;
...@@ -25,7 +26,7 @@ public class PurchaseFoodBean implements Serializable { ...@@ -25,7 +26,7 @@ public class PurchaseFoodBean implements Serializable {
/** /**
* 單價 * 單價
*/ */
private double unitPrice; private Double unitPrice;
/** /**
* 分類名 * 分類名
*/ */
......
package com.gingersoft.supply_chain.mvp.bean; package com.gingersoft.supply_chain.mvp.bean;
import com.gingersoft.supply_chain.R;
import java.util.List; import java.util.List;
import lombok.Data; import lombok.Data;
...@@ -42,6 +44,7 @@ public class PurchaseOrderDetailsBean { ...@@ -42,6 +44,7 @@ public class PurchaseOrderDetailsBean {
public static final int ALL = 0; public static final int ALL = 0;
private static String[] states = new String[]{"", "待收貨", "部分收貨", "已完成", "拒收"}; private static String[] states = new String[]{"", "待收貨", "部分收貨", "已完成", "拒收"};
private static int[] colors = new int[]{R.color.color_3c, R.color.order_state0_color, R.color.order_state5_color, R.color.brick_red, R.color.red};
public static String getStringByOrderState(int state) { public static String getStringByOrderState(int state) {
if (state < 0 || state > states.length) { if (state < 0 || state > states.length) {
...@@ -50,10 +53,28 @@ public class PurchaseOrderDetailsBean { ...@@ -50,10 +53,28 @@ public class PurchaseOrderDetailsBean {
return states[state]; return states[state];
} }
public static int getColorByOrderState(int state) {
if (state < 0 || state > colors.length) {
return colors[0];
}
return colors[state];
}
/**
* 待收貨
*/
public static final int WAIT_RECEIVED = 1; public static final int WAIT_RECEIVED = 1;
/**
* 部分收貨
*/
public static final int PART_RECEIVED = 2; public static final int PART_RECEIVED = 2;
/**
* 全部收貨
*/
public static final int COMPLETE_RECEIVED = 3; public static final int COMPLETE_RECEIVED = 3;
/**
* 拒收
*/
public static final int REFUSE_RECEIVED = 4; public static final int REFUSE_RECEIVED = 4;
private String supplierName; private String supplierName;
......
...@@ -9,7 +9,7 @@ package com.gingersoft.supply_chain.mvp.bean; ...@@ -9,7 +9,7 @@ package com.gingersoft.supply_chain.mvp.bean;
*/ */
public class WareHousingUnitBean { public class WareHousingUnitBean {
private int id; private Integer id;
/** /**
* 入庫單詳情id * 入庫單詳情id
*/ */
......
...@@ -33,6 +33,8 @@ public interface SupplierListContract { ...@@ -33,6 +33,8 @@ public interface SupplierListContract {
void deleteSuccess(int position); void deleteSuccess(int position);
void loadError(); void loadError();
void setSelectIndex(int index);
} }
//Model层定义接口,外部只需关心Model返回的数据,无需关心内部细节,即是否使用缓存 //Model层定义接口,外部只需关心Model返回的数据,无需关心内部细节,即是否使用缓存
......
...@@ -107,8 +107,8 @@ public class FoodUnitPagePresenter extends BasePresenter<FoodUnitPageContract.Mo ...@@ -107,8 +107,8 @@ public class FoodUnitPagePresenter extends BasePresenter<FoodUnitPageContract.Mo
deputyUnitBeans = CollectionUtils.deepCopy(afterDeputyUnits); deputyUnitBeans = CollectionUtils.deepCopy(afterDeputyUnits);
foodId = arguments.getInt(FoodUnitPageFragment.FOOD_ID_KEY); foodId = arguments.getInt(FoodUnitPageFragment.FOOD_ID_KEY);
isUpdate = arguments.getBoolean(FoodUnitPageFragment.UPDATE_UNIT_KEY); isUpdate = arguments.getBoolean(FoodUnitPageFragment.UPDATE_UNIT_KEY);
if (isUpdate) {
mRootView.setMainUnit(basicUnitName); mRootView.setMainUnit(basicUnitName);
if (isUpdate) {
mRootView.initTopBar("編輯商品單位"); mRootView.initTopBar("編輯商品單位");
} else { } else {
mRootView.initTopBar("填寫商品單位"); mRootView.initTopBar("填寫商品單位");
...@@ -248,8 +248,16 @@ public class FoodUnitPagePresenter extends BasePresenter<FoodUnitPageContract.Mo ...@@ -248,8 +248,16 @@ public class FoodUnitPagePresenter extends BasePresenter<FoodUnitPageContract.Mo
/** /**
* 添加基本單位-快捷輸入 * 添加基本單位-快捷輸入
* @param content 新增的基本單位
* @param basicUnitBeans 已有的基本單位——需要判斷是否已經存在了
*/ */
public void addBasicUnit(String content) { public void addBasicUnit(String content, List<BasicUnitBean> basicUnitBeans) {
for (BasicUnitBean basicUnitBean : basicUnitBeans) {
if(basicUnitBean.getContent().equals(content)){
mRootView.showMessage("此單位已存在,不能重複添加");
return;
}
}
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
try { try {
jsonObject.put("content", content); jsonObject.put("content", content);
......
...@@ -3,12 +3,14 @@ package com.gingersoft.supply_chain.mvp.presenter; ...@@ -3,12 +3,14 @@ package com.gingersoft.supply_chain.mvp.presenter;
import android.app.Application; import android.app.Application;
import android.content.Context; import android.content.Context;
import android.text.InputFilter; import android.text.InputFilter;
import android.text.InputType;
import android.view.inputmethod.EditorInfo; import android.view.inputmethod.EditorInfo;
import com.gingersoft.gsa.cloud.common.bean.BaseResult; import com.gingersoft.gsa.cloud.common.bean.BaseResult;
import com.gingersoft.gsa.cloud.common.core.restaurant.RestaurantInfoManager; import com.gingersoft.gsa.cloud.common.core.restaurant.RestaurantInfoManager;
import com.gingersoft.gsa.cloud.common.utils.JsonUtils; import com.gingersoft.gsa.cloud.common.utils.JsonUtils;
import com.gingersoft.gsa.cloud.common.utils.gson.GsonUtils; import com.gingersoft.gsa.cloud.common.utils.gson.GsonUtils;
import com.gingersoft.gsa.cloud.common.utils.inputFilter.DecimalDigitsInputFilter;
import com.gingersoft.gsa.cloud.common.utils.inputFilter.InputFilterUtils; import com.gingersoft.gsa.cloud.common.utils.inputFilter.InputFilterUtils;
import com.gingersoft.gsa.cloud.common.utils.other.TextUtil; import com.gingersoft.gsa.cloud.common.utils.other.TextUtil;
import com.gingersoft.gsa.cloud.common.utils.view.BitmapUtil; import com.gingersoft.gsa.cloud.common.utils.view.BitmapUtil;
...@@ -115,6 +117,10 @@ public class NewFoodIngredientsPresenter extends BasePresenter<NewFoodIngredient ...@@ -115,6 +117,10 @@ public class NewFoodIngredientsPresenter extends BasePresenter<NewFoodIngredient
* 如果是修改食材,則不為空 * 如果是修改食材,則不為空
*/ */
private PurchaseFoodBean purchaseFoodBean; private PurchaseFoodBean purchaseFoodBean;
/**
* 分類名:一級,二級,三級
*/
private List<String> categoryNames;
@Inject @Inject
public NewFoodIngredientsPresenter(NewFoodIngredientsContract.Model model, NewFoodIngredientsContract.View rootView) { public NewFoodIngredientsPresenter(NewFoodIngredientsContract.Model model, NewFoodIngredientsContract.View rootView) {
...@@ -134,6 +140,10 @@ public class NewFoodIngredientsPresenter extends BasePresenter<NewFoodIngredient ...@@ -134,6 +140,10 @@ public class NewFoodIngredientsPresenter extends BasePresenter<NewFoodIngredient
this.purchaseFoodBean = purchaseFoodBean; this.purchaseFoodBean = purchaseFoodBean;
} }
public void setCategoryNames(List<String> categoryNames) {
this.categoryNames = categoryNames;
}
/** /**
* 獲取食材詳情 * 獲取食材詳情
*/ */
...@@ -187,7 +197,7 @@ public class NewFoodIngredientsPresenter extends BasePresenter<NewFoodIngredient ...@@ -187,7 +197,7 @@ public class NewFoodIngredientsPresenter extends BasePresenter<NewFoodIngredient
infoMultiBeans.add(new MultiSelectBean(InfoMultiBean.EDIT_FOOD_ITEM_SELECT, "基本單位", false, "請選擇食材單位", SELECT_PACKAGE_SPECIFICATION_REQUEST_CODE, FoodUnitPageFragment.class)); infoMultiBeans.add(new MultiSelectBean(InfoMultiBean.EDIT_FOOD_ITEM_SELECT, "基本單位", false, "請選擇食材單位", SELECT_PACKAGE_SPECIFICATION_REQUEST_CODE, FoodUnitPageFragment.class));
infoMultiBeans.add(new MultiInputBean(InfoMultiBean.ITEM_TYPE_INPUT, "包裝說明", false, "請輸入包裝說明")); infoMultiBeans.add(new MultiInputBean(InfoMultiBean.ITEM_TYPE_INPUT, "包裝說明", false, "請輸入包裝說明"));
infoMultiBeans.add(new MultiInputBean(InfoMultiBean.ITEM_TYPE_INPUT, "食材編號", false, "請輸入食材編號")); infoMultiBeans.add(new MultiInputBean(InfoMultiBean.ITEM_TYPE_INPUT, "食材編號", false, "請輸入食材編號"));
infoMultiBeans.add(new MultiInputBean(InfoMultiBean.ITEM_TYPE_INPUT, "單價($)", false, "請輸入數字,保留2位小數", "0")); infoMultiBeans.add(new MultiInputBean(InfoMultiBean.ITEM_TYPE_INPUT, "單價($)", false, "請輸入單價,保留2位小數", new InputFilter[]{InputFilterUtils.getLengthFilter(context, 9), new DecimalDigitsInputFilter(context, 2)}, InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_FLAG_DECIMAL));
infoMultiBeans.add(new InfoMultiBean(InfoMultiBean.ITEM_TYPE_LINE)); infoMultiBeans.add(new InfoMultiBean(InfoMultiBean.ITEM_TYPE_LINE));
infoMultiBeans.add(new InfoMultiBean(InfoMultiBean.ITEM_TYPE_TITLE, "庫存預警")); infoMultiBeans.add(new InfoMultiBean(InfoMultiBean.ITEM_TYPE_TITLE, "庫存預警"));
infoMultiBeans.add(new InfoMultiBean(InfoMultiBean.ITEM_MULTIPLE_BOOLEAN, "是否審核", false, "請輸入單位")); infoMultiBeans.add(new InfoMultiBean(InfoMultiBean.ITEM_MULTIPLE_BOOLEAN, "是否審核", false, "請輸入單位"));
...@@ -203,7 +213,11 @@ public class NewFoodIngredientsPresenter extends BasePresenter<NewFoodIngredient ...@@ -203,7 +213,11 @@ public class NewFoodIngredientsPresenter extends BasePresenter<NewFoodIngredient
//食品名稱 //食品名稱
infoMultiBeans.get(foodNameIndex).setShowValue(purchaseFoodBean.getName()); infoMultiBeans.get(foodNameIndex).setShowValue(purchaseFoodBean.getName());
//食品分類 //食品分類
if (categoryNames != null && categoryNames.size() > 0) {
categoryName = categoryNames.get(categoryNames.size() - 1);
} else {
categoryName = purchaseFoodBean.getFoodCategoryName(); categoryName = purchaseFoodBean.getFoodCategoryName();
}
infoMultiBeans.get(foodIngredientCategoryIndex).setShowValue(purchaseFoodBean.getFoodCategoryName()); infoMultiBeans.get(foodIngredientCategoryIndex).setShowValue(purchaseFoodBean.getFoodCategoryName());
//基本單位 //基本單位
infoMultiBeans.get(basicUnitIndex).setShowValue(purchaseFoodBean.getBasicUnitName()); infoMultiBeans.get(basicUnitIndex).setShowValue(purchaseFoodBean.getBasicUnitName());
...@@ -212,7 +226,9 @@ public class NewFoodIngredientsPresenter extends BasePresenter<NewFoodIngredient ...@@ -212,7 +226,9 @@ public class NewFoodIngredientsPresenter extends BasePresenter<NewFoodIngredient
//食品編號 //食品編號
infoMultiBeans.get(foodNoIndex).setShowValue(purchaseFoodBean.getFoodNo()); infoMultiBeans.get(foodNoIndex).setShowValue(purchaseFoodBean.getFoodNo());
//單價 //單價
if (purchaseFoodBean.getUnitPrice() != null) {
infoMultiBeans.get(foodIngredientPriceIndex).setShowValue(purchaseFoodBean.getUnitPrice() + ""); infoMultiBeans.get(foodIngredientPriceIndex).setShowValue(purchaseFoodBean.getUnitPrice() + "");
}
//預警 //預警
PurchaseFoodBean.InventoryAlarm inventoryAlarm = purchaseFoodBean.getInventoryAlarm(); PurchaseFoodBean.InventoryAlarm inventoryAlarm = purchaseFoodBean.getInventoryAlarm();
if (inventoryAlarm != null) { if (inventoryAlarm != null) {
...@@ -282,12 +298,18 @@ public class NewFoodIngredientsPresenter extends BasePresenter<NewFoodIngredient ...@@ -282,12 +298,18 @@ public class NewFoodIngredientsPresenter extends BasePresenter<NewFoodIngredient
public void setCategoryInfo(List<SectionCheckItem> sectionCheckItems, List<InfoMultiBean> infoMultiBeans) { public void setCategoryInfo(List<SectionCheckItem> sectionCheckItems, List<InfoMultiBean> infoMultiBeans) {
StringBuilder categoryName = new StringBuilder(); StringBuilder categoryName = new StringBuilder();
if(categoryNames == null){
categoryNames = new ArrayList<>();
}
categoryNames.clear();
for (SectionCheckItem sectionCheckItem : sectionCheckItems) { for (SectionCheckItem sectionCheckItem : sectionCheckItems) {
categoryNames.add(sectionCheckItem.getText());
categoryName.append(sectionCheckItem.getText()) categoryName.append(sectionCheckItem.getText())
.append("-"); .append(PurchaseFoodBean.CATEGORY_DIVIDER);
} }
this.categoryName = sectionCheckItems.get(sectionCheckItems.size() - 1).getText(); this.categoryName = sectionCheckItems.get(sectionCheckItems.size() - 1).getText();
categoryName.deleteCharAt(categoryName.lastIndexOf("-")); categoryName.deleteCharAt(categoryName.lastIndexOf(PurchaseFoodBean.CATEGORY_DIVIDER));
infoMultiBeans.get(foodIngredientCategoryIndex).setShowValue(categoryName.toString()); infoMultiBeans.get(foodIngredientCategoryIndex).setShowValue(categoryName.toString());
mRootView.refreshAdapterByPosition(foodIngredientCategoryIndex); mRootView.refreshAdapterByPosition(foodIngredientCategoryIndex);
} }
...@@ -415,7 +437,12 @@ public class NewFoodIngredientsPresenter extends BasePresenter<NewFoodIngredient ...@@ -415,7 +437,12 @@ public class NewFoodIngredientsPresenter extends BasePresenter<NewFoodIngredient
//食材編號 //食材編號
purchaseFoodBean.setFoodNo(infoMultiBeans.get(foodNoIndex).getShowValue()); purchaseFoodBean.setFoodNo(infoMultiBeans.get(foodNoIndex).getShowValue());
//單價 //單價
purchaseFoodBean.setUnitPrice(Double.parseDouble(infoMultiBeans.get(foodIngredientPriceIndex).getShowValue())); String unitPriceStr = infoMultiBeans.get(foodIngredientPriceIndex).getShowValue();
if (TextUtil.isNotEmptyOrNullOrUndefined(unitPriceStr)) {
purchaseFoodBean.setUnitPrice(Double.parseDouble(unitPriceStr));
} else {
purchaseFoodBean.setUnitPrice(0d);
}
//庫存預警 //庫存預警
//是否修改了庫存預警,如果沒修過,就不傳遞給後台 //是否修改了庫存預警,如果沒修過,就不傳遞給後台
boolean isUpdateAlarm = false; boolean isUpdateAlarm = false;
......
...@@ -15,6 +15,7 @@ import com.gingersoft.gsa.cloud.common.utils.other.TextUtil; ...@@ -15,6 +15,7 @@ import com.gingersoft.gsa.cloud.common.utils.other.TextUtil;
import com.gingersoft.gsa.cloud.ui.adapter.bean.InfoMultiBean; import com.gingersoft.gsa.cloud.ui.adapter.bean.InfoMultiBean;
import com.gingersoft.gsa.cloud.ui.adapter.bean.MultiCheckInputBean; import com.gingersoft.gsa.cloud.ui.adapter.bean.MultiCheckInputBean;
import com.gingersoft.gsa.cloud.ui.adapter.bean.MultiInputBean; import com.gingersoft.gsa.cloud.ui.adapter.bean.MultiInputBean;
import com.gingersoft.gsa.cloud.ui.adapter.bean.MultiSelectBean;
import com.gingersoft.gsa.cloud.ui.adapter.multi.InfoMultiAdapter; import com.gingersoft.gsa.cloud.ui.adapter.multi.InfoMultiAdapter;
import com.gingersoft.gsa.cloud.ui.adapter.multi.RemarkProvider; import com.gingersoft.gsa.cloud.ui.adapter.multi.RemarkProvider;
import com.gingersoft.supply_chain.R; import com.gingersoft.supply_chain.R;
...@@ -199,7 +200,7 @@ public class NewSupplierPresenter extends BasePresenter<NewSupplierContract.Mode ...@@ -199,7 +200,7 @@ public class NewSupplierPresenter extends BasePresenter<NewSupplierContract.Mode
} }
//供應商聯繫方式不是在這個接口修改,就不傳到後台去了 //供應商聯繫方式不是在這個接口修改,就不傳到後台去了
supplierInfoBean.setSupplierContacts(null); supplierInfoBean.setSupplierContacts(null);
//修改供應商聯繫方式 //修改供應商聯繫方式單獨在這個接口
updateSupplierContact(); updateSupplierContact();
if (supplierName.equals(supplierInfoBean.getSupplierName())) { if (supplierName.equals(supplierInfoBean.getSupplierName())) {
supplierInfoBean.setSupplierName(null); supplierInfoBean.setSupplierName(null);
...@@ -309,7 +310,7 @@ public class NewSupplierPresenter extends BasePresenter<NewSupplierContract.Mode ...@@ -309,7 +310,7 @@ public class NewSupplierPresenter extends BasePresenter<NewSupplierContract.Mode
if (supplierContacts != null) { if (supplierContacts != null) {
//如果這個供應商之前有聯繫方式,則需要拿現在的聯繫方式和之前的進行對比,哪些有修改 //如果這個供應商之前有聯繫方式,則需要拿現在的聯繫方式和之前的進行對比,哪些有修改
Iterator<SupplierInfoBean.SupplierContacts> iterator = contacts.iterator(); Iterator<SupplierInfoBean.SupplierContacts> iterator = contacts.iterator();
while (iterator.hasNext()){ while (iterator.hasNext()) {
boolean afterHasThisContact = false; boolean afterHasThisContact = false;
SupplierInfoBean.SupplierContacts nextContact = iterator.next(); SupplierInfoBean.SupplierContacts nextContact = iterator.next();
for (SupplierInfoBean.SupplierContacts supplierContact : supplierContacts) { for (SupplierInfoBean.SupplierContacts supplierContact : supplierContacts) {
...@@ -319,11 +320,13 @@ public class NewSupplierPresenter extends BasePresenter<NewSupplierContract.Mode ...@@ -319,11 +320,13 @@ public class NewSupplierPresenter extends BasePresenter<NewSupplierContract.Mode
break; break;
} }
} }
if (!afterHasThisContact && TextUtil.isEmptyOrNullOrUndefined(nextContact.getConfigText())) { if (!afterHasThisContact) {
//之前沒有這個聯繫方式,如果這個聯繫方式是空的,就移除掉 if (!nextContact.isDefault() && TextUtil.isEmptyOrNullOrUndefined(nextContact.getConfigText())) {
//之前沒有這個聯繫方式,並且不是默認的,如果這個聯繫方式是空的,就移除掉
iterator.remove(); iterator.remove();
} }
} }
}
} else { } else {
deleteNullContact(contacts); deleteNullContact(contacts);
} }
...@@ -444,14 +447,19 @@ public class NewSupplierPresenter extends BasePresenter<NewSupplierContract.Mode ...@@ -444,14 +447,19 @@ public class NewSupplierPresenter extends BasePresenter<NewSupplierContract.Mode
} }
private void deleteNullContact(List<SupplierInfoBean.SupplierContacts> contacts) { private void deleteNullContact(List<SupplierInfoBean.SupplierContacts> contacts) {
if (contacts != null) {
Iterator<SupplierInfoBean.SupplierContacts> iterator = contacts.iterator(); Iterator<SupplierInfoBean.SupplierContacts> iterator = contacts.iterator();
while (iterator.hasNext()){ while (iterator.hasNext()) {
if (TextUtil.isEmptyOrNullOrUndefined(iterator.next().getConfigText())) { SupplierInfoBean.SupplierContacts nextContact = iterator.next();
if (!nextContact.isDefault()) {
if (TextUtil.isEmptyOrNullOrUndefined(nextContact.getConfigText())) {
//如果聯繫方式的內容是空的,則需要去掉 //如果聯繫方式的內容是空的,則需要去掉
iterator.remove(); iterator.remove();
} }
} }
} }
}
}
/** /**
* 獲取聯繫方式 * 獲取聯繫方式
...@@ -472,14 +480,36 @@ public class NewSupplierPresenter extends BasePresenter<NewSupplierContract.Mode ...@@ -472,14 +480,36 @@ public class NewSupplierPresenter extends BasePresenter<NewSupplierContract.Mode
contacts.add(new SupplierInfoBean.SupplierContacts(email, Email, multiCheckInputBean.isDefault())); contacts.add(new SupplierInfoBean.SupplierContacts(email, Email, multiCheckInputBean.isDefault()));
} }
} else { } else {
if (multiCheckInputBean.isDefault()) {
mRootView.showMessage("請輸入郵箱地址");
return null;
} else {
contacts.add(new SupplierInfoBean.SupplierContacts(email, Email, multiCheckInputBean.isDefault())); contacts.add(new SupplierInfoBean.SupplierContacts(email, Email, multiCheckInputBean.isDefault()));
} }
} }
}
addContacts(contacts, data, WhatsAppIndex, Whatsapp); addContacts(contacts, data, WhatsAppIndex, Whatsapp);
addContacts(contacts, data, weChatIndex, WeChat); addContacts(contacts, data, weChatIndex, WeChat);
addContacts(contacts, data, lineIndex, Line); addContacts(contacts, data, lineIndex, Line);
addContacts(contacts, data, kakaoIndex, Kakao_Talk); addContacts(contacts, data, kakaoIndex, Kakao_Talk);
InfoMultiBean smsInfoMultiBean = data.get(smsIndex);
if (smsInfoMultiBean instanceof MultiCheckInputBean) {
MultiCheckInputBean smsMultiCheckBean = (MultiCheckInputBean) smsInfoMultiBean;
if (smsMultiCheckBean.isDefault()) {
//如果設置sms是默認聯繫方式,那麼需要判斷是否輸入了內容
if (TextUtil.isNotEmptyOrNullOrUndefined(smsMultiCheckBean.getShowValue())) {
addContacts(contacts, data, smsIndex, SMS); addContacts(contacts, data, smsIndex, SMS);
} else {
mRootView.showMessage("請輸入sms");
return null;
}
} else {
addContacts(contacts, data, smsIndex, SMS);
}
} else {
addContacts(contacts, data, smsIndex, SMS);
}
if (supplierBean != null) { if (supplierBean != null) {
for (SupplierInfoBean.SupplierContacts contact : contacts) { for (SupplierInfoBean.SupplierContacts contact : contacts) {
contact.setSupplierId(supplierBean.getId()); contact.setSupplierId(supplierBean.getId());
......
...@@ -117,12 +117,21 @@ public class OrderDetailsPresenter extends BasePresenter<OrderDetailsContract.Mo ...@@ -117,12 +117,21 @@ public class OrderDetailsPresenter extends BasePresenter<OrderDetailsContract.Mo
//遍歷訂單商品 //遍歷訂單商品
for (PurchaseOrderDetailsBean.PurchaseOrderDetailsInfoVosBean purchaseOrderDetailsInfoVO : purchaseOrderDetailsInfoVos) { for (PurchaseOrderDetailsBean.PurchaseOrderDetailsInfoVosBean purchaseOrderDetailsInfoVO : purchaseOrderDetailsInfoVos) {
purchaseOrderDetailsInfoVO.setOrderNo(orderDetailsBean.getOrderNo()); purchaseOrderDetailsInfoVO.setOrderNo(orderDetailsBean.getOrderNo());
List<DeputyUnitBean> deputyUnitBeans = new ArrayList<>(); List<DeputyUnitBean> deputyUnitBeans = new ArrayList<>();
double warehousingAmount = 0;
if (purchaseOrderDetailsInfoVO.getStatus() == PurchaseOrderDetailsBean.WAIT_RECEIVED) {
//只要是待收貨的商品,都需要添加單價、主單位到副單位列表
deputyUnitBeans.add(new DeputyUnitBean("單價(HKD)", purchaseOrderDetailsInfoVO.getFoodPrice())); deputyUnitBeans.add(new DeputyUnitBean("單價(HKD)", purchaseOrderDetailsInfoVO.getFoodPrice()));
if (TextUtil.isNotEmptyOrNullOrUndefined(purchaseOrderDetailsInfoVO.getBasicUnitName())) {
deputyUnitBeans.add(new DeputyUnitBean(purchaseOrderDetailsInfoVO.getBasicUnitName(), purchaseOrderDetailsInfoVO.getFoodQuantity())); deputyUnitBeans.add(new DeputyUnitBean(purchaseOrderDetailsInfoVO.getBasicUnitName(), purchaseOrderDetailsInfoVO.getFoodQuantity()));
//入庫金額和總金額 }
purchaseOrderDetailsInfoVO.setWarehousingAmount(MoneyUtil.priceCalculation(purchaseOrderDetailsInfoVO.getFoodPrice(), purchaseOrderDetailsInfoVO.getFoodQuantity())); warehousingAmount = MoneyUtil.priceCalculation(purchaseOrderDetailsInfoVO.getFoodPrice(), purchaseOrderDetailsInfoVO.getFoodQuantity());
} else {
//如果不是待收貨的商品,入庫金額和總金額由副單位第一個值和第二個值相乘
//UI要改,先不管
}
purchaseOrderDetailsInfoVO.setWarehousingAmount(warehousingAmount);
purchaseOrderDetailsInfoVO.setTotalAmount(MoneyUtil.priceCalculation(purchaseOrderDetailsInfoVO.getFoodPrice(), purchaseOrderDetailsInfoVO.getFoodQuantity())); purchaseOrderDetailsInfoVO.setTotalAmount(MoneyUtil.priceCalculation(purchaseOrderDetailsInfoVO.getFoodPrice(), purchaseOrderDetailsInfoVO.getFoodQuantity()));
if (purchaseOrderDetailsInfoVO.getFoodUnits() != null) { if (purchaseOrderDetailsInfoVO.getFoodUnits() != null) {
...@@ -228,9 +237,12 @@ public class OrderDetailsPresenter extends BasePresenter<OrderDetailsContract.Mo ...@@ -228,9 +237,12 @@ public class OrderDetailsPresenter extends BasePresenter<OrderDetailsContract.Mo
purchaseWarehousingOrderDetail.setBasicUnitValue(deputyUnitBeans.get(1).getDeputyValue()); purchaseWarehousingOrderDetail.setBasicUnitValue(deputyUnitBeans.get(1).getDeputyValue());
//統計副單位 //統計副單位
List<WareHousingUnitBean> wareHousingUnitBeans = new ArrayList<>(); List<WareHousingUnitBean> wareHousingUnitBeans = new ArrayList<>();
for (int i = 2; i < deputyUnitBeans.size(); i++) { for (int i = 0; i < deputyUnitBeans.size(); i++) {
DeputyUnitBean deputyUnitBean = deputyUnitBeans.get(i); DeputyUnitBean deputyUnitBean = deputyUnitBeans.get(i);
WareHousingUnitBean wareHousingUnitBean = new WareHousingUnitBean(purchaseOrderDetailsInfoVosBean.getId(), deputyUnitBean.getDeputyUnit(), deputyUnitBean.getDeputyValue(), deputyUnitBean.getConversionMultiple()); WareHousingUnitBean wareHousingUnitBean = new WareHousingUnitBean(purchaseOrderDetailsInfoVosBean.getId(), deputyUnitBean.getDeputyUnit(), deputyUnitBean.getDeputyValue(), deputyUnitBean.getConversionMultiple());
if (deputyUnitBean.getId() != null) {
wareHousingUnitBean.setId(deputyUnitBean.getId());
}
wareHousingUnitBean.setBrandId(RestaurantInfoManager.newInstance().getBrandId()); wareHousingUnitBean.setBrandId(RestaurantInfoManager.newInstance().getBrandId());
wareHousingUnitBean.setRestaurantId(RestaurantInfoManager.newInstance().getRestaurantId()); wareHousingUnitBean.setRestaurantId(RestaurantInfoManager.newInstance().getRestaurantId());
wareHousingUnitBeans.add(wareHousingUnitBean); wareHousingUnitBeans.add(wareHousingUnitBean);
......
...@@ -6,6 +6,7 @@ import com.gingersoft.gsa.cloud.common.bean.BaseResult; ...@@ -6,6 +6,7 @@ import com.gingersoft.gsa.cloud.common.bean.BaseResult;
import com.gingersoft.gsa.cloud.common.utils.gson.GsonUtils; import com.gingersoft.gsa.cloud.common.utils.gson.GsonUtils;
import com.gingersoft.gsa.cloud.common.utils.other.TextUtil; import com.gingersoft.gsa.cloud.common.utils.other.TextUtil;
import com.gingersoft.supply_chain.mvp.bean.OrderBean; import com.gingersoft.supply_chain.mvp.bean.OrderBean;
import com.gingersoft.supply_chain.mvp.bean.PurchaseOrderDetailsBean;
import com.gingersoft.supply_chain.mvp.bean.PurchaseOrderResultBean; import com.gingersoft.supply_chain.mvp.bean.PurchaseOrderResultBean;
import com.gingersoft.supply_chain.mvp.content.Constant; import com.gingersoft.supply_chain.mvp.content.Constant;
import com.gingersoft.supply_chain.mvp.contract.PurchaseListContract; import com.gingersoft.supply_chain.mvp.contract.PurchaseListContract;
...@@ -30,6 +31,7 @@ import me.jessyan.rxerrorhandler.handler.ErrorHandleSubscriber; ...@@ -30,6 +31,7 @@ import me.jessyan.rxerrorhandler.handler.ErrorHandleSubscriber;
import okhttp3.MediaType; import okhttp3.MediaType;
import okhttp3.RequestBody; import okhttp3.RequestBody;
import static com.gingersoft.supply_chain.mvp.bean.PurchaseOrderDetailsBean.WAIT_RECEIVED;
import static com.gingersoft.supply_chain.mvp.content.Constant.PAGE_SIZE; import static com.gingersoft.supply_chain.mvp.content.Constant.PAGE_SIZE;
...@@ -73,8 +75,16 @@ public class PurchaseListPresenter extends BasePresenter<PurchaseListContract.Mo ...@@ -73,8 +75,16 @@ public class PurchaseListPresenter extends BasePresenter<PurchaseListContract.Mo
map.put("orderNo", orderNo); map.put("orderNo", orderNo);
} }
if (orderStatus != 0) { if (orderStatus != 0) {
if (orderStatus == PurchaseOrderDetailsBean.WAIT_RECEIVED) {
//如果是查未完成訂單,需要傳入兩個狀態,未收貨和部分收貨
List<Integer> list = new ArrayList<>();
list.add(PurchaseOrderDetailsBean.WAIT_RECEIVED);
list.add(PurchaseOrderDetailsBean.PART_RECEIVED);
map.put("status", "1,2");
} else {
map.put("status", orderStatus); map.put("status", orderStatus);
} }
}
map.put("pageIndex", pageIndex * PAGE_SIZE); map.put("pageIndex", pageIndex * PAGE_SIZE);
mModel.getOrderList(map) mModel.getOrderList(map)
.subscribeOn(Schedulers.io()) .subscribeOn(Schedulers.io())
......
...@@ -15,6 +15,8 @@ import com.jess.arms.http.imageloader.ImageLoader; ...@@ -15,6 +15,8 @@ import com.jess.arms.http.imageloader.ImageLoader;
import com.jess.arms.integration.AppManager; import com.jess.arms.integration.AppManager;
import com.jess.arms.mvp.BasePresenter; import com.jess.arms.mvp.BasePresenter;
import com.jess.arms.utils.RxLifecycleUtils; import com.jess.arms.utils.RxLifecycleUtils;
import com.xuexiang.rxutil2.rxjava.RxJavaUtils;
import com.xuexiang.rxutil2.rxjava.task.RxAsyncTask;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
...@@ -56,6 +58,7 @@ public class SupplierListPresenter extends BasePresenter<SupplierListContract.Mo ...@@ -56,6 +58,7 @@ public class SupplierListPresenter extends BasePresenter<SupplierListContract.Mo
AppManager mAppManager; AppManager mAppManager;
private List<SupplierInfoBean> supplierBeanList; private List<SupplierInfoBean> supplierBeanList;
private String supplierName;
@Inject @Inject
public SupplierListPresenter(SupplierListContract.Model model, SupplierListContract.View rootView) { public SupplierListPresenter(SupplierListContract.Model model, SupplierListContract.View rootView) {
...@@ -71,7 +74,18 @@ public class SupplierListPresenter extends BasePresenter<SupplierListContract.Mo ...@@ -71,7 +74,18 @@ public class SupplierListPresenter extends BasePresenter<SupplierListContract.Mo
this.mApplication = null; this.mApplication = null;
} }
public void getSupplierList(String content, int pageIndex) { public void setSupplierName(String supplierName) {
this.supplierName = supplierName;
}
/**
* 獲取供應商列表
*
* @param content 用於搜索的內容
* @param pageIndex 頁數
* @param needGetIndex 是否需要遍歷來獲取默認選中的供應商
*/
public void getSupplierList(String content, int pageIndex, boolean needGetIndex) {
Map<String, Object> map = new HashMap<>(5); Map<String, Object> map = new HashMap<>(5);
map.put("pageSize", Constant.PAGE_SIZE); map.put("pageSize", Constant.PAGE_SIZE);
map.put("pageIndex", pageIndex * Constant.PAGE_SIZE); map.put("pageIndex", pageIndex * Constant.PAGE_SIZE);
...@@ -104,6 +118,34 @@ public class SupplierListPresenter extends BasePresenter<SupplierListContract.Mo ...@@ -104,6 +118,34 @@ public class SupplierListPresenter extends BasePresenter<SupplierListContract.Mo
supplierBeanList.addAll(list); supplierBeanList.addAll(list);
} }
mRootView.loadSupplierList(supplierBeanList); mRootView.loadSupplierList(supplierBeanList);
if (info.getData() != null) {
if (needGetIndex && TextUtil.isNotEmptyOrNullOrUndefined(supplierName)) {
//當前頁面用於選擇,並且供應商名稱不為空,遍歷獲取默認選中的供應商
RxJavaUtils.executeAsyncTask(new RxAsyncTask<Object, Integer>(1) {
@Override
public void doInUIThread(Integer o) {
if(o != null){
mRootView.setSelectIndex(o);
}
}
@Override
public Integer doInIOThread(Object o) {
List<SupplierInfoBean> list = info.getData().getList();
if (list != null) {
int size = list.size();
for (int i = 0; i < size; i++) {
if (list.get(i).getSupplierName().equals(supplierName)) {
return supplierBeanList.size() - list.size() + i;
}
}
}
return null;
}
});
}
}
} else if (TextUtil.isNotEmptyOrNullOrUndefined(info.getErrMsg())) { } else if (TextUtil.isNotEmptyOrNullOrUndefined(info.getErrMsg())) {
mRootView.showMessage(info.getErrMsg()); mRootView.showMessage(info.getErrMsg());
} else { } else {
......
...@@ -32,6 +32,7 @@ public class OrderCategoryAdapter extends BaseQuickAdapter<OrderCategoryBean.Foo ...@@ -32,6 +32,7 @@ public class OrderCategoryAdapter extends BaseQuickAdapter<OrderCategoryBean.Foo
public static final int PRIMARY_CATEGORY = 1; public static final int PRIMARY_CATEGORY = 1;
public static final int SECOND_CATEGORY = 2; public static final int SECOND_CATEGORY = 2;
public static final int THIRD_CATEGORY = 3;
/** /**
* 當前顯示的是幾級分類 * 當前顯示的是幾級分類
*/ */
......
package com.gingersoft.supply_chain.mvp.ui.adapter; package com.gingersoft.supply_chain.mvp.ui.adapter;
import androidx.core.content.ContextCompat;
import com.chad.library.adapter.base.BaseQuickAdapter; import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder; import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.gingersoft.gsa.cloud.common.utils.MoneyUtil;
import com.gingersoft.gsa.cloud.common.utils.time.TimeUtils; import com.gingersoft.gsa.cloud.common.utils.time.TimeUtils;
import com.gingersoft.supply_chain.R; import com.gingersoft.supply_chain.R;
import com.gingersoft.supply_chain.mvp.bean.NewPurchaseOrderBean; import com.gingersoft.supply_chain.mvp.bean.NewPurchaseOrderBean;
...@@ -25,7 +28,7 @@ public class PurchaseOrderAdapter extends BaseQuickAdapter<OrderBean, BaseViewHo ...@@ -25,7 +28,7 @@ public class PurchaseOrderAdapter extends BaseQuickAdapter<OrderBean, BaseViewHo
public PurchaseOrderAdapter(@Nullable List<OrderBean> data) { public PurchaseOrderAdapter(@Nullable List<OrderBean> data) {
super(R.layout.item_purchase_order, data); super(R.layout.item_purchase_order, data);
addChildClickViewIds(R.id.btn_purchase_send, R.id.btn_purchase_buy_again, R.id.btn_receiver_goods); addChildClickViewIds(R.id.iv_purchase_order_more, R.id.btn_purchase_send, R.id.btn_purchase_buy_again, R.id.btn_receiver_goods);
} }
@Override @Override
...@@ -35,8 +38,8 @@ public class PurchaseOrderAdapter extends BaseQuickAdapter<OrderBean, BaseViewHo ...@@ -35,8 +38,8 @@ public class PurchaseOrderAdapter extends BaseQuickAdapter<OrderBean, BaseViewHo
viewHolder.setText(R.id.tv_purchase_order_create_time, TimeUtils.getTime(purchaseOrderBean.getCreateTime(), TimeUtils.DEFAULT_DATE_FORMAT_YMDHM)); viewHolder.setText(R.id.tv_purchase_order_create_time, TimeUtils.getTime(purchaseOrderBean.getCreateTime(), TimeUtils.DEFAULT_DATE_FORMAT_YMDHM));
viewHolder.setText(R.id.tv_purchase_order_goods_num, purchaseOrderBean.getPurchaseFoodCount() + ""); viewHolder.setText(R.id.tv_purchase_order_goods_num, purchaseOrderBean.getPurchaseFoodCount() + "");
viewHolder.setText(R.id.tv_purchase_order_goods, purchaseOrderBean.getName()); viewHolder.setText(R.id.tv_purchase_order_goods, purchaseOrderBean.getName());
viewHolder.setText(R.id.tv_purchase_order_total_price, purchaseOrderBean.getTotalAmount() + ""); viewHolder.setText(R.id.tv_purchase_order_total_price, String.format(getContext().getString(R.string.amount_string_s), MoneyUtil.formatDouble(purchaseOrderBean.getTotalAmount())));
viewHolder.setText(R.id.btn_receiver_goods, PurchaseOrderDetailsBean.getStringByOrderState(purchaseOrderBean.getStatus())); viewHolder.setText(R.id.btn_receiver_goods, PurchaseOrderDetailsBean.getStringByOrderState(purchaseOrderBean.getStatus()));
viewHolder.setTextColor(R.id.btn_receiver_goods, ContextCompat.getColor(getContext(), PurchaseOrderDetailsBean.getColorByOrderState(purchaseOrderBean.getStatus())));
} }
} }
...@@ -8,8 +8,10 @@ import com.chad.library.adapter.base.viewholder.BaseViewHolder; ...@@ -8,8 +8,10 @@ import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.gingersoft.gsa.cloud.common.utils.time.TimeUtils; import com.gingersoft.gsa.cloud.common.utils.time.TimeUtils;
import com.gingersoft.supply_chain.R; import com.gingersoft.supply_chain.R;
import com.gingersoft.supply_chain.mvp.bean.SupplierInfoBean; import com.gingersoft.supply_chain.mvp.bean.SupplierInfoBean;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
import java.util.List; import java.util.List;
/** /**
...@@ -22,7 +24,7 @@ import java.util.List; ...@@ -22,7 +24,7 @@ import java.util.List;
public class SupplierAdapter extends BaseQuickAdapter<SupplierInfoBean, BaseViewHolder> { public class SupplierAdapter extends BaseQuickAdapter<SupplierInfoBean, BaseViewHolder> {
private boolean isSelect; private boolean isSelect;
private int selectIndex = 0; private int selectIndex = -1;
public SupplierAdapter(@Nullable List<SupplierInfoBean> data) { public SupplierAdapter(@Nullable List<SupplierInfoBean> data) {
this(data, false); this(data, false);
...@@ -44,7 +46,7 @@ public class SupplierAdapter extends BaseQuickAdapter<SupplierInfoBean, BaseView ...@@ -44,7 +46,7 @@ public class SupplierAdapter extends BaseQuickAdapter<SupplierInfoBean, BaseView
viewHolder.setGone(R.id.rb_supplier, !isSelect); viewHolder.setGone(R.id.rb_supplier, !isSelect);
viewHolder.setGone(R.id.iv_supplier_edit, isSelect); viewHolder.setGone(R.id.iv_supplier_edit, isSelect);
viewHolder.setGone(R.id.iv_supplier_delete, isSelect); viewHolder.setGone(R.id.iv_supplier_delete, isSelect);
if(isSelect) { if (isSelect) {
RadioButton radioButton = viewHolder.getView(R.id.rb_supplier); RadioButton radioButton = viewHolder.getView(R.id.rb_supplier);
radioButton.setChecked(viewHolder.getAdapterPosition() == selectIndex); radioButton.setChecked(viewHolder.getAdapterPosition() == selectIndex);
radioButton.setOnCheckedChangeListener((buttonView, isChecked) -> { radioButton.setOnCheckedChangeListener((buttonView, isChecked) -> {
...@@ -68,4 +70,14 @@ public class SupplierAdapter extends BaseQuickAdapter<SupplierInfoBean, BaseView ...@@ -68,4 +70,14 @@ public class SupplierAdapter extends BaseQuickAdapter<SupplierInfoBean, BaseView
public int getSelectIndex() { public int getSelectIndex() {
return selectIndex; return selectIndex;
} }
public void setSelectIndex(int selectIndex) {
if (this.selectIndex != -1) {
notifyItemChanged(this.selectIndex);
}
this.selectIndex = selectIndex;
if (selectIndex != -1) {
notifyItemChanged(selectIndex);
}
}
} }
...@@ -100,7 +100,7 @@ public class FunctionListFragment extends BaseSupplyChainFragment<FunctionListPr ...@@ -100,7 +100,7 @@ public class FunctionListFragment extends BaseSupplyChainFragment<FunctionListPr
List<Function> data = functionChildAdapter.getData(); List<Function> data = functionChildAdapter.getData();
switch (data.get(position).getResName()) { switch (data.get(position).getResName()) {
case "供應商": case "供應商":
start(SupplierListFragment.newInstance(false)); start(SupplierListFragment.newInstance(false, null));
break; break;
case "食材": case "食材":
start(FoodIngredientsFragment.newInstance(FOOD_INGREDIENTS)); start(FoodIngredientsFragment.newInstance(FOOD_INGREDIENTS));
......
...@@ -31,6 +31,7 @@ import java.util.List; ...@@ -31,6 +31,7 @@ import java.util.List;
import butterknife.BindView; import butterknife.BindView;
import butterknife.OnClick; import butterknife.OnClick;
import static com.gingersoft.gsa.cloud.ui.adapter.BaseRadioSectionAdapter.SEPARATOR; import static com.gingersoft.gsa.cloud.ui.adapter.BaseRadioSectionAdapter.SEPARATOR;
...@@ -57,12 +58,22 @@ public class CategorySelectFragment extends BaseSupplyChainFragment<CategorySele ...@@ -57,12 +58,22 @@ public class CategorySelectFragment extends BaseSupplyChainFragment<CategorySele
* 選中的分類數據key * 選中的分類數據key
*/ */
public final static String SELECT_CATEGORY_DATA_KEY = "categoryKey"; public final static String SELECT_CATEGORY_DATA_KEY = "categoryKey";
private final static String CATEGORY_NAME_KEY = "categoryNameKey";
public static CategorySelectFragment newInstance() { public static CategorySelectFragment newInstance(List<String> categoryNames) {
CategorySelectFragment fragment = new CategorySelectFragment(); CategorySelectFragment fragment = new CategorySelectFragment();
if (categoryNames != null && categoryNames.size() > 0) {
Bundle bundle = new Bundle();
bundle.putSerializable(CATEGORY_NAME_KEY, (Serializable) categoryNames);
fragment.setArguments(bundle);
}
return fragment; return fragment;
} }
public static CategorySelectFragment newInstance() {
return newInstance(null);
}
@Override @Override
public void setupFragmentComponent(@NonNull AppComponent appComponent) { public void setupFragmentComponent(@NonNull AppComponent appComponent) {
DaggerCategorySelectComponent //如找不到该类,请编译一下项目 DaggerCategorySelectComponent //如找不到该类,请编译一下项目
...@@ -215,9 +226,9 @@ public class CategorySelectFragment extends BaseSupplyChainFragment<CategorySele ...@@ -215,9 +226,9 @@ public class CategorySelectFragment extends BaseSupplyChainFragment<CategorySele
getTheDeepest(sections.get(Integer.parseInt(split[i])).getSectionCheckItems(), split, i + 1, isChecked); getTheDeepest(sections.get(Integer.parseInt(split[i])).getSectionCheckItems(), split, i + 1, isChecked);
} }
} else if (sections != null) { } else if (sections != null) {
for (int j = 0; j < sections.size(); j++) { // for (int j = 0; j < sections.size(); j++) {
//
} // }
} }
} }
} }
package com.gingersoft.supply_chain.mvp.ui.fragment.food; package com.gingersoft.supply_chain.mvp.ui.fragment.food;
import android.os.Bundle; import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
...@@ -38,7 +39,10 @@ import com.kingja.loadsir.core.LoadSir; ...@@ -38,7 +39,10 @@ import com.kingja.loadsir.core.LoadSir;
import com.qmuiteam.qmui.alpha.QMUIAlphaButton; import com.qmuiteam.qmui.alpha.QMUIAlphaButton;
import com.qmuiteam.qmui.alpha.QMUIAlphaLinearLayout; import com.qmuiteam.qmui.alpha.QMUIAlphaLinearLayout;
import com.qmuiteam.qmui.widget.QMUITopBar; import com.qmuiteam.qmui.widget.QMUITopBar;
import com.xuexiang.rxutil2.rxjava.RxJavaUtils;
import com.xuexiang.rxutil2.rxjava.task.RxIOTask;
import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -103,10 +107,12 @@ public class FoodIngredientsFragment extends BaseSupplyChainFragment<FoodIngredi ...@@ -103,10 +107,12 @@ public class FoodIngredientsFragment extends BaseSupplyChainFragment<FoodIngredi
private final static String supplierNameKey = "supplierName"; private final static String supplierNameKey = "supplierName";
/** /**
* 當前選中的供應商名字 * 當前選中的供應商名字
* 當前選中的分類名字
*/ */
private String currentSupplierName; private String currentSupplierName;
private String currentCategoryName; /**
* 當前選中的一級分類、二級分類、三級分類名,新建食材時需要用到
*/
private List<String> categoryNames;
/** /**
* 分類id,查詢此分類下的食品 * 分類id,查詢此分類下的食品
*/ */
...@@ -132,6 +138,7 @@ public class FoodIngredientsFragment extends BaseSupplyChainFragment<FoodIngredi ...@@ -132,6 +138,7 @@ public class FoodIngredientsFragment extends BaseSupplyChainFragment<FoodIngredi
* 現用於切換供應商再切換回來之後,顯示哪一級的分類 * 現用於切換供應商再切換回來之後,顯示哪一級的分類
*/ */
private int currentLevelCategory = OrderCategoryAdapter.PRIMARY_CATEGORY; private int currentLevelCategory = OrderCategoryAdapter.PRIMARY_CATEGORY;
private BaseCategoryAdapter listSelectAdapter; private BaseCategoryAdapter listSelectAdapter;
public static FoodIngredientsFragment newInstance(int pageType) { public static FoodIngredientsFragment newInstance(int pageType) {
...@@ -174,7 +181,8 @@ public class FoodIngredientsFragment extends BaseSupplyChainFragment<FoodIngredi ...@@ -174,7 +181,8 @@ public class FoodIngredientsFragment extends BaseSupplyChainFragment<FoodIngredi
if (arguments != null) { if (arguments != null) {
pageType = arguments.getInt(pageTypeKey); pageType = arguments.getInt(pageTypeKey);
} }
loadService = LoadSir.getDefault().register(rvRightFoodIngredients, (Callback.OnReloadListener) v -> {}); loadService = LoadSir.getDefault().register(rvRightFoodIngredients, (Callback.OnReloadListener) v -> {
});
initTopBar(); initTopBar();
//初始化購物車數據 //初始化購物車數據
SupplyShoppingCart.getInstance().getCartFoods(); SupplyShoppingCart.getInstance().getCartFoods();
...@@ -267,8 +275,11 @@ public class FoodIngredientsFragment extends BaseSupplyChainFragment<FoodIngredi ...@@ -267,8 +275,11 @@ public class FoodIngredientsFragment extends BaseSupplyChainFragment<FoodIngredi
topbarFoodIngredients.addLeftBackImageButton().setOnClickListener(v -> killMyself()); topbarFoodIngredients.addLeftBackImageButton().setOnClickListener(v -> killMyself());
} }
/**
* 新建食品
*/
private void toCreateFood() { private void toCreateFood() {
startForResult(NewFoodIngredientsFragment.newInstance(currentSupplierName, currentCategoryName), EDIT_FOOD_REQUEST_CODE); startForResult(NewFoodIngredientsFragment.newInstance(currentSupplierName, categoryNames), EDIT_FOOD_REQUEST_CODE);
} }
private void moveToCenter(LinearLayoutManager leftLayoutManager, int sectionPosition) { private void moveToCenter(LinearLayoutManager leftLayoutManager, int sectionPosition) {
...@@ -359,11 +370,6 @@ public class FoodIngredientsFragment extends BaseSupplyChainFragment<FoodIngredi ...@@ -359,11 +370,6 @@ public class FoodIngredientsFragment extends BaseSupplyChainFragment<FoodIngredi
foodListAdapter.setList(purchaseFoodListVos); foodListAdapter.setList(purchaseFoodListVos);
} else { } else {
foodListAdapter = new FoodListAdapter(mContext, purchaseFoodListVos, pageType); foodListAdapter = new FoodListAdapter(mContext, purchaseFoodListVos, pageType);
//把購物車的食材和數量裝入adapter的map中
// Map<Integer, PurchaseFoodBean> integerMap = foodListAdapter.getIntegerMap();
// for (PurchaseFoodBean purchaseFoodBean : SupplyShoppingCart.getInstance().getCartFoods()) {
// integerMap.put(purchaseFoodBean.getId(), purchaseFoodBean);
// }
LinearLayoutManager rightLayoutManager = new LinearLayoutManager(mContext); LinearLayoutManager rightLayoutManager = new LinearLayoutManager(mContext);
rvRightFoodIngredients.setLayoutManager(rightLayoutManager); rvRightFoodIngredients.setLayoutManager(rightLayoutManager);
rvRightFoodIngredients.setAdapter(foodListAdapter); rvRightFoodIngredients.setAdapter(foodListAdapter);
...@@ -376,7 +382,7 @@ public class FoodIngredientsFragment extends BaseSupplyChainFragment<FoodIngredi ...@@ -376,7 +382,7 @@ public class FoodIngredientsFragment extends BaseSupplyChainFragment<FoodIngredi
PurchaseFoodBean purchaseFoodBean = foodListAdapter.getData().get(position); PurchaseFoodBean purchaseFoodBean = foodListAdapter.getData().get(position);
new AppDialog().showWaringDialog(mContext, "是否確認刪除" + purchaseFoodBean.getName(), (view1, dialog) -> { new AppDialog().showWaringDialog(mContext, "是否確認刪除" + purchaseFoodBean.getName(), (view1, dialog) -> {
if (!isSupplier) { if (!isSupplier) {
purchaseFoodBean.setFoodCategoryName(currentCategoryName); purchaseFoodBean.setFoodCategoryName(getCurrentCategory());
} }
mPresenter.deleteFood(purchaseFoodBean.getId(), position); mPresenter.deleteFood(purchaseFoodBean.getId(), position);
dialog.dismiss(); dialog.dismiss();
...@@ -402,7 +408,7 @@ public class FoodIngredientsFragment extends BaseSupplyChainFragment<FoodIngredi ...@@ -402,7 +408,7 @@ public class FoodIngredientsFragment extends BaseSupplyChainFragment<FoodIngredi
//點擊二級分類時,隱藏一級和二級,顯示二級和三級分類數據 //點擊二級分類時,隱藏一級和二級,顯示二級和三級分類數據
if (orderCategoryAdapter.getCurrentLevelCategory() == OrderCategoryAdapter.PRIMARY_CATEGORY) { if (orderCategoryAdapter.getCurrentLevelCategory() == OrderCategoryAdapter.PRIMARY_CATEGORY) {
currentLevelCategory = OrderCategoryAdapter.SECOND_CATEGORY; currentLevelCategory = OrderCategoryAdapter.SECOND_CATEGORY;
setCurrentCategoryInfo(foodCategoryTrees1.get(position)); setCurrentCategoryInfo(foodCategoryTrees1.get(position), OrderCategoryAdapter.SECOND_CATEGORY);
getFoodsByCategoryId(); getFoodsByCategoryId();
initSecondAdapter(foodCategoryTrees1, position); initSecondAdapter(foodCategoryTrees1, position);
} }
...@@ -419,9 +425,39 @@ public class FoodIngredientsFragment extends BaseSupplyChainFragment<FoodIngredi ...@@ -419,9 +425,39 @@ public class FoodIngredientsFragment extends BaseSupplyChainFragment<FoodIngredi
currentSupplierName = name; currentSupplierName = name;
} }
private void setCurrentCategoryInfo(OrderCategoryBean.FoodCategoryTrees foodCategoryTrees) { private void setCurrentCategoryInfo(OrderCategoryBean.FoodCategoryTrees foodCategoryTrees, int level) {
RxJavaUtils.doInIOThread(new RxIOTask<Object>(0) {
@Override
public Void doInIOThread(Object o) {
categoryId = foodCategoryTrees.getId(); categoryId = foodCategoryTrees.getId();
currentCategoryName = foodCategoryTrees.getName(); if (categoryNames == null) {
categoryNames = new ArrayList<>();
}
//將所選的一級。二級。三級分類都保存下來,新建食品時用到
if (level == OrderCategoryAdapter.PRIMARY_CATEGORY) {
//切换到一級分類
categoryNames.clear();
categoryNames.add(foodCategoryTrees.getName());
} else if (level == OrderCategoryAdapter.SECOND_CATEGORY) {
if (categoryNames.size() > 0) {
//有一級分類
String primaryCateName = categoryNames.get(0);
categoryNames.clear();
categoryNames.add(primaryCateName);
categoryNames.add(foodCategoryTrees.getName());
}
} else if (level == OrderCategoryAdapter.THIRD_CATEGORY) {
if (categoryNames.size() > 2) {
//有三級分類
categoryNames.set(2, foodCategoryTrees.getName());
} else if (categoryNames.size() == 2) {
//有二級分類
categoryNames.add(foodCategoryTrees.getName());
}
}
return null;
}
});
} }
private void initSecondAdapter private void initSecondAdapter
...@@ -440,12 +476,12 @@ public class FoodIngredientsFragment extends BaseSupplyChainFragment<FoodIngredi ...@@ -440,12 +476,12 @@ public class FoodIngredientsFragment extends BaseSupplyChainFragment<FoodIngredi
//當前分類顯示的是二級分類和三級分類,二級分類的點擊事件 //當前分類顯示的是二級分類和三級分類,二級分類的點擊事件
List<OrderCategoryBean.FoodCategoryTrees> data = secondCategoryAdapter.getData(); List<OrderCategoryBean.FoodCategoryTrees> data = secondCategoryAdapter.getData();
secondCategoryAdapter.setSelectIndex(secondPosition); secondCategoryAdapter.setSelectIndex(secondPosition);
setCurrentCategoryInfo(data.get(secondPosition)); setCurrentCategoryInfo(data.get(secondPosition), OrderCategoryAdapter.SECOND_CATEGORY);
getFoodsByCategoryId(); getFoodsByCategoryId();
}); });
secondCategoryAdapter.setOnSecondCategoryClickListener((foodCategoryTrees1, thirdPosition) -> { secondCategoryAdapter.setOnSecondCategoryClickListener((foodCategoryTrees1, thirdPosition) -> {
//當前分類顯示的是二級分類和三級分類,三級分類的點擊事件 //當前分類顯示的是二級分類和三級分類,三級分類的點擊事件
setCurrentCategoryInfo(foodCategoryTrees1.get(thirdPosition)); setCurrentCategoryInfo(foodCategoryTrees1.get(thirdPosition), OrderCategoryAdapter.THIRD_CATEGORY);
getFoodsByCategoryId(); getFoodsByCategoryId();
}); });
rvSecondCategory.setAdapter(secondCategoryAdapter); rvSecondCategory.setAdapter(secondCategoryAdapter);
...@@ -473,7 +509,7 @@ public class FoodIngredientsFragment extends BaseSupplyChainFragment<FoodIngredi ...@@ -473,7 +509,7 @@ public class FoodIngredientsFragment extends BaseSupplyChainFragment<FoodIngredi
orderCategoryAdapter.setOnItemClickListener((adapter, view, position) -> { orderCategoryAdapter.setOnItemClickListener((adapter, view, position) -> {
//當頁面顯示的是一級分類和二級分類時,一級分類的點擊事件 //當頁面顯示的是一級分類和二級分類時,一級分類的點擊事件
//點擊之後顯示一級分類和所屬的二級分類 //點擊之後顯示一級分類和所屬的二級分類
setCurrentCategoryInfo(foodCategoryTrees.get(position)); setCurrentCategoryInfo(foodCategoryTrees.get(position), OrderCategoryAdapter.PRIMARY_CATEGORY);
getFoodsByCategoryId(); getFoodsByCategoryId();
orderCategoryAdapter.setSelectIndex(position); orderCategoryAdapter.setSelectIndex(position);
}); });
...@@ -482,11 +518,23 @@ public class FoodIngredientsFragment extends BaseSupplyChainFragment<FoodIngredi ...@@ -482,11 +518,23 @@ public class FoodIngredientsFragment extends BaseSupplyChainFragment<FoodIngredi
orderCategoryAdapter.getOnItemClickListener().onItemClick(orderCategoryAdapter, null, 0); orderCategoryAdapter.getOnItemClickListener().onItemClick(orderCategoryAdapter, null, 0);
} }
if (orderCategoryAdapter.getSelectIndex() != -1) { if (orderCategoryAdapter.getSelectIndex() != -1) {
setCurrentCategoryInfo(foodCategoryTrees.get(orderCategoryAdapter.getSelectIndex())); setCurrentCategoryInfo(foodCategoryTrees.get(orderCategoryAdapter.getSelectIndex()), OrderCategoryAdapter.PRIMARY_CATEGORY);
getFoodsByCategoryId(); getFoodsByCategoryId();
} }
} }
/**
* @return 當前選中的分類名
*/
public String getCurrentCategory() {
if (categoryNames != null) {
if (categoryNames.size() > 0) {
return categoryNames.get(categoryNames.size() - 1);
}
}
return null;
}
@Override @Override
public void onFragmentResult(int requestCode, int resultCode, Bundle data) { public void onFragmentResult(int requestCode, int resultCode, Bundle data) {
super.onFragmentResult(requestCode, resultCode, data); super.onFragmentResult(requestCode, resultCode, data);
...@@ -499,7 +547,7 @@ public class FoodIngredientsFragment extends BaseSupplyChainFragment<FoodIngredi ...@@ -499,7 +547,7 @@ public class FoodIngredientsFragment extends BaseSupplyChainFragment<FoodIngredi
String categoryName = data.getString(NewFoodIngredientsFragment.CATEGORY_NAME_KEY); String categoryName = data.getString(NewFoodIngredientsFragment.CATEGORY_NAME_KEY);
//從供應商的數據中將緩存移除掉,並拿到這個食材所屬的供應商 //從供應商的數據中將緩存移除掉,並拿到這個食材所屬的供應商
int removeSupplierId = mPresenter.removeSupplierCache(supplierName); int removeSupplierId = mPresenter.removeSupplierCache(supplierName);
//從分類的數據中緩存移除掉 //從分類的數據中緩存移除掉
mPresenter.removeCacheByCategoryName(categoryName); mPresenter.removeCacheByCategoryName(categoryName);
//如果所屬供應商是當前選中的供應商,則調用接口重新獲取數據 //如果所屬供應商是當前選中的供應商,則調用接口重新獲取數據
if (isSupplier) { if (isSupplier) {
...@@ -507,11 +555,15 @@ public class FoodIngredientsFragment extends BaseSupplyChainFragment<FoodIngredi ...@@ -507,11 +555,15 @@ public class FoodIngredientsFragment extends BaseSupplyChainFragment<FoodIngredi
if (supplierId == removeSupplierId) { if (supplierId == removeSupplierId) {
getFoodsBySupplierId(); getFoodsBySupplierId();
} }
} else if (TextUtil.isNotEmptyOrNullOrUndefined(currentCategoryName) && currentCategoryName.equals(categoryName)) { } else if (TextUtil.isNotEmptyOrNullOrUndefined(getCurrentCategory())) {
//當前分類不為空
//新建食材的分類不為空,並且新建食材的分類和當前選中的分類一致,那麼就刷新數據
if (TextUtil.isNotEmptyOrNullOrUndefined(categoryName) && categoryName.equals(getCurrentCategory())) {
//如果當前選中的是分類,並且是當前分類。重新獲取該分類下的數據 //如果當前選中的是分類,並且是當前分類。重新獲取該分類下的數據
getFoodsByCategoryId(); getFoodsByCategoryId();
} }
} }
} }
} }
}
} }
...@@ -164,7 +164,7 @@ public class FoodUnitPageFragment extends BaseSupplyChainFragment<FoodUnitPagePr ...@@ -164,7 +164,7 @@ public class FoodUnitPageFragment extends BaseSupplyChainFragment<FoodUnitPagePr
@Override @Override
public void onConfirm(String text) { public void onConfirm(String text) {
if (TextUtil.isNotEmptyOrNullOrUndefined(text)) { if (TextUtil.isNotEmptyOrNullOrUndefined(text)) {
mPresenter.addBasicUnit(text); mPresenter.addBasicUnit(text, basicUnitAdapter.getData());
} }
} }
}); });
......
...@@ -51,6 +51,7 @@ import java.io.File; ...@@ -51,6 +51,7 @@ import java.io.File;
import java.io.FileOutputStream; import java.io.FileOutputStream;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.io.Serializable;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
...@@ -108,11 +109,11 @@ public class NewFoodIngredientsFragment extends BaseSupplyChainFragment<NewFoodI ...@@ -108,11 +109,11 @@ public class NewFoodIngredientsFragment extends BaseSupplyChainFragment<NewFoodI
return fragment; return fragment;
} }
public static NewFoodIngredientsFragment newInstance(String supplierName, String categoryName) { public static NewFoodIngredientsFragment newInstance(String supplierName, List<String> categoryNames) {
NewFoodIngredientsFragment fragment = new NewFoodIngredientsFragment(); NewFoodIngredientsFragment fragment = new NewFoodIngredientsFragment();
Bundle bundle = new Bundle(); Bundle bundle = new Bundle();
bundle.putSerializable(SUPPLIER_NAME_KEY, supplierName); bundle.putString(SUPPLIER_NAME_KEY, supplierName);
bundle.putSerializable(CATEGORY_NAME_KEY, categoryName); bundle.putSerializable(CATEGORY_NAME_KEY, (Serializable) categoryNames);
fragment.setArguments(bundle); fragment.setArguments(bundle);
return fragment; return fragment;
} }
...@@ -153,7 +154,19 @@ public class NewFoodIngredientsFragment extends BaseSupplyChainFragment<NewFoodI ...@@ -153,7 +154,19 @@ public class NewFoodIngredientsFragment extends BaseSupplyChainFragment<NewFoodI
isUpdate = false; isUpdate = false;
initTopBar(topbarNewFoodIngredients, "新增食材"); initTopBar(topbarNewFoodIngredients, "新增食材");
purchaseFoodBean = new PurchaseFoodBean(); purchaseFoodBean = new PurchaseFoodBean();
purchaseFoodBean.setFoodCategoryName(arguments.getString(CATEGORY_NAME_KEY)); //拿到分類集合
List<String> categoryNames = (List<String>) arguments.getSerializable(CATEGORY_NAME_KEY);
if (categoryNames != null && categoryNames.size()>0) {
//分類不為空,設置分類信息
mPresenter.setCategoryNames(categoryNames);
StringBuilder category = new StringBuilder();
for (String categoryName : categoryNames) {
category.append(categoryName).append(PurchaseFoodBean.CATEGORY_DIVIDER);
}
category.deleteCharAt(category.lastIndexOf(PurchaseFoodBean.CATEGORY_DIVIDER));
purchaseFoodBean.setFoodCategoryName(category.toString());
}
//供應商名稱
purchaseFoodBean.setSupplierName(arguments.getString(SUPPLIER_NAME_KEY)); purchaseFoodBean.setSupplierName(arguments.getString(SUPPLIER_NAME_KEY));
mPresenter.setPurchaseFoodBean(purchaseFoodBean); mPresenter.setPurchaseFoodBean(purchaseFoodBean);
initAdapter(); initAdapter();
...@@ -177,10 +190,13 @@ public class NewFoodIngredientsFragment extends BaseSupplyChainFragment<NewFoodI ...@@ -177,10 +190,13 @@ public class NewFoodIngredientsFragment extends BaseSupplyChainFragment<NewFoodI
if (infoMultiBean instanceof MultiSelectBean) { if (infoMultiBean instanceof MultiSelectBean) {
MultiSelectBean multiBean = (MultiSelectBean) infoMultiBean; MultiSelectBean multiBean = (MultiSelectBean) infoMultiBean;
if (infoMultiBean.getFragment() == SupplierListFragment.class) { if (infoMultiBean.getFragment() == SupplierListFragment.class) {
startForResult(SupplierListFragment.newInstance(true), multiBean.getRequestCode()); //選擇供應商
startForResult(SupplierListFragment.newInstance(true, multiBean.getShowValue()), multiBean.getRequestCode());
} else if (infoMultiBean.getFragment() == CategorySelectFragment.class) { } else if (infoMultiBean.getFragment() == CategorySelectFragment.class) {
//選擇分類
startForResult(CategorySelectFragment.newInstance(), multiBean.getRequestCode()); startForResult(CategorySelectFragment.newInstance(), multiBean.getRequestCode());
} else if (infoMultiBean.getFragment() == FoodUnitPageFragment.class) { } else if (infoMultiBean.getFragment() == FoodUnitPageFragment.class) {
//食品單位
startForResult(FoodUnitPageFragment.newInstance(mPresenter.getBasicUnit(data), mPresenter.getDeputyUnitBeans(), isUpdate, mPresenter.getFoodId()), multiBean.getRequestCode()); startForResult(FoodUnitPageFragment.newInstance(mPresenter.getBasicUnit(data), mPresenter.getDeputyUnitBeans(), isUpdate, mPresenter.getFoodId()), multiBean.getRequestCode());
} }
} }
......
...@@ -169,6 +169,7 @@ public class OrderDetailsFragment extends BaseSupplyChainFragment<OrderDetailsPr ...@@ -169,6 +169,7 @@ public class OrderDetailsFragment extends BaseSupplyChainFragment<OrderDetailsPr
initRecyclerView(orderDetailsBean); initRecyclerView(orderDetailsBean);
//全選按鈕狀態切換 //全選按鈕狀態切換
cbOrderDetailsAllSelected.setOnCheckedChangeListener((buttonView, isChecked) -> { cbOrderDetailsAllSelected.setOnCheckedChangeListener((buttonView, isChecked) -> {
if (buttonView.isPressed()) {
//重新計算總價 //重新計算總價
totalAmount = 0; totalAmount = 0;
typesOfFood = isChecked ? orderDetailsFoodAdapter.getData().size() : 0; typesOfFood = isChecked ? orderDetailsFoodAdapter.getData().size() : 0;
...@@ -182,6 +183,7 @@ public class OrderDetailsFragment extends BaseSupplyChainFragment<OrderDetailsPr ...@@ -182,6 +183,7 @@ public class OrderDetailsFragment extends BaseSupplyChainFragment<OrderDetailsPr
orderDetailsFoodAdapter.notifyDataSetChanged(); orderDetailsFoodAdapter.notifyDataSetChanged();
setTotalAmount(); setTotalAmount();
setTypesOfFood(); setTypesOfFood();
}
}); });
} }
......
...@@ -31,12 +31,16 @@ import com.gingersoft.supply_chain.mvp.ui.adapter.PurchaseOrderAdapter; ...@@ -31,12 +31,16 @@ import com.gingersoft.supply_chain.mvp.ui.adapter.PurchaseOrderAdapter;
import com.gingersoft.supply_chain.mvp.ui.adapter.PurchasePageAdapter; import com.gingersoft.supply_chain.mvp.ui.adapter.PurchasePageAdapter;
import com.gingersoft.supply_chain.mvp.ui.fragment.BaseSupplyChainFragment; import com.gingersoft.supply_chain.mvp.ui.fragment.BaseSupplyChainFragment;
import com.gingersoft.supply_chain.mvp.ui.fragment.food.FoodIngredientsFragment; import com.gingersoft.supply_chain.mvp.ui.fragment.food.FoodIngredientsFragment;
import com.gingersoft.supply_chain.mvp.ui.widget.PurchaseListMorePopup;
import com.gingersoft.supply_chain.mvp.ui.widget.ScreenView; import com.gingersoft.supply_chain.mvp.ui.widget.ScreenView;
import com.jess.arms.di.component.AppComponent; import com.jess.arms.di.component.AppComponent;
import com.kingja.loadsir.callback.Callback; import com.kingja.loadsir.callback.Callback;
import com.kingja.loadsir.callback.SuccessCallback; import com.kingja.loadsir.callback.SuccessCallback;
import com.kingja.loadsir.core.LoadService; import com.kingja.loadsir.core.LoadService;
import com.kingja.loadsir.core.LoadSir; import com.kingja.loadsir.core.LoadSir;
import com.lxj.xpopup.XPopup;
import com.lxj.xpopup.enums.PopupPosition;
import com.lxj.xpopup.interfaces.OnSelectListener;
import com.qmuiteam.qmui.alpha.QMUIAlphaButton; import com.qmuiteam.qmui.alpha.QMUIAlphaButton;
import com.qmuiteam.qmui.util.QMUIDisplayHelper; import com.qmuiteam.qmui.util.QMUIDisplayHelper;
import com.qmuiteam.qmui.widget.QMUITopBar; import com.qmuiteam.qmui.widget.QMUITopBar;
...@@ -88,6 +92,9 @@ public class PurchaseListFragment extends BaseSupplyChainFragment<PurchaseListPr ...@@ -88,6 +92,9 @@ public class PurchaseListFragment extends BaseSupplyChainFragment<PurchaseListPr
return fragment; return fragment;
} }
/**
* 待收貨,已完成
*/
private final int[] orderState = new int[]{PurchaseOrderDetailsBean.WAIT_RECEIVED, PurchaseOrderDetailsBean.COMPLETE_RECEIVED}; private final int[] orderState = new int[]{PurchaseOrderDetailsBean.WAIT_RECEIVED, PurchaseOrderDetailsBean.COMPLETE_RECEIVED};
private int pageIndex = 0; private int pageIndex = 0;
/** /**
...@@ -169,35 +176,34 @@ public class PurchaseListFragment extends BaseSupplyChainFragment<PurchaseListPr ...@@ -169,35 +176,34 @@ public class PurchaseListFragment extends BaseSupplyChainFragment<PurchaseListPr
purchaseOrderAdapter.setOnItemClickListener((adapter, view, position) -> startForResult(OrderDetailsFragment.newInstance(purchaseOrderAdapter.getData().get(position).getId(), orderState[orderStateIndex]), REQUEST_ORDER_DETAILS_CODE)); purchaseOrderAdapter.setOnItemClickListener((adapter, view, position) -> startForResult(OrderDetailsFragment.newInstance(purchaseOrderAdapter.getData().get(position).getId(), orderState[orderStateIndex]), REQUEST_ORDER_DETAILS_CODE));
purchaseOrderAdapter.setOnItemChildClickListener((adapter, view, position) -> { purchaseOrderAdapter.setOnItemChildClickListener((adapter, view, position) -> {
int viewId = view.getId(); int viewId = view.getId();
if (viewId == R.id.btn_purchase_send) { if (viewId == R.id.iv_purchase_order_more) {
//更多:刪除。發送。再次購買
new XPopup.Builder(mContext)
.atView(view)
.hasShadowBg(false)
.popupPosition(PopupPosition.Left)
.asCustom(new PurchaseListMorePopup(mContext)
.setStringData(new String[]{"删除", "发送", "再次购买"}, new int[]{R.drawable.ic_purchase_delete, R.drawable.ic_purchase_send, R.drawable.ic_purchase_buy_again})
.setOnSelectListener((position1, text) -> {
if (position1 == 2) {
//發送
//發送採購單 //發送採購單
List<OrderBean> data = purchaseOrderAdapter.getData(); sendPurchase(position);
OrderBean orderBean = data.get(position); }
}))
ConfirmOrderBean.PurchaseOrder purchaseOrder = new ConfirmOrderBean.PurchaseOrder(); .show();
purchaseOrder.setId(orderBean.getId());
purchaseOrder.setSupplierId(orderBean.getSupplierId());
purchaseOrder.setSupplierName(orderBean.getSupplierName());
start(SendMsgFragment.newInstance(Collections.singletonList(purchaseOrder)));
} }
// if (viewId == R.id.iv_supplier_delete) {
// //刪除採購單
// AppDialog.getInstance().showWaringDialog(mContext, "是否刪除採購單?", (view1, dialog) -> {
// List<OrderBean> data = purchaseOrderAdapter.getData();
// mPresenter.deleteOrder(position, data.get(position));
// dialog.dismiss();
// });
// }
}); });
PurchasePageAdapter adapter = new PurchasePageAdapter(purchaseOrderAdapter, 2); PurchasePageAdapter adapter = new PurchasePageAdapter(purchaseOrderAdapter, 2);
contentViewPager.setAdapter(adapter); contentViewPager.setAdapter(adapter);
mTabSegment.setupWithViewPager(contentViewPager); mTabSegment.setupWithViewPager(contentViewPager);
mTabSegment.setIndicator(new QMUITabIndicator( //new QMUITabIndicator(
QMUIDisplayHelper.dp2px(getContext(), 2), false, false)); // QMUIDisplayHelper.dp2px(getContext(), 2), false, false)
QMUITabIndicator qmuiTabIndicator = new QMUITabIndicator(
ContextCompat.getDrawable(mContext, R.drawable.ic_open_close), false, false, ContextCompat.getColor(mContext, R.color.color_3c));
mTabSegment.setIndicator(qmuiTabIndicator);
mTabSegment.addTab(builder.setText("未完成").build(getContext())); mTabSegment.addTab(builder.setText("未完成").build(getContext()));
mTabSegment.addTab(builder.setText("已完成").build(getContext())); mTabSegment.addTab(builder.setText("已完成").build(getContext()));
// mTabSegment.addTab(builder.setText("部分收貨").build(getContext()));
// mTabSegment.addTab(builder.setText("全部收貨").build(getContext()));
mTabSegment.notifyDataChanged(); mTabSegment.notifyDataChanged();
mTabSegment.setMode(QMUITabSegment.MODE_FIXED); mTabSegment.setMode(QMUITabSegment.MODE_FIXED);
mTabSegment.addOnTabSelectedListener(new QMUIBasicTabSegment.OnTabSelectedListener() { mTabSegment.addOnTabSelectedListener(new QMUIBasicTabSegment.OnTabSelectedListener() {
...@@ -224,11 +230,22 @@ public class PurchaseListFragment extends BaseSupplyChainFragment<PurchaseListPr ...@@ -224,11 +230,22 @@ public class PurchaseListFragment extends BaseSupplyChainFragment<PurchaseListPr
}); });
} }
@OnClick({R2.id.layout_purchase_list_screen, R2.id.iv_purchase_list_search}) private void sendPurchase(int position) {
List<OrderBean> data = purchaseOrderAdapter.getData();
OrderBean orderBean = data.get(position);
ConfirmOrderBean.PurchaseOrder purchaseOrder = new ConfirmOrderBean.PurchaseOrder();
purchaseOrder.setId(orderBean.getId());
purchaseOrder.setSupplierId(orderBean.getSupplierId());
purchaseOrder.setSupplierName(orderBean.getSupplierName());
start(SendMsgFragment.newInstance(Collections.singletonList(purchaseOrder)));
}
@OnClick({R2.id.iv_purchase_list_screen, R2.id.iv_purchase_list_search})
@Override @Override
public void onClick(View v) { public void onClick(View v) {
int viewId = v.getId(); int viewId = v.getId();
if (viewId == R.id.layout_purchase_list_screen) { if (viewId == R.id.iv_purchase_list_screen) {
//篩選 //篩選
screenView.setVisibility(screenView.getVisibility() == View.VISIBLE ? View.GONE : View.VISIBLE); screenView.setVisibility(screenView.getVisibility() == View.VISIBLE ? View.GONE : View.VISIBLE);
} else if (viewId == R.id.iv_purchase_list_search) { } else if (viewId == R.id.iv_purchase_list_search) {
...@@ -276,7 +293,7 @@ public class PurchaseListFragment extends BaseSupplyChainFragment<PurchaseListPr ...@@ -276,7 +293,7 @@ public class PurchaseListFragment extends BaseSupplyChainFragment<PurchaseListPr
@Override @Override
public void onFragmentResult(int requestCode, int resultCode, Bundle data) { public void onFragmentResult(int requestCode, int resultCode, Bundle data) {
super.onFragmentResult(requestCode, resultCode, data); super.onFragmentResult(requestCode, resultCode, data);
if(requestCode == REQUEST_ORDER_DETAILS_CODE && resultCode == RESULT_OK){ if (requestCode == REQUEST_ORDER_DETAILS_CODE && resultCode == RESULT_OK) {
//用戶進行了收貨操作,需要對列表進行刷新 //用戶進行了收貨操作,需要對列表進行刷新
getOrderList(); getOrderList();
} }
......
...@@ -32,6 +32,8 @@ import com.kingja.loadsir.core.LoadSir; ...@@ -32,6 +32,8 @@ import com.kingja.loadsir.core.LoadSir;
import com.qmuiteam.qmui.alpha.QMUIAlphaTextView; import com.qmuiteam.qmui.alpha.QMUIAlphaTextView;
import com.qmuiteam.qmui.widget.QMUITopBar; import com.qmuiteam.qmui.widget.QMUITopBar;
import com.scwang.smartrefresh.layout.SmartRefreshLayout; import com.scwang.smartrefresh.layout.SmartRefreshLayout;
import com.xuexiang.rxutil2.rxjava.RxJavaUtils;
import com.xuexiang.rxutil2.rxjava.task.RxAsyncTask;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
...@@ -75,11 +77,13 @@ public class SupplierListFragment extends BaseSupplyChainFragment<SupplierListPr ...@@ -75,11 +77,13 @@ public class SupplierListFragment extends BaseSupplyChainFragment<SupplierListPr
*/ */
private boolean isSelect = false; private boolean isSelect = false;
public static final String IS_SELECT_KEY = "selectSupplier"; public static final String IS_SELECT_KEY = "selectSupplier";
private static final String SUPPLIER_NAME_KEY = "supplierNameKey";
public static SupplierListFragment newInstance(boolean isSelect) { public static SupplierListFragment newInstance(boolean isSelect, String supplierName) {
SupplierListFragment fragment = new SupplierListFragment(); SupplierListFragment fragment = new SupplierListFragment();
Bundle bundle = new Bundle(); Bundle bundle = new Bundle();
bundle.putBoolean(IS_SELECT_KEY, isSelect); bundle.putBoolean(IS_SELECT_KEY, isSelect);
bundle.putString(SUPPLIER_NAME_KEY, supplierName);
fragment.setArguments(bundle); fragment.setArguments(bundle);
return fragment; return fragment;
} }
...@@ -106,6 +110,7 @@ public class SupplierListFragment extends BaseSupplyChainFragment<SupplierListPr ...@@ -106,6 +110,7 @@ public class SupplierListFragment extends BaseSupplyChainFragment<SupplierListPr
Bundle arguments = getArguments(); Bundle arguments = getArguments();
if (arguments != null) { if (arguments != null) {
isSelect = arguments.getBoolean(IS_SELECT_KEY); isSelect = arguments.getBoolean(IS_SELECT_KEY);
mPresenter.setSupplierName(arguments.getString(SUPPLIER_NAME_KEY));
} }
btnConfirm.setVisibility(isSelect ? View.VISIBLE : View.GONE); btnConfirm.setVisibility(isSelect ? View.VISIBLE : View.GONE);
btnCancel.setVisibility(isSelect ? View.VISIBLE : View.GONE); btnCancel.setVisibility(isSelect ? View.VISIBLE : View.GONE);
...@@ -140,7 +145,11 @@ public class SupplierListFragment extends BaseSupplyChainFragment<SupplierListPr ...@@ -140,7 +145,11 @@ public class SupplierListFragment extends BaseSupplyChainFragment<SupplierListPr
} }
private void getSupplierList() { private void getSupplierList() {
mPresenter.getSupplierList(edSupplier.getText() + "", pageIndex); if (supplierAdapter == null) {
mPresenter.getSupplierList(edSupplier.getText() + "", pageIndex, isSelect);
} else {
mPresenter.getSupplierList(edSupplier.getText() + "", pageIndex, isSelect && supplierAdapter.getSelectIndex() == -1);
}
} }
private void initTopBar() { private void initTopBar() {
...@@ -241,4 +250,11 @@ public class SupplierListFragment extends BaseSupplyChainFragment<SupplierListPr ...@@ -241,4 +250,11 @@ public class SupplierListFragment extends BaseSupplyChainFragment<SupplierListPr
public void loadError() { public void loadError() {
loadService.showCallback(ErrorCallback.class); loadService.showCallback(ErrorCallback.class);
} }
@Override
public void setSelectIndex(int index) {
if (supplierAdapter != null) {
supplierAdapter.setSelectIndex(index);
}
}
} }
package com.gingersoft.supply_chain.mvp.ui.widget;
import android.content.Context;
import androidx.annotation.NonNull;
import com.gingersoft.supply_chain.R;
import com.lxj.xpopup.impl.AttachListPopupView;
/**
* @author 宇航.
* User: admin
* Date: 2021/1/19
* Time: 16:06
* Use:
*/
public class PurchaseListMorePopup extends AttachListPopupView {
/**
* @param context
* @param bindLayoutId layoutId 要求layoutId中必须有一个id为recyclerView的RecyclerView
* @param bindItemLayoutId itemLayoutId 条目的布局id,要求布局中必须有id为iv_image的ImageView,和id为tv_text的TextView
*/
public PurchaseListMorePopup(@NonNull Context context) {
super(context, R.layout.pop_purchase_list_more, R.layout.pop_purchase_list_more_item);
}
@Override
protected void onCreate() {
super.onCreate();
findViewById(R.id.recyclerView);
}
}
...@@ -20,7 +20,8 @@ ...@@ -20,7 +20,8 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/dp_48" android:layout_height="@dimen/dp_48"
android:layout_margin="@dimen/dp_10" android:layout_margin="@dimen/dp_10"
android:orientation="horizontal"> android:orientation="horizontal"
android:visibility="gone">
<LinearLayout <LinearLayout
android:layout_width="0dp" android:layout_width="0dp"
...@@ -29,14 +30,6 @@ ...@@ -29,14 +30,6 @@
android:background="@drawable/shape_white_eight_corners_bg" android:background="@drawable/shape_white_eight_corners_bg"
android:orientation="horizontal"> android:orientation="horizontal">
<ImageView
android:id="@+id/iv_purchase_list_search"
android:layout_width="@dimen/dp_24"
android:layout_height="@dimen/dp_24"
android:layout_gravity="center_vertical"
android:layout_marginLeft="@dimen/dp_10"
android:src="@drawable/ic_search" />
<EditText <EditText
android:id="@+id/ed_food_ingredients_search" android:id="@+id/ed_food_ingredients_search"
android:layout_width="match_parent" android:layout_width="match_parent"
...@@ -87,11 +80,38 @@ ...@@ -87,11 +80,38 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:visibility="gone" /> android:visibility="gone" />
<com.qmuiteam.qmui.widget.tab.QMUITabSegment2 <LinearLayout
android:id="@+id/purchase_list_tabSegment"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/dp_42" android:layout_height="@dimen/dp_42"
android:background="@color/white" /> android:background="@color/white"
android:orientation="horizontal">
<ImageView
android:id="@+id/iv_purchase_list_search"
android:layout_width="@dimen/dp_42"
android:layout_height="match_parent"
android:layout_gravity="center_vertical"
android:paddingLeft="@dimen/dp_6"
android:paddingRight="@dimen/dp_6"
android:src="@drawable/ic_search"
android:visibility="gone" />
<com.qmuiteam.qmui.widget.tab.QMUITabSegment2
android:id="@+id/purchase_list_tabSegment"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1" />
<ImageView
android:id="@+id/iv_purchase_list_screen"
android:layout_width="@dimen/dp_42"
android:layout_height="match_parent"
android:layout_gravity="center_vertical"
android:paddingLeft="@dimen/dp_6"
android:paddingRight="@dimen/dp_6"
android:src="@drawable/ic_screen"
android:visibility="gone" />
</LinearLayout>
<FrameLayout <FrameLayout
android:layout_width="match_parent" android:layout_width="match_parent"
......
...@@ -58,6 +58,7 @@ ...@@ -58,6 +58,7 @@
android:layout_weight="1" android:layout_weight="1"
android:ellipsize="end" android:ellipsize="end"
android:maxLines="1" android:maxLines="1"
android:visibility="gone"
android:textSize="@dimen/dp_12" android:textSize="@dimen/dp_12"
tools:text="SP001" /> tools:text="SP001" />
...@@ -67,7 +68,6 @@ ...@@ -67,7 +68,6 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:ellipsize="end" android:ellipsize="end"
android:gravity="right"
android:maxLines="2" android:maxLines="2"
android:textColor="@color/black" android:textColor="@color/black"
android:textSize="@dimen/dp_17" android:textSize="@dimen/dp_17"
......
...@@ -58,11 +58,10 @@ ...@@ -58,11 +58,10 @@
android:paddingLeft="@dimen/dp_5" android:paddingLeft="@dimen/dp_5"
android:paddingRight="@dimen/dp_2" android:paddingRight="@dimen/dp_2"
android:paddingBottom="@dimen/dp_10" android:paddingBottom="@dimen/dp_10"
android:singleLine="true"
android:textColor="@color/s_btn_blue_3c_text" android:textColor="@color/s_btn_blue_3c_text"
android:textSize="@dimen/dp_14" android:textSize="@dimen/dp_14"
android:textStyle="bold" android:textStyle="bold"
tools:text="果蔬類" /> tools:text="果蔬類阿斯蘭大家阿拉斯加的垃圾勞動局阿克蘇奧術大師大所多啊實打實大" />
<View <View
android:id="@+id/order_primary_category_line" android:id="@+id/order_primary_category_line"
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/dp_40" android:layout_height="@dimen/dp_40"
android:layout_marginLeft="@dimen/dp_8" android:layout_marginLeft="@dimen/dp_8"
android:layout_marginRight="@dimen/dp_8"
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="horizontal"> android:orientation="horizontal">
...@@ -35,13 +34,16 @@ ...@@ -35,13 +34,16 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:gravity="center_vertical" android:gravity="center_vertical"
android:textStyle="bold"
tools:text="收貨狀態" /> tools:text="收貨狀態" />
<ImageView <ImageView
android:id="@+id/iv_purchase_order_more" android:id="@+id/iv_purchase_order_more"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:padding="@dimen/dp_10" android:paddingLeft="@dimen/dp_10"
android:paddingRight="@dimen/dp_5"
android:layout_marginRight="@dimen/dp_5"
android:src="@drawable/ic_more" /> android:src="@drawable/ic_more" />
</LinearLayout> </LinearLayout>
......
...@@ -22,10 +22,11 @@ ...@@ -22,10 +22,11 @@
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="13dp"
android:text="供應商:" android:text="供應商:"
android:textColor="@color/black" android:textColor="@color/black"
android:textSize="@dimen/dp_17" android:textSize="@dimen/dp_17"
android:visibility="gone"
android:textStyle="bold" /> android:textStyle="bold" />
<TextView <TextView
......
<?xml version="1.0" encoding="utf-8"?>
<androidx.recyclerview.widget.RecyclerView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:background="@drawable/shape_white_eight_corners_bg"
android:elevation="@dimen/dp_10" />
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingLeft="@dimen/dp_10"
android:paddingTop="@dimen/dp_10"
android:paddingRight="@dimen/dp_10"
android:paddingBottom="@dimen/dp_10">
<ImageView
android:id="@+id/iv_image"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/tv_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_15" />
</LinearLayout>
\ No newline at end of file
...@@ -96,6 +96,9 @@ public abstract class BaseActivity<P extends IPresenter> extends AppCompatActivi ...@@ -96,6 +96,9 @@ public abstract class BaseActivity<P extends IPresenter> extends AppCompatActivi
if (QMUIDeviceHelper.isTablet(this)) { if (QMUIDeviceHelper.isTablet(this)) {
//平板端按照系統方向來 //平板端按照系統方向來
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED); setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED);
} else {
//手機端直接強制竖屏
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
} }
//DecorView的背景对我来说无用,但是会产生一次Overdraw,这里去掉(过度绘制优化) //DecorView的背景对我来说无用,但是会产生一次Overdraw,这里去掉(过度绘制优化)
getWindow().setBackgroundDrawable(null); getWindow().setBackgroundDrawable(null);
......
...@@ -104,7 +104,10 @@ public abstract class BaseFragmentActivity<P extends IPresenter> extends Fragmen ...@@ -104,7 +104,10 @@ public abstract class BaseFragmentActivity<P extends IPresenter> extends Fragmen
// .init(); // .init();
mDelegate.onCreate(savedInstanceState); mDelegate.onCreate(savedInstanceState);
mContext = this; mContext = this;
if (!QMUIDeviceHelper.isTablet(this)) { if (QMUIDeviceHelper.isTablet(this)) {
//平板端按照系統方向來
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED);
} else {
//手機端直接強制竖屏 //手機端直接強制竖屏
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
} }
......
...@@ -7,7 +7,9 @@ import com.gingersoft.gsa.cloud.common.core.user.UserContext; ...@@ -7,7 +7,9 @@ import com.gingersoft.gsa.cloud.common.core.user.UserContext;
import com.gingersoft.gsa.cloud.common.oaId.DeviceID; import com.gingersoft.gsa.cloud.common.oaId.DeviceID;
import com.gingersoft.gsa.cloud.common.utils.encryption.Aes; import com.gingersoft.gsa.cloud.common.utils.encryption.Aes;
import com.jess.arms.utils.DeviceUtils; import com.jess.arms.utils.DeviceUtils;
import java.io.IOException; import java.io.IOException;
import okhttp3.Headers; import okhttp3.Headers;
import okhttp3.Interceptor; import okhttp3.Interceptor;
import okhttp3.Request; import okhttp3.Request;
...@@ -29,8 +31,11 @@ public class HeadersInterceptor implements Interceptor { ...@@ -29,8 +31,11 @@ public class HeadersInterceptor implements Interceptor {
builder.set("appinfo", DeviceUtils.getVersionName(GsaCloudApplication.getAppContext())); builder.set("appinfo", DeviceUtils.getVersionName(GsaCloudApplication.getAppContext()));
builder.set("mobileId", "1"); builder.set("mobileId", "1");
builder.set("uid", UserContext.newInstance().getMemberId() + ""); builder.set("uid", UserContext.newInstance().getMemberId() + "");
builder.set("deviceId", DeviceID.getDeviceId());
String deviceId = DeviceID.getDeviceId();
if (deviceId != null) {
builder.set("deviceId", DeviceID.getDeviceId());
}
Headers headers = originalRequest.headers(); Headers headers = originalRequest.headers();
for (int i = 0; i < headers.size(); i++) { for (int i = 0; i < headers.size(); i++) {
builder.set(headers.name(i), headers.value(i)); builder.set(headers.name(i), headers.value(i));
......
package com.gingersoft.gsa.cloud.common.utils.inputFilter;
import android.content.Context;
import android.text.InputFilter;
import android.text.Spanned;
import com.gingersoft.gsa.cloud.common.utils.toast.ToastUtils;
/**
* @author 宇航.
* User: admin
* Date: 2021/1/19
* Time: 18:29
* Use:
*/
public class DecimalDigitsInputFilter implements InputFilter {
/**
* 限制小数位数
*/
private final int decimalDigits;
private Context context;
public DecimalDigitsInputFilter(Context context, int decimalDigits) {
this.decimalDigits = decimalDigits;
this.context = context;
}
@Override
public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend) {
int dotPos = -1;
int len = dest.length();
for (int i = 0; i < len; i++) {
char c = dest.charAt(i);
if (c == '.' || c == ',') {
dotPos = i;
break;
}
}
if (source.equals(".") && dstart == 0 && dend == 0) {
return "";
}
if (dotPos >= 0) {
// protects against many dots
if (source.equals(".") || source.equals(",")) {
return "";
}
// if the text is entered before the dot
if (dend <= dotPos) {
return null;
}
if (len - dotPos > decimalDigits) {
ToastUtils.show(context, "最多只能兩位小數");
return "";
}
}
return null;
}
}
...@@ -11,12 +11,12 @@ ...@@ -11,12 +11,12 @@
android:orientation="horizontal" android:orientation="horizontal"
app:cardElevation="@dimen/dp_10"> app:cardElevation="@dimen/dp_10">
<LinearLayout <RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal" android:orientation="horizontal"
android:paddingTop="@dimen/dp_10" android:paddingTop="@dimen/dp_5"
android:paddingBottom="@dimen/dp_10"> android:paddingBottom="@dimen/dp_5">
<TextView <TextView
android:id="@+id/tv_category_name" android:id="@+id/tv_category_name"
...@@ -24,22 +24,24 @@ ...@@ -24,22 +24,24 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:button="@null" android:button="@null"
android:ellipsize="marquee" android:ellipsize="marquee"
android:layout_toLeftOf="@id/iv_category_delete"
android:gravity="center_vertical" android:gravity="center_vertical"
android:paddingLeft="@dimen/dp_5" android:paddingLeft="@dimen/dp_5"
android:paddingRight="@dimen/dp_2" android:paddingRight="@dimen/dp_2"
android:singleLine="true"
android:textColor="@color/s_btn_blue_3c_text" android:textColor="@color/s_btn_blue_3c_text"
android:textSize="@dimen/dp_14" android:textSize="@dimen/dp_14"
android:textStyle="bold" android:textStyle="bold"
tools:text="果蔬類" /> tools:text="果蔬類看書福利卡駕駛的垃圾死了阿斯蘭大家啦款手機愛上了的框架拉三季度阿薩德科技拉屎" />
</LinearLayout>
<com.qmuiteam.qmui.alpha.QMUIAlphaImageButton <com.qmuiteam.qmui.alpha.QMUIAlphaImageButton
android:id="@+id/iv_category_delete" android:id="@+id/iv_category_delete"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_alignParentRight="true"
android:paddingLeft="@dimen/dp_5" android:paddingLeft="@dimen/dp_5"
android:paddingRight="@dimen/dp_5" android:paddingRight="@dimen/dp_5"
android:layout_gravity="right|center_vertical"
android:src="@drawable/ic_red_circular_delete" /> android:src="@drawable/ic_red_circular_delete" />
</RelativeLayout>
</androidx.cardview.widget.CardView> </androidx.cardview.widget.CardView>
\ No newline at end of file
...@@ -487,9 +487,11 @@ ...@@ -487,9 +487,11 @@
<color name="order_state2_color">#FF720A</color> <color name="order_state2_color">#FF720A</color>
<!-- 待取餐背景色--> <!-- 待取餐背景色-->
<color name="order_state3_color">#00479D</color> <color name="order_state3_color">#00479D</color>
<!-- 供應鏈部分收貨字體顏色 -->
<color name="order_state5_color">#EF9A1B</color>
<!-- 待製作按鈕背景色--> <!-- 待製作按鈕背景色-->
<color name="order_state4_color">#21AE37</color> <color name="order_state4_color">#21AE37</color>
<!-- 在線支付背景色--> <!-- 在線支付背景色-->
<color name="cash_on_delivery_bg">#E1BF32</color> <color name="cash_on_delivery_bg">#E1BF32</color>
<color name="online_payments_bg">#6EBF8D</color> <color name="online_payments_bg">#6EBF8D</color>
......
...@@ -84,6 +84,10 @@ public class PrinterDeviceBean implements Serializable { ...@@ -84,6 +84,10 @@ public class PrinterDeviceBean implements Serializable {
private String languageType; private String languageType;
public final static String LANGUAGE_ONE = "1";
public final static String LANGUAGE_TWO = "2";
public final static String LANGUAGE_THREE = "3";
@Generated(hash = 626885316) @Generated(hash = 626885316)
public PrinterDeviceBean() { public PrinterDeviceBean() {
} }
......
...@@ -79,6 +79,11 @@ public class PrjBean { ...@@ -79,6 +79,11 @@ public class PrjBean {
* 3:細項 * 3:細項
*/ */
private int itemType; private int itemType;
public final static int FOOD_MAIN = 1;
public final static int FOOD_SECONDARY = 2;
public final static int FOOD_THREE_LEVEL = 3;
private String sender; private String sender;
private String takeTime; private String takeTime;
......
...@@ -2,7 +2,6 @@ package com.gingersoft.gsa.cloud.ui.adapter.bean; ...@@ -2,7 +2,6 @@ package com.gingersoft.gsa.cloud.ui.adapter.bean;
import android.text.InputFilter; import android.text.InputFilter;
import android.text.TextWatcher; import android.text.TextWatcher;
import lombok.Data; import lombok.Data;
import me.yokeyword.fragmentation.ISupportFragment; import me.yokeyword.fragmentation.ISupportFragment;
......
...@@ -6,18 +6,17 @@ import android.view.View; ...@@ -6,18 +6,17 @@ import android.view.View;
import android.widget.EditText; import android.widget.EditText;
import android.widget.ImageView; import android.widget.ImageView;
import androidx.core.content.ContextCompat;
import com.chad.library.adapter.base.provider.BaseItemProvider; import com.chad.library.adapter.base.provider.BaseItemProvider;
import com.chad.library.adapter.base.viewholder.BaseViewHolder; import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.gingersoft.gsa.cloud.common.utils.other.TextUtil; import com.gingersoft.gsa.cloud.common.utils.other.TextUtil;
import com.gingersoft.gsa.cloud.ui.R; import com.gingersoft.gsa.cloud.ui.R;
import com.gingersoft.gsa.cloud.ui.adapter.bean.InfoMultiBean; import com.gingersoft.gsa.cloud.ui.adapter.bean.InfoMultiBean;
import com.gingersoft.gsa.cloud.ui.adapter.bean.MultiInputBean; import com.gingersoft.gsa.cloud.ui.adapter.bean.MultiInputBean;
import com.gingersoft.gsa.cloud.ui.adapter.bean.MultiSelectBean; import com.google.android.material.textfield.TextInputEditText;
import com.qmuiteam.qmui.util.QMUIKeyboardHelper;
import com.xuexiang.rxutil2.rxjava.RxJavaUtils;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import org.w3c.dom.Text;
/** /**
* @author 宇航. * @author 宇航.
...@@ -49,7 +48,7 @@ public class InputProvider<T extends InfoMultiBean> extends BaseItemProvider<T> ...@@ -49,7 +48,7 @@ public class InputProvider<T extends InfoMultiBean> extends BaseItemProvider<T>
} else { } else {
baseViewHolder.setText(R.id.tv_multi_title, ""); baseViewHolder.setText(R.id.tv_multi_title, "");
} }
EditText editText = baseViewHolder.getView(R.id.ed_multi_value); TextInputEditText editText = baseViewHolder.getView(R.id.ed_multi_value);
setFilters(editText, infoMultiBean); setFilters(editText, infoMultiBean);
initEditText(editText, infoMultiBean.getShowValue(), infoMultiBean.getHintText()); initEditText(editText, infoMultiBean.getShowValue(), infoMultiBean.getHintText());
...@@ -79,25 +78,27 @@ public class InputProvider<T extends InfoMultiBean> extends BaseItemProvider<T> ...@@ -79,25 +78,27 @@ public class InputProvider<T extends InfoMultiBean> extends BaseItemProvider<T>
editText.setOnFocusChangeListener((v, hasFocus) -> { editText.setOnFocusChangeListener((v, hasFocus) -> {
if (hasFocus) { if (hasFocus) {
editText.addTextChangedListener(textWatcher); editText.addTextChangedListener(textWatcher);
baseViewHolder.setGone(R.id.iv_clear_multi_content, TextUtil.isEmptyOrNullOrUndefined(editText)); RxJavaUtils.delay(1, aLong -> baseViewHolder.setGone(R.id.iv_clear_multi_content, TextUtil.isEmptyOrNullOrUndefined(editText)));
} else { } else {
editText.removeTextChangedListener(textWatcher); editText.removeTextChangedListener(textWatcher);
baseViewHolder.setGone(R.id.iv_clear_multi_content, true); RxJavaUtils.delay(1, aLong -> baseViewHolder.setGone(R.id.iv_clear_multi_content, true));
} }
}); });
ImageView ivClear = baseViewHolder.getView(R.id.iv_clear_multi_content); ImageView ivClear = baseViewHolder.getView(R.id.iv_clear_multi_content);
ivClear.setOnClickListener(v -> { ivClear.setOnClickListener(v -> {
editText.setText(""); editText.setText("");
editText.requestFocus();
QMUIKeyboardHelper.showKeyboard(editText, false);
ivClear.setVisibility(View.GONE); ivClear.setVisibility(View.GONE);
}); });
editText.setFocusable(infoMultiBean.isEdit()); editText.setFocusable(infoMultiBean.isEdit());
if (infoMultiBean.isEdit()) { // if (infoMultiBean.isEdit()) {
editText.setTextColor(ContextCompat.getColor(context, R.color.color_3c)); // editText.setTextColor(ContextCompat.getColor(context, R.color.color_3c));
} else { // } else {
editText.setTextColor(ContextCompat.getColor(context, R.color.color_c9)); // editText.setTextColor(ContextCompat.getColor(context, R.color.color_c9));
} // }
} }
......
...@@ -98,11 +98,11 @@ public class MultiCheckProvider<T extends InfoMultiBean> extends BaseItemProvide ...@@ -98,11 +98,11 @@ public class MultiCheckProvider<T extends InfoMultiBean> extends BaseItemProvide
editText.addTextChangedListener(infoMultiBean.getTextWatcher()); editText.addTextChangedListener(infoMultiBean.getTextWatcher());
editText.setFocusable(infoMultiBean.isEdit()); editText.setFocusable(infoMultiBean.isEdit());
if(infoMultiBean.isEdit()){ // if(infoMultiBean.isEdit()){
editText.setTextColor(ContextCompat.getColor(context, R.color.color_3c)); // editText.setTextColor(ContextCompat.getColor(context, R.color.color_3c));
} else { // } else {
editText.setTextColor(ContextCompat.getColor(context, R.color.color_c9)); // editText.setTextColor(ContextCompat.getColor(context, R.color.color_c9));
} // }
} }
private void setEditText(MultiCheckInputBean infoMultiBean, EditText editText) { private void setEditText(MultiCheckInputBean infoMultiBean, EditText editText) {
......
...@@ -89,10 +89,10 @@ public class SelectItemProvider<T extends InfoMultiBean> extends BaseItemProvide ...@@ -89,10 +89,10 @@ public class SelectItemProvider<T extends InfoMultiBean> extends BaseItemProvide
edFirst.removeTextChangedListener(textWatcher); edFirst.removeTextChangedListener(textWatcher);
} }
}); });
edFirst.setTextColor(getColor(R.color.color_3c)); // edFirst.setTextColor(getColor(R.color.color_3c));
} else { } else {
edFirst.setKeyListener(null); edFirst.setKeyListener(null);
edFirst.setTextColor(getColor(R.color.color_c9)); // edFirst.setTextColor(getColor(R.color.color_c9));
} }
// edFirst.setFocusableInTouchMode(multiSelectBean.isEdit()); // edFirst.setFocusableInTouchMode(multiSelectBean.isEdit());
// edFirst.setFocusable(multiSelectBean.isEdit()); // edFirst.setFocusable(multiSelectBean.isEdit());
......
package com.gingersoft.gsa.cloud.ui.view;
import android.content.Context;
import android.util.AttributeSet;
import android.widget.EditText;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
/**
* @author 宇航.
* User: admin
* Date: 2021/1/12
* Time: 16:57
* Use: 只能輸入兩位小數
* 小數位為0時只顯示整數位
*/
public class AmountEditText extends androidx.appcompat.widget.AppCompatEditText {
public AmountEditText(@NonNull Context context) {
super(context);
}
public AmountEditText(@NonNull Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
}
public AmountEditText(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
private void init(){
}
}
...@@ -8,13 +8,15 @@ ...@@ -8,13 +8,15 @@
<include layout="@layout/item_multi_title_layout" /> <include layout="@layout/item_multi_title_layout" />
<EditText <com.google.android.material.textfield.TextInputEditText
android:id="@+id/ed_multi_value" android:id="@+id/ed_multi_value"
style="@style/Multi_Input_editStyle" style="@style/Multi_Input_editStyle"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginLeft="@dimen/dp_5" android:layout_marginLeft="@dimen/dp_5"
android:layout_weight="1" android:layout_weight="1"
android:focusableInTouchMode="true"
android:focusable="true"
android:background="@null" android:background="@null"
tools:hint="請輸入食品組名稱" /> tools:hint="請輸入食品組名稱" />
......
...@@ -187,7 +187,16 @@ ...@@ -187,7 +187,16 @@
android:id="@+id/rv_kitchen_food" android:id="@+id/rv_kitchen_food"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_10" /> android:layout_marginTop="@dimen/dp_10"
android:visibility="gone" />
<LinearLayout
android:id="@+id/layout_kitchen_food"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_10"
android:orientation="vertical" />
<TextView <TextView
android:id="@+id/tv_kitchen_print_table_number2" android:id="@+id/tv_kitchen_print_table_number2"
......
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