Merge remote-tracking branch 'origin/master' into wumedical/v1

# Conflicts:
#	src/main/java/com/peanut/modules/common/dao/ShopProductBookLabelDao.java
#	src/main/java/com/peanut/modules/common/dao/ShopProductBookMarketDao.java
#	src/main/java/com/peanut/modules/common/dao/ShopProductToBookLabelDao.java
#	src/main/java/com/peanut/modules/common/dao/ShopProductToBookMarketDao.java
#	src/main/java/com/peanut/modules/common/dao/ShopStoreDao.java
#	src/main/java/com/peanut/modules/common/entity/ShopProductBookLabel.java
#	src/main/java/com/peanut/modules/common/entity/ShopProductBookMarket.java
#	src/main/java/com/peanut/modules/common/entity/ShopProductToBookLabel.java
#	src/main/java/com/peanut/modules/common/entity/ShopProductToBookMarket.java
#	src/main/java/com/peanut/modules/common/entity/ShopStore.java
This commit is contained in:
wangjinlei
2024-03-21 09:25:48 +08:00
25 changed files with 740 additions and 3 deletions

View File

@@ -457,7 +457,7 @@ public class BuyOrderServiceImpl extends ServiceImpl<BuyOrderDao, BuyOrder> impl
public Page<BuyOrder> getUserOrderList(UserOrderDto userOrderDto) {
LambdaQueryWrapper<BuyOrder> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(BuyOrder::getUserId,userOrderDto.getUserId());
wrapper.eq(BuyOrder::getOrderType,"order");
// wrapper.eq(BuyOrder::getOrderType,"order");//这里有点问题
if(userOrderDto.getOrderStatus()==null){
Integer[] sts = {0,1,2,3};
wrapper.in(BuyOrder::getOrderStatus,sts);

View File

@@ -0,0 +1,47 @@
package com.peanut.modules.book.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.peanut.modules.book.dao.ShopProductBookLabelDao;
import com.peanut.modules.book.entity.ShopProductBookLabel;
import com.peanut.modules.book.service.ShopProductBookLabelService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.stream.Collectors;
@Slf4j
@Service("shopProductBookLabelService")
public class ShopProductBookLabelServiceImpl extends ServiceImpl<ShopProductBookLabelDao, ShopProductBookLabel> implements ShopProductBookLabelService {
@Autowired
private ShopProductBookLabelDao labelDao;
@Override
public List<ShopProductBookLabel> labelTree() {
List<ShopProductBookLabel> labels = labelDao.selectList(new QueryWrapper<>());
List<ShopProductBookLabel> labelsTree = labels.stream().filter((shopProductBookLabel) ->
shopProductBookLabel.getPid() == 0
).map((label)->{
label.setChildren(getLabelChildrens(label,labels));
return label;
}).sorted((label1,label2)->{
return (label1.getSort() == null? 0 : label1.getSort()) - (label2.getSort()==null?0:label2.getSort());
}).collect(Collectors.toList());
return labelsTree;
}
private List<ShopProductBookLabel> getLabelChildrens(ShopProductBookLabel root,List<ShopProductBookLabel> all){
List<ShopProductBookLabel> children = all.stream().filter(shopProductBookLabel -> {
return root.getId().equals(shopProductBookLabel.getPid());
}).map(shopProductBookLabel -> {
shopProductBookLabel.setChildren(getLabelChildrens(shopProductBookLabel, all));
return shopProductBookLabel;
}).sorted((label1,label2)->{
return (label1.getSort()==null?0:label1.getSort()) - (label2.getSort()==null?0:label2.getSort());
}).collect(Collectors.toList());
return children;
}
}

View File

@@ -0,0 +1,48 @@
package com.peanut.modules.book.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.peanut.common.utils.R;
import com.peanut.modules.book.dao.ShopProductBookMarketDao;
import com.peanut.modules.book.entity.ShopProductBookMarket;
import com.peanut.modules.book.service.ShopProductBookMarketService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.stream.Collectors;
@Slf4j
@Service("shopProductBookMarketService")
public class ShopProductBookMarketServiceImpl extends ServiceImpl<ShopProductBookMarketDao, ShopProductBookMarket> implements ShopProductBookMarketService {
@Autowired
private ShopProductBookMarketDao marketDao;
@Override
public List<ShopProductBookMarket> marketTree() {
List<ShopProductBookMarket> markets = marketDao.selectList(new QueryWrapper<>());
List<ShopProductBookMarket> marketsTree = markets.stream().filter((shopProductBookMarket) ->
shopProductBookMarket.getPid() == 0
).map((market)->{
market.setChildren(getMarketChildrens(market,markets));
return market;
}).sorted((sort1,sort2)->{
return (sort1.getSort() == null? 0 : sort1.getSort()) - (sort2.getSort()==null?0:sort2.getSort());
}).collect(Collectors.toList());
return marketsTree;
}
private List<ShopProductBookMarket> getMarketChildrens(ShopProductBookMarket root,List<ShopProductBookMarket> all){
List<ShopProductBookMarket> children = all.stream().filter(shopProductBookMarket -> {
return root.getId().equals(shopProductBookMarket.getPid());
}).map(shopProductBookMarket -> {
shopProductBookMarket.setChildren(getMarketChildrens(shopProductBookMarket, all));
return shopProductBookMarket;
}).sorted((sort1,sort2)->{
return (sort1.getSort()==null?0:sort1.getSort()) - (sort2.getSort()==null?0:sort2.getSort());
}).collect(Collectors.toList());
return children;
}
}

View File

@@ -0,0 +1,13 @@
package com.peanut.modules.book.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.peanut.modules.book.dao.ShopProductToBookLabelDao;
import com.peanut.modules.book.entity.ShopProductToBookLabel;
import com.peanut.modules.book.service.ShopProductToBookLabelService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
@Slf4j
@Service("shopProductToBookLabelService")
public class ShopProductToBookLabelServiceImpl extends ServiceImpl<ShopProductToBookLabelDao, ShopProductToBookLabel> implements ShopProductToBookLabelService {
}

View File

@@ -0,0 +1,13 @@
package com.peanut.modules.book.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.peanut.modules.book.dao.ShopProductToBookMarketDao;
import com.peanut.modules.book.entity.ShopProductToBookMarket;
import com.peanut.modules.book.service.ShopProductToBookMarketService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
@Slf4j
@Service("shopProductToBookMarketService")
public class ShopProductToBookMarketServiceImpl extends ServiceImpl<ShopProductToBookMarketDao, ShopProductToBookMarket> implements ShopProductToBookMarketService {
}

View File

@@ -0,0 +1,13 @@
package com.peanut.modules.book.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.peanut.modules.book.dao.ShopStoreDao;
import com.peanut.modules.book.entity.ShopStore;
import com.peanut.modules.book.service.ShopStoreService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
@Slf4j
@Service("shopStore")
public class ShopStoreServiceImpl extends ServiceImpl<ShopStoreDao, ShopStore> implements ShopStoreService {
}