提交代码

dev-discount
胡锐 2 years ago
parent 38f8f812da
commit 2b55ac1f44
  1. 4
      hai-bweb/src/main/java/com/bweb/controller/HighGasClassGroupTaskController.java
  2. 2
      hai-bweb/src/main/java/com/bweb/controller/HighOrderController.java
  3. 2
      hai-cweb/src/main/java/com/cweb/controller/HighTestController.java
  4. 2
      hai-cweb/src/main/java/com/cweb/controller/pay/UnionPayController.java
  5. 14
      hai-service/src/main/java/com/hai/config/SpPrinterTemplate.java
  6. 27
      hai-service/src/main/java/com/hai/config/ZkcPrinterTemplate.java
  7. 2
      hai-service/src/main/java/com/hai/service/HighOrderService.java
  8. 4
      hai-service/src/main/java/com/hai/service/impl/HighGasClassGroupTaskServiceImpl.java
  9. 14
      hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java
  10. 4
      hai-service/src/main/java/com/hai/service/pay/impl/GoodsOrderServiceImpl.java
  11. 1
      v1/src/main/java/com/v1/controller/RechargeProductController.java

@ -223,7 +223,7 @@ public class HighGasClassGroupTaskController {
try { try {
// 推送打印机 // 推送打印机
SpPrinterConfig spPrinterConfig = new SpPrinterConfig(); SpPrinterConfig spPrinterConfig = new SpPrinterConfig();
spPrinterConfig.print(device.getDeviceSn(), SpPrinterTemplate.classGroupCountTemp(dataCount), 1); spPrinterConfig.print(device.getDeviceSn(), SpPrinterTemplate.classGroupCountTemp(dataCount, true), 1);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
@ -233,7 +233,7 @@ public class HighGasClassGroupTaskController {
new Thread(() -> { new Thread(() -> {
try { try {
// 推送打印机 // 推送打印机
mqttProviderConfig.publish(2,false, device.getDeviceImei(), ZkcPrinterTemplate.classGroupCountTemp(dataCount)); mqttProviderConfig.publish(2,false, device.getDeviceImei(), ZkcPrinterTemplate.classGroupCountTemp(dataCount,true));
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }

@ -90,7 +90,7 @@ public class HighOrderController {
// 1. 热敏打印机 2. 云打印机 // 1. 热敏打印机 2. 云打印机
if (printType == 2) { if (printType == 2) {
highOrderService.printGasOrder(order.getHighChildOrderList().get(0).getGoodsId(), order); highOrderService.printGasOrder(order.getHighChildOrderList().get(0).getGoodsId(), order, true);
} }
return ResponseMsgUtil.success("操作成功"); return ResponseMsgUtil.success("操作成功");

File diff suppressed because one or more lines are too long

@ -374,7 +374,7 @@ public class UnionPayController {
if (order.getHighChildOrderList().get(0).getGoodsType().equals(3)) { if (order.getHighChildOrderList().get(0).getGoodsType().equals(3)) {
new Thread(() -> { new Thread(() -> {
highOrderService.printGasOrder(order.getHighChildOrderList().get(0).getGoodsId(), order); highOrderService.printGasOrder(order.getHighChildOrderList().get(0).getGoodsId(), order, false);
}).start(); }).start();
} }
} }

@ -15,8 +15,8 @@ public class SpPrinterTemplate {
/** /**
* 加油站收银员存根模板 * 加油站收银员存根模板
*/ */
public static String classGroupCountTemp(GasClassGroupTaskDataCount dataCount) throws Exception { public static String classGroupCountTemp(GasClassGroupTaskDataCount dataCount, boolean makeUp) throws Exception {
String str = "<C>" + dataCount.getClassNum() + "班结流水</C> <BR> " + String str = "<C>" + dataCount.getClassNum() + "班结流水" + (makeUp?"(补打)":"") + "</C> <BR> " +
"===============================<BR>" + "===============================<BR>" +
"开始时间:" + DateUtil.date2String(dataCount.getStartTime(), "yyyy-MM-dd HH:mm:ss") + "<BR>" + "开始时间:" + DateUtil.date2String(dataCount.getStartTime(), "yyyy-MM-dd HH:mm:ss") + "<BR>" +
"结束时间:" + DateUtil.date2String(dataCount.getEndTime(), "yyyy-MM-dd HH:mm:ss") + "<BR>" + "结束时间:" + DateUtil.date2String(dataCount.getEndTime(), "yyyy-MM-dd HH:mm:ss") + "<BR>" +
@ -62,8 +62,9 @@ public class SpPrinterTemplate {
String gunNo, String gunNo,
String oilNo, String oilNo,
String oilLiters, String oilLiters,
String orderPrice) throws Exception { String orderPrice,
String str = "<C><B>" + gasName + "</B></C> <BR> " + boolean makeUp) throws Exception {
String str = "<C><B>" + gasName + (makeUp?"(补打)":"") + "</B></C> <BR> " +
"<C>(收银员存根)</C> <BR>" + "<C>(收银员存根)</C> <BR>" +
"------------------------------<BR>" + "------------------------------<BR>" +
"流水:" + orderNo + "<BR>" + "流水:" + orderNo + "<BR>" +
@ -104,8 +105,9 @@ public class SpPrinterTemplate {
String gunNo, String gunNo,
String oilNo, String oilNo,
String oilLiters, String oilLiters,
String orderPrice) throws Exception { String orderPrice,
String str = "<C><B>" + gasName + "</B></C> <BR> " + boolean makeUp) throws Exception {
String str = "<C><B>" + gasName + (makeUp?"(补打)":"") +"</B></C> <BR> " +
"<C>(客户存根)</C> <BR>" + "<C>(客户存根)</C> <BR>" +
"------------------------------<BR>" + "------------------------------<BR>" +
"流水:" + orderNo + "<BR>" + "流水:" + orderNo + "<BR>" +

@ -17,14 +17,14 @@ public class ZkcPrinterTemplate {
* 加油站 * 加油站
* @return * @return
*/ */
public static byte[] classGroupCountTemp(GasClassGroupTaskDataCount dataCount) throws Exception { public static byte[] classGroupCountTemp(GasClassGroupTaskDataCount dataCount, boolean makeUp) throws Exception {
ByteArrayOutputStream stream = new ByteArrayOutputStream(); ByteArrayOutputStream stream = new ByteArrayOutputStream();
// 居中 // 居中
stream.write(0x1B); stream.write(0x1B);
stream.write(0x61); stream.write(0x61);
stream.write(0x01); stream.write(0x01);
stream.write((dataCount.getClassNum() + "班结流水").getBytes("UTF-8")); stream.write((dataCount.getClassNum() + "班结流水"+ (makeUp?"(补打)":"")).getBytes("UTF-8"));
stream.write(0x0A); stream.write(0x0A);
stream.write("================================".getBytes("UTF-8")); stream.write("================================".getBytes("UTF-8"));
stream.write(0x0A); stream.write(0x0A);
@ -106,14 +106,15 @@ public class ZkcPrinterTemplate {
String gunNo, String gunNo,
String oilNo, String oilNo,
String oilLiters, String oilLiters,
String orderPrice) throws Exception { String orderPrice,
boolean makeUp) throws Exception {
ByteArrayOutputStream stream = new ByteArrayOutputStream(); ByteArrayOutputStream stream = new ByteArrayOutputStream();
// 居中 // 居中
stream.write(0x1B); stream.write(0x1B);
stream.write(0x61); stream.write(0x61);
stream.write(0x01); stream.write(0x01);
stream.write(gasName.getBytes("UTF-8")); stream.write((gasName + (makeUp?"(补打)":"")).getBytes("UTF-8"));
stream.write(0x0A); stream.write(0x0A);
stream.write("(收银员存根)".getBytes("UTF-8")); stream.write("(收银员存根)".getBytes("UTF-8"));
stream.write(0x0A); stream.write(0x0A);
@ -280,14 +281,15 @@ public class ZkcPrinterTemplate {
String gunNo, String gunNo,
String oilNo, String oilNo,
String oilLiters, String oilLiters,
String orderPrice) throws Exception { String orderPrice,
boolean makeUp) throws Exception {
ByteArrayOutputStream stream = new ByteArrayOutputStream(); ByteArrayOutputStream stream = new ByteArrayOutputStream();
// 居中 // 居中
stream.write(0x1B); stream.write(0x1B);
stream.write(0x61); stream.write(0x61);
stream.write(0x01); stream.write(0x01);
stream.write(gasName.getBytes("UTF-8")); stream.write((gasName + (makeUp?"(补打)":"")).getBytes("UTF-8"));
stream.write(0x0A); stream.write(0x0A);
stream.write("(收银员存根)".getBytes("UTF-8")); stream.write("(收银员存根)".getBytes("UTF-8"));
stream.write(0x0A); stream.write(0x0A);
@ -316,10 +318,10 @@ public class ZkcPrinterTemplate {
stream.write("来源:嗨森逛".getBytes("UTF-8")); stream.write("来源:嗨森逛".getBytes("UTF-8"));
stream.write(0x0A); stream.write(0x0A);
stream.write(("油枪:" + gunNo).getBytes("UTF-8")); stream.write(("油枪:" + gunNo + "号").getBytes("UTF-8"));
stream.write(0x0A); stream.write(0x0A);
stream.write(("油品:" + oilNo).getBytes("UTF-8")); stream.write(("油品:" + oilNo + "#").getBytes("UTF-8"));
stream.write(0x0A); stream.write(0x0A);
stream.write(("升数:" + oilLiters + "升").getBytes("UTF-8")); stream.write(("升数:" + oilLiters + "升").getBytes("UTF-8"));
@ -379,7 +381,8 @@ public class ZkcPrinterTemplate {
String gunNo, String gunNo,
String oilNo, String oilNo,
String oilLiters, String oilLiters,
String orderPrice) throws Exception { String orderPrice,
boolean makeUp) throws Exception {
ByteArrayOutputStream stream = new ByteArrayOutputStream(); ByteArrayOutputStream stream = new ByteArrayOutputStream();
// 居中 // 居中
@ -387,7 +390,7 @@ public class ZkcPrinterTemplate {
stream.write(0x61); stream.write(0x61);
stream.write(0x01); stream.write(0x01);
stream.write(gasName.getBytes("UTF-8")); stream.write((gasName + (makeUp?"(补打)":"")).getBytes("UTF-8"));
stream.write(0x0A); stream.write(0x0A);
stream.write("(客户存根)".getBytes("UTF-8")); stream.write("(客户存根)".getBytes("UTF-8"));
stream.write(0x0A); stream.write(0x0A);
@ -416,10 +419,10 @@ public class ZkcPrinterTemplate {
stream.write("来源:嗨森逛".getBytes("UTF-8")); stream.write("来源:嗨森逛".getBytes("UTF-8"));
stream.write(0x0A); stream.write(0x0A);
stream.write(("油枪:" + gunNo).getBytes("UTF-8")); stream.write(("油枪:" + gunNo + "号").getBytes("UTF-8"));
stream.write(0x0A); stream.write(0x0A);
stream.write(("油品:" + oilNo).getBytes("UTF-8")); stream.write(("油品:" + oilNo + "#").getBytes("UTF-8"));
stream.write(0x0A); stream.write(0x0A);
stream.write(("升数:" + oilLiters + "升").getBytes("UTF-8")); stream.write(("升数:" + oilLiters + "升").getBytes("UTF-8"));

@ -468,7 +468,7 @@ public interface HighOrderService {
* 打印加油订单 * 打印加油订单
* @param gasId * @param gasId
*/ */
void printGasOrder(Long gasId, HighOrder order); void printGasOrder(Long gasId, HighOrder order, boolean makeUp);
/** /**
* @Author Sum1Dream * @Author Sum1Dream

@ -104,7 +104,7 @@ public class HighGasClassGroupTaskServiceImpl implements HighGasClassGroupTaskSe
try { try {
// 推送打印机 // 推送打印机
SpPrinterConfig spPrinterConfig = new SpPrinterConfig(); SpPrinterConfig spPrinterConfig = new SpPrinterConfig();
spPrinterConfig.print(device.getDeviceSn(), SpPrinterTemplate.classGroupCountTemp(dataCount), 1); spPrinterConfig.print(device.getDeviceSn(), SpPrinterTemplate.classGroupCountTemp(dataCount, false), 1);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
@ -114,7 +114,7 @@ public class HighGasClassGroupTaskServiceImpl implements HighGasClassGroupTaskSe
new Thread(() -> { new Thread(() -> {
try { try {
// 推送打印机 // 推送打印机
mqttProviderConfig.publish(2,false, device.getDeviceImei(), ZkcPrinterTemplate.classGroupCountTemp(dataCount)); mqttProviderConfig.publish(2,false, device.getDeviceImei(), ZkcPrinterTemplate.classGroupCountTemp(dataCount, false));
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }

@ -492,7 +492,7 @@ public class HighOrderServiceImpl implements HighOrderService {
new Thread(() -> { new Thread(() -> {
if (highOrder.getHighChildOrderList().get(0).getGoodsType().equals(3)) { if (highOrder.getHighChildOrderList().get(0).getGoodsType().equals(3)) {
printGasOrder(highOrder.getHighChildOrderList().get(0).getGoodsId(), highOrder); printGasOrder(highOrder.getHighChildOrderList().get(0).getGoodsId(), highOrder, false);
Map<String, Object> pushMsg = new HashMap<>(); Map<String, Object> pushMsg = new HashMap<>();
pushMsg.put("userId", highOrder.getHighChildOrderList().get(0).getGoodsId()); pushMsg.put("userId", highOrder.getHighChildOrderList().get(0).getGoodsId());
@ -736,7 +736,7 @@ public class HighOrderServiceImpl implements HighOrderService {
new Thread(() -> { new Thread(() -> {
if (order.getHighChildOrderList().get(0).getGoodsType().equals(3)) { if (order.getHighChildOrderList().get(0).getGoodsType().equals(3)) {
printGasOrder(order.getHighChildOrderList().get(0).getGoodsId(), order); printGasOrder(order.getHighChildOrderList().get(0).getGoodsId(), order, false);
Map<String, Object> pushMsg = new HashMap<>(); Map<String, Object> pushMsg = new HashMap<>();
pushMsg.put("userId", order.getHighChildOrderList().get(0).getGoodsId()); pushMsg.put("userId", order.getHighChildOrderList().get(0).getGoodsId());
@ -1065,7 +1065,7 @@ public class HighOrderServiceImpl implements HighOrderService {
new Thread(() -> { new Thread(() -> {
if (order.getHighChildOrderList().get(0).getGoodsType().equals(3)) { if (order.getHighChildOrderList().get(0).getGoodsType().equals(3)) {
printGasOrder(order.getHighChildOrderList().get(0).getGoodsId(), order); printGasOrder(order.getHighChildOrderList().get(0).getGoodsId(), order, false);
Map<String, Object> pushMsg = new HashMap<>(); Map<String, Object> pushMsg = new HashMap<>();
pushMsg.put("userId", order.getHighChildOrderList().get(0).getGoodsId()); pushMsg.put("userId", order.getHighChildOrderList().get(0).getGoodsId());
@ -1713,7 +1713,7 @@ public class HighOrderServiceImpl implements HighOrderService {
} }
@Override @Override
public void printGasOrder(Long gasId, HighOrder order) { public void printGasOrder(Long gasId, HighOrder order, boolean makeUp) {
if (order == null) { if (order == null) {
return; return;
} }
@ -1739,7 +1739,8 @@ public class HighOrderServiceImpl implements HighOrderService {
childOrder.getGasGunNo(), childOrder.getGasGunNo(),
childOrder.getGasOilNo(), childOrder.getGasOilNo(),
childOrder.getGasOilLiters().toString(), childOrder.getGasOilLiters().toString(),
order.getTotalPrice().toString() order.getTotalPrice().toString(),
makeUp
) + "<BR>"; ) + "<BR>";
/* + /* +
SpPrinterTemplate.oilClientStubTemp( SpPrinterTemplate.oilClientStubTemp(
@ -1773,7 +1774,8 @@ public class HighOrderServiceImpl implements HighOrderService {
childOrder.getGasGunNo(), childOrder.getGasGunNo(),
childOrder.getGasOilNo(), childOrder.getGasOilNo(),
childOrder.getGasOilLiters().toString(), childOrder.getGasOilLiters().toString(),
order.getTotalPrice().toString() order.getTotalPrice().toString(),
makeUp
)); ));
} catch (Exception e) { } catch (Exception e) {
e.getMessage(); e.getMessage();

@ -430,8 +430,8 @@ public class GoodsOrderServiceImpl implements PayService {
}).start(); }).start();
} }
} }
highOrderService.printGasOrder(order.getHighChildOrderList().get(0).getGoodsId(), order); highOrderService.printGasOrder(order.getHighChildOrderList().get(0).getGoodsId(), order, false);
} catch (Exception e){ } catch (Exception e) {
} }
}).start(); }).start();

@ -10,7 +10,6 @@ import com.hai.model.ResponseData;
import com.hai.service.*; import com.hai.service.*;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import jdk.jfr.consumer.RecordedObject;
import org.apache.commons.collections4.MapUtils; import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;

Loading…
Cancel
Save