主页-我的课程

This commit is contained in:
wuchunlei
2024-04-11 09:05:34 +08:00
parent fe14ece2a3
commit b705aec11d
68 changed files with 1772 additions and 4 deletions

View File

@@ -0,0 +1,13 @@
package com.peanut.modules.master.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.peanut.modules.common.dao.ShopProductMedicineLabelDao;
import com.peanut.modules.common.entity.ShopProductMedicineLabel;
import com.peanut.modules.medical.service.ShopProductMedicineLabelService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
@Slf4j
@Service("medicineShopProductMedicineLabelService")
public class ShopProductMedicineLabelServiceImpl extends ServiceImpl<ShopProductMedicineLabelDao, ShopProductMedicineLabel> implements ShopProductMedicineLabelService {
}

View File

@@ -0,0 +1,13 @@
package com.peanut.modules.master.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.peanut.modules.common.dao.ShopProductMedicineMarketDao;
import com.peanut.modules.common.entity.ShopProductMedicineMarket;
import com.peanut.modules.medical.service.ShopProductMedicineMarketService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
@Slf4j
@Service("medicineShopProductMedicineMarketService")
public class ShopProductMedicineMarketServiceImpl extends ServiceImpl<ShopProductMedicineMarketDao, ShopProductMedicineMarket> implements ShopProductMedicineMarketService {
}

View File

@@ -0,0 +1,46 @@
package com.peanut.modules.master.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.peanut.modules.common.dao.ShopProductSociologyLabelDao;
import com.peanut.modules.common.entity.ShopProductSociologyLabel;
import com.peanut.modules.master.service.ShopProductSociologyLabelService;
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("sociologyShopProductSociologyLabelService")
public class ShopProductSociologyLabelServiceImpl extends ServiceImpl<ShopProductSociologyLabelDao, ShopProductSociologyLabel> implements ShopProductSociologyLabelService {
@Autowired
private ShopProductSociologyLabelDao labelDao;
@Override
public List<ShopProductSociologyLabel> labelTree() {
List<ShopProductSociologyLabel> labels = labelDao.selectList(new QueryWrapper<>());
List<ShopProductSociologyLabel> labelsTree = labels.stream().filter((shopProductSociologyLabel) ->
shopProductSociologyLabel.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<ShopProductSociologyLabel> getLabelChildrens(ShopProductSociologyLabel root,List<ShopProductSociologyLabel> all){
List<ShopProductSociologyLabel> children = all.stream().filter(shopProductSociologyLabel -> {
return root.getId().equals(shopProductSociologyLabel.getPid());
}).map(shopProductSociologyLabel -> {
shopProductSociologyLabel.setChildren(getLabelChildrens(shopProductSociologyLabel, all));
return shopProductSociologyLabel;
}).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,46 @@
package com.peanut.modules.master.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.peanut.modules.common.dao.ShopProductSociologyMarketDao;
import com.peanut.modules.common.entity.ShopProductSociologyMarket;
import com.peanut.modules.master.service.ShopProductSociologyMarketService;
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("sociologyShopProductSociologyMarketService")
public class ShopProductSociologyMarketServiceImpl extends ServiceImpl<ShopProductSociologyMarketDao, ShopProductSociologyMarket> implements ShopProductSociologyMarketService {
@Autowired
private ShopProductSociologyMarketDao marketDao;
@Override
public List<ShopProductSociologyMarket> marketTree() {
List<ShopProductSociologyMarket> markets = marketDao.selectList(new QueryWrapper<>());
List<ShopProductSociologyMarket> marketsTree = markets.stream().filter((shopProductSociologyMarket) ->
shopProductSociologyMarket.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<ShopProductSociologyMarket> getMarketChildrens(ShopProductSociologyMarket root,List<ShopProductSociologyMarket> all){
List<ShopProductSociologyMarket> children = all.stream().filter(shopProductSociologyMarket -> {
return root.getId().equals(shopProductSociologyMarket.getPid());
}).map(shopProductSociologyMarket -> {
shopProductSociologyMarket.setChildren(getMarketChildrens(shopProductSociologyMarket, all));
return shopProductSociologyMarket;
}).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.master.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.peanut.modules.common.dao.ShopProductToMedicineLabelDao;
import com.peanut.modules.common.entity.ShopProductToMedicineLabel;
import com.peanut.modules.medical.service.ShopProductToMedicineLabelService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
@Slf4j
@Service("medicineShopProductToMedicineLabelService")
public class ShopProductToMedicineLabelServiceImpl extends ServiceImpl<ShopProductToMedicineLabelDao, ShopProductToMedicineLabel> implements ShopProductToMedicineLabelService {
}

View File

@@ -0,0 +1,13 @@
package com.peanut.modules.master.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.peanut.modules.common.dao.ShopProductToMedicineMarketDao;
import com.peanut.modules.common.entity.ShopProductToMedicineMarket;
import com.peanut.modules.medical.service.ShopProductToMedicineMarketService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
@Slf4j
@Service("medicineShopProductToMedicineMarketService")
public class ShopProductToMedicineMarketServiceImpl extends ServiceImpl<ShopProductToMedicineMarketDao, ShopProductToMedicineMarket> implements ShopProductToMedicineMarketService {
}

View File

@@ -0,0 +1,13 @@
package com.peanut.modules.master.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.peanut.modules.common.dao.ShopProductToSociologyLabelDao;
import com.peanut.modules.common.entity.ShopProductToSociologyLabel;
import com.peanut.modules.master.service.ShopProductToSociologyLabelService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
@Slf4j
@Service("sociologyShopProductToSociologyLabelService")
public class ShopProductToSociologyLabelServiceImpl extends ServiceImpl<ShopProductToSociologyLabelDao, ShopProductToSociologyLabel> implements ShopProductToSociologyLabelService {
}

View File

@@ -0,0 +1,13 @@
package com.peanut.modules.master.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.peanut.modules.common.dao.ShopProductToSociologyMarketDao;
import com.peanut.modules.common.entity.ShopProductToSociologyMarket;
import com.peanut.modules.master.service.ShopProductToSociologyMarketService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
@Slf4j
@Service("sociologyShopProductToSociologyMarketService")
public class ShopProductToSociologyMarketServiceImpl extends ServiceImpl<ShopProductToSociologyMarketDao, ShopProductToSociologyMarket> implements ShopProductToSociologyMarketService {
}