feat:在线查询、注册消息缺少时间等修复
parent
720901e9eb
commit
f0c4b175f7
|
@ -68,13 +68,13 @@ public interface IDeviceInfoData extends IOwnedData<DeviceInfo, String> {
|
|||
* @param subUid 子账号id
|
||||
* @param productKey 产品key
|
||||
* @param groupId 设备分组
|
||||
* @param state 是否在线:online在线,offline离线
|
||||
* @param online 是否在线:true在线,false离线
|
||||
* @param keyword 关键字
|
||||
* @param page 页码
|
||||
* @param size 分页大小
|
||||
*/
|
||||
Paging<DeviceInfo> findByConditions(String uid, String subUid, String productKey,
|
||||
String groupId, String state, String keyword,
|
||||
String groupId, Boolean online, String keyword,
|
||||
int page, int size);
|
||||
|
||||
/**
|
||||
|
|
|
@ -148,7 +148,7 @@ public class DeviceInfoDataCache implements IDeviceInfoData, SmartInitializingSi
|
|||
|
||||
@Override
|
||||
public Paging<DeviceInfo> findByConditions(String uid, String subUid, String productKey,
|
||||
String groupId, String state, String keyword, int page, int size) {
|
||||
String groupId, Boolean state, String keyword, int page, int size) {
|
||||
return deviceInfoData.findByConditions(uid, subUid, productKey, groupId, state, keyword, page, size);
|
||||
}
|
||||
|
||||
|
|
|
@ -128,8 +128,8 @@ public class DeviceInfoPropertyDataCache implements IDeviceInfoData {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Paging<DeviceInfo> findByConditions(String uid, String subUid, String productKey, String groupId, String state, String keyword, int page, int size) {
|
||||
return deviceInfoData.findByConditions(uid, subUid, productKey, groupId, state, keyword, page, size);
|
||||
public Paging<DeviceInfo> findByConditions(String uid, String subUid, String productKey, String groupId, Boolean online, String keyword, int page, int size) {
|
||||
return deviceInfoData.findByConditions(uid, subUid, productKey, groupId, online, keyword, page, size);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -207,7 +207,7 @@ public class DeviceInfoDataImpl implements IDeviceInfoData, IJPACommData<DeviceI
|
|||
@Override
|
||||
public Paging<DeviceInfo> findByConditions(String uid, String subUid,
|
||||
String productKey, String groupId,
|
||||
String state, String keyword,
|
||||
Boolean online, String keyword,
|
||||
int page, int size) {
|
||||
JPAQuery<TbDeviceInfo> query = jpaQueryFactory.selectFrom(tbDeviceInfo);
|
||||
|
||||
|
@ -230,8 +230,8 @@ public class DeviceInfoDataImpl implements IDeviceInfoData, IJPACommData<DeviceI
|
|||
query.where(tbDeviceInfo.productKey.eq(productKey));
|
||||
}
|
||||
|
||||
if (StringUtils.isNotBlank(state)) {
|
||||
query.where(tbDeviceInfo.state.eq(state));
|
||||
if (online != null) {
|
||||
query.where(tbDeviceInfo.state.eq(online ? "online" : "offline"));
|
||||
}
|
||||
|
||||
if (StringUtils.isNotBlank(keyword)) {
|
||||
|
@ -384,7 +384,7 @@ public class DeviceInfoDataImpl implements IDeviceInfoData, IJPACommData<DeviceI
|
|||
|
||||
@Override
|
||||
public List<DeviceInfo> findByIds(Collection<String> ids) {
|
||||
return MapstructUtils.convert(deviceInfoRepository.findAllById(ids),DeviceInfo.class);
|
||||
return MapstructUtils.convert(deviceInfoRepository.findAllById(ids), DeviceInfo.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -23,7 +23,6 @@ import lombok.EqualsAndHashCode;
|
|||
@ApiModel(value = "DeviceQueryBo")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = DeviceInfo.class, reverseConvertGenerate = false)
|
||||
public class DeviceQueryBo extends BaseDto {
|
||||
|
||||
|
||||
|
@ -60,7 +59,7 @@ public class DeviceQueryBo extends BaseDto {
|
|||
@Size(max = 255, message = "设备状态长度不正确")
|
||||
@AutoMapping(ignore = true)
|
||||
@ReverseAutoMapping(ignore = true)
|
||||
private String state;
|
||||
private Boolean online;
|
||||
|
||||
@ApiModelProperty(value="用户id")
|
||||
@Size(max = 255, message = "用户id长度不正确")
|
||||
|
|
|
@ -93,10 +93,10 @@ public class DeviceManagerServiceImpl implements IDeviceManagerService {
|
|||
//关键字查询
|
||||
String keyword = query.getKeyword();
|
||||
String group = query.getGroup();
|
||||
String state = query.getState();
|
||||
Boolean online = query.getOnline();
|
||||
|
||||
Paging<DeviceInfoVo> result = MapstructUtils.convert(deviceInfoData.findByConditions(uid, subUid, pk, group,
|
||||
state, keyword, pageRequest.getPageNum(), pageRequest.getPageSize()), DeviceInfoVo.class);
|
||||
online, keyword, pageRequest.getPageNum(), pageRequest.getPageSize()), DeviceInfoVo.class);
|
||||
for (DeviceInfoVo row : result.getRows()) {
|
||||
row.setProduct(productData.findByProductKey(row.getProductKey()));
|
||||
}
|
||||
|
|
|
@ -222,6 +222,7 @@ public class ThingServiceImpl implements IThingService {
|
|||
ThingModelMessage.builder()
|
||||
.type(ThingModelMessage.TYPE_LIFETIME)
|
||||
.identifier("register")
|
||||
.time(System.currentTimeMillis())
|
||||
.build()
|
||||
);
|
||||
return deviceInfo.getDeviceId();
|
||||
|
@ -273,6 +274,7 @@ public class ThingServiceImpl implements IThingService {
|
|||
ThingModelMessage.builder()
|
||||
.type(ThingModelMessage.TYPE_STATE)
|
||||
.identifier(action.getState().getState())
|
||||
.time(System.currentTimeMillis())
|
||||
.build()
|
||||
);
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ public class RuleDeviceConsumer implements ConsumerHandler<ThingModelMessage>, A
|
|||
@Override
|
||||
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
|
||||
Map<String, DeviceMessageHandler> handlerMap = applicationContext.getBeansOfType(DeviceMessageHandler.class);
|
||||
messageHandlerPool = ThreadUtil.newScheduled(handlerMap.size(), "messageHandler");
|
||||
messageHandlerPool = ThreadUtil.newScheduled(handlerMap.size() * 2, "messageHandler");
|
||||
this.handlers.addAll(handlerMap.values());
|
||||
}
|
||||
|
||||
|
|
|
@ -40,10 +40,10 @@
|
|||
</dependency>
|
||||
|
||||
<!--打开注释使用rocketmq消息总线-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>cc.iotkit</groupId>-->
|
||||
<!-- <artifactId>iot-message-rocketmq</artifactId>-->
|
||||
<!-- </dependency>-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>cc.iotkit</groupId>-->
|
||||
<!-- <artifactId>iot-message-rocketmq</artifactId>-->
|
||||
<!-- </dependency>-->
|
||||
|
||||
<dependency>
|
||||
<groupId>cc.iotkit</groupId>
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
<!-- 将assemblies/bin目录下的所有文件输出到打包后的bin目录中 -->
|
||||
<fileSet>
|
||||
<directory>${project.parent.basedir}/iot-starter/src/main/bin</directory>
|
||||
<outputDirectory>/bin</outputDirectory>
|
||||
<outputDirectory>${project.name}/bin</outputDirectory>
|
||||
<includes>
|
||||
<include>**/*.bat</include>
|
||||
<include>**/*.sh</include>
|
||||
|
@ -30,7 +30,7 @@
|
|||
<!-- 将/iot-standalone/src/main/resources下配置文件打包到config目录 -->
|
||||
<fileSet>
|
||||
<directory>${project.parent.basedir}/iot-starter/src/main/resources</directory>
|
||||
<outputDirectory>/config</outputDirectory>
|
||||
<outputDirectory>${project.name}/config</outputDirectory>
|
||||
<includes>
|
||||
<include>**/*.xml</include>
|
||||
<include>**/*.properties</include>
|
||||
|
@ -42,7 +42,7 @@
|
|||
<!-- 将项目启动jar打包到lib目录中 -->
|
||||
<fileSet>
|
||||
<directory>target</directory>
|
||||
<outputDirectory>lib</outputDirectory>
|
||||
<outputDirectory>${project.name}/lib</outputDirectory>
|
||||
<includes>
|
||||
<include>*.jar</include>
|
||||
</includes>
|
||||
|
@ -51,7 +51,7 @@
|
|||
<!-- 将项目说明文档打包到docs目录中 -->
|
||||
<fileSet>
|
||||
<directory>${project.parent.basedir}</directory>
|
||||
<outputDirectory>docs</outputDirectory>
|
||||
<outputDirectory>${project.name}/docs</outputDirectory>
|
||||
<includes>
|
||||
<include>*.md</include>
|
||||
</includes>
|
||||
|
@ -59,23 +59,9 @@
|
|||
</fileSet>
|
||||
|
||||
<!--将初始化数据打包到data目录-->
|
||||
<fileSet>
|
||||
<directory>${project.parent.basedir}/data/components</directory>
|
||||
<outputDirectory>data/components</outputDirectory>
|
||||
<includes>
|
||||
<include>**/*</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
<fileSet>
|
||||
<directory>${project.parent.basedir}/data/converters</directory>
|
||||
<outputDirectory>data/converters</outputDirectory>
|
||||
<includes>
|
||||
<include>**/*</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
<fileSet>
|
||||
<directory>${project.parent.basedir}/data/init</directory>
|
||||
<outputDirectory>data/init</outputDirectory>
|
||||
<outputDirectory>${project.name}/data/init</outputDirectory>
|
||||
<includes>
|
||||
<include>**/*</include>
|
||||
</includes>
|
||||
|
|
2
pom.xml
2
pom.xml
|
@ -29,7 +29,7 @@
|
|||
|
||||
<properties>
|
||||
<java.version>11</java.version>
|
||||
<iot-iita-core.version>1.0.3</iot-iita-core.version>
|
||||
<iot-iita-core.version>1.0.4</iot-iita-core.version>
|
||||
<spring-boot.version>2.7.11</spring-boot.version>
|
||||
<vertx.version>4.2.2</vertx.version>
|
||||
<satoken.version>1.34.0</satoken.version>
|
||||
|
|
Loading…
Reference in New Issue