diff --git a/mhd_oms/src/main/java/com/mhd/oms/application/service/businessPartner/BusinessPartnerApplicationService.java b/mhd_oms/src/main/java/com/mhd/oms/application/service/businessPartner/BusinessPartnerApplicationService.java index 5a7339591..f5bbd1b82 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/application/service/businessPartner/BusinessPartnerApplicationService.java +++ b/mhd_oms/src/main/java/com/mhd/oms/application/service/businessPartner/BusinessPartnerApplicationService.java @@ -36,7 +36,7 @@ public class BusinessPartnerApplicationService { @Value("${gw.push.url}") private String pushUrl; - @Value("${gw.push.verify-key2}") + @Value("${gw.push.verify-key1}") private String verifyKey; @Resource diff --git a/mhd_oms/src/main/java/com/mhd/oms/application/service/erpCountry/ErpCountryApplicationService.java b/mhd_oms/src/main/java/com/mhd/oms/application/service/erpCountry/ErpCountryApplicationService.java index 6ad9e23e9..378c091b9 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/application/service/erpCountry/ErpCountryApplicationService.java +++ b/mhd_oms/src/main/java/com/mhd/oms/application/service/erpCountry/ErpCountryApplicationService.java @@ -22,6 +22,7 @@ import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClients; import org.apache.http.util.EntityUtils; import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import javax.annotation.Resource; @@ -31,9 +32,13 @@ import java.util.*; @Service @Slf4j public class ErpCountryApplicationService{ - private static final String PUSH_API_URL = "http://10.33.0.100/nagu-erp-api/transfer/pushData"; private static final String API_NAME = "saveCountry"; - private static final String VERIFY = "ESLuxAmB6VXCgbqP1eFzxTPVRagkQ62BUkfhElrgQ6XmE/g2reHVflY/SiCSU7JD"; + + @Value("${gw.push.url}") + private String pushUrl; + + @Value("${gw.push.verify-key1}") + private String verifyKey; @Resource private ErpCountryMapper erpCountryMapper; @@ -162,12 +167,12 @@ public class ErpCountryApplicationService{ updatePushStatus(dto.getId(), 2, new Date(), pushBy,pushByName); CloseableHttpClient httpClient = HttpClients.createDefault(); - HttpPost httpPost = new HttpPost(PUSH_API_URL); + HttpPost httpPost = new HttpPost(pushUrl); StringEntity postingString = new StringEntity(JSONObject.toJSONString(bodyList), "UTF-8"); httpPost.setEntity(postingString); httpPost.setHeader("Content-type", "application/json"); httpPost.setHeader("apiName", API_NAME); - httpPost.setHeader("verify", VERIFY); + httpPost.setHeader("verify", verifyKey); try { CloseableHttpResponse response = httpClient.execute(httpPost); diff --git a/mhd_oms/src/main/java/com/mhd/oms/application/service/erpEnterpriseUnit/ErpEnterpriseUnitApplicationService.java b/mhd_oms/src/main/java/com/mhd/oms/application/service/erpEnterpriseUnit/ErpEnterpriseUnitApplicationService.java index ea35644d4..53cee8665 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/application/service/erpEnterpriseUnit/ErpEnterpriseUnitApplicationService.java +++ b/mhd_oms/src/main/java/com/mhd/oms/application/service/erpEnterpriseUnit/ErpEnterpriseUnitApplicationService.java @@ -23,6 +23,7 @@ import org.apache.http.entity.StringEntity; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClients; import org.apache.http.util.EntityUtils; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import javax.annotation.Resource; @@ -33,9 +34,13 @@ import java.util.*; @Slf4j public class ErpEnterpriseUnitApplicationService { - private static final String PUSH_API_URL = "http://10.33.0.100/nagu-erp-api/transfer/pushData"; private static final String API_NAME = "saveUnit"; - private static final String VERIFY = "ESLuxAmB6VXCgbqP1eFzxTPVRagkQ62BUkfhElrgQ6XmE/g2reHVflY/SiCSU7JD"; + + @Value("${gw.push.url}") + private String pushUrl; + + @Value("${gw.push.verify-key1}") + private String verifyKey; @Resource private ErpEnterpriseUnitMapper erpEnterpriseUnitMapper; @@ -146,12 +151,12 @@ public class ErpEnterpriseUnitApplicationService { updatePushStatus(dto.getId(), 2, new Date(), pushBy,pushByName); CloseableHttpClient httpClient = HttpClients.createDefault(); - HttpPost httpPost = new HttpPost(PUSH_API_URL); + HttpPost httpPost = new HttpPost(pushUrl); StringEntity postingString = new StringEntity(JSONObject.toJSONString(bodyList), "UTF-8"); httpPost.setEntity(postingString); httpPost.setHeader("Content-type", "application/json"); httpPost.setHeader("apiName", API_NAME); - httpPost.setHeader("verify", VERIFY); + httpPost.setHeader("verify", verifyKey); try { CloseableHttpResponse response = httpClient.execute(httpPost); diff --git a/mhd_oms/src/main/java/com/mhd/oms/application/service/exchangeRate/ExchangeRateApplicationService.java b/mhd_oms/src/main/java/com/mhd/oms/application/service/exchangeRate/ExchangeRateApplicationService.java index b194654b1..2c6fbf7b7 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/application/service/exchangeRate/ExchangeRateApplicationService.java +++ b/mhd_oms/src/main/java/com/mhd/oms/application/service/exchangeRate/ExchangeRateApplicationService.java @@ -18,6 +18,7 @@ import org.apache.http.entity.StringEntity; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClients; import org.apache.http.util.EntityUtils; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import javax.annotation.Resource; @@ -29,9 +30,13 @@ import java.util.*; @Slf4j public class ExchangeRateApplicationService { - private static final String PUSH_API_URL = "http://10.33.0.100/nagu-erp-api/transfer/pushData"; private static final String API_NAME = "saveCurr"; - private static final String VERIFY = "ESLuxAmB6VXCgbqP1eFzxTPVRagkQ62BUkfhElrgQ6XmE/g2reHVflY/SiCSU7JD"; + + @Value("${gw.push.url}") + private String pushUrl; + + @Value("${gw.push.verify-key1}") + private String verifyKey; @Resource private WlhyServiceFeign wlhyServiceFeign; @@ -123,12 +128,12 @@ public class ExchangeRateApplicationService { updateExchangeRatePushStatus(dto.getId(), 2, new Date(), pushBy, pushByName); CloseableHttpClient httpClient = HttpClients.createDefault(); - HttpPost httpPost = new HttpPost(PUSH_API_URL); + HttpPost httpPost = new HttpPost(pushUrl); StringEntity postingString = new StringEntity(JSONObject.toJSONString(bodyList), "UTF-8"); httpPost.setEntity(postingString); httpPost.setHeader("Content-type", "application/json"); httpPost.setHeader("apiName", API_NAME); - httpPost.setHeader("verify", VERIFY); + httpPost.setHeader("verify", verifyKey); try { CloseableHttpResponse response = httpClient.execute(httpPost); diff --git a/mhd_oms/src/main/java/com/mhd/oms/application/service/materialInfo/MaterialInfoApplicationService.java b/mhd_oms/src/main/java/com/mhd/oms/application/service/materialInfo/MaterialInfoApplicationService.java index 9e93f8610..698366631 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/application/service/materialInfo/MaterialInfoApplicationService.java +++ b/mhd_oms/src/main/java/com/mhd/oms/application/service/materialInfo/MaterialInfoApplicationService.java @@ -19,6 +19,7 @@ import org.apache.http.entity.StringEntity; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClients; import org.apache.http.util.EntityUtils; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import javax.annotation.Resource; @@ -29,9 +30,13 @@ import java.util.*; @Slf4j public class MaterialInfoApplicationService { - private static final String PUSH_API_URL = "http://10.33.0.100/nagu-erp-api/transfer/pushData"; private static final String API_NAME = "saveOrgGoods"; - private static final String VERIFY = "ESLuxAmB6VXCgbqP1eFzxTPVRagkQ62BUkfhElrgQ6XmE/g2reHVflY/SiCSU7JD"; + + @Value("${gw.push.url}") + private String pushUrl; + + @Value("${gw.push.verify-key1}") + private String verifyKey; @Resource private GwLogMapper gwLogMapper; @@ -113,12 +118,12 @@ public class MaterialInfoApplicationService { updatePushStatus(dto.getMaterialBaseInfoId(), 2, new Date(), pushBy,pushByName); CloseableHttpClient httpClient = HttpClients.createDefault(); - HttpPost httpPost = new HttpPost(PUSH_API_URL); + HttpPost httpPost = new HttpPost(pushUrl); StringEntity postingString = new StringEntity(JSONObject.toJSONString(bodyList), "UTF-8"); httpPost.setEntity(postingString); httpPost.setHeader("Content-type", "application/json"); httpPost.setHeader("apiName", API_NAME); - httpPost.setHeader("verify", VERIFY); + httpPost.setHeader("verify", verifyKey); try { CloseableHttpResponse response = httpClient.execute(httpPost);