From 11eb0165ce1091a2bf4dd723135c7de1e1c98bb0 Mon Sep 17 00:00:00 2001
From: liyj <1617420630@qq.com>
Date: Sat, 14 Jun 2025 09:01:22 +0800
Subject: [PATCH 1/4] =?UTF-8?q?=E5=BA=97=E9=93=BA=E6=96=B0=E5=A2=9E?=
=?UTF-8?q?=E5=95=86=E5=BA=97=E6=9D=83=E9=99=90=E6=95=B0=E6=8D=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../admin/ShopBaseProductBrandController.java | 10 ++++++++++
.../admin/ShopBaseProductCategoryController.java | 8 ++++++++
.../admin/ShopBaseProductTypeController.java | 6 ++++++
.../base/mapper/ShopBaseProductCategoryMapper.java | 5 +++--
.../service/impl/ShopBaseProductBrandServiceImpl.java | 4 ++--
.../impl/ShopBaseProductCategoryServiceImpl.java | 2 +-
.../mapper/base/ShopBaseProductCategoryMapper.xml | 1 +
7 files changed, 31 insertions(+), 5 deletions(-)
diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/base/controller/admin/ShopBaseProductBrandController.java b/mall-shop/src/main/java/com/suisung/mall/shop/base/controller/admin/ShopBaseProductBrandController.java
index affc896b..598bb1c2 100644
--- a/mall-shop/src/main/java/com/suisung/mall/shop/base/controller/admin/ShopBaseProductBrandController.java
+++ b/mall-shop/src/main/java/com/suisung/mall/shop/base/controller/admin/ShopBaseProductBrandController.java
@@ -1,9 +1,11 @@
package com.suisung.mall.shop.base.controller.admin;
+import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.suisung.mall.common.api.CommonResult;
import com.suisung.mall.common.modules.base.ShopBaseProductBrand;
+import com.suisung.mall.common.modules.base.ShopBaseProductType;
import com.suisung.mall.common.service.impl.BaseControllerImpl;
import com.suisung.mall.common.utils.CheckUtil;
import com.suisung.mall.shop.base.service.ShopBaseProductBrandService;
@@ -17,6 +19,8 @@ import org.springframework.web.bind.annotation.RestController;
import java.util.Arrays;
+import static com.suisung.mall.common.utils.ContextUtil.getCurrentUser;
+
/**
*
* 品牌表 - 540 前端控制器
@@ -54,6 +58,8 @@ public class ShopBaseProductBrandController extends BaseControllerImpl {
@RequestMapping(value = "/brands", method = RequestMethod.GET)
public CommonResult getList(@RequestParam(name = "brand_name", required = false) String brand_name) {
QueryWrapper queryWrapper = new QueryWrapper<>();
+ Integer store_id = Convert.toInt(getCurrentUser().getStore_id());
+ queryWrapper.eq("store_id", store_id);
queryWrapper.eq("brand_enable", 1);
queryWrapper.orderByAsc("brand_id");
if (StrUtil.isNotEmpty(brand_name)) {
@@ -65,6 +71,8 @@ public class ShopBaseProductBrandController extends BaseControllerImpl {
@ApiOperation(value = "品牌表 - 540-编辑", notes = "品牌表 - 540-编辑")
@RequestMapping(value = "/edit", method = RequestMethod.POST)
public CommonResult edit(ShopBaseProductBrand shopBaseProductBrand) {
+ Integer store_id = Convert.toInt(getCurrentUser().getStore_id());
+ shopBaseProductBrand.setStore_id(store_id);
return CommonResult.success(shopBaseProductBrandService.saveOrUpdateBrand(shopBaseProductBrand));
}
@@ -100,6 +108,8 @@ public class ShopBaseProductBrandController extends BaseControllerImpl {
public CommonResult getBrandS() {
String brand_name = getParameter("brand_name");
QueryWrapper queryWrapper = new QueryWrapper<>();
+ Integer store_id = Convert.toInt(getCurrentUser().getStore_id());
+ queryWrapper.eq("store_id", store_id);
queryWrapper.like("brand_name", brand_name);
return CommonResult.success(shopBaseProductBrandService.find(queryWrapper));
}
diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/base/controller/admin/ShopBaseProductCategoryController.java b/mall-shop/src/main/java/com/suisung/mall/shop/base/controller/admin/ShopBaseProductCategoryController.java
index dde4b34e..c288d60d 100644
--- a/mall-shop/src/main/java/com/suisung/mall/shop/base/controller/admin/ShopBaseProductCategoryController.java
+++ b/mall-shop/src/main/java/com/suisung/mall/shop/base/controller/admin/ShopBaseProductCategoryController.java
@@ -1,5 +1,6 @@
package com.suisung.mall.shop.base.controller.admin;
+import cn.hutool.core.convert.Convert;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.suisung.mall.common.api.CommonResult;
import com.suisung.mall.common.modules.base.ShopBaseProductCategory;
@@ -13,6 +14,8 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
+import static com.suisung.mall.common.utils.ContextUtil.getCurrentUser;
+
/**
*
* 商品分类表-分类强调区别, 类型强调共性 前端控制器
@@ -60,6 +63,8 @@ public class ShopBaseProductCategoryController {
@RequestMapping(value = "/categoryTree", method = RequestMethod.GET)
public CommonResult getList(ShopBaseProductCategory category) {
QueryWrapper queryWrapper = new QueryWrapper<>();
+ String store_id = getCurrentUser().getStore_id();
+ queryWrapper.eq("store_id", store_id);
queryWrapper.eq("category_is_enable", 1);
Integer category_parent_id = category.getCategory_parent_id();
if (category_parent_id == null) category_parent_id = 0;
@@ -82,6 +87,8 @@ public class ShopBaseProductCategoryController {
@ApiOperation(value = "商品分类表-分类强调区别, 类型强调共性-编辑", notes = "商品分类表-分类强调区别, 类型强调共性-编辑")
@RequestMapping(value = "/edit", method = RequestMethod.POST)
public CommonResult edit(ShopBaseProductCategory shopBaseProductCategory) {
+ String store_id = getCurrentUser().getStore_id();
+ shopBaseProductCategory.setStore_id(store_id);
Integer category_id = shopBaseProductCategory.getCategory_id();
if (category_id == null) {
shopBaseProductCategory.setPage_id_pc(0L);
@@ -126,6 +133,7 @@ public class ShopBaseProductCategoryController {
@RequestMapping(value = "/tree", method = {RequestMethod.GET, RequestMethod.POST})
public CommonResult tree(ShopBaseProductCategory category) {
QueryWrapper queryWrapper = new QueryWrapper<>();
+ queryWrapper.eq("store_id", getCurrentUser().getStore_id());
queryWrapper.orderByAsc("category_order");
if (category.getCategory_parent_id() != null) {
queryWrapper.eq("category_parent_id", category.getCategory_parent_id());
diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/base/controller/admin/ShopBaseProductTypeController.java b/mall-shop/src/main/java/com/suisung/mall/shop/base/controller/admin/ShopBaseProductTypeController.java
index 91874bb6..7371cb42 100644
--- a/mall-shop/src/main/java/com/suisung/mall/shop/base/controller/admin/ShopBaseProductTypeController.java
+++ b/mall-shop/src/main/java/com/suisung/mall/shop/base/controller/admin/ShopBaseProductTypeController.java
@@ -79,7 +79,9 @@ public class ShopBaseProductTypeController {
@ApiOperation(value = "商品类型表-强调共性,类别cat是强调区别.-列表查询", notes = "商品类型表-强调共性,类别cat是强调区别.-列表查询")
@RequestMapping(value = "/lists", method = RequestMethod.GET)
public CommonResult lists() {
+ Integer store_id = Convert.toInt(getCurrentUser().getStore_id());
QueryWrapper queryWrapper = new QueryWrapper<>();
+ queryWrapper.eq("store_id", store_id);
queryWrapper.orderByAsc("type_id");
return CommonResult.success(shopBaseProductTypeService.find(queryWrapper));
}
@@ -87,7 +89,9 @@ public class ShopBaseProductTypeController {
@ApiOperation(value = "商品类型表-强调共性,类别cat是强调区别.-列表查询", notes = "商品类型表-强调共性,类别cat是强调区别.-列表查询")
@RequestMapping(value = "/getLists", method = RequestMethod.GET)
public CommonResult getLists() {
+ Integer store_id = Convert.toInt(getCurrentUser().getStore_id());
QueryWrapper queryWrapper = new QueryWrapper<>();
+ queryWrapper.eq("store_id", store_id);
queryWrapper.orderByAsc("type_id");
queryWrapper.eq("type_is_draft", 0);
return CommonResult.success(shopBaseProductTypeService.find(queryWrapper));
@@ -105,6 +109,8 @@ public class ShopBaseProductTypeController {
public CommonResult edit(ShopBaseProductType shopBaseProductType) {
String type_spec_ids = shopBaseProductType.getType_spec_ids();
+ Integer store_id = Convert.toInt(getCurrentUser().getStore_id());
+ shopBaseProductType.setStore_id(store_id);
//读取当前已经存在的type_id
Integer type_id = shopBaseProductType.getType_id();
diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/base/mapper/ShopBaseProductCategoryMapper.java b/mall-shop/src/main/java/com/suisung/mall/shop/base/mapper/ShopBaseProductCategoryMapper.java
index cadac33f..99adbe81 100644
--- a/mall-shop/src/main/java/com/suisung/mall/shop/base/mapper/ShopBaseProductCategoryMapper.java
+++ b/mall-shop/src/main/java/com/suisung/mall/shop/base/mapper/ShopBaseProductCategoryMapper.java
@@ -28,7 +28,8 @@ public interface ShopBaseProductCategoryMapper extends BaseMapper getParentCategory(@Param("category_id") Integer category_id);
/**
- * 查询商品分类列表
+ * 根据商店id查询商品分类列表
+ * @param storeId 商店id
*/
- List selectCategoryList();
+ List selectCategoryList(@Param("storeId") String storeId);
}
diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/base/service/impl/ShopBaseProductBrandServiceImpl.java b/mall-shop/src/main/java/com/suisung/mall/shop/base/service/impl/ShopBaseProductBrandServiceImpl.java
index 3b9213c9..30294a69 100644
--- a/mall-shop/src/main/java/com/suisung/mall/shop/base/service/impl/ShopBaseProductBrandServiceImpl.java
+++ b/mall-shop/src/main/java/com/suisung/mall/shop/base/service/impl/ShopBaseProductBrandServiceImpl.java
@@ -52,8 +52,8 @@ public class ShopBaseProductBrandServiceImpl extends BaseServiceImpl> brandMap() {
-
- List brands = find(new QueryWrapper().eq("brand_enable", 1));
+ Integer store_id = Convert.toInt(getCurrentUser().getStore_id());
+ List brands = find(new QueryWrapper().eq("brand_enable", 1).eq("store_id", store_id));
if (CollectionUtil.isEmpty(brands)) {
throw new ApiException(I18nUtil._("启用品牌列表为空!"));
diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/base/service/impl/ShopBaseProductCategoryServiceImpl.java b/mall-shop/src/main/java/com/suisung/mall/shop/base/service/impl/ShopBaseProductCategoryServiceImpl.java
index 90af0436..6498635a 100644
--- a/mall-shop/src/main/java/com/suisung/mall/shop/base/service/impl/ShopBaseProductCategoryServiceImpl.java
+++ b/mall-shop/src/main/java/com/suisung/mall/shop/base/service/impl/ShopBaseProductCategoryServiceImpl.java
@@ -940,7 +940,7 @@ public class ShopBaseProductCategoryServiceImpl extends BaseServiceImpl shopBaseProductCategories = shopBaseProductCategoryMapper.selectCategoryList();
+ List shopBaseProductCategories = shopBaseProductCategoryMapper.selectCategoryList(getCurrentUser().getStore_id());
Map map = new HashMap(1);
map.put("items", shopBaseProductCategories);
return map;
diff --git a/mall-shop/src/main/resources/mapper/base/ShopBaseProductCategoryMapper.xml b/mall-shop/src/main/resources/mapper/base/ShopBaseProductCategoryMapper.xml
index 8ce1ca4d..9559953b 100644
--- a/mall-shop/src/main/resources/mapper/base/ShopBaseProductCategoryMapper.xml
+++ b/mall-shop/src/main/resources/mapper/base/ShopBaseProductCategoryMapper.xml
@@ -31,6 +31,7 @@
c.category_name AS `name`,
t.type_name AS `type_name`
FROM shop_base_product_category c JOIN shop_base_product_type t ON c.type_id = t.type_id
+ where c.store_id=#{storeId}
From 15024604383a06f7abba982f35da2072ad8bbeeb Mon Sep 17 00:00:00 2001
From: liyj <1617420630@qq.com>
Date: Sat, 14 Jun 2025 16:35:13 +0800
Subject: [PATCH 2/4] =?UTF-8?q?=E5=90=8C=E6=AD=A5=E5=95=86=E5=93=81?=
=?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=89=B9=E4=BB=B7=E5=95=86=E5=93=81=E6=A0=87?=
=?UTF-8?q?=E5=BF=97?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../suisung/mall/common/modules/product/ShopProductBase.java | 3 +++
.../mall/shop/sync/service/impl/SyncBaseThirdSxAbstract.java | 1 +
2 files changed, 4 insertions(+)
diff --git a/mall-common/src/main/java/com/suisung/mall/common/modules/product/ShopProductBase.java b/mall-common/src/main/java/com/suisung/mall/common/modules/product/ShopProductBase.java
index 92ecc307..21edad45 100644
--- a/mall-common/src/main/java/com/suisung/mall/common/modules/product/ShopProductBase.java
+++ b/mall-common/src/main/java/com/suisung/mall/common/modules/product/ShopProductBase.java
@@ -142,6 +142,9 @@ public class ShopProductBase implements Serializable{
@TableField(updateStrategy=NOT_EMPTY)
private BigDecimal shop_weight;
+ @ApiModelProperty("是否特价商品,0否,1是")
+ private String is_special;
+
@ApiModelProperty(value = "单价")
@TableField(updateStrategy=NOT_EMPTY)
private BigDecimal unit_price;
diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/sync/service/impl/SyncBaseThirdSxAbstract.java b/mall-shop/src/main/java/com/suisung/mall/shop/sync/service/impl/SyncBaseThirdSxAbstract.java
index 7bcf6d2e..a683a951 100644
--- a/mall-shop/src/main/java/com/suisung/mall/shop/sync/service/impl/SyncBaseThirdSxAbstract.java
+++ b/mall-shop/src/main/java/com/suisung/mall/shop/sync/service/impl/SyncBaseThirdSxAbstract.java
@@ -573,6 +573,7 @@ public abstract class SyncBaseThirdSxAbstract{
shopProductBase.setProduct_from(1005);// 商品来源(ENUM):1000-发布;1001-天猫;1002-淘宝;1003-阿里巴巴;1004-京东;1005-思迅;
shopProductBase.setProduct_add_time(currentDate.getTime());
shopProductBase.setProduct_unit_price(BigDecimal.valueOf(jsonObj.getDouble("retail_price")));
+ shopProductBase.setIs_special(jsonObj.getStr("isSpecial"));//是否特价商品
//商品总量
if(ObjectUtil.isNotEmpty(jsonObj.getStr("unit"))&&ObjectUtil.isNotEmpty(jsonObj.getStr("stock"))
&& "KG,kg,公斤".contains(jsonObj.getStr("unit"))){
From 68081a180e65fa11b1011de914084ed6e3404e7f Mon Sep 17 00:00:00 2001
From: liyj <1617420630@qq.com>
Date: Sat, 14 Jun 2025 16:36:13 +0800
Subject: [PATCH 3/4] =?UTF-8?q?=E5=90=8C=E6=AD=A5=E5=95=86=E5=93=81?=
=?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=89=B9=E4=BB=B7=E5=95=86=E5=93=81=E6=A0=87?=
=?UTF-8?q?=E5=BF=97sql?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
sql/shop/dev/202506014_ddl.sql | 2 ++
1 file changed, 2 insertions(+)
create mode 100644 sql/shop/dev/202506014_ddl.sql
diff --git a/sql/shop/dev/202506014_ddl.sql b/sql/shop/dev/202506014_ddl.sql
new file mode 100644
index 00000000..45d13dfb
--- /dev/null
+++ b/sql/shop/dev/202506014_ddl.sql
@@ -0,0 +1,2 @@
+alter table shop_product_base add column `is_special` varchar(2) NOT NULL DEFAULT '0' COMMENT '是否特价商品,0否,1是';
+alter table shop_product_base add index `is_special` (`is_special`) USING BTREE;
\ No newline at end of file
From 079685b766f0d142b8ed935fe1760ce8559032d5 Mon Sep 17 00:00:00 2001
From: liyj <1617420630@qq.com>
Date: Sat, 14 Jun 2025 16:37:10 +0800
Subject: [PATCH 4/4] =?UTF-8?q?=E5=AE=A2=E6=88=B7=E7=AB=AF=E5=95=86?=
=?UTF-8?q?=E5=93=81=E5=90=8C=E6=AD=A5=E4=B8=8A=E4=BC=A0cos=E5=92=8C?=
=?UTF-8?q?=E5=88=B7=E6=96=B0=E6=97=B6=E9=97=B4=E6=94=B9=E4=B8=BA=E6=9C=8D?=
=?UTF-8?q?=E5=8A=A1=E5=99=A8=E5=88=B7=E6=96=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
client/src/main/java/com/small/client/dto/SxGoosModel.java | 2 ++
.../com/small/client/service/SxDataAbst/SxDataAbstService.java | 3 ++-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/client/src/main/java/com/small/client/dto/SxGoosModel.java b/client/src/main/java/com/small/client/dto/SxGoosModel.java
index ed570893..a6b56a9d 100644
--- a/client/src/main/java/com/small/client/dto/SxGoosModel.java
+++ b/client/src/main/java/com/small/client/dto/SxGoosModel.java
@@ -97,6 +97,8 @@ public class SxGoosModel {
@ApiModelProperty("商品图片库")
private List product_images;
+ @ApiModelProperty("是否特价商品,0否,1是")
+ private String isSpecial;
@ApiModelProperty("商品详情")
private List promotion_detail;
diff --git a/client/src/main/java/com/small/client/service/SxDataAbst/SxDataAbstService.java b/client/src/main/java/com/small/client/service/SxDataAbst/SxDataAbstService.java
index 9940de9d..3f43eca5 100644
--- a/client/src/main/java/com/small/client/service/SxDataAbst/SxDataAbstService.java
+++ b/client/src/main/java/com/small/client/service/SxDataAbst/SxDataAbstService.java
@@ -172,7 +172,7 @@ public abstract class SxDataAbstService {
sxGoosModel.setProduct_images(new ArrayList<>());//介绍图片 todo
sxGoosModel.setPromotion_detail(new ArrayList<>());//活动列表 todo
-
+ sxGoosModel.setIsSpecial("0");
SxGoosModel finalSxGoosModel = sxGoosModel;
specPriceDtoList.forEach(m->{
if(sxSyncGood.getItem_no().equals(m.getItemNo())){
@@ -184,6 +184,7 @@ public abstract class SxDataAbstService {
if(type.equals("2")){
finalSxGoosModel.setPrice(finalSxGoosModel.getPrice().multiply(m.getDiscount()));
}
+ finalSxGoosModel.setIsSpecial("1");
}
});
sxGoosModelList.add(sxGoosModel);