TRX 1 рік тому
батько
коміт
38f22c4042

+ 6 - 0
pom.xml

@@ -396,6 +396,12 @@
             <version>3.2.4</version>
         </dependency>
 
+        <dependency>
+            <groupId>com.zswl</groupId>
+            <artifactId>ConfigModel</artifactId>
+            <version>1.0.0-SNAPSHOT</version>
+        </dependency>
+
     </dependencies>
 
 

+ 1 - 2
src/main/java/com/zswl/dataservice/service/mqtt/DeviceSyncFullCardService.java

@@ -9,7 +9,6 @@ import com.zswl.dataservice.event.GateWaySyncEvent;
 import com.zswl.dataservice.httpRequest.ApiRequestService;
 import com.zswl.dataservice.service.base.SuperService;
 import com.zswl.dataservice.utils.result.ResultContent;
-import lombok.Data;
 import lombok.SneakyThrows;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.ObjectUtils;
@@ -21,7 +20,6 @@ import org.springframework.stereotype.Service;
 
 import java.util.ArrayList;
 import java.util.List;
-import java.util.concurrent.TimeUnit;
 import java.util.stream.Collectors;
 
 /**
@@ -82,6 +80,7 @@ public class DeviceSyncFullCardService extends SuperService {
 
     /**
      * 通知同步设备
+     *
      * @param deviceIds
      * @return
      */

+ 2 - 2
src/main/java/com/zswl/dataservice/service/mqtt/GateWayInfoService.java

@@ -77,12 +77,12 @@ public class GateWayInfoService extends SuperService {
      * @return
      */
     public ResultContent addGateWayInfo(GateWayInfoAddParam param) {
+        initDefaultUser(param);
         GateWayInfo gateWayInfo = gateWayInfoDao.findTopByGateWayId(param.getGateWayId());
         if(ObjectUtils.isEmpty(gateWayInfo)){
             gateWayInfo = new GateWayInfo();
         }
-        initDefaultUser(param);
-        BeanUtils.copyProperties(param, gateWayInfo);
+        BeanUtils.copyProperties(param, gateWayInfo, "id");
         if (param.getState() == null) {
             gateWayInfo.setState(OnLineState.OffLine);
         }