diff --git a/src/main/java/com/yn/bftl/thirdparty/modules/secret/service/impl/RandomKeyServiceImpl.java b/src/main/java/com/yn/bftl/thirdparty/modules/secret/service/impl/RandomKeyServiceImpl.java index 0ff0011..155eb51 100644 --- a/src/main/java/com/yn/bftl/thirdparty/modules/secret/service/impl/RandomKeyServiceImpl.java +++ b/src/main/java/com/yn/bftl/thirdparty/modules/secret/service/impl/RandomKeyServiceImpl.java @@ -2,8 +2,9 @@ import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; +import com.yn.bftl.common.common.util.ByxRouteUtil; import com.yn.bftl.common.common.util.RouteUtil; -import com.yn.bftl.thirdparty.modules.chinaums.util.ChinaumsUtil; +import com.yn.bftl.thirdparty.modules.chinaums.util.ByxChinaumsUtil; import com.yn.bftl.thirdparty.modules.secret.service.RandomKeyService; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; @@ -27,7 +28,7 @@ private LocalDateTime markedDate = LocalDateTime.now(); @Resource - private ChinaumsUtil chinaumsUtil; + private ByxChinaumsUtil byxChinaumsUtil; public String getOneKey() { try { @@ -40,12 +41,12 @@ // TODO: send JSONObject params = new JSONObject(); params.put("applyCount", applyCount); - JSONObject result = chinaumsUtil.execute(RouteUtil.ROUTE_WALLET_CUS_APPLICATIONS, params, JSONObject.class); + JSONObject result = byxChinaumsUtil.execute(ByxRouteUtil.ROUTE_GET_RANDOM_KEY, params, JSONObject.class); if (result == null) { log.error("随机因子创建失败,请联系管理员"); throw new RuntimeException("随机因子创建失败,请联系管理员"); } - JSONArray jsonArray = result.getJSONArray("plugRandomKey"); + JSONArray jsonArray = result.getJSONArray("list"); this.addDataToQueue(jsonArray); //更新markedDate @@ -65,7 +66,8 @@ throw new RuntimeException("获取随机因子失败,请联系管理员"); } for (int i = 0; i < jsonArray.size(); i++) { - queue.put(jsonArray.getString(i)); + String randomKey = jsonArray.getJSONObject(i).get("plugRandomKey").toString(); + queue.put(randomKey); } }