Commit c2e248b5 by zhangxingmin

push

parent 93af2bd9
......@@ -16,6 +16,7 @@ import com.yd.common.result.Result;
import com.yd.common.utils.RandomStringGenerator;
import com.yd.product.api.service.*;
import com.yd.product.feign.dto.ApiProductLaunchDto;
import com.yd.product.feign.dto.ApiProjectDto;
import com.yd.product.feign.dto.ApiSpeciesPriceDto;
import com.yd.product.feign.dto.ApiSpeciesTypeDto;
import com.yd.product.feign.enums.ProductCommonEnum;
......@@ -29,8 +30,11 @@ import com.yd.product.feign.response.productlaunch.ApiProductLaunchPageResponse;
import com.yd.product.service.model.*;
import com.yd.product.service.service.*;
import com.yd.user.feign.client.reltenantproject.ApiRelTenantProjectFeignClient;
import com.yd.user.feign.client.sysproject.ApiSysProjectFeignClient;
import com.yd.user.feign.request.reltenantproject.QueryRelTenantProjectListRequest;
import com.yd.user.feign.request.sysproject.ApiSysProjectListRequest;
import com.yd.user.feign.response.reltenantproject.QueryRelTenantProjectListResponse;
import com.yd.user.feign.response.sysproject.ApiSysProjectDetailResponse;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
......@@ -77,6 +81,9 @@ public class ApiProductLaunchServiceImpl implements ApiProductLaunchService {
@Autowired
private ApiFieldFeignClient apiFieldFeignClient;
@Autowired
private ApiSysProjectFeignClient apiSysProjectFeignClient;
@Override
public Result<IPage<ApiProductLaunchPageResponse>> page(ApiProductLaunchPageRequest request) {
Page<ApiProductLaunchPageResponse> page = new Page<ApiProductLaunchPageResponse>(request.getPageNo(), request.getPageSize());
......@@ -170,6 +177,8 @@ public class ApiProductLaunchServiceImpl implements ApiProductLaunchService {
List<String> categoryBizIdList = listResult.getData().stream().map(ApiRelObjectCategoryQueryResponse::getCategoryBizId).collect(Collectors.toList());
apiProductLaunchDto.setCategoryBizIdList(categoryBizIdList);
}
apiProductLaunchDto.setApiProjectDtoList(apiProjectDtoList(productLaunch.getProjectBizIdList()));
response.setApiProductLaunchDto(apiProductLaunchDto);
//设置的产品上架信息的参数列表
......@@ -209,6 +218,27 @@ public class ApiProductLaunchServiceImpl implements ApiProductLaunchService {
}
/**
* 根据项目业务id返回封装结构
* @param projectBizIds
* @return
*/
public List<ApiProjectDto> apiProjectDtoList(String projectBizIds) {
List<String> projectBizIdList = StringUtils.isNotBlank(projectBizIds) ? Arrays.asList(projectBizIds.split(";").clone()) : new ArrayList<>();
List<ApiProjectDto> list = new ArrayList<>();
ApiSysProjectListRequest request = new ApiSysProjectListRequest();
request.setProjectBizIdList(projectBizIdList);
Result<List<ApiSysProjectDetailResponse>> result = apiSysProjectFeignClient.list(request);
if (!CollectionUtils.isEmpty(result.getData())) {
list = result.getData().stream().map(d -> {
ApiProjectDto dto = new ApiProjectDto();
BeanUtils.copyProperties(d,dto);
return dto;
}).collect(Collectors.toList());
}
return list;
}
/**
* 保存-产品上架信息
* @param request
* @return
......
......@@ -90,6 +90,11 @@ public class ApiProductLaunchDto {
private List<String> projectBizIdList;
/**
* 上架到对应的项目对象列表
*/
private List<ApiProjectDto> apiProjectDtoList;
/**
* 分类表唯一业务ID列表
*/
private List<String> categoryBizIdList;
......
package com.yd.product.feign.dto;
import lombok.Data;
@Data
public class ApiProjectDto {
/**
* 项目唯一标识(业务ID)
*/
private String projectBizId;
/**
* 项目名称
*/
private String projectName;
/**
* 项目编码(租户内唯一)
*/
private String projectCode;
}
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