diff --git a/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/constant/CaWghDataConstant.java b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/constant/CaWghDataConstant.java index 42862e1b37..624c9ac5b4 100644 --- a/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/constant/CaWghDataConstant.java +++ b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/constant/CaWghDataConstant.java @@ -21,4 +21,6 @@ public interface CaWghDataConstant { String UNICOM_RENTAL = "ca_rental"; String DATA_URL_UNICON = "http://120.221.72.83:9090/bridge/unicom/page"; + + String UNICOM_CONDITION = "unicomCondition"; } diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/CaLoudongServiceImpl.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/CaLoudongServiceImpl.java index d0ef055332..bd2f41b004 100644 --- a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/CaLoudongServiceImpl.java +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/CaLoudongServiceImpl.java @@ -12,6 +12,7 @@ import com.epmet.commons.tools.utils.HttpClientManager; import com.epmet.commons.tools.utils.Result; import com.epmet.opendata.dao.CaLoudongDao; import com.epmet.opendata.dto.ca.CaLoudongDTO; +import com.epmet.opendata.dto.constant.CaWghDataConstant; import com.epmet.opendata.dto.form.CaLoudongDetailsFormDTO; import com.epmet.opendata.dto.form.CaLoudongFormDTO; import com.epmet.opendata.dto.form.PreserVationFormDTO; @@ -137,8 +138,8 @@ public class CaLoudongServiceImpl extends BaseServiceImpl (pageNo * NumConstant.FIFTY)); } - enum loudongEnum { - - LD("unicom", "ca_loudong"), - AES("key", "hriajrutnbghajsd") - ; - - private String name; - private String code; - - - loudongEnum(String name, String code) { - this.name = name; - this.code = code; - } - - } private int listLouDong(PreserVationFormDTO dto) throws Exception { - String aes = AesUtils.encryptByAES(JSONObject.toJSONString(dto), loudongEnum.AES.code); + String aes = AesUtils.encryptByAES(JSONObject.toJSONString(dto), CaWghDataConstant.AESKEY); JSONObject obj = new JSONObject(); - obj.put("unicomCondition", aes); - String data = HttpClientManager.getInstance().sendPostByJSON("http://120.221.72.83:9090/bridge/unicom/page", obj.toJSONString()).getData(); + obj.put(CaWghDataConstant.UNICOM_CONDITION, aes); + String data = HttpClientManager.getInstance().sendPostByJSON(CaWghDataConstant.DATA_URL_UNICON, obj.toJSONString()).getData(); JSONObject toResult = JSON.parseObject(data); Result result = ConvertUtils.mapToEntity(toResult, Result.class); if (!result.success()) { diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/CaPingfangServiceImpl.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/CaPingfangServiceImpl.java index a807cd973e..541726c478 100644 --- a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/CaPingfangServiceImpl.java +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/CaPingfangServiceImpl.java @@ -13,6 +13,7 @@ import com.epmet.commons.tools.utils.HttpClientManager; import com.epmet.commons.tools.utils.Result; import com.epmet.opendata.dao.CaPingfangDao; import com.epmet.opendata.dto.ca.CaPingfangDTO; +import com.epmet.opendata.dto.constant.CaWghDataConstant; import com.epmet.opendata.dto.form.CaPingFangDetailsFormDTO; import com.epmet.opendata.dto.form.CaPingfangFormDTO; import com.epmet.opendata.dto.form.PreserVationFormDTO; @@ -117,8 +118,8 @@ public class CaPingfangServiceImpl extends BaseServiceImpl