技术监督国网上送,网址映射修改

This commit is contained in:
wr
2023-08-29 11:14:56 +08:00
parent 2f7c830227
commit d34425f94a

View File

@@ -33,6 +33,7 @@ import com.njcn.web.utils.RestTemplateUtil;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.compress.utils.IOUtils; import org.apache.commons.compress.utils.IOUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.io.FileSystemResource; import org.springframework.core.io.FileSystemResource;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@@ -76,6 +77,10 @@ public class SupvPushGwServiceImpl implements SupvPushGwService {
private final UserFeignClient userFeignClient; private final UserFeignClient userFeignClient;
@Value("${gw.url}")
private String gwUrl;
@Override @Override
public String pushPlan(List<String> planIds) { public String pushPlan(List<String> planIds) {
LambdaQueryWrapper<SupvPlan> lambdaQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<SupvPlan> lambdaQueryWrapper = new LambdaQueryWrapper<>();
@@ -445,7 +450,7 @@ public class SupvPushGwServiceImpl implements SupvPushGwService {
} }
} }
public static Map<String, String> send(SendParam param, String url, String serviceName) { public Map<String, String> send(SendParam param, String url, String serviceName) {
Map<String, String> map = new LinkedHashMap<>(); Map<String, String> map = new LinkedHashMap<>();
ContentBody cb; ContentBody cb;
if (ObjectUtil.isNull(param)) { if (ObjectUtil.isNull(param)) {
@@ -484,12 +489,12 @@ public class SupvPushGwServiceImpl implements SupvPushGwService {
return map; return map;
} }
public static String LoginToken() { public String LoginToken() {
String token = null; String token = null;
String clientId = "942a9278671711eda2e10ae0b5517f6c"; String clientId = "942a9278671711eda2e10ae0b5517f6c";
String clientSecret = "3Psd2VEhsA3dVsSPHW0ll5r/03kAqlA2P4w2IiWPA8UWSadcX0we2wffjyTUYGsK"; String clientSecret = "3Psd2VEhsA3dVsSPHW0ll5r/03kAqlA2P4w2IiWPA8UWSadcX0we2wffjyTUYGsK";
String userUrl = "http://25.36.214.86:32234/psr-auth/oauth/accessToken?grant_type={grant_type}&client_id={client_id}&client_secret={client_secret}"; String userUrl = "http://"+gwUrl+"/psr-auth/oauth/accessToken?grant_type={grant_type}&client_id={client_id}&client_secret={client_secret}";
Map<String, String> map = new HashMap<>(); Map<String, String> map = new HashMap<>();
map.put("grant_type", "credentials"); map.put("grant_type", "credentials");
map.put("client_id", clientId); map.put("client_id", clientId);
@@ -533,7 +538,7 @@ public class SupvPushGwServiceImpl implements SupvPushGwService {
//如果需要传递请求参数 可以拼接到请求URL中或者设置paramsMap参数由SDK内部进行拼接 //如果需要传递请求参数 可以拼接到请求URL中或者设置paramsMap参数由SDK内部进行拼接
HttpParameters.Builder builder = HttpParameters.newBuilder(); HttpParameters.Builder builder = HttpParameters.newBuilder();
builder.requestURL("http://25.36.214.86:32234/CSB/WMCenter/powerQuality/file/create") // 设置请求的URL,可以拼接URL请求参数 builder.requestURL(url) // 设置请求的URL,可以拼接URL请求参数
.api("zongbuSync") // 设置服务名 .api("zongbuSync") // 设置服务名
.version("1.0.0") // 设置版本号 .version("1.0.0") // 设置版本号
.method("post") // 设置调用方式, 必须为 post .method("post") // 设置调用方式, 必须为 post
@@ -638,8 +643,8 @@ public class SupvPushGwServiceImpl implements SupvPushGwService {
* @param type * @param type
* @return * @return
*/ */
public static String getUrl(Integer type) { public String getUrl(Integer type) {
String url = "http://25.36.214.86:32234/CSB"; String url = "http://"+gwUrl+"/CSB";
switch (type) { switch (type) {
case 1: case 1: