自动生成物料id

This commit is contained in:
liuhanqing
2025-09-11 16:20:50 +08:00
parent e98b7969c7
commit e99d4346b2
3 changed files with 13 additions and 10 deletions

View File

@@ -1,6 +1,8 @@
package com.ruoyi.bas.BasProduct.service.impl; package com.ruoyi.bas.BasProduct.service.impl;
import java.util.List; import java.util.List;
import cn.hutool.core.util.IdUtil;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.ruoyi.bas.BasProduct.mapper.BasProductMapper; import com.ruoyi.bas.BasProduct.mapper.BasProductMapper;
@@ -52,6 +54,7 @@ public class BasProductServiceImpl implements IBasProductService
@Override @Override
public int insertBasProduct(BasProduct basProduct) public int insertBasProduct(BasProduct basProduct)
{ {
basProduct.setProductGuid(IdUtil.fastSimpleUUID());
return basProductMapper.insertBasProduct(basProduct); return basProductMapper.insertBasProduct(basProduct);
} }

View File

@@ -135,7 +135,7 @@
<el-table v-loading="loading" :data="BasProductList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="BasProductList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="主键" align="center" prop="productGuid" /> <!-- <el-table-column label="主键" align="center" prop="productGuid" />-->
<el-table-column label="物料编码" align="center" prop="productId" /> <el-table-column label="物料编码" align="center" prop="productId" />
<el-table-column label="物料名称" align="center" prop="productName" /> <el-table-column label="物料名称" align="center" prop="productName" />
<el-table-column label="序列号" align="center" prop="spare4" /> <el-table-column label="序列号" align="center" prop="spare4" />