Commit c19bd4df authored by 赵啸非's avatar 赵啸非

设备添加站点编码

parent a52305ad
...@@ -257,7 +257,7 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D ...@@ -257,7 +257,7 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D
//注册rabbmit相关队列与绑定 //注册rabbmit相关队列与绑定
registerRabbitQueue(entity, platformEntity, productEntity); registerRabbitQueue(entity, platformEntity, productEntity);
//新增设备通知第三方平台 激活后的设备才通知 //新增设备通知第三方平台 激活后的设备才通知
if(entity.getDeviceStatus()>0){ if (entity.getDeviceStatus() > 0) {
sendThirdParty(entity, productEntity, platformEntity, DeviceMethodEnum.UPDATE); sendThirdParty(entity, productEntity, platformEntity, DeviceMethodEnum.UPDATE);
} }
} }
...@@ -398,16 +398,18 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D ...@@ -398,16 +398,18 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D
entity.setPlatformName(platformEntity.getPlatformName()); entity.setPlatformName(platformEntity.getPlatformName());
} }
} }
//如果负责人与电话为空,查询站点关联 //如果负责人与电话为空,查询站点关联
if(ObjectUtils.isEmpty(entity.getLeadingOfficial())){ if (ObjectUtils.isEmpty(entity.getLeadingOfficial()) || ObjectUtils.isEmpty(entity.getSiteCode())) {
Rest<SitePdu> info = siteFeign.info(entity.getSiteId()); Rest<SitePdu> info = siteFeign.info(entity.getSiteId());
if(info.getCode()==YesNoEnum.YES.getValue()){ if (info.getCode() == YesNoEnum.YES.getValue()) {
entity.setLeadingOfficial(info.getData().getLeadingOfficial()); entity.setLeadingOfficial(info.getData().getLeadingOfficial());
entity.setLeadingOfficialTelephone(info.getData().getLeadingOfficialTelephone()); entity.setLeadingOfficialTelephone(info.getData().getLeadingOfficialTelephone());
entity.setSiteCode(info.getData().getSiteCode());
entity.setSiteName(info.getData().getSiteName());
} }
} }
super.saveBefore(entity, context); super.saveBefore(entity, context);
} }
......
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 to comment