Commit bfc6e8d0 by huangjy

fix:修改设备属性问题

parent ee3d59e7
...@@ -220,7 +220,7 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev ...@@ -220,7 +220,7 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
// 写入设备 // 写入设备
PlatDeviceAttrWechatDTO platDeviceAttrWechatDTO = JSON.parseObject(dto.getAttribute(), PlatDeviceAttrWechatDTO.class); PlatDeviceAttrWechatDTO platDeviceAttrWechatDTO = JSON.parseObject(dto.getAttribute(), PlatDeviceAttrWechatDTO.class);
platDeviceAttrWechatDTO.setDeviceId(db.getOriDeviceId()); platDeviceAttrWechatDTO.setDeviceId(db.getId());
editDeviceProperties(platDeviceAttrWechatDTO); editDeviceProperties(platDeviceAttrWechatDTO);
} }
...@@ -343,10 +343,11 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev ...@@ -343,10 +343,11 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
if (StringUtils.isNotEmpty(other.getAttribute())) { if (StringUtils.isNotEmpty(other.getAttribute())) {
PlatDeviceAttrWechatDTO deviceAttrWechatDTO = JsonUtil.toObj(other.getAttribute(), PlatDeviceAttrWechatDTO.class); PlatDeviceAttrWechatDTO deviceAttrWechatDTO = JsonUtil.toObj(other.getAttribute(), PlatDeviceAttrWechatDTO.class);
if (deviceAttrWechatDTO != null) {
deviceAttrWechatDTO.setDeviceId(db.getId());
//更新区域设置设备安装方式 //更新区域设置设备安装方式
platRegionSettingService.update(new UpdateWrapper<PlatRegionSetting>().lambda() editDeviceProperties(deviceAttrWechatDTO);
.set(PlatRegionSetting::getInstallType, deviceAttrWechatDTO.getRadarMount()) }
.eq(PlatRegionSetting::getDeviceId, other.getDeviceId()));
} }
} }
...@@ -393,7 +394,7 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev ...@@ -393,7 +394,7 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
if (StringUtils.isNotEmpty(dto.getAttribute())) { if (StringUtils.isNotEmpty(dto.getAttribute())) {
// 写入设备 // 写入设备
PlatDeviceAttrWechatDTO platDeviceAttrWechatDTO = JSON.parseObject(dto.getAttribute(), PlatDeviceAttrWechatDTO.class); PlatDeviceAttrWechatDTO platDeviceAttrWechatDTO = JSON.parseObject(dto.getAttribute(), PlatDeviceAttrWechatDTO.class);
platDeviceAttrWechatDTO.setDeviceId(db.getOriDeviceId()); platDeviceAttrWechatDTO.setDeviceId(db.getId());
editDeviceProperties(platDeviceAttrWechatDTO); editDeviceProperties(platDeviceAttrWechatDTO);
} }
} }
......
...@@ -502,7 +502,8 @@ public class PlatElderRealTimeServiceImpl implements PlatElderRealTimeService { ...@@ -502,7 +502,8 @@ public class PlatElderRealTimeServiceImpl implements PlatElderRealTimeService {
JSONObject jsonObject = JSON.parseObject(fallResult); JSONObject jsonObject = JSON.parseObject(fallResult);
vo.setDeviceId(platDevice.getId()); vo.setDeviceId(platDevice.getId());
vo.setOriDeviceId(platDevice.getOriDeviceId()); vo.setOriDeviceId(platDevice.getOriDeviceId());
vo.setTrack((List<Integer>) jsonObject.get("track")); Object track = jsonObject.get("track");
vo.setTrack((track == null ? Lists.newArrayList() : (List<Integer>) track));
vo.setPersonState(Integer.valueOf(jsonObject.getString("personState"))); vo.setPersonState(Integer.valueOf(jsonObject.getString("personState")));
vo.setMount(Integer.valueOf(jsonObject.getString("mount"))); vo.setMount(Integer.valueOf(jsonObject.getString("mount")));
vo.setType(2); vo.setType(2);
......
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