提交 62319f2a authored 作者: zhoushaopan's avatar zhoushaopan

feat(3D模块): 新增3D模块

新增3D模块
上级 fb8fb9c6
......@@ -66,4 +66,12 @@ public class DeviceLibraryPositionController {
DeviceLibraryPosition deviceLibraryPosition = deviceLibraryPositionService.findById(id);
return ResponseEntity.ok(deviceLibraryPosition);
}
@GetMapping("/delete")
@ApiOperation(value = "根据id查询")
public ResponseEntity<String> deleteByPosition(Integer id){
deviceLibraryPositionService.deleteByPosition(id);
return ResponseEntity.ok("删除成功");
}
}
......@@ -19,4 +19,6 @@ public interface DeviceLibraryPositionService {
List<DeviceLibraryPosition> findByStorageLocationId(Integer StorageLocationId);
DeviceLibraryPosition findById(Integer id);
void deleteByPosition(Integer id);
}
......@@ -2,8 +2,11 @@ package com.tykj.dev.device.library.service.impl;
import com.tykj.dev.device.library.repository.DeviceLibraryPositionDao;
import com.tykj.dev.device.library.service.DeviceLibraryPositionService;
import com.tykj.dev.device.library.service.DeviceLibraryService;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import com.tykj.dev.device.library.subject.domin.DeviceLibraryPosition;
import com.tykj.dev.device.user.util.UserUtils;
import lombok.val;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -20,6 +23,9 @@ public class DeviceLibraryPositionServiceImpl implements DeviceLibraryPositionSe
@Autowired
private UserUtils userUtils;
@Autowired
private DeviceLibraryService deviceLibraryService;
@Autowired
private DeviceLibraryPositionDao deviceLibraryPositionDao;
......@@ -53,4 +59,14 @@ public class DeviceLibraryPositionServiceImpl implements DeviceLibraryPositionSe
}
return deviceLibraryPosition;
}
@Override
public void deleteByPosition(Integer id) {
DeviceLibraryPosition deviceLibraryPosition= findById(id);
DeviceLibrary deviceLibrary = deviceLibraryService.getOne(deviceLibraryPosition.getDeviceId());
deviceLibrary.setStorageLocation(null);
deviceLibrary.setStorageLocationId(null);
deviceLibraryPositionDao.delete(deviceLibraryPosition);
deviceLibraryService.update(deviceLibrary);
}
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论