设备
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)
|
@Log(title = "设备进出场记录", businessType = BusinessType.INSERT)
|
||||||
@RepeatSubmit()
|
@RepeatSubmit()
|
||||||
@PostMapping()
|
@PostMapping()
|
||||||
|
|||||||
@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user