|
|
@ -3,36 +3,32 @@ package com.epmet.apiservice.impl; |
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
import com.epmet.apiservice.ApiService; |
|
|
|
import com.epmet.apiservice.result.LZGridPlatformBaseResult; |
|
|
|
import com.epmet.apiservice.result.LZGridPlatformProjectAssistResult; |
|
|
|
import com.epmet.commons.tools.constant.StrConstant; |
|
|
|
import com.epmet.commons.tools.exception.RenException; |
|
|
|
import com.epmet.commons.tools.redis.RedisKeys; |
|
|
|
import com.epmet.commons.tools.utils.HttpClientManager; |
|
|
|
import com.epmet.commons.tools.utils.Result; |
|
|
|
import com.epmet.commons.tools.utils.SpringContextUtils; |
|
|
|
import com.epmet.constant.ThirdPlatformActions; |
|
|
|
import com.epmet.dao.ThirdplatformActionDao; |
|
|
|
import com.epmet.dao.ThirdplatformDao; |
|
|
|
import com.epmet.dto.form.ProjectApplyAssistFormDTO; |
|
|
|
import com.epmet.dto.form.UploadFileFormDTO; |
|
|
|
import com.epmet.dto.result.ProjectAssistResult; |
|
|
|
import com.epmet.dto.form.ProjectApplyAssistFormDTO; |
|
|
|
import com.epmet.dto.result.UploadFileResultDTO; |
|
|
|
import com.epmet.entity.ThirdplatformActionEntity; |
|
|
|
import com.epmet.entity.ThirdplatformEntity; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.apache.commons.io.FileUtils; |
|
|
|
import org.apache.commons.io.FilenameUtils; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.springframework.data.redis.core.RedisTemplate; |
|
|
|
import org.springframework.stereotype.Component; |
|
|
|
|
|
|
|
import java.io.File; |
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.Objects; |
|
|
|
import java.util.concurrent.TimeUnit; |
|
|
|
|
|
|
|
/** |
|
|
|
* 泸州网格化平台ApiService |
|
|
|
*/ |
|
|
|
@Slf4j |
|
|
|
@Component("luzhouGridPlatformApiService") |
|
|
|
public class LuzhouGridPlatformApiService extends ApiService { |
|
|
|
|
|
|
@ -51,13 +47,13 @@ public class LuzhouGridPlatformApiService extends ApiService { |
|
|
|
HashMap<String, Object> params = new HashMap<>(); |
|
|
|
params.put("appKey", platformKey); |
|
|
|
params.put("appSecret", platformSecret); |
|
|
|
Result<String> result = HttpClientManager.getInstance().sendGet(baseUrl.concat(actionEntity.getApiUrl()), params); |
|
|
|
|
|
|
|
if (result == null) { |
|
|
|
throw new RenException("请求第三方平台,获取AccessToken失败。result为null"); |
|
|
|
} |
|
|
|
Result<String> result = null; |
|
|
|
int tryTime = 0; |
|
|
|
do { |
|
|
|
result = HttpClientManager.getInstance().sendGet(baseUrl.concat(actionEntity.getApiUrl()), params); |
|
|
|
} while ((result == null || !result.success()) && super.RETRY_TIME<tryTime++); |
|
|
|
|
|
|
|
if (!result.success()) { |
|
|
|
if (result == null || !result.success()) { |
|
|
|
throw new RenException("请求第三方平台,获取AccessToken失败。"); |
|
|
|
} |
|
|
|
|
|
|
@ -92,7 +88,7 @@ public class LuzhouGridPlatformApiService extends ApiService { |
|
|
|
// 此处设置为第三方系统返回的唯一id
|
|
|
|
projectAssistResult.setTaskId(lzResult.getResult()); |
|
|
|
} |
|
|
|
System.out.println("泸州网格化平台项目协助发送成功"); |
|
|
|
log.info("projectAssist 泸州网格化平台项目协助发送成功"); |
|
|
|
return projectAssistResult; |
|
|
|
} |
|
|
|
|
|
|
|