Commit ca400239 by huangjy

Merge remote-tracking branch 'origin/dev' into dev

parents e155cdb1 8beb3b67
...@@ -382,11 +382,42 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev ...@@ -382,11 +382,42 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
for (PlatDeviceOther platDeviceOther : platDeviceOtherList) { for (PlatDeviceOther platDeviceOther : platDeviceOtherList) {
BeanUtils.copyProperties(dto, platDeviceOther,"id"); BeanUtils.copyProperties(dto, platDeviceOther,"id");
platDeviceOther.setDeviceId(id); platDeviceOther.setDeviceId(id);
platDeviceOther.setAttribute(getDefaultAttr(db));
platDeviceOther.setOriDeviceId(db.getOriDeviceId()); platDeviceOther.setOriDeviceId(db.getOriDeviceId());
platDeviceOtherService.saveOrUpdate(platDeviceOther); platDeviceOtherService.saveOrUpdate(platDeviceOther);
} }
} }
private String getDefaultAttr(PlatDevice platDevice) {
String category = platDevice.getCategory();
if (!(PlatDeviceEnum.CategoryEnum.FALL.getValue().equals(category) || PlatDeviceEnum.CategoryEnum.SPACE.getValue().equals(category))) {
return null;
}
PlatDeviceBaseAttrDTO platDeviceBaseAttrDTO = new PlatDeviceBaseAttrDTO();
// 跌倒
if (PlatDeviceEnum.CategoryEnum.FALL.getValue().equals(category)) {
platDeviceBaseAttrDTO.setRadarMount(1);
platDeviceBaseAttrDTO.setRadarHight(300);
platDeviceBaseAttrDTO.setRadarSence(2);
platDeviceBaseAttrDTO.setRadarSPL(1);
}
// 空间人体
if (PlatDeviceEnum.CategoryEnum.SPACE.getValue().equals(category)) {
platDeviceBaseAttrDTO.setRadarMount(0);
platDeviceBaseAttrDTO.setRadarMode(1);
PlatDeviceBaseAttrDTO.DeviceAttrRange distance = new PlatDeviceBaseAttrDTO.DeviceAttrRange();
distance.setMax(1000);
distance.setMin(10);
platDeviceBaseAttrDTO.setRadarDistance(distance);
PlatDeviceBaseAttrDTO.DeviceAttrRange angle = new PlatDeviceBaseAttrDTO.DeviceAttrRange();
angle.setMax(60);
angle.setMin(-60);
platDeviceBaseAttrDTO.setRadarAngle(angle);
platDeviceBaseAttrDTO.setRadarDelay(30);
}
return JSON.toJSONString(platDeviceBaseAttrDTO);
}
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void wechatEdit(PlatDeviceEditWechatDTO dto) { public void wechatEdit(PlatDeviceEditWechatDTO dto) {
...@@ -765,7 +796,6 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev ...@@ -765,7 +796,6 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
platDeviceOther = new PlatDeviceOther(); platDeviceOther = new PlatDeviceOther();
platDeviceOther.setDeviceId(platDevice.getId()); platDeviceOther.setDeviceId(platDevice.getId());
platDeviceOther.setOriDeviceId(platDevice.getOriDeviceId()); platDeviceOther.setOriDeviceId(platDevice.getOriDeviceId());
platDeviceOther.setAttribute(JSON.toJSONString(getDeviceBaseAttrDTO(platDevice)));
platDeviceOther.setTenantId(platDevice.getTenantId()); platDeviceOther.setTenantId(platDevice.getTenantId());
platDeviceOtherService.save(platDeviceOther); platDeviceOtherService.save(platDeviceOther);
} }
......
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