bug修改

master
DongZeLiang 2024-03-26 11:24:13 +08:00
parent 48b64bbc0d
commit adfce2bc5c
2 changed files with 16 additions and 15 deletions

View File

@ -32,6 +32,11 @@ public class ProjectDetailResp {
*/ */
private ProjectInfo projectInfo; private ProjectInfo projectInfo;
/**
*
*/
private BrandInfo brandInfo;
/** /**
* Sku * Sku
*/ */

View File

@ -7,10 +7,7 @@ import java.util.List;
import com.muyu.common.core.utils.ObjUtils; import com.muyu.common.core.utils.ObjUtils;
import com.muyu.common.security.utils.SecurityUtils; import com.muyu.common.security.utils.SecurityUtils;
import com.muyu.product.domain.*; import com.muyu.product.domain.*;
import com.muyu.product.domain.model.AttrValueModel; import com.muyu.product.domain.model.*;
import com.muyu.product.domain.model.ProductSkuModel;
import com.muyu.product.domain.model.ProjectAddModel;
import com.muyu.product.domain.model.RuleAttrAddModel;
import com.muyu.product.domain.req.ProjectInfoSaveReq; import com.muyu.product.domain.req.ProjectInfoSaveReq;
import com.muyu.product.domain.resp.CategoryCommonElementResp; import com.muyu.product.domain.resp.CategoryCommonElementResp;
import com.muyu.product.domain.resp.ProjectDetailResp; import com.muyu.product.domain.resp.ProjectDetailResp;
@ -46,16 +43,7 @@ public class ProjectInfoServiceImpl extends ServiceImpl<ProjectInfoMapper, Proje
private RuleAttrInfoService ruleAttrInfoService; private RuleAttrInfoService ruleAttrInfoService;
@Autowired @Autowired
private AsCategoryAttributeService asCategoryAttributeService; private BrandInfoService brandInfoService;
@Autowired
private AsCategoryAttributeGroupService asCategoryAttributeGroupService;
@Autowired
private AttributeGroupService attributeGroupService;
@Autowired
private AttributeInfoService attributeInfoService;
/** /**
* *
@ -158,6 +146,8 @@ public class ProjectInfoServiceImpl extends ServiceImpl<ProjectInfoMapper, Proje
public ProjectDetailResp getDetailInfo (Long id) { public ProjectDetailResp getDetailInfo (Long id) {
// 商品信息获取 // 商品信息获取
ProjectInfo projectInfo = this.getById(id); ProjectInfo projectInfo = this.getById(id);
// 品牌信息
BrandInfo brandInfo = this.brandInfoService.getById(projectInfo.getBrandId());
// 品类集合 // 品类集合
List<CategoryInfo> categoryInfoList = categoryInfoService.listByIds(new ArrayList<>() {{ List<CategoryInfo> categoryInfoList = categoryInfoService.listByIds(new ArrayList<>() {{
add(projectInfo.getMianType()); add(projectInfo.getMianType());
@ -181,13 +171,19 @@ public class ProjectInfoServiceImpl extends ServiceImpl<ProjectInfoMapper, Proje
CategoryCommonElementResp templateAttribute = this.categoryInfoService.getTemplateAttributeByCateGoryId(projectInfo.getType()); CategoryCommonElementResp templateAttribute = this.categoryInfoService.getTemplateAttributeByCateGoryId(projectInfo.getType());
List<TemplateAttributeModel> templateAttributeList = templateAttribute.getTemplateAttributeList();
// TODO 添加上,商品的自有属性
List<TemplateAttributeModel> projectAttributeList = null;
// 把自有属性添加到商品属性的集合当中,进行合并
templateAttributeList.addAll(projectAttributeList);
return ProjectDetailResp.builder() return ProjectDetailResp.builder()
.projectInfo(projectInfo) .projectInfo(projectInfo)
.brandInfo(brandInfo)
.categoryInfoList(categoryInfoList) .categoryInfoList(categoryInfoList)
.projectSkuInfoList(projectSkuInfoList) .projectSkuInfoList(projectSkuInfoList)
.productAttributeInfoList(productAttributeInfoList) .productAttributeInfoList(productAttributeInfoList)
.ruleAttrModelList(ruleAttrModelList) .ruleAttrModelList(ruleAttrModelList)
.attributeInfoList(templateAttribute.getTemplateAttributeList()) .attributeInfoList(templateAttributeList)
.attributeGroupList(templateAttribute.getTemplateAttributeGroupList()) .attributeGroupList(templateAttribute.getTemplateAttributeGroupList())
.build(); .build();
} }