第一周结束
parent
c96798b9da
commit
fcc9be49bd
|
@ -93,15 +93,15 @@ public class ProjectInfo extends BaseEntity {
|
|||
|
||||
|
||||
|
||||
private String mianTypeName;
|
||||
|
||||
private String parentTypeName;
|
||||
|
||||
private String typeName;
|
||||
|
||||
private String ruleIdName;
|
||||
|
||||
private String brandIdName;
|
||||
// private String mianTypeName;
|
||||
//
|
||||
// private String parentTypeName;
|
||||
//
|
||||
// private String typeName;
|
||||
//
|
||||
// private String ruleIdName;
|
||||
//
|
||||
// private String brandIdName;
|
||||
|
||||
/**
|
||||
* 查询构造器
|
||||
|
@ -118,11 +118,6 @@ public class ProjectInfo extends BaseEntity {
|
|||
.status(projectInfoQueryReq.getStatus())
|
||||
.ruleId(projectInfoQueryReq.getRuleId())
|
||||
.brandId(projectInfoQueryReq.getBrandId())
|
||||
.mianTypeName(null)
|
||||
.parentTypeName(null)
|
||||
.typeName(null)
|
||||
.ruleIdName(null)
|
||||
.brandIdName(null)
|
||||
.build();
|
||||
}
|
||||
|
||||
|
|
|
@ -63,4 +63,13 @@ public class ProjectInfoQueryReq extends BaseEntity {
|
|||
@ApiModelProperty(name = "品牌", value = "品牌")
|
||||
private Long brandId;
|
||||
|
||||
// private String mianTypeName;
|
||||
//
|
||||
// private String parentTypeName;
|
||||
//
|
||||
// private String typeName;
|
||||
//
|
||||
// private String ruleIdName;
|
||||
//
|
||||
// private String brandIdName;
|
||||
}
|
||||
|
|
|
@ -64,16 +64,16 @@ public class ProjectInfoController extends BaseController {
|
|||
public Result<TableDataInfo<ProjectInfo>> list(ProjectInfoQueryReq projectInfoQueryReq) {
|
||||
startPage();
|
||||
List<ProjectInfo> list = projectInfoService.list(ProjectInfo.queryBuild(projectInfoQueryReq));
|
||||
//
|
||||
for (ProjectInfo info : list) {
|
||||
RuleInfo byId = ruleInfoService.getById(info.getRuleId());
|
||||
info.setRuleIdName(byId.getName());
|
||||
}
|
||||
//
|
||||
for (ProjectInfo info : list) {
|
||||
BrandInfo byId = brandInfoService.getById(info.getBrandId());
|
||||
info.setRuleIdName(byId.getNam());
|
||||
}
|
||||
// // 规格
|
||||
// for (ProjectInfo info : list) {
|
||||
// RuleInfo byId = ruleInfoService.getById(info.getRuleId());
|
||||
// info.setRuleIdName(byId.getName());
|
||||
// }
|
||||
// // 品牌
|
||||
// for (ProjectInfo info : list) {
|
||||
// BrandInfo byId = brandInfoService.getById(info.getBrandId());
|
||||
// info.setRuleIdName(byId.getNam());
|
||||
// }
|
||||
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
@ -98,13 +98,13 @@ public class ProjectInfoController extends BaseController {
|
|||
@RequiresPermissions("product:info:query")
|
||||
@GetMapping(value = "/{id}")
|
||||
@ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = Long.class)
|
||||
// public Result<ProjectInfo> getInfo(@PathVariable("id") Long id) {
|
||||
// return Result.success(projectInfoCache.get(id));
|
||||
// }
|
||||
public Result<ProjectInfoSaveReq> getInfo(@PathVariable("id") Long id) {
|
||||
ProjectInfoSaveReq projectUpdInfo = projectInfoService.get(id);
|
||||
return Result.success(projectUpdInfo);
|
||||
public Result<ProjectInfo> getInfo(@PathVariable("id") Long id) {
|
||||
return Result.success(projectInfoCache.get(id));
|
||||
}
|
||||
// public Result<ProjectInfoSaveReq> getInfo(@PathVariable("id") Long id) {
|
||||
// ProjectInfoSaveReq projectUpdInfo = projectInfoService.get(id);
|
||||
// return Result.success(projectUpdInfo);
|
||||
// }
|
||||
|
||||
/**
|
||||
* 获取商品信息详细信息
|
||||
|
|
|
@ -34,9 +34,9 @@ public interface ProjectInfoService extends IService<ProjectInfo> {
|
|||
* @return 商品详情
|
||||
*/
|
||||
ProjectDetailResp getDetailInfo (Long id);
|
||||
/**
|
||||
* 获取商品信息详细信息
|
||||
*/
|
||||
ProjectInfoSaveReq get(Long id);
|
||||
// /**
|
||||
// * 获取商品信息详细信息
|
||||
// */
|
||||
// ProjectInfoSaveReq get(Long id);
|
||||
|
||||
}
|
||||
|
|
|
@ -229,34 +229,34 @@ public class ProjectInfoServiceImpl extends ServiceImpl<ProjectInfoMapper, Proje
|
|||
/**
|
||||
* 获取商品信息详细信息
|
||||
*/
|
||||
@Override
|
||||
public ProjectInfoSaveReq get(Long id) {
|
||||
// 商品信息
|
||||
ProjectInfo info = this.getById(id);
|
||||
// 商品属性表中间表
|
||||
LambdaQueryWrapper<AsProductAttributeInfo> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(AsProductAttributeInfo::getProductId,id);
|
||||
List<AsProductAttributeInfo> attributeInfoList = asProductAttributeInfoService.list(queryWrapper);
|
||||
List<Long> longs = attributeInfoList.stream().map(AsProductAttributeInfo::getAttributeId).toList();
|
||||
List<AttributeInfo> arrayList = new ArrayList<>();
|
||||
for (Long aLong : longs) {
|
||||
AttributeInfo attributeInfo = projectInfoMapper.selectProject(aLong);
|
||||
arrayList.add(attributeInfo);
|
||||
}
|
||||
// sku
|
||||
LambdaQueryWrapper<ProjectSkuInfo> queryWrapper1 = new LambdaQueryWrapper<>();
|
||||
queryWrapper1.eq(ProjectSkuInfo::getProjectId,id);
|
||||
List<ProjectSkuInfo> projectSkuInfoList = projectSkuInfoService.list(queryWrapper1);
|
||||
List<Long> longs1 = projectSkuInfoList.stream().map(ProjectSkuInfo::getId).toList();
|
||||
ArrayList<ProjectSkuInfo> skuInfoArrayList = new ArrayList<>();
|
||||
for (Long aLong : longs1) {
|
||||
ProjectSkuInfo projectSkuInfo = projectInfoMapper.selectProjectSkuInfo(aLong);
|
||||
skuInfoArrayList.add(projectSkuInfo);
|
||||
}
|
||||
return ProjectInfoSaveReq.builder()
|
||||
.projectAddModel(info)
|
||||
.attrValueList(arrayList)
|
||||
.projectSkuInfoList(skuInfoArrayList)
|
||||
.build();
|
||||
}
|
||||
// @Override
|
||||
// public ProjectInfoSaveReq get(Long id) {
|
||||
// // 商品信息
|
||||
// ProjectInfo info = this.getById(id);
|
||||
// // 商品属性表中间表
|
||||
// LambdaQueryWrapper<AsProductAttributeInfo> queryWrapper = new LambdaQueryWrapper<>();
|
||||
// queryWrapper.eq(AsProductAttributeInfo::getProductId,id);
|
||||
// List<AsProductAttributeInfo> attributeInfoList = asProductAttributeInfoService.list(queryWrapper);
|
||||
// List<Long> longs = attributeInfoList.stream().map(AsProductAttributeInfo::getAttributeId).toList();
|
||||
// List<AttributeInfo> arrayList = new ArrayList<>();
|
||||
// for (Long aLong : longs) {
|
||||
// AttributeInfo attributeInfo = projectInfoMapper.selectProject(aLong);
|
||||
// arrayList.add(attributeInfo);
|
||||
// }
|
||||
// // sku
|
||||
// LambdaQueryWrapper<ProjectSkuInfo> queryWrapper1 = new LambdaQueryWrapper<>();
|
||||
// queryWrapper1.eq(ProjectSkuInfo::getProjectId,id);
|
||||
// List<ProjectSkuInfo> projectSkuInfoList = projectSkuInfoService.list(queryWrapper1);
|
||||
// List<Long> longs1 = projectSkuInfoList.stream().map(ProjectSkuInfo::getId).toList();
|
||||
// ArrayList<ProjectSkuInfo> skuInfoArrayList = new ArrayList<>();
|
||||
// for (Long aLong : longs1) {
|
||||
// ProjectSkuInfo projectSkuInfo = projectInfoMapper.selectProjectSkuInfo(aLong);
|
||||
// skuInfoArrayList.add(projectSkuInfo);
|
||||
// }
|
||||
// return ProjectInfoSaveReq.builder()
|
||||
// .projectAddModel(info)
|
||||
// .attrValueList(arrayList)
|
||||
// .projectSkuInfoList(skuInfoArrayList)
|
||||
// .build();
|
||||
// }
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue