|
@@ -15,11 +15,9 @@ import com.fdkankan.common.util.MD5;
|
|
import com.fdkankan.common.util.SnowflakeIdGenerator;
|
|
import com.fdkankan.common.util.SnowflakeIdGenerator;
|
|
import com.fdkankan.contro.entity.SceneFileBuild;
|
|
import com.fdkankan.contro.entity.SceneFileBuild;
|
|
import com.fdkankan.contro.entity.SceneOrigBd;
|
|
import com.fdkankan.contro.entity.SceneOrigBd;
|
|
|
|
+import com.fdkankan.contro.entity.ScenePlus;
|
|
import com.fdkankan.contro.httpclient.CustomHttpClient;
|
|
import com.fdkankan.contro.httpclient.CustomHttpClient;
|
|
-import com.fdkankan.contro.service.GzZcdjzxService;
|
|
|
|
-import com.fdkankan.contro.service.IHaixinService;
|
|
|
|
-import com.fdkankan.contro.service.ISceneFileBuildService;
|
|
|
|
-import com.fdkankan.contro.service.ISceneOrigBdService;
|
|
|
|
|
|
+import com.fdkankan.contro.service.*;
|
|
import com.fdkankan.contro.util.BdUtil;
|
|
import com.fdkankan.contro.util.BdUtil;
|
|
import com.fdkankan.fyun.config.FYunFileConfig;
|
|
import com.fdkankan.fyun.config.FYunFileConfig;
|
|
import com.fdkankan.fyun.face.FYunFileServiceInterface;
|
|
import com.fdkankan.fyun.face.FYunFileServiceInterface;
|
|
@@ -48,8 +46,6 @@ import java.util.UUID;
|
|
public class GzZcdjzxServiceImpl implements GzZcdjzxService {
|
|
public class GzZcdjzxServiceImpl implements GzZcdjzxService {
|
|
|
|
|
|
@Resource
|
|
@Resource
|
|
- private BdUtil bdUtil;
|
|
|
|
- @Resource
|
|
|
|
private CustomHttpClient httpClient;
|
|
private CustomHttpClient httpClient;
|
|
@Resource
|
|
@Resource
|
|
private FYunFileConfig fYunFileConfig;
|
|
private FYunFileConfig fYunFileConfig;
|
|
@@ -59,6 +55,8 @@ public class GzZcdjzxServiceImpl implements GzZcdjzxService {
|
|
private ISceneOrigBdService sceneOrigBdService;
|
|
private ISceneOrigBdService sceneOrigBdService;
|
|
@Autowired
|
|
@Autowired
|
|
private IHaixinService haixinService;
|
|
private IHaixinService haixinService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private IScenePlusService scenePlusService;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -66,7 +64,10 @@ public class GzZcdjzxServiceImpl implements GzZcdjzxService {
|
|
|
|
|
|
List<SceneOrigBd> list = sceneOrigBdService.list(new LambdaQueryWrapper<SceneOrigBd>().eq(SceneOrigBd::getStatus, CommonSuccessStatus.WAITING.code()));
|
|
List<SceneOrigBd> list = sceneOrigBdService.list(new LambdaQueryWrapper<SceneOrigBd>().eq(SceneOrigBd::getStatus, CommonSuccessStatus.WAITING.code()));
|
|
|
|
|
|
- list.stream().forEach(v->{
|
|
|
|
|
|
+ if(CollUtil.isEmpty(list)){
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ for (SceneOrigBd v : list) {
|
|
String uuid = UUID.randomUUID().toString();
|
|
String uuid = UUID.randomUUID().toString();
|
|
String fileUrl = v.getFileUrl();
|
|
String fileUrl = v.getFileUrl();
|
|
String zipName = FileUtil.getName(fileUrl);
|
|
String zipName = FileUtil.getName(fileUrl);
|
|
@@ -74,6 +75,12 @@ public class GzZcdjzxServiceImpl implements GzZcdjzxService {
|
|
String taskId = v.getTaskId();
|
|
String taskId = v.getTaskId();
|
|
String kNo = v.getKNo();
|
|
String kNo = v.getKNo();
|
|
try {
|
|
try {
|
|
|
|
+
|
|
|
|
+ ScenePlus scenePlus = scenePlusService.getByTaskId(taskId);
|
|
|
|
+ if(scenePlus.getSceneStatus() == SceneStatus.wait.code()){
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+
|
|
httpClient.downloadFile(fileUrl, zipDir, zipName);
|
|
httpClient.downloadFile(fileUrl, zipDir, zipName);
|
|
String unzipCmd = "unzip -o -O GBK " + zipDir + zipName + " -d " + zipDir;
|
|
String unzipCmd = "unzip -o -O GBK " + zipDir + zipName + " -d " + zipDir;
|
|
|
|
|
|
@@ -129,14 +136,16 @@ public class GzZcdjzxServiceImpl implements GzZcdjzxService {
|
|
try {
|
|
try {
|
|
ResultData resultData = null;
|
|
ResultData resultData = null;
|
|
if(camType == 5){//圆周率
|
|
if(camType == 5){//圆周率
|
|
- resultData = sceneFileBuildService.uploadSuccessBuild(params, taskId, kNo);
|
|
|
|
|
|
+ resultData = sceneFileBuildService.uploadSuccessBuild(params, taskId, kNo);
|
|
}else{
|
|
}else{
|
|
- resultData = sceneFileBuildService.turntableUploadSuccess(params, taskId, kNo);
|
|
|
|
|
|
+ resultData = sceneFileBuildService.turntableUploadSuccess(params, taskId, kNo);
|
|
}
|
|
}
|
|
code = resultData.getCode();
|
|
code = resultData.getCode();
|
|
}catch (BusinessException e){
|
|
}catch (BusinessException e){
|
|
|
|
+ log.error("提交建模失败,taskId:{}", taskId, e);
|
|
code = e.getCode();
|
|
code = e.getCode();
|
|
} catch (Exception e){
|
|
} catch (Exception e){
|
|
|
|
+ log.error("提交建模失败,taskId:{}", taskId, e);
|
|
code = ServerCode.SYSTEM_ERROR.code();
|
|
code = ServerCode.SYSTEM_ERROR.code();
|
|
}
|
|
}
|
|
|
|
|
|
@@ -146,12 +155,13 @@ public class GzZcdjzxServiceImpl implements GzZcdjzxService {
|
|
v.setStatus(CommonSuccessStatus.FAIL.code());
|
|
v.setStatus(CommonSuccessStatus.FAIL.code());
|
|
}
|
|
}
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
|
+ log.error("提交建模失败,taskId:{}", taskId, e);
|
|
v.setStatus(CommonSuccessStatus.FAIL.code());
|
|
v.setStatus(CommonSuccessStatus.FAIL.code());
|
|
haixinService.sendResult(taskId, null);
|
|
haixinService.sendResult(taskId, null);
|
|
|
|
|
|
}
|
|
}
|
|
sceneOrigBdService.updateById(v);
|
|
sceneOrigBdService.updateById(v);
|
|
- });
|
|
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
public static void main(String[] args) throws Exception {
|