|
@@ -76,42 +76,6 @@ public class FdModelController {
|
|
|
}
|
|
|
|
|
|
|
|
|
-// @ApiOperation("测试生成队列")
|
|
|
-// @GetMapping("command/queProducer/{fileId}/")
|
|
|
-// private R queProducer(@PathVariable("fileId") Long fileId) {
|
|
|
-// log.info("run queProducer: {}", fileId);
|
|
|
-//
|
|
|
-// // 命令产生的是文件夹
|
|
|
-// FileEntity fileEntity = new FileEntity();
|
|
|
-// fileEntity.setFileName(fileId.toString());
|
|
|
-// fileEntity.setFileUrl("33");
|
|
|
-// fileEntity.setCreateTime(new Date());
|
|
|
-// fileEntity.setUpdateTime(new Date());
|
|
|
-// fileEntity.setStatus(5);
|
|
|
-//
|
|
|
-// fileEntity = fileServer.save(fileEntity);
|
|
|
-//
|
|
|
-// MyQueue que = new MyQueue();
|
|
|
-// que.setObj(fileEntity);
|
|
|
-// que.setStr("cmd1");
|
|
|
-//
|
|
|
-// // 将数据存入队列中
|
|
|
-// boolean offer = false;
|
|
|
-// try {
|
|
|
-// offer = oQueue.offer(que, 2, TimeUnit.SECONDS);
|
|
|
-// } catch (InterruptedException e) {
|
|
|
-// e.printStackTrace();
|
|
|
-// }
|
|
|
-// if (offer) {
|
|
|
-// System.out.println("生产者,存入" + que.toString() + "到队列中,成功.");
|
|
|
-// } else {
|
|
|
-// System.out.println("生产者,存入" + que.toString() + "到队列中,失败.");
|
|
|
-// }
|
|
|
-//
|
|
|
-// return new R(200, fileEntity);
|
|
|
-//
|
|
|
-// }
|
|
|
-
|
|
|
/**
|
|
|
* 消费队列
|
|
|
*/
|
|
@@ -155,66 +119,6 @@ public class FdModelController {
|
|
|
|
|
|
|
|
|
|
|
|
-// @ApiOperation("生成队列")
|
|
|
-// @PostMapping(value = "test")
|
|
|
-// private R test() {
|
|
|
-// log.info("run test");
|
|
|
-// // 将数据存入队列中
|
|
|
-// String data = count.incrementAndGet() + "";
|
|
|
-//
|
|
|
-// boolean offer = false;
|
|
|
-// try {
|
|
|
-// // 将数据存入队列中
|
|
|
-// offer = queue.offer(data, 2, TimeUnit.SECONDS);
|
|
|
-// } catch (InterruptedException e) {
|
|
|
-// e.printStackTrace();
|
|
|
-// }
|
|
|
-// if (offer) {
|
|
|
-// System.out.println("生产者,存入" + data + "到队列中,成功.");
|
|
|
-// } else {
|
|
|
-// System.out.println("生产者,存入" + data + "到队列中,失败.");
|
|
|
-// }
|
|
|
-// return new R(200, data);
|
|
|
-// }
|
|
|
-
|
|
|
-// @ApiOperation("消费队列")
|
|
|
-// @PostMapping(value = "test2")
|
|
|
-// private R test2() {
|
|
|
-// log.info("run test");
|
|
|
-//
|
|
|
-//
|
|
|
-// String data = null;
|
|
|
-// try {
|
|
|
-// data = queue.poll(2, TimeUnit.SECONDS);
|
|
|
-// } catch (InterruptedException e) {
|
|
|
-// e.printStackTrace();
|
|
|
-// }
|
|
|
-// if (data != null) {
|
|
|
-// System.out.println("消费者,拿到队列中的数据data:" + data);
|
|
|
-// }
|
|
|
-// return new R(200, data);
|
|
|
-// }
|
|
|
-
|
|
|
-// public class ConsumerThread implements Runnable{
|
|
|
-//
|
|
|
-// @Override
|
|
|
-// public void run() {
|
|
|
-// log.warn("run ConsumerThread");
|
|
|
-// while (true) {
|
|
|
-// try {
|
|
|
-// String data = queue.poll(2, TimeUnit.SECONDS);
|
|
|
-// if (data != null) {
|
|
|
-// log.info("消费者,拿到队列中的数据data:" + data);
|
|
|
-// }
|
|
|
-// Thread.sleep(2000);
|
|
|
-// } catch (InterruptedException e) {
|
|
|
-// e.printStackTrace();
|
|
|
-// }
|
|
|
-// }
|
|
|
-// }
|
|
|
-// }
|
|
|
-
|
|
|
-
|
|
|
@ApiOperation("上传3D模型数据,只能上传zip文件")
|
|
|
@PostMapping(value = "upload", consumes = {"multipart/form-data"})
|
|
|
private R upload(@RequestParam("file") MultipartFile file) {
|
|
@@ -323,87 +227,6 @@ public class FdModelController {
|
|
|
|
|
|
}
|
|
|
|
|
|
-// @ApiOperation("倾斜摄影数据切片")
|
|
|
-// @GetMapping("command/osgb/{fileId}/")
|
|
|
-// private R cmdModelSlice(@PathVariable("fileId") Long fileId) {
|
|
|
-// log.info("run cmdModelSlice: {}", fileId);
|
|
|
-//
|
|
|
-//
|
|
|
-//// // 将数据存入队列中
|
|
|
-//// String data = count.incrementAndGet() + "";
|
|
|
-//// boolean offer = false;
|
|
|
-//// try {
|
|
|
-//// // 将数据存入队列中
|
|
|
-//// offer = queue.offer(data, 2, TimeUnit.SECONDS);
|
|
|
-//// } catch (InterruptedException e) {
|
|
|
-//// e.printStackTrace();
|
|
|
-//// }
|
|
|
-//// if (offer) {
|
|
|
-//// System.out.println("生产者,存入" + data + "到队列中,成功.");
|
|
|
-//// } else {
|
|
|
-//// System.out.println("生产者,存入" + data + "到队列中,失败.");
|
|
|
-//// }
|
|
|
-//
|
|
|
-//
|
|
|
-// FileEntity entity = fileServer.findById(fileId);
|
|
|
-// // 传入的是目录
|
|
|
-// String cmd = Command.MODEL_SLICE_OSGB;
|
|
|
-// cmd = cmd.replace("@fileName", entity.getFileName());
|
|
|
-// log.info("cmd: {}", cmd);
|
|
|
-//
|
|
|
-// // 命令产生的是文件夹
|
|
|
-// FileEntity fileEntity = new FileEntity();
|
|
|
-// fileEntity.setFileName(entity.getFileName());
|
|
|
-// fileEntity.setFileUrl(OUTPUT_FILE_PATH + entity.getFileName());
|
|
|
-// fileEntity.setCreateTime(new Date());
|
|
|
-// fileEntity.setUpdateTime(new Date());
|
|
|
-// fileEntity.setStatus(5);
|
|
|
-//
|
|
|
-// fileEntity = fileServer.save(fileEntity);
|
|
|
-//
|
|
|
-// // 多线程运行切片
|
|
|
-// new Thread(new ModelSliceThread(cmd, fileEntity)).start();
|
|
|
-//
|
|
|
-//
|
|
|
-// return new R(200, fileEntity);
|
|
|
-//
|
|
|
-// }
|
|
|
-
|
|
|
-
|
|
|
-// public class ModelSliceThread implements Runnable {
|
|
|
-//
|
|
|
-// private volatile boolean flag = true;
|
|
|
-//
|
|
|
-// private String cmd;
|
|
|
-//
|
|
|
-// private FileEntity entity;
|
|
|
-//
|
|
|
-// private ModelSliceThread(String cmd, FileEntity entity) {
|
|
|
-// this.cmd = cmd;
|
|
|
-// this.entity = entity;
|
|
|
-//
|
|
|
-// }
|
|
|
-//
|
|
|
-// @Override
|
|
|
-// public void run() {
|
|
|
-// log.warn("run ModelSliceThread");
|
|
|
-//
|
|
|
-//// queue.poll(2, Ti)
|
|
|
-//
|
|
|
-// Integer integer = cmdServer.exeCmdModelSlice(cmd);
|
|
|
-// if (integer != 0) {
|
|
|
-// log.info("error command exeCmdModelSlice");
|
|
|
-// // 如果命令运行失败,删除刚才创建的实体类
|
|
|
-// fileServer.deleteById(entity.getId());
|
|
|
-// return;
|
|
|
-// }
|
|
|
-// log.warn("end RasterSliceThread");
|
|
|
-// }
|
|
|
-// }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
|
|
|
@ApiOperation("移动数据到服务器上")
|
|
|
@GetMapping("move/{fileId}/")
|