|
|
@ -281,7 +281,7 @@ public class IotThingRelationDetailServiceImpl extends BaseServiceImpl<IotThingR |
|
|
} else { |
|
|
} else { |
|
|
mapper.updateByQuery(item, QueryWrapper.create().eq(IotThingRelationDetailEntity::getId, item.getId())); |
|
|
mapper.updateByQuery(item, QueryWrapper.create().eq(IotThingRelationDetailEntity::getId, item.getId())); |
|
|
} |
|
|
} |
|
|
ObjectNode node = JsonConverter.convertToJsonObjectObjectNode(item); |
|
|
|
|
|
|
|
|
ObjectNode node = JsonConverter.convertToJsonObjectObjectNode(ConvertUtils.sourceToTarget(item, IotThingRelationDetailDTO.class)); |
|
|
List<ObjectNode> mapAccurateKey = cache.findMapAccurateKey(CacheNameEnum.THING_MODEL, item.getToCode()); |
|
|
List<ObjectNode> mapAccurateKey = cache.findMapAccurateKey(CacheNameEnum.THING_MODEL, item.getToCode()); |
|
|
if (CollectionUtils.isNotEmpty(mapAccurateKey)) { |
|
|
if (CollectionUtils.isNotEmpty(mapAccurateKey)) { |
|
|
String status = mapAccurateKey.get(0).get(CacheNameEnum.ModelField.THING_MODEL_STATUS.getField()).asText(); |
|
|
String status = mapAccurateKey.get(0).get(CacheNameEnum.ModelField.THING_MODEL_STATUS.getField()).asText(); |
|
|
@ -324,7 +324,7 @@ public class IotThingRelationDetailServiceImpl extends BaseServiceImpl<IotThingR |
|
|
root.setConfig(request.getConfig()); |
|
|
root.setConfig(request.getConfig()); |
|
|
relationRootsService.updateById(root); |
|
|
relationRootsService.updateById(root); |
|
|
//更新缓存 |
|
|
//更新缓存 |
|
|
ObjectNode nodes = JsonConverter.convertToJsonObjectObjectNode(root); |
|
|
|
|
|
|
|
|
ObjectNode nodes = JsonConverter.convertToJsonObjectObjectNode(ConvertUtils.sourceToTarget(root, IotThingRelationRootDTO.class)); |
|
|
nodes.put("fromId", "0"); |
|
|
nodes.put("fromId", "0"); |
|
|
nodes.put("rootId", nodes.get("id").asText()); |
|
|
nodes.put("rootId", nodes.get("id").asText()); |
|
|
nodes.put("toId", nodes.get("id").asText()); |
|
|
nodes.put("toId", nodes.get("id").asText()); |
|
|
@ -363,7 +363,7 @@ public class IotThingRelationDetailServiceImpl extends BaseServiceImpl<IotThingR |
|
|
//更新缓存 |
|
|
//更新缓存 |
|
|
list.forEach(entity -> |
|
|
list.forEach(entity -> |
|
|
{ |
|
|
{ |
|
|
ObjectNode node = JsonConverter.convertToJsonObjectObjectNode(entity); |
|
|
|
|
|
|
|
|
ObjectNode node = JsonConverter.convertToJsonObjectObjectNode(ConvertUtils.sourceToTarget(entity, IotThingRelationDetailDTO.class)); |
|
|
List<ObjectNode> mapAccurateKey = cache.findMapAccurateKey(CacheNameEnum.THING_MODEL, entity.getToCode()); |
|
|
List<ObjectNode> mapAccurateKey = cache.findMapAccurateKey(CacheNameEnum.THING_MODEL, entity.getToCode()); |
|
|
if (CollectionUtils.isNotEmpty(mapAccurateKey)) { |
|
|
if (CollectionUtils.isNotEmpty(mapAccurateKey)) { |
|
|
String status = mapAccurateKey.get(0).get(CacheNameEnum.ModelField.THING_MODEL_STATUS.getField()).asText(); |
|
|
String status = mapAccurateKey.get(0).get(CacheNameEnum.ModelField.THING_MODEL_STATUS.getField()).asText(); |
|
|
@ -385,7 +385,7 @@ public class IotThingRelationDetailServiceImpl extends BaseServiceImpl<IotThingR |
|
|
sourceEntity.setTag(StringUtils.isBlank(dto.getTag()) ? dto.getToName() : dto.getTag()); |
|
|
sourceEntity.setTag(StringUtils.isBlank(dto.getTag()) ? dto.getToName() : dto.getTag()); |
|
|
if(Objects.isNull(dto.getPid()) || Objects.equals(dto.getPid(), 0L)){ |
|
|
if(Objects.isNull(dto.getPid()) || Objects.equals(dto.getPid(), 0L)){ |
|
|
mapper.update(sourceEntity); |
|
|
mapper.update(sourceEntity); |
|
|
ObjectNode node = JsonConverter.convertToJsonObjectObjectNode(sourceEntity); |
|
|
|
|
|
|
|
|
ObjectNode node = JsonConverter.convertToJsonObjectObjectNode(ConvertUtils.sourceToTarget(sourceEntity, IotThingRelationDetailDTO.class)); |
|
|
List<ObjectNode> mapAccurateKey = cache.findMapAccurateKey(CacheNameEnum.THING_MODEL, sourceEntity.getToCode()); |
|
|
List<ObjectNode> mapAccurateKey = cache.findMapAccurateKey(CacheNameEnum.THING_MODEL, sourceEntity.getToCode()); |
|
|
if(CollectionUtils.isNotEmpty(mapAccurateKey)){ |
|
|
if(CollectionUtils.isNotEmpty(mapAccurateKey)){ |
|
|
String status = mapAccurateKey.get(0).get(CacheNameEnum.ModelField.THING_MODEL_STATUS.getField()).asText(); |
|
|
String status = mapAccurateKey.get(0).get(CacheNameEnum.ModelField.THING_MODEL_STATUS.getField()).asText(); |
|
|
@ -403,7 +403,7 @@ public class IotThingRelationDetailServiceImpl extends BaseServiceImpl<IotThingR |
|
|
} |
|
|
} |
|
|
if(sourceEntity.getFromId().equals(targetEntity.getToId())){ |
|
|
if(sourceEntity.getFromId().equals(targetEntity.getToId())){ |
|
|
mapper.update(sourceEntity); |
|
|
mapper.update(sourceEntity); |
|
|
ObjectNode node = JsonConverter.convertToJsonObjectObjectNode(sourceEntity); |
|
|
|
|
|
|
|
|
ObjectNode node = JsonConverter.convertToJsonObjectObjectNode(ConvertUtils.sourceToTarget(sourceEntity, IotThingRelationDetailDTO.class)); |
|
|
List<ObjectNode> mapAccurateKey = cache.findMapAccurateKey(CacheNameEnum.THING_MODEL, sourceEntity.getToCode()); |
|
|
List<ObjectNode> mapAccurateKey = cache.findMapAccurateKey(CacheNameEnum.THING_MODEL, sourceEntity.getToCode()); |
|
|
if(CollectionUtils.isNotEmpty(mapAccurateKey)){ |
|
|
if(CollectionUtils.isNotEmpty(mapAccurateKey)){ |
|
|
String status = mapAccurateKey.get(0).get(CacheNameEnum.ModelField.THING_MODEL_STATUS.getField()).asText(); |
|
|
String status = mapAccurateKey.get(0).get(CacheNameEnum.ModelField.THING_MODEL_STATUS.getField()).asText(); |
|
|
@ -455,7 +455,7 @@ public class IotThingRelationDetailServiceImpl extends BaseServiceImpl<IotThingR |
|
|
{ |
|
|
{ |
|
|
item.setSort(sort.incrementAndGet()); |
|
|
item.setSort(sort.incrementAndGet()); |
|
|
mapper.updateByQuery(item, QueryWrapper.create().eq(IotThingRelationDetailEntity::getId, item.getId())); |
|
|
mapper.updateByQuery(item, QueryWrapper.create().eq(IotThingRelationDetailEntity::getId, item.getId())); |
|
|
ObjectNode node = JsonConverter.convertToJsonObjectObjectNode(sourceEntity); |
|
|
|
|
|
|
|
|
ObjectNode node = JsonConverter.convertToJsonObjectObjectNode(ConvertUtils.sourceToTarget(sourceEntity, IotThingRelationDetailDTO.class)); |
|
|
List<ObjectNode> mapAccurateKey = cache.findMapAccurateKey(CacheNameEnum.THING_MODEL, sourceEntity.getToCode()); |
|
|
List<ObjectNode> mapAccurateKey = cache.findMapAccurateKey(CacheNameEnum.THING_MODEL, sourceEntity.getToCode()); |
|
|
if(CollectionUtils.isNotEmpty(mapAccurateKey)){ |
|
|
if(CollectionUtils.isNotEmpty(mapAccurateKey)){ |
|
|
String status = mapAccurateKey.get(0).get(CacheNameEnum.ModelField.THING_MODEL_STATUS.getField()).asText(); |
|
|
String status = mapAccurateKey.get(0).get(CacheNameEnum.ModelField.THING_MODEL_STATUS.getField()).asText(); |
|
|
@ -577,7 +577,7 @@ public class IotThingRelationDetailServiceImpl extends BaseServiceImpl<IotThingR |
|
|
//更新缓存 |
|
|
//更新缓存 |
|
|
resultList.forEach(s -> |
|
|
resultList.forEach(s -> |
|
|
{ |
|
|
{ |
|
|
ObjectNode node = JsonConverter.convertToJsonObjectObjectNode(s); |
|
|
|
|
|
|
|
|
ObjectNode node = JsonConverter.convertToJsonObjectObjectNode(ConvertUtils.sourceToTarget(s, IotThingRelationDetailDTO.class)); |
|
|
List<ObjectNode> mapAccurateKey = cache.findMapAccurateKey(CacheNameEnum.THING_MODEL, s.getToCode()); |
|
|
List<ObjectNode> mapAccurateKey = cache.findMapAccurateKey(CacheNameEnum.THING_MODEL, s.getToCode()); |
|
|
if (CollectionUtils.isNotEmpty(mapAccurateKey)) { |
|
|
if (CollectionUtils.isNotEmpty(mapAccurateKey)) { |
|
|
String status = mapAccurateKey.get(0).get(CacheNameEnum.ModelField.THING_MODEL_STATUS.getField()).asText(); |
|
|
String status = mapAccurateKey.get(0).get(CacheNameEnum.ModelField.THING_MODEL_STATUS.getField()).asText(); |
|
|
@ -620,7 +620,7 @@ public class IotThingRelationDetailServiceImpl extends BaseServiceImpl<IotThingR |
|
|
//更新缓存 |
|
|
//更新缓存 |
|
|
reslutList.forEach(s -> |
|
|
reslutList.forEach(s -> |
|
|
{ |
|
|
{ |
|
|
ObjectNode node = JsonConverter.convertToJsonObjectObjectNode(s); |
|
|
|
|
|
|
|
|
ObjectNode node = JsonConverter.convertToJsonObjectObjectNode(ConvertUtils.sourceToTarget(s, IotThingRelationDetailDTO.class)); |
|
|
List<ObjectNode> mapAccurateKey = cache.findMapAccurateKey(CacheNameEnum.THING_MODEL, s.getToCode()); |
|
|
List<ObjectNode> mapAccurateKey = cache.findMapAccurateKey(CacheNameEnum.THING_MODEL, s.getToCode()); |
|
|
if (CollectionUtils.isNotEmpty(mapAccurateKey)) { |
|
|
if (CollectionUtils.isNotEmpty(mapAccurateKey)) { |
|
|
String status = mapAccurateKey.get(0).get(CacheNameEnum.ModelField.THING_MODEL_STATUS.getField()).asText(); |
|
|
String status = mapAccurateKey.get(0).get(CacheNameEnum.ModelField.THING_MODEL_STATUS.getField()).asText(); |
|
|
@ -659,7 +659,7 @@ public class IotThingRelationDetailServiceImpl extends BaseServiceImpl<IotThingR |
|
|
mapper.insertOrUpdateSelective(s); |
|
|
mapper.insertOrUpdateSelective(s); |
|
|
//更新缓存 |
|
|
//更新缓存 |
|
|
|
|
|
|
|
|
ObjectNode node = JsonConverter.convertToJsonObjectObjectNode(s); |
|
|
|
|
|
|
|
|
ObjectNode node = JsonConverter.convertToJsonObjectObjectNode(ConvertUtils.sourceToTarget(s, IotThingRelationDetailDTO.class)); |
|
|
List<ObjectNode> mapAccurateKey = cache.findMapAccurateKey(CacheNameEnum.THING_MODEL, s.getToCode()); |
|
|
List<ObjectNode> mapAccurateKey = cache.findMapAccurateKey(CacheNameEnum.THING_MODEL, s.getToCode()); |
|
|
if (CollectionUtils.isNotEmpty(mapAccurateKey)) { |
|
|
if (CollectionUtils.isNotEmpty(mapAccurateKey)) { |
|
|
String status = mapAccurateKey.get(0).get(CacheNameEnum.ModelField.THING_MODEL_STATUS.getField()).asText(); |
|
|
String status = mapAccurateKey.get(0).get(CacheNameEnum.ModelField.THING_MODEL_STATUS.getField()).asText(); |
|
|
|