Commit 9d5691e2 by zhangxingmin

push

parent 502f9287
...@@ -20,11 +20,16 @@ import com.yd.product.feign.request.relprojectproductlaunch.ApiRelProjectProduct ...@@ -20,11 +20,16 @@ import com.yd.product.feign.request.relprojectproductlaunch.ApiRelProjectProduct
import com.yd.product.feign.response.productlaunch.ApiAttributeSettingDto; import com.yd.product.feign.response.productlaunch.ApiAttributeSettingDto;
import com.yd.product.feign.response.relprojectproductlaunch.ApiProductLaunchParameterPageResponse; import com.yd.product.feign.response.relprojectproductlaunch.ApiProductLaunchParameterPageResponse;
import com.yd.product.feign.response.relprojectproductlaunch.ApiRelProjectProductLaunchPageResponse; import com.yd.product.feign.response.relprojectproductlaunch.ApiRelProjectProductLaunchPageResponse;
import com.yd.product.service.dto.AttributeSettingDto;
import com.yd.product.service.model.AttributeSetting;
import com.yd.product.service.service.IAttributeSettingService;
import com.yd.product.service.service.IRelProjectProductLaunchService; import com.yd.product.service.service.IRelProjectProductLaunchService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -50,6 +55,9 @@ public class ApiRelProjectProductLaunchServiceImpl implements ApiRelProjectProdu ...@@ -50,6 +55,9 @@ public class ApiRelProjectProductLaunchServiceImpl implements ApiRelProjectProdu
@Autowired @Autowired
private ApiOssFileFeignClient apiOssFileFeignClient; private ApiOssFileFeignClient apiOssFileFeignClient;
@Autowired
private IAttributeSettingService iAttributeSettingService;
/** /**
* 分页列表查询-租户项目产品上架关系信息 * 分页列表查询-租户项目产品上架关系信息
* @param request * @param request
...@@ -120,6 +128,53 @@ public class ApiRelProjectProductLaunchServiceImpl implements ApiRelProjectProdu ...@@ -120,6 +128,53 @@ public class ApiRelProjectProductLaunchServiceImpl implements ApiRelProjectProdu
@Override @Override
public Result<IPage<ApiProductLaunchParameterPageResponse>> parameterPage(ApiProductLaunchParameterPageRequest request) { public Result<IPage<ApiProductLaunchParameterPageResponse>> parameterPage(ApiProductLaunchParameterPageRequest request) {
Page<ApiProductLaunchParameterPageResponse> page = new Page<>(request.getPageNo(), request.getPageSize()); Page<ApiProductLaunchParameterPageResponse> page = new Page<>(request.getPageNo(), request.getPageSize());
// 构建最终的 productLaunchBizIdList
List<String> finalProductLaunchBizIdList = new ArrayList<>();
// 如果 request 中已有 productLaunchBizIdList,先加入
if (!CollectionUtils.isEmpty(request.getProductLaunchBizIdList())) {
finalProductLaunchBizIdList.addAll(request.getProductLaunchBizIdList());
}
// 根据分类编码列表查询产品上架ID
if (!CollectionUtils.isEmpty(request.getCategoryCodeList())) {
ApiRelObjectCategoryQueryRequest categoryQueryRequest = new ApiRelObjectCategoryQueryRequest();
categoryQueryRequest.setCategoryCodeList(request.getCategoryCodeList());
Result<List<ApiRelObjectCategoryQueryResponse>> categoryResult = apiRelObjectCategoryFeignClient.query(categoryQueryRequest);
if (categoryResult != null && !CollectionUtils.isEmpty(categoryResult.getData())) {
List<String> categoryProductLaunchIds = categoryResult.getData().stream()
.map(ApiRelObjectCategoryQueryResponse::getObjectBizId)
.distinct()
.collect(Collectors.toList());
finalProductLaunchBizIdList.addAll(categoryProductLaunchIds);
}
}
// 根据保险公司ID列表查询产品上架ID
if (!CollectionUtils.isEmpty(request.getInsuranceCompanyBizIdList())) {
List<AttributeSetting> attributeSettingList = iAttributeSettingService.queryList(AttributeSettingDto.builder()
.fieldValueBizIdList(request.getInsuranceCompanyBizIdList())
.build());
if (!CollectionUtils.isEmpty(attributeSettingList)) {
List<String> insuranceProductLaunchIds = attributeSettingList.stream()
.map(AttributeSetting::getProductLaunchBizId)
.distinct()
.collect(Collectors.toList());
finalProductLaunchBizIdList.addAll(insuranceProductLaunchIds);
}
}
// 去重并设置回 request
if (!CollectionUtils.isEmpty(finalProductLaunchBizIdList)) {
request.setProductLaunchBizIdList(finalProductLaunchBizIdList.stream()
.distinct()
.collect(Collectors.toList()));
}
// 执行查询
IPage<ApiProductLaunchParameterPageResponse> iPage = iRelProjectProductLaunchService.parameterPage(page, request); IPage<ApiProductLaunchParameterPageResponse> iPage = iRelProjectProductLaunchService.parameterPage(page, request);
if (!CollectionUtils.isEmpty(iPage.getRecords())) { if (!CollectionUtils.isEmpty(iPage.getRecords())) {
List<ApiProductLaunchParameterPageResponse> responses = iPage.getRecords(); List<ApiProductLaunchParameterPageResponse> responses = iPage.getRecords();
......
...@@ -3,6 +3,8 @@ package com.yd.product.feign.request.productlaunch; ...@@ -3,6 +3,8 @@ package com.yd.product.feign.request.productlaunch;
import com.yd.common.dto.PageDto; import com.yd.common.dto.PageDto;
import lombok.Data; import lombok.Data;
import java.util.List;
@Data @Data
public class ApiProductLaunchParameterPageRequest extends PageDto { public class ApiProductLaunchParameterPageRequest extends PageDto {
...@@ -30,4 +32,19 @@ public class ApiProductLaunchParameterPageRequest extends PageDto { ...@@ -30,4 +32,19 @@ public class ApiProductLaunchParameterPageRequest extends PageDto {
* 字段值表唯一业务ID * 字段值表唯一业务ID
*/ */
private String fieldValueBizId; private String fieldValueBizId;
/**
* 分类编码列表
*/
private List<String> categoryCodeList;
/**
* 保险公司表唯一业务ID列表
*/
private List<String> insuranceCompanyBizIdList;
/**
* 产品上架信息表唯一业务ID列表
*/
private List<String> productLaunchBizIdList;
} }
...@@ -4,6 +4,7 @@ import lombok.AllArgsConstructor; ...@@ -4,6 +4,7 @@ import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import java.util.List;
@Data @Data
@Builder @Builder
...@@ -15,4 +16,10 @@ public class AttributeSettingDto { ...@@ -15,4 +16,10 @@ public class AttributeSettingDto {
* 产品上架信息表唯一业务ID * 产品上架信息表唯一业务ID
*/ */
private String productLaunchBizId; private String productLaunchBizId;
/**
* 字段值表唯一业务ID列表
*/
private List<String> fieldValueBizIdList;
} }
...@@ -8,6 +8,7 @@ import com.yd.product.service.service.IAttributeSettingService; ...@@ -8,6 +8,7 @@ import com.yd.product.service.service.IAttributeSettingService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.List; import java.util.List;
...@@ -26,6 +27,7 @@ public class AttributeSettingServiceImpl extends ServiceImpl<AttributeSettingMap ...@@ -26,6 +27,7 @@ public class AttributeSettingServiceImpl extends ServiceImpl<AttributeSettingMap
public List<AttributeSetting> queryList(AttributeSettingDto dto) { public List<AttributeSetting> queryList(AttributeSettingDto dto) {
List<AttributeSetting> list = baseMapper.selectList(new LambdaQueryWrapper<AttributeSetting>() List<AttributeSetting> list = baseMapper.selectList(new LambdaQueryWrapper<AttributeSetting>()
.eq(StringUtils.isNotBlank(dto.getProductLaunchBizId()),AttributeSetting::getProductLaunchBizId,dto.getProductLaunchBizId()) .eq(StringUtils.isNotBlank(dto.getProductLaunchBizId()),AttributeSetting::getProductLaunchBizId,dto.getProductLaunchBizId())
.in(!CollectionUtils.isEmpty(dto.getFieldValueBizIdList()),AttributeSetting::getFieldValueBizId,dto.getFieldValueBizIdList())
); );
return list; return list;
} }
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
from attribute_setting s from attribute_setting s
left join rel_project_product_launch rppl on rppl.product_launch_biz_id = s.product_launch_biz_id and rppl.is_deleted = 0 left join rel_project_product_launch rppl on rppl.product_launch_biz_id = s.product_launch_biz_id and rppl.is_deleted = 0
left join product_launch pl on pl.product_launch_biz_id = rppl.product_launch_biz_id and pl.is_deleted = 0 left join product_launch pl on pl.product_launch_biz_id = rppl.product_launch_biz_id and pl.is_deleted = 0
left join product p on p.product_biz_id = pl.product_biz_id and pl.is_deleted = 0 left join product p on p.product_biz_id = pl.product_biz_id and p.is_deleted = 0
<where> <where>
<if test="request.tenantBizId != null and request.tenantBizId != ''"> <if test="request.tenantBizId != null and request.tenantBizId != ''">
and rppl.tenant_biz_id = #{request.tenantBizId} and rppl.tenant_biz_id = #{request.tenantBizId}
...@@ -48,6 +48,12 @@ ...@@ -48,6 +48,12 @@
</if> </if>
and s.field_biz_id = #{request.fieldBizId} and s.field_biz_id = #{request.fieldBizId}
and s.field_value_biz_id = #{request.fieldValueBizId} and s.field_value_biz_id = #{request.fieldValueBizId}
<if test="request.productLaunchBizIdList != null and request.productLaunchBizIdList.size > 0">
and s.product_launch_biz_id in
<foreach collection="request.productLaunchBizIdList" item="item" index="index" open="(" separator="," close=")">
#{item}
</foreach>
</if>
and s.is_deleted = 0 and s.is_deleted = 0
</where> </where>
</select> </select>
......
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