TRX пре 1 година
родитељ
комит
5eea11601e

+ 2 - 2
OneCardIotClient/src/main/java/com/zhongshu/iot/client/model/iot/IotMainSearch.java

@@ -1,8 +1,8 @@
 package com.zhongshu.iot.client.model.iot;
 
+import com.github.microservice.types.FunctionType;
 import com.zhongshu.iot.client.model.baseParam.SuperSearchParam;
 import com.zhongshu.iot.client.type.DataType;
-import com.github.microservice.types.FunctionType;
 import com.zhongshu.iot.client.type.IotDataType;
 import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.AllArgsConstructor;
@@ -30,7 +30,7 @@ public class IotMainSearch extends SuperSearchParam {
     @Schema(description = "功能类型")
     private FunctionType functionType;
 
-    @Schema(description = "标识符")
+    @Schema(description = "标识符,如:ConsumTransactions,用户刷卡综合")
     private String identifier;
 
     @Schema(description = "数据类型")

+ 4 - 0
OneCardIotServer/src/main/java/com/zhongshu/iot/server/core/dao/iot/impl/IotMainDaoImpl.java

@@ -51,14 +51,17 @@ public class IotMainDaoImpl extends BaseImpl implements IotMainDaoExtend {
             criteria.and("iotDataType").is(param.getIotDataType());
         }
 
+        // 数据类型
         if (param.getDataType() != null) {
             criteria.and("dataType").is(param.getDataType());
         }
 
+        // 设备deviceId
         if (StringUtils.isNotEmpty(param.getDeviceId())) {
             criteria.and("deviceId").is(param.getDeviceId());
         }
 
+        // 网关gateWayId
         if (StringUtils.isNotEmpty(param.getGateWayId())) {
             criteria.and("gateWayId").is(param.getGateWayId());
         }
@@ -69,6 +72,7 @@ public class IotMainDaoImpl extends BaseImpl implements IotMainDaoExtend {
             Pattern pattern = Pattern.compile("^.*" + param.getName() + ".*$");
             criterias.add(Criteria.where("name").is(pattern));
         }
+        // 标识符
         if (StringUtils.isNotEmpty(param.getIdentifier())) {
             Pattern pattern = Pattern.compile("^.*" + param.getIdentifier() + ".*$");
             criterias.add(Criteria.where("identifier").is(pattern));

+ 6 - 0
OneCardIotServer/src/main/java/com/zhongshu/iot/server/core/httpRequest/conf/FullCardAPIConfig.java

@@ -36,6 +36,8 @@ public class FullCardAPIConfig {
     public static final String syncDeviceOnLineState = api + "/deviceSync/syncDeviceOnLineState";
     public static final String lastDeviceOnLineTime = api + "/deviceSync/lastDeviceOnLineTime";
 
+    public static final String iotQueryProjectConfig = api + "/openAPI/projectConfig/v1/iotQueryProjectConfig";
+
     public static final HashMap<String, ApiConfParam> map = new HashMap<>();
 
     static {
@@ -59,6 +61,10 @@ public class FullCardAPIConfig {
         map.put(syncGateWays, ApiConfParam.builder().apiName(syncGateWays).methodType(MethodType.Json.name()).build());
         map.put(syncDeviceOnLineState, ApiConfParam.builder().apiName(syncDeviceOnLineState).methodType(MethodType.Json.name()).build());
         map.put(lastDeviceOnLineTime, ApiConfParam.builder().apiName(lastDeviceOnLineTime).methodType(MethodType.Json.name()).build());
+
+        // 查询项目的配置信息
+        map.put(iotQueryProjectConfig, ApiConfParam.builder().apiName(iotQueryProjectConfig).methodType(MethodType.Json.name()).build());
+
     }
 
     public static ApiConfParam getApiConfParam(String apiName) {

+ 3 - 2
OneCardIotServer/src/main/java/com/zhongshu/iot/server/core/service/sync/DeviceSyncFullCardService.java

@@ -1,9 +1,11 @@
 package com.zhongshu.iot.server.core.service.sync;
 
+import com.github.microservice.http.APIResponseModel;
 import com.github.microservice.models.device.DeviceInfoSyncParam;
 import com.github.microservice.models.device.DeviceSyncListParam;
 import com.github.microservice.models.device.GateWaySyncParam;
 import com.github.microservice.models.hxz.DevicePingInfoParam;
+import com.github.microservice.net.ResultContent;
 import com.zhongshu.iot.server.core.dao.mqtt.DeviceInfoDao;
 import com.zhongshu.iot.server.core.dao.mqtt.GateWay2DeviceDao;
 import com.zhongshu.iot.server.core.dao.mqtt.GateWayInfoDao;
@@ -15,12 +17,10 @@ import com.zhongshu.iot.server.core.event.DeviceStateChangeEvent;
 import com.zhongshu.iot.server.core.event.DeviceSyncEvent;
 import com.zhongshu.iot.server.core.event.GateWaySyncEvent;
 import com.zhongshu.iot.server.core.httpRequest.ApiRequestService;
-import com.github.microservice.http.APIResponseModel;
 import com.zhongshu.iot.server.core.httpRequest.conf.FullCardAPIConfig;
 import com.zhongshu.iot.server.core.service.base.SuperService;
 import com.zhongshu.iot.server.core.service.user.OperationLogsService;
 import com.zhongshu.iot.server.core.util.bean.BeanUtils;
-import com.github.microservice.net.ResultContent;
 import lombok.SneakyThrows;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.ObjectUtils;
@@ -188,6 +188,7 @@ public class DeviceSyncFullCardService extends SuperService {
             List<GateWaySyncParam.GateWaySyncInfo> list = gateWayInfos.stream().map(it -> {
                 GateWaySyncParam.GateWaySyncInfo syncInfo = new GateWaySyncParam.GateWaySyncInfo();
                 BeanUtils.copyProperties(it, syncInfo);
+                syncInfo.setState(it.getOnLineState());
                 return syncInfo;
             }).collect(Collectors.toList());
             syncParam.setList(list);

+ 1 - 1
OneCardIotServer/src/main/java/com/zhongshu/iot/server/core/util/test/Test153AddUser.java

@@ -46,7 +46,7 @@ public class Test153AddUser {
             StopWatch stopWatch = new StopWatch();
 
             stopWatch.start("开始添加用户");
-            for (int i = 0; i < 100; i++) {
+            for (int i = 0; i < 10; i++) {
                 String name = "mqttUser" + i;
                 try {
                     addressControl.removeUser(name);