Commit 9029ddf2 by 宁斌

bbpos打印細節調整,新增擴展自動(點選支付方式是否彈出輸入框,餐檯模式開檯自動彈出輸入人數彈窗)

parent 70d85024
...@@ -103,6 +103,16 @@ public class FunctionExtendedConfiguration { ...@@ -103,6 +103,16 @@ public class FunctionExtendedConfiguration {
.remark("餐檯模式下單頁多少秒不操作返回餐檯頁面") .remark("餐檯模式下單頁多少秒不操作返回餐檯頁面")
.build(); .build();
private ExpandInfoSetting SelectPaymentAutoShowKeyboard = ExpandInfoSetting.builder()
.valueBoolean(false)
.remark("點選支付方式是否彈出輸入框")
.build();
private ExpandInfoSetting OpenTableAutoShowKeyboard = ExpandInfoSetting.builder()
.valueBoolean(true)
.remark("餐檯模式開檯自動彈出輸入人數彈窗")
.build();
/** /**
* skyorder相關 * skyorder相關
*/ */
...@@ -216,4 +226,13 @@ public class FunctionExtendedConfiguration { ...@@ -216,4 +226,13 @@ public class FunctionExtendedConfiguration {
public <T> T getSkyQRCodePrintBottomInfoVaule() { public <T> T getSkyQRCodePrintBottomInfoVaule() {
return SkyQRCodePrintBottomInfo.getValue(); return SkyQRCodePrintBottomInfo.getValue();
} }
public <T> T getSelectPaymentAutoShowKeyboardVaule() {
return SelectPaymentAutoShowKeyboard.getValue();
}
public <T> T getOpenTableAutoShowKeyboardVaule() {
return OpenTableAutoShowKeyboard.getValue();
}
} }
package com.gingersoft.gsa.cloud.common.core.print.bean; package com.gingersoft.gsa.cloud.common.core.print.bean;
import android.os.Parcel; import android.os.Parcel;
import android.os.Parcelable;
import androidx.annotation.NonNull;
import com.gingersoft.gsa.cloud.common.core.settlement.SettlementReport; import com.gingersoft.gsa.cloud.common.core.settlement.SettlementReport;
import com.gingersoft.gsa.cloud.database.bean.Discount;
import java.util.List;
import lombok.Data;
/** /**
* @author : bin * @author : bin
...@@ -10,9 +18,56 @@ import com.gingersoft.gsa.cloud.common.core.settlement.SettlementReport; ...@@ -10,9 +18,56 @@ import com.gingersoft.gsa.cloud.common.core.settlement.SettlementReport;
* @update date: 2020-11-27 * @update date: 2020-11-27
* @description: * @description:
*/ */
public class PrintCleanMachineContent extends SettlementReport implements PrintContent { @Data
public class PrintCleanMachineContent implements PrintContent, Parcelable {
private String yesterdayTime;
private SettlementReport.VoBean vo;
private String restaurantOperationTime;
private List<SettlementReport.AnalysisBean> analysis;
private List<SettlementReport.CashBean> cash;
private String currentTime;
private String startTime;
public PrintCleanMachineContent() {
}
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeString(this.yesterdayTime);
dest.writeParcelable(this.vo, flags);
dest.writeString(this.restaurantOperationTime);
dest.writeTypedList(this.analysis);
dest.writeTypedList(this.cash);
dest.writeString(this.currentTime);
dest.writeString(this.startTime);
}
protected PrintCleanMachineContent(Parcel in) { protected PrintCleanMachineContent(Parcel in) {
super(in); this.yesterdayTime = in.readString();
this.vo = in.readParcelable(SettlementReport.VoBean.class.getClassLoader());
this.restaurantOperationTime = in.readString();
this.analysis = in.createTypedArrayList(SettlementReport.AnalysisBean.CREATOR);
this.cash = in.createTypedArrayList(SettlementReport.CashBean.CREATOR);
this.currentTime = in.readString();
this.startTime = in.readString();
}
public static final Creator<PrintCleanMachineContent> CREATOR = new Creator<PrintCleanMachineContent>() {
@Override
public PrintCleanMachineContent createFromParcel(Parcel source) {
return new PrintCleanMachineContent(source);
}
@Override
public PrintCleanMachineContent[] newArray(int size) {
return new PrintCleanMachineContent[size];
} }
};
} }
package com.gingersoft.gsa.cloud.common.core.print.bean;
import android.os.Parcel;
import android.os.Parcelable;
import com.gingersoft.gsa.cloud.common.core.order.commodity.OrderDetail;
import java.util.List;
import lombok.Data;
/**
* @author : bin
* @create date: 2020-12-03
* @update date: 2020-12-03
* @description:堂食上菜紙打印內容
*/
@Data
public class PrintServingPaperContent implements PrintContent {
private String brand;
private String resturantName;
private String orderNo;
private int person;
private String createTime;
private List<OrderDetail> foodList;
//禮貌用語
private String politeLanguage;
}
package com.gingersoft.gsa.cloud.common.core.print.bean;
import android.os.Parcelable;
import com.gingersoft.gsa.cloud.common.core.order.billItem.BillItem;
import com.gingersoft.gsa.cloud.common.core.order.commodity.OrderDetail;
import java.util.ArrayList;
import java.util.List;
import lombok.Data;
/**
* @author : bin
* @create date: 2020-12-03
* @update date: 2020-12-03
* @description:堂食印單打印內容
* */
@Data
public class PrintSlipContent implements PrintContent {
private String brand;
private String resturantName;
private String tableName;
private String orderNo;
private int person;
private String createTime;
private List<OrderDetail> foodList;
private List<BillItem> billItemList;
private double wholeAmount;
private double totalAmount;
//禮貌用語
private String politeLanguage;
}
...@@ -20,16 +20,21 @@ public class PrintTakeawayFormContent implements PrintContent, Parcelable { ...@@ -20,16 +20,21 @@ public class PrintTakeawayFormContent implements PrintContent, Parcelable {
private String brand; private String brand;
private String resturantName; private String resturantName;
/** /**
* 2=外送
* 其他=自取
*/
private String orderType;
/**
* 支付類型:在線支付,貨到付款 * 支付類型:在線支付,貨到付款
*/ */
private String payType; private String payType;
//送達時間 //送達時間
private String deliveryTime; private String deliveryTime;
//單號 //單號
private String orderNumber; private String orderNo;
//訂單碼 //訂單碼
private String billNumber; private String billNo;
//取餐碼 //取餐碼/訂單碼
private String orderTakeFoodCode; private String orderTakeFoodCode;
//開單時間 //開單時間
private String billingTime; private String billingTime;
...@@ -40,7 +45,7 @@ public class PrintTakeawayFormContent implements PrintContent, Parcelable { ...@@ -40,7 +45,7 @@ public class PrintTakeawayFormContent implements PrintContent, Parcelable {
//訂單實體 //訂單實體
private List<PrintFoodItem> foodItemList; private List<PrintFoodItem> foodItemList;
private List<PrintBillItem> billItemList; private List<PrintBillItem> billItemList;
private List<PrintPayTypeItem> printPayTypeItemList; // private List<PrintPayTypeItem> printPayTypeItemList;
//總金額 //總金額
private String totalAmountText; private String totalAmountText;
private String totalAmount; private String totalAmount;
...@@ -66,6 +71,7 @@ public class PrintTakeawayFormContent implements PrintContent, Parcelable { ...@@ -66,6 +71,7 @@ public class PrintTakeawayFormContent implements PrintContent, Parcelable {
public PrintTakeawayFormContent() { public PrintTakeawayFormContent() {
} }
@Override @Override
public int describeContents() { public int describeContents() {
return 0; return 0;
...@@ -75,22 +81,23 @@ public class PrintTakeawayFormContent implements PrintContent, Parcelable { ...@@ -75,22 +81,23 @@ public class PrintTakeawayFormContent implements PrintContent, Parcelable {
public void writeToParcel(Parcel dest, int flags) { public void writeToParcel(Parcel dest, int flags) {
dest.writeString(this.brand); dest.writeString(this.brand);
dest.writeString(this.resturantName); dest.writeString(this.resturantName);
dest.writeString(this.orderType);
dest.writeString(this.payType); dest.writeString(this.payType);
dest.writeString(this.deliveryTime); dest.writeString(this.deliveryTime);
dest.writeString(this.orderNumber); dest.writeString(this.orderNo);
dest.writeString(this.billNumber); dest.writeString(this.billNo);
dest.writeString(this.orderTakeFoodCode); dest.writeString(this.orderTakeFoodCode);
dest.writeString(this.billingTime); dest.writeString(this.billingTime);
dest.writeString(this.payTime); dest.writeString(this.payTime);
dest.writeString(this.remark); dest.writeString(this.remark);
dest.writeTypedList(this.foodItemList); dest.writeTypedList(this.foodItemList);
dest.writeTypedList(this.billItemList); dest.writeTypedList(this.billItemList);
dest.writeTypedList(this.printPayTypeItemList);
dest.writeString(this.totalAmountText); dest.writeString(this.totalAmountText);
dest.writeString(this.totalAmount); dest.writeString(this.totalAmount);
dest.writeString(this.payAmountText);
dest.writeString(this.payAmount); dest.writeString(this.payAmount);
dest.writeString(this.memberNumber);
dest.writeString(this.memberName); dest.writeString(this.memberName);
dest.writeString(this.memberNumber);
dest.writeString(this.memberPhone); dest.writeString(this.memberPhone);
dest.writeString(this.memberOldPoints); dest.writeString(this.memberOldPoints);
dest.writeString(this.memberAddPoints); dest.writeString(this.memberAddPoints);
...@@ -105,22 +112,23 @@ public class PrintTakeawayFormContent implements PrintContent, Parcelable { ...@@ -105,22 +112,23 @@ public class PrintTakeawayFormContent implements PrintContent, Parcelable {
protected PrintTakeawayFormContent(Parcel in) { protected PrintTakeawayFormContent(Parcel in) {
this.brand = in.readString(); this.brand = in.readString();
this.resturantName = in.readString(); this.resturantName = in.readString();
this.orderType = in.readString();
this.payType = in.readString(); this.payType = in.readString();
this.deliveryTime = in.readString(); this.deliveryTime = in.readString();
this.orderNumber = in.readString(); this.orderNo = in.readString();
this.billNumber = in.readString(); this.billNo = in.readString();
this.orderTakeFoodCode = in.readString(); this.orderTakeFoodCode = in.readString();
this.billingTime = in.readString(); this.billingTime = in.readString();
this.payTime = in.readString(); this.payTime = in.readString();
this.remark = in.readString(); this.remark = in.readString();
this.foodItemList = in.createTypedArrayList(PrintFoodItem.CREATOR); this.foodItemList = in.createTypedArrayList(PrintFoodItem.CREATOR);
this.billItemList = in.createTypedArrayList(PrintBillItem.CREATOR); this.billItemList = in.createTypedArrayList(PrintBillItem.CREATOR);
this.printPayTypeItemList = in.createTypedArrayList(PrintPayTypeItem.CREATOR);
this.totalAmountText = in.readString(); this.totalAmountText = in.readString();
this.totalAmount = in.readString(); this.totalAmount = in.readString();
this.payAmountText = in.readString();
this.payAmount = in.readString(); this.payAmount = in.readString();
this.memberNumber = in.readString();
this.memberName = in.readString(); this.memberName = in.readString();
this.memberNumber = in.readString();
this.memberPhone = in.readString(); this.memberPhone = in.readString();
this.memberOldPoints = in.readString(); this.memberOldPoints = in.readString();
this.memberAddPoints = in.readString(); this.memberAddPoints = in.readString();
...@@ -143,6 +151,4 @@ public class PrintTakeawayFormContent implements PrintContent, Parcelable { ...@@ -143,6 +151,4 @@ public class PrintTakeawayFormContent implements PrintContent, Parcelable {
return new PrintTakeawayFormContent[size]; return new PrintTakeawayFormContent[size];
} }
}; };
} }
...@@ -2,6 +2,7 @@ package com.gingersoft.gsa.cloud.common.core.print.bean.adapter; ...@@ -2,6 +2,7 @@ package com.gingersoft.gsa.cloud.common.core.print.bean.adapter;
import com.gingersoft.gsa.cloud.common.core.print.bean.OrderDetails; import com.gingersoft.gsa.cloud.common.core.print.bean.OrderDetails;
import com.gingersoft.gsa.cloud.common.core.print.bean.PrintContent; import com.gingersoft.gsa.cloud.common.core.print.bean.PrintContent;
import com.gingersoft.gsa.cloud.common.core.settlement.SettlementReport;
/** /**
* @author : bin * @author : bin
...@@ -17,6 +18,6 @@ public interface AdaptationContent { ...@@ -17,6 +18,6 @@ public interface AdaptationContent {
PrintContent adaptationPrintTakeawayFormContent(OrderDetails.DataBean data); PrintContent adaptationPrintTakeawayFormContent(OrderDetails.DataBean data);
PrintContent adaptationPrintCleanMachineContent(); PrintContent adaptationPrintCleanMachineContent(SettlementReport settlementReport);
} }
package com.gingersoft.gsa.cloud.common.core.print.bean.adapter; package com.gingersoft.gsa.cloud.common.core.print.bean.adapter;
import android.text.TextUtils; import android.text.TextUtils;
import android.view.View;
import com.gingersoft.gsa.cloud.app.GsaCloudApplication;
import com.gingersoft.gsa.cloud.common.R;
import com.gingersoft.gsa.cloud.common.constans.AppConstans;
import com.gingersoft.gsa.cloud.common.constans.ExpandConstant;
import com.gingersoft.gsa.cloud.common.core.order.commodity.OrderDetail; import com.gingersoft.gsa.cloud.common.core.order.commodity.OrderDetail;
import com.gingersoft.gsa.cloud.common.core.print.bean.PrintCleanMachineContent;
import com.gingersoft.gsa.cloud.common.core.restaurant.ResturantInfoManager; import com.gingersoft.gsa.cloud.common.core.restaurant.ResturantInfoManager;
import com.gingersoft.gsa.cloud.common.core.print.bean.OrderDetails; import com.gingersoft.gsa.cloud.common.core.print.bean.OrderDetails;
import com.gingersoft.gsa.cloud.common.core.print.bean.PrintContent; import com.gingersoft.gsa.cloud.common.core.print.bean.PrintContent;
...@@ -11,8 +17,16 @@ import com.gingersoft.gsa.cloud.common.core.print.bean.PrintTakeawayFormContent; ...@@ -11,8 +17,16 @@ import com.gingersoft.gsa.cloud.common.core.print.bean.PrintTakeawayFormContent;
import com.gingersoft.gsa.cloud.common.core.print.bean.base.PrintBillItem; import com.gingersoft.gsa.cloud.common.core.print.bean.base.PrintBillItem;
import com.gingersoft.gsa.cloud.common.core.print.bean.base.PrintFoodItem; import com.gingersoft.gsa.cloud.common.core.print.bean.base.PrintFoodItem;
import com.gingersoft.gsa.cloud.common.core.print.bean.base.PrintPayTypeItem; import com.gingersoft.gsa.cloud.common.core.print.bean.base.PrintPayTypeItem;
import com.gingersoft.gsa.cloud.common.core.restaurant.utils.RestaurantExpandInfoUtils;
import com.gingersoft.gsa.cloud.common.core.settlement.SettlementReport;
import com.gingersoft.gsa.cloud.common.utils.MoneyUtil;
import com.gingersoft.gsa.cloud.common.utils.other.TextUtil;
import com.gingersoft.gsa.cloud.common.utils.time.TimeUtils;
import com.jess.arms.utils.ArmsUtils;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import lombok.Data; import lombok.Data;
/** /**
...@@ -44,47 +58,115 @@ public class PrintContentAdapter implements AdaptationContent { ...@@ -44,47 +58,115 @@ public class PrintContentAdapter implements AdaptationContent {
} }
@Override @Override
public PrintContent adaptationPrintCleanMachineContent() { public PrintContent adaptationPrintCleanMachineContent(SettlementReport settlementReport) {
return null; PrintCleanMachineContent cleanMachineContent = new PrintCleanMachineContent();
cleanMachineContent.setYesterdayTime(settlementReport.getYesterdayTime());
cleanMachineContent.setVo(settlementReport.getVo());
cleanMachineContent.setCash(settlementReport.getCash());
cleanMachineContent.setAnalysis(settlementReport.getAnalysis());
cleanMachineContent.setRestaurantOperationTime(TimeUtils.getStringByFormat(settlementReport.getRestaurantOperation().getOperationTime(), TimeUtils.DEFAULT_DATE_FORMAT));
cleanMachineContent.setStartTime(settlementReport.getStartTime());
cleanMachineContent.setCurrentTime(settlementReport.getCurrentTime());
return cleanMachineContent;
} }
public PrintTakeawayFormContent getPrintTakeawayFormContent(OrderDetails.DataBean data, int type) { public PrintTakeawayFormContent getPrintTakeawayFormContent(OrderDetails.DataBean data, int type) {
PrintTakeawayFormContent takeawayPrintContent; PrintTakeawayFormContent takeawayPrintContent;
if (type == 1) { if (type == 1) {
takeawayPrintContent = new PrintTakeawayCheckoutContent(); takeawayPrintContent = new PrintTakeawayCheckoutContent();
PrintTakeawayCheckoutContent checkoutContent = (PrintTakeawayCheckoutContent) takeawayPrintContent;
checkoutContent.setPayTypeList(getPrintPayTypeItemsByPayMultiple(data.getPayMultiple()));
} else { } else {
takeawayPrintContent = new PrintTakeawayFormContent(); takeawayPrintContent = new PrintTakeawayFormContent();
} }
takeawayPrintContent.setBrand(ResturantInfoManager.newInstance().getBrandName()); takeawayPrintContent.setBrand(ResturantInfoManager.newInstance().getBrandName());
takeawayPrintContent.setResturantName(ResturantInfoManager.newInstance().getRestaurantName()); takeawayPrintContent.setResturantName(ResturantInfoManager.newInstance().getRestaurantName());
takeawayPrintContent.setPayType(String.valueOf(data.getPayType())); if (data.getOrder_type() == 2) {
takeawayPrintContent.setOrderType("外送");
} else {
takeawayPrintContent.setOrderType("自取");
}
if (data.getPayType() == 2) {
if (!TextUtil.isEmptyOrNullOrUndefined(data.getPayTime())) {
//支付時間,只有在線支付有
if (!TextUtil.isEmptyOrNullOrUndefined(data.getPayTime())) {
takeawayPrintContent.setPayTime("支付時間:" + data.getPayTime());
}
}
}
//取餐碼
if (data.getOrder_type() == 7) {
//自取 顯示 取餐碼+訂單碼
if (!TextUtil.isEmptyOrNullOrUndefined(data.getTakeFoodCode())) {
takeawayPrintContent.setOrderTakeFoodCode("取餐碼:" + data.getTakeFoodCode());
}
} else {
//外送 顯示訂單碼
takeawayPrintContent.setOrderTakeFoodCode("訂單碼:" + data.getTakeFoodCode());
}
if (data.getTakeFoodCode() == null || data.getTakeFoodCode().equals("0")) {
takeawayPrintContent.setOrderTakeFoodCode("");
}
if (!TextUtil.isEmptyOrNullOrUndefined(data.getRemark())) {
takeawayPrintContent.setRemark("備註:" + data.getRemark());
}
if (!TextUtil.isEmptyOrNullOrUndefined(data.getBillNo())) {
takeawayPrintContent.setBillNo("訂單碼:" + data.getBillNo());
}
takeawayPrintContent.setOrderNo("單號:" + data.getORDER_NO());
//支付類型
takeawayPrintContent.setPayType(getPaytype(data));
takeawayPrintContent.setDeliveryTime(data.getOrder_type() == 2 ? data.getSEND_TIME() : data.getTakeTime()); takeawayPrintContent.setDeliveryTime(data.getOrder_type() == 2 ? data.getSEND_TIME() : data.getTakeTime());
takeawayPrintContent.setOrderNumber(data.getORDER_NO()); takeawayPrintContent.setBillingTime("開單時間:" + TimeUtils.parseTimeRepeat(data.getCREATE_TIME(), TimeUtils.DEFAULT_DATE_FORMAT));
takeawayPrintContent.setBillNumber(data.getBillNo()); takeawayPrintContent.setRemark("備註:" + data.getRemark());
takeawayPrintContent.setOrderTakeFoodCode(data.getTakeFoodCode());
takeawayPrintContent.setBillingTime(data.getCREATE_TIME());
takeawayPrintContent.setPayTime(data.getPayTime());
takeawayPrintContent.setRemark(data.getRemark());
takeawayPrintContent.setFoodItemList(getPrintFoodItemsByProductBeans(data.getPRODUCT_NAME())); takeawayPrintContent.setFoodItemList(getPrintFoodItemsByProductBeans(data.getPRODUCT_NAME()));
takeawayPrintContent.setBillItemList(getBillItemListByInfo(data.getTOTAL_AMOUNT(), data.getLunchbox(), data.getDELIVERY_CHARGE())); takeawayPrintContent.setBillItemList(getBillItemListByInfo(data.getTOTAL_AMOUNT(), data.getLunchbox(), data.getDELIVERY_CHARGE(), data.getCouponList()));
takeawayPrintContent.setPrintPayTypeItemList(getPrintPayTypeItemsByPayMultiple(data.getPayMultiple()));
takeawayPrintContent.setTotalAmountText("總金額: "); takeawayPrintContent.setTotalAmountText("總金額: ");
takeawayPrintContent.setTotalAmount(data.getTOTAL_AMOUNT()); takeawayPrintContent.setTotalAmount(AppConstans.CARSH_STR + data.getTOTAL_AMOUNT());
takeawayPrintContent.setPayAmountText("支付金額: "); takeawayPrintContent.setPayAmountText("支付金額: ");
takeawayPrintContent.setPayAmount(String.valueOf(data.getPAY_AMOUNT())); takeawayPrintContent.setPayAmount(AppConstans.CARSH_STR + MoneyUtil.sub(Double.parseDouble(data.getTOTAL_AMOUNT()), data.getDiscount_amount()));
takeawayPrintContent.setMemberName(data.getMEMBER_NAME()); takeawayPrintContent.setMemberName("會員名稱: " + data.getMEMBER_NAME());
// takeawayPrintContent.setMemberNumber(data.getm); // takeawayPrintContent.setMemberNumber(data.getm);
takeawayPrintContent.setMemberPhone(data.getPHONE()); takeawayPrintContent.setMemberPhone("會員電話: " + data.getPHONE());
takeawayPrintContent.setMemberOldPoints(String.valueOf(data.getOldPoints())); takeawayPrintContent.setMemberOldPoints("上次積分: " + data.getOldPoints());
takeawayPrintContent.setMemberAddPoints(String.valueOf(data.getAddPoints())); takeawayPrintContent.setMemberAddPoints("本次積分: " + data.getAddPoints());
takeawayPrintContent.setMemberNowPoints(String.valueOf(data.getNowPoints())); takeawayPrintContent.setMemberNowPoints("結餘積分: " + data.getNowPoints());
if (data.getOrder_type() == 2) {
//自取,隱藏地址和收貨人
// takeawayPrintContent.setAdress("地址: " + data.getAddressDetail());
takeawayPrintContent.setAdress(data.getAddressDetail()); takeawayPrintContent.setAdress(data.getAddressDetail());
takeawayPrintContent.setReceiver(data.getRECEIVER()); takeawayPrintContent.setReceiver("收貨人: " + data.getRECEIVER());
takeawayPrintContent.setPhone(data.getPHONE()); }
takeawayPrintContent.setPhone("手機號: " + data.getPHONE());
takeawayPrintContent.setPoliteLanguage("謝謝光臨!"); takeawayPrintContent.setPoliteLanguage("謝謝光臨!");
return takeawayPrintContent; return takeawayPrintContent;
} }
private String getPaytype(OrderDetails.DataBean data) {
String payTypeStr = null;
if (data.getPayType() == 1) {
//貨到付款
payTypeStr = "貨到付款";
} else if (data.getPayType() == 0) {
payTypeStr = "店內支付";
} else if (data.getPayType() == 2) {
if (data.getPayMultiple() != null) {
StringBuilder payName = new StringBuilder();
for (OrderDetails.DataBean.PayMultiple payMultiple : data.getPayMultiple()) {
payName.append(payMultiple.getPayName());
payName.append(",");
}
if (payName.length() > 0) {
payName.deleteCharAt(payName.length() - 1);
}
payTypeStr = "在線支付:" + payName.toString();
} else {
payTypeStr = "在線支付";
}
}
return payTypeStr;
}
private List<PrintFoodItem> getPrintFoodItemsByProductBeans(List<OrderDetails.DataBean.PRODUCTNAMEBean> productnameBeanList) { private List<PrintFoodItem> getPrintFoodItemsByProductBeans(List<OrderDetails.DataBean.PRODUCTNAMEBean> productnameBeanList) {
List<OrderDetail> orderDetailList = OrderDetail.productMameBeanToOrderDetail(1, productnameBeanList); List<OrderDetail> orderDetailList = OrderDetail.productMameBeanToOrderDetail(1, productnameBeanList);
List<PrintFoodItem> printFoodItems = new ArrayList<>(); List<PrintFoodItem> printFoodItems = new ArrayList<>();
...@@ -94,16 +176,19 @@ public class PrintContentAdapter implements AdaptationContent { ...@@ -94,16 +176,19 @@ public class PrintContentAdapter implements AdaptationContent {
return printFoodItems; return printFoodItems;
} }
private List<PrintBillItem> getBillItemListByInfo(String totalAmount, double lunchbox, double deliveryCharge) { private List<PrintBillItem> getBillItemListByInfo(String totalAmount, double lunchbox, double deliveryCharge, List<OrderDetails.DataBean.CouponBean> couponBeanList) {
List<PrintBillItem> billItems = new ArrayList<>(); List<PrintBillItem> billItems = new ArrayList<>();
if (TextUtils.isEmpty(totalAmount)) { billItems.add(new PrintBillItem("合計: ", AppConstans.CARSH_STR + MoneyUtil.sub(MoneyUtil.sub(Double.parseDouble(totalAmount), lunchbox), deliveryCharge)));
billItems.add(new PrintBillItem("合計: ", String.valueOf(totalAmount)));
}
if (lunchbox != 0.0) { if (lunchbox != 0.0) {
billItems.add(new PrintBillItem("餐盒費: ", String.valueOf(lunchbox))); billItems.add(new PrintBillItem("餐盒費: ", AppConstans.CARSH_STR + lunchbox));
} }
if (deliveryCharge != 0.0) { if (deliveryCharge != 0.0) {
billItems.add(new PrintBillItem("送貨費: ", String.valueOf(deliveryCharge))); billItems.add(new PrintBillItem("送貨費: ", AppConstans.CARSH_STR + deliveryCharge));
}
if (couponBeanList != null && couponBeanList.size() > 0) {
for (OrderDetails.DataBean.CouponBean couponBean : couponBeanList) {
billItems.add(new PrintBillItem(couponBean.getCouponName(), AppConstans.CARSH_STR + couponBean.getDiscount_amount()));
}
} }
return billItems; return billItems;
} }
...@@ -111,7 +196,7 @@ public class PrintContentAdapter implements AdaptationContent { ...@@ -111,7 +196,7 @@ public class PrintContentAdapter implements AdaptationContent {
private List<PrintPayTypeItem> getPrintPayTypeItemsByPayMultiple(List<OrderDetails.DataBean.PayMultiple> payMultiples) { private List<PrintPayTypeItem> getPrintPayTypeItemsByPayMultiple(List<OrderDetails.DataBean.PayMultiple> payMultiples) {
List<PrintPayTypeItem> printPayTypeItems = new ArrayList<>(); List<PrintPayTypeItem> printPayTypeItems = new ArrayList<>();
for (OrderDetails.DataBean.PayMultiple payMultiple : payMultiples) { for (OrderDetails.DataBean.PayMultiple payMultiple : payMultiples) {
printPayTypeItems.add(new PrintPayTypeItem(payMultiple.getPayName(), String.valueOf(payMultiple.getAmount()))); printPayTypeItems.add(new PrintPayTypeItem(payMultiple.getPayName(), AppConstans.CARSH_STR + payMultiple.getAmount()));
} }
return printPayTypeItems; return printPayTypeItems;
} }
......
...@@ -274,6 +274,18 @@ public class SettlementReport implements Parcelable { ...@@ -274,6 +274,18 @@ public class SettlementReport implements Parcelable {
} }
public static final Creator<SettlementReport> CREATOR = new Creator<SettlementReport>() {
@Override
public SettlementReport createFromParcel(Parcel in) {
return new SettlementReport(in);
}
@Override
public SettlementReport[] newArray(int size) {
return new SettlementReport[size];
}
};
@Override @Override
public int describeContents() { public int describeContents() {
return 0; return 0;
...@@ -300,15 +312,4 @@ public class SettlementReport implements Parcelable { ...@@ -300,15 +312,4 @@ public class SettlementReport implements Parcelable {
this.startTime = in.readString(); this.startTime = in.readString();
} }
public static final Creator<SettlementReport> CREATOR = new Creator<SettlementReport>() {
@Override
public SettlementReport createFromParcel(Parcel source) {
return new SettlementReport(source);
}
@Override
public SettlementReport[] newArray(int size) {
return new SettlementReport[size];
}
};
} }
...@@ -195,6 +195,11 @@ public class OrderPayView extends LinearLayout { ...@@ -195,6 +195,11 @@ public class OrderPayView extends LinearLayout {
//設置差額狀態 //設置差額狀態
setDifferenceText(context); setDifferenceText(context);
boolean selectPaymentAutoShowKeyboard = GsaCloudApplication.functionConfiguration.getSelectPaymentAutoShowKeyboardVaule();
if (selectPaymentAutoShowKeyboard) {
//彈出支付金額鍵盤
view.findViewById(R.id.layout_keypad).performClick();
}
if (onSelectPayClickLisenter != null) { if (onSelectPayClickLisenter != null) {
onSelectPayClickLisenter.addClick(method); onSelectPayClickLisenter.addClick(method);
} }
......
...@@ -7,8 +7,8 @@ ext { ...@@ -7,8 +7,8 @@ ext {
targetSdkVersion : 29, targetSdkVersion : 29,
//正式版: 1.0.3 3 //正式版: 1.0.3 3
//內部測試版:1.2.0 20 //內部測試版:1.2.0 20
versionCode : 12, versionCode : 13,
versionName : "1.1.2" versionName : "1.1.3"
] ]
version = [ version = [
......
...@@ -13,6 +13,7 @@ import com.gingersoft.gsa.cloud.common.utils.toast.ToastUtils ...@@ -13,6 +13,7 @@ import com.gingersoft.gsa.cloud.common.utils.toast.ToastUtils
import com.gingersoft.gsa.cloud.component.ComponentName import com.gingersoft.gsa.cloud.component.ComponentName
import com.gingersoft.gsa.cloud.common.constans.PrintConstans import com.gingersoft.gsa.cloud.common.constans.PrintConstans
import com.gingersoft.gsa.cloud.common.core.print.bean.OrderDetails import com.gingersoft.gsa.cloud.common.core.print.bean.OrderDetails
import com.gingersoft.gsa.cloud.common.core.print.bean.adapter.PrintContentAdapter
import com.gingersoft.gsa.delivery_pick_mode.data.HistoryOrderRepository import com.gingersoft.gsa.delivery_pick_mode.data.HistoryOrderRepository
import com.gingersoft.gsa.delivery_pick_mode.data.model.bean.HistoryOrderBean import com.gingersoft.gsa.delivery_pick_mode.data.model.bean.HistoryOrderBean
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
...@@ -89,8 +90,13 @@ class HistoryOrderViewModel(private val historyOrderRepository: HistoryOrderRepo ...@@ -89,8 +90,13 @@ class HistoryOrderViewModel(private val historyOrderRepository: HistoryOrderRepo
orderDetails.data!![0].order_type = data.order_type orderDetails.data!![0].order_type = data.order_type
orderDetails.data!![0].orderPayType = data.orderPayType orderDetails.data!![0].orderPayType = data.orderPayType
TakeawayOrder.getInstance().shoppingCart.deliveryAndPickupData = orderDetails.data!![0] TakeawayOrder.getInstance().shoppingCart.deliveryAndPickupData = orderDetails.data!![0]
var contentAdapter = PrintContentAdapter()
var printContent = contentAdapter.adaptationPrintTakeawayFormContent(TakeawayOrder.getInstance().shoppingCart.deliveryAndPickupData)
CC.obtainBuilder(ComponentName.COMPONENT_PRINT) CC.obtainBuilder(ComponentName.COMPONENT_PRINT)
.addParam(PrintConstans.PRINT_TYPE, PrintConstans.PRINT_OTHER_ORDER) .addParam(PrintConstans.PRINT_TYPE, PrintConstans.PRINT_OTHER_ORDER)
.addParam(PrintConstans.PRINT_CONTENT, printContent)
.setActionName("printActivity") .setActionName("printActivity")
.build() .build()
.callAsyncCallbackOnMainThread { _, result -> .callAsyncCallbackOnMainThread { _, result ->
......
...@@ -620,8 +620,13 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() { ...@@ -620,8 +620,13 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
fun printOrder(code: Int, dataBean: OrderDetails.DataBean, listener: (MessageBean) -> Unit) { fun printOrder(code: Int, dataBean: OrderDetails.DataBean, listener: (MessageBean) -> Unit) {
//訂單信息和廚房單,打印前需要修改dataBean的order_type和orderPayType //訂單信息和廚房單,打印前需要修改dataBean的order_type和orderPayType
TakeawayOrder.getInstance().shoppingCart.deliveryAndPickupData = dataBean TakeawayOrder.getInstance().shoppingCart.deliveryAndPickupData = dataBean
var contentAdapter = PrintContentAdapter()
var printContent = contentAdapter.adaptationPrintTakeawayFormContent(dataBean)
CC.obtainBuilder(ComponentName.COMPONENT_PRINT) CC.obtainBuilder(ComponentName.COMPONENT_PRINT)
.addParam(PrintConstans.PRINT_TYPE, PrintConstans.PRINT_OTHER_ORDER) .addParam(PrintConstans.PRINT_TYPE, PrintConstans.PRINT_OTHER_ORDER)
.addParam(PrintConstans.PRINT_CONTENT, printContent)
.setActionName("printActivity") .setActionName("printActivity")
.build() .build()
.callAsyncCallbackOnMainThread { _, result -> .callAsyncCallbackOnMainThread { _, result ->
......
...@@ -103,10 +103,12 @@ public class WelcomeActivity extends LoginInterfaceImpl<WelcomePresenter> implem ...@@ -103,10 +103,12 @@ public class WelcomeActivity extends LoginInterfaceImpl<WelcomePresenter> implem
boolean isLogin = (boolean) SPUtils.get(UserConstans.AUTO_LOGIN, false); boolean isLogin = (boolean) SPUtils.get(UserConstans.AUTO_LOGIN, false);
if (isLogin) { if (isLogin) {
if (!TextUtils.isEmpty(UserContext.newInstance().getLoginToken()) && ResturantInfoManager.newInstance(). getRestaurantId() != 0) { if (!TextUtils.isEmpty(UserContext.newInstance().getLoginToken()) && ResturantInfoManager.newInstance().getRestaurantId() != 0) {
//自動登陸 //自動登陸
String pwd = Aes.aesDecrypt((String) SPUtils.get(UserConstans.LOGIN_PASSWORD, "")); String pwd = Aes.aesDecrypt((String) SPUtils.get(UserConstans.LOGIN_PASSWORD, ""));
mPresenter.login(SPUtils.get(UserConstans.LOGIN_USERNAME, "") + "", pwd); mPresenter.login(SPUtils.get(UserConstans.LOGIN_USERNAME, "") + "", pwd);
} else {
startActivity(new Intent(mContext, LoginActivity.class));
} }
} else { } else {
startActivity(new Intent(mContext, LoginActivity.class)); startActivity(new Intent(mContext, LoginActivity.class));
......
...@@ -22,6 +22,8 @@ import androidx.recyclerview.widget.LinearLayoutManager; ...@@ -22,6 +22,8 @@ import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import com.billy.cc.core.component.CC; import com.billy.cc.core.component.CC;
import com.gingersoft.gsa.cloud.common.core.print.bean.PrintContent;
import com.gingersoft.gsa.cloud.common.core.print.bean.adapter.PrintContentAdapter;
import com.gingersoft.gsa.cloud.common.core.restaurant.ResturantInfoManager; import com.gingersoft.gsa.cloud.common.core.restaurant.ResturantInfoManager;
import com.gingersoft.gsa.cloud.common.core.user.UserContext; import com.gingersoft.gsa.cloud.common.core.user.UserContext;
import com.gingersoft.gsa.cloud.common.core.pay.PayMethod; import com.gingersoft.gsa.cloud.common.core.pay.PayMethod;
...@@ -122,6 +124,7 @@ public class SettlementReportActivity extends BaseActivity<SettlementReportPrese ...@@ -122,6 +124,7 @@ public class SettlementReportActivity extends BaseActivity<SettlementReportPrese
private int type; private int type;
private SettlementReport mSettlementReport;
/** /**
* 1#全部計入到10號清機數據 * 1#全部計入到10號清機數據
* 2#全部計入到12號清機數據 * 2#全部計入到12號清機數據
...@@ -296,6 +299,7 @@ public class SettlementReportActivity extends BaseActivity<SettlementReportPrese ...@@ -296,6 +299,7 @@ public class SettlementReportActivity extends BaseActivity<SettlementReportPrese
@Override @Override
public void returnSettlementData(SettlementReport datasBean) { public void returnSettlementData(SettlementReport datasBean) {
this.mSettlementReport = datasBean;
if (datasBean.getVo() != null && datasBean.getVo().getPrices() > 0) { if (datasBean.getVo() != null && datasBean.getVo().getPrices() > 0) {
//保存下次重印數據 //保存下次重印數據
SPUtils.put(PrintConstans.SETTLEMENT_REPORT, JsonUtils.toJson(datasBean)); SPUtils.put(PrintConstans.SETTLEMENT_REPORT, JsonUtils.toJson(datasBean));
...@@ -575,11 +579,18 @@ public class SettlementReportActivity extends BaseActivity<SettlementReportPrese ...@@ -575,11 +579,18 @@ public class SettlementReportActivity extends BaseActivity<SettlementReportPrese
@Override @Override
public void printRepore() { public void printRepore() {
if (mSettlementReport == null) {
return;
}
View view = initPrintView(); View view = initPrintView();
//清機成功,打印 //清機成功,打印
PrintTransitUtils.getInstance().setPrintView(view); PrintTransitUtils.getInstance().setPrintView(view);
PrintContent printContent = new PrintContentAdapter().adaptationPrintCleanMachineContent(mSettlementReport);
CC.obtainBuilder(ComponentName.COMPONENT_PRINT) CC.obtainBuilder(ComponentName.COMPONENT_PRINT)
.addParam(PrintConstans.PRINT_TYPE, PrintConstans.PRINT_CLEAN_MACHINE)//清機打印 .addParam(PrintConstans.PRINT_TYPE, PrintConstans.PRINT_CLEAN_MACHINE)//清機打印
.addParam(PrintConstans.PRINT_CONTENT, printContent)//清機內容
.setActionName("printActivity") .setActionName("printActivity")
.build() .build()
.callAsyncCallbackOnMainThread((cc, result) -> { .callAsyncCallbackOnMainThread((cc, result) -> {
......
package com.joe.print.mvp.model.bean;
import lombok.Data;
/**
* @author : bin
* @create date: 2020-12-03
* @update date: 2020-12-03
* @description:
*/
@Data
public class FontStyle {
private int foodComplexion;//食品顔色 0 黑色 2 紅色
private int modifierComplexion;//細項顔色 0 黑色 2 紅色
private int foodIsBold;//食品是否加粗 0預設 1是 2否
private String foodFont;//食品字體大小 0預設
private int foodIsItalic;//食品是否斜體 0預設 1是 2否
private int modifierIsBold;//細項是否加粗 0預設 1是 2否
private String modifierFont;//細項字號 0預設
private int modifierIsItalic;//細項是否斜體 0預設 1是 2否
private int numberIsFlip;//數量大於1顔色是否翻轉 0預設 1是 2否
}
...@@ -23,13 +23,17 @@ import java.util.List; ...@@ -23,13 +23,17 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import static com.joe.print.mvp.print.common.HtmlContract.ATTRIBUTES_ALIGN; import static com.joe.print.mvp.print.common.HtmlContract.ATTRIBUTES_ALIGN;
import static com.joe.print.mvp.print.common.HtmlContract.ATTRIBUTES_FONT_SIZE;
import static com.joe.print.mvp.print.common.HtmlContract.ATTRIBUTES_OFFSET; import static com.joe.print.mvp.print.common.HtmlContract.ATTRIBUTES_OFFSET;
import static com.joe.print.mvp.print.common.HtmlContract.LABLE_COLUMN; import static com.joe.print.mvp.print.common.HtmlContract.LABLE_COLUMN;
import static com.joe.print.mvp.print.common.HtmlContract.LABLE_DIV;
import static com.joe.print.mvp.print.common.HtmlContract.LABLE_P; import static com.joe.print.mvp.print.common.HtmlContract.LABLE_P;
import static com.joe.print.mvp.print.common.HtmlContract.value_align_center; import static com.joe.print.mvp.print.common.HtmlContract.value_align_center;
import static com.joe.print.mvp.print.common.HtmlContract.value_offset_last; import static com.joe.print.mvp.print.common.HtmlContract.value_offset_last;
import static com.joe.print.mvp.print.common.HtmlContract.value_offset_percentage30; import static com.joe.print.mvp.print.common.HtmlContract.value_offset_percentage30;
import static com.joe.print.mvp.print.common.HtmlContract.value_offset_percentage35;
import static com.joe.print.mvp.print.common.HtmlContract.value_offset_percentage60; import static com.joe.print.mvp.print.common.HtmlContract.value_offset_percentage60;
import static com.joe.print.mvp.print.common.HtmlContract.value_offset_percentage65;
/** /**
* 清機打印 * 清機打印
...@@ -41,9 +45,11 @@ public class PrintCleanMachine extends PrinterRoot<PrintCleanMachineContent> { ...@@ -41,9 +45,11 @@ public class PrintCleanMachine extends PrinterRoot<PrintCleanMachineContent> {
@Override @Override
protected void setPrintContent(PrintCleanMachineContent printContent) { protected void setPrintContent(PrintCleanMachineContent printContent) {
if (printContent != null) {
this.mCleanMachineContent = printContent; this.mCleanMachineContent = printContent;
this.mAnalysisBeanMap = getAnalysisBeanMap(mCleanMachineContent.getAnalysis()); this.mAnalysisBeanMap = getAnalysisBeanMap(mCleanMachineContent.getAnalysis());
} }
}
private Map<String, SettlementReport.AnalysisBean> getAnalysisBeanMap(List<SettlementReport.AnalysisBean> analysisBeanList) { private Map<String, SettlementReport.AnalysisBean> getAnalysisBeanMap(List<SettlementReport.AnalysisBean> analysisBeanList) {
Map<String, SettlementReport.AnalysisBean> analysisBeanMap = new HashMap<>(); Map<String, SettlementReport.AnalysisBean> analysisBeanMap = new HashMap<>();
...@@ -77,8 +83,11 @@ public class PrintCleanMachine extends PrinterRoot<PrintCleanMachineContent> { ...@@ -77,8 +83,11 @@ public class PrintCleanMachine extends PrinterRoot<PrintCleanMachineContent> {
getHtmlCumulativeThisMonth() + getHtmlCumulativeThisMonth() +
getHtmlEndInfo() getHtmlEndInfo()
+ "</body></html>"; + "</body></html>";
String[] pritContent = new String[1]; int printCount = getPrintCount(mContext);
pritContent[0] = stringBuilder; String[] pritContent = new String[printCount];
for (int i = 0; i < printCount; i++) {
pritContent[i] = stringBuilder;
}
return pritContent; return pritContent;
} }
...@@ -103,13 +112,18 @@ public class PrintCleanMachine extends PrinterRoot<PrintCleanMachineContent> { ...@@ -103,13 +112,18 @@ public class PrintCleanMachine extends PrinterRoot<PrintCleanMachineContent> {
private String getHtmlHeadInfo() { private String getHtmlHeadInfo() {
List<HtmlLable> htmlLables = new ArrayList<>(); List<HtmlLable> htmlLables = new ArrayList<>();
htmlLables.add(new HtmlLable(LABLE_P, "上次清機時間:" + mCleanMachineContent.getRestaurantOperation().getOperationTime()));
htmlLables.add(new HtmlLable(LABLE_P, "品牌名稱:" + ResturantInfoManager.newInstance().getBrandName())); List<String> items = new ArrayList<>();
htmlLables.add(new HtmlLable(LABLE_P, "店鋪名稱:" + ResturantInfoManager.newInstance().getRestaurantName())); items.add("上次清機時間:" + mCleanMachineContent.getRestaurantOperationTime());
htmlLables.add(new HtmlLable(LABLE_P, "每日營業報表")); items.add("品牌名稱:" + ResturantInfoManager.newInstance().getBrandName());
htmlLables.add(new HtmlLable(LABLE_P, "由營業日期:" + mCleanMachineContent.getStartTime())); items.add("店鋪名稱:" + ResturantInfoManager.newInstance().getRestaurantName());
htmlLables.add(new HtmlLable(LABLE_P, "到營業日期:" + mCleanMachineContent.getCurrentTime())); items.add("每日營業報表");
htmlLables.add(new HtmlLable(LABLE_P, HtmlContract.dividing_line)); items.add("由營業日期:" + mCleanMachineContent.getStartTime());
items.add("到營業日期:" + mCleanMachineContent.getCurrentTime());
for (String item : items) {
htmlLables.addAll(getRowInformation(new HtmlLable[]{new HtmlLable(LABLE_COLUMN, item)}, 24));
}
htmlLables.add(new HtmlLable(LABLE_DIV, HtmlContract.dividing_line));
return getHtmlLables(htmlLables.toArray(new HtmlLable[htmlLables.size()])); return getHtmlLables(htmlLables.toArray(new HtmlLable[htmlLables.size()]));
} }
...@@ -120,35 +134,34 @@ public class PrintCleanMachine extends PrinterRoot<PrintCleanMachineContent> { ...@@ -120,35 +134,34 @@ public class PrintCleanMachine extends PrinterRoot<PrintCleanMachineContent> {
List<HtmlLable> htmlLables = new ArrayList<>(); List<HtmlLable> htmlLables = new ArrayList<>();
String[] items = {"項目銷售總額", "折扣", "服務費", "送貨費", "營業今個淨值", "現金核數", "營業金額淨值"}; String[] items = {"項目銷售總額", "折扣", "服務費", "送貨費", "營業今個淨值", "", "現金核數", "營業金額淨值"};
List<String> items2 = new ArrayList<>(); List<String> items2 = new ArrayList<>();
items2.add(String.valueOf(voBean.getPrices())); items2.add(AppConstans.CARSH_STR + voBean.getPrices());
items2.add(String.valueOf(voBean.getDisamount())); items2.add(AppConstans.CARSH_STR + voBean.getDisamount());
items2.add(String.valueOf(voBean.getScamount())); items2.add(AppConstans.CARSH_STR + voBean.getScamount());
items2.add(String.valueOf(voBean.getDeliverycharge())); items2.add(AppConstans.CARSH_STR + voBean.getDeliverycharge());
items2.add(String.valueOf(voBean.getTotamount())); items2.add(AppConstans.CARSH_STR + voBean.getTotamount());
items2.add("");
items2.add(""); items2.add("");
items2.add(String.valueOf(voBean.getTotamount())); items2.add(AppConstans.CARSH_STR + voBean.getTotamount());
for (int i = 0; i < items.length; i++) { for (int i = 0; i < items.length; i++) {
htmlLables.add(new HtmlLable(getRowLableStart())); htmlLables.addAll(getRowInformation(new HtmlLable[]{
htmlLables.add(new HtmlLable(LABLE_COLUMN, items[i])); new HtmlLable(LABLE_COLUMN, items[i]),
if (items2.size() > (i + 1)) { new HtmlLable(LABLE_COLUMN, String.valueOf(items2.get(i)), new HtmlLable.Attributes(ATTRIBUTES_OFFSET, value_offset_last))},
htmlLables.add(new HtmlLable(LABLE_COLUMN, String.valueOf(items2.get(i)), new HtmlLable.Attributes(ATTRIBUTES_OFFSET, value_offset_last))); 24));
}
htmlLables.add(new HtmlLable(getRowLableEnd()));
} }
if (cashs != null) { if (cashs != null) {
for (SettlementReport.CashBean cashBean : cashs) { for (SettlementReport.CashBean cashBean : cashs) {
htmlLables.add(new HtmlLable(getRowLableStart())); htmlLables.addAll(getRowInformation(new HtmlLable[]{
htmlLables.add(new HtmlLable(LABLE_COLUMN, cashBean.getPayName())); new HtmlLable(LABLE_COLUMN, cashBean.getPayName()),
htmlLables.add(new HtmlLable(LABLE_COLUMN, String.valueOf(cashBean.getPayNum()), new HtmlLable.Attributes(ATTRIBUTES_OFFSET, value_offset_percentage60))); new HtmlLable(LABLE_COLUMN, String.valueOf(cashBean.getPayNum()), new HtmlLable.Attributes(ATTRIBUTES_OFFSET, value_offset_percentage60)),
htmlLables.add(new HtmlLable(LABLE_COLUMN, String.valueOf(cashBean.getPayAmount()), new HtmlLable.Attributes(ATTRIBUTES_OFFSET, value_offset_last))); new HtmlLable(LABLE_COLUMN, AppConstans.CARSH_STR + cashBean.getPayAmount(), new HtmlLable.Attributes(ATTRIBUTES_OFFSET, value_offset_last))
htmlLables.add(new HtmlLable(getRowLableEnd())); }, 24));
} }
} }
htmlLables.add(new HtmlLable(LABLE_P, HtmlContract.dividing_line)); // htmlLables.add(new HtmlLable(LABLE_P, HtmlContract.dividing_line));
htmlLables.add(new HtmlLable(LABLE_P, HtmlContract.dividing_line)); htmlLables.add(new HtmlLable(LABLE_P, HtmlContract.dividing_line));
return getHtmlLables(htmlLables.toArray(new HtmlLable[htmlLables.size()])); return getHtmlLables(htmlLables.toArray(new HtmlLable[htmlLables.size()]));
} }
...@@ -164,20 +177,26 @@ public class PrintCleanMachine extends PrinterRoot<PrintCleanMachineContent> { ...@@ -164,20 +177,26 @@ public class PrintCleanMachine extends PrinterRoot<PrintCleanMachineContent> {
return ""; return "";
} }
List<HtmlLable> htmlLables = new ArrayList<>(); List<HtmlLable> htmlLables = new ArrayList<>();
htmlLables.add(new HtmlLable(LABLE_P, "現金詳情", new HtmlLable.Attributes(ATTRIBUTES_ALIGN, value_align_center))); htmlLables.add(new HtmlLable(LABLE_P, "現金詳情",
new HtmlLable.Attributes(ATTRIBUTES_FONT_SIZE, "26"),
new HtmlLable.Attributes(ATTRIBUTES_ALIGN, value_align_center, HtmlContract.value_type_string)));
for (SettlementReport.CashBean cashBean : cashs) { for (SettlementReport.CashBean cashBean : cashs) {
if (cashBean.getPayType() == PayMethod.PAY_TYPE_CASH) { if (cashBean.getPayType() == PayMethod.PAY_TYPE_CASH) {
htmlLables.add(new HtmlLable(getRowLableStart())); htmlLables.addAll(getRowInformation(new HtmlLable[]{
htmlLables.add(new HtmlLable(LABLE_COLUMN, cashBean.getPayName())); new HtmlLable(LABLE_COLUMN, cashBean.getPayName()),
htmlLables.add(new HtmlLable(LABLE_COLUMN, String.valueOf(cashBean.getPayNum()), new HtmlLable.Attributes(ATTRIBUTES_OFFSET, value_offset_percentage60))); new HtmlLable(LABLE_COLUMN, String.valueOf(cashBean.getPayNum()), new HtmlLable.Attributes(ATTRIBUTES_OFFSET, value_offset_percentage60)),
htmlLables.add(new HtmlLable(LABLE_COLUMN, String.valueOf(cashBean.getPayAmount()), new HtmlLable.Attributes(ATTRIBUTES_OFFSET, value_offset_last))); new HtmlLable(LABLE_COLUMN, AppConstans.CARSH_STR + cashBean.getPayAmount(), new HtmlLable.Attributes(ATTRIBUTES_OFFSET, value_offset_last))
htmlLables.add(new HtmlLable(getRowLableEnd())); }, 22));
break; break;
} }
} }
if (htmlLables.size() > 0) { if (htmlLables.size() > 0) {
htmlLables.add(new HtmlLable(LABLE_P, HtmlContract.dividing_line)); htmlLables.add(new HtmlLable(LABLE_P, HtmlContract.dividing_line));
htmlLables.add(new HtmlLable(LABLE_P, HtmlContract.dividing_line)); // htmlLables.add(new HtmlLable(LABLE_P, HtmlContract.dividing_line));
}
if (htmlLables.size() == 1) {
return "";
} }
return getHtmlLables(htmlLables.toArray(new HtmlLable[htmlLables.size()])); return getHtmlLables(htmlLables.toArray(new HtmlLable[htmlLables.size()]));
} }
...@@ -193,35 +212,39 @@ public class PrintCleanMachine extends PrinterRoot<PrintCleanMachineContent> { ...@@ -193,35 +212,39 @@ public class PrintCleanMachine extends PrinterRoot<PrintCleanMachineContent> {
List<HtmlLable> htmlLables = new ArrayList<>(); List<HtmlLable> htmlLables = new ArrayList<>();
htmlLables.add(new HtmlLable(LABLE_P, "分析統計", new HtmlLable.Attributes(ATTRIBUTES_ALIGN, value_align_center))); htmlLables.add(new HtmlLable(LABLE_P, "分析統計",
new HtmlLable.Attributes(ATTRIBUTES_FONT_SIZE, "26"),
new HtmlLable.Attributes(ATTRIBUTES_ALIGN, value_align_center, HtmlContract.value_type_string)));
htmlLables.add(new HtmlLable(getRowLableStart())); htmlLables.addAll(getRowInformation(new HtmlLable[]{
htmlLables.add(new HtmlLable(LABLE_COLUMN, "帳單金額總數")); new HtmlLable(LABLE_COLUMN, "帳單金額總數"),
htmlLables.add(new HtmlLable(LABLE_COLUMN, String.valueOf(voBean.getTotamount()), new HtmlLable.Attributes(ATTRIBUTES_OFFSET, value_offset_last))); new HtmlLable(LABLE_COLUMN, AppConstans.CARSH_STR + voBean.getTotamount(), new HtmlLable.Attributes(ATTRIBUTES_OFFSET, value_offset_last))
htmlLables.add(new HtmlLable(getRowLableEnd())); }, 22));
htmlLables.add(new HtmlLable(getRowLableStart())); htmlLables.add(new HtmlLable(getRowLableStart()));
String averagePrice = "0.00"; String averagePrice = "0.00";
if (voBean.getNum() != 0) { if (voBean.getNum() != 0) {
averagePrice = String.valueOf(MoneyUtil.get_ItemDecimals_money(voBean.getPrices() / voBean.getNum())); averagePrice = String.valueOf(MoneyUtil.get_ItemDecimals_money(voBean.getPrices() / voBean.getNum()));
} }
htmlLables.add(new HtmlLable(LABLE_COLUMN, "帳單數目"));
htmlLables.add(new HtmlLable(LABLE_COLUMN, String.valueOf(voBean.getNum()), new HtmlLable.Attributes(ATTRIBUTES_OFFSET, value_offset_percentage60)));
htmlLables.add(new HtmlLable(LABLE_COLUMN, averagePrice, new HtmlLable.Attributes(ATTRIBUTES_OFFSET, value_offset_last)));
htmlLables.add(new HtmlLable(getRowLableEnd()));
htmlLables.addAll(getRowInformation(new HtmlLable[]{
new HtmlLable(LABLE_COLUMN, "帳單數目"),
new HtmlLable(LABLE_COLUMN, String.valueOf(voBean.getNum()), new HtmlLable.Attributes(ATTRIBUTES_OFFSET, value_offset_percentage60)),
new HtmlLable(LABLE_COLUMN, AppConstans.CARSH_STR + averagePrice, new HtmlLable.Attributes(ATTRIBUTES_OFFSET, value_offset_last))
}, 22));
htmlLables.add(new HtmlLable(getRowLableStart()));
String averageConsumption = "0.00"; String averageConsumption = "0.00";
if (voBean.getPerson() != 0) { if (voBean.getPerson() != 0) {
averageConsumption = String.valueOf(MoneyUtil.get_ItemDecimals_money(voBean.getPrices() / voBean.getPerson())); averageConsumption = String.valueOf(MoneyUtil.get_ItemDecimals_money(voBean.getPrices() / voBean.getPerson()));
} }
htmlLables.add(new HtmlLable(LABLE_COLUMN, "人數 / 平均消費"));
htmlLables.add(new HtmlLable(LABLE_COLUMN, String.valueOf(voBean.getPerson()), new HtmlLable.Attributes(ATTRIBUTES_OFFSET, value_offset_percentage60)));
htmlLables.add(new HtmlLable(LABLE_COLUMN, averageConsumption, new HtmlLable.Attributes(ATTRIBUTES_OFFSET, value_offset_last)));
htmlLables.add(new HtmlLable(getRowLableEnd()));
htmlLables.add(new HtmlLable(LABLE_P, HtmlContract.dividing_line)); htmlLables.addAll(getRowInformation(new HtmlLable[]{
new HtmlLable(LABLE_COLUMN, "人數 / 平均消費"),
new HtmlLable(LABLE_COLUMN, String.valueOf(voBean.getPerson()), new HtmlLable.Attributes(ATTRIBUTES_OFFSET, value_offset_percentage60)),
new HtmlLable(LABLE_COLUMN, AppConstans.CARSH_STR + averageConsumption, new HtmlLable.Attributes(ATTRIBUTES_OFFSET, value_offset_last))
}, 22));
// htmlLables.add(new HtmlLable(LABLE_P, HtmlContract.dividing_line));
htmlLables.add(new HtmlLable(LABLE_P, HtmlContract.dividing_line)); htmlLables.add(new HtmlLable(LABLE_P, HtmlContract.dividing_line));
return getHtmlLables(htmlLables.toArray(new HtmlLable[htmlLables.size()])); return getHtmlLables(htmlLables.toArray(new HtmlLable[htmlLables.size()]));
...@@ -235,7 +258,9 @@ public class PrintCleanMachine extends PrinterRoot<PrintCleanMachineContent> { ...@@ -235,7 +258,9 @@ public class PrintCleanMachine extends PrinterRoot<PrintCleanMachineContent> {
private String getHtmlBillingStatisticsItems() { private String getHtmlBillingStatisticsItems() {
List<HtmlLable> htmlLables = new ArrayList<>(); List<HtmlLable> htmlLables = new ArrayList<>();
htmlLables.add(new HtmlLable(LABLE_P, "賬單統計", new HtmlLable.Attributes(ATTRIBUTES_ALIGN, value_align_center))); htmlLables.add(new HtmlLable(LABLE_P, "賬單統計",
new HtmlLable.Attributes(ATTRIBUTES_FONT_SIZE, "26"),
new HtmlLable.Attributes(ATTRIBUTES_ALIGN, value_align_center, HtmlContract.value_type_string)));
List<SettlementReport.AnalysisBean> analysisBeanList = mCleanMachineContent.getAnalysis(); List<SettlementReport.AnalysisBean> analysisBeanList = mCleanMachineContent.getAnalysis();
SettlementReport.VoBean voBean = mCleanMachineContent.getVo(); SettlementReport.VoBean voBean = mCleanMachineContent.getVo();
...@@ -246,6 +271,9 @@ public class PrintCleanMachine extends PrinterRoot<PrintCleanMachineContent> { ...@@ -246,6 +271,9 @@ public class PrintCleanMachine extends PrinterRoot<PrintCleanMachineContent> {
htmlLables.addAll(getHtmlBillingStatisticsItem(analysisBean, voBean)); htmlLables.addAll(getHtmlBillingStatisticsItem(analysisBean, voBean));
} }
} }
if (htmlLables.size() == 1) {
return "";
}
return getHtmlLables(htmlLables.toArray(new HtmlLable[htmlLables.size()])); return getHtmlLables(htmlLables.toArray(new HtmlLable[htmlLables.size()]));
} }
...@@ -255,10 +283,11 @@ public class PrintCleanMachine extends PrinterRoot<PrintCleanMachineContent> { ...@@ -255,10 +283,11 @@ public class PrintCleanMachine extends PrinterRoot<PrintCleanMachineContent> {
List<String> items2 = new ArrayList<>(); List<String> items2 = new ArrayList<>();
List<HtmlLable> htmlLables = new ArrayList<>(); List<HtmlLable> htmlLables = new ArrayList<>();
htmlLables.add(new HtmlLable(getRowLableStart()));
htmlLables.add(new HtmlLable(LABLE_COLUMN, "類別")); htmlLables.addAll(getRowInformation(new HtmlLable[]{
htmlLables.add(new HtmlLable(LABLE_COLUMN, analysisBean.getTypeName(), new HtmlLable.Attributes(ATTRIBUTES_OFFSET, value_offset_last))); new HtmlLable(LABLE_COLUMN, "類別"),
htmlLables.add(new HtmlLable(getRowLableEnd())); new HtmlLable(LABLE_COLUMN, analysisBean.getTypeName(), new HtmlLable.Attributes(ATTRIBUTES_OFFSET, value_offset_last)),
}, 24));
String averagePrice = ""; String averagePrice = "";
String percentage = ""; String percentage = "";
...@@ -273,13 +302,13 @@ public class PrintCleanMachine extends PrinterRoot<PrintCleanMachineContent> { ...@@ -273,13 +302,13 @@ public class PrintCleanMachine extends PrinterRoot<PrintCleanMachineContent> {
} }
items2.add(analysisBean.getTypeName()); items2.add(analysisBean.getTypeName());
items2.add(String.valueOf(analysisBean.getNum())); items2.add(String.valueOf(analysisBean.getNum()));
items2.add(String.valueOf(analysisBean.getAmount())); items2.add(AppConstans.CARSH_STR + analysisBean.getAmount());
items2.add(averagePrice); items2.add(AppConstans.CARSH_STR + averagePrice);
items2.add(percentage); items2.add(AppConstans.CARSH_STR + percentage);
for (int i = 0; i < items.length; i++) { for (int i = 0; i < items.length; i++) {
htmlLables.add(new HtmlLable(getRowLableStart())); htmlLables.add(new HtmlLable(getRowLableStart(new HtmlLable.Attributes(ATTRIBUTES_FONT_SIZE, "22"))));
htmlLables.add(new HtmlLable(LABLE_COLUMN, items[i])); htmlLables.add(new HtmlLable(LABLE_COLUMN, items[i]));
if (items2.size() > (i + 1)) { if (items2.size() > i) {
htmlLables.add(new HtmlLable(LABLE_COLUMN, items2.get(i), new HtmlLable.Attributes(ATTRIBUTES_OFFSET, value_offset_last))); htmlLables.add(new HtmlLable(LABLE_COLUMN, items2.get(i), new HtmlLable.Attributes(ATTRIBUTES_OFFSET, value_offset_last)));
} }
htmlLables.add(new HtmlLable(getRowLableEnd())); htmlLables.add(new HtmlLable(getRowLableEnd()));
...@@ -308,7 +337,9 @@ public class PrintCleanMachine extends PrinterRoot<PrintCleanMachineContent> { ...@@ -308,7 +337,9 @@ public class PrintCleanMachine extends PrinterRoot<PrintCleanMachineContent> {
items4.add("金額"); items4.add("金額");
List<HtmlLable> htmlLables = new ArrayList<>(); List<HtmlLable> htmlLables = new ArrayList<>();
htmlLables.add(new HtmlLable(LABLE_P, "賬單現況", new HtmlLable.Attributes(ATTRIBUTES_ALIGN, value_align_center))); htmlLables.add(new HtmlLable(LABLE_P, "賬單現況",
new HtmlLable.Attributes(ATTRIBUTES_FONT_SIZE, "26"),
new HtmlLable.Attributes(ATTRIBUTES_ALIGN, value_align_center, HtmlContract.value_type_string)));
for (int i = 0; i < analysisBeanList.size(); i++) { for (int i = 0; i < analysisBeanList.size(); i++) {
SettlementReport.AnalysisBean analysisBean = analysisBeanList.get(i); SettlementReport.AnalysisBean analysisBean = analysisBeanList.get(i);
...@@ -316,24 +347,38 @@ public class PrintCleanMachine extends PrinterRoot<PrintCleanMachineContent> { ...@@ -316,24 +347,38 @@ public class PrintCleanMachine extends PrinterRoot<PrintCleanMachineContent> {
items.add(analysisBean.getTypeName()); items.add(analysisBean.getTypeName());
items2.add(String.valueOf(analysisBean.getNum())); items2.add(String.valueOf(analysisBean.getNum()));
items3.add(String.valueOf(analysisBean.getPerson())); items3.add(String.valueOf(analysisBean.getPerson()));
items4.add(String.valueOf(analysisBean.getAmount())); items4.add(AppConstans.CARSH_STR + analysisBean.getAmount());
} }
} }
for (int i = 0; i < items.size(); i++) { for (int i = 0; i < items.size(); i++) {
htmlLables.add(new HtmlLable(getRowLableStart())); htmlLables.add(new HtmlLable(getRowLableStart(new HtmlLable.Attributes(ATTRIBUTES_FONT_SIZE, "22"))));
htmlLables.add(new HtmlLable(LABLE_COLUMN, items.get(i))); htmlLables.add(new HtmlLable(LABLE_COLUMN, items.get(i)));
if (items2.size() > (i + 1)) { if (items2.size() > i) {
if (i > 0) {
htmlLables.add(new HtmlLable(LABLE_COLUMN, items2.get(i), new HtmlLable.Attributes(ATTRIBUTES_OFFSET, value_offset_percentage35)));
} else {
htmlLables.add(new HtmlLable(LABLE_COLUMN, items2.get(i), new HtmlLable.Attributes(ATTRIBUTES_OFFSET, value_offset_percentage30))); htmlLables.add(new HtmlLable(LABLE_COLUMN, items2.get(i), new HtmlLable.Attributes(ATTRIBUTES_OFFSET, value_offset_percentage30)));
} }
if (items3.size() > (i + 1)) { }
if (items3.size() > i) {
if (i > 0) {
htmlLables.add(new HtmlLable(LABLE_COLUMN, items3.get(i), new HtmlLable.Attributes(ATTRIBUTES_OFFSET, value_offset_percentage65)));
} else {
htmlLables.add(new HtmlLable(LABLE_COLUMN, items3.get(i), new HtmlLable.Attributes(ATTRIBUTES_OFFSET, value_offset_percentage60))); htmlLables.add(new HtmlLable(LABLE_COLUMN, items3.get(i), new HtmlLable.Attributes(ATTRIBUTES_OFFSET, value_offset_percentage60)));
} }
if (items4.size() > (i + 1)) { }
if (items4.size() > i) {
if (i > 0) {
htmlLables.add(new HtmlLable(LABLE_COLUMN, items4.get(i), new HtmlLable.Attributes(ATTRIBUTES_OFFSET, value_offset_last)));
} else {
htmlLables.add(new HtmlLable(LABLE_COLUMN, items4.get(i), new HtmlLable.Attributes(ATTRIBUTES_OFFSET, value_offset_last))); htmlLables.add(new HtmlLable(LABLE_COLUMN, items4.get(i), new HtmlLable.Attributes(ATTRIBUTES_OFFSET, value_offset_last)));
} }
}
htmlLables.add(new HtmlLable(getRowLableEnd())); htmlLables.add(new HtmlLable(getRowLableEnd()));
} }
htmlLables.add(new HtmlLable(LABLE_P, HtmlContract.dividing_line));
htmlLables.add(new HtmlLable(getBrLable()));
return getHtmlLables(htmlLables.toArray(new HtmlLable[htmlLables.size()])); return getHtmlLables(htmlLables.toArray(new HtmlLable[htmlLables.size()]));
} }
...@@ -365,13 +410,14 @@ public class PrintCleanMachine extends PrinterRoot<PrintCleanMachineContent> { ...@@ -365,13 +410,14 @@ public class PrintCleanMachine extends PrinterRoot<PrintCleanMachineContent> {
} }
for (int i = 0; i < items.size(); i++) { for (int i = 0; i < items.size(); i++) {
htmlLables.add(new HtmlLable(getRowLableStart())); htmlLables.add(new HtmlLable(getRowLableStart(new HtmlLable.Attributes(ATTRIBUTES_FONT_SIZE, "24"))));
htmlLables.add(new HtmlLable(LABLE_COLUMN, items.get(i))); htmlLables.add(new HtmlLable(LABLE_COLUMN, items.get(i)));
if (items2.size() > (i + 1)) { if (items2.size() > i) {
htmlLables.add(new HtmlLable(LABLE_COLUMN, items2.get(i), new HtmlLable.Attributes(ATTRIBUTES_OFFSET, value_offset_last))); htmlLables.add(new HtmlLable(LABLE_COLUMN, items2.get(i), new HtmlLable.Attributes(ATTRIBUTES_OFFSET, value_offset_last)));
} }
htmlLables.add(new HtmlLable(getRowLableEnd())); htmlLables.add(new HtmlLable(getRowLableEnd()));
} }
htmlLables.add(new HtmlLable(LABLE_P, HtmlContract.dividing_line));
return getHtmlLables(htmlLables.toArray(new HtmlLable[htmlLables.size()])); return getHtmlLables(htmlLables.toArray(new HtmlLable[htmlLables.size()]));
} }
...@@ -388,7 +434,7 @@ public class PrintCleanMachine extends PrinterRoot<PrintCleanMachineContent> { ...@@ -388,7 +434,7 @@ public class PrintCleanMachine extends PrinterRoot<PrintCleanMachineContent> {
items.add("讀取人員:" + UserContext.newInstance().getMemberName()); items.add("讀取人員:" + UserContext.newInstance().getMemberName());
items.add(currentDate); items.add(currentDate);
for (int i = 0; i < items.size(); i++) { for (int i = 0; i < items.size(); i++) {
htmlLables.add(new HtmlLable(getRowLableStart())); htmlLables.add(new HtmlLable(getRowLableStart(new HtmlLable.Attributes(ATTRIBUTES_FONT_SIZE, "24"))));
htmlLables.add(new HtmlLable(LABLE_COLUMN, items.get(i))); htmlLables.add(new HtmlLable(LABLE_COLUMN, items.get(i)));
htmlLables.add(new HtmlLable(getRowLableEnd())); htmlLables.add(new HtmlLable(getRowLableEnd()));
} }
......
...@@ -63,13 +63,14 @@ public class PrintOtherOrder extends PrinterRoot<PrintTakeawayFormContent> { ...@@ -63,13 +63,14 @@ public class PrintOtherOrder extends PrinterRoot<PrintTakeawayFormContent> {
String stringBuilder = "<html><body>" + String stringBuilder = "<html><body>" +
getTakewayPrintContent(printTakeawayFormContent,deviceBean) + getTakewayPrintContent(printTakeawayFormContent,deviceBean) +
"</body></html>"; "</body></html>";
String[] pritContent = new String[1]; int printCount = getPrintCount(mContext);
pritContent[0] = stringBuilder; String[] pritContent = new String[printCount];
for (int i = 0; i < printCount; i++) {
pritContent[i] = stringBuilder;
}
return pritContent; return pritContent;
} }
@Override @Override
public int getPrintCount(Context context) { public int getPrintCount(Context context) {
return RestaurantExpandInfoUtils.getValue(ExpandConstant.DeliveryPrintCount,1); return RestaurantExpandInfoUtils.getValue(ExpandConstant.DeliveryPrintCount,1);
......
...@@ -65,8 +65,11 @@ public class PrintOtherOrderClosing extends PrinterRoot<PrintTakeawayCheckoutCon ...@@ -65,8 +65,11 @@ public class PrintOtherOrderClosing extends PrinterRoot<PrintTakeawayCheckoutCon
String stringBuilder = "<html><body>" + String stringBuilder = "<html><body>" +
getTakewayPrintContent(mTakeawayCheckoutContent, deviceBean) + getTakewayPrintContent(mTakeawayCheckoutContent, deviceBean) +
"</body></html>"; "</body></html>";
String[] pritContent = new String[1]; int printCount = getPrintCount(mContext);
pritContent[0] = stringBuilder; String[] pritContent = new String[printCount];
for (int i = 0; i < printCount; i++) {
pritContent[i] = stringBuilder;
}
return pritContent; return pritContent;
} }
......
...@@ -146,7 +146,7 @@ public class PrintPrjKitchen extends PrinterRoot { ...@@ -146,7 +146,7 @@ public class PrintPrjKitchen extends PrinterRoot {
if (RestaurantExpandInfoUtils.getValue(ExpandConstant.PrintFirstOrder, false)) { if (RestaurantExpandInfoUtils.getValue(ExpandConstant.PrintFirstOrder, false)) {
htmlLables.add(new HtmlLable(HtmlContract.LABLE_P, getTableName(prjBean), htmlLables.add(new HtmlLable(HtmlContract.LABLE_P, getTableName(prjBean),
new HtmlLable.Attributes(HtmlContract.ATTRIBUTES_FONT_SIZE, font_size_first_order), new HtmlLable.Attributes(HtmlContract.ATTRIBUTES_FONT_SIZE, font_size_first_order),
new HtmlLable.Attributes(HtmlContract.ATTRIBUTES_ALIGN, HtmlContract.value_align_center))); new HtmlLable.Attributes(HtmlContract.ATTRIBUTES_ALIGN, HtmlContract.value_align_center,HtmlContract.value_type_string)));
} }
//統計打印數 //統計打印數
if (RestaurantExpandInfoUtils.getValue(ExpandConstant.PrintStatisticsAmount, false)) { if (RestaurantExpandInfoUtils.getValue(ExpandConstant.PrintStatisticsAmount, false)) {
...@@ -221,7 +221,7 @@ public class PrintPrjKitchen extends PrinterRoot { ...@@ -221,7 +221,7 @@ public class PrintPrjKitchen extends PrinterRoot {
if (RestaurantExpandInfoUtils.getValue(ExpandConstant.PrintPage, false)) { if (RestaurantExpandInfoUtils.getValue(ExpandConstant.PrintPage, false)) {
htmlLables.add(new HtmlLable(HtmlContract.LABLE_P, prjBean.getCurrentIndex() + "/" + prjBean.getTotalPrj(), htmlLables.add(new HtmlLable(HtmlContract.LABLE_P, prjBean.getCurrentIndex() + "/" + prjBean.getTotalPrj(),
new HtmlLable.Attributes(HtmlContract.ATTRIBUTES_FONT_SIZE, font_size_prj_page_index), new HtmlLable.Attributes(HtmlContract.ATTRIBUTES_FONT_SIZE, font_size_prj_page_index),
new HtmlLable.Attributes(HtmlContract.ATTRIBUTES_ALIGN, HtmlContract.value_align_center))); new HtmlLable.Attributes(HtmlContract.ATTRIBUTES_ALIGN, HtmlContract.value_align_center,HtmlContract.value_type_string)));
} }
return getHtmlLables(htmlLables.toArray(new HtmlLable[htmlLables.size()])); return getHtmlLables(htmlLables.toArray(new HtmlLable[htmlLables.size()]));
} }
......
...@@ -53,8 +53,11 @@ public class PrintQRCode extends PrinterRoot<PrintQRCodeContent> { ...@@ -53,8 +53,11 @@ public class PrintQRCode extends PrinterRoot<PrintQRCodeContent> {
String stringBuilder = "<html><body>" + String stringBuilder = "<html><body>" +
getHtmlContent() + getHtmlContent() +
"</body></html>"; "</body></html>";
String[] pritContent = new String[1]; int printCount = getPrintCount(mContext);
pritContent[0] = stringBuilder; String[] pritContent = new String[printCount];
for (int i = 0; i < printCount; i++) {
pritContent[i] = stringBuilder;
}
return pritContent; return pritContent;
} }
...@@ -62,9 +65,9 @@ public class PrintQRCode extends PrinterRoot<PrintQRCodeContent> { ...@@ -62,9 +65,9 @@ public class PrintQRCode extends PrinterRoot<PrintQRCodeContent> {
List<HtmlLable> htmlLables = new ArrayList<>(); List<HtmlLable> htmlLables = new ArrayList<>();
//頭部 //頭部
htmlLables.add(new HtmlLable(HtmlContract.LABLE_H3,mQRCodeBean.getPrintTableName(), new HtmlLable.Attributes(HtmlContract.ATTRIBUTES_ALIGN, HtmlContract.value_align_center))); htmlLables.add(new HtmlLable(HtmlContract.LABLE_H3,mQRCodeBean.getPrintTableName(), new HtmlLable.Attributes(HtmlContract.ATTRIBUTES_ALIGN, HtmlContract.value_align_center,HtmlContract.value_type_string)));
htmlLables.add(new HtmlLable(HtmlContract.LABLE_P,mQRCodeBean.getPrintTopInfo(), htmlLables.add(new HtmlLable(HtmlContract.LABLE_P,mQRCodeBean.getPrintTopInfo(),
new HtmlLable.Attributes(HtmlContract.ATTRIBUTES_ALIGN, HtmlContract.value_align_center), new HtmlLable.Attributes(HtmlContract.ATTRIBUTES_ALIGN, HtmlContract.value_align_center,HtmlContract.value_type_string),
new HtmlLable.Attributes(HtmlContract.ATTRIBUTES_FONT_SIZE,"25"))); new HtmlLable.Attributes(HtmlContract.ATTRIBUTES_FONT_SIZE,"25")));
//qrcode //qrcode
......
...@@ -5,23 +5,37 @@ import android.graphics.Bitmap; ...@@ -5,23 +5,37 @@ import android.graphics.Bitmap;
import android.view.Gravity; import android.view.Gravity;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import com.gingersoft.gsa.cloud.common.constans.ExpandConstant;
import com.gingersoft.gsa.cloud.common.core.order.commodity.OrderDetail; import com.gingersoft.gsa.cloud.common.core.order.commodity.OrderDetail;
import com.gingersoft.gsa.cloud.common.core.order.order.DoshokuOrder; import com.gingersoft.gsa.cloud.common.core.order.order.DoshokuOrder;
import com.gingersoft.gsa.cloud.common.core.print.bean.PrintServingPaperContent;
import com.gingersoft.gsa.cloud.common.core.restaurant.utils.RestaurantExpandInfoUtils;
import com.gingersoft.gsa.cloud.common.core.table.TableBean; import com.gingersoft.gsa.cloud.common.core.table.TableBean;
import com.gingersoft.gsa.cloud.common.utils.other.TextUtil; import com.gingersoft.gsa.cloud.common.utils.other.TextUtil;
import com.gingersoft.gsa.cloud.common.utils.time.TimeUtils; import com.gingersoft.gsa.cloud.common.utils.time.TimeUtils;
import com.gingersoft.gsa.cloud.database.bean.PrinterDeviceBean; import com.gingersoft.gsa.cloud.database.bean.PrinterDeviceBean;
import com.joe.print.R; import com.joe.print.R;
import com.joe.print.mvp.model.bean.HtmlLable;
import com.joe.print.mvp.print.common.HtmlContract;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import static com.joe.print.mvp.print.common.HtmlContract.LABLE_DIV;
/** /**
* 上菜紙打印 已改新版 * 上菜紙打印 已改新版
*/ */
public class PrintServe extends PrinterRoot { public class PrintServe extends PrinterRoot<PrintServingPaperContent> {
private PrintServingPaperContent mPrintServingPaperContent;
@Override
protected void setPrintContent(PrintServingPaperContent printContent) {
this.mPrintServingPaperContent = printContent;
}
@Override @Override
public Map<String, List<Bitmap>> getPrintBitmap(Context mContext, PrinterDeviceBean printerDeviceBean) { public Map<String, List<Bitmap>> getPrintBitmap(Context mContext, PrinterDeviceBean printerDeviceBean) {
...@@ -35,6 +49,9 @@ public class PrintServe extends PrinterRoot { ...@@ -35,6 +49,9 @@ public class PrintServe extends PrinterRoot {
@Override @Override
public String[] getPrintDatas(Context mContext, PrinterDeviceBean deviceBean) { public String[] getPrintDatas(Context mContext, PrinterDeviceBean deviceBean) {
if(mPrintServingPaperContent == null){
return new String[]{"<html><body></body></html>"};
}
List<OrderDetail> foodList = DoshokuOrder.getInstance().getShoppingCart().getOrderCommodityList(); List<OrderDetail> foodList = DoshokuOrder.getInstance().getShoppingCart().getOrderCommodityList();
TableBean.DataBean tableBean = DoshokuOrder.getInstance().getOpenTableInfo(); TableBean.DataBean tableBean = DoshokuOrder.getInstance().getOpenTableInfo();
...@@ -48,11 +65,51 @@ public class PrintServe extends PrinterRoot { ...@@ -48,11 +65,51 @@ public class PrintServe extends PrinterRoot {
generateHtmlFoodInfoTwoColumns(foodList) + generateHtmlFoodInfoTwoColumns(foodList) +
getWholeLine() + getWholeLine() +
getHtmlFooter() + "</body></html>"; getHtmlFooter() + "</body></html>";
String[] pritContent = new String[1];
pritContent[0] = stringBuilder; int printCount = getPrintCount(mContext);
String[] pritContent = new String[printCount];
for (int i = 0; i < printCount; i++) {
pritContent[i] = stringBuilder;
}
return pritContent; return pritContent;
} }
private String getHtmlContent() {
List<HtmlLable> htmlLables = new ArrayList<>();
/**
* 頭部
*/
htmlLables.add(new HtmlLable(LABLE_DIV, mPrintServingPaperContent.getBrand(),
new HtmlLable.Attributes(HtmlContract.ATTRIBUTES_ALIGN, HtmlContract.value_align_center, HtmlContract.value_type_string),
new HtmlLable.Attributes(HtmlContract.ATTRIBUTES_FONT_SIZE, "28")));
htmlLables.add(new HtmlLable(LABLE_DIV, mPrintServingPaperContent.getResturantName(),
new HtmlLable.Attributes(HtmlContract.ATTRIBUTES_ALIGN, HtmlContract.value_align_center, HtmlContract.value_type_string),
new HtmlLable.Attributes(HtmlContract.ATTRIBUTES_FONT_SIZE, "28")));
/**
* 訂單
*/
/**
* 食品
*/
/**
* 賬單項
*/
/**
* 底部
*/
return getHtmlLables(htmlLables.toArray(new HtmlLable[htmlLables.size()]));
}
@Override @Override
public int getPrintCount(Context context) { public int getPrintCount(Context context) {
return 1; return 1;
......
...@@ -5,6 +5,8 @@ import android.graphics.Bitmap; ...@@ -5,6 +5,8 @@ import android.graphics.Bitmap;
import android.view.Gravity; import android.view.Gravity;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import com.gingersoft.gsa.cloud.common.core.print.bean.PrintSlipContent;
import com.gingersoft.gsa.cloud.common.utils.other.TextUtil;
import com.joe.print.mvp.model.bean.BillingBean; import com.joe.print.mvp.model.bean.BillingBean;
import com.gingersoft.gsa.cloud.common.core.order.billItem.BillItem; import com.gingersoft.gsa.cloud.common.core.order.billItem.BillItem;
import com.gingersoft.gsa.cloud.common.core.order.cart.ShoppingCart; import com.gingersoft.gsa.cloud.common.core.order.cart.ShoppingCart;
...@@ -16,16 +18,29 @@ import com.gingersoft.gsa.cloud.common.utils.time.TimeUtils; ...@@ -16,16 +18,29 @@ import com.gingersoft.gsa.cloud.common.utils.time.TimeUtils;
import com.gingersoft.gsa.cloud.common.constans.ExpandConstant; import com.gingersoft.gsa.cloud.common.constans.ExpandConstant;
import com.gingersoft.gsa.cloud.database.bean.PrinterDeviceBean; import com.gingersoft.gsa.cloud.database.bean.PrinterDeviceBean;
import com.joe.print.R; import com.joe.print.R;
import com.joe.print.mvp.model.bean.HtmlLable;
import com.joe.print.mvp.print.common.HtmlContract;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import static com.joe.print.mvp.print.common.HtmlContract.LABLE_COLUMN;
import static com.joe.print.mvp.print.common.HtmlContract.LABLE_DIV;
import static com.joe.print.mvp.print.common.HtmlContract.LABLE_P;
/** /**
* 印單打印 已改新版 * 印單打印 已改新版
*/ */
public class PrintSlip extends PrinterRoot { public class PrintSlip extends PrinterRoot<PrintSlipContent> {
private PrintSlipContent mPrintSlipContent;
@Override
protected void setPrintContent(PrintSlipContent printContent) {
this.mPrintSlipContent = printContent;
}
@Override @Override
public Map<String, List<Bitmap>> getPrintBitmap(Context mContext, PrinterDeviceBean deviceBean) { public Map<String, List<Bitmap>> getPrintBitmap(Context mContext, PrinterDeviceBean deviceBean) {
...@@ -46,6 +61,11 @@ public class PrintSlip extends PrinterRoot { ...@@ -46,6 +61,11 @@ public class PrintSlip extends PrinterRoot {
@Override @Override
public String[] getPrintDatas(Context mContext, PrinterDeviceBean deviceBean) { public String[] getPrintDatas(Context mContext, PrinterDeviceBean deviceBean) {
if (mPrintSlipContent == null) {
return new String[]{"<html><body></body></html>"};
}
List<OrderDetail> foodList = DoshokuOrder.getInstance().getShoppingCart().getOrderCommodityList(); List<OrderDetail> foodList = DoshokuOrder.getInstance().getShoppingCart().getOrderCommodityList();
TableBean.DataBean tableBean = DoshokuOrder.getInstance().getOpenTableInfo(); TableBean.DataBean tableBean = DoshokuOrder.getInstance().getOpenTableInfo();
...@@ -61,11 +81,58 @@ public class PrintSlip extends PrinterRoot { ...@@ -61,11 +81,58 @@ public class PrintSlip extends PrinterRoot {
getWholeLine() + getWholeLine() +
getHtmlFooter() + "</body></html>"; getHtmlFooter() + "</body></html>";
String[] pritContent = new String[1]; int printCount = getPrintCount(mContext);
pritContent[0] = stringBuilder; String[] pritContent = new String[printCount];
for (int i = 0; i < printCount; i++) {
pritContent[i] = stringBuilder;
}
return pritContent; return pritContent;
} }
private String getHtmlContent() {
List<HtmlLable> htmlLables = new ArrayList<>();
/**
* 頭部
*/
htmlLables.add(new HtmlLable(LABLE_DIV, mPrintSlipContent.getBrand(),
new HtmlLable.Attributes(HtmlContract.ATTRIBUTES_ALIGN, HtmlContract.value_align_center, HtmlContract.value_type_string),
new HtmlLable.Attributes(HtmlContract.ATTRIBUTES_FONT_SIZE, "28")));
htmlLables.add(new HtmlLable(LABLE_DIV, mPrintSlipContent.getResturantName(),
new HtmlLable.Attributes(HtmlContract.ATTRIBUTES_ALIGN, HtmlContract.value_align_center, HtmlContract.value_type_string),
new HtmlLable.Attributes(HtmlContract.ATTRIBUTES_FONT_SIZE, "28")));
/**
* 訂單
*/
String orderNum = "單號:";
if (TextUtil.isNotEmptyOrNullOrUndefined(DoshokuOrder.getInstance().getOrderNo())) {
orderNum = "單號:" + DoshokuOrder.getInstance().getOrderNo();
}
htmlLables.addAll(getRowInformation(new HtmlLable[]{new HtmlLable(LABLE_COLUMN, "餐檯:" + mPrintSlipContent.getTableName())}, 24));
htmlLables.addAll(getRowInformation(new HtmlLable[]{new HtmlLable(LABLE_COLUMN, "人數:" + mPrintSlipContent.getPerson())}, 24));
htmlLables.addAll(getRowInformation(new HtmlLable[]{new HtmlLable(LABLE_COLUMN, orderNum)}, 24));
htmlLables.addAll(getRowInformation(new HtmlLable[]{new HtmlLable(LABLE_COLUMN, "日期:" + TimeUtils.parseTimeRepeat(mPrintSlipContent.getCreateTime(), TimeUtils.DEFAULT_DATE_FORMAT))}, 24));
htmlLables.add(new HtmlLable(LABLE_P, HtmlContract.dividing_line));
/**
* 食品
*/
/**
* 賬單項
*/
/**
* 底部
*/
return getHtmlLables(htmlLables.toArray(new HtmlLable[htmlLables.size()]));
}
private String getPLable(String content) { private String getPLable(String content) {
return "<p>" + content + "</p>"; return "<p>" + content + "</p>";
} }
...@@ -95,7 +162,7 @@ public class PrintSlip extends PrinterRoot { ...@@ -95,7 +162,7 @@ public class PrintSlip extends PrinterRoot {
layout.addView(getLine(mContext)); layout.addView(getLine(mContext));
//訂單信息 //訂單信息
layout.addView(getDiningTableOrderInfo(mContext, "餐檯:" + tableBean.getTableName(), "人數:" + doshokuOrder.getOpenTableInfo().getPerson(), "單號:" +doshokuOrder.getOrderNo(), "日期:" + TimeUtils.getCurrentTimeInString(TimeUtils.DEFAULT_DATE_FORMAT))); layout.addView(getDiningTableOrderInfo(mContext, "餐檯:" + tableBean.getTableName(), "人數:" + doshokuOrder.getOpenTableInfo().getPerson(), "單號:" + doshokuOrder.getOrderNo(), "日期:" + TimeUtils.getCurrentTimeInString(TimeUtils.DEFAULT_DATE_FORMAT)));
layout.addView(getLine(mContext)); layout.addView(getLine(mContext));
layout.addView(getDiningFoodList(mContext, foodList, printerDeviceBean, 0, true)); layout.addView(getDiningFoodList(mContext, foodList, printerDeviceBean, 0, true));
......
...@@ -16,13 +16,16 @@ import android.view.ViewGroup; ...@@ -16,13 +16,16 @@ import android.view.ViewGroup;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.TextView; import android.widget.TextView;
import androidx.annotation.ColorRes; import androidx.annotation.ColorRes;
import androidx.core.content.ContextCompat; import androidx.core.content.ContextCompat;
import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import com.epson.epos2.printer.Printer; import com.epson.epos2.printer.Printer;
import com.epson.epos2.printer.PrinterStatusInfo; import com.epson.epos2.printer.PrinterStatusInfo;
import com.epson.epos2.printer.ReceiveListener; import com.epson.epos2.printer.ReceiveListener;
import com.gingersoft.gsa.cloud.common.constans.AppConstans;
import com.gingersoft.gsa.cloud.common.core.restaurant.ResturantInfoManager; import com.gingersoft.gsa.cloud.common.core.restaurant.ResturantInfoManager;
import com.joe.print.mvp.ui.adapter.BillAdapter; import com.joe.print.mvp.ui.adapter.BillAdapter;
import com.joe.print.mvp.ui.adapter.BillTypeAdapter; import com.joe.print.mvp.ui.adapter.BillTypeAdapter;
...@@ -73,15 +76,21 @@ import com.joe.print.mvp.print.usb.UsbPrinterFinder; ...@@ -73,15 +76,21 @@ import com.joe.print.mvp.print.usb.UsbPrinterFinder;
import com.joe.print.mvp.print.utils.BBposPrint; import com.joe.print.mvp.print.utils.BBposPrint;
import com.joe.print.mvp.ui.adapter.BillItemAdapter; import com.joe.print.mvp.ui.adapter.BillItemAdapter;
import com.sunmi.peripheral.printer.InnerResultCallbcak; import com.sunmi.peripheral.printer.InnerResultCallbcak;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Objects; import java.util.Objects;
import javax.inject.Inject; import javax.inject.Inject;
import lombok.Getter; import lombok.Getter;
import static com.joe.print.mvp.print.common.HtmlContract.LABLE_COLUMN;
import static com.joe.print.mvp.print.common.HtmlContract.LABLE_DIV;
import static com.joe.print.mvp.print.common.HtmlContract.LABLE_H2;
import static com.joe.print.mvp.print.common.HtmlContract.LABLE_H3; import static com.joe.print.mvp.print.common.HtmlContract.LABLE_H3;
import static com.joe.print.mvp.print.common.HtmlContract.LABLE_P; import static com.joe.print.mvp.print.common.HtmlContract.LABLE_P;
...@@ -168,6 +177,7 @@ public abstract class PrinterRoot<T extends PrintContent> implements PrintSocket ...@@ -168,6 +177,7 @@ public abstract class PrinterRoot<T extends PrintContent> implements PrintSocket
return null; return null;
} }
Map<String, List<Bitmap>> printBitmap = getPrintBitmap(mContext, deviceBean); Map<String, List<Bitmap>> printBitmap = getPrintBitmap(mContext, deviceBean);
if (printBitmap != null) {
List<Bitmap> bitmapList = printBitmap.get(""); List<Bitmap> bitmapList = printBitmap.get("");
//根據打印次數,複製 //根據打印次數,複製
if (bitmapList != null) { if (bitmapList != null) {
...@@ -181,6 +191,8 @@ public abstract class PrinterRoot<T extends PrintContent> implements PrintSocket ...@@ -181,6 +191,8 @@ public abstract class PrinterRoot<T extends PrintContent> implements PrintSocket
} }
return printBitmap; return printBitmap;
} }
return null;
}
/** /**
* @param mContext * @param mContext
...@@ -1001,79 +1013,115 @@ public abstract class PrinterRoot<T extends PrintContent> implements PrintSocket ...@@ -1001,79 +1013,115 @@ public abstract class PrinterRoot<T extends PrintContent> implements PrintSocket
/** /**
* 頭部 * 頭部
*/ */
htmlLables.addAll(getRowInformation(new HtmlLable(printContent.getBrand(), new HtmlLable.Attributes(HtmlContract.ATTRIBUTES_ALIGN, HtmlContract.value_align_center)))); htmlLables.add(new HtmlLable(LABLE_DIV, printContent.getBrand(),
htmlLables.addAll(getRowInformation(new HtmlLable(printContent.getResturantName(), new HtmlLable.Attributes(HtmlContract.ATTRIBUTES_ALIGN, HtmlContract.value_align_center)))); new HtmlLable.Attributes(HtmlContract.ATTRIBUTES_ALIGN, HtmlContract.value_align_center, HtmlContract.value_type_string),
htmlLables.add(new HtmlLable(LABLE_P, HtmlContract.dividing_line_half + "外送" + HtmlContract.dividing_line_half)); new HtmlLable.Attributes(HtmlContract.ATTRIBUTES_FONT_SIZE, "28")));
htmlLables.add(new HtmlLable(LABLE_H3, printContent.getPayType(), new HtmlLable.Attributes(HtmlContract.ATTRIBUTES_ALIGN, HtmlContract.value_align_center))); htmlLables.add(new HtmlLable(LABLE_DIV, printContent.getResturantName(),
htmlLables.add(new HtmlLable(LABLE_H3, printContent.getDeliveryTime())); new HtmlLable.Attributes(HtmlContract.ATTRIBUTES_ALIGN, HtmlContract.value_align_center, HtmlContract.value_type_string),
new HtmlLable.Attributes(HtmlContract.ATTRIBUTES_FONT_SIZE, "28")));
htmlLables.add(new HtmlLable(LABLE_DIV, HtmlContract.dividing_line_half + printContent.getOrderType() + HtmlContract.dividing_line_half, new HtmlLable.Attributes(HtmlContract.ATTRIBUTES_FONT_SIZE, "28")));
htmlLables.add(new HtmlLable(LABLE_DIV, printContent.getPayType(),
new HtmlLable.Attributes(HtmlContract.ATTRIBUTES_ALIGN, HtmlContract.value_align_center, HtmlContract.value_type_string),
new HtmlLable.Attributes(HtmlContract.ATTRIBUTES_FONT_SIZE, "35")));
// htmlLables.addAll(getRowInformation(new HtmlLable[]{new HtmlLable(LABLE_COLUMN, printContent.getDeliveryTime())}, 28));
htmlLables.add(new HtmlLable(LABLE_DIV, printContent.getDeliveryTime(), new HtmlLable.Attributes(HtmlContract.ATTRIBUTES_FONT_SIZE, "26")));
/** /**
* 訂單信息 * 訂單信息
*/ */
htmlLables.add(new HtmlLable(LABLE_P, HtmlContract.dividing_line)); // htmlLables.add(new HtmlLable(LABLE_DIV, HtmlContract.dividing_line));
htmlLables.addAll(getRowInformation(new HtmlLable(printContent.getOrderNumber()))); if (!TextUtils.isEmpty(printContent.getOrderNo())) {
htmlLables.add(new HtmlLable(LABLE_H3, printContent.getBillNumber())); htmlLables.addAll(getRowInformation(new HtmlLable[]{new HtmlLable(LABLE_COLUMN, printContent.getOrderNo())}, 26));
htmlLables.addAll(getRowInformation(new HtmlLable(printContent.getBillingTime()))); }
if (!TextUtils.isEmpty(printContent.getBillNo())) {
htmlLables.addAll(getRowInformation(new HtmlLable[]{new HtmlLable(LABLE_COLUMN, printContent.getBillNo())}, 26));
}
if (!TextUtils.isEmpty(printContent.getOrderTakeFoodCode())) {
htmlLables.addAll(getRowInformation(new HtmlLable[]{new HtmlLable(LABLE_COLUMN, printContent.getOrderTakeFoodCode())}, 48));
}
if (!TextUtils.isEmpty(printContent.getBillingTime())) {
htmlLables.addAll(getRowInformation(new HtmlLable[]{new HtmlLable(LABLE_COLUMN, printContent.getBillingTime())}, 24));
}
if (!TextUtil.isEmptyOrNullOrUndefined(printContent.getPayTime())) {
//支付時間
htmlLables.addAll(getRowInformation(new HtmlLable[]{new HtmlLable(LABLE_COLUMN, printContent.getPayTime())}, 24));
}
/** /**
* 食品信息 * 食品信息
*/ */
htmlLables.add(new HtmlLable(LABLE_P, HtmlContract.dividing_line_half + "項目" + HtmlContract.dividing_line_half, new HtmlLable.Attributes(HtmlContract.ATTRIBUTES_FONT_SIZE, "28")));
htmlLables.addAll(getBBPosFoodLineString(printContent.getFoodItemList(), deviceBean)); htmlLables.addAll(getBBPosFoodLineString(printContent.getFoodItemList(), deviceBean));
htmlLables.add(new HtmlLable(LABLE_P, HtmlContract.dividing_line));
/** /**
* 總金額,支付信息 * 總金額,支付信息
*/ */
//賬單項(合計,送貨費) //賬單項(合計,送貨費)
List<PrintBillItem> billItemList = printContent.getBillItemList(); List<PrintBillItem> billItemList = printContent.getBillItemList();
if (billItemList.size() > 0) {
for (PrintBillItem billItem : billItemList) { for (PrintBillItem billItem : billItemList) {
htmlLables.addAll(getRowInformation( htmlLables.addAll(getRowInformation(new HtmlLable[]{
new HtmlLable(billItem.getBillName()), new HtmlLable(LABLE_COLUMN, billItem.getBillName()),
new HtmlLable(billItem.getBillAmount(), new HtmlLable.Attributes(HtmlContract.ATTRIBUTES_OFFSET, HtmlContract.value_offset_last)))); new HtmlLable(LABLE_COLUMN, billItem.getBillAmount(), new HtmlLable.Attributes(HtmlContract.ATTRIBUTES_OFFSET, HtmlContract.value_offset_last))}, 28));
} }
htmlLables.add(new HtmlLable(LABLE_P, HtmlContract.dividing_line)); htmlLables.add(new HtmlLable(LABLE_P, HtmlContract.dividing_line));
}
//總金額 //總金額
htmlLables.addAll(getRowInformation( htmlLables.addAll(getRowInformation(new HtmlLable[]{
new HtmlLable(printContent.getTotalAmountText(), new HtmlLable.Attributes(HtmlContract.ATTRIBUTES_FONT_SIZE, font_size_total_amount)), new HtmlLable(LABLE_COLUMN, printContent.getTotalAmountText()),
new HtmlLable(printContent.getTotalAmount(), new HtmlLable.Attributes(HtmlContract.ATTRIBUTES_OFFSET, HtmlContract.value_offset_last), new HtmlLable.Attributes(HtmlContract.ATTRIBUTES_FONT_SIZE, font_size_total_amount)))); new HtmlLable(LABLE_COLUMN, printContent.getTotalAmount(), new HtmlLable.Attributes(HtmlContract.ATTRIBUTES_OFFSET, HtmlContract.value_offset_last))}, 35));
htmlLables.add(new HtmlLable(LABLE_P, HtmlContract.dividing_line)); htmlLables.add(new HtmlLable(LABLE_P, HtmlContract.dividing_line));
if (printContent instanceof PrintTakeawayCheckoutContent) { if (printContent instanceof PrintTakeawayCheckoutContent) {
//TODO 外送結賬有支付方式 //TODO 外送結賬有支付方式
PrintTakeawayCheckoutContent takeawayCheckoutContent = (PrintTakeawayCheckoutContent) printContent; PrintTakeawayCheckoutContent takeawayCheckoutContent = (PrintTakeawayCheckoutContent) printContent;
//支付方式 //支付方式
List<PrintPayTypeItem> payTypeList = takeawayCheckoutContent.getPayTypeList(); List<PrintPayTypeItem> payTypeList = takeawayCheckoutContent.getPayTypeList();
if (payTypeList != null) {
for (PrintPayTypeItem payTypeItem : payTypeList) { for (PrintPayTypeItem payTypeItem : payTypeList) {
htmlLables.addAll(getRowInformation( if (!TextUtils.isEmpty(payTypeItem.getPayAmount())) {
new HtmlLable(payTypeItem.getPayName(), new HtmlLable.Attributes(HtmlContract.ATTRIBUTES_FONT_SIZE, font_size_pay_type)), htmlLables.addAll(getRowInformation(new HtmlLable[]{
new HtmlLable(payTypeItem.getPayAmount(), new HtmlLable.Attributes(HtmlContract.ATTRIBUTES_OFFSET, HtmlContract.value_offset_last), new HtmlLable.Attributes(HtmlContract.ATTRIBUTES_FONT_SIZE, font_size_pay_type)))); new HtmlLable(LABLE_COLUMN, payTypeItem.getPayName()),
new HtmlLable(LABLE_COLUMN, payTypeItem.getPayAmount(), new HtmlLable.Attributes(HtmlContract.ATTRIBUTES_OFFSET, HtmlContract.value_offset_last))}, 30));
}
}
} }
htmlLables.add(new HtmlLable(LABLE_P, HtmlContract.dividing_line)); htmlLables.add(new HtmlLable(LABLE_P, HtmlContract.dividing_line));
} }
//支付金額 //支付金額
htmlLables.addAll(getRowInformation( htmlLables.addAll(getRowInformation(new HtmlLable[]{
new HtmlLable(printContent.getPayAmountText(), new HtmlLable.Attributes(HtmlContract.ATTRIBUTES_FONT_SIZE, font_size_pay_amuount)), new HtmlLable(LABLE_COLUMN, printContent.getPayAmountText()),
new HtmlLable(printContent.getPayAmount(), new HtmlLable.Attributes(HtmlContract.ATTRIBUTES_OFFSET, HtmlContract.value_offset_last), new HtmlLable.Attributes(HtmlContract.ATTRIBUTES_FONT_SIZE, font_size_pay_amuount)))); new HtmlLable(LABLE_COLUMN, printContent.getPayAmount(), new HtmlLable.Attributes(HtmlContract.ATTRIBUTES_OFFSET, HtmlContract.value_offset_last))}, 35));
htmlLables.add(new HtmlLable(LABLE_P, HtmlContract.dividing_line)); htmlLables.add(new HtmlLable(LABLE_P, HtmlContract.dividing_line));
/** /**
* 會員積分 * 會員積分、配送信息
*/ */
htmlLables.addAll(getRowInformation(new HtmlLable(printContent.getMemberName()))); List<String> items = new ArrayList<>();
htmlLables.addAll(getRowInformation(new HtmlLable(printContent.getMemberNumber()))); if (RestaurantExpandInfoUtils.getValue(ExpandConstant.PrintMemberInfo, false)) {
htmlLables.addAll(getRowInformation(new HtmlLable(printContent.getMemberPhone()))); items.add(printContent.getMemberName());
htmlLables.addAll(getRowInformation(new HtmlLable(printContent.getMemberOldPoints()))); items.add(printContent.getMemberNumber());
htmlLables.addAll(getRowInformation(new HtmlLable(printContent.getMemberAddPoints()))); items.add(printContent.getMemberPhone());
htmlLables.addAll(getRowInformation(new HtmlLable(printContent.getMemberNowPoints()))); items.add(printContent.getMemberOldPoints());
items.add(printContent.getMemberAddPoints());
/** items.add(printContent.getMemberNowPoints());
* 配送信息 items.add(HtmlContract.dividing_line);
*/ }
htmlLables.addAll(getRowInformation(new HtmlLable(printContent.getAdress()))); if (!TextUtils.isEmpty(printContent.getAdress())) {
htmlLables.addAll(getRowInformation(new HtmlLable(printContent.getReceiver()))); items.add("地址: " + printContent.getAdress());
htmlLables.addAll(getRowInformation(new HtmlLable(printContent.getPhone()))); }
if (!TextUtils.isEmpty(printContent.getReceiver())) {
return getHtmlLables((HtmlLable[]) htmlLables.toArray()); items.add(printContent.getReceiver());
}
items.add(printContent.getPhone());
for (String item : items) {
if (!TextUtils.isEmpty(item)) {
// htmlLables.addAll(getRowInformation(new HtmlLable[]{new HtmlLable(LABLE_COLUMN, item)}, 22));
htmlLables.add(new HtmlLable(LABLE_DIV, item, new HtmlLable.Attributes(HtmlContract.ATTRIBUTES_FONT_SIZE, "24")));
}
}
return getHtmlLables(htmlLables.toArray(new HtmlLable[htmlLables.size()]));
} }
...@@ -1086,6 +1134,11 @@ public abstract class PrinterRoot<T extends PrintContent> implements PrintSocket ...@@ -1086,6 +1134,11 @@ public abstract class PrinterRoot<T extends PrintContent> implements PrintSocket
protected List<HtmlLable> getBBPosFoodLineString(List<PrintFoodItem> foodItemList, PrinterDeviceBean printerDeviceBean) { protected List<HtmlLable> getBBPosFoodLineString(List<PrintFoodItem> foodItemList, PrinterDeviceBean printerDeviceBean) {
int foodFontSize = 24; int foodFontSize = 24;
int modifierFontSize = 24; int modifierFontSize = 24;
/**
* 0預設
* 1是
* 2否
*/
int foodIsBold = printerDeviceBean.getFoodIsBold(); int foodIsBold = printerDeviceBean.getFoodIsBold();
int modifierIsBold = printerDeviceBean.getModifierIsBold(); int modifierIsBold = printerDeviceBean.getModifierIsBold();
int foodIsItalic = printerDeviceBean.getFoodIsItalic(); int foodIsItalic = printerDeviceBean.getFoodIsItalic();
...@@ -1116,12 +1169,27 @@ public abstract class PrinterRoot<T extends PrintContent> implements PrintSocket ...@@ -1116,12 +1169,27 @@ public abstract class PrinterRoot<T extends PrintContent> implements PrintSocket
String name = nameList.get(i); String name = nameList.get(i);
int num = 0; int num = 0;
double price = -9999; double price = -9999;
if (numList.size() > (i + 1)) { int fontSize = 24;
boolean isBold = false;
boolean isItalic = false;
if (numList.size() > i) {
num = numList.get(i); num = numList.get(i);
} }
if (priceList.size() > (i + 1)) { if (priceList.size() > i) {
price = priceList.get(i); price = priceList.get(i);
} }
if (itemTypes.size() > i) {
int itemType = itemTypes.get(i);
if (itemType == 3) {
fontSize = modifierFontSize;
isBold = modifierIsBold == 1 ? true : false;
isItalic = modifierIsItalic == 1 ? true : false;
} else {
fontSize = foodFontSize;
isBold = foodIsBold == 1 ? true : false;
isItalic = foodIsItalic == 1 ? true : false;
}
}
List<String> name1s = PrintUtils.getFormatList(name, PrintUtils.foodNameSpace, PrintUtils.BBPOS_Chinese_Length); List<String> name1s = PrintUtils.getFormatList(name, PrintUtils.foodNameSpace, PrintUtils.BBPOS_Chinese_Length);
if (name1s.size() > 1) { if (name1s.size() > 1) {
//食品名需要獨佔一行,甚至換行顯示 //食品名需要獨佔一行,甚至換行顯示
...@@ -1130,16 +1198,16 @@ public abstract class PrinterRoot<T extends PrintContent> implements PrintSocket ...@@ -1130,16 +1198,16 @@ public abstract class PrinterRoot<T extends PrintContent> implements PrintSocket
if (lines > 1) { if (lines > 1) {
//大於一行 //大於一行
for (int j = 0; j < lines; j++) { for (int j = 0; j < lines; j++) {
htmlLables.addAll(getRowFoodInformation(name)); htmlLables.addAll(getRowFoodInformation(name, fontSize, isBold, isItalic));
} }
htmlLables.addAll(getRowFoodInformation(num, price)); htmlLables.addAll(getRowFoodInformation(num, price, fontSize, isBold, isItalic));
} else { } else {
//一行 //一行
htmlLables.addAll(getRowFoodInformation(name)); htmlLables.addAll(getRowFoodInformation(name, fontSize, isBold, isItalic));
htmlLables.addAll(getRowFoodInformation(num, price)); htmlLables.addAll(getRowFoodInformation(num, price, fontSize, isBold, isItalic));
} }
} else { } else {
htmlLables.addAll(getRowFoodInformation(name, num, price)); htmlLables.addAll(getRowFoodInformation(name, num, price, fontSize, isBold, isItalic));
} }
} }
return htmlLables; return htmlLables;
...@@ -1148,6 +1216,9 @@ public abstract class PrinterRoot<T extends PrintContent> implements PrintSocket ...@@ -1148,6 +1216,9 @@ public abstract class PrinterRoot<T extends PrintContent> implements PrintSocket
protected String getHtmlLables(HtmlLable... lables) { protected String getHtmlLables(HtmlLable... lables) {
StringBuilder stringBuilder = new StringBuilder(); StringBuilder stringBuilder = new StringBuilder();
for (HtmlLable lable : lables) { for (HtmlLable lable : lables) {
if (TextUtils.isEmpty(lable.getLablename()) || (!lable.getLablename().contains("row") && TextUtils.isEmpty(lable.getValue()))) {
continue;
}
if (lable.getLablename().contains("row") || lable.getLablename().contains("br")) { if (lable.getLablename().contains("row") || lable.getLablename().contains("br")) {
//<row>,<br>標籤直接追加即可 //<row>,<br>標籤直接追加即可
stringBuilder.append(lable.getLablename()); stringBuilder.append(lable.getLablename());
...@@ -1172,45 +1243,49 @@ public abstract class PrinterRoot<T extends PrintContent> implements PrintSocket ...@@ -1172,45 +1243,49 @@ public abstract class PrinterRoot<T extends PrintContent> implements PrintSocket
if (attributes.getValueType() == HtmlContract.value_type_string) { if (attributes.getValueType() == HtmlContract.value_type_string) {
stringBuilder.append("\"" + attributes.getAttributesVaule() + "\""); stringBuilder.append("\"" + attributes.getAttributesVaule() + "\"");
} else { } else {
if (StringUtils.isNumeric(attributesVaule)) { // if (StringUtils.isNumeric(attributesVaule)) {
stringBuilder.append(attributes.getAttributesVaule()); stringBuilder.append(attributes.getAttributesVaule());
} else { // } else {
stringBuilder.append("\"" + attributes.getAttributesVaule() + "\""); // stringBuilder.append("\"" + attributes.getAttributesVaule() + "\"");
} // }
} }
} }
return stringBuilder.toString(); return stringBuilder.toString();
} }
/** /**
* 獲取一行信息,多個column * 獲取一行信息,多個column 可配置字體大小
* *
* @param lables * @param lables
* @param fontSize
* @return * @return
*/ */
protected List<HtmlLable> getRowInformation(HtmlLable... lables) { protected List<HtmlLable> getRowInformation(HtmlLable[] lables, int fontSize) {
List<HtmlLable> htmlLables = new ArrayList<>(); List<HtmlLable> htmlLables = new ArrayList<>();
htmlLables.add(new HtmlLable(getRowLableStart())); htmlLables.add(new HtmlLable(getRowLableStart(new HtmlLable.Attributes(HtmlContract.ATTRIBUTES_FONT_SIZE, String.valueOf(fontSize)))));
if (lables != null) { if (lables != null) {
for (HtmlLable lable : lables) { for (HtmlLable lable : lables) {
htmlLables.add(new HtmlLable(HtmlContract.LABLE_COLUMN, lable.getValue(), lable.getAttributesList())); htmlLables.add(new HtmlLable(LABLE_COLUMN, lable.getValue(), lable.getAttributesList()));
} }
} }
htmlLables.add(new HtmlLable(getRowLableEnd())); htmlLables.add(new HtmlLable(getRowLableEnd()));
return htmlLables; return htmlLables;
} }
/** /**
* 獲取一行食品信息(食品名稱) * 獲取一行食品信息(食品名稱)
* *
* @param name * @param name
* @return * @return
*/ */
private List<HtmlLable> getRowFoodInformation(String name) { private List<HtmlLable> getRowFoodInformation(String name, int fontSize, boolean isBold, boolean isItalic) {
List<HtmlLable> htmlLables = new ArrayList<>(); List<HtmlLable> htmlLables = new ArrayList<>();
htmlLables.add(new HtmlLable(getRowLableStart())); htmlLables.add(new HtmlLable(getRowLableStart(new HtmlLable.Attributes(HtmlContract.ATTRIBUTES_FONT_SIZE, String.valueOf(fontSize)))));
htmlLables.add(new HtmlLable(HtmlContract.LABLE_COLUMN, name)); if (isBold) {
htmlLables.add(new HtmlLable(LABLE_COLUMN, name, new HtmlLable.Attributes(HtmlContract.ATTRIBUTES_BOLD, HtmlContract.value_bold_1)));
} else {
htmlLables.add(new HtmlLable(LABLE_COLUMN, name));
}
htmlLables.add(new HtmlLable(getRowLableEnd())); htmlLables.add(new HtmlLable(getRowLableEnd()));
return htmlLables; return htmlLables;
} }
...@@ -1222,12 +1297,25 @@ public abstract class PrinterRoot<T extends PrintContent> implements PrintSocket ...@@ -1222,12 +1297,25 @@ public abstract class PrinterRoot<T extends PrintContent> implements PrintSocket
* @param amount * @param amount
* @return * @return
*/ */
private List<HtmlLable> getRowFoodInformation(int num, double amount) { private List<HtmlLable> getRowFoodInformation(int num, double amount, int fontSize, boolean isBold, boolean isItalic) {
List<HtmlLable> htmlLables = new ArrayList<>(); List<HtmlLable> htmlLables = new ArrayList<>();
htmlLables.add(new HtmlLable(getRowLableStart())); htmlLables.add(new HtmlLable(getRowLableStart(new HtmlLable.Attributes(HtmlContract.ATTRIBUTES_FONT_SIZE, String.valueOf(fontSize)))));
htmlLables.add(new HtmlLable(HtmlContract.LABLE_COLUMN, String.valueOf(num), new HtmlLable.Attributes(HtmlContract.ATTRIBUTES_OFFSET, HtmlContract.value_offset_percentage_foodNum))); if (isBold) {
htmlLables.add(new HtmlLable(LABLE_COLUMN, String.valueOf(num),
new HtmlLable.Attributes(HtmlContract.ATTRIBUTES_BOLD, HtmlContract.value_bold_1),
new HtmlLable.Attributes(HtmlContract.ATTRIBUTES_OFFSET, HtmlContract.value_offset_percentage_foodNum)));
} else {
htmlLables.add(new HtmlLable(LABLE_COLUMN, String.valueOf(num),
new HtmlLable.Attributes(HtmlContract.ATTRIBUTES_OFFSET, HtmlContract.value_offset_percentage_foodNum)));
}
if (amount != -9999) { if (amount != -9999) {
htmlLables.add(new HtmlLable(HtmlContract.LABLE_COLUMN, String.valueOf(amount), new HtmlLable.Attributes(HtmlContract.ATTRIBUTES_OFFSET, HtmlContract.value_offset_last))); if (isBold) {
htmlLables.add(new HtmlLable(LABLE_COLUMN, AppConstans.CARSH_STR + amount,
new HtmlLable.Attributes(HtmlContract.ATTRIBUTES_BOLD, HtmlContract.value_bold_1),
new HtmlLable.Attributes(HtmlContract.ATTRIBUTES_OFFSET, HtmlContract.value_offset_last)));
} else {
htmlLables.add(new HtmlLable(LABLE_COLUMN, AppConstans.CARSH_STR + amount, new HtmlLable.Attributes(HtmlContract.ATTRIBUTES_OFFSET, HtmlContract.value_offset_last)));
}
} }
htmlLables.add(new HtmlLable(getRowLableEnd())); htmlLables.add(new HtmlLable(getRowLableEnd()));
return htmlLables; return htmlLables;
...@@ -1241,13 +1329,30 @@ public abstract class PrinterRoot<T extends PrintContent> implements PrintSocket ...@@ -1241,13 +1329,30 @@ public abstract class PrinterRoot<T extends PrintContent> implements PrintSocket
* @param amount * @param amount
* @return * @return
*/ */
private List<HtmlLable> getRowFoodInformation(String name, int num, double amount) { private List<HtmlLable> getRowFoodInformation(String name, int num, double amount, int fontSize, boolean isBold, boolean isItalic) {
List<HtmlLable> htmlLables = new ArrayList<>(); List<HtmlLable> htmlLables = new ArrayList<>();
htmlLables.add(new HtmlLable(getRowLableStart())); htmlLables.add(new HtmlLable(getRowLableStart(new HtmlLable.Attributes(HtmlContract.ATTRIBUTES_FONT_SIZE, String.valueOf(fontSize)))));
htmlLables.add(new HtmlLable(HtmlContract.LABLE_COLUMN, name)); if (isBold) {
htmlLables.add(new HtmlLable(HtmlContract.LABLE_COLUMN, String.valueOf(num), new HtmlLable.Attributes(HtmlContract.ATTRIBUTES_OFFSET, HtmlContract.value_offset_percentage_foodNum))); htmlLables.add(new HtmlLable(LABLE_COLUMN, name,
new HtmlLable.Attributes(HtmlContract.ATTRIBUTES_BOLD, HtmlContract.value_bold_1)));
} else {
htmlLables.add(new HtmlLable(LABLE_COLUMN, name));
}
if (isBold) {
htmlLables.add(new HtmlLable(LABLE_COLUMN, String.valueOf(num),
new HtmlLable.Attributes(HtmlContract.ATTRIBUTES_BOLD, HtmlContract.value_bold_1),
new HtmlLable.Attributes(HtmlContract.ATTRIBUTES_OFFSET, HtmlContract.value_offset_percentage_foodNum)));
} else {
htmlLables.add(new HtmlLable(LABLE_COLUMN, String.valueOf(num), new HtmlLable.Attributes(HtmlContract.ATTRIBUTES_OFFSET, HtmlContract.value_offset_percentage_foodNum)));
}
if (amount != -9999) { if (amount != -9999) {
htmlLables.add(new HtmlLable(HtmlContract.LABLE_COLUMN, String.valueOf(amount), new HtmlLable.Attributes(HtmlContract.ATTRIBUTES_OFFSET, HtmlContract.value_offset_last))); if (isBold) {
htmlLables.add(new HtmlLable(LABLE_COLUMN, AppConstans.CARSH_STR + amount,
new HtmlLable.Attributes(HtmlContract.ATTRIBUTES_BOLD, HtmlContract.value_bold_1),
new HtmlLable.Attributes(HtmlContract.ATTRIBUTES_OFFSET, HtmlContract.value_offset_last)));
} else {
htmlLables.add(new HtmlLable(LABLE_COLUMN, AppConstans.CARSH_STR + amount, new HtmlLable.Attributes(HtmlContract.ATTRIBUTES_OFFSET, HtmlContract.value_offset_last)));
}
} }
htmlLables.add(new HtmlLable(getRowLableEnd())); htmlLables.add(new HtmlLable(getRowLableEnd()));
return htmlLables; return htmlLables;
......
...@@ -23,11 +23,13 @@ public class HtmlContract { ...@@ -23,11 +23,13 @@ public class HtmlContract {
public static final String ATTRIBUTES_ALIGN = "align"; public static final String ATTRIBUTES_ALIGN = "align";
public static final String ATTRIBUTES_BOLD = "bold"; public static final String ATTRIBUTES_BOLD = "bold";
public static final String ATTRIBUTES_SCALE = "scale"; public static final String ATTRIBUTES_SCALE = "scale";
public static final String ATTRIBUTES_FONT_SIZE = "font-size"; public static final String ATTRIBUTES_FONT_SIZE = "size";
public static final String value_offset_last = "last"; public static final String value_offset_last = "last";
public static final String value_offset_percentage70 = "0.7"; public static final String value_offset_percentage70 = "0.7";
public static final String value_offset_percentage60 = "0.6"; public static final String value_offset_percentage60 = "0.6";
public static final String value_offset_percentage65 = "0.65";
public static final String value_offset_percentage50 = "0.5"; public static final String value_offset_percentage50 = "0.5";
public static final String value_offset_percentage40 = "0.4"; public static final String value_offset_percentage40 = "0.4";
public static final String value_offset_percentage30 = "0.3"; public static final String value_offset_percentage30 = "0.3";
...@@ -36,15 +38,14 @@ public class HtmlContract { ...@@ -36,15 +38,14 @@ public class HtmlContract {
public static final String value_offset_percentage_foodNum = "0.6"; public static final String value_offset_percentage_foodNum = "0.6";
public static final String value_bold_1 = "1";
public static final String value_scale_1 = "2"; public static final String value_scale_1 = "2";
public static final String value_align_center = "center"; public static final String value_align_center = "center";
public static final String value_align_right = "right"; public static final String value_align_right = "right";
public static final byte value_type_default = 0; public static final byte value_type_default = 0;
public static final byte value_type_string = 1; public static final byte value_type_string = 1;
public static final String dividing_line="-----------------------------------------------------------------"; public static final String dividing_line="-----------------------------------------------------------------";
public static final String dividing_line_half="---------------------------------"; public static final String dividing_line_half="------------------";
} }
...@@ -138,7 +138,7 @@ public class TablePresenter extends BasePresenter<TableContract.Model, TableCont ...@@ -138,7 +138,7 @@ public class TablePresenter extends BasePresenter<TableContract.Model, TableCont
public TablePresenter(TableContract.Model model, TableContract.View rootView) { public TablePresenter(TableContract.Model model, TableContract.View rootView) {
super(model, rootView); super(model, rootView);
this.IActivity = (TableActivity) rootView; this.IActivity = (TableActivity) rootView;
XFunctionManager.newInstance().inJect(this, FunctionTable.class); XFunctionManager.inJect(this, FunctionTable.class);
startTablePolling(); startTablePolling();
} }
......
...@@ -344,7 +344,8 @@ public class MealStandActivity extends BaseFragmentActivity<MealStandPresenter> ...@@ -344,7 +344,8 @@ public class MealStandActivity extends BaseFragmentActivity<MealStandPresenter>
DoshokuOrder.getInstance().setOpenTableInfo(tableBean); DoshokuOrder.getInstance().setOpenTableInfo(tableBean);
btn_send_order.setText("送單信息"); btn_send_order.setText("送單信息");
} else { } else {
if (DoshokuOrder.getInstance().getOpenTableInfo().getPerson() == 0) { boolean openTableAutoShowKeyboard = GsaCloudApplication.functionConfiguration.getOpenTableAutoShowKeyboardVaule();
if (openTableAutoShowKeyboard && DoshokuOrder.getInstance().getOpenTableInfo().getPerson() == 0) {
showChoosePeopleNumDialog(false); showChoosePeopleNumDialog(false);
} }
} }
......
...@@ -9,7 +9,9 @@ import android.text.TextUtils; ...@@ -9,7 +9,9 @@ import android.text.TextUtils;
import android.util.Log; import android.util.Log;
import android.view.View; import android.view.View;
import android.widget.TextView; import android.widget.TextView;
import com.billy.cc.core.component.CC; import com.billy.cc.core.component.CC;
import com.gingersoft.gsa.cloud.app.GsaCloudApplication;
import com.gingersoft.gsa.cloud.common.core.user.UserContext; import com.gingersoft.gsa.cloud.common.core.user.UserContext;
import com.gingersoft.gsa.cloud.common.core.member.MemberInfo; import com.gingersoft.gsa.cloud.common.core.member.MemberInfo;
import com.gingersoft.gsa.cloud.common.core.pay.PayMethod; import com.gingersoft.gsa.cloud.common.core.pay.PayMethod;
......
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