|
|
|
|
@ -148,6 +148,10 @@ public class RfidDeviceServiceImpl implements IRfidDeviceService {
|
|
|
|
|
@Override
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
|
public Boolean insertByBo(RfidDeviceBo bo) {
|
|
|
|
|
// 兜底策略:若前端未传入设备编号,后端自动生成,确保数据完整性
|
|
|
|
|
if (StringUtils.isBlank(bo.getDeviceCode())) {
|
|
|
|
|
bo.setDeviceCode("DEV" + System.currentTimeMillis());
|
|
|
|
|
}
|
|
|
|
|
RfidDevice add = MapstructUtils.convert(bo, RfidDevice.class);
|
|
|
|
|
validEntityBeforeSave(add);
|
|
|
|
|
boolean flag = baseMapper.insert(add) > 0;
|
|
|
|
|
|