| | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.core.base.smo.BaseServiceSMO; |
| | | import com.java110.core.cache.Java110RedisConfig; |
| | | import com.java110.core.context.IPageData; |
| | | import com.java110.core.smo.IGetCommunityStoreInfoSMO; |
| | | import com.java110.entity.component.ComponentValidateResult; |
| | | import com.java110.utils.cache.MappingCache; |
| | | import com.java110.utils.constant.MappingConstant; |
| | | import com.java110.utils.constant.ResponseConstant; |
| | | import com.java110.utils.constant.ServiceCodeConstant; |
| | | import com.java110.utils.constant.ServiceConstant; |
| | |
| | | import com.java110.utils.factory.ApplicationContextFactory; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.utils.util.StringUtil; |
| | | import com.java110.vo.ResultVo; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.cache.annotation.Cacheable; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpMethod; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.http.ResponseEntity; |
| | |
| | | private static Logger logger = LoggerFactory.getLogger(BaseComponentSMO.class); |
| | | |
| | | protected static final int MAX_ROW = 50; |
| | | |
| | | @Autowired(required = false) |
| | | private IGetCommunityStoreInfoSMO getCommunityStoreInfoSMOImpl; |
| | | |
| | | /** |
| | | * 调用组件 |
| | |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 查询商户信息 |
| | | * |
| | | * @return |
| | | */ |
| | | @Cacheable(value = "getStoreInfo" + Java110RedisConfig.GET_STORE_INFO_EXPIRE_TIME_KEY, key = "#userId") |
| | | protected ResponseEntity<String> getStoreInfo(IPageData pd, RestTemplate restTemplate, String userId) { |
| | | Assert.hasLength(pd.getUserId(), "用户未登录请先登录"); |
| | | ResponseEntity<String> responseEntity = null; |
| | | responseEntity = this.callCenterService(restTemplate, pd, "", ServiceConstant.SERVICE_API_URL + "/api/query.store.byuser?userId=" + userId, HttpMethod.GET); |
| | | |
| | | return responseEntity; |
| | | } |
| | | |
| | | /** |
| | | * 查询商户信息 |
| | |
| | | protected ResponseEntity<String> getStoreInfo(IPageData pd, RestTemplate restTemplate) { |
| | | Assert.hasLength(pd.getUserId(), "用户未登录请先登录"); |
| | | |
| | | return getStoreInfo(pd, restTemplate, pd.getUserId()); |
| | | // ResponseEntity<String> responseEntity = null; |
| | | // responseEntity = this.callCenterService(restTemplate, pd, "", ServiceConstant.SERVICE_API_URL + "/api/query.store.byuser?userId=" + pd.getUserId(), HttpMethod.GET); |
| | | // |
| | | // return responseEntity; |
| | | ResultVo resultVo = getCommunityStoreInfoSMOImpl.getStoreInfo(pd, restTemplate, pd.getUserId()); |
| | | |
| | | return new ResponseEntity<String>(resultVo.getMsg(), resultVo.getCode() == ResultVo.CODE_OK ? HttpStatus.OK : HttpStatus.BAD_REQUEST); |
| | | } |
| | | |
| | | @Cacheable(value = "getStoreEnterCommunitys" + Java110RedisConfig.GET_STORE_ENTER_COMMUNITYS_EXPIRE_TIME_KEY, key = "#storeId") |
| | | private ResponseEntity<String> getStoreEnterCommunitys(IPageData pd, String storeId, String storeTypeCd, RestTemplate restTemplate) { |
| | | ResponseEntity<String> responseEntity = null; |
| | | responseEntity = this.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); |
| | | |
| | | return responseEntity; |
| | | ResultVo resultVo = getCommunityStoreInfoSMOImpl.getStoreEnterCommunitys(pd, storeId, storeTypeCd, restTemplate); |
| | | return new ResponseEntity<String>(resultVo.getMsg(), resultVo.getCode() == ResultVo.CODE_OK ? HttpStatus.OK : HttpStatus.BAD_REQUEST); |
| | | } |
| | | |
| | | /** |