提交代码

dev-discount
胡锐 2 years ago
parent 2b55ac1f44
commit 6ca63a6b82
  1. 14
      hai-bweb/src/main/java/com/bweb/controller/HighDeviceController.java
  2. 2
      hai-cweb/src/main/java/com/cweb/controller/HighTestController.java
  3. 28
      hai-service/src/main/java/com/hai/config/SpPrinterTemplate.java
  4. 184
      hai-service/src/main/java/com/hai/config/ZkcPrinterTemplate.java
  5. 28
      hai-service/src/main/java/com/hai/dao/HighDeviceMapper.java
  6. 42
      hai-service/src/main/java/com/hai/dao/HighDeviceSqlProvider.java
  7. 48
      hai-service/src/main/java/com/hai/entity/HighDevice.java
  8. 210
      hai-service/src/main/java/com/hai/entity/HighDeviceExample.java
  9. 12
      hai-service/src/main/java/com/hai/service/impl/HighGasDiscountOilPriceServiceImpl.java
  10. 21
      hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java

@ -57,10 +57,7 @@ public class HighDeviceController {
public ResponseData editDevice(@RequestBody HighDevice body) {
try {
if (body.getMerStoreId() == null
|| body.getType() == null
|| StringUtils.isBlank(body.getDeviceName())
) {
if (body.getMerStoreId() == null || body.getType() == null) {
log.error("HighDeviceController -> editDevice() error!","参数错误");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
@ -114,13 +111,15 @@ public class HighDeviceController {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的分公司");
}
if (body.getId() == null) {
if (body.getType().equals(DeviceTypeEnum.type1.getType())) {
SpPrinterConfig sp = new SpPrinterConfig();
JSONObject jsonObject = JSONObject.parseObject(sp.addPrinter(body.getDeviceSn(), body.getDeviceKey(), body.getDeviceName()));
JSONObject jsonObject = JSONObject.parseObject(sp.addPrinter(body.getDeviceSn(), body.getDeviceKey(), store.getStoreName()));
if (!jsonObject.getInteger("errorcode").equals(0)) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, jsonObject.getString("errormsg"));
}
}
}
device.setCompanyId(company.getId());
device.setCompanyName(company.getName());
@ -129,11 +128,14 @@ public class HighDeviceController {
device.setMerStoreId(store.getId());
device.setMerStoreName(store.getStoreName());
device.setType(body.getType());
device.setDeviceName(body.getDeviceName());
device.setDeviceName(store.getStoreName());
device.setDeviceSn(body.getDeviceSn());
device.setDeviceKey(body.getDeviceKey());
device.setDeviceImei(body.getDeviceImei());
device.setDeviceIccid(body.getDeviceIccid());
device.setReceiptTop(body.getReceiptTop());
device.setReceiptSource(body.getReceiptSource());
device.setReceiptBottom(body.getReceiptBottom());
deviceService.editDevice(device);
return ResponseMsgUtil.success("操作成功");

File diff suppressed because one or more lines are too long

@ -3,8 +3,11 @@ package com.hai.config;
import com.hai.common.utils.DateUtil;
import com.hai.model.GasClassGroupTaskDataCount;
import com.hai.model.GasClassGroupTaskOilCount;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils;
import java.util.Date;
import java.util.Map;
/**
* 商鹏打印机模板
@ -47,24 +50,27 @@ public class SpPrinterTemplate {
* @param gasName 油站名称
* @param orderNo 订单号
* @param payTime 支付时间
* @param source 来源
* @param gunNo 抢号
* @param oilNo 油号
* @param oilLiters 升数
* @param orderPrice 加油金额
* @param receiptMap 小票配置
* @param makeUp 重复打印
* @return
*/
public static String oilCashierStubTemp(String gasName,
String orderNo,
String payTime,
String phone,
String source,
String gunNo,
String oilNo,
String oilLiters,
String orderPrice,
Map<String, Object> receiptMap,
boolean makeUp) throws Exception {
String str = "<C><B>" + gasName + (makeUp?"(补打)":"") + "</B></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>(收银员存根)</C> <BR>" +
"------------------------------<BR>" +
"流水:" + orderNo + "<BR>" +
@ -72,7 +78,7 @@ public class SpPrinterTemplate {
"打印时间:" + DateUtil.date2String(new Date(), "yyyy-MM-dd HH:mm:ss") + "<BR>" +
"支付时间:" + payTime + "<BR>" +
"电话:" + phone.substring(0, 3) + "****" + phone.substring(7) + "<BR>" +
"来源:" + source + "<BR>" +
"来源:" + (StringUtils.isNotBlank(MapUtils.getString(receiptMap, "receiptSource"))?MapUtils.getString(receiptMap, "receiptSource"):"嗨森逛")+ "<BR>" +
"油枪:"+ gunNo + "号<BR>" +
"油品:" + oilNo + "#<BR>" +
"升数:" + oilLiters +"升<BR>" +
@ -81,7 +87,7 @@ public class SpPrinterTemplate {
"<L1>加油金额</L1><BR>" +
"<L1>¥" + orderPrice + "元</L1><BR>" +
"------------------------------<BR>" +
"<C><B>开心又省钱; 来"嗨森逛"</B></C>";
"<C><B>"+ (StringUtils.isNotBlank(MapUtils.getString(receiptMap, "receiptBottom"))?MapUtils.getString(receiptMap, "receiptBottom"):"开心又省钱; 来"嗨森逛"") + "</B></C>";
return str;
}
@ -90,24 +96,26 @@ public class SpPrinterTemplate {
* @param gasName 油站名称
* @param orderNo 订单号
* @param payTime 支付时间
* @param source 来源
* @param gunNo 抢号
* @param oilNo 油号
* @param oilLiters 升数
* @param orderPrice 加油金额
* @param receiptMap 小票配置
* @param makeUp 重复打印
* @return
*/
public static String oilClientStubTemp(String gasName,
String orderNo,
String payTime,
String phone,
String source,
String gunNo,
String oilNo,
String oilLiters,
String orderPrice,
Map<String, Object> receiptMap,
boolean makeUp) throws Exception {
String str = "<C><B>" + gasName + (makeUp?"(补打)":"") +"</B></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>(客户存根)</C> <BR>" +
"------------------------------<BR>" +
"流水:" + orderNo + "<BR>" +
@ -115,7 +123,7 @@ public class SpPrinterTemplate {
"打印时间:" + DateUtil.date2String(new Date(), "yyyy-MM-dd HH:mm:ss") + "<BR>" +
"支付时间:" + payTime + "<BR>" +
"电话:" + phone.substring(0, 3) + "****" + phone.substring(7) + "<BR>" +
"来源:" + source + "<BR>" +
"来源:" + (StringUtils.isNotBlank(MapUtils.getString(receiptMap, "receiptSource"))?MapUtils.getString(receiptMap, "receiptSource"):"嗨森逛")+ "<BR>" +
"油枪:"+ gunNo + "号<BR>" +
"油品:" + oilNo + "#<BR>" +
"升数:" + oilLiters +"升<BR>" +
@ -124,7 +132,7 @@ public class SpPrinterTemplate {
"<L1>加油金额</L1><BR>" +
"<L1>¥" + orderPrice + "元</L1><BR>" +
"------------------------------<BR>" +
"<C><B>开心又省钱; 来"嗨森逛"</B></C>";
"<C><B>"+ (StringUtils.isNotBlank(MapUtils.getString(receiptMap, "receiptBottom"))?MapUtils.getString(receiptMap, "receiptBottom"):"开心又省钱; 来"嗨森逛"") + "</B></C>";
return str;
}

@ -3,9 +3,12 @@ package com.hai.config;
import com.hai.common.utils.DateUtil;
import com.hai.model.GasClassGroupTaskDataCount;
import com.hai.model.GasClassGroupTaskOilCount;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils;
import java.io.ByteArrayOutputStream;
import java.util.Date;
import java.util.Map;
/**
* ZKC云打印机模板
@ -87,7 +90,7 @@ public class ZkcPrinterTemplate {
}
/**
* 加油站
* 加油站收银员存根模板
* @param gasName 油站名称
* @param orderNo 订单号
* @param payTime 支付时间
@ -96,9 +99,11 @@ public class ZkcPrinterTemplate {
* @param oilNo 油号
* @param oilLiters 升数
* @param orderPrice 加油金额
* @param receiptMap 小票配置
* @param makeUp 重复打印
* @return
*/
public static byte[] oilTemp(String gasName,
public static byte[] oilCashierStubTemp(String gasName,
String orderNo,
String payTime,
String phone,
@ -107,6 +112,7 @@ public class ZkcPrinterTemplate {
String oilNo,
String oilLiters,
String orderPrice,
Map<String, Object> receiptMap,
boolean makeUp) throws Exception {
ByteArrayOutputStream stream = new ByteArrayOutputStream();
// 居中
@ -114,180 +120,15 @@ public class ZkcPrinterTemplate {
stream.write(0x61);
stream.write(0x01);
stream.write((gasName + (makeUp?"(补打)":"")).getBytes("UTF-8"));
stream.write(0x0A);
stream.write("(收银员存根)".getBytes("UTF-8"));
stream.write(0x0A);
// 左对齐
stream.write(0x1B);
stream.write(0x61);
stream.write(0x00);
stream.write("--------------------------------".getBytes("UTF-8"));
stream.write(0x0A);
stream.write(("流水号:" + orderNo).getBytes("UTF-8"));
stream.write(0x0A);
stream.write("--------------------------------".getBytes("UTF-8"));
stream.write(0x0A);
stream.write(("打印时间:" + DateUtil.date2String(new Date(), "yyyy-MM-dd HH:mm:ss")).getBytes("UTF-8"));
stream.write(0x0A);
stream.write(("支付时间:" + payTime).getBytes("UTF-8"));
stream.write(0x0A);
stream.write(("电话:" + phone.substring(0, 3) + "****" + phone.substring(7)).getBytes("UTF-8"));
stream.write(0x0A);
stream.write("来源:嗨森逛".getBytes("UTF-8"));
stream.write(0x0A);
stream.write(("油枪:" + gunNo + "号").getBytes("UTF-8"));
stream.write(0x0A);
stream.write(("油品:" + oilNo + "#").getBytes("UTF-8"));
stream.write(0x0A);
stream.write(("升数:" + oilLiters + "升").getBytes("UTF-8"));
stream.write(0x0A);
stream.write("实际加油升数以加油机为准!".getBytes("UTF-8"));
stream.write(0x0A);
stream.write("--------------------------------".getBytes("UTF-8"));
stream.write(0x0A);
stream.write(0x1B);
stream.write(0x0E);
stream.write("加油金额".getBytes("UTF-8"));
stream.write(0x0A);
stream.write(("¥" + orderPrice).getBytes("UTF-8"));
stream.write(0x0A);
stream.write(0x1B);
stream.write(0x21);
stream.write(0x00);
stream.write("--------------------------------".getBytes("UTF-8"));
stream.write(0x0A);
stream.write(0x1B);
stream.write(0x61);
stream.write(0x01);
stream.write("开心又省钱;来“ 嗨森逛 ”".getBytes("UTF-8"));
stream.write(0x0A);
stream.write(0x0A);
stream.write(0x0A);
stream.write(0x0A);
// 居中
stream.write(0x1B);
stream.write(0x61);
stream.write(0x01);
stream.write(gasName.getBytes("UTF-8"));
stream.write(0x0A);
stream.write("(客户存根)".getBytes("UTF-8"));
stream.write(0x0A);
// 左对齐
stream.write(0x1B);
stream.write(0x61);
stream.write(0x00);
stream.write("--------------------------------".getBytes("UTF-8"));
stream.write(0x0A);
stream.write(("流水号:" + orderNo).getBytes("UTF-8"));
stream.write(0x0A);
stream.write("--------------------------------".getBytes("UTF-8"));
stream.write(0x0A);
stream.write(("打印时间:" + DateUtil.date2String(new Date(), "yyyy-MM-dd HH:mm:ss")).getBytes("UTF-8"));
stream.write(0x0A);
stream.write(("支付时间:" + payTime).getBytes("UTF-8"));
stream.write(0x0A);
stream.write(("电话:" + phone.substring(0, 3) + "****" + phone.substring(7)).getBytes("UTF-8"));
stream.write(0x0A);
stream.write("来源:嗨森逛".getBytes("UTF-8"));
stream.write(0x0A);
stream.write(("油枪:" + gunNo + "号").getBytes("UTF-8"));
stream.write(0x0A);
stream.write(("油品:" + oilNo + "#").getBytes("UTF-8"));
stream.write(0x0A);
stream.write(("升数:" + oilLiters + "升").getBytes("UTF-8"));
stream.write(0x0A);
stream.write("实际加油升数以加油机为准!".getBytes("UTF-8"));
stream.write(0x0A);
stream.write("--------------------------------".getBytes("UTF-8"));
stream.write(0x0A);
stream.write(0x1B);
stream.write(0x0E);
stream.write("加油金额".getBytes("UTF-8"));
stream.write((StringUtils.isNotBlank(MapUtils.getString(receiptMap, "receiptTop"))?MapUtils.getString(receiptMap, "receiptTop"):"嗨森逛").getBytes("UTF-8"));
stream.write(0x0A);
stream.write(("¥" + orderPrice).getBytes("UTF-8"));
stream.write(0x0A);
stream.write(0x1B);
stream.write(0x21);
stream.write(0x00);
stream.write("--------------------------------".getBytes("UTF-8"));
stream.write(0x0A);
stream.write(0x1B);
stream.write(0x61);
stream.write(0x01);
stream.write("开心又省钱;来“ 嗨森逛 ”".getBytes("UTF-8"));
stream.write(0x0A);
stream.write(0x0A);
stream.write(0x0A);
stream.write(0x0A);
stream.write(0x0A);
stream.write(0x0A);
stream.write(0x0A);
return getPrinterBytes(stream.toByteArray(), 1, "UTF-8");
}
/**
* 加油站收银员存根模板
* @param gasName 油站名称
* @param orderNo 订单号
* @param payTime 支付时间
* @param source 来源
* @param gunNo 抢号
* @param oilNo 油号
* @param oilLiters 升数
* @param orderPrice 加油金额
* @return
*/
public static byte[] oilCashierStubTemp(String gasName,
String orderNo,
String payTime,
String phone,
String source,
String gunNo,
String oilNo,
String oilLiters,
String orderPrice,
boolean makeUp) throws Exception {
ByteArrayOutputStream stream = new ByteArrayOutputStream();
// 居中
stream.write(0x1B);
stream.write(0x61);
stream.write(0x01);
stream.write((gasName + (makeUp?"(补打)":"")).getBytes("UTF-8"));
stream.write(0x0A);
@ -315,7 +156,7 @@ public class ZkcPrinterTemplate {
stream.write(("电话:" + phone.substring(0, 3) + "****" + phone.substring(7)).getBytes("UTF-8"));
stream.write(0x0A);
stream.write("来源:嗨森逛".getBytes("UTF-8"));
stream.write(("来源:" + (StringUtils.isNotBlank(MapUtils.getString(receiptMap, "receiptSource"))?MapUtils.getString(receiptMap, "receiptSource"):"嗨森逛")).getBytes("UTF-8"));
stream.write(0x0A);
stream.write(("油枪:" + gunNo + "号").getBytes("UTF-8"));
@ -350,7 +191,7 @@ public class ZkcPrinterTemplate {
stream.write(0x1B);
stream.write(0x61);
stream.write(0x01);
stream.write("开心又省钱;来“ 嗨森逛 ”".getBytes("UTF-8"));
stream.write((StringUtils.isNotBlank(MapUtils.getString(receiptMap, "receiptBottom"))?MapUtils.getString(receiptMap, "receiptBottom"):"开心又省钱; 来"嗨森逛"").getBytes("UTF-8"));
stream.write(0x0A);
stream.write(0x0A);
@ -371,6 +212,8 @@ public class ZkcPrinterTemplate {
* @param oilNo 油号
* @param oilLiters 升数
* @param orderPrice 加油金额
* @param receiptMap 小票配置
* @param makeUp 重复打印
* @return
*/
public static byte[] oilClientStubTemp(String gasName,
@ -382,6 +225,7 @@ public class ZkcPrinterTemplate {
String oilNo,
String oilLiters,
String orderPrice,
Map<String, Object> receiptMap,
boolean makeUp) throws Exception {
ByteArrayOutputStream stream = new ByteArrayOutputStream();

@ -45,18 +45,20 @@ public interface HighDeviceMapper extends HighDeviceMapperExt {
"mer_store_name, device_name, ",
"device_sn, device_key, ",
"device_imei, device_iccid, ",
"`status`, create_time, ",
"update_time, ext_1, ",
"ext_2, ext_3)",
"receipt_top, receipt_source, ",
"receipt_bottom, `status`, ",
"create_time, update_time, ",
"ext_1, ext_2, ext_3)",
"values (#{type,jdbcType=INTEGER}, #{companyId,jdbcType=BIGINT}, ",
"#{companyName,jdbcType=VARCHAR}, #{merId,jdbcType=BIGINT}, ",
"#{merName,jdbcType=VARCHAR}, #{merStoreId,jdbcType=BIGINT}, ",
"#{merStoreName,jdbcType=VARCHAR}, #{deviceName,jdbcType=VARCHAR}, ",
"#{deviceSn,jdbcType=VARCHAR}, #{deviceKey,jdbcType=VARCHAR}, ",
"#{deviceImei,jdbcType=VARCHAR}, #{deviceIccid,jdbcType=VARCHAR}, ",
"#{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, ",
"#{updateTime,jdbcType=TIMESTAMP}, #{ext1,jdbcType=VARCHAR}, ",
"#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
"#{receiptTop,jdbcType=VARCHAR}, #{receiptSource,jdbcType=VARCHAR}, ",
"#{receiptBottom,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, ",
"#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ",
"#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
})
@Options(useGeneratedKeys=true,keyProperty="id")
int insert(HighDevice record);
@ -80,6 +82,9 @@ public interface HighDeviceMapper extends HighDeviceMapperExt {
@Result(column="device_key", property="deviceKey", jdbcType=JdbcType.VARCHAR),
@Result(column="device_imei", property="deviceImei", jdbcType=JdbcType.VARCHAR),
@Result(column="device_iccid", property="deviceIccid", jdbcType=JdbcType.VARCHAR),
@Result(column="receipt_top", property="receiptTop", jdbcType=JdbcType.VARCHAR),
@Result(column="receipt_source", property="receiptSource", jdbcType=JdbcType.VARCHAR),
@Result(column="receipt_bottom", property="receiptBottom", jdbcType=JdbcType.VARCHAR),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
@ -92,8 +97,9 @@ public interface HighDeviceMapper extends HighDeviceMapperExt {
@Select({
"select",
"id, `type`, company_id, company_name, mer_id, mer_name, mer_store_id, mer_store_name, ",
"device_name, device_sn, device_key, device_imei, device_iccid, `status`, create_time, ",
"update_time, ext_1, ext_2, ext_3",
"device_name, device_sn, device_key, device_imei, device_iccid, receipt_top, ",
"receipt_source, receipt_bottom, `status`, create_time, update_time, ext_1, ext_2, ",
"ext_3",
"from high_device",
"where id = #{id,jdbcType=BIGINT}"
})
@ -111,6 +117,9 @@ public interface HighDeviceMapper extends HighDeviceMapperExt {
@Result(column="device_key", property="deviceKey", jdbcType=JdbcType.VARCHAR),
@Result(column="device_imei", property="deviceImei", jdbcType=JdbcType.VARCHAR),
@Result(column="device_iccid", property="deviceIccid", jdbcType=JdbcType.VARCHAR),
@Result(column="receipt_top", property="receiptTop", jdbcType=JdbcType.VARCHAR),
@Result(column="receipt_source", property="receiptSource", jdbcType=JdbcType.VARCHAR),
@Result(column="receipt_bottom", property="receiptBottom", jdbcType=JdbcType.VARCHAR),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
@ -143,6 +152,9 @@ public interface HighDeviceMapper extends HighDeviceMapperExt {
"device_key = #{deviceKey,jdbcType=VARCHAR},",
"device_imei = #{deviceImei,jdbcType=VARCHAR},",
"device_iccid = #{deviceIccid,jdbcType=VARCHAR},",
"receipt_top = #{receiptTop,jdbcType=VARCHAR},",
"receipt_source = #{receiptSource,jdbcType=VARCHAR},",
"receipt_bottom = #{receiptBottom,jdbcType=VARCHAR},",
"`status` = #{status,jdbcType=INTEGER},",
"create_time = #{createTime,jdbcType=TIMESTAMP},",
"update_time = #{updateTime,jdbcType=TIMESTAMP},",

@ -76,6 +76,18 @@ public class HighDeviceSqlProvider {
sql.VALUES("device_iccid", "#{deviceIccid,jdbcType=VARCHAR}");
}
if (record.getReceiptTop() != null) {
sql.VALUES("receipt_top", "#{receiptTop,jdbcType=VARCHAR}");
}
if (record.getReceiptSource() != null) {
sql.VALUES("receipt_source", "#{receiptSource,jdbcType=VARCHAR}");
}
if (record.getReceiptBottom() != null) {
sql.VALUES("receipt_bottom", "#{receiptBottom,jdbcType=VARCHAR}");
}
if (record.getStatus() != null) {
sql.VALUES("`status`", "#{status,jdbcType=INTEGER}");
}
@ -122,6 +134,9 @@ public class HighDeviceSqlProvider {
sql.SELECT("device_key");
sql.SELECT("device_imei");
sql.SELECT("device_iccid");
sql.SELECT("receipt_top");
sql.SELECT("receipt_source");
sql.SELECT("receipt_bottom");
sql.SELECT("`status`");
sql.SELECT("create_time");
sql.SELECT("update_time");
@ -197,6 +212,18 @@ public class HighDeviceSqlProvider {
sql.SET("device_iccid = #{record.deviceIccid,jdbcType=VARCHAR}");
}
if (record.getReceiptTop() != null) {
sql.SET("receipt_top = #{record.receiptTop,jdbcType=VARCHAR}");
}
if (record.getReceiptSource() != null) {
sql.SET("receipt_source = #{record.receiptSource,jdbcType=VARCHAR}");
}
if (record.getReceiptBottom() != null) {
sql.SET("receipt_bottom = #{record.receiptBottom,jdbcType=VARCHAR}");
}
if (record.getStatus() != null) {
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
}
@ -242,6 +269,9 @@ public class HighDeviceSqlProvider {
sql.SET("device_key = #{record.deviceKey,jdbcType=VARCHAR}");
sql.SET("device_imei = #{record.deviceImei,jdbcType=VARCHAR}");
sql.SET("device_iccid = #{record.deviceIccid,jdbcType=VARCHAR}");
sql.SET("receipt_top = #{record.receiptTop,jdbcType=VARCHAR}");
sql.SET("receipt_source = #{record.receiptSource,jdbcType=VARCHAR}");
sql.SET("receipt_bottom = #{record.receiptBottom,jdbcType=VARCHAR}");
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}");
sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}");
@ -306,6 +336,18 @@ public class HighDeviceSqlProvider {
sql.SET("device_iccid = #{deviceIccid,jdbcType=VARCHAR}");
}
if (record.getReceiptTop() != null) {
sql.SET("receipt_top = #{receiptTop,jdbcType=VARCHAR}");
}
if (record.getReceiptSource() != null) {
sql.SET("receipt_source = #{receiptSource,jdbcType=VARCHAR}");
}
if (record.getReceiptBottom() != null) {
sql.SET("receipt_bottom = #{receiptBottom,jdbcType=VARCHAR}");
}
if (record.getStatus() != null) {
sql.SET("`status` = #{status,jdbcType=INTEGER}");
}

@ -78,6 +78,21 @@ public class HighDevice implements Serializable {
*/
private String deviceIccid;
/**
* 小票顶部显示
*/
private String receiptTop;
/**
* 小票来源显示
*/
private String receiptSource;
/**
* 小票底部显示
*/
private String receiptBottom;
/**
* 状态0删除1正常
*/
@ -205,6 +220,30 @@ public class HighDevice implements Serializable {
this.deviceIccid = deviceIccid;
}
public String getReceiptTop() {
return receiptTop;
}
public void setReceiptTop(String receiptTop) {
this.receiptTop = receiptTop;
}
public String getReceiptSource() {
return receiptSource;
}
public void setReceiptSource(String receiptSource) {
this.receiptSource = receiptSource;
}
public String getReceiptBottom() {
return receiptBottom;
}
public void setReceiptBottom(String receiptBottom) {
this.receiptBottom = receiptBottom;
}
public Integer getStatus() {
return status;
}
@ -278,6 +317,9 @@ public class HighDevice implements Serializable {
&& (this.getDeviceKey() == null ? other.getDeviceKey() == null : this.getDeviceKey().equals(other.getDeviceKey()))
&& (this.getDeviceImei() == null ? other.getDeviceImei() == null : this.getDeviceImei().equals(other.getDeviceImei()))
&& (this.getDeviceIccid() == null ? other.getDeviceIccid() == null : this.getDeviceIccid().equals(other.getDeviceIccid()))
&& (this.getReceiptTop() == null ? other.getReceiptTop() == null : this.getReceiptTop().equals(other.getReceiptTop()))
&& (this.getReceiptSource() == null ? other.getReceiptSource() == null : this.getReceiptSource().equals(other.getReceiptSource()))
&& (this.getReceiptBottom() == null ? other.getReceiptBottom() == null : this.getReceiptBottom().equals(other.getReceiptBottom()))
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
&& (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
@ -303,6 +345,9 @@ public class HighDevice implements Serializable {
result = prime * result + ((getDeviceKey() == null) ? 0 : getDeviceKey().hashCode());
result = prime * result + ((getDeviceImei() == null) ? 0 : getDeviceImei().hashCode());
result = prime * result + ((getDeviceIccid() == null) ? 0 : getDeviceIccid().hashCode());
result = prime * result + ((getReceiptTop() == null) ? 0 : getReceiptTop().hashCode());
result = prime * result + ((getReceiptSource() == null) ? 0 : getReceiptSource().hashCode());
result = prime * result + ((getReceiptBottom() == null) ? 0 : getReceiptBottom().hashCode());
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
@ -331,6 +376,9 @@ public class HighDevice implements Serializable {
sb.append(", deviceKey=").append(deviceKey);
sb.append(", deviceImei=").append(deviceImei);
sb.append(", deviceIccid=").append(deviceIccid);
sb.append(", receiptTop=").append(receiptTop);
sb.append(", receiptSource=").append(receiptSource);
sb.append(", receiptBottom=").append(receiptBottom);
sb.append(", status=").append(status);
sb.append(", createTime=").append(createTime);
sb.append(", updateTime=").append(updateTime);

@ -985,6 +985,216 @@ public class HighDeviceExample {
return (Criteria) this;
}
public Criteria andReceiptTopIsNull() {
addCriterion("receipt_top is null");
return (Criteria) this;
}
public Criteria andReceiptTopIsNotNull() {
addCriterion("receipt_top is not null");
return (Criteria) this;
}
public Criteria andReceiptTopEqualTo(String value) {
addCriterion("receipt_top =", value, "receiptTop");
return (Criteria) this;
}
public Criteria andReceiptTopNotEqualTo(String value) {
addCriterion("receipt_top <>", value, "receiptTop");
return (Criteria) this;
}
public Criteria andReceiptTopGreaterThan(String value) {
addCriterion("receipt_top >", value, "receiptTop");
return (Criteria) this;
}
public Criteria andReceiptTopGreaterThanOrEqualTo(String value) {
addCriterion("receipt_top >=", value, "receiptTop");
return (Criteria) this;
}
public Criteria andReceiptTopLessThan(String value) {
addCriterion("receipt_top <", value, "receiptTop");
return (Criteria) this;
}
public Criteria andReceiptTopLessThanOrEqualTo(String value) {
addCriterion("receipt_top <=", value, "receiptTop");
return (Criteria) this;
}
public Criteria andReceiptTopLike(String value) {
addCriterion("receipt_top like", value, "receiptTop");
return (Criteria) this;
}
public Criteria andReceiptTopNotLike(String value) {
addCriterion("receipt_top not like", value, "receiptTop");
return (Criteria) this;
}
public Criteria andReceiptTopIn(List<String> values) {
addCriterion("receipt_top in", values, "receiptTop");
return (Criteria) this;
}
public Criteria andReceiptTopNotIn(List<String> values) {
addCriterion("receipt_top not in", values, "receiptTop");
return (Criteria) this;
}
public Criteria andReceiptTopBetween(String value1, String value2) {
addCriterion("receipt_top between", value1, value2, "receiptTop");
return (Criteria) this;
}
public Criteria andReceiptTopNotBetween(String value1, String value2) {
addCriterion("receipt_top not between", value1, value2, "receiptTop");
return (Criteria) this;
}
public Criteria andReceiptSourceIsNull() {
addCriterion("receipt_source is null");
return (Criteria) this;
}
public Criteria andReceiptSourceIsNotNull() {
addCriterion("receipt_source is not null");
return (Criteria) this;
}
public Criteria andReceiptSourceEqualTo(String value) {
addCriterion("receipt_source =", value, "receiptSource");
return (Criteria) this;
}
public Criteria andReceiptSourceNotEqualTo(String value) {
addCriterion("receipt_source <>", value, "receiptSource");
return (Criteria) this;
}
public Criteria andReceiptSourceGreaterThan(String value) {
addCriterion("receipt_source >", value, "receiptSource");
return (Criteria) this;
}
public Criteria andReceiptSourceGreaterThanOrEqualTo(String value) {
addCriterion("receipt_source >=", value, "receiptSource");
return (Criteria) this;
}
public Criteria andReceiptSourceLessThan(String value) {
addCriterion("receipt_source <", value, "receiptSource");
return (Criteria) this;
}
public Criteria andReceiptSourceLessThanOrEqualTo(String value) {
addCriterion("receipt_source <=", value, "receiptSource");
return (Criteria) this;
}
public Criteria andReceiptSourceLike(String value) {
addCriterion("receipt_source like", value, "receiptSource");
return (Criteria) this;
}
public Criteria andReceiptSourceNotLike(String value) {
addCriterion("receipt_source not like", value, "receiptSource");
return (Criteria) this;
}
public Criteria andReceiptSourceIn(List<String> values) {
addCriterion("receipt_source in", values, "receiptSource");
return (Criteria) this;
}
public Criteria andReceiptSourceNotIn(List<String> values) {
addCriterion("receipt_source not in", values, "receiptSource");
return (Criteria) this;
}
public Criteria andReceiptSourceBetween(String value1, String value2) {
addCriterion("receipt_source between", value1, value2, "receiptSource");
return (Criteria) this;
}
public Criteria andReceiptSourceNotBetween(String value1, String value2) {
addCriterion("receipt_source not between", value1, value2, "receiptSource");
return (Criteria) this;
}
public Criteria andReceiptBottomIsNull() {
addCriterion("receipt_bottom is null");
return (Criteria) this;
}
public Criteria andReceiptBottomIsNotNull() {
addCriterion("receipt_bottom is not null");
return (Criteria) this;
}
public Criteria andReceiptBottomEqualTo(String value) {
addCriterion("receipt_bottom =", value, "receiptBottom");
return (Criteria) this;
}
public Criteria andReceiptBottomNotEqualTo(String value) {
addCriterion("receipt_bottom <>", value, "receiptBottom");
return (Criteria) this;
}
public Criteria andReceiptBottomGreaterThan(String value) {
addCriterion("receipt_bottom >", value, "receiptBottom");
return (Criteria) this;
}
public Criteria andReceiptBottomGreaterThanOrEqualTo(String value) {
addCriterion("receipt_bottom >=", value, "receiptBottom");
return (Criteria) this;
}
public Criteria andReceiptBottomLessThan(String value) {
addCriterion("receipt_bottom <", value, "receiptBottom");
return (Criteria) this;
}
public Criteria andReceiptBottomLessThanOrEqualTo(String value) {
addCriterion("receipt_bottom <=", value, "receiptBottom");
return (Criteria) this;
}
public Criteria andReceiptBottomLike(String value) {
addCriterion("receipt_bottom like", value, "receiptBottom");
return (Criteria) this;
}
public Criteria andReceiptBottomNotLike(String value) {
addCriterion("receipt_bottom not like", value, "receiptBottom");
return (Criteria) this;
}
public Criteria andReceiptBottomIn(List<String> values) {
addCriterion("receipt_bottom in", values, "receiptBottom");
return (Criteria) this;
}
public Criteria andReceiptBottomNotIn(List<String> values) {
addCriterion("receipt_bottom not in", values, "receiptBottom");
return (Criteria) this;
}
public Criteria andReceiptBottomBetween(String value1, String value2) {
addCriterion("receipt_bottom between", value1, value2, "receiptBottom");
return (Criteria) this;
}
public Criteria andReceiptBottomNotBetween(String value1, String value2) {
addCriterion("receipt_bottom not between", value1, value2, "receiptBottom");
return (Criteria) this;
}
public Criteria andStatusIsNull() {
addCriterion("`status` is null");
return (Criteria) this;

@ -184,7 +184,7 @@ public class HighGasDiscountOilPriceServiceImpl implements HighGasDiscountOilPri
payPriceModel.setOilLiters(oilingPrice.divide(priceGun, 2, BigDecimal.ROUND_HALF_DOWN));
// 平台折扣,我们平台或者代理商设置的折扣
payPriceModel.setDiscount(discount.compareTo(new BigDecimal("1.00")) == 0 ? new BigDecimal("100") : discount);
payPriceModel.setDiscount(discount.compareTo(new BigDecimal("1.00")) == 0 ? new BigDecimal("1.00") : discount);
// 加油补贴, 计算方式:加油站枪价 - 加油站VIP价
// payPriceModel.setOilSubsidy(priceGun.subtract(priceVip));
@ -193,12 +193,12 @@ public class HighGasDiscountOilPriceServiceImpl implements HighGasDiscountOilPri
BigDecimal decimal1 = new BigDecimal("1").subtract(discount);
// 油枪价 - 平台补贴
BigDecimal price = payPriceModel.getPriceGun().subtract(preferentialMargin);
// BigDecimal price = payPriceModel.getPriceGun().subtract(preferentialMargin);
// 优惠价格 (油枪价 - 平台补贴) * 系统折扣
payPriceModel.setPricePreferences(price.multiply(discount).setScale(2, BigDecimal.ROUND_HALF_UP));
// 优惠价格 油站VIP价 * 系统折扣
payPriceModel.setPricePreferences(priceVip.multiply(discount).setScale(2, BigDecimal.ROUND_HALF_UP));
// 每升优惠 价 - 优惠价格
// 每升优惠 国标价 - 优惠价格
payPriceModel.setLitersPreferences(payPriceModel.getPriceOfficial().subtract(payPriceModel.getPricePreferences()));
// 本次优惠 加油升数 * 每升优惠
@ -251,7 +251,7 @@ public class HighGasDiscountOilPriceServiceImpl implements HighGasDiscountOilPri
payPriceModel.setOilLiters(oilingPrice.divide(priceGun, 2, BigDecimal.ROUND_HALF_DOWN));
// 平台折扣,我们平台或者代理商设置的折扣
payPriceModel.setDiscount(discount.compareTo(new BigDecimal("1.00")) == 0 ? new BigDecimal("100") : discount);
payPriceModel.setDiscount(discount.compareTo(new BigDecimal("1.00")) == 0 ? new BigDecimal("1.00") : discount);
// 加油补贴, 计算方式:团油枪价 - 团油VIP价
// payPriceModel.setOilSubsidy(priceGun.subtract(priceVip));

@ -1724,6 +1724,10 @@ public class HighOrderServiceImpl implements HighOrderService {
// 查询油站云打印设备
List<HighDevice> deviceList = deviceService.getDeviceListByStoreId(gasId);
for (HighDevice device : deviceList) {
Map<String, Object> receiptMap = new HashMap<>();
receiptMap.put("receiptTop", device.getReceiptTop());
receiptMap.put("receiptSource", device.getReceiptSource());
receiptMap.put("receiptBottom", device.getReceiptBottom());
if (device.getType().equals(DeviceTypeEnum.type1.getType())) {
new Thread(() -> {
@ -1735,25 +1739,13 @@ public class HighOrderServiceImpl implements HighOrderService {
order.getOrderNo(),
DateUtil.date2String(order.getPayTime(), "yyyy-MM-dd HH:mm:ss"),
order.getMemPhone(),
"嗨森逛",
childOrder.getGasGunNo(),
childOrder.getGasOilNo(),
childOrder.getGasOilLiters().toString(),
order.getTotalPrice().toString(),
receiptMap,
makeUp
) + "<BR>";
/* +
SpPrinterTemplate.oilClientStubTemp(
childOrder.getGoodsName(),
order.getOrderNo(),
DateUtil.date2String(order.getPayTime(), "yyyy-MM-dd HH:mm:ss"),
order.getMemPhone(),
"嗨森逛",
childOrder.getGasGunNo(),
childOrder.getGasOilNo(),
childOrder.getGasOilLiters().toString(),
order.getTotalPrice().toString()
) + "<BR>";*/
);
sp.print(device.getDeviceSn(), printStr, 1);
} catch (Exception e) {
e.printStackTrace();
@ -1775,6 +1767,7 @@ public class HighOrderServiceImpl implements HighOrderService {
childOrder.getGasOilNo(),
childOrder.getGasOilLiters().toString(),
order.getTotalPrice().toString(),
receiptMap,
makeUp
));
} catch (Exception e) {

Loading…
Cancel
Save