设备
This commit is contained in:
@ -87,7 +87,7 @@ public class DeviceAccessRecordController extends BaseController {
|
||||
/**
|
||||
* 新增设备进出场记录
|
||||
*/
|
||||
// @SaCheckPermission("device:accessRecord:add")
|
||||
@SaCheckPermission("device:accessRecord:add")
|
||||
@Log(title = "设备进出场记录", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
|
||||
@ -102,7 +102,7 @@ public class DeviceTypeServiceImpl extends ServiceImpl<DeviceTypeMapper, DeviceT
|
||||
public Boolean insertByBo(DeviceTypeBo bo) {
|
||||
DeviceType add = MapstructUtils.convert(bo, DeviceType.class);
|
||||
validEntityBeforeSave(add);
|
||||
handleLevelAndAcestors(add);
|
||||
handleLevelAndAncestors(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
@ -120,11 +120,11 @@ public class DeviceTypeServiceImpl extends ServiceImpl<DeviceTypeMapper, DeviceT
|
||||
public Boolean updateByBo(DeviceTypeBo bo) {
|
||||
DeviceType update = MapstructUtils.convert(bo, DeviceType.class);
|
||||
validEntityBeforeSave(update);
|
||||
handleLevelAndAcestors(update);
|
||||
handleLevelAndAncestors(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
private void handleLevelAndAcestors(DeviceType deviceType) {
|
||||
private void handleLevelAndAncestors(DeviceType deviceType) {
|
||||
if(deviceType.getParentId() == 0L){
|
||||
deviceType.setAncestors("0");
|
||||
deviceType.setLevel(1);
|
||||
|
||||
Reference in New Issue
Block a user