Commit 654437d8 by 宁斌

修改餐廳操作相關類

parent fa4a065d
...@@ -238,6 +238,8 @@ public class GsaCloudApplication extends BaseApplication { ...@@ -238,6 +238,8 @@ public class GsaCloudApplication extends BaseApplication {
RetrofitUrlManager.getInstance().putDomain("ricepon_cloud_gsa", HttpsConstans.ricepon_cloud_gsa); RetrofitUrlManager.getInstance().putDomain("ricepon_cloud_gsa", HttpsConstans.ricepon_cloud_gsa);
//61177 //61177
RetrofitUrlManager.getInstance().putDomain("ricepon_member", HttpsConstans.RICEPON_MEMBER_61177); RetrofitUrlManager.getInstance().putDomain("ricepon_member", HttpsConstans.RICEPON_MEMBER_61177);
//餐廳模塊請求地址
RetrofitUrlManager.getInstance().putDomain("ricepon_restaurant", HttpsConstans.ROOT_SERVER_ADDRESS_FORMAL_RESTAURANT);
} }
private void initPrint() { private void initPrint() {
......
...@@ -39,7 +39,8 @@ public class HttpsConstans { ...@@ -39,7 +39,8 @@ public class HttpsConstans {
private static String HTTP_ADDRESS_URL_HK = "http://a.ricepon.com:58201";//香港測試 private static String HTTP_ADDRESS_URL_HK = "http://a.ricepon.com:58201";//香港測試
private static String HTTP_ADDRESS_URL_PRE = "http://prf-m.ricepon.com/";//預發佈 private static String HTTP_ADDRESS_URL_PRE = "http://prf-m.ricepon.com/";//預發佈
public static String CLOUD_GSA_API_PATH = "/ricepon-cloud-gsa/api/";//路徑 public static String CLOUD_GSA_API_PATH = "/ricepon-cloud-gsa/api/";//雲端GSA路徑
public static String RESTAURANT_API_PATH = "/ricepon-restaurant/api/";//餐廳模塊路徑
public static String ROOT_SERVER_YOU_CHANG_HK = "http://192.168.1.142:9012/api/"; //友常本地 public static String ROOT_SERVER_YOU_CHANG_HK = "http://192.168.1.142:9012/api/"; //友常本地
public static String ROOT_SERVER_ZHI_WANG_HK = "http://192.168.1.169:9012/api/"; //世維本地 public static String ROOT_SERVER_ZHI_WANG_HK = "http://192.168.1.169:9012/api/"; //世維本地
...@@ -97,6 +98,8 @@ public class HttpsConstans { ...@@ -97,6 +98,8 @@ public class HttpsConstans {
//默認url,配置這個值修改環境 //默認url,配置這個值修改環境
public static String ROOT_SERVER_ADDRESS_FORMAL = HTTP_ADDRESS_URL_FORMAL + CLOUD_GSA_API_PATH; public static String ROOT_SERVER_ADDRESS_FORMAL = HTTP_ADDRESS_URL_FORMAL + CLOUD_GSA_API_PATH;
public static String ROOT_SERVER_ADDRESS_FORMAL_RESTAURANT = HTTP_ADDRESS_URL_FORMAL + RESTAURANT_API_PATH;
public static String ROOT_SERVER = HTTP_ADDRESS_URL_FORMAL; public static String ROOT_SERVER = HTTP_ADDRESS_URL_FORMAL;
//修改這個值,配置外賣接單環境 //修改這個值,配置外賣接單環境
...@@ -128,6 +131,7 @@ public class HttpsConstans { ...@@ -128,6 +131,7 @@ public class HttpsConstans {
_SERVER_ADDRESS = HTTP_ADDRESS_URL_FORMAL + WECHAR_REPORT_PATH; _SERVER_ADDRESS = HTTP_ADDRESS_URL_FORMAL + WECHAR_REPORT_PATH;
ROOT_SETTLEMENT_REPORT_SERVER_ADDRESS_FORMAL = HTTP_ADDRESS_URL_FORMAL; ROOT_SETTLEMENT_REPORT_SERVER_ADDRESS_FORMAL = HTTP_ADDRESS_URL_FORMAL;
ROOT_SERVER_ADDRESS_FORMAL = HTTP_ADDRESS_URL_FORMAL + CLOUD_GSA_API_PATH; ROOT_SERVER_ADDRESS_FORMAL = HTTP_ADDRESS_URL_FORMAL + CLOUD_GSA_API_PATH;
ROOT_SERVER_ADDRESS_FORMAL_RESTAURANT = HTTP_ADDRESS_URL_FORMAL + RESTAURANT_API_PATH;
ROOT_URL = ROOT_FORMAL_URL; ROOT_URL = ROOT_FORMAL_URL;
REPORT_SERVER_ADDRESS = REPORT_FORMAL_ADDRESS + REPORT_PATH; REPORT_SERVER_ADDRESS = REPORT_FORMAL_ADDRESS + REPORT_PATH;
WECHAR_REPORT_SERVER_ADDRESS = WECHAR_REPORT_FORMAL_ADDRESS + WECHAR_REPORT_PATH;//正式:WECHAR_REPORT_FORMAL_ADDRESS 測試:WECHAR_REPORT_TEST_ADDRESS WECHAR_REPORT_SERVER_ADDRESS = WECHAR_REPORT_FORMAL_ADDRESS + WECHAR_REPORT_PATH;//正式:WECHAR_REPORT_FORMAL_ADDRESS 測試:WECHAR_REPORT_TEST_ADDRESS
...@@ -140,6 +144,7 @@ public class HttpsConstans { ...@@ -140,6 +144,7 @@ public class HttpsConstans {
_SERVER_ADDRESS = WECHAR_REPORT_TEST_ADDRESS + WECHAR_REPORT_PATH; _SERVER_ADDRESS = WECHAR_REPORT_TEST_ADDRESS + WECHAR_REPORT_PATH;
ROOT_SETTLEMENT_REPORT_SERVER_ADDRESS_FORMAL = REPORT_TEST_ADDRESS; ROOT_SETTLEMENT_REPORT_SERVER_ADDRESS_FORMAL = REPORT_TEST_ADDRESS;
ROOT_SERVER_ADDRESS_FORMAL = HTTP_ADDRESS_URL_HK + CLOUD_GSA_API_PATH; ROOT_SERVER_ADDRESS_FORMAL = HTTP_ADDRESS_URL_HK + CLOUD_GSA_API_PATH;
ROOT_SERVER_ADDRESS_FORMAL_RESTAURANT = HTTP_ADDRESS_URL_HK + RESTAURANT_API_PATH;
ROOT_URL = ROOT_HK_TEST_URL; ROOT_URL = ROOT_HK_TEST_URL;
REPORT_SERVER_ADDRESS = REPORT_TEST_ADDRESS + REPORT_PATH; REPORT_SERVER_ADDRESS = REPORT_TEST_ADDRESS + REPORT_PATH;
WECHAR_REPORT_SERVER_ADDRESS = WECHAR_REPORT_TEST_ADDRESS + WECHAR_REPORT_PATH;//正式:WECHAR_REPORT_FORMAL_ADDRESS 測試:WECHAR_REPORT_TEST_ADDRESS WECHAR_REPORT_SERVER_ADDRESS = WECHAR_REPORT_TEST_ADDRESS + WECHAR_REPORT_PATH;//正式:WECHAR_REPORT_FORMAL_ADDRESS 測試:WECHAR_REPORT_TEST_ADDRESS
...@@ -152,6 +157,7 @@ public class HttpsConstans { ...@@ -152,6 +157,7 @@ public class HttpsConstans {
_SERVER_ADDRESS = HTTP_ADDRESS_URL_PRE + WECHAR_REPORT_PATH; _SERVER_ADDRESS = HTTP_ADDRESS_URL_PRE + WECHAR_REPORT_PATH;
ROOT_SETTLEMENT_REPORT_SERVER_ADDRESS_FORMAL = HTTP_ADDRESS_URL_PRE; ROOT_SETTLEMENT_REPORT_SERVER_ADDRESS_FORMAL = HTTP_ADDRESS_URL_PRE;
ROOT_SERVER_ADDRESS_FORMAL = HTTP_ADDRESS_URL_PRE + CLOUD_GSA_API_PATH; ROOT_SERVER_ADDRESS_FORMAL = HTTP_ADDRESS_URL_PRE + CLOUD_GSA_API_PATH;
ROOT_SERVER_ADDRESS_FORMAL_RESTAURANT = HTTP_ADDRESS_URL_PRE + RESTAURANT_API_PATH;
ROOT_URL = HTTP_ADDRESS_URL_PRE; ROOT_URL = HTTP_ADDRESS_URL_PRE;
REPORT_SERVER_ADDRESS = HTTP_ADDRESS_URL_PRE + REPORT_PATH; REPORT_SERVER_ADDRESS = HTTP_ADDRESS_URL_PRE + REPORT_PATH;
WECHAR_REPORT_SERVER_ADDRESS = HTTP_ADDRESS_URL_PRE + WECHAR_REPORT_PATH; WECHAR_REPORT_SERVER_ADDRESS = HTTP_ADDRESS_URL_PRE + WECHAR_REPORT_PATH;
......
...@@ -43,7 +43,6 @@ public class MyGlobalHttpHandler implements GlobalHttpHandler { ...@@ -43,7 +43,6 @@ public class MyGlobalHttpHandler implements GlobalHttpHandler {
Headers headers = request.headers(); Headers headers = request.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));
} }
if(GsaCloudApplication.isLogin){ if(GsaCloudApplication.isLogin){
builder.set("token", token); builder.set("token", token);
......
...@@ -4,6 +4,4 @@ ...@@ -4,6 +4,4 @@
<item android:drawable="@drawable/shape_delivery_item_btn_normal"/> <item android:drawable="@drawable/shape_delivery_item_btn_normal"/>
</selector> </selector>
\ No newline at end of file
...@@ -7,8 +7,8 @@ ext { ...@@ -7,8 +7,8 @@ ext {
targetSdkVersion : 29, targetSdkVersion : 29,
//正式版: 1.0.3 3 //正式版: 1.0.3 3
//內部測試版:1.2.0 20 //內部測試版:1.2.0 20
versionCode : 10, versionCode : 11,
versionName : "1.1.0" versionName : "1.1.1"
] ]
version = [ version = [
......
...@@ -48,9 +48,13 @@ public class Discount { ...@@ -48,9 +48,13 @@ public class Discount {
public static final byte DISCOUNT_TYPE_KEYBOARD = 3; public static final byte DISCOUNT_TYPE_KEYBOARD = 3;
public static final byte DISCOUNT_TYPE_FREE_SERVICE_CHARGE = 4; public static final byte DISCOUNT_TYPE_FREE_SERVICE_CHARGE = 4;
/** /**
* 折扣可使用范围#0:食品;1:账单; * 折扣可使用范围#0:食品;1:账单;2:全部;
*/ */
private String discountType; private String discountType;
public static final byte discount_scope_commodity = 0;
public static final byte discount_scope_bill = 1;
public static final byte discount_scope_ALL = 2;
/** /**
* 状态#0:启用;1:禁用; * 状态#0:启用;1:禁用;
*/ */
...@@ -75,6 +79,11 @@ public class Discount { ...@@ -75,6 +79,11 @@ public class Discount {
* 落單類型 0:餐檯模式,1:外賣模式,2:外送模式,3:自取模式 * 落單類型 0:餐檯模式,1:外賣模式,2:外送模式,3:自取模式
*/ */
private String placeOrderType; private String placeOrderType;
public static final byte ORDER_TYPE_MEAL_STAND = 0;
public static final byte ORDER_TYPE_TAKEAWAY = 1;
public static final byte ORDER_TYPE_DELIVERY = 2;
public static final byte ORDER_TYPE_SELF_COLLECTION = 3;
/** /**
* 折扣上限 * 折扣上限
*/ */
......
...@@ -2,7 +2,6 @@ package com.gingersoft.gsa.delivery_pick_mode.model.viewModel ...@@ -2,7 +2,6 @@ package com.gingersoft.gsa.delivery_pick_mode.model.viewModel
import android.app.Dialog import android.app.Dialog
import android.content.Context import android.content.Context
import android.util.Log
import android.view.Gravity import android.view.Gravity
import android.view.WindowManager import android.view.WindowManager
import android.widget.TextView import android.widget.TextView
......
...@@ -147,7 +147,9 @@ public class OrderBean { ...@@ -147,7 +147,9 @@ public class OrderBean {
private Long id; private Long id;
private String productName; private String productName;
private long productId; private long productId;
//單價 /**
* 單價
*/
private double price; private double price;
private double lunchboxPrice; private double lunchboxPrice;
private int number; private int number;
...@@ -173,12 +175,12 @@ public class OrderBean { ...@@ -173,12 +175,12 @@ public class OrderBean {
private Long discountId; private Long discountId;
/**折扣實體*/ /**折扣實體*/
private RestaurantDiscountVO restaurantDiscountVO; private RestaurantDiscountVO restaurantDiscountVO;
/** /**
* 是否参与折扣#0:不參與;1:參與; * 是否参与服務費#0:不參與;1:參與;
**/ **/
private byte scAble = 1; private byte scAble = 1;
/** /**
* 額外食品加分 * 額外食品加分
*/ */
...@@ -341,10 +343,6 @@ public class OrderBean { ...@@ -341,10 +343,6 @@ public class OrderBean {
return restaurantDiscountVO; return restaurantDiscountVO;
} }
public void setRestaurantDiscountVO(RestaurantDiscountVO restaurantDiscountVO) {
this.restaurantDiscountVO = restaurantDiscountVO;
}
public byte getScAble() { public byte getScAble() {
return scAble; return scAble;
} }
......
...@@ -45,7 +45,7 @@ public class ShoppingCart { ...@@ -45,7 +45,7 @@ public class ShoppingCart {
/** /**
* 賬單項列表 * 賬單項列表
* *
* @see CopyOnWriteArrayList 賬單計算放在子線程中保證同步問題使用CopyOnWriteArrayList * @see
*/ */
protected List<BillItem> billItemList = new ArrayList<>(); protected List<BillItem> billItemList = new ArrayList<>();
/** /**
......
...@@ -2,7 +2,6 @@ package com.gingersoft.gsa.cloud.base.order.commodity; ...@@ -2,7 +2,6 @@ package com.gingersoft.gsa.cloud.base.order.commodity;
import com.gingersoft.gsa.cloud.base.order.bean.OrderBean; import com.gingersoft.gsa.cloud.base.order.bean.OrderBean;
import com.gingersoft.gsa.cloud.base.order.bean.discount.OrderDiscount;
import com.gingersoft.gsa.cloud.base.order.discount.NomalDiscount; import com.gingersoft.gsa.cloud.base.order.discount.NomalDiscount;
import com.gingersoft.gsa.cloud.base.order.order.BaseOrder; import com.gingersoft.gsa.cloud.base.order.order.BaseOrder;
import com.gingersoft.gsa.cloud.base.order.order.DoshokuOrder; import com.gingersoft.gsa.cloud.base.order.order.DoshokuOrder;
...@@ -363,8 +362,6 @@ public class MealCommodity implements Commodity { ...@@ -363,8 +362,6 @@ public class MealCommodity implements Commodity {
return mealCommodityList; return mealCommodityList;
} }
//PLU可输入子项
//食品数量支持小数 例如1.25
private static Discount getDiscountItem(OrderBean.OrderDetailsBean.RestaurantDiscountVO discountBean) { private static Discount getDiscountItem(OrderBean.OrderDetailsBean.RestaurantDiscountVO discountBean) {
Discount discount = new Discount(); Discount discount = new Discount();
discount.setId(discountBean.getId()); discount.setId(discountBean.getId());
......
...@@ -149,6 +149,6 @@ public interface MealStandContract { ...@@ -149,6 +149,6 @@ public interface MealStandContract {
List<FoodModifier> queryDB_FoodModifierList(long fid); List<FoodModifier> queryDB_FoodModifierList(long fid);
List<Discount> queryDB_DiscountList(String discountType); List<Discount> queryDB_DiscountList(byte discountScope, byte discountType);
} }
} }
...@@ -73,7 +73,7 @@ public interface OrderContentContract { ...@@ -73,7 +73,7 @@ public interface OrderContentContract {
//Model层定义接口,外部只需关心Model返回的数据,无需关心内部细节,即是否使用缓存 //Model层定义接口,外部只需关心Model返回的数据,无需关心内部细节,即是否使用缓存
interface Model extends BaseOrderContract.Model { interface Model extends BaseOrderContract.Model {
List<Discount> queryDB_DiscountList(String discountType); List<Discount> queryDB_DiscountList(byte discountScope, byte discountType);
Observable<BaseOrderRespose> createOrder(RequestBody requestBody); Observable<BaseOrderRespose> createOrder(RequestBody requestBody);
......
...@@ -65,6 +65,8 @@ public interface TableContract { ...@@ -65,6 +65,8 @@ public interface TableContract {
void startMealStandActivity(); void startMealStandActivity();
void setBottomFunctionVisibility(boolean show); void setBottomFunctionVisibility(boolean show);
void setLockVisibility(boolean show);
} }
//Model层定义接口,外部只需关心Model返回的数据,无需关心内部细节,即是否使用缓存 //Model层定义接口,外部只需关心Model返回的数据,无需关心内部细节,即是否使用缓存
...@@ -89,5 +91,7 @@ public interface TableContract { ...@@ -89,5 +91,7 @@ public interface TableContract {
Observable<BaseResult> getSplitTables(int tableId); Observable<BaseResult> getSplitTables(int tableId);
Observable<BaseResult> splitTable(int tableId); Observable<BaseResult> splitTable(int tableId);
Observable<BaseResult> getFoodSummarys(int restaurantId,boolean isDefault, byte businessType);
} }
} }
...@@ -21,6 +21,7 @@ import com.gingersoft.gsa.cloud.table.mvp.model.bean.FoodReason; ...@@ -21,6 +21,7 @@ import com.gingersoft.gsa.cloud.table.mvp.model.bean.FoodReason;
import com.gingersoft.gsa.cloud.table.mvp.model.service.MealService; import com.gingersoft.gsa.cloud.table.mvp.model.service.MealService;
import com.gingersoft.gsa.cloud.table.mvp.model.service.MemberService; import com.gingersoft.gsa.cloud.table.mvp.model.service.MemberService;
import com.gingersoft.gsa.cloud.table.mvp.model.service.OrderPayService; import com.gingersoft.gsa.cloud.table.mvp.model.service.OrderPayService;
import com.gingersoft.gsa.cloud.table.mvp.model.utils.MealConditionFilterUtils;
import com.google.gson.Gson; import com.google.gson.Gson;
import com.jess.arms.di.scope.ActivityScope; import com.jess.arms.di.scope.ActivityScope;
import com.jess.arms.integration.IRepositoryManager; import com.jess.arms.integration.IRepositoryManager;
...@@ -67,52 +68,6 @@ public class MealStandModel extends BaseModel implements MealStandContract.Model ...@@ -67,52 +68,6 @@ public class MealStandModel extends BaseModel implements MealStandContract.Model
this.mApplication = null; this.mApplication = null;
} }
/**
* 過濾食品條件
* @param foodList
* @param summary
* @return
*/
public List<Food> foodConditionFilter(List<Food> foodList, int summary) {
String strSummary = String.valueOf(summary);
List<Food> newFoodList = new ArrayList<>();
for (Food food : foodList) {
String foodSummary = food.getFoodSummary();
if (!TextUtils.isEmpty(foodSummary)) {
String[] summarys = foodSummary.split(",");
for (String item : summarys) {
if (item.equals(strSummary)) {
newFoodList.add(food);
}
}
}
}
return newFoodList;
}
/**
* 過濾套餐食品條件
* @param comboItemList
* @param summary
* @return
*/
public List<ComboItem> comboConditionFilter(List<ComboItem> comboItemList, int summary) {
String strSummary = String.valueOf(summary);
List<ComboItem> newComboItemList = new ArrayList<>();
for (ComboItem comboItem : comboItemList) {
String foodSummary = comboItem.getFoodSummary();
if (!TextUtils.isEmpty(foodSummary)) {
String[] summarys = foodSummary.split(",");
for (String item : summarys) {
if (item.equals(strSummary)) {
newComboItemList.add(comboItem);
}
}
}
}
return newComboItemList;
}
@Override @Override
public List<Food> queryDB_AllFoodList() { public List<Food> queryDB_AllFoodList() {
FoodDaoUtils foodDaoUtils = new FoodDaoUtils(mApplication); FoodDaoUtils foodDaoUtils = new FoodDaoUtils(mApplication);
...@@ -124,8 +79,7 @@ public class MealStandModel extends BaseModel implements MealStandContract.Model ...@@ -124,8 +79,7 @@ public class MealStandModel extends BaseModel implements MealStandContract.Model
public List<Food> queryDB_FoodGroupList(int foodSummary) { public List<Food> queryDB_FoodGroupList(int foodSummary) {
FoodDaoUtils foodDaoUtils = new FoodDaoUtils(mApplication); FoodDaoUtils foodDaoUtils = new FoodDaoUtils(mApplication);
List<Food> foods = foodDaoUtils.queryFoodGroupByQueryBuilder(foodSummary); List<Food> foods = foodDaoUtils.queryFoodGroupByQueryBuilder(foodSummary);
// return foods; return MealConditionFilterUtils.foodConditionFilter(foods,foodSummary);
return foodConditionFilter(foods,foodSummary);
} }
@Override @Override
...@@ -133,7 +87,7 @@ public class MealStandModel extends BaseModel implements MealStandContract.Model ...@@ -133,7 +87,7 @@ public class MealStandModel extends BaseModel implements MealStandContract.Model
FoodDaoUtils foodDaoUtils = new FoodDaoUtils(mApplication); FoodDaoUtils foodDaoUtils = new FoodDaoUtils(mApplication);
List<Food> foods = foodDaoUtils.queryFoodByQueryBuilder(parentId, foodSummary); List<Food> foods = foodDaoUtils.queryFoodByQueryBuilder(parentId, foodSummary);
// return foods; // return foods;
return foodConditionFilter(foods,foodSummary); return MealConditionFilterUtils.foodConditionFilter(foods,foodSummary);
} }
...@@ -147,8 +101,7 @@ public class MealStandModel extends BaseModel implements MealStandContract.Model ...@@ -147,8 +101,7 @@ public class MealStandModel extends BaseModel implements MealStandContract.Model
public List<ComboItem> queryDB_ComboList(long fid, int foodSummary) { public List<ComboItem> queryDB_ComboList(long fid, int foodSummary) {
ComboItemDaoUtils comboItemDao = new ComboItemDaoUtils(mApplication); ComboItemDaoUtils comboItemDao = new ComboItemDaoUtils(mApplication);
List<ComboItem> foodCombos = comboItemDao.queryComboItemsByFidQueryBuilder(fid, foodSummary); List<ComboItem> foodCombos = comboItemDao.queryComboItemsByFidQueryBuilder(fid, foodSummary);
// return foodCombos; return MealConditionFilterUtils.comboConditionFilter(foodCombos,foodSummary);
return comboConditionFilter(foodCombos,foodSummary);
} }
@Override @Override
...@@ -163,9 +116,10 @@ public class MealStandModel extends BaseModel implements MealStandContract.Model ...@@ -163,9 +116,10 @@ public class MealStandModel extends BaseModel implements MealStandContract.Model
} }
@Override @Override
public List<Discount> queryDB_DiscountList(String discountType) { public List<Discount> queryDB_DiscountList(byte discountScope, byte discountType) {
DiscountDaoUtils discountDaoUtils = new DiscountDaoUtils(mApplication); DiscountDaoUtils discountDaoUtils = new DiscountDaoUtils(mApplication);
return discountDaoUtils.queryDiscountByQueryBuilder(); List<Discount> discountList = discountDaoUtils.queryDiscountByQueryBuilder();
return MealConditionFilterUtils.discountConditionFilter(discountList,discountScope,discountType);
} }
@Override @Override
......
...@@ -14,6 +14,7 @@ import com.gingersoft.gsa.cloud.table.mvp.model.service.OrderPayService; ...@@ -14,6 +14,7 @@ import com.gingersoft.gsa.cloud.table.mvp.model.service.OrderPayService;
import com.gingersoft.gsa.cloud.table.mvp.model.service.TableService; import com.gingersoft.gsa.cloud.table.mvp.model.service.TableService;
import com.gingersoft.gsa.cloud.database.bean.Discount; import com.gingersoft.gsa.cloud.database.bean.Discount;
import com.gingersoft.gsa.cloud.database.utils.DiscountDaoUtils; import com.gingersoft.gsa.cloud.database.utils.DiscountDaoUtils;
import com.gingersoft.gsa.cloud.table.mvp.model.utils.MealConditionFilterUtils;
import com.google.gson.Gson; import com.google.gson.Gson;
import com.google.gson.internal.LinkedTreeMap; import com.google.gson.internal.LinkedTreeMap;
import com.jess.arms.di.scope.ActivityScope; import com.jess.arms.di.scope.ActivityScope;
...@@ -71,18 +72,19 @@ public class OrderContentModel extends BaseModel implements OrderContentContract ...@@ -71,18 +72,19 @@ public class OrderContentModel extends BaseModel implements OrderContentContract
} }
@Override @Override
public List<Discount> queryDB_DiscountList(String discountType) {
DiscountDaoUtils discountDaoUtils = new DiscountDaoUtils(mApplication);
return discountDaoUtils.queryDiscountByQueryBuilder();
}
@Override
public Observable<BaseOrderRespose> loadOrder(long orderId) { public Observable<BaseOrderRespose> loadOrder(long orderId) {
return mRepositoryManager.obtainRetrofitService(MealService.class) return mRepositoryManager.obtainRetrofitService(MealService.class)
.loadOrder(orderId); .loadOrder(orderId);
} }
@Override @Override
public List<Discount> queryDB_DiscountList(byte discountScope, byte discountType) {
DiscountDaoUtils discountDaoUtils = new DiscountDaoUtils(mApplication);
List<Discount> discountList = discountDaoUtils.queryDiscountByQueryBuilder();
return MealConditionFilterUtils.discountConditionFilter(discountList,discountScope,discountType);
}
@Override
public Observable<BaseOrderRespose> createOrder(RequestBody requestBody) { public Observable<BaseOrderRespose> createOrder(RequestBody requestBody) {
Observable ob = mRepositoryManager.obtainRetrofitService(MealService.class) Observable ob = mRepositoryManager.obtainRetrofitService(MealService.class)
.createOrder(requestBody) .createOrder(requestBody)
......
...@@ -23,6 +23,10 @@ import java.util.List; ...@@ -23,6 +23,10 @@ import java.util.List;
import javax.inject.Inject; import javax.inject.Inject;
import io.reactivex.Observable; import io.reactivex.Observable;
import io.reactivex.ObservableSource;
import io.reactivex.Observer;
import io.reactivex.functions.Consumer;
import io.reactivex.functions.Function;
import okhttp3.RequestBody; import okhttp3.RequestBody;
...@@ -74,13 +78,25 @@ public class TableModel extends BaseModel implements TableContract.Model { ...@@ -74,13 +78,25 @@ public class TableModel extends BaseModel implements TableContract.Model {
@Override @Override
public Observable<TableBean> getTables(int restaurantId) { public Observable<TableBean> getTables(int restaurantId) {
return mRepositoryManager.obtainRetrofitService(TableService.class) return mRepositoryManager.obtainRetrofitService(TableService.class)
.getTables(restaurantId); .getTables(restaurantId)
.doOnError(new Consumer<Throwable>() {
@Override
public void accept(Throwable throwable) throws Exception {
return;
}
})
.flatMap(new Function<TableBean, ObservableSource<TableBean>>() {
@Override
public ObservableSource<TableBean> apply(TableBean tableBean) throws Exception {
return Observable.just(tableBean);
}
});
} }
@Override @Override
public Observable<TableDetail> getTable(int tableId,String tableNumber) { public Observable<TableDetail> getTable(int tableId, String tableNumber) {
return mRepositoryManager.obtainRetrofitService(TableService.class) return mRepositoryManager.obtainRetrofitService(TableService.class)
.getTable(tableId,tableNumber); .getTable(tableId, tableNumber);
} }
@Override @Override
...@@ -119,5 +135,11 @@ public class TableModel extends BaseModel implements TableContract.Model { ...@@ -119,5 +135,11 @@ public class TableModel extends BaseModel implements TableContract.Model {
.splitTable(tableId); .splitTable(tableId);
} }
@Override
public Observable<BaseResult> getFoodSummarys(int restaurantId, boolean isDefault, byte businessType) {
return mRepositoryManager.obtainRetrofitService(TableService.class)
.getFoodSummarys(restaurantId, isDefault, businessType);
}
} }
\ No newline at end of file
...@@ -7,14 +7,26 @@ import lombok.Setter; ...@@ -7,14 +7,26 @@ import lombok.Setter;
* @author : bin * @author : bin
* @create date: 2020-11-03 * @create date: 2020-11-03
* @update date: 2020-11-03 * @update date: 2020-11-03
* @description: * @description: 餐種
*/ */
@Getter @Getter
@Setter @Setter
public class MealSummary { public class FoodSummary {
private int id;
private int restaurantId;
private String name; private String name;
private boolean isDefault;
/**
* 自定義字段
*/
private boolean selected = false;
/**
* 用餐時長
*/
private int mealLength = 120;
public static final byte BUSINESS_TYPE_TAKEWAY = 1;
public static final byte BUSINESS_TYPE_SKYORDER = 2;
} }
package com.gingersoft.gsa.cloud.table.mvp.model.constant;
/**
* @author : bin
* @create date: 2020-11-04
* @update date: 2020-11-04
* @description:
*/
public interface SkyOrderConstant {
String check_status = "check_status";
String delivery_time_hour = "delivery_time_hour";
String delivery_time_minute = "delivery_time_minute";
}
...@@ -4,11 +4,13 @@ import com.gingersoft.gsa.cloud.base.common.bean.BaseResult; ...@@ -4,11 +4,13 @@ import com.gingersoft.gsa.cloud.base.common.bean.BaseResult;
import com.gingersoft.gsa.cloud.base.table.bean.TableBean; import com.gingersoft.gsa.cloud.base.table.bean.TableBean;
import com.gingersoft.gsa.cloud.table.mvp.model.bean.BaseOrderRespose; import com.gingersoft.gsa.cloud.table.mvp.model.bean.BaseOrderRespose;
import com.gingersoft.gsa.cloud.table.mvp.model.bean.TableDetail; import com.gingersoft.gsa.cloud.table.mvp.model.bean.TableDetail;
import io.reactivex.Observable; import io.reactivex.Observable;
import me.jessyan.retrofiturlmanager.RetrofitUrlManager; import me.jessyan.retrofiturlmanager.RetrofitUrlManager;
import okhttp3.RequestBody; import okhttp3.RequestBody;
import retrofit2.http.Body; import retrofit2.http.Body;
import retrofit2.http.GET; import retrofit2.http.GET;
import retrofit2.http.Headers;
import retrofit2.http.POST; import retrofit2.http.POST;
import retrofit2.http.Query; import retrofit2.http.Query;
...@@ -41,4 +43,8 @@ public interface TableService { ...@@ -41,4 +43,8 @@ public interface TableService {
@GET("restaurantTable/getSplitTable" + RetrofitUrlManager.IDENTIFICATION_PATH_SIZE + 2) @GET("restaurantTable/getSplitTable" + RetrofitUrlManager.IDENTIFICATION_PATH_SIZE + 2)
Observable<BaseResult> splitTable(@Query("tableId") int tableId); Observable<BaseResult> splitTable(@Query("tableId") int tableId);
@Headers({"Domain-Name: ricepon_restaurant"})
@GET("summary/getSummaryBusinessList" + RetrofitUrlManager.IDENTIFICATION_PATH_SIZE + 2)
Observable<BaseResult> getFoodSummarys(@Query("restaurantId") int restaurantId, @Query("isDefault") boolean isDefault, @Query("businessType") byte businessType);
} }
package com.gingersoft.gsa.cloud.table.mvp.model.table.action; package com.gingersoft.gsa.cloud.table.mvp.model.table.action;
import android.app.Activity;
import android.content.Context; import android.content.Context;
import com.gingersoft.gsa.cloud.base.table.bean.TableBean; import com.gingersoft.gsa.cloud.base.table.bean.TableBean;
...@@ -14,7 +15,7 @@ import com.gingersoft.gsa.cloud.base.table.bean.TableBean; ...@@ -14,7 +15,7 @@ import com.gingersoft.gsa.cloud.base.table.bean.TableBean;
*/ */
public class MoveTableAction extends TableAction { public class MoveTableAction extends TableAction {
public MoveTableAction(Context context) { public MoveTableAction(Activity context) {
super(context, "轉台", "請選擇檯號", ""); super(context, "轉台", "請選擇檯號", "");
} }
...@@ -33,5 +34,8 @@ public class MoveTableAction extends TableAction { ...@@ -33,5 +34,8 @@ public class MoveTableAction extends TableAction {
return true; return true;
} }
@Override
public void destroy() {
}
} }
package com.gingersoft.gsa.cloud.table.mvp.model.table.action;
/**
* @author : bin
* @create date: 2020-11-04
* @update date: 2020-11-04
* @description: 操作網絡回調結果
*/
public interface OnNetworkCallbackListener<T> {
void onResult(T t);
void onError(Throwable t);
}
package com.gingersoft.gsa.cloud.table.mvp.model.table.action; package com.gingersoft.gsa.cloud.table.mvp.model.table.action;
import android.app.Activity;
import android.content.Context; import android.content.Context;
import com.billy.cc.core.component.CC;
import com.gingersoft.gsa.cloud.base.order.bean.OrderBean;
import com.gingersoft.gsa.cloud.base.order.commodity.OrderDetail;
import com.gingersoft.gsa.cloud.base.order.order.DoshokuOrder;
import com.gingersoft.gsa.cloud.base.table.bean.TableBean; import com.gingersoft.gsa.cloud.base.table.bean.TableBean;
import com.gingersoft.gsa.cloud.constans.PrintConstans;
import com.gingersoft.gsa.cloud.table.R; import com.gingersoft.gsa.cloud.table.R;
import com.gingersoft.gsa.cloud.table.mvp.model.bean.BaseOrderRespose;
import com.gingersoft.gsa.cloud.table.mvp.model.utils.OrderAssemblyUtil;
import com.gingersoft.gsa.cloud.table.mvp.presenter.TablePresenter;
import com.gingersoft.gsa.cloud.ui.widget.dialog.CommonTipDialog;
import com.qmuiteam.qmui.widget.dialog.QMUIDialog; import com.qmuiteam.qmui.widget.dialog.QMUIDialog;
import com.qmuiteam.qmui.widget.dialog.QMUIDialogAction; import com.qmuiteam.qmui.widget.dialog.QMUIDialogAction;
import java.util.ArrayList;
import java.util.List;
/** /**
* 作者:ELEGANT_BIN * 作者:ELEGANT_BIN
* 版本:1.6.0 * 版本:1.6.0
...@@ -15,9 +29,11 @@ import com.qmuiteam.qmui.widget.dialog.QMUIDialogAction; ...@@ -15,9 +29,11 @@ import com.qmuiteam.qmui.widget.dialog.QMUIDialogAction;
*/ */
public class PrintServingPaperAction extends TableAction { public class PrintServingPaperAction extends TableAction {
private TablePresenter mTablePresenter;
public PrintServingPaperAction(Context context) { public PrintServingPaperAction(Activity context, TablePresenter tablePresenter) {
super(context, "上菜紙", "請選擇檯號", ""); super(context, "上菜紙", "請選擇檯號", "");
this.mTablePresenter = tablePresenter;
} }
@Override @Override
...@@ -35,15 +51,65 @@ public class PrintServingPaperAction extends TableAction { ...@@ -35,15 +51,65 @@ public class PrintServingPaperAction extends TableAction {
return dataBean.getStatus() != 0; return dataBean.getStatus() != 0;
} }
public void showActionTipDialog(TableBean.DataBean dataBean) { @Override
public void destroy() {
mTablePresenter = null;
}
public void showActionTipDialog(TableBean.DataBean tableBean) {
QMUIDialog.MessageDialogBuilder dialogBuilder = new QMUIDialog.MessageDialogBuilder(mContext); QMUIDialog.MessageDialogBuilder dialogBuilder = new QMUIDialog.MessageDialogBuilder(mContext);
dialogBuilder.setTitleIcon(R.drawable.qmui_icon_dialog_doubt); dialogBuilder.setTitleIcon(R.drawable.qmui_icon_dialog_doubt);
dialogBuilder.setMessage("是否確認打印"); dialogBuilder.setMessage("是否確認打印");
dialogBuilder.addAction(0, "確認", QMUIDialogAction.ACTION_PROP_NEGATIVE, new QMUIDialogAction.ActionListener() { dialogBuilder.addAction(0, "確認", QMUIDialogAction.ACTION_PROP_NEGATIVE, new QMUIDialogAction.ActionListener() {
@Override @Override
public void onClick(QMUIDialog dialog, int index) { public void onClick(QMUIDialog dialog, int index) {
mTablePresenter.loadOrderToPrintParper(tableBean, new OnNetworkCallbackListener<BaseOrderRespose>() {
@Override
public void onResult(BaseOrderRespose respose) {
if (respose.isSuccess()) {
DoshokuOrder doshokuOrder = DoshokuOrder.getInstance();
doshokuOrder.setOpenTableInfo(new TableBean.DataBean());
TableBean.DataBean tableInfo = doshokuOrder.getOpenTableInfo();
tableInfo.setPerson(0);
OrderBean orderBean = respose.getData();
if (orderBean != null && respose.getData().getOrderDetails() != null) {
if (respose.getData().getCreateTime() != null && tableBean != null) {
//將開台時間設置為訂單創建時間
tableBean.setCreateTime(respose.getData().getCreateTime());
}
tableInfo.setPerson(orderBean.getPerson());
List<OrderBean.OrderDetailsBean> orderDetailsBeans = respose.getData().getOrderDetails();
//緩存訂單信息
doshokuOrder.setOrderPlaced(new OrderBean(orderBean));
//緩存食品信息
List<OrderDetail> orderDetailList = OrderAssemblyUtil.assemblyOrder(OrderDetail.orderTransOrderDetails(orderDetailsBeans));
doshokuOrder.getShoppingCart().setOrderCommodityList(orderDetailList);
} else {
doshokuOrder.setOrderPlaced(null);
doshokuOrder.getShoppingCart().setOrderCommodityList(new ArrayList<>());
}
doshokuOrder.setOpenTableInfo(tableBean);
printParper();
} else {
CommonTipDialog.showSurpisedDialog(mContext, respose.getErrMsg(), null, null, null, null, null);
}
}
@Override
public void onError(Throwable t) {
}
});
dialog.dismiss(); dialog.dismiss();
loadOrderToPrint(dataBean);
} }
}); });
dialogBuilder.addAction("取消", new QMUIDialogAction.ActionListener() { dialogBuilder.addAction("取消", new QMUIDialogAction.ActionListener() {
...@@ -55,4 +121,21 @@ public class PrintServingPaperAction extends TableAction { ...@@ -55,4 +121,21 @@ public class PrintServingPaperAction extends TableAction {
}); });
dialogBuilder.create(R.style.MyDialogTheme2).show(); dialogBuilder.create(R.style.MyDialogTheme2).show();
} }
/**
* 打印上菜紙
*/
private void printParper() {
CC.obtainBuilder("Component.Print")
.setActionName("printActivity")
.addParam(PrintConstans.PRINT_TYPE, PrintConstans.PRINT_SERVE)
.build()
.callAsyncCallbackOnMainThread((cc, result) -> {
//清空賬單數據
DoshokuOrder.getInstance().initialization();
cancel();
});
}
} }
package com.gingersoft.gsa.cloud.table.mvp.model.table.action; package com.gingersoft.gsa.cloud.table.mvp.model.table.action;
import android.app.Activity;
import android.content.Context; import android.content.Context;
import com.gingersoft.gsa.cloud.base.common.bean.BaseResult;
import com.gingersoft.gsa.cloud.base.table.bean.TableBean; import com.gingersoft.gsa.cloud.base.table.bean.TableBean;
import com.gingersoft.gsa.cloud.base.utils.JsonUtils;
import com.gingersoft.gsa.cloud.table.mvp.model.bean.FoodSummary;
import com.gingersoft.gsa.cloud.table.mvp.presenter.TablePresenter;
import com.gingersoft.gsa.cloud.table.mvp.ui.widget.SkyOrderDialog;
import com.gingersoft.gsa.cloud.ui.widget.dialog.BaseRetryDialog;
import java.util.List;
/** /**
...@@ -14,14 +23,17 @@ import com.gingersoft.gsa.cloud.base.table.bean.TableBean; ...@@ -14,14 +23,17 @@ import com.gingersoft.gsa.cloud.base.table.bean.TableBean;
*/ */
public class PrintSkyOrderAction extends TableAction { public class PrintSkyOrderAction extends TableAction {
private TablePresenter mTablePresenter;
private SkyOrderDialog mSkyOrderDialog;
public PrintSkyOrderAction(Context context) { public PrintSkyOrderAction(Activity context, TablePresenter tablePresenter) {
super(context, "打印skyorder", "請選擇檯號", ""); super(context, "打印skyorder", "請選擇檯號", "");
this.mTablePresenter = tablePresenter;
} }
@Override @Override
public void action(TableBean.DataBean dataBean) { public void action(TableBean.DataBean dataBean) {
showSkyOrderDialog();
} }
@Override @Override
...@@ -29,4 +41,65 @@ public class PrintSkyOrderAction extends TableAction { ...@@ -29,4 +41,65 @@ public class PrintSkyOrderAction extends TableAction {
return true; return true;
} }
@Override
public void destroy() {
mTablePresenter = null;
if (mSkyOrderDialog != null) {
mSkyOrderDialog.dismiss();
mSkyOrderDialog = null;
}
}
public void showSkyOrderDialog() {
if (mSkyOrderDialog == null) {
mSkyOrderDialog = new SkyOrderDialog(mContext).build();
mSkyOrderDialog.setOnRetryListener(new BaseRetryDialog.OnRetryListener() {
@Override
public void onRetryClick() {
getFoodSummarys();
}
});
mSkyOrderDialog.setCallbackListener(new SkyOrderDialog.OnCallbackListener() {
@Override
public void lockState(boolean state) {
skyOrderLockStateAction(state);
}
@Override
public void onPrint() {
}
});
getFoodSummarys();
}
mSkyOrderDialog.show();
}
private void getFoodSummarys(){
mTablePresenter.getFoodSummarys(new OnNetworkCallbackListener<BaseResult>() {
@Override
public void onResult(BaseResult result) {
if (result.isSuccess()) {
if (result.getData() != null) {
List<FoodSummary> foodSummaryList = JsonUtils.parseArray(result.getData(), FoodSummary.class);
mSkyOrderDialog.updateFoodSummaryList(foodSummaryList);
} else {
mSkyOrderDialog.showEmptyView(true,0,null);
}
} else {
mSkyOrderDialog.showEmptyView(false,0,null);
}
mSkyOrderDialog.setProgressVisibility(false);
}
@Override
public void onError(Throwable t) {
mSkyOrderDialog.showEmptyView(false,0,t);
mSkyOrderDialog.setProgressVisibility(false);
}
});
mSkyOrderDialog.setProgressVisibility(true);
}
} }
...@@ -18,21 +18,18 @@ import com.qmuiteam.qmui.widget.dialog.QMUIDialogAction; ...@@ -18,21 +18,18 @@ import com.qmuiteam.qmui.widget.dialog.QMUIDialogAction;
*/ */
public class ResetTableAction extends TableAction { public class ResetTableAction extends TableAction {
public ResetTableAction(Context context) { public ResetTableAction(Activity context) {
super(context, "重置餐檯", "請選擇需要重置的檯號", ""); super(context, "重置餐檯", "請選擇需要重置的檯號", "");
} }
@Override @Override
public void action(TableBean.DataBean dataBean) { public void action(TableBean.DataBean dataBean) {
new SkyOrderDialog((Activity) mContext) setOperatContentText(dataBean.getTableName());
.build() if (dataBean.getSplitStatus() == 1) {
.show(); showSplitTableDialogAction();
// setOperatContentText(dataBean.getTableName()); } else {
// if (dataBean.getSplitStatus() == 1) { showActionTipDialog(dataBean);
// showSplitTableDialogAction(); }
// } else {
// showActionTipDialog(dataBean);
// }
} }
@Override @Override
...@@ -40,6 +37,10 @@ public class ResetTableAction extends TableAction { ...@@ -40,6 +37,10 @@ public class ResetTableAction extends TableAction {
return dataBean.getUseStatus() == 1 || dataBean.getSplitStatus() == 1; return dataBean.getUseStatus() == 1 || dataBean.getSplitStatus() == 1;
} }
@Override
public void destroy() {
}
public void showActionTipDialog(TableBean.DataBean dataBean) { public void showActionTipDialog(TableBean.DataBean dataBean) {
QMUIDialog.MessageDialogBuilder dialogBuilder = new QMUIDialog.MessageDialogBuilder(mContext); QMUIDialog.MessageDialogBuilder dialogBuilder = new QMUIDialog.MessageDialogBuilder(mContext);
dialogBuilder.setTitleIcon(R.drawable.qmui_icon_dialog_doubt); dialogBuilder.setTitleIcon(R.drawable.qmui_icon_dialog_doubt);
......
package com.gingersoft.gsa.cloud.table.mvp.model.table.action; package com.gingersoft.gsa.cloud.table.mvp.model.table.action;
import android.app.Activity;
import android.content.Context; import android.content.Context;
import com.gingersoft.gsa.cloud.base.table.bean.TableBean; import com.gingersoft.gsa.cloud.base.table.bean.TableBean;
...@@ -13,7 +14,7 @@ import com.gingersoft.gsa.cloud.base.table.bean.TableBean; ...@@ -13,7 +14,7 @@ import com.gingersoft.gsa.cloud.base.table.bean.TableBean;
*/ */
public class SplitTableAction extends TableAction { public class SplitTableAction extends TableAction {
public SplitTableAction(Context context) { public SplitTableAction(Activity context) {
super(context, "分檯", "請選擇檯號", ""); super(context, "分檯", "請選擇檯號", "");
} }
...@@ -28,4 +29,9 @@ public class SplitTableAction extends TableAction { ...@@ -28,4 +29,9 @@ public class SplitTableAction extends TableAction {
return dataBean.getStatus() != 0; return dataBean.getStatus() != 0;
} }
@Override
public void destroy() {
}
} }
package com.gingersoft.gsa.cloud.table.mvp.model.table.action; package com.gingersoft.gsa.cloud.table.mvp.model.table.action;
import android.app.Activity;
import android.content.Context; import android.content.Context;
import com.gingersoft.gsa.cloud.base.table.bean.TableBean; import com.gingersoft.gsa.cloud.base.table.bean.TableBean;
import com.gingersoft.gsa.cloud.patterns.Strategy; import com.gingersoft.gsa.cloud.patterns.Strategy;
import com.gingersoft.gsa.cloud.table.mvp.ui.widget.SkyOrderDialog;
import lombok.Data; import lombok.Data;
/** /**
...@@ -15,25 +19,29 @@ import lombok.Data; ...@@ -15,25 +19,29 @@ import lombok.Data;
@Data @Data
public abstract class TableAction implements Strategy<TableBean.DataBean> { public abstract class TableAction implements Strategy<TableBean.DataBean> {
public Context mContext; protected Activity mContext;
protected String actionTitle; protected String actionTitle;
protected String actionHint; protected String actionHint;
protected String actionContent; protected String actionContent;
public TableAction(Context context) { public TableAction(Activity context) {
this.mContext = context; this.mContext = context;
} }
public TableAction(Context context, String actionTitle, String actionHint, String actionContent) { public TableAction(Activity context, String actionTitle, String actionHint, String actionContent) {
this.mContext = context; this.mContext = context;
this.actionTitle = actionTitle; this.actionTitle = actionTitle;
this.actionHint = actionHint; this.actionHint = actionHint;
this.actionContent = actionContent; this.actionContent = actionContent;
} }
/**不同餐檯操作,對餐檯的過濾條件*/ /**
* 不同餐檯操作,對餐檯的過濾條件
*/
public abstract boolean filterTableCondition(TableBean.DataBean dataBean); public abstract boolean filterTableCondition(TableBean.DataBean dataBean);
public abstract void destroy();
protected void setOperatContentText(String content) { protected void setOperatContentText(String content) {
if (actionListener != null) { if (actionListener != null) {
actionListener.setOperatContentText(content); actionListener.setOperatContentText(content);
...@@ -52,12 +60,6 @@ public abstract class TableAction implements Strategy<TableBean.DataBean> { ...@@ -52,12 +60,6 @@ public abstract class TableAction implements Strategy<TableBean.DataBean> {
} }
} }
protected void loadOrderToPrint(TableBean.DataBean tableBean) {
if (actionListener != null) {
actionListener.loadOrderToPrint(tableBean);
}
}
protected void showSplitTableDialogAction() { protected void showSplitTableDialogAction() {
if (actionListener != null) { if (actionListener != null) {
actionListener.showSplitTableDialogAction(); actionListener.showSplitTableDialogAction();
...@@ -70,6 +72,12 @@ public abstract class TableAction implements Strategy<TableBean.DataBean> { ...@@ -70,6 +72,12 @@ public abstract class TableAction implements Strategy<TableBean.DataBean> {
} }
} }
protected void skyOrderLockStateAction(boolean state) {
if (actionListener != null) {
actionListener.skyOrderLockState(state);
}
}
public void cancel() { public void cancel() {
if (actionListener != null) { if (actionListener != null) {
actionListener.cancel(); actionListener.cancel();
...@@ -89,12 +97,12 @@ public abstract class TableAction implements Strategy<TableBean.DataBean> { ...@@ -89,12 +97,12 @@ public abstract class TableAction implements Strategy<TableBean.DataBean> {
void moveTable(TableBean.DataBean tableBean); void moveTable(TableBean.DataBean tableBean);
void loadOrderToPrint(TableBean.DataBean tableBean);
void splitTableAction(TableBean.DataBean tableBean); void splitTableAction(TableBean.DataBean tableBean);
void showSplitTableDialogAction(); void showSplitTableDialogAction();
void skyOrderLockState(boolean state);
void cancel(); void cancel();
} }
} }
package com.gingersoft.gsa.cloud.table.mvp.model.utils;
import java.util.List;
/**
* 作者:ELEGANT_BIN
* 版本:1.6.0
* 创建日期:2019/3/14
* 修订历史:2019/3/14
* 描述:
*/
public class MathUtils {
/**
* 在一組数据内,找相近的数
*
* @param list
* @param targetNum 接近的数字
*/
public static int findRecentNum(List<Integer> list, int targetNum) {
// 差值实始化
int diffNum = Math.abs(list.get(0) - targetNum);
// 最终结果
int result = list.get(0);
for (Integer integer : list) {
int diffNumTemp = Math.abs(integer - targetNum);
if (diffNumTemp < diffNum) {
diffNum = diffNumTemp;
result = integer;
}
}
return result;
}
}
package com.gingersoft.gsa.cloud.table.mvp.model.utils;
import android.text.TextUtils;
import com.gingersoft.gsa.cloud.database.bean.ComboItem;
import com.gingersoft.gsa.cloud.database.bean.Discount;
import com.gingersoft.gsa.cloud.database.bean.Food;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author : bin
* @create date: 2020-11-04
* @update date: 2020-11-04
* @description:餐牌相關數據條件過濾
*/
public class MealConditionFilterUtils {
/**
* 過濾食品條件
*
* @param foodList
* @param summary
* @return
*/
public static List<Food> foodConditionFilter(List<Food> foodList, int summary) {
String strSummary = String.valueOf(summary);
List<Food> newFoodList = new ArrayList<>();
for (Food food : foodList) {
String foodSummary = food.getFoodSummary();
if (!TextUtils.isEmpty(foodSummary)) {
String[] summarys = foodSummary.split(",");
for (String item : summarys) {
if (item.equals(strSummary)) {
newFoodList.add(food);
}
}
}
}
return newFoodList;
}
/**
* 過濾套餐食品條件
*
* @param comboItemList
* @param summary
* @return
*/
public static List<ComboItem> comboConditionFilter(List<ComboItem> comboItemList, int summary) {
String strSummary = String.valueOf(summary);
List<ComboItem> newComboItemList = new ArrayList<>();
for (ComboItem comboItem : comboItemList) {
String foodSummary = comboItem.getFoodSummary();
if (!TextUtils.isEmpty(foodSummary)) {
String[] summarys = foodSummary.split(",");
for (String item : summarys) {
if (item.equals(strSummary)) {
newComboItemList.add(comboItem);
}
}
}
}
return newComboItemList;
}
/**
* 過濾折扣條件
*
* @param discountList
* @param discountScope 折扣可使用范围
* @param placeOrderType 落單類型
* @return
*/
public static List<Discount> discountConditionFilter(List<Discount> discountList, byte discountScope, byte placeOrderType) {
String strScope = String.valueOf(discountScope);
String strType = String.valueOf(placeOrderType);
Map<String, Discount> newDiscountMaps = new HashMap<>();
for (Discount discount : discountList) {
newDiscountMaps.put(discount.getDiscountType() + "_" + discount.getPlaceOrderType(), discount);
}
List<Discount> newDiscountList = new ArrayList<>();
for (String key : newDiscountMaps.keySet()) {
String[] keys = key.split("_");
if (keys.length == 2) {
String scopeKey = keys[0];
String typeKeFy = keys[1];
boolean withinRange = scopeKey.contains(String.valueOf(Discount.discount_scope_ALL)) || scopeKey.contains(strScope);
if (withinRange && typeKeFy.contains(strType)) {
Discount discount = newDiscountMaps.get(key);
newDiscountList.add(discount);
}
}
}
return newDiscountList;
}
}
...@@ -2,7 +2,6 @@ package com.gingersoft.gsa.cloud.table.mvp.presenter; ...@@ -2,7 +2,6 @@ package com.gingersoft.gsa.cloud.table.mvp.presenter;
import android.app.Activity; import android.app.Activity;
import android.app.Application; import android.app.Application;
import android.os.Looper;
import android.text.TextUtils; import android.text.TextUtils;
import android.widget.TextView; import android.widget.TextView;
...@@ -19,8 +18,6 @@ import com.gingersoft.gsa.cloud.base.order.billItem.DiscountItem; ...@@ -19,8 +18,6 @@ import com.gingersoft.gsa.cloud.base.order.billItem.DiscountItem;
import com.gingersoft.gsa.cloud.base.order.billItem.RoundingItem; import com.gingersoft.gsa.cloud.base.order.billItem.RoundingItem;
import com.gingersoft.gsa.cloud.base.order.billItem.ServiceChargeItem; import com.gingersoft.gsa.cloud.base.order.billItem.ServiceChargeItem;
import com.gingersoft.gsa.cloud.base.order.cart.ShoppingCart; import com.gingersoft.gsa.cloud.base.order.cart.ShoppingCart;
import com.gingersoft.gsa.cloud.base.order.commodity.MealCommodity;
import com.gingersoft.gsa.cloud.base.order.discount.MultyDiscount;
import com.gingersoft.gsa.cloud.base.order.discount.NomalDiscount; import com.gingersoft.gsa.cloud.base.order.discount.NomalDiscount;
import com.gingersoft.gsa.cloud.base.order.order.BaseOrder; import com.gingersoft.gsa.cloud.base.order.order.BaseOrder;
import com.gingersoft.gsa.cloud.base.order.order.DoshokuOrder; import com.gingersoft.gsa.cloud.base.order.order.DoshokuOrder;
...@@ -55,8 +52,6 @@ import java.util.ArrayList; ...@@ -55,8 +52,6 @@ import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.logging.Handler;
import javax.inject.Inject; import javax.inject.Inject;
...@@ -301,7 +296,6 @@ public abstract class BaseOrderPresenter<M extends BaseOrderContract.Model, V ex ...@@ -301,7 +296,6 @@ public abstract class BaseOrderPresenter<M extends BaseOrderContract.Model, V ex
setOrderMealPasteDSMark(); setOrderMealPasteDSMark();
//計算折扣金額 //計算折扣金額
double discountableMoney = getDiscountableAmount(); double discountableMoney = getDiscountableAmount();
// if (discountableMoney > 0 && mShoppingCart.getMultyDiscountList().size() > 0) {
if (mShoppingCart.getMultyDiscountList().size() > 0) { if (mShoppingCart.getMultyDiscountList().size() > 0) {
//調用折扣鏈進行計算 //調用折扣鏈進行計算
totalAmount = MoneyUtil.sub(totalAmount, mShoppingCart.calculateLinkedDiscounts(discountableMoney)); totalAmount = MoneyUtil.sub(totalAmount, mShoppingCart.calculateLinkedDiscounts(discountableMoney));
......
...@@ -17,6 +17,7 @@ import com.gingersoft.gsa.cloud.base.utils.LanguageUtils; ...@@ -17,6 +17,7 @@ import com.gingersoft.gsa.cloud.base.utils.LanguageUtils;
import com.gingersoft.gsa.cloud.base.utils.MoneyUtil; import com.gingersoft.gsa.cloud.base.utils.MoneyUtil;
import com.gingersoft.gsa.cloud.base.utils.RestaurantExpandInfoUtils; import com.gingersoft.gsa.cloud.base.utils.RestaurantExpandInfoUtils;
import com.gingersoft.gsa.cloud.base.utils.gson.GsonUtils; import com.gingersoft.gsa.cloud.base.utils.gson.GsonUtils;
import com.gingersoft.gsa.cloud.constans.FoodSummaryConstans;
import com.gingersoft.gsa.cloud.table.R; import com.gingersoft.gsa.cloud.table.R;
import com.gingersoft.gsa.cloud.table.mvp.contract.MealStandContract; import com.gingersoft.gsa.cloud.table.mvp.contract.MealStandContract;
import com.gingersoft.gsa.cloud.table.mvp.model.bean.FoodReason; import com.gingersoft.gsa.cloud.table.mvp.model.bean.FoodReason;
...@@ -51,13 +52,11 @@ import com.jess.arms.integration.AppManager; ...@@ -51,13 +52,11 @@ import com.jess.arms.integration.AppManager;
import com.jess.arms.utils.RxLifecycleUtils; import com.jess.arms.utils.RxLifecycleUtils;
import com.qmuiteam.qmui.widget.dialog.QMUIDialog; import com.qmuiteam.qmui.widget.dialog.QMUIDialog;
import com.qmuiteam.qmui.widget.dialog.QMUIDialogAction; import com.qmuiteam.qmui.widget.dialog.QMUIDialogAction;
import com.xuexiang.rxutil2.RxBindingUtils;
import org.simple.eventbus.Subscriber; import org.simple.eventbus.Subscriber;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.concurrent.TimeUnit;
import javax.inject.Inject; import javax.inject.Inject;
...@@ -68,7 +67,6 @@ import io.reactivex.Observer; ...@@ -68,7 +67,6 @@ import io.reactivex.Observer;
import io.reactivex.android.schedulers.AndroidSchedulers; import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.annotations.NonNull; import io.reactivex.annotations.NonNull;
import io.reactivex.disposables.Disposable; import io.reactivex.disposables.Disposable;
import io.reactivex.functions.Consumer;
import io.reactivex.schedulers.Schedulers; import io.reactivex.schedulers.Schedulers;
import me.jessyan.rxerrorhandler.core.RxErrorHandler; import me.jessyan.rxerrorhandler.core.RxErrorHandler;
import me.jessyan.rxerrorhandler.handler.ErrorHandleSubscriber; import me.jessyan.rxerrorhandler.handler.ErrorHandleSubscriber;
...@@ -2051,7 +2049,12 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod ...@@ -2051,7 +2049,12 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
} }
mCurrentOrderDetailBean = currentOrderBean; mCurrentOrderDetailBean = currentOrderBean;
List<Discount> discountList = filterDiscountByType(mModel.queryDB_DiscountList("0"), "0"); List<Discount> discountList;
if (BaseOrder.isCurrentOrderType(FoodSummaryConstans.TAKEAWAY_TYPE)) {
discountList = mModel.queryDB_DiscountList(Discount.discount_scope_commodity, Discount.ORDER_TYPE_TAKEAWAY);
} else {
discountList = mModel.queryDB_DiscountList(Discount.discount_scope_commodity, Discount.ORDER_TYPE_MEAL_STAND);
}
mDiscountList.clear(); mDiscountList.clear();
mDiscountList.addAll(discountList); mDiscountList.addAll(discountList);
......
...@@ -53,27 +53,23 @@ import com.gingersoft.gsa.cloud.table.mvp.ui.widget.DiscountDialog; ...@@ -53,27 +53,23 @@ import com.gingersoft.gsa.cloud.table.mvp.ui.widget.DiscountDialog;
import com.gingersoft.gsa.cloud.table.mvp.ui.widget.SplitTableDialog; import com.gingersoft.gsa.cloud.table.mvp.ui.widget.SplitTableDialog;
import com.gingersoft.gsa.cloud.ui.widget.dialog.BaseRetryDialog; import com.gingersoft.gsa.cloud.ui.widget.dialog.BaseRetryDialog;
import com.gingersoft.gsa.cloud.ui.widget.dialog.CommonTipDialog; import com.gingersoft.gsa.cloud.ui.widget.dialog.CommonTipDialog;
import com.jakewharton.rxbinding2.view.RxView;
import com.jess.arms.di.scope.ActivityScope; import com.jess.arms.di.scope.ActivityScope;
import com.jess.arms.http.imageloader.ImageLoader; import com.jess.arms.http.imageloader.ImageLoader;
import com.jess.arms.integration.AppManager; import com.jess.arms.integration.AppManager;
import com.jess.arms.utils.ArmsUtils; import com.jess.arms.utils.ArmsUtils;
import com.jess.arms.utils.RxLifecycleUtils; import com.jess.arms.utils.RxLifecycleUtils;
import com.scwang.smartrefresh.layout.api.RefreshLayout; import com.scwang.smartrefresh.layout.api.RefreshLayout;
import com.xuexiang.rxutil2.RxBindingUtils;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.Comparator; import java.util.Comparator;
import java.util.List; import java.util.List;
import java.util.concurrent.TimeUnit;
import javax.inject.Inject; import javax.inject.Inject;
import io.reactivex.android.schedulers.AndroidSchedulers; import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.annotations.NonNull; import io.reactivex.annotations.NonNull;
import io.reactivex.disposables.Disposable; import io.reactivex.disposables.Disposable;
import io.reactivex.functions.Consumer;
import io.reactivex.schedulers.Schedulers; import io.reactivex.schedulers.Schedulers;
import me.jessyan.rxerrorhandler.core.RxErrorHandler; import me.jessyan.rxerrorhandler.core.RxErrorHandler;
import me.jessyan.rxerrorhandler.handler.ErrorHandleSubscriber; import me.jessyan.rxerrorhandler.handler.ErrorHandleSubscriber;
...@@ -780,7 +776,13 @@ public class OrderContentPresenter extends BaseOrderPresenter<OrderContentContra ...@@ -780,7 +776,13 @@ public class OrderContentPresenter extends BaseOrderPresenter<OrderContentContra
} }
}); });
} }
List<Discount> discountList = filterDiscountByType(mModel.queryDB_DiscountList("1"), "1"); List<Discount> discountList;
if (BaseOrder.isCurrentOrderType(FoodSummaryConstans.TAKEAWAY_TYPE)) {
discountList = mModel.queryDB_DiscountList(Discount.discount_scope_bill, Discount.ORDER_TYPE_TAKEAWAY);
} else {
discountList = mModel.queryDB_DiscountList(Discount.discount_scope_bill, Discount.ORDER_TYPE_MEAL_STAND);
}
mDiscountDialog.addItems(discountList); mDiscountDialog.addItems(discountList);
mDiscountDialog.build().show(); mDiscountDialog.build().show();
} }
......
...@@ -42,7 +42,6 @@ import com.gingersoft.gsa.cloud.table.di.component.DaggerMealStandComponent; ...@@ -42,7 +42,6 @@ import com.gingersoft.gsa.cloud.table.di.component.DaggerMealStandComponent;
import com.gingersoft.gsa.cloud.table.mvp.contract.MealStandContract; import com.gingersoft.gsa.cloud.table.mvp.contract.MealStandContract;
import com.gingersoft.gsa.cloud.table.mvp.model.bean.SoldoutCtrFood; import com.gingersoft.gsa.cloud.table.mvp.model.bean.SoldoutCtrFood;
import com.gingersoft.gsa.cloud.table.mvp.model.bean.event.InitTableEvent; import com.gingersoft.gsa.cloud.table.mvp.model.bean.event.InitTableEvent;
import com.gingersoft.gsa.cloud.table.mvp.presenter.BaseOrderPresenter;
import com.gingersoft.gsa.cloud.table.mvp.presenter.MealStandPresenter; import com.gingersoft.gsa.cloud.table.mvp.presenter.MealStandPresenter;
import com.gingersoft.gsa.cloud.table.mvp.ui.adapter.BaseFragmentAdapter; import com.gingersoft.gsa.cloud.table.mvp.ui.adapter.BaseFragmentAdapter;
import com.gingersoft.gsa.cloud.table.mvp.ui.adapter.meal.FoodGroupAdapter; import com.gingersoft.gsa.cloud.table.mvp.ui.adapter.meal.FoodGroupAdapter;
...@@ -70,7 +69,6 @@ import com.jess.arms.di.component.AppComponent; ...@@ -70,7 +69,6 @@ import com.jess.arms.di.component.AppComponent;
import com.jess.arms.utils.ArmsUtils; import com.jess.arms.utils.ArmsUtils;
import com.qmuiteam.qmui.alpha.QMUIAlphaTextView; import com.qmuiteam.qmui.alpha.QMUIAlphaTextView;
import com.qmuiteam.qmui.util.QMUIDisplayHelper; import com.qmuiteam.qmui.util.QMUIDisplayHelper;
import com.xuexiang.rxutil2.RxBindingUtils;
import org.simple.eventbus.EventBus; import org.simple.eventbus.EventBus;
...@@ -92,7 +90,6 @@ import androidx.viewpager.widget.ViewPager; ...@@ -92,7 +90,6 @@ import androidx.viewpager.widget.ViewPager;
import butterknife.BindView; import butterknife.BindView;
import butterknife.OnClick; import butterknife.OnClick;
import butterknife.OnLongClick; import butterknife.OnLongClick;
import io.reactivex.functions.Consumer;
import static com.jess.arms.utils.Preconditions.checkNotNull; import static com.jess.arms.utils.Preconditions.checkNotNull;
...@@ -322,8 +319,6 @@ public class MealStandActivity extends BaseFragmentActivity<MealStandPresenter> ...@@ -322,8 +319,6 @@ public class MealStandActivity extends BaseFragmentActivity<MealStandPresenter>
initAutoQuit(); initAutoQuit();
} }
mPresenter.getCurrentSoldoutFood(); mPresenter.getCurrentSoldoutFood();
// setViewDrawableColor();
} }
private void initUIStyleConfiguration() { private void initUIStyleConfiguration() {
...@@ -1376,7 +1371,6 @@ public class MealStandActivity extends BaseFragmentActivity<MealStandPresenter> ...@@ -1376,7 +1371,6 @@ public class MealStandActivity extends BaseFragmentActivity<MealStandPresenter>
btn_select_all.setVisibility(visibility); btn_select_all.setVisibility(visibility);
} }
public boolean isInitSentOrderDiscount() { public boolean isInitSentOrderDiscount() {
return initSentOrderDiscount; return initSentOrderDiscount;
} }
......
package com.gingersoft.gsa.cloud.table.mvp.ui.activity; package com.gingersoft.gsa.cloud.table.mvp.ui.activity;
import android.content.Intent; import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.os.Bundle; import android.os.Bundle;
import android.os.Message; import android.os.Message;
import android.view.MenuItem;
import android.view.View; import android.view.View;
import android.widget.AdapterView; import android.widget.AdapterView;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.SimpleAdapter; import android.widget.SimpleAdapter;
import android.widget.TextView; import android.widget.TextView;
import com.billy.cc.core.component.CC; import com.billy.cc.core.component.CC;
...@@ -28,19 +27,14 @@ import com.gingersoft.gsa.cloud.table.mvp.ui.fragment.AllTableFragment; ...@@ -28,19 +27,14 @@ import com.gingersoft.gsa.cloud.table.mvp.ui.fragment.AllTableFragment;
import com.gingersoft.gsa.cloud.table.mvp.ui.fragment.InputTableFragment; import com.gingersoft.gsa.cloud.table.mvp.ui.fragment.InputTableFragment;
import com.gingersoft.gsa.cloud.constans.GoldConstants; import com.gingersoft.gsa.cloud.constans.GoldConstants;
import com.gingersoft.gsa.cloud.ui.widget.dialog.LoadingDialog; import com.gingersoft.gsa.cloud.ui.widget.dialog.LoadingDialog;
import com.google.android.material.bottomnavigation.BottomNavigationView;
import com.ittianyu.bottomnavigationviewex.BottomNavigationViewEx;
import com.jess.arms.base.BaseFragmentActivity; import com.jess.arms.base.BaseFragmentActivity;
import com.jess.arms.base.DefaultAdapter; import com.jess.arms.base.DefaultAdapter;
import com.jess.arms.di.component.AppComponent; import com.jess.arms.di.component.AppComponent;
import com.jess.arms.utils.ArmsUtils; import com.jess.arms.utils.ArmsUtils;
import com.kingja.loadsir.callback.Callback;
import com.kingja.loadsir.core.LoadService; import com.kingja.loadsir.core.LoadService;
import com.kingja.loadsir.core.LoadSir;
import com.qmuiteam.qmui.alpha.QMUIAlphaImageButton; import com.qmuiteam.qmui.alpha.QMUIAlphaImageButton;
import com.qmuiteam.qmui.arch.QMUIFragmentPagerAdapter; import com.qmuiteam.qmui.arch.QMUIFragmentPagerAdapter;
import com.qmuiteam.qmui.layout.QMUIButton; import com.qmuiteam.qmui.layout.QMUIButton;
import com.qmuiteam.qmui.util.QMUIDeviceHelper;
import com.qmuiteam.qmui.util.QMUIDisplayHelper; import com.qmuiteam.qmui.util.QMUIDisplayHelper;
import com.qmuiteam.qmui.widget.QMUITopBar; import com.qmuiteam.qmui.widget.QMUITopBar;
import com.qmuiteam.qmui.widget.popup.QMUIPopup; import com.qmuiteam.qmui.widget.popup.QMUIPopup;
...@@ -50,7 +44,6 @@ import com.qmuiteam.qmui.widget.tab.QMUITabBuilder; ...@@ -50,7 +44,6 @@ import com.qmuiteam.qmui.widget.tab.QMUITabBuilder;
import com.qmuiteam.qmui.widget.tab.QMUITabIndicator; import com.qmuiteam.qmui.widget.tab.QMUITabIndicator;
import com.qmuiteam.qmui.widget.tab.QMUITabSegment; import com.qmuiteam.qmui.widget.tab.QMUITabSegment;
import com.scwang.smartrefresh.layout.api.RefreshLayout; import com.scwang.smartrefresh.layout.api.RefreshLayout;
import com.xuexiang.rxutil2.RxBindingUtils;
import org.simple.eventbus.Subscriber; import org.simple.eventbus.Subscriber;
...@@ -109,6 +102,11 @@ public class TableActivity extends BaseFragmentActivity<TablePresenter> implemen ...@@ -109,6 +102,11 @@ public class TableActivity extends BaseFragmentActivity<TablePresenter> implemen
@BindView(R2.id.tv_table_action_content) @BindView(R2.id.tv_table_action_content)
TextView tv_table_action_content; TextView tv_table_action_content;
@BindView(R2.id.rl_skyorder)
RelativeLayout rl_skyorder;
@BindView(R2.id.iv_lock)
ImageView iv_lock;
private LoadService loadService; private LoadService loadService;
/** /**
...@@ -163,7 +161,6 @@ public class TableActivity extends BaseFragmentActivity<TablePresenter> implemen ...@@ -163,7 +161,6 @@ public class TableActivity extends BaseFragmentActivity<TablePresenter> implemen
// getTables(true, null); // getTables(true, null);
// } // }
// }); // });
// bn_table_function.getMenu().
initTabAndPager(); initTabAndPager();
getTables(true, null); getTables(true, null);
} }
...@@ -335,6 +332,7 @@ public class TableActivity extends BaseFragmentActivity<TablePresenter> implemen ...@@ -335,6 +332,7 @@ public class TableActivity extends BaseFragmentActivity<TablePresenter> implemen
btn_cancel_operat.setVisibility(View.VISIBLE); btn_cancel_operat.setVisibility(View.VISIBLE);
ll_table_operat_content.setVisibility(View.VISIBLE); ll_table_operat_content.setVisibility(View.VISIBLE);
rv_bottom_function.setVisibility(View.INVISIBLE); rv_bottom_function.setVisibility(View.INVISIBLE);
rl_skyorder.setVisibility(View.INVISIBLE);
setTableActionTitle(action); setTableActionTitle(action);
} }
...@@ -352,6 +350,7 @@ public class TableActivity extends BaseFragmentActivity<TablePresenter> implemen ...@@ -352,6 +350,7 @@ public class TableActivity extends BaseFragmentActivity<TablePresenter> implemen
btn_cancel_operat.setVisibility(View.INVISIBLE); btn_cancel_operat.setVisibility(View.INVISIBLE);
ll_table_operat_content.setVisibility(View.INVISIBLE); ll_table_operat_content.setVisibility(View.INVISIBLE);
rv_bottom_function.setVisibility(View.VISIBLE); rv_bottom_function.setVisibility(View.VISIBLE);
rl_skyorder.setVisibility(View.VISIBLE);
tv_table_action_hint.setText(""); tv_table_action_hint.setText("");
tv_table_action_content.setText(""); tv_table_action_content.setText("");
...@@ -419,6 +418,11 @@ public class TableActivity extends BaseFragmentActivity<TablePresenter> implemen ...@@ -419,6 +418,11 @@ public class TableActivity extends BaseFragmentActivity<TablePresenter> implemen
rv_bottom_function.setVisibility(show == true ? View.VISIBLE : View.GONE); rv_bottom_function.setVisibility(show == true ? View.VISIBLE : View.GONE);
} }
@Override
public void setLockVisibility(boolean show) {
iv_lock.setVisibility(show == true ? View.VISIBLE : View.GONE);
}
private void initTabAndPager() { private void initTabAndPager() {
QMUIFragmentPagerAdapter pagerAdapter = new QMUIFragmentPagerAdapter(getSupportFragmentManager()) { QMUIFragmentPagerAdapter pagerAdapter = new QMUIFragmentPagerAdapter(getSupportFragmentManager()) {
@Override @Override
......
package com.gingersoft.gsa.cloud.table.mvp.ui.adapter;
import android.content.res.ColorStateList;
import android.graphics.Color;
import android.text.TextUtils;
import android.widget.TextView;
import androidx.annotation.Nullable;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.gingersoft.gsa.cloud.table.R;
import com.gingersoft.gsa.cloud.table.R2;
import com.gingersoft.gsa.cloud.table.mvp.model.bean.FoodSummary;
import com.gingersoft.gsa.cloud.ui.bean.view.SectionTextItem3;
import com.gingersoft.gsa.cloud.ui.view.ColorUtils;
import com.jess.arms.utils.ArmsUtils;
import com.qmuiteam.qmui.util.QMUIColorHelper;
import com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButton;
import com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButtonDrawable;
import java.util.List;
import butterknife.BindView;
/**
* @author : bin
* @create date: 2020-11-04
* @update date: 2020-11-04
* @description:
*/
public class FoodSummaryAdapter extends BaseQuickAdapter<FoodSummary, BaseViewHolder> {
public FoodSummaryAdapter(@Nullable List<FoodSummary> data) {
super(R.layout.table_item_food_summary, data);
}
@Override
protected void convert(BaseViewHolder helper, FoodSummary item) {
QMUIRoundButton btn_summary = helper.getView(R.id.btn_summary);
if (item.isSelected()) {
btn_summary.setBackgroundColor(ArmsUtils.getColor(getContext(), R.color.theme_color));
btn_summary.setStrokeColors(ColorStateList.valueOf(ArmsUtils.getColor(getContext(), R.color.theme_white_color)));
btn_summary.setTextColor(ArmsUtils.getColor(getContext(), R.color.theme_white_color));
} else {
btn_summary.setBackgroundColor(ArmsUtils.getColor(getContext(), R.color.theme_white_color));
btn_summary.setStrokeColors(ColorStateList.valueOf(ArmsUtils.getColor(getContext(), R.color.theme_text_color_black)));
btn_summary.setTextColor(ArmsUtils.getColor(getContext(), R.color.theme_text_color_black));
}
if (!TextUtils.isEmpty(item.getName())) {
btn_summary.setText(item.getName());
}
}
}
\ No newline at end of file
...@@ -38,7 +38,8 @@ ...@@ -38,7 +38,8 @@
android:paddingStart="@dimen/dp_10" android:paddingStart="@dimen/dp_10"
android:text="22:00" android:text="22:00"
android:textColor="@color/theme_text_color" android:textColor="@color/theme_text_color"
android:textSize="@dimen/sp_16" android:textSize="@dimen/dp_18"
android:textStyle="bold"
app:layout_constraintLeft_toRightOf="@+id/cb_title" /> app:layout_constraintLeft_toRightOf="@+id/cb_title" />
<TextView <TextView
...@@ -48,6 +49,7 @@ ...@@ -48,6 +49,7 @@
android:layout_marginStart="@dimen/dp_20" android:layout_marginStart="@dimen/dp_20"
android:layout_marginEnd="@dimen/dp_20" android:layout_marginEnd="@dimen/dp_20"
android:text=":" android:text=":"
android:textStyle="bold"
app:layout_constraintLeft_toRightOf="@+id/tv_start_time" /> app:layout_constraintLeft_toRightOf="@+id/tv_start_time" />
<TextView <TextView
...@@ -62,7 +64,8 @@ ...@@ -62,7 +64,8 @@
android:paddingEnd="@dimen/dp_10" android:paddingEnd="@dimen/dp_10"
android:text="23:30" android:text="23:30"
android:textColor="@color/theme_text_color" android:textColor="@color/theme_text_color"
android:textSize="@dimen/sp_16" android:textSize="@dimen/dp_18"
android:textStyle="bold"
app:layout_constraintLeft_toRightOf="@+id/tv_split" /> app:layout_constraintLeft_toRightOf="@+id/tv_split" />
</LinearLayout> </LinearLayout>
......
...@@ -7,7 +7,8 @@ ...@@ -7,7 +7,8 @@
<RelativeLayout <RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/dp_80" android:layout_height="@dimen/dp_80"
android:layout_margin="@dimen/dp_15"> android:layout_marginStart="@dimen/dp_15"
android:layout_marginEnd="@dimen/dp_15">
<TextView <TextView
android:id="@+id/tv_title" android:id="@+id/tv_title"
...@@ -74,7 +75,7 @@ ...@@ -74,7 +75,7 @@
android:tag="7" android:tag="7"
android:text="@string/Key_7" android:text="@string/Key_7"
android:textColor="@color/table_input_table_keypad" android:textColor="@color/table_input_table_keypad"
android:textSize="@dimen/dp_30" /> android:textSize="@dimen/dp_35" />
<com.qmuiteam.qmui.alpha.QMUIAlphaTextView <com.qmuiteam.qmui.alpha.QMUIAlphaTextView
android:id="@+id/btn_8" android:id="@+id/btn_8"
...@@ -88,7 +89,7 @@ ...@@ -88,7 +89,7 @@
android:tag="8" android:tag="8"
android:text="@string/Key_8" android:text="@string/Key_8"
android:textColor="@color/table_input_table_keypad" android:textColor="@color/table_input_table_keypad"
android:textSize="@dimen/dp_30" /> android:textSize="@dimen/dp_35" />
<com.qmuiteam.qmui.alpha.QMUIAlphaTextView <com.qmuiteam.qmui.alpha.QMUIAlphaTextView
android:id="@+id/btn_9" android:id="@+id/btn_9"
...@@ -101,7 +102,7 @@ ...@@ -101,7 +102,7 @@
android:tag="9" android:tag="9"
android:text="@string/Key_9" android:text="@string/Key_9"
android:textColor="@color/table_input_table_keypad" android:textColor="@color/table_input_table_keypad"
android:textSize="@dimen/dp_30" /> android:textSize="@dimen/dp_35" />
</TableRow> </TableRow>
<TableRow <TableRow
...@@ -123,7 +124,7 @@ ...@@ -123,7 +124,7 @@
android:tag="4" android:tag="4"
android:text="@string/Key_4" android:text="@string/Key_4"
android:textColor="@color/table_input_table_keypad" android:textColor="@color/table_input_table_keypad"
android:textSize="@dimen/dp_30" /> android:textSize="@dimen/dp_35" />
<com.qmuiteam.qmui.alpha.QMUIAlphaTextView <com.qmuiteam.qmui.alpha.QMUIAlphaTextView
android:id="@+id/btn_5" android:id="@+id/btn_5"
...@@ -138,7 +139,7 @@ ...@@ -138,7 +139,7 @@
android:tag="5" android:tag="5"
android:text="@string/Key_5" android:text="@string/Key_5"
android:textColor="@color/table_input_table_keypad" android:textColor="@color/table_input_table_keypad"
android:textSize="@dimen/dp_30" /> android:textSize="@dimen/dp_35" />
<com.qmuiteam.qmui.alpha.QMUIAlphaTextView <com.qmuiteam.qmui.alpha.QMUIAlphaTextView
android:id="@+id/btn_6" android:id="@+id/btn_6"
...@@ -152,7 +153,7 @@ ...@@ -152,7 +153,7 @@
android:tag="6" android:tag="6"
android:text="@string/Key_6" android:text="@string/Key_6"
android:textColor="@color/table_input_table_keypad" android:textColor="@color/table_input_table_keypad"
android:textSize="@dimen/dp_30" /> android:textSize="@dimen/dp_35" />
</TableRow> </TableRow>
<TableRow <TableRow
...@@ -174,7 +175,7 @@ ...@@ -174,7 +175,7 @@
android:tag="1" android:tag="1"
android:text="@string/Key_1" android:text="@string/Key_1"
android:textColor="@color/table_input_table_keypad" android:textColor="@color/table_input_table_keypad"
android:textSize="@dimen/dp_30" /> android:textSize="@dimen/dp_35" />
<com.qmuiteam.qmui.alpha.QMUIAlphaTextView <com.qmuiteam.qmui.alpha.QMUIAlphaTextView
android:id="@+id/btn_2" android:id="@+id/btn_2"
...@@ -189,7 +190,7 @@ ...@@ -189,7 +190,7 @@
android:tag="2" android:tag="2"
android:text="@string/Key_2" android:text="@string/Key_2"
android:textColor="@color/table_input_table_keypad" android:textColor="@color/table_input_table_keypad"
android:textSize="@dimen/dp_30" /> android:textSize="@dimen/dp_35" />
<com.qmuiteam.qmui.alpha.QMUIAlphaTextView <com.qmuiteam.qmui.alpha.QMUIAlphaTextView
android:id="@+id/btn_3" android:id="@+id/btn_3"
...@@ -203,7 +204,7 @@ ...@@ -203,7 +204,7 @@
android:tag="3" android:tag="3"
android:text="@string/Key_3" android:text="@string/Key_3"
android:textColor="@color/table_input_table_keypad" android:textColor="@color/table_input_table_keypad"
android:textSize="@dimen/dp_30" /> android:textSize="@dimen/dp_35" />
</TableRow> </TableRow>
<TableRow <TableRow
...@@ -241,7 +242,7 @@ ...@@ -241,7 +242,7 @@
android:tag="0" android:tag="0"
android:text="@string/Key_0" android:text="@string/Key_0"
android:textColor="@color/table_input_table_keypad" android:textColor="@color/table_input_table_keypad"
android:textSize="@dimen/dp_30" /> android:textSize="@dimen/dp_35" />
<com.qmuiteam.qmui.alpha.QMUIAlphaTextView <com.qmuiteam.qmui.alpha.QMUIAlphaTextView
android:id="@+id/btn_add10" android:id="@+id/btn_add10"
...@@ -257,7 +258,7 @@ ...@@ -257,7 +258,7 @@
android:tag="99" android:tag="99"
android:text="+10" android:text="+10"
android:textColor="@color/table_input_table_keypad" android:textColor="@color/table_input_table_keypad"
android:textSize="@dimen/dp_28" /> android:textSize="@dimen/dp_30" />
</TableRow> </TableRow>
</TableLayout> </TableLayout>
...@@ -278,7 +279,7 @@ ...@@ -278,7 +279,7 @@
android:tag="98" android:tag="98"
android:text="×" android:text="×"
android:textColor="#1196DB" android:textColor="#1196DB"
android:textSize="@dimen/dp_25" android:textSize="@dimen/dp_35"
android:textStyle="bold" /> android:textStyle="bold" />
<com.qmuiteam.qmui.alpha.QMUIAlphaTextView <com.qmuiteam.qmui.alpha.QMUIAlphaTextView
...@@ -293,7 +294,7 @@ ...@@ -293,7 +294,7 @@
android:tag="98" android:tag="98"
android:text="@string/Key_right" android:text="@string/Key_right"
android:textColor="@color/theme_white_color" android:textColor="@color/theme_white_color"
android:textSize="@dimen/dp_25" android:textSize="@dimen/dp_35"
android:textStyle="bold" /> android:textStyle="bold" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
......
<?xml version="1.0" encoding="utf-8"?>
<com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButton xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/btn_summary"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="@dimen/dp_14"
android:textColor="@color/theme_text_color_black"
android:text="早餐"
android:ellipsize="end"
android:maxLines="1"
android:paddingTop="@dimen/dp_8"
android:paddingBottom="@dimen/dp_8"
android:layout_margin="@dimen/dp_5"
app:qmui_borderColor="@color/theme_text_color_black"
app:qmui_radius="@dimen/dp_5"
app:qmui_backgroundColor="@color/theme_white_color">
</com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButton>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<com.qmuiteam.qmui.widget.roundwidget.QMUIRoundRelativeLayout <com.qmuiteam.qmui.widget.roundwidget.QMUIRoundRelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="@dimen/dp_80" android:id="@+id/rl_skyorder"
android:layout_height="@dimen/dp_80" android:layout_width="@dimen/dp_65"
android:layout_height="@dimen/dp_65"
android:layout_marginBottom="@dimen/dp_25"
android:gravity="center"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
android:layout_above="@+id/rv_bottom_function"
android:gravity="center"
android:orientation="vertical" android:orientation="vertical"
app:qmui_backgroundColor="@color/theme_color" app:qmui_backgroundColor="@color/theme_color">
app:qmui_borderColor="@color/theme_hint_color">
<TextView <ImageView
android:id="@+id/tv_name" android:id="@+id/iv_skyorder_qrcode"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:drawableTint="@color/theme_white_color" android:src="@mipmap/table_skyorder_qrcode"
android:drawableTop="@mipmap/table_skyorder_qrcode" android:tint="@color/theme_white_color" />
android:text="skyorder"
android:layout_marginTop="@dimen/dp_5"
android:textColor="@color/theme_white_color"
android:textSize="@dimen/font_normal" />
<ImageView <ImageView
android:id="@+id/iv_lock" android:id="@+id/iv_lock"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:tint="@color/theme_white_color" android:layout_below="@+id/iv_skyorder_qrcode"
android:layout_below="@+id/tv_name" android:src="@drawable/qrcode_time_lock"
android:src="@drawable/qrcode_time_lock"/> android:tint="@color/theme_white_color" />
</com.qmuiteam.qmui.widget.roundwidget.QMUIRoundRelativeLayout> </com.qmuiteam.qmui.widget.roundwidget.QMUIRoundRelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<com.qmuiteam.qmui.alpha.QMUIAlphaTextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/tv_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="@dimen/dp_15"
android:paddingBottom="@dimen/dp_15"
android:paddingRight="@dimen/dp_10"
android:paddingLeft="@dimen/dp_20"
android:gravity="center_vertical"
android:text="餐檯模式"
android:textColor="@color/theme_text_color_black"
android:textSize="@dimen/dp_18"
android:textStyle="bold"/>
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
android:layout_height="@dimen/dp_55" android:layout_height="@dimen/dp_55"
android:gravity="center" android:gravity="center"
android:orientation="vertical" android:orientation="vertical"
android:background="@drawable/ui_selector_item_background"> android:background="@color/theme_white_color">
<ImageView <ImageView
android:id="@+id/iv_icon" android:id="@+id/iv_icon"
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
android:layout_marginTop="@dimen/dp_5" android:layout_marginTop="@dimen/dp_5"
android:src="@mipmap/ic_launcher" /> android:src="@mipmap/ic_launcher" />
<TextView <com.qmuiteam.qmui.alpha.QMUIAlphaTextView
android:id="@+id/tv_name" android:id="@+id/tv_name"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
...@@ -21,5 +21,4 @@ ...@@ -21,5 +21,4 @@
android:layout_marginTop="@dimen/dp_5" android:layout_marginTop="@dimen/dp_5"
android:textColor="@color/theme_black" android:textColor="@color/theme_black"
android:textSize="@dimen/font_normal" /> android:textSize="@dimen/font_normal" />
</LinearLayout> </LinearLayout>
\ No newline at end of file
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