From 055b75bc30aaceb1c73bcb823e8c5ef682891fde Mon Sep 17 00:00:00 2001 From: jiangping <jp@doumee.com> Date: 星期一, 15 七月 2024 17:14:14 +0800 Subject: [PATCH] 提交 --- server/service/src/main/java/com/doumee/biz/zbom/impl/ZbomZhongTaiServiceImpl.java | 75 ++++++++++++++++++++++++++++--------- 1 files changed, 57 insertions(+), 18 deletions(-) diff --git a/server/service/src/main/java/com/doumee/biz/zbom/impl/ZbomZhongTaiServiceImpl.java b/server/service/src/main/java/com/doumee/biz/zbom/impl/ZbomZhongTaiServiceImpl.java index 12f9fc8..d1b6eaa 100644 --- a/server/service/src/main/java/com/doumee/biz/zbom/impl/ZbomZhongTaiServiceImpl.java +++ b/server/service/src/main/java/com/doumee/biz/zbom/impl/ZbomZhongTaiServiceImpl.java @@ -16,6 +16,7 @@ import com.doumee.dao.business.MemberMapper; import com.doumee.dao.business.model.CrmInterfaceLog; import com.doumee.dao.business.model.InterfaceLog; +import com.doumee.dao.web.response.ZSZXCatalogResponse; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -52,11 +53,37 @@ ZTConstants.IntegerName.USER_GET_TOKEN_NAME, param.getToken(), param.getUserType(), - JSONObject.toJSONString(param )); + JSONObject.toJSONString(param ), + new TypeReference<ZTBaseResponse<ZTUserGetTokenResponse>>(){}); if(result!=null){ return result.getData(); } return null; + } + /** + * 鑾峰彇鐢ㄦ埛鐧婚檰token + * @return + */ + @Override + public ZSZXCatalogResponse getZSZXCatalogs(){ + ZSZXCatalogResponse response = new ZSZXCatalogResponse(); + ZTCatalogListRequest param = new ZTCatalogListRequest(); + param.setCatalogCode(ZTConstants.CatalogCode.ZHISHUO_ZHUANGXIU); + List<ZTCatalogInfoResponse> cataList = getCatalogList(param); + if(cataList!=null ){ + for(ZTCatalogInfoResponse data : cataList){ + if(StringUtils.equals(data.getCode(), ZTConstants.CatalogCode.JIADE_ID)){ + response.setJdId(data); + }else if(StringUtils.equals(data.getCode(), ZTConstants.CatalogCode.CHUFANGSHEJI)){ + response.setCfsj(data); + }else if(StringUtils.equals(data.getCode(), ZTConstants.CatalogCode.QW_SHEJI)){ + response.setQwsj(data); + }else if(StringUtils.equals(data.getCode(), ZTConstants.CatalogCode.SHOUNASHEJI)){ + response.setSnsj(data); + } + } + } + return response; } /** * 鐢ㄦ埛淇℃伅鍚屾 @@ -70,7 +97,8 @@ ZTConstants.IntegerName.USER_UPDATE_NAME, param.getToken(), param.getUserType(), - JSONObject.toJSONString(param )); + JSONObject.toJSONString(param ), + new TypeReference<ZTBaseResponse<ZTUserGetTokenResponse>>(){}); if(result!=null){ return result.getData(); } @@ -88,7 +116,8 @@ ZTConstants.IntegerName.USER_LOGOUT_NAME, param.getToken(), param.getUserType(), - JSONObject.toJSONString(param )); + JSONObject.toJSONString(param ), + new TypeReference<ZTBaseResponse<Object>>(){}); if(result!=null ){ return true; } @@ -102,12 +131,14 @@ */ @Override public List<ZTCatalogInfoResponse> getCatalogList(ZTCatalogListRequest param){ - ZTBaseResponse<List<ZTCatalogInfoResponse>> result = sendHttpRequest( + + ZTBaseResponse<List<ZTCatalogInfoResponse>> result = sendHttpRequest( ZTConstants.IntegerUrl.CATALOG_LIST_URL, ZTConstants.IntegerName.CATALOG_LIST_NAME, param.getToken(), param.getUserType(), - JSONObject.toJSONString(param )); + JSONObject.toJSONString(param ), + new TypeReference<ZTBaseResponse<List<ZTCatalogInfoResponse>>>(){}); if(result!=null){ return result.getData(); } @@ -125,7 +156,8 @@ ZTConstants.IntegerName.TAG_LIST_NAME, param.getToken(), param.getUserType(), - JSONObject.toJSONString(param )); + JSONObject.toJSONString(param ), + new TypeReference<ZTBaseResponse<List<ZTTagInfoResponse>>>(){}); if(result!=null){ return result.getData(); } @@ -144,7 +176,8 @@ ZTConstants.IntegerName.CONTENT_LIST_NAME, param.getToken(), param.getUserType(), - JSONObject.toJSONString(param )); + JSONObject.toJSONString(param ), + new TypeReference<ZTBaseResponse<ZTBasePageResponse<ZTContentListResponse>>>(){}); if(result!=null){ return result.getData(); } @@ -162,7 +195,8 @@ ZTConstants.IntegerName.CONTENT_INFO_NAME, param.getToken(), param.getUserType(), - JSONObject.toJSONString(param )); + JSONObject.toJSONString(param ), + new TypeReference<ZTBaseResponse<ZTContentInfoResponse>>(){}); if(result!=null){ return result.getData(); } @@ -180,7 +214,8 @@ ZTConstants.IntegerName.COLLECT_DO_NAME, param.getToken(), param.getUserType(), - JSONObject.toJSONString(param )); + JSONObject.toJSONString(param ), + new TypeReference<ZTBaseResponse<Object>>(){}); if(result!=null ){ return true; } @@ -198,7 +233,8 @@ ZTConstants.IntegerName.LIKE_DO_NAME, param.getToken(), param.getUserType(), - JSONObject.toJSONString(param )); + JSONObject.toJSONString(param ), + new TypeReference<ZTBaseResponse<Object>>(){}); if(result!=null ){ return true; } @@ -216,7 +252,8 @@ ZTConstants.IntegerName.SHARE_DO_NAME, param.getToken(), param.getUserType(), - JSONObject.toJSONString(param )); + JSONObject.toJSONString(param ), + new TypeReference<ZTBaseResponse<Object>>(){}); if(result!=null ){ return true; } @@ -234,7 +271,8 @@ ZTConstants.IntegerName.VIEW_DO_NAME, param.getToken(), param.getUserType(), - JSONObject.toJSONString(param )); + JSONObject.toJSONString(param ), + new TypeReference<ZTBaseResponse<Object>>(){}); if(result!=null ){ return true; } @@ -252,7 +290,8 @@ ZTConstants.IntegerName.COLLECT_LIST_NAME, param.getToken(), param.getUserType(), - JSONObject.toJSONString(param )); + JSONObject.toJSONString(param ), + new TypeReference<ZTBaseResponse<ZTBasePageResponse<ZTContentListResponse>>>(){}); if(result!=null){ return result.getData(); } @@ -271,7 +310,8 @@ ZTConstants.IntegerName.LIKE_LIST_NAME, param.getToken(), param.getUserType(), - JSONObject.toJSONString(param )); + JSONObject.toJSONString(param ), + new TypeReference<ZTBaseResponse<ZTBasePageResponse<ZTContentListResponse>>>(){}); if(result!=null){ return result.getData(); } @@ -293,7 +333,8 @@ ZTConstants.IntegerName.AREA_LIST_NAME, param.getToken(), param.getUserType(), - JSONObject.toJSONString(param )); + JSONObject.toJSONString(param ), + new TypeReference<ZTBaseResponse<List<ZTAreaInfoResponse>>>(){}); if(result!=null){ return result.getData(); } @@ -301,7 +342,7 @@ } - public <T> ZTBaseResponse<T> sendHttpRequest(String url,String name,String token,String userType,String param){ + public <T> ZTBaseResponse<T> sendHttpRequest(String url,String name,String token,String userType,String param,TypeReference<ZTBaseResponse<T>> typeReference){ log.info("銆�"+name+"銆�================寮�濮�===="+ JSONObject.toJSONString(param)); String res = null; int success = 0; @@ -312,8 +353,6 @@ headers.put(ZTConstants.HEADER_USERTYPE,userType); String index = (String) redisTemplate.opsForValue().get(Constants.RedisKeys.ZBOM_ZHONGTAI_API_URL); res = HttpsUtil.postJsonWithHeaders(index+url,param,headers); - TypeReference typeReference = - new TypeReference<ZTBaseResponse<T>>(){}; ZTBaseResponse<T> result = JSONObject.parseObject(res, typeReference.getType()); logResult(result,name); if(Constants.equalsInteger(result.getCode(),ZTConstants.CODE_SUCCESS)){ -- Gitblit v1.9.3