|
@@ -14,13 +14,18 @@ import com.shkpr.service.alambizplugin.constants.LogFlagBusiType;
|
|
|
import com.shkpr.service.alambizplugin.constants.ResponseCode;
|
|
|
import com.shkpr.service.alambizplugin.controllerfilter.TokenAuthenticationService;
|
|
|
import com.shkpr.service.alambizplugin.controllervalid.CommonParamValidSK;
|
|
|
+import com.shkpr.service.alambizplugin.dbdao.services.GisSurveyLayerApplyThirdCopyServiceImpl;
|
|
|
import com.shkpr.service.alambizplugin.dbdao.services.intef.GisSurveyLayerApplyService;
|
|
|
+import com.shkpr.service.alambizplugin.dto.GisSurveyLayerApplyThirdCopy;
|
|
|
import com.shkpr.service.alambizplugin.dto.GisSurveySystemCheckResult;
|
|
|
import com.shkpr.service.alambizplugin.dto.GisSurveyThirdImportResult;
|
|
|
+import com.shkpr.service.alambizplugin.dto.PageResponse;
|
|
|
import com.shkpr.service.alambizplugin.dto.ResponseRes;
|
|
|
import com.shkpr.service.alambizplugin.exception.SelfException;
|
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
+import org.springframework.data.domain.Pageable;
|
|
|
+import org.springframework.data.web.PageableDefault;
|
|
|
import org.springframework.validation.BindingResult;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
@@ -48,22 +53,29 @@ public class ApiGisSurveyController {
|
|
|
private final AtomicInteger mSeqSysCheckCancelReq;
|
|
|
private final AtomicInteger mSeqThirdImportReq;
|
|
|
private final AtomicInteger mSeqThirdImportCancelReq;
|
|
|
+ private final AtomicInteger mSeqThirdImportPreviewReq;
|
|
|
+ private final AtomicInteger mSeqThirdImportCommitReq;
|
|
|
|
|
|
private final GisSurveySystemCheckBizService systemCheckBizService;
|
|
|
private final GisSurveyThirdImportBizService thirdImportBizService;
|
|
|
private final GisSurveyLayerApplyService layerApplyService;
|
|
|
+ private final GisSurveyLayerApplyThirdCopyServiceImpl layerApplyThirdCopyService;
|
|
|
|
|
|
public ApiGisSurveyController(GisSurveySystemCheckBizService systemCheckBizService
|
|
|
- , GisSurveyThirdImportBizService thirdImportBizService, GisSurveyLayerApplyService layerApplyService) {
|
|
|
+ , GisSurveyThirdImportBizService thirdImportBizService, GisSurveyLayerApplyService layerApplyService
|
|
|
+ , GisSurveyLayerApplyThirdCopyServiceImpl layerApplyThirdCopyService) {
|
|
|
mStrClassName = "ApiGisSurveyController";
|
|
|
mBizType = LogFlagBusiType.BUSI_GIS_SURVEY.toStrValue();
|
|
|
mSeqSysCheckReq = new AtomicInteger(0);
|
|
|
mSeqSysCheckCancelReq = new AtomicInteger(0);
|
|
|
mSeqThirdImportReq = new AtomicInteger(0);
|
|
|
mSeqThirdImportCancelReq = new AtomicInteger(0);
|
|
|
+ mSeqThirdImportPreviewReq = new AtomicInteger(0);
|
|
|
+ mSeqThirdImportCommitReq = new AtomicInteger(0);
|
|
|
this.systemCheckBizService = systemCheckBizService;
|
|
|
this.thirdImportBizService = thirdImportBizService;
|
|
|
this.layerApplyService = layerApplyService;
|
|
|
+ this.layerApplyThirdCopyService = layerApplyThirdCopyService;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -355,6 +367,69 @@ public class ApiGisSurveyController {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * 预览第三方导入
|
|
|
+ *
|
|
|
+ * @param request request
|
|
|
+ * @param strClientType 客户端类型
|
|
|
+ * @param strUserAgent 用户信息
|
|
|
+ * @param jobId 任务id
|
|
|
+ * @param pageable 分页
|
|
|
+ * @return 清除状态
|
|
|
+ * @throws SelfException selfException
|
|
|
+ */
|
|
|
+ @GetMapping(value = ApiURI.URI_XXX_THIRD_IMPORT_PREVIEW)
|
|
|
+ public ResponseRes<?> previewImport(HttpServletRequest request
|
|
|
+ , @RequestHeader(value = ApiURI.HEADER_CLIENT_TYPE, required = false) String strClientType
|
|
|
+ , @RequestHeader(value = ApiURI.HEADER_USER_AGENT, required = false) String strUserAgent
|
|
|
+ , @RequestParam("jobId") String jobId, @PageableDefault() Pageable pageable) throws Exception {
|
|
|
+ //入参校验
|
|
|
+ final String URI_PATH = request.getRequestURI();
|
|
|
+ final String strPlatform = CommTool.getPlatformByAgent(strClientType, strUserAgent);
|
|
|
+ final String strUserId = (String) request.getAttribute(TokenAuthenticationService.HEADER_USERID);
|
|
|
+ if (StringUtils.isBlank(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, mSeqThirdImportPreviewReq.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<PageResponse<GisSurveyLayerApplyThirdCopy>> resResult = new ResponseRes<>();
|
|
|
+ resResult.setRescode(ResponseCode.RESULT_THIRD_IMPORT_FAILED.toStrCode());
|
|
|
+ resResult.setResmsg(ResponseCode.RESULT_THIRD_IMPORT_FAILED.toStrMsg());
|
|
|
+
|
|
|
+ //查询
|
|
|
+ PageResponse<GisSurveyLayerApplyThirdCopy> pageResponse = layerApplyThirdCopyService.findByJobId(jobId, pageable);
|
|
|
+ resResult.setRescode(ResponseCode.RESULT_NORMAL.toStrCode());
|
|
|
+ resResult.setResmsg(ResponseCode.RESULT_NORMAL.toStrMsg());
|
|
|
+ resResult.setResdata(pageResponse);
|
|
|
+
|
|
|
+ //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;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
* 提交第三方导入
|
|
|
*
|
|
|
* @param request request
|
|
@@ -382,7 +457,7 @@ public class ApiGisSurveyController {
|
|
|
}
|
|
|
//begin
|
|
|
long llReqBefore = System.currentTimeMillis();
|
|
|
- String strRunSeq = String.format("%d-%d", llReqBefore, mSeqThirdImportCancelReq.incrementAndGet());
|
|
|
+ String strRunSeq = String.format("%d-%d", llReqBefore, mSeqThirdImportCommitReq.incrementAndGet());
|
|
|
LogPrintMgr.getInstance().printLogMsg(LogLevelFlag.LOG_INFO, mBizType, mStrClassName, strUserId
|
|
|
, String.format("%s:%s seq:{%s} param:%s begin====>"
|
|
|
, strPlatform
|