修改3-15问题

This commit is contained in:
2023-03-15 18:13:27 +08:00
parent 7cfbdaf947
commit 90c0a9bfdf
10 changed files with 72 additions and 8 deletions

View File

@@ -171,13 +171,21 @@ public class PmsProductServiceImpl extends ServiceImpl<PmsProductMapper, PmsProd
List<PmsProductAttributeValue> valueList = productAttributeValueMapper.selectList(new QueryWrapper<PmsProductAttributeValue>().eq("product_id", goods.getId()));
List<PmsProductAttributeValue> productAttributeValueList = new ArrayList<>();
List<PmsProductAttributeValue> attributeValueList = new ArrayList<>();
for (PmsProductAttributeValue attributeValue : valueList) {
if (attributeValue.getType() == 1) {
productAttributeValueList.add(attributeValue);
} else {
attributeValueList.add(attributeValue);
valueList.removeAll(Collections.singleton(null));
if(!valueList.isEmpty()){
for (PmsProductAttributeValue attributeValue : valueList) {
if(attributeValue.getType() != null){
if (attributeValue.getType() == 1) {
productAttributeValueList.add(attributeValue);
} else {
attributeValueList.add(attributeValue);
}
}else{
attributeValueList.add(attributeValue);
}
}
}
param.setProductAttributeValueList(productAttributeValueList);
param.setProductCanShuValueList(attributeValueList);

View File

@@ -909,7 +909,11 @@ public class SingePmsController extends ApiBaseAction {
List<Long> ids = new ArrayList<>();
ids.add(1L);
ids.add(0L);
List<PmsProductCategory> categories = categoryMapper.selectList(new QueryWrapper<PmsProductCategory>().in("level", ids));
QueryWrapper<PmsProductCategory> qw = new QueryWrapper<>();
qw.in("level", ids);
qw.orderByAsc("sort");
qw.eq("show_status",1);
List<PmsProductCategory> categories = categoryMapper.selectList(qw);
for (PmsProductCategory v : categories) {
if (v.getLevel() == 0) {
ProductTypeVo vo = new ProductTypeVo();