|
@@ -66,6 +66,7 @@ public class ApiGisSurveyController {
|
|
|
private final AtomicInteger mSeqThirdImportCommitReq;
|
|
|
private final AtomicInteger mSeqCadConvertReq;
|
|
|
private final AtomicInteger mSeqThirdExportReq;
|
|
|
+ private final AtomicInteger mSeqThirdExportGetReq;
|
|
|
private final AtomicInteger mSeqCadConvertGetReq;
|
|
|
|
|
|
private final GisSurveySystemCheckBizService systemCheckBizService;
|
|
@@ -91,6 +92,7 @@ public class ApiGisSurveyController {
|
|
|
mSeqThirdImportPreviewReq = new AtomicInteger(0);
|
|
|
mSeqThirdImportCommitReq = new AtomicInteger(0);
|
|
|
mSeqThirdExportReq = new AtomicInteger(0);
|
|
|
+ mSeqThirdExportGetReq = new AtomicInteger(0);
|
|
|
mSeqCadConvertReq = new AtomicInteger(0);
|
|
|
mSeqCadConvertGetReq = new AtomicInteger(0);
|
|
|
this.systemCheckBizService = systemCheckBizService;
|
|
@@ -607,12 +609,12 @@ public class ApiGisSurveyController {
|
|
|
, @RequestHeader(value = ApiURI.HEADER_CLIENT_TYPE, required = false) String strClientType
|
|
|
, @RequestHeader(value = ApiURI.HEADER_USER_AGENT, required = false) String strUserAgent
|
|
|
, @RequestParam(value = "jobId", required = false) String jobId
|
|
|
- , @RequestParam(value = "fileType", required = false, defaultValue = "excel") String fileType) throws SelfException {
|
|
|
+ , @RequestParam(value = "fileType", required = false) String fileType) throws SelfException {
|
|
|
//入参校验
|
|
|
final String URI_PATH = request.getRequestURI();
|
|
|
final String strPlatform = CommTool.getPlatformByAgent(strClientType, strUserAgent);
|
|
|
final String strUserId = (String) request.getAttribute(TokenAuthenticationService.HEADER_USERID);
|
|
|
- if (StringUtils.isAnyBlank(jobId) || StringUtils.length(jobId) > 64 || StringUtils.length(fileType) > 64) {
|
|
|
+ if (StringUtils.isAnyBlank(jobId,fileType) || StringUtils.length(jobId) > 64 || StringUtils.length(fileType) > 64) {
|
|
|
throw new SelfException(ResponseCode.STATUS_ERROR_PARAM_FORMAT.toStrCode()
|
|
|
, String.format(ApiURI.EXCEPTION_FORMAT
|
|
|
, strPlatform
|
|
@@ -667,6 +669,79 @@ public class ApiGisSurveyController {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * 获取第三方导出结果
|
|
|
+ *
|
|
|
+ * @param request request
|
|
|
+ * @param strClientType 客户端类型
|
|
|
+ * @param strUserAgent 用户信息
|
|
|
+ * @param jobId 任务id
|
|
|
+ * @return cad转换结果
|
|
|
+ */
|
|
|
+ @GetMapping(value = ApiURI.URI_XXX_THIRD_EXPORT_GET)
|
|
|
+ public ResponseRes<CommAsyncResult<Map<String, String>>> thirdExportGet(HttpServletRequest request
|
|
|
+ , @RequestHeader(value = ApiURI.HEADER_CLIENT_TYPE, required = false) String strClientType
|
|
|
+ , @RequestHeader(value = ApiURI.HEADER_USER_AGENT, required = false) String strUserAgent
|
|
|
+ , @RequestParam(value = "jobId", required = false) String jobId) throws SelfException {
|
|
|
+ //入参校验
|
|
|
+ final String URI_PATH = request.getRequestURI();
|
|
|
+ final String strPlatform = CommTool.getPlatformByAgent(strClientType, strUserAgent);
|
|
|
+ final String strUserId = (String) request.getAttribute(TokenAuthenticationService.HEADER_USERID);
|
|
|
+ if (StringUtils.isAnyBlank(jobId) || StringUtils.length(jobId) > 64) {
|
|
|
+ throw new SelfException(ResponseCode.STATUS_ERROR_PARAM_FORMAT.toStrCode()
|
|
|
+ , String.format(ApiURI.EXCEPTION_FORMAT
|
|
|
+ , strPlatform
|
|
|
+ , URI_PATH
|
|
|
+ , ResponseCode.STATUS_ERROR_PARAM_FORMAT.toStrMsg()));
|
|
|
+ }
|
|
|
+
|
|
|
+ //begin
|
|
|
+ long llReqBefore = System.currentTimeMillis();
|
|
|
+ String strRunSeq = String.format("%d-%d", llReqBefore, mSeqThirdExportGetReq.incrementAndGet());
|
|
|
+ LogPrintMgr.getInstance().printLogMsg(LogLevelFlag.LOG_INFO, mBizType, mStrClassName, strUserId
|
|
|
+ , String.format("%s:%s seq:{%s} param:%s begin====>"
|
|
|
+ , strPlatform
|
|
|
+ , URI_PATH
|
|
|
+ , strRunSeq
|
|
|
+ , jobId));
|
|
|
+
|
|
|
+ //构建result
|
|
|
+ ResponseRes<CommAsyncResult<Map<String, String>>> resResult = new ResponseRes<>();
|
|
|
+ resResult.setRescode(ResponseCode.RESULT_ASYNC_TASK_FAILED.toStrCode());
|
|
|
+ resResult.setResmsg(ResponseCode.RESULT_ASYNC_TASK_FAILED.toStrMsg());
|
|
|
+
|
|
|
+ //执行第三方导出
|
|
|
+ CommAsyncResult<Map<String, String>> result = thirdExportBizService.getResult(jobId);
|
|
|
+
|
|
|
+ //执行成功
|
|
|
+ if (result != null && !Objects.equals(result.getStatus(), CommAsyncStatusEnum.FAIL.getCode())) {
|
|
|
+ resResult.setRescode(ResponseCode.RESULT_NORMAL.toStrCode());
|
|
|
+ resResult.setResmsg(ResponseCode.RESULT_NORMAL.toStrMsg());
|
|
|
+ resResult.setResdata(result);
|
|
|
+ }
|
|
|
+ //执行失败
|
|
|
+ if (result != null && Objects.equals(result.getStatus(), CommAsyncStatusEnum.FAIL.getCode())) {
|
|
|
+ resResult.setResdata(result);
|
|
|
+ }
|
|
|
+ //不存在
|
|
|
+ if (result == null) {
|
|
|
+ resResult.setRescode(ResponseCode.RESULT_ASYNC_TASK_NOT_FOUND.toStrCode());
|
|
|
+ resResult.setResmsg(ResponseCode.RESULT_ASYNC_TASK_NOT_FOUND.toStrMsg());
|
|
|
+ }
|
|
|
+
|
|
|
+ //end
|
|
|
+ resResult.setTimestamp(System.currentTimeMillis());
|
|
|
+ LogPrintMgr.getInstance().printLogMsg(LogLevelFlag.LOG_INFO, mBizType, mStrClassName, strUserId
|
|
|
+ , String.format("%s:%s seq:{%s} rescode:{%s} resmsg:{%s} time:{%d ms} end<===="
|
|
|
+ , strPlatform
|
|
|
+ , URI_PATH
|
|
|
+ , strRunSeq
|
|
|
+ , resResult.getRescode()
|
|
|
+ , resResult.getResmsg()
|
|
|
+ , resResult.getTimestamp() - llReqBefore));
|
|
|
+ return resResult;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* 执行cad转换
|
|
|
*
|
|
|
* @param request request
|