Commit 4cce725c by Wyh

Merge remote-tracking branch 'origin/dev' into dev

parents f947efa6 1288870b
...@@ -101,6 +101,7 @@ dependencies { ...@@ -101,6 +101,7 @@ dependencies {
exclude module: 'support-annotations' exclude module: 'support-annotations'
} }
api rootProject.ext.dependencies['rxerrorhandler2'] api rootProject.ext.dependencies['rxerrorhandler2']
api rootProject.ext.dependencies['rxbinding']
//network //network
api(rootProject.ext.dependencies["retrofit"]) { api(rootProject.ext.dependencies["retrofit"]) {
exclude module: 'okhttp' exclude module: 'okhttp'
......
...@@ -51,7 +51,7 @@ android { ...@@ -51,7 +51,7 @@ android {
/** /**
* 版本号 * 版本号
*/ */
schemaVersion 20 schemaVersion 21
/** /**
* greendao输出dao的数据库操作实体类文件夹(相对路径 包名+自定义路径名称,包将创建于包名的直接路径下) * greendao输出dao的数据库操作实体类文件夹(相对路径 包名+自定义路径名称,包将创建于包名的直接路径下)
*/ */
......
...@@ -104,6 +104,7 @@ public class GsaCloudApplication extends BaseApplication { ...@@ -104,6 +104,7 @@ public class GsaCloudApplication extends BaseApplication {
//指定为经典Footer,默认是 BallPulseFooter //指定为经典Footer,默认是 BallPulseFooter
return new ClassicsFooter(context).setDrawableSize(20); return new ClassicsFooter(context).setDrawableSize(20);
}); });
} }
@Override @Override
...@@ -133,14 +134,12 @@ public class GsaCloudApplication extends BaseApplication { ...@@ -133,14 +134,12 @@ public class GsaCloudApplication extends BaseApplication {
//初始化crash記錄 //初始化crash記錄
AppCrashHandler.getInstance().init(this); AppCrashHandler.getInstance().init(this);
uiStyleConfiguration = new UIStyleExtendedConfiguration();
functionConfiguration = new FunctionExtendedConfiguration();
isLogin = (boolean) SPUtils.get(this, PrintConstans.IS_LOGIN, false); isLogin = (boolean) SPUtils.get(this, PrintConstans.IS_LOGIN, false);
uiStyleConfiguration = new UIStyleExtendedConfiguration();
functionConfiguration = new FunctionExtendedConfiguration();
//上傳餐廳擴展信息 //上傳餐廳擴展信息
ExpandInfoSetting.initUpdateExtendedConfiguration(uiStyleConfiguration,functionConfiguration); ExpandInfoSetting.initUpdateExtendedConfiguration(uiStyleConfiguration,functionConfiguration);
//獲取餐廳擴展表數據
initExpandInfo();
// 设定一些通用的属性,这些属性在每次统计事件中都会附带 // 设定一些通用的属性,这些属性在每次统计事件中都会附带
// 注意:如果此处的属性名与内置属性的名称相同,则内置属性会被覆盖 // 注意:如果此处的属性名与内置属性的名称相同,则内置属性会被覆盖
...@@ -158,21 +157,6 @@ public class GsaCloudApplication extends BaseApplication { ...@@ -158,21 +157,6 @@ public class GsaCloudApplication extends BaseApplication {
// Tracker.INSTANCE.initialize(this); // Tracker.INSTANCE.initialize(this);
} }
private void initExpandInfo() {
//在IO线程执行数据库处理操作
Observable.just(0)
.subscribeOn(Schedulers.io())
.subscribe(new Consumer<Integer>() {
@Override
public void accept(@io.reactivex.annotations.NonNull Integer integer) throws Exception {
ExpandInfoDaoUtils expandInfoDaoUtils = new ExpandInfoDaoUtils(getAppContext());
List<ExpandInfo> expandInfos = expandInfoDaoUtils.queryAllExpandInfo();
if (expandInfos != null) {
RestaurantExpandInfoUtils.setCommonExpandInfo(expandInfos);
}
}
});
}
public Activity getCurrentActivity() { public Activity getCurrentActivity() {
return mCurrentActivity; return mCurrentActivity;
......
package com.gingersoft.gsa.cloud.bean.expandInfo; package com.gingersoft.gsa.cloud.bean.expandInfo;
import android.util.SparseArray;
import com.gingersoft.gsa.cloud.base.Api; import com.gingersoft.gsa.cloud.base.Api;
import com.gingersoft.gsa.cloud.base.utils.JsonUtils; import com.gingersoft.gsa.cloud.base.utils.JsonUtils;
import com.gingersoft.gsa.cloud.base.utils.ReflectionUtils; import com.gingersoft.gsa.cloud.base.utils.ReflectionUtils;
import com.gingersoft.gsa.cloud.base.utils.RestaurantExpandInfoUtils; import com.gingersoft.gsa.cloud.base.utils.RestaurantExpandInfoUtils;
import com.gingersoft.gsa.cloud.base.utils.gson.GsonUtils;
import com.gingersoft.gsa.cloud.base.utils.okhttpUtils.OkHttp3Utils; import com.gingersoft.gsa.cloud.base.utils.okhttpUtils.OkHttp3Utils;
import com.gingersoft.gsa.cloud.constans.HttpsConstans; import com.gingersoft.gsa.cloud.constans.HttpsConstans;
import com.gingersoft.gsa.cloud.database.bean.ExpandInfo; import com.gingersoft.gsa.cloud.database.bean.ExpandInfo;
...@@ -18,15 +19,18 @@ import java.util.HashMap; ...@@ -18,15 +19,18 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
import io.reactivex.Observable; import io.reactivex.Observable;
import io.reactivex.Observer;
import io.reactivex.disposables.Disposable;
import io.reactivex.functions.Consumer; import io.reactivex.functions.Consumer;
import io.reactivex.schedulers.Schedulers; import io.reactivex.schedulers.Schedulers;
import lombok.Builder; import lombok.Builder;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
import me.jessyan.retrofiturlmanager.RetrofitUrlManager;
import okhttp3.MediaType; import okhttp3.MediaType;
import okhttp3.RequestBody; import okhttp3.RequestBody;
import static com.gingersoft.gsa.cloud.base.application.GsaCloudApplication.getAppContext;
/** /**
* @author : bin * @author : bin
* @create date: 2020-10-20 * @create date: 2020-10-20
...@@ -46,7 +50,7 @@ public class ExpandInfoSetting { ...@@ -46,7 +50,7 @@ public class ExpandInfoSetting {
/** /**
* 數據類型 1:整形,2:字符型,3:布爾型,4:日期類型 * 數據類型 1:整形,2:字符型,3:布爾型,4:日期類型
*/ */
private byte dataType; private int dataType;
private int sort; private int sort;
private String showName; private String showName;
private String remark; private String remark;
...@@ -67,7 +71,7 @@ public class ExpandInfoSetting { ...@@ -67,7 +71,7 @@ public class ExpandInfoSetting {
public static void initUpdateExtendedConfiguration(Object... objects) { public static void initUpdateExtendedConfiguration(Object... objects) {
Observable.just(0) Observable.just(0)
.subscribeOn(Schedulers.newThread()) .subscribeOn(Schedulers.io())
.subscribe(new Consumer<Integer>() { .subscribe(new Consumer<Integer>() {
@Override @Override
public void accept(@io.reactivex.annotations.NonNull Integer integer) throws Exception { public void accept(@io.reactivex.annotations.NonNull Integer integer) throws Exception {
...@@ -78,10 +82,34 @@ public class ExpandInfoSetting { ...@@ -78,10 +82,34 @@ public class ExpandInfoSetting {
} }
String expandInfoListJson = JsonUtils.toJson(expandInfoSettingList); String expandInfoListJson = JsonUtils.toJson(expandInfoSettingList);
RequestBody requestBody = RequestBody.create(MediaType.parse("application/json"),expandInfoListJson); RequestBody requestBody = RequestBody.create(MediaType.parse("application/json"), expandInfoListJson);
OkHttp3Utils.post(HttpsConstans.ROOT_SERVER_ADDRESS_FORMAL + Api.add_restaurant_base_table_configuration, requestBody)
.subscribe(new Observer<String>() {
@Override
public void onSubscribe(Disposable d) {
OkHttp3Utils.post(HttpsConstans.ROOT_SERVER_ADDRESS_FORMAL + Api.add_restaurant_base_table_configuration,requestBody) }
.subscribe();
@Override
public void onNext(String s) {
}
@Override
public void onError(Throwable e) {
}
@Override
public void onComplete() {
//從本地獲取餐廳擴展表數據
ExpandInfoDaoUtils expandInfoDaoUtils = new ExpandInfoDaoUtils(getAppContext());
List<ExpandInfo> expandInfos = expandInfoDaoUtils.queryAllExpandInfo();
if (expandInfos != null) {
RestaurantExpandInfoUtils.setCommonExpandInfo(expandInfos);
}
}
});
} }
}); });
} }
...@@ -104,7 +132,7 @@ public class ExpandInfoSetting { ...@@ -104,7 +132,7 @@ public class ExpandInfoSetting {
Class<?> returnClass = method.getReturnType(); Class<?> returnClass = method.getReturnType();
if (method.getName().startsWith("get") && returnClass.equals(ExpandInfoSetting.class)) { if (method.getName().startsWith("get") && returnClass.equals(ExpandInfoSetting.class)) {
try { try {
Object [] objs ={}; Object[] objs = {};
//反射執行get方法 獲取每個配置類信息 //反射執行get方法 獲取每個配置類信息
ExpandInfoSetting expandInfo = (ExpandInfoSetting) ReflectionUtils.invokeMethod(method, obj, objs); ExpandInfoSetting expandInfo = (ExpandInfoSetting) ReflectionUtils.invokeMethod(method, obj, objs);
//獲取完整的settingName //獲取完整的settingName
......
...@@ -79,28 +79,32 @@ public class UIStyleExtendedConfiguration { ...@@ -79,28 +79,32 @@ public class UIStyleExtendedConfiguration {
/** /**
* 食品組、食品、細項、折扣字體大小 * 食品組、食品、細項、折扣字體大小
*/ */
private ExpandInfoSetting billListFontSize = ExpandInfoSetting.builder()
.valueInt(18)
.remark("餐牌選中食品字體大小")
.build();
private ExpandInfoSetting foodGroupFontSize = ExpandInfoSetting.builder() private ExpandInfoSetting foodGroupFontSize = ExpandInfoSetting.builder()
.valueInt(40) .valueInt(12)
.remark("食品組字體大小") .remark("食品組字體大小")
.build(); .build();
private ExpandInfoSetting foodFontSize = ExpandInfoSetting.builder() private ExpandInfoSetting foodFontSize = ExpandInfoSetting.builder()
.valueInt(40) .valueInt(12)
.remark("食品字體大小") .remark("食品字體大小")
.build(); .build();
private ExpandInfoSetting comboFontSize = ExpandInfoSetting.builder() private ExpandInfoSetting comboFontSize = ExpandInfoSetting.builder()
.valueInt(40) .valueInt(10)
.remark("套餐字體大小") .remark("套餐字體大小")
.build(); .build();
private ExpandInfoSetting modFontSize = ExpandInfoSetting.builder() private ExpandInfoSetting modFontSize = ExpandInfoSetting.builder()
.valueInt(40) .valueInt(10)
.remark("細項字體大小") .remark("細項字體大小")
.build(); .build();
private ExpandInfoSetting discountFontSize = ExpandInfoSetting.builder() private ExpandInfoSetting discountFontSize = ExpandInfoSetting.builder()
.valueInt(40) .valueInt(12)
.remark("折扣字體大小") .remark("折扣字體大小")
.build(); .build();
private ExpandInfoSetting soldoutFoodFlagFontSize = ExpandInfoSetting.builder() private ExpandInfoSetting soldoutFoodFlagFontSize = ExpandInfoSetting.builder()
.valueInt(10) .valueInt(8)
.remark("食品沽清標誌字體大小") .remark("食品沽清標誌字體大小")
.build(); .build();
private ExpandInfoSetting soldoutModFlagFontSize = ExpandInfoSetting.builder() private ExpandInfoSetting soldoutModFlagFontSize = ExpandInfoSetting.builder()
...@@ -108,7 +112,7 @@ public class UIStyleExtendedConfiguration { ...@@ -108,7 +112,7 @@ public class UIStyleExtendedConfiguration {
.remark("細項沽清標誌字體大小") .remark("細項沽清標誌字體大小")
.build(); .build();
private ExpandInfoSetting soldoutCtrlFoodFontSize = ExpandInfoSetting.builder() private ExpandInfoSetting soldoutCtrlFoodFontSize = ExpandInfoSetting.builder()
.valueInt(40) .valueInt(14)
.remark("估清控制item字體大小") .remark("估清控制item字體大小")
.build(); .build();
...@@ -169,6 +173,10 @@ public class UIStyleExtendedConfiguration { ...@@ -169,6 +173,10 @@ public class UIStyleExtendedConfiguration {
return soldoutModFlagHeight.getValue(); return soldoutModFlagHeight.getValue();
} }
public <T> T getBillListFontSizeVaule() {
return billListFontSize.getValue();
}
public <T> T getFoodGroupFontSizeValue() { public <T> T getFoodGroupFontSizeValue() {
return foodGroupFontSize.getValue(); return foodGroupFontSize.getValue();
} }
......
...@@ -14,10 +14,10 @@ import org.greenrobot.greendao.identityscope.IdentityScopeType; ...@@ -14,10 +14,10 @@ import org.greenrobot.greendao.identityscope.IdentityScopeType;
// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
/** /**
* Master of DAO (schema version 20): knows all DAOs. * Master of DAO (schema version 21): knows all DAOs.
*/ */
public class DaoMaster extends AbstractDaoMaster { public class DaoMaster extends AbstractDaoMaster {
public static final int SCHEMA_VERSION = 20; public static final int SCHEMA_VERSION = 21;
/** Creates underlying database table using DAOs. */ /** Creates underlying database table using DAOs. */
public static void createAllTables(Database db, boolean ifNotExists) { public static void createAllTables(Database db, boolean ifNotExists) {
......
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;
}
}
...@@ -7,8 +7,8 @@ ext { ...@@ -7,8 +7,8 @@ ext {
targetSdkVersion : 29, targetSdkVersion : 29,
//正式版: 1.0.3 3 //正式版: 1.0.3 3
//內部測試版:1.2.0 20 //內部測試版:1.2.0 20
versionCode : 9, versionCode : 10,
versionName : "1.0.9" versionName : "1.1.0"
] ]
version = [ version = [
...@@ -78,6 +78,9 @@ ext { ...@@ -78,6 +78,9 @@ ext {
"rxpermissions2" : "com.tbruyelle.rxpermissions2:rxpermissions:0.9.5@aar", "rxpermissions2" : "com.tbruyelle.rxpermissions2:rxpermissions:0.9.5@aar",
"rxerrorhandler2" : "me.jessyan:rxerrorhandler:2.1.1", "rxerrorhandler2" : "me.jessyan:rxerrorhandler:2.1.1",
//rxbinding
"rxbinding" : "com.jakewharton.rxbinding4:rxbinding:4.0.0",
//tools //tools
"dagger2" : "com.google.dagger:dagger:${version["dagger2SdkVersion"]}", "dagger2" : "com.google.dagger:dagger:${version["dagger2SdkVersion"]}",
"dagger2-android" : "com.google.dagger:dagger-android:${version["dagger2SdkVersion"]}", "dagger2-android" : "com.google.dagger:dagger-android:${version["dagger2SdkVersion"]}",
......
...@@ -452,7 +452,7 @@ public class OrderBean { ...@@ -452,7 +452,7 @@ public class OrderBean {
public static class RestaurantDiscountVO implements Serializable{ public static class RestaurantDiscountVO implements Serializable{
private long id; private long id;
private int type; private int type;
private float discountValue; private int discountValue;
private String remark; private String remark;
private double discountAmount; private double discountAmount;
...@@ -472,11 +472,11 @@ public class OrderBean { ...@@ -472,11 +472,11 @@ public class OrderBean {
this.type = type; this.type = type;
} }
public float getDiscountValue() { public int getDiscountValue() {
return discountValue; return discountValue;
} }
public void setDiscountValue(float discountValue) { public void setDiscountValue(int discountValue) {
this.discountValue = discountValue; this.discountValue = discountValue;
} }
......
...@@ -1071,7 +1071,7 @@ public class OrderDetail implements Serializable { ...@@ -1071,7 +1071,7 @@ public class OrderDetail implements Serializable {
private static Discount getDiscountItem(OrderBean.OrderDetailsBean.RestaurantDiscountVO discountBean) { private static Discount getDiscountItem(OrderBean.OrderDetailsBean.RestaurantDiscountVO discountBean) {
Discount discount = new Discount(); Discount discount = new Discount();
discount.setId(discountBean.getId()); discount.setId(discountBean.getId());
discount.setDiscount_value(discountBean.getDiscountValue()); discount.setDiscountValue(discountBean.getDiscountValue());
discount.setAmount(discountBean.getDiscountAmount()); discount.setAmount(discountBean.getDiscountAmount());
discount.setType(discountBean.getType()); discount.setType(discountBean.getType());
discount.setRemark(discountBean.getRemark()); discount.setRemark(discountBean.getRemark());
......
...@@ -114,7 +114,7 @@ public class OrderDiscount { ...@@ -114,7 +114,7 @@ public class OrderDiscount {
request.setType(MEMBER_DISCOUNT); request.setType(MEMBER_DISCOUNT);
if(discount.getDiscount() != null) { if(discount.getDiscount() != null) {
request.setMemberId(discount.getDiscount().getId()); request.setMemberId(discount.getDiscount().getId());
request.setMemberDiscountRate((int) discount.getDiscount().getDiscount_value()); request.setMemberDiscountRate((int) discount.getDiscount().getDiscountValue());
} }
request.setDiscountAmount(discount.getMoney()); request.setDiscountAmount(discount.getMoney());
request.setScAble(0); request.setScAble(0);
...@@ -127,7 +127,7 @@ public class OrderDiscount { ...@@ -127,7 +127,7 @@ public class OrderDiscount {
if(discount.getDiscount() != null) { if(discount.getDiscount() != null) {
request.setMemberId(discount.getDiscount().getMemberId()); request.setMemberId(discount.getDiscount().getMemberId());
request.setDiscountId(discount.getDiscount().getId()); request.setDiscountId(discount.getDiscount().getId());
request.setMemberDiscountRate((int) discount.getDiscount().getDiscount_value()); request.setMemberDiscountRate((int) discount.getDiscount().getDiscountValue());
} }
request.setDiscountAmount(discount.getMoney()); request.setDiscountAmount(discount.getMoney());
request.setScAble(0); request.setScAble(0);
......
...@@ -22,6 +22,7 @@ import com.jess.arms.di.scope.ActivityScope; ...@@ -22,6 +22,7 @@ import com.jess.arms.di.scope.ActivityScope;
import com.jess.arms.integration.IRepositoryManager; import com.jess.arms.integration.IRepositoryManager;
import com.jess.arms.mvp.BaseModel; import com.jess.arms.mvp.BaseModel;
import java.util.Date;
import java.util.List; import java.util.List;
import javax.inject.Inject; import javax.inject.Inject;
...@@ -66,7 +67,8 @@ public class OrderContentModel extends BaseModel implements OrderContentContract ...@@ -66,7 +67,8 @@ public class OrderContentModel extends BaseModel implements OrderContentContract
if (OpenTableManage.getDefault().getTableBean() == null) { if (OpenTableManage.getDefault().getTableBean() == null) {
OpenTableManage.getDefault().setTableBean(new TableBean.DataBean()); OpenTableManage.getDefault().setTableBean(new TableBean.DataBean());
} }
OpenTableManage.getDefault().getTableBean().setCreateTime(TimeUtils.getTime(createTime, TimeUtils.DEFAULT_DATE_FORMAT)); String dateTime = new Date(createTime).toString();
OpenTableManage.getDefault().getTableBean().setCreateTime(dateTime);
} }
@Override @Override
...@@ -191,9 +193,9 @@ public class OrderContentModel extends BaseModel implements OrderContentContract ...@@ -191,9 +193,9 @@ public class OrderContentModel extends BaseModel implements OrderContentContract
} }
@Override @Override
public Observable<BaseResult> queryCoupon(int tableId,Long memberId, long couponMemberId, String couponNo, int restaurantId) { public Observable<BaseResult> queryCoupon(int tableId, Long memberId, long couponMemberId, String couponNo, int restaurantId) {
return mRepositoryManager.obtainRetrofitService(MemberService.class) return mRepositoryManager.obtainRetrofitService(MemberService.class)
.queryCoupon(tableId,memberId, couponMemberId, couponNo, restaurantId); .queryCoupon(tableId, memberId, couponMemberId, couponNo, restaurantId);
} }
@Override @Override
......
...@@ -36,7 +36,7 @@ public abstract class ShoppingCart { ...@@ -36,7 +36,7 @@ public abstract class ShoppingCart {
Discount discount = new Discount(); Discount discount = new Discount();
discount.setType(1); discount.setType(1);
discount.setRemark("9折"); discount.setRemark("9折");
discount.setDiscount_value(10); discount.setDiscountValue(10);
MemberInfo memberDiscount = new MemberInfo(); MemberInfo memberDiscount = new MemberInfo();
memberDiscount.setMemberName("斯八達"); memberDiscount.setMemberName("斯八達");
......
...@@ -50,7 +50,7 @@ public class NomalDiscount extends MultyDiscount{ ...@@ -50,7 +50,7 @@ public class NomalDiscount extends MultyDiscount{
discountMoney = discount.getAmount(); discountMoney = discount.getAmount();
} else { } else {
//百分比折扣 //百分比折扣
discountMoney = MoneyUtil.divide(MoneyUtil.multiply(sourceMoney, discount.getDiscount_value()), 100).doubleValue(); discountMoney = MoneyUtil.divide(MoneyUtil.multiply(sourceMoney, discount.getDiscountValue()), 100).doubleValue();
} }
if (sourceMoney < discountMoney) { if (sourceMoney < discountMoney) {
//折扣金額不能超出總額 //折扣金額不能超出總額
......
...@@ -42,6 +42,7 @@ import com.jess.arms.utils.RxLifecycleUtils; ...@@ -42,6 +42,7 @@ import com.jess.arms.utils.RxLifecycleUtils;
import com.tbruyelle.rxpermissions2.RxPermissions; import com.tbruyelle.rxpermissions2.RxPermissions;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -117,7 +118,8 @@ public abstract class BaseOrderPresenter<M extends BaseOrderContract.Model, V ex ...@@ -117,7 +118,8 @@ public abstract class BaseOrderPresenter<M extends BaseOrderContract.Model, V ex
if (OpenTableManage.getDefault().getTableBean() == null) { if (OpenTableManage.getDefault().getTableBean() == null) {
OpenTableManage.getDefault().setTableBean(new TableBean.DataBean()); OpenTableManage.getDefault().setTableBean(new TableBean.DataBean());
} }
OpenTableManage.getDefault().getTableBean().setCreateTime(TimeUtils.getTime(createTime, TimeUtils.DEFAULT_DATE_FORMAT)); String dateTime = new Date(createTime).toString();
OpenTableManage.getDefault().getTableBean().setCreateTime(dateTime);
} }
...@@ -420,7 +422,7 @@ public abstract class BaseOrderPresenter<M extends BaseOrderContract.Model, V ex ...@@ -420,7 +422,7 @@ public abstract class BaseOrderPresenter<M extends BaseOrderContract.Model, V ex
if (orderDiscount.getDiscountValue() != 0) { if (orderDiscount.getDiscountValue() != 0) {
//百分比折扣 //百分比折扣
discount.setType(1); discount.setType(1);
discount.setDiscount_value(orderDiscount.getDiscountValue()); discount.setDiscountValue(orderDiscount.getDiscountValue());
addOrderDiscount(true, discount, BillOrderMoney.BILL_ITEM_ORDER_SENT_STATUS); addOrderDiscount(true, discount, BillOrderMoney.BILL_ITEM_ORDER_SENT_STATUS);
continue; continue;
} }
...@@ -577,7 +579,7 @@ public abstract class BaseOrderPresenter<M extends BaseOrderContract.Model, V ex ...@@ -577,7 +579,7 @@ public abstract class BaseOrderPresenter<M extends BaseOrderContract.Model, V ex
discount.setMemberId(memberId); discount.setMemberId(memberId);
discount.setType(1); discount.setType(1);
discount.setRemark(memberName + discountRate + "%"); discount.setRemark(memberName + discountRate + "%");
discount.setDiscount_value(discountRate); discount.setDiscountValue(discountRate);
orderMoney.setDiscount(discount); orderMoney.setDiscount(discount);
mOrderMoneyList.add(orderMoney); mOrderMoneyList.add(orderMoney);
...@@ -627,7 +629,7 @@ public abstract class BaseOrderPresenter<M extends BaseOrderContract.Model, V ex ...@@ -627,7 +629,7 @@ public abstract class BaseOrderPresenter<M extends BaseOrderContract.Model, V ex
discount.setId(coupon.getId()); discount.setId(coupon.getId());
discount.setMemberId(memberId); discount.setMemberId(memberId);
discount.setRemark(coupon.getName() + coupon.getDiscount() + "%"); discount.setRemark(coupon.getName() + coupon.getDiscount() + "%");
discount.setDiscount_value(coupon.getDiscount()); discount.setDiscountValue(coupon.getDiscount());
discount.setAmount(coupon.getAmount()); discount.setAmount(coupon.getAmount());
if (coupon.getDiscount() != 0) { if (coupon.getDiscount() != 0) {
discount.setType(1); discount.setType(1);
...@@ -647,7 +649,7 @@ public abstract class BaseOrderPresenter<M extends BaseOrderContract.Model, V ex ...@@ -647,7 +649,7 @@ public abstract class BaseOrderPresenter<M extends BaseOrderContract.Model, V ex
BillOrderMoney orderMoney = getBillOrderItemByType(BillOrderMoney.COUPON_DISCOUNT_TYPE); BillOrderMoney orderMoney = getBillOrderItemByType(BillOrderMoney.COUPON_DISCOUNT_TYPE);
if (orderMoney != null) { if (orderMoney != null) {
double totalMoney = getDiscountableFoodTotal(BillOrderMoney.COUPON_DISCOUNT_TYPE, false); double totalMoney = getDiscountableFoodTotal(BillOrderMoney.COUPON_DISCOUNT_TYPE, false);
double discountPrice = CouponDiscountBean.calculationCoupon(orderMoney.getDiscount().getDiscount_value(), orderMoney.getDiscount().getAmount(), totalMoney); double discountPrice = CouponDiscountBean.calculationCoupon(orderMoney.getDiscount().getDiscountValue(), orderMoney.getDiscount().getAmount(), totalMoney);
orderMoney.setMoney(discountPrice); orderMoney.setMoney(discountPrice);
} }
} }
...@@ -1454,6 +1456,10 @@ public abstract class BaseOrderPresenter<M extends BaseOrderContract.Model, V ex ...@@ -1454,6 +1456,10 @@ public abstract class BaseOrderPresenter<M extends BaseOrderContract.Model, V ex
protected List<Discount> filterDiscountByType(List<Discount> discountList, String discountType) { protected List<Discount> filterDiscountByType(List<Discount> discountList, String discountType) {
for (int i = discountList.size() - 1; i >= 0; i--) { for (int i = discountList.size() - 1; i >= 0; i--) {
Discount discount = discountList.get(i); Discount discount = discountList.get(i);
if (discount.getDiscountType().equals("2")) {
//2=全部類型
continue;
}
if (TextUtils.isEmpty(discount.getDiscountType()) || !discount.getDiscountType().contains(discountType)) { if (TextUtils.isEmpty(discount.getDiscountType()) || !discount.getDiscountType().contains(discountType)) {
discountList.remove(i); discountList.remove(i);
} }
...@@ -1579,7 +1585,7 @@ public abstract class BaseOrderPresenter<M extends BaseOrderContract.Model, V ex ...@@ -1579,7 +1585,7 @@ public abstract class BaseOrderPresenter<M extends BaseOrderContract.Model, V ex
} }
protected boolean hasNesOrderFoods() { public boolean hasNesOrderFoods() {
if (getNewOrderFoodLists().size() > 0) { if (getNewOrderFoodLists().size() > 0) {
return true; return true;
} }
......
...@@ -975,10 +975,10 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod ...@@ -975,10 +975,10 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
//更新會員信息 //更新會員信息
mRootView.updateMemberInfo(memberInfo); mRootView.updateMemberInfo(memberInfo);
} else { } else {
mRootView.showMessage("請輸入正確的會員號碼!"); mRootView.showMessage("未找到相關會員電話號碼,請重新輸入");
} }
} else { } else {
mRootView.showMessage("獲取會員信息失敗!"); mRootView.showMessage("獲取會員信息失敗");
} }
} else { } else {
mRootView.showMessage(info.getErrMsg()); mRootView.showMessage(info.getErrMsg());
......
...@@ -336,7 +336,7 @@ public class TablePresenter extends BasePresenter<TableContract.Model, TableCont ...@@ -336,7 +336,7 @@ public class TablePresenter extends BasePresenter<TableContract.Model, TableCont
if (orderBean != null && respose.getData().getOrderDetails() != null) { if (orderBean != null && respose.getData().getOrderDetails() != null) {
if (respose.getData().getCreateTime() != null && openTableBean != null) { if (respose.getData().getCreateTime() != null && openTableBean != null) {
//將開台時間設置為訂單創建時間 //將開台時間設置為訂單創建時間
openTableBean.setCreateTime(TimeUtils.getFormatTime(respose.getData().getCreateTime(), TimeUtils.DEFAULT_DATE_FORMAT)); openTableBean.setCreateTime(respose.getData().getCreateTime());
} }
OpenTableManage.getDefault().setPeopleNumber(orderBean.getPerson()); OpenTableManage.getDefault().setPeopleNumber(orderBean.getPerson());
...@@ -418,7 +418,7 @@ public class TablePresenter extends BasePresenter<TableContract.Model, TableCont ...@@ -418,7 +418,7 @@ public class TablePresenter extends BasePresenter<TableContract.Model, TableCont
if (orderBean != null && respose.getData().getOrderDetails() != null) { if (orderBean != null && respose.getData().getOrderDetails() != null) {
if (respose.getData().getCreateTime() != null && openTableBean != null) { if (respose.getData().getCreateTime() != null && openTableBean != null) {
//將開台時間設置為訂單創建時間 //將開台時間設置為訂單創建時間
openTableBean.setCreateTime(TimeUtils.getFormatTime(respose.getData().getCreateTime(), TimeUtils.DEFAULT_DATE_FORMAT)); openTableBean.setCreateTime(respose.getData().getCreateTime());
} }
OpenTableManage.getDefault().setPeopleNumber(orderBean.getPerson()); OpenTableManage.getDefault().setPeopleNumber(orderBean.getPerson());
......
...@@ -34,6 +34,7 @@ import com.gingersoft.gsa.cloud.base.order.bean.OrderDetail; ...@@ -34,6 +34,7 @@ import com.gingersoft.gsa.cloud.base.order.bean.OrderDetail;
import com.gingersoft.gsa.cloud.base.order.bean.mealManger.MyOrderManage; import com.gingersoft.gsa.cloud.base.order.bean.mealManger.MyOrderManage;
import com.gingersoft.gsa.cloud.base.order.bean.mealManger.OpenTableManage; import com.gingersoft.gsa.cloud.base.order.bean.mealManger.OpenTableManage;
import com.gingersoft.gsa.cloud.base.table.bean.TableBean; import com.gingersoft.gsa.cloud.base.table.bean.TableBean;
import com.gingersoft.gsa.cloud.base.utils.LanguageUtils;
import com.gingersoft.gsa.cloud.base.utils.VibratorUtils; import com.gingersoft.gsa.cloud.base.utils.VibratorUtils;
import com.gingersoft.gsa.cloud.base.utils.other.SPUtils; import com.gingersoft.gsa.cloud.base.utils.other.SPUtils;
import com.gingersoft.gsa.cloud.constans.FoodSummaryConstans; import com.gingersoft.gsa.cloud.constans.FoodSummaryConstans;
...@@ -44,6 +45,7 @@ import com.gingersoft.gsa.cloud.table.di.component.DaggerMealStandComponent; ...@@ -44,6 +45,7 @@ import com.gingersoft.gsa.cloud.table.di.component.DaggerMealStandComponent;
import com.gingersoft.gsa.cloud.table.mvp.contract.MealStandContract; import com.gingersoft.gsa.cloud.table.mvp.contract.MealStandContract;
import com.gingersoft.gsa.cloud.table.mvp.model.bean.SoldoutCtrFood; import com.gingersoft.gsa.cloud.table.mvp.model.bean.SoldoutCtrFood;
import com.gingersoft.gsa.cloud.table.mvp.model.bean.event.InitTableEvent; import com.gingersoft.gsa.cloud.table.mvp.model.bean.event.InitTableEvent;
import com.gingersoft.gsa.cloud.table.mvp.presenter.BaseOrderPresenter;
import com.gingersoft.gsa.cloud.table.mvp.presenter.MealStandPresenter; import com.gingersoft.gsa.cloud.table.mvp.presenter.MealStandPresenter;
import com.gingersoft.gsa.cloud.table.mvp.ui.adapter.BaseFragmentAdapter; import com.gingersoft.gsa.cloud.table.mvp.ui.adapter.BaseFragmentAdapter;
import com.gingersoft.gsa.cloud.table.mvp.ui.adapter.meal.FoodGroupAdapter; import com.gingersoft.gsa.cloud.table.mvp.ui.adapter.meal.FoodGroupAdapter;
...@@ -62,6 +64,7 @@ import com.gingersoft.gsa.cloud.ui.recylcler.decorator.GridDividerItemDecoration ...@@ -62,6 +64,7 @@ import com.gingersoft.gsa.cloud.ui.recylcler.decorator.GridDividerItemDecoration
import com.gingersoft.gsa.cloud.ui.view.PagerSlidingTabStrip; import com.gingersoft.gsa.cloud.ui.view.PagerSlidingTabStrip;
import com.gingersoft.gsa.cloud.ui.view.RecyclerViewNoBugLinearLayoutManager; import com.gingersoft.gsa.cloud.ui.view.RecyclerViewNoBugLinearLayoutManager;
import com.gingersoft.gsa.cloud.ui.view.SearchKeyBoardView; import com.gingersoft.gsa.cloud.ui.view.SearchKeyBoardView;
import com.gingersoft.gsa.cloud.ui.widget.dialog.CommonTipDialog;
import com.gingersoft.gsa.cloud.ui.widget.dialog.LoadingDialog; import com.gingersoft.gsa.cloud.ui.widget.dialog.LoadingDialog;
import com.gingersoft.gsa.cloud.zxing.MipcaCaptureActivity; import com.gingersoft.gsa.cloud.zxing.MipcaCaptureActivity;
import com.jess.arms.base.BaseFragmentActivity; import com.jess.arms.base.BaseFragmentActivity;
...@@ -741,7 +744,7 @@ public class MealStandActivity extends BaseFragmentActivity<MealStandPresenter> ...@@ -741,7 +744,7 @@ public class MealStandActivity extends BaseFragmentActivity<MealStandPresenter>
Intent intent = new Intent(this, OrderContentActivity.class); Intent intent = new Intent(this, OrderContentActivity.class);
startActivityForResult(intent, ORDER_CONTENT_CODE); startActivityForResult(intent, ORDER_CONTENT_CODE);
} else if (id == R.id.tv_no_save_return) { } else if (id == R.id.tv_no_save_return) {
returnBeforeActivity(true); returnTableActivity(true);
} else if (id == R.id.btn_taste) { } else if (id == R.id.btn_taste) {
currentFinePage = 0; currentFinePage = 0;
showRemarkLayout(); showRemarkLayout();
...@@ -817,10 +820,24 @@ public class MealStandActivity extends BaseFragmentActivity<MealStandPresenter> ...@@ -817,10 +820,24 @@ public class MealStandActivity extends BaseFragmentActivity<MealStandPresenter>
@Override @Override
public void onBackPressedSupport() { public void onBackPressedSupport() {
super.onBackPressedSupport(); // super.onBackPressedSupport();
returnBeforeActivity(true); returnTableActivity(true);
} }
public void returnTableActivity(boolean initTable) {
if (!MyOrderManage.getInstance().isModifyOrder() && mPresenter.hasNesOrderFoods()) {
if (mPresenter.hasNesOrderFoods()) {
//没有过重复下单提示且有未送单食品,提示用户
String tip = LanguageUtils.get_language_system(this, "food.not.delivered.tip", "有食品未送單, 確認離開?");
Class[] parameterTypes = {boolean.class};
Object[] parameters = {initTable};
CommonTipDialog.showSurpisedDialog(this, tip, MealStandActivity.class, this,
"returnBeforeActivity", parameterTypes, parameters);
}
} else {
returnBeforeActivity(initTable);
}
}
public void returnBeforeActivity(boolean initTable) { public void returnBeforeActivity(boolean initTable) {
SPUtils.put(this, MealConstant.EXIT_IS_PLU_MODE, isPluMode); SPUtils.put(this, MealConstant.EXIT_IS_PLU_MODE, isPluMode);
...@@ -885,7 +902,7 @@ public class MealStandActivity extends BaseFragmentActivity<MealStandPresenter> ...@@ -885,7 +902,7 @@ public class MealStandActivity extends BaseFragmentActivity<MealStandPresenter>
@Override @Override
public void OnBackClick() { public void OnBackClick() {
recordOperat(true); recordOperat(true);
returnBeforeActivity(true); returnTableActivity(true);
} }
}); });
int backPageBtnVisibility; int backPageBtnVisibility;
...@@ -912,7 +929,7 @@ public class MealStandActivity extends BaseFragmentActivity<MealStandPresenter> ...@@ -912,7 +929,7 @@ public class MealStandActivity extends BaseFragmentActivity<MealStandPresenter>
@Override @Override
public void onBackPage() { public void onBackPage() {
returnBeforeActivity(true); returnTableActivity(true);
} }
}); });
mChooseNumberDialog.setCancelable(isNeedCancel); mChooseNumberDialog.setCancelable(isNeedCancel);
...@@ -1328,11 +1345,11 @@ public class MealStandActivity extends BaseFragmentActivity<MealStandPresenter> ...@@ -1328,11 +1345,11 @@ public class MealStandActivity extends BaseFragmentActivity<MealStandPresenter>
@Override @Override
public void setModifierTop(int margins) { public void setModifierTop(int margins) {
// RelativeLayout.LayoutParams layoutParam = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); RelativeLayout.LayoutParams layoutParam = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
// layoutParam.setMargins(0, margins, 0, 0); layoutParam.setMargins(0, margins, 0, 0);
// layoutParam.addRule(RelativeLayout.ABOVE, R.id.ll_stand_oper); layoutParam.addRule(RelativeLayout.ABOVE, R.id.ll_stand_oper);
// layoutParam.addRule(RelativeLayout.BELOW, R.id.rv_combo); layoutParam.addRule(RelativeLayout.BELOW, R.id.rv_combo);
// rv_modifier.setLayoutParams(layoutParam); rv_modifier.setLayoutParams(layoutParam);
} }
@Override @Override
......
...@@ -160,7 +160,7 @@ public class TableAdapter extends DefaultAdapter<TableBean.DataBean> { ...@@ -160,7 +160,7 @@ public class TableAdapter extends DefaultAdapter<TableBean.DataBean> {
tv_people.setVisibility(View.VISIBLE); tv_people.setVisibility(View.VISIBLE);
tv_people.setText(person + "人"); tv_people.setText(person + "人");
String createDate = item.getCreateTime(); String createDate = item.getCreateTime();
if (!TextUtils.isEmpty(createDate) && createDate.startsWith("Jul")) { if (!TextUtils.isEmpty(createDate)) {
LogUtil.d(TAG, "tableName: " + item.getTableName() + " " + "createDate: " + createDate); LogUtil.d(TAG, "tableName: " + item.getTableName() + " " + "createDate: " + createDate);
Date date = new Date(createDate); Date date = new Date(createDate);
String createTime = TimeUtils.getStringByFormat(date, TimeUtils.DEFAULT_DATE_FORMAT); String createTime = TimeUtils.getStringByFormat(date, TimeUtils.DEFAULT_DATE_FORMAT);
......
...@@ -158,28 +158,6 @@ public class ComboAdapter extends DefaultAdapter<ComboItem> { ...@@ -158,28 +158,6 @@ public class ComboAdapter extends DefaultAdapter<ComboItem> {
} }
private void initModifierSoldout(Modifier datasBean) { private void initModifierSoldout(Modifier datasBean) {
// if (datasBean.isSoldout()) {
// iv_qty_sold.setVisibility(View.VISIBLE);
// } else {
// iv_qty_sold.setVisibility(View.INVISIBLE);
// }
// int maxNumber = datasBean.getMaxNumber();
// int number = datasBean.getNumber();
// if (number >= maxNumber) {
// tv_soldout.setVisibility(View.VISIBLE);
// tv_soldout.setText(maxNumber);
// } else {
// tv_soldout.setVisibility(View.INVISIBLE);
// }
// String qty = datasBean.getMaxNumber();
// if (qty.equals("")) {
// tv_soldout.setVisibility(View.INVISIBLE);
// } else {
// tv_soldout.setVisibility(View.VISIBLE);
// tv_soldout.setText(datasBean.getMaxNumber());
// }
String qty = datasBean.getCurrentMaxNumber(); String qty = datasBean.getCurrentMaxNumber();
if (TextUtils.isEmpty(qty)) { if (TextUtils.isEmpty(qty)) {
tv_soldout.setVisibility(View.INVISIBLE); tv_soldout.setVisibility(View.INVISIBLE);
...@@ -191,9 +169,6 @@ public class ComboAdapter extends DefaultAdapter<ComboItem> { ...@@ -191,9 +169,6 @@ public class ComboAdapter extends DefaultAdapter<ComboItem> {
tv_soldout.setText(qty); tv_soldout.setText(qty);
} }
} }
tv_soldout.setMaxHeight(soldoutModFlagHeight);
tv_soldout.setMinHeight(soldoutModFlagHeight);
tv_soldout.setTextSize(soldoutFoodFlagFontSize);
} }
private void initComboName(ComboItem datasBean) { private void initComboName(ComboItem datasBean) {
...@@ -206,14 +181,10 @@ public class ComboAdapter extends DefaultAdapter<ComboItem> { ...@@ -206,14 +181,10 @@ public class ComboAdapter extends DefaultAdapter<ComboItem> {
private void setSolodStatus(ComboItem datasBean) { private void setSolodStatus(ComboItem datasBean) {
tv_soldout.setMaxHeight(soldoutModFlagHeight);
tv_soldout.setMinHeight(soldoutModFlagHeight); tv_soldout.setMinHeight(soldoutModFlagHeight);
tv_soldout.setTextSize(soldoutFoodFlagFontSize); 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.setBackgroundDrawable(mContext.getResources().getDrawable(R.drawable.meal_shape_remaining_number_bg));
// tv_soldout.setMinWidth(15); tv_soldout.setGravity(Gravity.CENTER);
// tv_soldout.setTextSize(8);
// tv_soldout.setGravity(Gravity.CENTER);
RelativeLayout.LayoutParams lp2 = new RelativeLayout.LayoutParams(new ViewGroup.MarginLayoutParams(60, 40)); RelativeLayout.LayoutParams lp2 = new RelativeLayout.LayoutParams(new ViewGroup.MarginLayoutParams(60, 40));
lp2.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM); lp2.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);
......
...@@ -175,19 +175,10 @@ public class FoodAdapter extends DefaultAdapter<Food> { ...@@ -175,19 +175,10 @@ public class FoodAdapter extends DefaultAdapter<Food> {
private void setStatus(Food datasBean) { private void setStatus(Food datasBean) {
tv_soldout.setMaxHeight(mSoldoutFoodFlagHeight);
tv_soldout.setMinHeight(mSoldoutFoodFlagHeight); tv_soldout.setMinHeight(mSoldoutFoodFlagHeight);
tv_soldout.setTextSize(mSoldoutFoodFlagFontSize); 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.setBackgroundDrawable(mContext.getResources().getDrawable(R.drawable.meal_shape_remaining_number_bg));
// tv_soldout.setMinWidth(20); tv_soldout.setGravity(Gravity.CENTER);
// tv_soldout.setTextSize(10);
// tv_soldout.setGravity(Gravity.CENTER);
// RelativeLayout.LayoutParams lp2 = new RelativeLayout.LayoutParams(new ViewGroup.MarginLayoutParams(60, 40));
// lp2.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);
// lp2.addRule(RelativeLayout.ALIGN_PARENT_LEFT);
// tv_soldout.setLayoutParams(lp2);
tv_soldout.setVisibility(View.INVISIBLE); tv_soldout.setVisibility(View.INVISIBLE);
iv_qtySold.setVisibility(View.INVISIBLE); iv_qtySold.setVisibility(View.INVISIBLE);
...@@ -239,8 +230,9 @@ public class FoodAdapter extends DefaultAdapter<Food> { ...@@ -239,8 +230,9 @@ public class FoodAdapter extends DefaultAdapter<Food> {
} }
//设置当前选中item颜色 //设置当前选中item颜色
if (datasBean != null) if (datasBean != null) {
datasBean.setSelected(true); datasBean.setSelected(true);
}
notifyDataSetChanged(); notifyDataSetChanged();
//保存上次操作的position //保存上次操作的position
......
...@@ -226,8 +226,6 @@ public class FoodGroupAdapter extends DefaultAdapter<Food> { ...@@ -226,8 +226,6 @@ public class FoodGroupAdapter extends DefaultAdapter<Food> {
String qty = datasBean.getMaxNumber(); String qty = datasBean.getMaxNumber();
if (!qty.equals("")) { if (!qty.equals("")) {
// tv_soldout.setVisibility(View.VISIBLE);
// tv_soldout.setText(datasBean.getMaxNumber());
blv_soldout.setVisibility(View.VISIBLE); blv_soldout.setVisibility(View.VISIBLE);
blv_soldout.setLableText(datasBean.getMaxNumber()); blv_soldout.setLableText(datasBean.getMaxNumber());
} }
......
...@@ -35,6 +35,7 @@ public class ModifierAdapter extends DefaultAdapter<Modifier> { ...@@ -35,6 +35,7 @@ public class ModifierAdapter extends DefaultAdapter<Modifier> {
private int ColHeight; private int ColHeight;
private int FontSize; private int FontSize;
private int soldoutModFlagHeight;
private int OrderNumberChildFontSize; private int OrderNumberChildFontSize;
...@@ -44,6 +45,7 @@ public class ModifierAdapter extends DefaultAdapter<Modifier> { ...@@ -44,6 +45,7 @@ public class ModifierAdapter extends DefaultAdapter<Modifier> {
ColHeight = GsaCloudApplication.uiStyleConfiguration.getModBtnHeightValue(); ColHeight = GsaCloudApplication.uiStyleConfiguration.getModBtnHeightValue();
FontSize = GsaCloudApplication.uiStyleConfiguration.getModFontSizeValue(); FontSize = GsaCloudApplication.uiStyleConfiguration.getModFontSizeValue();
soldoutModFlagHeight = GsaCloudApplication.uiStyleConfiguration.getSoldoutModFlagHeightValue();
OrderNumberChildFontSize = GsaCloudApplication.uiStyleConfiguration.getSoldoutModFlagFontSizeValue(); OrderNumberChildFontSize = GsaCloudApplication.uiStyleConfiguration.getSoldoutModFlagFontSizeValue();
} }
...@@ -142,17 +144,10 @@ public class ModifierAdapter extends DefaultAdapter<Modifier> { ...@@ -142,17 +144,10 @@ public class ModifierAdapter extends DefaultAdapter<Modifier> {
private void initModifierSoldout(Modifier datasBean) { private void initModifierSoldout(Modifier datasBean) {
// String qty = datasBean.getCurrentMaxNumber(); tv_soldout.setMinHeight(soldoutModFlagHeight);
// if (qty.equals("")) {
// tv_soldout.setVisibility(View.INVISIBLE);
// } else {
// tv_soldout.setVisibility(View.VISIBLE);
// tv_soldout.setText(datasBean.getCurrentMaxNumber());
// }
tv_soldout.setBackgroundDrawable(mContext.getResources().getDrawable(R.drawable.meal_shape_remaining_number_bg));
// tv_soldout.setMaxHeight(OrderNumberChildShowSize);
// tv_soldout.setMinHeight(OrderNumberChildShowSize);
tv_soldout.setTextSize(OrderNumberChildFontSize); tv_soldout.setTextSize(OrderNumberChildFontSize);
tv_soldout.setBackgroundDrawable(mContext.getResources().getDrawable(R.drawable.meal_shape_remaining_number_bg));
tv_soldout.setGravity(Gravity.CENTER);
tv_soldout.setVisibility(View.INVISIBLE); tv_soldout.setVisibility(View.INVISIBLE);
iv_qty_sold.setVisibility(View.INVISIBLE); iv_qty_sold.setVisibility(View.INVISIBLE);
......
...@@ -74,6 +74,7 @@ public class SelectMealAdapter extends DefaultAdapter<OrderDetail> { ...@@ -74,6 +74,7 @@ public class SelectMealAdapter extends DefaultAdapter<OrderDetail> {
public SelectMealAdapter(Context context, List<OrderDetail> data, BasePresenter presenter) { public SelectMealAdapter(Context context, List<OrderDetail> data, BasePresenter presenter) {
super(data); super(data);
this.mContext = context; this.mContext = context;
this.BillListFontSize = GsaCloudApplication.uiStyleConfiguration.getBillListFontSizeVaule();
if (presenter instanceof MealStandPresenter) { if (presenter instanceof MealStandPresenter) {
// this.mMealStandPresenter = (MealStandPresenter) presenter; // this.mMealStandPresenter = (MealStandPresenter) presenter;
this.mMealStandActivity = (MealStandActivity) context; this.mMealStandActivity = (MealStandActivity) context;
......
...@@ -499,7 +499,7 @@ ...@@ -499,7 +499,7 @@
android:layout_height="38dp" android:layout_height="38dp"
android:layout_below="@+id/ll_meals" android:layout_below="@+id/ll_meals"
android:background="@color/theme_white_color" android:background="@color/theme_white_color"
android:visibility="visible"> android:visibility="invisible">
<ImageView <ImageView
android:id="@+id/iv_fine_back" android:id="@+id/iv_fine_back"
...@@ -543,7 +543,7 @@ ...@@ -543,7 +543,7 @@
android:layout_below="@+id/ll_meals" android:layout_below="@+id/ll_meals"
android:layout_above="@+id/ll_stand_oper"> android:layout_above="@+id/ll_stand_oper">
<LinearLayout <RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical"> android:orientation="vertical">
...@@ -565,8 +565,9 @@ ...@@ -565,8 +565,9 @@
android:divider="@null" android:divider="@null"
android:fadeScrollbars="false" android:fadeScrollbars="false"
android:orientation="vertical" android:orientation="vertical"
android:layout_below="@+id/rv_combo"
android:visibility="visible" /> android:visibility="visible" />
</LinearLayout> </RelativeLayout>
</ScrollView> </ScrollView>
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment