This commit is contained in:
zt
2025-12-02 16:22:42 +08:00
parent 4e3faa7a23
commit 45702ef838
2 changed files with 4 additions and 4 deletions

View File

@ -87,7 +87,7 @@ public class DeviceAccessRecordController extends BaseController {
/** /**
* 新增设备进出场记录 * 新增设备进出场记录
*/ */
// @SaCheckPermission("device:accessRecord:add") @SaCheckPermission("device:accessRecord:add")
@Log(title = "设备进出场记录", businessType = BusinessType.INSERT) @Log(title = "设备进出场记录", businessType = BusinessType.INSERT)
@RepeatSubmit() @RepeatSubmit()
@PostMapping() @PostMapping()

View File

@ -102,7 +102,7 @@ public class DeviceTypeServiceImpl extends ServiceImpl<DeviceTypeMapper, DeviceT
public Boolean insertByBo(DeviceTypeBo bo) { public Boolean insertByBo(DeviceTypeBo bo) {
DeviceType add = MapstructUtils.convert(bo, DeviceType.class); DeviceType add = MapstructUtils.convert(bo, DeviceType.class);
validEntityBeforeSave(add); validEntityBeforeSave(add);
handleLevelAndAcestors(add); handleLevelAndAncestors(add);
boolean flag = baseMapper.insert(add) > 0; boolean flag = baseMapper.insert(add) > 0;
if (flag) { if (flag) {
bo.setId(add.getId()); bo.setId(add.getId());
@ -120,11 +120,11 @@ public class DeviceTypeServiceImpl extends ServiceImpl<DeviceTypeMapper, DeviceT
public Boolean updateByBo(DeviceTypeBo bo) { public Boolean updateByBo(DeviceTypeBo bo) {
DeviceType update = MapstructUtils.convert(bo, DeviceType.class); DeviceType update = MapstructUtils.convert(bo, DeviceType.class);
validEntityBeforeSave(update); validEntityBeforeSave(update);
handleLevelAndAcestors(update); handleLevelAndAncestors(update);
return baseMapper.updateById(update) > 0; return baseMapper.updateById(update) > 0;
} }
private void handleLevelAndAcestors(DeviceType deviceType) { private void handleLevelAndAncestors(DeviceType deviceType) {
if(deviceType.getParentId() == 0L){ if(deviceType.getParentId() == 0L){
deviceType.setAncestors("0"); deviceType.setAncestors("0");
deviceType.setLevel(1); deviceType.setLevel(1);