Commit 167a3dcf by huangjy

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

parents a1843621 ce5007a4
......@@ -107,7 +107,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<>();
}
......@@ -125,12 +125,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);
}
......@@ -165,7 +165,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,10 +197,16 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
public void setup(PlatDeviceSetupDTO dto) {
PlatDevice db = getOne(new QueryWrapper<PlatDevice>().lambda()
.eq(PlatDevice::getOriDeviceId, dto.getOriDeviceId()));
if (db == null) {
throw new RuntimeException("设备不存在:" + db.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()));
......@@ -213,15 +219,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);
......@@ -255,8 +262,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())
......@@ -273,10 +280,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
......@@ -294,7 +301,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);
......@@ -339,7 +346,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