新增商店名称返回给商品分类、品牌、类型、规格列表
This commit is contained in:
parent
397634d57d
commit
de52e64390
@ -105,4 +105,7 @@ public class ShopBaseProductCategory implements Serializable {
|
|||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private String type_name;
|
private String type_name;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String store_name;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -67,4 +67,8 @@ public class ShopBaseProductSpec implements Serializable {
|
|||||||
|
|
||||||
@ApiModelProperty(value = "所属店铺")
|
@ApiModelProperty(value = "所属店铺")
|
||||||
private Integer store_id;
|
private Integer store_id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "所属店铺")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String store_name;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -86,4 +86,7 @@ public class ShopBaseProductType implements Serializable {
|
|||||||
@ApiModelProperty(value = "所属店铺")
|
@ApiModelProperty(value = "所属店铺")
|
||||||
private Integer store_id;
|
private Integer store_id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "所属店铺")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String store_name;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,6 +4,7 @@ import cn.hutool.core.convert.Convert;
|
|||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.suisung.mall.common.api.CommonResult;
|
import com.suisung.mall.common.api.CommonResult;
|
||||||
import com.suisung.mall.common.modules.base.ShopBaseProductCategory;
|
import com.suisung.mall.common.modules.base.ShopBaseProductCategory;
|
||||||
|
import com.suisung.mall.common.utils.FilterUtils;
|
||||||
import com.suisung.mall.common.utils.I18nUtil;
|
import com.suisung.mall.common.utils.I18nUtil;
|
||||||
import com.suisung.mall.shop.base.service.ShopBaseProductCategoryService;
|
import com.suisung.mall.shop.base.service.ShopBaseProductCategoryService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
@ -63,12 +64,10 @@ public class ShopBaseProductCategoryController {
|
|||||||
@RequestMapping(value = "/categoryTree", method = RequestMethod.GET)
|
@RequestMapping(value = "/categoryTree", method = RequestMethod.GET)
|
||||||
public CommonResult getList(ShopBaseProductCategory category) {
|
public CommonResult getList(ShopBaseProductCategory category) {
|
||||||
QueryWrapper<ShopBaseProductCategory> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<ShopBaseProductCategory> queryWrapper = new QueryWrapper<>();
|
||||||
String store_id = getCurrentUser().getStore_id();
|
new FilterUtils<ShopBaseProductCategory>().applyStoreFilter(queryWrapper);
|
||||||
queryWrapper.eq("store_id", store_id);
|
|
||||||
queryWrapper.eq("category_is_enable", 1);
|
queryWrapper.eq("category_is_enable", 1);
|
||||||
Integer category_parent_id = category.getCategory_parent_id();
|
Integer category_parent_id = category.getCategory_parent_id();
|
||||||
if (category_parent_id == null) category_parent_id = 0;
|
if (category_parent_id == null) category_parent_id = 0;
|
||||||
|
|
||||||
return CommonResult.success(shopBaseProductCategoryService.getCategoryTree(queryWrapper, category_parent_id));
|
return CommonResult.success(shopBaseProductCategoryService.getCategoryTree(queryWrapper, category_parent_id));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -87,8 +86,7 @@ public class ShopBaseProductCategoryController {
|
|||||||
@ApiOperation(value = "商品分类表-分类强调区别, 类型强调共性-编辑", notes = "商品分类表-分类强调区别, 类型强调共性-编辑")
|
@ApiOperation(value = "商品分类表-分类强调区别, 类型强调共性-编辑", notes = "商品分类表-分类强调区别, 类型强调共性-编辑")
|
||||||
@RequestMapping(value = "/edit", method = RequestMethod.POST)
|
@RequestMapping(value = "/edit", method = RequestMethod.POST)
|
||||||
public CommonResult edit(ShopBaseProductCategory shopBaseProductCategory) {
|
public CommonResult edit(ShopBaseProductCategory shopBaseProductCategory) {
|
||||||
String store_id = getCurrentUser().getStore_id();
|
|
||||||
shopBaseProductCategory.setStore_id(store_id);
|
|
||||||
Integer category_id = shopBaseProductCategory.getCategory_id();
|
Integer category_id = shopBaseProductCategory.getCategory_id();
|
||||||
if (category_id == null) {
|
if (category_id == null) {
|
||||||
shopBaseProductCategory.setPage_id_pc(0L);
|
shopBaseProductCategory.setPage_id_pc(0L);
|
||||||
@ -99,9 +97,16 @@ public class ShopBaseProductCategoryController {
|
|||||||
if (shopBaseProductCategory.getCategory_order() == null) {
|
if (shopBaseProductCategory.getCategory_order() == null) {
|
||||||
shopBaseProductCategory.setCategory_order(50);
|
shopBaseProductCategory.setCategory_order(50);
|
||||||
}
|
}
|
||||||
|
String store_id = getCurrentUser().getStore_id();
|
||||||
|
shopBaseProductCategory.setStore_id(store_id);
|
||||||
} else {
|
} else {
|
||||||
//修改,不允许修改商品类型
|
//修改,不允许修改商品类型
|
||||||
// shopBaseProductCategory.setType_id(null);
|
// shopBaseProductCategory.setType_id(null);
|
||||||
|
ShopBaseProductCategory oldShopBaseProductCategory= shopBaseProductCategoryService.get(category_id);
|
||||||
|
if(null==oldShopBaseProductCategory){
|
||||||
|
return CommonResult.failed("商品分类不存在");
|
||||||
|
}
|
||||||
|
oldShopBaseProductCategory.setStore_id(oldShopBaseProductCategory.getStore_id());
|
||||||
}
|
}
|
||||||
|
|
||||||
return CommonResult.success(shopBaseProductCategoryService.editCategory(shopBaseProductCategory));
|
return CommonResult.success(shopBaseProductCategoryService.editCategory(shopBaseProductCategory));
|
||||||
@ -116,6 +121,13 @@ public class ShopBaseProductCategoryController {
|
|||||||
@ApiOperation(value = "商品分类表-分类强调区别, 类型强调共性-通过category_id删除", notes = "商品分类表-分类强调区别, 类型强调共性-通过category_id删除")
|
@ApiOperation(value = "商品分类表-分类强调区别, 类型强调共性-通过category_id删除", notes = "商品分类表-分类强调区别, 类型强调共性-通过category_id删除")
|
||||||
@RequestMapping(value = "/delete", method = RequestMethod.POST)
|
@RequestMapping(value = "/delete", method = RequestMethod.POST)
|
||||||
public CommonResult delete(@RequestParam(name = "category_id") Integer category_id) {
|
public CommonResult delete(@RequestParam(name = "category_id") Integer category_id) {
|
||||||
|
if(getCurrentUser().isStore()){
|
||||||
|
String store_id = getCurrentUser().getStore_id();
|
||||||
|
ShopBaseProductCategory shopBaseProductCategory= shopBaseProductCategoryService.get(category_id);
|
||||||
|
if(!shopBaseProductCategory.getStore_id().equals(store_id)){
|
||||||
|
return CommonResult.failed("非本人店铺分类不能删除");
|
||||||
|
}
|
||||||
|
}
|
||||||
QueryWrapper<ShopBaseProductCategory> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<ShopBaseProductCategory> queryWrapper = new QueryWrapper<>();
|
||||||
queryWrapper.eq("category_parent_id", category_id);
|
queryWrapper.eq("category_parent_id", category_id);
|
||||||
long count = shopBaseProductCategoryService.count(queryWrapper);
|
long count = shopBaseProductCategoryService.count(queryWrapper);
|
||||||
@ -133,7 +145,7 @@ public class ShopBaseProductCategoryController {
|
|||||||
@RequestMapping(value = "/tree", method = {RequestMethod.GET, RequestMethod.POST})
|
@RequestMapping(value = "/tree", method = {RequestMethod.GET, RequestMethod.POST})
|
||||||
public CommonResult tree(ShopBaseProductCategory category) {
|
public CommonResult tree(ShopBaseProductCategory category) {
|
||||||
QueryWrapper<ShopBaseProductCategory> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<ShopBaseProductCategory> queryWrapper = new QueryWrapper<>();
|
||||||
queryWrapper.eq("store_id", getCurrentUser().getStore_id());
|
new FilterUtils<ShopBaseProductCategory>().applyStoreFilter(queryWrapper);
|
||||||
queryWrapper.orderByAsc("category_order");
|
queryWrapper.orderByAsc("category_order");
|
||||||
if (category.getCategory_parent_id() != null) {
|
if (category.getCategory_parent_id() != null) {
|
||||||
queryWrapper.eq("category_parent_id", category.getCategory_parent_id());
|
queryWrapper.eq("category_parent_id", category.getCategory_parent_id());
|
||||||
|
|||||||
@ -3,6 +3,7 @@ package com.suisung.mall.shop.base.controller.admin;
|
|||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.convert.Convert;
|
import cn.hutool.core.convert.Convert;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.suisung.mall.common.api.CommonResult;
|
import com.suisung.mall.common.api.CommonResult;
|
||||||
import com.suisung.mall.common.domain.UserDto;
|
import com.suisung.mall.common.domain.UserDto;
|
||||||
import com.suisung.mall.common.exception.ApiException;
|
import com.suisung.mall.common.exception.ApiException;
|
||||||
@ -14,6 +15,7 @@ import com.suisung.mall.common.utils.FilterUtils;
|
|||||||
import com.suisung.mall.common.utils.I18nUtil;
|
import com.suisung.mall.common.utils.I18nUtil;
|
||||||
import com.suisung.mall.shop.base.service.ShopBaseProductSpecService;
|
import com.suisung.mall.shop.base.service.ShopBaseProductSpecService;
|
||||||
import com.suisung.mall.shop.product.service.ShopProductSpecItemService;
|
import com.suisung.mall.shop.product.service.ShopProductSpecItemService;
|
||||||
|
import com.suisung.mall.shop.store.service.ShopStoreBaseService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@ -46,6 +48,8 @@ public class ShopBaseProductSpecController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private ShopProductSpecItemService shopProductSpecItemService;
|
private ShopProductSpecItemService shopProductSpecItemService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
ShopStoreBaseService shopStoreBaseService;
|
||||||
/**
|
/**
|
||||||
* 分页列表查询
|
* 分页列表查询
|
||||||
*
|
*
|
||||||
@ -64,8 +68,11 @@ public class ShopBaseProductSpecController {
|
|||||||
if (CheckUtil.isNotEmpty(shopBaseProductSpec.getSpec_name())) {
|
if (CheckUtil.isNotEmpty(shopBaseProductSpec.getSpec_name())) {
|
||||||
queryWrapper.like("spec_name", shopBaseProductSpec.getSpec_name());
|
queryWrapper.like("spec_name", shopBaseProductSpec.getSpec_name());
|
||||||
}
|
}
|
||||||
|
Page<ShopBaseProductSpec> pageList= shopBaseProductSpecService.lists(queryWrapper, pageNum, pageSize);
|
||||||
return CommonResult.success(shopBaseProductSpecService.lists(queryWrapper, pageNum, pageSize));
|
List<ShopBaseProductSpec> shopBaseProductSpecList= pageList.getRecords();
|
||||||
|
shopBaseProductSpecList=shopStoreBaseService.fixStoreDataShopBaseProductSpec(shopBaseProductSpecList);
|
||||||
|
pageList.setRecords(shopBaseProductSpecList);
|
||||||
|
return CommonResult.success(pageList);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -4,6 +4,7 @@ import cn.hutool.core.convert.Convert;
|
|||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.alibaba.csp.sentinel.adapter.servlet.util.FilterUtil;
|
import com.alibaba.csp.sentinel.adapter.servlet.util.FilterUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.suisung.mall.common.api.CommonResult;
|
import com.suisung.mall.common.api.CommonResult;
|
||||||
import com.suisung.mall.common.modules.base.ShopBaseProductType;
|
import com.suisung.mall.common.modules.base.ShopBaseProductType;
|
||||||
import com.suisung.mall.common.modules.product.ShopProductInfo;
|
import com.suisung.mall.common.modules.product.ShopProductInfo;
|
||||||
@ -12,6 +13,7 @@ import com.suisung.mall.common.utils.FilterUtils;
|
|||||||
import com.suisung.mall.shop.base.service.ShopBaseProductTypeService;
|
import com.suisung.mall.shop.base.service.ShopBaseProductTypeService;
|
||||||
import com.suisung.mall.shop.product.mapper.ShopProductInfoMapper;
|
import com.suisung.mall.shop.product.mapper.ShopProductInfoMapper;
|
||||||
import com.suisung.mall.shop.product.service.ShopProductItemService;
|
import com.suisung.mall.shop.product.service.ShopProductItemService;
|
||||||
|
import com.suisung.mall.shop.store.service.ShopStoreBaseService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@ -44,6 +46,9 @@ public class ShopBaseProductTypeController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
ShopProductInfoMapper shopProductInfoMapper;
|
ShopProductInfoMapper shopProductInfoMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
ShopStoreBaseService shopStoreBaseService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ShopBaseProductTypeService shopBaseProductTypeService;
|
private ShopBaseProductTypeService shopBaseProductTypeService;
|
||||||
|
|
||||||
@ -70,8 +75,11 @@ public class ShopBaseProductTypeController {
|
|||||||
if (CheckUtil.isNotEmpty(shopBaseProductType.getType_name())) {
|
if (CheckUtil.isNotEmpty(shopBaseProductType.getType_name())) {
|
||||||
queryWrapper.like("type_name", shopBaseProductType.getType_name());
|
queryWrapper.like("type_name", shopBaseProductType.getType_name());
|
||||||
}
|
}
|
||||||
|
Page<ShopBaseProductType> pageList= shopBaseProductTypeService.lists(queryWrapper, pageNum, pageSize);
|
||||||
return CommonResult.success(shopBaseProductTypeService.lists(queryWrapper, pageNum, pageSize));
|
List<ShopBaseProductType> shopBaseProductTypes= pageList.getRecords();
|
||||||
|
shopBaseProductTypes=shopStoreBaseService.fixStoreDataShopBaseProductType(shopBaseProductTypes);
|
||||||
|
pageList.setRecords(shopBaseProductTypes);
|
||||||
|
return CommonResult.success(pageList);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "商品类型表-强调共性,类别cat是强调区别.-通过type_id查询", notes = "商品类型表-强调共性,类别cat是强调区别.-通过type_id查询")
|
@ApiOperation(value = "商品类型表-强调共性,类别cat是强调区别.-通过type_id查询", notes = "商品类型表-强调共性,类别cat是强调区别.-通过type_id查询")
|
||||||
|
|||||||
@ -47,6 +47,7 @@ import com.suisung.mall.shop.product.service.ShopProductIndexService;
|
|||||||
import com.suisung.mall.shop.product.service.ShopProductItemService;
|
import com.suisung.mall.shop.product.service.ShopProductItemService;
|
||||||
import com.suisung.mall.shop.sixun.service.SxSyncCategoryService;
|
import com.suisung.mall.shop.sixun.service.SxSyncCategoryService;
|
||||||
import com.suisung.mall.shop.store.service.ShopStoreActivityItemService;
|
import com.suisung.mall.shop.store.service.ShopStoreActivityItemService;
|
||||||
|
import com.suisung.mall.shop.store.service.ShopStoreBaseService;
|
||||||
import com.suisung.mall.shop.user.service.ShopUserCartService;
|
import com.suisung.mall.shop.user.service.ShopUserCartService;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@ -137,6 +138,9 @@ public class ShopBaseProductCategoryServiceImpl extends BaseServiceImpl<ShopBase
|
|||||||
@Autowired
|
@Autowired
|
||||||
private SxSyncCategoryService sxSyncCategoryService;
|
private SxSyncCategoryService sxSyncCategoryService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ShopStoreBaseService shopStoreBaseService;
|
||||||
|
|
||||||
private final String LANG = "zh_CN"; // todo 多语言动态
|
private final String LANG = "zh_CN"; // todo 多语言动态
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -256,6 +260,7 @@ public class ShopBaseProductCategoryServiceImpl extends BaseServiceImpl<ShopBase
|
|||||||
queryWrapper.orderByAsc("category_order");
|
queryWrapper.orderByAsc("category_order");
|
||||||
List<Map> categories = Convert.toList(Map.class, find(queryWrapper));
|
List<Map> categories = Convert.toList(Map.class, find(queryWrapper));
|
||||||
categories = shopProductBaseService.fixProductTypeDate(categories);
|
categories = shopProductBaseService.fixProductTypeDate(categories);
|
||||||
|
shopStoreBaseService.fixStoreData(categories);
|
||||||
List<Map> categoryTree = getCategoryTree(categories, 0);
|
List<Map> categoryTree = getCategoryTree(categories, 0);
|
||||||
redisService.set(redisKey, categoryTree);
|
redisService.set(redisKey, categoryTree);
|
||||||
return categoryTree;
|
return categoryTree;
|
||||||
|
|||||||
@ -4,11 +4,15 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.suisung.mall.common.api.CommonResult;
|
import com.suisung.mall.common.api.CommonResult;
|
||||||
import com.suisung.mall.common.modules.account.AccountUserInfo;
|
import com.suisung.mall.common.modules.account.AccountUserInfo;
|
||||||
|
import com.suisung.mall.common.modules.base.ShopBaseProductCategory;
|
||||||
|
import com.suisung.mall.common.modules.base.ShopBaseProductSpec;
|
||||||
|
import com.suisung.mall.common.modules.base.ShopBaseProductType;
|
||||||
import com.suisung.mall.common.modules.base.ShopBaseStoreCategory;
|
import com.suisung.mall.common.modules.base.ShopBaseStoreCategory;
|
||||||
import com.suisung.mall.common.modules.store.ShopStoreBase;
|
import com.suisung.mall.common.modules.store.ShopStoreBase;
|
||||||
import com.suisung.mall.common.modules.store.ShopStoreCompany;
|
import com.suisung.mall.common.modules.store.ShopStoreCompany;
|
||||||
import com.suisung.mall.common.pojo.dto.StandardAddressDTO;
|
import com.suisung.mall.common.pojo.dto.StandardAddressDTO;
|
||||||
import com.suisung.mall.core.web.service.IBaseService;
|
import com.suisung.mall.core.web.service.IBaseService;
|
||||||
|
import org.apache.poi.ss.formula.functions.T;
|
||||||
import org.springframework.data.util.Pair;
|
import org.springframework.data.util.Pair;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
@ -59,6 +63,12 @@ public interface ShopStoreBaseService extends IBaseService<ShopStoreBase> {
|
|||||||
|
|
||||||
void fixStoreData(List<Map> rows);
|
void fixStoreData(List<Map> rows);
|
||||||
|
|
||||||
|
void fixStoreDataByShopBaseProductCategory(List<ShopBaseProductCategory> rows);
|
||||||
|
|
||||||
|
List<ShopBaseProductType> fixStoreDataShopBaseProductType(List<ShopBaseProductType> rows);
|
||||||
|
|
||||||
|
List<ShopBaseProductSpec> fixStoreDataShopBaseProductSpec(List<ShopBaseProductSpec> rows);
|
||||||
|
|
||||||
Map getBaseList(QueryWrapper<ShopStoreBase> queryWrapper, Integer pageNum, Integer pageSize);
|
Map getBaseList(QueryWrapper<ShopStoreBase> queryWrapper, Integer pageNum, Integer pageSize);
|
||||||
|
|
||||||
Map getBase(Integer store_id);
|
Map getBase(Integer store_id);
|
||||||
|
|||||||
@ -6,6 +6,7 @@ import cn.hutool.core.collection.ListUtil;
|
|||||||
import cn.hutool.core.convert.Convert;
|
import cn.hutool.core.convert.Convert;
|
||||||
import cn.hutool.core.date.DateTime;
|
import cn.hutool.core.date.DateTime;
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import cn.hutool.core.map.MapUtil;
|
||||||
import cn.hutool.core.util.NumberUtil;
|
import cn.hutool.core.util.NumberUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
@ -31,10 +32,7 @@ import com.suisung.mall.common.feignService.PayService;
|
|||||||
import com.suisung.mall.common.modules.account.AccountUserBase;
|
import com.suisung.mall.common.modules.account.AccountUserBase;
|
||||||
import com.suisung.mall.common.modules.account.AccountUserInfo;
|
import com.suisung.mall.common.modules.account.AccountUserInfo;
|
||||||
import com.suisung.mall.common.modules.account.AccountUserSns;
|
import com.suisung.mall.common.modules.account.AccountUserSns;
|
||||||
import com.suisung.mall.common.modules.base.ShopBaseProductTag;
|
import com.suisung.mall.common.modules.base.*;
|
||||||
import com.suisung.mall.common.modules.base.ShopBaseStoreCategory;
|
|
||||||
import com.suisung.mall.common.modules.base.ShopBaseStoreGrade;
|
|
||||||
import com.suisung.mall.common.modules.base.ShopPageModule;
|
|
||||||
import com.suisung.mall.common.modules.distribution.ShopDistributionPlantformUser;
|
import com.suisung.mall.common.modules.distribution.ShopDistributionPlantformUser;
|
||||||
import com.suisung.mall.common.modules.invoicing.InvoicingCustomerLevel;
|
import com.suisung.mall.common.modules.invoicing.InvoicingCustomerLevel;
|
||||||
import com.suisung.mall.common.modules.invoicing.InvoicingWarehouseBase;
|
import com.suisung.mall.common.modules.invoicing.InvoicingWarehouseBase;
|
||||||
@ -67,6 +65,7 @@ import com.suisung.mall.shop.store.service.*;
|
|||||||
import com.suisung.mall.shop.user.service.ShopUserFavoritesStoreService;
|
import com.suisung.mall.shop.user.service.ShopUserFavoritesStoreService;
|
||||||
import com.suisung.mall.shop.wechat.service.WxQrCodeService;
|
import com.suisung.mall.shop.wechat.service.WxQrCodeService;
|
||||||
import io.seata.spring.annotation.GlobalTransactional;
|
import io.seata.spring.annotation.GlobalTransactional;
|
||||||
|
import org.apache.poi.ss.formula.functions.T;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@ -3657,5 +3656,70 @@ public class ShopStoreBaseServiceImpl extends BaseServiceImpl<ShopStoreBaseMappe
|
|||||||
row.put("store_latitude", gps.getWgLat());
|
row.put("store_latitude", gps.getWgLat());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void fixStoreDataByShopBaseProductCategory(List<ShopBaseProductCategory> rows) {
|
||||||
|
if (CollUtil.isNotEmpty(rows)) {
|
||||||
|
List<Integer> store_ids = rows.stream().map(s -> Convert.toInt(s.getStore_id())).distinct().collect(Collectors.toList());
|
||||||
|
List<Map> store_rows = gets(store_ids);
|
||||||
|
|
||||||
|
for (ShopBaseProductCategory row : rows) {
|
||||||
|
Integer store_id = Convert.toInt(row.getStore_id());
|
||||||
|
Optional<Map> storeOpl = store_rows.stream().filter(s -> ObjectUtil.equal(store_id, Convert.toInt(s.get("store_id")))).findFirst();
|
||||||
|
|
||||||
|
if (storeOpl.isPresent()) {
|
||||||
|
Map store = storeOpl.get();
|
||||||
|
row.setStore_name((String) store.get("store_name"));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
row.setStore_name("(无)");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ShopBaseProductType> fixStoreDataShopBaseProductType(List<ShopBaseProductType> rows) {
|
||||||
|
if (CollUtil.isNotEmpty(rows)) {
|
||||||
|
List<ShopBaseProductType> shopBaseProductTypes= rows;
|
||||||
|
List<Integer> store_ids = shopBaseProductTypes.stream().map(s -> Convert.toInt(s.getStore_id())).distinct().collect(Collectors.toList());
|
||||||
|
List<Map> store_rows = gets(store_ids);
|
||||||
|
for (ShopBaseProductType row : shopBaseProductTypes) {
|
||||||
|
Integer store_id = Convert.toInt(row.getStore_id());
|
||||||
|
Optional<Map> storeOpl = store_rows.stream().filter(s -> ObjectUtil.equal(store_id, Convert.toInt(s.get("store_id")))).findFirst();
|
||||||
|
|
||||||
|
if (storeOpl.isPresent()) {
|
||||||
|
Map store = storeOpl.get();
|
||||||
|
row.setStore_name((String) store.get("store_name"));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
row.setStore_name("(无)");
|
||||||
|
}
|
||||||
|
return shopBaseProductTypes;
|
||||||
|
}
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ShopBaseProductSpec> fixStoreDataShopBaseProductSpec(List<ShopBaseProductSpec> rows) {
|
||||||
|
if (CollUtil.isNotEmpty(rows)) {
|
||||||
|
List<ShopBaseProductSpec> shopBaseProductSpecs= rows;
|
||||||
|
List<Integer> store_ids = shopBaseProductSpecs.stream().map(s -> Convert.toInt(s.getStore_id())).distinct().collect(Collectors.toList());
|
||||||
|
List<Map> store_rows = gets(store_ids);
|
||||||
|
for (ShopBaseProductSpec row : shopBaseProductSpecs) {
|
||||||
|
Integer store_id = Convert.toInt(row.getStore_id());
|
||||||
|
Optional<Map> storeOpl = store_rows.stream().filter(s -> ObjectUtil.equal(store_id, Convert.toInt(s.get("store_id")))).findFirst();
|
||||||
|
|
||||||
|
if (storeOpl.isPresent()) {
|
||||||
|
Map store = storeOpl.get();
|
||||||
|
row.setStore_name((String) store.get("store_name"));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
row.setStore_name("(无)");
|
||||||
|
}
|
||||||
|
return shopBaseProductSpecs;
|
||||||
|
}
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue
Block a user