| | |
| | | import com.java110.core.context.IPageData; |
| | | import com.java110.core.factory.CallApiServiceFactory; |
| | | import com.java110.core.smo.IGetCommunityStoreInfoSMO; |
| | | import com.java110.utils.cache.CommonCache; |
| | | import com.java110.utils.cache.MappingCache; |
| | | import com.java110.utils.constant.MappingConstant; |
| | | import com.java110.utils.constant.ServiceConstant; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.utils.util.StringUtil; |
| | | import com.java110.vo.ResultVo; |
| | | import org.springframework.cache.annotation.Cacheable; |
| | | import org.springframework.http.HttpMethod; |
| | |
| | | Assert.hasLength(pd.getUserId(), "用户未登录请先登录"); |
| | | ResponseEntity<String> responseEntity = null; |
| | | responseEntity = CallApiServiceFactory.callCenterService(restTemplate, pd, "", ServiceConstant.SERVICE_API_URL + "/api/query.store.byuser?userId=" + userId, HttpMethod.GET); |
| | | |
| | | if (responseEntity.getStatusCode() != HttpStatus.OK) { |
| | | throw new IllegalArgumentException(responseEntity.getBody()); |
| | | } |
| | | return new ResultVo(responseEntity.getStatusCode() == HttpStatus.OK ? ResultVo.CODE_OK : ResultVo.CODE_ERROR, responseEntity.getBody()); |
| | | } |
| | | |
| | |
| | | @Cacheable(value = "getStoreEnterCommunitys" + Java110RedisConfig.GET_STORE_ENTER_COMMUNITYS_EXPIRE_TIME_KEY, key = "#storeId") |
| | | public ResultVo getStoreEnterCommunitys(IPageData pd, String storeId, String storeTypeCd, RestTemplate restTemplate) { |
| | | ResponseEntity<String> responseEntity = null; |
| | | // responseEntity = CallApiServiceFactory.callCenterService(restTemplate, pd, "", |
| | | // ServiceConstant.SERVICE_API_URL + "/api/query.myCommunity.byMember?memberId=" + storeId + "&memberTypeCd=" |
| | | // + MappingCache.getValue(MappingConstant.DOMAIN_STORE_TYPE_2_COMMUNITY_MEMBER_TYPE, storeTypeCd), HttpMethod.GET); |
| | | |
| | | responseEntity = CallApiServiceFactory.callCenterService(restTemplate, pd, "", |
| | | ServiceConstant.SERVICE_API_URL + "/api/query.myCommunity.byMember?memberId=" + storeId + "&memberTypeCd=" |
| | | ServiceConstant.SERVICE_API_URL + "/api/communitys/queryStoreCommunitys?memberId=" + storeId + "&memberTypeCd=" |
| | | + MappingCache.getValue(MappingConstant.DOMAIN_STORE_TYPE_2_COMMUNITY_MEMBER_TYPE, storeTypeCd), HttpMethod.GET); |
| | | |
| | | if (responseEntity.getStatusCode() != HttpStatus.OK) { |
| | | throw new IllegalArgumentException(responseEntity.getBody()); |
| | | } |
| | | return new ResultVo(responseEntity.getStatusCode() == HttpStatus.OK ? ResultVo.CODE_OK : ResultVo.CODE_ERROR, responseEntity.getBody()); |
| | | } |
| | | |
| | |
| | | |
| | | ResponseEntity<String> privilegeGroup = CallApiServiceFactory.callCenterService(restTemplate, pd, "", |
| | | ServiceConstant.SERVICE_API_URL + "/api/query.user.privilege?userId=" + staffId + "&domain=" + storeTypeCd, HttpMethod.GET); |
| | | |
| | | if (privilegeGroup.getStatusCode() != HttpStatus.OK) { |
| | | throw new IllegalArgumentException(privilegeGroup.getBody()); |
| | | } |
| | | return new ResultVo(privilegeGroup.getStatusCode() == HttpStatus.OK ? ResultVo.CODE_OK : ResultVo.CODE_ERROR, privilegeGroup.getBody()); |
| | | |
| | | } |
| | |
| | | HttpMethod.POST); |
| | | |
| | | if (responseEntity.getStatusCode() != HttpStatus.OK) { |
| | | return null; |
| | | throw new IllegalArgumentException(responseEntity.getBody()); |
| | | } |
| | | |
| | | JSONObject data = JSONObject.parseObject(responseEntity.getBody()); |