Commit aa267293 by 宁斌

餐廳擴展同步完善

parent 81e309bb
......@@ -51,7 +51,7 @@ android {
/**
* 版本号
*/
schemaVersion 19
schemaVersion 20
/**
* greendao输出dao的数据库操作实体类文件夹(相对路径 包名+自定义路径名称,包将创建于包名的直接路径下)
*/
......
......@@ -11,6 +11,7 @@ import android.os.RemoteException;
import androidx.annotation.NonNull;
import com.billy.cc.core.component.CC;
import com.bumptech.glide.Glide;
import com.elvishew.xlog.LogConfiguration;
import com.elvishew.xlog.LogLevel;
import com.elvishew.xlog.XLog;
......@@ -30,6 +31,7 @@ import com.gingersoft.gsa.cloud.base.utils.crash.AppCrashHandler;
import com.gingersoft.gsa.cloud.base.utils.log.LogUtil;
import com.gingersoft.gsa.cloud.base.utils.other.SPUtils;
import com.gingersoft.gsa.cloud.base.utils.xlog.MyBackupStrategy;
import com.gingersoft.gsa.cloud.bean.expandInfo.ExpandInfoSetting;
import com.gingersoft.gsa.cloud.bean.expandInfo.FunctionExtendedConfiguration;
import com.gingersoft.gsa.cloud.bean.expandInfo.UIStyleExtendedConfiguration;
import com.gingersoft.gsa.cloud.constans.HttpsConstans;
......@@ -51,6 +53,8 @@ import java.util.Locale;
import io.reactivex.Observable;
import io.reactivex.ObservableEmitter;
import io.reactivex.ObservableOnSubscribe;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.functions.Consumer;
import io.reactivex.schedulers.Schedulers;
import me.jessyan.autosize.AutoSize;
import me.jessyan.autosize.AutoSizeConfig;
......@@ -133,7 +137,11 @@ public class GsaCloudApplication extends BaseApplication {
functionConfiguration = new FunctionExtendedConfiguration();
isLogin = (boolean) SPUtils.get(this, PrintConstans.IS_LOGIN, false);
//上傳餐廳擴展信息
ExpandInfoSetting.initUpdateExtendedConfiguration(uiStyleConfiguration,functionConfiguration);
//獲取餐廳擴展表數據
initExpandInfo();
// 设定一些通用的属性,这些属性在每次统计事件中都会附带
// 注意:如果此处的属性名与内置属性的名称相同,则内置属性会被覆盖
// Tracker.INSTANCE.addProperty("附加的属性1", "附加的属性1");
......@@ -151,16 +159,19 @@ public class GsaCloudApplication extends BaseApplication {
}
private void initExpandInfo() {
Observable.create(new ObservableOnSubscribe<Void>() {
@Override
public void subscribe(ObservableEmitter<Void> emitter) throws Exception {
ExpandInfoDaoUtils expandInfoDaoUtils = new ExpandInfoDaoUtils(getAppContext());
List<ExpandInfo> expandInfos = expandInfoDaoUtils.queryAllExpandInfo();
if (expandInfos != null) {
RestaurantExpandInfoUtils.setCommonExpandInfo(expandInfos);
}
}
}).subscribeOn(Schedulers.io()).subscribe();//在IO线程执行数据库处理操作
//在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() {
......
......@@ -3,6 +3,7 @@ package com.gingersoft.gsa.cloud.base.utils;
import android.text.TextUtils;
import com.gingersoft.gsa.cloud.base.application.GsaCloudApplication;
import com.gingersoft.gsa.cloud.bean.expandInfo.ExpandInfoSetting;
import com.gingersoft.gsa.cloud.bean.expandInfo.FunctionExtendedConfiguration;
import com.gingersoft.gsa.cloud.bean.expandInfo.UIStyleExtendedConfiguration;
import com.gingersoft.gsa.cloud.constans.ExpandConstant;
......@@ -100,15 +101,23 @@ public class RestaurantExpandInfoUtils {
Object value = map.get(expandinfoName);
try {
field.setAccessible(true);
Object fieldType = field.get(uiStyleConfiguration);
boolean typeMatch = (value instanceof Integer && fieldType instanceof Integer) ||
(value instanceof String && fieldType instanceof String) ||
(value instanceof Boolean && fieldType instanceof Boolean);
ExpandInfoSetting expandInfo = (ExpandInfoSetting) field.get(uiStyleConfiguration);
boolean typeMatch = (value instanceof Integer && expandInfo.getDataType() == 1) ||
(value instanceof String && (expandInfo.getDataType() == 2 || expandInfo.getDataType() == 4)) ||
(value instanceof Boolean && expandInfo.getDataType() == 3);
if (!typeMatch) {
//後台配置的類型與前端的不一致 直接不管
continue;
}
field.set(uiStyleConfiguration, value);
if (expandInfo.getDataType() == 1) {
expandInfo.setValueInt((Integer) value);
} else if (expandInfo.getDataType() == 2) {
expandInfo.setValueChar((String) value);
} else if (expandInfo.getDataType() == 3) {
expandInfo.setValueBoolean((Boolean) value);
} else if (expandInfo.getDataType() == 4) {
expandInfo.setValueDateTime((String) value);
}
} catch (IllegalAccessException e) {
e.printStackTrace();
}
......@@ -123,20 +132,29 @@ public class RestaurantExpandInfoUtils {
Object value = map.get(expandinfoName);
try {
field.setAccessible(true);
Object fieldType = field.get(functionConfiguration);
boolean typeMatch = (value instanceof Integer && fieldType instanceof Integer) ||
(value instanceof String && fieldType instanceof String) ||
(value instanceof Boolean && fieldType instanceof Boolean);
ExpandInfoSetting expandInfo = (ExpandInfoSetting) field.get(functionConfiguration);
boolean typeMatch = (value instanceof Integer && expandInfo.getDataType() == 1) ||
(value instanceof String && (expandInfo.getDataType() == 2 || expandInfo.getDataType() == 4)) ||
(value instanceof Boolean && expandInfo.getDataType() == 3);
if (!typeMatch) {
//後台配置的類型與前端的不一致 直接不管
continue;
}
field.set(functionConfiguration, value);
if (expandInfo.getDataType() == 1) {
expandInfo.setValueInt((Integer) value);
} else if (expandInfo.getDataType() == 2) {
expandInfo.setValueChar((String) value);
} else if (expandInfo.getDataType() == 3) {
expandInfo.setValueBoolean((Boolean) value);
} else if (expandInfo.getDataType() == 4) {
expandInfo.setValueDateTime((String) value);
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
int i = 100;
}
......
package com.gingersoft.gsa.cloud.bean.expandInfo;
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;
import com.gingersoft.gsa.cloud.database.utils.ExpandInfoDaoUtils;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import io.reactivex.Observable;
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;
/**
* @author : bin
......@@ -14,13 +37,12 @@ import lombok.Setter;
@Builder
@Getter
@Setter
public class ExpandInfoSetting{
public class ExpandInfoSetting {
private String settingName;
private int valueInt;
private Integer valueInt;
private String valueChar;
private boolean valueBoolean;
private Boolean valueBoolean;
private String valueDateTime;
private String valueDateTime2;
/**
* 數據類型 1:整形,2:字符型,3:布爾型,4:日期類型
*/
......@@ -28,5 +50,94 @@ public class ExpandInfoSetting{
private int sort;
private String showName;
private String remark;
public <T> T getValue() {
if (valueInt != null) {
return (T) valueInt;
} else if (valueChar != null) {
return (T) valueChar;
} else if (valueBoolean != null) {
return (T) valueBoolean;
} else if (valueDateTime != null) {
return (T) valueDateTime;
}
return null;
}
public static void initUpdateExtendedConfiguration(Object... objects) {
Observable.just(0)
.subscribeOn(Schedulers.newThread())
.subscribe(new Consumer<Integer>() {
@Override
public void accept(@io.reactivex.annotations.NonNull Integer integer) throws Exception {
List<ExpandInfoSetting> expandInfoSettingList = new ArrayList<>();
for (Object obj : objects) {
expandInfoSettingList.addAll(scanExtendedConfiguration(obj));
}
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();
}
});
}
private static List<ExpandInfoSetting> scanExtendedConfiguration(Object obj) {
List<ExpandInfoSetting> expandInfoList = new ArrayList<>();
HashMap<String, String> settingNameMap = new HashMap<>();
Field[] fields = obj.getClass().getDeclaredFields();
for (Field field : fields) {
settingNameMap.put(field.getName().substring(1), field.getName());
}
Method[] methods = obj.getClass().getDeclaredMethods();
for (Method method : methods) {
Class<?> returnClass = method.getReturnType();
if (method.getName().startsWith("get") && returnClass.equals(ExpandInfoSetting.class)) {
try {
Object [] objs ={};
//反射執行get方法 獲取每個配置類信息
ExpandInfoSetting expandInfo = (ExpandInfoSetting) ReflectionUtils.invokeMethod(method, obj, objs);
//獲取完整的settingName
String settingName;
if (settingNameMap.containsKey(method.getName().substring(4))) {
settingName = settingNameMap.get(method.getName().substring(4));
} else {
settingName = method.getName().substring(3);
}
expandInfo.setSettingName(settingName);
expandInfo.setShowName(settingName);
if (expandInfo.getValueInt() != null) {
expandInfo.setDataType(ExpandInfo.data_type_int);
} else if (expandInfo.getValueChar() != null) {
expandInfo.setDataType(ExpandInfo.data_type_string);
} else if (expandInfo.getValueBoolean() != null) {
expandInfo.setDataType(ExpandInfo.data_type_boolean);
} else if (expandInfo.getValueDateTime() != null) {
expandInfo.setDataType(ExpandInfo.data_type_date);
}
if (expandInfo.getValueInt() == null) {
//為了兼容後台,這裡不是valueInt值默認給0
expandInfo.setValueInt(0);
}
expandInfoList.add(expandInfo);
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InvocationTargetException e) {
e.printStackTrace();
}
}
}
return expandInfoList;
}
}
......@@ -14,165 +14,164 @@ import lombok.Setter;
public class FunctionExtendedConfiguration {
private ExpandInfoSetting Rounding = ExpandInfoSetting.builder()
.settingName("Rounding")
.valueInt(0)
.dataType((byte) 1)
.showName("Rounding")
.remark("賬單小數相關")
.build();
private ExpandInfoSetting RoundingDecimal = ExpandInfoSetting.builder()
.settingName("RoundingDecimal")
.valueInt(0)
.dataType((byte) 1)
.showName("RoundingDecimal")
.valueInt(1)
.remark("賬單小數相關")
.build();
private ExpandInfoSetting ItemDecimals = ExpandInfoSetting.builder()
.settingName("ItemDecimals")
.valueInt(0)
.dataType((byte) 1)
.showName("ItemDecimals")
.valueInt(2)
.remark("小數位金額")
.build();
private ExpandInfoSetting DeliveryPrintCount = ExpandInfoSetting.builder()
.settingName("DeliveryPrintCount")
.valueInt(0)
.dataType((byte) 1)
.showName("DeliveryPrintCount")
.valueInt(1)
.remark("外送印單打印次數")
.build();
private ExpandInfoSetting DeliveryClosingPC = ExpandInfoSetting.builder()
.settingName("DeliveryClosingPC")
.valueInt(0)
.dataType((byte) 1)
.showName("DeliveryClosingPC")
.valueInt(1)
.remark("外送結賬打印次數")
.build();
private ExpandInfoSetting TableModePrintCount = ExpandInfoSetting.builder()
.settingName("TableModePrintCount")
.valueInt(0)
.dataType((byte) 1)
.showName("TableModePrintCount")
.valueInt(1)
.remark("餐檯印單打印次數")
.build();
private ExpandInfoSetting TableModeClosingPC = ExpandInfoSetting.builder()
.settingName("TableModeClosingPC")
.valueInt(0)
.dataType((byte) 1)
.showName("TableModeClosingPC")
.valueInt(1)
.remark("餐檯模式結賬單打印次數")
.build();
private ExpandInfoSetting OrderReceivingTimeout = ExpandInfoSetting.builder()
.settingName("OrderReceivingTimeout")
.valueInt(0)
.dataType((byte) 1)
.showName("OrderReceivingTimeout")
.valueInt(60 * 60 * 1000)
.remark("外送接單超時時間")
.build();
private ExpandInfoSetting PrintMemberInfo = ExpandInfoSetting.builder()
.settingName("PrintMemberInfo")
.valueInt(0)
.dataType((byte) 1)
.showName("PrintMemberInfo")
.valueBoolean(false)
.remark("是否打印會員信息")
.build();
private ExpandInfoSetting PrintPage = ExpandInfoSetting.builder()
.settingName("PrintPage")
.valueInt(0)
.dataType((byte) 1)
.showName("PrintPage")
.valueBoolean(false)
.remark("是否打印頁數")
.build();
private ExpandInfoSetting PrintMergerFood = ExpandInfoSetting.builder()
.settingName("PrintMergerFood")
.valueInt(0)
.dataType((byte) 1)
.showName("PrintMergerFood")
.valueBoolean(false)
.remark("是否合併食品")
.build();
private ExpandInfoSetting PrintStatisticsAmount = ExpandInfoSetting.builder()
.settingName("PrintStatisticsAmount")
.valueInt(0)
.dataType((byte) 1)
.showName("PrintStatisticsAmount")
.valueBoolean(false)
.remark("是否顯示統計打印數")
.build();
private ExpandInfoSetting PrintFirstOrder = ExpandInfoSetting.builder()
.settingName("PrintFirstOrder")
.valueInt(0)
.dataType((byte) 1)
.showName("PrintFirstOrder")
.valueBoolean(false)
.remark("是否打印\"頭單\"文字")
.build();
private ExpandInfoSetting FrozenChainAutoOrder = ExpandInfoSetting.builder()
.settingName("FrozenChainAutoOrder")
.valueInt(0)
.dataType((byte) 1)
.showName("FrozenChainAutoOrder")
.valueBoolean(true)
.remark("是否自動接單 為0true")
.build();
private ExpandInfoSetting MergeSendFood = ExpandInfoSetting.builder()
.settingName("MergeSendFood")
.valueInt(0)
.dataType((byte) 1)
.showName("MergeSendFood")
.valueBoolean(false)
.remark("送單是否自動合併食品")
.build();
private ExpandInfoSetting AutoPrinterPaper = ExpandInfoSetting.builder()
.settingName("AutoPrinterPaper")
.valueInt(0)
.dataType((byte) 1)
.showName("AutoPrinterPaper")
.valueBoolean(false)
.remark("送單自動打印上菜紙")
.build();
private ExpandInfoSetting ToPrintQRCode = ExpandInfoSetting.builder()
.settingName("ToPrintQRCode")
.valueInt(0)
.dataType((byte) 1)
.showName("ToPrintQRCode")
.valueBoolean(false)
.remark("結賬是否打印積分二維碼")
.build();
private ExpandInfoSetting AutoQuitTime = ExpandInfoSetting.builder()
.settingName("AutoQuitTime")
.valueInt(600)
.dataType((byte) 1)
.showName("AutoQuitTime")
.remark("餐檯模式下單頁多少秒不操作返回餐檯頁面")
.build();
private int DeliveryPrintCount;//外送印單打印次數
private int DeliveryClosingPC;//外送結賬打印次數
private int TableModePrintCount;//餐檯印單打印次數
private int TableModeClosingPC;//餐檯模式結賬單打印次數
private int OrderReceivingTimeout;//外送接單超時時間
private int PrintMemberInfo;//是否打印會員信息
private int PrintPage;//是否打印頁數
private int PrintMergerFood;//是否合併食品
private int PrintStatisticsAmount;//是否顯示統計打印數
private int PrintFirstOrder;//是否打印"頭單"文字
private int FrozenChainAutoOrder;//是否自動接單 為0true
public <T>T getRoundingVaule() {
return Rounding.getValue();
}
public <T>T getRoundingDecimalVaule() {
return RoundingDecimal.getValue();
}
public <T>T getItemDecimalsVaule() {
return ItemDecimals.getValue();
}
public <T>T getDeliveryPrintCountVaule() {
return DeliveryPrintCount.getValue();
}
public <T>T getDeliveryClosingPCVaule() {
return DeliveryClosingPC.getValue();
}
public <T>T getTableModePrintCountVaule() {
return TableModePrintCount.getValue();
}
public <T>T getTableModeClosingPCVaule() {
return TableModeClosingPC.getValue();
}
public <T>T getOrderReceivingTimeoutVaule() {
return OrderReceivingTimeout.getValue();
}
public <T>T getPrintMemberInfoVaule() {
return PrintMemberInfo.getValue();
}
public <T>T getPrintPageVaule() {
return PrintPage.getValue();
}
public <T>T getPrintMergerFoodVaule() {
return PrintMergerFood.getValue();
}
public <T>T getPrintStatisticsAmountVaule() {
return PrintStatisticsAmount.getValue();
}
public <T>T getPrintFirstOrderVaule() {
return PrintFirstOrder.getValue();
}
public <T>T getFrozenChainAutoOrderVaule() {
return FrozenChainAutoOrder.getValue();
}
public <T>T getMergeSendFoodVaule() {
return MergeSendFood.getValue();
}
private int MergeSendFood;//送單是否自動合併食品
private int AutoPrinterPaper;//送單自動打印上菜紙
private int ToPrintQRCode;//結賬是否打印積分二維碼
private int AutoQuitTime = 600;//餐檯模式下單頁多少秒不操作返回餐檯頁面
public <T>T getAutoPrinterPaperVaule() {
return AutoPrinterPaper.getValue();
}
public <T>T getToPrintQRCodeVaule() {
return ToPrintQRCode.getValue();
}
public <T>T getAutoQuitTimeVaule() {
return AutoQuitTime.getValue();
}
}
......@@ -16,38 +16,188 @@ public class UIStyleExtendedConfiguration {
/**
* 食品組、食品、細項、折扣行列寬高
*/
private int foodGroupRow = 2;
private int foodGroupColumn = 5;
private int foodColumn = 4;
private int comboColumn = 4;
private int modColumn = 4;
private int discountColumn = 4;
private ExpandInfoSetting foodGroupRow = ExpandInfoSetting.builder()
.valueInt(2)
.remark("食品組行數")
.build();
private ExpandInfoSetting foodGroupColumn = ExpandInfoSetting.builder()
.valueInt(5)
.remark("食品組列數")
.build();
private ExpandInfoSetting foodColumn = ExpandInfoSetting.builder()
.valueInt(4)
.remark("食品列數")
.build();
private ExpandInfoSetting comboColumn = ExpandInfoSetting.builder()
.valueInt(4)
.remark("套餐列數")
.build();
private ExpandInfoSetting modColumn = ExpandInfoSetting.builder()
.valueInt(4)
.remark("細項列數")
.build();
private ExpandInfoSetting discountColumn = ExpandInfoSetting.builder()
.valueInt(4)
.remark("餐牌折扣列數")
.build();
/**
* 食品組、食品、細項、折扣Item高度
*/
private int foodGroupBtnHeight = 150;
private int foodBtnHeight = 120;
private int modBtnHeight = 80;
private int comboHeight = 90;
private int discountHeight = 80;
private int LayoutQtyHeight = 40;
private ExpandInfoSetting foodGroupBtnHeight = ExpandInfoSetting.builder()
.valueInt(150)
.remark("食品組高度")
.build();
private ExpandInfoSetting foodBtnHeight = ExpandInfoSetting.builder()
.valueInt(120)
.remark("食品高度")
.build();
private ExpandInfoSetting modBtnHeight = ExpandInfoSetting.builder()
.valueInt(80)
.remark("細項高度")
.build();
private ExpandInfoSetting comboHeight = ExpandInfoSetting.builder()
.valueInt(90)
.remark("套餐高度")
.build();
private ExpandInfoSetting discountHeight = ExpandInfoSetting.builder()
.valueInt(80)
.remark("餐牌折扣Item高度")
.build();
private ExpandInfoSetting LayoutQtyHeight = ExpandInfoSetting.builder()
.valueInt(40)
.remark("選擇數量紅點高度")
.build();
private ExpandInfoSetting soldoutFoodFlagHeight = ExpandInfoSetting.builder()
.valueInt(20)
.remark("食品沽清標誌高度")
.build();
private ExpandInfoSetting soldoutModFlagHeight = ExpandInfoSetting.builder()
.valueInt(15)
.remark("細項沽清標誌高度")
.build();
/**
* 食品組、食品、細項、折扣字體大小
*/
private int foodGroupFontSize = 14;
private int foodFontSize = 14;
private int comboFontSize = 12;
private int modFontSize = 12;
private int discountFontSize = 12;
private ExpandInfoSetting foodGroupFontSize = ExpandInfoSetting.builder()
.valueInt(40)
.remark("食品組字體大小")
.build();
private ExpandInfoSetting foodFontSize = ExpandInfoSetting.builder()
.valueInt(40)
.remark("食品字體大小")
.build();
private ExpandInfoSetting comboFontSize = ExpandInfoSetting.builder()
.valueInt(40)
.remark("套餐字體大小")
.build();
private ExpandInfoSetting modFontSize = ExpandInfoSetting.builder()
.valueInt(40)
.remark("細項字體大小")
.build();
private ExpandInfoSetting discountFontSize = ExpandInfoSetting.builder()
.valueInt(40)
.remark("折扣字體大小")
.build();
private ExpandInfoSetting soldoutFoodFlagFontSize = ExpandInfoSetting.builder()
.valueInt(10)
.remark("食品沽清標誌字體大小")
.build();
private ExpandInfoSetting soldoutModFlagFontSize = ExpandInfoSetting.builder()
.valueInt(7)
.remark("細項沽清標誌字體大小")
.build();
private ExpandInfoSetting soldoutCtrlFoodFontSize = ExpandInfoSetting.builder()
.valueInt(40)
.remark("估清控制item字體大小")
.build();
public <T> T getFoodGroupRowValue() {
return foodGroupRow.getValue();
}
public <T> T getFoodGroupColumnValue() {
return foodGroupColumn.getValue();
}
public <T> T getFoodColumnValue() {
return foodColumn.getValue();
}
public <T> T getComboColumnValue() {
return comboColumn.getValue();
}
public <T> T getModColumnValue() {
return modColumn.getValue();
}
public <T> T getDiscountColumnValue() {
return discountColumn.getValue();
}
public <T> T getFoodGroupBtnHeightValue() {
return foodGroupBtnHeight.getValue();
}
public <T> T getFoodBtnHeightValue() {
return foodBtnHeight.getValue();
}
public <T> T getModBtnHeightValue() {
return modBtnHeight.getValue();
}
public <T> T getComboHeightValue() {
return comboHeight.getValue();
}
public <T> T getDiscountHeightValue() {
return discountHeight.getValue();
}
public <T> T getLayoutQtyHeightValue() {
return LayoutQtyHeight.getValue();
}
public <T> T getSoldoutFoodFlagHeightValue() {
return soldoutFoodFlagHeight.getValue();
}
public <T> T getSoldoutModFlagHeightValue() {
return soldoutModFlagHeight.getValue();
}
public <T> T getFoodGroupFontSizeValue() {
return foodGroupFontSize.getValue();
}
public <T> T getFoodFontSizeValue() {
return foodFontSize.getValue();
}
public <T> T getComboFontSizeValue() {
return comboFontSize.getValue();
}
public <T> T getModFontSizeValue() {
return modFontSize.getValue();
}
private int OrderNumberShowSize = 20;
private int OrderNumberFontSize = 7;
private int OrderNumberChildShowSize = 20;
private int OrderNumberChildFontSize = 10;
public <T> T getDiscountFontSizeValue() {
return discountFontSize.getValue();
}
//估清控制食品字體大小
private int soldoutCtrlFoodFontSize = 16;
public <T> T getSoldoutFoodFlagFontSizeValue() {
return soldoutFoodFlagFontSize.getValue();
}
public <T> T getSoldoutModFlagFontSizeValue() {
return soldoutModFlagFontSize.getValue();
}
public <T> T getSoldoutCtrlFoodFontSizeValue() {
return soldoutCtrlFoodFontSize.getValue();
}
}
......@@ -21,7 +21,6 @@ import lombok.Data;
@Entity
public class ExpandInfo implements Serializable {
private static final long serialVersionUID = -82395061667241608L;
@Property(nameInDb = "_id")
......@@ -38,6 +37,7 @@ public class ExpandInfo implements Serializable {
*/
private Integer valueInt;
private String valueChar;
private Boolean valueBoolean;
private String valueDatetime;
/**
* 功能说明
......@@ -58,20 +58,23 @@ public class ExpandInfo implements Serializable {
@Transient
private boolean isUpdate = false;
public static final int data_type_int = 1;
public static final int data_type_string = 2;
public static final int data_type_boolean = 3;
public static final int data_type_date = 4;
public static final byte data_type_int = 1;
public static final byte data_type_string = 2;
public static final byte data_type_boolean = 3;
public static final byte data_type_date = 4;
@Generated(hash = 1155994232)
@Generated(hash = 1753053413)
public ExpandInfo(Long id, int restaurantId, String settingName,
Integer valueInt, String valueChar, String valueDatetime, String remark,
int dataType, String showName) {
Integer valueInt, String valueChar, Boolean valueBoolean,
String valueDatetime, String remark, int dataType, String showName) {
this.id = id;
this.restaurantId = restaurantId;
this.settingName = settingName;
this.valueInt = valueInt;
this.valueChar = valueChar;
this.valueBoolean = valueBoolean;
this.valueDatetime = valueDatetime;
this.remark = remark;
this.dataType = dataType;
......@@ -80,6 +83,9 @@ public class ExpandInfo implements Serializable {
@Generated(hash = 9429432)
public ExpandInfo() {
}
public Long getId() {
return this.id;
}
......@@ -122,6 +128,18 @@ public class ExpandInfo implements Serializable {
public void setRemark(String remark) {
this.remark = remark;
}
public String getShowName() {
return this.showName;
}
public void setShowName(String showName) {
this.showName = showName;
}
public Boolean getValueBoolean() {
return this.valueBoolean;
}
public void setValueBoolean(Boolean valueBoolean) {
this.valueBoolean = valueBoolean;
}
public int getDataType() {
return this.dataType;
}
......@@ -129,19 +147,4 @@ public class ExpandInfo implements Serializable {
this.dataType = dataType;
}
public boolean isUpdate() {
return isUpdate;
}
public void setUpdate(boolean update) {
isUpdate = update;
}
public String getShowName() {
return showName;
}
public void setShowName(String showName) {
this.showName = showName;
}
}
......@@ -14,10 +14,10 @@ import org.greenrobot.greendao.identityscope.IdentityScopeType;
// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
/**
* Master of DAO (schema version 19): knows all DAOs.
* Master of DAO (schema version 20): knows all DAOs.
*/
public class DaoMaster extends AbstractDaoMaster {
public static final int SCHEMA_VERSION = 19;
public static final int SCHEMA_VERSION = 20;
/** Creates underlying database table using DAOs. */
public static void createAllTables(Database db, boolean ifNotExists) {
......
......@@ -29,10 +29,11 @@ public class ExpandInfoDao extends AbstractDao<ExpandInfo, Long> {
public final static Property SettingName = new Property(2, String.class, "settingName", false, "SETTING_NAME");
public final static Property ValueInt = new Property(3, Integer.class, "valueInt", false, "VALUE_INT");
public final static Property ValueChar = new Property(4, String.class, "valueChar", false, "VALUE_CHAR");
public final static Property ValueDatetime = new Property(5, String.class, "valueDatetime", false, "VALUE_DATETIME");
public final static Property Remark = new Property(6, String.class, "remark", false, "REMARK");
public final static Property DataType = new Property(7, int.class, "dataType", false, "DATA_TYPE");
public final static Property ShowName = new Property(8, String.class, "showName", false, "SHOW_NAME");
public final static Property ValueBoolean = new Property(5, Boolean.class, "valueBoolean", false, "VALUE_BOOLEAN");
public final static Property ValueDatetime = new Property(6, String.class, "valueDatetime", false, "VALUE_DATETIME");
public final static Property Remark = new Property(7, String.class, "remark", false, "REMARK");
public final static Property DataType = new Property(8, int.class, "dataType", false, "DATA_TYPE");
public final static Property ShowName = new Property(9, String.class, "showName", false, "SHOW_NAME");
}
......@@ -53,10 +54,11 @@ public class ExpandInfoDao extends AbstractDao<ExpandInfo, Long> {
"\"SETTING_NAME\" TEXT," + // 2: settingName
"\"VALUE_INT\" INTEGER," + // 3: valueInt
"\"VALUE_CHAR\" TEXT," + // 4: valueChar
"\"VALUE_DATETIME\" TEXT," + // 5: valueDatetime
"\"REMARK\" TEXT," + // 6: remark
"\"DATA_TYPE\" INTEGER NOT NULL ," + // 7: dataType
"\"SHOW_NAME\" TEXT);"); // 8: showName
"\"VALUE_BOOLEAN\" INTEGER," + // 5: valueBoolean
"\"VALUE_DATETIME\" TEXT," + // 6: valueDatetime
"\"REMARK\" TEXT," + // 7: remark
"\"DATA_TYPE\" INTEGER NOT NULL ," + // 8: dataType
"\"SHOW_NAME\" TEXT);"); // 9: showName
}
/** Drops the underlying database table. */
......@@ -90,20 +92,25 @@ public class ExpandInfoDao extends AbstractDao<ExpandInfo, Long> {
stmt.bindString(5, valueChar);
}
Boolean valueBoolean = entity.getValueBoolean();
if (valueBoolean != null) {
stmt.bindLong(6, valueBoolean ? 1L: 0L);
}
String valueDatetime = entity.getValueDatetime();
if (valueDatetime != null) {
stmt.bindString(6, valueDatetime);
stmt.bindString(7, valueDatetime);
}
String remark = entity.getRemark();
if (remark != null) {
stmt.bindString(7, remark);
stmt.bindString(8, remark);
}
stmt.bindLong(8, entity.getDataType());
stmt.bindLong(9, entity.getDataType());
String showName = entity.getShowName();
if (showName != null) {
stmt.bindString(9, showName);
stmt.bindString(10, showName);
}
}
......@@ -132,20 +139,25 @@ public class ExpandInfoDao extends AbstractDao<ExpandInfo, Long> {
stmt.bindString(5, valueChar);
}
Boolean valueBoolean = entity.getValueBoolean();
if (valueBoolean != null) {
stmt.bindLong(6, valueBoolean ? 1L: 0L);
}
String valueDatetime = entity.getValueDatetime();
if (valueDatetime != null) {
stmt.bindString(6, valueDatetime);
stmt.bindString(7, valueDatetime);
}
String remark = entity.getRemark();
if (remark != null) {
stmt.bindString(7, remark);
stmt.bindString(8, remark);
}
stmt.bindLong(8, entity.getDataType());
stmt.bindLong(9, entity.getDataType());
String showName = entity.getShowName();
if (showName != null) {
stmt.bindString(9, showName);
stmt.bindString(10, showName);
}
}
......@@ -162,10 +174,11 @@ public class ExpandInfoDao extends AbstractDao<ExpandInfo, Long> {
cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // settingName
cursor.isNull(offset + 3) ? null : cursor.getInt(offset + 3), // valueInt
cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // valueChar
cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // valueDatetime
cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // remark
cursor.getInt(offset + 7), // dataType
cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8) // showName
cursor.isNull(offset + 5) ? null : cursor.getShort(offset + 5) != 0, // valueBoolean
cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // valueDatetime
cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // remark
cursor.getInt(offset + 8), // dataType
cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9) // showName
);
return entity;
}
......@@ -177,10 +190,11 @@ public class ExpandInfoDao extends AbstractDao<ExpandInfo, Long> {
entity.setSettingName(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2));
entity.setValueInt(cursor.isNull(offset + 3) ? null : cursor.getInt(offset + 3));
entity.setValueChar(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4));
entity.setValueDatetime(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5));
entity.setRemark(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6));
entity.setDataType(cursor.getInt(offset + 7));
entity.setShowName(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8));
entity.setValueBoolean(cursor.isNull(offset + 5) ? null : cursor.getShort(offset + 5) != 0);
entity.setValueDatetime(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6));
entity.setRemark(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7));
entity.setDataType(cursor.getInt(offset + 8));
entity.setShowName(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9));
}
@Override
......
package com.gingersoft.gsa.cloud.greendao;
import android.database.Cursor;
import android.database.sqlite.SQLiteStatement;
import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.Property;
import org.greenrobot.greendao.internal.DaoConfig;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.database.DatabaseStatement;
import com.gingersoft.gsa.cloud.database.bean.ColorBean;
// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
/**
* DAO for table "COLOR_BEAN".
*/
public class ColorBeanDao extends AbstractDao<ColorBean, Void> {
public static final String TABLENAME = "COLOR_BEAN";
/**
* Properties of entity ColorBean.<br/>
* Can be used for QueryBuilder and for referencing column names.
*/
public static class Properties {
public final static Property ColorId = new Property(0, int.class, "colorId", false, "COLOR_ID");
public final static Property ColorStart = new Property(1, String.class, "colorStart", false, "COLOR_START");
public final static Property ColorStop = new Property(2, String.class, "colorStop", false, "COLOR_STOP");
public final static Property FontColor = new Property(3, String.class, "fontColor", false, "FONT_COLOR");
public final static Property AndroidColor = new Property(4, String.class, "androidColor", false, "ANDROID_COLOR");
public final static Property AndroidFontColor = new Property(5, String.class, "androidFontColor", false, "ANDROID_FONT_COLOR");
public final static Property CreateTime = new Property(6, String.class, "createTime", false, "CREATE_TIME");
public final static Property EditTime = new Property(7, String.class, "editTime", false, "EDIT_TIME");
}
public ColorBeanDao(DaoConfig config) {
super(config);
}
public ColorBeanDao(DaoConfig config, DaoSession daoSession) {
super(config, daoSession);
}
/** Creates the underlying database table. */
public static void createTable(Database db, boolean ifNotExists) {
String constraint = ifNotExists? "IF NOT EXISTS ": "";
db.execSQL("CREATE TABLE " + constraint + "\"COLOR_BEAN\" (" + //
"\"COLOR_ID\" INTEGER NOT NULL ," + // 0: colorId
"\"COLOR_START\" TEXT," + // 1: colorStart
"\"COLOR_STOP\" TEXT," + // 2: colorStop
"\"FONT_COLOR\" TEXT," + // 3: fontColor
"\"ANDROID_COLOR\" TEXT," + // 4: androidColor
"\"ANDROID_FONT_COLOR\" TEXT," + // 5: androidFontColor
"\"CREATE_TIME\" TEXT," + // 6: createTime
"\"EDIT_TIME\" TEXT);"); // 7: editTime
}
/** Drops the underlying database table. */
public static void dropTable(Database db, boolean ifExists) {
String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"COLOR_BEAN\"";
db.execSQL(sql);
}
@Override
protected final void bindValues(DatabaseStatement stmt, ColorBean entity) {
stmt.clearBindings();
stmt.bindLong(1, entity.getColorId());
String colorStart = entity.getColorStart();
if (colorStart != null) {
stmt.bindString(2, colorStart);
}
String colorStop = entity.getColorStop();
if (colorStop != null) {
stmt.bindString(3, colorStop);
}
String fontColor = entity.getFontColor();
if (fontColor != null) {
stmt.bindString(4, fontColor);
}
String androidColor = entity.getAndroidColor();
if (androidColor != null) {
stmt.bindString(5, androidColor);
}
String androidFontColor = entity.getAndroidFontColor();
if (androidFontColor != null) {
stmt.bindString(6, androidFontColor);
}
String createTime = entity.getCreateTime();
if (createTime != null) {
stmt.bindString(7, createTime);
}
String editTime = entity.getEditTime();
if (editTime != null) {
stmt.bindString(8, editTime);
}
}
@Override
protected final void bindValues(SQLiteStatement stmt, ColorBean entity) {
stmt.clearBindings();
stmt.bindLong(1, entity.getColorId());
String colorStart = entity.getColorStart();
if (colorStart != null) {
stmt.bindString(2, colorStart);
}
String colorStop = entity.getColorStop();
if (colorStop != null) {
stmt.bindString(3, colorStop);
}
String fontColor = entity.getFontColor();
if (fontColor != null) {
stmt.bindString(4, fontColor);
}
String androidColor = entity.getAndroidColor();
if (androidColor != null) {
stmt.bindString(5, androidColor);
}
String androidFontColor = entity.getAndroidFontColor();
if (androidFontColor != null) {
stmt.bindString(6, androidFontColor);
}
String createTime = entity.getCreateTime();
if (createTime != null) {
stmt.bindString(7, createTime);
}
String editTime = entity.getEditTime();
if (editTime != null) {
stmt.bindString(8, editTime);
}
}
@Override
public Void readKey(Cursor cursor, int offset) {
return null;
}
@Override
public ColorBean readEntity(Cursor cursor, int offset) {
ColorBean entity = new ColorBean( //
cursor.getInt(offset + 0), // colorId
cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // colorStart
cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // colorStop
cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // fontColor
cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // androidColor
cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // androidFontColor
cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // createTime
cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7) // editTime
);
return entity;
}
@Override
public void readEntity(Cursor cursor, ColorBean entity, int offset) {
entity.setColorId(cursor.getInt(offset + 0));
entity.setColorStart(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1));
entity.setColorStop(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2));
entity.setFontColor(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3));
entity.setAndroidColor(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4));
entity.setAndroidFontColor(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5));
entity.setCreateTime(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6));
entity.setEditTime(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7));
}
@Override
protected final Void updateKeyAfterInsert(ColorBean entity, long rowId) {
// Unsupported or missing PK type
return null;
}
@Override
public Void getKey(ColorBean entity) {
return null;
}
@Override
public boolean hasKey(ColorBean entity) {
// TODO
return false;
}
@Override
protected final boolean isEntityUpdateable() {
return true;
}
}
package com.gingersoft.gsa.cloud.greendao;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteDatabase.CursorFactory;
import android.util.Log;
import org.greenrobot.greendao.AbstractDaoMaster;
import org.greenrobot.greendao.database.StandardDatabase;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.database.DatabaseOpenHelper;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
/**
* Master of DAO (schema version 20): knows all DAOs.
*/
public class DaoMaster extends AbstractDaoMaster {
public static final int SCHEMA_VERSION = 20;
/** Creates underlying database table using DAOs. */
public static void createAllTables(Database db, boolean ifNotExists) {
ColorBeanDao.createTable(db, ifNotExists);
ComboItemDao.createTable(db, ifNotExists);
DiscountDao.createTable(db, ifNotExists);
ExpandInfoDao.createTable(db, ifNotExists);
FoodDao.createTable(db, ifNotExists);
FoodComboDao.createTable(db, ifNotExists);
FoodModifierDao.createTable(db, ifNotExists);
FunctionDao.createTable(db, ifNotExists);
LanguageDao.createTable(db, ifNotExists);
ModifierDao.createTable(db, ifNotExists);
PrintCurrencyBeanDao.createTable(db, ifNotExists);
PrintModelBeanDao.createTable(db, ifNotExists);
PrinterDeviceBeanDao.createTable(db, ifNotExists);
}
/** Drops underlying database table using DAOs. */
public static void dropAllTables(Database db, boolean ifExists) {
ColorBeanDao.dropTable(db, ifExists);
ComboItemDao.dropTable(db, ifExists);
DiscountDao.dropTable(db, ifExists);
ExpandInfoDao.dropTable(db, ifExists);
FoodDao.dropTable(db, ifExists);
FoodComboDao.dropTable(db, ifExists);
FoodModifierDao.dropTable(db, ifExists);
FunctionDao.dropTable(db, ifExists);
LanguageDao.dropTable(db, ifExists);
ModifierDao.dropTable(db, ifExists);
PrintCurrencyBeanDao.dropTable(db, ifExists);
PrintModelBeanDao.dropTable(db, ifExists);
PrinterDeviceBeanDao.dropTable(db, ifExists);
}
/**
* WARNING: Drops all table on Upgrade! Use only during development.
* Convenience method using a {@link DevOpenHelper}.
*/
public static DaoSession newDevSession(Context context, String name) {
Database db = new DevOpenHelper(context, name).getWritableDb();
DaoMaster daoMaster = new DaoMaster(db);
return daoMaster.newSession();
}
public DaoMaster(SQLiteDatabase db) {
this(new StandardDatabase(db));
}
public DaoMaster(Database db) {
super(db, SCHEMA_VERSION);
registerDaoClass(ColorBeanDao.class);
registerDaoClass(ComboItemDao.class);
registerDaoClass(DiscountDao.class);
registerDaoClass(ExpandInfoDao.class);
registerDaoClass(FoodDao.class);
registerDaoClass(FoodComboDao.class);
registerDaoClass(FoodModifierDao.class);
registerDaoClass(FunctionDao.class);
registerDaoClass(LanguageDao.class);
registerDaoClass(ModifierDao.class);
registerDaoClass(PrintCurrencyBeanDao.class);
registerDaoClass(PrintModelBeanDao.class);
registerDaoClass(PrinterDeviceBeanDao.class);
}
public DaoSession newSession() {
return new DaoSession(db, IdentityScopeType.Session, daoConfigMap);
}
public DaoSession newSession(IdentityScopeType type) {
return new DaoSession(db, type, daoConfigMap);
}
/**
* Calls {@link #createAllTables(Database, boolean)} in {@link #onCreate(Database)} -
*/
public static abstract class OpenHelper extends DatabaseOpenHelper {
public OpenHelper(Context context, String name) {
super(context, name, SCHEMA_VERSION);
}
public OpenHelper(Context context, String name, CursorFactory factory) {
super(context, name, factory, SCHEMA_VERSION);
}
@Override
public void onCreate(Database db) {
Log.i("greenDAO", "Creating tables for schema version " + SCHEMA_VERSION);
createAllTables(db, false);
}
}
/** WARNING: Drops all table on Upgrade! Use only during development. */
public static class DevOpenHelper extends OpenHelper {
public DevOpenHelper(Context context, String name) {
super(context, name);
}
public DevOpenHelper(Context context, String name, CursorFactory factory) {
super(context, name, factory);
}
@Override
public void onUpgrade(Database db, int oldVersion, int newVersion) {
Log.i("greenDAO", "Upgrading schema from version " + oldVersion + " to " + newVersion + " by dropping all tables");
dropAllTables(db, true);
onCreate(db);
}
}
}
package com.gingersoft.gsa.cloud.greendao;
import java.util.Map;
import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;
import com.gingersoft.gsa.cloud.database.bean.ColorBean;
import com.gingersoft.gsa.cloud.database.bean.ComboItem;
import com.gingersoft.gsa.cloud.database.bean.Discount;
import com.gingersoft.gsa.cloud.database.bean.ExpandInfo;
import com.gingersoft.gsa.cloud.database.bean.Food;
import com.gingersoft.gsa.cloud.database.bean.FoodCombo;
import com.gingersoft.gsa.cloud.database.bean.FoodModifier;
import com.gingersoft.gsa.cloud.database.bean.Function;
import com.gingersoft.gsa.cloud.database.bean.Language;
import com.gingersoft.gsa.cloud.database.bean.Modifier;
import com.gingersoft.gsa.cloud.database.bean.PrintCurrencyBean;
import com.gingersoft.gsa.cloud.database.bean.PrintModelBean;
import com.gingersoft.gsa.cloud.database.bean.PrinterDeviceBean;
import com.gingersoft.gsa.cloud.greendao.ColorBeanDao;
import com.gingersoft.gsa.cloud.greendao.ComboItemDao;
import com.gingersoft.gsa.cloud.greendao.DiscountDao;
import com.gingersoft.gsa.cloud.greendao.ExpandInfoDao;
import com.gingersoft.gsa.cloud.greendao.FoodDao;
import com.gingersoft.gsa.cloud.greendao.FoodComboDao;
import com.gingersoft.gsa.cloud.greendao.FoodModifierDao;
import com.gingersoft.gsa.cloud.greendao.FunctionDao;
import com.gingersoft.gsa.cloud.greendao.LanguageDao;
import com.gingersoft.gsa.cloud.greendao.ModifierDao;
import com.gingersoft.gsa.cloud.greendao.PrintCurrencyBeanDao;
import com.gingersoft.gsa.cloud.greendao.PrintModelBeanDao;
import com.gingersoft.gsa.cloud.greendao.PrinterDeviceBeanDao;
// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
/**
* {@inheritDoc}
*
* @see org.greenrobot.greendao.AbstractDaoSession
*/
public class DaoSession extends AbstractDaoSession {
private final DaoConfig colorBeanDaoConfig;
private final DaoConfig comboItemDaoConfig;
private final DaoConfig discountDaoConfig;
private final DaoConfig expandInfoDaoConfig;
private final DaoConfig foodDaoConfig;
private final DaoConfig foodComboDaoConfig;
private final DaoConfig foodModifierDaoConfig;
private final DaoConfig functionDaoConfig;
private final DaoConfig languageDaoConfig;
private final DaoConfig modifierDaoConfig;
private final DaoConfig printCurrencyBeanDaoConfig;
private final DaoConfig printModelBeanDaoConfig;
private final DaoConfig printerDeviceBeanDaoConfig;
private final ColorBeanDao colorBeanDao;
private final ComboItemDao comboItemDao;
private final DiscountDao discountDao;
private final ExpandInfoDao expandInfoDao;
private final FoodDao foodDao;
private final FoodComboDao foodComboDao;
private final FoodModifierDao foodModifierDao;
private final FunctionDao functionDao;
private final LanguageDao languageDao;
private final ModifierDao modifierDao;
private final PrintCurrencyBeanDao printCurrencyBeanDao;
private final PrintModelBeanDao printModelBeanDao;
private final PrinterDeviceBeanDao printerDeviceBeanDao;
public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
daoConfigMap) {
super(db);
colorBeanDaoConfig = daoConfigMap.get(ColorBeanDao.class).clone();
colorBeanDaoConfig.initIdentityScope(type);
comboItemDaoConfig = daoConfigMap.get(ComboItemDao.class).clone();
comboItemDaoConfig.initIdentityScope(type);
discountDaoConfig = daoConfigMap.get(DiscountDao.class).clone();
discountDaoConfig.initIdentityScope(type);
expandInfoDaoConfig = daoConfigMap.get(ExpandInfoDao.class).clone();
expandInfoDaoConfig.initIdentityScope(type);
foodDaoConfig = daoConfigMap.get(FoodDao.class).clone();
foodDaoConfig.initIdentityScope(type);
foodComboDaoConfig = daoConfigMap.get(FoodComboDao.class).clone();
foodComboDaoConfig.initIdentityScope(type);
foodModifierDaoConfig = daoConfigMap.get(FoodModifierDao.class).clone();
foodModifierDaoConfig.initIdentityScope(type);
functionDaoConfig = daoConfigMap.get(FunctionDao.class).clone();
functionDaoConfig.initIdentityScope(type);
languageDaoConfig = daoConfigMap.get(LanguageDao.class).clone();
languageDaoConfig.initIdentityScope(type);
modifierDaoConfig = daoConfigMap.get(ModifierDao.class).clone();
modifierDaoConfig.initIdentityScope(type);
printCurrencyBeanDaoConfig = daoConfigMap.get(PrintCurrencyBeanDao.class).clone();
printCurrencyBeanDaoConfig.initIdentityScope(type);
printModelBeanDaoConfig = daoConfigMap.get(PrintModelBeanDao.class).clone();
printModelBeanDaoConfig.initIdentityScope(type);
printerDeviceBeanDaoConfig = daoConfigMap.get(PrinterDeviceBeanDao.class).clone();
printerDeviceBeanDaoConfig.initIdentityScope(type);
colorBeanDao = new ColorBeanDao(colorBeanDaoConfig, this);
comboItemDao = new ComboItemDao(comboItemDaoConfig, this);
discountDao = new DiscountDao(discountDaoConfig, this);
expandInfoDao = new ExpandInfoDao(expandInfoDaoConfig, this);
foodDao = new FoodDao(foodDaoConfig, this);
foodComboDao = new FoodComboDao(foodComboDaoConfig, this);
foodModifierDao = new FoodModifierDao(foodModifierDaoConfig, this);
functionDao = new FunctionDao(functionDaoConfig, this);
languageDao = new LanguageDao(languageDaoConfig, this);
modifierDao = new ModifierDao(modifierDaoConfig, this);
printCurrencyBeanDao = new PrintCurrencyBeanDao(printCurrencyBeanDaoConfig, this);
printModelBeanDao = new PrintModelBeanDao(printModelBeanDaoConfig, this);
printerDeviceBeanDao = new PrinterDeviceBeanDao(printerDeviceBeanDaoConfig, this);
registerDao(ColorBean.class, colorBeanDao);
registerDao(ComboItem.class, comboItemDao);
registerDao(Discount.class, discountDao);
registerDao(ExpandInfo.class, expandInfoDao);
registerDao(Food.class, foodDao);
registerDao(FoodCombo.class, foodComboDao);
registerDao(FoodModifier.class, foodModifierDao);
registerDao(Function.class, functionDao);
registerDao(Language.class, languageDao);
registerDao(Modifier.class, modifierDao);
registerDao(PrintCurrencyBean.class, printCurrencyBeanDao);
registerDao(PrintModelBean.class, printModelBeanDao);
registerDao(PrinterDeviceBean.class, printerDeviceBeanDao);
}
public void clear() {
colorBeanDaoConfig.clearIdentityScope();
comboItemDaoConfig.clearIdentityScope();
discountDaoConfig.clearIdentityScope();
expandInfoDaoConfig.clearIdentityScope();
foodDaoConfig.clearIdentityScope();
foodComboDaoConfig.clearIdentityScope();
foodModifierDaoConfig.clearIdentityScope();
functionDaoConfig.clearIdentityScope();
languageDaoConfig.clearIdentityScope();
modifierDaoConfig.clearIdentityScope();
printCurrencyBeanDaoConfig.clearIdentityScope();
printModelBeanDaoConfig.clearIdentityScope();
printerDeviceBeanDaoConfig.clearIdentityScope();
}
public ColorBeanDao getColorBeanDao() {
return colorBeanDao;
}
public ComboItemDao getComboItemDao() {
return comboItemDao;
}
public DiscountDao getDiscountDao() {
return discountDao;
}
public ExpandInfoDao getExpandInfoDao() {
return expandInfoDao;
}
public FoodDao getFoodDao() {
return foodDao;
}
public FoodComboDao getFoodComboDao() {
return foodComboDao;
}
public FoodModifierDao getFoodModifierDao() {
return foodModifierDao;
}
public FunctionDao getFunctionDao() {
return functionDao;
}
public LanguageDao getLanguageDao() {
return languageDao;
}
public ModifierDao getModifierDao() {
return modifierDao;
}
public PrintCurrencyBeanDao getPrintCurrencyBeanDao() {
return printCurrencyBeanDao;
}
public PrintModelBeanDao getPrintModelBeanDao() {
return printModelBeanDao;
}
public PrinterDeviceBeanDao getPrinterDeviceBeanDao() {
return printerDeviceBeanDao;
}
}
package com.gingersoft.gsa.cloud.greendao;
import android.database.Cursor;
import android.database.sqlite.SQLiteStatement;
import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.Property;
import org.greenrobot.greendao.internal.DaoConfig;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.database.DatabaseStatement;
import com.gingersoft.gsa.cloud.database.bean.Discount;
// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
/**
* DAO for table "DISCOUNT".
*/
public class DiscountDao extends AbstractDao<Discount, Long> {
public static final String TABLENAME = "DISCOUNT";
/**
* Properties of entity Discount.<br/>
* Can be used for QueryBuilder and for referencing column names.
*/
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 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 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 DiscountDao(DaoConfig config) {
super(config);
}
public DiscountDao(DaoConfig config, DaoSession daoSession) {
super(config, daoSession);
}
/** Creates the underlying database table. */
public static void createTable(Database db, boolean ifNotExists) {
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
"\"AMOUNT\" REAL NOT NULL ," + // 2: amount
"\"DISCOUNT_VALUE\" REAL NOT NULL ," + // 3: discount_value
"\"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
}
/** Drops the underlying database table. */
public static void dropTable(Database db, boolean ifExists) {
String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"DISCOUNT\"";
db.execSQL(sql);
}
@Override
protected final void bindValues(DatabaseStatement stmt, Discount entity) {
stmt.clearBindings();
Long id = entity.getId();
if (id != null) {
stmt.bindLong(1, id);
}
stmt.bindLong(2, entity.getRestaurant_id());
stmt.bindDouble(3, entity.getAmount());
stmt.bindDouble(4, entity.getDiscount_value());
stmt.bindLong(5, entity.getType());
String discountType = entity.getDiscountType();
if (discountType != null) {
stmt.bindString(6, discountType);
}
stmt.bindLong(7, entity.getStatus());
String remark = entity.getRemark();
if (remark != null) {
stmt.bindString(8, remark);
}
String begin_time = entity.getBegin_time();
if (begin_time != null) {
stmt.bindString(9, begin_time);
}
String end_time = entity.getEnd_time();
if (end_time != null) {
stmt.bindString(10, end_time);
}
}
@Override
protected final void bindValues(SQLiteStatement stmt, Discount entity) {
stmt.clearBindings();
Long id = entity.getId();
if (id != null) {
stmt.bindLong(1, id);
}
stmt.bindLong(2, entity.getRestaurant_id());
stmt.bindDouble(3, entity.getAmount());
stmt.bindDouble(4, entity.getDiscount_value());
stmt.bindLong(5, entity.getType());
String discountType = entity.getDiscountType();
if (discountType != null) {
stmt.bindString(6, discountType);
}
stmt.bindLong(7, entity.getStatus());
String remark = entity.getRemark();
if (remark != null) {
stmt.bindString(8, remark);
}
String begin_time = entity.getBegin_time();
if (begin_time != null) {
stmt.bindString(9, begin_time);
}
String end_time = entity.getEnd_time();
if (end_time != null) {
stmt.bindString(10, end_time);
}
}
@Override
public Long readKey(Cursor cursor, int offset) {
return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0);
}
@Override
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.getDouble(offset + 2), // amount
cursor.getDouble(offset + 3), // discount_value
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
);
return entity;
}
@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.setAmount(cursor.getDouble(offset + 2));
entity.setDiscount_value(cursor.getDouble(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));
}
@Override
protected final Long updateKeyAfterInsert(Discount entity, long rowId) {
entity.setId(rowId);
return rowId;
}
@Override
public Long getKey(Discount entity) {
if(entity != null) {
return entity.getId();
} else {
return null;
}
}
@Override
public boolean hasKey(Discount entity) {
return entity.getId() != null;
}
@Override
protected final boolean isEntityUpdateable() {
return true;
}
}
package com.gingersoft.gsa.cloud.greendao;
import android.database.Cursor;
import android.database.sqlite.SQLiteStatement;
import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.Property;
import org.greenrobot.greendao.internal.DaoConfig;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.database.DatabaseStatement;
import com.gingersoft.gsa.cloud.database.bean.ExpandInfo;
// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
/**
* DAO for table "EXPAND_INFO".
*/
public class ExpandInfoDao extends AbstractDao<ExpandInfo, Long> {
public static final String TABLENAME = "EXPAND_INFO";
/**
* Properties of entity ExpandInfo.<br/>
* Can be used for QueryBuilder and for referencing column names.
*/
public static class Properties {
public final static Property Id = new Property(0, Long.class, "id", true, "_id");
public final static Property RestaurantId = new Property(1, Integer.class, "restaurantId", false, "RESTAURANT_ID");
public final static Property SettingName = new Property(2, String.class, "settingName", false, "SETTING_NAME");
public final static Property ValueInt = new Property(3, Integer.class, "valueInt", false, "VALUE_INT");
public final static Property ValueChar = new Property(4, String.class, "valueChar", false, "VALUE_CHAR");
public final static Property ValueBoolean = new Property(5, Boolean.class, "valueBoolean", false, "VALUE_BOOLEAN");
public final static Property ValueDatetime = new Property(6, String.class, "valueDatetime", false, "VALUE_DATETIME");
public final static Property Remark = new Property(7, String.class, "remark", false, "REMARK");
public final static Property DataType = new Property(8, int.class, "dataType", false, "DATA_TYPE");
public final static Property ShowName = new Property(9, String.class, "showName", false, "SHOW_NAME");
}
public ExpandInfoDao(DaoConfig config) {
super(config);
}
public ExpandInfoDao(DaoConfig config, DaoSession daoSession) {
super(config, daoSession);
}
/** Creates the underlying database table. */
public static void createTable(Database db, boolean ifNotExists) {
String constraint = ifNotExists? "IF NOT EXISTS ": "";
db.execSQL("CREATE TABLE " + constraint + "\"EXPAND_INFO\" (" + //
"\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id
"\"RESTAURANT_ID\" INTEGER," + // 1: restaurantId
"\"SETTING_NAME\" TEXT," + // 2: settingName
"\"VALUE_INT\" INTEGER," + // 3: valueInt
"\"VALUE_CHAR\" TEXT," + // 4: valueChar
"\"VALUE_BOOLEAN\" INTEGER," + // 5: valueBoolean
"\"VALUE_DATETIME\" TEXT," + // 6: valueDatetime
"\"REMARK\" TEXT," + // 7: remark
"\"DATA_TYPE\" INTEGER NOT NULL ," + // 8: dataType
"\"SHOW_NAME\" TEXT);"); // 9: showName
}
/** Drops the underlying database table. */
public static void dropTable(Database db, boolean ifExists) {
String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"EXPAND_INFO\"";
db.execSQL(sql);
}
@Override
protected final void bindValues(DatabaseStatement stmt, ExpandInfo entity) {
stmt.clearBindings();
Long id = entity.getId();
if (id != null) {
stmt.bindLong(1, id);
}
Integer restaurantId = entity.getRestaurantId();
if (restaurantId != null) {
stmt.bindLong(2, restaurantId);
}
String settingName = entity.getSettingName();
if (settingName != null) {
stmt.bindString(3, settingName);
}
Integer valueInt = entity.getValueInt();
if (valueInt != null) {
stmt.bindLong(4, valueInt);
}
String valueChar = entity.getValueChar();
if (valueChar != null) {
stmt.bindString(5, valueChar);
}
Boolean valueBoolean = entity.getValueBoolean();
if (valueBoolean != null) {
stmt.bindLong(6, valueBoolean ? 1L: 0L);
}
String valueDatetime = entity.getValueDatetime();
if (valueDatetime != null) {
stmt.bindString(7, valueDatetime);
}
String remark = entity.getRemark();
if (remark != null) {
stmt.bindString(8, remark);
}
stmt.bindLong(9, entity.getDataType());
String showName = entity.getShowName();
if (showName != null) {
stmt.bindString(10, showName);
}
}
@Override
protected final void bindValues(SQLiteStatement stmt, ExpandInfo entity) {
stmt.clearBindings();
Long id = entity.getId();
if (id != null) {
stmt.bindLong(1, id);
}
Integer restaurantId = entity.getRestaurantId();
if (restaurantId != null) {
stmt.bindLong(2, restaurantId);
}
String settingName = entity.getSettingName();
if (settingName != null) {
stmt.bindString(3, settingName);
}
Integer valueInt = entity.getValueInt();
if (valueInt != null) {
stmt.bindLong(4, valueInt);
}
String valueChar = entity.getValueChar();
if (valueChar != null) {
stmt.bindString(5, valueChar);
}
Boolean valueBoolean = entity.getValueBoolean();
if (valueBoolean != null) {
stmt.bindLong(6, valueBoolean ? 1L: 0L);
}
String valueDatetime = entity.getValueDatetime();
if (valueDatetime != null) {
stmt.bindString(7, valueDatetime);
}
String remark = entity.getRemark();
if (remark != null) {
stmt.bindString(8, remark);
}
stmt.bindLong(9, entity.getDataType());
String showName = entity.getShowName();
if (showName != null) {
stmt.bindString(10, showName);
}
}
@Override
public Long readKey(Cursor cursor, int offset) {
return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0);
}
@Override
public ExpandInfo readEntity(Cursor cursor, int offset) {
ExpandInfo entity = new ExpandInfo( //
cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id
cursor.isNull(offset + 1) ? null : cursor.getInt(offset + 1), // restaurantId
cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // settingName
cursor.isNull(offset + 3) ? null : cursor.getInt(offset + 3), // valueInt
cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // valueChar
cursor.isNull(offset + 5) ? null : cursor.getShort(offset + 5) != 0, // valueBoolean
cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // valueDatetime
cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // remark
cursor.getInt(offset + 8), // dataType
cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9) // showName
);
return entity;
}
@Override
public void readEntity(Cursor cursor, ExpandInfo entity, int offset) {
entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0));
entity.setRestaurantId(cursor.isNull(offset + 1) ? null : cursor.getInt(offset + 1));
entity.setSettingName(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2));
entity.setValueInt(cursor.isNull(offset + 3) ? null : cursor.getInt(offset + 3));
entity.setValueChar(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4));
entity.setValueBoolean(cursor.isNull(offset + 5) ? null : cursor.getShort(offset + 5) != 0);
entity.setValueDatetime(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6));
entity.setRemark(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7));
entity.setDataType(cursor.getInt(offset + 8));
entity.setShowName(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9));
}
@Override
protected final Long updateKeyAfterInsert(ExpandInfo entity, long rowId) {
entity.setId(rowId);
return rowId;
}
@Override
public Long getKey(ExpandInfo entity) {
if(entity != null) {
return entity.getId();
} else {
return null;
}
}
@Override
public boolean hasKey(ExpandInfo entity) {
return entity.getId() != null;
}
@Override
protected final boolean isEntityUpdateable() {
return true;
}
}
package com.gingersoft.gsa.cloud.greendao;
import android.database.Cursor;
import android.database.sqlite.SQLiteStatement;
import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.Property;
import org.greenrobot.greendao.internal.DaoConfig;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.database.DatabaseStatement;
import com.gingersoft.gsa.cloud.database.bean.Function;
// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
/**
* DAO for table "FUNCTION".
*/
public class FunctionDao extends AbstractDao<Function, Long> {
public static final String TABLENAME = "FUNCTION";
/**
* Properties of entity Function.<br/>
* Can be used for QueryBuilder and for referencing column names.
*/
public static class Properties {
public final static Property Dbid = new Property(0, Long.class, "dbid", true, "_id");
public final static Property Id = new Property(1, Long.class, "id", false, "ID");
public final static Property ParentId = new Property(2, int.class, "parentId", false, "PARENT_ID");
public final static Property GroupId = new Property(3, int.class, "groupId", false, "GROUP_ID");
public final static Property EffectiveTime = new Property(4, long.class, "effectiveTime", false, "EFFECTIVE_TIME");
public final static Property ResName = new Property(5, String.class, "resName", false, "RES_NAME");
public final static Property ResUrl = new Property(6, String.class, "resUrl", false, "RES_URL");
public final static Property ImageURL = new Property(7, String.class, "imageURL", false, "IMAGE_URL");
public final static Property IcRes = new Property(8, int.class, "icRes", false, "IC_RES");
public final static Property Status = new Property(9, int.class, "status", false, "STATUS");
}
public FunctionDao(DaoConfig config) {
super(config);
}
public FunctionDao(DaoConfig config, DaoSession daoSession) {
super(config, daoSession);
}
/** Creates the underlying database table. */
public static void createTable(Database db, boolean ifNotExists) {
String constraint = ifNotExists? "IF NOT EXISTS ": "";
db.execSQL("CREATE TABLE " + constraint + "\"FUNCTION\" (" + //
"\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: dbid
"\"ID\" INTEGER NOT NULL ," + // 1: id
"\"PARENT_ID\" INTEGER NOT NULL ," + // 2: parentId
"\"GROUP_ID\" INTEGER NOT NULL ," + // 3: groupId
"\"EFFECTIVE_TIME\" INTEGER NOT NULL ," + // 4: effectiveTime
"\"RES_NAME\" TEXT," + // 5: resName
"\"RES_URL\" TEXT," + // 6: resUrl
"\"IMAGE_URL\" TEXT," + // 7: imageURL
"\"IC_RES\" INTEGER NOT NULL ," + // 8: icRes
"\"STATUS\" INTEGER NOT NULL );"); // 9: status
}
/** Drops the underlying database table. */
public static void dropTable(Database db, boolean ifExists) {
String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"FUNCTION\"";
db.execSQL(sql);
}
@Override
protected final void bindValues(DatabaseStatement stmt, Function entity) {
stmt.clearBindings();
Long dbid = entity.getDbid();
if (dbid != null) {
stmt.bindLong(1, dbid);
}
stmt.bindLong(2, entity.getId());
stmt.bindLong(3, entity.getParentId());
stmt.bindLong(4, entity.getGroupId());
stmt.bindLong(5, entity.getEffectiveTime());
String resName = entity.getResName();
if (resName != null) {
stmt.bindString(6, resName);
}
String resUrl = entity.getResUrl();
if (resUrl != null) {
stmt.bindString(7, resUrl);
}
String imageURL = entity.getImageURL();
if (imageURL != null) {
stmt.bindString(8, imageURL);
}
stmt.bindLong(9, entity.getIcRes());
stmt.bindLong(10, entity.getStatus());
}
@Override
protected final void bindValues(SQLiteStatement stmt, Function entity) {
stmt.clearBindings();
Long dbid = entity.getDbid();
if (dbid != null) {
stmt.bindLong(1, dbid);
}
stmt.bindLong(2, entity.getId());
stmt.bindLong(3, entity.getParentId());
stmt.bindLong(4, entity.getGroupId());
stmt.bindLong(5, entity.getEffectiveTime());
String resName = entity.getResName();
if (resName != null) {
stmt.bindString(6, resName);
}
String resUrl = entity.getResUrl();
if (resUrl != null) {
stmt.bindString(7, resUrl);
}
String imageURL = entity.getImageURL();
if (imageURL != null) {
stmt.bindString(8, imageURL);
}
stmt.bindLong(9, entity.getIcRes());
stmt.bindLong(10, entity.getStatus());
}
@Override
public Long readKey(Cursor cursor, int offset) {
return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0);
}
@Override
public Function readEntity(Cursor cursor, int offset) {
Function entity = new Function( //
cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // dbid
cursor.getLong(offset + 1), // id
cursor.getInt(offset + 2), // parentId
cursor.getInt(offset + 3), // groupId
cursor.getLong(offset + 4), // effectiveTime
cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // resName
cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // resUrl
cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // imageURL
cursor.getInt(offset + 8), // icRes
cursor.getInt(offset + 9) // status
);
return entity;
}
@Override
public void readEntity(Cursor cursor, Function entity, int offset) {
entity.setDbid(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0));
entity.setId(cursor.getLong(offset + 1));
entity.setParentId(cursor.getInt(offset + 2));
entity.setGroupId(cursor.getInt(offset + 3));
entity.setEffectiveTime(cursor.getLong(offset + 4));
entity.setResName(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5));
entity.setResUrl(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6));
entity.setImageURL(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7));
entity.setIcRes(cursor.getInt(offset + 8));
entity.setStatus(cursor.getInt(offset + 9));
}
@Override
protected final Long updateKeyAfterInsert(Function entity, long rowId) {
entity.setDbid(rowId);
return rowId;
}
@Override
public Long getKey(Function entity) {
if(entity != null) {
return entity.getDbid();
} else {
return null;
}
}
@Override
public boolean hasKey(Function entity) {
return entity.getDbid() != null;
}
@Override
protected final boolean isEntityUpdateable() {
return true;
}
}
package com.gingersoft.gsa.cloud.greendao;
import android.database.Cursor;
import android.database.sqlite.SQLiteStatement;
import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.Property;
import org.greenrobot.greendao.internal.DaoConfig;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.database.DatabaseStatement;
import com.gingersoft.gsa.cloud.database.bean.Language;
// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
/**
* DAO for table "LANGUAGE".
*/
public class LanguageDao extends AbstractDao<Language, Long> {
public static final String TABLENAME = "LANGUAGE";
/**
* Properties of entity Language.<br/>
* Can be used for QueryBuilder and for referencing column names.
*/
public static class Properties {
public final static Property Id = new Property(0, Long.class, "id", true, "_id");
public final static Property FunctionName = new Property(1, String.class, "functionName", false, "FUNCTION_NAME");
public final static Property LanguageName = new Property(2, String.class, "languageName", false, "LANGUAGE_NAME");
}
public LanguageDao(DaoConfig config) {
super(config);
}
public LanguageDao(DaoConfig config, DaoSession daoSession) {
super(config, daoSession);
}
/** Creates the underlying database table. */
public static void createTable(Database db, boolean ifNotExists) {
String constraint = ifNotExists? "IF NOT EXISTS ": "";
db.execSQL("CREATE TABLE " + constraint + "\"LANGUAGE\" (" + //
"\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id
"\"FUNCTION_NAME\" TEXT NOT NULL ," + // 1: functionName
"\"LANGUAGE_NAME\" TEXT);"); // 2: languageName
}
/** Drops the underlying database table. */
public static void dropTable(Database db, boolean ifExists) {
String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"LANGUAGE\"";
db.execSQL(sql);
}
@Override
protected final void bindValues(DatabaseStatement stmt, Language entity) {
stmt.clearBindings();
Long id = entity.getId();
if (id != null) {
stmt.bindLong(1, id);
}
stmt.bindString(2, entity.getFunctionName());
String languageName = entity.getLanguageName();
if (languageName != null) {
stmt.bindString(3, languageName);
}
}
@Override
protected final void bindValues(SQLiteStatement stmt, Language entity) {
stmt.clearBindings();
Long id = entity.getId();
if (id != null) {
stmt.bindLong(1, id);
}
stmt.bindString(2, entity.getFunctionName());
String languageName = entity.getLanguageName();
if (languageName != null) {
stmt.bindString(3, languageName);
}
}
@Override
public Long readKey(Cursor cursor, int offset) {
return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0);
}
@Override
public Language readEntity(Cursor cursor, int offset) {
Language entity = new Language( //
cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id
cursor.getString(offset + 1), // functionName
cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2) // languageName
);
return entity;
}
@Override
public void readEntity(Cursor cursor, Language entity, int offset) {
entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0));
entity.setFunctionName(cursor.getString(offset + 1));
entity.setLanguageName(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2));
}
@Override
protected final Long updateKeyAfterInsert(Language entity, long rowId) {
entity.setId(rowId);
return rowId;
}
@Override
public Long getKey(Language entity) {
if(entity != null) {
return entity.getId();
} else {
return null;
}
}
@Override
public boolean hasKey(Language entity) {
return entity.getId() != null;
}
@Override
protected final boolean isEntityUpdateable() {
return true;
}
}
package com.gingersoft.gsa.cloud.greendao;
import android.database.Cursor;
import android.database.sqlite.SQLiteStatement;
import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.Property;
import org.greenrobot.greendao.internal.DaoConfig;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.database.DatabaseStatement;
import com.gingersoft.gsa.cloud.database.bean.PrintModelBean;
// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
/**
* DAO for table "PRINT_MODEL_BEAN".
*/
public class PrintModelBeanDao extends AbstractDao<PrintModelBean, Long> {
public static final String TABLENAME = "PRINT_MODEL_BEAN";
/**
* Properties of entity PrintModelBean.<br/>
* Can be used for QueryBuilder and for referencing column names.
*/
public static class Properties {
public final static Property Dbid = new Property(0, Long.class, "dbid", true, "_id");
public final static Property Id = new Property(1, int.class, "id", false, "ID");
public final static Property PaperSpecification = new Property(2, String.class, "paperSpecification", false, "PAPER_SPECIFICATION");
public final static Property PrinterName = new Property(3, String.class, "printerName", false, "PRINTER_NAME");
public final static Property Model = new Property(4, String.class, "model", false, "MODEL");
}
public PrintModelBeanDao(DaoConfig config) {
super(config);
}
public PrintModelBeanDao(DaoConfig config, DaoSession daoSession) {
super(config, daoSession);
}
/** Creates the underlying database table. */
public static void createTable(Database db, boolean ifNotExists) {
String constraint = ifNotExists? "IF NOT EXISTS ": "";
db.execSQL("CREATE TABLE " + constraint + "\"PRINT_MODEL_BEAN\" (" + //
"\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: dbid
"\"ID\" INTEGER NOT NULL ," + // 1: id
"\"PAPER_SPECIFICATION\" TEXT," + // 2: paperSpecification
"\"PRINTER_NAME\" TEXT," + // 3: printerName
"\"MODEL\" TEXT);"); // 4: model
}
/** Drops the underlying database table. */
public static void dropTable(Database db, boolean ifExists) {
String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"PRINT_MODEL_BEAN\"";
db.execSQL(sql);
}
@Override
protected final void bindValues(DatabaseStatement stmt, PrintModelBean entity) {
stmt.clearBindings();
Long dbid = entity.getDbid();
if (dbid != null) {
stmt.bindLong(1, dbid);
}
stmt.bindLong(2, entity.getId());
String paperSpecification = entity.getPaperSpecification();
if (paperSpecification != null) {
stmt.bindString(3, paperSpecification);
}
String printerName = entity.getPrinterName();
if (printerName != null) {
stmt.bindString(4, printerName);
}
String model = entity.getModel();
if (model != null) {
stmt.bindString(5, model);
}
}
@Override
protected final void bindValues(SQLiteStatement stmt, PrintModelBean entity) {
stmt.clearBindings();
Long dbid = entity.getDbid();
if (dbid != null) {
stmt.bindLong(1, dbid);
}
stmt.bindLong(2, entity.getId());
String paperSpecification = entity.getPaperSpecification();
if (paperSpecification != null) {
stmt.bindString(3, paperSpecification);
}
String printerName = entity.getPrinterName();
if (printerName != null) {
stmt.bindString(4, printerName);
}
String model = entity.getModel();
if (model != null) {
stmt.bindString(5, model);
}
}
@Override
public Long readKey(Cursor cursor, int offset) {
return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0);
}
@Override
public PrintModelBean readEntity(Cursor cursor, int offset) {
PrintModelBean entity = new PrintModelBean( //
cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // dbid
cursor.getInt(offset + 1), // id
cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // paperSpecification
cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // printerName
cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4) // model
);
return entity;
}
@Override
public void readEntity(Cursor cursor, PrintModelBean entity, int offset) {
entity.setDbid(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0));
entity.setId(cursor.getInt(offset + 1));
entity.setPaperSpecification(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2));
entity.setPrinterName(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3));
entity.setModel(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4));
}
@Override
protected final Long updateKeyAfterInsert(PrintModelBean entity, long rowId) {
entity.setDbid(rowId);
return rowId;
}
@Override
public Long getKey(PrintModelBean entity) {
if(entity != null) {
return entity.getDbid();
} else {
return null;
}
}
@Override
public boolean hasKey(PrintModelBean entity) {
return entity.getDbid() != null;
}
@Override
protected final boolean isEntityUpdateable() {
return true;
}
}
package com.gingersoft.gsa.cloud.main.mvp.contract;
import com.gingersoft.gsa.cloud.base.common.bean.BaseResult;
import com.gingersoft.gsa.cloud.main.mvp.model.bean.CheckVersionRequest;
import com.jess.arms.mvp.IView;
import com.jess.arms.mvp.IModel;
......@@ -33,6 +34,8 @@ public interface NewMainContract {
//Model层定义接口,外部只需关心Model返回的数据,无需关心内部细节,即是否使用缓存
interface Model extends IModel {
Observable<BaseResult> syncRestaurantExtendedConfiguration(int restaurantId);
Observable<CheckVersionRequest> checkAppVersion(String version);
Observable<Object> loginOut(RequestBody requestBody);
......
......@@ -2,6 +2,7 @@ package com.gingersoft.gsa.cloud.main.mvp.model;
import android.app.Application;
import com.gingersoft.gsa.cloud.base.common.bean.BaseResult;
import com.gingersoft.gsa.cloud.main.mvp.model.bean.CheckVersionRequest;
import com.gingersoft.gsa.cloud.main.mvp.model.service.MainService;
import com.gingersoft.gsa.cloud.main.mvp.ui.activity.MainActivity;
......@@ -51,6 +52,12 @@ public class NewMainModel extends BaseModel implements NewMainContract.Model {
}
@Override
public Observable<BaseResult> syncRestaurantExtendedConfiguration(int restaurantId) {
return mRepositoryManager.obtainRetrofitService(MainService.class)
.syncRestaurantExtendedConfiguration(restaurantId);
}
@Override
public Observable<CheckVersionRequest> checkAppVersion(String version) {
return mRepositoryManager.obtainRetrofitService(MainService.class)
.checkAppVersion(version);
......
package com.gingersoft.gsa.cloud.main.mvp.model.service;
import com.gingersoft.gsa.cloud.base.Api;
import com.gingersoft.gsa.cloud.base.common.bean.BaseResult;
import com.gingersoft.gsa.cloud.main.mvp.model.bean.CheckVersionRequest;
import com.gingersoft.gsa.cloud.main.mvp.model.bean.RestaurantQrBean;
......@@ -7,6 +9,8 @@ import io.reactivex.Observable;
import me.jessyan.retrofiturlmanager.RetrofitUrlManager;
import okhttp3.RequestBody;
import retrofit2.http.Body;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.Headers;
import retrofit2.http.POST;
......@@ -17,14 +21,18 @@ import retrofit2.http.Query;
*/
public interface MainService {
// @Headers({"Domain-Name: system_url"})/**/
@POST("user/logout" + RetrofitUrlManager.IDENTIFICATION_PATH_SIZE + 2)
Observable<Object> loginOut(@Body RequestBody requestBody);
@Headers({"Domain-Name: update_version"})
@GET("system/checkAppVersionGsa" + RetrofitUrlManager.IDENTIFICATION_PATH_SIZE + 2)
Observable<CheckVersionRequest> checkAppVersion(@Query("version") String version);
@FormUrlEncoded
@POST(Api.sync_restaurant_base_table_configuration + RetrofitUrlManager.IDENTIFICATION_PATH_SIZE + 2)
Observable<BaseResult> syncRestaurantExtendedConfiguration(@Field("restaurantId") int restaurantId);
// @Headers({"Domain-Name: system_url"})/**/
@POST("user/logout" + RetrofitUrlManager.IDENTIFICATION_PATH_SIZE + 2)
Observable<Object> loginOut(@Body RequestBody requestBody);
@Headers({"Domain-Name: update_version"})
@POST("restaurant/clearHeartbeat" + RetrofitUrlManager.IDENTIFICATION_PATH_SIZE + 2)
Observable<Object> clearHeartbeat(@Body RequestBody requestBody);
......
......@@ -7,6 +7,7 @@ import android.text.TextUtils;
import com.billy.cc.core.component.CC;
import com.gingersoft.gsa.cloud.base.application.GsaCloudApplication;
import com.gingersoft.gsa.cloud.base.common.bean.BaseResult;
import com.gingersoft.gsa.cloud.main.mvp.contract.NewMainContract;
import com.gingersoft.gsa.cloud.main.mvp.model.bean.CheckVersionRequest;
import com.gingersoft.gsa.cloud.main.mvp.ui.activity.NewMainActivity;
......@@ -72,6 +73,24 @@ public class NewMainPresenter extends BasePresenter<NewMainContract.Model, NewMa
this.mApplication = null;
}
public void syncRestaurantExtendedConfiguration() {
mModel.syncRestaurantExtendedConfiguration(GsaCloudApplication.getRestaurantId())
.subscribeOn(Schedulers.io())
.subscribeOn(AndroidSchedulers.mainThread())
.observeOn(AndroidSchedulers.mainThread())
.compose(RxLifecycleUtils.bindToLifecycle(mRootView))
.subscribe(new ErrorHandleSubscriber<BaseResult>(mErrorHandler) {
@Override
public void onNext(@NonNull BaseResult result) {
if (result != null) {
} else {
}
}
});
}
public void checkAppVersion() {
// RequestBody requestBody = new FormBody.Builder()
// .add("version", )
......
......@@ -131,6 +131,7 @@ public class NewMainActivity extends BaseFragmentActivity<NewMainPresenter> impl
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mPresenter.checkAppVersion();
mPresenter.syncRestaurantExtendedConfiguration();
}
@Override
......
......@@ -321,12 +321,12 @@ public class MealStandActivity extends BaseFragmentActivity<MealStandPresenter>
}
private void initUIStyleConfiguration() {
foodGroupColumn = GsaCloudApplication.uiStyleConfiguration.getFoodGroupColumn();
foodGroupRow = GsaCloudApplication.uiStyleConfiguration.getFoodGroupRow();
foodColumn = GsaCloudApplication.uiStyleConfiguration.getFoodColumn();
comboColumn = GsaCloudApplication.uiStyleConfiguration.getComboColumn();
modColumn = GsaCloudApplication.uiStyleConfiguration.getModColumn();
discountColumn = GsaCloudApplication.uiStyleConfiguration.getModColumn();
foodGroupColumn = GsaCloudApplication.uiStyleConfiguration.getFoodGroupColumnValue();
foodGroupRow = GsaCloudApplication.uiStyleConfiguration.getFoodGroupRowValue();
foodColumn = GsaCloudApplication.uiStyleConfiguration.getFoodColumnValue();
comboColumn = GsaCloudApplication.uiStyleConfiguration.getComboColumnValue();
modColumn = GsaCloudApplication.uiStyleConfiguration.getModColumnValue();
discountColumn = GsaCloudApplication.uiStyleConfiguration.getModColumnValue();
}
private void initTableDetail() {
......@@ -412,7 +412,8 @@ public class MealStandActivity extends BaseFragmentActivity<MealStandPresenter>
}
});
int mParentColHeight = GsaCloudApplication.uiStyleConfiguration.getFoodGroupBtnHeight() * Rows;
int foodGroupBtnHeight = GsaCloudApplication.uiStyleConfiguration.getFoodGroupBtnHeightValue();
int mParentColHeight = foodGroupBtnHeight * Rows;
//设置ViewPager适配器
rv_food_group.setLayoutParams(new LinearLayout.LayoutParams(
......@@ -840,7 +841,8 @@ public class MealStandActivity extends BaseFragmentActivity<MealStandPresenter>
public void onChronometerTick(Chronometer chronometer) {
// 执行一下看看是否按下了home键的线程
// 如果开始计时到现在超过了autoQuitTime秒
if (SystemClock.elapsedRealtime() - chronometer.getBase() > GsaCloudApplication.functionConfiguration.getAutoQuitTime() * 1000) {
int autoQuitTime = GsaCloudApplication.functionConfiguration.getAutoQuitTimeVaule();
if (SystemClock.elapsedRealtime() - chronometer.getBase() > autoQuitTime * 1000) {
// 停止计时
chronometer.stop();
returnBeforeActivity(true);
......
......@@ -445,7 +445,8 @@ public class OrderContentActivity extends BaseFragmentActivity<OrderContentPrese
public void onChronometerTick(Chronometer chronometer) {
// 执行一下看看是否按下了home键的线程
// 如果开始计时到现在超过了autoQuitTime秒
if (SystemClock.elapsedRealtime() - chronometer.getBase() > GsaCloudApplication.functionConfiguration.getAutoQuitTime() * 1000) {
int autoQuitTime = GsaCloudApplication.functionConfiguration.getAutoQuitTimeVaule();
if (SystemClock.elapsedRealtime() - chronometer.getBase() > autoQuitTime * 1000) {
// 停止计时
chronometer.stop();
returnTableActivity(true);
......
......@@ -223,9 +223,9 @@ public class SoldoutCtrlActivity extends BaseFragmentActivity<SoldoutCtrlPresent
para1.height = screenHeidth * 33 / 100;
recycle_current_soldout_food.setLayoutParams(para1);
foodGroupColumn = GsaCloudApplication.uiStyleConfiguration.getFoodGroupColumn();
foodGroupRow = GsaCloudApplication.uiStyleConfiguration.getFoodGroupRow();
foodColumn = GsaCloudApplication.uiStyleConfiguration.getFoodColumn();
foodGroupColumn = GsaCloudApplication.uiStyleConfiguration.getFoodGroupColumnValue();
foodGroupRow = GsaCloudApplication.uiStyleConfiguration.getFoodGroupRowValue();
foodColumn = GsaCloudApplication.uiStyleConfiguration.getFoodColumnValue();
}
public void initFoodGroupView(List<Food> foodGroupList) {
......@@ -299,7 +299,8 @@ public class SoldoutCtrlActivity extends BaseFragmentActivity<SoldoutCtrlPresent
}
});
int mParentColHeight = GsaCloudApplication.uiStyleConfiguration.getFoodGroupBtnHeight() * Rows;
int foodGroupBtnHeight = GsaCloudApplication.uiStyleConfiguration.getFoodGroupBtnHeightValue();
int mParentColHeight = foodGroupBtnHeight * Rows;
//设置ViewPager适配器
recycle_food_group.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, mParentColHeight));
......
......@@ -37,7 +37,7 @@ public class CurrentSlodoutFoodAdapter extends DefaultAdapter<SoldoutCtrFood> {
public CurrentSlodoutFoodAdapter(Context context, List<SoldoutCtrFood> infos) {
super(infos);
this.mContext = context;
this.soldoutCtrlFoodFontSize = GsaCloudApplication.uiStyleConfiguration.getSoldoutCtrlFoodFontSize();
this.soldoutCtrlFoodFontSize = GsaCloudApplication.uiStyleConfiguration.getSoldoutCtrlFoodFontSizeValue();
}
public void setSelectPosition(int select_position) {
......
......@@ -57,11 +57,12 @@ public class FineItemOneAdapter extends DefaultAdapter<Modifier> {
public FineItemOneAdapter(Context context, List<Modifier> infos) {
super(infos);
this.mContext = context;
this.mOrderNumberShowSize = GsaCloudApplication.uiStyleConfiguration.getOrderNumberChildShowSize();
this.mOrderNumberFontSize = GsaCloudApplication.uiStyleConfiguration.getOrderNumberChildFontSize();
this.mModFontSize = GsaCloudApplication.uiStyleConfiguration.getModFontSize();
this.mColHeight = GsaCloudApplication.uiStyleConfiguration.getModBtnHeight();
this.mColwidth = (int) ((DeviceUtils.getScreenWidth(context) / GsaCloudApplication.uiStyleConfiguration.getModColumn()));
this.mOrderNumberShowSize = GsaCloudApplication.uiStyleConfiguration.getSoldoutModFlagHeightValue();
this.mOrderNumberFontSize = GsaCloudApplication.uiStyleConfiguration.getSoldoutModFlagFontSizeValue();
this.mModFontSize = GsaCloudApplication.uiStyleConfiguration.getModFontSizeValue();
this.mColHeight = GsaCloudApplication.uiStyleConfiguration.getModBtnHeightValue();
int modColumn = GsaCloudApplication.uiStyleConfiguration.getModColumnValue();
this.mColwidth = (int) ((DeviceUtils.getScreenWidth(context) / modColumn));
// Db_Color dc = new Db_Color(context);
// mColorList = dc.query("");
......
......@@ -58,11 +58,12 @@ public class FineItemTwoAdapter extends DefaultAdapter<Modifier> {
public FineItemTwoAdapter(Context context, List<Modifier> infos) {
super(infos);
this.mContext = context;
this.mOrderNumberShowSize = GsaCloudApplication.uiStyleConfiguration.getOrderNumberChildShowSize();
this.mOrderNumberFontSize = GsaCloudApplication.uiStyleConfiguration.getOrderNumberChildFontSize();
this.mModFontSize = GsaCloudApplication.uiStyleConfiguration.getModFontSize();
this.mColwidth = (int) ((DeviceUtils.getScreenWidth(context) / GsaCloudApplication.uiStyleConfiguration.getModColumn()));
this.mColHeight = GsaCloudApplication.uiStyleConfiguration.getModBtnHeight();
this.mOrderNumberShowSize = GsaCloudApplication.uiStyleConfiguration.getSoldoutModFlagHeightValue();
this.mOrderNumberFontSize = GsaCloudApplication.uiStyleConfiguration.getSoldoutModFlagFontSizeValue();
this.mModFontSize = GsaCloudApplication.uiStyleConfiguration.getModFontSizeValue();
int modColumn = GsaCloudApplication.uiStyleConfiguration.getModColumnValue();
this.mColwidth = (int) ((DeviceUtils.getScreenWidth(context) / modColumn));
this.mColHeight = GsaCloudApplication.uiStyleConfiguration.getModBtnHeightValue();
// Db_Color dc = new Db_Color(context);
// mColorList = dc.query("");
......
......@@ -41,8 +41,8 @@ public class ComboAdapter extends DefaultAdapter<ComboItem> {
private int ColHeight;
private int FontSize;
private int OrderNumberChildShowSize;
private int OrderNumberChildFontSize;
private int soldoutModFlagHeight;
private int soldoutFoodFlagFontSize;
public ComboAdapter(Context context, List<ComboItem> infos) {
......@@ -52,10 +52,10 @@ public class ComboAdapter extends DefaultAdapter<ComboItem> {
int ComboColCount = 4;
int screenWidth = (int) DeviceUtils.getScreenWidth(context);
ColWidth = ((screenWidth - ComboColCount) / ComboColCount);
ColHeight = GsaCloudApplication.uiStyleConfiguration.getModBtnHeight();
FontSize = GsaCloudApplication.uiStyleConfiguration.getModFontSize();
OrderNumberChildShowSize = GsaCloudApplication.uiStyleConfiguration.getOrderNumberChildShowSize();
OrderNumberChildFontSize = GsaCloudApplication.uiStyleConfiguration.getOrderNumberChildFontSize();
ColHeight = GsaCloudApplication.uiStyleConfiguration.getModBtnHeightValue();
FontSize = GsaCloudApplication.uiStyleConfiguration.getModFontSizeValue();
soldoutModFlagHeight = GsaCloudApplication.uiStyleConfiguration.getSoldoutModFlagHeightValue();
soldoutFoodFlagFontSize = GsaCloudApplication.uiStyleConfiguration.getSoldoutFoodFlagFontSizeValue();
}
@Override
......@@ -191,9 +191,9 @@ public class ComboAdapter extends DefaultAdapter<ComboItem> {
tv_soldout.setText(qty);
}
}
tv_soldout.setMaxHeight(OrderNumberChildShowSize);
tv_soldout.setMinHeight(OrderNumberChildShowSize);
tv_soldout.setTextSize(OrderNumberChildFontSize);
tv_soldout.setMaxHeight(soldoutModFlagHeight);
tv_soldout.setMinHeight(soldoutModFlagHeight);
tv_soldout.setTextSize(soldoutFoodFlagFontSize);
}
private void initComboName(ComboItem datasBean) {
......@@ -206,9 +206,9 @@ public class ComboAdapter extends DefaultAdapter<ComboItem> {
private void setSolodStatus(ComboItem datasBean) {
// tv_soldout.setMaxHeight(OrderNumberChildFontSize);
// tv_soldout.setMinHeight(OrderNumberChildFontSize);
tv_soldout.setTextSize(OrderNumberChildFontSize);
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);
......
......@@ -38,8 +38,8 @@ public class DiscountAdapter extends DefaultAdapter<Discount> {
super(infos);
this.mContext = context;
fontSize = GsaCloudApplication.uiStyleConfiguration.getDiscountFontSize();
colHeight = GsaCloudApplication.uiStyleConfiguration.getDiscountHeight();
fontSize = GsaCloudApplication.uiStyleConfiguration.getDiscountFontSizeValue();
colHeight = GsaCloudApplication.uiStyleConfiguration.getDiscountHeightValue();
}
......
......@@ -37,8 +37,8 @@ public class FoodAdapter extends DefaultAdapter<Food> {
private Context mContext;
private int mOrderNumberShowSize;
private int mOrderNumberFontSize;
private int mSoldoutFoodFlagHeight;
private int mSoldoutFoodFlagFontSize;
private int mFoodFontSize;
private int mColwidth;
......@@ -59,12 +59,13 @@ public class FoodAdapter extends DefaultAdapter<Food> {
super(infos);
this.mContext = context;
this.mFromType = fromType;
this.mOrderNumberShowSize = GsaCloudApplication.uiStyleConfiguration.getOrderNumberChildShowSize();
this.mOrderNumberFontSize = GsaCloudApplication.uiStyleConfiguration.getOrderNumberChildFontSize();
this.mFoodFontSize = GsaCloudApplication.uiStyleConfiguration.getFoodFontSize();
this.mColwidth = (int) ((DeviceUtils.getScreenWidth(context) / GsaCloudApplication.uiStyleConfiguration.getFoodColumn()));
this.mColHeight = GsaCloudApplication.uiStyleConfiguration.getFoodBtnHeight();
this.mLayoutQtyHeight = GsaCloudApplication.uiStyleConfiguration.getLayoutQtyHeight();
this.mSoldoutFoodFlagHeight = GsaCloudApplication.uiStyleConfiguration.getSoldoutFoodFlagHeightValue();
this.mSoldoutFoodFlagFontSize = GsaCloudApplication.uiStyleConfiguration.getSoldoutFoodFlagFontSizeValue();
this.mFoodFontSize = GsaCloudApplication.uiStyleConfiguration.getFoodFontSizeValue();
int foodColumn = GsaCloudApplication.uiStyleConfiguration.getFoodColumnValue();
this.mColwidth = (int) ((DeviceUtils.getScreenWidth(context) / foodColumn));
this.mColHeight = GsaCloudApplication.uiStyleConfiguration.getFoodBtnHeightValue();
this.mLayoutQtyHeight = GsaCloudApplication.uiStyleConfiguration.getLayoutQtyHeightValue();
}
@Override
......@@ -174,9 +175,9 @@ public class FoodAdapter extends DefaultAdapter<Food> {
private void setStatus(Food datasBean) {
// tv_soldout.setMaxHeight(mOrderNumberShowSize);
// tv_soldout.setMinHeight(mOrderNumberShowSize);
tv_soldout.setTextSize(mOrderNumberFontSize);
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);
......
......@@ -54,12 +54,13 @@ public class FoodGroupAdapter extends DefaultAdapter<Food> {
this.mContext = context;
this.mFromType = fromType;
this.mOrderNumberShowSize = GsaCloudApplication.uiStyleConfiguration.getOrderNumberShowSize();
this.mOrderNumberFontSize = GsaCloudApplication.uiStyleConfiguration.getOrderNumberFontSize();
this.FoodTypeFontSize = GsaCloudApplication.uiStyleConfiguration.getFoodGroupFontSize();
this.mParentColWidth = (int) (DeviceUtils.getScreenWidth(context) / GsaCloudApplication.uiStyleConfiguration.getFoodGroupColumn());
this.mParentColHeight = GsaCloudApplication.uiStyleConfiguration.getFoodGroupBtnHeight();
this.mLayoutQtyHeight = GsaCloudApplication.uiStyleConfiguration.getLayoutQtyHeight();
this.mOrderNumberShowSize = GsaCloudApplication.uiStyleConfiguration.getSoldoutFoodFlagHeightValue();
this.mOrderNumberFontSize = GsaCloudApplication.uiStyleConfiguration.getSoldoutFoodFlagFontSizeValue();
this.FoodTypeFontSize = GsaCloudApplication.uiStyleConfiguration.getFoodGroupFontSizeValue();
int foodGroupColumn = GsaCloudApplication.uiStyleConfiguration.getFoodGroupColumnValue();
this.mParentColWidth = (int) (DeviceUtils.getScreenWidth(context) / foodGroupColumn);
this.mParentColHeight = GsaCloudApplication.uiStyleConfiguration.getFoodGroupBtnHeightValue();
this.mLayoutQtyHeight = GsaCloudApplication.uiStyleConfiguration.getLayoutQtyHeightValue();
}
......
......@@ -42,9 +42,9 @@ public class ModifierAdapter extends DefaultAdapter<Modifier> {
super(infos);
this.mContext = context;
ColHeight = GsaCloudApplication.uiStyleConfiguration.getModBtnHeight();
FontSize = GsaCloudApplication.uiStyleConfiguration.getModFontSize();
OrderNumberChildFontSize = GsaCloudApplication.uiStyleConfiguration.getOrderNumberChildFontSize();
ColHeight = GsaCloudApplication.uiStyleConfiguration.getModBtnHeightValue();
FontSize = GsaCloudApplication.uiStyleConfiguration.getModFontSizeValue();
OrderNumberChildFontSize = GsaCloudApplication.uiStyleConfiguration.getSoldoutModFlagFontSizeValue();
}
@Override
......
......@@ -80,7 +80,7 @@ public class FineItemAllFragment extends BaseFragment<FineItemAllPresenter> impl
@Override
public void initData(@Nullable Bundle savedInstanceState) {
modCol = GsaCloudApplication.uiStyleConfiguration.getModColumn();
modCol = GsaCloudApplication.uiStyleConfiguration.getModColumnValue();
mPresenter.initAdapter();
mPresenter.initItemListener(mContext);
......
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