|
|
@@ -3,6 +3,7 @@ package com.siwei.apply.service.impl;
|
|
|
import com.siwei.apply.domain.*;
|
|
|
import com.siwei.apply.mapper.*;
|
|
|
import com.siwei.apply.service.ThematicService;
|
|
|
+import com.siwei.apply.service.cadastre.impl.FzssFxrwrzHandleService;
|
|
|
import com.siwei.apply.utils.DownloadUtils;
|
|
|
import com.siwei.apply.utils.FixedThreadUtil;
|
|
|
import com.siwei.common.core.domain.R;
|
|
|
@@ -44,6 +45,11 @@ public class ThematicImpl implements ThematicService {
|
|
|
@Value("${python.parcelmap}")
|
|
|
private String parcelmapPy;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private FzssFxrwrzHandleService fzssFxrwrzHandleService;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
@Override
|
|
|
public R<Object> list(String name, String rwlx, Integer page, Integer limit) {
|
|
|
try {
|
|
|
@@ -95,6 +101,8 @@ public class ThematicImpl implements ThematicService {
|
|
|
String uuid = StringUtils.getUUID();
|
|
|
// 插入制图任务表
|
|
|
thematicMapper.addRw(uuid, name, rwlx, ztfw, ztry);
|
|
|
+ fzssFxrwrzHandleService.insertFxrwrz(uuid, "地籍制图", "任务创建成功", "info");
|
|
|
+
|
|
|
// 判断需要执行的python脚本
|
|
|
String pyPath = "";
|
|
|
if ("1".equals(rwlx)) {
|
|
|
@@ -106,6 +114,7 @@ public class ThematicImpl implements ThematicService {
|
|
|
// 异步线程执行分析
|
|
|
FixedThreadUtil.FIXED_THREAD_POOL.execute(() -> {
|
|
|
try {
|
|
|
+ fzssFxrwrzHandleService.insertFxrwrz(uuid, "地籍制图", "开始制图任务。。。", "info");
|
|
|
// 更新状态为运行中
|
|
|
thematicMapper.updateRwzt(uuid, "1");
|
|
|
//TODO command ProcessBuilder
|
|
|
@@ -113,6 +122,7 @@ public class ThematicImpl implements ThematicService {
|
|
|
pb.redirectErrorStream(true);
|
|
|
Process process = null;
|
|
|
process = pb.start();
|
|
|
+ fzssFxrwrzHandleService.insertFxrwrz(uuid, "地籍制图", "制图任务启动。。。", "info");
|
|
|
BufferedReader reader = new BufferedReader(
|
|
|
new InputStreamReader(process.getInputStream()));
|
|
|
String line;
|
|
|
@@ -133,14 +143,15 @@ public class ThematicImpl implements ThematicService {
|
|
|
// 插入制图产品表
|
|
|
thematicMapper.addDetails(id, uuid, args[0], args[1], args[2]);
|
|
|
}
|
|
|
+ fzssFxrwrzHandleService.insertFxrwrz(uuid, "地籍制图", "制图成功", "info");
|
|
|
} else {
|
|
|
// 更新状态为失败
|
|
|
thematicMapper.updateRwzt2(uuid, "3");
|
|
|
+ fzssFxrwrzHandleService.insertFxrwrz(uuid, "地籍制图", "制图失败", "info");
|
|
|
}
|
|
|
} catch (IOException e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
-
|
|
|
});
|
|
|
return R.ok("制图任务创建成功!id:"+uuid);
|
|
|
}
|
|
|
@@ -156,9 +167,9 @@ public class ThematicImpl implements ThematicService {
|
|
|
}
|
|
|
Integer offset = (page - 1) * limit;
|
|
|
List<ThematicDetails> datas = thematicMapper.productlist(name, taskid, offset, limit);
|
|
|
- for (ThematicDetails cur : datas) {
|
|
|
- cur.setFilepath(StringUtils.getFileStaticPath(cur.getFilepath(), temppath));
|
|
|
- }
|
|
|
+// for (ThematicDetails cur : datas) {
|
|
|
+// cur.setFilepath(StringUtils.getFileStaticPath(cur.getFilepath(), temppath));
|
|
|
+// }
|
|
|
Integer count = thematicMapper.productlistcount(name, taskid);
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
map.put("count", count);
|