当前位置:网站首页>Business learning of mall commodity module
Business learning of mall commodity module
2022-07-05 21:59:00 【The sea of waves】
Business study related to commodities
First look at the function menu rendering :
Product list function
design sketch
Product classification search box
elementUI The official website is static data , The following is the rendering of the official website ,Cascader Cascade selector
Next , Let me see how dynamic data can be achieved :
The front desk code
<el-form-item label=" Classification of goods :">
<el-cascader
clearable
v-model="selectProductCateValue"
:options="productCateOptions">
</el-cascader>
</el-form-item>
created() {
this.getList();
this.getBrandList();
this.getProductCateList();
},
watch: {
selectProductCateValue: function (newValue) {
if (newValue != null && newValue.length == 2) {
this.listQuery.productCategoryId = newValue[1];
} else {
this.listQuery.productCategoryId = null;
}
}
},
getProductCateList() {
fetchListWithChildren().then(response => {
let list = response.data;
this.productCateOptions = [];
for (let i = 0; i < list.length; i++) {
let children = [];
if (list[i].children != null && list[i].children.length > 0) {
for (let j = 0; j < list[i].children.length; j++) {
children.push({label: list[i].children[j].name, value: list[i].children[j].id});
}
}
this.productCateOptions.push({label: list[i].name, value: list[i].id, children: children});
}
});
},
The data format is as follows :
options: [{
value: 'zhinan',
label: ' guide ',
children: [{
value: 'shejiyuanze',
label: ' Design principles ',
children: [{
value: 'yizhi',
label: ' Agreement '
}, {
value: 'fankui',
label: ' feedback '
}, {
value: 'xiaolv',
label: ' efficiency '
}, {
value: 'kekong',
label: ' controllable '
}]
}]
export function fetchListWithChildren() {
return request({
url:'/productCategory/list/withChildren',
method:'get'
})
}
Background code
PmsProductCategoryController
@Controller
@Api(tags = "PmsProductCategoryController", description = " Commodity classification management ")
@RequestMapping("/productCategory")
public class PmsProductCategoryController {
@ApiOperation(" Query all primary classifications and sub classifications ")
@RequestMapping(value = "/list/withChildren", method = RequestMethod.GET)
@ResponseBody
public CommonResult<List<PmsProductCategoryWithChildrenItem>> listWithChildren() {
List<PmsProductCategoryWithChildrenItem> list = productCategoryService.listWithChildren();
return CommonResult.success(list);
}
}
PmsProductCategoryService
public interface PmsProductCategoryService {
/** * Get commodity classification in hierarchical form */
List<PmsProductCategoryWithChildrenItem> listWithChildren();
}
PmsProductCategoryServiceImpl
public class PmsProductCategoryServiceImpl implements PmsProductCategoryService {
@Override
public List<PmsProductCategoryWithChildrenItem> listWithChildren() {
return productCategoryDao.listWithChildren();
}
}
PmsProductCategoryDao
public interface PmsProductCategoryDao {
/** * Get the commodity classification and its sub classifications */
List<PmsProductCategoryWithChildrenItem> listWithChildren();
}
PmsProductCategoryDao.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.macro.mall.dao.PmsProductCategoryDao">
<resultMap id="listWithChildrenMap" type="com.macro.mall.dto.PmsProductCategoryWithChildrenItem" extends="com.macro.mall.mapper.PmsProductCategoryMapper.BaseResultMap">
<collection property="children" resultMap="com.macro.mall.mapper.PmsProductCategoryMapper.BaseResultMap" columnPrefix="child_"></collection>
</resultMap>
<select id="listWithChildren" resultMap="listWithChildrenMap">
select
c1.id,
c1.name,
c2.id child_id,
c2.name child_name
from pms_product_category c1 left join pms_product_category c2 on c1.id = c2.parent_id
where c1.parent_id = 0
</select>
</mapper>
pms_product_category.sql
select
c1.id,
c1.name,
c2.id child_id,
c2.name child_name
from pms_product_category c1 left join pms_product_category c2 on c1.id = c2.parent_id
where c1.parent_id = 0;
+----+----------+----------+------------+
| id | name | child_id | child_name |
+----+----------+----------+------------+
| 1 | clothing | 7 | coat |
| 1 | clothing | 8 | T T-shirt |
| 1 | clothing | 9 | Casual pants |
| 1 | clothing | 10 | A pair of jeans |
| 1 | clothing | 11 | shirt |
| 1 | clothing | 29 | Men's Shoes |
| 2 | Mobile phone digital | 19 | Mobile communication |
| 2 | Mobile phone digital | 30 | Mobile Accessories |
| 2 | Mobile phone digital | 31 | Photographing |
| 2 | Mobile phone digital | 32 | Video entertainment |
| 2 | Mobile phone digital | 33 | Digital accessories |
| 2 | Mobile phone digital | 34 | Smart devices |
| 3 | Household appliances | 35 | TV |
| 3 | Household appliances | 36 | Air conditioner |
| 3 | Household appliances | 37 | Washing machine |
| 3 | Household appliances | 38 | The refrigerator |
| 3 | Household appliances | 39 | Kitchen and bathroom power |
| 3 | Household appliances | 40 | Kitchen light |
| 3 | Household appliances | 41 | Living appliances |
| 3 | Household appliances | 42 | To protect your health |
| 4 | Furniture and home decoration | 43 | Kitchen and bathroom |
| 4 | Furniture and home decoration | 44 | lighting |
| 4 | Furniture and home decoration | 45 | Hardware tools |
| 4 | Furniture and home decoration | 46 | Bedroom furniture |
| 4 | Furniture and home decoration | 47 | Living room furniture |
| 5 | Automobile | 48 | Brand new vehicle |
| 5 | Automobile | 49 | Car electrical appliances |
| 5 | Automobile | 50 | Maintenance |
| 5 | Automobile | 51 | Car decoration |
+----+----------+----------+------------+
Product pictures in the data list , label ,SKU stock
The front desk code
<el-table-column label=" Commodity images " width="120" align="center">
<template slot-scope="scope"><img style="height: 80px" :src="scope.row.pic"></template>
</el-table-column>
<el-table-column label=" Name of commodity " align="center">
<template slot-scope="scope">
<p>{
{scope.row.name}}</p>
<p> brand :{
{scope.row.brandName}}</p>
</template>
</el-table-column>
<el-table-column label=" Price / Article No " width="120" align="center">
<template slot-scope="scope">
<p> Price :¥{
{scope.row.price}}</p>
<p> Article No :{
{scope.row.productSn}}</p>
</template>
</el-table-column>
<el-table-column label=" label " width="140" align="center">
<template slot-scope="scope">
<p> shelves :
<el-switch
@change="handlePublishStatusChange(scope.$index, scope.row)"
:active-value="1"
:inactive-value="0"
v-model="scope.row.publishStatus">
</el-switch>
</p>
<p> New product :
<el-switch
@change="handleNewStatusChange(scope.$index, scope.row)"
:active-value="1"
:inactive-value="0"
v-model="scope.row.newStatus">
</el-switch>
</p>
<p> recommend :
<el-switch
@change="handleRecommendStatusChange(scope.$index, scope.row)"
:active-value="1"
:inactive-value="0"
v-model="scope.row.recommandStatus">
</el-switch>
</p>
</template>
</el-table-column>
<el-table-column label=" Sort " width="100" align="center">
<template slot-scope="scope">{
{scope.row.sort}}</template>
</el-table-column>
<el-table-column label="SKU stock " width="100" align="center">
<template slot-scope="scope">
<el-button type="primary" icon="el-icon-edit" @click="handleShowSkuEditDialog(scope.$index, scope.row)" circle></el-button>
</template>
</el-table-column>
// Query all
getList() {
this.listLoading = true;
fetchList(this.listQuery).then(response => {
this.listLoading = false;
this.list = response.data.list;
this.total = response.data.total;
});
},
// In the label , Update of launch status , Support single and batch modification
handlePublishStatusChange(index, row) {
let ids = [];
ids.push(row.id);
this.updatePublishStatus(row.publishStatus, ids);
},
pdatePublishStatus(publishStatus, ids) {
let params = new URLSearchParams();
params.append('ids', ids);
params.append('publishStatus', publishStatus);
updatePublishStatus(params).then(response => {
this.$message({
message: ' Modification successful ',
type: 'success',
duration: 1000
});
});
},
// SKU Popup , And query information
handleShowSkuEditDialog(index,row){
this.editSkuInfo.dialogVisible=true;
this.editSkuInfo.productId=row.id;
this.editSkuInfo.productSn=row.productSn;
this.editSkuInfo.productAttributeCategoryId = row.productAttributeCategoryId;
this.editSkuInfo.keyword=null;
fetchSkuStockList(row.id,{
keyword:this.editSkuInfo.keyword}).then(response=>{
this.editSkuInfo.stockList=response.data;
});
if(row.productAttributeCategoryId!=null){
fetchProductAttrList(row.productAttributeCategoryId,{
type:0}).then(response=>{
this.editSkuInfo.productAttr=response.data.list;
});
}
},
export function fetchList(params) {
return request({
url:'/product/list',
method:'get',
params:params
})
}
export function updatePublishStatus(params) {
return request({
url:'/product/update/publishStatus',
method:'post',
params:params
})
}
export function fetchList(pid,params) {
return request({
url:'/sku/'+pid,
method:'get',
params:params
})
}
label This function corresponds to Element in Switch switch , Than a simple button , It's much better , Friendly user interface , It's still very important ( Minimum , Your own products can be sold more expensive , There is no problem )
<!-- binding v-model To a Boolean Variable of type . have access to active-color Properties and inactive-color Property to set the background color of the switch .-->
<el-switch
v-model="value"
active-color="#13ce66"
inactive-color="#ff4949">
</el-switch>
<script>
export default {
data() {
return {
value: true
}
}
};
</script>
- SPU(Standard Product Unit ): It refers to the standard commodity unit , The smallest unit of commodity information aggregation , It's a set of reusable 、 A collection of easily retrievable standardized information , This set describes the characteristics of a commodity ;
- SKU(Stock Keeping Unit): A unit of stock , It is the smallest inventory unit that is physically indivisible .
for instance : For example, there is a mobile phone product called Xiaomi 8, millet 8 There are different properties , For example, it has black and blue , Yes 32G and 64G Version of . here millet 8
It's just one. SPU, and millet 8 black 64G
It's just one. SKU. Excerpt from mall-learning
Background code
PmsProductController
public class PmsProductController {
@ApiOperation(" Query products ")
@RequestMapping(value = "/list", method = RequestMethod.GET)
@ResponseBody
public CommonResult<CommonPage<PmsProduct>> getList(PmsProductQueryParam productQueryParam,
@RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum) {
List<PmsProduct> productList = productService.list(productQueryParam, pageSize, pageNum);
return CommonResult.success(CommonPage.restPage(productList));
}
@ApiOperation(" Batch loading and unloading ")
@RequestMapping(value = "/update/publishStatus", method = RequestMethod.POST)
@ResponseBody
public CommonResult updatePublishStatus(@RequestParam("ids") List<Long> ids,
@RequestParam("publishStatus") Integer publishStatus) {
int count = productService.updatePublishStatus(ids, publishStatus);
if (count > 0) {
return CommonResult.success(count);
} else {
return CommonResult.failed();
}
}
}
PmsProductService
public interface PmsProductService {
/** * Search products by page */
List<PmsProduct> list(PmsProductQueryParam productQueryParam, Integer pageSize, Integer pageNum);
}
/** * Batch modify the status of goods on the shelves */
int updatePublishStatus(List<Long> ids, Integer publishStatus);
}
PmsProductService
public class PmsProductServiceImpl implements PmsProductService {
@Override
public List<PmsProduct> list(PmsProductQueryParam productQueryParam, Integer pageSize, Integer pageNum) {
PageHelper.startPage(pageNum, pageSize);
PmsProductExample productExample = new PmsProductExample();
PmsProductExample.Criteria criteria = productExample.createCriteria();
criteria.andDeleteStatusEqualTo(0);
if (productQueryParam.getPublishStatus() != null) {
criteria.andPublishStatusEqualTo(productQueryParam.getPublishStatus());
}
if (productQueryParam.getVerifyStatus() != null) {
criteria.andVerifyStatusEqualTo(productQueryParam.getVerifyStatus());
}
if (!StringUtils.isEmpty(productQueryParam.getKeyword())) {
criteria.andNameLike("%" + productQueryParam.getKeyword() + "%");
}
if (!StringUtils.isEmpty(productQueryParam.getProductSn())) {
criteria.andProductSnEqualTo(productQueryParam.getProductSn());
}
if (productQueryParam.getBrandId() != null) {
criteria.andBrandIdEqualTo(productQueryParam.getBrandId());
}
if (productQueryParam.getProductCategoryId() != null) {
criteria.andProductCategoryIdEqualTo(productQueryParam.getProductCategoryId());
}
return productMapper.selectByExample(productExample);
}
@Override
public int updatePublishStatus(List<Long> ids, Integer publishStatus) {
PmsProduct record = new PmsProduct();
record.setPublishStatus(publishStatus);
PmsProductExample example = new PmsProductExample();
example.createCriteria().andIdIn(ids);
return productMapper.updateByExampleSelective(record, example);
}
}
PmsSkuStockController
@Api(tags = "PmsSkuStockController", description = "sku Commodity inventory management ")
@RequestMapping("/sku")
public class PmsSkuStockController {
@Autowired
private PmsSkuStockService skuStockService;
@ApiOperation(" Fuzzy search according to product number and number sku stock ")
@RequestMapping(value = "/{pid}", method = RequestMethod.GET)
@ResponseBody
public CommonResult<List<PmsSkuStock>> getList(@PathVariable Long pid, @RequestParam(value = "keyword",required = false) String keyword) {
List<PmsSkuStock> skuStockList = skuStockService.getList(pid, keyword);
return CommonResult.success(skuStockList);
}
}
PmsSkuStockService
public interface PmsSkuStockService {
/** * According to product id and skuCode Fuzzy search */
List<PmsSkuStock> getList(Long pid, String keyword);
}
PmsSkuStockServiceImpl
public class PmsSkuStockServiceImpl implements PmsSkuStockService {
@Override
public List<PmsSkuStock> getList(Long pid, String keyword) {
PmsSkuStockExample example = new PmsSkuStockExample();
PmsSkuStockExample.Criteria criteria = example.createCriteria().andProductIdEqualTo(pid);
if (!StringUtils.isEmpty(keyword)) {
criteria.andSkuCodeLike("%" + keyword + "%");
}
return skuStockMapper.selectByExample(example);
}
}
Add product features
design sketch
First step Fill in the product information
The second step Fill in the product promotion
The third step Fill in the product properties
Step four Choose product Association
Let's take a look at the effect of this timeline as a whole , Each node introduces a component , Take a look at the code :
The front desk code
<el-card class="form-container" shadow="never">
<el-steps :active="active" finish-status="success" align-center>
<el-step title=" Fill in the product information "></el-step>
<el-step title=" Fill in the product promotion "></el-step>
<el-step title=" Fill in the product properties "></el-step>
<el-step title=" Choose product Association "></el-step>
</el-steps>
<product-info-detail
v-show="showStatus[0]"
v-model="productParam"
:is-edit="isEdit"
@nextStep="nextStep">
</product-info-detail>
<product-sale-detail
v-show="showStatus[1]"
v-model="productParam"
:is-edit="isEdit"
@nextStep="nextStep"
@prevStep="prevStep">
</product-sale-detail>
<product-attr-detail
v-show="showStatus[2]"
v-model="productParam"
:is-edit="isEdit"
@nextStep="nextStep"
@prevStep="prevStep">
</product-attr-detail>
<product-relation-detail
v-show="showStatus[3]"
v-model="productParam"
:is-edit="isEdit"
@prevStep="prevStep"
@finishCommit="finishCommit">
</product-relation-detail>
</el-card>
export default {
name: 'ProductDetail',
components: {ProductInfoDetail, ProductSaleDetail, ProductAttrDetail, ProductRelationDetail},
props: {
isEdit: {
type: Boolean,
default: false
}
},
import ProductInfoDetail from './ProductInfoDetail';
import ProductSaleDetail from './ProductSaleDetail';
import ProductAttrDetail from './ProductAttrDetail';
import ProductRelationDetail from './ProductRelationDetail';
The custom labels are product-info-detail , product-sale-detail,product-attr-detail,product-relation-detail , Allow capitalization , however “-” The label cannot be removed , After removal, it cannot be displayed normally , No specific rules can be found on the Internet , There are students who know , Please leave a message .
The default data information of these four nodes is ProductDetail On the page , It is just displayed in four pages , The last save , The method called is also here .
<!--ProductDetail page -->
<product-relation-detail
v-show="showStatus[3]"
v-model="productParam"
:is-edit="isEdit"
@prevStep="prevStep"
@finishCommit="finishCommit">
</product-relation-detail>
<!--ProductRelationDetail page -->
<el-form-item style="text-align: center">
<el-button size="medium" @click="handlePrev"> The previous step , Fill in the product properties </el-button>
<el-button type="primary" size="medium" @click="handleFinishCommit"> complete , Submit goods </el-button>
</el-form-item>
handleFinishCommit(){
this.$emit('finishCommit',this.isEdit);
}
<el-form-item label=" Related topics :">
<el-transfer
style="display: inline-block"
filterable
:filter-method="filterMethod"
filter-placeholder=" Please enter the topic name "
v-model="selectSubject"
:titles="subjectTitles"
:data="subjectList">
</el-transfer>
</el-form-item>
<el-form-item label=" Association optimization :">
<el-transfer
style="display: inline-block"
filterable
:filter-method="filterMethod"
filter-placeholder=" Please enter the preferred name "
v-model="selectPrefrenceArea"
:titles="prefrenceAreaTitles"
:data="prefrenceAreaList">
</el-transfer>
</el-form-item>
Background code
PmsProductController
@Controller
@Api(tags = "PmsProductController", description = " Commodity management ")
@RequestMapping("/product")
public class PmsProductController {
@Autowired
private PmsProductService productService;
@ApiOperation(" Create merchandise ")
@RequestMapping(value = "/create", method = RequestMethod.POST)
@ResponseBody
public CommonResult create(@RequestBody PmsProductParam productParam, BindingResult bindingResult) {
int count = productService.create(productParam);
if (count > 0) {
return CommonResult.success(count);
} else {
return CommonResult.failed();
}
}
@ApiOperation(" According to the goods id Get product editing information ")
@RequestMapping(value = "/updateInfo/{id}", method = RequestMethod.GET)
@ResponseBody
public CommonResult<PmsProductResult> getUpdateInfo(@PathVariable Long id) {
PmsProductResult productResult = productService.getUpdateInfo(id);
return CommonResult.success(productResult);
}
@ApiOperation(" Update products ")
@RequestMapping(value = "/update/{id}", method = RequestMethod.POST)
@ResponseBody
public CommonResult update(@PathVariable Long id, @RequestBody PmsProductParam productParam, BindingResult bindingResult) {
int count = productService.update(id, productParam);
if (count > 0) {
return CommonResult.success(count);
} else {
return CommonResult.failed();
}
}
PmsProductService
public interface PmsProductService {
/** * Create merchandise */
@Transactional(isolation = Isolation.DEFAULT,propagation = Propagation.REQUIRED)
int create(PmsProductParam productParam);
/** * Get updated information according to the item number */
PmsProductResult getUpdateInfo(Long id);
/** * Update products */
@Transactional
int update(Long id, PmsProductParam productParam);
}
PmsProductServiceImpl
@Override
public int create(PmsProductParam productParam) {
int count;
// Create merchandise
PmsProduct product = productParam;
product.setId(null);
productMapper.insertSelective(product);
// Set the price according to the promotion type : Member price 、 Step price 、 Full price reduction
Long productId = product.getId();
// Member price
relateAndInsertList(memberPriceDao, productParam.getMemberPriceList(), productId);
// Step price
relateAndInsertList(productLadderDao, productParam.getProductLadderList(), productId);
// Full price reduction
relateAndInsertList(productFullReductionDao, productParam.getProductFullReductionList(), productId);
// Handle sku The coding
handleSkuStockCode(productParam.getSkuStockList(),productId);
// add to sku Stock information
relateAndInsertList(skuStockDao, productParam.getSkuStockList(), productId);
// Add product parameters , Add custom product specifications
relateAndInsertList(productAttributeValueDao, productParam.getProductAttributeValueList(), productId);
// Related topics
relateAndInsertList(subjectProductRelationDao, productParam.getSubjectProductRelationList(), productId);
// Association optimization
relateAndInsertList(prefrenceAreaProductRelationDao, productParam.getPrefrenceAreaProductRelationList(), productId);
count = 1;
return count;
}
@Override
public int update(Long id, PmsProductParam productParam) {
int count;
// Update product information
PmsProduct product = productParam;
product.setId(id);
productMapper.updateByPrimaryKeySelective(product);
// Member price
PmsMemberPriceExample pmsMemberPriceExample = new PmsMemberPriceExample();
pmsMemberPriceExample.createCriteria().andProductIdEqualTo(id);
memberPriceMapper.deleteByExample(pmsMemberPriceExample);
relateAndInsertList(memberPriceDao, productParam.getMemberPriceList(), id);
// Step price
PmsProductLadderExample ladderExample = new PmsProductLadderExample();
ladderExample.createCriteria().andProductIdEqualTo(id);
productLadderMapper.deleteByExample(ladderExample);
relateAndInsertList(productLadderDao, productParam.getProductLadderList(), id);
// Full price reduction
PmsProductFullReductionExample fullReductionExample = new PmsProductFullReductionExample();
fullReductionExample.createCriteria().andProductIdEqualTo(id);
productFullReductionMapper.deleteByExample(fullReductionExample);
relateAndInsertList(productFullReductionDao, productParam.getProductFullReductionList(), id);
// modify sku Stock information
handleUpdateSkuStockList(id, productParam);
// Modify product parameters , Add custom product specifications
PmsProductAttributeValueExample productAttributeValueExample = new PmsProductAttributeValueExample();
productAttributeValueExample.createCriteria().andProductIdEqualTo(id);
productAttributeValueMapper.deleteByExample(productAttributeValueExample);
relateAndInsertList(productAttributeValueDao, productParam.getProductAttributeValueList(), id);
// Related topics
CmsSubjectProductRelationExample subjectProductRelationExample = new CmsSubjectProductRelationExample();
subjectProductRelationExample.createCriteria().andProductIdEqualTo(id);
subjectProductRelationMapper.deleteByExample(subjectProductRelationExample);
relateAndInsertList(subjectProductRelationDao, productParam.getSubjectProductRelationList(), id);
// Association optimization
CmsPrefrenceAreaProductRelationExample prefrenceAreaExample = new CmsPrefrenceAreaProductRelationExample();
prefrenceAreaExample.createCriteria().andProductIdEqualTo(id);
prefrenceAreaProductRelationMapper.deleteByExample(prefrenceAreaExample);
relateAndInsertList(prefrenceAreaProductRelationDao, productParam.getPrefrenceAreaProductRelationList(), id);
count = 1;
return count;
}
/** * Create and insert relational tables * * @param dao It can be operated dao * @param dataList The data to be inserted * @param productId Building relationships id */
private void relateAndInsertList(Object dao, List dataList, Long productId) {
try {
if (CollectionUtils.isEmpty(dataList)) return;
for (Object item : dataList) {
Method setId = item.getClass().getMethod("setId", Long.class);
setId.invoke(item, (Long) null);
Method setProductId = item.getClass().getMethod("setProductId", Long.class);
setProductId.invoke(item, productId);
}
Method insertList = dao.getClass().getMethod("insertList", List.class);
insertList.invoke(dao, dataList);
} catch (Exception e) {
LOGGER.warn(" Error creating product :{}", e.getMessage());
throw new RuntimeException(e.getMessage());
}
}
PmsProductParam
@Data
@EqualsAndHashCode(callSuper = false)
public class PmsProductParam extends PmsProduct{
@ApiModelProperty(" Commodity ladder price setting ")
private List<PmsProductLadder> productLadderList;
@ApiModelProperty(" Price setting for full reduction of goods ")
private List<PmsProductFullReduction> productFullReductionList;
@ApiModelProperty(" Commodity member price setting ")
private List<PmsMemberPrice> memberPriceList;
@ApiModelProperty(" Commodity sku Stock information ")
private List<PmsSkuStock> skuStockList;
@ApiModelProperty(" Product parameters and custom specification attributes ")
private List<PmsProductAttributeValue> productAttributeValueList;
@ApiModelProperty(" Topic and commodity relations ")
private List<CmsSubjectProductRelation> subjectProductRelationList;
@ApiModelProperty(" The relationship between preferred zones and commodities ")
private List<CmsPrefrenceAreaProductRelation> prefrenceAreaProductRelationList;
}
Classification of goods 、 Commodity type 、 Brand management function
These three functions are relatively simple , I will list the simple table structure .
brand
CREATE TABLE `pms_brand` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(64) DEFAULT NULL,
`first_letter` varchar(8) DEFAULT NULL COMMENT ' The first letter ',
`sort` int(11) DEFAULT NULL,
`factory_status` int(1) DEFAULT NULL COMMENT ' Is it a brand manufacturer :0-> No ;1-> yes ',
`show_status` int(1) DEFAULT NULL,
`product_count` int(11) DEFAULT NULL COMMENT ' Product quantity ',
`product_comment_count` int(11) DEFAULT NULL COMMENT ' Number of product reviews ',
`logo` varchar(255) DEFAULT NULL COMMENT ' brand logo',
`big_pic` varchar(255) DEFAULT NULL COMMENT ' Big picture of the special area ',
`brand_story` text COMMENT ' Brand story ',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=59 DEFAULT CHARSET=utf8 COMMENT=' Brand list ';
Classification of goods
CREATE TABLE `pms_product_category` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`parent_id` bigint(20) DEFAULT NULL COMMENT ' Number of computer classification :0 Represents a level 1 Classification ',
`name` varchar(64) DEFAULT NULL,
`level` int(1) DEFAULT NULL COMMENT ' Classification level :0->1 level ;1->2 level ',
`product_count` int(11) DEFAULT NULL,
`product_unit` varchar(64) DEFAULT NULL,
`nav_status` int(1) DEFAULT NULL COMMENT ' Is it displayed in the navigation bar :0-> No display ;1-> Show ',
`show_status` int(1) DEFAULT NULL COMMENT ' Display state :0-> No display ;1-> Show ',
`sort` int(11) DEFAULT NULL,
`icon` varchar(255) DEFAULT NULL COMMENT ' Icon ',
`keywords` varchar(255) DEFAULT NULL,
`description` text COMMENT ' describe ',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=53 DEFAULT CHARSET=utf8 COMMENT=' Product classification ';
Commodity type
CREATE TABLE `pms_product_attribute_category` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(64) DEFAULT NULL,
`attribute_count` int(11) DEFAULT '0' COMMENT ' Attribute quantity ',
`param_count` int(11) DEFAULT '0' COMMENT ' The number of arguments ',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8 COMMENT=' Product attribute classification table ';
There is something wrong , Welcome to the discussion .
Last , Welcome to pay attention to my wechat , What do you like , Collection , Forwarding is my greatest encouragement .
边栏推荐
- 854. 相似度为 K 的字符串 BFS
- The Blue Bridge Cup web application development simulation competition is open for the first time! Contestants fast forward!
- CRM creates its own custom report based on fetch
- 阿龙的感悟
- Kingbasees v8r3 data security case - audit record clearing case
- 1.2 download and installation of the help software rstudio
- Database tuning solution
- The solution to the problem that Oracle hugepages are not used, causing the server to be too laggy
- Microservice link risk analysis
- Ethereum ETH的奖励机制
猜你喜欢
KingbaseES V8R3集群维护案例之---在线添加备库管理节点
从零开始实现lmax-Disruptor队列(四)多线程生产者MultiProducerSequencer原理解析
Index optimization of performance tuning methodology
Countdown to 92 days, the strategy for the provincial preparation of the Blue Bridge Cup is coming~
华为快游戏调用登录接口失败,返回错误码 -1
Type of fault
The real situation of programmers
Ad637 notes d'utilisation
Huawei fast game failed to call the login interface, and returned error code -1
Recovery technology with checkpoints
随机推荐
Analyse des risques liés aux liaisons de microservices
Daily question brushing record (XIV)
如何向mongoDB中添加新的字段附代码(全)
装饰器学习01
Huawei game multimedia service calls the method of shielding the voice of the specified player, and the error code 3010 is returned
About the writing method of SQL field "this includes" and "included in" strings
Type of fault
Efficiency difference between row first and column first traversal of mat data types in opencv
Summary of El and JSTL precautions
2.2.5 basic sentences of R language drawing
ICMP introduction
Cross end solutions to improve development efficiency
A long's perception
Deeply convinced plan X - network protocol basic DNS
SQL knowledge leak detection
regular expression
Alibaba cloud award winning experience: build a highly available system with polardb-x
Oracle HugePages没有被使用导致服务器很卡的解决方法
DBeaver同时执行多条insert into报错处理
微服务入门(RestTemplate、Eureka、Nacos、Feign、Gateway)