|
|
@@ -1,7 +1,12 @@ |
|
|
|
package com.ningdatech.pmapi.projectlib.manage; |
|
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil; |
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
import com.alibaba.fastjson.JSONArray; |
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.ningdatech.basic.exception.BizException; |
|
|
|
import com.ningdatech.basic.function.VUtils; |
|
|
|
import com.ningdatech.basic.model.ApiResponse; |
|
|
|
import com.ningdatech.pmapi.common.util.HmacAuthUtil; |
|
|
|
import com.ningdatech.pmapi.projectlib.model.dto.ApplicationAppCodeSaveDTO; |
|
|
|
import com.ningdatech.pmapi.projectlib.model.entity.ProjectApplication; |
|
|
@@ -9,11 +14,9 @@ import com.ningdatech.pmapi.projectlib.service.IProjectApplicationService; |
|
|
|
import com.ningdatech.pmapi.user.util.LoginUserUtil; |
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Value; |
|
|
|
import org.springframework.http.HttpEntity; |
|
|
|
import org.springframework.http.HttpHeaders; |
|
|
|
import org.springframework.http.HttpMethod; |
|
|
|
import org.springframework.http.ResponseEntity; |
|
|
|
import org.springframework.http.*; |
|
|
|
import org.springframework.stereotype.Component; |
|
|
|
import org.springframework.util.MultiValueMap; |
|
|
|
import org.springframework.web.client.RestTemplate; |
|
|
@@ -85,11 +88,29 @@ public class ApplicationManage { |
|
|
|
HttpEntity<MultiValueMap<String, Object>> formEntity = new HttpEntity<MultiValueMap<String, Object>>(headers); |
|
|
|
|
|
|
|
RestTemplate restTemplate = new RestTemplate(); |
|
|
|
ResponseEntity<String> forEntity = restTemplate.exchange(url, HttpMethod.GET,formEntity, String.class); |
|
|
|
ResponseEntity<ApiResponse> forEntity = restTemplate.exchange(appUrl, HttpMethod.GET,formEntity, ApiResponse.class); |
|
|
|
|
|
|
|
log.info("body:",forEntity.getBody()); |
|
|
|
String body = forEntity.getBody(); |
|
|
|
ApiResponse body = forEntity.getBody(); |
|
|
|
|
|
|
|
return null; |
|
|
|
if(!body.getCode().equals(HttpStatus.OK.value())){ |
|
|
|
throw new BizException(body.getMessage()); |
|
|
|
} |
|
|
|
|
|
|
|
Object data = body.getData(); |
|
|
|
if(Objects.nonNull(data)){ |
|
|
|
JSONObject dataJson = JSON.parseObject(JSON.toJSONString(data)); |
|
|
|
JSONArray resourceList = dataJson.getJSONArray("resourceList"); |
|
|
|
if(CollUtil.isNotEmpty(resourceList)){ |
|
|
|
JSONObject resource = JSON.parseObject(JSON.toJSONString(resourceList.get(0))); |
|
|
|
if(StringUtils.isBlank(resource.getString("reportOss"))){ |
|
|
|
//暂时没有 appCode 所以先返回测试数据 |
|
|
|
return "https://irs-yyyw.oss-cn-hangzhou-zwynet-d01-a.internet.cloud.zj.gov.cn/tmp/%E6%B8%A9%E5%B7%9E%E5%B8%82%E4%B9%90%E6%B8%85%E5%B8%82%E5%8C%BA%E5%9F%9F%E4%BD%93%E6%A3%80%E4%BF%A1%E6%81%AF%E7%B3%BB%E7%BB%9F_9cf0b901f2ca4fbf8ff274da359ad219.html?Expires=1687833685&OSSAccessKeyId=wMhEw2BhpIDc1xwO&Signature=UPAbMdDy23FI1sNemszg5WH%2BG40%3D"; |
|
|
|
}else{ |
|
|
|
return resource.getString("reportOss"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
throw new BizException("获取报告失败!"); |
|
|
|
} |
|
|
|
} |