Commit 9ca88b20 by 宁斌

skyorder打印處理 新增哆啦A夢:滴滴開源工具(辅助开发工具、测试效率工具、视觉辅助工具)

parent 654437d8
package com.gingersoft.gsa.cloud.base.common.bean;
/**
* @author : bin
* @create date: 2020-11-05
* @update date: 2020-11-05
* @description:
*/
public class BaseResultOld {
}
package com.gingersoft.gsa.cloud.config;
/**
* @author : bin
* @create date: 2020-11-05
* @update date: 2020-11-05
* @description:
*/
public class LogConfig {
}
package com.gingersoft.gsa.cloud.bean.expandInfo; package com.gingersoft.gsa.cloud.config.expandInfo;
import android.util.SparseArray;
import com.gingersoft.gsa.cloud.base.Api; import com.gingersoft.gsa.cloud.base.Api;
import com.gingersoft.gsa.cloud.base.utils.JsonUtils; import com.gingersoft.gsa.cloud.base.utils.JsonUtils;
...@@ -57,14 +55,14 @@ public class ExpandInfoSetting { ...@@ -57,14 +55,14 @@ public class ExpandInfoSetting {
public <T> T getValue() { public <T> T getValue() {
if (valueInt != null) { if (valueChar != null) {
return (T) valueInt;
} else if (valueChar != null) {
return (T) valueChar; return (T) valueChar;
} else if (valueBoolean != null) { } else if (valueBoolean != null) {
return (T) valueBoolean; return (T) valueBoolean;
} else if (valueDateTime != null) { } else if (valueDateTime != null) {
return (T) valueDateTime; return (T) valueDateTime;
} else if (valueInt != null) {
return (T) valueInt;
} }
return null; return null;
} }
...@@ -94,7 +92,7 @@ public class ExpandInfoSetting { ...@@ -94,7 +92,7 @@ public class ExpandInfoSetting {
@Override @Override
public void onNext(String s) { public void onNext(String s) {
int i = 1;
} }
@Override @Override
......
package com.gingersoft.gsa.cloud.bean.expandInfo; package com.gingersoft.gsa.cloud.config.expandInfo;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
...@@ -103,6 +103,11 @@ public class FunctionExtendedConfiguration { ...@@ -103,6 +103,11 @@ public class FunctionExtendedConfiguration {
.remark("餐檯模式下單頁多少秒不操作返回餐檯頁面") .remark("餐檯模式下單頁多少秒不操作返回餐檯頁面")
.build(); .build();
private ExpandInfoSetting QRCodeTimeSlice = ExpandInfoSetting.builder()
.valueChar("00,15,30,45")
.remark("QRCode交台时间片(分)使用逗号分隔")
.build();
public <T>T getRoundingVaule() { public <T>T getRoundingVaule() {
return Rounding.getValue(); return Rounding.getValue();
} }
...@@ -174,4 +179,8 @@ public class FunctionExtendedConfiguration { ...@@ -174,4 +179,8 @@ public class FunctionExtendedConfiguration {
public <T>T getAutoQuitTimeVaule() { public <T>T getAutoQuitTimeVaule() {
return AutoQuitTime.getValue(); return AutoQuitTime.getValue();
} }
public <T>T getQRCodeTimeSliceVaule() {
return QRCodeTimeSlice.getValue();
}
} }
package com.gingersoft.gsa.cloud.bean.expandInfo; package com.gingersoft.gsa.cloud.config.expandInfo;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
......
...@@ -2,6 +2,7 @@ package com.gingersoft.gsa.cloud.globalconfig; ...@@ -2,6 +2,7 @@ package com.gingersoft.gsa.cloud.globalconfig;
import android.app.Application; import android.app.Application;
import android.content.Context; import android.content.Context;
import com.gingersoft.gsa.cloud.constans.HttpsConstans; import com.gingersoft.gsa.cloud.constans.HttpsConstans;
import com.gingersoft.gsa.cloud.globalconfig.applyOptions.MyGlobalHttpHandler; import com.gingersoft.gsa.cloud.globalconfig.applyOptions.MyGlobalHttpHandler;
import com.gingersoft.gsa.cloud.globalconfig.applyOptions.MyGsonConfiguration; import com.gingersoft.gsa.cloud.globalconfig.applyOptions.MyGsonConfiguration;
...@@ -14,10 +15,14 @@ import com.gingersoft.gsa.cloud.globalconfig.lifecyclesOptioins.MyAppLifecycles; ...@@ -14,10 +15,14 @@ import com.gingersoft.gsa.cloud.globalconfig.lifecyclesOptioins.MyAppLifecycles;
import com.jess.arms.base.delegate.AppLifecycles; import com.jess.arms.base.delegate.AppLifecycles;
import com.jess.arms.di.module.GlobalConfigModule; import com.jess.arms.di.module.GlobalConfigModule;
import com.jess.arms.integration.ConfigModule; import com.jess.arms.integration.ConfigModule;
import com.jess.arms.integration.cache.Cache;
import com.jess.arms.integration.cache.CacheType;
import com.jess.arms.utils.DataHelper; import com.jess.arms.utils.DataHelper;
import java.io.File; import java.io.File;
import java.util.List; import java.util.List;
import androidx.annotation.NonNull;
import androidx.fragment.app.FragmentManager; import androidx.fragment.app.FragmentManager;
public class GlobalConfiguration implements ConfigModule { public class GlobalConfiguration implements ConfigModule {
......
package com.gingersoft.gsa.cloud.function;
import android.content.Context;
import android.util.DisplayMetrics;
import android.util.Log;
import com.jess.arms.utils.DeviceUtils;
import java.util.HashSet;
import java.util.Set;
import lombok.Data;
/**
* 作者:ELEGANT_BIN
* 版本:1.6.0
* 创建日期:2018/8/11
* 修订历史:2018/8/11
* 描述:
*/
@Data
public class FunctionStyleUtils {
private int ID;
private String TableNumPadChar;
private String PLUNumPadChar;
private int FoodTypeFontSize = 12;
private int FoodFontSize = 12;
private String TableExt = "";
private int BaseDpi = 480;
private int BaseHeight = 1920;
private int BaseWidth = 1080;
private int ModFontSize = 14;
private int BillListFontSize = 12;
private int BillTotalFontSize = 12;
private int FoodlListFontSize = 18;
private int LayoutBillListHeight = 40;
private int LayoutQtyHeight = 40;
private int LayoutQuitHeight = 40;
private int LayoutFoodTypeHeight = 100;
private int FoodBtnHeight = 120;
private int ModBtnHeight = 75;
private int FoodTypeCol = 4;
private int FoodTypeRow = 1;
private int FoodCol = 4;
private int ModCol = 5;
private int DiscountCol = 5;
private int TableDirection;
private int RefreshTime = 1;
private String ShowTableType = "1,2,3,5";
private int servicecharge_tablemode;
private int servicecharge_tablemode_setting;
private int servicecharge_takeoutmode;
private int servicecharge_deliverymode;
private int servicecharge_pickupmode;
private int tableType = 1;
private boolean ServiceChargeIncludeItemDiscount;
private boolean BillDiscountIncludeServiceCharge;
private boolean Edit_Send;
private int ItemDecimals;
private int RoundingDecimal = 1;
private int Rounding;
private int SystemLanguage = 2;
private int OpenTableVipFrontColor = 1;
private int OpenTableVipBackColor = 2;
private int nowLanguageIndex = 1;
private String orderlanguage = "1,2,3";
private boolean MemberLoginCover = true;
private String LanageName = "中文,粵語,英文";
private int DataLanguage = 2;
private int AutoQuitTime = 600;
private int ModFunctionBarHeight = 60;
private int BottomBarHeight = 160;
private int ReportFontSize = 15;
private String ShopId = "";
private boolean OrderFunction_Discount;
private boolean OrderFunction_Transfer;
private boolean OrderFunction_Print;
private boolean MainFunction_Report;
private int printerServerReadTime = 10;
private boolean OrderFunction_VoidSentItem = false;
private boolean OrderFunction_ItemDiscount = false;
private boolean OrderFunction_ItemFoodMerge = false;
private boolean OrderFunction_FoodTableMode = true;
private boolean OrderFunction_FoodTemporay = true;
private boolean Order_InputPax = true;
private boolean Order_GetTables = true;
private int OrderOperButtonHeight = 40;
private int orderInfoHeight = 40;
private int orderInfoFontSize = 16;
private int OrderDataOperBtnWidth = 50;
private int OrderDataOperBtnHeight = 50;
private boolean BillTextScroll = true;
private int TableFunctionTopHeight = 100;
private int TableFunctionBottomHeight = 100;
private int TableFunctionFontSize = 20;
private int TableFunctionTopFontSize = 20;
private int TableFunctionBottomFontSize = 20;
private String Memberinfo = "MEM_MemberNo,MEM_Phone,MEM_NAME,MEM_Points";
private String MemberHttp = "http://m.ricepon.com:9090/member-web";
private boolean EnableErrorLog = true;
private boolean TableFunction_SplitTable = true;
private boolean TableFunction_FoodList = true;
private boolean TableFunction_OfflineOrder = true;
private boolean MainFunction_TableMode = true;
private boolean TableFunction_ScanBarcode = true;
private boolean OrderFunction_send = true;
private boolean TableFunction_PayBill = true;
private boolean OrderFunction_PrePay = true;
private int AutoOpen = 0;
private int OrderNumberShowSize = 20;
private int OrderNumberFontSize = 7;
private int OrderNumberChildShowSize = 20;
private int OrderNumberChildFontSize = 10;
/**
* 送單是否自動合併未送食品(只處理未有細項的食品)
*/
private boolean MergeSendFood = true;
/**
* 送單是否自動打印上菜纸
*/
private boolean AutoPrinterParper = true;
private Set<String> customizeSetting = new HashSet<>();
private int screen_w = 1080;
private int screen_h = 1920;
private int screen_density_dpi;
public void adjustSize(Context context, FunctionStyleUtils setting) {
DisplayMetrics metrics = DeviceUtils.getDisplayMetrics(context);
screen_w = metrics.widthPixels;
screen_h = metrics.heightPixels;
screen_density_dpi = metrics.densityDpi;
if (!setting.customizeSetting.contains("TableFunctionBottomHeight")) {
//计算高度/
setting.TableFunctionBottomHeight = (int) Math.ceil((float) setting.TableFunctionBottomHeight / (float) setting.BaseHeight * (float) setting.screen_h);
}
if (!setting.customizeSetting.contains("TableFunctionTopHeight")) {
//计算高度/
setting.TableFunctionTopHeight = (int) Math.ceil((float) setting.TableFunctionTopHeight / (float) setting.BaseHeight * (float) setting.screen_h);
}
if (!setting.customizeSetting.contains("OrderOperButtonHeight")) {
//计算高度/
setting.OrderOperButtonHeight = (int) Math.ceil((float) setting.OrderOperButtonHeight / (float) setting.BaseHeight * (float) setting.screen_h);
}
if (!setting.customizeSetting.contains("LayoutBillListHeight")) {
//计算高度/
setting.LayoutBillListHeight = (int) Math.ceil((float) setting.LayoutBillListHeight / (float) setting.BaseHeight * (float) setting.screen_h);
}
if (!setting.customizeSetting.contains("LayoutQtyHeight")) {
//计算高度/
setting.LayoutQtyHeight = (int) Math.ceil((float) setting.LayoutQtyHeight / (float) setting.BaseHeight * (float) setting.screen_h);
}
if (!setting.customizeSetting.contains("LayoutQuitHeight")) {
//计算高度/
setting.LayoutQuitHeight = (int) Math.ceil((float) setting.LayoutQuitHeight / (float) setting.BaseHeight * (float) setting.screen_h);
}
if (!setting.customizeSetting.contains("LayoutFoodTypeHeight")) {
//计算高度/
setting.LayoutFoodTypeHeight = (int) Math.ceil((float) setting.LayoutFoodTypeHeight / (float) setting.BaseHeight * (float) setting.screen_h);
}
if (!setting.customizeSetting.contains("FoodBtnHeight")) {
//计算高度/
Log.e("初始FoodBtnHeight", FoodBtnHeight + "");
setting.FoodBtnHeight = (int) Math.ceil((float) setting.FoodBtnHeight / (float) setting.BaseHeight * (float) setting.screen_h);
Log.e("最后得出的FoodBtnHeight", setting.FoodBtnHeight + "");
}
if (!setting.customizeSetting.contains("ModBtnHeight")) {
//计算高度/
setting.ModBtnHeight = (int) Math.ceil((float) setting.ModBtnHeight / (float) setting.BaseHeight * (float) setting.screen_h);
}
if (!setting.customizeSetting.contains("ModFunctionBarHeight")) {
//计算高度/
setting.ModFunctionBarHeight = (int) Math.ceil((float) setting.ModFunctionBarHeight / (float) setting.BaseHeight * (float) setting.screen_h);
}
if (!setting.customizeSetting.contains("BottomBarHeight")) {
//计算高度/
setting.BottomBarHeight = (int) Math.ceil((float) setting.BottomBarHeight / (float) setting.BaseHeight * (float) setting.screen_h);
}
if (!setting.customizeSetting.contains("OrderDataOperBtnWidth")) {
//计算高度/
OrderDataOperBtnWidth = (int) Math.ceil((float) OrderDataOperBtnWidth / (float) BaseWidth * (float) screen_w);
}
if (!customizeSetting.contains("OrderDataOperBtnHeight")) {
//计算高度/
setting.OrderDataOperBtnHeight = (int) Math.ceil((float) setting.OrderDataOperBtnHeight / (float) setting.BaseHeight * (float) setting.screen_h);
}
float screen_scaledDensity = (float) setting.screen_density_dpi / 160;
float base_scaledDensity = (float) setting.BaseDpi / 160;
float rate = (float) (base_scaledDensity / screen_scaledDensity);
if (!setting.customizeSetting.contains("TableFunctionTopFontSize")) {
setting.TableFunctionTopFontSize = (int) Math.ceil((float) setting.TableFunctionTopFontSize / (float) setting.BaseWidth * (float) setting.screen_w * rate);///base_scaledDensity*(float)privateClass.screen_scaledDensity);
}
if (!setting.customizeSetting.contains("TableFunctionBottomFontSize")) {
setting.TableFunctionBottomFontSize = (int) Math.ceil((float) setting.TableFunctionBottomFontSize / (float) setting.BaseWidth * (float) setting.screen_w * rate);
}
if (!setting.customizeSetting.contains("FoodTypeFontSize")) {
setting.FoodTypeFontSize = (int) Math.ceil((float) setting.FoodTypeFontSize / (float) setting.BaseWidth * (float) setting.screen_w * rate);
}
if (!setting.customizeSetting.contains("FoodFontSize")) {
setting.FoodFontSize = (int) Math.ceil((float) setting.FoodFontSize / (float) setting.BaseWidth * (float) setting.screen_w * rate);
}
if (!setting.customizeSetting.contains("ModFontSize")) {
setting.ModFontSize = (int) Math.ceil((float) setting.ModFontSize / (float) setting.BaseWidth * (float) setting.screen_w * rate);
}
if (!setting.customizeSetting.contains("BillTotalFontSize")) {
setting.BillTotalFontSize = (int) Math.ceil((float) setting.BillTotalFontSize / (float) setting.BaseWidth * (float) setting.screen_w * rate);
}
if (!setting.customizeSetting.contains("BillListFontSize")) {
Log.e("初始BillListFontSize", setting.BillListFontSize + "");
setting.BillListFontSize = (int) Math.ceil((float) setting.BillListFontSize / (float) setting.BaseWidth * (float) setting.screen_w * rate);
Log.e("最后得出的BillListFontSize", BillListFontSize + "");
}
if (!setting.customizeSetting.contains("FoodlListFontSize")) {
setting.FoodlListFontSize = (int) Math.ceil((float) setting.FoodlListFontSize / (float) setting.BaseWidth * (float) setting.screen_w * rate);
}
if (!setting.customizeSetting.contains("orderInfoFontSize")) {
Log.e("初始orderInfoFontSize", setting.orderInfoFontSize + "");
setting.orderInfoFontSize = (int) Math.ceil((float) setting.orderInfoFontSize / (float) setting.BaseWidth * (float) setting.screen_w * rate);
Log.e("最后得出的orderInfoFontSize", setting.orderInfoFontSize + "");
}
if (!setting.customizeSetting.contains("TableFunctionFontSize")) {
setting.TableFunctionFontSize = (int) Math.ceil((float) setting.TableFunctionFontSize / (float) setting.BaseWidth * (float) setting.screen_w * rate);
}
if (!setting.customizeSetting.contains("OrderNumberFontSize")) {
setting.OrderNumberFontSize = (int) Math.ceil((float) setting.OrderNumberFontSize / (float) setting.BaseWidth * (float) setting.screen_w * rate);
}
if (!setting.customizeSetting.contains("OrderNumberChildFontSize")) {
setting.OrderNumberChildFontSize = (int) Math.ceil((float) setting.OrderNumberChildFontSize / (float) setting.BaseWidth * (float) setting.screen_w * rate);
}
}
}
package com.gingersoft.gsa.cloud.ui.widget.dialog;
/**
* @author : bin
* @create date: 2020-11-05
* @update date: 2020-11-05
* @description:
*/
public interface DialogLifecycleListener {
}
package com.gingersoft.gsa.cloud.database.greendao;
import android.database.Cursor;
import android.database.sqlite.SQLiteStatement;
import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.Property;
import org.greenrobot.greendao.internal.DaoConfig;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.database.DatabaseStatement;
import com.gingersoft.gsa.cloud.database.bean.FoodCombo;
// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
/**
* DAO for table "FOOD_COMBO".
*/
public class FoodComboDao extends AbstractDao<FoodCombo, Void> {
public static final String TABLENAME = "FOOD_COMBO";
/**
* Properties of entity FoodCombo.<br/>
* Can be used for QueryBuilder and for referencing column names.
*/
public static class Properties {
public final static Property Id = new Property(0, Long.class, "id", false, "_id");
public final static Property Fid = new Property(1, Long.class, "fid", false, "FID");
public final static Property ComId = new Property(2, int.class, "comId", false, "COM_ID");
public final static Property SeqNo = new Property(3, int.class, "seqNo", false, "SEQ_NO");
public final static Property DiffAmt = new Property(4, int.class, "diffAmt", false, "DIFF_AMT");
public final static Property SelectQty = new Property(5, int.class, "selectQty", false, "SELECT_QTY");
public final static Property CreateTime = new Property(6, String.class, "createTime", false, "CREATE_TIME");
public final static Property DefModifier = new Property(7, String.class, "defModifier", false, "DEF_MODIFIER");
public final static Property ExcModifier = new Property(8, String.class, "excModifier", false, "EXC_MODIFIER");
public final static Property AutoNext = new Property(9, int.class, "autoNext", false, "AUTO_NEXT");
public final static Property MultipleSelect = new Property(10, int.class, "multipleSelect", false, "MULTIPLE_SELECT");
public final static Property UpdateTime = new Property(11, String.class, "updateTime", false, "UPDATE_TIME");
public final static Property Conditions = new Property(12, int.class, "conditions", false, "CONDITIONS");
public final static Property IsRT = new Property(13, int.class, "isRT", false, "IS_RT");
public final static Property Deletes = new Property(14, int.class, "deletes", false, "DELETES");
public final static Property RestaurantId = new Property(15, int.class, "restaurantId", false, "RESTAURANT_ID");
}
public FoodComboDao(DaoConfig config) {
super(config);
}
public FoodComboDao(DaoConfig config, DaoSession daoSession) {
super(config, daoSession);
}
/** Creates the underlying database table. */
public static void createTable(Database db, boolean ifNotExists) {
String constraint = ifNotExists? "IF NOT EXISTS ": "";
db.execSQL("CREATE TABLE " + constraint + "\"FOOD_COMBO\" (" + //
"\"_id\" INTEGER," + // 0: id
"\"FID\" INTEGER," + // 1: fid
"\"COM_ID\" INTEGER NOT NULL ," + // 2: comId
"\"SEQ_NO\" INTEGER NOT NULL ," + // 3: seqNo
"\"DIFF_AMT\" INTEGER NOT NULL ," + // 4: diffAmt
"\"SELECT_QTY\" INTEGER NOT NULL ," + // 5: selectQty
"\"CREATE_TIME\" TEXT," + // 6: createTime
"\"DEF_MODIFIER\" TEXT," + // 7: defModifier
"\"EXC_MODIFIER\" TEXT," + // 8: excModifier
"\"AUTO_NEXT\" INTEGER NOT NULL ," + // 9: autoNext
"\"MULTIPLE_SELECT\" INTEGER NOT NULL ," + // 10: multipleSelect
"\"UPDATE_TIME\" TEXT," + // 11: updateTime
"\"CONDITIONS\" INTEGER NOT NULL ," + // 12: conditions
"\"IS_RT\" INTEGER NOT NULL ," + // 13: isRT
"\"DELETES\" INTEGER NOT NULL ," + // 14: deletes
"\"RESTAURANT_ID\" INTEGER NOT NULL );"); // 15: restaurantId
}
/** Drops the underlying database table. */
public static void dropTable(Database db, boolean ifExists) {
String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"FOOD_COMBO\"";
db.execSQL(sql);
}
@Override
protected final void bindValues(DatabaseStatement stmt, FoodCombo entity) {
stmt.clearBindings();
Long id = entity.getId();
if (id != null) {
stmt.bindLong(1, id);
}
Long fid = entity.getFid();
if (fid != null) {
stmt.bindLong(2, fid);
}
stmt.bindLong(3, entity.getComId());
stmt.bindLong(4, entity.getSeqNo());
stmt.bindLong(5, entity.getDiffAmt());
stmt.bindLong(6, entity.getSelectQty());
String createTime = entity.getCreateTime();
if (createTime != null) {
stmt.bindString(7, createTime);
}
String defModifier = entity.getDefModifier();
if (defModifier != null) {
stmt.bindString(8, defModifier);
}
String excModifier = entity.getExcModifier();
if (excModifier != null) {
stmt.bindString(9, excModifier);
}
stmt.bindLong(10, entity.getAutoNext());
stmt.bindLong(11, entity.getMultipleSelect());
String updateTime = entity.getUpdateTime();
if (updateTime != null) {
stmt.bindString(12, updateTime);
}
stmt.bindLong(13, entity.getConditions());
stmt.bindLong(14, entity.getIsRT());
stmt.bindLong(15, entity.getDeletes());
stmt.bindLong(16, entity.getRestaurantId());
}
@Override
protected final void bindValues(SQLiteStatement stmt, FoodCombo entity) {
stmt.clearBindings();
Long id = entity.getId();
if (id != null) {
stmt.bindLong(1, id);
}
Long fid = entity.getFid();
if (fid != null) {
stmt.bindLong(2, fid);
}
stmt.bindLong(3, entity.getComId());
stmt.bindLong(4, entity.getSeqNo());
stmt.bindLong(5, entity.getDiffAmt());
stmt.bindLong(6, entity.getSelectQty());
String createTime = entity.getCreateTime();
if (createTime != null) {
stmt.bindString(7, createTime);
}
String defModifier = entity.getDefModifier();
if (defModifier != null) {
stmt.bindString(8, defModifier);
}
String excModifier = entity.getExcModifier();
if (excModifier != null) {
stmt.bindString(9, excModifier);
}
stmt.bindLong(10, entity.getAutoNext());
stmt.bindLong(11, entity.getMultipleSelect());
String updateTime = entity.getUpdateTime();
if (updateTime != null) {
stmt.bindString(12, updateTime);
}
stmt.bindLong(13, entity.getConditions());
stmt.bindLong(14, entity.getIsRT());
stmt.bindLong(15, entity.getDeletes());
stmt.bindLong(16, entity.getRestaurantId());
}
@Override
public Void readKey(Cursor cursor, int offset) {
return null;
}
@Override
public FoodCombo readEntity(Cursor cursor, int offset) {
FoodCombo entity = new FoodCombo( //
cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id
cursor.isNull(offset + 1) ? null : cursor.getLong(offset + 1), // fid
cursor.getInt(offset + 2), // comId
cursor.getInt(offset + 3), // seqNo
cursor.getInt(offset + 4), // diffAmt
cursor.getInt(offset + 5), // selectQty
cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // createTime
cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // defModifier
cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // excModifier
cursor.getInt(offset + 9), // autoNext
cursor.getInt(offset + 10), // multipleSelect
cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // updateTime
cursor.getInt(offset + 12), // conditions
cursor.getInt(offset + 13), // isRT
cursor.getInt(offset + 14), // deletes
cursor.getInt(offset + 15) // restaurantId
);
return entity;
}
@Override
public void readEntity(Cursor cursor, FoodCombo entity, int offset) {
entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0));
entity.setFid(cursor.isNull(offset + 1) ? null : cursor.getLong(offset + 1));
entity.setComId(cursor.getInt(offset + 2));
entity.setSeqNo(cursor.getInt(offset + 3));
entity.setDiffAmt(cursor.getInt(offset + 4));
entity.setSelectQty(cursor.getInt(offset + 5));
entity.setCreateTime(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6));
entity.setDefModifier(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7));
entity.setExcModifier(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8));
entity.setAutoNext(cursor.getInt(offset + 9));
entity.setMultipleSelect(cursor.getInt(offset + 10));
entity.setUpdateTime(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11));
entity.setConditions(cursor.getInt(offset + 12));
entity.setIsRT(cursor.getInt(offset + 13));
entity.setDeletes(cursor.getInt(offset + 14));
entity.setRestaurantId(cursor.getInt(offset + 15));
}
@Override
protected final Void updateKeyAfterInsert(FoodCombo entity, long rowId) {
// Unsupported or missing PK type
return null;
}
@Override
public Void getKey(FoodCombo entity) {
return null;
}
@Override
public boolean hasKey(FoodCombo entity) {
// TODO
return false;
}
@Override
protected final boolean isEntityUpdateable() {
return true;
}
}
package com.joe.print.mvp.print;
import android.content.Context;
import android.graphics.Bitmap;
import android.view.Gravity;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.gingersoft.gsa.cloud.base.application.GsaCloudApplication;
import com.gingersoft.gsa.cloud.base.order.commodity.OrderDetail;
import com.gingersoft.gsa.cloud.base.order.order.DoshokuOrder;
import com.gingersoft.gsa.cloud.base.table.bean.TableBean;
import com.gingersoft.gsa.cloud.base.utils.other.TextUtil;
import com.gingersoft.gsa.cloud.base.utils.time.TimeUtils;
import com.gingersoft.gsa.cloud.database.bean.PrinterDeviceBean;
import com.joe.print.R;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* skyorder qrcode打印
*/
public class PrintSkyOrderQR extends PrinterRoot {
@Override
public Map<String, List<Bitmap>> getPrintBitmap(Context mContext, PrinterDeviceBean printerDeviceBean) {
Map<String, List<Bitmap>> bitmapMaps = new HashMap<>();
List<Bitmap> bitmaps = new ArrayList<>();
bitmaps.add(getBitmap(mContext, printerDeviceBean));
bitmapMaps.put("", bitmaps);
return bitmapMaps;
}
@Override
public String getPrintData(Context mContext, PrinterDeviceBean deviceBean) {
List<OrderDetail> foodList = DoshokuOrder.getInstance().getShoppingCart().getOrderCommodityList();
TableBean.DataBean tableBean = DoshokuOrder.getInstance().getOpenTableInfo();
String stringBuilder = "<html><body>" +
getHtmlPrintHeadInfo() +
getHtmlPrintHeadOrderInfo(tableBean) +
generateFoodInfoTwoColumns(foodList) +
getWholeLine() +
getHtmlFooter() + "</body></html>";
return stringBuilder;
}
@Override
public int getPrintCount(Context context) {
return 1;
}
private Bitmap getBitmap(Context mContext, PrinterDeviceBean printerDeviceBean) {
List<OrderDetail> foodList = DoshokuOrder.getInstance().getShoppingCart().getOrderCommodityList();
if (foodList == null || foodList.size() <= 0) {
return null;
}
TableBean.DataBean tableBean = DoshokuOrder.getInstance().getOpenTableInfo();
LinearLayout layout = new LinearLayout(mContext);
layout.setOrientation(LinearLayout.VERTICAL);
//訂單頭
layout.addView(getHeader(mContext));
layout.addView(getLine(mContext));
String orderNo = "單號:";
if (TextUtil.isNotEmptyOrNullOrUndefined(DoshokuOrder.getInstance().getOrderNo())) {
orderNo = "單號:" + DoshokuOrder.getInstance().getOrderNo();
}
//訂單信息
layout.addView(getDiningTableOrderInfo(mContext, "餐檯:" + tableBean.getTableName(), "人數:" + DoshokuOrder.getInstance().getOpenTableInfo().getPerson(), orderNo, "日期:" + TimeUtils.getCurrentTimeInString(TimeUtils.DEFAULT_DATE_FORMAT)));
layout.addView(getLine(mContext));
layout.addView(getDiningFoodList(mContext, foodList, printerDeviceBean, 0, false));
layout.addView(getLine(mContext));
layout.addView(getTextView(mContext, "Thank you!", Gravity.CENTER_HORIZONTAL, getDimensionPixelSize(mContext, R.dimen.dp_8)));
layout.addView(getTextView(mContext, TimeUtils.getCurrentTimeInString(TimeUtils.DEFAULT_DATE_FORMAT), Gravity.CENTER_HORIZONTAL, getDimensionPixelSize(mContext, R.dimen.dp_8)));
return viewToZoomBitmap(mContext, layout, printerDeviceBean);
}
public View getPrintView(Context mContext) {
View view = View.inflate(mContext, R.layout.print_skyorder_qrcode, null);
TextView tvBrandName = view.findViewById(R.id.print_brand_name);
TextView tvRestaurantName = view.findViewById(R.id.print_restaurant_name);
tvBrandName.setText(GsaCloudApplication.getBrandName());
tvRestaurantName.setText(GsaCloudApplication.getRestaurantName());
return view;
}
}
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical">
<TextView
android:id="@+id/print_brand_name"
style="@style/Print_text_style"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="10dp"
android:gravity="center"
tools:text="品牌名" />
<TextView
android:id="@+id/print_restaurant_name"
style="@style/Print_text_style"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:gravity="center"
tools:text="餐廳名" />
</LinearLayout>
\ No newline at end of file
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