|
|
|
@ -57,6 +57,7 @@ import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.apache.commons.collections4.CollectionUtils; |
|
|
|
import org.apache.commons.collections4.MapUtils; |
|
|
|
import org.apache.commons.lang3.ArrayUtils; |
|
|
|
import org.apache.commons.lang3.ObjectUtils; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.apache.commons.lang3.tuple.Pair; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
@ -306,6 +307,12 @@ public class IotThingEntityServiceImpl extends BaseServiceImpl<IotThingEntityMap |
|
|
|
IotThingEntityInfoDTO iotThingEntityInfoDTO = ConvertUtils.sourceToTarget(thingEntityDTO, IotThingEntityInfoDTO.class); |
|
|
|
iotThingEntityInfoDTO.setTags( StringUtils.isNotBlank(thingEntityDTO.getTags()) ? thingEntityDTO.getTags().split(",") : new String[]{}); |
|
|
|
iotThingEntityInfoDTO.setDeptIds( StringUtils.isNotBlank(thingEntityDTO.getDeptIds()) ? thingEntityDTO.getDeptIds().split(",") : new String[]{}); |
|
|
|
|
|
|
|
|
|
|
|
if(ObjectUtils.isNotEmpty( iotThingEntityInfoDTO.getImg())){ |
|
|
|
String url =iotThingEntityInfoDTO.getImg(); |
|
|
|
iotThingEntityInfoDTO.setImg(OSSFactory.splice(url)); |
|
|
|
} |
|
|
|
return iotThingEntityInfoDTO; |
|
|
|
} |
|
|
|
|
|
|
|
@ -965,6 +972,10 @@ public class IotThingEntityServiceImpl extends BaseServiceImpl<IotThingEntityMap |
|
|
|
if(CollectionUtils.isNotEmpty(keyMap)){ |
|
|
|
res.put("status",keyMap.get(0).get(CacheNameEnum.ModelField.THING_MODEL_STATUS.getField()).asText()); |
|
|
|
res.put("statusTs",keyMap.get(0).get(CacheNameEnum.ModelField.THING_MODEL_STATUS_TS.getField()).asText()); |
|
|
|
if(ObjectUtils.isNotEmpty(res.get("img"))){ |
|
|
|
String url = res.get("img").asText(); |
|
|
|
res.put("img",OSSFactory.splice(url)); |
|
|
|
} |
|
|
|
JsonNode jsonNode = res.get(CacheNameEnum.EntityField.THING_ENTITY_DEPT_IDS.getField()); |
|
|
|
if(Objects.nonNull(jsonNode) && !(jsonNode instanceof NullNode)){ |
|
|
|
List<Long> deptIds = Stream.of(StringUtils.split(jsonNode.asText(), ",")).map(Long::parseLong).toList(); |
|
|
|
|