修改小票模板

master
胡锐 2 months ago
parent 48c4d19c36
commit 69b5d9d3d3
  1. 40
      service/src/main/java/com/hfkj/device/sanmisen/PrinterTemplate.java
  2. 22
      service/src/main/java/com/hfkj/device/spyun/SpPrinterTemplate.java
  3. 4
      service/src/main/java/com/hfkj/service/impl/BsDeviceServiceImpl.java

@ -262,25 +262,49 @@ public class PrinterTemplate {
divLine3.put("type", "div_star"); divLine3.put("type", "div_star");
contents.add(divLine3); contents.add(divLine3);
// 加油金额标题
JSONObject refuelPriceTitle = new JSONObject();
refuelPriceTitle.put("cont", "加油金额");
refuelPriceTitle.put("type", "text");
refuelPriceTitle.put("size", "11");
contents.add(refuelPriceTitle);
// 加油金额 // 加油金额
JSONObject refuelPrice = new JSONObject(); JSONObject refuelPrice = new JSONObject();
refuelPrice.put("cont", "" + gasOrder.getGasRefuelPrice() + "元"); refuelPrice.put("cont", "加油金额:" + gasOrder.getGasRefuelPrice()+"元");
refuelPrice.put("type", "text"); refuelPrice.put("type", "text");
refuelPrice.put("size", "11");
contents.add(refuelPrice); contents.add(refuelPrice);
// 优惠金额
JSONObject discountPrice = new JSONObject();
discountPrice.put("cont", "优惠金额:" + gasOrder.getTotalDeductionPrice()+"元");
discountPrice.put("type", "text");
contents.add(discountPrice);
// 分割线 // 分割线
JSONObject divLine4 = new JSONObject(); JSONObject divLine4 = new JSONObject();
divLine4.put("cont", ""); divLine4.put("cont", "");
divLine4.put("type", "div_star"); divLine4.put("type", "div_star");
contents.add(divLine4); contents.add(divLine4);
// 实际支付
JSONObject actualPayment = new JSONObject();
actualPayment.put("cont", "实际支付:" + gasOrder.getActualPayPrice()+"元");
actualPayment.put("type", "text");
contents.add(actualPayment);
/* // 加油金额标题
JSONObject refuelPriceTitle = new JSONObject();
refuelPriceTitle.put("cont", "加油金额");
refuelPriceTitle.put("type", "text");
refuelPriceTitle.put("size", "11");
contents.add(refuelPriceTitle);
// 加油金额
JSONObject refuelPrice = new JSONObject();
refuelPrice.put("cont", "¥" + gasOrder.getGasRefuelPrice() + "元");
refuelPrice.put("type", "text");
refuelPrice.put("size", "11");
contents.add(refuelPrice);*/
// 分割线
JSONObject divLine5 = new JSONObject();
divLine5.put("cont", "");
divLine5.put("type", "div_star");
contents.add(divLine5);
// 小票底部 // 小票底部
JSONObject receiptBottom = new JSONObject(); JSONObject receiptBottom = new JSONObject();
receiptBottom.put("cont", (StringUtils.isNotBlank(MapUtils.getString(receiptMap, "receiptBottom"))?MapUtils.getString(receiptMap, "receiptBottom"):"开心又省钱; 来"嗨加油"")); receiptBottom.put("cont", (StringUtils.isNotBlank(MapUtils.getString(receiptMap, "receiptBottom"))?MapUtils.getString(receiptMap, "receiptBottom"):"开心又省钱; 来"嗨加油""));

@ -66,6 +66,8 @@ public class SpPrinterTemplate {
String oilNo, String oilNo,
String oilLiters, String oilLiters,
String orderPrice, String orderPrice,
String discountPrice,
String actualPayment,
Map<String, Object> receiptMap, Map<String, Object> receiptMap,
boolean makeUp) { boolean makeUp) {
@ -84,8 +86,12 @@ public class SpPrinterTemplate {
"升数:" + oilLiters +"升<BR>" + "升数:" + oilLiters +"升<BR>" +
"实际加油升数以油站加油机为准!<BR>" + "实际加油升数以油站加油机为准!<BR>" +
"------------------------------<BR>" + "------------------------------<BR>" +
"<L1>加油金额</L1><BR>" + "加油金额:"+ orderPrice + "元<BR>" +
"<L1>¥" + orderPrice + "元</L1><BR>" + "优惠金额:" + discountPrice + "元<BR>" +
"------------------------------<BR>" +
"实际支付:" + actualPayment +"元<BR>" +
/* "<L1>加油金额</L1><BR>" +
"<L1>¥" + orderPrice + "元</L1><BR>" +*/
"------------------------------<BR>" + "------------------------------<BR>" +
"<C><B>"+ (StringUtils.isNotBlank(MapUtils.getString(receiptMap, "receiptBottom"))?MapUtils.getString(receiptMap, "receiptBottom"):"开心又省钱; 来"嗨加油"") + "</B></C>"; "<C><B>"+ (StringUtils.isNotBlank(MapUtils.getString(receiptMap, "receiptBottom"))?MapUtils.getString(receiptMap, "receiptBottom"):"开心又省钱; 来"嗨加油"") + "</B></C>";
return str; return str;
@ -112,7 +118,9 @@ public class SpPrinterTemplate {
String oilNo, String oilNo,
String oilLiters, String oilLiters,
String orderPrice, String orderPrice,
Map<String, Object> receiptMap, String discountPrice,
String actualPayment,
Map<String, Object> receiptMap,
boolean makeUp) throws Exception { boolean makeUp) throws Exception {
String str = "<C><L1>" + (StringUtils.isNotBlank(MapUtils.getString(receiptMap, "receiptTop"))?MapUtils.getString(receiptMap, "receiptTop"):"嗨加油") + "</L1></C> <BR> " + String str = "<C><L1>" + (StringUtils.isNotBlank(MapUtils.getString(receiptMap, "receiptTop"))?MapUtils.getString(receiptMap, "receiptTop"):"嗨加油") + "</L1></C> <BR> " +
"<C><B>" + gasName + (makeUp?"(补打)":"") + "</B></C> <BR> " + "<C><B>" + gasName + (makeUp?"(补打)":"") + "</B></C> <BR> " +
@ -129,8 +137,12 @@ public class SpPrinterTemplate {
"升数:" + oilLiters +"升<BR>" + "升数:" + oilLiters +"升<BR>" +
"实际加油升数以油站加油机为准!<BR>" + "实际加油升数以油站加油机为准!<BR>" +
"------------------------------<BR>" + "------------------------------<BR>" +
"<L1>加油金额</L1><BR>" + "加油金额:"+ orderPrice + "元<BR>" +
"<L1>¥" + orderPrice + "元</L1><BR>" + "优惠金额:" + discountPrice + "元<BR>" +
"------------------------------<BR>" +
"实际支付:" + actualPayment +"元<BR>" +
/* "<L1>加油金额</L1><BR>" +
"<L1>¥" + orderPrice + "元</L1><BR>" +*/
"------------------------------<BR>" + "------------------------------<BR>" +
"<C><B>"+ (StringUtils.isNotBlank(MapUtils.getString(receiptMap, "receiptBottom"))?MapUtils.getString(receiptMap, "receiptBottom"):"开心又省钱; 来"嗨加油"") + "</B></C>"; "<C><B>"+ (StringUtils.isNotBlank(MapUtils.getString(receiptMap, "receiptBottom"))?MapUtils.getString(receiptMap, "receiptBottom"):"开心又省钱; 来"嗨加油"") + "</B></C>";
return str; return str;

@ -109,6 +109,8 @@ public class BsDeviceServiceImpl implements BsDeviceService {
gasOrder.getGasOilNo(), gasOrder.getGasOilNo(),
gasOrder.getGasOilLiters().toString(), gasOrder.getGasOilLiters().toString(),
gasOrder.getGasRefuelPrice().toString(), gasOrder.getGasRefuelPrice().toString(),
gasOrder.getTotalDeductionPrice().toString(),
gasOrder.getActualPayPrice().toString(),
receiptMap, receiptMap,
makeUp makeUp
), 1); ), 1);
@ -127,6 +129,8 @@ public class BsDeviceServiceImpl implements BsDeviceService {
gasOrder.getGasOilNo(), gasOrder.getGasOilNo(),
gasOrder.getGasOilLiters().toString(), gasOrder.getGasOilLiters().toString(),
gasOrder.getGasRefuelPrice().toString(), gasOrder.getGasRefuelPrice().toString(),
gasOrder.getTotalDeductionPrice().toString(),
gasOrder.getActualPayPrice().toString(),
receiptMap, receiptMap,
makeUp makeUp
), 1); ), 1);

Loading…
Cancel
Save