密码动态配置配合不同环境联调

This commit is contained in:
psh
2024-01-23 14:18:54 +08:00
parent 68c70d93a6
commit f2d9342aed
2 changed files with 11 additions and 5 deletions

View File

@@ -33,6 +33,9 @@ public interface AcsConfig {
//WCS系统接口地址
String WCSURL = "liKu_wcs_url";
//密码
String PASSWORD = "password";
String HASOTHERSYSTEM = "hasOtherSystem";
String ERPURL = "erpurl";

View File

@@ -103,6 +103,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
log.info("开始反馈wms任务状态,请求参数:{}", JSON.toJSONString(data));
this.getTokenFromWms();
String wmsurl = paramService.findByCode(AcsConfig.WMSURL).getValue();
String password=paramService.findByCode(AcsConfig.PASSWORD).getValue();
HttpResponse result = null;
AddressDto addressDto = addressService.findByCode("feedbackTaskStatusToWms");
String methods_url = addressDto.getMethods_url();
@@ -113,7 +114,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
result = HttpRequest
.post(url)
.header("Content-Type", "application/json;charset=UTF-8")
.basicAuth("INFOR","Aa123456@@!!")
.basicAuth("INFOR",password)
.body(JSON.toJSONString(data))
.timeout(3000)
.execute();
@@ -535,6 +536,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
MDC.put(log_file_type, log_type);
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) {
String wmsUrl = paramService.findByCode(AcsConfig.WMSURL).getValue();
String password=paramService.findByCode(AcsConfig.PASSWORD).getValue();
AddressDto addressDto = addressService.findByCode("shipDeviceUpdate");
String methods_url = addressDto.getMethods_url();
String url = wmsUrl + methods_url;
@@ -543,7 +545,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
ja.add(param);
HttpResponse result=HttpRequest.post(url)
.body(ja.toString())
.basicAuth("INFOR","Aa123456@@!!")
.basicAuth("INFOR",password)
.execute();
log.info("shipDeviceUpdate - 返回参数 {}", result.body());
return JSONObject.parseObject(result.body());
@@ -563,6 +565,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) {
String wmsUrl = paramService.findByCode(AcsConfig.WMSURL).getValue();
String password=paramService.findByCode(AcsConfig.PASSWORD).getValue();
AddressDto addressDto = addressService.findByCode("feedAgvTaskStatus");
String methodsUrl = addressDto.getMethods_url();
String url = wmsUrl + methodsUrl;
@@ -570,7 +573,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
HttpResponse response = HttpRequest
.post(url)
.body(from.toString())
.basicAuth("INFOR","Aa123456@@!!")
.basicAuth("INFOR",password)
.execute();
log.info("feedAgvTaskStatus - 返回参数 {}", response.body());
return JSONObject.parseObject(response.body());
@@ -626,7 +629,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
@Override
public HttpResponse feedbackAgvDeviceStatus(String device_code, String hasGoods) {
String wmsUrl = paramService.findByCode(AcsConfig.WMSURL).getValue();
String password=paramService.findByCode(AcsConfig.PASSWORD).getValue();
JSONObject json = new JSONObject();
json.put("device_code", device_code);
json.put("is_have", hasGoods);
@@ -640,7 +643,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
try {
result = HttpRequest.post(url)
.body(String.valueOf(json))
.basicAuth("INFOR","Aa123456@@!!")
.basicAuth("INFOR",password)
.execute();
System.out.println(result);
log.info("feedbackAgvDeviceStatus----返回参数{}", result);