Merge remote-tracking branch 'origin/main'
This commit is contained in:
commit
ad7d2a8bde
@ -97,6 +97,8 @@ public class SxGoosModel {
|
|||||||
@ApiModelProperty("商品图片库")
|
@ApiModelProperty("商品图片库")
|
||||||
private List<ProductImage> product_images;
|
private List<ProductImage> product_images;
|
||||||
|
|
||||||
|
@ApiModelProperty("是否特价商品,0否,1是")
|
||||||
|
private String isSpecial;
|
||||||
|
|
||||||
@ApiModelProperty("商品详情")
|
@ApiModelProperty("商品详情")
|
||||||
private List<PromotionDetail> promotion_detail;
|
private List<PromotionDetail> promotion_detail;
|
||||||
|
|||||||
@ -172,7 +172,7 @@ public abstract class SxDataAbstService {
|
|||||||
sxGoosModel.setProduct_images(new ArrayList<>());//介绍图片 todo
|
sxGoosModel.setProduct_images(new ArrayList<>());//介绍图片 todo
|
||||||
|
|
||||||
sxGoosModel.setPromotion_detail(new ArrayList<>());//活动列表 todo
|
sxGoosModel.setPromotion_detail(new ArrayList<>());//活动列表 todo
|
||||||
|
sxGoosModel.setIsSpecial("0");
|
||||||
SxGoosModel finalSxGoosModel = sxGoosModel;
|
SxGoosModel finalSxGoosModel = sxGoosModel;
|
||||||
specPriceDtoList.forEach(m->{
|
specPriceDtoList.forEach(m->{
|
||||||
if(sxSyncGood.getItem_no().equals(m.getItemNo())){
|
if(sxSyncGood.getItem_no().equals(m.getItemNo())){
|
||||||
@ -184,6 +184,7 @@ public abstract class SxDataAbstService {
|
|||||||
if(type.equals("2")){
|
if(type.equals("2")){
|
||||||
finalSxGoosModel.setPrice(finalSxGoosModel.getPrice().multiply(m.getDiscount()));
|
finalSxGoosModel.setPrice(finalSxGoosModel.getPrice().multiply(m.getDiscount()));
|
||||||
}
|
}
|
||||||
|
finalSxGoosModel.setIsSpecial("1");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
sxGoosModelList.add(sxGoosModel);
|
sxGoosModelList.add(sxGoosModel);
|
||||||
|
|||||||
@ -142,6 +142,9 @@ public class ShopProductBase implements Serializable{
|
|||||||
@TableField(updateStrategy=NOT_EMPTY)
|
@TableField(updateStrategy=NOT_EMPTY)
|
||||||
private BigDecimal shop_weight;
|
private BigDecimal shop_weight;
|
||||||
|
|
||||||
|
@ApiModelProperty("是否特价商品,0否,1是")
|
||||||
|
private String is_special;
|
||||||
|
|
||||||
@ApiModelProperty(value = "单价")
|
@ApiModelProperty(value = "单价")
|
||||||
@TableField(updateStrategy=NOT_EMPTY)
|
@TableField(updateStrategy=NOT_EMPTY)
|
||||||
private BigDecimal unit_price;
|
private BigDecimal unit_price;
|
||||||
|
|||||||
@ -1,9 +1,11 @@
|
|||||||
package com.suisung.mall.shop.base.controller.admin;
|
package com.suisung.mall.shop.base.controller.admin;
|
||||||
|
|
||||||
|
import cn.hutool.core.convert.Convert;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
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.ShopBaseProductBrand;
|
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.service.impl.BaseControllerImpl;
|
||||||
import com.suisung.mall.common.utils.CheckUtil;
|
import com.suisung.mall.common.utils.CheckUtil;
|
||||||
import com.suisung.mall.shop.base.service.ShopBaseProductBrandService;
|
import com.suisung.mall.shop.base.service.ShopBaseProductBrandService;
|
||||||
@ -17,6 +19,8 @@ import org.springframework.web.bind.annotation.RestController;
|
|||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
import static com.suisung.mall.common.utils.ContextUtil.getCurrentUser;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* 品牌表 - 540 前端控制器
|
* 品牌表 - 540 前端控制器
|
||||||
@ -54,6 +58,8 @@ public class ShopBaseProductBrandController extends BaseControllerImpl {
|
|||||||
@RequestMapping(value = "/brands", method = RequestMethod.GET)
|
@RequestMapping(value = "/brands", method = RequestMethod.GET)
|
||||||
public CommonResult getList(@RequestParam(name = "brand_name", required = false) String brand_name) {
|
public CommonResult getList(@RequestParam(name = "brand_name", required = false) String brand_name) {
|
||||||
QueryWrapper<ShopBaseProductBrand> queryWrapper = new QueryWrapper<>();
|
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.eq("brand_enable", 1);
|
||||||
queryWrapper.orderByAsc("brand_id");
|
queryWrapper.orderByAsc("brand_id");
|
||||||
if (StrUtil.isNotEmpty(brand_name)) {
|
if (StrUtil.isNotEmpty(brand_name)) {
|
||||||
@ -65,6 +71,8 @@ public class ShopBaseProductBrandController extends BaseControllerImpl {
|
|||||||
@ApiOperation(value = "品牌表 - 540-编辑", notes = "品牌表 - 540-编辑")
|
@ApiOperation(value = "品牌表 - 540-编辑", notes = "品牌表 - 540-编辑")
|
||||||
@RequestMapping(value = "/edit", method = RequestMethod.POST)
|
@RequestMapping(value = "/edit", method = RequestMethod.POST)
|
||||||
public CommonResult edit(ShopBaseProductBrand shopBaseProductBrand) {
|
public CommonResult edit(ShopBaseProductBrand shopBaseProductBrand) {
|
||||||
|
Integer store_id = Convert.toInt(getCurrentUser().getStore_id());
|
||||||
|
shopBaseProductBrand.setStore_id(store_id);
|
||||||
return CommonResult.success(shopBaseProductBrandService.saveOrUpdateBrand(shopBaseProductBrand));
|
return CommonResult.success(shopBaseProductBrandService.saveOrUpdateBrand(shopBaseProductBrand));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -100,6 +108,8 @@ public class ShopBaseProductBrandController extends BaseControllerImpl {
|
|||||||
public CommonResult getBrandS() {
|
public CommonResult getBrandS() {
|
||||||
String brand_name = getParameter("brand_name");
|
String brand_name = getParameter("brand_name");
|
||||||
QueryWrapper<ShopBaseProductBrand> queryWrapper = new QueryWrapper<>();
|
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);
|
queryWrapper.like("brand_name", brand_name);
|
||||||
return CommonResult.success(shopBaseProductBrandService.find(queryWrapper));
|
return CommonResult.success(shopBaseProductBrandService.find(queryWrapper));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
package com.suisung.mall.shop.base.controller.admin;
|
package com.suisung.mall.shop.base.controller.admin;
|
||||||
|
|
||||||
|
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;
|
||||||
@ -13,6 +14,8 @@ import org.springframework.web.bind.annotation.RequestMethod;
|
|||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import static com.suisung.mall.common.utils.ContextUtil.getCurrentUser;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* 商品分类表-分类强调区别, 类型强调共性 前端控制器
|
* 商品分类表-分类强调区别, 类型强调共性 前端控制器
|
||||||
@ -60,6 +63,8 @@ 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();
|
||||||
|
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;
|
||||||
@ -82,6 +87,8 @@ 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);
|
||||||
@ -126,6 +133,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());
|
||||||
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());
|
||||||
|
|||||||
@ -79,7 +79,9 @@ public class ShopBaseProductTypeController {
|
|||||||
@ApiOperation(value = "商品类型表-强调共性,类别cat是强调区别.-列表查询", notes = "商品类型表-强调共性,类别cat是强调区别.-列表查询")
|
@ApiOperation(value = "商品类型表-强调共性,类别cat是强调区别.-列表查询", notes = "商品类型表-强调共性,类别cat是强调区别.-列表查询")
|
||||||
@RequestMapping(value = "/lists", method = RequestMethod.GET)
|
@RequestMapping(value = "/lists", method = RequestMethod.GET)
|
||||||
public CommonResult lists() {
|
public CommonResult lists() {
|
||||||
|
Integer store_id = Convert.toInt(getCurrentUser().getStore_id());
|
||||||
QueryWrapper<ShopBaseProductType> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<ShopBaseProductType> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.eq("store_id", store_id);
|
||||||
queryWrapper.orderByAsc("type_id");
|
queryWrapper.orderByAsc("type_id");
|
||||||
return CommonResult.success(shopBaseProductTypeService.find(queryWrapper));
|
return CommonResult.success(shopBaseProductTypeService.find(queryWrapper));
|
||||||
}
|
}
|
||||||
@ -87,7 +89,9 @@ public class ShopBaseProductTypeController {
|
|||||||
@ApiOperation(value = "商品类型表-强调共性,类别cat是强调区别.-列表查询", notes = "商品类型表-强调共性,类别cat是强调区别.-列表查询")
|
@ApiOperation(value = "商品类型表-强调共性,类别cat是强调区别.-列表查询", notes = "商品类型表-强调共性,类别cat是强调区别.-列表查询")
|
||||||
@RequestMapping(value = "/getLists", method = RequestMethod.GET)
|
@RequestMapping(value = "/getLists", method = RequestMethod.GET)
|
||||||
public CommonResult getLists() {
|
public CommonResult getLists() {
|
||||||
|
Integer store_id = Convert.toInt(getCurrentUser().getStore_id());
|
||||||
QueryWrapper<ShopBaseProductType> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<ShopBaseProductType> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.eq("store_id", store_id);
|
||||||
queryWrapper.orderByAsc("type_id");
|
queryWrapper.orderByAsc("type_id");
|
||||||
queryWrapper.eq("type_is_draft", 0);
|
queryWrapper.eq("type_is_draft", 0);
|
||||||
return CommonResult.success(shopBaseProductTypeService.find(queryWrapper));
|
return CommonResult.success(shopBaseProductTypeService.find(queryWrapper));
|
||||||
@ -105,6 +109,8 @@ public class ShopBaseProductTypeController {
|
|||||||
public CommonResult edit(ShopBaseProductType shopBaseProductType) {
|
public CommonResult edit(ShopBaseProductType shopBaseProductType) {
|
||||||
String type_spec_ids = shopBaseProductType.getType_spec_ids();
|
String type_spec_ids = shopBaseProductType.getType_spec_ids();
|
||||||
|
|
||||||
|
Integer store_id = Convert.toInt(getCurrentUser().getStore_id());
|
||||||
|
shopBaseProductType.setStore_id(store_id);
|
||||||
//读取当前已经存在的type_id
|
//读取当前已经存在的type_id
|
||||||
Integer type_id = shopBaseProductType.getType_id();
|
Integer type_id = shopBaseProductType.getType_id();
|
||||||
|
|
||||||
|
|||||||
@ -28,7 +28,8 @@ public interface ShopBaseProductCategoryMapper extends BaseMapper<ShopBaseProduc
|
|||||||
List<Integer> getParentCategory(@Param("category_id") Integer category_id);
|
List<Integer> getParentCategory(@Param("category_id") Integer category_id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询商品分类列表
|
* 根据商店id查询商品分类列表
|
||||||
|
* @param storeId 商店id
|
||||||
*/
|
*/
|
||||||
List<ShopBaseProductCategory> selectCategoryList();
|
List<ShopBaseProductCategory> selectCategoryList(@Param("storeId") String storeId);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -52,8 +52,8 @@ public class ShopBaseProductBrandServiceImpl extends BaseServiceImpl<ShopBasePro
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, List<ShopBaseProductBrand>> brandMap() {
|
public Map<String, List<ShopBaseProductBrand>> brandMap() {
|
||||||
|
Integer store_id = Convert.toInt(getCurrentUser().getStore_id());
|
||||||
List<ShopBaseProductBrand> brands = find(new QueryWrapper<ShopBaseProductBrand>().eq("brand_enable", 1));
|
List<ShopBaseProductBrand> brands = find(new QueryWrapper<ShopBaseProductBrand>().eq("brand_enable", 1).eq("store_id", store_id));
|
||||||
|
|
||||||
if (CollectionUtil.isEmpty(brands)) {
|
if (CollectionUtil.isEmpty(brands)) {
|
||||||
throw new ApiException(I18nUtil._("启用品牌列表为空!"));
|
throw new ApiException(I18nUtil._("启用品牌列表为空!"));
|
||||||
|
|||||||
@ -940,7 +940,7 @@ public class ShopBaseProductCategoryServiceImpl extends BaseServiceImpl<ShopBase
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map lists() {
|
public Map lists() {
|
||||||
List<ShopBaseProductCategory> shopBaseProductCategories = shopBaseProductCategoryMapper.selectCategoryList();
|
List<ShopBaseProductCategory> shopBaseProductCategories = shopBaseProductCategoryMapper.selectCategoryList(getCurrentUser().getStore_id());
|
||||||
Map map = new HashMap(1);
|
Map map = new HashMap(1);
|
||||||
map.put("items", shopBaseProductCategories);
|
map.put("items", shopBaseProductCategories);
|
||||||
return map;
|
return map;
|
||||||
|
|||||||
@ -573,6 +573,7 @@ public abstract class SyncBaseThirdSxAbstract{
|
|||||||
shopProductBase.setProduct_from(1005);// 商品来源(ENUM):1000-发布;1001-天猫;1002-淘宝;1003-阿里巴巴;1004-京东;1005-思迅;
|
shopProductBase.setProduct_from(1005);// 商品来源(ENUM):1000-发布;1001-天猫;1002-淘宝;1003-阿里巴巴;1004-京东;1005-思迅;
|
||||||
shopProductBase.setProduct_add_time(currentDate.getTime());
|
shopProductBase.setProduct_add_time(currentDate.getTime());
|
||||||
shopProductBase.setProduct_unit_price(BigDecimal.valueOf(jsonObj.getDouble("retail_price")));
|
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"))
|
if(ObjectUtil.isNotEmpty(jsonObj.getStr("unit"))&&ObjectUtil.isNotEmpty(jsonObj.getStr("stock"))
|
||||||
&& "KG,kg,公斤".contains(jsonObj.getStr("unit"))){
|
&& "KG,kg,公斤".contains(jsonObj.getStr("unit"))){
|
||||||
|
|||||||
@ -31,6 +31,7 @@
|
|||||||
c.category_name AS `name`,
|
c.category_name AS `name`,
|
||||||
t.type_name AS `type_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
|
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>
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
2
sql/shop/dev/202506014_ddl.sql
Normal file
2
sql/shop/dev/202506014_ddl.sql
Normal 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;
|
||||||
Loading…
Reference in New Issue
Block a user