mirror of
https://gitee.com/beecue/fastbee.git
synced 2025-12-17 16:36:03 +08:00
设备添加初始化信息
This commit is contained in:
@@ -426,13 +426,17 @@ public class DeviceServiceImpl implements IDeviceService {
|
|||||||
device.setTenantId(sysUser.getUserId());
|
device.setTenantId(sysUser.getUserId());
|
||||||
device.setTenantName(sysUser.getUserName());
|
device.setTenantName(sysUser.getUserName());
|
||||||
device.setRssi(0);
|
device.setRssi(0);
|
||||||
// 随机经纬度
|
// 随机经纬度和地址
|
||||||
|
device.setNetworkIp("127.0.0.1");
|
||||||
if(device.getLongitude()==null || device.getLongitude().equals("")){
|
if(device.getLongitude()==null || device.getLongitude().equals("")){
|
||||||
device.setLongitude(BigDecimal.valueOf(116.23-(Math.random()*15)));
|
device.setLongitude(BigDecimal.valueOf(116.23-(Math.random()*15)));
|
||||||
}
|
}
|
||||||
if(device.getLatitude()==null || device.getLatitude().equals("")){
|
if(device.getLatitude()==null || device.getLatitude().equals("")){
|
||||||
device.setLatitude(BigDecimal.valueOf(39.54-(Math.random()*15)));
|
device.setLatitude(BigDecimal.valueOf(39.54-(Math.random()*15)));
|
||||||
}
|
}
|
||||||
|
if(device.getNetworkAddress()==null || device.getNetworkAddress().equals("")){
|
||||||
|
device.setNetworkAddress("中国");
|
||||||
|
}
|
||||||
Product product=productService.selectProductByProductId(device.getProductId());
|
Product product=productService.selectProductByProductId(device.getProductId());
|
||||||
device.setImgUrl(product.getImgUrl());
|
device.setImgUrl(product.getImgUrl());
|
||||||
deviceMapper.insertDevice(device);
|
deviceMapper.insertDevice(device);
|
||||||
|
|||||||
Reference in New Issue
Block a user