diff --git a/service/src/main/java/com/hfkj/device/sanmisen/PrinterTemplate.java b/service/src/main/java/com/hfkj/device/sanmisen/PrinterTemplate.java index 3e67799..5663c33 100644 --- a/service/src/main/java/com/hfkj/device/sanmisen/PrinterTemplate.java +++ b/service/src/main/java/com/hfkj/device/sanmisen/PrinterTemplate.java @@ -262,25 +262,49 @@ public class PrinterTemplate { divLine3.put("type", "div_star"); 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(); - refuelPrice.put("cont", "¥" + gasOrder.getGasRefuelPrice() + "元"); + refuelPrice.put("cont", "加油金额:" + gasOrder.getGasRefuelPrice()+"元"); refuelPrice.put("type", "text"); - refuelPrice.put("size", "11"); contents.add(refuelPrice); + // 优惠金额 + JSONObject discountPrice = new JSONObject(); + discountPrice.put("cont", "优惠金额:" + gasOrder.getTotalDeductionPrice()+"元"); + discountPrice.put("type", "text"); + contents.add(discountPrice); + // 分割线 JSONObject divLine4 = new JSONObject(); divLine4.put("cont", ""); divLine4.put("type", "div_star"); 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(); receiptBottom.put("cont", (StringUtils.isNotBlank(MapUtils.getString(receiptMap, "receiptBottom"))?MapUtils.getString(receiptMap, "receiptBottom"):"开心又省钱; 来"嗨加油"")); diff --git a/service/src/main/java/com/hfkj/device/spyun/SpPrinterTemplate.java b/service/src/main/java/com/hfkj/device/spyun/SpPrinterTemplate.java index d11b0d5..93af2f2 100644 --- a/service/src/main/java/com/hfkj/device/spyun/SpPrinterTemplate.java +++ b/service/src/main/java/com/hfkj/device/spyun/SpPrinterTemplate.java @@ -66,6 +66,8 @@ public class SpPrinterTemplate { String oilNo, String oilLiters, String orderPrice, + String discountPrice, + String actualPayment, Map receiptMap, boolean makeUp) { @@ -84,8 +86,12 @@ public class SpPrinterTemplate { "升数:" + oilLiters +"升
" + "实际加油升数以油站加油机为准!
" + "------------------------------
" + - "加油金额
" + - "¥" + orderPrice + "元
" + + "加油金额:"+ orderPrice + "元
" + + "优惠金额:" + discountPrice + "元
" + + "------------------------------
" + + "实际支付:" + actualPayment +"元
" + + /* "加油金额
" + + "¥" + orderPrice + "元
" +*/ "------------------------------
" + ""+ (StringUtils.isNotBlank(MapUtils.getString(receiptMap, "receiptBottom"))?MapUtils.getString(receiptMap, "receiptBottom"):"开心又省钱; 来"嗨加油"") + ""; return str; @@ -112,7 +118,9 @@ public class SpPrinterTemplate { String oilNo, String oilLiters, String orderPrice, - Map receiptMap, + String discountPrice, + String actualPayment, + Map receiptMap, boolean makeUp) throws Exception { String str = "" + (StringUtils.isNotBlank(MapUtils.getString(receiptMap, "receiptTop"))?MapUtils.getString(receiptMap, "receiptTop"):"嗨加油") + "
" + "" + gasName + (makeUp?"(补打)":"") + "
" + @@ -129,8 +137,12 @@ public class SpPrinterTemplate { "升数:" + oilLiters +"升
" + "实际加油升数以油站加油机为准!
" + "------------------------------
" + - "加油金额
" + - "¥" + orderPrice + "元
" + + "加油金额:"+ orderPrice + "元
" + + "优惠金额:" + discountPrice + "元
" + + "------------------------------
" + + "实际支付:" + actualPayment +"元
" + +/* "加油金额
" + + "¥" + orderPrice + "元
" +*/ "------------------------------
" + ""+ (StringUtils.isNotBlank(MapUtils.getString(receiptMap, "receiptBottom"))?MapUtils.getString(receiptMap, "receiptBottom"):"开心又省钱; 来"嗨加油"") + ""; return str; diff --git a/service/src/main/java/com/hfkj/service/impl/BsDeviceServiceImpl.java b/service/src/main/java/com/hfkj/service/impl/BsDeviceServiceImpl.java index 1753cdc..4806a64 100644 --- a/service/src/main/java/com/hfkj/service/impl/BsDeviceServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/impl/BsDeviceServiceImpl.java @@ -109,6 +109,8 @@ public class BsDeviceServiceImpl implements BsDeviceService { gasOrder.getGasOilNo(), gasOrder.getGasOilLiters().toString(), gasOrder.getGasRefuelPrice().toString(), + gasOrder.getTotalDeductionPrice().toString(), + gasOrder.getActualPayPrice().toString(), receiptMap, makeUp ), 1); @@ -127,6 +129,8 @@ public class BsDeviceServiceImpl implements BsDeviceService { gasOrder.getGasOilNo(), gasOrder.getGasOilLiters().toString(), gasOrder.getGasRefuelPrice().toString(), + gasOrder.getTotalDeductionPrice().toString(), + gasOrder.getActualPayPrice().toString(), receiptMap, makeUp ), 1);