Commit f2839e37 by zhiwj

Merge branch 'developer' of…

Merge branch 'developer' of http://115.159.76.241/base_platform_enterprise/gic-data-cloud into developer
parents a318b800 75534d3e
......@@ -60,7 +60,7 @@ public class StoreSearchUtils {
ServiceResponse<DataAuthDTO> response = this.dataAuthApiService.ggetDataAuthByUserId(enterpriseId, userId);
DataAuthDTO dataAuthDTO = response.getResult() == null ? new DataAuthDTO() : response.getResult();
if(StringUtils.isBlank(searchJson)){
return dataAuthDTO.getNoOwnerStore();
return 0;
}
JSONObject json = JSON.parseObject(searchJson);
StoreSearchQo storeSearchQo = json.getObject(StoreChannelEnum.OFFLINE.getChannel().toString(), StoreSearchQo.class);
......@@ -72,8 +72,10 @@ public class StoreSearchUtils {
}
public List<Integer> storeSearch(Integer userId, Integer enterpriseId, String searchJson){
log.info("storeSearchParams:{},{},{}", userId, enterpriseId, searchJson);
String key = "1:" + enterpriseId + ":" + userId +":" + (StringUtils.isNotBlank(searchJson) ? searchJson.hashCode() : "searchJSON".hashCode());
StoreAuth storeAuth = this.dataAuthUtils.getStoreAuth(userId, enterpriseId);
log.info("storeAuth:{}", JSON.toJSONString(storeAuth));
if(!storeAuth.isHasAuth()){
ArrayList<Integer> list = new ArrayList<>();
list.add(0);
......@@ -110,13 +112,14 @@ public class StoreSearchUtils {
}
}
ServiceResponse<Page<StoreDTO>> pageServiceResponse = this.storeApiService.listStore(storeSearchDTO, 1, 20000);
if(pageServiceResponse.isSuccess() && pageServiceResponse.getResult() != null){
log.info("storeResule:{}", JSON.toJSONString(pageServiceResponse));
if(pageServiceResponse.isSuccess() && pageServiceResponse.getResult() != null && CollectionUtils.isNotEmpty(pageServiceResponse.getResult().getResult())){
List<StoreDTO> storeDTOList = pageServiceResponse.getResult().getResult();
List<Integer> storeInfoIdList = storeDTOList.stream().map(storeDTO -> storeDTO.getStoreInfoId()).collect(Collectors.toList());
if(CollectionUtils.isNotEmpty(storeAuth.getStoreInfoIdList())){
resultList = storeInfoIdList.stream().filter(s -> {
for (Integer storeInfoId : storeAuth.getStoreInfoIdList()) {
if (s.intValue() == storeInfoId.intValue()) {
if (s != null && s.intValue() == storeInfoId.intValue()) {
return true;
}
}
......@@ -138,6 +141,7 @@ public class StoreSearchUtils {
public List<String> onLineStoreSearch(Integer userId, Integer enterpriseId, String searchJson){
OnLineAuth onlineStoreAuth = this.dataAuthUtils.getOnlineStore(userId, enterpriseId);
log.info("onlineStoreAuth:{}", JSON.toJSONString(onlineStoreAuth));
List<String> list = new ArrayList<>();
if(onlineStoreAuth.isHasAuth()){
this.getOnlineStoreIds(searchJson, onlineStoreAuth, list, StoreChannelEnum.GICMALL.getChannel(), userId, enterpriseId);
......@@ -255,8 +259,9 @@ public class StoreSearchUtils {
}
}
} else {
if(CollectionUtils.isNotEmpty(onlineStoreAuth.getList())){
onlineStoreAuth.getList().stream().forEach(s -> {
if(s.getChannel().intValue() == channel.intValue()){
if(s.getChannel() != null && s.getChannel().intValue() == channel.intValue()){
if(CollectionUtils.isNotEmpty(s.getStoreIdList())){
RedisUtil.setCache(key, 1, 10l, TimeUnit.MINUTES);
list.addAll(s.getStoreIdList());
......@@ -265,5 +270,6 @@ public class StoreSearchUtils {
});
}
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment