Commit 0815ce98 by 张跃

Merge branch 'featur/20210602-券码接口调整-zy' into qa

parents 30da3701 ece33ad1
......@@ -10,11 +10,13 @@ import com.freemud.application.sdk.api.storecenter.request.vo.GetOrgTreeListRequ
import com.freemud.application.sdk.api.storecenter.response.StoreResponse;
import com.freemud.application.sdk.api.storecenter.response.vo.GetOrgTreeListResponse;
import com.freemud.application.sdk.api.storecenter.service.StoreCenterService;
import com.freemud.application.sdk.api.util.ResponseUtils;
import com.google.common.base.Joiner;
import org.apache.commons.collections4.CollectionUtils;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
/**
......@@ -43,11 +45,23 @@ public interface CommonService {
request.setPartnerId(partnerId);
request.setStoreCode(storeCode);
StoreCenterService storeCenterService = SpringBeanUtil.getBean(StoreCenterService.class);
BaseResponse<List<String>> orgList = storeCenterService.getOrgList(request, LogThreadLocal.getTrackingNo());
if (orgList != null && ResponseCodeConstant.RESPONSE_SUCCESS_STR.equals(orgList.getCode())) {
return orgList.getData();
BaseResponse<GetOrgTreeListResponse> response = storeCenterService.getOrgTreeList(request, LogThreadLocal.getTrackingNo());
// BaseResponse<List<String>> orgList = storeCenterService.getOrgList(request, LogThreadLocal.getTrackingNo());
if (Objects.equals("100", response.getCode()) && response.getData() != null) {
List<GetOrgTreeListResponse.OrgList> orgList = ((GetOrgTreeListResponse)response.getData()).getOrgList();
if (org.springframework.util.CollectionUtils.isEmpty(orgList)) {
return null;
} else {
List<String> orgIds = (List)orgList.stream().map(GetOrgTreeListResponse.OrgList::getOrganizationId).collect(Collectors.toList());
return orgIds;
}
} else {
return null;
}
return null;
// if (orgList != null && ResponseCodeConstant.RESPONSE_SUCCESS_STR.equals(orgList.getCode())) {
// return orgList.getData();
// }
// return null;
}
/**
......
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