添加商品分类、商品资料导入接口
This commit is contained in:
parent
51efdd592e
commit
aa32728f6e
8
Makefile
8
Makefile
|
@ -14,8 +14,12 @@ build-sqlite:
|
|||
# docker build . -t go-admin:latest
|
||||
|
||||
|
||||
build dev:
|
||||
GOOS=linux GOARCH=amd64 go build -o dev-go-admin main.go
|
||||
build-dev:
|
||||
set GOARCH=amd64
|
||||
set GOOS=linux
|
||||
go build -o dev-go-admin main.go
|
||||
|
||||
|
||||
build:
|
||||
GOOS=linux GOARCH=amd64 go build -o go-admin main.go
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@ import (
|
|||
"go-admin/logger"
|
||||
"go-admin/tools"
|
||||
"go-admin/tools/app"
|
||||
"io"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
|
@ -210,3 +211,81 @@ func CategoryDisplay(c *gin.Context) {
|
|||
|
||||
app.OK(c, nil, "ok")
|
||||
}
|
||||
|
||||
// CategoryImportView 导入商品分类预览
|
||||
// @Summary 导入商品分类预览
|
||||
// @Tags 商品分类
|
||||
// @Produce json
|
||||
// @Accept json
|
||||
// @Param file body string true "上传excel文件"
|
||||
// @Success 200 {array} models.CategoryExcel
|
||||
// @Router /api/v1/category/import_category_view [post]
|
||||
func CategoryImportView(c *gin.Context) {
|
||||
file, header, err := c.Request.FormFile("file")
|
||||
if err != nil {
|
||||
//logger.Error("form file err:", err)
|
||||
app.Error(c, http.StatusInternalServerError, err, "预览失败")
|
||||
return
|
||||
}
|
||||
|
||||
readAll, err := io.ReadAll(file)
|
||||
if err != nil {
|
||||
//logger.Error("read all err:", err)
|
||||
app.Error(c, http.StatusInternalServerError, err, "预览失败")
|
||||
return
|
||||
}
|
||||
|
||||
fmt.Println("header:", header.Filename)
|
||||
_, colsMap, err := models.FileExcelImport([]byte(readAll), nil)
|
||||
if err != nil {
|
||||
//logger.Error("file excel reader err:", err)
|
||||
app.Error(c, http.StatusInternalServerError, err, err.Error())
|
||||
return
|
||||
}
|
||||
fmt.Println("colsMap:", colsMap)
|
||||
if len(colsMap) != 0 {
|
||||
colsMap = colsMap[1:]
|
||||
}
|
||||
|
||||
app.OK(c, &colsMap, "")
|
||||
return
|
||||
}
|
||||
|
||||
// CategoryImport 导入商品分类
|
||||
// @Summary 导入商品分类
|
||||
// @Tags 商品分类
|
||||
// @Produce json
|
||||
// @Accept json
|
||||
// @Param file body string true "上传excel文件"
|
||||
// @Success 200 {object} app.Response
|
||||
// @Router /api/v1/category/import_category [post]
|
||||
func CategoryImport(c *gin.Context) {
|
||||
file, header, err := c.Request.FormFile("file")
|
||||
if err != nil {
|
||||
//logger.Error("form file err:", err)
|
||||
app.Error(c, http.StatusInternalServerError, err, "预览失败")
|
||||
return
|
||||
}
|
||||
|
||||
readAll, err := io.ReadAll(file)
|
||||
if err != nil {
|
||||
//logger.Error("read all err:", err)
|
||||
app.Error(c, http.StatusInternalServerError, err, "预览失败")
|
||||
return
|
||||
}
|
||||
|
||||
fmt.Println("header:", header.Filename)
|
||||
_, colsMap, err := models.FileExcelReader([]byte(readAll), nil)
|
||||
if err != nil {
|
||||
//logger.Error("file excel reader err:", err)
|
||||
app.Error(c, http.StatusInternalServerError, err, "预览失败")
|
||||
return
|
||||
}
|
||||
fmt.Println("colsMap:", colsMap)
|
||||
if len(colsMap) != 0 {
|
||||
colsMap = colsMap[1:]
|
||||
}
|
||||
|
||||
app.OK(c, &colsMap, "")
|
||||
return
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@ import (
|
|||
"go-admin/app/admin/models"
|
||||
orm "go-admin/common/global"
|
||||
"go-admin/tools/app"
|
||||
"io"
|
||||
"net/http"
|
||||
"strconv"
|
||||
)
|
||||
|
@ -14,7 +15,7 @@ import (
|
|||
type CommodityCreateRequest struct {
|
||||
Name string `json:"name" binding:"required"` // 商品名称
|
||||
ErpCategoryId uint32 `json:"erp_category_id" binding:"required"` // 商品分类id
|
||||
IMEIType uint32 `json:"imei_type" binding:"required"` // 1-无串码 2-串码
|
||||
IMEIType uint32 `json:"imei_type" binding:"required"` // 1-无串码 2-串码(系统生成) 3-串码(手动添加)
|
||||
ErpSupplierId uint32 `json:"erp_supplier_id" binding:"required"` // 主供应商
|
||||
RetailPrice uint32 `json:"retail_price" binding:"required"` // 指导零售价
|
||||
MinRetailPrice uint32 `json:"min_retail_price" binding:"required"` // 最低零售价
|
||||
|
@ -184,13 +185,13 @@ type CommodityEditRequest struct {
|
|||
Id uint32 `json:"id" binding:"required"` // 商品id
|
||||
Name string `json:"name" binding:"required"` // 商品名称
|
||||
ErpCategoryId uint32 `json:"erp_category_id" binding:"required"` // 商品分类id
|
||||
IMEIType uint32 `json:"imei_type" binding:"required"` // 1-无串码 2-串码
|
||||
IMEIType uint32 `json:"imei_type" binding:"required"` // 1-无串码 2-串码(系统生成) 3-串码(手动添加)
|
||||
ErpSupplierId uint32 `json:"erp_supplier_id" binding:"required"` // 主供应商id
|
||||
RetailPrice uint32 `json:"retail_price" binding:"required"` // 指导零售价
|
||||
MinRetailPrice uint32 `json:"min_retail_price" binding:"required"` // 最低零售价
|
||||
StaffCostPrice uint32 `json:"staff_cost_price" binding:"required"` // 员工成本价加价
|
||||
WholesalePrice uint32 `json:"wholesale_price" binding:"required"` // 指导采购价
|
||||
Brokerage1 float64 `json:"brokerage_1" binding:"required"` // 销售毛利提成
|
||||
Brokerage1 float64 `json:"brokerage_1"` // 销售毛利提成
|
||||
Brokerage2 float64 `json:"brokerage_2"` // 员工毛利提成
|
||||
MemberDiscount float64 `json:"member_discount"` // 会员优惠
|
||||
Origin string `json:"origin"` // 产地
|
||||
|
@ -314,3 +315,42 @@ func CommodityDel(c *gin.Context) {
|
|||
app.OK(c, nil, "删除成功")
|
||||
return
|
||||
}
|
||||
|
||||
// BatchImportView 导入商品资料预览
|
||||
// @Summary 导入商品资料预览
|
||||
// @Tags 商品资料
|
||||
// @Produce json
|
||||
// @Accept json
|
||||
// @Param file body string true "上传excel文件"
|
||||
// @Success 200 {array} models.CommodityExcel
|
||||
// @Router /api/v1/commodity/import_commodity_view [post]
|
||||
func CommodityImportView(c *gin.Context) {
|
||||
file, header, err := c.Request.FormFile("file")
|
||||
if err != nil {
|
||||
//logger.Error("form file err:", err)
|
||||
app.Error(c, http.StatusInternalServerError, err, "预览失败")
|
||||
return
|
||||
}
|
||||
|
||||
readAll, err := io.ReadAll(file)
|
||||
if err != nil {
|
||||
//logger.Error("read all err:", err)
|
||||
app.Error(c, http.StatusInternalServerError, err, "预览失败")
|
||||
return
|
||||
}
|
||||
|
||||
fmt.Println("header:", header.Filename)
|
||||
_, colsMap, err := models.FileExcelReader([]byte(readAll), nil)
|
||||
if err != nil {
|
||||
//logger.Error("file excel reader err:", err)
|
||||
app.Error(c, http.StatusInternalServerError, err, "预览失败")
|
||||
return
|
||||
}
|
||||
fmt.Println("colsMap:", colsMap)
|
||||
if len(colsMap) != 0 {
|
||||
colsMap = colsMap[1:]
|
||||
}
|
||||
|
||||
app.OK(c, &colsMap, "")
|
||||
return
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ type ErpStock struct {
|
|||
ErpCategoryId uint32 `json:"erp_category_id" gorm:"index"`
|
||||
ErpCategoryName string `json:"erp_category_name"`
|
||||
CommoditySerialNumber string `json:"commodity_serial_number" gorm:"index"`
|
||||
IMEIType uint32 `json:"imei_type"` // 1-无串码 2-串码
|
||||
IMEIType uint32 `json:"imei_type"` // 1-无串码 2-串码(系统生成) 3-串码(手动添加)
|
||||
RetailPrice uint32 `json:"retail_price"`
|
||||
MinRetailPrice uint32 `json:"min_retail_price"`
|
||||
Count uint32 `json:"count"`
|
||||
|
@ -56,7 +56,7 @@ type ErpStockCommodity struct {
|
|||
CommoditySerialNumber string `json:"commodity_serial_number" gorm:"index"`
|
||||
ErpCategoryId uint32 `json:"erp_category_id" gorm:"index"`
|
||||
ErpCategoryName string `json:"erp_category_name"`
|
||||
IMEIType uint32 `json:"imei_type"` // 1-无串码 2-串码
|
||||
IMEIType uint32 `json:"imei_type"` // 1-无串码 2-串码(系统生成) 3-串码(手动添加)
|
||||
IMEI string `json:"imei"`
|
||||
ErpSupplierId uint32 `json:"erp_supplier_id" gorm:"index"`
|
||||
ErpSupplierName string `json:"erp_supplier_name"`
|
||||
|
@ -87,7 +87,7 @@ type ErpCommodity struct {
|
|||
Name string `json:"name"` // 商品名称
|
||||
ErpCategoryId uint32 `json:"erp_category_id" gorm:"index"` // 商品分类id
|
||||
ErpCategoryName string `json:"erp_category_name"` // 商品分类名称
|
||||
IMEIType uint32 `json:"imei_type"` // 1-无串码 2-串码
|
||||
IMEIType uint32 `json:"imei_type"` // 1-无串码 2-串码(系统生成) 3-串码(手动添加)
|
||||
IMEI string `json:"imei"` // 串码
|
||||
ErpSupplierId uint32 `json:"erp_supplier_id" gorm:"index"` // 主供应商id
|
||||
ErpSupplierName string `json:"erp_supplier_name"` // 主供应商名称
|
||||
|
@ -152,7 +152,7 @@ type ErpInventoryStock struct {
|
|||
ErpCategoryId uint32 `json:"erp_category_id" gorm:"index"`
|
||||
ErpCategoryName string `json:"erp_category_name"`
|
||||
CommoditySerialNumber string `json:"commodity_serial_number" gorm:"index"`
|
||||
IMEIType uint32 `json:"imei_type"` // 1-无串码 2-串码
|
||||
IMEIType uint32 `json:"imei_type"` // 1-无串码 2-串码(系统生成) 3-串码(手动添加)
|
||||
RetailPrice uint32 `json:"retail_price"`
|
||||
MinRetailPrice uint32 `json:"min_retail_price"`
|
||||
Count uint32 `json:"count"`
|
||||
|
@ -174,7 +174,7 @@ type ErpInventoryStockCommodity struct {
|
|||
ErpCommodityId uint32 `json:"erp_commodity_id" gorm:"index"`
|
||||
ErpCommodityName string `json:"erp_commodity_name"`
|
||||
CommoditySerialNumber string `json:"commodity_serial_number" gorm:"index"`
|
||||
IMEIType uint32 `json:"imei_type"` // 1-无串码 2-串码
|
||||
IMEIType uint32 `json:"imei_type"` // 1-无串码 2-串码(系统生成) 3-串码(手动添加)
|
||||
IMEI string `json:"imei"`
|
||||
ErpSupplierId uint32 `json:"erp_supplier_id" gorm:"index"`
|
||||
ErpSupplierName string `json:"erp_supplier_name"`
|
||||
|
@ -250,21 +250,21 @@ func (c *ErpCommodity) SetErpCategory() error {
|
|||
}
|
||||
|
||||
type ErpCommodityListReq struct {
|
||||
SerialNumber string `json:"serial_number"`
|
||||
ErpCommodityName string `json:"erp_commodity_name"`
|
||||
ErpCategoryId uint32 `json:"erp_category_id"`
|
||||
IMEI string `json:"imei"`
|
||||
ErpSupplierId uint32 `json:"erp_supplier_id"`
|
||||
PageNum int `json:"page_num"`
|
||||
PageSize int `json:"page_size"`
|
||||
IsExport uint32 `json:"is_export"` // 1-导出
|
||||
SerialNumber string `json:"serial_number"` // 商品编号
|
||||
ErpCommodityName string `json:"erp_commodity_name"` // 商品名称
|
||||
ErpCategoryId uint32 `json:"erp_category_id"` // 商品分类id
|
||||
IMEI string `json:"imei"` // 串码
|
||||
ErpSupplierId uint32 `json:"erp_supplier_id"` // 供应商id
|
||||
PageNum int `json:"page_num"` // 页码
|
||||
PageSize int `json:"page_size"` // 每页展示数据条数
|
||||
IsExport uint32 `json:"is_export"` // 1-导出
|
||||
}
|
||||
type ErpCommodityListResp struct {
|
||||
List []ErpCommodity `json:"list"`
|
||||
Total int `json:"total"`
|
||||
PageNum int `json:"page_num"`
|
||||
PageSize int `json:"page_size"`
|
||||
ExportUrl string `json:"export_url"`
|
||||
Total int `json:"total"` // 总页数
|
||||
PageNum int `json:"page_num"` // 页码
|
||||
PageSize int `json:"page_size"` // 每页展示数据条数
|
||||
ExportUrl string `json:"export_url"` // 1-导出
|
||||
}
|
||||
|
||||
func (m *ErpCommodityListReq) List() (*ErpCommodityListResp, error) {
|
||||
|
|
264
app/admin/models/file.go
Normal file
264
app/admin/models/file.go
Normal file
|
@ -0,0 +1,264 @@
|
|||
package models
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/codinl/go-logger"
|
||||
"github.com/xuri/excelize/v2"
|
||||
"reflect"
|
||||
)
|
||||
|
||||
type CategoryExcel struct {
|
||||
FirstCategory string `json:"first_category" binding:"required"` // 一级分类
|
||||
SecondCategory string `json:"second_category"` // 二级分类
|
||||
ThreeCategory string `json:"three_category"` // 三级分类
|
||||
}
|
||||
|
||||
type CommodityExcel struct {
|
||||
Category string `json:"category" binding:"required"` // 商品所属分类
|
||||
Name string `json:"name" binding:"required"` // 商品名称
|
||||
IMEIType string `json:"imei_type" binding:"required"` // 是否串码 1-无串码 2-串码(系统生成) 3-串码(手动添加)
|
||||
SysGenerate string `json:"sys_generate" binding:"required"` // 系统生成串码
|
||||
SupplierName string `json:"supplier_name" binding:"required"` // 供应商名称
|
||||
SellBrokerage string `json:"sell_brokerage" binding:"required"` // 销售毛利提成
|
||||
StaffBrokerage string `json:"staff_brokerage" binding:"required"` // 员工毛利提成
|
||||
MemberDiscount string `json:"member_discount" binding:"required"` // 会员优惠
|
||||
RetailPrice string `json:"retail_price" binding:"required"` // 指导零售价
|
||||
MinRetailPrice string `json:"min_retail_price" binding:"required"` // 最低零售价
|
||||
WholesalePrice string `json:"wholesale_price" binding:"required"` // 指导采购价
|
||||
StaffCostPrice string `json:"staff_cost_price" binding:"required"` // 员工成本价加价
|
||||
Origin string `json:"origin"` // 产地
|
||||
Remark string `json:"remark"` // 备注
|
||||
}
|
||||
|
||||
// 获取struct的tag标签,匹配excel导入数据
|
||||
func getJSONTagNames(s interface{}) []string {
|
||||
valueType := reflect.TypeOf(s)
|
||||
if valueType.Kind() != reflect.Struct {
|
||||
fmt.Println("传入的不是结构体")
|
||||
return nil
|
||||
}
|
||||
|
||||
var tagNames []string
|
||||
for i := 0; i < valueType.NumField(); i++ {
|
||||
field := valueType.Field(i)
|
||||
tag := field.Tag.Get("json")
|
||||
if tag != "" {
|
||||
tagNames = append(tagNames, tag)
|
||||
}
|
||||
}
|
||||
|
||||
return tagNames
|
||||
}
|
||||
|
||||
// 预览excel数据(不做必填项校验)
|
||||
func FileExcelReader(d []byte, cols []string) ([]byte, []map[string]interface{}, error) {
|
||||
reader, err := excelize.OpenReader(bytes.NewReader(d))
|
||||
if err != nil {
|
||||
logger.Error("open reader err:", err)
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
sheetList := reader.GetSheetList()
|
||||
if len(sheetList) == 0 {
|
||||
logger.Error("sheet list nil")
|
||||
return nil, nil, err
|
||||
}
|
||||
rows, err := reader.Rows(sheetList[0])
|
||||
if err != nil {
|
||||
logger.Error("reader rows err:", err)
|
||||
return nil, nil, err
|
||||
}
|
||||
sheetCols, err := reader.GetCols(sheetList[0])
|
||||
if err != nil {
|
||||
logger.Error("reader get cols err:", err)
|
||||
return nil, nil, err
|
||||
}
|
||||
if len(sheetCols) == 0 {
|
||||
logger.Error("get cols null err")
|
||||
return nil, nil, err
|
||||
}
|
||||
colsMap := make([]map[string]interface{}, 0)
|
||||
if len(cols) == 0 {
|
||||
if sheetList[0] == "导分类" {
|
||||
cols = getJSONTagNames(CategoryExcel{})
|
||||
} else if sheetList[0] == "导商品" {
|
||||
cols = getJSONTagNames(CommodityExcel{})
|
||||
} else {
|
||||
cols = make([]string, len(sheetCols))
|
||||
for i := 0; i < len(sheetCols); i++ {
|
||||
cols[i] = fmt.Sprintf("c%02d", i)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
fmt.Println("cols", len(cols))
|
||||
fmt.Println("sheetCols", len(sheetCols))
|
||||
if len(cols) != len(sheetCols) {
|
||||
logger.Error("cols length not equal columns")
|
||||
return nil, nil, errors.New("cols length not equal columns")
|
||||
}
|
||||
}
|
||||
|
||||
for rows.Next() {
|
||||
columns, err := rows.Columns()
|
||||
if err != nil {
|
||||
logger.Error("rows columns err:", err)
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
columnMap := make(map[string]interface{}, 0)
|
||||
for i, _ := range cols {
|
||||
columnMap[cols[i]] = ""
|
||||
}
|
||||
for i, _ := range columns {
|
||||
columnMap[cols[i]] = columns[i]
|
||||
}
|
||||
fmt.Println("columnMap:", columnMap)
|
||||
colsMap = append(colsMap, columnMap)
|
||||
}
|
||||
|
||||
fmt.Println("colsMap:", colsMap)
|
||||
mCols, err := json.Marshal(colsMap)
|
||||
if err != nil {
|
||||
logger.Error("marshal err:", err)
|
||||
return mCols, nil, err
|
||||
}
|
||||
|
||||
return mCols, colsMap, nil
|
||||
}
|
||||
|
||||
// 导入excel数据(校验必填项)
|
||||
func FileExcelImport(d []byte, cols []string) ([]byte, []map[string]interface{}, error) {
|
||||
reader, err := excelize.OpenReader(bytes.NewReader(d))
|
||||
if err != nil {
|
||||
logger.Error("open reader err:", err)
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
sheetList := reader.GetSheetList()
|
||||
if len(sheetList) == 0 {
|
||||
logger.Error("sheet list nil")
|
||||
return nil, nil, err
|
||||
}
|
||||
rows, err := reader.Rows(sheetList[0])
|
||||
if err != nil {
|
||||
logger.Error("reader rows err:", err)
|
||||
return nil, nil, err
|
||||
}
|
||||
sheetCols, err := reader.GetCols(sheetList[0])
|
||||
if err != nil {
|
||||
logger.Error("reader get cols err:", err)
|
||||
return nil, nil, err
|
||||
}
|
||||
if len(sheetCols) == 0 {
|
||||
logger.Error("get cols null err")
|
||||
return nil, nil, err
|
||||
}
|
||||
colsMap := make([]map[string]interface{}, 0)
|
||||
if len(cols) == 0 {
|
||||
if sheetList[0] == "导分类" {
|
||||
//校验商品分类导入规则
|
||||
err := checkCategoryExcel(sheetCols)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
cols = getJSONTagNames(CategoryExcel{})
|
||||
} else if sheetList[0] == "导商品" {
|
||||
//校验商品资料导入规则
|
||||
err := checkCommodityExcel(sheetCols)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
cols = getJSONTagNames(CommodityExcel{})
|
||||
} else {
|
||||
cols = make([]string, len(sheetCols))
|
||||
for i := 0; i < len(sheetCols); i++ {
|
||||
cols[i] = fmt.Sprintf("c%02d", i)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
fmt.Println("cols", len(cols))
|
||||
fmt.Println("sheetCols", len(sheetCols))
|
||||
if len(cols) != len(sheetCols) {
|
||||
logger.Error("cols length not equal columns")
|
||||
return nil, nil, errors.New("cols length not equal columns")
|
||||
}
|
||||
}
|
||||
|
||||
for rows.Next() {
|
||||
columns, err := rows.Columns()
|
||||
if err != nil {
|
||||
logger.Error("rows columns err:", err)
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
columnMap := make(map[string]interface{}, 0)
|
||||
for i, _ := range cols {
|
||||
columnMap[cols[i]] = ""
|
||||
for j, _ := range columns {
|
||||
columnMap[cols[j]] = columns[j]
|
||||
}
|
||||
}
|
||||
//for i, _ := range columns {
|
||||
// columnMap[cols[i]] = columns[i]
|
||||
//}
|
||||
|
||||
fmt.Println("columnMap:", columnMap)
|
||||
colsMap = append(colsMap, columnMap)
|
||||
}
|
||||
|
||||
fmt.Println("colsMap:", colsMap)
|
||||
mCols, err := json.Marshal(colsMap)
|
||||
if err != nil {
|
||||
logger.Error("marshal err:", err)
|
||||
return mCols, nil, err
|
||||
}
|
||||
|
||||
return mCols, colsMap, nil
|
||||
}
|
||||
|
||||
// 校验商品分类导入规则
|
||||
// 导入商品分类校验报错: (1)只有3级,没有2级或1级 (2)有2,3级,但没有1级
|
||||
func checkCategoryExcel(sheetCols [][]string) error {
|
||||
if len(sheetCols) != 3 {
|
||||
return errors.New("模版错误,请检查文件")
|
||||
}
|
||||
|
||||
if len(sheetCols[0]) < len(sheetCols[1]) || len(sheetCols[0]) < len(sheetCols[2]) {
|
||||
return errors.New("格式错误,缺少一级分类")
|
||||
} else if len(sheetCols[1]) < len(sheetCols[2]) {
|
||||
return errors.New("格式错误,缺少二级分类")
|
||||
}
|
||||
|
||||
for i := 1; i < len(sheetCols[2]); i++ {
|
||||
if sheetCols[0][i] == "" && (sheetCols[1][i] != "" || sheetCols[2][i] != "") {
|
||||
return errors.New("格式错误,缺少一级分类")
|
||||
} else if sheetCols[2][i] != "" && sheetCols[1][i] == "" {
|
||||
return errors.New("格式错误,缺少二级分类")
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// 校验商品资料导入规则
|
||||
// 导入商品资料校验报错:必填项缺少数据(除了产地、备注,其他都是必填项)
|
||||
func checkCommodityExcel(sheetCols [][]string) error {
|
||||
if len(sheetCols) != 14 {
|
||||
return errors.New("模版错误,请检查文件")
|
||||
}
|
||||
|
||||
for i := 0; i < len(sheetCols)-2; i++ {
|
||||
if len(sheetCols[i]) < len(sheetCols[i+1]) {
|
||||
return errors.New("格式错误,有必填项未录入")
|
||||
}
|
||||
for _, v := range sheetCols[i] {
|
||||
if v == "" {
|
||||
return errors.New("格式错误,有必填项未录入")
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
|
@ -8,16 +8,16 @@ import (
|
|||
var RecordNotFound = gorm.ErrRecordNotFound
|
||||
|
||||
type BaseModel struct {
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
UpdatedAt time.Time `json:"updatedAt"`
|
||||
DeletedAt *time.Time `json:"deletedAt"`
|
||||
CreatedAt time.Time `json:"createdAt"` // 创建时间
|
||||
UpdatedAt time.Time `json:"updatedAt"` // 更新时间
|
||||
DeletedAt *time.Time `json:"deletedAt"` // 删除时间
|
||||
}
|
||||
|
||||
type Model struct {
|
||||
ID uint32 `json:"id" gorm:"primary_key;AUTO_INCREMENT"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
UpdatedAt time.Time `json:"-"`
|
||||
DeletedAt *time.Time `json:"-" sql:"index"`
|
||||
ID uint32 `json:"id" gorm:"primary_key;AUTO_INCREMENT"` // 数据库记录编号
|
||||
CreatedAt time.Time `json:"createdAt"` // 创建时间
|
||||
UpdatedAt time.Time `json:"-"` // 更新时间
|
||||
DeletedAt *time.Time `json:"-" sql:"index"` // 删除时间
|
||||
}
|
||||
|
||||
type Unix struct {
|
||||
|
|
|
@ -14,4 +14,6 @@ func registerCategoryRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddl
|
|||
r.POST("delete", basic.DeleteCategory)
|
||||
r.POST("list", basic.CategoryList)
|
||||
r.POST("display", basic.CategoryDisplay)
|
||||
r.POST("import_category_view", basic.CategoryImportView)
|
||||
r.POST("import_category", basic.CategoryImport)
|
||||
}
|
||||
|
|
|
@ -14,4 +14,5 @@ func registerCommodityRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMidd
|
|||
r.POST("delete", basic.CommodityDel)
|
||||
r.POST("list", basic.CommodityList)
|
||||
r.POST("detail", basic.CommodityDetail)
|
||||
r.POST("import_commodity_view", basic.CommodityImportView)
|
||||
}
|
||||
|
|
|
@ -96,10 +96,8 @@ func examplesCheckRoleRouter(r *gin.Engine, authMiddleware *jwtauth.GinJWTMiddle
|
|||
|
||||
//供应商
|
||||
registerSupplierRouter(v1, authMiddleware)
|
||||
|
||||
//商品分类
|
||||
registerCategoryRouter(v1, authMiddleware)
|
||||
|
||||
//商品资料
|
||||
registerCommodityRouter(v1, authMiddleware)
|
||||
}
|
||||
|
|
|
@ -47,6 +47,7 @@ func sysBaseRouter(r *gin.RouterGroup) {
|
|||
func sysStaticFileRouter(r *gin.RouterGroup) {
|
||||
mime.AddExtensionType(".js", "application/javascript")
|
||||
r.Static("/static", "./static")
|
||||
//r.StaticFile("/importCategory.xlsx", "/static/导分类.xlsx")
|
||||
r.Static("/form-generator", "./static/form-generator")
|
||||
}
|
||||
|
||||
|
|
230
docs/docs.go
230
docs/docs.go
|
@ -310,6 +310,78 @@ const docTemplate = `{
|
|||
}
|
||||
}
|
||||
},
|
||||
"/api/v1/commodity/import_category_view": {
|
||||
"post": {
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"商品分类"
|
||||
],
|
||||
"summary": "导入商品分类预览",
|
||||
"parameters": [
|
||||
{
|
||||
"description": "上传excel文件",
|
||||
"name": "file",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/models.CategoryExcel"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/v1/commodity/import_commodity_view": {
|
||||
"post": {
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"商品资料"
|
||||
],
|
||||
"summary": "导入商品资料预览",
|
||||
"parameters": [
|
||||
{
|
||||
"description": "上传excel文件",
|
||||
"name": "file",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/models.CommodityExcel"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/v1/commodity/list": {
|
||||
"post": {
|
||||
"consumes": [
|
||||
|
@ -3050,7 +3122,7 @@ const docTemplate = `{
|
|||
"type": "integer"
|
||||
},
|
||||
"imei_type": {
|
||||
"description": "1-无串码 2-串码",
|
||||
"description": "1-无串码 2-串码(系统生成) 3-串码(手动添加)",
|
||||
"type": "integer"
|
||||
},
|
||||
"member_discount": {
|
||||
|
@ -3148,7 +3220,7 @@ const docTemplate = `{
|
|||
"type": "integer"
|
||||
},
|
||||
"imei_type": {
|
||||
"description": "1-无串码 2-串码",
|
||||
"description": "1-无串码 2-串码(系统生成) 3-串码(手动添加)",
|
||||
"type": "integer"
|
||||
},
|
||||
"member_discount": {
|
||||
|
@ -3412,6 +3484,7 @@ const docTemplate = `{
|
|||
"type": "integer"
|
||||
},
|
||||
"createdAt": {
|
||||
"description": "创建时间",
|
||||
"type": "string"
|
||||
},
|
||||
"display": {
|
||||
|
@ -3419,6 +3492,7 @@ const docTemplate = `{
|
|||
"type": "integer"
|
||||
},
|
||||
"id": {
|
||||
"description": "数据库记录编号",
|
||||
"type": "integer"
|
||||
},
|
||||
"name": {
|
||||
|
@ -3435,6 +3509,26 @@ const docTemplate = `{
|
|||
}
|
||||
}
|
||||
},
|
||||
"models.CategoryExcel": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"first_category"
|
||||
],
|
||||
"properties": {
|
||||
"first_category": {
|
||||
"description": "一级分类",
|
||||
"type": "string"
|
||||
},
|
||||
"second_category": {
|
||||
"description": "二级分类",
|
||||
"type": "string"
|
||||
},
|
||||
"three_category": {
|
||||
"description": "三级分类",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"models.CategoryModel": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
@ -3443,6 +3537,7 @@ const docTemplate = `{
|
|||
"type": "integer"
|
||||
},
|
||||
"createdAt": {
|
||||
"description": "创建时间",
|
||||
"type": "string"
|
||||
},
|
||||
"display": {
|
||||
|
@ -3450,6 +3545,7 @@ const docTemplate = `{
|
|||
"type": "integer"
|
||||
},
|
||||
"id": {
|
||||
"description": "数据库记录编号",
|
||||
"type": "integer"
|
||||
},
|
||||
"name": {
|
||||
|
@ -3473,6 +3569,81 @@ const docTemplate = `{
|
|||
}
|
||||
}
|
||||
},
|
||||
"models.CommodityExcel": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"category",
|
||||
"imei_type",
|
||||
"member_discount",
|
||||
"min_retail_price",
|
||||
"name",
|
||||
"retail_price",
|
||||
"sell_brokerage",
|
||||
"staff_brokerage",
|
||||
"staff_cost_price",
|
||||
"supplier_name",
|
||||
"sys_generate",
|
||||
"wholesale_price"
|
||||
],
|
||||
"properties": {
|
||||
"category": {
|
||||
"description": "商品所属分类",
|
||||
"type": "string"
|
||||
},
|
||||
"imei_type": {
|
||||
"description": "是否串码 1-无串码 2-串码(系统生成) 3-串码(手动添加)",
|
||||
"type": "string"
|
||||
},
|
||||
"member_discount": {
|
||||
"description": "会员优惠",
|
||||
"type": "string"
|
||||
},
|
||||
"min_retail_price": {
|
||||
"description": "最低零售价",
|
||||
"type": "string"
|
||||
},
|
||||
"name": {
|
||||
"description": "商品名称",
|
||||
"type": "string"
|
||||
},
|
||||
"origin": {
|
||||
"description": "产地",
|
||||
"type": "string"
|
||||
},
|
||||
"remark": {
|
||||
"description": "备注",
|
||||
"type": "string"
|
||||
},
|
||||
"retail_price": {
|
||||
"description": "指导零售价",
|
||||
"type": "string"
|
||||
},
|
||||
"sell_brokerage": {
|
||||
"description": "销售毛利提成",
|
||||
"type": "string"
|
||||
},
|
||||
"staff_brokerage": {
|
||||
"description": "员工毛利提成",
|
||||
"type": "string"
|
||||
},
|
||||
"staff_cost_price": {
|
||||
"description": "员工成本价加价",
|
||||
"type": "string"
|
||||
},
|
||||
"supplier_name": {
|
||||
"description": "供应商名称",
|
||||
"type": "string"
|
||||
},
|
||||
"sys_generate": {
|
||||
"description": "系统生成串码",
|
||||
"type": "string"
|
||||
},
|
||||
"wholesale_price": {
|
||||
"description": "指导采购价",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"models.DictType": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
@ -3481,12 +3652,14 @@ const docTemplate = `{
|
|||
"type": "string"
|
||||
},
|
||||
"createdAt": {
|
||||
"description": "创建时间",
|
||||
"type": "string"
|
||||
},
|
||||
"dataScope": {
|
||||
"type": "string"
|
||||
},
|
||||
"deletedAt": {
|
||||
"description": "删除时间",
|
||||
"type": "string"
|
||||
},
|
||||
"dictId": {
|
||||
|
@ -3516,6 +3689,7 @@ const docTemplate = `{
|
|||
"type": "string"
|
||||
},
|
||||
"updatedAt": {
|
||||
"description": "更新时间",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
|
@ -3524,12 +3698,14 @@ const docTemplate = `{
|
|||
"type": "object",
|
||||
"properties": {
|
||||
"createdAt": {
|
||||
"description": "创建时间",
|
||||
"type": "string"
|
||||
},
|
||||
"full_num": {
|
||||
"type": "integer"
|
||||
},
|
||||
"id": {
|
||||
"description": "数据库记录编号",
|
||||
"type": "integer"
|
||||
},
|
||||
"level": {
|
||||
|
@ -3578,6 +3754,7 @@ const docTemplate = `{
|
|||
"type": "number"
|
||||
},
|
||||
"createdAt": {
|
||||
"description": "创建时间",
|
||||
"type": "string"
|
||||
},
|
||||
"erp_category": {
|
||||
|
@ -3600,6 +3777,7 @@ const docTemplate = `{
|
|||
"type": "string"
|
||||
},
|
||||
"id": {
|
||||
"description": "数据库记录编号",
|
||||
"type": "integer"
|
||||
},
|
||||
"imei": {
|
||||
|
@ -3607,7 +3785,7 @@ const docTemplate = `{
|
|||
"type": "string"
|
||||
},
|
||||
"imei_type": {
|
||||
"description": "1-无串码 2-串码",
|
||||
"description": "1-无串码 2-串码(系统生成) 3-串码(手动添加)",
|
||||
"type": "integer"
|
||||
},
|
||||
"member_discount": {
|
||||
|
@ -3656,15 +3834,19 @@ const docTemplate = `{
|
|||
"type": "object",
|
||||
"properties": {
|
||||
"erp_category_id": {
|
||||
"description": "商品分类id",
|
||||
"type": "integer"
|
||||
},
|
||||
"erp_commodity_name": {
|
||||
"description": "商品名称",
|
||||
"type": "string"
|
||||
},
|
||||
"erp_supplier_id": {
|
||||
"description": "供应商id",
|
||||
"type": "integer"
|
||||
},
|
||||
"imei": {
|
||||
"description": "串码",
|
||||
"type": "string"
|
||||
},
|
||||
"is_export": {
|
||||
|
@ -3672,12 +3854,15 @@ const docTemplate = `{
|
|||
"type": "integer"
|
||||
},
|
||||
"page_num": {
|
||||
"description": "页码",
|
||||
"type": "integer"
|
||||
},
|
||||
"page_size": {
|
||||
"description": "每页展示数据条数",
|
||||
"type": "integer"
|
||||
},
|
||||
"serial_number": {
|
||||
"description": "商品编号",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
|
@ -3686,6 +3871,7 @@ const docTemplate = `{
|
|||
"type": "object",
|
||||
"properties": {
|
||||
"export_url": {
|
||||
"description": "1-导出",
|
||||
"type": "string"
|
||||
},
|
||||
"list": {
|
||||
|
@ -3695,12 +3881,15 @@ const docTemplate = `{
|
|||
}
|
||||
},
|
||||
"page_num": {
|
||||
"description": "页码",
|
||||
"type": "integer"
|
||||
},
|
||||
"page_size": {
|
||||
"description": "每页展示数据条数",
|
||||
"type": "integer"
|
||||
},
|
||||
"total": {
|
||||
"description": "总页数",
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
|
@ -3745,6 +3934,7 @@ const docTemplate = `{
|
|||
"type": "string"
|
||||
},
|
||||
"createdAt": {
|
||||
"description": "创建时间",
|
||||
"type": "string"
|
||||
},
|
||||
"dataScope": {
|
||||
|
@ -3752,6 +3942,7 @@ const docTemplate = `{
|
|||
"type": "string"
|
||||
},
|
||||
"deletedAt": {
|
||||
"description": "删除时间",
|
||||
"type": "string"
|
||||
},
|
||||
"infoId": {
|
||||
|
@ -3797,6 +3988,7 @@ const docTemplate = `{
|
|||
"type": "string"
|
||||
},
|
||||
"updatedAt": {
|
||||
"description": "更新时间",
|
||||
"type": "string"
|
||||
},
|
||||
"username": {
|
||||
|
@ -3827,12 +4019,14 @@ const docTemplate = `{
|
|||
"type": "string"
|
||||
},
|
||||
"createdAt": {
|
||||
"description": "创建时间",
|
||||
"type": "string"
|
||||
},
|
||||
"dataScope": {
|
||||
"type": "string"
|
||||
},
|
||||
"deletedAt": {
|
||||
"description": "删除时间",
|
||||
"type": "string"
|
||||
},
|
||||
"icon": {
|
||||
|
@ -3884,6 +4078,7 @@ const docTemplate = `{
|
|||
"type": "string"
|
||||
},
|
||||
"updatedAt": {
|
||||
"description": "更新时间",
|
||||
"type": "string"
|
||||
},
|
||||
"visible": {
|
||||
|
@ -3898,12 +4093,14 @@ const docTemplate = `{
|
|||
"type": "string"
|
||||
},
|
||||
"createdAt": {
|
||||
"description": "创建时间",
|
||||
"type": "string"
|
||||
},
|
||||
"dataScope": {
|
||||
"type": "string"
|
||||
},
|
||||
"deletedAt": {
|
||||
"description": "删除时间",
|
||||
"type": "string"
|
||||
},
|
||||
"params": {
|
||||
|
@ -3937,6 +4134,7 @@ const docTemplate = `{
|
|||
"type": "string"
|
||||
},
|
||||
"updatedAt": {
|
||||
"description": "更新时间",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
|
@ -3977,6 +4175,7 @@ const docTemplate = `{
|
|||
"type": "integer"
|
||||
},
|
||||
"createdAt": {
|
||||
"description": "创建时间",
|
||||
"type": "string"
|
||||
},
|
||||
"email": {
|
||||
|
@ -3984,6 +4183,7 @@ const docTemplate = `{
|
|||
"type": "string"
|
||||
},
|
||||
"id": {
|
||||
"description": "数据库记录编号",
|
||||
"type": "integer"
|
||||
},
|
||||
"landline": {
|
||||
|
@ -4028,12 +4228,14 @@ const docTemplate = `{
|
|||
"type": "string"
|
||||
},
|
||||
"createdAt": {
|
||||
"description": "创建时间",
|
||||
"type": "string"
|
||||
},
|
||||
"dataScope": {
|
||||
"type": "string"
|
||||
},
|
||||
"deletedAt": {
|
||||
"description": "删除时间",
|
||||
"type": "string"
|
||||
},
|
||||
"id": {
|
||||
|
@ -4068,6 +4270,7 @@ const docTemplate = `{
|
|||
"type": "string"
|
||||
},
|
||||
"updatedAt": {
|
||||
"description": "更新时间",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
|
@ -4099,12 +4302,14 @@ const docTemplate = `{
|
|||
"type": "string"
|
||||
},
|
||||
"createdAt": {
|
||||
"description": "创建时间",
|
||||
"type": "string"
|
||||
},
|
||||
"dataScope": {
|
||||
"type": "string"
|
||||
},
|
||||
"deletedAt": {
|
||||
"description": "删除时间",
|
||||
"type": "string"
|
||||
},
|
||||
"params": {
|
||||
|
@ -4118,6 +4323,7 @@ const docTemplate = `{
|
|||
"type": "string"
|
||||
},
|
||||
"updatedAt": {
|
||||
"description": "更新时间",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
|
@ -4138,12 +4344,14 @@ const docTemplate = `{
|
|||
"type": "string"
|
||||
},
|
||||
"createdAt": {
|
||||
"description": "创建时间",
|
||||
"type": "string"
|
||||
},
|
||||
"dataScope": {
|
||||
"type": "string"
|
||||
},
|
||||
"deletedAt": {
|
||||
"description": "删除时间",
|
||||
"type": "string"
|
||||
},
|
||||
"id": {
|
||||
|
@ -4178,6 +4386,7 @@ const docTemplate = `{
|
|||
"type": "string"
|
||||
},
|
||||
"updatedAt": {
|
||||
"description": "更新时间",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
|
@ -4195,12 +4404,14 @@ const docTemplate = `{
|
|||
"type": "string"
|
||||
},
|
||||
"createdAt": {
|
||||
"description": "创建时间",
|
||||
"type": "string"
|
||||
},
|
||||
"dataScope": {
|
||||
"type": "string"
|
||||
},
|
||||
"deletedAt": {
|
||||
"description": "删除时间",
|
||||
"type": "string"
|
||||
},
|
||||
"deptId": {
|
||||
|
@ -4245,6 +4456,7 @@ const docTemplate = `{
|
|||
"type": "string"
|
||||
},
|
||||
"updatedAt": {
|
||||
"description": "更新时间",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
|
@ -4263,12 +4475,14 @@ const docTemplate = `{
|
|||
"type": "string"
|
||||
},
|
||||
"createdAt": {
|
||||
"description": "创建时间",
|
||||
"type": "string"
|
||||
},
|
||||
"dataScope": {
|
||||
"type": "string"
|
||||
},
|
||||
"deletedAt": {
|
||||
"description": "删除时间",
|
||||
"type": "string"
|
||||
},
|
||||
"id": {
|
||||
|
@ -4297,6 +4511,7 @@ const docTemplate = `{
|
|||
"type": "string"
|
||||
},
|
||||
"updatedAt": {
|
||||
"description": "更新时间",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
|
@ -4316,6 +4531,7 @@ const docTemplate = `{
|
|||
"type": "string"
|
||||
},
|
||||
"createdAt": {
|
||||
"description": "创建时间",
|
||||
"type": "string"
|
||||
},
|
||||
"dataScope": {
|
||||
|
@ -4323,6 +4539,7 @@ const docTemplate = `{
|
|||
"type": "string"
|
||||
},
|
||||
"deletedAt": {
|
||||
"description": "删除时间",
|
||||
"type": "string"
|
||||
},
|
||||
"deptName": {
|
||||
|
@ -4398,6 +4615,7 @@ const docTemplate = `{
|
|||
"type": "string"
|
||||
},
|
||||
"updatedAt": {
|
||||
"description": "更新时间",
|
||||
"type": "string"
|
||||
},
|
||||
"userAgent": {
|
||||
|
@ -4416,12 +4634,14 @@ const docTemplate = `{
|
|||
"type": "string"
|
||||
},
|
||||
"createdAt": {
|
||||
"description": "创建时间",
|
||||
"type": "string"
|
||||
},
|
||||
"dataScope": {
|
||||
"type": "string"
|
||||
},
|
||||
"deletedAt": {
|
||||
"description": "删除时间",
|
||||
"type": "string"
|
||||
},
|
||||
"deptIds": {
|
||||
|
@ -4469,6 +4689,7 @@ const docTemplate = `{
|
|||
"type": "string"
|
||||
},
|
||||
"updatedAt": {
|
||||
"description": "更新时间",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
|
@ -4495,12 +4716,14 @@ const docTemplate = `{
|
|||
"type": "string"
|
||||
},
|
||||
"createdAt": {
|
||||
"description": "创建时间",
|
||||
"type": "string"
|
||||
},
|
||||
"dataScope": {
|
||||
"type": "string"
|
||||
},
|
||||
"deletedAt": {
|
||||
"description": "删除时间",
|
||||
"type": "string"
|
||||
},
|
||||
"deptId": {
|
||||
|
@ -4561,6 +4784,7 @@ const docTemplate = `{
|
|||
"type": "string"
|
||||
},
|
||||
"updatedAt": {
|
||||
"description": "更新时间",
|
||||
"type": "string"
|
||||
},
|
||||
"userId": {
|
||||
|
|
|
@ -302,6 +302,78 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"/api/v1/commodity/import_category_view": {
|
||||
"post": {
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"商品分类"
|
||||
],
|
||||
"summary": "导入商品分类预览",
|
||||
"parameters": [
|
||||
{
|
||||
"description": "上传excel文件",
|
||||
"name": "file",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/models.CategoryExcel"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/v1/commodity/import_commodity_view": {
|
||||
"post": {
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"商品资料"
|
||||
],
|
||||
"summary": "导入商品资料预览",
|
||||
"parameters": [
|
||||
{
|
||||
"description": "上传excel文件",
|
||||
"name": "file",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/models.CommodityExcel"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/v1/commodity/list": {
|
||||
"post": {
|
||||
"consumes": [
|
||||
|
@ -3042,7 +3114,7 @@
|
|||
"type": "integer"
|
||||
},
|
||||
"imei_type": {
|
||||
"description": "1-无串码 2-串码",
|
||||
"description": "1-无串码 2-串码(系统生成) 3-串码(手动添加)",
|
||||
"type": "integer"
|
||||
},
|
||||
"member_discount": {
|
||||
|
@ -3140,7 +3212,7 @@
|
|||
"type": "integer"
|
||||
},
|
||||
"imei_type": {
|
||||
"description": "1-无串码 2-串码",
|
||||
"description": "1-无串码 2-串码(系统生成) 3-串码(手动添加)",
|
||||
"type": "integer"
|
||||
},
|
||||
"member_discount": {
|
||||
|
@ -3404,6 +3476,7 @@
|
|||
"type": "integer"
|
||||
},
|
||||
"createdAt": {
|
||||
"description": "创建时间",
|
||||
"type": "string"
|
||||
},
|
||||
"display": {
|
||||
|
@ -3411,6 +3484,7 @@
|
|||
"type": "integer"
|
||||
},
|
||||
"id": {
|
||||
"description": "数据库记录编号",
|
||||
"type": "integer"
|
||||
},
|
||||
"name": {
|
||||
|
@ -3427,6 +3501,26 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"models.CategoryExcel": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"first_category"
|
||||
],
|
||||
"properties": {
|
||||
"first_category": {
|
||||
"description": "一级分类",
|
||||
"type": "string"
|
||||
},
|
||||
"second_category": {
|
||||
"description": "二级分类",
|
||||
"type": "string"
|
||||
},
|
||||
"three_category": {
|
||||
"description": "三级分类",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"models.CategoryModel": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
@ -3435,6 +3529,7 @@
|
|||
"type": "integer"
|
||||
},
|
||||
"createdAt": {
|
||||
"description": "创建时间",
|
||||
"type": "string"
|
||||
},
|
||||
"display": {
|
||||
|
@ -3442,6 +3537,7 @@
|
|||
"type": "integer"
|
||||
},
|
||||
"id": {
|
||||
"description": "数据库记录编号",
|
||||
"type": "integer"
|
||||
},
|
||||
"name": {
|
||||
|
@ -3465,6 +3561,81 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"models.CommodityExcel": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"category",
|
||||
"imei_type",
|
||||
"member_discount",
|
||||
"min_retail_price",
|
||||
"name",
|
||||
"retail_price",
|
||||
"sell_brokerage",
|
||||
"staff_brokerage",
|
||||
"staff_cost_price",
|
||||
"supplier_name",
|
||||
"sys_generate",
|
||||
"wholesale_price"
|
||||
],
|
||||
"properties": {
|
||||
"category": {
|
||||
"description": "商品所属分类",
|
||||
"type": "string"
|
||||
},
|
||||
"imei_type": {
|
||||
"description": "是否串码 1-无串码 2-串码(系统生成) 3-串码(手动添加)",
|
||||
"type": "string"
|
||||
},
|
||||
"member_discount": {
|
||||
"description": "会员优惠",
|
||||
"type": "string"
|
||||
},
|
||||
"min_retail_price": {
|
||||
"description": "最低零售价",
|
||||
"type": "string"
|
||||
},
|
||||
"name": {
|
||||
"description": "商品名称",
|
||||
"type": "string"
|
||||
},
|
||||
"origin": {
|
||||
"description": "产地",
|
||||
"type": "string"
|
||||
},
|
||||
"remark": {
|
||||
"description": "备注",
|
||||
"type": "string"
|
||||
},
|
||||
"retail_price": {
|
||||
"description": "指导零售价",
|
||||
"type": "string"
|
||||
},
|
||||
"sell_brokerage": {
|
||||
"description": "销售毛利提成",
|
||||
"type": "string"
|
||||
},
|
||||
"staff_brokerage": {
|
||||
"description": "员工毛利提成",
|
||||
"type": "string"
|
||||
},
|
||||
"staff_cost_price": {
|
||||
"description": "员工成本价加价",
|
||||
"type": "string"
|
||||
},
|
||||
"supplier_name": {
|
||||
"description": "供应商名称",
|
||||
"type": "string"
|
||||
},
|
||||
"sys_generate": {
|
||||
"description": "系统生成串码",
|
||||
"type": "string"
|
||||
},
|
||||
"wholesale_price": {
|
||||
"description": "指导采购价",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"models.DictType": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
@ -3473,12 +3644,14 @@
|
|||
"type": "string"
|
||||
},
|
||||
"createdAt": {
|
||||
"description": "创建时间",
|
||||
"type": "string"
|
||||
},
|
||||
"dataScope": {
|
||||
"type": "string"
|
||||
},
|
||||
"deletedAt": {
|
||||
"description": "删除时间",
|
||||
"type": "string"
|
||||
},
|
||||
"dictId": {
|
||||
|
@ -3508,6 +3681,7 @@
|
|||
"type": "string"
|
||||
},
|
||||
"updatedAt": {
|
||||
"description": "更新时间",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
|
@ -3516,12 +3690,14 @@
|
|||
"type": "object",
|
||||
"properties": {
|
||||
"createdAt": {
|
||||
"description": "创建时间",
|
||||
"type": "string"
|
||||
},
|
||||
"full_num": {
|
||||
"type": "integer"
|
||||
},
|
||||
"id": {
|
||||
"description": "数据库记录编号",
|
||||
"type": "integer"
|
||||
},
|
||||
"level": {
|
||||
|
@ -3570,6 +3746,7 @@
|
|||
"type": "number"
|
||||
},
|
||||
"createdAt": {
|
||||
"description": "创建时间",
|
||||
"type": "string"
|
||||
},
|
||||
"erp_category": {
|
||||
|
@ -3592,6 +3769,7 @@
|
|||
"type": "string"
|
||||
},
|
||||
"id": {
|
||||
"description": "数据库记录编号",
|
||||
"type": "integer"
|
||||
},
|
||||
"imei": {
|
||||
|
@ -3599,7 +3777,7 @@
|
|||
"type": "string"
|
||||
},
|
||||
"imei_type": {
|
||||
"description": "1-无串码 2-串码",
|
||||
"description": "1-无串码 2-串码(系统生成) 3-串码(手动添加)",
|
||||
"type": "integer"
|
||||
},
|
||||
"member_discount": {
|
||||
|
@ -3648,15 +3826,19 @@
|
|||
"type": "object",
|
||||
"properties": {
|
||||
"erp_category_id": {
|
||||
"description": "商品分类id",
|
||||
"type": "integer"
|
||||
},
|
||||
"erp_commodity_name": {
|
||||
"description": "商品名称",
|
||||
"type": "string"
|
||||
},
|
||||
"erp_supplier_id": {
|
||||
"description": "供应商id",
|
||||
"type": "integer"
|
||||
},
|
||||
"imei": {
|
||||
"description": "串码",
|
||||
"type": "string"
|
||||
},
|
||||
"is_export": {
|
||||
|
@ -3664,12 +3846,15 @@
|
|||
"type": "integer"
|
||||
},
|
||||
"page_num": {
|
||||
"description": "页码",
|
||||
"type": "integer"
|
||||
},
|
||||
"page_size": {
|
||||
"description": "每页展示数据条数",
|
||||
"type": "integer"
|
||||
},
|
||||
"serial_number": {
|
||||
"description": "商品编号",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
|
@ -3678,6 +3863,7 @@
|
|||
"type": "object",
|
||||
"properties": {
|
||||
"export_url": {
|
||||
"description": "1-导出",
|
||||
"type": "string"
|
||||
},
|
||||
"list": {
|
||||
|
@ -3687,12 +3873,15 @@
|
|||
}
|
||||
},
|
||||
"page_num": {
|
||||
"description": "页码",
|
||||
"type": "integer"
|
||||
},
|
||||
"page_size": {
|
||||
"description": "每页展示数据条数",
|
||||
"type": "integer"
|
||||
},
|
||||
"total": {
|
||||
"description": "总页数",
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
|
@ -3737,6 +3926,7 @@
|
|||
"type": "string"
|
||||
},
|
||||
"createdAt": {
|
||||
"description": "创建时间",
|
||||
"type": "string"
|
||||
},
|
||||
"dataScope": {
|
||||
|
@ -3744,6 +3934,7 @@
|
|||
"type": "string"
|
||||
},
|
||||
"deletedAt": {
|
||||
"description": "删除时间",
|
||||
"type": "string"
|
||||
},
|
||||
"infoId": {
|
||||
|
@ -3789,6 +3980,7 @@
|
|||
"type": "string"
|
||||
},
|
||||
"updatedAt": {
|
||||
"description": "更新时间",
|
||||
"type": "string"
|
||||
},
|
||||
"username": {
|
||||
|
@ -3819,12 +4011,14 @@
|
|||
"type": "string"
|
||||
},
|
||||
"createdAt": {
|
||||
"description": "创建时间",
|
||||
"type": "string"
|
||||
},
|
||||
"dataScope": {
|
||||
"type": "string"
|
||||
},
|
||||
"deletedAt": {
|
||||
"description": "删除时间",
|
||||
"type": "string"
|
||||
},
|
||||
"icon": {
|
||||
|
@ -3876,6 +4070,7 @@
|
|||
"type": "string"
|
||||
},
|
||||
"updatedAt": {
|
||||
"description": "更新时间",
|
||||
"type": "string"
|
||||
},
|
||||
"visible": {
|
||||
|
@ -3890,12 +4085,14 @@
|
|||
"type": "string"
|
||||
},
|
||||
"createdAt": {
|
||||
"description": "创建时间",
|
||||
"type": "string"
|
||||
},
|
||||
"dataScope": {
|
||||
"type": "string"
|
||||
},
|
||||
"deletedAt": {
|
||||
"description": "删除时间",
|
||||
"type": "string"
|
||||
},
|
||||
"params": {
|
||||
|
@ -3929,6 +4126,7 @@
|
|||
"type": "string"
|
||||
},
|
||||
"updatedAt": {
|
||||
"description": "更新时间",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
|
@ -3969,6 +4167,7 @@
|
|||
"type": "integer"
|
||||
},
|
||||
"createdAt": {
|
||||
"description": "创建时间",
|
||||
"type": "string"
|
||||
},
|
||||
"email": {
|
||||
|
@ -3976,6 +4175,7 @@
|
|||
"type": "string"
|
||||
},
|
||||
"id": {
|
||||
"description": "数据库记录编号",
|
||||
"type": "integer"
|
||||
},
|
||||
"landline": {
|
||||
|
@ -4020,12 +4220,14 @@
|
|||
"type": "string"
|
||||
},
|
||||
"createdAt": {
|
||||
"description": "创建时间",
|
||||
"type": "string"
|
||||
},
|
||||
"dataScope": {
|
||||
"type": "string"
|
||||
},
|
||||
"deletedAt": {
|
||||
"description": "删除时间",
|
||||
"type": "string"
|
||||
},
|
||||
"id": {
|
||||
|
@ -4060,6 +4262,7 @@
|
|||
"type": "string"
|
||||
},
|
||||
"updatedAt": {
|
||||
"description": "更新时间",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
|
@ -4091,12 +4294,14 @@
|
|||
"type": "string"
|
||||
},
|
||||
"createdAt": {
|
||||
"description": "创建时间",
|
||||
"type": "string"
|
||||
},
|
||||
"dataScope": {
|
||||
"type": "string"
|
||||
},
|
||||
"deletedAt": {
|
||||
"description": "删除时间",
|
||||
"type": "string"
|
||||
},
|
||||
"params": {
|
||||
|
@ -4110,6 +4315,7 @@
|
|||
"type": "string"
|
||||
},
|
||||
"updatedAt": {
|
||||
"description": "更新时间",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
|
@ -4130,12 +4336,14 @@
|
|||
"type": "string"
|
||||
},
|
||||
"createdAt": {
|
||||
"description": "创建时间",
|
||||
"type": "string"
|
||||
},
|
||||
"dataScope": {
|
||||
"type": "string"
|
||||
},
|
||||
"deletedAt": {
|
||||
"description": "删除时间",
|
||||
"type": "string"
|
||||
},
|
||||
"id": {
|
||||
|
@ -4170,6 +4378,7 @@
|
|||
"type": "string"
|
||||
},
|
||||
"updatedAt": {
|
||||
"description": "更新时间",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
|
@ -4187,12 +4396,14 @@
|
|||
"type": "string"
|
||||
},
|
||||
"createdAt": {
|
||||
"description": "创建时间",
|
||||
"type": "string"
|
||||
},
|
||||
"dataScope": {
|
||||
"type": "string"
|
||||
},
|
||||
"deletedAt": {
|
||||
"description": "删除时间",
|
||||
"type": "string"
|
||||
},
|
||||
"deptId": {
|
||||
|
@ -4237,6 +4448,7 @@
|
|||
"type": "string"
|
||||
},
|
||||
"updatedAt": {
|
||||
"description": "更新时间",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
|
@ -4255,12 +4467,14 @@
|
|||
"type": "string"
|
||||
},
|
||||
"createdAt": {
|
||||
"description": "创建时间",
|
||||
"type": "string"
|
||||
},
|
||||
"dataScope": {
|
||||
"type": "string"
|
||||
},
|
||||
"deletedAt": {
|
||||
"description": "删除时间",
|
||||
"type": "string"
|
||||
},
|
||||
"id": {
|
||||
|
@ -4289,6 +4503,7 @@
|
|||
"type": "string"
|
||||
},
|
||||
"updatedAt": {
|
||||
"description": "更新时间",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
|
@ -4308,6 +4523,7 @@
|
|||
"type": "string"
|
||||
},
|
||||
"createdAt": {
|
||||
"description": "创建时间",
|
||||
"type": "string"
|
||||
},
|
||||
"dataScope": {
|
||||
|
@ -4315,6 +4531,7 @@
|
|||
"type": "string"
|
||||
},
|
||||
"deletedAt": {
|
||||
"description": "删除时间",
|
||||
"type": "string"
|
||||
},
|
||||
"deptName": {
|
||||
|
@ -4390,6 +4607,7 @@
|
|||
"type": "string"
|
||||
},
|
||||
"updatedAt": {
|
||||
"description": "更新时间",
|
||||
"type": "string"
|
||||
},
|
||||
"userAgent": {
|
||||
|
@ -4408,12 +4626,14 @@
|
|||
"type": "string"
|
||||
},
|
||||
"createdAt": {
|
||||
"description": "创建时间",
|
||||
"type": "string"
|
||||
},
|
||||
"dataScope": {
|
||||
"type": "string"
|
||||
},
|
||||
"deletedAt": {
|
||||
"description": "删除时间",
|
||||
"type": "string"
|
||||
},
|
||||
"deptIds": {
|
||||
|
@ -4461,6 +4681,7 @@
|
|||
"type": "string"
|
||||
},
|
||||
"updatedAt": {
|
||||
"description": "更新时间",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
|
@ -4487,12 +4708,14 @@
|
|||
"type": "string"
|
||||
},
|
||||
"createdAt": {
|
||||
"description": "创建时间",
|
||||
"type": "string"
|
||||
},
|
||||
"dataScope": {
|
||||
"type": "string"
|
||||
},
|
||||
"deletedAt": {
|
||||
"description": "删除时间",
|
||||
"type": "string"
|
||||
},
|
||||
"deptId": {
|
||||
|
@ -4553,6 +4776,7 @@
|
|||
"type": "string"
|
||||
},
|
||||
"updatedAt": {
|
||||
"description": "更新时间",
|
||||
"type": "string"
|
||||
},
|
||||
"userId": {
|
||||
|
|
|
@ -53,7 +53,7 @@ definitions:
|
|||
description: 主供应商
|
||||
type: integer
|
||||
imei_type:
|
||||
description: 1-无串码 2-串码
|
||||
description: 1-无串码 2-串码(系统生成) 3-串码(手动添加)
|
||||
type: integer
|
||||
member_discount:
|
||||
description: 会员优惠
|
||||
|
@ -125,7 +125,7 @@ definitions:
|
|||
description: 商品id
|
||||
type: integer
|
||||
imei_type:
|
||||
description: 1-无串码 2-串码
|
||||
description: 1-无串码 2-串码(系统生成) 3-串码(手动添加)
|
||||
type: integer
|
||||
member_discount:
|
||||
description: 会员优惠
|
||||
|
@ -332,11 +332,13 @@ definitions:
|
|||
description: 合作商id
|
||||
type: integer
|
||||
createdAt:
|
||||
description: 创建时间
|
||||
type: string
|
||||
display:
|
||||
description: 1 展示 0 隐藏
|
||||
type: integer
|
||||
id:
|
||||
description: 数据库记录编号
|
||||
type: integer
|
||||
name:
|
||||
description: 分类名称
|
||||
|
@ -348,17 +350,33 @@ definitions:
|
|||
description: 父分类的编号
|
||||
type: integer
|
||||
type: object
|
||||
models.CategoryExcel:
|
||||
properties:
|
||||
first_category:
|
||||
description: 一级分类
|
||||
type: string
|
||||
second_category:
|
||||
description: 二级分类
|
||||
type: string
|
||||
three_category:
|
||||
description: 三级分类
|
||||
type: string
|
||||
required:
|
||||
- first_category
|
||||
type: object
|
||||
models.CategoryModel:
|
||||
properties:
|
||||
cooperative_business_id:
|
||||
description: 合作商id
|
||||
type: integer
|
||||
createdAt:
|
||||
description: 创建时间
|
||||
type: string
|
||||
display:
|
||||
description: 1 展示 0 隐藏
|
||||
type: integer
|
||||
id:
|
||||
description: 数据库记录编号
|
||||
type: integer
|
||||
name:
|
||||
description: 分类名称
|
||||
|
@ -375,16 +393,76 @@ definitions:
|
|||
$ref: '#/definitions/models.CategoryModel'
|
||||
type: array
|
||||
type: object
|
||||
models.CommodityExcel:
|
||||
properties:
|
||||
category:
|
||||
description: 商品所属分类
|
||||
type: string
|
||||
imei_type:
|
||||
description: 是否串码 1-无串码 2-串码(系统生成) 3-串码(手动添加)
|
||||
type: string
|
||||
member_discount:
|
||||
description: 会员优惠
|
||||
type: string
|
||||
min_retail_price:
|
||||
description: 最低零售价
|
||||
type: string
|
||||
name:
|
||||
description: 商品名称
|
||||
type: string
|
||||
origin:
|
||||
description: 产地
|
||||
type: string
|
||||
remark:
|
||||
description: 备注
|
||||
type: string
|
||||
retail_price:
|
||||
description: 指导零售价
|
||||
type: string
|
||||
sell_brokerage:
|
||||
description: 销售毛利提成
|
||||
type: string
|
||||
staff_brokerage:
|
||||
description: 员工毛利提成
|
||||
type: string
|
||||
staff_cost_price:
|
||||
description: 员工成本价加价
|
||||
type: string
|
||||
supplier_name:
|
||||
description: 供应商名称
|
||||
type: string
|
||||
sys_generate:
|
||||
description: 系统生成串码
|
||||
type: string
|
||||
wholesale_price:
|
||||
description: 指导采购价
|
||||
type: string
|
||||
required:
|
||||
- category
|
||||
- imei_type
|
||||
- member_discount
|
||||
- min_retail_price
|
||||
- name
|
||||
- retail_price
|
||||
- sell_brokerage
|
||||
- staff_brokerage
|
||||
- staff_cost_price
|
||||
- supplier_name
|
||||
- sys_generate
|
||||
- wholesale_price
|
||||
type: object
|
||||
models.DictType:
|
||||
properties:
|
||||
createBy:
|
||||
description: 创建者
|
||||
type: string
|
||||
createdAt:
|
||||
description: 创建时间
|
||||
type: string
|
||||
dataScope:
|
||||
type: string
|
||||
deletedAt:
|
||||
description: 删除时间
|
||||
type: string
|
||||
dictId:
|
||||
type: integer
|
||||
|
@ -406,15 +484,18 @@ definitions:
|
|||
description: 更新者
|
||||
type: string
|
||||
updatedAt:
|
||||
description: 更新时间
|
||||
type: string
|
||||
type: object
|
||||
models.ErpCategory:
|
||||
properties:
|
||||
createdAt:
|
||||
description: 创建时间
|
||||
type: string
|
||||
full_num:
|
||||
type: integer
|
||||
id:
|
||||
description: 数据库记录编号
|
||||
type: integer
|
||||
level:
|
||||
description: 分类层级
|
||||
|
@ -449,6 +530,7 @@ definitions:
|
|||
description: 员工毛利提成
|
||||
type: number
|
||||
createdAt:
|
||||
description: 创建时间
|
||||
type: string
|
||||
erp_category:
|
||||
$ref: '#/definitions/models.ErpCategory'
|
||||
|
@ -465,12 +547,13 @@ definitions:
|
|||
description: 主供应商名称
|
||||
type: string
|
||||
id:
|
||||
description: 数据库记录编号
|
||||
type: integer
|
||||
imei:
|
||||
description: 串码
|
||||
type: string
|
||||
imei_type:
|
||||
description: 1-无串码 2-串码
|
||||
description: 1-无串码 2-串码(系统生成) 3-串码(手动添加)
|
||||
type: integer
|
||||
member_discount:
|
||||
description: 会员优惠
|
||||
|
@ -506,36 +589,47 @@ definitions:
|
|||
models.ErpCommodityListReq:
|
||||
properties:
|
||||
erp_category_id:
|
||||
description: 商品分类id
|
||||
type: integer
|
||||
erp_commodity_name:
|
||||
description: 商品名称
|
||||
type: string
|
||||
erp_supplier_id:
|
||||
description: 供应商id
|
||||
type: integer
|
||||
imei:
|
||||
description: 串码
|
||||
type: string
|
||||
is_export:
|
||||
description: 1-导出
|
||||
type: integer
|
||||
page_num:
|
||||
description: 页码
|
||||
type: integer
|
||||
page_size:
|
||||
description: 每页展示数据条数
|
||||
type: integer
|
||||
serial_number:
|
||||
description: 商品编号
|
||||
type: string
|
||||
type: object
|
||||
models.ErpCommodityListResp:
|
||||
properties:
|
||||
export_url:
|
||||
description: 1-导出
|
||||
type: string
|
||||
list:
|
||||
items:
|
||||
$ref: '#/definitions/models.ErpCommodity'
|
||||
type: array
|
||||
page_num:
|
||||
description: 页码
|
||||
type: integer
|
||||
page_size:
|
||||
description: 每页展示数据条数
|
||||
type: integer
|
||||
total:
|
||||
description: 总页数
|
||||
type: integer
|
||||
type: object
|
||||
models.Login:
|
||||
|
@ -567,11 +661,13 @@ definitions:
|
|||
description: 创建人
|
||||
type: string
|
||||
createdAt:
|
||||
description: 创建时间
|
||||
type: string
|
||||
dataScope:
|
||||
description: 数据
|
||||
type: string
|
||||
deletedAt:
|
||||
description: 删除时间
|
||||
type: string
|
||||
infoId:
|
||||
description: 主键
|
||||
|
@ -605,6 +701,7 @@ definitions:
|
|||
description: 更新者
|
||||
type: string
|
||||
updatedAt:
|
||||
description: 更新时间
|
||||
type: string
|
||||
username:
|
||||
description: 用户名
|
||||
|
@ -625,10 +722,12 @@ definitions:
|
|||
createBy:
|
||||
type: string
|
||||
createdAt:
|
||||
description: 创建时间
|
||||
type: string
|
||||
dataScope:
|
||||
type: string
|
||||
deletedAt:
|
||||
description: 删除时间
|
||||
type: string
|
||||
icon:
|
||||
type: string
|
||||
|
@ -663,6 +762,7 @@ definitions:
|
|||
updateBy:
|
||||
type: string
|
||||
updatedAt:
|
||||
description: 更新时间
|
||||
type: string
|
||||
visible:
|
||||
type: string
|
||||
|
@ -672,10 +772,12 @@ definitions:
|
|||
createBy:
|
||||
type: string
|
||||
createdAt:
|
||||
description: 创建时间
|
||||
type: string
|
||||
dataScope:
|
||||
type: string
|
||||
deletedAt:
|
||||
description: 删除时间
|
||||
type: string
|
||||
params:
|
||||
type: string
|
||||
|
@ -700,6 +802,7 @@ definitions:
|
|||
updateBy:
|
||||
type: string
|
||||
updatedAt:
|
||||
description: 更新时间
|
||||
type: string
|
||||
type: object
|
||||
models.Supplier:
|
||||
|
@ -729,11 +832,13 @@ definitions:
|
|||
description: 合作商id
|
||||
type: integer
|
||||
createdAt:
|
||||
description: 创建时间
|
||||
type: string
|
||||
email:
|
||||
description: 邮件
|
||||
type: string
|
||||
id:
|
||||
description: 数据库记录编号
|
||||
type: integer
|
||||
landline:
|
||||
description: 固定电话
|
||||
|
@ -766,10 +871,12 @@ definitions:
|
|||
description: 创建者
|
||||
type: string
|
||||
createdAt:
|
||||
description: 创建时间
|
||||
type: string
|
||||
dataScope:
|
||||
type: string
|
||||
deletedAt:
|
||||
description: 删除时间
|
||||
type: string
|
||||
id:
|
||||
description: 分类Id
|
||||
|
@ -795,6 +902,7 @@ definitions:
|
|||
description: 更新者
|
||||
type: string
|
||||
updatedAt:
|
||||
description: 更新时间
|
||||
type: string
|
||||
type: object
|
||||
models.SysConfig:
|
||||
|
@ -817,10 +925,12 @@ definitions:
|
|||
createBy:
|
||||
type: string
|
||||
createdAt:
|
||||
description: 创建时间
|
||||
type: string
|
||||
dataScope:
|
||||
type: string
|
||||
deletedAt:
|
||||
description: 删除时间
|
||||
type: string
|
||||
params:
|
||||
type: string
|
||||
|
@ -830,6 +940,7 @@ definitions:
|
|||
updateBy:
|
||||
type: string
|
||||
updatedAt:
|
||||
description: 更新时间
|
||||
type: string
|
||||
type: object
|
||||
models.SysContent:
|
||||
|
@ -844,10 +955,12 @@ definitions:
|
|||
description: 创建者
|
||||
type: string
|
||||
createdAt:
|
||||
description: 创建时间
|
||||
type: string
|
||||
dataScope:
|
||||
type: string
|
||||
deletedAt:
|
||||
description: 删除时间
|
||||
type: string
|
||||
id:
|
||||
description: id
|
||||
|
@ -873,6 +986,7 @@ definitions:
|
|||
description: 更新者
|
||||
type: string
|
||||
updatedAt:
|
||||
description: 更新时间
|
||||
type: string
|
||||
type: object
|
||||
models.SysDept:
|
||||
|
@ -884,10 +998,12 @@ definitions:
|
|||
createBy:
|
||||
type: string
|
||||
createdAt:
|
||||
description: 创建时间
|
||||
type: string
|
||||
dataScope:
|
||||
type: string
|
||||
deletedAt:
|
||||
description: 删除时间
|
||||
type: string
|
||||
deptId:
|
||||
description: 部门编码
|
||||
|
@ -920,6 +1036,7 @@ definitions:
|
|||
updateBy:
|
||||
type: string
|
||||
updatedAt:
|
||||
description: 更新时间
|
||||
type: string
|
||||
type: object
|
||||
models.SysFileDir:
|
||||
|
@ -932,10 +1049,12 @@ definitions:
|
|||
description: 创建人
|
||||
type: string
|
||||
createdAt:
|
||||
description: 创建时间
|
||||
type: string
|
||||
dataScope:
|
||||
type: string
|
||||
deletedAt:
|
||||
description: 删除时间
|
||||
type: string
|
||||
id:
|
||||
type: integer
|
||||
|
@ -956,6 +1075,7 @@ definitions:
|
|||
description: 编辑人
|
||||
type: string
|
||||
updatedAt:
|
||||
description: 更新时间
|
||||
type: string
|
||||
type: object
|
||||
models.SysOperLog:
|
||||
|
@ -969,11 +1089,13 @@ definitions:
|
|||
description: 创建人
|
||||
type: string
|
||||
createdAt:
|
||||
description: 创建时间
|
||||
type: string
|
||||
dataScope:
|
||||
description: 数据
|
||||
type: string
|
||||
deletedAt:
|
||||
description: 删除时间
|
||||
type: string
|
||||
deptName:
|
||||
description: 部门名称
|
||||
|
@ -1030,6 +1152,7 @@ definitions:
|
|||
description: 更新者
|
||||
type: string
|
||||
updatedAt:
|
||||
description: 更新时间
|
||||
type: string
|
||||
userAgent:
|
||||
description: ua
|
||||
|
@ -1042,10 +1165,12 @@ definitions:
|
|||
createBy:
|
||||
type: string
|
||||
createdAt:
|
||||
description: 创建时间
|
||||
type: string
|
||||
dataScope:
|
||||
type: string
|
||||
deletedAt:
|
||||
description: 删除时间
|
||||
type: string
|
||||
deptIds:
|
||||
items:
|
||||
|
@ -1079,6 +1204,7 @@ definitions:
|
|||
updateBy:
|
||||
type: string
|
||||
updatedAt:
|
||||
description: 更新时间
|
||||
type: string
|
||||
type: object
|
||||
models.SysUser:
|
||||
|
@ -1097,10 +1223,12 @@ definitions:
|
|||
createBy:
|
||||
type: string
|
||||
createdAt:
|
||||
description: 创建时间
|
||||
type: string
|
||||
dataScope:
|
||||
type: string
|
||||
deletedAt:
|
||||
description: 删除时间
|
||||
type: string
|
||||
deptId:
|
||||
description: 部门编码
|
||||
|
@ -1145,6 +1273,7 @@ definitions:
|
|||
updateBy:
|
||||
type: string
|
||||
updatedAt:
|
||||
description: 更新时间
|
||||
type: string
|
||||
userId:
|
||||
description: 编码
|
||||
|
@ -1523,6 +1652,52 @@ paths:
|
|||
summary: 编辑商品
|
||||
tags:
|
||||
- 商品资料
|
||||
/api/v1/commodity/import_category_view:
|
||||
post:
|
||||
consumes:
|
||||
- application/json
|
||||
parameters:
|
||||
- description: 上传excel文件
|
||||
in: body
|
||||
name: file
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
items:
|
||||
$ref: '#/definitions/models.CategoryExcel'
|
||||
type: array
|
||||
summary: 导入商品分类预览
|
||||
tags:
|
||||
- 商品分类
|
||||
/api/v1/commodity/import_commodity_view:
|
||||
post:
|
||||
consumes:
|
||||
- application/json
|
||||
parameters:
|
||||
- description: 上传excel文件
|
||||
in: body
|
||||
name: file
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
items:
|
||||
$ref: '#/definitions/models.CommodityExcel'
|
||||
type: array
|
||||
summary: 导入商品资料预览
|
||||
tags:
|
||||
- 商品资料
|
||||
/api/v1/commodity/list:
|
||||
post:
|
||||
consumes:
|
||||
|
|
BIN
static/导分类.xlsx
Normal file
BIN
static/导分类.xlsx
Normal file
Binary file not shown.
BIN
static/导商品.xlsx
Normal file
BIN
static/导商品.xlsx
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user