Commit e775e87f by 杨伟程

配网更新

parent 9004b172
......@@ -106,7 +106,7 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
//List<PlatDeviceListVO> voList = BeanDtoVoUtils.listVo(records, PlatDeviceListVO.class);
if(CollectionUtils.isEmpty(records)){
if (CollectionUtils.isEmpty(records)) {
return new PageVO<>();
}
......@@ -124,12 +124,12 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
for (PlatDeviceListVO record : records) {
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 spaceName = spaceNameJoin + "-" + record.getSpaceName() + "-" + record.getRoomName();
if(StringUtils.isNotBlank(record.getBedName())){
spaceName = spaceName +"-"+record.getBedName();
if (StringUtils.isNotBlank(record.getBedName())) {
spaceName = spaceName + "-" + record.getBedName();
}
record.setSpaceName(spaceName);
}
......@@ -164,7 +164,7 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
check(dto);
PlatDevice db = getById(dto.getId());
BeanUtils.copyProperties(dto, db,BaseBusEntity.Fields.tenantId);
BeanUtils.copyProperties(dto, db, BaseBusEntity.Fields.tenantId);
updateById(db);
......@@ -197,7 +197,11 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
PlatDevice db = getOne(new QueryWrapper<PlatDevice>().lambda()
.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()
.eq(PlatDeviceOther::getOriDeviceId, dto.getOriDeviceId()));
......@@ -210,15 +214,16 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
BeanUtils.copyProperties(dto, db);
db.setId(id);
saveOrUpdate(db);
id = db.getId();
deviceCacheUtil.put(db);
BeanUtils.copyProperties(dto, other);
other.setId(otherId);
other.setDeviceId(id);
other.setOriDeviceId(db.getOriDeviceId());
updateById(db);
deviceCacheUtil.put(db);
platDeviceOtherService.saveOrUpdate(other);
......@@ -252,8 +257,8 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
platDeviceOtherService.saveOrUpdate(other);
if(StringUtils.isNotEmpty(other.getAttribute())){
PlatDeviceAttrWechatDTO deviceAttrWechatDTO = JsonUtil.toObj(other.getAttribute(),PlatDeviceAttrWechatDTO.class);
if (StringUtils.isNotEmpty(other.getAttribute())) {
PlatDeviceAttrWechatDTO deviceAttrWechatDTO = JsonUtil.toObj(other.getAttribute(), PlatDeviceAttrWechatDTO.class);
//更新区域设置设备安装方式
platRegionSettingService.update(new UpdateWrapper<PlatRegionSetting>().lambda()
.set(PlatRegionSetting::getInstallType, deviceAttrWechatDTO.getRadarMount())
......@@ -270,10 +275,10 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
Page<PlatDevice> devicePage = page(page, lambdaQueryWrapper);
List<PlatDevice> records = devicePage.getRecords();
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());
});
return PageUtil.toPageVO(platDeviceListVOS,devicePage);
return PageUtil.toPageVO(platDeviceListVOS, devicePage);
}
@Override
......@@ -291,7 +296,7 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
BeanUtils.copyProperties(dto, db);
db.setId(id);
BeanUtils.copyProperties(dto, other,BaseEntity.Fields.id);
BeanUtils.copyProperties(dto, other, BaseEntity.Fields.id);
other.setDeviceId(id);
updateById(db);
......@@ -336,7 +341,7 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
@Override
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()
......
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