Commit 0a68da8c by 朱淼
parents e82a45df 167a3dcf
...@@ -47,7 +47,8 @@ public class SignAuthFilter implements Filter { ...@@ -47,7 +47,8 @@ public class SignAuthFilter implements Filter {
String decryptJson = RSAUtils.privateDecrypt(sign, RSAUtils.getPrivateKey(RSAUtils.PRIVATE_KEY), "UTF-8"); String decryptJson = RSAUtils.privateDecrypt(sign, RSAUtils.getPrivateKey(RSAUtils.PRIVATE_KEY), "UTF-8");
boolean couldPass = decryptJson.equals(bodyString); boolean couldPass = decryptJson.replaceAll("\n","").replaceAll(" ","").trim()
.equals(bodyString.replaceAll(" ","").trim());
if (couldPass) { if (couldPass) {
// 放行 // 放行
chain.doFilter(requestWrapper, response); chain.doFilter(requestWrapper, response);
......
...@@ -107,7 +107,7 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev ...@@ -107,7 +107,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<>();
} }
...@@ -125,12 +125,12 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev ...@@ -125,12 +125,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);
} }
...@@ -165,7 +165,7 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev ...@@ -165,7 +165,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);
...@@ -198,7 +198,15 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev ...@@ -198,7 +198,15 @@ 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(); if (db == null) {
throw new RuntimeException("设备不存在:" + db.getOriDeviceId());
}
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()));
...@@ -211,15 +219,16 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev ...@@ -211,15 +219,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);
...@@ -253,8 +262,8 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev ...@@ -253,8 +262,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())
...@@ -271,10 +280,10 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev ...@@ -271,10 +280,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
...@@ -292,7 +301,7 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev ...@@ -292,7 +301,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);
...@@ -337,7 +346,7 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev ...@@ -337,7 +346,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