Sfoglia il codice sorgente

Merge branch 'hotfix/1.2.1'

Zhenghanjv 7 mesi fa
parent
commit
75e0408a99

+ 11 - 0
ai-fueling/src/main/java/com/tokheim/aifueling/communication/toInternalInterface/InterfaceUtils.java

@@ -138,6 +138,17 @@ public class InterfaceUtils {
     private static boolean sortBalanceComm(Integer dataType, BaseInfo baseInfo) throws IOException {
         //挂枪指令信息加入缓存
         if (dataType == 2 && baseInfo.getEventType() == 2) {
+            //一键加油没有弹卡,需要直接发送挂枪指令
+            if (baseInfo.getCardType() == 0 || baseInfo.getCardType() == 4) {
+                NozzleStatus nozzleStatus = (NozzleStatus) baseInfo;
+                BigDecimal amount = new BigDecimal(nozzleStatus.getAmount());
+                BigDecimal balance = new BigDecimal(nozzleStatus.getBalance());
+                nozzleStatus.setBalance(balance.subtract(amount).toString());
+
+                String response = interfaceApi.sendData(2, nozzleStatus);
+                log.info("授权码,发送挂枪指令,收到内部接口响应:{}",response);
+                return false;
+            }
             commMap.put(baseInfo.getNozzleNum()+HANG, baseInfo);
             return false;
         }