Commit 826ce8fa by 罗志长

fix: viewByDeviceId

parent 47cdf891
...@@ -475,8 +475,21 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev ...@@ -475,8 +475,21 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
.eq(PlatDeviceOther::getDeviceId, platDevice.getId()) .eq(PlatDeviceOther::getDeviceId, platDevice.getId())
.last("limit 1")); .last("limit 1"));
PlatDeviceBaseAttrDTO iotAttr = getDeviceBaseAttrDTO(platDevice);
if (other != null) { if (other != null) {
String oldAttr = other.getAttribute();
if (StringUtils.isBlank(other.getAttribute())) {
PlatDeviceBaseAttrDTO defaultAttr = getDefaultAttr(platDevice);
String attr = defaultAttr != null ? JSON.toJSONString(defaultAttr) : null;
other.setAttribute(attr);
}
BeanUtils.copyProperties(other, vo); BeanUtils.copyProperties(other, vo);
String attr = getAfterComparisonAttr(iotAttr, other.getAttribute());
vo.setAttribute(attr);
if (!StringUtils.equals(oldAttr, attr)) {
other.setAttribute(attr);
platDeviceOtherService.updateById(other);
}
} }
vo.setId(platDevice.getId()); vo.setId(platDevice.getId());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment