Browse Source

传递参数机号

xiari 11 tháng trước cách đây
mục cha
commit
fabe093783

+ 2 - 1
ruoyi-server/ruoyi-server-hik/src/main/java/org/dromara/server/hik/event/handler/ConsumptionEventHandler.java

@@ -43,8 +43,8 @@ public class ConsumptionEventHandler implements HikEventHandler {
         ConsumptionEventReceive receive = jsonObject.toJavaObject(ConsumptionEventReceive.class);
         ConsumptionEventDetail consumptionEvent = receive.getConsumptionEvent();
         log.info("消费机事件,类型:{}", consumptionEvent.getMinor());
+        XfTermVo termVo = termService.queryByMac(receive.getMacAddress());
         if (TRANSACTION_PREPROCESSING_REQUEST.equals(consumptionEvent.getMinor())) {
-            XfTermVo termVo = termService.queryByMac(receive.getMacAddress());
             if (termVo == null) {
                 log.error("消费机交易记录事件,设备信息为空,mac:{}, 不存在系统中", receive.getMacAddress());
                 // 直接应答失败
@@ -98,6 +98,7 @@ public class ConsumptionEventHandler implements HikEventHandler {
             RemoteConsumeBo remoteBo = setParamBo(receive, consumptionEvent);
             remoteBo.setRecordStatus(364L);
             remoteBo.setRecordId(0L);
+            remoteBo.setTermNo(termVo.getTermNo());
             RemoteResultDto result = remoteConsumeService.dealHikUploadRecord(remoteBo);
 //            log.info("消费机消费请求确认事件,结果:{}", JSONObject.toJSONString(result.getUpdatedRemoteBo()));
             R<ErrorInfo> errorInfo = result.getErrorInfo();

+ 1 - 0
ruoyi-server/ruoyi-server-hik/src/main/java/org/dromara/server/hik/event/handler/TransactionRecordEventHandler.java

@@ -78,6 +78,7 @@ public class TransactionRecordEventHandler implements HikEventHandler {
         // 如果是在线交易的,平台根据流水号判断当前交易记录事件是否为未处理事件,若为未处理事件,则平台进行处理并进行扣费;
         // 如果是离线交易记录事件,则平台进行处理并进行扣费;
         RemoteConsumeBo remoteBo = getRemoteBo(transactionRecordEventReceive);
+        remoteBo.setTermNo(termNo);
         R<ErrorInfo> errorInfo = R.fail("处理失败");
         try  {
             if (ModeTypeEnum.offLine.getCode().equals(modeType)) {