forked from dyf/fys-Multi-tenant
Merge remote-tracking branch 'origin/main' into dyf-device
This commit is contained in:
@ -59,8 +59,8 @@ public class Device extends TenantEntity {
|
||||
@Schema(name = "原始设备")
|
||||
private Long originalDeviceId;
|
||||
|
||||
/*@Schema( name = "设备编号")
|
||||
private String deviceNo;*/
|
||||
@Schema( name = "设备编号")
|
||||
private String deviceNo;
|
||||
|
||||
@Schema(name = "设备名称")
|
||||
private String deviceName;
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.fuyuanshen.equipment.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.lang.UUID;
|
||||
import cn.hutool.core.lang.generator.SnowflakeGenerator;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
@ -192,6 +193,7 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme
|
||||
device.setDeviceType(deviceTypes.getId());
|
||||
BeanUtil.copyProperties(deviceForm, device, true);
|
||||
|
||||
device.setDeviceNo(createDeviceNo());
|
||||
deviceMapper.insert(device);
|
||||
|
||||
// 新增设备类型记录
|
||||
@ -209,7 +211,10 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme
|
||||
deviceAssignmentsService.save(assignments);
|
||||
|
||||
}
|
||||
|
||||
private String createDeviceNo() {
|
||||
String uuidStr = UUID.fastUUID().toString(); // 获取带 - 的标准格式字符串
|
||||
return uuidStr.replaceAll("-", "");
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新设备信息
|
||||
|
Reference in New Issue
Block a user