Commit e775e87f by 杨伟程

配网更新

parent 9004b172
...@@ -106,7 +106,7 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev ...@@ -106,7 +106,7 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
//List<PlatDeviceListVO> voList = BeanDtoVoUtils.listVo(records, PlatDeviceListVO.class); //List<PlatDeviceListVO> voList = BeanDtoVoUtils.listVo(records, PlatDeviceListVO.class);
if(CollectionUtils.isEmpty(records)){ if (CollectionUtils.isEmpty(records)) {
return new PageVO<>(); return new PageVO<>();
} }
...@@ -124,12 +124,12 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev ...@@ -124,12 +124,12 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
for (PlatDeviceListVO record : records) { for (PlatDeviceListVO record : records) {
String spaceParentPath = record.getSpaceParentPath(); String spaceParentPath = record.getSpaceParentPath();
if(StringUtils.isNotBlank(spaceParentPath)){ if (StringUtils.isNotBlank(spaceParentPath)) {
String spaceNameJoin = Stream.of(spaceParentPath.split(",")).map(vo -> spaceIdNameMap.get(vo)).collect(Collectors.joining("-")); String spaceNameJoin = Stream.of(spaceParentPath.split(",")).map(vo -> spaceIdNameMap.get(vo)).collect(Collectors.joining("-"));
String spaceName = spaceNameJoin + "-" + record.getSpaceName() + "-" + record.getRoomName(); String spaceName = spaceNameJoin + "-" + record.getSpaceName() + "-" + record.getRoomName();
if(StringUtils.isNotBlank(record.getBedName())){ if (StringUtils.isNotBlank(record.getBedName())) {
spaceName = spaceName +"-"+record.getBedName(); spaceName = spaceName + "-" + record.getBedName();
} }
record.setSpaceName(spaceName); record.setSpaceName(spaceName);
} }
...@@ -164,7 +164,7 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev ...@@ -164,7 +164,7 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
check(dto); check(dto);
PlatDevice db = getById(dto.getId()); PlatDevice db = getById(dto.getId());
BeanUtils.copyProperties(dto, db,BaseBusEntity.Fields.tenantId); BeanUtils.copyProperties(dto, db, BaseBusEntity.Fields.tenantId);
updateById(db); updateById(db);
...@@ -197,7 +197,11 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev ...@@ -197,7 +197,11 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
PlatDevice db = getOne(new QueryWrapper<PlatDevice>().lambda() PlatDevice db = getOne(new QueryWrapper<PlatDevice>().lambda()
.eq(PlatDevice::getOriDeviceId, dto.getOriDeviceId())); .eq(PlatDevice::getOriDeviceId, dto.getOriDeviceId()));
String id = db.getId(); String id = null;
if (db != null) {
id = db.getId();
}
PlatDeviceOther other = platDeviceOtherService.getOne(new QueryWrapper<PlatDeviceOther>().lambda() PlatDeviceOther other = platDeviceOtherService.getOne(new QueryWrapper<PlatDeviceOther>().lambda()
.eq(PlatDeviceOther::getOriDeviceId, dto.getOriDeviceId())); .eq(PlatDeviceOther::getOriDeviceId, dto.getOriDeviceId()));
...@@ -210,15 +214,16 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev ...@@ -210,15 +214,16 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
BeanUtils.copyProperties(dto, db); BeanUtils.copyProperties(dto, db);
db.setId(id); db.setId(id);
saveOrUpdate(db);
id = db.getId();
deviceCacheUtil.put(db);
BeanUtils.copyProperties(dto, other); BeanUtils.copyProperties(dto, other);
other.setId(otherId); other.setId(otherId);
other.setDeviceId(id); other.setDeviceId(id);
other.setOriDeviceId(db.getOriDeviceId()); other.setOriDeviceId(db.getOriDeviceId());
updateById(db);
deviceCacheUtil.put(db);
platDeviceOtherService.saveOrUpdate(other); platDeviceOtherService.saveOrUpdate(other);
...@@ -252,8 +257,8 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev ...@@ -252,8 +257,8 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
platDeviceOtherService.saveOrUpdate(other); platDeviceOtherService.saveOrUpdate(other);
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);
//更新区域设置设备安装方式 //更新区域设置设备安装方式
platRegionSettingService.update(new UpdateWrapper<PlatRegionSetting>().lambda() platRegionSettingService.update(new UpdateWrapper<PlatRegionSetting>().lambda()
.set(PlatRegionSetting::getInstallType, deviceAttrWechatDTO.getRadarMount()) .set(PlatRegionSetting::getInstallType, deviceAttrWechatDTO.getRadarMount())
...@@ -270,10 +275,10 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev ...@@ -270,10 +275,10 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
Page<PlatDevice> devicePage = page(page, lambdaQueryWrapper); Page<PlatDevice> devicePage = page(page, lambdaQueryWrapper);
List<PlatDevice> records = devicePage.getRecords(); List<PlatDevice> records = devicePage.getRecords();
List<PlatDeviceListVO> platDeviceListVOS = BeanDtoVoUtils.listVo(records, PlatDeviceListVO.class); List<PlatDeviceListVO> platDeviceListVOS = BeanDtoVoUtils.listVo(records, PlatDeviceListVO.class);
JoinUtil.join(platDeviceListVOS,platTenantService, BaseTenantDTO::getTenantId,BaseEntity::getId,(d,o)->{ JoinUtil.join(platDeviceListVOS, platTenantService, BaseTenantDTO::getTenantId, BaseEntity::getId, (d, o) -> {
d.setTenantName(o.getName()); d.setTenantName(o.getName());
}); });
return PageUtil.toPageVO(platDeviceListVOS,devicePage); return PageUtil.toPageVO(platDeviceListVOS, devicePage);
} }
@Override @Override
...@@ -291,7 +296,7 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev ...@@ -291,7 +296,7 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
BeanUtils.copyProperties(dto, db); BeanUtils.copyProperties(dto, db);
db.setId(id); db.setId(id);
BeanUtils.copyProperties(dto, other,BaseEntity.Fields.id); BeanUtils.copyProperties(dto, other, BaseEntity.Fields.id);
other.setDeviceId(id); other.setDeviceId(id);
updateById(db); updateById(db);
...@@ -336,7 +341,7 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev ...@@ -336,7 +341,7 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
@Override @Override
public void editDeviceProperties(PlatDeviceAttrWechatDTO dto) { public void editDeviceProperties(PlatDeviceAttrWechatDTO dto) {
devicePropertiesOperateService.deviceWrite(dto.getDeviceId(),dto.getRadarMount(),dto.getRadarMode(),dto.getRadarHight()); devicePropertiesOperateService.deviceWrite(dto.getDeviceId(), dto.getRadarMount(), dto.getRadarMode(), dto.getRadarHight());
//更新区域设置设备安装方式 //更新区域设置设备安装方式
platRegionSettingService.update(new UpdateWrapper<PlatRegionSetting>().lambda() platRegionSettingService.update(new UpdateWrapper<PlatRegionSetting>().lambda()
......
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