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