tanbin hai 8 meses
pai
achega
44d0c04f44

+ 4 - 2
device-api-service/src/main/java/com/xy/service/factory/device/impl/open/OpenDeviceFactoryImpl.java

@@ -2,6 +2,7 @@ package com.xy.service.factory.device.impl.open;
 
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.util.BooleanUtil;
 import cn.hutool.core.util.StrUtil;
 import cn.hutool.json.JSONObject;
 import cn.hutool.json.JSONUtil;
@@ -210,9 +211,9 @@ public class OpenDeviceFactoryImpl implements DeviceFactory {
                 //  NFC 支付宝碰一下激活
                 ActiveDeviceDTO activeDeviceDTO = new ActiveDeviceDTO().setTerminalId(String.valueOf(deviceId))
                         .setDeviceName(deviceName)
-                        .setBoardSn(deviceSysinfo.getDeviceSn()).setNfcSn(deviceSysinfo.getNfcSn()).setAddress(dv.getPlaceName());
+                        .setBoardSn(nfcSn).setNfcSn(nfcSn).setAddress(dv.getPlaceName());
                 Boolean b = R.feignCheckData(alipayDeviceService.nfcDeviceActive(activeDeviceDTO));
-                if (b) {
+                if (BooleanUtil.isFalse(b)) {
                     throw new RuntimeException("NFC设备激活失败!");
                 }
             }
@@ -255,6 +256,7 @@ public class OpenDeviceFactoryImpl implements DeviceFactory {
                 .set(DeviceInfo::getActiveTime, null)
                 .eq(DeviceInfo::getDeviceId, restActive.getDeviceId())
         );
+
         return R.ok();
     }