Commit b0548d5f by 宁斌

1、okhttp canceh配置 2、餐台模式食品套餐可配置颜色 3、删除xLog日志库依赖 4、添加Retrofit配置

parent 522480e0
......@@ -53,8 +53,6 @@ dependencies {
annotationProcessor rootProject.ext.dependencies["dagger2-compiler"]
implementation rootProject.ext.dependencies["constraintlayout"]
implementation 'org.jetbrains:annotations:15.0'
//日誌管理
implementation 'com.elvishew:xlog:1.6.1'
//lombok
implementation 'org.projectlombok:lombok:1.18.10'
annotationProcessor 'org.projectlombok:lombok:1.18.10'
......
package com.gingersoft.gsa.delivery_pick_mode.data.network
import com.gingersoft.gsa.cloud.common.config.OkHttpConfig
import com.gingersoft.gsa.cloud.common.config.globalconfig.applyOptions.intercept.HeadersInterceptor
import com.gingersoft.gsa.cloud.common.config.globalconfig.applyOptions.intercept.LoggingInterceptor
import com.gingersoft.gsa.cloud.common.constans.HttpsConstans
import com.gingersoft.gsa.cloud.common.constans.HttpsConstans.ROOT_SERVER
import com.gingersoft.gsa.cloud.common.constans.HttpsConstans.URK_RICEPON_GSA
import com.jess.arms.http.log.RequestInterceptor
import okhttp3.Cache
import okhttp3.OkHttpClient
import retrofit2.Retrofit
import retrofit2.converter.gson.GsonConverterFactory
import retrofit2.converter.scalars.ScalarsConverterFactory
import java.io.File
import java.util.concurrent.TimeUnit
object ServiceCreator {
......@@ -19,6 +22,7 @@ object ServiceCreator {
.callTimeout(30, TimeUnit.SECONDS)
.readTimeout(30, TimeUnit.SECONDS)
.writeTimeout(30, TimeUnit.SECONDS)
.cache(Cache(File(OkHttpConfig.CACHE_DIRECTORY), OkHttpConfig.CACHE_MAXSIZE))
.addInterceptor(RequestInterceptor())
.addInterceptor(HeadersInterceptor())
.addInterceptor(LoggingInterceptor())
......
......@@ -2,12 +2,15 @@ package com.gingersoft.gsa.cloud.table.mvp.contract;
import android.app.Activity;
import com.gingersoft.gsa.cloud.database.bean.Modifier;
import com.jess.arms.base.DefaultAdapter;
import com.jess.arms.mvp.IView;
import com.jess.arms.mvp.IModel;
import androidx.recyclerview.widget.RecyclerView;
import java.util.List;
/**
* ================================================
......@@ -43,5 +46,13 @@ public interface FineItemAllContract {
//Model层定义接口,外部只需关心Model返回的数据,无需关心内部细节,即是否使用缓存
interface Model extends IModel {
List<Modifier> queryDB_ModifierByModMsgAndVisibleQueryBuilder();
List<Modifier> queryDB_ModifierByModModTasteVisibleQueryBuilder();
List<Modifier> queryDB_ModifierByModModCommVisibleQueryBuilder();
List<Modifier> queryDB_ModifierByTopidAndVisibleQueryBuilder(long fid);
}
}
......@@ -2,12 +2,17 @@ package com.gingersoft.gsa.cloud.table.mvp.model;
import android.app.Application;
import com.gingersoft.gsa.cloud.database.bean.Modifier;
import com.gingersoft.gsa.cloud.database.utils.ModifierDaoUtils;
import com.gingersoft.gsa.cloud.table.mvp.contract.FineItemAllContract;
import com.gingersoft.gsa.cloud.table.mvp.model.utils.MealStyleUtils;
import com.google.gson.Gson;
import com.jess.arms.di.scope.FragmentScope;
import com.jess.arms.integration.IRepositoryManager;
import com.jess.arms.mvp.BaseModel;
import java.util.List;
import javax.inject.Inject;
......@@ -41,4 +46,33 @@ public class FineItemAllModel extends BaseModel implements FineItemAllContract.M
this.mGson = null;
this.mApplication = null;
}
@Override
public List<Modifier> queryDB_ModifierByModMsgAndVisibleQueryBuilder() {
//获取数据
ModifierDaoUtils modifierDaoUtils = new ModifierDaoUtils(mApplication);
List<Modifier> modifierList = modifierDaoUtils.queryModifierByModMsgAndVisibleQueryBuilder();
return MealStyleUtils.assemblyModifiersColor(modifierList);
}
@Override
public List<Modifier> queryDB_ModifierByModModTasteVisibleQueryBuilder() {
ModifierDaoUtils modifierDaoUtils = new ModifierDaoUtils(mApplication);
List<Modifier> modifierList = modifierDaoUtils.queryModifierByModModTasteVisibleQueryBuilder();
return MealStyleUtils.assemblyModifiersColor(modifierList);
}
@Override
public List<Modifier> queryDB_ModifierByModModCommVisibleQueryBuilder() {
ModifierDaoUtils modifierDaoUtils = new ModifierDaoUtils(mApplication);
List<Modifier> modifierList = modifierDaoUtils.queryModifierByModModCommVisibleQueryBuilder();
return MealStyleUtils.assemblyModifiersColor(modifierList);
}
@Override
public List<Modifier> queryDB_ModifierByTopidAndVisibleQueryBuilder(long fid) {
ModifierDaoUtils modifierDaoUtils = new ModifierDaoUtils(mApplication);
List<Modifier> modifierList = modifierDaoUtils.queryModifierByTopidAndVisibleQueryBuilder(fid);
return MealStyleUtils.assemblyModifiersColor(modifierList);
}
}
\ No newline at end of file
......@@ -7,6 +7,7 @@ import com.gingersoft.gsa.cloud.database.bean.Modifier;
import com.gingersoft.gsa.cloud.database.utils.ComboItemDaoUtils;
import com.gingersoft.gsa.cloud.database.utils.ModifierDaoUtils;
import com.gingersoft.gsa.cloud.table.mvp.contract.FineItemOneselfContract;
import com.gingersoft.gsa.cloud.table.mvp.model.utils.MealStyleUtils;
import com.google.gson.Gson;
import com.jess.arms.integration.IRepositoryManager;
import com.jess.arms.mvp.BaseModel;
......@@ -52,7 +53,7 @@ public class FineItemOneselfModel extends BaseModel implements FineItemOneselfCo
@Override
public List<Modifier> queryDB_ModifierList(long fid, int mode) {
ModifierDaoUtils daoUtils = new ModifierDaoUtils(mApplication);
return daoUtils.queryModifiersByFid(fid, mode);
return MealStyleUtils.assemblyModifiersColor(daoUtils.queryModifiersByFid(fid, mode));
}
@Override
......
......@@ -21,6 +21,7 @@ import com.gingersoft.gsa.cloud.table.mvp.model.service.MealService;
import com.gingersoft.gsa.cloud.table.mvp.model.service.MemberService;
import com.gingersoft.gsa.cloud.table.mvp.model.service.OrderPayService;
import com.gingersoft.gsa.cloud.table.mvp.model.utils.MealConditionFilterUtils;
import com.gingersoft.gsa.cloud.table.mvp.model.utils.MealStyleUtils;
import com.google.gson.Gson;
import com.jess.arms.di.scope.ActivityScope;
import com.jess.arms.integration.IRepositoryManager;
......@@ -77,27 +78,27 @@ public class MealStandModel extends BaseModel implements MealStandContract.Model
public List<Food> queryDB_FoodGroupList(int foodSummary) {
FoodDaoUtils foodDaoUtils = new FoodDaoUtils(mApplication);
List<Food> foods = foodDaoUtils.queryFoodGroupByQueryBuilder(foodSummary);
return MealConditionFilterUtils.foodConditionFilter(foods,foodSummary);
return MealStyleUtils.assemblyFoodsColor(MealConditionFilterUtils.foodConditionFilter(foods, foodSummary));
}
@Override
public List<Food> queryDB_FoodList(long parentId, int foodSummary) {
FoodDaoUtils foodDaoUtils = new FoodDaoUtils(mApplication);
List<Food> foods = foodDaoUtils.queryFoodByQueryBuilder(parentId, foodSummary);
return MealConditionFilterUtils.foodConditionFilter(foods,foodSummary);
return MealStyleUtils.assemblyFoodsColor(MealConditionFilterUtils.foodConditionFilter(foods, foodSummary));
}
@Override
public List<Modifier> queryDB_ModifierList(long fid, int mode) {
ModifierDaoUtils daoUtils = new ModifierDaoUtils(mApplication);
return daoUtils.queryModifiersByFid(fid, mode);
return MealStyleUtils.assemblyModifiersColor(daoUtils.queryModifiersByFid(fid, mode)) ;
}
@Override
public List<ComboItem> queryDB_ComboList(long fid, int foodSummary) {
ComboItemDaoUtils comboItemDao = new ComboItemDaoUtils(mApplication);
List<ComboItem> foodCombos = comboItemDao.queryComboItemsByFidQueryBuilder(fid, foodSummary);
return MealConditionFilterUtils.comboConditionFilter(foodCombos,foodSummary);
return MealConditionFilterUtils.comboConditionFilter(foodCombos, foodSummary);
}
@Override
......@@ -115,7 +116,7 @@ public class MealStandModel extends BaseModel implements MealStandContract.Model
public List<Discount> queryDB_DiscountList(byte discountScope, byte discountType) {
DiscountDaoUtils discountDaoUtils = new DiscountDaoUtils(mApplication);
List<Discount> discountList = discountDaoUtils.queryDiscountByQueryBuilder();
return MealConditionFilterUtils.discountConditionFilter(discountList,discountScope,discountType);
return MealConditionFilterUtils.discountConditionFilter(discountList, discountScope, discountType);
}
@Override
......
package com.gingersoft.gsa.cloud.table.mvp.model.utils;
import com.gingersoft.gsa.cloud.common.utils.okhttpUtils.OkHttp3Utils;
import com.gingersoft.gsa.cloud.database.bean.Food;
import com.gingersoft.gsa.cloud.database.bean.Modifier;
import java.util.List;
/**
* @作者: bin
* @創建時間: 2021-03-04 15:12
* @更新時間: 2021-03-04 15:12
* @描述:
*/
public class MealStyleUtils {
public static List<Food> assemblyFoodsColor(List<Food> foodList) {
for (Food food : foodList) {
food.getColorBean();
}
return foodList;
}
public static List<Modifier> assemblyModifiersColor(List<Modifier> modifierList) {
for (Modifier modifier : modifierList) {
modifier.getColorBean();
}
return modifierList;
}
}
......@@ -17,8 +17,8 @@ import com.gingersoft.gsa.cloud.table.R;
import com.gingersoft.gsa.cloud.table.mvp.contract.FineItemAllContract;
import com.gingersoft.gsa.cloud.table.mvp.model.bean.SoldoutCtrFood;
import com.gingersoft.gsa.cloud.table.mvp.ui.activity.MealStandActivity;
import com.gingersoft.gsa.cloud.table.mvp.ui.adapter.FineItemOneAdapter;
import com.gingersoft.gsa.cloud.table.mvp.ui.adapter.FineItemTwoAdapter;
import com.gingersoft.gsa.cloud.table.mvp.ui.adapter.meal.FineItemOneAdapter;
import com.gingersoft.gsa.cloud.table.mvp.ui.adapter.meal.FineItemTwoAdapter;
import com.gingersoft.gsa.cloud.ui.widget.dialog.CommonTipDialog;
import com.jess.arms.di.scope.FragmentScope;
import com.jess.arms.http.imageloader.ImageLoader;
......@@ -186,8 +186,7 @@ public class FineItemAllPresenter extends BasePresenter<FineItemAllContract.Mode
mFineItemOneLastPosition = -1;
//获取数据
ModifierDaoUtils modifierDaoUtils = new ModifierDaoUtils(mApplication);
List<Modifier> modifierList = modifierDaoUtils.queryModifierByModMsgAndVisibleQueryBuilder();
List<Modifier> modifierList = mModel.queryDB_ModifierByModMsgAndVisibleQueryBuilder();
if (modifierList == null || modifierList.size() == 0) {
mFineItemOneList.clear();
......@@ -208,8 +207,7 @@ public class FineItemAllPresenter extends BasePresenter<FineItemAllContract.Mode
mFineItemOneLastPosition = -1;
//获取数据
ModifierDaoUtils modifierDaoUtils = new ModifierDaoUtils(mApplication);
List<Modifier> modifierList = modifierDaoUtils.queryModifierByModModTasteVisibleQueryBuilder();
List<Modifier> modifierList = mModel.queryDB_ModifierByModModTasteVisibleQueryBuilder();
if (modifierList == null || modifierList.size() == 0) {
mFineItemOneList.clear();
......@@ -230,8 +228,7 @@ public class FineItemAllPresenter extends BasePresenter<FineItemAllContract.Mode
mFineItemOneLastPosition = -1;
//获取数据
ModifierDaoUtils modifierDaoUtils = new ModifierDaoUtils(mApplication);
List<Modifier> modifierList = modifierDaoUtils.queryModifierByModModCommVisibleQueryBuilder();
List<Modifier> modifierList = mModel.queryDB_ModifierByModModCommVisibleQueryBuilder();
if (modifierList == null || modifierList.size() == 0) {
mFineItemOneList.clear();
......@@ -250,8 +247,7 @@ public class FineItemAllPresenter extends BasePresenter<FineItemAllContract.Mode
public void initChildFineItemItemData(long fid) {
//获取数据
ModifierDaoUtils modifierDaoUtils = new ModifierDaoUtils(mApplication);
List<Modifier> modifierList = modifierDaoUtils.queryModifierByTopidAndVisibleQueryBuilder(fid);
List<Modifier> modifierList = mModel.queryDB_ModifierByTopidAndVisibleQueryBuilder(fid);
if (modifierList == null || modifierList.size() == 0) {
return;
......
......@@ -20,6 +20,7 @@ import com.gingersoft.gsa.cloud.common.utils.LanguageUtils;
import com.gingersoft.gsa.cloud.common.utils.MoneyUtil;
import com.gingersoft.gsa.cloud.common.utils.gson.GsonUtils;
import com.gingersoft.gsa.cloud.component.ComponentName;
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.Food;
......@@ -1820,6 +1821,10 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
* @param parentId
*/
private void updateFoodData(List<Food> foodList, long parentId) {
for (Food food : foodList) {
ColorBean colorBean = food.getColorBean();
int i = 0;
}
setTopId(foodList, parentId);
setFoodComboListStatus(foodList);
mFoodList.clear();
......
......@@ -99,6 +99,7 @@ public class ComboAdapter extends DefaultAdapter<ComboItem> {
if (!datasBean.isModifier()) {
initComboName(datasBean);
initComboColor(datasBean);
} else {
initModifierName(datasBean.getModifier());
initModifierSoldout(datasBean.getModifier());
......@@ -132,29 +133,11 @@ public class ComboAdapter extends DefaultAdapter<ComboItem> {
// if (desc == null || desc.trim().length() == 0) {
// desc = datasBean.getDesc1();
// }
tv_name.setText(desc);
// com.elegant.bin.gsa.mvp.main.model.bean.Color.DatasBean bgAndFontColor = datasBean.getBgAndFontColor();
// if (bgAndFontColor != null) {
// if (!TextUtils.isEmpty(bgAndFontColor.getAndroidColor())) {
// tv_name.setBackgroundColor(Color.parseColor(bgAndFontColor.getAndroidColor()));
// } else {
tv_name.setBackgroundColor(ArmsUtils.getColor(mContext, R.color.keyboard_paybill_normal));
// }
// if (!TextUtils.isEmpty(bgAndFontColor.getAndroidfontcolor())) {
// tv_name.setTextColor(Color.parseColor(bgAndFontColor.getAndroidfontcolor()));
// } else {
tv_name.setTextColor(ArmsUtils.getColor(mContext, R.color.theme_white_color));
// }
// }
// tv_name.setHeight(ColHeight);
// tv_name.setWidth(ColWidth);
// tv_name.setMaxWidth(ColHeight);
// tv_name.setMinWidth(ColWidth);
tv_name.setBackgroundColor(datasBean.getBgColor());
tv_name.setTextColor(datasBean.getFontColor());
tv_name.setGravity(Gravity.CENTER);
tv_name.setTextSize(FontSize);
tv_name.setText(desc);
}
private void initModifierSoldout(Modifier datasBean) {
......@@ -175,8 +158,6 @@ public class ComboAdapter extends DefaultAdapter<ComboItem> {
String Fname = datasBean.getName();
tv_name.setText(Fname);
tv_name.setTextSize(FontSize);
initComboColor(datasBean);
}
private void setSolodStatus(ComboItem datasBean) {
......@@ -199,7 +180,7 @@ public class ComboAdapter extends DefaultAdapter<ComboItem> {
if (TextUtils.isEmpty(qty)) {
tv_soldout.setVisibility(View.INVISIBLE);
} else {
if (qty.equalsIgnoreCase("售罄") || qty.equalsIgnoreCase("暫停") ) {
if (qty.equalsIgnoreCase("售罄") || qty.equalsIgnoreCase("暫停")) {
blv_soldout.setLableText(qty);
blv_soldout.setVisibility(View.VISIBLE);
} else {
......
package com.gingersoft.gsa.cloud.table.mvp.ui.adapter;
package com.gingersoft.gsa.cloud.table.mvp.ui.adapter.meal;
import android.content.Context;
import android.graphics.Color;
import android.text.TextUtils;
import android.view.Gravity;
import android.view.View;
......@@ -12,6 +13,7 @@ import android.widget.TextView;
import androidx.recyclerview.widget.GridLayoutManager;
import com.gingersoft.gsa.cloud.app.GsaCloudApplication;
import com.gingersoft.gsa.cloud.database.bean.ColorBean;
import com.gingersoft.gsa.cloud.database.bean.Modifier;
import com.gingersoft.gsa.cloud.table.R;
import com.gingersoft.gsa.cloud.table.R2;
......@@ -139,16 +141,6 @@ public class FineItemOneAdapter extends DefaultAdapter<Modifier> {
desc = datasBean.getModifierName();
// }
// tv_food_name.setMaxWidth(mColwidth);
// tv_food_name.setMinWidth(mColwidth);
// tv_food_name.setWidth(mColwidth);
tv_food_name.setText(desc);
tv_food_name.setTextSize(mModFontSize);
tv_food_name.setHeight(mColHeight);
tv_food_name.setGravity(Gravity.CENTER);
tv_food_name.setSingleLine(false);
GridLayoutManager.LayoutParams lp = (GridLayoutManager.LayoutParams) rl_container.getLayoutParams();
lp.height = mColHeight;
lp.width = mColwidth;
......@@ -157,38 +149,20 @@ public class FineItemOneAdapter extends DefaultAdapter<Modifier> {
/**
* 设置字体颜色以及块颜色
*/
// if (mColorList != null) {
// //后台有设置颜色当前选中高亮色,没有选中默认使用后台配置的颜色
// if (datasBean.isSelected()) {
// tv_food_name.setBackgroundColor(ArmsUtils.getColor(mContext, R.color.colorAccent));
// tv_food_name.setTextColor(ArmsUtils.getColor(mContext, R.color.theme_white_color));
// } else {
// for (Color.DatasBean cs : mColorList) {
// if (cs.getColorid() == datasBean.getColor()) {
// if (!TextUtils.isEmpty(cs.getAndroidColor())) {
// tv_food_name.setBackgroundColor(android.graphics.Color.parseColor(cs.getAndroidColor()));
// } else {
// tv_food_name.setBackgroundColor(ArmsUtils.getColor(mContext, R.color.Grass_green));
// }
// if (!TextUtils.isEmpty(cs.getAndroidfontcolor())) {
// tv_food_name.setTextColor(android.graphics.Color.parseColor(cs.getAndroidfontcolor()));
// } else {
// tv_food_name.setTextColor(ArmsUtils.getColor(mContext, R.color.theme_white_color));
// }
// break;
// }
// }
// }
// } else {
//后台没有设置颜色当前选中高亮色,没有选中默认使用绿色
// if (datasBean.isSelected()) {
// tv_food_name.setBackgroundColor(ArmsUtils.getColor(mContext, R.color.orange_500));
// tv_food_name.setTextColor(ArmsUtils.getColor(mContext, R.color.theme_white_color));
// } else {
ColorBean colorBean = datasBean.getColorBean();
if (colorBean != null) {
tv_food_name.setBackgroundColor(Color.parseColor(colorBean.getAndroidColor()));
tv_food_name.setTextColor(Color.parseColor(colorBean.getAndroidFontColor()));
} else {
tv_food_name.setBackgroundColor(ArmsUtils.getColor(mContext, R.color.Grass_green));
tv_food_name.setTextColor(ArmsUtils.getColor(mContext, R.color.theme_white_color));
// }
// }
}
tv_food_name.setHeight(mColHeight);
tv_food_name.setGravity(Gravity.CENTER);
tv_food_name.setSingleLine(false);
tv_food_name.setTextSize(mModFontSize);
tv_food_name.setText(desc);
}
public void setNumber(Modifier datasBean) {
......
package com.gingersoft.gsa.cloud.table.mvp.ui.adapter;
package com.gingersoft.gsa.cloud.table.mvp.ui.adapter.meal;
import android.content.Context;
import android.graphics.Color;
import android.text.TextUtils;
import android.view.Gravity;
import android.view.View;
......@@ -11,6 +12,7 @@ import android.widget.TextView;
import androidx.recyclerview.widget.GridLayoutManager;
import com.gingersoft.gsa.cloud.app.GsaCloudApplication;
import com.gingersoft.gsa.cloud.database.bean.ColorBean;
import com.gingersoft.gsa.cloud.database.bean.Modifier;
import com.gingersoft.gsa.cloud.table.R;
import com.gingersoft.gsa.cloud.table.R2;
......@@ -170,12 +172,6 @@ public class FineItemTwoAdapter extends DefaultAdapter<Modifier> {
tv_food_name.setMinWidth(mColwidth);
tv_food_name.setWidth(mColwidth);
tv_food_name.setText(desc);
tv_food_name.setTextSize(mModFontSize);
tv_food_name.setHeight(mColHeight);
tv_food_name.setGravity(Gravity.CENTER);
tv_food_name.setSingleLine(false);
GridLayoutManager.LayoutParams lp = (GridLayoutManager.LayoutParams) rl_container.getLayoutParams();
lp.height = mColHeight;
lp.width = mColwidth;
......@@ -184,38 +180,20 @@ public class FineItemTwoAdapter extends DefaultAdapter<Modifier> {
/**
* 设置字体颜色以及块颜色
*/
// if (mColorList != null) {
// //后台有设置颜色当前选中高亮色,没有选中默认使用后台配置的颜色
// if (datasBean.isSelected()) {
// tv_food_name.setBackgroundColor(ArmsUtils.getColor(mContext, R.color.colorAccent));
// tv_food_name.setTextColor(ArmsUtils.getColor(mContext, R.color.theme_white_color));
// } else {
// for (Color.DatasBean cs : mColorList) {
// if (cs.getColorid() == datasBean.getColor()) {
// if (!TextUtils.isEmpty(cs.getAndroidColor())) {
// tv_food_name.setBackgroundColor(android.graphics.Color.parseColor(cs.getAndroidColor()));
// } else {
// tv_food_name.setBackgroundColor(ArmsUtils.getColor(mContext, R.color.Grass_green));
// }
// if (!TextUtils.isEmpty(cs.getAndroidfontcolor())) {
// tv_food_name.setTextColor(android.graphics.Color.parseColor(cs.getAndroidfontcolor()));
// } else {
// tv_food_name.setTextColor(ArmsUtils.getColor(mContext, R.color.theme_white_color));
// }
// break;
// }
// }
// }
// } else {
//后台没有设置颜色当前选中高亮色,没有选中默认使用绿色
// if (datasBean.isSelected()) {
// tv_food_name.setBackgroundColor(ArmsUtils.getColor(mContext, R.color.orange_500));
// tv_food_name.setTextColor(ArmsUtils.getColor(mContext, R.color.theme_white_color));
// } else {
ColorBean colorBean = datasBean.getColorBean();
if (colorBean != null) {
tv_food_name.setBackgroundColor(Color.parseColor(colorBean.getAndroidColor()));
tv_food_name.setTextColor(Color.parseColor(colorBean.getAndroidFontColor()));
} else {
tv_food_name.setBackgroundColor(ArmsUtils.getColor(mContext, R.color.Grass_green));
tv_food_name.setTextColor(ArmsUtils.getColor(mContext, R.color.theme_white_color));
// }
// }
}
tv_food_name.setHeight(mColHeight);
tv_food_name.setGravity(Gravity.CENTER);
tv_food_name.setSingleLine(false);
tv_food_name.setTextSize(mModFontSize);
tv_food_name.setText(desc);
}
public void setNumber(Modifier datasBean) {
......
package com.gingersoft.gsa.cloud.table.mvp.ui.adapter.meal;
import android.content.Context;
import android.graphics.Color;
import android.text.TextUtils;
import android.view.Gravity;
import android.view.View;
......@@ -12,6 +13,7 @@ import android.widget.TextView;
import androidx.recyclerview.widget.GridLayoutManager;
import com.gingersoft.gsa.cloud.app.GsaCloudApplication;
import com.gingersoft.gsa.cloud.database.bean.ColorBean;
import com.gingersoft.gsa.cloud.database.bean.Food;
import com.gingersoft.gsa.cloud.table.R;
import com.gingersoft.gsa.cloud.table.R2;
......@@ -200,11 +202,17 @@ public class FoodAdapter extends DefaultAdapter<Food> {
tv_food_name.setBackgroundColor(ArmsUtils.getColor(mContext, R.color.orange_500));
tv_food_name.setTextColor(ArmsUtils.getColor(mContext, R.color.theme_white_color));
} else {
if (datasBean.getColorBean() != null) {
ColorBean colorBean = datasBean.getColorBean();
tv_food_name.setBackgroundColor(Color.parseColor(colorBean.getAndroidColor()));
tv_food_name.setTextColor(Color.parseColor(colorBean.getAndroidFontColor()));
} else {
tv_food_name.setBackgroundColor(ArmsUtils.getColor(mContext, R.color.light_blue_500));
tv_food_name.setTextColor(ArmsUtils.getColor(mContext, R.color.theme_white_color));
}
}
}
}
public void resetSelect(int position, Food datasBean) {
if (position < 0) {
......
......@@ -9,6 +9,7 @@ import android.widget.RelativeLayout;
import android.widget.TextView;
import com.gingersoft.gsa.cloud.app.GsaCloudApplication;
import com.gingersoft.gsa.cloud.database.bean.ColorBean;
import com.gingersoft.gsa.cloud.database.bean.Food;
import com.gingersoft.gsa.cloud.table.R;
import com.gingersoft.gsa.cloud.table.R2;
......@@ -100,6 +101,7 @@ public class FoodGroupAdapter extends DefaultAdapter<Food> {
setFoodGroup(datasBean);
setNumber(datasBean);
setColor(datasBean);
setSoldoutStatus(datasBean);
setOnItemClickListener(new OnViewClickListener() {
......@@ -180,15 +182,13 @@ public class FoodGroupAdapter extends DefaultAdapter<Food> {
// }
// } else {
// //后台没有设置颜色当前选中高亮色,没有选中默认使用绿色
if (datasBean.isSelected()) {
tv_name.setBackgroundColor(Color.parseColor("#3C3C3C"));
// tv_name.setBackgroundColor(ArmsUtils.getColor(mContext, R.color.orange_500));
tv_name.setTextColor(ArmsUtils.getColor(mContext, R.color.theme_white_color));
} else {
tv_name.setBackgroundColor(Color.parseColor("#FF9700"));
// tv_name.setBackgroundColor(ArmsUtils.getColor(mContext, R.color.Grass_green));
tv_name.setTextColor(ArmsUtils.getColor(mContext, R.color.theme_white_color));
}
// if (datasBean.isSelected()) {
// tv_name.setBackgroundColor(Color.parseColor("#3C3C3C"));
// tv_name.setTextColor(ArmsUtils.getColor(mContext, R.color.theme_white_color));
// } else {
// tv_name.setBackgroundColor(Color.parseColor("#FF9700"));
// tv_name.setTextColor(ArmsUtils.getColor(mContext, R.color.theme_white_color));
// }
// }
}
......@@ -212,6 +212,22 @@ public class FoodGroupAdapter extends DefaultAdapter<Food> {
}
}
private void setColor(Food datasBean) {
if (datasBean.isSelected()) {
tv_name.setBackgroundColor(Color.parseColor("#3C3C3C"));
tv_name.setTextColor(ArmsUtils.getColor(mContext, R.color.theme_white_color));
} else {
if (datasBean.getColorBean() != null) {
ColorBean colorBean = datasBean.getColorBean();
tv_name.setBackgroundColor(Color.parseColor(colorBean.getAndroidColor()));
tv_name.setTextColor(Color.parseColor(colorBean.getAndroidFontColor()));
} else {
tv_name.setBackgroundColor(ArmsUtils.getColor(mContext, R.color.orange_500));
tv_name.setTextColor(ArmsUtils.getColor(mContext, R.color.theme_white_color));
}
}
}
public void setSoldoutStatus(Food datasBean) {
tv_soldout.setMaxHeight(mOrderNumberShowSize);
tv_soldout.setMinHeight(mOrderNumberShowSize);
......
package com.gingersoft.gsa.cloud.table.mvp.ui.adapter.meal;
import android.content.Context;
import android.graphics.Color;
import android.text.TextUtils;
import android.view.Gravity;
import android.view.View;
......@@ -9,6 +10,7 @@ import android.widget.ImageView;
import android.widget.TextView;
import com.gingersoft.gsa.cloud.app.GsaCloudApplication;
import com.gingersoft.gsa.cloud.database.bean.ColorBean;
import com.gingersoft.gsa.cloud.database.bean.Modifier;
import com.gingersoft.gsa.cloud.table.R;
import com.gingersoft.gsa.cloud.table.R2;
......@@ -104,43 +106,17 @@ public class ModifierAdapter extends DefaultAdapter<Modifier> {
private void initModifierName(Modifier datasBean) {
String desc = datasBean.getModifierName();
// switch (GSAApplication.androidSetting.getDataLanguage()) {
// case 1:
// desc = datasBean.getDesc1();
// break;
// case 2:
// desc = datasBean.getDesc2();
// break;
// case 3:
// desc = datasBean.getDesc3();
// break;
// }
// if (desc == null || desc.trim().length() == 0) {
// desc = datasBean.getDesc1();
// }
tv_name.setText(desc);
// com.elegant.bin.gsa.mvp.main.model.bean.Color.DatasBean bgAndFontColor = datasBean.getBgAndFontColor();
// if (bgAndFontColor != null) {
// if (!TextUtils.isEmpty(bgAndFontColor.getAndroidColor())) {
// tv_name.setBackgroundColor(Color.parseColor(bgAndFontColor.getAndroidColor()));
// } else {
ColorBean colorBean = datasBean.getColorBean();
if (colorBean != null) {
tv_name.setBackgroundColor(Color.parseColor(colorBean.getAndroidColor()));
tv_name.setTextColor(Color.parseColor(colorBean.getAndroidFontColor()));
} else {
tv_name.setBackgroundColor(ArmsUtils.getColor(mContext, R.color.keyboard_paybill_normal));
// }
// if (!TextUtils.isEmpty(bgAndFontColor.getAndroidfontcolor())) {
// tv_name.setTextColor(Color.parseColor(bgAndFontColor.getAndroidfontcolor()));
// } else {
tv_name.setTextColor(ArmsUtils.getColor(mContext, R.color.theme_white_color));
// }
// }
// tv_name.setHeight(ColHeight);
// tv_name.setWidth(ColWidth);
// tv_name.setMaxWidth(ColHeight);
// tv_name.setMinWidth(ColWidth);
tv_name.setGravity(Gravity.CENTER);
}
tv_name.setTextSize(FontSize);
tv_name.setText(desc);
tv_name.setGravity(Gravity.CENTER);
}
private void initModifierSoldout(Modifier datasBean) {
......@@ -158,7 +134,7 @@ public class ModifierAdapter extends DefaultAdapter<Modifier> {
if (TextUtils.isEmpty(qty)) {
tv_soldout.setVisibility(View.INVISIBLE);
} else {
if (qty.equalsIgnoreCase("售罄") || qty.equalsIgnoreCase("暫停") ) {
if (qty.equalsIgnoreCase("售罄") || qty.equalsIgnoreCase("暫停")) {
blv_soldout.setLableText(qty);
blv_soldout.setVisibility(View.VISIBLE);
} else {
......
......@@ -39,6 +39,7 @@ import io.rx_cache2.internal.RxCache;
import io.victoralbertos.jolyglot.GsonSpeaker;
import me.jessyan.rxerrorhandler.core.RxErrorHandler;
import me.jessyan.rxerrorhandler.handler.listener.ResponseErrorListener;
import okhttp3.Cache;
import okhttp3.HttpUrl;
import okhttp3.Interceptor;
import okhttp3.OkHttpClient;
......
......@@ -8,22 +8,10 @@ import android.content.res.Configuration;
import android.graphics.Bitmap;
import android.os.Build;
import android.os.RemoteException;
import androidx.annotation.NonNull;
import com.billy.cc.core.component.CC;
import com.dianping.logan.Logan;
import com.dianping.logan.OnLoganProtocolStatus;
import com.elvishew.xlog.LogConfiguration;
import com.elvishew.xlog.LogLevel;
import com.elvishew.xlog.XLog;
import com.elvishew.xlog.interceptor.BlacklistTagsFilterInterceptor;
import com.elvishew.xlog.printer.AndroidPrinter;
import com.elvishew.xlog.printer.ConsolePrinter;
import com.elvishew.xlog.printer.Printer;
import com.elvishew.xlog.printer.file.FilePrinter;
import com.elvishew.xlog.printer.file.clean.FileLastModifiedCleanStrategy;
import com.elvishew.xlog.printer.file.naming.DateFileNameGenerator;
import com.gingersoft.gsa.cloud.common.BuildConfig;
import com.gingersoft.gsa.cloud.common.R;
import com.gingersoft.gsa.cloud.common.config.LoganConfig;
......@@ -49,11 +37,9 @@ import com.gingersoft.gsa.cloud.common.printer.PrinterFileUtils;
import com.gingersoft.gsa.cloud.common.printer.plugins.PrinterFlowListener;
import com.gingersoft.gsa.cloud.common.printer.plugins.PrinterFlowProxy;
import com.gingersoft.gsa.cloud.common.utils.AppDevices;
import com.gingersoft.gsa.cloud.common.utils.FileUtils;
import com.gingersoft.gsa.cloud.common.utils.crash.AppCrashHandler;
import com.gingersoft.gsa.cloud.common.utils.log.LogUtil;
import com.gingersoft.gsa.cloud.common.utils.other.SPUtils;
import com.gingersoft.gsa.cloud.common.utils.xlog.MyBackupStrategy;
import com.gingersoft.gsa.cloud.component.ComponentAction;
import com.gingersoft.gsa.cloud.component.ComponentName;
import com.gingersoft.gsa.cloud.database.DaoManager;
......@@ -74,6 +60,9 @@ import io.reactivex.plugins.RxJavaPlugins;
import me.jessyan.autosize.AutoSize;
import me.jessyan.autosize.AutoSizeConfig;
import me.jessyan.autosize.onAdaptListener;
import me.jessyan.progressmanager.ProgressListener;
import me.jessyan.progressmanager.ProgressManager;
import me.jessyan.progressmanager.body.ProgressInfo;
import me.jessyan.retrofiturlmanager.RetrofitUrlManager;
/**
......@@ -130,6 +119,8 @@ public class GsaCloudApplication extends BaseApplication {
initHywebCommandImpl();
//初始化服務器地址
initDomainUrl();
//初始化Http请求响应进度监听器
initHttpProgressListener();
//初始化QMUI相关
initQMUI();
//初始化哆啦A夢
......@@ -144,8 +135,6 @@ public class GsaCloudApplication extends BaseApplication {
initGreenDao();
//初始化打印相關
initPrint();
//初始化日誌管理庫
initXLog();
//初始化crash記錄
AppCrashHandler.getInstance().init(this);
//初始化Rxjava相關
......@@ -319,6 +308,33 @@ public class GsaCloudApplication extends BaseApplication {
RetrofitUrlManager.getInstance().putDomain("ricepon_hk_member", HttpsConstans.HK_TEST_RICEPON_MEMBER);
}
private void initHttpProgressListener() {
ProgressManager.getInstance().addRequestListener("http://a.ricepon.com:58201/ricepon-cloud-gsa/api/restaurantTable/list?restaurantId=365", new ProgressListener() {
@Override
public void onProgress(ProgressInfo progressInfo) {
LoganManager.w_printer(TAG, "request onProgress->" + progressInfo.toString());
}
@Override
public void onError(long id, Exception e) {
LoganManager.w_printer(TAG, "request onError->" + id);
}
});
ProgressManager.getInstance().addResponseListener("http://a.ricepon.com:58201/ricepon-cloud-gsa/api/restaurantTable/list?restaurantId=365", new ProgressListener() {
@Override
public void onProgress(ProgressInfo progressInfo) {
LoganManager.w_printer(TAG, "response onProgress->" + progressInfo.toString());
}
@Override
public void onError(long id, Exception e) {
LoganManager.w_printer(TAG, "response onError->" + id);
}
});
}
private void initPrint() {
if (PrintConstans.PRINT_MODEL_V2.contains(Build.MODEL)) {
//商米打印
......@@ -403,27 +419,27 @@ public class GsaCloudApplication extends BaseApplication {
}
private void initXLog() {
LogConfiguration config = new LogConfiguration.Builder()
.logLevel(BuildConfig.DEBUG ? LogLevel.ALL // 指定日志级别,低于该级别的日志将不会被打印,默认为 LogLevel.ALL
: LogLevel.NONE)
.tag("GSA_Cloud_TAG") // 指定 TAG,默认为 "X-LOG"
.addInterceptor(new BlacklistTagsFilterInterceptor( // 添加黑名单 TAG 过滤器
"blacklist1", "blacklist2", "blacklist3"))
.build();
Printer androidPrinter = new AndroidPrinter(); // 通过 android.util.Log 打印日志的打印器
Printer consolePrinter = new ConsolePrinter(); // 通过 System.out 打印日志到控制台的打印器
Printer filePrinter = new FilePrinter // 打印日志到文件的打印器
.Builder(FileUtils.ACTIONLOG_PATH) // 指定保存日志文件的路径
.fileNameGenerator(new DateFileNameGenerator()) // 指定日志文件名生成器,默认为 ChangelessFileNameGenerator("log")
.backupStrategy(new MyBackupStrategy(FileUtils.ACTION_MAX_SIZE)) // 指定日志文件备份策略,默认为 FileSizeBackupStrategy(1024 * 1024)
.cleanStrategy(new FileLastModifiedCleanStrategy(FileUtils.ACTION_MAX_FILE_TIME)) // 指定日志文件清除策略,默认为 NeverCleanStrategy()
.build();
XLog.init( // 初始化 XLog
config, // 指定日志配置,如果不指定,会默认使用 new LogConfiguration.Builder().build()
androidPrinter, // 添加任意多的打印器。如果没有添加任何打印器,会默认使用 AndroidPrinter(Android)/ConsolePrinter(java)
consolePrinter,
filePrinter);
// LogConfiguration config = new LogConfiguration.Builder()
// .logLevel(BuildConfig.DEBUG ? LogLevel.ALL // 指定日志级别,低于该级别的日志将不会被打印,默认为 LogLevel.ALL
// : LogLevel.NONE)
// .tag("GSA_Cloud_TAG") // 指定 TAG,默认为 "X-LOG"
// .addInterceptor(new BlacklistTagsFilterInterceptor( // 添加黑名单 TAG 过滤器
// "blacklist1", "blacklist2", "blacklist3"))
// .build();
//
// Printer androidPrinter = new AndroidPrinter(); // 通过 android.util.Log 打印日志的打印器
// Printer consolePrinter = new ConsolePrinter(); // 通过 System.out 打印日志到控制台的打印器
// Printer filePrinter = new FilePrinter // 打印日志到文件的打印器
// .Builder(FileUtils.ACTIONLOG_PATH) // 指定保存日志文件的路径
// .fileNameGenerator(new DateFileNameGenerator()) // 指定日志文件名生成器,默认为 ChangelessFileNameGenerator("log")
// .backupStrategy(new MyBackupStrategy(FileUtils.ACTION_MAX_SIZE)) // 指定日志文件备份策略,默认为 FileSizeBackupStrategy(1024 * 1024)
// .cleanStrategy(new FileLastModifiedCleanStrategy(FileUtils.ACTION_MAX_FILE_TIME)) // 指定日志文件清除策略,默认为 NeverCleanStrategy()
// .build();
// XLog.init( // 初始化 XLog
// config, // 指定日志配置,如果不指定,会默认使用 new LogConfiguration.Builder().build()
// androidPrinter, // 添加任意多的打印器。如果没有添加任何打印器,会默认使用 AndroidPrinter(Android)/ConsolePrinter(java)
// consolePrinter,
// filePrinter);
}
......
package com.gingersoft.gsa.cloud.common.config;
import android.os.Environment;
import com.gingersoft.gsa.cloud.app.GsaCloudApplication;
import java.io.File;
/**
* @author : bin
* @create date: 2020-11-21
......@@ -9,6 +15,15 @@ package com.gingersoft.gsa.cloud.common.config;
public class OkHttpConfig {
/**
* okhttp cache目录
*/
public static final String CACHE_DIRECTORY = GsaCloudApplication.getAppContext().getExternalFilesDir(null).getAbsolutePath() + File.separator + "okhttpCache";
/**
* okhttp cache大小
*/
public static final long CACHE_MAXSIZE = 1024 * 1024 * 5;
/**
* okhttp连接超时20秒
*/
public static final byte CONNECT_TIMEOUT = 20;
......
......@@ -5,10 +5,12 @@ import android.content.Context;
import com.gingersoft.gsa.cloud.common.config.OkHttpConfig;
import com.jess.arms.di.module.ClientModule;
import java.io.File;
import java.util.concurrent.TimeUnit;
import me.jessyan.progressmanager.ProgressManager;
import me.jessyan.retrofiturlmanager.RetrofitUrlManager;
import okhttp3.Cache;
import okhttp3.OkHttpClient;
/**
......@@ -26,6 +28,7 @@ public class MyOkhttpConfiguration implements ClientModule.OkhttpConfiguration {
builder.connectTimeout(OkHttpConfig.CONNECT_TIMEOUT, TimeUnit.SECONDS);
builder.writeTimeout(OkHttpConfig.REQUEST_TIMEOUT, TimeUnit.SECONDS);
builder.readTimeout(OkHttpConfig.REQUEST_TIMEOUT, TimeUnit.SECONDS);
builder.cache(new Cache(new File(OkHttpConfig.CACHE_DIRECTORY), OkHttpConfig.CACHE_MAXSIZE));
//使用一行代码监听 Retrofit/Okhttp 上传下载进度监听,以及 Glide 加载进度监听 详细使用方法查看 https://github.com/JessYanCoding/ProgressManager
ProgressManager.getInstance().with(builder);
//让 Retrofit 同时支持多个 BaseUrl 以及动态改变 BaseUrl. 详细使用请方法查看 https://github.com/JessYanCoding/RetrofitUrlManager
......
......@@ -2,8 +2,15 @@ package com.gingersoft.gsa.cloud.common.config.globalconfig.applyOptions;
import android.content.Context;
import com.gingersoft.gsa.cloud.common.BuildConfig;
import com.gingersoft.gsa.cloud.common.config.OkHttpConfig;
import com.jess.arms.di.module.ClientModule;
import java.io.File;
import java.util.concurrent.TimeUnit;
import me.jessyan.progressmanager.ProgressManager;
import me.jessyan.retrofiturlmanager.RetrofitUrlManager;
import okhttp3.Cache;
import okhttp3.OkHttpClient;
import retrofit2.Retrofit;
......@@ -16,8 +23,15 @@ public class MyRetrofitConfiguration implements ClientModule.RetrofitConfigurati
if (BuildConfig.DEBUG) {
// clientBuilder.addInterceptor(new LoggingInterceptor());//使用自定义的Log拦截器
}
// clientBuilder.addInterceptor(new RequestInterceptor());
// clientBuilder.addInterceptor(new HeadersInterceptor());//使用自定义User-Agent
// builder.client(RetrofitUrlManager.getInstance().with(clientBuilder).build());
clientBuilder.connectTimeout(OkHttpConfig.CONNECT_TIMEOUT, TimeUnit.SECONDS);
clientBuilder.writeTimeout(OkHttpConfig.REQUEST_TIMEOUT, TimeUnit.SECONDS);
clientBuilder.readTimeout(OkHttpConfig.REQUEST_TIMEOUT, TimeUnit.SECONDS);
clientBuilder.cache(new Cache(new File(OkHttpConfig.CACHE_DIRECTORY), OkHttpConfig.CACHE_MAXSIZE));
//使用一行代码监听 Retrofit/Okhttp 上传下载进度监听,以及 Glide 加载进度监听 详细使用方法查看 https://github.com/JessYanCoding/ProgressManager
ProgressManager.getInstance().with(clientBuilder);
//让 Retrofit 同时支持多个 BaseUrl 以及动态改变 BaseUrl. 详细使用请方法查看 https://github.com/JessYanCoding/RetrofitUrlManager
RetrofitUrlManager.getInstance().with(clientBuilder).build();
builder.client(clientBuilder.build());
}
}
......@@ -11,6 +11,7 @@ import com.gingersoft.gsa.cloud.common.core.user.UserContext;
import com.gingersoft.gsa.cloud.app.GsaCloudApplication;
import com.gingersoft.gsa.cloud.common.BuildConfig;
import com.gingersoft.gsa.cloud.common.utils.log.LogUtil;
import com.gingersoft.gsa.cloud.common.utils.okhttpUtils.OkHttp3Utils;
import com.gingersoft.gsa.cloud.common.utils.time.TimeUtils;
import com.gingersoft.gsa.cloud.common.config.LoganConfig;
import com.jess.arms.utils.ArmsUtils;
......
......@@ -10,11 +10,7 @@ import android.os.Environment;
import android.provider.DocumentsContract;
import android.provider.MediaStore;
import android.text.TextUtils;
import com.elvishew.xlog.XLog;
import com.gingersoft.gsa.cloud.common.utils.encryption.BASE64Encoder;
import com.gingersoft.gsa.cloud.common.utils.view.BitmapUtil;
import java.io.BufferedReader;
import java.io.ByteArrayOutputStream;
import java.io.Closeable;
......
......@@ -9,8 +9,6 @@ import android.os.Looper;
import android.text.TextUtils;
import android.util.Log;
import android.widget.Toast;
import com.elvishew.xlog.XLog;
import com.gingersoft.gsa.cloud.common.Api;
import com.gingersoft.gsa.cloud.common.bean.BaseResult;
import com.gingersoft.gsa.cloud.common.constans.HttpsConstans;
......
......@@ -18,6 +18,7 @@ import java.util.concurrent.TimeUnit;
import io.reactivex.Observable;
import io.reactivex.schedulers.Schedulers;
import okhttp3.Cache;
import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.FormBody;
......@@ -47,6 +48,7 @@ public class OkHttp3Utils {
mOkHttpClient = new OkHttpClient.Builder()
.connectTimeout(OkHttpConfig.REQUEST_TIMEOUT, TimeUnit.SECONDS)
.readTimeout(OkHttpConfig.REQUEST_TIMEOUT, TimeUnit.SECONDS)
.cache(new Cache(new File(OkHttpConfig.CACHE_DIRECTORY), OkHttpConfig.CACHE_MAXSIZE))
.addInterceptor(new HeadersInterceptor())
.addInterceptor(new RequestInterceptor())
.build();
......@@ -219,7 +221,6 @@ public class OkHttp3Utils {
}
/**
* 心跳接口報錯,推送給相關人員
* 版本,時間,RP_HD001,Gingersoft,GS1,26ErrorMsg:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
......
package com.gingersoft.gsa.cloud.common.utils.xlog;
import com.elvishew.xlog.printer.file.naming.FileNameGenerator;
import com.gingersoft.gsa.cloud.app.GsaCloudApplication;
import com.jess.arms.utils.DeviceUtils;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import java.util.TimeZone;
/**
* 作者:ELEGANT_BIN
* 版本:1.6.0
* 创建日期:2019-12-06
* 修订历史:2019-12-06
* 描述:
*/
public class DateFileNameGenerator implements FileNameGenerator {
ThreadLocal<SimpleDateFormat> mLocalDateFormat = new ThreadLocal<SimpleDateFormat>() {
@Override
protected SimpleDateFormat initialValue() {
return new SimpleDateFormat("yyyy-MM-dd", Locale.US);
}
};
@Override
public boolean isFileNameChangeable() {
return true;
}
/**
* Generate a file name which represent a specific date.
*/
@Override
public String generateFileName(int logLevel, long timestamp) {
SimpleDateFormat sdf = mLocalDateFormat.get();
sdf.setTimeZone(TimeZone.getDefault());
String machineName = "test_machine";
String fileName = machineName + "-" + DeviceUtils.getVersionName(GsaCloudApplication.getAppContext()) + "-" + sdf.format(new Date(timestamp));
return fileName;
}
}
package com.gingersoft.gsa.cloud.common.utils.xlog;
import com.elvishew.xlog.printer.file.backup.BackupStrategy;
import java.io.File;
/**
* 作者:ELEGANT_BIN
* 版本:1.6.0
* 创建日期:2019-12-05
* 修订历史:2019-12-05
* 描述:
*/
public class MyBackupStrategy implements BackupStrategy {
private long maxSize;
/**
* Constructor.
*
* @param maxSize the max size the file can reach
*/
public MyBackupStrategy(long maxSize) {
this.maxSize = maxSize;
}
@Override
public boolean shouldBackup(File file) {
return file.length() > maxSize;
}
}
......@@ -23,7 +23,7 @@ public class ColorBean {
* editTime : Dec 12, 2018 6:03:58 PM
*/
// @Property(nameInDb = "_id")
@Id(autoincrement = true)
@Id
private Long colorId;
private String colorStart;
private String colorStop;
......
......@@ -293,8 +293,9 @@ public class Food {
* 顏色ID
*/
private long colorId;
// @ToOne(joinProperty = "colorId") //这个是注解绑定 hid就是上面一行的colorId
// private ColorBean colorBean;
@ToOne(joinProperty = "colorId") //这个是注解绑定 hid就是上面一行的colorId
private ColorBean colorBean;
/**
* 自定義字段
......@@ -324,6 +325,14 @@ public class Food {
/**是否组合食品*/
@Transient
private boolean isComboFood = false;
/** Used to resolve relations */
@Generated(hash = 2040040024)
private transient DaoSession daoSession;
/** Used for active entity operations. */
@Generated(hash = 1296197325)
private transient FoodDao myDao;
@Generated(hash = 292980300)
private transient Long colorBean__resolvedKey;
@Generated(hash = 60268763)
public Food(Long id, long parentId, long restaurantId, byte isParent, long seqNo, String foodName,
String foodName1, String foodName2, String plu, String posFid, String foodDesc,
......@@ -1211,4 +1220,80 @@ public class Food {
this.isStatistic = isStatistic;
}
/** To-one relationship, resolved on first access. */
@Generated(hash = 972194621)
public ColorBean getColorBean() {
long __key = this.colorId;
if (colorBean__resolvedKey == null || !colorBean__resolvedKey.equals(__key)) {
final DaoSession daoSession = this.daoSession;
if (daoSession == null) {
throw new DaoException("Entity is detached from DAO context");
}
ColorBeanDao targetDao = daoSession.getColorBeanDao();
ColorBean colorBeanNew = targetDao.load(__key);
synchronized (this) {
colorBean = colorBeanNew;
colorBean__resolvedKey = __key;
}
}
return colorBean;
}
/** called by internal mechanisms, do not call yourself. */
@Generated(hash = 453682256)
public void setColorBean(@NotNull ColorBean colorBean) {
if (colorBean == null) {
throw new DaoException(
"To-one property 'colorId' has not-null constraint; cannot set to-one to null");
}
synchronized (this) {
this.colorBean = colorBean;
colorId = colorBean.getColorId();
colorBean__resolvedKey = colorId;
}
}
/**
* Convenient call for {@link org.greenrobot.greendao.AbstractDao#delete(Object)}.
* Entity must attached to an entity context.
*/
@Generated(hash = 128553479)
public void delete() {
if (myDao == null) {
throw new DaoException("Entity is detached from DAO context");
}
myDao.delete(this);
}
/**
* Convenient call for {@link org.greenrobot.greendao.AbstractDao#refresh(Object)}.
* Entity must attached to an entity context.
*/
@Generated(hash = 1942392019)
public void refresh() {
if (myDao == null) {
throw new DaoException("Entity is detached from DAO context");
}
myDao.refresh(this);
}
/**
* Convenient call for {@link org.greenrobot.greendao.AbstractDao#update(Object)}.
* Entity must attached to an entity context.
*/
@Generated(hash = 713229351)
public void update() {
if (myDao == null) {
throw new DaoException("Entity is detached from DAO context");
}
myDao.update(this);
}
/** called by internal mechanisms, do not call yourself. */
@Generated(hash = 505459956)
public void __setDaoSession(DaoSession daoSession) {
this.daoSession = daoSession;
myDao = daoSession != null ? daoSession.getFoodDao() : null;
}
}
......@@ -7,9 +7,15 @@ import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Generated;
import org.greenrobot.greendao.annotation.Id;
import org.greenrobot.greendao.annotation.Property;
import org.greenrobot.greendao.annotation.ToOne;
import org.greenrobot.greendao.annotation.Transient;
import java.util.Date;
import org.greenrobot.greendao.DaoException;
import com.gingersoft.gsa.cloud.database.greendao.DaoSession;
import com.gingersoft.gsa.cloud.database.greendao.ColorBeanDao;
import org.greenrobot.greendao.annotation.NotNull;
import com.gingersoft.gsa.cloud.database.greendao.ModifierDao;
/**
* 作者:ELEGANT_BIN
......@@ -46,7 +52,6 @@ public class Modifier {
*/
private double lunchboxPrice;
private long colorId;
/**
* 圖片
*/
......@@ -203,6 +208,14 @@ public class Modifier {
* 是否參與會員喜好統計 0 參與 1 不參與
*/
private long isStatistic;
/**
* 顏色ID
*/
private long colorId;
@ToOne(joinProperty = "colorId") //这个是注解绑定 hid就是上面一行的colorId
private ColorBean colorBean;
/**
* 自定義字段
......@@ -241,17 +254,28 @@ public class Modifier {
/**是否細項組返回按鈕*/
private boolean isReturn = false;
/** Used to resolve relations */
@Generated(hash = 2040040024)
private transient DaoSession daoSession;
/** Used for active entity operations. */
@Generated(hash = 811918038)
private transient ModifierDao myDao;
@Generated(hash = 292980300)
private transient Long colorBean__resolvedKey;
@Generated(hash = 1490458360)
@Generated(hash = 1099399041)
public Modifier(Long dbid, long mid, long topId, long restaurantId, String modifierName, long seqNo, double marketPrice,
double price, double lunchboxPrice, long colorId, String imageUrl, long invisible, double cost, Date startDate,
Date endDate, long like, long totalSold, long majorMainId, long deptId, String createBy, Date createTime,
String updateBy, Date updateTime, String posFid, String pId, long autoMod, long blueEdit, long autoMerge,
long customMsg, long isParent, String modifierName1, String modifierName2, double multiple, String printSet,
String ktSetting, long modComm, long modTaste, long modMsg, long ktFireCourse, long ableDisCount,
long printToBill, long ktPrintMainItem, long ktShowPrice, long ktFont, long conditions, long isRt, byte visible,
long deletes, long isStatistic) {
double price, double lunchboxPrice, String imageUrl, long invisible, double cost, Date startDate, Date endDate,
long like, long totalSold, long majorMainId, long deptId, String createBy, Date createTime, String updateBy,
Date updateTime, String posFid, String pId, long autoMod, long blueEdit, long autoMerge, long customMsg,
long isParent, String modifierName1, String modifierName2, double multiple, String printSet, String ktSetting,
long modComm, long modTaste, long modMsg, long ktFireCourse, long ableDisCount, long printToBill,
long ktPrintMainItem, long ktShowPrice, long ktFont, long conditions, long isRt, byte visible, long deletes,
long isStatistic, long colorId) {
this.dbid = dbid;
this.mid = mid;
this.topId = topId;
......@@ -261,7 +285,6 @@ public class Modifier {
this.marketPrice = marketPrice;
this.price = price;
this.lunchboxPrice = lunchboxPrice;
this.colorId = colorId;
this.imageUrl = imageUrl;
this.invisible = invisible;
this.cost = cost;
......@@ -301,6 +324,7 @@ public class Modifier {
this.visible = visible;
this.deletes = deletes;
this.isStatistic = isStatistic;
this.colorId = colorId;
}
@Generated(hash = 385685553)
......@@ -946,4 +970,79 @@ public class Modifier {
public void setSelectQty(int selectQty) {
this.selectQty = selectQty;
}
/** To-one relationship, resolved on first access. */
@Generated(hash = 972194621)
public ColorBean getColorBean() {
long __key = this.colorId;
if (colorBean__resolvedKey == null || !colorBean__resolvedKey.equals(__key)) {
final DaoSession daoSession = this.daoSession;
if (daoSession == null) {
throw new DaoException("Entity is detached from DAO context");
}
ColorBeanDao targetDao = daoSession.getColorBeanDao();
ColorBean colorBeanNew = targetDao.load(__key);
synchronized (this) {
colorBean = colorBeanNew;
colorBean__resolvedKey = __key;
}
}
return colorBean;
}
/** called by internal mechanisms, do not call yourself. */
@Generated(hash = 453682256)
public void setColorBean(@NotNull ColorBean colorBean) {
if (colorBean == null) {
throw new DaoException("To-one property 'colorId' has not-null constraint; cannot set to-one to null");
}
synchronized (this) {
this.colorBean = colorBean;
colorId = colorBean.getColorId();
colorBean__resolvedKey = colorId;
}
}
/**
* Convenient call for {@link org.greenrobot.greendao.AbstractDao#delete(Object)}.
* Entity must attached to an entity context.
*/
@Generated(hash = 128553479)
public void delete() {
if (myDao == null) {
throw new DaoException("Entity is detached from DAO context");
}
myDao.delete(this);
}
/**
* Convenient call for {@link org.greenrobot.greendao.AbstractDao#refresh(Object)}.
* Entity must attached to an entity context.
*/
@Generated(hash = 1942392019)
public void refresh() {
if (myDao == null) {
throw new DaoException("Entity is detached from DAO context");
}
myDao.refresh(this);
}
/**
* Convenient call for {@link org.greenrobot.greendao.AbstractDao#update(Object)}.
* Entity must attached to an entity context.
*/
@Generated(hash = 713229351)
public void update() {
if (myDao == null) {
throw new DaoException("Entity is detached from DAO context");
}
myDao.update(this);
}
/** called by internal mechanisms, do not call yourself. */
@Generated(hash = 956718133)
public void __setDaoSession(DaoSession daoSession) {
this.daoSession = daoSession;
myDao = daoSession != null ? daoSession.getModifierDao() : null;
}
}
......@@ -47,7 +47,7 @@ public class ColorBeanDao extends AbstractDao<ColorBean, Long> {
public static void createTable(Database db, boolean ifNotExists) {
String constraint = ifNotExists? "IF NOT EXISTS ": "";
db.execSQL("CREATE TABLE " + constraint + "\"COLOR_BEAN\" (" + //
"\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: colorId
"\"_id\" INTEGER PRIMARY KEY ," + // 0: colorId
"\"COLOR_START\" TEXT," + // 1: colorStart
"\"COLOR_STOP\" TEXT," + // 2: colorStop
"\"FONT_COLOR\" TEXT," + // 3: fontColor
......
package com.gingersoft.gsa.cloud.database.greendao;
import java.util.List;
import java.util.ArrayList;
import android.database.Cursor;
import android.database.sqlite.SQLiteStatement;
import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.Property;
import org.greenrobot.greendao.internal.SqlUtils;
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;
import com.gingersoft.gsa.cloud.database.bean.Food;
// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
......@@ -93,6 +98,8 @@ public class FoodDao extends AbstractDao<Food, Long> {
public final static Property ColorId = new Property(66, long.class, "colorId", false, "COLOR_ID");
}
private DaoSession daoSession;
public FoodDao(DaoConfig config) {
super(config);
......@@ -100,6 +107,7 @@ public class FoodDao extends AbstractDao<Food, Long> {
public FoodDao(DaoConfig config, DaoSession daoSession) {
super(config, daoSession);
this.daoSession = daoSession;
}
/** Creates the underlying database table. */
......@@ -470,6 +478,12 @@ public class FoodDao extends AbstractDao<Food, Long> {
}
@Override
protected final void attachEntity(Food entity) {
super.attachEntity(entity);
entity.__setDaoSession(daoSession);
}
@Override
public Long readKey(Cursor cursor, int offset) {
return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0);
}
......@@ -644,4 +658,97 @@ public class FoodDao extends AbstractDao<Food, Long> {
return true;
}
private String selectDeep;
protected String getSelectDeep() {
if (selectDeep == null) {
StringBuilder builder = new StringBuilder("SELECT ");
SqlUtils.appendColumns(builder, "T", getAllColumns());
builder.append(',');
SqlUtils.appendColumns(builder, "T0", daoSession.getColorBeanDao().getAllColumns());
builder.append(" FROM FOOD T");
builder.append(" LEFT JOIN COLOR_BEAN T0 ON T.\"COLOR_ID\"=T0.\"_id\"");
builder.append(' ');
selectDeep = builder.toString();
}
return selectDeep;
}
protected Food loadCurrentDeep(Cursor cursor, boolean lock) {
Food entity = loadCurrent(cursor, 0, lock);
int offset = getAllColumns().length;
ColorBean colorBean = loadCurrentOther(daoSession.getColorBeanDao(), cursor, offset);
if(colorBean != null) {
entity.setColorBean(colorBean);
}
return entity;
}
public Food loadDeep(Long key) {
assertSinglePk();
if (key == null) {
return null;
}
StringBuilder builder = new StringBuilder(getSelectDeep());
builder.append("WHERE ");
SqlUtils.appendColumnsEqValue(builder, "T", getPkColumns());
String sql = builder.toString();
String[] keyArray = new String[] { key.toString() };
Cursor cursor = db.rawQuery(sql, keyArray);
try {
boolean available = cursor.moveToFirst();
if (!available) {
return null;
} else if (!cursor.isLast()) {
throw new IllegalStateException("Expected unique result, but count was " + cursor.getCount());
}
return loadCurrentDeep(cursor, true);
} finally {
cursor.close();
}
}
/** Reads all available rows from the given cursor and returns a list of new ImageTO objects. */
public List<Food> loadAllDeepFromCursor(Cursor cursor) {
int count = cursor.getCount();
List<Food> list = new ArrayList<Food>(count);
if (cursor.moveToFirst()) {
if (identityScope != null) {
identityScope.lock();
identityScope.reserveRoom(count);
}
try {
do {
list.add(loadCurrentDeep(cursor, false));
} while (cursor.moveToNext());
} finally {
if (identityScope != null) {
identityScope.unlock();
}
}
}
return list;
}
protected List<Food> loadDeepAllAndCloseCursor(Cursor cursor) {
try {
return loadAllDeepFromCursor(cursor);
} finally {
cursor.close();
}
}
/** A raw-style query where you can pass any WHERE clause and arguments. */
public List<Food> queryDeep(String where, String... selectionArg) {
Cursor cursor = db.rawQuery(getSelectDeep() + where, selectionArg);
return loadDeepAllAndCloseCursor(cursor);
}
}
package com.gingersoft.gsa.cloud.database.greendao;
import java.util.List;
import java.util.ArrayList;
import android.database.Cursor;
import android.database.sqlite.SQLiteStatement;
import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.Property;
import org.greenrobot.greendao.internal.SqlUtils;
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;
import com.gingersoft.gsa.cloud.database.bean.Modifier;
// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
......@@ -33,47 +38,49 @@ public class ModifierDao extends AbstractDao<Modifier, Long> {
public final static Property MarketPrice = new Property(6, double.class, "marketPrice", false, "MARKET_PRICE");
public final static Property Price = new Property(7, double.class, "price", false, "PRICE");
public final static Property LunchboxPrice = new Property(8, double.class, "lunchboxPrice", false, "LUNCHBOX_PRICE");
public final static Property ColorId = new Property(9, long.class, "colorId", false, "COLOR_ID");
public final static Property ImageUrl = new Property(10, String.class, "imageUrl", false, "IMAGE_URL");
public final static Property Invisible = new Property(11, long.class, "invisible", false, "INVISIBLE");
public final static Property Cost = new Property(12, double.class, "cost", false, "COST");
public final static Property StartDate = new Property(13, java.util.Date.class, "startDate", false, "START_DATE");
public final static Property EndDate = new Property(14, java.util.Date.class, "endDate", false, "END_DATE");
public final static Property Like = new Property(15, long.class, "like", false, "LIKE");
public final static Property TotalSold = new Property(16, long.class, "totalSold", false, "TOTAL_SOLD");
public final static Property MajorMainId = new Property(17, long.class, "majorMainId", false, "MAJOR_MAIN_ID");
public final static Property DeptId = new Property(18, long.class, "deptId", false, "DEPT_ID");
public final static Property CreateBy = new Property(19, String.class, "createBy", false, "CREATE_BY");
public final static Property CreateTime = new Property(20, java.util.Date.class, "createTime", false, "CREATE_TIME");
public final static Property UpdateBy = new Property(21, String.class, "updateBy", false, "UPDATE_BY");
public final static Property UpdateTime = new Property(22, java.util.Date.class, "updateTime", false, "UPDATE_TIME");
public final static Property PosFid = new Property(23, String.class, "posFid", false, "POS_FID");
public final static Property PId = new Property(24, String.class, "pId", false, "P_ID");
public final static Property AutoMod = new Property(25, long.class, "autoMod", false, "AUTO_MOD");
public final static Property BlueEdit = new Property(26, long.class, "blueEdit", false, "BLUE_EDIT");
public final static Property AutoMerge = new Property(27, long.class, "autoMerge", false, "AUTO_MERGE");
public final static Property CustomMsg = new Property(28, long.class, "customMsg", false, "CUSTOM_MSG");
public final static Property IsParent = new Property(29, long.class, "isParent", false, "IS_PARENT");
public final static Property ModifierName1 = new Property(30, String.class, "modifierName1", false, "MODIFIER_NAME1");
public final static Property ModifierName2 = new Property(31, String.class, "modifierName2", false, "MODIFIER_NAME2");
public final static Property Multiple = new Property(32, double.class, "multiple", false, "MULTIPLE");
public final static Property PrintSet = new Property(33, String.class, "printSet", false, "PRINT_SET");
public final static Property KtSetting = new Property(34, String.class, "ktSetting", false, "KT_SETTING");
public final static Property ModComm = new Property(35, long.class, "modComm", false, "MOD_COMM");
public final static Property ModTaste = new Property(36, long.class, "modTaste", false, "MOD_TASTE");
public final static Property ModMsg = new Property(37, long.class, "modMsg", false, "MOD_MSG");
public final static Property KtFireCourse = new Property(38, long.class, "ktFireCourse", false, "KT_FIRE_COURSE");
public final static Property AbleDisCount = new Property(39, long.class, "ableDisCount", false, "ABLE_DIS_COUNT");
public final static Property PrintToBill = new Property(40, long.class, "printToBill", false, "PRINT_TO_BILL");
public final static Property KtPrintMainItem = new Property(41, long.class, "ktPrintMainItem", false, "KT_PRINT_MAIN_ITEM");
public final static Property KtShowPrice = new Property(42, long.class, "ktShowPrice", false, "KT_SHOW_PRICE");
public final static Property KtFont = new Property(43, long.class, "ktFont", false, "KT_FONT");
public final static Property Conditions = new Property(44, long.class, "conditions", false, "CONDITIONS");
public final static Property IsRt = new Property(45, long.class, "isRt", false, "IS_RT");
public final static Property Visible = new Property(46, byte.class, "visible", false, "VISIBLE");
public final static Property Deletes = new Property(47, long.class, "deletes", false, "DELETES");
public final static Property IsStatistic = new Property(48, long.class, "isStatistic", false, "IS_STATISTIC");
}
public final static Property ImageUrl = new Property(9, String.class, "imageUrl", false, "IMAGE_URL");
public final static Property Invisible = new Property(10, long.class, "invisible", false, "INVISIBLE");
public final static Property Cost = new Property(11, double.class, "cost", false, "COST");
public final static Property StartDate = new Property(12, java.util.Date.class, "startDate", false, "START_DATE");
public final static Property EndDate = new Property(13, java.util.Date.class, "endDate", false, "END_DATE");
public final static Property Like = new Property(14, long.class, "like", false, "LIKE");
public final static Property TotalSold = new Property(15, long.class, "totalSold", false, "TOTAL_SOLD");
public final static Property MajorMainId = new Property(16, long.class, "majorMainId", false, "MAJOR_MAIN_ID");
public final static Property DeptId = new Property(17, long.class, "deptId", false, "DEPT_ID");
public final static Property CreateBy = new Property(18, String.class, "createBy", false, "CREATE_BY");
public final static Property CreateTime = new Property(19, java.util.Date.class, "createTime", false, "CREATE_TIME");
public final static Property UpdateBy = new Property(20, String.class, "updateBy", false, "UPDATE_BY");
public final static Property UpdateTime = new Property(21, java.util.Date.class, "updateTime", false, "UPDATE_TIME");
public final static Property PosFid = new Property(22, String.class, "posFid", false, "POS_FID");
public final static Property PId = new Property(23, String.class, "pId", false, "P_ID");
public final static Property AutoMod = new Property(24, long.class, "autoMod", false, "AUTO_MOD");
public final static Property BlueEdit = new Property(25, long.class, "blueEdit", false, "BLUE_EDIT");
public final static Property AutoMerge = new Property(26, long.class, "autoMerge", false, "AUTO_MERGE");
public final static Property CustomMsg = new Property(27, long.class, "customMsg", false, "CUSTOM_MSG");
public final static Property IsParent = new Property(28, long.class, "isParent", false, "IS_PARENT");
public final static Property ModifierName1 = new Property(29, String.class, "modifierName1", false, "MODIFIER_NAME1");
public final static Property ModifierName2 = new Property(30, String.class, "modifierName2", false, "MODIFIER_NAME2");
public final static Property Multiple = new Property(31, double.class, "multiple", false, "MULTIPLE");
public final static Property PrintSet = new Property(32, String.class, "printSet", false, "PRINT_SET");
public final static Property KtSetting = new Property(33, String.class, "ktSetting", false, "KT_SETTING");
public final static Property ModComm = new Property(34, long.class, "modComm", false, "MOD_COMM");
public final static Property ModTaste = new Property(35, long.class, "modTaste", false, "MOD_TASTE");
public final static Property ModMsg = new Property(36, long.class, "modMsg", false, "MOD_MSG");
public final static Property KtFireCourse = new Property(37, long.class, "ktFireCourse", false, "KT_FIRE_COURSE");
public final static Property AbleDisCount = new Property(38, long.class, "ableDisCount", false, "ABLE_DIS_COUNT");
public final static Property PrintToBill = new Property(39, long.class, "printToBill", false, "PRINT_TO_BILL");
public final static Property KtPrintMainItem = new Property(40, long.class, "ktPrintMainItem", false, "KT_PRINT_MAIN_ITEM");
public final static Property KtShowPrice = new Property(41, long.class, "ktShowPrice", false, "KT_SHOW_PRICE");
public final static Property KtFont = new Property(42, long.class, "ktFont", false, "KT_FONT");
public final static Property Conditions = new Property(43, long.class, "conditions", false, "CONDITIONS");
public final static Property IsRt = new Property(44, long.class, "isRt", false, "IS_RT");
public final static Property Visible = new Property(45, byte.class, "visible", false, "VISIBLE");
public final static Property Deletes = new Property(46, long.class, "deletes", false, "DELETES");
public final static Property IsStatistic = new Property(47, long.class, "isStatistic", false, "IS_STATISTIC");
public final static Property ColorId = new Property(48, long.class, "colorId", false, "COLOR_ID");
}
private DaoSession daoSession;
public ModifierDao(DaoConfig config) {
......@@ -82,6 +89,7 @@ public class ModifierDao extends AbstractDao<Modifier, Long> {
public ModifierDao(DaoConfig config, DaoSession daoSession) {
super(config, daoSession);
this.daoSession = daoSession;
}
/** Creates the underlying database table. */
......@@ -97,46 +105,46 @@ public class ModifierDao extends AbstractDao<Modifier, Long> {
"\"MARKET_PRICE\" REAL NOT NULL ," + // 6: marketPrice
"\"PRICE\" REAL NOT NULL ," + // 7: price
"\"LUNCHBOX_PRICE\" REAL NOT NULL ," + // 8: lunchboxPrice
"\"COLOR_ID\" INTEGER NOT NULL ," + // 9: colorId
"\"IMAGE_URL\" TEXT," + // 10: imageUrl
"\"INVISIBLE\" INTEGER NOT NULL ," + // 11: invisible
"\"COST\" REAL NOT NULL ," + // 12: cost
"\"START_DATE\" INTEGER," + // 13: startDate
"\"END_DATE\" INTEGER," + // 14: endDate
"\"LIKE\" INTEGER NOT NULL ," + // 15: like
"\"TOTAL_SOLD\" INTEGER NOT NULL ," + // 16: totalSold
"\"MAJOR_MAIN_ID\" INTEGER NOT NULL ," + // 17: majorMainId
"\"DEPT_ID\" INTEGER NOT NULL ," + // 18: deptId
"\"CREATE_BY\" TEXT," + // 19: createBy
"\"CREATE_TIME\" INTEGER," + // 20: createTime
"\"UPDATE_BY\" TEXT," + // 21: updateBy
"\"UPDATE_TIME\" INTEGER," + // 22: updateTime
"\"POS_FID\" TEXT," + // 23: posFid
"\"P_ID\" TEXT," + // 24: pId
"\"AUTO_MOD\" INTEGER NOT NULL ," + // 25: autoMod
"\"BLUE_EDIT\" INTEGER NOT NULL ," + // 26: blueEdit
"\"AUTO_MERGE\" INTEGER NOT NULL ," + // 27: autoMerge
"\"CUSTOM_MSG\" INTEGER NOT NULL ," + // 28: customMsg
"\"IS_PARENT\" INTEGER NOT NULL ," + // 29: isParent
"\"MODIFIER_NAME1\" TEXT," + // 30: modifierName1
"\"MODIFIER_NAME2\" TEXT," + // 31: modifierName2
"\"MULTIPLE\" REAL NOT NULL ," + // 32: multiple
"\"PRINT_SET\" TEXT," + // 33: printSet
"\"KT_SETTING\" TEXT," + // 34: ktSetting
"\"MOD_COMM\" INTEGER NOT NULL ," + // 35: modComm
"\"MOD_TASTE\" INTEGER NOT NULL ," + // 36: modTaste
"\"MOD_MSG\" INTEGER NOT NULL ," + // 37: modMsg
"\"KT_FIRE_COURSE\" INTEGER NOT NULL ," + // 38: ktFireCourse
"\"ABLE_DIS_COUNT\" INTEGER NOT NULL ," + // 39: ableDisCount
"\"PRINT_TO_BILL\" INTEGER NOT NULL ," + // 40: printToBill
"\"KT_PRINT_MAIN_ITEM\" INTEGER NOT NULL ," + // 41: ktPrintMainItem
"\"KT_SHOW_PRICE\" INTEGER NOT NULL ," + // 42: ktShowPrice
"\"KT_FONT\" INTEGER NOT NULL ," + // 43: ktFont
"\"CONDITIONS\" INTEGER NOT NULL ," + // 44: conditions
"\"IS_RT\" INTEGER NOT NULL ," + // 45: isRt
"\"VISIBLE\" INTEGER NOT NULL ," + // 46: visible
"\"DELETES\" INTEGER NOT NULL ," + // 47: deletes
"\"IS_STATISTIC\" INTEGER NOT NULL );"); // 48: isStatistic
"\"IMAGE_URL\" TEXT," + // 9: imageUrl
"\"INVISIBLE\" INTEGER NOT NULL ," + // 10: invisible
"\"COST\" REAL NOT NULL ," + // 11: cost
"\"START_DATE\" INTEGER," + // 12: startDate
"\"END_DATE\" INTEGER," + // 13: endDate
"\"LIKE\" INTEGER NOT NULL ," + // 14: like
"\"TOTAL_SOLD\" INTEGER NOT NULL ," + // 15: totalSold
"\"MAJOR_MAIN_ID\" INTEGER NOT NULL ," + // 16: majorMainId
"\"DEPT_ID\" INTEGER NOT NULL ," + // 17: deptId
"\"CREATE_BY\" TEXT," + // 18: createBy
"\"CREATE_TIME\" INTEGER," + // 19: createTime
"\"UPDATE_BY\" TEXT," + // 20: updateBy
"\"UPDATE_TIME\" INTEGER," + // 21: updateTime
"\"POS_FID\" TEXT," + // 22: posFid
"\"P_ID\" TEXT," + // 23: pId
"\"AUTO_MOD\" INTEGER NOT NULL ," + // 24: autoMod
"\"BLUE_EDIT\" INTEGER NOT NULL ," + // 25: blueEdit
"\"AUTO_MERGE\" INTEGER NOT NULL ," + // 26: autoMerge
"\"CUSTOM_MSG\" INTEGER NOT NULL ," + // 27: customMsg
"\"IS_PARENT\" INTEGER NOT NULL ," + // 28: isParent
"\"MODIFIER_NAME1\" TEXT," + // 29: modifierName1
"\"MODIFIER_NAME2\" TEXT," + // 30: modifierName2
"\"MULTIPLE\" REAL NOT NULL ," + // 31: multiple
"\"PRINT_SET\" TEXT," + // 32: printSet
"\"KT_SETTING\" TEXT," + // 33: ktSetting
"\"MOD_COMM\" INTEGER NOT NULL ," + // 34: modComm
"\"MOD_TASTE\" INTEGER NOT NULL ," + // 35: modTaste
"\"MOD_MSG\" INTEGER NOT NULL ," + // 36: modMsg
"\"KT_FIRE_COURSE\" INTEGER NOT NULL ," + // 37: ktFireCourse
"\"ABLE_DIS_COUNT\" INTEGER NOT NULL ," + // 38: ableDisCount
"\"PRINT_TO_BILL\" INTEGER NOT NULL ," + // 39: printToBill
"\"KT_PRINT_MAIN_ITEM\" INTEGER NOT NULL ," + // 40: ktPrintMainItem
"\"KT_SHOW_PRICE\" INTEGER NOT NULL ," + // 41: ktShowPrice
"\"KT_FONT\" INTEGER NOT NULL ," + // 42: ktFont
"\"CONDITIONS\" INTEGER NOT NULL ," + // 43: conditions
"\"IS_RT\" INTEGER NOT NULL ," + // 44: isRt
"\"VISIBLE\" INTEGER NOT NULL ," + // 45: visible
"\"DELETES\" INTEGER NOT NULL ," + // 46: deletes
"\"IS_STATISTIC\" INTEGER NOT NULL ," + // 47: isStatistic
"\"COLOR_ID\" INTEGER NOT NULL );"); // 48: colorId
}
/** Drops the underlying database table. */
......@@ -165,98 +173,98 @@ public class ModifierDao extends AbstractDao<Modifier, Long> {
stmt.bindDouble(7, entity.getMarketPrice());
stmt.bindDouble(8, entity.getPrice());
stmt.bindDouble(9, entity.getLunchboxPrice());
stmt.bindLong(10, entity.getColorId());
String imageUrl = entity.getImageUrl();
if (imageUrl != null) {
stmt.bindString(11, imageUrl);
stmt.bindString(10, imageUrl);
}
stmt.bindLong(12, entity.getInvisible());
stmt.bindDouble(13, entity.getCost());
stmt.bindLong(11, entity.getInvisible());
stmt.bindDouble(12, entity.getCost());
java.util.Date startDate = entity.getStartDate();
if (startDate != null) {
stmt.bindLong(14, startDate.getTime());
stmt.bindLong(13, startDate.getTime());
}
java.util.Date endDate = entity.getEndDate();
if (endDate != null) {
stmt.bindLong(15, endDate.getTime());
stmt.bindLong(14, endDate.getTime());
}
stmt.bindLong(16, entity.getLike());
stmt.bindLong(17, entity.getTotalSold());
stmt.bindLong(18, entity.getMajorMainId());
stmt.bindLong(19, entity.getDeptId());
stmt.bindLong(15, entity.getLike());
stmt.bindLong(16, entity.getTotalSold());
stmt.bindLong(17, entity.getMajorMainId());
stmt.bindLong(18, entity.getDeptId());
String createBy = entity.getCreateBy();
if (createBy != null) {
stmt.bindString(20, createBy);
stmt.bindString(19, createBy);
}
java.util.Date createTime = entity.getCreateTime();
if (createTime != null) {
stmt.bindLong(21, createTime.getTime());
stmt.bindLong(20, createTime.getTime());
}
String updateBy = entity.getUpdateBy();
if (updateBy != null) {
stmt.bindString(22, updateBy);
stmt.bindString(21, updateBy);
}
java.util.Date updateTime = entity.getUpdateTime();
if (updateTime != null) {
stmt.bindLong(23, updateTime.getTime());
stmt.bindLong(22, updateTime.getTime());
}
String posFid = entity.getPosFid();
if (posFid != null) {
stmt.bindString(24, posFid);
stmt.bindString(23, posFid);
}
String pId = entity.getPId();
if (pId != null) {
stmt.bindString(25, pId);
stmt.bindString(24, pId);
}
stmt.bindLong(26, entity.getAutoMod());
stmt.bindLong(27, entity.getBlueEdit());
stmt.bindLong(28, entity.getAutoMerge());
stmt.bindLong(29, entity.getCustomMsg());
stmt.bindLong(30, entity.getIsParent());
stmt.bindLong(25, entity.getAutoMod());
stmt.bindLong(26, entity.getBlueEdit());
stmt.bindLong(27, entity.getAutoMerge());
stmt.bindLong(28, entity.getCustomMsg());
stmt.bindLong(29, entity.getIsParent());
String modifierName1 = entity.getModifierName1();
if (modifierName1 != null) {
stmt.bindString(31, modifierName1);
stmt.bindString(30, modifierName1);
}
String modifierName2 = entity.getModifierName2();
if (modifierName2 != null) {
stmt.bindString(32, modifierName2);
stmt.bindString(31, modifierName2);
}
stmt.bindDouble(33, entity.getMultiple());
stmt.bindDouble(32, entity.getMultiple());
String printSet = entity.getPrintSet();
if (printSet != null) {
stmt.bindString(34, printSet);
stmt.bindString(33, printSet);
}
String ktSetting = entity.getKtSetting();
if (ktSetting != null) {
stmt.bindString(35, ktSetting);
}
stmt.bindLong(36, entity.getModComm());
stmt.bindLong(37, entity.getModTaste());
stmt.bindLong(38, entity.getModMsg());
stmt.bindLong(39, entity.getKtFireCourse());
stmt.bindLong(40, entity.getAbleDisCount());
stmt.bindLong(41, entity.getPrintToBill());
stmt.bindLong(42, entity.getKtPrintMainItem());
stmt.bindLong(43, entity.getKtShowPrice());
stmt.bindLong(44, entity.getKtFont());
stmt.bindLong(45, entity.getConditions());
stmt.bindLong(46, entity.getIsRt());
stmt.bindLong(47, entity.getVisible());
stmt.bindLong(48, entity.getDeletes());
stmt.bindLong(49, entity.getIsStatistic());
stmt.bindString(34, ktSetting);
}
stmt.bindLong(35, entity.getModComm());
stmt.bindLong(36, entity.getModTaste());
stmt.bindLong(37, entity.getModMsg());
stmt.bindLong(38, entity.getKtFireCourse());
stmt.bindLong(39, entity.getAbleDisCount());
stmt.bindLong(40, entity.getPrintToBill());
stmt.bindLong(41, entity.getKtPrintMainItem());
stmt.bindLong(42, entity.getKtShowPrice());
stmt.bindLong(43, entity.getKtFont());
stmt.bindLong(44, entity.getConditions());
stmt.bindLong(45, entity.getIsRt());
stmt.bindLong(46, entity.getVisible());
stmt.bindLong(47, entity.getDeletes());
stmt.bindLong(48, entity.getIsStatistic());
stmt.bindLong(49, entity.getColorId());
}
@Override
......@@ -279,98 +287,104 @@ public class ModifierDao extends AbstractDao<Modifier, Long> {
stmt.bindDouble(7, entity.getMarketPrice());
stmt.bindDouble(8, entity.getPrice());
stmt.bindDouble(9, entity.getLunchboxPrice());
stmt.bindLong(10, entity.getColorId());
String imageUrl = entity.getImageUrl();
if (imageUrl != null) {
stmt.bindString(11, imageUrl);
stmt.bindString(10, imageUrl);
}
stmt.bindLong(12, entity.getInvisible());
stmt.bindDouble(13, entity.getCost());
stmt.bindLong(11, entity.getInvisible());
stmt.bindDouble(12, entity.getCost());
java.util.Date startDate = entity.getStartDate();
if (startDate != null) {
stmt.bindLong(14, startDate.getTime());
stmt.bindLong(13, startDate.getTime());
}
java.util.Date endDate = entity.getEndDate();
if (endDate != null) {
stmt.bindLong(15, endDate.getTime());
stmt.bindLong(14, endDate.getTime());
}
stmt.bindLong(16, entity.getLike());
stmt.bindLong(17, entity.getTotalSold());
stmt.bindLong(18, entity.getMajorMainId());
stmt.bindLong(19, entity.getDeptId());
stmt.bindLong(15, entity.getLike());
stmt.bindLong(16, entity.getTotalSold());
stmt.bindLong(17, entity.getMajorMainId());
stmt.bindLong(18, entity.getDeptId());
String createBy = entity.getCreateBy();
if (createBy != null) {
stmt.bindString(20, createBy);
stmt.bindString(19, createBy);
}
java.util.Date createTime = entity.getCreateTime();
if (createTime != null) {
stmt.bindLong(21, createTime.getTime());
stmt.bindLong(20, createTime.getTime());
}
String updateBy = entity.getUpdateBy();
if (updateBy != null) {
stmt.bindString(22, updateBy);
stmt.bindString(21, updateBy);
}
java.util.Date updateTime = entity.getUpdateTime();
if (updateTime != null) {
stmt.bindLong(23, updateTime.getTime());
stmt.bindLong(22, updateTime.getTime());
}
String posFid = entity.getPosFid();
if (posFid != null) {
stmt.bindString(24, posFid);
stmt.bindString(23, posFid);
}
String pId = entity.getPId();
if (pId != null) {
stmt.bindString(25, pId);
stmt.bindString(24, pId);
}
stmt.bindLong(26, entity.getAutoMod());
stmt.bindLong(27, entity.getBlueEdit());
stmt.bindLong(28, entity.getAutoMerge());
stmt.bindLong(29, entity.getCustomMsg());
stmt.bindLong(30, entity.getIsParent());
stmt.bindLong(25, entity.getAutoMod());
stmt.bindLong(26, entity.getBlueEdit());
stmt.bindLong(27, entity.getAutoMerge());
stmt.bindLong(28, entity.getCustomMsg());
stmt.bindLong(29, entity.getIsParent());
String modifierName1 = entity.getModifierName1();
if (modifierName1 != null) {
stmt.bindString(31, modifierName1);
stmt.bindString(30, modifierName1);
}
String modifierName2 = entity.getModifierName2();
if (modifierName2 != null) {
stmt.bindString(32, modifierName2);
stmt.bindString(31, modifierName2);
}
stmt.bindDouble(33, entity.getMultiple());
stmt.bindDouble(32, entity.getMultiple());
String printSet = entity.getPrintSet();
if (printSet != null) {
stmt.bindString(34, printSet);
stmt.bindString(33, printSet);
}
String ktSetting = entity.getKtSetting();
if (ktSetting != null) {
stmt.bindString(35, ktSetting);
}
stmt.bindLong(36, entity.getModComm());
stmt.bindLong(37, entity.getModTaste());
stmt.bindLong(38, entity.getModMsg());
stmt.bindLong(39, entity.getKtFireCourse());
stmt.bindLong(40, entity.getAbleDisCount());
stmt.bindLong(41, entity.getPrintToBill());
stmt.bindLong(42, entity.getKtPrintMainItem());
stmt.bindLong(43, entity.getKtShowPrice());
stmt.bindLong(44, entity.getKtFont());
stmt.bindLong(45, entity.getConditions());
stmt.bindLong(46, entity.getIsRt());
stmt.bindLong(47, entity.getVisible());
stmt.bindLong(48, entity.getDeletes());
stmt.bindLong(49, entity.getIsStatistic());
stmt.bindString(34, ktSetting);
}
stmt.bindLong(35, entity.getModComm());
stmt.bindLong(36, entity.getModTaste());
stmt.bindLong(37, entity.getModMsg());
stmt.bindLong(38, entity.getKtFireCourse());
stmt.bindLong(39, entity.getAbleDisCount());
stmt.bindLong(40, entity.getPrintToBill());
stmt.bindLong(41, entity.getKtPrintMainItem());
stmt.bindLong(42, entity.getKtShowPrice());
stmt.bindLong(43, entity.getKtFont());
stmt.bindLong(44, entity.getConditions());
stmt.bindLong(45, entity.getIsRt());
stmt.bindLong(46, entity.getVisible());
stmt.bindLong(47, entity.getDeletes());
stmt.bindLong(48, entity.getIsStatistic());
stmt.bindLong(49, entity.getColorId());
}
@Override
protected final void attachEntity(Modifier entity) {
super.attachEntity(entity);
entity.__setDaoSession(daoSession);
}
@Override
......@@ -390,46 +404,46 @@ public class ModifierDao extends AbstractDao<Modifier, Long> {
cursor.getDouble(offset + 6), // marketPrice
cursor.getDouble(offset + 7), // price
cursor.getDouble(offset + 8), // lunchboxPrice
cursor.getLong(offset + 9), // colorId
cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // imageUrl
cursor.getLong(offset + 11), // invisible
cursor.getDouble(offset + 12), // cost
cursor.isNull(offset + 13) ? null : new java.util.Date(cursor.getLong(offset + 13)), // startDate
cursor.isNull(offset + 14) ? null : new java.util.Date(cursor.getLong(offset + 14)), // endDate
cursor.getLong(offset + 15), // like
cursor.getLong(offset + 16), // totalSold
cursor.getLong(offset + 17), // majorMainId
cursor.getLong(offset + 18), // deptId
cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // createBy
cursor.isNull(offset + 20) ? null : new java.util.Date(cursor.getLong(offset + 20)), // createTime
cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // updateBy
cursor.isNull(offset + 22) ? null : new java.util.Date(cursor.getLong(offset + 22)), // updateTime
cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // posFid
cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // pId
cursor.getLong(offset + 25), // autoMod
cursor.getLong(offset + 26), // blueEdit
cursor.getLong(offset + 27), // autoMerge
cursor.getLong(offset + 28), // customMsg
cursor.getLong(offset + 29), // isParent
cursor.isNull(offset + 30) ? null : cursor.getString(offset + 30), // modifierName1
cursor.isNull(offset + 31) ? null : cursor.getString(offset + 31), // modifierName2
cursor.getDouble(offset + 32), // multiple
cursor.isNull(offset + 33) ? null : cursor.getString(offset + 33), // printSet
cursor.isNull(offset + 34) ? null : cursor.getString(offset + 34), // ktSetting
cursor.getLong(offset + 35), // modComm
cursor.getLong(offset + 36), // modTaste
cursor.getLong(offset + 37), // modMsg
cursor.getLong(offset + 38), // ktFireCourse
cursor.getLong(offset + 39), // ableDisCount
cursor.getLong(offset + 40), // printToBill
cursor.getLong(offset + 41), // ktPrintMainItem
cursor.getLong(offset + 42), // ktShowPrice
cursor.getLong(offset + 43), // ktFont
cursor.getLong(offset + 44), // conditions
cursor.getLong(offset + 45), // isRt
(byte) cursor.getShort(offset + 46), // visible
cursor.getLong(offset + 47), // deletes
cursor.getLong(offset + 48) // isStatistic
cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // imageUrl
cursor.getLong(offset + 10), // invisible
cursor.getDouble(offset + 11), // cost
cursor.isNull(offset + 12) ? null : new java.util.Date(cursor.getLong(offset + 12)), // startDate
cursor.isNull(offset + 13) ? null : new java.util.Date(cursor.getLong(offset + 13)), // endDate
cursor.getLong(offset + 14), // like
cursor.getLong(offset + 15), // totalSold
cursor.getLong(offset + 16), // majorMainId
cursor.getLong(offset + 17), // deptId
cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // createBy
cursor.isNull(offset + 19) ? null : new java.util.Date(cursor.getLong(offset + 19)), // createTime
cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // updateBy
cursor.isNull(offset + 21) ? null : new java.util.Date(cursor.getLong(offset + 21)), // updateTime
cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // posFid
cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // pId
cursor.getLong(offset + 24), // autoMod
cursor.getLong(offset + 25), // blueEdit
cursor.getLong(offset + 26), // autoMerge
cursor.getLong(offset + 27), // customMsg
cursor.getLong(offset + 28), // isParent
cursor.isNull(offset + 29) ? null : cursor.getString(offset + 29), // modifierName1
cursor.isNull(offset + 30) ? null : cursor.getString(offset + 30), // modifierName2
cursor.getDouble(offset + 31), // multiple
cursor.isNull(offset + 32) ? null : cursor.getString(offset + 32), // printSet
cursor.isNull(offset + 33) ? null : cursor.getString(offset + 33), // ktSetting
cursor.getLong(offset + 34), // modComm
cursor.getLong(offset + 35), // modTaste
cursor.getLong(offset + 36), // modMsg
cursor.getLong(offset + 37), // ktFireCourse
cursor.getLong(offset + 38), // ableDisCount
cursor.getLong(offset + 39), // printToBill
cursor.getLong(offset + 40), // ktPrintMainItem
cursor.getLong(offset + 41), // ktShowPrice
cursor.getLong(offset + 42), // ktFont
cursor.getLong(offset + 43), // conditions
cursor.getLong(offset + 44), // isRt
(byte) cursor.getShort(offset + 45), // visible
cursor.getLong(offset + 46), // deletes
cursor.getLong(offset + 47), // isStatistic
cursor.getLong(offset + 48) // colorId
);
return entity;
}
......@@ -445,46 +459,46 @@ public class ModifierDao extends AbstractDao<Modifier, Long> {
entity.setMarketPrice(cursor.getDouble(offset + 6));
entity.setPrice(cursor.getDouble(offset + 7));
entity.setLunchboxPrice(cursor.getDouble(offset + 8));
entity.setColorId(cursor.getLong(offset + 9));
entity.setImageUrl(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10));
entity.setInvisible(cursor.getLong(offset + 11));
entity.setCost(cursor.getDouble(offset + 12));
entity.setStartDate(cursor.isNull(offset + 13) ? null : new java.util.Date(cursor.getLong(offset + 13)));
entity.setEndDate(cursor.isNull(offset + 14) ? null : new java.util.Date(cursor.getLong(offset + 14)));
entity.setLike(cursor.getLong(offset + 15));
entity.setTotalSold(cursor.getLong(offset + 16));
entity.setMajorMainId(cursor.getLong(offset + 17));
entity.setDeptId(cursor.getLong(offset + 18));
entity.setCreateBy(cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19));
entity.setCreateTime(cursor.isNull(offset + 20) ? null : new java.util.Date(cursor.getLong(offset + 20)));
entity.setUpdateBy(cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21));
entity.setUpdateTime(cursor.isNull(offset + 22) ? null : new java.util.Date(cursor.getLong(offset + 22)));
entity.setPosFid(cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23));
entity.setPId(cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24));
entity.setAutoMod(cursor.getLong(offset + 25));
entity.setBlueEdit(cursor.getLong(offset + 26));
entity.setAutoMerge(cursor.getLong(offset + 27));
entity.setCustomMsg(cursor.getLong(offset + 28));
entity.setIsParent(cursor.getLong(offset + 29));
entity.setModifierName1(cursor.isNull(offset + 30) ? null : cursor.getString(offset + 30));
entity.setModifierName2(cursor.isNull(offset + 31) ? null : cursor.getString(offset + 31));
entity.setMultiple(cursor.getDouble(offset + 32));
entity.setPrintSet(cursor.isNull(offset + 33) ? null : cursor.getString(offset + 33));
entity.setKtSetting(cursor.isNull(offset + 34) ? null : cursor.getString(offset + 34));
entity.setModComm(cursor.getLong(offset + 35));
entity.setModTaste(cursor.getLong(offset + 36));
entity.setModMsg(cursor.getLong(offset + 37));
entity.setKtFireCourse(cursor.getLong(offset + 38));
entity.setAbleDisCount(cursor.getLong(offset + 39));
entity.setPrintToBill(cursor.getLong(offset + 40));
entity.setKtPrintMainItem(cursor.getLong(offset + 41));
entity.setKtShowPrice(cursor.getLong(offset + 42));
entity.setKtFont(cursor.getLong(offset + 43));
entity.setConditions(cursor.getLong(offset + 44));
entity.setIsRt(cursor.getLong(offset + 45));
entity.setVisible((byte) cursor.getShort(offset + 46));
entity.setDeletes(cursor.getLong(offset + 47));
entity.setIsStatistic(cursor.getLong(offset + 48));
entity.setImageUrl(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9));
entity.setInvisible(cursor.getLong(offset + 10));
entity.setCost(cursor.getDouble(offset + 11));
entity.setStartDate(cursor.isNull(offset + 12) ? null : new java.util.Date(cursor.getLong(offset + 12)));
entity.setEndDate(cursor.isNull(offset + 13) ? null : new java.util.Date(cursor.getLong(offset + 13)));
entity.setLike(cursor.getLong(offset + 14));
entity.setTotalSold(cursor.getLong(offset + 15));
entity.setMajorMainId(cursor.getLong(offset + 16));
entity.setDeptId(cursor.getLong(offset + 17));
entity.setCreateBy(cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18));
entity.setCreateTime(cursor.isNull(offset + 19) ? null : new java.util.Date(cursor.getLong(offset + 19)));
entity.setUpdateBy(cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20));
entity.setUpdateTime(cursor.isNull(offset + 21) ? null : new java.util.Date(cursor.getLong(offset + 21)));
entity.setPosFid(cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22));
entity.setPId(cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23));
entity.setAutoMod(cursor.getLong(offset + 24));
entity.setBlueEdit(cursor.getLong(offset + 25));
entity.setAutoMerge(cursor.getLong(offset + 26));
entity.setCustomMsg(cursor.getLong(offset + 27));
entity.setIsParent(cursor.getLong(offset + 28));
entity.setModifierName1(cursor.isNull(offset + 29) ? null : cursor.getString(offset + 29));
entity.setModifierName2(cursor.isNull(offset + 30) ? null : cursor.getString(offset + 30));
entity.setMultiple(cursor.getDouble(offset + 31));
entity.setPrintSet(cursor.isNull(offset + 32) ? null : cursor.getString(offset + 32));
entity.setKtSetting(cursor.isNull(offset + 33) ? null : cursor.getString(offset + 33));
entity.setModComm(cursor.getLong(offset + 34));
entity.setModTaste(cursor.getLong(offset + 35));
entity.setModMsg(cursor.getLong(offset + 36));
entity.setKtFireCourse(cursor.getLong(offset + 37));
entity.setAbleDisCount(cursor.getLong(offset + 38));
entity.setPrintToBill(cursor.getLong(offset + 39));
entity.setKtPrintMainItem(cursor.getLong(offset + 40));
entity.setKtShowPrice(cursor.getLong(offset + 41));
entity.setKtFont(cursor.getLong(offset + 42));
entity.setConditions(cursor.getLong(offset + 43));
entity.setIsRt(cursor.getLong(offset + 44));
entity.setVisible((byte) cursor.getShort(offset + 45));
entity.setDeletes(cursor.getLong(offset + 46));
entity.setIsStatistic(cursor.getLong(offset + 47));
entity.setColorId(cursor.getLong(offset + 48));
}
@Override
......@@ -512,4 +526,97 @@ public class ModifierDao extends AbstractDao<Modifier, Long> {
return true;
}
private String selectDeep;
protected String getSelectDeep() {
if (selectDeep == null) {
StringBuilder builder = new StringBuilder("SELECT ");
SqlUtils.appendColumns(builder, "T", getAllColumns());
builder.append(',');
SqlUtils.appendColumns(builder, "T0", daoSession.getColorBeanDao().getAllColumns());
builder.append(" FROM MODIFIER T");
builder.append(" LEFT JOIN COLOR_BEAN T0 ON T.\"COLOR_ID\"=T0.\"_id\"");
builder.append(' ');
selectDeep = builder.toString();
}
return selectDeep;
}
protected Modifier loadCurrentDeep(Cursor cursor, boolean lock) {
Modifier entity = loadCurrent(cursor, 0, lock);
int offset = getAllColumns().length;
ColorBean colorBean = loadCurrentOther(daoSession.getColorBeanDao(), cursor, offset);
if(colorBean != null) {
entity.setColorBean(colorBean);
}
return entity;
}
public Modifier loadDeep(Long key) {
assertSinglePk();
if (key == null) {
return null;
}
StringBuilder builder = new StringBuilder(getSelectDeep());
builder.append("WHERE ");
SqlUtils.appendColumnsEqValue(builder, "T", getPkColumns());
String sql = builder.toString();
String[] keyArray = new String[] { key.toString() };
Cursor cursor = db.rawQuery(sql, keyArray);
try {
boolean available = cursor.moveToFirst();
if (!available) {
return null;
} else if (!cursor.isLast()) {
throw new IllegalStateException("Expected unique result, but count was " + cursor.getCount());
}
return loadCurrentDeep(cursor, true);
} finally {
cursor.close();
}
}
/** Reads all available rows from the given cursor and returns a list of new ImageTO objects. */
public List<Modifier> loadAllDeepFromCursor(Cursor cursor) {
int count = cursor.getCount();
List<Modifier> list = new ArrayList<Modifier>(count);
if (cursor.moveToFirst()) {
if (identityScope != null) {
identityScope.lock();
identityScope.reserveRoom(count);
}
try {
do {
list.add(loadCurrentDeep(cursor, false));
} while (cursor.moveToNext());
} finally {
if (identityScope != null) {
identityScope.unlock();
}
}
}
return list;
}
protected List<Modifier> loadDeepAllAndCloseCursor(Cursor cursor) {
try {
return loadAllDeepFromCursor(cursor);
} finally {
cursor.close();
}
}
/** A raw-style query where you can pass any WHERE clause and arguments. */
public List<Modifier> queryDeep(String where, String... selectionArg) {
Cursor cursor = db.rawQuery(getSelectDeep() + where, selectionArg);
return loadDeepAllAndCloseCursor(cursor);
}
}
......@@ -2,6 +2,7 @@ package com.gingersoft.gsa.cloud.database.utils;
import android.content.Context;
import android.database.Cursor;
import android.graphics.Color;
import android.text.TextUtils;
import android.util.Log;
......@@ -166,13 +167,15 @@ public class ComboItemDaoUtils {
// sql = "SELECT c.*,f.FOOD_NAME,f.FOOD_NAME1,f.FOOD_NAME2,f.PRICE,f.FOOD_SUMMARY,f.AUTO_MOD,f.PRINT_SETING,f.ABLE_DISCOUNT,SELECT_QTY,DEF_MODIFIER,INVISIBLE,POINTS_ADD,POINTS_RATIO,POINTS_REDEEM,SERVICE_CHARGE,c.DIFF_AMT FROM COMBO_ITEM c join FOOD f on c.FID=f.FID and f.INVISIBLE!=1 and where FOOD_SUMMARY LIKE %s join FOOD_COMBO r on r.COM_ID=c.COM_ID and r.DELETES!=1";
// sql = String.format(sql, foodSummary);
// } else {
sql = "SELECT c.*,f.FOOD_NAME,f.FOOD_NAME1,f.FOOD_NAME2,f.PRICE,f.FOOD_SUMMARY,f.AUTO_MOD,f.PRINT_SETING,f.ABLE_DISCOUNT,SELECT_QTY,DEF_MODIFIER,INVISIBLE,POINTS_ADD,POINTS_RATIO,POINTS_REDEEM,SERVICE_CHARGE,c.DIFF_AMT,c.SEQ_NO FROM COMBO_ITEM c join FOOD f on c.FID=f.FID and f.INVISIBLE!=1 join FOOD_COMBO r on r.COM_ID=c.COM_ID and r.DELETES!=1";
sql = "SELECT c.*,f.FOOD_NAME,f.FOOD_NAME1,f.FOOD_NAME2,f.PRICE,f.FOOD_SUMMARY,f.AUTO_MOD,f.PRINT_SETING,f.ABLE_DISCOUNT,SELECT_QTY,DEF_MODIFIER,INVISIBLE,POINTS_ADD,POINTS_RATIO,POINTS_REDEEM,SERVICE_CHARGE,c.DIFF_AMT,c.SEQ_NO,col.ANDROID_COLOR,col.ANDROID_FONT_COLOR FROM COMBO_ITEM c join FOOD f on c.FID=f.FID and f.INVISIBLE!=1 join FOOD_COMBO r on r.COM_ID=c.COM_ID and r.DELETES!=1 join COLOR_BEAN col on f.COLOR_ID=col._id";
// }
if (fid > 0) {
sql = sql + " where r.FID='" + fid + "' order by c.COM_ID,f.CREATE_TIME desc";
}
Cursor c = mManager.getDaoSession().getFoodDao().getDatabase().rawQuery(sql, null);
Cursor c = null;
try {
c = mManager.getDaoSession().getFoodDao().getDatabase().rawQuery(sql, null);
while (c.moveToNext()) {
ComboItem item = new ComboItem();
item.setFid(c.getLong(c.getColumnIndex("FID")));
......@@ -199,11 +202,27 @@ public class ComboItemDaoUtils {
if (!TextUtils.isEmpty(defmodifier) && !", ".equals(defmodifier)) {
item.setDefmodifier(defmodifier);
}
String backgroupColor = c.getString(c.getColumnIndex("ANDROID_COLOR"));
String fontColor = c.getString(c.getColumnIndex("ANDROID_FONT_COLOR"));
if (!TextUtils.isEmpty(backgroupColor)) {
item.setBgColor(Color.parseColor(backgroupColor));
}
if (!TextUtils.isEmpty(fontColor)) {
item.setFontColor(Color.parseColor(fontColor));
}
// if (item.isVisible()) {
comboItems.add(item);
// }
}
} catch (Exception e) {
if (c != null) {
c.close();
}
} finally {
if (c != null) {
c.close();
}
}
return comboItems;
}
......
......@@ -206,11 +206,14 @@ public class FoodDaoUtils {
public List<Food> queryFoodByQueryBuilder(long parentId, int foodSummary) {
QueryBuilder<Food> queryBuilder = mManager.getDaoSession().queryBuilder(Food.class);
long currentTime = System.currentTimeMillis();
return queryBuilder.where(queryBuilder.and(
// queryBuilder.join(ColorBeanDao.Properties.AndroidColor, Food.class, FoodDao.Properties.ColorId);
queryBuilder.where(queryBuilder.and(
FoodDao.Properties.ParentId.eq(parentId),
FoodDao.Properties.Invisible.notEq(1),
FoodDao.Properties.StartDate.le(currentTime),
FoodDao.Properties.EndDate.ge(currentTime))).orderAsc(FoodDao.Properties.SeqNo).list();
FoodDao.Properties.EndDate.ge(currentTime)));
return queryBuilder.orderAsc(FoodDao.Properties.SeqNo).list();
}
public List<Food> queryAllFoodByQueryBuilder() {
......
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