|
@@ -8,14 +8,12 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.yami.shop.bean.dto.ShopCategoryExcelDTO;
|
|
|
-import com.yami.shop.bean.model.Category;
|
|
|
-import com.yami.shop.bean.model.FrontCategory;
|
|
|
+import com.yami.shop.bean.model.*;
|
|
|
import com.yami.shop.bean.model.ShopCategory;
|
|
|
-import com.yami.shop.bean.model.ShopCategory;
|
|
|
-import com.yami.shop.bean.model.ShopDetail;
|
|
|
import com.yami.shop.bean.vo.FrontCategoryVO;
|
|
|
import com.yami.shop.common.exception.GlobalException;
|
|
|
import com.yami.shop.dao.FrontCategoryMapper;
|
|
|
+import com.yami.shop.dao.LabelMapper;
|
|
|
import com.yami.shop.dao.ShopCategoryMapper;
|
|
|
import com.yami.shop.dao.ShopDetailMapper;
|
|
|
import com.yami.shop.service.IShopCategoryService;
|
|
@@ -50,6 +48,7 @@ public class ShopCategoryServiceImpl extends ServiceImpl<ShopCategoryMapper, Sho
|
|
|
private final FrontCategoryMapper frontCategoryMapper;
|
|
|
|
|
|
private final ShopDetailMapper shopDetailMapper;
|
|
|
+ private final LabelMapper labelMapper;
|
|
|
|
|
|
|
|
|
@Override
|
|
@@ -130,7 +129,7 @@ public class ShopCategoryServiceImpl extends ServiceImpl<ShopCategoryMapper, Sho
|
|
|
new LambdaQueryWrapper<ShopCategory>()
|
|
|
.eq(ShopCategory::getName, category.getName())
|
|
|
.eq(ShopCategory::getShopId, shopId)
|
|
|
- .eq(ShopCategory::getIsDelete, 0).eq(ShopCategory::getPid, 0L));
|
|
|
+ .eq(ShopCategory::getIsDelete, 0).eq(ShopCategory::getPid, 0L));
|
|
|
if (ObjectUtils.isEmpty(shopCategory)) {
|
|
|
category.setShopId(shopId);
|
|
|
category.setPid(0L);
|
|
@@ -173,7 +172,15 @@ public class ShopCategoryServiceImpl extends ServiceImpl<ShopCategoryMapper, Sho
|
|
|
category.setPic(sc.getPic());
|
|
|
category.setSeq(sc.getNum());
|
|
|
category.setGrade(sc.getLevel());
|
|
|
- category.setLabel(sc.getLabel());
|
|
|
+ if(null!=sc.getLabel()){
|
|
|
+ Label label = labelMapper.selectOne(new LambdaQueryWrapper<Label>()
|
|
|
+ .eq(Label::getId, Long.valueOf(sc.getLabel()))
|
|
|
+ .eq(Label::getIsDelete, 0)
|
|
|
+ .eq(Label::getType, 0));
|
|
|
+ if (null != label && null != label.getName()) {
|
|
|
+ category.setLabel(label.getName());
|
|
|
+ }
|
|
|
+ }
|
|
|
return category;
|
|
|
}).collect(Collectors.toList());
|
|
|
res.setRecords(categories);
|
|
@@ -203,7 +210,7 @@ public class ShopCategoryServiceImpl extends ServiceImpl<ShopCategoryMapper, Sho
|
|
|
|
|
|
shopCategory.setHbShopId(hbShopId);
|
|
|
shopCategory.setShopId(shopId);
|
|
|
-log.info("添加门店前台类目:{}", shopCategory);
|
|
|
+ log.info("添加门店前台类目:{}", shopCategory);
|
|
|
this.save(shopCategory);
|
|
|
List<FrontCategory> frontCategoryList = frontCategoryMapper.selectList(new LambdaQueryWrapper<FrontCategory>()
|
|
|
.eq(FrontCategory::getParentCode, frontCategory.getCode()));
|