package com.hai.config;
import com.hai.common.utils.DateUtil;
import com.hai.model.GasClassGroupTaskDataCount;
import com.hai.model.GasClassGroupTaskOilCount;
import java.util.Date;
/**
* 商鹏打印机模板
* @author hurui
*/
public class SpPrinterTemplate {
/**
* 加油站收银员存根模板
*/
public static String classGroupCountTemp(GasClassGroupTaskDataCount dataCount, boolean makeUp) throws Exception {
String str = "" + dataCount.getClassNum() + "班结流水" + (makeUp?"(补打)":"") + "
" +
"===============================
" +
"开始时间:" + DateUtil.date2String(dataCount.getStartTime(), "yyyy-MM-dd HH:mm:ss") + "
" +
"结束时间:" + DateUtil.date2String(dataCount.getEndTime(), "yyyy-MM-dd HH:mm:ss") + "
" +
"
" +
"加油金额汇总:" + dataCount.getRefuelPrice() + "元
" +
"加油笔数汇总:" + dataCount.getRefuelNum() + "笔
" +
"加油升数汇总:" + dataCount.getRefuelLiters() + "升
" +
"
" +
"退款金额汇总:" + dataCount.getRefundPrice() + "元
" +
"退款笔数汇总:" + dataCount.getRefundNum() + "笔
" +
"退款升数汇总:" + dataCount.getRefundLiters() + "升
" +
"
" +
"--------------收款-------------
" +
"油号 金额(元) 升数 笔数
";
String oilCountStr = "";
for (GasClassGroupTaskOilCount oilCount : dataCount.getGroupTaskOilCountList()) {
oilCountStr += oilCount.getOilNo() + "# " + oilCount.getRefuelPrice() + " " + oilCount.getRefuelLiters() + " " + oilCount.getRefuelNum() + "
";
}
str += oilCountStr +
"================================
" +
"" + DateUtil.date2String(new Date(), "yyyy-MM-dd HH:mm:ss") +"
";
return str;
}
/**
* 加油站收银员存根模板
* @param gasName 油站名称
* @param orderNo 订单号
* @param payTime 支付时间
* @param source 来源
* @param gunNo 抢号
* @param oilNo 油号
* @param oilLiters 升数
* @param orderPrice 加油金额
* @return
*/
public static String oilCashierStubTemp(String gasName,
String orderNo,
String payTime,
String phone,
String source,
String gunNo,
String oilNo,
String oilLiters,
String orderPrice,
boolean makeUp) throws Exception {
String str = "" + gasName + (makeUp?"(补打)":"") + "
" +
"(收银员存根)
" +
"------------------------------
" +
"流水:" + orderNo + "
" +
"------------------------------
" +
"打印时间:" + DateUtil.date2String(new Date(), "yyyy-MM-dd HH:mm:ss") + "
" +
"支付时间:" + payTime + "
" +
"电话:" + phone.substring(0, 3) + "****" + phone.substring(7) + "
" +
"来源:" + source + "
" +
"油枪:"+ gunNo + "号
" +
"油品:" + oilNo + "#
" +
"升数:" + oilLiters +"升
" +
"实际加油升数以油站加油机为准!
" +
"------------------------------
" +
"加油金额
" +
"¥" + orderPrice + "元
" +
"------------------------------
" +
"开心又省钱; 来"嗨森逛"";
return str;
}
/**
* 加油站客户存根模板
* @param gasName 油站名称
* @param orderNo 订单号
* @param payTime 支付时间
* @param source 来源
* @param gunNo 抢号
* @param oilNo 油号
* @param oilLiters 升数
* @param orderPrice 加油金额
* @return
*/
public static String oilClientStubTemp(String gasName,
String orderNo,
String payTime,
String phone,
String source,
String gunNo,
String oilNo,
String oilLiters,
String orderPrice,
boolean makeUp) throws Exception {
String str = "" + gasName + (makeUp?"(补打)":"") +"
" +
"(客户存根)
" +
"------------------------------
" +
"流水:" + orderNo + "
" +
"------------------------------
" +
"打印时间:" + DateUtil.date2String(new Date(), "yyyy-MM-dd HH:mm:ss") + "
" +
"支付时间:" + payTime + "
" +
"电话:" + phone.substring(0, 3) + "****" + phone.substring(7) + "
" +
"来源:" + source + "
" +
"油枪:"+ gunNo + "号
" +
"油品:" + oilNo + "#
" +
"升数:" + oilLiters +"升
" +
"实际加油升数以油站加油机为准!
" +
"------------------------------
" +
"加油金额
" +
"¥" + orderPrice + "元
" +
"------------------------------
" +
"开心又省钱; 来"嗨森逛"";
return str;
}
}