Merge remote-tracking branch 'origin/main'

This commit is contained in:
Jack 2025-06-14 16:41:53 +08:00
commit ad7d2a8bde
12 changed files with 41 additions and 6 deletions

View File

@ -97,6 +97,8 @@ public class SxGoosModel {
@ApiModelProperty("商品图片库")
private List<ProductImage> product_images;
@ApiModelProperty("是否特价商品,0否1是")
private String isSpecial;
@ApiModelProperty("商品详情")
private List<PromotionDetail> promotion_detail;

View File

@ -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);

View File

@ -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;

View File

@ -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;
/**
* <p>
* 品牌表 - 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<ShopBaseProductBrand> 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<ShopBaseProductBrand> 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));
}

View File

@ -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;
/**
* <p>
* 商品分类表-分类强调区别, 类型强调共性 前端控制器
@ -60,6 +63,8 @@ public class ShopBaseProductCategoryController {
@RequestMapping(value = "/categoryTree", method = RequestMethod.GET)
public CommonResult getList(ShopBaseProductCategory category) {
QueryWrapper<ShopBaseProductCategory> 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<ShopBaseProductCategory> 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());

View File

@ -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<ShopBaseProductType> 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<ShopBaseProductType> 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();

View File

@ -28,7 +28,8 @@ public interface ShopBaseProductCategoryMapper extends BaseMapper<ShopBaseProduc
List<Integer> getParentCategory(@Param("category_id") Integer category_id);
/**
* 查询商品分类列表
* 根据商店id查询商品分类列表
* @param storeId 商店id
*/
List<ShopBaseProductCategory> selectCategoryList();
List<ShopBaseProductCategory> selectCategoryList(@Param("storeId") String storeId);
}

View File

@ -52,8 +52,8 @@ public class ShopBaseProductBrandServiceImpl extends BaseServiceImpl<ShopBasePro
@Override
public Map<String, List<ShopBaseProductBrand>> brandMap() {
List<ShopBaseProductBrand> brands = find(new QueryWrapper<ShopBaseProductBrand>().eq("brand_enable", 1));
Integer store_id = Convert.toInt(getCurrentUser().getStore_id());
List<ShopBaseProductBrand> brands = find(new QueryWrapper<ShopBaseProductBrand>().eq("brand_enable", 1).eq("store_id", store_id));
if (CollectionUtil.isEmpty(brands)) {
throw new ApiException(I18nUtil._("启用品牌列表为空!"));

View File

@ -940,7 +940,7 @@ public class ShopBaseProductCategoryServiceImpl extends BaseServiceImpl<ShopBase
@Override
public Map lists() {
List<ShopBaseProductCategory> shopBaseProductCategories = shopBaseProductCategoryMapper.selectCategoryList();
List<ShopBaseProductCategory> shopBaseProductCategories = shopBaseProductCategoryMapper.selectCategoryList(getCurrentUser().getStore_id());
Map map = new HashMap(1);
map.put("items", shopBaseProductCategories);
return map;

View File

@ -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"))){

View File

@ -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}
</select>
</mapper>

View File

@ -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;