Commit d34cee16 by 宁斌

Merge branch 'dev' into master

parents b6bfdbd5 1288870b
......@@ -101,6 +101,7 @@ dependencies {
exclude module: 'support-annotations'
}
api rootProject.ext.dependencies['rxerrorhandler2']
api rootProject.ext.dependencies['rxbinding']
//network
api(rootProject.ext.dependencies["retrofit"]) {
exclude module: 'okhttp'
......
......@@ -51,7 +51,7 @@ android {
/**
* 版本号
*/
schemaVersion 20
schemaVersion 21
/**
* greendao输出dao的数据库操作实体类文件夹(相对路径 包名+自定义路径名称,包将创建于包名的直接路径下)
*/
......
......@@ -104,6 +104,7 @@ public class GsaCloudApplication extends BaseApplication {
//指定为经典Footer,默认是 BallPulseFooter
return new ClassicsFooter(context).setDrawableSize(20);
});
}
@Override
......@@ -133,14 +134,12 @@ public class GsaCloudApplication extends BaseApplication {
//初始化crash記錄
AppCrashHandler.getInstance().init(this);
uiStyleConfiguration = new UIStyleExtendedConfiguration();
functionConfiguration = new FunctionExtendedConfiguration();
isLogin = (boolean) SPUtils.get(this, PrintConstans.IS_LOGIN, false);
uiStyleConfiguration = new UIStyleExtendedConfiguration();
functionConfiguration = new FunctionExtendedConfiguration();
//上傳餐廳擴展信息
ExpandInfoSetting.initUpdateExtendedConfiguration(uiStyleConfiguration,functionConfiguration);
//獲取餐廳擴展表數據
initExpandInfo();
// 设定一些通用的属性,这些属性在每次统计事件中都会附带
// 注意:如果此处的属性名与内置属性的名称相同,则内置属性会被覆盖
......@@ -158,21 +157,6 @@ public class GsaCloudApplication extends BaseApplication {
// Tracker.INSTANCE.initialize(this);
}
private void initExpandInfo() {
//在IO线程执行数据库处理操作
Observable.just(0)
.subscribeOn(Schedulers.io())
.subscribe(new Consumer<Integer>() {
@Override
public void accept(@io.reactivex.annotations.NonNull Integer integer) throws Exception {
ExpandInfoDaoUtils expandInfoDaoUtils = new ExpandInfoDaoUtils(getAppContext());
List<ExpandInfo> expandInfos = expandInfoDaoUtils.queryAllExpandInfo();
if (expandInfos != null) {
RestaurantExpandInfoUtils.setCommonExpandInfo(expandInfos);
}
}
});
}
public Activity getCurrentActivity() {
return mCurrentActivity;
......
......@@ -11,6 +11,7 @@ import android.widget.Toast;
import com.elvishew.xlog.XLog;
import com.gingersoft.gsa.cloud.base.Api;
import com.gingersoft.gsa.cloud.base.BuildConfig;
import com.gingersoft.gsa.cloud.base.application.GsaCloudApplication;
import com.gingersoft.gsa.cloud.base.common.bean.BaseResult;
import com.gingersoft.gsa.cloud.base.utils.FileUtils;
......@@ -41,6 +42,8 @@ import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.Disposable;
import io.reactivex.schedulers.Schedulers;
import static com.gingersoft.gsa.cloud.constans.AppConstans.RP_ERROR;
public class AppCrashHandler implements UncaughtExceptionHandler {
/**
* Debug Log tag
......@@ -141,12 +144,27 @@ public class AppCrashHandler implements UncaughtExceptionHandler {
if (ex == null) {
return false;
}
//使用Toast来显示异常信息
new Thread() {
@Override
public void run() {
Looper.prepare();
Toast.makeText(mContext, ErrorStr, Toast.LENGTH_LONG).show();
String showText = ErrorStr;
Throwable cause = ex.getCause();
if (cause != null && BuildConfig.DEBUG) {
StackTraceElement[] stackTrace = cause.getStackTrace();
if (stackTrace != null && stackTrace.length > 0) {
String causeName = cause.getClass().getSimpleName();
String fileName = stackTrace[0].getFileName();
fileName = fileName.substring(0, fileName.length() - 4);
int lineNumber = stackTrace[0].getLineNumber();
showText += "-" + fileName + "-" + lineNumber + "-" + causeName;
OkHttp3Utils.noticePersonnel(RP_ERROR, showText);
}
}
Toast.makeText(mContext, showText, Toast.LENGTH_LONG).show();
Looper.loop();
}
}.start();
......@@ -201,7 +219,7 @@ public class AppCrashHandler implements UncaughtExceptionHandler {
@Override
public void onNext(String data) {
if(!TextUtils.isEmpty(data)){
if (!TextUtils.isEmpty(data)) {
BaseResult result = JsonUtils.parseObject(data, BaseResult.class);
if (result != null && result.isSuccess()) {
//上傳成功后刪除對應文件
......
......@@ -119,6 +119,7 @@ public class TimePickerUtils {
.setTitleColor(Color.BLACK)//标题文字颜色
.setSubmitColor(Color.BLUE)//确定按钮文字颜色
.setCancelColor(Color.BLUE)//取消按钮文字颜色
.setDate(defaultTime)
.setRangDate(Calendar.getInstance(), endTime)//限制時間範圍
.setLabel("", "", "", "", "", "")
.isCenterLabel(false) //是否只显示中间选中项的label文字,false则每项item全部都带有label。
......
package com.gingersoft.gsa.cloud.bean.expandInfo;
import android.util.SparseArray;
import com.gingersoft.gsa.cloud.base.Api;
import com.gingersoft.gsa.cloud.base.utils.JsonUtils;
import com.gingersoft.gsa.cloud.base.utils.ReflectionUtils;
import com.gingersoft.gsa.cloud.base.utils.RestaurantExpandInfoUtils;
import com.gingersoft.gsa.cloud.base.utils.gson.GsonUtils;
import com.gingersoft.gsa.cloud.base.utils.okhttpUtils.OkHttp3Utils;
import com.gingersoft.gsa.cloud.constans.HttpsConstans;
import com.gingersoft.gsa.cloud.database.bean.ExpandInfo;
......@@ -18,15 +19,18 @@ import java.util.HashMap;
import java.util.List;
import io.reactivex.Observable;
import io.reactivex.Observer;
import io.reactivex.disposables.Disposable;
import io.reactivex.functions.Consumer;
import io.reactivex.schedulers.Schedulers;
import lombok.Builder;
import lombok.Getter;
import lombok.Setter;
import me.jessyan.retrofiturlmanager.RetrofitUrlManager;
import okhttp3.MediaType;
import okhttp3.RequestBody;
import static com.gingersoft.gsa.cloud.base.application.GsaCloudApplication.getAppContext;
/**
* @author : bin
* @create date: 2020-10-20
......@@ -46,7 +50,7 @@ public class ExpandInfoSetting {
/**
* 數據類型 1:整形,2:字符型,3:布爾型,4:日期類型
*/
private byte dataType;
private int dataType;
private int sort;
private String showName;
private String remark;
......@@ -67,7 +71,7 @@ public class ExpandInfoSetting {
public static void initUpdateExtendedConfiguration(Object... objects) {
Observable.just(0)
.subscribeOn(Schedulers.newThread())
.subscribeOn(Schedulers.io())
.subscribe(new Consumer<Integer>() {
@Override
public void accept(@io.reactivex.annotations.NonNull Integer integer) throws Exception {
......@@ -78,10 +82,34 @@ public class ExpandInfoSetting {
}
String expandInfoListJson = JsonUtils.toJson(expandInfoSettingList);
RequestBody requestBody = RequestBody.create(MediaType.parse("application/json"),expandInfoListJson);
OkHttp3Utils.post(HttpsConstans.ROOT_SERVER_ADDRESS_FORMAL + Api.add_restaurant_base_table_configuration,requestBody)
.subscribe();
RequestBody requestBody = RequestBody.create(MediaType.parse("application/json"), expandInfoListJson);
OkHttp3Utils.post(HttpsConstans.ROOT_SERVER_ADDRESS_FORMAL + Api.add_restaurant_base_table_configuration, requestBody)
.subscribe(new Observer<String>() {
@Override
public void onSubscribe(Disposable d) {
}
@Override
public void onNext(String s) {
}
@Override
public void onError(Throwable e) {
}
@Override
public void onComplete() {
//從本地獲取餐廳擴展表數據
ExpandInfoDaoUtils expandInfoDaoUtils = new ExpandInfoDaoUtils(getAppContext());
List<ExpandInfo> expandInfos = expandInfoDaoUtils.queryAllExpandInfo();
if (expandInfos != null) {
RestaurantExpandInfoUtils.setCommonExpandInfo(expandInfos);
}
}
});
}
});
}
......@@ -104,7 +132,7 @@ public class ExpandInfoSetting {
Class<?> returnClass = method.getReturnType();
if (method.getName().startsWith("get") && returnClass.equals(ExpandInfoSetting.class)) {
try {
Object [] objs ={};
Object[] objs = {};
//反射執行get方法 獲取每個配置類信息
ExpandInfoSetting expandInfo = (ExpandInfoSetting) ReflectionUtils.invokeMethod(method, obj, objs);
//獲取完整的settingName
......
......@@ -10,7 +10,8 @@ public class AppConstans {
public static final String RP_THIRE_LOGISTICS_ERROR = "RP_WL003";//第三方物流接口錯誤碼
public static final String RP_UPDATE_ORDER_STATE_ERROR = "RP_UO004";//修改訂單狀態失敗錯誤碼
public static final String RP_LOGIN_ERROR = "RP_LOGIN";//登陸報錯錯誤碼
public static final String RP_REPRINT_CODE = "RP_REPRINT_CODE";//登陸報錯錯誤碼
public static final String RP_REPRINT_CODE = "RP_REPRINT_CODE";//重印推送
public static final String RP_ERROR = "RP_ERROR";//全局報錯錯誤碼
public static final String SECRETKEY_VALUES = "2309485937845783";
......@@ -27,5 +28,5 @@ public class AppConstans {
/**語言下標*/
public static final String LANGUAGE_INDEX = "language_index";
//4個四通,四條腿
}
......@@ -28,19 +28,25 @@ public class Discount {
@Id(autoincrement = true)
private Long id;
private int restaurant_id;
private int restaurantId;
/**
* 金額
*/
private double amount;
/**
* 折扣
* 折扣比例
*/
private double discount_value;
private int discountValue;
/**
* 类型#0:金额;1:折扣;
* 类型#0:金额;1:折扣比例;2:自定義金額;3:自定義金額鍵盤輸入;4:免服務費
*/
private int type;
public static final byte DISCOUNT_TYPE_AMOUNT = 0;
public static final byte DISCOUNT_TYPE_RATE = 1;
public static final byte DISCOUNT_TYPE_CUSTOM_AMOUNT = 2;
public static final byte DISCOUNT_TYPE_KEYBOARD = 3;
public static final byte DISCOUNT_TYPE_FREE_SERVICE_CHARGE = 4;
/**
* 折扣可使用范围#0:食品;1:账单;
*/
......@@ -53,9 +59,69 @@ public class Discount {
* 折扣描述
*/
private String remark;
private String begin_time;
private String end_time;
/**
* 是否免服務費 0:否,1:是
*/
private byte freeServiceCharge;
/**
* 是否經理批准 0:否,1:是
*/
private byte managerApproval;
/**
* 顏色
*/
private String color;
/**
* 落單類型 0:餐檯模式,1:外賣模式,2:外送模式,3:自取模式
*/
private String placeOrderType;
/**
* 折扣上限
*/
private double discountCap;
/**
* 銷售額
*/
private double salesAmount;
/**
* 免稅 0:否,1:是
*/
private byte taxFree;
/**
* 獨佔折扣 0:否,1:是
*/
private byte exclusive;
/**
* 暫停 0:否,1:是
*/
private byte pause;
/**
* 折上折 0:否,1:是
*/
private byte additionalDiscount;
/**
* 只一次 0:否,1:是
*/
private byte onlyOnce;
/**
* 最小賬單金額
*/
private double minBillAmount;
/**
* 扣減積分 0:否,1:是
*/
private byte pointsDeduction;
/**
* 整單免積分 0:否,1:是
*/
private byte wholeFreePoints;
/**
* 最小金額類型 0:合計,1:總金額 默認 1
*/
private byte amountTypeMin;
private String beginTime;
private String endTime;
/**
* 自定義字段
......@@ -64,27 +130,43 @@ public class Discount {
private long memberId = -1;
@Generated(hash = 901376651)
public Discount(Long id, int restaurant_id, double amount, double discount_value,
int type, String discountType, int status, String remark, String begin_time,
String end_time) {
@Generated(hash = 1938515536)
public Discount(Long id, int restaurantId, double amount, int discountValue, int type, String discountType, int status,
String remark, byte freeServiceCharge, byte managerApproval, String color, String placeOrderType, double discountCap,
double salesAmount, byte taxFree, byte exclusive, byte pause, byte additionalDiscount, byte onlyOnce,
double minBillAmount, byte pointsDeduction, byte wholeFreePoints, byte amountTypeMin, String beginTime, String endTime) {
this.id = id;
this.restaurant_id = restaurant_id;
this.restaurantId = restaurantId;
this.amount = amount;
this.discount_value = discount_value;
this.discountValue = discountValue;
this.type = type;
this.discountType = discountType;
this.status = status;
this.remark = remark;
this.begin_time = begin_time;
this.end_time = end_time;
this.freeServiceCharge = freeServiceCharge;
this.managerApproval = managerApproval;
this.color = color;
this.placeOrderType = placeOrderType;
this.discountCap = discountCap;
this.salesAmount = salesAmount;
this.taxFree = taxFree;
this.exclusive = exclusive;
this.pause = pause;
this.additionalDiscount = additionalDiscount;
this.onlyOnce = onlyOnce;
this.minBillAmount = minBillAmount;
this.pointsDeduction = pointsDeduction;
this.wholeFreePoints = wholeFreePoints;
this.amountTypeMin = amountTypeMin;
this.beginTime = beginTime;
this.endTime = endTime;
}
@Generated(hash = 1777606421)
public Discount() {
}
public long getMemberId() {
return memberId;
}
......@@ -107,7 +189,7 @@ public class Discount {
discountPrice = discount.getAmount();
} else {
//百分比折扣
discountPrice = MoneyUtil.divide(MoneyUtil.multiply(sourcePrice, discount.getDiscount_value()), 100).doubleValue();
discountPrice = MoneyUtil.divide(MoneyUtil.multiply(sourcePrice, discount.getDiscountValue()), 100).doubleValue();
}
if (sourcePrice < discountPrice) {
//折扣金額不能超出總額
......@@ -131,105 +213,207 @@ public class Discount {
return -MoneyUtil.get_ItemDecimals_money(Math.abs(discountPrice));
}
public Long getId() {
return this.id;
}
public void setId(Long id) {
this.id = id;
}
public int getRestaurant_id() {
return this.restaurant_id;
public int getRestaurantId() {
return this.restaurantId;
}
public void setRestaurant_id(int restaurant_id) {
this.restaurant_id = restaurant_id;
public void setRestaurantId(int restaurantId) {
this.restaurantId = restaurantId;
}
public double getAmount() {
return this.amount;
}
public void setAmount(double amount) {
this.amount = amount;
}
public double getDiscount_value() {
return this.discount_value;
public int getDiscountValue() {
return this.discountValue;
}
public void setDiscount_value(double discount_value) {
this.discount_value = discount_value;
public void setDiscountValue(int discountValue) {
this.discountValue = discountValue;
}
public int getType() {
return this.type;
}
public void setType(int type) {
this.type = type;
}
public String getDiscountType() {
return this.discountType;
}
public void setDiscountType(String discountType) {
this.discountType = discountType;
}
public int getStatus() {
return this.status;
}
public void setStatus(int status) {
this.status = status;
}
public String getRemark() {
return this.remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public byte getFreeServiceCharge() {
return this.freeServiceCharge;
}
public String getBegin_time() {
return this.begin_time;
public void setFreeServiceCharge(byte freeServiceCharge) {
this.freeServiceCharge = freeServiceCharge;
}
public byte getManagerApproval() {
return this.managerApproval;
}
public void setBegin_time(String begin_time) {
this.begin_time = begin_time;
public void setManagerApproval(byte managerApproval) {
this.managerApproval = managerApproval;
}
public String getColor() {
return this.color;
}
public String getEnd_time() {
return this.end_time;
public void setColor(String color) {
this.color = color;
}
public String getPlaceOrderType() {
return this.placeOrderType;
}
public void setEnd_time(String end_time) {
this.end_time = end_time;
public void setPlaceOrderType(String placeOrderType) {
this.placeOrderType = placeOrderType;
}
public double getDiscountCap() {
return this.discountCap;
}
public void setDiscountCap(double discountCap) {
this.discountCap = discountCap;
}
public double getSalesAmount() {
return this.salesAmount;
}
public void setSalesAmount(double salesAmount) {
this.salesAmount = salesAmount;
}
public byte getTaxFree() {
return this.taxFree;
}
public void setTaxFree(byte taxFree) {
this.taxFree = taxFree;
}
public byte getExclusive() {
return this.exclusive;
}
public void setExclusive(byte exclusive) {
this.exclusive = exclusive;
}
public byte getPause() {
return this.pause;
}
public void setPause(byte pause) {
this.pause = pause;
}
public byte getAdditionalDiscount() {
return this.additionalDiscount;
}
public void setAdditionalDiscount(byte additionalDiscount) {
this.additionalDiscount = additionalDiscount;
}
public byte getOnlyOnce() {
return this.onlyOnce;
}
public void setOnlyOnce(byte onlyOnce) {
this.onlyOnce = onlyOnce;
}
public double getMinBillAmount() {
return this.minBillAmount;
}
public void setMinBillAmount(double minBillAmount) {
this.minBillAmount = minBillAmount;
}
public byte getPointsDeduction() {
return this.pointsDeduction;
}
public void setPointsDeduction(byte pointsDeduction) {
this.pointsDeduction = pointsDeduction;
}
public byte getWholeFreePoints() {
return this.wholeFreePoints;
}
public void setWholeFreePoints(byte wholeFreePoints) {
this.wholeFreePoints = wholeFreePoints;
}
public byte getAmountTypeMin() {
return this.amountTypeMin;
}
public void setAmountTypeMin(byte amountTypeMin) {
this.amountTypeMin = amountTypeMin;
}
public String getBeginTime() {
return this.beginTime;
}
public void setBeginTime(String beginTime) {
this.beginTime = beginTime;
}
public String getEndTime() {
return this.endTime;
}
public void setEndTime(String endTime) {
this.endTime = endTime;
}
}
......@@ -14,10 +14,10 @@ import org.greenrobot.greendao.identityscope.IdentityScopeType;
// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
/**
* Master of DAO (schema version 20): knows all DAOs.
* Master of DAO (schema version 21): knows all DAOs.
*/
public class DaoMaster extends AbstractDaoMaster {
public static final int SCHEMA_VERSION = 20;
public static final int SCHEMA_VERSION = 21;
/** Creates underlying database table using DAOs. */
public static void createAllTables(Database db, boolean ifNotExists) {
......
......@@ -25,15 +25,30 @@ public class DiscountDao extends AbstractDao<Discount, Long> {
*/
public static class Properties {
public final static Property Id = new Property(0, Long.class, "id", true, "_id");
public final static Property Restaurant_id = new Property(1, int.class, "restaurant_id", false, "RESTAURANT_ID");
public final static Property RestaurantId = new Property(1, int.class, "restaurantId", false, "RESTAURANT_ID");
public final static Property Amount = new Property(2, double.class, "amount", false, "AMOUNT");
public final static Property Discount_value = new Property(3, double.class, "discount_value", false, "DISCOUNT_VALUE");
public final static Property DiscountValue = new Property(3, int.class, "discountValue", false, "DISCOUNT_VALUE");
public final static Property Type = new Property(4, int.class, "type", false, "TYPE");
public final static Property DiscountType = new Property(5, String.class, "discountType", false, "DISCOUNT_TYPE");
public final static Property Status = new Property(6, int.class, "status", false, "STATUS");
public final static Property Remark = new Property(7, String.class, "remark", false, "REMARK");
public final static Property Begin_time = new Property(8, String.class, "begin_time", false, "BEGIN_TIME");
public final static Property End_time = new Property(9, String.class, "end_time", false, "END_TIME");
public final static Property FreeServiceCharge = new Property(8, byte.class, "freeServiceCharge", false, "FREE_SERVICE_CHARGE");
public final static Property ManagerApproval = new Property(9, byte.class, "managerApproval", false, "MANAGER_APPROVAL");
public final static Property Color = new Property(10, String.class, "color", false, "COLOR");
public final static Property PlaceOrderType = new Property(11, String.class, "placeOrderType", false, "PLACE_ORDER_TYPE");
public final static Property DiscountCap = new Property(12, double.class, "discountCap", false, "DISCOUNT_CAP");
public final static Property SalesAmount = new Property(13, double.class, "salesAmount", false, "SALES_AMOUNT");
public final static Property TaxFree = new Property(14, byte.class, "taxFree", false, "TAX_FREE");
public final static Property Exclusive = new Property(15, byte.class, "exclusive", false, "EXCLUSIVE");
public final static Property Pause = new Property(16, byte.class, "pause", false, "PAUSE");
public final static Property AdditionalDiscount = new Property(17, byte.class, "additionalDiscount", false, "ADDITIONAL_DISCOUNT");
public final static Property OnlyOnce = new Property(18, byte.class, "onlyOnce", false, "ONLY_ONCE");
public final static Property MinBillAmount = new Property(19, double.class, "minBillAmount", false, "MIN_BILL_AMOUNT");
public final static Property PointsDeduction = new Property(20, byte.class, "pointsDeduction", false, "POINTS_DEDUCTION");
public final static Property WholeFreePoints = new Property(21, byte.class, "wholeFreePoints", false, "WHOLE_FREE_POINTS");
public final static Property AmountTypeMin = new Property(22, byte.class, "amountTypeMin", false, "AMOUNT_TYPE_MIN");
public final static Property BeginTime = new Property(23, String.class, "beginTime", false, "BEGIN_TIME");
public final static Property EndTime = new Property(24, String.class, "endTime", false, "END_TIME");
}
......@@ -50,15 +65,30 @@ public class DiscountDao extends AbstractDao<Discount, Long> {
String constraint = ifNotExists? "IF NOT EXISTS ": "";
db.execSQL("CREATE TABLE " + constraint + "\"DISCOUNT\" (" + //
"\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id
"\"RESTAURANT_ID\" INTEGER NOT NULL ," + // 1: restaurant_id
"\"RESTAURANT_ID\" INTEGER NOT NULL ," + // 1: restaurantId
"\"AMOUNT\" REAL NOT NULL ," + // 2: amount
"\"DISCOUNT_VALUE\" REAL NOT NULL ," + // 3: discount_value
"\"DISCOUNT_VALUE\" INTEGER NOT NULL ," + // 3: discountValue
"\"TYPE\" INTEGER NOT NULL ," + // 4: type
"\"DISCOUNT_TYPE\" TEXT," + // 5: discountType
"\"STATUS\" INTEGER NOT NULL ," + // 6: status
"\"REMARK\" TEXT," + // 7: remark
"\"BEGIN_TIME\" TEXT," + // 8: begin_time
"\"END_TIME\" TEXT);"); // 9: end_time
"\"FREE_SERVICE_CHARGE\" INTEGER NOT NULL ," + // 8: freeServiceCharge
"\"MANAGER_APPROVAL\" INTEGER NOT NULL ," + // 9: managerApproval
"\"COLOR\" TEXT," + // 10: color
"\"PLACE_ORDER_TYPE\" TEXT," + // 11: placeOrderType
"\"DISCOUNT_CAP\" REAL NOT NULL ," + // 12: discountCap
"\"SALES_AMOUNT\" REAL NOT NULL ," + // 13: salesAmount
"\"TAX_FREE\" INTEGER NOT NULL ," + // 14: taxFree
"\"EXCLUSIVE\" INTEGER NOT NULL ," + // 15: exclusive
"\"PAUSE\" INTEGER NOT NULL ," + // 16: pause
"\"ADDITIONAL_DISCOUNT\" INTEGER NOT NULL ," + // 17: additionalDiscount
"\"ONLY_ONCE\" INTEGER NOT NULL ," + // 18: onlyOnce
"\"MIN_BILL_AMOUNT\" REAL NOT NULL ," + // 19: minBillAmount
"\"POINTS_DEDUCTION\" INTEGER NOT NULL ," + // 20: pointsDeduction
"\"WHOLE_FREE_POINTS\" INTEGER NOT NULL ," + // 21: wholeFreePoints
"\"AMOUNT_TYPE_MIN\" INTEGER NOT NULL ," + // 22: amountTypeMin
"\"BEGIN_TIME\" TEXT," + // 23: beginTime
"\"END_TIME\" TEXT);"); // 24: endTime
}
/** Drops the underlying database table. */
......@@ -75,9 +105,9 @@ public class DiscountDao extends AbstractDao<Discount, Long> {
if (id != null) {
stmt.bindLong(1, id);
}
stmt.bindLong(2, entity.getRestaurant_id());
stmt.bindLong(2, entity.getRestaurantId());
stmt.bindDouble(3, entity.getAmount());
stmt.bindDouble(4, entity.getDiscount_value());
stmt.bindLong(4, entity.getDiscountValue());
stmt.bindLong(5, entity.getType());
String discountType = entity.getDiscountType();
......@@ -90,15 +120,38 @@ public class DiscountDao extends AbstractDao<Discount, Long> {
if (remark != null) {
stmt.bindString(8, remark);
}
stmt.bindLong(9, entity.getFreeServiceCharge());
stmt.bindLong(10, entity.getManagerApproval());
String begin_time = entity.getBegin_time();
if (begin_time != null) {
stmt.bindString(9, begin_time);
String color = entity.getColor();
if (color != null) {
stmt.bindString(11, color);
}
String end_time = entity.getEnd_time();
if (end_time != null) {
stmt.bindString(10, end_time);
String placeOrderType = entity.getPlaceOrderType();
if (placeOrderType != null) {
stmt.bindString(12, placeOrderType);
}
stmt.bindDouble(13, entity.getDiscountCap());
stmt.bindDouble(14, entity.getSalesAmount());
stmt.bindLong(15, entity.getTaxFree());
stmt.bindLong(16, entity.getExclusive());
stmt.bindLong(17, entity.getPause());
stmt.bindLong(18, entity.getAdditionalDiscount());
stmt.bindLong(19, entity.getOnlyOnce());
stmt.bindDouble(20, entity.getMinBillAmount());
stmt.bindLong(21, entity.getPointsDeduction());
stmt.bindLong(22, entity.getWholeFreePoints());
stmt.bindLong(23, entity.getAmountTypeMin());
String beginTime = entity.getBeginTime();
if (beginTime != null) {
stmt.bindString(24, beginTime);
}
String endTime = entity.getEndTime();
if (endTime != null) {
stmt.bindString(25, endTime);
}
}
......@@ -110,9 +163,9 @@ public class DiscountDao extends AbstractDao<Discount, Long> {
if (id != null) {
stmt.bindLong(1, id);
}
stmt.bindLong(2, entity.getRestaurant_id());
stmt.bindLong(2, entity.getRestaurantId());
stmt.bindDouble(3, entity.getAmount());
stmt.bindDouble(4, entity.getDiscount_value());
stmt.bindLong(4, entity.getDiscountValue());
stmt.bindLong(5, entity.getType());
String discountType = entity.getDiscountType();
......@@ -125,15 +178,38 @@ public class DiscountDao extends AbstractDao<Discount, Long> {
if (remark != null) {
stmt.bindString(8, remark);
}
stmt.bindLong(9, entity.getFreeServiceCharge());
stmt.bindLong(10, entity.getManagerApproval());
String color = entity.getColor();
if (color != null) {
stmt.bindString(11, color);
}
String placeOrderType = entity.getPlaceOrderType();
if (placeOrderType != null) {
stmt.bindString(12, placeOrderType);
}
stmt.bindDouble(13, entity.getDiscountCap());
stmt.bindDouble(14, entity.getSalesAmount());
stmt.bindLong(15, entity.getTaxFree());
stmt.bindLong(16, entity.getExclusive());
stmt.bindLong(17, entity.getPause());
stmt.bindLong(18, entity.getAdditionalDiscount());
stmt.bindLong(19, entity.getOnlyOnce());
stmt.bindDouble(20, entity.getMinBillAmount());
stmt.bindLong(21, entity.getPointsDeduction());
stmt.bindLong(22, entity.getWholeFreePoints());
stmt.bindLong(23, entity.getAmountTypeMin());
String begin_time = entity.getBegin_time();
if (begin_time != null) {
stmt.bindString(9, begin_time);
String beginTime = entity.getBeginTime();
if (beginTime != null) {
stmt.bindString(24, beginTime);
}
String end_time = entity.getEnd_time();
if (end_time != null) {
stmt.bindString(10, end_time);
String endTime = entity.getEndTime();
if (endTime != null) {
stmt.bindString(25, endTime);
}
}
......@@ -146,15 +222,30 @@ public class DiscountDao extends AbstractDao<Discount, Long> {
public Discount readEntity(Cursor cursor, int offset) {
Discount entity = new Discount( //
cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id
cursor.getInt(offset + 1), // restaurant_id
cursor.getInt(offset + 1), // restaurantId
cursor.getDouble(offset + 2), // amount
cursor.getDouble(offset + 3), // discount_value
cursor.getInt(offset + 3), // discountValue
cursor.getInt(offset + 4), // type
cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // discountType
cursor.getInt(offset + 6), // status
cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // remark
cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // begin_time
cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9) // end_time
(byte) cursor.getShort(offset + 8), // freeServiceCharge
(byte) cursor.getShort(offset + 9), // managerApproval
cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // color
cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // placeOrderType
cursor.getDouble(offset + 12), // discountCap
cursor.getDouble(offset + 13), // salesAmount
(byte) cursor.getShort(offset + 14), // taxFree
(byte) cursor.getShort(offset + 15), // exclusive
(byte) cursor.getShort(offset + 16), // pause
(byte) cursor.getShort(offset + 17), // additionalDiscount
(byte) cursor.getShort(offset + 18), // onlyOnce
cursor.getDouble(offset + 19), // minBillAmount
(byte) cursor.getShort(offset + 20), // pointsDeduction
(byte) cursor.getShort(offset + 21), // wholeFreePoints
(byte) cursor.getShort(offset + 22), // amountTypeMin
cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // beginTime
cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24) // endTime
);
return entity;
}
......@@ -162,15 +253,30 @@ public class DiscountDao extends AbstractDao<Discount, Long> {
@Override
public void readEntity(Cursor cursor, Discount entity, int offset) {
entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0));
entity.setRestaurant_id(cursor.getInt(offset + 1));
entity.setRestaurantId(cursor.getInt(offset + 1));
entity.setAmount(cursor.getDouble(offset + 2));
entity.setDiscount_value(cursor.getDouble(offset + 3));
entity.setDiscountValue(cursor.getInt(offset + 3));
entity.setType(cursor.getInt(offset + 4));
entity.setDiscountType(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5));
entity.setStatus(cursor.getInt(offset + 6));
entity.setRemark(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7));
entity.setBegin_time(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8));
entity.setEnd_time(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9));
entity.setFreeServiceCharge((byte) cursor.getShort(offset + 8));
entity.setManagerApproval((byte) cursor.getShort(offset + 9));
entity.setColor(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10));
entity.setPlaceOrderType(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11));
entity.setDiscountCap(cursor.getDouble(offset + 12));
entity.setSalesAmount(cursor.getDouble(offset + 13));
entity.setTaxFree((byte) cursor.getShort(offset + 14));
entity.setExclusive((byte) cursor.getShort(offset + 15));
entity.setPause((byte) cursor.getShort(offset + 16));
entity.setAdditionalDiscount((byte) cursor.getShort(offset + 17));
entity.setOnlyOnce((byte) cursor.getShort(offset + 18));
entity.setMinBillAmount(cursor.getDouble(offset + 19));
entity.setPointsDeduction((byte) cursor.getShort(offset + 20));
entity.setWholeFreePoints((byte) cursor.getShort(offset + 21));
entity.setAmountTypeMin((byte) cursor.getShort(offset + 22));
entity.setBeginTime(cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23));
entity.setEndTime(cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24));
}
@Override
......
......@@ -700,8 +700,8 @@ public class WheelTime {
sb.append((wv_year.getCurrentItem() + startYear)).append("-")
.append((wv_month.getCurrentItem() + startMonth)).append("-")
.append((wv_day.getCurrentItem() + startDay)).append(" ")
.append(wv_hours.getCurrentItem()).append(":")
.append(wv_minutes.getCurrentItem()).append(":")
.append(wv_hours.getCurrentItem() + startHour).append(":")
.append(wv_minutes.getCurrentItem() + startMin).append(":")
.append(wv_seconds.getCurrentItem());
} else {
sb.append((wv_year.getCurrentItem() + startYear)).append("-")
......
......@@ -78,6 +78,9 @@ ext {
"rxpermissions2" : "com.tbruyelle.rxpermissions2:rxpermissions:0.9.5@aar",
"rxerrorhandler2" : "me.jessyan:rxerrorhandler:2.1.1",
//rxbinding
"rxbinding" : "com.jakewharton.rxbinding4:rxbinding:4.0.0",
//tools
"dagger2" : "com.google.dagger:dagger:${version["dagger2SdkVersion"]}",
"dagger2-android" : "com.google.dagger:dagger-android:${version["dagger2SdkVersion"]}",
......
......@@ -221,6 +221,11 @@ public class PrjQueryActivity extends BaseActivity<PrjQueryPresenter> implements
}
private void printPrj(List<PrjBean.DataBean.Bean> printDatas) {
for (int i = 0; i < printDatas.size(); i++) {
printDatas.get(i).setTotalPrj(printDatas.size());
printDatas.get(i).setCurrentIndex(i);
}
CC.obtainBuilder("Component.Print")
.addParam(PrintConstans.PRINT_TYPE, PrintConstans.PRINT_KITCHEN)
.addParam("prjBeans", printDatas)
......
......@@ -452,7 +452,7 @@ public class OrderBean {
public static class RestaurantDiscountVO implements Serializable{
private long id;
private int type;
private float discountValue;
private int discountValue;
private String remark;
private double discountAmount;
......@@ -472,11 +472,11 @@ public class OrderBean {
this.type = type;
}
public float getDiscountValue() {
public int getDiscountValue() {
return discountValue;
}
public void setDiscountValue(float discountValue) {
public void setDiscountValue(int discountValue) {
this.discountValue = discountValue;
}
......
......@@ -1071,7 +1071,7 @@ public class OrderDetail implements Serializable {
private static Discount getDiscountItem(OrderBean.OrderDetailsBean.RestaurantDiscountVO discountBean) {
Discount discount = new Discount();
discount.setId(discountBean.getId());
discount.setDiscount_value(discountBean.getDiscountValue());
discount.setDiscountValue(discountBean.getDiscountValue());
discount.setAmount(discountBean.getDiscountAmount());
discount.setType(discountBean.getType());
discount.setRemark(discountBean.getRemark());
......
......@@ -114,7 +114,7 @@ public class OrderDiscount {
request.setType(MEMBER_DISCOUNT);
if(discount.getDiscount() != null) {
request.setMemberId(discount.getDiscount().getId());
request.setMemberDiscountRate((int) discount.getDiscount().getDiscount_value());
request.setMemberDiscountRate((int) discount.getDiscount().getDiscountValue());
}
request.setDiscountAmount(discount.getMoney());
request.setScAble(0);
......@@ -127,7 +127,7 @@ public class OrderDiscount {
if(discount.getDiscount() != null) {
request.setMemberId(discount.getDiscount().getMemberId());
request.setDiscountId(discount.getDiscount().getId());
request.setMemberDiscountRate((int) discount.getDiscount().getDiscount_value());
request.setMemberDiscountRate((int) discount.getDiscount().getDiscountValue());
}
request.setDiscountAmount(discount.getMoney());
request.setScAble(0);
......
......@@ -53,6 +53,7 @@ import com.joe.print.mvp.ui.adapter.DialogPrinterListAdapter;
import com.joe.print.mvp.ui.adapter.PrintProgressAdapter;
import com.yanzhenjie.recyclerview.widget.DefaultItemDecoration;
import java.util.Collections;
import java.util.List;
import java.util.Map;
......@@ -170,7 +171,18 @@ public class PrintActivity extends BaseActivity<PrintPresenter> implements Print
// List<PrjBean.DataBean.Bean> printDatas = (List<PrjBean.DataBean.Bean>) getIntent().getSerializableExtra("prjBeans");
List<PrjBean.DataBean.Bean> printDatas = CCUtil.getNavigateParam(this, "prjBeans", null);
Map<String, List<PrjBean.DataBean.Bean>> prjMap = PrintPrjKitchen.getPrjMap();
prjMap.put("", printDatas);
for (PrjBean.DataBean.Bean prjBean : printDatas) {
if (prjMap.containsKey(prjBean.getPrintPosition())) {
List<PrjBean.DataBean.Bean> beans = prjMap.get(prjBean.getPrintPosition());
if (beans != null) {
beans.add(prjBean);
}
} else {
prjMap.put(prjBean.getPrintPosition(), Collections.singletonList(prjBean));
}
}
// prjMap.put("", printDatas);
}
if (defaultPrint == null) {
......
......@@ -22,6 +22,7 @@ import com.jess.arms.di.scope.ActivityScope;
import com.jess.arms.integration.IRepositoryManager;
import com.jess.arms.mvp.BaseModel;
import java.util.Date;
import java.util.List;
import javax.inject.Inject;
......@@ -66,7 +67,8 @@ public class OrderContentModel extends BaseModel implements OrderContentContract
if (OpenTableManage.getDefault().getTableBean() == null) {
OpenTableManage.getDefault().setTableBean(new TableBean.DataBean());
}
OpenTableManage.getDefault().getTableBean().setCreateTime(TimeUtils.getTime(createTime, TimeUtils.DEFAULT_DATE_FORMAT));
String dateTime = new Date(createTime).toString();
OpenTableManage.getDefault().getTableBean().setCreateTime(dateTime);
}
@Override
......@@ -191,9 +193,9 @@ public class OrderContentModel extends BaseModel implements OrderContentContract
}
@Override
public Observable<BaseResult> queryCoupon(int tableId,Long memberId, long couponMemberId, String couponNo, int restaurantId) {
public Observable<BaseResult> queryCoupon(int tableId, Long memberId, long couponMemberId, String couponNo, int restaurantId) {
return mRepositoryManager.obtainRetrofitService(MemberService.class)
.queryCoupon(tableId,memberId, couponMemberId, couponNo, restaurantId);
.queryCoupon(tableId, memberId, couponMemberId, couponNo, restaurantId);
}
@Override
......
......@@ -36,7 +36,7 @@ public abstract class ShoppingCart {
Discount discount = new Discount();
discount.setType(1);
discount.setRemark("9折");
discount.setDiscount_value(10);
discount.setDiscountValue(10);
MemberInfo memberDiscount = new MemberInfo();
memberDiscount.setMemberName("斯八達");
......
......@@ -50,7 +50,7 @@ public class NomalDiscount extends MultyDiscount{
discountMoney = discount.getAmount();
} else {
//百分比折扣
discountMoney = MoneyUtil.divide(MoneyUtil.multiply(sourceMoney, discount.getDiscount_value()), 100).doubleValue();
discountMoney = MoneyUtil.divide(MoneyUtil.multiply(sourceMoney, discount.getDiscountValue()), 100).doubleValue();
}
if (sourceMoney < discountMoney) {
//折扣金額不能超出總額
......
......@@ -42,6 +42,7 @@ import com.jess.arms.utils.RxLifecycleUtils;
import com.tbruyelle.rxpermissions2.RxPermissions;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -117,7 +118,8 @@ public abstract class BaseOrderPresenter<M extends BaseOrderContract.Model, V ex
if (OpenTableManage.getDefault().getTableBean() == null) {
OpenTableManage.getDefault().setTableBean(new TableBean.DataBean());
}
OpenTableManage.getDefault().getTableBean().setCreateTime(TimeUtils.getTime(createTime, TimeUtils.DEFAULT_DATE_FORMAT));
String dateTime = new Date(createTime).toString();
OpenTableManage.getDefault().getTableBean().setCreateTime(dateTime);
}
......@@ -420,7 +422,7 @@ public abstract class BaseOrderPresenter<M extends BaseOrderContract.Model, V ex
if (orderDiscount.getDiscountValue() != 0) {
//百分比折扣
discount.setType(1);
discount.setDiscount_value(orderDiscount.getDiscountValue());
discount.setDiscountValue(orderDiscount.getDiscountValue());
addOrderDiscount(true, discount, BillOrderMoney.BILL_ITEM_ORDER_SENT_STATUS);
continue;
}
......@@ -577,7 +579,7 @@ public abstract class BaseOrderPresenter<M extends BaseOrderContract.Model, V ex
discount.setMemberId(memberId);
discount.setType(1);
discount.setRemark(memberName + discountRate + "%");
discount.setDiscount_value(discountRate);
discount.setDiscountValue(discountRate);
orderMoney.setDiscount(discount);
mOrderMoneyList.add(orderMoney);
......@@ -627,7 +629,7 @@ public abstract class BaseOrderPresenter<M extends BaseOrderContract.Model, V ex
discount.setId(coupon.getId());
discount.setMemberId(memberId);
discount.setRemark(coupon.getName() + coupon.getDiscount() + "%");
discount.setDiscount_value(coupon.getDiscount());
discount.setDiscountValue(coupon.getDiscount());
discount.setAmount(coupon.getAmount());
if (coupon.getDiscount() != 0) {
discount.setType(1);
......@@ -647,7 +649,7 @@ public abstract class BaseOrderPresenter<M extends BaseOrderContract.Model, V ex
BillOrderMoney orderMoney = getBillOrderItemByType(BillOrderMoney.COUPON_DISCOUNT_TYPE);
if (orderMoney != null) {
double totalMoney = getDiscountableFoodTotal(BillOrderMoney.COUPON_DISCOUNT_TYPE, false);
double discountPrice = CouponDiscountBean.calculationCoupon(orderMoney.getDiscount().getDiscount_value(), orderMoney.getDiscount().getAmount(), totalMoney);
double discountPrice = CouponDiscountBean.calculationCoupon(orderMoney.getDiscount().getDiscountValue(), orderMoney.getDiscount().getAmount(), totalMoney);
orderMoney.setMoney(discountPrice);
}
}
......@@ -1454,6 +1456,10 @@ public abstract class BaseOrderPresenter<M extends BaseOrderContract.Model, V ex
protected List<Discount> filterDiscountByType(List<Discount> discountList, String discountType) {
for (int i = discountList.size() - 1; i >= 0; i--) {
Discount discount = discountList.get(i);
if (discount.getDiscountType().equals("2")) {
//2=全部類型
continue;
}
if (TextUtils.isEmpty(discount.getDiscountType()) || !discount.getDiscountType().contains(discountType)) {
discountList.remove(i);
}
......@@ -1579,7 +1585,7 @@ public abstract class BaseOrderPresenter<M extends BaseOrderContract.Model, V ex
}
protected boolean hasNesOrderFoods() {
public boolean hasNesOrderFoods() {
if (getNewOrderFoodLists().size() > 0) {
return true;
}
......
......@@ -975,10 +975,10 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
//更新會員信息
mRootView.updateMemberInfo(memberInfo);
} else {
mRootView.showMessage("請輸入正確的會員號碼!");
mRootView.showMessage("未找到相關會員電話號碼,請重新輸入");
}
} else {
mRootView.showMessage("獲取會員信息失敗!");
mRootView.showMessage("獲取會員信息失敗");
}
} else {
mRootView.showMessage(info.getErrMsg());
......
......@@ -336,7 +336,7 @@ public class TablePresenter extends BasePresenter<TableContract.Model, TableCont
if (orderBean != null && respose.getData().getOrderDetails() != null) {
if (respose.getData().getCreateTime() != null && openTableBean != null) {
//將開台時間設置為訂單創建時間
openTableBean.setCreateTime(TimeUtils.getFormatTime(respose.getData().getCreateTime(), TimeUtils.DEFAULT_DATE_FORMAT));
openTableBean.setCreateTime(respose.getData().getCreateTime());
}
OpenTableManage.getDefault().setPeopleNumber(orderBean.getPerson());
......@@ -418,7 +418,7 @@ public class TablePresenter extends BasePresenter<TableContract.Model, TableCont
if (orderBean != null && respose.getData().getOrderDetails() != null) {
if (respose.getData().getCreateTime() != null && openTableBean != null) {
//將開台時間設置為訂單創建時間
openTableBean.setCreateTime(TimeUtils.getFormatTime(respose.getData().getCreateTime(), TimeUtils.DEFAULT_DATE_FORMAT));
openTableBean.setCreateTime(respose.getData().getCreateTime());
}
OpenTableManage.getDefault().setPeopleNumber(orderBean.getPerson());
......
......@@ -34,6 +34,7 @@ import com.gingersoft.gsa.cloud.base.order.bean.OrderDetail;
import com.gingersoft.gsa.cloud.base.order.bean.mealManger.MyOrderManage;
import com.gingersoft.gsa.cloud.base.order.bean.mealManger.OpenTableManage;
import com.gingersoft.gsa.cloud.base.table.bean.TableBean;
import com.gingersoft.gsa.cloud.base.utils.LanguageUtils;
import com.gingersoft.gsa.cloud.base.utils.VibratorUtils;
import com.gingersoft.gsa.cloud.base.utils.other.SPUtils;
import com.gingersoft.gsa.cloud.constans.FoodSummaryConstans;
......@@ -44,6 +45,7 @@ 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.model.bean.SoldoutCtrFood;
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.ui.adapter.BaseFragmentAdapter;
import com.gingersoft.gsa.cloud.table.mvp.ui.adapter.meal.FoodGroupAdapter;
......@@ -62,6 +64,7 @@ import com.gingersoft.gsa.cloud.ui.recylcler.decorator.GridDividerItemDecoration
import com.gingersoft.gsa.cloud.ui.view.PagerSlidingTabStrip;
import com.gingersoft.gsa.cloud.ui.view.RecyclerViewNoBugLinearLayoutManager;
import com.gingersoft.gsa.cloud.ui.view.SearchKeyBoardView;
import com.gingersoft.gsa.cloud.ui.widget.dialog.CommonTipDialog;
import com.gingersoft.gsa.cloud.ui.widget.dialog.LoadingDialog;
import com.gingersoft.gsa.cloud.zxing.MipcaCaptureActivity;
import com.jess.arms.base.BaseFragmentActivity;
......@@ -741,7 +744,7 @@ public class MealStandActivity extends BaseFragmentActivity<MealStandPresenter>
Intent intent = new Intent(this, OrderContentActivity.class);
startActivityForResult(intent, ORDER_CONTENT_CODE);
} else if (id == R.id.tv_no_save_return) {
returnBeforeActivity(true);
returnTableActivity(true);
} else if (id == R.id.btn_taste) {
currentFinePage = 0;
showRemarkLayout();
......@@ -817,11 +820,25 @@ public class MealStandActivity extends BaseFragmentActivity<MealStandPresenter>
@Override
public void onBackPressedSupport() {
super.onBackPressedSupport();
returnBeforeActivity(true);
// super.onBackPressedSupport();
returnTableActivity(true);
}
public void returnTableActivity(boolean initTable) {
if (!MyOrderManage.getInstance().isModifyOrder() && mPresenter.hasNesOrderFoods()) {
if (mPresenter.hasNesOrderFoods()) {
//没有过重复下单提示且有未送单食品,提示用户
String tip = LanguageUtils.get_language_system(this, "food.not.delivered.tip", "有食品未送單, 確認離開?");
Class[] parameterTypes = {boolean.class};
Object[] parameters = {initTable};
CommonTipDialog.showSurpisedDialog(this, tip, MealStandActivity.class, this,
"returnBeforeActivity", parameterTypes, parameters);
}
} else {
returnBeforeActivity(initTable);
}
}
public void returnBeforeActivity(boolean initTable) {
SPUtils.put(this, MealConstant.EXIT_IS_PLU_MODE, isPluMode);
if (initTable && OpenTableManage.getDefault().getTableBean() != null && !MyOrderManage.getInstance().isModifyOrder()) {
......@@ -885,7 +902,7 @@ public class MealStandActivity extends BaseFragmentActivity<MealStandPresenter>
@Override
public void OnBackClick() {
recordOperat(true);
returnBeforeActivity(true);
returnTableActivity(true);
}
});
int backPageBtnVisibility;
......@@ -912,7 +929,7 @@ public class MealStandActivity extends BaseFragmentActivity<MealStandPresenter>
@Override
public void onBackPage() {
returnBeforeActivity(true);
returnTableActivity(true);
}
});
mChooseNumberDialog.setCancelable(isNeedCancel);
......@@ -1328,11 +1345,11 @@ public class MealStandActivity extends BaseFragmentActivity<MealStandPresenter>
@Override
public void setModifierTop(int margins) {
// RelativeLayout.LayoutParams layoutParam = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
// layoutParam.setMargins(0, margins, 0, 0);
// layoutParam.addRule(RelativeLayout.ABOVE, R.id.ll_stand_oper);
// layoutParam.addRule(RelativeLayout.BELOW, R.id.rv_combo);
// rv_modifier.setLayoutParams(layoutParam);
RelativeLayout.LayoutParams layoutParam = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
layoutParam.setMargins(0, margins, 0, 0);
layoutParam.addRule(RelativeLayout.ABOVE, R.id.ll_stand_oper);
layoutParam.addRule(RelativeLayout.BELOW, R.id.rv_combo);
rv_modifier.setLayoutParams(layoutParam);
}
@Override
......
......@@ -160,7 +160,7 @@ public class TableAdapter extends DefaultAdapter<TableBean.DataBean> {
tv_people.setVisibility(View.VISIBLE);
tv_people.setText(person + "人");
String createDate = item.getCreateTime();
if (!TextUtils.isEmpty(createDate) && createDate.startsWith("Jul")) {
if (!TextUtils.isEmpty(createDate)) {
LogUtil.d(TAG, "tableName: " + item.getTableName() + " " + "createDate: " + createDate);
Date date = new Date(createDate);
String createTime = TimeUtils.getStringByFormat(date, TimeUtils.DEFAULT_DATE_FORMAT);
......
......@@ -158,28 +158,6 @@ public class ComboAdapter extends DefaultAdapter<ComboItem> {
}
private void initModifierSoldout(Modifier datasBean) {
// if (datasBean.isSoldout()) {
// iv_qty_sold.setVisibility(View.VISIBLE);
// } else {
// iv_qty_sold.setVisibility(View.INVISIBLE);
// }
// int maxNumber = datasBean.getMaxNumber();
// int number = datasBean.getNumber();
// if (number >= maxNumber) {
// tv_soldout.setVisibility(View.VISIBLE);
// tv_soldout.setText(maxNumber);
// } else {
// tv_soldout.setVisibility(View.INVISIBLE);
// }
// String qty = datasBean.getMaxNumber();
// if (qty.equals("")) {
// tv_soldout.setVisibility(View.INVISIBLE);
// } else {
// tv_soldout.setVisibility(View.VISIBLE);
// tv_soldout.setText(datasBean.getMaxNumber());
// }
String qty = datasBean.getCurrentMaxNumber();
if (TextUtils.isEmpty(qty)) {
tv_soldout.setVisibility(View.INVISIBLE);
......@@ -191,9 +169,6 @@ public class ComboAdapter extends DefaultAdapter<ComboItem> {
tv_soldout.setText(qty);
}
}
tv_soldout.setMaxHeight(soldoutModFlagHeight);
tv_soldout.setMinHeight(soldoutModFlagHeight);
tv_soldout.setTextSize(soldoutFoodFlagFontSize);
}
private void initComboName(ComboItem datasBean) {
......@@ -206,14 +181,10 @@ public class ComboAdapter extends DefaultAdapter<ComboItem> {
private void setSolodStatus(ComboItem datasBean) {
tv_soldout.setMaxHeight(soldoutModFlagHeight);
tv_soldout.setMinHeight(soldoutModFlagHeight);
tv_soldout.setTextSize(soldoutFoodFlagFontSize);
// tv_soldout.setTextColor(Color.parseColor("#000000"));
tv_soldout.setBackgroundDrawable(mContext.getResources().getDrawable(R.drawable.meal_shape_remaining_number_bg));
// tv_soldout.setMinWidth(15);
// tv_soldout.setTextSize(8);
// tv_soldout.setGravity(Gravity.CENTER);
tv_soldout.setGravity(Gravity.CENTER);
RelativeLayout.LayoutParams lp2 = new RelativeLayout.LayoutParams(new ViewGroup.MarginLayoutParams(60, 40));
lp2.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);
......
......@@ -175,19 +175,10 @@ public class FoodAdapter extends DefaultAdapter<Food> {
private void setStatus(Food datasBean) {
tv_soldout.setMaxHeight(mSoldoutFoodFlagHeight);
tv_soldout.setMinHeight(mSoldoutFoodFlagHeight);
tv_soldout.setTextSize(mSoldoutFoodFlagFontSize);
// tv_soldout.setTextColor(Color.parseColor("#000000"));
tv_soldout.setBackgroundDrawable(mContext.getResources().getDrawable(R.drawable.meal_shape_remaining_number_bg));
// tv_soldout.setMinWidth(20);
// tv_soldout.setTextSize(10);
// tv_soldout.setGravity(Gravity.CENTER);
// RelativeLayout.LayoutParams lp2 = new RelativeLayout.LayoutParams(new ViewGroup.MarginLayoutParams(60, 40));
// lp2.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);
// lp2.addRule(RelativeLayout.ALIGN_PARENT_LEFT);
// tv_soldout.setLayoutParams(lp2);
tv_soldout.setGravity(Gravity.CENTER);
tv_soldout.setVisibility(View.INVISIBLE);
iv_qtySold.setVisibility(View.INVISIBLE);
......@@ -239,8 +230,9 @@ public class FoodAdapter extends DefaultAdapter<Food> {
}
//设置当前选中item颜色
if (datasBean != null)
if (datasBean != null) {
datasBean.setSelected(true);
}
notifyDataSetChanged();
//保存上次操作的position
......
......@@ -226,8 +226,6 @@ public class FoodGroupAdapter extends DefaultAdapter<Food> {
String qty = datasBean.getMaxNumber();
if (!qty.equals("")) {
// tv_soldout.setVisibility(View.VISIBLE);
// tv_soldout.setText(datasBean.getMaxNumber());
blv_soldout.setVisibility(View.VISIBLE);
blv_soldout.setLableText(datasBean.getMaxNumber());
}
......
......@@ -35,6 +35,7 @@ public class ModifierAdapter extends DefaultAdapter<Modifier> {
private int ColHeight;
private int FontSize;
private int soldoutModFlagHeight;
private int OrderNumberChildFontSize;
......@@ -44,6 +45,7 @@ public class ModifierAdapter extends DefaultAdapter<Modifier> {
ColHeight = GsaCloudApplication.uiStyleConfiguration.getModBtnHeightValue();
FontSize = GsaCloudApplication.uiStyleConfiguration.getModFontSizeValue();
soldoutModFlagHeight = GsaCloudApplication.uiStyleConfiguration.getSoldoutModFlagHeightValue();
OrderNumberChildFontSize = GsaCloudApplication.uiStyleConfiguration.getSoldoutModFlagFontSizeValue();
}
......@@ -142,17 +144,10 @@ public class ModifierAdapter extends DefaultAdapter<Modifier> {
private void initModifierSoldout(Modifier datasBean) {
// String qty = datasBean.getCurrentMaxNumber();
// if (qty.equals("")) {
// tv_soldout.setVisibility(View.INVISIBLE);
// } else {
// tv_soldout.setVisibility(View.VISIBLE);
// tv_soldout.setText(datasBean.getCurrentMaxNumber());
// }
tv_soldout.setBackgroundDrawable(mContext.getResources().getDrawable(R.drawable.meal_shape_remaining_number_bg));
// tv_soldout.setMaxHeight(OrderNumberChildShowSize);
// tv_soldout.setMinHeight(OrderNumberChildShowSize);
tv_soldout.setMinHeight(soldoutModFlagHeight);
tv_soldout.setTextSize(OrderNumberChildFontSize);
tv_soldout.setBackgroundDrawable(mContext.getResources().getDrawable(R.drawable.meal_shape_remaining_number_bg));
tv_soldout.setGravity(Gravity.CENTER);
tv_soldout.setVisibility(View.INVISIBLE);
iv_qty_sold.setVisibility(View.INVISIBLE);
......
......@@ -499,7 +499,7 @@
android:layout_height="38dp"
android:layout_below="@+id/ll_meals"
android:background="@color/theme_white_color"
android:visibility="visible">
android:visibility="invisible">
<ImageView
android:id="@+id/iv_fine_back"
......@@ -543,7 +543,7 @@
android:layout_below="@+id/ll_meals"
android:layout_above="@+id/ll_stand_oper">
<LinearLayout
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
......@@ -565,8 +565,9 @@
android:divider="@null"
android:fadeScrollbars="false"
android:orientation="vertical"
android:layout_below="@+id/rv_combo"
android:visibility="visible" />
</LinearLayout>
</RelativeLayout>
</ScrollView>
<androidx.recyclerview.widget.RecyclerView
......
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