第一周结束

main
尚志豪123 2024-11-20 16:05:39 +08:00
parent c96798b9da
commit fcc9be49bd
5 changed files with 68 additions and 64 deletions

View File

@ -93,15 +93,15 @@ public class ProjectInfo extends BaseEntity {
private String mianTypeName; // private String mianTypeName;
//
private String parentTypeName; // private String parentTypeName;
//
private String typeName; // private String typeName;
//
private String ruleIdName; // private String ruleIdName;
//
private String brandIdName; // private String brandIdName;
/** /**
* *
@ -118,11 +118,6 @@ public class ProjectInfo extends BaseEntity {
.status(projectInfoQueryReq.getStatus()) .status(projectInfoQueryReq.getStatus())
.ruleId(projectInfoQueryReq.getRuleId()) .ruleId(projectInfoQueryReq.getRuleId())
.brandId(projectInfoQueryReq.getBrandId()) .brandId(projectInfoQueryReq.getBrandId())
.mianTypeName(null)
.parentTypeName(null)
.typeName(null)
.ruleIdName(null)
.brandIdName(null)
.build(); .build();
} }

View File

@ -63,4 +63,13 @@ public class ProjectInfoQueryReq extends BaseEntity {
@ApiModelProperty(name = "品牌", value = "品牌") @ApiModelProperty(name = "品牌", value = "品牌")
private Long brandId; private Long brandId;
// private String mianTypeName;
//
// private String parentTypeName;
//
// private String typeName;
//
// private String ruleIdName;
//
// private String brandIdName;
} }

View File

@ -64,16 +64,16 @@ public class ProjectInfoController extends BaseController {
public Result<TableDataInfo<ProjectInfo>> list(ProjectInfoQueryReq projectInfoQueryReq) { public Result<TableDataInfo<ProjectInfo>> list(ProjectInfoQueryReq projectInfoQueryReq) {
startPage(); startPage();
List<ProjectInfo> list = projectInfoService.list(ProjectInfo.queryBuild(projectInfoQueryReq)); List<ProjectInfo> list = projectInfoService.list(ProjectInfo.queryBuild(projectInfoQueryReq));
// // // 规格
for (ProjectInfo info : list) { // for (ProjectInfo info : list) {
RuleInfo byId = ruleInfoService.getById(info.getRuleId()); // RuleInfo byId = ruleInfoService.getById(info.getRuleId());
info.setRuleIdName(byId.getName()); // info.setRuleIdName(byId.getName());
} // }
// // // 品牌
for (ProjectInfo info : list) { // for (ProjectInfo info : list) {
BrandInfo byId = brandInfoService.getById(info.getBrandId()); // BrandInfo byId = brandInfoService.getById(info.getBrandId());
info.setRuleIdName(byId.getNam()); // info.setRuleIdName(byId.getNam());
} // }
return getDataTable(list); return getDataTable(list);
} }
@ -98,13 +98,13 @@ public class ProjectInfoController extends BaseController {
@RequiresPermissions("product:info:query") @RequiresPermissions("product:info:query")
@GetMapping(value = "/{id}") @GetMapping(value = "/{id}")
@ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = Long.class) @ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = Long.class)
// public Result<ProjectInfo> getInfo(@PathVariable("id") Long id) { public Result<ProjectInfo> getInfo(@PathVariable("id") Long id) {
// return Result.success(projectInfoCache.get(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<ProjectInfoSaveReq> getInfo(@PathVariable("id") Long id) {
// ProjectInfoSaveReq projectUpdInfo = projectInfoService.get(id);
// return Result.success(projectUpdInfo);
// }
/** /**
* *

View File

@ -34,9 +34,9 @@ public interface ProjectInfoService extends IService<ProjectInfo> {
* @return * @return
*/ */
ProjectDetailResp getDetailInfo (Long id); ProjectDetailResp getDetailInfo (Long id);
/** // /**
* // * 获取商品信息详细信息
*/ // */
ProjectInfoSaveReq get(Long id); // ProjectInfoSaveReq get(Long id);
} }

View File

@ -229,34 +229,34 @@ public class ProjectInfoServiceImpl extends ServiceImpl<ProjectInfoMapper, Proje
/** /**
* *
*/ */
@Override // @Override
public ProjectInfoSaveReq get(Long id) { // public ProjectInfoSaveReq get(Long id) {
// 商品信息 // // 商品信息
ProjectInfo info = this.getById(id); // ProjectInfo info = this.getById(id);
// 商品属性表中间表 // // 商品属性表中间表
LambdaQueryWrapper<AsProductAttributeInfo> queryWrapper = new LambdaQueryWrapper<>(); // LambdaQueryWrapper<AsProductAttributeInfo> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(AsProductAttributeInfo::getProductId,id); // queryWrapper.eq(AsProductAttributeInfo::getProductId,id);
List<AsProductAttributeInfo> attributeInfoList = asProductAttributeInfoService.list(queryWrapper); // List<AsProductAttributeInfo> attributeInfoList = asProductAttributeInfoService.list(queryWrapper);
List<Long> longs = attributeInfoList.stream().map(AsProductAttributeInfo::getAttributeId).toList(); // List<Long> longs = attributeInfoList.stream().map(AsProductAttributeInfo::getAttributeId).toList();
List<AttributeInfo> arrayList = new ArrayList<>(); // List<AttributeInfo> arrayList = new ArrayList<>();
for (Long aLong : longs) { // for (Long aLong : longs) {
AttributeInfo attributeInfo = projectInfoMapper.selectProject(aLong); // AttributeInfo attributeInfo = projectInfoMapper.selectProject(aLong);
arrayList.add(attributeInfo); // arrayList.add(attributeInfo);
} // }
// sku // // sku
LambdaQueryWrapper<ProjectSkuInfo> queryWrapper1 = new LambdaQueryWrapper<>(); // LambdaQueryWrapper<ProjectSkuInfo> queryWrapper1 = new LambdaQueryWrapper<>();
queryWrapper1.eq(ProjectSkuInfo::getProjectId,id); // queryWrapper1.eq(ProjectSkuInfo::getProjectId,id);
List<ProjectSkuInfo> projectSkuInfoList = projectSkuInfoService.list(queryWrapper1); // List<ProjectSkuInfo> projectSkuInfoList = projectSkuInfoService.list(queryWrapper1);
List<Long> longs1 = projectSkuInfoList.stream().map(ProjectSkuInfo::getId).toList(); // List<Long> longs1 = projectSkuInfoList.stream().map(ProjectSkuInfo::getId).toList();
ArrayList<ProjectSkuInfo> skuInfoArrayList = new ArrayList<>(); // ArrayList<ProjectSkuInfo> skuInfoArrayList = new ArrayList<>();
for (Long aLong : longs1) { // for (Long aLong : longs1) {
ProjectSkuInfo projectSkuInfo = projectInfoMapper.selectProjectSkuInfo(aLong); // ProjectSkuInfo projectSkuInfo = projectInfoMapper.selectProjectSkuInfo(aLong);
skuInfoArrayList.add(projectSkuInfo); // skuInfoArrayList.add(projectSkuInfo);
} // }
return ProjectInfoSaveReq.builder() // return ProjectInfoSaveReq.builder()
.projectAddModel(info) // .projectAddModel(info)
.attrValueList(arrayList) // .attrValueList(arrayList)
.projectSkuInfoList(skuInfoArrayList) // .projectSkuInfoList(skuInfoArrayList)
.build(); // .build();
} // }
} }