Commit 0659130c by 宁斌

1、食品刪除接口調整

2、套餐食品沒有跟餐問題
3、食品組邊框調整
parent b5fb8a06
......@@ -27,7 +27,6 @@ dependencies {
implementation 'org.jetbrains:annotations:15.0'
//日誌管理
implementation 'com.elvishew:xlog:1.6.1'
}
//此文件是作为组件化配置的公共gradle脚本文件,在每个组件中都apply此文件,下载到工程根目录后,可以在下方添加一些自己工程中通用的配置
......
......@@ -3,6 +3,7 @@ package com.gingersoft.gsa.cloud.download.mvp.presenter;
import android.app.Application;
import com.billy.cc.core.component.CC;
import com.gingersoft.gsa.cloud.base.application.GsaCloudApplication;
import com.gingersoft.gsa.cloud.base.common.bean.FoodBean;
import com.gingersoft.gsa.cloud.database.bean.Combo;
import com.gingersoft.gsa.cloud.database.bean.Food;
......@@ -110,10 +111,8 @@ public class DownloadPresenter extends BasePresenter<DownloadContract.Model, Dow
down_load_data();
}
public void down_load_data() {
int restaurantId = 26;
// int restaurantId = GsaCloudApplication.getRestaurantId(IActivity);
int restaurantId = GsaCloudApplication.getRestaurantId(IActivity);
Observable.mergeArray(mModel.downFunctionList(), mModel.downFoodList(restaurantId)
, mModel.downModifier(restaurantId), mModel.downCombo(restaurantId),
mModel.downFoodModifier(restaurantId))
......@@ -256,6 +255,8 @@ public class DownloadPresenter extends BasePresenter<DownloadContract.Model, Dow
//这里报错需要累加一
downLoadCount++;
mRootView.showMessage("部分下載失敗,點擊刷新按鈕重新下載");
// downAllList();
}
});
}
......
......@@ -2,7 +2,6 @@ package com.joe.print.mvp.print;
import android.content.Context;
import android.os.RemoteException;
import com.gingersoft.gsa.cloud.base.utils.LanguageUtils;
import com.hyweb.n5.lib.util.PrinterUtil;
import com.jess.arms.utils.ArmsUtils;
......
......@@ -59,13 +59,13 @@ dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation files('libs/javabase64-1.2.jar')
implementation files('libs/sun.misc.BASE64Decoder.jar')
// test
testImplementation rootProject.ext.dependencies["junit"]
debugImplementation rootProject.ext.dependencies["canary-debug"]
releaseImplementation rootProject.ext.dependencies["canary-release"]
testImplementation rootProject.ext.dependencies["canary-release"]
annotationProcessor rootProject.ext.dependencies["dagger2-compiler"]
implementation rootProject.ext.dependencies["BaseRecyclerViewAdapter"]
// implementation 'androidx.appcompat:appcompat:1.1.0'
testImplementation 'junit:junit:4.12'
......@@ -79,4 +79,6 @@ dependencies {
implementation 'org.greenrobot:greendao-generator:3.2.2'
implementation rootProject.ext.dependencies["BaseRecyclerViewAdapter"]
implementation files('libs/ecracalib.jar')
implementation files('libs/nexgon5lib.jar')
}
......@@ -19,8 +19,8 @@ public class FoodAdapter extends BaseQuickAdapter<OrderDetail, BaseViewHolder> {
@Override
protected void convert(BaseViewHolder helper, OrderDetail item) {
helper.setText(R.id.tv_food_name, item.getName());
helper.setText(R.id.tv_food_name, item.getProductName());
helper.setText(R.id.tv_food_quantity, String.valueOf(item.getNumber()));
helper.setText(R.id.tv_food_price, "$" + item.getAmount_price());
helper.setText(R.id.tv_food_price, "$" + item.getPrice());
}
}
......@@ -3,10 +3,23 @@ package com.gingersoft.gsa.cloud.base.application;
import android.content.Context;
import com.billy.cc.core.component.CC;
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.base.BuildConfig;
import com.gingersoft.gsa.cloud.base.common.bean.CurrentAndroidSetting;
import com.gingersoft.gsa.cloud.base.utils.constans.UserConstans;
import com.gingersoft.gsa.cloud.base.utils.crash.AppCrashHandler;
import com.gingersoft.gsa.cloud.base.utils.file.FileUtils;
import com.gingersoft.gsa.cloud.base.utils.other.SPUtils;
import com.gingersoft.gsa.cloud.base.utils.xlog.MyBackupStrategy;
import com.gingersoft.gsa.cloud.database.DaoManager;
import com.jess.arms.base.BaseApplication;
......@@ -32,14 +45,41 @@ public class GsaCloudApplication extends BaseApplication {
CC.enableVerboseLog(true);
CC.enableDebug(true);
CC.enableRemoteCC(true);
//初始化日誌管理庫
initXLog();
initGreenDao();
AppCrashHandler.getInstance().init(this,"test");
AppCrashHandler.getInstance().init(this, "test");
androidSetting = new CurrentAndroidSetting();
}
private void initXLog() {
LogConfiguration config = new LogConfiguration.Builder()
.logLevel(BuildConfig.DEBUG ? LogLevel.ALL // 指定日志级别,低于该级别的日志将不会被打印,默认为 LogLevel.ALL
: LogLevel.NONE)
.tag("GSA_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);
}
private void initGreenDao() {
DaoManager mManager = DaoManager.getInstance();
mManager.init(this);
......
......@@ -39,7 +39,7 @@ public class CurrentAndroidSetting {
private int LayoutQuitHeight = 40;
private int LayoutFoodTypeHeight = 100;
private int FoodBtnHeight = 120;
private int ModBtnHeight = 48;
private int ModBtnHeight = 55;
private int FoodTypeCol = 4;
private int FoodTypeRow = 1;
private int FoodCol = 4;
......
package com.gingersoft.gsa.cloud.base.common.bean;
import com.gingersoft.gsa.cloud.base.common.bean.mealManage.OpenTableManage;
import com.gingersoft.gsa.cloud.database.bean.Food;
import java.util.ArrayList;
......@@ -106,32 +107,30 @@ public class OrderBean {
*/
private int id;
private String productName;
private String productId;
private long productId;
private double price;
private double lunchboxPrice;
private int number;
private String createTime;
private int status;
private byte type;
private long parentId;
private long orderId;
public OrderDetailsBean() {
}
public OrderDetailsBean(String productName, String productId, double price, double lunchboxPrice, int number, long orderId) {
this.productName = productName;
this.productId = productId;
this.price = price;
this.lunchboxPrice = lunchboxPrice;
this.number = number;
this.orderId = orderId;
}
public OrderDetailsBean(String productName, String productId, double price, double lunchboxPrice, int number) {
public OrderDetailsBean(String productName, long productId,long parentId, double price, double lunchboxPrice, int number,byte type, long orderId) {
this.productName = productName;
this.productId = productId;
this.parentId = parentId;
this.price = price;
this.lunchboxPrice = lunchboxPrice;
this.number = number;
this.type =type;
this.orderId = orderId;
}
public int getId() {
......@@ -142,6 +141,22 @@ public class OrderBean {
this.id = id;
}
public byte getType() {
return type;
}
public void setType(byte type) {
this.type = type;
}
public long getParentId() {
return parentId;
}
public void setParentId(long parentId) {
this.parentId = parentId;
}
public String getProductName() {
return productName;
}
......@@ -150,11 +165,11 @@ public class OrderBean {
this.productName = productName;
}
public String getProductId() {
public long getProductId() {
return productId;
}
public void setProductId(String productId) {
public void setProductId(long productId) {
this.productId = productId;
}
......@@ -207,7 +222,6 @@ public class OrderBean {
}
}
// public static List<OrderDetailsBean> transOrderDetails(List<Food> foods) {
// List<OrderDetailsBean> orderDetailsBeans = new ArrayList<>();
// for (Food food : foods) {
......@@ -220,8 +234,7 @@ public class OrderBean {
public static List<OrderDetailsBean> transOrderDetails(List<OrderDetail> foods) {
List<OrderDetailsBean> orderDetailsBeans = new ArrayList<>();
for (OrderDetail food : foods) {
// OrderDetailsBean orderDetailsBean = new OrderDetailsBean(food.getName(), food.getParentId()+ "", food.getAmount_price(), food.getLunchboxPrice(), food.getNumber(), food.getOrderId());
OrderDetailsBean orderDetailsBean = new OrderDetailsBean(food.getName(), food.getParentId()+ "", food.getAmount_price(), food.getLunchboxPrice(), food.getNumber());
OrderDetailsBean orderDetailsBean = new OrderDetailsBean(food.getProductName(), food.getProductId(), food.getParentId(),food.getPrice(), food.getLunchboxPrice(), food.getNumber(), food.getType(),food.getOrderId());
orderDetailsBeans.add(orderDetailsBean);
}
return orderDetailsBeans;
......
......@@ -6,6 +6,7 @@ import com.gingersoft.gsa.cloud.database.bean.Food;
import com.gingersoft.gsa.cloud.database.bean.Modifier;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
......@@ -24,18 +25,6 @@ public class OrderDetail {
* 3 由三级菜单进入选中全部
*/
private int selected = 0;
//食品名
private String name;
//選中數量
private int number = 0;
//總價格(已經x數量)
private double amount_price = 0;
//單價
private double unit_price = 0;
//餐盒費
private double lunchboxPrice = 0;
//食品類型(1+主食品,2=套餐食品,3=套餐下細項)
private int itemType = 1;
//是否食品
private boolean isIsfood = true;
//父級下標
......@@ -50,16 +39,10 @@ public class OrderDetail {
private int autoMod = 0;
//作用于套餐下子食品的限制数量
private int limitQty = 0;
//最后的金额平均数(Famount_price/number)
private double Famount_price_sign = 0;
//是否组合商品 1-组合商品 2-组合商品的子商品
private int ComboLevel = 0;
//折扣比例
private double PERCENTAGE = 0.00;
//"food" or "discount" or "modifiy"
private String prop = "food";
//套餐食品是否自動跟餐
private boolean isComboAuto = false;
//当作为套餐内时的编號
private String comid = "";
//修改数量前的数量
......@@ -70,234 +53,415 @@ public class OrderDetail {
private int bgColor;
//字體色
private int fontColor;
//保存訂單id
//是否组合商品 1-组合商品 2-组合商品的子商品
private int ComboLevel = 0;
//套餐食品是否自動跟餐
private boolean isComboAuto = false;
//層級
private int itemType;
/**
* ID
*/
private long id;
/**
* 订单ID
*/
private long orderId;
//fid
private long fid;
//父級fid
/**
* 父级ID
*/
private long parentId;
/**
* 商品名称
*/
private String productName;
/**
* 商品id
*/
private long productId;
/**
* 總價格(已經x數量)
*/
private double price = 0;
/**
* 單價
*/
private double unit_price = 0;
/**
* 餐盒費
*/
private double lunchboxPrice;
/**
* 細項價格
*/
private double itemsPrice;
/**
* 數量
*/
private int number;
/**
* 已經使用優惠卷卷號列表逗號分割
*/
private String userCouponNo;
/**
* 类型#1:优惠卷;2:商品;3:菜品;4:细项;
*/
private byte type;
/**
*
*/
private String qmUseData;
/**
* 备注
*/
private String remark;
/**
* 细项(食品种类#食品id#详细分类ID#详细ID#名称#单价#位置索引#数量#细项总价格#posFid)
*/
private String items;
/**
* 創建時間
*/
private Date createTime = new Date();
/**
* 是否参与折扣
*/
private long ablediscount;
/**
* 食品組
*/
private String ftName;
/**
* 自定義組
*/
private String majorName;
/**
* 状态#0:正常;1:删除;
*/
private Byte status = STATUS_NORMAL;
/**
* 状态#0:正常;1:删除;
*/
public static final byte STATUS_NORMAL = 0;
public static final byte STATUS_DELETE = 1;
/**
* type編號#3:菜品;4:細項
*/
public static final byte FOOD_TYPE = 3;
public static final byte MODIFIER_TYPE = 4;
private String printseting;
public OrderDetail() {
}
public String getName() {
return name;
public int getSelected() {
return selected;
}
public void setName(String name) {
this.name = name;
public boolean isIsfood() {
return isIsfood;
}
public double getLunchboxPrice() {
return lunchboxPrice;
public int getParentIndex() {
return parentIndex;
}
public void setLunchboxPrice(double lunchboxPrice) {
this.lunchboxPrice = lunchboxPrice;
public int getMyIndex() {
return myIndex;
}
public long getParentId() {
return parentId;
public boolean isNew() {
return isNew;
}
public void setParentId(long parentId) {
this.parentId = parentId;
public boolean isVisible() {
return visible;
}
public int getAutoMod() {
return autoMod;
}
public int getLimitQty() {
return limitQty;
}
public double getPERCENTAGE() {
return PERCENTAGE;
}
public String getProp() {
return prop;
}
public String getComid() {
return comid;
}
public int getChangeBeforeQty() {
return changeBeforeQty;
}
public boolean isHasChild() {
return hasChild;
}
public int getBgColor() {
return bgColor;
}
public int getFontColor() {
return fontColor;
}
public int getComboLevel() {
return ComboLevel;
}
public boolean isComboAuto() {
return isComboAuto;
}
public long getId() {
return id;
}
public long getOrderId() {
return orderId;
}
public void setOrderId(long orderId) {
this.orderId = orderId;
public long getParentId() {
return parentId;
}
public int getSelected() {
return selected;
public String getProductName() {
return productName;
}
public void setSelected(int selected) {
this.selected = selected;
public long getProductId() {
return productId;
}
public double getUnit_price() {
return unit_price;
}
public double getLunchboxPrice() {
return lunchboxPrice;
}
public double getItemsPrice() {
return itemsPrice;
}
public int getNumber() {
return number;
}
public long getFid() {
return fid;
public String getUserCouponNo() {
return userCouponNo;
}
public void setFid(long fid) {
this.fid = fid;
public byte getType() {
return type;
}
public void setNumber(int number) {
this.number = number;
public String getQmUseData() {
return qmUseData;
}
public double getAmount_price() {
return amount_price;
public String getRemark() {
return remark;
}
public void setAmount_price(double amount_price) {
this.amount_price = amount_price;
public String getItems() {
return items;
}
public int getItemType() {
return itemType;
public Date getCreateTime() {
return createTime;
}
public void setItemType(int itemType) {
this.itemType = itemType;
public long getAblediscount() {
return ablediscount;
}
public boolean isIsfood() {
return isIsfood;
public String getFtName() {
return ftName;
}
public void setIsfood(boolean isfood) {
isIsfood = isfood;
public String getMajorName() {
return majorName;
}
public int getParentIndex() {
return parentIndex;
public void setSelected(int selected) {
this.selected = selected;
}
public void setParentIndex(int parentIndex) {
this.parentIndex = parentIndex;
public void setIsfood(boolean isfood) {
isIsfood = isfood;
}
public int getMyIndex() {
return myIndex;
public void setParentIndex(int parentIndex) {
this.parentIndex = parentIndex;
}
public void setMyIndex(int myIndex) {
this.myIndex = myIndex;
}
public boolean isNew() {
return isNew;
}
public void setNew(boolean aNew) {
isNew = aNew;
}
public boolean isVisible() {
return visible;
}
public void setVisible(boolean visible) {
this.visible = visible;
}
public void setAutoMod(int autoMod) {
this.autoMod = autoMod;
}
public int getAutoMod() {
return autoMod;
public void setLimitQty(int limitQty) {
this.limitQty = limitQty;
}
public void setAutoMod(int autoMod) {
this.autoMod = autoMod;
public void setPERCENTAGE(double PERCENTAGE) {
this.PERCENTAGE = PERCENTAGE;
}
public int getLimitQty() {
return limitQty;
public void setProp(String prop) {
this.prop = prop;
}
public void setLimitQty(int limitQty) {
this.limitQty = limitQty;
public void setComid(String comid) {
this.comid = comid;
}
public double getFamount_price_sign() {
return Famount_price_sign;
public void setChangeBeforeQty(int changeBeforeQty) {
this.changeBeforeQty = changeBeforeQty;
}
public void setFamount_price_sign(double famount_price_sign) {
Famount_price_sign = famount_price_sign;
public void setHasChild(boolean hasChild) {
this.hasChild = hasChild;
}
public int getComboLevel() {
return ComboLevel;
public void setBgColor(int bgColor) {
this.bgColor = bgColor;
}
public void setFontColor(int fontColor) {
this.fontColor = fontColor;
}
public void setComboLevel(int comboLevel) {
ComboLevel = comboLevel;
}
public double getPERCENTAGE() {
return PERCENTAGE;
public void setComboAuto(boolean comboAuto) {
isComboAuto = comboAuto;
}
public void setPERCENTAGE(double PERCENTAGE) {
this.PERCENTAGE = PERCENTAGE;
public void setId(long id) {
this.id = id;
}
public String getProp() {
return prop;
public void setOrderId(long orderId) {
this.orderId = orderId;
}
public void setProp(String prop) {
this.prop = prop;
public void setParentId(long parentId) {
this.parentId = parentId;
}
public boolean isComboAuto() {
return isComboAuto;
public void setProductName(String productName) {
this.productName = productName;
}
public void setComboAuto(boolean comboAuto) {
isComboAuto = comboAuto;
public void setProductId(long productId) {
this.productId = productId;
}
public String getComid() {
return comid;
public void setUnit_price(double unit_price) {
this.unit_price = unit_price;
}
public void setComid(String comid) {
this.comid = comid;
public void setLunchboxPrice(double lunchboxPrice) {
this.lunchboxPrice = lunchboxPrice;
}
public int getChangeBeforeQty() {
return changeBeforeQty;
public void setItemsPrice(double itemsPrice) {
this.itemsPrice = itemsPrice;
}
public void setChangeBeforeQty(int changeBeforeQty) {
this.changeBeforeQty = changeBeforeQty;
public void setNumber(int number) {
this.number = number;
}
public boolean isHasChild() {
return hasChild;
public void setUserCouponNo(String userCouponNo) {
this.userCouponNo = userCouponNo;
}
public void setHasChild(boolean hasChild) {
this.hasChild = hasChild;
public void setType(byte type) {
this.type = type;
}
public int getBgColor() {
return bgColor;
public void setQmUseData(String qmUseData) {
this.qmUseData = qmUseData;
}
public void setBgColor(int bgColor) {
this.bgColor = bgColor;
public void setRemark(String remark) {
this.remark = remark;
}
public int getFontColor() {
return fontColor;
public void setItems(String items) {
this.items = items;
}
public void setFontColor(int fontColor) {
this.fontColor = fontColor;
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public double getUnit_price() {
return unit_price;
public void setAblediscount(long ablediscount) {
this.ablediscount = ablediscount;
}
public void setUnit_price(double unit_price) {
this.unit_price = unit_price;
public void setFtName(String ftName) {
this.ftName = ftName;
}
public void setMajorName(String majorName) {
this.majorName = majorName;
}
public double getPrice() {
return price;
}
public void setPrice(double price) {
this.price = price;
}
public Byte getStatus() {
return status;
}
public void setStatus(Byte status) {
this.status = status;
}
public int getItemType() {
return itemType;
}
public void setItemType(int itemType) {
this.itemType = itemType;
}
public String getPrintseting() {
......@@ -316,24 +480,54 @@ public class OrderDetail {
*/
public static List<OrderDetail> orderTransOrderDetails(List<OrderBean.OrderDetailsBean> orderDetails) {
List<OrderDetail> orderDetailList = new ArrayList<>();
OrderDetail parentOrderDetail = null;
for (OrderBean.OrderDetailsBean orderDetailsBean : orderDetails) {
OrderDetail orderDetail = new OrderDetail();
orderDetail.setFid(orderDetailsBean.getId());
orderDetail.setId(orderDetailsBean.getId());
orderDetail.setProductId(orderDetailsBean.getProductId());
orderDetail.setOrderId(orderDetailsBean.getOrderId());
orderDetail.setName(orderDetailsBean.getProductName());
orderDetail.setParentId(orderDetailsBean.getParentId());
orderDetail.setProductName(orderDetailsBean.getProductName());
orderDetail.setNumber(orderDetailsBean.getNumber());
orderDetail.setAmount_price(orderDetailsBean.getPrice());
orderDetail.setPrice(orderDetailsBean.getPrice());
orderDetail.setVisible(orderDetailsBean.getStatus() == 0);
// orderDetail.setAutomod(foods.getAutomod());//TODO 需接口返回
orderDetail.setIsfood(true);//TODO 需接口返回
orderDetail.setItemType(1);//TODO 需接口返回
// orderDetail.setProp("food");
// orderDetail.setAutomod(foods.getAutomod());
orderDetail.setIsfood(orderDetailsBean.getType() == FOOD_TYPE ? true : false);
orderDetail.setNew(false);
orderDetail.setType(orderDetailsBean.getType());
orderDetail.setItemType(getItemType(orderDetailsBean, parentOrderDetail));
orderDetailList.add(orderDetail);
if (orderDetail.isIsfood()) {
parentOrderDetail = orderDetail;
}
}
return orderDetailList;
}
public static int getItemType(OrderBean.OrderDetailsBean orderDetailsBean, OrderDetail parentOrderDetail) {
if (orderDetailsBean != null) {
if (orderDetailsBean.getParentId() == 0) {
return 1;
}
if (orderDetailsBean.getParentId() != 0 && orderDetailsBean.getType() == FOOD_TYPE) {
return 2;
}
if (parentOrderDetail != null && orderDetailsBean.getParentId() != 0) {
if (parentOrderDetail.getProductId() == orderDetailsBean.getParentId()) {
//是父級
if (parentOrderDetail.getParentId() == 0) {
return 2;
}
if (parentOrderDetail.getParentId() != 0 && parentOrderDetail.getType() == FOOD_TYPE) {
return 3;
}
}
return 3;
}
}
return 1;
}
/**
* 主食品轉換
*
......@@ -343,17 +537,22 @@ public class OrderDetail {
*/
public static OrderDetail foodTransOrderDetails(Food foods, int number) {
OrderDetail orderDetail = new OrderDetail();
orderDetail.setName(foods.getFoodName());
orderDetail.setFid(foods.getId());
orderDetail.setProductName(foods.getFoodName());
orderDetail.setId(foods.getId());
orderDetail.setProductId(foods.getId());
orderDetail.setParentId(0);
orderDetail.setUnit_price(foods.getPrice());
orderDetail.setAmount_price(number * orderDetail.getUnit_price());
orderDetail.setPrice(number * orderDetail.getUnit_price());
orderDetail.setNumber(number);
orderDetail.setOrderId(MyOrderManage.getInstance().getOrderId());
orderDetail.setIsfood(true);
orderDetail.setNew(true);
orderDetail.setType(FOOD_TYPE);
orderDetail.setItemType(1);
orderDetail.setProp("food");
orderDetail.setAutoMod(foods.getAutoMod());
int comboLevel = foods.isComboFood() ? 1 : 0;
orderDetail.setComboLevel(comboLevel);
return orderDetail;
}
......@@ -368,14 +567,17 @@ public class OrderDetail {
*/
public static OrderDetail comboTransOrderDetail(Combo combo, int number, String prop, boolean isRvMealClicked) {
OrderDetail orderDetail = new OrderDetail();
orderDetail.setName(combo.getName());
orderDetail.setFid(combo.getFid());
orderDetail.setProductName(combo.getName());
orderDetail.setId(combo.getId());
orderDetail.setProductId(combo.getComId());
orderDetail.setParentId(combo.getFid());
orderDetail.setUnit_price(combo.getPrice());
orderDetail.setAmount_price(number * orderDetail.getUnit_price());
orderDetail.setPrice(number * orderDetail.getUnit_price());
orderDetail.setNumber(number);
orderDetail.setOrderId(MyOrderManage.getInstance().getOrderId());
orderDetail.setIsfood(true);
orderDetail.setNew(true);
orderDetail.setType(FOOD_TYPE);
orderDetail.setItemType(2);
orderDetail.setProp(prop);
// orderDetail.setComboAuto(combo.isAutoMode());
......@@ -398,14 +600,16 @@ public class OrderDetail {
*/
public static OrderDetail modifierTransOrderDetail(Modifier modifier, int number) {
OrderDetail orderDetail = new OrderDetail();
orderDetail.setName(modifier.getModifierName());
orderDetail.setFid(modifier.getMid());
orderDetail.setProductName(modifier.getModifierName());
orderDetail.setId(modifier.getMid());
orderDetail.setParentId(modifier.getFid());
orderDetail.setUnit_price(modifier.getPrice());
orderDetail.setAmount_price(number * orderDetail.getUnit_price());
orderDetail.setPrice(number * orderDetail.getUnit_price());
orderDetail.setNumber(number);
orderDetail.setOrderId(MyOrderManage.getInstance().getOrderId());
orderDetail.setIsfood(false);
orderDetail.setNew(true);
orderDetail.setType(MODIFIER_TYPE);
orderDetail.setItemType(3);
orderDetail.setProp("modifify");
//手动点击细项 才将子食品作为主体被选中
......
......@@ -730,7 +730,7 @@ public class MyOrderManage {
// datasBean.isManualMoney = true;
// }
datasBean.setUnit_price(money);
datasBean.setAmount_price(money * datasBean.getNumber());
datasBean.setPrice(money * datasBean.getNumber());
}
// /**
......
......@@ -5,8 +5,8 @@ package com.gingersoft.gsa.cloud.base.utils.constans;
*/
public class HttpsConstans {
public static String ROOT_SERVER_ADDRESS_FORMAL = "http://gingersoft.tpddns.cn:58201/ricepon-cloud-gsa/api/";// 正式服務
// public static String ROOT_SERVER_ADDRESS_FORMAL = "http://192.168.1.74:8201/ricepon-cloud-gsa/api/";// 正式服務
public static String ROOT_SERVER_ADDRESS_FORMAL = "http://gingersoft.tpddns.cn:58201/ricepon-cloud-gsa/api/";// 深圳服务
// public static String ROOT_SERVER_ADDRESS_FORMAL = "http://a.ricepon.com:58201/ricepon-cloud-gsa/api/";// 香港服务
public static String ROOT_SERVER_ADDRESS_FORMAL2 = "http://gingersoft.tpddns.cn:53000/mock/49/ricepon-cloud-gsa/api/";//測試服務器
......
......@@ -12,6 +12,8 @@ import android.telecom.Call;
import android.util.Base64;
import android.util.Log;
import android.widget.Toast;
import com.elvishew.xlog.XLog;
import com.gingersoft.gsa.cloud.base.utils.log.LogUtil;
import com.gingersoft.gsa.cloud.base.utils.other.AppUtils;
import com.jess.arms.di.component.AppComponent;
......@@ -202,6 +204,7 @@ public class AppCrashHandler implements UncaughtExceptionHandler {
String stacktrace = result.toString();
printWriter.close();
LogUtil.d(TAG,stacktrace);
// XLog.tag(TAG).d(stacktrace);
//收集设备信息
collectCrashDeviceInfo(mContext);
......
package com.gingersoft.gsa.cloud.base.utils.file;
import android.content.Context;
import android.os.Environment;
import android.text.TextUtils;
import com.elvishew.xlog.XLog;
import java.io.BufferedReader;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
/**
* 作者:ELEGANT_BIN
* 版本:1.6.0
* 创建日期:2018/11/16
* 修订历史:2018/11/16
* 描述:7.0 兼容
* <files-path name="name" path="path" /> 对应getFilesDir()。
* <cache-path name="name" path="path" /> 对应getCacheDir()。
* <external-path name="name" path="path" /> 对应Environment.getExternalStorageDirectory()。
* <external-files-path name="name" path="path" /> 对应getExternalFilesDir()。
* <external-cache-path name="name" path="path" /> 对应getExternalCacheDir()。
*/
public class FileUtils {
public static String FirstFolder = "GsAndroid";//一级目录
public static String file = "file";//文件文件夹
public static String Image = "image";//图片文件夹
public static String Log = "xLog";//日志存储
public static String ActionLog = "actionLog";//操作日志
public static String ErrorLog = "errorLog";//错误日志存储
public static String APK = "Download";//安装包目录放在系统目录
/*ALBUM_PATH取得机器的SD卡位置,File.separator为分隔符“/”*/
public final static String ALBUM_PATH = Environment.getExternalStorageDirectory() + File.separator + FirstFolder + File.separator;
public final static String IMAGE_PATH = ALBUM_PATH + Image + File.separator;
public final static String File_PATH = ALBUM_PATH + file + File.separator;
public final static String LOG_PATH = ALBUM_PATH + Log + File.separator;
public final static String ACTIONLOG_PATH = LOG_PATH + ActionLog + File.separator;
public final static String ERRORLOG_PATH = LOG_PATH + ErrorLog + File.separator;
public final static String APK_PATH = Environment.getExternalStorageDirectory() + File.separator + APK + File.separator;
public final static String FILE_EXTENSION_SEPARATOR = ".";
//操作日志單最大文件大小
public final static int ACTION_MAX_SIZE = 1024 * 1024 * 5;
//操作日志文件按照時間刪除
public final static int ACTION_MAX_FILE_TIME = 1000 * 60 * 60 * 12;
private FileUtils() {
throw new AssertionError();
}
public static StringBuilder readFile(String filePath, String charsetName) {
File file = new File(filePath);
StringBuilder fileContent = new StringBuilder("");
if (file == null || !file.isFile()) {
return null;
}
BufferedReader reader = null;
try {
InputStreamReader is = new InputStreamReader(new FileInputStream(
file), charsetName);
reader = new BufferedReader(is);
String line = null;
while ((line = reader.readLine()) != null) {
if (!fileContent.toString().equals("")) {
fileContent.append("\r\n");
}
fileContent.append(line);
}
reader.close();
return fileContent;
} catch (IOException e) {
throw new RuntimeException("IOException occurred. ", e);
} finally {
if (reader != null) {
try {
reader.close();
} catch (IOException e) {
throw new RuntimeException("IOException occurred. ", e);
}
}
}
}
/**
* 写文件
*
* @param
* @return boolean 返回类型
*/
public static boolean writeFile(String filePath, String content,
boolean append) {
if (TextUtils.isEmpty(content)) {
return false;
}
FileWriter fileWriter = null;
try {
makeDirs(filePath);
fileWriter = new FileWriter(filePath, append);
fileWriter.write(content);
fileWriter.close();
return true;
} catch (IOException e) {
throw new RuntimeException("IOException occurred. ", e);
} finally {
if (fileWriter != null) {
try {
fileWriter.close();
} catch (IOException e) {
throw new RuntimeException("IOException occurred. ", e);
}
}
}
}
/**
* 创建文件的路径
*
* @param
* @return boolean 返回类型
*/
public static boolean makeDirs(String filePath) {
String folderName = getFolderName(filePath);
if (TextUtils.isEmpty(folderName)) {
return false;
}
File folder = new File(folderName);
return (folder.exists() && folder.isDirectory()) ? true : folder.mkdirs();
}
public static String getFolderName(String filePath) {
if (TextUtils.isEmpty(filePath)) {
return filePath;
}
int filePosi = filePath.lastIndexOf(File.separator);
return (filePosi == -1) ? "" : filePath.substring(0, filePosi);
}
/**
* 写文本文件 在Android系统中,文件保存在 /data/data/PACKAGE_NAME/files 目录下
*
* @param context
*/
public static void write(Context context, String fileName, String content) {
if (content == null)
content = "";
try {
FileOutputStream fos = context.openFileOutput(fileName,
Context.MODE_PRIVATE);
fos.write(content.getBytes());
fos.close();
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 读取文本文件 文件保存在 /data/data/PACKAGE_NAME/files
*
* @param context
* @param fileName
* @return
*/
public static String read(Context context, String fileName) {
try {
FileInputStream in = context.openFileInput(fileName);
return readInStream(in);
} catch (Exception e) {
e.printStackTrace();
}
return "";
}
public static String readInStream(FileInputStream inStream) {
try {
ByteArrayOutputStream outStream = new ByteArrayOutputStream();
byte[] buffer = new byte[512];
int length = -1;
while ((length = inStream.read(buffer)) != -1) {
outStream.write(buffer, 0, length);
}
outStream.close();
inStream.close();
return outStream.toString();
} catch (IOException e) {
XLog.tag("FileTest").d(e.getMessage());
}
return null;
}
/**
* 创建文件
*
* @param folderPath
* @param fileName
* @return
*/
public static File createFile(String folderPath, String fileName) {
File destDir = new File(folderPath);
if (!destDir.exists()) {
destDir.mkdirs();
}
return new File(folderPath, fileName + fileName);
}
/*
* 在SD卡上创建目录
*/
public static File creatSDDir(String dirName) {
File dir = new File(dirName);
if (!dir.exists()) {
dir.mkdirs();
}
return dir;
}
/**
* 获取文件大小
*
* @param filePath
* @return
*/
public static long getFileSize(String filePath) {
long size = 0;
File file = new File(filePath);
if (file != null && file.exists()) {
size = file.length();
}
return size;
}
/*
* Java文件操作 获取文件扩展名
* */
public static String getExtensionName(String filename) {
if ((filename != null) && (filename.length() > 0)) {
int dot = filename.lastIndexOf('.');
if ((dot > -1) && (dot < (filename.length() - 1))) {
return filename.substring(dot + 1);
}
}
return filename;
}
/*
* Java文件操作 获取不带扩展名的文件名
* */
public static String getFileNameNoEx(String filename) {
if ((filename != null) && (filename.length() > 0)) {
int dot = filename.lastIndexOf('.');
if ((dot > -1) && (dot < (filename.length()))) {
return filename.substring(0, dot);
}
}
return filename;
}
}
package com.gingersoft.gsa.cloud.base.utils.xlog;
import com.elvishew.xlog.printer.file.naming.FileNameGenerator;
import com.gingersoft.gsa.cloud.base.application.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.base.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;
}
}
......@@ -46,22 +46,36 @@ public class Combo {
*/
@Transient
private String name;
/**價格*/
@Transient
private long parentId;
/**
* 價格
*/
@Transient
private double price = 0.00;
/**是否自動展開*/
/**
* 是否自動展開
*/
@Transient
private int autoMode = 0;
/**是否备注细项*/
/**
* 是否备注细项
*/
@Transient
private boolean isModifier;
/**背景顏色*/
/**
* 背景顏色
*/
@Transient
private int bgColor = Color.parseColor("#067878");
/**字體顏色*/
/**
* 字體顏色
*/
@Transient
private int fontColor = Color.parseColor("#FFFFFF");
/**套餐細項*/
/**
* 套餐細項
*/
@Transient
private Modifier modifier;
......@@ -104,6 +118,14 @@ public class Combo {
// }
public long getParentId() {
return parentId;
}
public void setParentId(long parentId) {
this.parentId = parentId;
}
public long getId() {
return id;
}
......
......@@ -26,148 +26,276 @@ public class Food {
@Id(autoincrement = true)
private Long dbid;
/**食品ID*/
/**
* ID
*/
private Long id;
/**上級ID (如0=最高級)*/
/**
* 上級ID (如0=最高級)
*/
private Long parentId;
/**商户ID*/
/**
* 商户ID
*/
private Long restaurantId;
private String fid;
/**是否組別*/
/**食品ID*/
// private Long fid;
/**
* 是否組別
*/
private Byte isParent;
/**排序*/
/**
* 排序
*/
private Long seqNo;
/**名稱1*/
/**
* 名稱1
*/
private String foodName;
/**本地对应ID*/
/**
* 食品名称1
*/
private String foodName1;
/**
* 食品名称2
*/
private String foodName2;
/**
* 自定義食品編號
*/
private String plu;
/**
* 本地对应ID
*/
private String posFid;
/**描述*/
/**
* 描述
*/
private String foodDesc;
/**限制比例#0不做判断;(人数*N)*/
/**
* 限制比例#0不做判断;(人数*N)
*/
private Long limitAmount;
/**限制类型#1:表示每次送单限制 ;2:表示整单限制*/
/**
* 限制类型#1:表示每次送单限制 ;2:表示整单限制
*/
private Long limitType;
/**餐种*/
/**
* 餐种
*/
private Long foodSummary;
/**0=顯示, 1=隱藏, 2=暫停,3=只显示,不操作*/
/**
* 0=顯示, 1=隱藏, 2=暫停,3=只显示,不操作
*/
private Long invisible;
/**自動跳出細項頁*/
/**
* 自動跳出細項頁
*/
private Byte autoMod;
/**金額*/
/**
* 金額
*/
private Double price;
/**原價 (刪除線)*/
/**
* 原價 (刪除線)
*/
private Double marketPrice;
/**餐盒费*/
/**
* 餐盒费
*/
private Double lunchboxPrice;
/**食品小图片*/
/**
* 食品小图片
*/
private String imgUrlSmall;
/**食品大图片*/
/**
* 食品大图片
*/
private String imageurl;
/**ricepon显示状态,当为0的时候,取Invisible的状态:0=顯示, 1=隱藏, 2=暫停*/
/**
* ricepon显示状态,当为0的时候,取Invisible的状态:0=顯示, 1=隱藏, 2=暫停
*/
private Long riceponInvisible;
/**成本*/
/**
* 成本
*/
private Double cost;
/**開始日期*/
/**
* 開始日期
*/
private Date startDate;
/**結束日期*/
/**
* 結束日期
*/
private Date endDate;
/**贊*/
/**
* 贊
*/
private Long like;
/**已售*/
/**
* 已售
*/
private Long totalSold;
/**是否显示已售*/
/**
* 是否显示已售
*/
private Long isSold;
/**创建人*/
/**
* 创建人
*/
private String createBy;
private Date createTime;
/**更新人*/
/**
* 更新人
*/
private String updateBy;
/**更新时间*/
/**
* 更新时间
*/
private Date updateTime;
/**時段, 請關聯到m_period_info*/
/**
* 時段, 請關聯到m_period_info
*/
private Long periodId;
/**是否参与折扣#1:可折扣*/
/**
* 是否参与折扣#1:可折扣
*/
private Long ableDiscount;
/**是否外卖#0:是;1:否*/
/**
* 是否外卖#0:是;1:否
*/
private Long takeaway;
/**餐頁面中藍色按鈕有沒有編輯按鈕 (筆的圖按) 0=不可編輯 1=可編輯*/
/**
* 餐頁面中藍色按鈕有沒有編輯按鈕 (筆的圖按) 0=不可編輯 1=可編輯
*/
private Long blueEdit;
/**購物車中是否可編輯 (加入口味) 0=隱藏購物車中食品的編輯按鈕 1=顯示按鈕*/
/**
* 購物車中是否可編輯 (加入口味) 0=隱藏購物車中食品的編輯按鈕 1=顯示按鈕
*/
private Long cartEdit;
/**相同項目自動合併 0=不自動合併 1=自動合併*/
/**
* 相同項目自動合併 0=不自動合併 1=自動合併
*/
private Long autoMerge;
/**食品名称1*/
private String foodName1;
/**食品名称2*/
private String foodName2;
/**自定義食品編號*/
private String plu;
/**打印設定, 用逗號分隔, *=切紙*/
/**
* 打印設定, 用逗號分隔, *=切紙
*/
private String printSeting;
/**是否打印叫号小票*/
/**
* 是否打印叫号小票
*/
private Long isPrintQueueCode;
/**打印叫号小票对应队ID*/
/**
* 打印叫号小票对应队ID
*/
private Long queueHeadId;
/**是否需要經理批準*/
/**
* 是否需要經理批準
*/
private Long approve;
/**0=系統顏色, 1=黑色, 2=紅色*/
/**
* 0=系統顏色, 1=黑色, 2=紅色
*/
private Long printFont;
/**自動顯示細項*/
/**
* 自動顯示細項
*/
private Long advPrice;
/**當金額=0時, 是否打印在帳單上*/
/**
* 當金額=0時, 是否打印在帳單上
*/
private Long printToBill;
/**額外食品加分*/
/**
* 額外食品加分
*/
private Double pointsAdd;
/**額外積分比率*/
/**
* 額外積分比率
*/
private Long pointsRatio;
/**換購食品所需積分*/
/**
* 換購食品所需積分
*/
private Double pointsRedeem;
/**是否打印主项*/
/**
* 是否打印主项
*/
private Long ktPrintMainItem;
/**是否打印价格*/
/**
* 是否打印价格
*/
private Long ktShowPrice;
/**0食品清单打印 账单打印//1食品清单不打印 账单不打印//2食品清单打印 账单不打印//3食品清单不打印 账单打印*/
/**
* 0食品清单打印 账单打印//1食品清单不打印 账单不打印//2食品清单打印 账单不打印//3食品清单不打印 账单打印
*/
private Long printTo;
/**食品数量是否同步 餐台人数*/
/**
* 食品数量是否同步 餐台人数
*/
private Long toPax;
/**食品类型 0普通食品 1称重食品*/
/**
* 食品类型 0普通食品 1称重食品
*/
private Long foodType;
/**gspos自定义表中的Id*/
/**
* gspos自定义表中的Id
*/
private Long majorMainId;
/**部门Id*/
/**
* 部门Id
*/
private Long deptId;
/**是否收取服務費*/
/**
* 是否收取服務費
*/
private Byte serviceCharge;
/**顏色ID*/
/**
* 顏色ID
*/
private Long colorId;
/**0:新增;1:修改;2:刪除*/
/**
* 0:新增;1:修改;2:刪除
*/
private Long conditions;
/**是否同步 0:否 1:是*/
/**
* 是否同步 0:否 1:是
*/
private Long isRt;
/**是否删除:0正常,1删除*/
/**
* 是否删除:0正常,1删除
*/
private Long deletes;
/**是否時長食物 0=普通食品 1=計費食品 2=免費N小時 3=時段對沖 4=入場費食品*/
/**
* 是否時長食物 0=普通食品 1=計費食品 2=免費N小時 3=時段對沖 4=入場費食品
*/
private Long isTimingFood;
/**最低持續時間*/
/**
* 最低持續時間
*/
private Long minLongTime;
private Long unitTime;
/**單位價格*/
/**
* 單位價格
*/
private Double unitPrice;
/**免費時間(小時)*/
/**
* 免費時間(小時)
*/
private Long freeLongTime;
/**免費開始時間*/
/**
* 免費開始時間
*/
private Date freePeriodBegin;
/**是否參與會員喜好統計 0 參與 1 不參與*/
/**
* 是否參與會員喜好統計 0 參與 1 不參與
*/
private Long isStatistic;
/**
*
* 自定義字段
*
*/
@Transient
......@@ -181,39 +309,46 @@ public class Food {
private int fontColor = Color.parseColor("#FFFFFF");
@Transient
/**最大選中數*/
private int maxNumber =99;
private int maxNumber = 99;
@Transient
/**是否選中*/
private boolean selected;
@Transient
/**是否组合食品*/
private boolean isComboFood = false;
@Generated(hash = 866324199)
public Food() {
}
@Generated(hash = 1004134489)
public Food(Long dbid, Long id, Long parentId, Long restaurantId, String fid,
Byte isParent, Long seqNo, String foodName, String posFid,
String foodDesc, Long limitAmount, Long limitType, Long foodSummary,
Long invisible, Byte autoMod, Double price, Double marketPrice,
Double lunchboxPrice, String imgUrlSmall, String imageurl,
Long riceponInvisible, Double cost, Date startDate, Date endDate,
Long like, Long totalSold, Long isSold, String createBy,
Date createTime, String updateBy, Date updateTime, Long periodId,
Long ableDiscount, Long takeaway, Long blueEdit, Long cartEdit,
Long autoMerge, String foodName1, String foodName2, String plu,
String printSeting, Long isPrintQueueCode, Long queueHeadId,
Long approve, Long printFont, Long advPrice, Long printToBill,
Double pointsAdd, Long pointsRatio, Double pointsRedeem,
Long ktPrintMainItem, Long ktShowPrice, Long printTo, Long toPax,
Long foodType, Long majorMainId, Long deptId, Byte serviceCharge,
Long colorId, Long conditions, Long isRt, Long deletes,
@Generated(hash = 1165612351)
public Food(Long dbid, Long id, Long parentId, Long restaurantId, Byte isParent,
Long seqNo, String foodName, String foodName1, String foodName2, String plu,
String posFid, String foodDesc, Long limitAmount, Long limitType,
Long foodSummary, Long invisible, Byte autoMod, Double price, Double marketPrice,
Double lunchboxPrice, String imgUrlSmall, String imageurl, Long riceponInvisible,
Double cost, Date startDate, Date endDate, Long like, Long totalSold, Long isSold,
String createBy, Date createTime, String updateBy, Date updateTime, Long periodId,
Long ableDiscount, Long takeaway, Long blueEdit, Long cartEdit, Long autoMerge,
String printSeting, Long isPrintQueueCode, Long queueHeadId, Long approve,
Long printFont, Long advPrice, Long printToBill, Double pointsAdd,
Long pointsRatio, Double pointsRedeem, Long ktPrintMainItem, Long ktShowPrice,
Long printTo, Long toPax, Long foodType, Long majorMainId, Long deptId,
Byte serviceCharge, Long colorId, Long conditions, Long isRt, Long deletes,
Long isTimingFood, Long minLongTime, Long unitTime, Double unitPrice,
Long freeLongTime, Date freePeriodBegin, Long isStatistic) {
this.dbid = dbid;
this.id = id;
this.parentId = parentId;
this.restaurantId = restaurantId;
this.fid = fid;
this.isParent = isParent;
this.seqNo = seqNo;
this.foodName = foodName;
this.foodName1 = foodName1;
this.foodName2 = foodName2;
this.plu = plu;
this.posFid = posFid;
this.foodDesc = foodDesc;
this.limitAmount = limitAmount;
......@@ -243,9 +378,6 @@ public class Food {
this.blueEdit = blueEdit;
this.cartEdit = cartEdit;
this.autoMerge = autoMerge;
this.foodName1 = foodName1;
this.foodName2 = foodName2;
this.plu = plu;
this.printSeting = printSeting;
this.isPrintQueueCode = isPrintQueueCode;
this.queueHeadId = queueHeadId;
......@@ -277,10 +409,6 @@ public class Food {
this.isStatistic = isStatistic;
}
@Generated(hash = 866324199)
public Food() {
}
public Long getId() {
return id;
......@@ -306,14 +434,6 @@ public class Food {
this.restaurantId = restaurantId;
}
public String getFid() {
return fid;
}
public void setFid(String fid) {
this.fid = fid;
}
public Byte getIsParent() {
return isParent;
}
......@@ -873,4 +993,12 @@ public class Food {
public void setSelected(boolean selected) {
this.selected = selected;
}
public boolean isComboFood() {
return isComboFood;
}
public void setComboFood(boolean comboFood) {
isComboFood = comboFood;
}
}
......@@ -328,7 +328,7 @@ public class Modifier {
return marketPrice;
}
public Double getPrice() {
public double getPrice() {
return price;
}
......
package com.gingersoft.gsa.cloud.database.bean;
/**
* 作者:ELEGANT_BIN
* 版本:1.6.0
* 创建日期:2020-02-19
* 修订历史:2020-02-19
* 描述:
*/
public class Score {
}
......@@ -14,10 +14,10 @@ import org.greenrobot.greendao.identityscope.IdentityScopeType;
// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
/**
* Master of DAO (schema version 13): knows all DAOs.
* Master of DAO (schema version 1): knows all DAOs.
*/
public class DaoMaster extends AbstractDaoMaster {
public static final int SCHEMA_VERSION = 13;
public static final int SCHEMA_VERSION = 1;
/** Creates underlying database table using DAOs. */
public static void createAllTables(Database db, boolean ifNotExists) {
......
......@@ -31,71 +31,70 @@ public class FoodDao extends AbstractDao<Food, Long> {
public final static Property Id = new Property(1, Long.class, "id", false, "ID");
public final static Property ParentId = new Property(2, Long.class, "parentId", false, "PARENT_ID");
public final static Property RestaurantId = new Property(3, Long.class, "restaurantId", false, "RESTAURANT_ID");
public final static Property Fid = new Property(4, String.class, "fid", false, "FID");
public final static Property IsParent = new Property(5, Byte.class, "isParent", false, "IS_PARENT");
public final static Property SeqNo = new Property(6, Long.class, "seqNo", false, "SEQ_NO");
public final static Property FoodName = new Property(7, String.class, "foodName", false, "FOOD_NAME");
public final static Property PosFid = new Property(8, String.class, "posFid", false, "POS_FID");
public final static Property FoodDesc = new Property(9, String.class, "foodDesc", false, "FOOD_DESC");
public final static Property LimitAmount = new Property(10, Long.class, "limitAmount", false, "LIMIT_AMOUNT");
public final static Property LimitType = new Property(11, Long.class, "limitType", false, "LIMIT_TYPE");
public final static Property FoodSummary = new Property(12, Long.class, "foodSummary", false, "FOOD_SUMMARY");
public final static Property Invisible = new Property(13, Long.class, "invisible", false, "INVISIBLE");
public final static Property AutoMod = new Property(14, Byte.class, "autoMod", false, "AUTO_MOD");
public final static Property Price = new Property(15, Double.class, "price", false, "PRICE");
public final static Property MarketPrice = new Property(16, Double.class, "marketPrice", false, "MARKET_PRICE");
public final static Property LunchboxPrice = new Property(17, Double.class, "lunchboxPrice", false, "LUNCHBOX_PRICE");
public final static Property ImgUrlSmall = new Property(18, String.class, "imgUrlSmall", false, "IMG_URL_SMALL");
public final static Property Imageurl = new Property(19, String.class, "imageurl", false, "IMAGEURL");
public final static Property RiceponInvisible = new Property(20, Long.class, "riceponInvisible", false, "RICEPON_INVISIBLE");
public final static Property Cost = new Property(21, Double.class, "cost", false, "COST");
public final static Property StartDate = new Property(22, java.util.Date.class, "startDate", false, "START_DATE");
public final static Property EndDate = new Property(23, java.util.Date.class, "endDate", false, "END_DATE");
public final static Property Like = new Property(24, Long.class, "like", false, "LIKE");
public final static Property TotalSold = new Property(25, Long.class, "totalSold", false, "TOTAL_SOLD");
public final static Property IsSold = new Property(26, Long.class, "isSold", false, "IS_SOLD");
public final static Property CreateBy = new Property(27, String.class, "createBy", false, "CREATE_BY");
public final static Property CreateTime = new Property(28, java.util.Date.class, "createTime", false, "CREATE_TIME");
public final static Property UpdateBy = new Property(29, String.class, "updateBy", false, "UPDATE_BY");
public final static Property UpdateTime = new Property(30, java.util.Date.class, "updateTime", false, "UPDATE_TIME");
public final static Property PeriodId = new Property(31, Long.class, "periodId", false, "PERIOD_ID");
public final static Property AbleDiscount = new Property(32, Long.class, "ableDiscount", false, "ABLE_DISCOUNT");
public final static Property Takeaway = new Property(33, Long.class, "takeaway", false, "TAKEAWAY");
public final static Property BlueEdit = new Property(34, Long.class, "blueEdit", false, "BLUE_EDIT");
public final static Property CartEdit = new Property(35, Long.class, "cartEdit", false, "CART_EDIT");
public final static Property AutoMerge = new Property(36, Long.class, "autoMerge", false, "AUTO_MERGE");
public final static Property FoodName1 = new Property(37, String.class, "foodName1", false, "FOOD_NAME1");
public final static Property FoodName2 = new Property(38, String.class, "foodName2", false, "FOOD_NAME2");
public final static Property Plu = new Property(39, String.class, "plu", false, "PLU");
public final static Property PrintSeting = new Property(40, String.class, "printSeting", false, "PRINT_SETING");
public final static Property IsPrintQueueCode = new Property(41, Long.class, "isPrintQueueCode", false, "IS_PRINT_QUEUE_CODE");
public final static Property QueueHeadId = new Property(42, Long.class, "queueHeadId", false, "QUEUE_HEAD_ID");
public final static Property Approve = new Property(43, Long.class, "approve", false, "APPROVE");
public final static Property PrintFont = new Property(44, Long.class, "printFont", false, "PRINT_FONT");
public final static Property AdvPrice = new Property(45, Long.class, "advPrice", false, "ADV_PRICE");
public final static Property PrintToBill = new Property(46, Long.class, "printToBill", false, "PRINT_TO_BILL");
public final static Property PointsAdd = new Property(47, Double.class, "pointsAdd", false, "POINTS_ADD");
public final static Property PointsRatio = new Property(48, Long.class, "pointsRatio", false, "POINTS_RATIO");
public final static Property PointsRedeem = new Property(49, Double.class, "pointsRedeem", false, "POINTS_REDEEM");
public final static Property KtPrintMainItem = new Property(50, Long.class, "ktPrintMainItem", false, "KT_PRINT_MAIN_ITEM");
public final static Property KtShowPrice = new Property(51, Long.class, "ktShowPrice", false, "KT_SHOW_PRICE");
public final static Property PrintTo = new Property(52, Long.class, "printTo", false, "PRINT_TO");
public final static Property ToPax = new Property(53, Long.class, "toPax", false, "TO_PAX");
public final static Property FoodType = new Property(54, Long.class, "foodType", false, "FOOD_TYPE");
public final static Property MajorMainId = new Property(55, Long.class, "majorMainId", false, "MAJOR_MAIN_ID");
public final static Property DeptId = new Property(56, Long.class, "deptId", false, "DEPT_ID");
public final static Property ServiceCharge = new Property(57, Byte.class, "serviceCharge", false, "SERVICE_CHARGE");
public final static Property ColorId = new Property(58, Long.class, "colorId", false, "COLOR_ID");
public final static Property Conditions = new Property(59, Long.class, "conditions", false, "CONDITIONS");
public final static Property IsRt = new Property(60, Long.class, "isRt", false, "IS_RT");
public final static Property Deletes = new Property(61, Long.class, "deletes", false, "DELETES");
public final static Property IsTimingFood = new Property(62, Long.class, "isTimingFood", false, "IS_TIMING_FOOD");
public final static Property MinLongTime = new Property(63, Long.class, "minLongTime", false, "MIN_LONG_TIME");
public final static Property UnitTime = new Property(64, Long.class, "unitTime", false, "UNIT_TIME");
public final static Property UnitPrice = new Property(65, Double.class, "unitPrice", false, "UNIT_PRICE");
public final static Property FreeLongTime = new Property(66, Long.class, "freeLongTime", false, "FREE_LONG_TIME");
public final static Property FreePeriodBegin = new Property(67, java.util.Date.class, "freePeriodBegin", false, "FREE_PERIOD_BEGIN");
public final static Property IsStatistic = new Property(68, Long.class, "isStatistic", false, "IS_STATISTIC");
public final static Property IsParent = new Property(4, Byte.class, "isParent", false, "IS_PARENT");
public final static Property SeqNo = new Property(5, Long.class, "seqNo", false, "SEQ_NO");
public final static Property FoodName = new Property(6, String.class, "foodName", false, "FOOD_NAME");
public final static Property FoodName1 = new Property(7, String.class, "foodName1", false, "FOOD_NAME1");
public final static Property FoodName2 = new Property(8, String.class, "foodName2", false, "FOOD_NAME2");
public final static Property Plu = new Property(9, String.class, "plu", false, "PLU");
public final static Property PosFid = new Property(10, String.class, "posFid", false, "POS_FID");
public final static Property FoodDesc = new Property(11, String.class, "foodDesc", false, "FOOD_DESC");
public final static Property LimitAmount = new Property(12, Long.class, "limitAmount", false, "LIMIT_AMOUNT");
public final static Property LimitType = new Property(13, Long.class, "limitType", false, "LIMIT_TYPE");
public final static Property FoodSummary = new Property(14, Long.class, "foodSummary", false, "FOOD_SUMMARY");
public final static Property Invisible = new Property(15, Long.class, "invisible", false, "INVISIBLE");
public final static Property AutoMod = new Property(16, Byte.class, "autoMod", false, "AUTO_MOD");
public final static Property Price = new Property(17, Double.class, "price", false, "PRICE");
public final static Property MarketPrice = new Property(18, Double.class, "marketPrice", false, "MARKET_PRICE");
public final static Property LunchboxPrice = new Property(19, Double.class, "lunchboxPrice", false, "LUNCHBOX_PRICE");
public final static Property ImgUrlSmall = new Property(20, String.class, "imgUrlSmall", false, "IMG_URL_SMALL");
public final static Property Imageurl = new Property(21, String.class, "imageurl", false, "IMAGEURL");
public final static Property RiceponInvisible = new Property(22, Long.class, "riceponInvisible", false, "RICEPON_INVISIBLE");
public final static Property Cost = new Property(23, Double.class, "cost", false, "COST");
public final static Property StartDate = new Property(24, java.util.Date.class, "startDate", false, "START_DATE");
public final static Property EndDate = new Property(25, java.util.Date.class, "endDate", false, "END_DATE");
public final static Property Like = new Property(26, Long.class, "like", false, "LIKE");
public final static Property TotalSold = new Property(27, Long.class, "totalSold", false, "TOTAL_SOLD");
public final static Property IsSold = new Property(28, Long.class, "isSold", false, "IS_SOLD");
public final static Property CreateBy = new Property(29, String.class, "createBy", false, "CREATE_BY");
public final static Property CreateTime = new Property(30, java.util.Date.class, "createTime", false, "CREATE_TIME");
public final static Property UpdateBy = new Property(31, String.class, "updateBy", false, "UPDATE_BY");
public final static Property UpdateTime = new Property(32, java.util.Date.class, "updateTime", false, "UPDATE_TIME");
public final static Property PeriodId = new Property(33, Long.class, "periodId", false, "PERIOD_ID");
public final static Property AbleDiscount = new Property(34, Long.class, "ableDiscount", false, "ABLE_DISCOUNT");
public final static Property Takeaway = new Property(35, Long.class, "takeaway", false, "TAKEAWAY");
public final static Property BlueEdit = new Property(36, Long.class, "blueEdit", false, "BLUE_EDIT");
public final static Property CartEdit = new Property(37, Long.class, "cartEdit", false, "CART_EDIT");
public final static Property AutoMerge = new Property(38, Long.class, "autoMerge", false, "AUTO_MERGE");
public final static Property PrintSeting = new Property(39, String.class, "printSeting", false, "PRINT_SETING");
public final static Property IsPrintQueueCode = new Property(40, Long.class, "isPrintQueueCode", false, "IS_PRINT_QUEUE_CODE");
public final static Property QueueHeadId = new Property(41, Long.class, "queueHeadId", false, "QUEUE_HEAD_ID");
public final static Property Approve = new Property(42, Long.class, "approve", false, "APPROVE");
public final static Property PrintFont = new Property(43, Long.class, "printFont", false, "PRINT_FONT");
public final static Property AdvPrice = new Property(44, Long.class, "advPrice", false, "ADV_PRICE");
public final static Property PrintToBill = new Property(45, Long.class, "printToBill", false, "PRINT_TO_BILL");
public final static Property PointsAdd = new Property(46, Double.class, "pointsAdd", false, "POINTS_ADD");
public final static Property PointsRatio = new Property(47, Long.class, "pointsRatio", false, "POINTS_RATIO");
public final static Property PointsRedeem = new Property(48, Double.class, "pointsRedeem", false, "POINTS_REDEEM");
public final static Property KtPrintMainItem = new Property(49, Long.class, "ktPrintMainItem", false, "KT_PRINT_MAIN_ITEM");
public final static Property KtShowPrice = new Property(50, Long.class, "ktShowPrice", false, "KT_SHOW_PRICE");
public final static Property PrintTo = new Property(51, Long.class, "printTo", false, "PRINT_TO");
public final static Property ToPax = new Property(52, Long.class, "toPax", false, "TO_PAX");
public final static Property FoodType = new Property(53, Long.class, "foodType", false, "FOOD_TYPE");
public final static Property MajorMainId = new Property(54, Long.class, "majorMainId", false, "MAJOR_MAIN_ID");
public final static Property DeptId = new Property(55, Long.class, "deptId", false, "DEPT_ID");
public final static Property ServiceCharge = new Property(56, Byte.class, "serviceCharge", false, "SERVICE_CHARGE");
public final static Property ColorId = new Property(57, Long.class, "colorId", false, "COLOR_ID");
public final static Property Conditions = new Property(58, Long.class, "conditions", false, "CONDITIONS");
public final static Property IsRt = new Property(59, Long.class, "isRt", false, "IS_RT");
public final static Property Deletes = new Property(60, Long.class, "deletes", false, "DELETES");
public final static Property IsTimingFood = new Property(61, Long.class, "isTimingFood", false, "IS_TIMING_FOOD");
public final static Property MinLongTime = new Property(62, Long.class, "minLongTime", false, "MIN_LONG_TIME");
public final static Property UnitTime = new Property(63, Long.class, "unitTime", false, "UNIT_TIME");
public final static Property UnitPrice = new Property(64, Double.class, "unitPrice", false, "UNIT_PRICE");
public final static Property FreeLongTime = new Property(65, Long.class, "freeLongTime", false, "FREE_LONG_TIME");
public final static Property FreePeriodBegin = new Property(66, java.util.Date.class, "freePeriodBegin", false, "FREE_PERIOD_BEGIN");
public final static Property IsStatistic = new Property(67, Long.class, "isStatistic", false, "IS_STATISTIC");
}
private Query<Food> combo_FoodsQuery;
......@@ -116,71 +115,70 @@ public class FoodDao extends AbstractDao<Food, Long> {
"\"ID\" INTEGER," + // 1: id
"\"PARENT_ID\" INTEGER," + // 2: parentId
"\"RESTAURANT_ID\" INTEGER," + // 3: restaurantId
"\"FID\" TEXT," + // 4: fid
"\"IS_PARENT\" INTEGER," + // 5: isParent
"\"SEQ_NO\" INTEGER," + // 6: seqNo
"\"FOOD_NAME\" TEXT," + // 7: foodName
"\"POS_FID\" TEXT," + // 8: posFid
"\"FOOD_DESC\" TEXT," + // 9: foodDesc
"\"LIMIT_AMOUNT\" INTEGER," + // 10: limitAmount
"\"LIMIT_TYPE\" INTEGER," + // 11: limitType
"\"FOOD_SUMMARY\" INTEGER," + // 12: foodSummary
"\"INVISIBLE\" INTEGER," + // 13: invisible
"\"AUTO_MOD\" INTEGER," + // 14: autoMod
"\"PRICE\" REAL," + // 15: price
"\"MARKET_PRICE\" REAL," + // 16: marketPrice
"\"LUNCHBOX_PRICE\" REAL," + // 17: lunchboxPrice
"\"IMG_URL_SMALL\" TEXT," + // 18: imgUrlSmall
"\"IMAGEURL\" TEXT," + // 19: imageurl
"\"RICEPON_INVISIBLE\" INTEGER," + // 20: riceponInvisible
"\"COST\" REAL," + // 21: cost
"\"START_DATE\" INTEGER," + // 22: startDate
"\"END_DATE\" INTEGER," + // 23: endDate
"\"LIKE\" INTEGER," + // 24: like
"\"TOTAL_SOLD\" INTEGER," + // 25: totalSold
"\"IS_SOLD\" INTEGER," + // 26: isSold
"\"CREATE_BY\" TEXT," + // 27: createBy
"\"CREATE_TIME\" INTEGER," + // 28: createTime
"\"UPDATE_BY\" TEXT," + // 29: updateBy
"\"UPDATE_TIME\" INTEGER," + // 30: updateTime
"\"PERIOD_ID\" INTEGER," + // 31: periodId
"\"ABLE_DISCOUNT\" INTEGER," + // 32: ableDiscount
"\"TAKEAWAY\" INTEGER," + // 33: takeaway
"\"BLUE_EDIT\" INTEGER," + // 34: blueEdit
"\"CART_EDIT\" INTEGER," + // 35: cartEdit
"\"AUTO_MERGE\" INTEGER," + // 36: autoMerge
"\"FOOD_NAME1\" TEXT," + // 37: foodName1
"\"FOOD_NAME2\" TEXT," + // 38: foodName2
"\"PLU\" TEXT," + // 39: plu
"\"PRINT_SETING\" TEXT," + // 40: printSeting
"\"IS_PRINT_QUEUE_CODE\" INTEGER," + // 41: isPrintQueueCode
"\"QUEUE_HEAD_ID\" INTEGER," + // 42: queueHeadId
"\"APPROVE\" INTEGER," + // 43: approve
"\"PRINT_FONT\" INTEGER," + // 44: printFont
"\"ADV_PRICE\" INTEGER," + // 45: advPrice
"\"PRINT_TO_BILL\" INTEGER," + // 46: printToBill
"\"POINTS_ADD\" REAL," + // 47: pointsAdd
"\"POINTS_RATIO\" INTEGER," + // 48: pointsRatio
"\"POINTS_REDEEM\" REAL," + // 49: pointsRedeem
"\"KT_PRINT_MAIN_ITEM\" INTEGER," + // 50: ktPrintMainItem
"\"KT_SHOW_PRICE\" INTEGER," + // 51: ktShowPrice
"\"PRINT_TO\" INTEGER," + // 52: printTo
"\"TO_PAX\" INTEGER," + // 53: toPax
"\"FOOD_TYPE\" INTEGER," + // 54: foodType
"\"MAJOR_MAIN_ID\" INTEGER," + // 55: majorMainId
"\"DEPT_ID\" INTEGER," + // 56: deptId
"\"SERVICE_CHARGE\" INTEGER," + // 57: serviceCharge
"\"COLOR_ID\" INTEGER," + // 58: colorId
"\"CONDITIONS\" INTEGER," + // 59: conditions
"\"IS_RT\" INTEGER," + // 60: isRt
"\"DELETES\" INTEGER," + // 61: deletes
"\"IS_TIMING_FOOD\" INTEGER," + // 62: isTimingFood
"\"MIN_LONG_TIME\" INTEGER," + // 63: minLongTime
"\"UNIT_TIME\" INTEGER," + // 64: unitTime
"\"UNIT_PRICE\" REAL," + // 65: unitPrice
"\"FREE_LONG_TIME\" INTEGER," + // 66: freeLongTime
"\"FREE_PERIOD_BEGIN\" INTEGER," + // 67: freePeriodBegin
"\"IS_STATISTIC\" INTEGER);"); // 68: isStatistic
"\"IS_PARENT\" INTEGER," + // 4: isParent
"\"SEQ_NO\" INTEGER," + // 5: seqNo
"\"FOOD_NAME\" TEXT," + // 6: foodName
"\"FOOD_NAME1\" TEXT," + // 7: foodName1
"\"FOOD_NAME2\" TEXT," + // 8: foodName2
"\"PLU\" TEXT," + // 9: plu
"\"POS_FID\" TEXT," + // 10: posFid
"\"FOOD_DESC\" TEXT," + // 11: foodDesc
"\"LIMIT_AMOUNT\" INTEGER," + // 12: limitAmount
"\"LIMIT_TYPE\" INTEGER," + // 13: limitType
"\"FOOD_SUMMARY\" INTEGER," + // 14: foodSummary
"\"INVISIBLE\" INTEGER," + // 15: invisible
"\"AUTO_MOD\" INTEGER," + // 16: autoMod
"\"PRICE\" REAL," + // 17: price
"\"MARKET_PRICE\" REAL," + // 18: marketPrice
"\"LUNCHBOX_PRICE\" REAL," + // 19: lunchboxPrice
"\"IMG_URL_SMALL\" TEXT," + // 20: imgUrlSmall
"\"IMAGEURL\" TEXT," + // 21: imageurl
"\"RICEPON_INVISIBLE\" INTEGER," + // 22: riceponInvisible
"\"COST\" REAL," + // 23: cost
"\"START_DATE\" INTEGER," + // 24: startDate
"\"END_DATE\" INTEGER," + // 25: endDate
"\"LIKE\" INTEGER," + // 26: like
"\"TOTAL_SOLD\" INTEGER," + // 27: totalSold
"\"IS_SOLD\" INTEGER," + // 28: isSold
"\"CREATE_BY\" TEXT," + // 29: createBy
"\"CREATE_TIME\" INTEGER," + // 30: createTime
"\"UPDATE_BY\" TEXT," + // 31: updateBy
"\"UPDATE_TIME\" INTEGER," + // 32: updateTime
"\"PERIOD_ID\" INTEGER," + // 33: periodId
"\"ABLE_DISCOUNT\" INTEGER," + // 34: ableDiscount
"\"TAKEAWAY\" INTEGER," + // 35: takeaway
"\"BLUE_EDIT\" INTEGER," + // 36: blueEdit
"\"CART_EDIT\" INTEGER," + // 37: cartEdit
"\"AUTO_MERGE\" INTEGER," + // 38: autoMerge
"\"PRINT_SETING\" TEXT," + // 39: printSeting
"\"IS_PRINT_QUEUE_CODE\" INTEGER," + // 40: isPrintQueueCode
"\"QUEUE_HEAD_ID\" INTEGER," + // 41: queueHeadId
"\"APPROVE\" INTEGER," + // 42: approve
"\"PRINT_FONT\" INTEGER," + // 43: printFont
"\"ADV_PRICE\" INTEGER," + // 44: advPrice
"\"PRINT_TO_BILL\" INTEGER," + // 45: printToBill
"\"POINTS_ADD\" REAL," + // 46: pointsAdd
"\"POINTS_RATIO\" INTEGER," + // 47: pointsRatio
"\"POINTS_REDEEM\" REAL," + // 48: pointsRedeem
"\"KT_PRINT_MAIN_ITEM\" INTEGER," + // 49: ktPrintMainItem
"\"KT_SHOW_PRICE\" INTEGER," + // 50: ktShowPrice
"\"PRINT_TO\" INTEGER," + // 51: printTo
"\"TO_PAX\" INTEGER," + // 52: toPax
"\"FOOD_TYPE\" INTEGER," + // 53: foodType
"\"MAJOR_MAIN_ID\" INTEGER," + // 54: majorMainId
"\"DEPT_ID\" INTEGER," + // 55: deptId
"\"SERVICE_CHARGE\" INTEGER," + // 56: serviceCharge
"\"COLOR_ID\" INTEGER," + // 57: colorId
"\"CONDITIONS\" INTEGER," + // 58: conditions
"\"IS_RT\" INTEGER," + // 59: isRt
"\"DELETES\" INTEGER," + // 60: deletes
"\"IS_TIMING_FOOD\" INTEGER," + // 61: isTimingFood
"\"MIN_LONG_TIME\" INTEGER," + // 62: minLongTime
"\"UNIT_TIME\" INTEGER," + // 63: unitTime
"\"UNIT_PRICE\" REAL," + // 64: unitPrice
"\"FREE_LONG_TIME\" INTEGER," + // 65: freeLongTime
"\"FREE_PERIOD_BEGIN\" INTEGER," + // 66: freePeriodBegin
"\"IS_STATISTIC\" INTEGER);"); // 67: isStatistic
}
/** Drops the underlying database table. */
......@@ -213,329 +211,324 @@ public class FoodDao extends AbstractDao<Food, Long> {
stmt.bindLong(4, restaurantId);
}
String fid = entity.getFid();
if (fid != null) {
stmt.bindString(5, fid);
}
Byte isParent = entity.getIsParent();
if (isParent != null) {
stmt.bindLong(6, isParent);
stmt.bindLong(5, isParent);
}
Long seqNo = entity.getSeqNo();
if (seqNo != null) {
stmt.bindLong(7, seqNo);
stmt.bindLong(6, seqNo);
}
String foodName = entity.getFoodName();
if (foodName != null) {
stmt.bindString(8, foodName);
stmt.bindString(7, foodName);
}
String foodName1 = entity.getFoodName1();
if (foodName1 != null) {
stmt.bindString(8, foodName1);
}
String foodName2 = entity.getFoodName2();
if (foodName2 != null) {
stmt.bindString(9, foodName2);
}
String plu = entity.getPlu();
if (plu != null) {
stmt.bindString(10, plu);
}
String posFid = entity.getPosFid();
if (posFid != null) {
stmt.bindString(9, posFid);
stmt.bindString(11, posFid);
}
String foodDesc = entity.getFoodDesc();
if (foodDesc != null) {
stmt.bindString(10, foodDesc);
stmt.bindString(12, foodDesc);
}
Long limitAmount = entity.getLimitAmount();
if (limitAmount != null) {
stmt.bindLong(11, limitAmount);
stmt.bindLong(13, limitAmount);
}
Long limitType = entity.getLimitType();
if (limitType != null) {
stmt.bindLong(12, limitType);
stmt.bindLong(14, limitType);
}
Long foodSummary = entity.getFoodSummary();
if (foodSummary != null) {
stmt.bindLong(13, foodSummary);
stmt.bindLong(15, foodSummary);
}
Long invisible = entity.getInvisible();
if (invisible != null) {
stmt.bindLong(14, invisible);
stmt.bindLong(16, invisible);
}
Byte autoMod = entity.getAutoMod();
if (autoMod != null) {
stmt.bindLong(15, autoMod);
stmt.bindLong(17, autoMod);
}
Double price = entity.getPrice();
if (price != null) {
stmt.bindDouble(16, price);
stmt.bindDouble(18, price);
}
Double marketPrice = entity.getMarketPrice();
if (marketPrice != null) {
stmt.bindDouble(17, marketPrice);
stmt.bindDouble(19, marketPrice);
}
Double lunchboxPrice = entity.getLunchboxPrice();
if (lunchboxPrice != null) {
stmt.bindDouble(18, lunchboxPrice);
stmt.bindDouble(20, lunchboxPrice);
}
String imgUrlSmall = entity.getImgUrlSmall();
if (imgUrlSmall != null) {
stmt.bindString(19, imgUrlSmall);
stmt.bindString(21, imgUrlSmall);
}
String imageurl = entity.getImageurl();
if (imageurl != null) {
stmt.bindString(20, imageurl);
stmt.bindString(22, imageurl);
}
Long riceponInvisible = entity.getRiceponInvisible();
if (riceponInvisible != null) {
stmt.bindLong(21, riceponInvisible);
stmt.bindLong(23, riceponInvisible);
}
Double cost = entity.getCost();
if (cost != null) {
stmt.bindDouble(22, cost);
stmt.bindDouble(24, cost);
}
java.util.Date startDate = entity.getStartDate();
if (startDate != null) {
stmt.bindLong(23, startDate.getTime());
stmt.bindLong(25, startDate.getTime());
}
java.util.Date endDate = entity.getEndDate();
if (endDate != null) {
stmt.bindLong(24, endDate.getTime());
stmt.bindLong(26, endDate.getTime());
}
Long like = entity.getLike();
if (like != null) {
stmt.bindLong(25, like);
stmt.bindLong(27, like);
}
Long totalSold = entity.getTotalSold();
if (totalSold != null) {
stmt.bindLong(26, totalSold);
stmt.bindLong(28, totalSold);
}
Long isSold = entity.getIsSold();
if (isSold != null) {
stmt.bindLong(27, isSold);
stmt.bindLong(29, isSold);
}
String createBy = entity.getCreateBy();
if (createBy != null) {
stmt.bindString(28, createBy);
stmt.bindString(30, createBy);
}
java.util.Date createTime = entity.getCreateTime();
if (createTime != null) {
stmt.bindLong(29, createTime.getTime());
stmt.bindLong(31, createTime.getTime());
}
String updateBy = entity.getUpdateBy();
if (updateBy != null) {
stmt.bindString(30, updateBy);
stmt.bindString(32, updateBy);
}
java.util.Date updateTime = entity.getUpdateTime();
if (updateTime != null) {
stmt.bindLong(31, updateTime.getTime());
stmt.bindLong(33, updateTime.getTime());
}
Long periodId = entity.getPeriodId();
if (periodId != null) {
stmt.bindLong(32, periodId);
stmt.bindLong(34, periodId);
}
Long ableDiscount = entity.getAbleDiscount();
if (ableDiscount != null) {
stmt.bindLong(33, ableDiscount);
stmt.bindLong(35, ableDiscount);
}
Long takeaway = entity.getTakeaway();
if (takeaway != null) {
stmt.bindLong(34, takeaway);
stmt.bindLong(36, takeaway);
}
Long blueEdit = entity.getBlueEdit();
if (blueEdit != null) {
stmt.bindLong(35, blueEdit);
stmt.bindLong(37, blueEdit);
}
Long cartEdit = entity.getCartEdit();
if (cartEdit != null) {
stmt.bindLong(36, cartEdit);
stmt.bindLong(38, cartEdit);
}
Long autoMerge = entity.getAutoMerge();
if (autoMerge != null) {
stmt.bindLong(37, autoMerge);
}
String foodName1 = entity.getFoodName1();
if (foodName1 != null) {
stmt.bindString(38, foodName1);
}
String foodName2 = entity.getFoodName2();
if (foodName2 != null) {
stmt.bindString(39, foodName2);
}
String plu = entity.getPlu();
if (plu != null) {
stmt.bindString(40, plu);
stmt.bindLong(39, autoMerge);
}
String printSeting = entity.getPrintSeting();
if (printSeting != null) {
stmt.bindString(41, printSeting);
stmt.bindString(40, printSeting);
}
Long isPrintQueueCode = entity.getIsPrintQueueCode();
if (isPrintQueueCode != null) {
stmt.bindLong(42, isPrintQueueCode);
stmt.bindLong(41, isPrintQueueCode);
}
Long queueHeadId = entity.getQueueHeadId();
if (queueHeadId != null) {
stmt.bindLong(43, queueHeadId);
stmt.bindLong(42, queueHeadId);
}
Long approve = entity.getApprove();
if (approve != null) {
stmt.bindLong(44, approve);
stmt.bindLong(43, approve);
}
Long printFont = entity.getPrintFont();
if (printFont != null) {
stmt.bindLong(45, printFont);
stmt.bindLong(44, printFont);
}
Long advPrice = entity.getAdvPrice();
if (advPrice != null) {
stmt.bindLong(46, advPrice);
stmt.bindLong(45, advPrice);
}
Long printToBill = entity.getPrintToBill();
if (printToBill != null) {
stmt.bindLong(47, printToBill);
stmt.bindLong(46, printToBill);
}
Double pointsAdd = entity.getPointsAdd();
if (pointsAdd != null) {
stmt.bindDouble(48, pointsAdd);
stmt.bindDouble(47, pointsAdd);
}
Long pointsRatio = entity.getPointsRatio();
if (pointsRatio != null) {
stmt.bindLong(49, pointsRatio);
stmt.bindLong(48, pointsRatio);
}
Double pointsRedeem = entity.getPointsRedeem();
if (pointsRedeem != null) {
stmt.bindDouble(50, pointsRedeem);
stmt.bindDouble(49, pointsRedeem);
}
Long ktPrintMainItem = entity.getKtPrintMainItem();
if (ktPrintMainItem != null) {
stmt.bindLong(51, ktPrintMainItem);
stmt.bindLong(50, ktPrintMainItem);
}
Long ktShowPrice = entity.getKtShowPrice();
if (ktShowPrice != null) {
stmt.bindLong(52, ktShowPrice);
stmt.bindLong(51, ktShowPrice);
}
Long printTo = entity.getPrintTo();
if (printTo != null) {
stmt.bindLong(53, printTo);
stmt.bindLong(52, printTo);
}
Long toPax = entity.getToPax();
if (toPax != null) {
stmt.bindLong(54, toPax);
stmt.bindLong(53, toPax);
}
Long foodType = entity.getFoodType();
if (foodType != null) {
stmt.bindLong(55, foodType);
stmt.bindLong(54, foodType);
}
Long majorMainId = entity.getMajorMainId();
if (majorMainId != null) {
stmt.bindLong(56, majorMainId);
stmt.bindLong(55, majorMainId);
}
Long deptId = entity.getDeptId();
if (deptId != null) {
stmt.bindLong(57, deptId);
stmt.bindLong(56, deptId);
}
Byte serviceCharge = entity.getServiceCharge();
if (serviceCharge != null) {
stmt.bindLong(58, serviceCharge);
stmt.bindLong(57, serviceCharge);
}
Long colorId = entity.getColorId();
if (colorId != null) {
stmt.bindLong(59, colorId);
stmt.bindLong(58, colorId);
}
Long conditions = entity.getConditions();
if (conditions != null) {
stmt.bindLong(60, conditions);
stmt.bindLong(59, conditions);
}
Long isRt = entity.getIsRt();
if (isRt != null) {
stmt.bindLong(61, isRt);
stmt.bindLong(60, isRt);
}
Long deletes = entity.getDeletes();
if (deletes != null) {
stmt.bindLong(62, deletes);
stmt.bindLong(61, deletes);
}
Long isTimingFood = entity.getIsTimingFood();
if (isTimingFood != null) {
stmt.bindLong(63, isTimingFood);
stmt.bindLong(62, isTimingFood);
}
Long minLongTime = entity.getMinLongTime();
if (minLongTime != null) {
stmt.bindLong(64, minLongTime);
stmt.bindLong(63, minLongTime);
}
Long unitTime = entity.getUnitTime();
if (unitTime != null) {
stmt.bindLong(65, unitTime);
stmt.bindLong(64, unitTime);
}
Double unitPrice = entity.getUnitPrice();
if (unitPrice != null) {
stmt.bindDouble(66, unitPrice);
stmt.bindDouble(65, unitPrice);
}
Long freeLongTime = entity.getFreeLongTime();
if (freeLongTime != null) {
stmt.bindLong(67, freeLongTime);
stmt.bindLong(66, freeLongTime);
}
java.util.Date freePeriodBegin = entity.getFreePeriodBegin();
if (freePeriodBegin != null) {
stmt.bindLong(68, freePeriodBegin.getTime());
stmt.bindLong(67, freePeriodBegin.getTime());
}
Long isStatistic = entity.getIsStatistic();
if (isStatistic != null) {
stmt.bindLong(69, isStatistic);
stmt.bindLong(68, isStatistic);
}
}
......@@ -563,329 +556,324 @@ public class FoodDao extends AbstractDao<Food, Long> {
stmt.bindLong(4, restaurantId);
}
String fid = entity.getFid();
if (fid != null) {
stmt.bindString(5, fid);
}
Byte isParent = entity.getIsParent();
if (isParent != null) {
stmt.bindLong(6, isParent);
stmt.bindLong(5, isParent);
}
Long seqNo = entity.getSeqNo();
if (seqNo != null) {
stmt.bindLong(7, seqNo);
stmt.bindLong(6, seqNo);
}
String foodName = entity.getFoodName();
if (foodName != null) {
stmt.bindString(8, foodName);
stmt.bindString(7, foodName);
}
String foodName1 = entity.getFoodName1();
if (foodName1 != null) {
stmt.bindString(8, foodName1);
}
String foodName2 = entity.getFoodName2();
if (foodName2 != null) {
stmt.bindString(9, foodName2);
}
String plu = entity.getPlu();
if (plu != null) {
stmt.bindString(10, plu);
}
String posFid = entity.getPosFid();
if (posFid != null) {
stmt.bindString(9, posFid);
stmt.bindString(11, posFid);
}
String foodDesc = entity.getFoodDesc();
if (foodDesc != null) {
stmt.bindString(10, foodDesc);
stmt.bindString(12, foodDesc);
}
Long limitAmount = entity.getLimitAmount();
if (limitAmount != null) {
stmt.bindLong(11, limitAmount);
stmt.bindLong(13, limitAmount);
}
Long limitType = entity.getLimitType();
if (limitType != null) {
stmt.bindLong(12, limitType);
stmt.bindLong(14, limitType);
}
Long foodSummary = entity.getFoodSummary();
if (foodSummary != null) {
stmt.bindLong(13, foodSummary);
stmt.bindLong(15, foodSummary);
}
Long invisible = entity.getInvisible();
if (invisible != null) {
stmt.bindLong(14, invisible);
stmt.bindLong(16, invisible);
}
Byte autoMod = entity.getAutoMod();
if (autoMod != null) {
stmt.bindLong(15, autoMod);
stmt.bindLong(17, autoMod);
}
Double price = entity.getPrice();
if (price != null) {
stmt.bindDouble(16, price);
stmt.bindDouble(18, price);
}
Double marketPrice = entity.getMarketPrice();
if (marketPrice != null) {
stmt.bindDouble(17, marketPrice);
stmt.bindDouble(19, marketPrice);
}
Double lunchboxPrice = entity.getLunchboxPrice();
if (lunchboxPrice != null) {
stmt.bindDouble(18, lunchboxPrice);
stmt.bindDouble(20, lunchboxPrice);
}
String imgUrlSmall = entity.getImgUrlSmall();
if (imgUrlSmall != null) {
stmt.bindString(19, imgUrlSmall);
stmt.bindString(21, imgUrlSmall);
}
String imageurl = entity.getImageurl();
if (imageurl != null) {
stmt.bindString(20, imageurl);
stmt.bindString(22, imageurl);
}
Long riceponInvisible = entity.getRiceponInvisible();
if (riceponInvisible != null) {
stmt.bindLong(21, riceponInvisible);
stmt.bindLong(23, riceponInvisible);
}
Double cost = entity.getCost();
if (cost != null) {
stmt.bindDouble(22, cost);
stmt.bindDouble(24, cost);
}
java.util.Date startDate = entity.getStartDate();
if (startDate != null) {
stmt.bindLong(23, startDate.getTime());
stmt.bindLong(25, startDate.getTime());
}
java.util.Date endDate = entity.getEndDate();
if (endDate != null) {
stmt.bindLong(24, endDate.getTime());
stmt.bindLong(26, endDate.getTime());
}
Long like = entity.getLike();
if (like != null) {
stmt.bindLong(25, like);
stmt.bindLong(27, like);
}
Long totalSold = entity.getTotalSold();
if (totalSold != null) {
stmt.bindLong(26, totalSold);
stmt.bindLong(28, totalSold);
}
Long isSold = entity.getIsSold();
if (isSold != null) {
stmt.bindLong(27, isSold);
stmt.bindLong(29, isSold);
}
String createBy = entity.getCreateBy();
if (createBy != null) {
stmt.bindString(28, createBy);
stmt.bindString(30, createBy);
}
java.util.Date createTime = entity.getCreateTime();
if (createTime != null) {
stmt.bindLong(29, createTime.getTime());
stmt.bindLong(31, createTime.getTime());
}
String updateBy = entity.getUpdateBy();
if (updateBy != null) {
stmt.bindString(30, updateBy);
stmt.bindString(32, updateBy);
}
java.util.Date updateTime = entity.getUpdateTime();
if (updateTime != null) {
stmt.bindLong(31, updateTime.getTime());
stmt.bindLong(33, updateTime.getTime());
}
Long periodId = entity.getPeriodId();
if (periodId != null) {
stmt.bindLong(32, periodId);
stmt.bindLong(34, periodId);
}
Long ableDiscount = entity.getAbleDiscount();
if (ableDiscount != null) {
stmt.bindLong(33, ableDiscount);
stmt.bindLong(35, ableDiscount);
}
Long takeaway = entity.getTakeaway();
if (takeaway != null) {
stmt.bindLong(34, takeaway);
stmt.bindLong(36, takeaway);
}
Long blueEdit = entity.getBlueEdit();
if (blueEdit != null) {
stmt.bindLong(35, blueEdit);
stmt.bindLong(37, blueEdit);
}
Long cartEdit = entity.getCartEdit();
if (cartEdit != null) {
stmt.bindLong(36, cartEdit);
stmt.bindLong(38, cartEdit);
}
Long autoMerge = entity.getAutoMerge();
if (autoMerge != null) {
stmt.bindLong(37, autoMerge);
}
String foodName1 = entity.getFoodName1();
if (foodName1 != null) {
stmt.bindString(38, foodName1);
}
String foodName2 = entity.getFoodName2();
if (foodName2 != null) {
stmt.bindString(39, foodName2);
}
String plu = entity.getPlu();
if (plu != null) {
stmt.bindString(40, plu);
stmt.bindLong(39, autoMerge);
}
String printSeting = entity.getPrintSeting();
if (printSeting != null) {
stmt.bindString(41, printSeting);
stmt.bindString(40, printSeting);
}
Long isPrintQueueCode = entity.getIsPrintQueueCode();
if (isPrintQueueCode != null) {
stmt.bindLong(42, isPrintQueueCode);
stmt.bindLong(41, isPrintQueueCode);
}
Long queueHeadId = entity.getQueueHeadId();
if (queueHeadId != null) {
stmt.bindLong(43, queueHeadId);
stmt.bindLong(42, queueHeadId);
}
Long approve = entity.getApprove();
if (approve != null) {
stmt.bindLong(44, approve);
stmt.bindLong(43, approve);
}
Long printFont = entity.getPrintFont();
if (printFont != null) {
stmt.bindLong(45, printFont);
stmt.bindLong(44, printFont);
}
Long advPrice = entity.getAdvPrice();
if (advPrice != null) {
stmt.bindLong(46, advPrice);
stmt.bindLong(45, advPrice);
}
Long printToBill = entity.getPrintToBill();
if (printToBill != null) {
stmt.bindLong(47, printToBill);
stmt.bindLong(46, printToBill);
}
Double pointsAdd = entity.getPointsAdd();
if (pointsAdd != null) {
stmt.bindDouble(48, pointsAdd);
stmt.bindDouble(47, pointsAdd);
}
Long pointsRatio = entity.getPointsRatio();
if (pointsRatio != null) {
stmt.bindLong(49, pointsRatio);
stmt.bindLong(48, pointsRatio);
}
Double pointsRedeem = entity.getPointsRedeem();
if (pointsRedeem != null) {
stmt.bindDouble(50, pointsRedeem);
stmt.bindDouble(49, pointsRedeem);
}
Long ktPrintMainItem = entity.getKtPrintMainItem();
if (ktPrintMainItem != null) {
stmt.bindLong(51, ktPrintMainItem);
stmt.bindLong(50, ktPrintMainItem);
}
Long ktShowPrice = entity.getKtShowPrice();
if (ktShowPrice != null) {
stmt.bindLong(52, ktShowPrice);
stmt.bindLong(51, ktShowPrice);
}
Long printTo = entity.getPrintTo();
if (printTo != null) {
stmt.bindLong(53, printTo);
stmt.bindLong(52, printTo);
}
Long toPax = entity.getToPax();
if (toPax != null) {
stmt.bindLong(54, toPax);
stmt.bindLong(53, toPax);
}
Long foodType = entity.getFoodType();
if (foodType != null) {
stmt.bindLong(55, foodType);
stmt.bindLong(54, foodType);
}
Long majorMainId = entity.getMajorMainId();
if (majorMainId != null) {
stmt.bindLong(56, majorMainId);
stmt.bindLong(55, majorMainId);
}
Long deptId = entity.getDeptId();
if (deptId != null) {
stmt.bindLong(57, deptId);
stmt.bindLong(56, deptId);
}
Byte serviceCharge = entity.getServiceCharge();
if (serviceCharge != null) {
stmt.bindLong(58, serviceCharge);
stmt.bindLong(57, serviceCharge);
}
Long colorId = entity.getColorId();
if (colorId != null) {
stmt.bindLong(59, colorId);
stmt.bindLong(58, colorId);
}
Long conditions = entity.getConditions();
if (conditions != null) {
stmt.bindLong(60, conditions);
stmt.bindLong(59, conditions);
}
Long isRt = entity.getIsRt();
if (isRt != null) {
stmt.bindLong(61, isRt);
stmt.bindLong(60, isRt);
}
Long deletes = entity.getDeletes();
if (deletes != null) {
stmt.bindLong(62, deletes);
stmt.bindLong(61, deletes);
}
Long isTimingFood = entity.getIsTimingFood();
if (isTimingFood != null) {
stmt.bindLong(63, isTimingFood);
stmt.bindLong(62, isTimingFood);
}
Long minLongTime = entity.getMinLongTime();
if (minLongTime != null) {
stmt.bindLong(64, minLongTime);
stmt.bindLong(63, minLongTime);
}
Long unitTime = entity.getUnitTime();
if (unitTime != null) {
stmt.bindLong(65, unitTime);
stmt.bindLong(64, unitTime);
}
Double unitPrice = entity.getUnitPrice();
if (unitPrice != null) {
stmt.bindDouble(66, unitPrice);
stmt.bindDouble(65, unitPrice);
}
Long freeLongTime = entity.getFreeLongTime();
if (freeLongTime != null) {
stmt.bindLong(67, freeLongTime);
stmt.bindLong(66, freeLongTime);
}
java.util.Date freePeriodBegin = entity.getFreePeriodBegin();
if (freePeriodBegin != null) {
stmt.bindLong(68, freePeriodBegin.getTime());
stmt.bindLong(67, freePeriodBegin.getTime());
}
Long isStatistic = entity.getIsStatistic();
if (isStatistic != null) {
stmt.bindLong(69, isStatistic);
stmt.bindLong(68, isStatistic);
}
}
......@@ -901,71 +889,70 @@ public class FoodDao extends AbstractDao<Food, Long> {
cursor.isNull(offset + 1) ? null : cursor.getLong(offset + 1), // id
cursor.isNull(offset + 2) ? null : cursor.getLong(offset + 2), // parentId
cursor.isNull(offset + 3) ? null : cursor.getLong(offset + 3), // restaurantId
cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // fid
cursor.isNull(offset + 5) ? null : (byte) cursor.getShort(offset + 5), // isParent
cursor.isNull(offset + 6) ? null : cursor.getLong(offset + 6), // seqNo
cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // foodName
cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // posFid
cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // foodDesc
cursor.isNull(offset + 10) ? null : cursor.getLong(offset + 10), // limitAmount
cursor.isNull(offset + 11) ? null : cursor.getLong(offset + 11), // limitType
cursor.isNull(offset + 12) ? null : cursor.getLong(offset + 12), // foodSummary
cursor.isNull(offset + 13) ? null : cursor.getLong(offset + 13), // invisible
cursor.isNull(offset + 14) ? null : (byte) cursor.getShort(offset + 14), // autoMod
cursor.isNull(offset + 15) ? null : cursor.getDouble(offset + 15), // price
cursor.isNull(offset + 16) ? null : cursor.getDouble(offset + 16), // marketPrice
cursor.isNull(offset + 17) ? null : cursor.getDouble(offset + 17), // lunchboxPrice
cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // imgUrlSmall
cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // imageurl
cursor.isNull(offset + 20) ? null : cursor.getLong(offset + 20), // riceponInvisible
cursor.isNull(offset + 21) ? null : cursor.getDouble(offset + 21), // cost
cursor.isNull(offset + 22) ? null : new java.util.Date(cursor.getLong(offset + 22)), // startDate
cursor.isNull(offset + 23) ? null : new java.util.Date(cursor.getLong(offset + 23)), // endDate
cursor.isNull(offset + 24) ? null : cursor.getLong(offset + 24), // like
cursor.isNull(offset + 25) ? null : cursor.getLong(offset + 25), // totalSold
cursor.isNull(offset + 26) ? null : cursor.getLong(offset + 26), // isSold
cursor.isNull(offset + 27) ? null : cursor.getString(offset + 27), // createBy
cursor.isNull(offset + 28) ? null : new java.util.Date(cursor.getLong(offset + 28)), // createTime
cursor.isNull(offset + 29) ? null : cursor.getString(offset + 29), // updateBy
cursor.isNull(offset + 30) ? null : new java.util.Date(cursor.getLong(offset + 30)), // updateTime
cursor.isNull(offset + 31) ? null : cursor.getLong(offset + 31), // periodId
cursor.isNull(offset + 32) ? null : cursor.getLong(offset + 32), // ableDiscount
cursor.isNull(offset + 33) ? null : cursor.getLong(offset + 33), // takeaway
cursor.isNull(offset + 34) ? null : cursor.getLong(offset + 34), // blueEdit
cursor.isNull(offset + 35) ? null : cursor.getLong(offset + 35), // cartEdit
cursor.isNull(offset + 36) ? null : cursor.getLong(offset + 36), // autoMerge
cursor.isNull(offset + 37) ? null : cursor.getString(offset + 37), // foodName1
cursor.isNull(offset + 38) ? null : cursor.getString(offset + 38), // foodName2
cursor.isNull(offset + 39) ? null : cursor.getString(offset + 39), // plu
cursor.isNull(offset + 40) ? null : cursor.getString(offset + 40), // printSeting
cursor.isNull(offset + 41) ? null : cursor.getLong(offset + 41), // isPrintQueueCode
cursor.isNull(offset + 42) ? null : cursor.getLong(offset + 42), // queueHeadId
cursor.isNull(offset + 43) ? null : cursor.getLong(offset + 43), // approve
cursor.isNull(offset + 44) ? null : cursor.getLong(offset + 44), // printFont
cursor.isNull(offset + 45) ? null : cursor.getLong(offset + 45), // advPrice
cursor.isNull(offset + 46) ? null : cursor.getLong(offset + 46), // printToBill
cursor.isNull(offset + 47) ? null : cursor.getDouble(offset + 47), // pointsAdd
cursor.isNull(offset + 48) ? null : cursor.getLong(offset + 48), // pointsRatio
cursor.isNull(offset + 49) ? null : cursor.getDouble(offset + 49), // pointsRedeem
cursor.isNull(offset + 50) ? null : cursor.getLong(offset + 50), // ktPrintMainItem
cursor.isNull(offset + 51) ? null : cursor.getLong(offset + 51), // ktShowPrice
cursor.isNull(offset + 52) ? null : cursor.getLong(offset + 52), // printTo
cursor.isNull(offset + 53) ? null : cursor.getLong(offset + 53), // toPax
cursor.isNull(offset + 54) ? null : cursor.getLong(offset + 54), // foodType
cursor.isNull(offset + 55) ? null : cursor.getLong(offset + 55), // majorMainId
cursor.isNull(offset + 56) ? null : cursor.getLong(offset + 56), // deptId
cursor.isNull(offset + 57) ? null : (byte) cursor.getShort(offset + 57), // serviceCharge
cursor.isNull(offset + 58) ? null : cursor.getLong(offset + 58), // colorId
cursor.isNull(offset + 59) ? null : cursor.getLong(offset + 59), // conditions
cursor.isNull(offset + 60) ? null : cursor.getLong(offset + 60), // isRt
cursor.isNull(offset + 61) ? null : cursor.getLong(offset + 61), // deletes
cursor.isNull(offset + 62) ? null : cursor.getLong(offset + 62), // isTimingFood
cursor.isNull(offset + 63) ? null : cursor.getLong(offset + 63), // minLongTime
cursor.isNull(offset + 64) ? null : cursor.getLong(offset + 64), // unitTime
cursor.isNull(offset + 65) ? null : cursor.getDouble(offset + 65), // unitPrice
cursor.isNull(offset + 66) ? null : cursor.getLong(offset + 66), // freeLongTime
cursor.isNull(offset + 67) ? null : new java.util.Date(cursor.getLong(offset + 67)), // freePeriodBegin
cursor.isNull(offset + 68) ? null : cursor.getLong(offset + 68) // isStatistic
cursor.isNull(offset + 4) ? null : (byte) cursor.getShort(offset + 4), // isParent
cursor.isNull(offset + 5) ? null : cursor.getLong(offset + 5), // seqNo
cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // foodName
cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // foodName1
cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // foodName2
cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // plu
cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // posFid
cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // foodDesc
cursor.isNull(offset + 12) ? null : cursor.getLong(offset + 12), // limitAmount
cursor.isNull(offset + 13) ? null : cursor.getLong(offset + 13), // limitType
cursor.isNull(offset + 14) ? null : cursor.getLong(offset + 14), // foodSummary
cursor.isNull(offset + 15) ? null : cursor.getLong(offset + 15), // invisible
cursor.isNull(offset + 16) ? null : (byte) cursor.getShort(offset + 16), // autoMod
cursor.isNull(offset + 17) ? null : cursor.getDouble(offset + 17), // price
cursor.isNull(offset + 18) ? null : cursor.getDouble(offset + 18), // marketPrice
cursor.isNull(offset + 19) ? null : cursor.getDouble(offset + 19), // lunchboxPrice
cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // imgUrlSmall
cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // imageurl
cursor.isNull(offset + 22) ? null : cursor.getLong(offset + 22), // riceponInvisible
cursor.isNull(offset + 23) ? null : cursor.getDouble(offset + 23), // cost
cursor.isNull(offset + 24) ? null : new java.util.Date(cursor.getLong(offset + 24)), // startDate
cursor.isNull(offset + 25) ? null : new java.util.Date(cursor.getLong(offset + 25)), // endDate
cursor.isNull(offset + 26) ? null : cursor.getLong(offset + 26), // like
cursor.isNull(offset + 27) ? null : cursor.getLong(offset + 27), // totalSold
cursor.isNull(offset + 28) ? null : cursor.getLong(offset + 28), // isSold
cursor.isNull(offset + 29) ? null : cursor.getString(offset + 29), // createBy
cursor.isNull(offset + 30) ? null : new java.util.Date(cursor.getLong(offset + 30)), // createTime
cursor.isNull(offset + 31) ? null : cursor.getString(offset + 31), // updateBy
cursor.isNull(offset + 32) ? null : new java.util.Date(cursor.getLong(offset + 32)), // updateTime
cursor.isNull(offset + 33) ? null : cursor.getLong(offset + 33), // periodId
cursor.isNull(offset + 34) ? null : cursor.getLong(offset + 34), // ableDiscount
cursor.isNull(offset + 35) ? null : cursor.getLong(offset + 35), // takeaway
cursor.isNull(offset + 36) ? null : cursor.getLong(offset + 36), // blueEdit
cursor.isNull(offset + 37) ? null : cursor.getLong(offset + 37), // cartEdit
cursor.isNull(offset + 38) ? null : cursor.getLong(offset + 38), // autoMerge
cursor.isNull(offset + 39) ? null : cursor.getString(offset + 39), // printSeting
cursor.isNull(offset + 40) ? null : cursor.getLong(offset + 40), // isPrintQueueCode
cursor.isNull(offset + 41) ? null : cursor.getLong(offset + 41), // queueHeadId
cursor.isNull(offset + 42) ? null : cursor.getLong(offset + 42), // approve
cursor.isNull(offset + 43) ? null : cursor.getLong(offset + 43), // printFont
cursor.isNull(offset + 44) ? null : cursor.getLong(offset + 44), // advPrice
cursor.isNull(offset + 45) ? null : cursor.getLong(offset + 45), // printToBill
cursor.isNull(offset + 46) ? null : cursor.getDouble(offset + 46), // pointsAdd
cursor.isNull(offset + 47) ? null : cursor.getLong(offset + 47), // pointsRatio
cursor.isNull(offset + 48) ? null : cursor.getDouble(offset + 48), // pointsRedeem
cursor.isNull(offset + 49) ? null : cursor.getLong(offset + 49), // ktPrintMainItem
cursor.isNull(offset + 50) ? null : cursor.getLong(offset + 50), // ktShowPrice
cursor.isNull(offset + 51) ? null : cursor.getLong(offset + 51), // printTo
cursor.isNull(offset + 52) ? null : cursor.getLong(offset + 52), // toPax
cursor.isNull(offset + 53) ? null : cursor.getLong(offset + 53), // foodType
cursor.isNull(offset + 54) ? null : cursor.getLong(offset + 54), // majorMainId
cursor.isNull(offset + 55) ? null : cursor.getLong(offset + 55), // deptId
cursor.isNull(offset + 56) ? null : (byte) cursor.getShort(offset + 56), // serviceCharge
cursor.isNull(offset + 57) ? null : cursor.getLong(offset + 57), // colorId
cursor.isNull(offset + 58) ? null : cursor.getLong(offset + 58), // conditions
cursor.isNull(offset + 59) ? null : cursor.getLong(offset + 59), // isRt
cursor.isNull(offset + 60) ? null : cursor.getLong(offset + 60), // deletes
cursor.isNull(offset + 61) ? null : cursor.getLong(offset + 61), // isTimingFood
cursor.isNull(offset + 62) ? null : cursor.getLong(offset + 62), // minLongTime
cursor.isNull(offset + 63) ? null : cursor.getLong(offset + 63), // unitTime
cursor.isNull(offset + 64) ? null : cursor.getDouble(offset + 64), // unitPrice
cursor.isNull(offset + 65) ? null : cursor.getLong(offset + 65), // freeLongTime
cursor.isNull(offset + 66) ? null : new java.util.Date(cursor.getLong(offset + 66)), // freePeriodBegin
cursor.isNull(offset + 67) ? null : cursor.getLong(offset + 67) // isStatistic
);
return entity;
}
......@@ -976,71 +963,70 @@ public class FoodDao extends AbstractDao<Food, Long> {
entity.setId(cursor.isNull(offset + 1) ? null : cursor.getLong(offset + 1));
entity.setParentId(cursor.isNull(offset + 2) ? null : cursor.getLong(offset + 2));
entity.setRestaurantId(cursor.isNull(offset + 3) ? null : cursor.getLong(offset + 3));
entity.setFid(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4));
entity.setIsParent(cursor.isNull(offset + 5) ? null : (byte) cursor.getShort(offset + 5));
entity.setSeqNo(cursor.isNull(offset + 6) ? null : cursor.getLong(offset + 6));
entity.setFoodName(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7));
entity.setPosFid(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8));
entity.setFoodDesc(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9));
entity.setLimitAmount(cursor.isNull(offset + 10) ? null : cursor.getLong(offset + 10));
entity.setLimitType(cursor.isNull(offset + 11) ? null : cursor.getLong(offset + 11));
entity.setFoodSummary(cursor.isNull(offset + 12) ? null : cursor.getLong(offset + 12));
entity.setInvisible(cursor.isNull(offset + 13) ? null : cursor.getLong(offset + 13));
entity.setAutoMod(cursor.isNull(offset + 14) ? null : (byte) cursor.getShort(offset + 14));
entity.setPrice(cursor.isNull(offset + 15) ? null : cursor.getDouble(offset + 15));
entity.setMarketPrice(cursor.isNull(offset + 16) ? null : cursor.getDouble(offset + 16));
entity.setLunchboxPrice(cursor.isNull(offset + 17) ? null : cursor.getDouble(offset + 17));
entity.setImgUrlSmall(cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18));
entity.setImageurl(cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19));
entity.setRiceponInvisible(cursor.isNull(offset + 20) ? null : cursor.getLong(offset + 20));
entity.setCost(cursor.isNull(offset + 21) ? null : cursor.getDouble(offset + 21));
entity.setStartDate(cursor.isNull(offset + 22) ? null : new java.util.Date(cursor.getLong(offset + 22)));
entity.setEndDate(cursor.isNull(offset + 23) ? null : new java.util.Date(cursor.getLong(offset + 23)));
entity.setLike(cursor.isNull(offset + 24) ? null : cursor.getLong(offset + 24));
entity.setTotalSold(cursor.isNull(offset + 25) ? null : cursor.getLong(offset + 25));
entity.setIsSold(cursor.isNull(offset + 26) ? null : cursor.getLong(offset + 26));
entity.setCreateBy(cursor.isNull(offset + 27) ? null : cursor.getString(offset + 27));
entity.setCreateTime(cursor.isNull(offset + 28) ? null : new java.util.Date(cursor.getLong(offset + 28)));
entity.setUpdateBy(cursor.isNull(offset + 29) ? null : cursor.getString(offset + 29));
entity.setUpdateTime(cursor.isNull(offset + 30) ? null : new java.util.Date(cursor.getLong(offset + 30)));
entity.setPeriodId(cursor.isNull(offset + 31) ? null : cursor.getLong(offset + 31));
entity.setAbleDiscount(cursor.isNull(offset + 32) ? null : cursor.getLong(offset + 32));
entity.setTakeaway(cursor.isNull(offset + 33) ? null : cursor.getLong(offset + 33));
entity.setBlueEdit(cursor.isNull(offset + 34) ? null : cursor.getLong(offset + 34));
entity.setCartEdit(cursor.isNull(offset + 35) ? null : cursor.getLong(offset + 35));
entity.setAutoMerge(cursor.isNull(offset + 36) ? null : cursor.getLong(offset + 36));
entity.setFoodName1(cursor.isNull(offset + 37) ? null : cursor.getString(offset + 37));
entity.setFoodName2(cursor.isNull(offset + 38) ? null : cursor.getString(offset + 38));
entity.setPlu(cursor.isNull(offset + 39) ? null : cursor.getString(offset + 39));
entity.setPrintSeting(cursor.isNull(offset + 40) ? null : cursor.getString(offset + 40));
entity.setIsPrintQueueCode(cursor.isNull(offset + 41) ? null : cursor.getLong(offset + 41));
entity.setQueueHeadId(cursor.isNull(offset + 42) ? null : cursor.getLong(offset + 42));
entity.setApprove(cursor.isNull(offset + 43) ? null : cursor.getLong(offset + 43));
entity.setPrintFont(cursor.isNull(offset + 44) ? null : cursor.getLong(offset + 44));
entity.setAdvPrice(cursor.isNull(offset + 45) ? null : cursor.getLong(offset + 45));
entity.setPrintToBill(cursor.isNull(offset + 46) ? null : cursor.getLong(offset + 46));
entity.setPointsAdd(cursor.isNull(offset + 47) ? null : cursor.getDouble(offset + 47));
entity.setPointsRatio(cursor.isNull(offset + 48) ? null : cursor.getLong(offset + 48));
entity.setPointsRedeem(cursor.isNull(offset + 49) ? null : cursor.getDouble(offset + 49));
entity.setKtPrintMainItem(cursor.isNull(offset + 50) ? null : cursor.getLong(offset + 50));
entity.setKtShowPrice(cursor.isNull(offset + 51) ? null : cursor.getLong(offset + 51));
entity.setPrintTo(cursor.isNull(offset + 52) ? null : cursor.getLong(offset + 52));
entity.setToPax(cursor.isNull(offset + 53) ? null : cursor.getLong(offset + 53));
entity.setFoodType(cursor.isNull(offset + 54) ? null : cursor.getLong(offset + 54));
entity.setMajorMainId(cursor.isNull(offset + 55) ? null : cursor.getLong(offset + 55));
entity.setDeptId(cursor.isNull(offset + 56) ? null : cursor.getLong(offset + 56));
entity.setServiceCharge(cursor.isNull(offset + 57) ? null : (byte) cursor.getShort(offset + 57));
entity.setColorId(cursor.isNull(offset + 58) ? null : cursor.getLong(offset + 58));
entity.setConditions(cursor.isNull(offset + 59) ? null : cursor.getLong(offset + 59));
entity.setIsRt(cursor.isNull(offset + 60) ? null : cursor.getLong(offset + 60));
entity.setDeletes(cursor.isNull(offset + 61) ? null : cursor.getLong(offset + 61));
entity.setIsTimingFood(cursor.isNull(offset + 62) ? null : cursor.getLong(offset + 62));
entity.setMinLongTime(cursor.isNull(offset + 63) ? null : cursor.getLong(offset + 63));
entity.setUnitTime(cursor.isNull(offset + 64) ? null : cursor.getLong(offset + 64));
entity.setUnitPrice(cursor.isNull(offset + 65) ? null : cursor.getDouble(offset + 65));
entity.setFreeLongTime(cursor.isNull(offset + 66) ? null : cursor.getLong(offset + 66));
entity.setFreePeriodBegin(cursor.isNull(offset + 67) ? null : new java.util.Date(cursor.getLong(offset + 67)));
entity.setIsStatistic(cursor.isNull(offset + 68) ? null : cursor.getLong(offset + 68));
entity.setIsParent(cursor.isNull(offset + 4) ? null : (byte) cursor.getShort(offset + 4));
entity.setSeqNo(cursor.isNull(offset + 5) ? null : cursor.getLong(offset + 5));
entity.setFoodName(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6));
entity.setFoodName1(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7));
entity.setFoodName2(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8));
entity.setPlu(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9));
entity.setPosFid(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10));
entity.setFoodDesc(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11));
entity.setLimitAmount(cursor.isNull(offset + 12) ? null : cursor.getLong(offset + 12));
entity.setLimitType(cursor.isNull(offset + 13) ? null : cursor.getLong(offset + 13));
entity.setFoodSummary(cursor.isNull(offset + 14) ? null : cursor.getLong(offset + 14));
entity.setInvisible(cursor.isNull(offset + 15) ? null : cursor.getLong(offset + 15));
entity.setAutoMod(cursor.isNull(offset + 16) ? null : (byte) cursor.getShort(offset + 16));
entity.setPrice(cursor.isNull(offset + 17) ? null : cursor.getDouble(offset + 17));
entity.setMarketPrice(cursor.isNull(offset + 18) ? null : cursor.getDouble(offset + 18));
entity.setLunchboxPrice(cursor.isNull(offset + 19) ? null : cursor.getDouble(offset + 19));
entity.setImgUrlSmall(cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20));
entity.setImageurl(cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21));
entity.setRiceponInvisible(cursor.isNull(offset + 22) ? null : cursor.getLong(offset + 22));
entity.setCost(cursor.isNull(offset + 23) ? null : cursor.getDouble(offset + 23));
entity.setStartDate(cursor.isNull(offset + 24) ? null : new java.util.Date(cursor.getLong(offset + 24)));
entity.setEndDate(cursor.isNull(offset + 25) ? null : new java.util.Date(cursor.getLong(offset + 25)));
entity.setLike(cursor.isNull(offset + 26) ? null : cursor.getLong(offset + 26));
entity.setTotalSold(cursor.isNull(offset + 27) ? null : cursor.getLong(offset + 27));
entity.setIsSold(cursor.isNull(offset + 28) ? null : cursor.getLong(offset + 28));
entity.setCreateBy(cursor.isNull(offset + 29) ? null : cursor.getString(offset + 29));
entity.setCreateTime(cursor.isNull(offset + 30) ? null : new java.util.Date(cursor.getLong(offset + 30)));
entity.setUpdateBy(cursor.isNull(offset + 31) ? null : cursor.getString(offset + 31));
entity.setUpdateTime(cursor.isNull(offset + 32) ? null : new java.util.Date(cursor.getLong(offset + 32)));
entity.setPeriodId(cursor.isNull(offset + 33) ? null : cursor.getLong(offset + 33));
entity.setAbleDiscount(cursor.isNull(offset + 34) ? null : cursor.getLong(offset + 34));
entity.setTakeaway(cursor.isNull(offset + 35) ? null : cursor.getLong(offset + 35));
entity.setBlueEdit(cursor.isNull(offset + 36) ? null : cursor.getLong(offset + 36));
entity.setCartEdit(cursor.isNull(offset + 37) ? null : cursor.getLong(offset + 37));
entity.setAutoMerge(cursor.isNull(offset + 38) ? null : cursor.getLong(offset + 38));
entity.setPrintSeting(cursor.isNull(offset + 39) ? null : cursor.getString(offset + 39));
entity.setIsPrintQueueCode(cursor.isNull(offset + 40) ? null : cursor.getLong(offset + 40));
entity.setQueueHeadId(cursor.isNull(offset + 41) ? null : cursor.getLong(offset + 41));
entity.setApprove(cursor.isNull(offset + 42) ? null : cursor.getLong(offset + 42));
entity.setPrintFont(cursor.isNull(offset + 43) ? null : cursor.getLong(offset + 43));
entity.setAdvPrice(cursor.isNull(offset + 44) ? null : cursor.getLong(offset + 44));
entity.setPrintToBill(cursor.isNull(offset + 45) ? null : cursor.getLong(offset + 45));
entity.setPointsAdd(cursor.isNull(offset + 46) ? null : cursor.getDouble(offset + 46));
entity.setPointsRatio(cursor.isNull(offset + 47) ? null : cursor.getLong(offset + 47));
entity.setPointsRedeem(cursor.isNull(offset + 48) ? null : cursor.getDouble(offset + 48));
entity.setKtPrintMainItem(cursor.isNull(offset + 49) ? null : cursor.getLong(offset + 49));
entity.setKtShowPrice(cursor.isNull(offset + 50) ? null : cursor.getLong(offset + 50));
entity.setPrintTo(cursor.isNull(offset + 51) ? null : cursor.getLong(offset + 51));
entity.setToPax(cursor.isNull(offset + 52) ? null : cursor.getLong(offset + 52));
entity.setFoodType(cursor.isNull(offset + 53) ? null : cursor.getLong(offset + 53));
entity.setMajorMainId(cursor.isNull(offset + 54) ? null : cursor.getLong(offset + 54));
entity.setDeptId(cursor.isNull(offset + 55) ? null : cursor.getLong(offset + 55));
entity.setServiceCharge(cursor.isNull(offset + 56) ? null : (byte) cursor.getShort(offset + 56));
entity.setColorId(cursor.isNull(offset + 57) ? null : cursor.getLong(offset + 57));
entity.setConditions(cursor.isNull(offset + 58) ? null : cursor.getLong(offset + 58));
entity.setIsRt(cursor.isNull(offset + 59) ? null : cursor.getLong(offset + 59));
entity.setDeletes(cursor.isNull(offset + 60) ? null : cursor.getLong(offset + 60));
entity.setIsTimingFood(cursor.isNull(offset + 61) ? null : cursor.getLong(offset + 61));
entity.setMinLongTime(cursor.isNull(offset + 62) ? null : cursor.getLong(offset + 62));
entity.setUnitTime(cursor.isNull(offset + 63) ? null : cursor.getLong(offset + 63));
entity.setUnitPrice(cursor.isNull(offset + 64) ? null : cursor.getDouble(offset + 64));
entity.setFreeLongTime(cursor.isNull(offset + 65) ? null : cursor.getLong(offset + 65));
entity.setFreePeriodBegin(cursor.isNull(offset + 66) ? null : new java.util.Date(cursor.getLong(offset + 66)));
entity.setIsStatistic(cursor.isNull(offset + 67) ? null : cursor.getLong(offset + 67));
}
@Override
......
......@@ -30,7 +30,7 @@ public class ComboDaoUtils {
public ComboDaoUtils(Context context) {
mManager = DaoManager.getInstance();
mManager.init(context);
this.mContext =context;
this.mContext = context;
}
/**
......@@ -164,7 +164,28 @@ public class ComboDaoUtils {
if (combos != null) {
for (int i = 0; i < combos.size(); i++) {
Food food = foodDao.queryFoodByFidQueryBuilder(combos.get(i).getFid());
list.add(Combo.addFoodInfo(food,combos.get(i)));
if (food != null) {
list.add(Combo.addFoodInfo(food, combos.get(i)));
}
}
}
return list;
}
public List<Combo> queryCombosFoodsByQueryBuilder(long fid) {
List<Combo> combo = queryCombosByQueryBuilder(fid);
List<Combo> combos = null;
if (combo != null && combo.size() != 0) {
combos = queryCombosByComIdQueryBuilder(combo.get(0).getComId());
}
List<Combo> list = new ArrayList<>();
FoodDaoUtils foodDao = new FoodDaoUtils(mContext);
if (combos != null) {
for (int i = 0; i < combos.size(); i++) {
Food food = foodDao.queryFoodByFidQueryBuilder(combos.get(i).getFid());
if(food != null) {
list.add(Combo.addFoodInfo(food, combos.get(i)));
}
}
}
return list;
......@@ -185,6 +206,16 @@ public class ComboDaoUtils {
*
* @return
*/
public List<Combo> queryCombosByQueryBuilder(long fid) {
QueryBuilder<Combo> queryBuilder = mManager.getDaoSession().queryBuilder(Combo.class);
return queryBuilder.where(ComboDao.Properties.Fid.eq(fid)).build().list();
}
/**
* 使用queryBuilder进行查询食品
*
* @return
*/
public List<Combo> queryCombosByComIdQueryBuilder(int comId) {
QueryBuilder<Combo> queryBuilder = mManager.getDaoSession().queryBuilder(Combo.class);
return queryBuilder.where(ComboDao.Properties.ComId.eq(comId)).list();
......
......@@ -158,9 +158,12 @@ public class FoodModifierDaoUtils {
if (foodModifiers != null) {
for (int i = 0; i < foodModifiers.size(); i++) {
Modifier modifier = modifierDao.queryModifierByQueryBuilder(foodModifiers.get(i).getMid());
if (modifier != null) {
modifier.setFid(fid);
list.add(modifier);
}
}
}
return list;
}
......
......@@ -66,8 +66,5 @@ dependencies {
// test
testImplementation rootProject.ext.dependencies["junit"]
implementation rootProject.ext.dependencies["BaseRecyclerViewAdapter"]
// debugImplementation rootProject.ext.dependencies["canary-debug"]
// releaseImplementation rootProject.ext.dependencies["canary-release"]
// testImplementation rootProject.ext.dependencies["canary-release"]
implementation files('libs/ecracalib.jar')
}
......@@ -17,6 +17,6 @@ public interface GoldConstants {
// boolean isRefreshData = false;
int DetailColCount = 4;
int foodGriupColCount = 5;//食品組列數
int foodGriupPageSize = 10;//食品組最大顯示數
}
package com.gingersoft.gsa.cloud.table.app.payment;
import android.content.Context;
import android.os.Handler;
import android.os.Message;
import com.etps.aca.lib.constant.Constant;
import com.etps.aca.lib.util.CommandUtil;
import com.gingersoft.gsa.cloud.base.utils.gson.GsonUtils;
import com.gingersoft.gsa.cloud.base.utils.log.LogUtil;
import com.gingersoft.gsa.cloud.table.app.payment.bean.AdjustTipRequest;
import com.gingersoft.gsa.cloud.table.app.payment.bean.PayRequest;
import com.gingersoft.gsa.cloud.table.app.payment.bean.RefundRequest;
import com.gingersoft.gsa.cloud.table.app.payment.bean.RetrievalRequest;
import com.gingersoft.gsa.cloud.table.app.payment.bean.SettlementRequest;
import com.gingersoft.gsa.cloud.table.app.payment.bean.VoidRequest;
import com.gingersoft.gsa.cloud.table.app.payment.contract.IN5Action;
import com.gingersoft.gsa.cloud.table.app.printer.PrintPaymentStub;
import com.gingersoft.gsa.cloud.ui.widget.dialog.LoadingDialog;
import java.util.Timer;
import java.util.TimerTask;
/**
* 作者:ELEGANT_BIN
* 版本:1.6.0
* 创建日期:2019/6/13
* 修订历史:2019/6/13
* 描述:
*/
public class N5ActionManage implements IN5Action {
private final String TAG = this.getClass().getSimpleName();
private static N5ActionManage sInstance;
/**
* 期望:
* 1.timeout時間120秒 > 等待回應(成功, 失敗, 繁忙BUSY(97代表中端繁忙)等狀態)
* 2.120秒內每次收到繁忙都繼續等待, 直到120秒
* 3.120秒後每5秒調用一次, 合共12次如果仍然繁忙或沒有回應請退出
*/
private final long actionTimeout = 120 * 1000;
private final int queryCount = 2;
private final long queryInterval = 2 * 1000;
private boolean cancel;
public static N5ActionManage getInstance() {
if (sInstance == null) {
sInstance = new N5ActionManage();
}
return sInstance;
}
private N5ActionManage() {
}
@Override
public void sendSaleRequest(Context context, PayRequest request) {
String payRequest = GsonUtils.GsonString(request);
// setRequestTimeout(context, Constant.EVENT.NAME.SALE, request.getTXN_ID(), false);
CommandUtil.sendRequest(context, payRequest);
}
@Override
public void sendVoidRequest(Context context, VoidRequest request) {
String voidRequest = GsonUtils.GsonString(request);
// setRequestTimeout(context, Constant.EVENT.NAME.VOID, request.getTXN_ID(), false);
CommandUtil.sendRequest(context, voidRequest);
}
@Override
public void sendRefundRequest(Context context, RefundRequest request) {
String refundRequest = GsonUtils.GsonString(request);
// setRequestTimeout(context, Constant.EVENT.NAME.REFUND, request.getTXN_ID(), false);
CommandUtil.sendRequest(context, refundRequest);
}
@Override
public void sendAdjustTipResuest(Context context, AdjustTipRequest request) {
String adjustRequest = GsonUtils.GsonString(request);
// setRequestTimeout(context, Constant.EVENT.NAME.ADJUST, request.getTXN_ID(), false);
CommandUtil.sendRequest(context, adjustRequest);
}
@Override
public void sendPrintPaymentStubRequest(Context context, PrintPaymentStub request) {
String adjustRequest = GsonUtils.GsonString(request);
CommandUtil.sendRequest(context, adjustRequest);
}
@Override
public void sendRetrievalRequest(Context context, RetrievalRequest request) {
String retrievalRequest = GsonUtils.GsonString(request);
CommandUtil.sendRequest(context, retrievalRequest);
}
@Override
public void sendSettlementRequest(Context context, SettlementRequest request) {
String settlementRequest = GsonUtils.GsonString(request);
CommandUtil.sendRequest(context, settlementRequest);
}
private Handler mHander = new Handler() {
@Override
public void handleMessage(Message msg) {
LoadingDialog.cancelDialogForLoading();
// if (!TextUtils.isEmpty((String) msg.obj)) {
// ArmsUtils.makeText(GSAApplication.getAppContext(), (String) msg.obj);
// }
}
};
/**
* 设置N5请求超时处理
*/
public void setRequestTimeout(Context context, String action, String txn_id, boolean showDialog) {
LogUtil.d(TAG, "setRequestTimeout : " + action);
if (action.equals(Constant.EVENT.NAME.SALE) || action.equals(Constant.EVENT.NAME.VOID)
|| action.equals(Constant.EVENT.NAME.REFUND) || action.equals(Constant.EVENT.NAME.ADJUST) || action.equals("RETRIEVAL")) {
//回調記錄這裡(支付、退款、取消、调整、查詢交易)使用操作類型+交易ID作為key,防止回調記錄被重疊
String callKey = action + "_" + txn_id;
N5CallbackManage.getInstance().getCallbackRecordMap().put(callKey, false);
} else {
N5CallbackManage.getInstance().getCallbackRecordMap().put(action, false);
}
cancel = false;
Timer time = new Timer();
time.schedule(new TimerTask() {
@Override
public void run() {
String callKey = action + "_" + txn_id;
if (cancel) {
LogUtil.d(TAG, "setRequestTimeout cancel(): " + callKey + " - " + N5CallbackManage.getInstance().getCallbackRecordMap().get(callKey));
time.cancel();
return;
}
if (action.equals(Constant.EVENT.NAME.SALE)
|| action.equals(Constant.EVENT.NAME.VOID)
|| action.equals(Constant.EVENT.NAME.REFUND)
|| action.equals(Constant.EVENT.NAME.ADJUST)
|| action.equals("RETRIEVAL")) {
LogUtil.d(TAG, "setRequestTimeout run(): " + callKey + " - " + N5CallbackManage.getInstance().getCallbackRecordMap().get(callKey));
} else {
LogUtil.d(TAG, "setRequestTimeout run(): " + action + " - " + N5CallbackManage.getInstance().getCallbackRecordMap().get(action));
}
//查詢訂單狀態參數
RetrievalRequest retrievalRequest = new RetrievalRequest();
retrievalRequest.setEVENT_NAME("RETRIEVAL");
retrievalRequest.setTXN_ID(txn_id);
// switch (action) {
// case Constant.EVENT.NAME.SALE:
// if (!N5CallbackManage.getInstance().getCallbackRecordMap().get(callKey)) {
// sendMarkToast(LanguageUtils.get_language_system(context,"prompt.payment request.timed.out","支付請求超時"));
// queryOrderStatus(context, retrievalRequest, showDialog);
// }
// break;
// case Constant.EVENT.NAME.VOID:
// if (!N5CallbackManage.getInstance().getCallbackRecordMap().get(callKey)) {
// sendMarkToast(LanguageUtils.get_language_system(context,"prompt.void request.timed.out","取消請求超時"));
// queryOrderStatus(context, retrievalRequest, showDialog);
// }
// break;
// case Constant.EVENT.NAME.REFUND:
// if (!N5CallbackManage.getInstance().getCallbackRecordMap().get(callKey)) {
// sendMarkToast(LanguageUtils.get_language_system(context,"prompt.refund request.timed.out","退款請求超時"));
// queryOrderStatus(context, retrievalRequest, showDialog);
// }
// break;
// case Constant.EVENT.NAME.ADJUST:
// if (!N5CallbackManage.getInstance().getCallbackRecordMap().get(callKey)) {
// sendMarkToast(LanguageUtils.get_language_system(context,"prompt.tip request.timed.out","貼士調整請求超時"));
// queryOrderStatus(context, retrievalRequest, showDialog);
// }
// break;
// case "RETRIEVAL":
// if (!N5CallbackManage.getInstance().getCallbackRecordMap().get(callKey)) {
// sendMarkToast(LanguageUtils.get_language_system(context,"prompt.transaction request.timed.out","交易查詢請求超時"));
// }
// break;
// case Constant.EVENT.NAME.PRINT_RESP:
// if (!N5CallbackManage.getInstance().getCallbackRecordMap().get(action)) {
// sendMarkToast(LanguageUtils.get_language_system(context,"prompt.printer request.timed.out","打印請求超時"));
// }
// break;
// case "SETTLEMENT":
// if (!N5CallbackManage.getInstance().getCallbackRecordMap().get(action)) {
// sendMarkToast(LanguageUtils.get_language_system(context,"prompt.settlement request.timed.out","清機請求超時"));
// }
// break;
// }
//重置为未响应
N5CallbackManage.getInstance().getCallbackRecordMap().put(action, false);
}
}, actionTimeout);
}
private void sendMarkToast(String msg) {
Message message = Message.obtain();
message.arg1 = 2;
message.obj = msg;
mHander.sendMessage(message);
}
/**
* (支付、退款、取消、调整)请求超时,执行查询接口
*
* @param context
* @param request
*/
// public void queryOrderStatus(Context context, RetrievalRequest request, boolean showDialog) {
//// if (showDialog) {
//// LoadingDialog.showDialogForLoading(context, LanguageUtils.get_language_system(context, "comm.getdata", " get data"), true);
//// }
// RxTimer timer = new RxTimer();
// timer.interval(queryInterval, new RxTimer.RxAction() {
//
// @Override
// public void action(long number) {
//
// int count = (int) (number + 1);
//
// String retrievalCallKey = "RETRIEVAL" + "_" + request.getTXN_ID();
//
// if (N5CallbackManage.getInstance().getCallbackRecordMap().containsKey(retrievalCallKey)
// && N5CallbackManage.getInstance().getCallbackRecordMap().get(retrievalCallKey)) {
// //收到了查詢交易回調,斷掉查詢
//// GSAApplication.getAppContext().getCrashHandler()
// LogUtil.d(TAG, "queryOrderStatus stop: " + count + " - " + request.getEVENT_NAME() + " - " + request.getTXN_ID());
// timer.cancel();
// cancel = true;
// return;
// }
//
// if (count == queryCount) {
// //已到查詢最大數,斷掉查詢
// LogUtil.d(TAG, "queryOrderStatus cancel: " + count + " - " + request.getEVENT_NAME() + " - " + request.getTXN_ID());
// timer.cancel();
// cancel = true;
// return;
// }
//
// LogUtil.d(TAG, "queryOrderStatus: " + count + " - " + request.getEVENT_NAME() + " - " + request.getTXN_ID());
//
// sendRetrievalRequest(context, request);
// mHander.sendEmptyMessage(1);
// }
// });
// }
}
package com.gingersoft.gsa.cloud.table.app.payment;
import com.etps.aca.lib.constant.Constant;
import com.gingersoft.gsa.cloud.base.utils.gson.GsonUtils;
import com.gingersoft.gsa.cloud.table.app.payment.bean.AdjustTipRespose;
import com.gingersoft.gsa.cloud.table.app.payment.bean.RefundRespose;
import com.gingersoft.gsa.cloud.table.app.payment.bean.RetrievalRespose;
import com.gingersoft.gsa.cloud.table.app.payment.bean.SaleRespose;
import com.gingersoft.gsa.cloud.table.app.payment.bean.SettlementRespose;
import com.gingersoft.gsa.cloud.table.app.payment.bean.VoidRespose;
import com.gingersoft.gsa.cloud.table.app.payment.contract.IN5Callback;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
/**
* 作者:ELEGANT_BIN
* 版本:1.6.0
* 创建日期:2019-11-01
* 修订历史:2019-11-01
* 描述:
*/
public final class N5CallbackManage {
private Map<Object, IN5Callback> mActionMap = new HashMap<>();
private Map<String, Boolean> mCallbackRecordMap = new HashMap<>();
private static N5CallbackManage sDefaultN5Callback;
public static N5CallbackManage getInstance() {
if (sDefaultN5Callback == null) {
synchronized (N5CallbackManage.class) {
if (sDefaultN5Callback == null) {
sDefaultN5Callback = new N5CallbackManage();
}
}
}
return sDefaultN5Callback;
}
public void post(Object className, String response, String action) {
if (className == null || !mActionMap.containsKey(className)) {
return;
}
Iterator<Object> iterator = mActionMap.keySet().iterator();
while (iterator.hasNext()) {
Object key = iterator.next();
if (key != null && key == className) {
IN5Callback callback = mActionMap.get(key);
switch (action) {
case Constant.EVENT.NAME.SALE_RESP:
SaleRespose saleRespose = GsonUtils.GsonToBean(response, SaleRespose.class);
callback.onSaleCall(saleRespose);
//回調記錄這裡支付使用操作類型+交易ID作為key,防止回調記錄被重疊
String saleCallKey = Constant.EVENT.NAME.SALE + "_" + saleRespose.getTXN_ID();
mCallbackRecordMap.put(saleCallKey, true);
break;
case Constant.EVENT.NAME.VOID_RESP:
VoidRespose voidRespose = GsonUtils.GsonToBean(response, VoidRespose.class);
callback.onVoidCall(voidRespose);
//回調記錄這裡使用取消操作類型+交易ID作為key,防止回調記錄被重疊
String voidCallKey = Constant.EVENT.NAME.VOID + "_" + voidRespose.getTXN_ID();
mCallbackRecordMap.put(voidCallKey, true);
break;
case Constant.EVENT.NAME.REFUND_RESP:
RefundRespose refundRespose = GsonUtils.GsonToBean(response, RefundRespose.class);
callback.onRefundCall(refundRespose);
//回調記錄這裡使用退款操作類型+交易ID作為key,防止回調記錄被重疊
String refundCallKey = Constant.EVENT.NAME.REFUND + "_" + refundRespose.getTXN_ID();
mCallbackRecordMap.put(refundCallKey, true);
break;
case Constant.EVENT.NAME.ADJUST_RESP:
AdjustTipRespose adjustTipRespose = GsonUtils.GsonToBean(response, AdjustTipRespose.class);
callback.onAdjustCall(adjustTipRespose);
//回調記錄這裡使用支付操作類型+交易ID作為key,防止回調記錄被重疊
String tipCallKey = Constant.EVENT.NAME.ADJUST + "_" + adjustTipRespose.getTXN_ID();
mCallbackRecordMap.put(tipCallKey, true);
break;
case Constant.EVENT.NAME.PRINT_RESP:
callback.onPrinterCall(response);
mCallbackRecordMap.put(Constant.EVENT.NAME.PRINT, true);
break;
case "RETRIEVAL_RESP":
RetrievalRespose retrievalRespose = GsonUtils.GsonToBean(response, RetrievalRespose.class);
callback.onRetrievalCall(retrievalRespose);
//回調記錄這裡使用支付操作類型+交易ID作為key,防止回調記錄被重疊
String retrievalCallKey = "RETRIEVAL" + "_" + retrievalRespose.getTXN_ID();
mCallbackRecordMap.put(retrievalCallKey, true);
break;
case "SETTLE_RESP":
callback.onSettleCall(GsonUtils.GsonToBean(response, SettlementRespose.class));
mCallbackRecordMap.put("SETTLE", true);
break;
}
}
}
}
public void register(Object className, IN5Callback callback) {
if (className == null) {
return;
}
synchronized (this) {
mActionMap.put(className, callback);
}
}
public void unregister(Object className) {
if (className == null) {
return;
}
synchronized (this) {
mActionMap.remove(className);
}
}
public Map<String, Boolean> getCallbackRecordMap() {
return mCallbackRecordMap;
}
}
......@@ -6,7 +6,7 @@ import dagger.Component;
import com.jess.arms.di.component.AppComponent;
import com.gingersoft.gsa.cloud.table.di.module.FineItemKindModule;
import com.gingersoft.gsa.cloud.table.mvpcontract.FineItemKindContract;
import com.gingersoft.gsa.cloud.table.mvp.contract.FineItemKindContract;
import com.jess.arms.di.scope.FragmentScope;
import com.gingersoft.gsa.cloud.table.mvp.ui.fragment.FineItemKindFragment;
......
package com.gingersoft.gsa.cloud.table.di.module;
import com.jess.arms.di.scope.FragmentScope;
import dagger.Binds;
import dagger.Module;
import dagger.Provides;
import com.gingersoft.gsa.cloud.table.mvpcontract.FineItemKindContract;
import com.gingersoft.gsa.cloud.table.mvp.contract.FineItemKindContract;
import com.gingersoft.gsa.cloud.table.mvp.model.FineItemKindModel;
......
......@@ -10,6 +10,8 @@ import com.gingersoft.gsa.cloud.database.bean.Modifier;
import com.gingersoft.gsa.cloud.table.mvp.model.bean.BaseRespose;
import com.gingersoft.gsa.cloud.database.bean.Food;
import com.gingersoft.gsa.cloud.table.mvp.model.bean.request.OrderRequest;
import com.gingersoft.gsa.cloud.table.mvp.presenter.MealStandPresenter;
import com.gingersoft.gsa.cloud.table.mvp.ui.activity.MealStandActivity;
import com.jess.arms.base.DefaultAdapter;
import com.jess.arms.mvp.IModel;
import com.jess.arms.mvp.IView;
......@@ -89,7 +91,7 @@ public interface MealStandContract {
void setOrderFoodCount(String number);
void setMealRvScrollToPosition(int position) ;
void setMealRvScrollToPosition(int position);
Activity getActivity();
}
......@@ -97,7 +99,7 @@ public interface MealStandContract {
//Model层定义接口,外部只需关心Model返回的数据,无需关心内部细节,即是否使用缓存
interface Model extends BaseOrderContract.Model {
// Observable<Object> loadOrder(int orderId);
Observable<BaseRespose> loadOrder(int orderId);
Observable<BaseResult> createOrder(RequestBody requestBody);
......@@ -115,6 +117,8 @@ public interface MealStandContract {
List<Combo> queryDB_ComboList(long fid);
List<Combo> isComboFood(long fid);
List<FoodModifier> queryDB_FoodModifierList(long fid);
}
}
......@@ -8,6 +8,7 @@ import com.gingersoft.gsa.cloud.table.app.payment.bean.SaleRespose;
import com.gingersoft.gsa.cloud.ui.widget.dialog.StatusLoadingDialog;
import io.reactivex.Observable;
import okhttp3.RequestBody;
/**
* ================================================
......@@ -56,6 +57,6 @@ public interface OrderPayContract {
// Observable<Object> getN5SaleTxnId(String url);
//
// Observable<Object> updateSaleStaus(String url, RequestBody formBody);
Observable<BaseResult> updateOrderStatus( RequestBody formBody);
}
}
......@@ -10,7 +10,7 @@ import com.jess.arms.di.scope.FragmentScope;
import javax.inject.Inject;
import com.gingersoft.gsa.cloud.table.mvpcontract.FineItemKindContract;
import com.gingersoft.gsa.cloud.table.mvp.contract.FineItemKindContract;
/**
......
......@@ -3,6 +3,7 @@ package com.gingersoft.gsa.cloud.table.mvp.model;
import android.app.Application;
import com.gingersoft.gsa.cloud.base.common.bean.BaseResult;
import com.gingersoft.gsa.cloud.base.common.bean.mealManage.MyOrderManage;
import com.gingersoft.gsa.cloud.database.bean.Combo;
import com.gingersoft.gsa.cloud.database.bean.FoodModifier;
import com.gingersoft.gsa.cloud.database.bean.Modifier;
......@@ -10,12 +11,15 @@ import com.gingersoft.gsa.cloud.database.greendao.ModifierDao;
import com.gingersoft.gsa.cloud.database.utils.ComboDaoUtils;
import com.gingersoft.gsa.cloud.database.utils.FoodModifierDaoUtils;
import com.gingersoft.gsa.cloud.database.utils.ModifierDaoUtils;
import com.gingersoft.gsa.cloud.table.R;
import com.gingersoft.gsa.cloud.table.mvp.model.bean.BaseRespose;
import com.gingersoft.gsa.cloud.database.bean.Food;
import com.gingersoft.gsa.cloud.database.utils.FoodDaoUtils;
import com.gingersoft.gsa.cloud.table.mvp.contract.MealStandContract;
import com.gingersoft.gsa.cloud.table.mvp.model.bean.request.OrderRequest;
import com.gingersoft.gsa.cloud.table.mvp.model.service.MealService;
import com.gingersoft.gsa.cloud.table.mvp.presenter.MealStandPresenter;
import com.gingersoft.gsa.cloud.table.mvp.ui.activity.MealStandActivity;
import com.google.gson.Gson;
import com.jess.arms.di.scope.ActivityScope;
import com.jess.arms.integration.IRepositoryManager;
......@@ -26,6 +30,11 @@ import java.util.List;
import javax.inject.Inject;
import io.reactivex.Observable;
import io.reactivex.ObservableSource;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.functions.Action;
import io.reactivex.functions.Function;
import io.reactivex.schedulers.Schedulers;
import okhttp3.RequestBody;
......@@ -60,11 +69,11 @@ public class MealStandModel extends BaseModel implements MealStandContract.Model
this.mApplication = null;
}
// @Override
// public Observable<Object> loadOrder(int orderId) {
// return mRepositoryManager.obtainRetrofitService(MealService.class)
// .loadOrder(orderId);
// }
@Override
public Observable<BaseRespose> loadOrder(int orderId) {
return mRepositoryManager.obtainRetrofitService(MealService.class)
.loadOrder(orderId);
}
@Override
public Observable<BaseResult> createOrder(RequestBody requestBody) {
......@@ -81,7 +90,16 @@ public class MealStandModel extends BaseModel implements MealStandContract.Model
@Override
public Observable<BaseRespose> deleteFood(RequestBody requestBody) {
return mRepositoryManager.obtainRetrofitService(MealService.class)
.deleteFood(requestBody);
.deleteFood(requestBody)
.flatMap(new Function<BaseResult, Observable<BaseRespose>>() {
@Override
public Observable<BaseRespose> apply(BaseResult info) throws Exception {
if (info != null && info.isSuccess()) {
return loadOrder(MyOrderManage.getInstance().getOrderId());
}
return null;
}
});
}
@Override
......@@ -115,6 +133,12 @@ public class MealStandModel extends BaseModel implements MealStandContract.Model
}
@Override
public List<Combo> isComboFood(long fid) {
ComboDaoUtils comboDaoUtils = new ComboDaoUtils(mApplication);
return comboDaoUtils.queryCombosFoodsByQueryBuilder(fid);
}
@Override
public List<FoodModifier> queryDB_FoodModifierList(long fid) {
return null;
}
......
......@@ -13,6 +13,7 @@ import com.jess.arms.mvp.BaseModel;
import javax.inject.Inject;
import io.reactivex.Observable;
import okhttp3.RequestBody;
/**
......@@ -52,9 +53,10 @@ public class OrderPayModel extends BaseModel implements OrderPayContract.Model {
.getPayMethods();
}
// @Override
// public Observable<BaseResult> updateOrderStatus(RequestBody requestBody) {
// return mRepositoryManager.obtainRetrofitService(OrderPayService.class)
// .updateOrderStatus(requestBody);
// }
@Override
public Observable<BaseResult> updateOrderStatus(RequestBody formBody) {
return mRepositoryManager.obtainRetrofitService(OrderPayService.class)
.updateOrderStatus(formBody);
}
}
\ No newline at end of file
package com.gingersoft.gsa.cloud.table.mvp.model.bean.request;
/**
* 作者:ELEGANT_BIN
* 版本:1.6.0
* 创建日期:2020-02-22
* 修订历史:2020-02-22
* 描述:
*/
public class DeleteOrderRequest {
private String[]id;
public String[] getId() {
return id;
}
public void setId(String[] id) {
this.id = id;
}
}
package com.gingersoft.gsa.cloud.table.mvp.model.bean.request;
import com.gingersoft.gsa.cloud.base.common.bean.OrderBean;
import java.util.List;
/**
......@@ -14,7 +16,7 @@ public class OrderRequest {
private int person;
private int tableId;
private List<Request> orderDetails;
private List<OrderBean.OrderDetailsBean> orderDetails;
public int getPerson() {
return person;
......@@ -32,83 +34,83 @@ public class OrderRequest {
this.tableId = tableId;
}
public List<Request> getOrderDetails() {
public List<OrderBean.OrderDetailsBean> getOrderDetails() {
return orderDetails;
}
public void setOrderDetails(List<Request> orderDetails) {
public void setOrderDetails(List<OrderBean.OrderDetailsBean> orderDetails) {
this.orderDetails = orderDetails;
}
public static class Request {
private long productId;
private String productName;
private double price;
private double lunchboxPrice;
private int number;
public Request() {
}
public Request(long productId, String productName, double price, double lunchboxPrice, int number) {
this.productId = productId;
this.productName = productName;
this.price = price;
this.lunchboxPrice = lunchboxPrice;
this.number = number;
}
public long getProductId() {
return productId;
}
public void setProductId(long productId) {
this.productId = productId;
}
public String getProductName() {
return productName;
}
public void setProductName(String productName) {
this.productName = productName;
}
public double getPrice() {
return price;
}
public void setPrice(double price) {
this.price = price;
}
public double getLunchboxPrice() {
return lunchboxPrice;
}
public void setLunchboxPrice(double lunchboxPrice) {
this.lunchboxPrice = lunchboxPrice;
}
public int getNumber() {
return number;
}
public void setNumber(int number) {
this.number = number;
}
@Override
public String toString() {
return "Request{" +
"productId=" + productId +
", productName='" + productName + '\'' +
", price=" + price +
", lunchboxPrice=" + lunchboxPrice +
", number=" + number +
'}';
}
}
// public static class Request {
// private long productId;
// private String productName;
// private double price;
// private double lunchboxPrice;
// private int number;
//
// public Request() {
// }
//
// public Request(long productId, String productName, double price, double lunchboxPrice, int number) {
// this.productId = productId;
// this.productName = productName;
// this.price = price;
// this.lunchboxPrice = lunchboxPrice;
// this.number = number;
// }
//
// public long getProductId() {
// return productId;
// }
//
// public void setProductId(long productId) {
// this.productId = productId;
// }
//
// public String getProductName() {
// return productName;
// }
//
// public void setProductName(String productName) {
// this.productName = productName;
// }
//
// public double getPrice() {
// return price;
// }
//
// public void setPrice(double price) {
// this.price = price;
// }
//
// public double getLunchboxPrice() {
// return lunchboxPrice;
// }
//
// public void setLunchboxPrice(double lunchboxPrice) {
// this.lunchboxPrice = lunchboxPrice;
// }
//
// public int getNumber() {
// return number;
// }
//
// public void setNumber(int number) {
// this.number = number;
// }
//
// @Override
// public String toString() {
// return "Request{" +
// "productId=" + productId +
// ", productName='" + productName + '\'' +
// ", price=" + price +
// ", lunchboxPrice=" + lunchboxPrice +
// ", number=" + number +
// '}';
// }
// }
@Override
public String toString() {
......
......@@ -29,12 +29,12 @@ public interface MealService {
@POST("orderDetails/add" + RetrofitUrlManager.IDENTIFICATION_PATH_SIZE + 2)
Observable<BaseResult> addFood(@Body RequestBody requestBody);
// @FormUrlEncoded
// @POST("order/get" + RetrofitUrlManager.IDENTIFICATION_PATH_SIZE + 2)
// Observable<Object> loadOrder(@Field("orderId") int orderId);
@FormUrlEncoded
@POST("order/get" + RetrofitUrlManager.IDENTIFICATION_PATH_SIZE + 2)
Observable<BaseRespose> loadOrder(@Field("orderId") int orderId);
@POST("orderDetails/delete" + RetrofitUrlManager.IDENTIFICATION_PATH_SIZE + 2)
Observable<BaseRespose> deleteFood(@Body RequestBody requestBody);
Observable<BaseResult> deleteFood(@Body RequestBody requestBody);
@POST("behavior/print" + RetrofitUrlManager.IDENTIFICATION_PATH_SIZE + 2)
Observable<BaseRespose> printOrder(@Body RequestBody requestBody);
......
......@@ -3,12 +3,13 @@ package com.gingersoft.gsa.cloud.table.mvp.presenter;
import android.app.Activity;
import android.app.Application;
import com.gingersoft.gsa.cloud.base.common.bean.OrderBean;
import com.gingersoft.gsa.cloud.base.common.bean.mealManage.MyOrderManage;
import com.gingersoft.gsa.cloud.base.common.bean.mealManage.OpenTableManage;
import com.gingersoft.gsa.cloud.database.bean.Food;
import com.gingersoft.gsa.cloud.table.mvp.contract.BaseOrderContract;
import com.gingersoft.gsa.cloud.table.mvp.model.bean.BillOrderMoney;
import com.gingersoft.gsa.cloud.base.common.bean.OrderDetail;
import com.gingersoft.gsa.cloud.table.mvp.model.bean.request.OrderRequest;
import com.gingersoft.gsa.cloud.table.mvp.ui.adapter.OrderMoneyAdapter;
import com.gingersoft.gsa.cloud.table.mvp.ui.adapter.meal.SelectMealAdapter;
import com.jess.arms.di.scope.ActivityScope;
......@@ -17,6 +18,8 @@ import com.jess.arms.integration.AppManager;
import com.jess.arms.mvp.BasePresenter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import javax.inject.Inject;
......@@ -60,7 +63,7 @@ public class BaseOrderPresenter<M extends BaseOrderContract.Model, V extends Bas
protected List<BillOrderMoney> mOrderMoneyList = new ArrayList<>();
//選中操作的食品下標
protected int orderSelectPosition= -1;
protected int orderSelectPosition = -1;
//食品數量
protected int foodCount;
......@@ -81,6 +84,7 @@ public class BaseOrderPresenter<M extends BaseOrderContract.Model, V extends Bas
foodCount = initFoodCount();
totalMoney = initFoodTotalMoney();
resetSelected();
initOrderAdapter();
}
......@@ -96,6 +100,8 @@ public class BaseOrderPresenter<M extends BaseOrderContract.Model, V extends Bas
private void initOrderAdapter() {
if (mSelectMealAdapter == null) {
mSelectMealAdapter = new SelectMealAdapter(IActivity, orderFoodList, this);
//設置子父級下標
mSelectMealAdapter.setIndex();
}
if (mOrderMoneyAdapter == null) {
mOrderMoneyAdapter = new OrderMoneyAdapter(IActivity, mOrderMoneyList, cashStr);
......@@ -158,10 +164,17 @@ public class BaseOrderPresenter<M extends BaseOrderContract.Model, V extends Bas
return true;
}
public void resetSelected() {
for (int i = 0; i < orderFoodList.size(); i++) {
OrderDetail datasBean = orderFoodList.get(i);
datasBean.setSelected(0);
}
}
public double initFoodTotalMoney() {
double total = 0.0;
for (OrderDetail food : myOrderManage.getOrderFoodList()) {
total += food.getAmount_price();
total += food.getPrice();
}
return total;
}
......@@ -174,10 +187,101 @@ public class BaseOrderPresenter<M extends BaseOrderContract.Model, V extends Bas
return cout;
}
protected String getDeleteFoodIds() {
StringBuilder builder = new StringBuilder();
List<OrderDetail> orderDetails = getOldOrderFoodLists();
int start_position = mSelectMealAdapter.getSelect_full_start_position() + 1;
int end_position = mSelectMealAdapter.getSelect_full_end_position() + 1;
for (int i = orderDetails.size() - 1; i >= 0; i--) {
int my_index = orderDetails.get(i).getMyIndex();
if (start_position <= my_index && my_index <= end_position) {
OrderDetail orderDetail1 = orderDetails.get(i);
builder.append(orderDetail1.getId());
if (i <= (orderDetails.size() - 1)) {
builder.append(",");
}
}
}
String str = builder.toString();
if (str.endsWith(",")) {
str = str.substring(0, str.length() - 1);
}
return str;
}
protected OrderRequest getCreateOrderRequest(List<OrderDetail> foodList) {
OrderRequest request = new OrderRequest();
request.setOrderDetails(orderDetailBeanToFoodRequest(foodList));
request.setPerson(OpenTableManage.getDefault().getPeopleNumber());
request.setTableId(OpenTableManage.getDefault().getTableBean().getId());
return request;
}
private List<OrderBean.OrderDetailsBean> orderDetailBeanToFoodRequest(List<OrderDetail> foodList) {
List<OrderBean.OrderDetailsBean> requests = new ArrayList<>();
if (foodList != null) {
for (OrderDetail food : foodList) {
OrderBean.OrderDetailsBean request = new OrderBean.OrderDetailsBean();
request.setProductName(food.getProductName());
request.setProductId(food.getId());
request.setParentId(food.getParentId());
request.setNumber(food.getNumber());
request.setPrice(food.getPrice());
request.setType(food.getType());
request.setLunchboxPrice(0);
requests.add(request);
}
}
return requests;
}
protected List<OrderDetail> getNewOrderFoodLists() {
List<OrderDetail> orderDetails = new ArrayList<>();
for (int i = 0; i < getOrderFoodLists().size(); i++) {
OrderDetail orderDetail = getOrderFoodLists().get(i);
if (orderDetail.isNew()) {
orderDetails.add(orderDetail);
}
}
return orderDetails;
}
protected List<OrderDetail> getOldOrderFoodLists() {
List<OrderDetail> orderDetails = new ArrayList<>();
for (int i = 0; i < getOrderFoodLists().size(); i++) {
OrderDetail orderDetail = getOrderFoodLists().get(i);
if (!orderDetail.isNew()) {
orderDetails.add(orderDetail);
}
}
return orderDetails;
}
public List<OrderDetail> getOrderFoodLists() {
return myOrderManage.getOrderFoodList();
}
protected void sortSelectMealByIsNew() {
List<OrderDetail> orderDetail = orderFoodList;
List<OrderDetail> sortOrderList = new ArrayList<>();
for (int i = 0; i < orderDetail.size(); i++) {
sortOrderList.add(orderDetail.get(i));
}
Comparator c = new Comparator<OrderDetail>() {
@Override
public int compare(OrderDetail o1, OrderDetail o2) {
Boolean isnew1 = o1.isNew();
Boolean isnew2 = o2.isNew();
return isnew1.compareTo(isnew2);
}
};
Collections.sort(sortOrderList, c);
orderDetail.clear();
for (int i = 0; i < sortOrderList.size(); i++) {
orderDetail.add(sortOrderList.get(i));
}
}
protected String getTableName() {
String tablename = "";
if (OpenTableManage.getDefault().isSplite()) {
......
......@@ -3,7 +3,6 @@ package com.gingersoft.gsa.cloud.table.mvp.presenter;
import android.app.Activity;
import android.app.Application;
import android.content.Context;
import android.text.TextUtils;
import android.view.View;
import com.gingersoft.gsa.cloud.base.utils.VibratorUtils;
......@@ -24,7 +23,7 @@ import me.jessyan.rxerrorhandler.core.RxErrorHandler;
import javax.inject.Inject;
import com.gingersoft.gsa.cloud.table.mvpcontract.FineItemKindContract;
import com.gingersoft.gsa.cloud.table.mvp.contract.FineItemKindContract;
import org.simple.eventbus.EventBus;
......
......@@ -2,6 +2,7 @@ package com.gingersoft.gsa.cloud.table.mvp.presenter;
import android.app.Application;
import android.graphics.Color;
import android.text.TextUtils;
import android.widget.BaseAdapter;
import com.billy.cc.core.component.CC;
......@@ -11,13 +12,18 @@ import com.gingersoft.gsa.cloud.base.common.bean.OrderDetail;
import com.gingersoft.gsa.cloud.base.common.bean.mealManage.MyOrderManage;
import com.gingersoft.gsa.cloud.base.common.bean.mealManage.OpenTableManage;
import com.gingersoft.gsa.cloud.base.utils.JsonUtils;
import com.gingersoft.gsa.cloud.base.utils.LanguageUtils;
import com.gingersoft.gsa.cloud.database.bean.Combo;
import com.gingersoft.gsa.cloud.database.bean.Modifier;
import com.gingersoft.gsa.cloud.database.bean.PrinterDeviceBean;
import com.gingersoft.gsa.cloud.table.mvp.model.bean.BaseRespose;
import com.gingersoft.gsa.cloud.database.bean.Food;
import com.gingersoft.gsa.cloud.database.bean.Modifier;
import com.gingersoft.gsa.cloud.database.utils.FoodDaoUtils;
import com.gingersoft.gsa.cloud.table.R;
import com.gingersoft.gsa.cloud.table.mvp.contract.MealStandContract;
import com.gingersoft.gsa.cloud.table.mvp.model.bean.BaseRespose;
import com.gingersoft.gsa.cloud.table.mvp.model.bean.request.DeleteOrderRequest;
import com.gingersoft.gsa.cloud.table.mvp.model.bean.request.OrderRequest;
import com.gingersoft.gsa.cloud.table.mvp.model.constant.MealConstant;
import com.gingersoft.gsa.cloud.table.mvp.ui.activity.MealStandActivity;
......@@ -27,17 +33,25 @@ import com.gingersoft.gsa.cloud.table.mvp.ui.adapter.meal.SelectMealAdapter;
import com.jess.arms.di.scope.ActivityScope;
import com.jess.arms.http.imageloader.ImageLoader;
import com.jess.arms.integration.AppManager;
import com.jess.arms.mvp.BasePresenter;
import com.jess.arms.utils.RxLifecycleUtils;
import com.qmuiteam.qmui.widget.dialog.QMUIDialog;
import com.qmuiteam.qmui.widget.dialog.QMUIDialogAction;
import org.simple.eventbus.EventBus;
import org.simple.eventbus.Subscriber;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.inject.Inject;
import androidx.core.content.res.TypedArrayUtils;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.annotations.NonNull;
import io.reactivex.schedulers.Schedulers;
......@@ -134,13 +148,9 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
@Override
public void onItemClick(OrderDetail datasBean, int position) {
mRootView.recordOperat(true);
RvMealClicked = true;
mRootView.recordOperat(true);
mSelectMealAdapter.setMyOrderManageSelectPosition();
loadComboData(datasBean);
}
......@@ -158,19 +168,13 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
@Override
public void onItemClick(Food datasBean, int position) {
mRootView.recordOperat(true);
if (!foodConditionFilter(datasBean)) {
return;
}
RvMealClicked = false;
mCurrentOrderDetailBean = OrderDetail.foodTransOrderDetails(datasBean, 1);
addFoodItemBefore(mCurrentOrderDetailBean, 1);
// loadComboData(mCurrentOrderDetailBean);
addFoodItemBefore(mCurrentOrderDetailBean);
updateOrderFoodNumber();
}
});
......@@ -183,7 +187,7 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
RvMealClicked = false;
// Order.DatasBean orderBean = isParentFood(datasBean.getFID());
// Food orderBean = isParentFood(datasBean.getFID());
// if (orderBean != null && !foodConditionFilter(orderBean)) {
// return;
// }
......@@ -193,8 +197,7 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
// displayModalKeyBoardDialog();
// } else {
if (datasBean.isModifier()) {
mCurrentOrderDetailBean = OrderDetail.modifierTransOrderDetail(datasBean.getModifier(), 1);
addModifierItem(mCurrentOrderDetailBean);
addModifierItem(datasBean.getModifier());
} else {
//设置当前操作的套餐细项
mCurrentOrderDetailBean = OrderDetail.comboTransOrderDetail(datasBean, 1, "combo", RvMealClicked);
......@@ -207,24 +210,59 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
}
});
}
private void addFoodItemBefore(OrderDetail datasBean, int number) {
int addPosition = mSelectMealAdapter.addFoodItem(datasBean);
private void addFoodItemBefore(OrderDetail datasBean) {
loadComboData(mCurrentOrderDetailBean);
int addPosition = addFoodItem(datasBean);
//这里主食品作为选中主体
mRootView.setMealRvScrollToPosition(addPosition);
}
private void addComboItem(OrderDetail datasBean) {
private int addFoodItem(OrderDetail orderDetail) {
int addPosition = mSelectMealAdapter.addFoodItem(orderDetail);
if (orderDetail.getComboLevel() > 0) {
//自动添加组合子食品
if (mCurrentComboList != null && mCurrentComboList.size() > 0) {
for (int i = 0; i < mCurrentComboList.size(); i++) {
Combo comboItem = mCurrentComboList.get(i);
mCurrentOrderDetailBean = OrderDetail.comboTransOrderDetail(comboItem, 1, "combo", RvMealClicked);
addPosition = addComboItem(mCurrentOrderDetailBean);
}
}
}
// if (mAutoModifierList != null && mAutoModifierList.size() > 0) {
// //自动添加mixqty>1細項
// for (int i = 0; i < mAutoModifierList.size(); i++) {
// Modifier.DatasBean modfier = mAutoModifierList.get(i);
// mSelectMealAdapter.addFoodItem(myOrderManage.modifierConvertOrderDetail(modfier));
// }
// }
return addPosition;
}
private int addComboItem(OrderDetail datasBean) {
int addPosition = mSelectMealAdapter.addFoodItem(datasBean);
mRootView.setMealRvScrollToPosition(addPosition);
return addPosition;
}
private void addModifierItem(OrderDetail datasBean) {
int addPosition = mSelectMealAdapter.addFoodItem(datasBean);
@Subscriber(tag = MealConstant.ADD_FOOD_MODIFIER)
private void addModifierItem(Modifier datasBean) {
mCurrentOrderDetailBean = OrderDetail.modifierTransOrderDetail(datasBean, 1);
int addPosition = mSelectMealAdapter.addFoodItem(mCurrentOrderDetailBean);
mRootView.setMealRvScrollToPosition(addPosition);
}
private void loadComboData(OrderDetail food) {
long fid = food.getFid();
long fid = food.getProductId();
if (mCurrentComboList == null) {
mCurrentComboList = new ArrayList<>();
} else {
......@@ -266,7 +304,7 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
}
public void createOrder() {
OrderRequest request = getCreateOrderRequest(getOrderFoodLists());
OrderRequest request = getCreateOrderRequest(getNewOrderFoodLists());
RequestBody requestBody = RequestBody.create(MediaType.parse("application/json"), JsonUtils.toJson(request));
mModel.createOrder(requestBody)
.subscribeOn(Schedulers.io())
......@@ -290,50 +328,8 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
});
}
/**
* 篩選出兩個list不同的對象
*
* @param listA
* @param listB
* @param <T>
* @return
*/
private <T> List<T> getDiff(List<T> listA, List<T> listB) {
List<T> diff = new ArrayList<>();
List<T> maxList = listA;
List<T> minList = listB;
if (listB.size() > listA.size()) {
maxList = listB;
minList = listA;
}
Map<T, Integer> map = new HashMap<>(maxList.size());
for (T t : maxList) {
map.put(t, 1);
}
for (T t : minList) {
if (map.get(t) != null) {
map.put(t, 2);
continue;
}
diff.add(t);
}
for (Map.Entry<T, Integer> entry : map.entrySet()) {
if (entry.getValue() == 1) {
diff.add(entry.getKey());
}
}
return diff;
}
public void addOrderFood() {
// List<Food> foods = getDiff(MyOrderManage.getInstance().getOrderFoodList(), mSelectMealAdapter.getInfos());
List<OrderDetail> foods = MyOrderManage.getInstance().getOrderFoodList();
List<OrderDetail> newFoods = new ArrayList<>();
for (OrderDetail food : foods) {
if (food.isNew()) {
newFoods.add(food);
}
}
List<OrderDetail> newFoods = getNewOrderFoodLists();
for (OrderDetail food : newFoods) {
food.setOrderId(MyOrderManage.getInstance().getOrderId());
}
......@@ -341,7 +337,7 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
RequestBody requestBody = RequestBody.create(MediaType.parse("application/json"), JsonUtils.toJson(orderBeans));
mModel.addFood(requestBody)
.subscribeOn(Schedulers.io())
.doOnSubscribe(disposable -> mRootView.showLoading(""))
.doOnSubscribe(disposable -> mRootView.showLoading(null))
.subscribeOn(AndroidSchedulers.mainThread())
.observeOn(AndroidSchedulers.mainThread())
.doAfterTerminate(() -> mRootView.hideLoading())
......@@ -351,8 +347,13 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
public void onNext(@NonNull BaseResult info) {
if (info != null && info.isSuccess()) {
mRootView.showMessage("送單成功");
if (OpenTableManage.getDefault() != null) {
//通知更新餐台状态
EventBus.getDefault().post(OpenTableManage.getDefault().getTableBean().getId(), "initTable_status_event");
}
mRootView.killMyself();
// mRootView.launchActivity(new Intent(IActivity, MealStandActivity.class));
printSendOrder(newFoods);
// printSendOrder(newFoods);
} else {
mRootView.showMessage("送單失敗");
}
......@@ -391,15 +392,19 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
// });
}
public void deleteFood(long id) {
public void deleteFood() {
String ids = getDeleteFoodIds();
if (TextUtils.isEmpty(ids)) {
return;
}
RequestBody requestBody = new FormBody.Builder()
.add("id", id + "")
.add("ids", ids)
.build();
mModel.deleteFood(requestBody)
.subscribeOn(Schedulers.io())
.doOnSubscribe(disposable -> mRootView.showLoading(""))
.doOnSubscribe(disposable -> mRootView.showLoading(null))
.subscribeOn(AndroidSchedulers.mainThread())
.observeOn(AndroidSchedulers.mainThread())
.doAfterTerminate(() -> mRootView.hideLoading())
......@@ -407,8 +412,27 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
.subscribe(new ErrorHandleSubscriber<BaseRespose>(mErrorHandler) {
@Override
public void onNext(@NonNull BaseRespose info) {
if (info != null && info.isSuccess()) {
mRootView.showMessage("刪除成功");
//删除所有已下单信息
deleteOldFood();
if (info.getData() != null && info.getData().getOrderDetails() != null) {
//緩存訂單信息
MyOrderManage.getInstance().setOrderBean(new OrderBean(info.getData().getId(), info.getData().getOrderNo(), info.getData().getStatus(), info.getData().getCreateTime()));
//緩存食品信息
List<OrderDetail> orderDetailList = OrderDetail.orderTransOrderDetails(info.getData().getOrderDetails());
orderFoodList.addAll(orderDetailList);
}
//重新排序食品 将已下单食品放到前面
sortSelectMealByIsNew();
mSelectMealAdapter.notifyDataSetChanged();
mSelectMealAdapter.setIndex();
} else {
mRootView.showMessage("刪除失敗");
}
......@@ -431,9 +455,9 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
dialogBuilder.addAction("取消", (dialog, index) -> dialog.dismiss());
dialogBuilder.addAction(0, "確認", QMUIDialogAction.ACTION_PROP_NEGATIVE, (dialog, index) -> {
dialog.dismiss();
int deletePosition = mSelectMealAdapter.removeFoodItem();
mRootView.setMealRvScrollToPosition(deletePosition);
deleteFood(id);
// int deletePosition = mSelectMealAdapter.removeFoodItem();
// mRootView.setMealRvScrollToPosition(deletePosition);
deleteFood();
});
dialogBuilder.create(R.style.QMUI_Dialog).show();
}
......@@ -458,7 +482,7 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
if (!deleteFood.isNew()) {
//TODO 刪除已下單食品
deleteWithOrderedFoodById(deleteFood.getFid());
deleteWithOrderedFoodById(deleteFood.getId());
} else {
if (deleteStyle == 2) {
mSelectMealAdapter.removeAllNewFoodItem();
......@@ -489,18 +513,41 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
}
}
public void deleteOldFood() {
List<Integer> removeFoodIndex = new ArrayList<>();
//記錄删除所有已下单食品
for (int i = 0; i < getOrderFoodLists().size(); i++) {
OrderDetail myOrder = getOrderFoodLists().get(i);
if (!myOrder.isNew()) {
removeFoodIndex.add(myOrder.getMyIndex());
} else {
//未下單单食品下新加的子项 一起删除
if (removeFoodIndex.indexOf(myOrder.getParentIndex()) != -1) {
removeFoodIndex.add(myOrder.getMyIndex());
}
}
}
List<OrderDetail> orderFoodList = getOrderFoodLists();
//删除所有已下单食品下子食品
for (int i = removeFoodIndex.size() - 1; i >= 0; i--) {
int removeIndex = removeFoodIndex.get(i) - 1;
if (removeIndex > -1 && removeIndex < orderFoodList.size()) {
orderFoodList.remove(removeIndex);
}
}
if (removeFoodIndex.size() > 0) {
removeFoodIndex.clear();
mSelectMealAdapter.notifyDataSetChanged();
}
}
public void changedMealByParentId(long parentId) {
List<Food> foodList = mModel.queryDB_FoodList(parentId);
mFoodAdapter.resetSelect(-1, null);
if (foodList != null) {
mFoodList.clear();
mFoodList.addAll(foodList);
//根据Item个数显示每一行的个数
mRootView.setFoodRecycleSpanCount(mFoodList.size());
mFoodAdapter.notifyDataSetChanged();
updateFoodData(foodList);
}
mRootView.showViewModeVisibility(MealConstant.food_ViewMode, MealConstant.food_group_ViewMode);
}
......@@ -525,6 +572,8 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
return;
}
setFoodComboStatus(food);
int addPosition = mSelectMealAdapter.addFoodItem(OrderDetail.foodTransOrderDetails(food, 1));
mRootView.setMealRvScrollToPosition(addPosition);
......@@ -542,7 +591,7 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
for (int i = 0; i < getOrderFoodLists().size(); i++) {
OrderDetail orderFood = getOrderFoodLists().get(i);
if (orderFood.getFid() == foodBean.getId()) {
if (orderFood.getId() == foodBean.getId()) {
currentSelectNumber += orderFood.getNumber();
}
}
......@@ -642,7 +691,7 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
int iNumber = 0;
for (int j = 0; j < orderFoodList.size(); j++) {
OrderDetail datasBean = orderFoodList.get(j);
if (datasBean.isNew() && datasBean.getFid() == foodBean.getId()) {
if (datasBean.isNew() && datasBean.getId() == foodBean.getId()) {
iNumber = iNumber + datasBean.getNumber();
foodBean.setNumber(iNumber);
}
......@@ -659,7 +708,7 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
if (getOrderFoodLists() != null) {
for (int j = 0; j < getOrderFoodLists().size(); j++) {
OrderDetail food = getOrderFoodLists().get(j);
if (food.isNew() && food.getFid() == foodBean.getId()) {
if (food.isNew() && food.getId() == foodBean.getId()) {
iNumber = iNumber + food.getNumber();
foodBean.setNumber(iNumber);
}
......@@ -683,34 +732,31 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
return String.valueOf(i);
}
private OrderRequest getCreateOrderRequest(List<OrderDetail> foodList) {
OrderRequest request = new OrderRequest();
request.setOrderDetails(orderDetailBeanToFoodRequest(foodList));
request.setPerson(OpenTableManage.getDefault().getPeopleNumber());
request.setTableId(OpenTableManage.getDefault().getTableBean().getId());
return request;
/**
* 標識食品是否为组合食品
*
* @param foodList
*/
private void setFoodComboListStatus(List<Food> foodList) {
for (int i = 0; i < foodList.size(); i++) {
Food datasBean = foodList.get(i);
List<Combo> foodComboList = mModel.isComboFood(datasBean.getId());
if (foodComboList.size() > 0) {
datasBean.setComboFood(true);
}
private OrderRequest getAddOrderFoodRequest(List<OrderDetail> foodList) {
OrderRequest request = new OrderRequest();
request.setOrderDetails(orderDetailBeanToFoodRequest(foodList));
return request;
}
private List<OrderRequest.Request> orderDetailBeanToFoodRequest(List<OrderDetail> foodList) {
List<OrderRequest.Request> requests = new ArrayList<>();
if (foodList != null) {
for (OrderDetail food : foodList) {
OrderRequest.Request request = new OrderRequest.Request();
request.setProductName(food.getName());
request.setProductId(food.getFid());
request.setNumber(food.getNumber());
request.setPrice(food.getAmount_price());
request.setLunchboxPrice(0);
requests.add(request);
}
/**
* 標識食品是否为组合食品
*
* @param food
*/
private void setFoodComboStatus(Food food) {
List<Combo> foodComboList = mModel.isComboFood(food.getId());
if (foodComboList.size() > 0) {
food.setComboFood(true);
}
return requests;
}
public Food getOrderFoodById(long fid) {
......@@ -723,6 +769,15 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
return null;
}
private void updateFoodData(List<Food> foodList) {
setFoodComboListStatus(foodList);
mFoodList.clear();
mFoodList.addAll(foodList);
//根据Item个数显示每一行的个数
mRootView.setFoodRecycleSpanCount(mFoodList.size());
mFoodAdapter.notifyDataSetChanged();
}
private void updateComboData(List<Combo> comboList) {
mComboList.clear();
mComboList.addAll(comboList);
......
......@@ -145,7 +145,7 @@ public class OrderContentPresenter extends BaseOrderPresenter<OrderContentContra
RequestBody requestBody = RequestBody.create(MediaType.parse("application/json"), JsonUtils.toJson(request));
mModel.createOrder(requestBody)
.subscribeOn(Schedulers.io())
.doOnSubscribe(disposable -> mRootView.showLoading(""))
.doOnSubscribe(disposable -> mRootView.showLoading(null))
.subscribeOn(AndroidSchedulers.mainThread())
.observeOn(AndroidSchedulers.mainThread())
.doAfterTerminate(() -> mRootView.hideLoading())
......@@ -167,22 +167,15 @@ public class OrderContentPresenter extends BaseOrderPresenter<OrderContentContra
}
private void addOrderFood() {
List<OrderDetail> foods = MyOrderManage.getInstance().getOrderFoodList();
List<OrderDetail> newFoods = new ArrayList<>();
for (OrderDetail food : foods) {
if (food.isNew()) {
newFoods.add(food);
}
}
List<OrderDetail> newFoods = getNewOrderFoodLists();
for (OrderDetail food : newFoods) {
food.setOrderId(MyOrderManage.getInstance().getOrderId());
}
List<OrderBean.OrderDetailsBean> orderBeans = OrderBean.transOrderDetails(newFoods);
RequestBody requestBody = RequestBody.create(MediaType.parse("application/json"), JsonUtils.toJson(orderBeans));
// RequestBody requestBody = RequestBody.create(MediaType.parse("application/json"), JsonUtils.toJson(getOrderFoodLists()));
mModel.addFood(requestBody)
.subscribeOn(Schedulers.io())
.doOnSubscribe(disposable -> mRootView.showLoading(""))
.doOnSubscribe(disposable -> mRootView.showLoading(null))
.subscribeOn(AndroidSchedulers.mainThread())
.observeOn(AndroidSchedulers.mainThread())
.doAfterTerminate(() -> mRootView.hideLoading())
......@@ -209,7 +202,7 @@ public class OrderContentPresenter extends BaseOrderPresenter<OrderContentContra
mModel.printOrder(requestBody)
.subscribeOn(Schedulers.io())
.doOnSubscribe(disposable -> mRootView.showLoading(""))
.doOnSubscribe(disposable -> mRootView.showLoading(null))
.subscribeOn(AndroidSchedulers.mainThread())
.observeOn(AndroidSchedulers.mainThread())
.doAfterTerminate(() -> mRootView.hideLoading())
......@@ -252,7 +245,7 @@ public class OrderContentPresenter extends BaseOrderPresenter<OrderContentContra
// .call();
// }
private OrderRequest getCreateOrderRequest(List<OrderDetail> foodList) {
protected OrderRequest getCreateOrderRequest(List<OrderDetail> foodList) {
OrderRequest request = new OrderRequest();
request.setOrderDetails(orderDetailBeanToFoodRequest(foodList));
request.setPerson(OpenTableManage.getDefault().getPeopleNumber());
......@@ -260,21 +253,21 @@ public class OrderContentPresenter extends BaseOrderPresenter<OrderContentContra
return request;
}
private OrderRequest getAddOrderFoodRequest(List<OrderDetail> foodList) {
protected OrderRequest getAddOrderFoodRequest(List<OrderDetail> foodList) {
OrderRequest request = new OrderRequest();
request.setOrderDetails(orderDetailBeanToFoodRequest(foodList));
return request;
}
private List<OrderRequest.Request> orderDetailBeanToFoodRequest(List<OrderDetail> foodList) {
List<OrderRequest.Request> requests = new ArrayList<>();
private List<OrderBean.OrderDetailsBean> orderDetailBeanToFoodRequest(List<OrderDetail> foodList) {
List<OrderBean.OrderDetailsBean> requests = new ArrayList<>();
if (foodList != null) {
for (OrderDetail food : foodList) {
OrderRequest.Request request = new OrderRequest.Request();
request.setProductName(food.getName());
request.setProductId(food.getFid());
OrderBean.OrderDetailsBean request = new OrderBean.OrderDetailsBean();
request.setProductName(food.getProductName());
request.setProductId(food.getId());
request.setNumber(food.getNumber());
request.setPrice(food.getAmount_price());
request.setPrice(food.getPrice());
request.setLunchboxPrice(0);
requests.add(request);
}
......
......@@ -102,15 +102,16 @@ public class OrderPayPresenter extends BaseOrderPresenter<OrderPayContract.Model
@Override
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
PayMethod method = (PayMethod) adapter.getItem(position);
if (!isCashPayMethod(method)) {
PayMethod N5PayMethod = getSelectN5PayMethod();
if (N5PayMethod != null) {
//最多選擇2中支付方式(現金+其他)
mBillMoneyList.remove(N5PayMethod);
mBillMoneyAdapter.notifyDataSetChanged();
}
}
if (!mBillMoneyList.contains(method)) {
// if (!isCashPayMethod(method)) {
// PayMethod N5PayMethod = getSelectN5PayMethod();
// if (N5PayMethod != null) {
// //最多選擇2中支付方式(現金+其他)
// mBillMoneyList.remove(N5PayMethod);
// mBillMoneyAdapter.notifyDataSetChanged();
// }
// }
mBillMoneyList.clear();
// if (!mBillMoneyList.contains(method)) {
double differenceMoney = getDifferenceMoney();
if (differenceMoney > -1) {
//補足差額
......@@ -123,7 +124,7 @@ public class OrderPayPresenter extends BaseOrderPresenter<OrderPayContract.Model
mRootView.setBillMoneyRvScrollToPosition(mBillMoneyList.size() - 1);
//設置差額狀態
mRootView.setDifferenceText();
}
// }
}
});
mBillMoneyAdapter.setOnItemClickListener(new BillMoneyAdapter.OnItemClickListener() {
......@@ -162,7 +163,6 @@ public class OrderPayPresenter extends BaseOrderPresenter<OrderPayContract.Model
List<PayMethod> payMethods = JsonUtils.parseArray(baseResult.getData(), PayMethod.class);
mBillMethodList.addAll(payMethods);
mBillMethodAdapter.notifyDataSetChanged();
// mRootView.paySuccess();
}
}
});
......@@ -180,23 +180,24 @@ public class OrderPayPresenter extends BaseOrderPresenter<OrderPayContract.Model
.add("orderId", MyOrderManage.getInstance().getOrderId() + "")
.add("person", OpenTableManage.getDefault().getPeopleNumber() + "")
.add("status", statius)
.add("orderPayType", mBillMoneyList.get(0).getId()+"")
.build();
// mModel.updateOrderStatus(requestBody)
// .subscribeOn(Schedulers.io())
// .doOnSubscribe(disposable -> mRootView.showLoading(""))
// .subscribeOn(AndroidSchedulers.mainThread())
// .observeOn(AndroidSchedulers.mainThread())
// .doAfterTerminate(()-> mRootView.hideLoading())
// .compose(RxLifecycleUtils.bindToLifecycle(mRootView))
// .subscribe(new ErrorHandleSubscriber<BaseResult>(mErrorHandler) {
// @Override
// public void onNext(BaseResult baseResult) {
// if(baseResult.isSuccess()){
// //結賬成功
//// mRootView.paySuccess();
// }
// }
// });
mModel.updateOrderStatus(requestBody)
.subscribeOn(Schedulers.io())
.doOnSubscribe(disposable -> mRootView.showLoading(""))
.subscribeOn(AndroidSchedulers.mainThread())
.observeOn(AndroidSchedulers.mainThread())
.doAfterTerminate(() -> mRootView.hideLoading())
.compose(RxLifecycleUtils.bindToLifecycle(mRootView))
.subscribe(new ErrorHandleSubscriber<BaseResult>(mErrorHandler) {
@Override
public void onNext(BaseResult baseResult) {
if (baseResult.isSuccess()) {
//結賬成功
mRootView.paySuccess();
}
}
});
}
public void pressExact() {
......
......@@ -223,7 +223,7 @@ public class MealStandActivity extends BaseActivity<MealStandPresenter> implemen
//总的页数
private int totalPage;
//每页显示的最大的数量
private int mPageSize = 12;
// private int mPageSize = 10;
//GridView作为一个View对象添加到ViewPager集合中
private List<View> viewPagerList;
private static final int FINISH = 101;
......@@ -288,13 +288,13 @@ public class MealStandActivity extends BaseActivity<MealStandPresenter> implemen
foodGroupList.get(0).setSelected(true);
//总的页数向上取整
totalPage = (int) Math.ceil(foodGroupList.size() * 1.0 / mPageSize);
totalPage = (int) Math.ceil(foodGroupList.size() * 1.0 / GoldConstants.foodGriupPageSize);
viewPagerList = new ArrayList<>();
for (int i = 0; i < totalPage; i++) {
//每个页面都是inflate出一个新实例
LineGridView gridView = (LineGridView) View.inflate(this, R.layout.meal_food_group_grid, null);
gridView.setNumColumns(GoldConstants.foodGriupColCount);
HorizontalGridViewAdpter horizontalGridViewAdpter = new HorizontalGridViewAdpter(this, foodGroupList, i, mPageSize);
HorizontalGridViewAdpter horizontalGridViewAdpter = new HorizontalGridViewAdpter(this, foodGroupList, i, GoldConstants.foodGriupPageSize);
gridView.setAdapter(horizontalGridViewAdpter);
if (i == 0) {
mFoodGroupGridViewAdapter = horizontalGridViewAdpter;
......@@ -834,7 +834,7 @@ public class MealStandActivity extends BaseActivity<MealStandPresenter> implemen
@Override
public void showLoading(String message) {
if (!TextUtils.isEmpty(message))
if (message != null)
LoadingDialog.showDialogForLoading(this, message, true);
else
LoadingDialog.showDialogForLoading(this);
......@@ -880,11 +880,11 @@ public class MealStandActivity extends BaseActivity<MealStandPresenter> implemen
initFineItemTabBarViewPage();
fineItemAllFragment.onMidEvent(mPresenter.getCurrentOrderDetailBean().getFid());
fineItemAllFragment.onMidEvent(mPresenter.getCurrentOrderDetailBean().getProductId());
// EventBus.getDefault().post(mSoldoutList_full, "FineItemAllFragment_onCurrentSlodoutFoodList_FullEvent");
// EventBus.getDefault().post(mPresenter.getCurrentOrderDetailBean().getFid(), "FineItemAllFragment_onMidEvent");
fineItemKindFragment.onMidEvent(mPresenter.getCurrentOrderDetailBean().getFid());
fineItemKindFragment.onMidEvent(mPresenter.getCurrentOrderDetailBean().getProductId());
// EventBus.getDefault().post(mSoldoutList_full, "FineItemKindFragment_onCurrentSlodoutFoodList_FullEvent");
// EventBus.getDefault().post(mPresenter.getCurrentOrderDetailBean().getFid(), "FineItemKindFragment_onMidEvent");
......
package com.gingersoft.gsa.cloud.table.mvp.ui.adapter.meal;
import android.content.Context;
import android.text.TextUtils;
import android.view.Gravity;
import android.view.View;
import android.widget.ImageView;
......@@ -224,7 +225,7 @@ public class SelectMealAdapter extends DefaultAdapter<OrderDetail> {
private void setName(OrderDetail datasBean) {
int flevel = datasBean.getItemType();
String name = datasBean.getName();
String name = datasBean.getProductName();
switch (flevel) {
case 1:
tv_number.setGravity(Gravity.LEFT);
......@@ -239,6 +240,22 @@ public class SelectMealAdapter extends DefaultAdapter<OrderDetail> {
break;
}
tv_name.setText(name);
int selected = datasBean.getSelected();
if (selected != 0) {
//作为主体被选中 开启跑马灯效果
tv_name.setFocusable(true);
tv_name.setEllipsize(TextUtils.TruncateAt.MARQUEE);//设置旋转
tv_name.setMarqueeRepeatLimit(-1);//-1为死循环,1为1次
tv_name.setSelected(true);//设置不获取焦点就可以转
tv_name.setFocusableInTouchMode(true);
} else {
//关闭跑马灯效果
tv_name.setFocusable(false);
tv_name.setMarqueeRepeatLimit(0);
tv_name.setSelected(false);
tv_name.setFocusableInTouchMode(false);
}
}
private void setNumber(OrderDetail datasBean) {
......@@ -252,7 +269,7 @@ public class SelectMealAdapter extends DefaultAdapter<OrderDetail> {
}
private void setMoney(OrderDetail datasBean) {
double price = datasBean.getAmount_price();
double price = datasBean.getPrice();
if (price != 0) {
tv_money.setText(carshStr + MoneyUtil.get_ItemDecimals_money(price));
} else {
......@@ -368,7 +385,7 @@ public class SelectMealAdapter extends DefaultAdapter<OrderDetail> {
if (orderItem != null && orderItem.isNew()) {
mInfos.remove(i);
notifyItemChanged(i);
Food orderBean = mMealStandPresenter.getOrderFoodById(orderItem.getFid());
Food orderBean = mMealStandPresenter.getOrderFoodById(orderItem.getId());
if (orderBean != null) {
mMealStandPresenter.setUserMaxQty(orderBean);
}
......@@ -420,7 +437,93 @@ public class SelectMealAdapter extends DefaultAdapter<OrderDetail> {
* 删除食品子项及折扣
*/
public void removeChildItem() {
OrderDetail orderDetail= mInfos.get(select_position);
if (select_position > -1) {
switch (orderDetail.getItemType()) {
case 1:
//第一层下方有细项 从下方往上删
if (select_end_position != 0 && select_end_position > select_position) {
for (int i = select_end_position; i > select_position; i--) {
OrderDetail orderBean = mInfos.get(i);
boolean isParentChild = orderBean.getParentIndex() == orderDetail.getMyIndex();
if (orderBean.getItemType() == 3 && !isParentChild) {
//第二层 下面有第三层子项也要一并删除
removeAllChild3ByCombo(orderBean);
} else {
mInfos.remove(i);
notifyItemChanged(i);
}
break;
}
} else {
//第一层没有子食品 直接退出
return;
}
break;
case 2:
if (select_end_position != 0 &&
select_end_position > select_position &&
hasChild3Food(orderDetail)) {
//第二层 下面有第三层子项也要一并删除
for (int i = select_end_position; i >= select_position; i--) {
mInfos.remove(i);
notifyItemChanged(i);
}
} else {
// if (mInfos.get(select_position).comid.equals("discount")) {
// //如果刪除的是折扣,這裡初始化父食品D標識
// int parent_index = mInfos.get(select_position).getParent_index() -1;
// if (parent_index > -1 && parent_index < mInfos.size()) {
// mInfos.get(parent_index).setDiscount_double1(true);
// }
// }
mInfos.remove(select_position);
notifyItemChanged(select_position);
}
break;
case 3:
mInfos.remove(select_position);
notifyItemChanged(select_position);
break;
}
}
if (select_position >= mInfos.size()) {
select_position = mInfos.size() - 1;
}
if (mInfos.size() == 0) {
//全部删除重置选中下标
select_position = -1;
} else {
switch (orderDetail.getItemType()) {
case 1:
break;
case 2:
int comboIndex = getComboEdgeIndex();
if (comboIndex != (orderDetail.getMyIndex() - 1)) {
select_position -= 1;
} else {
if (select_position == mInfos.size()) {
select_position -= 1;
}
}
break;
case 3:
int edgeIndex = getChild2EdgeIndex();
if (edgeIndex != (orderDetail.getMyIndex() - 1)) {
select_position -= 1;
} else {
if (select_position == mInfos.size()) {
select_position -= 1;
}
}
break;
}
}
setIndex();
setSelectPosition(select_position);
setMyOrderManageSelectPosition();
}
private void removeIntactFoodItem() {
......@@ -437,6 +540,24 @@ public class SelectMealAdapter extends DefaultAdapter<OrderDetail> {
}
}
/**
* 删除第二层子食品下所有第三层备注
*
* @param orderDetail
* @return
*/
private boolean removeAllChild3ByCombo(OrderDetail orderDetail) {
boolean remove = false;
for (int i = mInfos.size() - 1; i >= 0; i--) {
boolean accordChild3 = mInfos.get(i).getParentIndex() == orderDetail.getParentIndex() || mInfos.get(i).getMyIndex() == orderDetail.getParentIndex();
if (mInfos.get(i).getItemType() != 1 && accordChild3) {
mInfos.remove(i);
notifyItemChanged(i);
remove = true;
}
}
return remove;
}
public void setMyOrderManageSelectPosition() {
MyOrderManage.getInstance().setSelstartpostion(select_start_position);
......@@ -504,17 +625,17 @@ public class SelectMealAdapter extends DefaultAdapter<OrderDetail> {
private void setItemNo(OrderDetail foodBean) {
switch (foodBean.getItemType()) {
case 1:
foodBean.setParentId(foodBean.getFid());
// foodBean.setParentId(foodBean.getId());
break;
case 2:
case 3:
long itemno = -1;
if (select_position != -1 && select_position < mInfos.size()) {
if (mInfos.get(select_position).isIsfood()) {
itemno = mInfos.get(select_position).getFid();
itemno = mInfos.get(select_position).getId();
} else {
if (select_start_position != -1 && select_start_position < mInfos.size()) {
itemno = mInfos.get(select_start_position).getFid();
itemno = mInfos.get(select_start_position).getId();
}
}
}
......@@ -752,12 +873,23 @@ public class SelectMealAdapter extends DefaultAdapter<OrderDetail> {
notifyDataSetChanged();
}
private void resetSelected() {
/**
* 获取食品子项最后一个子项位置
*
* @return
*/
private int getComboEdgeIndex() {
int parent_index = getParentFoodIndex(mInfos.get(select_position));
int edgeIndex = parent_index;
for (int i = 0; i < mInfos.size(); i++) {
OrderDetail datasBean = mInfos.get(i);
// datasBean.setIsSelected(false);
if (datasBean.getItemType() == 2 && datasBean.getParentIndex() == parent_index) {
edgeIndex = i;
}
}
return edgeIndex;
}
public List<OrderDetail> getInfos() {
return mInfos;
......
......@@ -3,7 +3,6 @@ package com.gingersoft.gsa.cloud.table.mvp.ui.fragment;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
......@@ -16,7 +15,7 @@ import com.jess.arms.base.BaseFragment;
import com.jess.arms.base.DefaultAdapter;
import com.jess.arms.di.component.AppComponent;
import com.jess.arms.utils.ArmsUtils;
import com.gingersoft.gsa.cloud.table.mvpcontract.FineItemKindContract;
import com.gingersoft.gsa.cloud.table.mvp.contract.FineItemKindContract;
import com.gingersoft.gsa.cloud.table.mvp.presenter.FineItemKindPresenter;
import org.simple.eventbus.Subscriber;
......
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<RelativeLayout
android:id="@+id/rl_container"
android:layout_width="match_parent"
android:layout_height="wrap_content">
......@@ -10,11 +14,11 @@
android:layout_height="match_parent"
android:layout_marginRight="2px"
android:layout_marginTop="2px"
android:text="food"
android:textSize="@dimen/sp_14"
android:gravity="center"
android:text="food"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="@drawable/meal_selector_food_backgroup" />
android:textColor="@drawable/meal_selector_food_backgroup"
android:textSize="@dimen/sp_14" />
<TextView
android:id="@+id/tv_number"
......@@ -34,9 +38,9 @@
android:layout_gravity="right"
android:layout_marginRight="2px"
android:layout_marginTop="2px"
android:visibility="invisible"
android:background="@drawable/ui_selector_white_rect"
android:text="sold" />
android:text="sold"
android:visibility="invisible" />
<View
android:id="@+id/right_line"
......@@ -52,4 +56,5 @@
android:layout_alignParentTop="true"
android:background="@color/theme_black" />
</RelativeLayout>
</RelativeLayout>
......@@ -70,6 +70,10 @@ public class LoginPresenter extends BasePresenter<LoginContract.Model, LoginCont
.add("userName", "admin")
.add("passWord", "123456")
.build();
// requestBody = new FormBody.Builder()
// .add("userName", "19901001")
// .add("passWord", "123456")
// .build();
} else {
requestBody = new FormBody.Builder()
.add("userName", account.trim() + "")
......
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