提交 99e8e8ea authored 作者: zhoushaopan's avatar zhoushaopan

fix(装备模块和3D模块): 导入装备数据到3D库中

导入装备数据到3D库中
上级 e3cc2dfc
...@@ -1232,6 +1232,14 @@ public class DeviceLibraryController { ...@@ -1232,6 +1232,14 @@ public class DeviceLibraryController {
return ResponseEntity.ok(s); return ResponseEntity.ok(s);
} }
@Transactional(rollbackFor = Exception.class)
@GetMapping("/importData")
@ApiOperation(value = "装备导入3D中")
public ResponseEntity<String> importData(){
deviceLibraryService.importData();
return ResponseEntity.ok("导入成功");
}
// @ApiOperation(value = "修改单位名称", notes = "修改单位名称") // @ApiOperation(value = "修改单位名称", notes = "修改单位名称")
// @PostMapping("/updateDeviceLocationAndOwnUnit") // @PostMapping("/updateDeviceLocationAndOwnUnit")
......
...@@ -565,4 +565,6 @@ public interface DeviceLibraryService { ...@@ -565,4 +565,6 @@ public interface DeviceLibraryService {
Map<String,Object> fnConditionQuery(QueryTheWarehouseVo queryTheWarehouseVo); Map<String,Object> fnConditionQuery(QueryTheWarehouseVo queryTheWarehouseVo);
void batchUpdateDevicesByPackingIds(String newModel,List<Integer> packingIds); void batchUpdateDevicesByPackingIds(String newModel,List<Integer> packingIds);
void importData();
} }
...@@ -1422,6 +1422,19 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService { ...@@ -1422,6 +1422,19 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
deviceLibraryDao.batchUpdateDevicesByPackingIds(newModel, packingIds); deviceLibraryDao.batchUpdateDevicesByPackingIds(newModel, packingIds);
} }
@Override
public void importData() {
List<DeviceLibrary> deviceLibraryList = deviceLibraryDao.findAll();
List<DeviceLibraryPosition> deviceLibraryPositions = new ArrayList<>();
deviceLibraryList.forEach(deviceLibrary -> {
DeviceLibraryPosition deviceLibraryPosition = new DeviceLibraryPosition();
deviceLibraryPosition.setDeviceId(deviceLibrary.getId());
deviceLibraryPositions.add(deviceLibraryPosition);
});
//批量保存到3D中
deviceLibraryPositionService.batchDeviceLibraryPositions(deviceLibraryPositions);
}
private Specification<DeviceLibrary> getSelectSpecification(DeviceLibrarySelectVo deviceLibrarySelectVo) { private Specification<DeviceLibrary> getSelectSpecification(DeviceLibrarySelectVo deviceLibrarySelectVo) {
PredicateBuilder<DeviceLibrary> predicateBuilder = getPredicateBuilder(deviceLibrarySelectVo); PredicateBuilder<DeviceLibrary> predicateBuilder = getPredicateBuilder(deviceLibrarySelectVo);
//unitId为空,默认查询当前单位 //unitId为空,默认查询当前单位
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论