jiangshuai
2023-09-20 6becb6b281b34e17197a25af86acd35628e88811
Merge branch 'master' of http://192.168.5.5:10010/r/aps/WMS
1个文件已删除
12个文件已修改
1815 ■■■■ 已修改文件
controllers/location.go 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
controllers/warehouse.go 125 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
docs/docs.go 435 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
docs/swagger.json 435 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
docs/swagger.yaml 304 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
models/location.go 56 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
models/material.go 83 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
models/product.go 294 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
models/product_category.go 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
models/warehouse.go 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
request/location.go 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
request/warehouse.go 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
router/router.go 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
controllers/location.go
@@ -26,7 +26,7 @@
    if params.Keyword != "" {
        search.SetKeyword(params.Keyword)
    }
    if params.ParentId != 0 {
    if params.ParentId != "" {
        search.SetParentId(params.ParentId)
    }
    if params.CompanyId != 0 {
@@ -43,7 +43,7 @@
    if params.Type == 0 {
        return errors.New("请选择正确的位置类型")
    }
    if params.ParentId < 0 {
    if params.ParentId == "" {
        return errors.New("错误参数ParentId")
    }
    if params.CompanyId < 0 {
controllers/warehouse.go
@@ -6,6 +6,8 @@
    "github.com/gin-gonic/gin"
    "github.com/spf13/cast"
    "gorm.io/gorm"
    "strconv"
    "wms/constvar"
    "wms/extend/code"
    "wms/extend/util"
    "wms/models"
@@ -39,6 +41,19 @@
        util.ResponseFormat(c, code.RequestParamError, err.Error())
        return
    }
    //创建默认位置
    location := &models.Location{
        Name:              "默认位置",
        ParentId:          params.Code,
        Type:              constvar.LocationTypeInternal,
        ReplenishLocation: true,
    }
    locationId, err := models.NewLocationSearch().CreateReturnId(location)
    if err != nil {
        util.ResponseFormat(c, code.SaveFail, "位置创建失败")
        return
    }
    params.LocationId = locationId
    if err := models.NewWarehouseSearch().Create(&params); err != nil {
        logx.Errorf("warehouse create err: %v", err)
        util.ResponseFormat(c, code.SaveFail, "插入失败")
@@ -48,39 +63,24 @@
    util.ResponseFormat(c, code.Success, "添加成功")
}
// Update
// UpdateWarehouse
// @Tags      仓库
// @Summary   编辑仓库
// @Produce   application/json
// @Param     object  body request.UpdateWarehouse true  "仓库信息"
// @Param     id  path string true  "仓库id"
// @Param     object  body  models.Warehouse true  "仓库信息"
// @Success   200 {object} util.Response "成功"
// @Router    /api-wms/v1/warehouse/warehouse/{id} [put]
func (slf WarehouseController) Update(c *gin.Context) {
    id := cast.ToUint(c.Param("id"))
    if id == 0 {
        util.ResponseFormat(c, code.RequestParamError, "空的记录id")
        return
    }
    var (
        reqParams request.UpdateWarehouse
        params    models.Warehouse
    )
    if err := c.BindJSON(&reqParams); err != nil {
// @Router    /api-wms/v1/warehouse/updateWarehouse [post]
func (slf WarehouseController) UpdateWarehouse(c *gin.Context) {
    var params models.Warehouse
    if err := c.BindJSON(&params); err != nil {
        util.ResponseFormat(c, code.RequestParamError, fmt.Sprintf("参数解析失败: %v"+err.Error()))
        return
    }
    if err := structx.AssignTo(reqParams, &params); err != nil {
        util.ResponseFormat(c, code.RequestParamError, fmt.Sprintf("数据转换错误: %v", err.Error()))
        return
    }
    params.ID = id
    if err := slf.ParamsCheck(params); err != nil {
        util.ResponseFormat(c, code.RequestParamError, err.Error())
        return
    }
    err := models.NewWarehouseSearch().SetID(params.ID).Update(&params)
    err := models.NewWarehouseSearch().SetID(params.Id).Update(&params)
    if err != nil {
        util.ResponseFormat(c, code.RequestParamError, "修改失败")
@@ -92,19 +92,31 @@
func (slf WarehouseController) ParamsCheck(params models.Warehouse) (err error) {
    var oldRecord *models.Warehouse
    if params.ID != 0 {
        oldRecord, err = models.NewWarehouseSearch().SetID(params.ID).First()
    if params.Id != 0 {
        oldRecord, err = models.NewWarehouseSearch().SetID(params.Id).First()
        if err == gorm.ErrRecordNotFound {
            return errors.New("记录不存在")
        }
    }
    if oldRecord == nil || params.Code != oldRecord.Code {
        _, err = models.NewWarehouseSearch().SetCode(params.Code).First()
        if err != gorm.ErrRecordNotFound {
    //更新位置信息
    if oldRecord != nil && params.Code != oldRecord.Code {
        m := make(map[string]interface{})
        m["parent_id"] = params.Code
        err := models.NewLocationSearch().SetID(oldRecord.LocationId).UpdateByMap(m)
        if err != nil {
            return errors.New("更新位置信息失败")
        }
    }
    if oldRecord == nil {
        record, err := models.NewWarehouseSearch().SetCode(params.Code).First()
        if record != nil && record.Code == params.Code {
            fmt.Println(err)
            return errors.New("仓库编号重复")
        }
    }
    if params.Code == "" {
        return errors.New("缩写不能为空")
    }
    return nil
}
@@ -126,6 +138,24 @@
        util.ResponseFormat(c, code.RequestParamError, "查找失败")
        return
    }
    //获取位置信息
    codes := make([]string, 0)
    for _, warehouse := range list {
        codes = append(codes, warehouse.Code)
    }
    locations, err := models.NewLocationSearch().SetParents(codes).FindNotTotal()
    if err != nil {
        util.ResponseFormat(c, code.RequestParamError, "位置信息查找失败")
        return
    }
    for _, warehouse := range list {
        for _, location := range locations {
            if warehouse.LocationId == location.Id {
                warehouse.WarehouseLocation = warehouse.Code + "/" + location.Name
                break
            }
        }
    }
    util.ResponseFormatList(c, code.Success, list, cast.ToInt(total))
}
@@ -138,16 +168,49 @@
// @Success   200 {object} util.Response "成功"
// @Router    /api-wms/v1/warehouse/warehouse/{id} [delete]
func (slf WarehouseController) Delete(c *gin.Context) {
    id := cast.ToUint(c.Param("id"))
    id, _ := strconv.Atoi(c.Param("id"))
    if id == 0 {
        util.ResponseFormat(c, code.RequestParamError, "空的记录id")
        return
    }
    err := models.NewWarehouseSearch().SetID(id).Delete()
    //删除位置信息
    first, err := models.NewWarehouseSearch().SetID(id).First()
    if err != nil {
        util.ResponseFormat(c, code.RequestParamError, "删除失败")
        util.ResponseFormat(c, code.RequestParamError, "获取仓库信息失败")
        return
    }
    err = models.NewLocationSearch().SetID(first.LocationId).Delete()
    if err != nil {
        util.ResponseFormat(c, code.RequestParamError, "删除位置信息失败")
        return
    }
    err = models.NewWarehouseSearch().SetID(id).Delete()
    if err != nil {
        util.ResponseFormat(c, code.RequestParamError, "删除仓库信息失败")
        return
    }
    util.ResponseFormat(c, code.UpdateSuccess, "删除成功")
}
// GetWarehouseDetails
// @Tags      仓库
// @Summary   获取仓库详情
// @Produce   application/json
// @Param     id  path string true  "仓库id"
// @Success   200 {object} util.Response{data=models.Warehouse}    "成功"
// @Router    /api-wms/v1/warehouse/getWarehouseDetails/{id} [get]
func (slf WarehouseController) GetWarehouseDetails(c *gin.Context) {
    id, _ := strconv.Atoi(c.Param("id"))
    if id == 0 {
        util.ResponseFormat(c, code.RequestParamError, "空的记录id")
        return
    }
    first, err := models.NewWarehouseSearch().SetID(id).First()
    if err != nil {
        util.ResponseFormat(c, code.RequestParamError, "获取仓库信息失败")
        return
    }
    util.ResponseFormat(c, code.UpdateSuccess, first)
}
docs/docs.go
@@ -426,6 +426,150 @@
                }
            }
        },
        "/api-wms/v1/operationType/operationType": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "作业类型"
                ],
                "summary": "查询作业类型列表",
                "parameters": [
                    {
                        "type": "string",
                        "name": "keyword",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "页码",
                        "name": "page",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "每页大小",
                        "name": "pageSize",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "成功",
                        "schema": {
                            "allOf": [
                                {
                                    "$ref": "#/definitions/util.ResponseList"
                                },
                                {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/definitions/models.OperationType"
                                            }
                                        }
                                    }
                                }
                            ]
                        }
                    }
                }
            },
            "post": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "作业类型"
                ],
                "summary": "添加作业类型",
                "parameters": [
                    {
                        "description": "作业类型信息",
                        "name": "object",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/request.AddOperationType"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "成功",
                        "schema": {
                            "$ref": "#/definitions/util.Response"
                        }
                    }
                }
            }
        },
        "/api-wms/v1/operationType/operationType/{id}": {
            "put": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "作业类型"
                ],
                "summary": "编辑作业类型",
                "parameters": [
                    {
                        "description": "作业类型信息",
                        "name": "object",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/request.UpdateOperationType"
                        }
                    },
                    {
                        "type": "string",
                        "description": "作业类型id",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "成功",
                        "schema": {
                            "$ref": "#/definitions/util.Response"
                        }
                    }
                }
            },
            "delete": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "作业类型"
                ],
                "summary": "删除作业类型",
                "parameters": [
                    {
                        "type": "string",
                        "description": "作业类型id",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "成功",
                        "schema": {
                            "$ref": "#/definitions/util.Response"
                        }
                    }
                }
            }
        },
        "/api-wms/v1/product/addProduct": {
            "post": {
                "produces": [
@@ -772,32 +916,22 @@
                }
            }
        },
        "/api-wms/v1/warehouse/operationType": {
        "/api-wms/v1/warehouse/getWarehouseDetails/{id}": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "作业类型"
                    "仓库"
                ],
                "summary": "查询作业类型列表",
                "summary": "获取仓库详情",
                "parameters": [
                    {
                        "type": "string",
                        "name": "keyword",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "页码",
                        "name": "page",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "每页大小",
                        "name": "pageSize",
                        "in": "query"
                        "description": "仓库id",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
@@ -806,16 +940,13 @@
                        "schema": {
                            "allOf": [
                                {
                                    "$ref": "#/definitions/util.ResponseList"
                                    "$ref": "#/definitions/util.Response"
                                },
                                {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/definitions/models.OperationType"
                                            }
                                            "$ref": "#/definitions/models.Warehouse"
                                        }
                                    }
                                }
@@ -823,87 +954,26 @@
                        }
                    }
                }
            },
            }
        },
        "/api-wms/v1/warehouse/updateWarehouse": {
            "post": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "作业类型"
                    "仓库"
                ],
                "summary": "添加作业类型",
                "summary": "编辑仓库",
                "parameters": [
                    {
                        "description": "作业类型信息",
                        "description": "仓库信息",
                        "name": "object",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/request.AddOperationType"
                            "$ref": "#/definitions/models.Warehouse"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "成功",
                        "schema": {
                            "$ref": "#/definitions/util.Response"
                        }
                    }
                }
            }
        },
        "/api-wms/v1/warehouse/operationType/{id}": {
            "put": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "作业类型"
                ],
                "summary": "编辑作业类型",
                "parameters": [
                    {
                        "description": "作业类型信息",
                        "name": "object",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/request.UpdateOperationType"
                        }
                    },
                    {
                        "type": "string",
                        "description": "作业类型id",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "成功",
                        "schema": {
                            "$ref": "#/definitions/util.Response"
                        }
                    }
                }
            },
            "delete": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "作业类型"
                ],
                "summary": "删除作业类型",
                "parameters": [
                    {
                        "type": "string",
                        "description": "作业类型id",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
@@ -998,41 +1068,6 @@
            }
        },
        "/api-wms/v1/warehouse/warehouse/{id}": {
            "put": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "仓库"
                ],
                "summary": "编辑仓库",
                "parameters": [
                    {
                        "description": "仓库信息",
                        "name": "object",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/request.UpdateWarehouse"
                        }
                    },
                    {
                        "type": "string",
                        "description": "仓库id",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "成功",
                        "schema": {
                            "$ref": "#/definitions/util.Response"
                        }
                    }
                }
            },
            "delete": {
                "produces": [
                    "application/json"
@@ -1235,6 +1270,24 @@
                "TaskAndObject"
            ]
        },
        "constvar.ProductType": {
            "type": "integer",
            "enum": [
                1,
                2,
                3
            ],
            "x-enum-comments": {
                "Consumables": "消耗品",
                "Server": "服务",
                "StoredProduct": "可储存的产品"
            },
            "x-enum-varnames": [
                "Consumables",
                "Server",
                "StoredProduct"
            ]
        },
        "constvar.ReservationMethod": {
            "type": "integer",
            "enum": [
@@ -1366,7 +1419,7 @@
                },
                "parentId": {
                    "description": "上级id",
                    "type": "integer"
                    "type": "string"
                },
                "replenishLocation": {
                    "description": "是否补充位置",
@@ -1389,9 +1442,11 @@
            "type": "object",
            "properties": {
                "HSCode": {
                    "description": "HS编码",
                    "type": "string"
                },
                "amount": {
                    "description": "数量",
                    "type": "number"
                },
                "barcode": {
@@ -1399,6 +1454,7 @@
                    "type": "string"
                },
                "buyExplain": {
                    "description": "采购说明",
                    "type": "string"
                },
                "canBePurchased": {
@@ -1409,20 +1465,32 @@
                    "description": "产品类别id",
                    "type": "integer"
                },
                "categoryName": {
                    "description": "产品类别名称",
                    "type": "string"
                },
                "companyId": {
                    "description": "公司id",
                    "type": "integer"
                },
                "companyName": {
                    "description": "公司名称",
                    "type": "string"
                },
                "controlStrategy": {
                    "$ref": "#/definitions/constvar.InvoicingStrategy"
                    "description": "控制策略",
                    "allOf": [
                        {
                            "$ref": "#/definitions/constvar.InvoicingStrategy"
                        }
                    ]
                },
                "cost": {
                    "description": "成本",
                    "type": "number"
                },
                "currencyName": {
                    "description": "币种名称",
                    "type": "string"
                },
                "customerTaxes": {
@@ -1430,12 +1498,14 @@
                    "type": "number"
                },
                "deliveryAdvanceTime": {
                    "description": "交货提前时间(天)",
                    "type": "integer"
                },
                "id": {
                    "type": "string"
                },
                "inStorageExplain": {
                    "description": "入库说明",
                    "type": "string"
                },
                "internalNotes": {
@@ -1447,10 +1517,11 @@
                    "type": "string"
                },
                "internalTransferExplain": {
                    "description": "内部调拨说明",
                    "type": "string"
                },
                "invoicingStrategy": {
                    "description": "wms添加字段",
                    "description": "开票策略",
                    "allOf": [
                        {
                            "$ref": "#/definitions/constvar.InvoicingStrategy"
@@ -1462,6 +1533,7 @@
                    "type": "boolean"
                },
                "maxInventory": {
                    "description": "最大库存",
                    "type": "number"
                },
                "minInventory": {
@@ -1481,18 +1553,27 @@
                    ]
                },
                "name": {
                    "description": "物料名称",
                    "type": "string"
                },
                "orderCreation": {
                    "$ref": "#/definitions/constvar.OrderCreation"
                    "description": "订单创建",
                    "allOf": [
                        {
                            "$ref": "#/definitions/constvar.OrderCreation"
                        }
                    ]
                },
                "originCountryId": {
                    "description": "原产地id",
                    "type": "integer"
                },
                "originCountryName": {
                    "description": "原产地名称",
                    "type": "string"
                },
                "outStorageExplain": {
                    "description": "出库说明",
                    "type": "string"
                },
                "principal": {
@@ -1500,26 +1581,43 @@
                    "type": "string"
                },
                "productTagId": {
                    "description": "产品标签",
                    "description": "产品标签id",
                    "type": "integer"
                },
                "productTagName": {
                    "description": "产品标签名称",
                    "type": "string"
                },
                "productType": {
                    "description": "wms添加字段",
                    "allOf": [
                        {
                            "$ref": "#/definitions/constvar.ProductType"
                        }
                    ]
                },
                "purchasePrice": {
                    "description": "采购价格",
                    "type": "number"
                },
                "salePrice": {
                    "description": "销售单价",
                    "type": "number"
                },
                "selectProduct": {
                    "description": "可选产品id",
                    "type": "integer"
                },
                "sellExplain": {
                    "description": "销售说明",
                    "type": "string"
                },
                "supplier": {
                    "description": "FSource           string                  ` + "`" + `gorm:\"type:varchar(191);comment:生产车间\" json:\"-\"` + "`" + `\nStatus            constvar.MaterialStatus ` + "`" + `gorm:\"type:int(11);comment:状态\" json:\"status\"` + "`" + `",
                    "type": "string"
                },
                "templateID": {
                    "description": "Note              string                  ` + "`" + `gorm:\"type:varchar(1024);comment:备注\" json:\"note\"` + "`" + `",
                    "type": "string"
                },
                "unit": {
@@ -1689,6 +1787,7 @@
                    "type": "integer"
                },
                "routeId": {
                    "description": "路线id",
                    "type": "integer"
                },
                "routeName": {
@@ -1706,6 +1805,10 @@
                "active": {
                    "description": "是否启用,传true就行",
                    "type": "boolean"
                },
                "address": {
                    "description": "地址",
                    "type": "string"
                },
                "buyToResupply": {
                    "description": "是否购买补给,已购买产品能够发送到此仓库",
@@ -1729,9 +1832,21 @@
                "id": {
                    "type": "integer"
                },
                "inboundTransportation": {
                    "description": "入向运输",
                    "type": "integer"
                },
                "locationId": {
                    "description": "位置id",
                    "type": "integer"
                },
                "name": {
                    "description": "仓库名称",
                    "type": "string"
                },
                "outboundTransportation": {
                    "description": "出库运输",
                    "type": "integer"
                },
                "partnerId": {
                    "description": "合作伙伴id",
@@ -1752,6 +1867,10 @@
                    }
                },
                "updateTime": {
                    "type": "string"
                },
                "warehouseLocation": {
                    "description": "库存位置",
                    "type": "string"
                }
            }
@@ -1940,6 +2059,10 @@
                    "description": "是否启用,传true就行",
                    "type": "boolean"
                },
                "address": {
                    "description": "地址",
                    "type": "string"
                },
                "buyToResupply": {
                    "description": "购买补给,已购买产品能够发送到此仓库",
                    "type": "boolean"
@@ -1950,9 +2073,21 @@
                    "maxLength": 5,
                    "minLength": 1
                },
                "inboundTransportation": {
                    "description": "入向运输",
                    "type": "integer"
                },
                "locationId": {
                    "description": "位置id",
                    "type": "integer"
                },
                "name": {
                    "description": "仓库名称",
                    "type": "string"
                },
                "outboundTransportation": {
                    "description": "出库运输",
                    "type": "integer"
                },
                "partnerId": {
                    "description": "合作伙伴id",
@@ -2181,46 +2316,6 @@
                "warehouseId": {
                    "description": "仓库id",
                    "type": "integer"
                }
            }
        },
        "request.UpdateWarehouse": {
            "type": "object",
            "required": [
                "code"
            ],
            "properties": {
                "active": {
                    "description": "是否启用,传true就行",
                    "type": "boolean"
                },
                "buyToResupply": {
                    "description": "购买补给,已购买产品能够发送到此仓库",
                    "type": "boolean"
                },
                "code": {
                    "description": "仓库编码",
                    "type": "string",
                    "maxLength": 5,
                    "minLength": 1
                },
                "id": {
                    "type": "integer"
                },
                "name": {
                    "description": "仓库名称",
                    "type": "string"
                },
                "partnerId": {
                    "description": "合作伙伴id",
                    "type": "integer"
                },
                "resupplyWhIds": {
                    "description": "补给来源仓库ID",
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                }
            }
        },
docs/swagger.json
@@ -414,6 +414,150 @@
                }
            }
        },
        "/api-wms/v1/operationType/operationType": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "作业类型"
                ],
                "summary": "查询作业类型列表",
                "parameters": [
                    {
                        "type": "string",
                        "name": "keyword",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "页码",
                        "name": "page",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "每页大小",
                        "name": "pageSize",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "成功",
                        "schema": {
                            "allOf": [
                                {
                                    "$ref": "#/definitions/util.ResponseList"
                                },
                                {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/definitions/models.OperationType"
                                            }
                                        }
                                    }
                                }
                            ]
                        }
                    }
                }
            },
            "post": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "作业类型"
                ],
                "summary": "添加作业类型",
                "parameters": [
                    {
                        "description": "作业类型信息",
                        "name": "object",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/request.AddOperationType"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "成功",
                        "schema": {
                            "$ref": "#/definitions/util.Response"
                        }
                    }
                }
            }
        },
        "/api-wms/v1/operationType/operationType/{id}": {
            "put": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "作业类型"
                ],
                "summary": "编辑作业类型",
                "parameters": [
                    {
                        "description": "作业类型信息",
                        "name": "object",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/request.UpdateOperationType"
                        }
                    },
                    {
                        "type": "string",
                        "description": "作业类型id",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "成功",
                        "schema": {
                            "$ref": "#/definitions/util.Response"
                        }
                    }
                }
            },
            "delete": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "作业类型"
                ],
                "summary": "删除作业类型",
                "parameters": [
                    {
                        "type": "string",
                        "description": "作业类型id",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "成功",
                        "schema": {
                            "$ref": "#/definitions/util.Response"
                        }
                    }
                }
            }
        },
        "/api-wms/v1/product/addProduct": {
            "post": {
                "produces": [
@@ -760,32 +904,22 @@
                }
            }
        },
        "/api-wms/v1/warehouse/operationType": {
        "/api-wms/v1/warehouse/getWarehouseDetails/{id}": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "作业类型"
                    "仓库"
                ],
                "summary": "查询作业类型列表",
                "summary": "获取仓库详情",
                "parameters": [
                    {
                        "type": "string",
                        "name": "keyword",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "页码",
                        "name": "page",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "每页大小",
                        "name": "pageSize",
                        "in": "query"
                        "description": "仓库id",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
@@ -794,16 +928,13 @@
                        "schema": {
                            "allOf": [
                                {
                                    "$ref": "#/definitions/util.ResponseList"
                                    "$ref": "#/definitions/util.Response"
                                },
                                {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/definitions/models.OperationType"
                                            }
                                            "$ref": "#/definitions/models.Warehouse"
                                        }
                                    }
                                }
@@ -811,87 +942,26 @@
                        }
                    }
                }
            },
            }
        },
        "/api-wms/v1/warehouse/updateWarehouse": {
            "post": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "作业类型"
                    "仓库"
                ],
                "summary": "添加作业类型",
                "summary": "编辑仓库",
                "parameters": [
                    {
                        "description": "作业类型信息",
                        "description": "仓库信息",
                        "name": "object",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/request.AddOperationType"
                            "$ref": "#/definitions/models.Warehouse"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "成功",
                        "schema": {
                            "$ref": "#/definitions/util.Response"
                        }
                    }
                }
            }
        },
        "/api-wms/v1/warehouse/operationType/{id}": {
            "put": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "作业类型"
                ],
                "summary": "编辑作业类型",
                "parameters": [
                    {
                        "description": "作业类型信息",
                        "name": "object",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/request.UpdateOperationType"
                        }
                    },
                    {
                        "type": "string",
                        "description": "作业类型id",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "成功",
                        "schema": {
                            "$ref": "#/definitions/util.Response"
                        }
                    }
                }
            },
            "delete": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "作业类型"
                ],
                "summary": "删除作业类型",
                "parameters": [
                    {
                        "type": "string",
                        "description": "作业类型id",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
@@ -986,41 +1056,6 @@
            }
        },
        "/api-wms/v1/warehouse/warehouse/{id}": {
            "put": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "仓库"
                ],
                "summary": "编辑仓库",
                "parameters": [
                    {
                        "description": "仓库信息",
                        "name": "object",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/request.UpdateWarehouse"
                        }
                    },
                    {
                        "type": "string",
                        "description": "仓库id",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "成功",
                        "schema": {
                            "$ref": "#/definitions/util.Response"
                        }
                    }
                }
            },
            "delete": {
                "produces": [
                    "application/json"
@@ -1223,6 +1258,24 @@
                "TaskAndObject"
            ]
        },
        "constvar.ProductType": {
            "type": "integer",
            "enum": [
                1,
                2,
                3
            ],
            "x-enum-comments": {
                "Consumables": "消耗品",
                "Server": "服务",
                "StoredProduct": "可储存的产品"
            },
            "x-enum-varnames": [
                "Consumables",
                "Server",
                "StoredProduct"
            ]
        },
        "constvar.ReservationMethod": {
            "type": "integer",
            "enum": [
@@ -1354,7 +1407,7 @@
                },
                "parentId": {
                    "description": "上级id",
                    "type": "integer"
                    "type": "string"
                },
                "replenishLocation": {
                    "description": "是否补充位置",
@@ -1377,9 +1430,11 @@
            "type": "object",
            "properties": {
                "HSCode": {
                    "description": "HS编码",
                    "type": "string"
                },
                "amount": {
                    "description": "数量",
                    "type": "number"
                },
                "barcode": {
@@ -1387,6 +1442,7 @@
                    "type": "string"
                },
                "buyExplain": {
                    "description": "采购说明",
                    "type": "string"
                },
                "canBePurchased": {
@@ -1397,20 +1453,32 @@
                    "description": "产品类别id",
                    "type": "integer"
                },
                "categoryName": {
                    "description": "产品类别名称",
                    "type": "string"
                },
                "companyId": {
                    "description": "公司id",
                    "type": "integer"
                },
                "companyName": {
                    "description": "公司名称",
                    "type": "string"
                },
                "controlStrategy": {
                    "$ref": "#/definitions/constvar.InvoicingStrategy"
                    "description": "控制策略",
                    "allOf": [
                        {
                            "$ref": "#/definitions/constvar.InvoicingStrategy"
                        }
                    ]
                },
                "cost": {
                    "description": "成本",
                    "type": "number"
                },
                "currencyName": {
                    "description": "币种名称",
                    "type": "string"
                },
                "customerTaxes": {
@@ -1418,12 +1486,14 @@
                    "type": "number"
                },
                "deliveryAdvanceTime": {
                    "description": "交货提前时间(天)",
                    "type": "integer"
                },
                "id": {
                    "type": "string"
                },
                "inStorageExplain": {
                    "description": "入库说明",
                    "type": "string"
                },
                "internalNotes": {
@@ -1435,10 +1505,11 @@
                    "type": "string"
                },
                "internalTransferExplain": {
                    "description": "内部调拨说明",
                    "type": "string"
                },
                "invoicingStrategy": {
                    "description": "wms添加字段",
                    "description": "开票策略",
                    "allOf": [
                        {
                            "$ref": "#/definitions/constvar.InvoicingStrategy"
@@ -1450,6 +1521,7 @@
                    "type": "boolean"
                },
                "maxInventory": {
                    "description": "最大库存",
                    "type": "number"
                },
                "minInventory": {
@@ -1469,18 +1541,27 @@
                    ]
                },
                "name": {
                    "description": "物料名称",
                    "type": "string"
                },
                "orderCreation": {
                    "$ref": "#/definitions/constvar.OrderCreation"
                    "description": "订单创建",
                    "allOf": [
                        {
                            "$ref": "#/definitions/constvar.OrderCreation"
                        }
                    ]
                },
                "originCountryId": {
                    "description": "原产地id",
                    "type": "integer"
                },
                "originCountryName": {
                    "description": "原产地名称",
                    "type": "string"
                },
                "outStorageExplain": {
                    "description": "出库说明",
                    "type": "string"
                },
                "principal": {
@@ -1488,26 +1569,43 @@
                    "type": "string"
                },
                "productTagId": {
                    "description": "产品标签",
                    "description": "产品标签id",
                    "type": "integer"
                },
                "productTagName": {
                    "description": "产品标签名称",
                    "type": "string"
                },
                "productType": {
                    "description": "wms添加字段",
                    "allOf": [
                        {
                            "$ref": "#/definitions/constvar.ProductType"
                        }
                    ]
                },
                "purchasePrice": {
                    "description": "采购价格",
                    "type": "number"
                },
                "salePrice": {
                    "description": "销售单价",
                    "type": "number"
                },
                "selectProduct": {
                    "description": "可选产品id",
                    "type": "integer"
                },
                "sellExplain": {
                    "description": "销售说明",
                    "type": "string"
                },
                "supplier": {
                    "description": "FSource           string                  `gorm:\"type:varchar(191);comment:生产车间\" json:\"-\"`\nStatus            constvar.MaterialStatus `gorm:\"type:int(11);comment:状态\" json:\"status\"`",
                    "type": "string"
                },
                "templateID": {
                    "description": "Note              string                  `gorm:\"type:varchar(1024);comment:备注\" json:\"note\"`",
                    "type": "string"
                },
                "unit": {
@@ -1677,6 +1775,7 @@
                    "type": "integer"
                },
                "routeId": {
                    "description": "路线id",
                    "type": "integer"
                },
                "routeName": {
@@ -1694,6 +1793,10 @@
                "active": {
                    "description": "是否启用,传true就行",
                    "type": "boolean"
                },
                "address": {
                    "description": "地址",
                    "type": "string"
                },
                "buyToResupply": {
                    "description": "是否购买补给,已购买产品能够发送到此仓库",
@@ -1717,9 +1820,21 @@
                "id": {
                    "type": "integer"
                },
                "inboundTransportation": {
                    "description": "入向运输",
                    "type": "integer"
                },
                "locationId": {
                    "description": "位置id",
                    "type": "integer"
                },
                "name": {
                    "description": "仓库名称",
                    "type": "string"
                },
                "outboundTransportation": {
                    "description": "出库运输",
                    "type": "integer"
                },
                "partnerId": {
                    "description": "合作伙伴id",
@@ -1740,6 +1855,10 @@
                    }
                },
                "updateTime": {
                    "type": "string"
                },
                "warehouseLocation": {
                    "description": "库存位置",
                    "type": "string"
                }
            }
@@ -1928,6 +2047,10 @@
                    "description": "是否启用,传true就行",
                    "type": "boolean"
                },
                "address": {
                    "description": "地址",
                    "type": "string"
                },
                "buyToResupply": {
                    "description": "购买补给,已购买产品能够发送到此仓库",
                    "type": "boolean"
@@ -1938,9 +2061,21 @@
                    "maxLength": 5,
                    "minLength": 1
                },
                "inboundTransportation": {
                    "description": "入向运输",
                    "type": "integer"
                },
                "locationId": {
                    "description": "位置id",
                    "type": "integer"
                },
                "name": {
                    "description": "仓库名称",
                    "type": "string"
                },
                "outboundTransportation": {
                    "description": "出库运输",
                    "type": "integer"
                },
                "partnerId": {
                    "description": "合作伙伴id",
@@ -2169,46 +2304,6 @@
                "warehouseId": {
                    "description": "仓库id",
                    "type": "integer"
                }
            }
        },
        "request.UpdateWarehouse": {
            "type": "object",
            "required": [
                "code"
            ],
            "properties": {
                "active": {
                    "description": "是否启用,传true就行",
                    "type": "boolean"
                },
                "buyToResupply": {
                    "description": "购买补给,已购买产品能够发送到此仓库",
                    "type": "boolean"
                },
                "code": {
                    "description": "仓库编码",
                    "type": "string",
                    "maxLength": 5,
                    "minLength": 1
                },
                "id": {
                    "type": "integer"
                },
                "name": {
                    "description": "仓库名称",
                    "type": "string"
                },
                "partnerId": {
                    "description": "合作伙伴id",
                    "type": "integer"
                },
                "resupplyWhIds": {
                    "description": "补给来源仓库ID",
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                }
            }
        },
docs/swagger.yaml
@@ -138,6 +138,20 @@
    - Task
    - Object
    - TaskAndObject
  constvar.ProductType:
    enum:
    - 1
    - 2
    - 3
    type: integer
    x-enum-comments:
      Consumables: 消耗品
      Server: 服务
      StoredProduct: 可储存的产品
    x-enum-varnames:
    - Consumables
    - Server
    - StoredProduct
  constvar.ReservationMethod:
    enum:
    - 1
@@ -232,7 +246,7 @@
        type: string
      parentId:
        description: 上级id
        type: integer
        type: string
      replenishLocation:
        description: 是否补充位置
        type: boolean
@@ -246,13 +260,16 @@
  models.Material:
    properties:
      HSCode:
        description: HS编码
        type: string
      amount:
        description: 数量
        type: number
      barcode:
        description: 条码
        type: string
      buyExplain:
        description: 采购说明
        type: string
      canBePurchased:
        description: 是否可采购
@@ -260,25 +277,35 @@
      categoryId:
        description: 产品类别id
        type: integer
      categoryName:
        description: 产品类别名称
        type: string
      companyId:
        description: 公司id
        type: integer
      companyName:
        description: 公司名称
        type: string
      controlStrategy:
        $ref: '#/definitions/constvar.InvoicingStrategy'
        allOf:
        - $ref: '#/definitions/constvar.InvoicingStrategy'
        description: 控制策略
      cost:
        description: 成本
        type: number
      currencyName:
        description: 币种名称
        type: string
      customerTaxes:
        description: 客户税百分比
        type: number
      deliveryAdvanceTime:
        description: 交货提前时间(天)
        type: integer
      id:
        type: string
      inStorageExplain:
        description: 入库说明
        type: string
      internalNotes:
        description: 内部说明
@@ -287,16 +314,18 @@
        description: 内部参考
        type: string
      internalTransferExplain:
        description: 内部调拨说明
        type: string
      invoicingStrategy:
        allOf:
        - $ref: '#/definitions/constvar.InvoicingStrategy'
        description: wms添加字段
        description: 开票策略
      isSale:
        description: PurchaseType      constvar.PurchaseType `gorm:"type:int(11);comment:采购类型"
          json:"purchaseType"`
        type: boolean
      maxInventory:
        description: 最大库存
        type: number
      minInventory:
        description: |-
@@ -316,35 +345,54 @@
        description: MaterialType constvar.ProductType  `gorm:"index;type:int(11);comment:物料类型(数字)"
          json:"materialType"`
      name:
        description: 物料名称
        type: string
      orderCreation:
        $ref: '#/definitions/constvar.OrderCreation'
        allOf:
        - $ref: '#/definitions/constvar.OrderCreation'
        description: 订单创建
      originCountryId:
        description: 原产地id
        type: integer
      originCountryName:
        description: 原产地名称
        type: string
      outStorageExplain:
        description: 出库说明
        type: string
      principal:
        description: 负责人
        type: string
      productTagId:
        description: 产品标签
        description: 产品标签id
        type: integer
      productTagName:
        description: 产品标签名称
        type: string
      productType:
        allOf:
        - $ref: '#/definitions/constvar.ProductType'
        description: wms添加字段
      purchasePrice:
        description: 采购价格
        type: number
      salePrice:
        description: 销售单价
        type: number
      selectProduct:
        description: 可选产品id
        type: integer
      sellExplain:
        description: 销售说明
        type: string
      supplier:
        description: |-
          FSource           string                  `gorm:"type:varchar(191);comment:生产车间" json:"-"`
          Status            constvar.MaterialStatus `gorm:"type:int(11);comment:状态" json:"status"`
        type: string
      templateID:
        description: Note              string                  `gorm:"type:varchar(1024);comment:备注"
          json:"note"`
        type: string
      unit:
        description: LockAmount        decimal.Decimal         `gorm:"type:decimal(35,18);default:0;comment:锁定数量"
@@ -450,6 +498,7 @@
        description: 上级id
        type: integer
      routeId:
        description: 路线id
        type: integer
      routeName:
        description: 公司
@@ -460,6 +509,9 @@
      active:
        description: 是否启用,传true就行
        type: boolean
      address:
        description: 地址
        type: string
      buyToResupply:
        description: 是否购买补给,已购买产品能够发送到此仓库
        type: boolean
@@ -476,9 +528,18 @@
        type: string
      id:
        type: integer
      inboundTransportation:
        description: 入向运输
        type: integer
      locationId:
        description: 位置id
        type: integer
      name:
        description: 仓库名称
        type: string
      outboundTransportation:
        description: 出库运输
        type: integer
      partnerId:
        description: 合作伙伴id
        type: integer
@@ -493,6 +554,9 @@
          type: string
        type: array
      updateTime:
        type: string
      warehouseLocation:
        description: 库存位置
        type: string
    required:
    - code
@@ -618,6 +682,9 @@
      active:
        description: 是否启用,传true就行
        type: boolean
      address:
        description: 地址
        type: string
      buyToResupply:
        description: 购买补给,已购买产品能够发送到此仓库
        type: boolean
@@ -626,9 +693,18 @@
        maxLength: 5
        minLength: 1
        type: string
      inboundTransportation:
        description: 入向运输
        type: integer
      locationId:
        description: 位置id
        type: integer
      name:
        description: 仓库名称
        type: string
      outboundTransportation:
        description: 出库运输
        type: integer
      partnerId:
        description: 合作伙伴id
        type: integer
@@ -785,35 +861,6 @@
      warehouseId:
        description: 仓库id
        type: integer
    type: object
  request.UpdateWarehouse:
    properties:
      active:
        description: 是否启用,传true就行
        type: boolean
      buyToResupply:
        description: 购买补给,已购买产品能够发送到此仓库
        type: boolean
      code:
        description: 仓库编码
        maxLength: 5
        minLength: 1
        type: string
      id:
        type: integer
      name:
        description: 仓库名称
        type: string
      partnerId:
        description: 合作伙伴id
        type: integer
      resupplyWhIds:
        description: 补给来源仓库ID
        items:
          type: string
        type: array
    required:
    - code
    type: object
  util.Response:
    properties:
@@ -1098,6 +1145,96 @@
      summary: 修改入库/出库信息
      tags:
      - 入库/出库
  /api-wms/v1/operationType/operationType:
    get:
      parameters:
      - in: query
        name: keyword
        type: string
      - description: 页码
        in: query
        name: page
        type: integer
      - description: 每页大小
        in: query
        name: pageSize
        type: integer
      produces:
      - application/json
      responses:
        "200":
          description: 成功
          schema:
            allOf:
            - $ref: '#/definitions/util.ResponseList'
            - properties:
                data:
                  items:
                    $ref: '#/definitions/models.OperationType'
                  type: array
              type: object
      summary: 查询作业类型列表
      tags:
      - 作业类型
    post:
      parameters:
      - description: 作业类型信息
        in: body
        name: object
        required: true
        schema:
          $ref: '#/definitions/request.AddOperationType'
      produces:
      - application/json
      responses:
        "200":
          description: 成功
          schema:
            $ref: '#/definitions/util.Response'
      summary: 添加作业类型
      tags:
      - 作业类型
  /api-wms/v1/operationType/operationType/{id}:
    delete:
      parameters:
      - description: 作业类型id
        in: path
        name: id
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: 成功
          schema:
            $ref: '#/definitions/util.Response'
      summary: 删除作业类型
      tags:
      - 作业类型
    put:
      parameters:
      - description: 作业类型信息
        in: body
        name: object
        required: true
        schema:
          $ref: '#/definitions/request.UpdateOperationType'
      - description: 作业类型id
        in: path
        name: id
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: 成功
          schema:
            $ref: '#/definitions/util.Response'
      summary: 编辑作业类型
      tags:
      - 作业类型
  /api-wms/v1/product/addProduct:
    post:
      parameters:
@@ -1308,20 +1445,14 @@
      summary: 修改产品类型
      tags:
      - 产品类型
  /api-wms/v1/warehouse/operationType:
  /api-wms/v1/warehouse/getWarehouseDetails/{id}:
    get:
      parameters:
      - in: query
        name: keyword
      - description: 仓库id
        in: path
        name: id
        required: true
        type: string
      - description: 页码
        in: query
        name: page
        type: integer
      - description: 每页大小
        in: query
        name: pageSize
        type: integer
      produces:
      - application/json
      responses:
@@ -1329,24 +1460,23 @@
          description: 成功
          schema:
            allOf:
            - $ref: '#/definitions/util.ResponseList'
            - $ref: '#/definitions/util.Response'
            - properties:
                data:
                  items:
                    $ref: '#/definitions/models.OperationType'
                  type: array
                  $ref: '#/definitions/models.Warehouse'
              type: object
      summary: 查询作业类型列表
      summary: 获取仓库详情
      tags:
      - 作业类型
      - 仓库
  /api-wms/v1/warehouse/updateWarehouse:
    post:
      parameters:
      - description: 作业类型信息
      - description: 仓库信息
        in: body
        name: object
        required: true
        schema:
          $ref: '#/definitions/request.AddOperationType'
          $ref: '#/definitions/models.Warehouse'
      produces:
      - application/json
      responses:
@@ -1354,50 +1484,9 @@
          description: 成功
          schema:
            $ref: '#/definitions/util.Response'
      summary: 添加作业类型
      summary: 编辑仓库
      tags:
      - 作业类型
  /api-wms/v1/warehouse/operationType/{id}:
    delete:
      parameters:
      - description: 作业类型id
        in: path
        name: id
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: 成功
          schema:
            $ref: '#/definitions/util.Response'
      summary: 删除作业类型
      tags:
      - 作业类型
    put:
      parameters:
      - description: 作业类型信息
        in: body
        name: object
        required: true
        schema:
          $ref: '#/definitions/request.UpdateOperationType'
      - description: 作业类型id
        in: path
        name: id
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: 成功
          schema:
            $ref: '#/definitions/util.Response'
      summary: 编辑作业类型
      tags:
      - 作业类型
      - 仓库
  /api-wms/v1/warehouse/warehouse:
    get:
      parameters:
@@ -1463,29 +1552,6 @@
          schema:
            $ref: '#/definitions/util.Response'
      summary: 删除仓库
      tags:
      - 仓库
    put:
      parameters:
      - description: 仓库信息
        in: body
        name: object
        required: true
        schema:
          $ref: '#/definitions/request.UpdateWarehouse'
      - description: 仓库id
        in: path
        name: id
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: 成功
          schema:
            $ref: '#/definitions/util.Response'
      summary: 编辑仓库
      tags:
      - 仓库
swagger: "2.0"
models/location.go
@@ -12,15 +12,15 @@
    Location struct {
        WmsModel
        Id                int                   `json:"id" gorm:"column:id;primary_key;AUTO_INCREMENT"`
        Name              string                `json:"name" gorm:"index;type:varchar(255);not null;comment:位置名称"`     //位置名称
        ParentId          int                   `json:"parentId" gorm:"type:int;not null"`                             //上级id
        CompanyId         int                   `json:"companyId" gorm:"type:int;not null"`                            //公司id
        Company           Company               `json:"company" gorm:"foreignKey:CompanyId"`                           //公司
        Type              constvar.LocationType `json:"type" gorm:"type:int(11);not null;comment:位置类型"`                //位置类型
        CountFrequency    int                   `json:"countFrequency" gorm:"type:tinyint;not null;comment:盘点频率(天)"`   //盘点频率(天)
        IsScrapLocation   bool                  `json:"isScrapLocation" gorm:"type:tinyint;not null;comment:是否报废位置"`   //是否报废位置
        IsReturnLocation  bool                  `json:"isReturnLocation" gorm:"type:tinyint;not null;comment:是否退货位置"`  //是否退货位置
        ReplenishLocation bool                  `json:"replenishLocation" gorm:"type:tinyint;not null;comment:是否补充位置"` //是否补充位置
        Name              string                `json:"name" gorm:"index;type:varchar(255);not null;comment:位置名称"` //位置名称
        ParentId          string                `json:"parentId" gorm:"type:varchar(255)"`                         //上级id
        CompanyId         int                   `json:"companyId" gorm:"type:int"`                                 //公司id
        Company           Company               `json:"company" gorm:"foreignKey:CompanyId"`                       //公司
        Type              constvar.LocationType `json:"type" gorm:"type:int(11);comment:位置类型"`                     //位置类型
        CountFrequency    int                   `json:"countFrequency" gorm:"type:tinyint;comment:盘点频率(天)"`        //盘点频率(天)
        IsScrapLocation   bool                  `json:"isScrapLocation" gorm:"type:tinyint;comment:是否报废位置"`        //是否报废位置
        IsReturnLocation  bool                  `json:"isReturnLocation" gorm:"type:tinyint;comment:是否退货位置"`       //是否退货位置
        ReplenishLocation bool                  `json:"replenishLocation" gorm:"type:tinyint;comment:是否补充位置"`      //是否补充位置
    }
    LocationSearch struct {
@@ -31,6 +31,7 @@
        Keyword  string
        Orm      *gorm.DB
        Preload  bool
        Parents  []string
    }
)
@@ -57,8 +58,12 @@
    return slf
}
func (slf *LocationSearch) SetID(id uint) *LocationSearch {
    slf.ID = id
func (slf *LocationSearch) SetID(id int) *LocationSearch {
    slf.Id = id
    return slf
}
func (slf *LocationSearch) SetParents(ids []string) *LocationSearch {
    slf.Parents = ids
    return slf
}
@@ -82,7 +87,7 @@
    return slf
}
func (slf *LocationSearch) SetParentId(parentId int) *LocationSearch {
func (slf *LocationSearch) SetParentId(parentId string) *LocationSearch {
    slf.ParentId = parentId
    return slf
}
@@ -93,10 +98,10 @@
}
func (slf *LocationSearch) build() *gorm.DB {
    var db = slf.Orm.Model(&Location{})
    var db = slf.Orm.Table(slf.TableName())
    if slf.ID != 0 {
        db = db.Where("id = ?", slf.ID)
    if slf.Id != 0 {
        db = db.Where("id = ?", slf.Id)
    }
    if slf.Order != "" {
@@ -115,11 +120,14 @@
        db = db.Where("type=?", slf.Type)
    }
    if slf.ParentId != 0 {
    if slf.ParentId != "" {
        db = db.Where("parent_id=?", slf.ParentId)
    }
    if slf.CompanyId != 0 {
        db = db.Where("company_id=?", slf.CompanyId)
    }
    if len(slf.Parents) != 0 {
        db = db.Where("parent_id in (?)", slf.Parents)
    }
    return db
@@ -134,6 +142,16 @@
    }
    return nil
}
func (slf *LocationSearch) CreateReturnId(record *Location) (int, error) {
    var db = slf.build()
    if err := db.Create(record).Error; err != nil {
        return 0, err
    }
    return record.Id, nil
}
// CreateBatch 批量插入
@@ -183,7 +201,7 @@
func (slf *LocationSearch) Delete() error {
    var db = slf.build()
    return db.Delete(&Location{}).Error
    return db.Unscoped().Delete(&Location{}).Error
}
func (slf *LocationSearch) First() (*Location, error) {
@@ -278,7 +296,9 @@
        records = make([]*Location, 0)
        db      = slf.build()
    )
    if err := db.Find(&records); err != nil {
    err := db.Find(&records)
    if err != nil {
        fmt.Println(err)
        return records, fmt.Errorf("func FindAll err: %v", err)
    }
    return records, nil
models/material.go
@@ -12,61 +12,62 @@
    // Material 物料
    Material struct {
        BaseModelString
        Name string `gorm:"unique;type:varchar(191);not null;comment:物料名称" json:"name"`
        Name string `gorm:"unique;type:varchar(191);not null;comment:物料名称" json:"name"` //物料名称
        //MaterialType constvar.ProductType  `gorm:"index;type:int(11);comment:物料类型(数字)" json:"materialType"`
        Model constvar.MaterialMode `gorm:"type:varchar(191);not null;comment:物料类型(字符串)" json:"model"`
        Model constvar.MaterialMode `gorm:"type:varchar(191);not null;comment:物料类型(字符串)" json:"model"` //物料类型(字符串)
        //Explain           string                  `gorm:"type:varchar(512);comment:编号说明" json:"explain"`
        //CodeStandardID    string                  `gorm:"type:varchar(191);comment:编码规范ID" json:"codeStandardID"`
        //Specs             string                  `gorm:"type:varchar(191);comment:物料规格" json:"specs"`
        //Type              string                  `gorm:"type:varchar(191);comment:物料型号" json:"type"`
        MinInventory decimal.Decimal `gorm:"type:decimal(35,18);comment:最小库存" json:"minInventory"`
        MaxInventory decimal.Decimal `gorm:"type:decimal(35,18);comment:最大库存" json:"maxInventory"`
        Amount       decimal.Decimal `gorm:"type:decimal(35,18);comment:数量" json:"amount"`
        MinInventory decimal.Decimal `gorm:"type:decimal(35,18);comment:最小库存" json:"minInventory"` //最小库存
        MaxInventory decimal.Decimal `gorm:"type:decimal(35,18);comment:最大库存" json:"maxInventory"` //最大库存
        Amount       decimal.Decimal `gorm:"type:decimal(35,18);comment:数量" json:"amount"`         //数量
        //LockAmount        decimal.Decimal         `gorm:"type:decimal(35,18);default:0;comment:锁定数量" json:"lockAmount"`
        Unit string `gorm:"type:varchar(100);comment:单位" json:"unit"`
        Unit string `gorm:"type:varchar(100);comment:单位" json:"unit"` //单位
        //Note              string                  `gorm:"type:varchar(1024);comment:备注" json:"note"`
        TemplateID string `gorm:"type:varchar(191);comment:模板ID" json:"-"`
        TemplateID string `gorm:"type:varchar(191);comment:模板ID" json:"templateID"` //模板ID
        //FSource           string                  `gorm:"type:varchar(191);comment:生产车间" json:"-"`
        //Status            constvar.MaterialStatus `gorm:"type:int(11);comment:状态" json:"status"`
        Supplier      string          `gorm:"type:varchar(191);comment:供应商" json:"supplier"`
        PurchasePrice decimal.Decimal `gorm:"type:decimal(35,18);comment:采购价格" json:"purchasePrice"`
        Supplier      string          `gorm:"type:varchar(191);comment:供应商" json:"supplier"`         //供应商
        PurchasePrice decimal.Decimal `gorm:"type:decimal(35,18);comment:采购价格" json:"purchasePrice"` //采购价格
        //PurchaseAheadDay  int                     `gorm:"type:int(11);comment:采购提前期(天)" json:"purchaseAheadDay"`
        //ProduceAheadDay   int                     `gorm:"type:int(11);comment:制造提前期(天)" json:"produceAheadDay"`
        MinPurchaseAmount decimal.Decimal `gorm:"type:decimal(35,18);comment:最小采购量" json:"minPurchaseAmount"`
        MinPurchaseAmount decimal.Decimal `gorm:"type:decimal(35,18);comment:最小采购量" json:"minPurchaseAmount"` //最小采购量
        //PurchaseType      constvar.PurchaseType `gorm:"type:int(11);comment:采购类型" json:"purchaseType"`
        IsSale    bool            `gorm:"type:tinyint(1);comment:是否销售" json:"isSale"`
        SalePrice decimal.Decimal `gorm:"type:decimal(35,18);comment:销售单价" json:"salePrice"`
        IsSale    bool            `gorm:"type:tinyint(1);comment:是否销售" json:"isSale"`        //是否销售
        SalePrice decimal.Decimal `gorm:"type:decimal(35,18);comment:销售单价" json:"salePrice"` //销售单价
        AutoIncr  uint            `gorm:"type:int(11);comment:自增ID;default:0;" json:"-"`
        //wms添加字段
        InvoicingStrategy       constvar.InvoicingStrategy `gorm:"type:int(11);comment:开票策略" json:"invoicingStrategy"`
        OrderCreation           constvar.OrderCreation     `gorm:"type:int(11);comment:订单创建" json:"orderCreation"`
        CustomerTaxes           decimal.Decimal            `gorm:"type:decimal(20,2);comment:客户税" json:"customerTaxes"`     //客户税百分比
        Cost                    decimal.Decimal            `gorm:"type:decimal(20,2);comment:成本" json:"cost"`               //成本
        CategoryId              int                        `gorm:"type:int(11);comment:产品类别id" json:"categoryId"`           //产品类别id
        InternalReference       string                     `gorm:"type:varchar(255);comment:内部参考" json:"internalReference"` //内部参考
        Barcode                 string                     `gorm:"type:varchar(255);comment:条码" json:"barcode"`             //条码
        ProductTagId            int                        `gorm:"type:int(11);comment:产品标签id" json:"productTagId"`         //产品标签
        ProductTagName          string                     `gorm:"type:varchar(255);comment:产品标签名称" json:"productTagName"`
        CompanyId               int                        `gorm:"type:int(11);comment:公司id" json:"companyId"`
        CompanyName             string                     `gorm:"type:varchar(255);comment:公司名称" json:"companyName"`
        InternalNotes           string                     `gorm:"type:varchar(512);comment:内部说明" json:"internalNotes"` //内部说明
        SelectProduct           int                        `gorm:"type:int(11);comment:可选产品id" json:"selectProduct"`
        SellExplain             string                     `gorm:"type:varchar(512);comment:销售说明" json:"sellExplain"`
        CanBePurchased          bool                       `gorm:"type:int(11);comment:是否可采购" json:"canBePurchased"` //是否可采购
        CurrencyName            string                     `gorm:"type:varchar(255);comment:币种名称" json:"currencyName"`
        DeliveryAdvanceTime     int                        `gorm:"type:int(11);comment:交货提前时间(天)" json:"deliveryAdvanceTime"`
        ControlStrategy         constvar.InvoicingStrategy `gorm:"type:int(11);comment:控制策略" json:"controlStrategy"`
        BuyExplain              string                     `gorm:"type:varchar(512);comment:采购说明" json:"buyExplain"`
        Principal               string                     `gorm:"type:varchar(255);comment:负责人" json:"principal"` //负责人
        Weight                  decimal.Decimal            `gorm:"type:decimal(20,2);comment:重量" json:"weight"`    //重量
        Volume                  decimal.Decimal            `gorm:"type:decimal(20,2);comment:体积" json:"volume"`    //体积
        HSCode                  string                     `gorm:"type:varchar(255);comment:HS编码" json:"HSCode"`
        OriginCountryId         int                        `gorm:"type:int(11);comment:原产地id" json:"originCountryId"`
        OriginCountryName       string                     `gorm:"type:varchar(255);comment:原产地名称" json:"originCountryName"`
        InStorageExplain        string                     `gorm:"type:varchar(512);comment:入库说明" json:"inStorageExplain"`
        OutStorageExplain       string                     `gorm:"type:varchar(512);comment:出库说明" json:"outStorageExplain"`
        InternalTransferExplain string                     `gorm:"type:varchar(512);comment:内部调拨说明" json:"internalTransferExplain"`
        //CompanyArr              []IdAndName                `gorm:"-" json:"companyArr"`
        ProductType             constvar.ProductType       `gorm:"type:int(11);comment:产品类型" json:"productType"`                    //产品类型
        InvoicingStrategy       constvar.InvoicingStrategy `gorm:"type:int(11);comment:开票策略" json:"invoicingStrategy"`              //开票策略
        OrderCreation           constvar.OrderCreation     `gorm:"type:int(11);comment:订单创建" json:"orderCreation"`                  //订单创建
        CustomerTaxes           decimal.Decimal            `gorm:"type:decimal(20,2);comment:客户税" json:"customerTaxes"`             //客户税百分比
        Cost                    decimal.Decimal            `gorm:"type:decimal(20,2);comment:成本" json:"cost"`                       //成本
        CategoryId              int                        `gorm:"type:int(11);comment:产品类别id" json:"categoryId"`                   //产品类别id
        CategoryName            string                     `gorm:"type:varchar(255);comment:产品类别名称" json:"categoryName"`            //产品类别名称
        InternalReference       string                     `gorm:"type:varchar(255);comment:内部参考" json:"internalReference"`         //内部参考
        Barcode                 string                     `gorm:"type:varchar(255);comment:条码" json:"barcode"`                     //条码
        ProductTagId            int                        `gorm:"type:int(11);comment:产品标签id" json:"productTagId"`                 //产品标签id
        ProductTagName          string                     `gorm:"type:varchar(255);comment:产品标签名称" json:"productTagName"`          //产品标签名称
        CompanyId               int                        `gorm:"type:int(11);comment:公司id" json:"companyId"`                      //公司id
        CompanyName             string                     `gorm:"type:varchar(255);comment:公司名称" json:"companyName"`               //公司名称
        InternalNotes           string                     `gorm:"type:varchar(512);comment:内部说明" json:"internalNotes"`             //内部说明
        SelectProduct           string                     `gorm:"type:varchar(255);comment:可选产品id" json:"selectProduct"`           //可选产品id
        SellExplain             string                     `gorm:"type:varchar(512);comment:销售说明" json:"sellExplain"`               //销售说明
        CanBePurchased          bool                       `gorm:"type:int(11);comment:是否可采购" json:"canBePurchased"`                //是否可采购
        CurrencyName            string                     `gorm:"type:varchar(255);comment:币种名称" json:"currencyName"`              //币种名称
        DeliveryAdvanceTime     int                        `gorm:"type:int(11);comment:交货提前时间(天)" json:"deliveryAdvanceTime"`       //交货提前时间(天)
        ControlStrategy         constvar.InvoicingStrategy `gorm:"type:int(11);comment:控制策略" json:"controlStrategy"`                //控制策略
        BuyExplain              string                     `gorm:"type:varchar(512);comment:采购说明" json:"buyExplain"`                //采购说明
        Principal               string                     `gorm:"type:varchar(255);comment:负责人" json:"principal"`                  //负责人
        Weight                  decimal.Decimal            `gorm:"type:decimal(20,2);comment:重量" json:"weight"`                     //重量
        Volume                  decimal.Decimal            `gorm:"type:decimal(20,2);comment:体积" json:"volume"`                     //体积
        HSCode                  string                     `gorm:"type:varchar(255);comment:HS编码" json:"HSCode"`                    //HS编码
        OriginCountryId         int                        `gorm:"type:int(11);comment:原产地id" json:"originCountryId"`               //原产地id
        OriginCountryName       string                     `gorm:"type:varchar(255);comment:原产地名称" json:"originCountryName"`        //原产地名称
        InStorageExplain        string                     `gorm:"type:varchar(512);comment:入库说明" json:"inStorageExplain"`          //入库说明
        OutStorageExplain       string                     `gorm:"type:varchar(512);comment:出库说明" json:"outStorageExplain"`         //出库说明
        InternalTransferExplain string                     `gorm:"type:varchar(512);comment:内部调拨说明" json:"internalTransferExplain"` //内部调拨说明
    }
    MaterialSearch struct {
models/product.go
File was deleted
models/product_category.go
@@ -13,11 +13,11 @@
        BaseModelInt
        Name                 string                        `json:"name" gorm:"index;type:varchar(255);not null;comment:分类名称"` //位置名称
        ParentId             int                           `json:"parentId" gorm:"type:int;comment:上级分类id"`                   //上级id
        RouteId              int                           `json:"routeId" gorm:"type:int;comment:路线id"`
        RouteName            string                        `json:"routeName" gorm:"type:varchar(512);comment:路线名称"`         //公司
        ForceRemovalStrategy constvar.ForceRemovalStrategy `json:"forceRemovalStrategy" gorm:"type:tinyint;comment:强制下架策略"` //强制下架策略
        CostingMethod        constvar.CostingMethod        `json:"costingMethod" gorm:"type:tinyint;comment:成本方法"`          //成本方法
        InventoryValuation   constvar.InventoryValuation   `json:"inventoryValuation" gorm:"type:tinyint;comment:库存计价"`     //库存计价
        RouteId              int                           `json:"routeId" gorm:"type:int;comment:路线id"`                      //路线id
        RouteName            string                        `json:"routeName" gorm:"type:varchar(512);comment:路线名称"`           //公司
        ForceRemovalStrategy constvar.ForceRemovalStrategy `json:"forceRemovalStrategy" gorm:"type:tinyint;comment:强制下架策略"`   //强制下架策略
        CostingMethod        constvar.CostingMethod        `json:"costingMethod" gorm:"type:tinyint;comment:成本方法"`            //成本方法
        InventoryValuation   constvar.InventoryValuation   `json:"inventoryValuation" gorm:"type:tinyint;comment:库存计价"`       //库存计价
    }
    ProductCategorySearch struct {
models/warehouse.go
@@ -11,17 +11,22 @@
    // Warehouse 仓库
    Warehouse struct {
        WmsModel
        Id               int          `json:"id" gorm:"column:id;primary_key;AUTO_INCREMENT"`
        Name             string       `json:"name" gorm:"index;type:varchar(255);not null;comment:仓库名称"`                                 //仓库名称
        Active           bool         `json:"active" gorm:"type:tinyint(1);not null;comment:是否激活"`                                       //是否启用,传true就行
        Code             string       `json:"code" binding:"required,min=1,max=5"  gorm:"index;type:varchar(255);not null;comment:仓库编码"` //仓库编码
        PartnerID        int          `json:"partnerId"  gorm:"type:int;not null;comment:合作伙伴id"`                                        //合作伙伴id
        BuyToResupply    bool         `json:"buyToResupply" gorm:"type:tinyint(1);not null;comment:是否购买补给"`                              //是否购买补给,已购买产品能够发送到此仓库
        ResupplyWhIdsStr string       `json:"-" gorm:"column:resupply_wh_ids;type:varchar(255);not null;comment:补给来源仓库ID"`               //补给来源仓库ID
        ResupplyWhIds    []string     `json:"resupplyWhIds" gorm:"-"`                                                                    //补给来源仓库ID
        ResupplyWh       []*Warehouse `json:"resupplyWh" gorm:"-"`                                                                       //补给来源仓库
        CompanyId        int          `json:"companyId" gorm:"type:int;not null;comment:公司id"`
        Company          Company      `json:"company" gorm:"foreignKey:CompanyId"`
        Id                     int          `json:"id" gorm:"column:id;primary_key;AUTO_INCREMENT"`
        Name                   string       `json:"name" gorm:"index;type:varchar(255);not null;comment:仓库名称"`                                 //仓库名称
        Active                 bool         `json:"active" gorm:"type:tinyint(1);not null;comment:是否激活"`                                       //是否启用,传true就行
        Code                   string       `json:"code" binding:"required,min=1,max=5"  gorm:"index;type:varchar(255);not null;comment:仓库编码"` //仓库编码
        PartnerID              int          `json:"partnerId"  gorm:"type:int;not null;comment:合作伙伴id"`                                        //合作伙伴id
        BuyToResupply          bool         `json:"buyToResupply" gorm:"type:tinyint(1);not null;comment:是否购买补给"`                              //是否购买补给,已购买产品能够发送到此仓库
        ResupplyWhIdsStr       string       `json:"-" gorm:"column:resupply_wh_ids;type:varchar(255);not null;comment:补给来源仓库ID"`               //补给来源仓库ID
        ResupplyWhIds          []string     `json:"resupplyWhIds" gorm:"-"`                                                                    //补给来源仓库ID
        ResupplyWh             []*Warehouse `json:"resupplyWh" gorm:"-"`                                                                       //补给来源仓库
        CompanyId              int          `json:"companyId" gorm:"type:int;not null;comment:公司id"`
        Company                Company      `json:"company" gorm:"foreignKey:CompanyId"`
        Address                string       `json:"address" gorm:"type:varchar(512);comment:地址"`         //地址
        InboundTransportation  int          `json:"inboundTransportation" gorm:"type:int;comment:入向运输"`  //入向运输
        OutboundTransportation int          `json:"outboundTransportation" gorm:"type:int;comment:出库运输"` //出库运输
        LocationId             int          `json:"locationId" gorm:"type:int;comment:位置id"`             //位置id
        WarehouseLocation      string       `json:"warehouseLocation" gorm:"-"`                          //库存位置
    }
    WarehouseSearch struct {
@@ -63,8 +68,8 @@
    return slf
}
func (slf *WarehouseSearch) SetID(id uint) *WarehouseSearch {
    slf.ID = id
func (slf *WarehouseSearch) SetID(id int) *WarehouseSearch {
    slf.Id = id
    return slf
}
@@ -89,10 +94,10 @@
}
func (slf *WarehouseSearch) build() *gorm.DB {
    var db = slf.Orm.Model(&Warehouse{})
    var db = slf.Orm.Table(slf.TableName())
    if slf.ID != 0 {
        db = db.Where("id = ?", slf.ID)
    if slf.Id != 0 {
        db = db.Where("id = ?", slf.Id)
    }
    if slf.Order != "" {
@@ -109,6 +114,9 @@
    if slf.Preload {
        db = db.Preload("Company")
    }
    if slf.Code != "" {
        db = db.Where("code = ?", slf.Code)
    }
    return db
@@ -172,7 +180,7 @@
func (slf *WarehouseSearch) Delete() error {
    var db = slf.build()
    return db.Delete(&Warehouse{}).Error
    return db.Unscoped().Delete(&Warehouse{}).Error
}
func (slf *WarehouseSearch) First() (*Warehouse, error) {
request/location.go
@@ -3,6 +3,6 @@
type LocationByType struct {
    Type      int    `json:"type" form:"type"`
    Keyword   string `json:"keyword" form:"keyword"`
    ParentId  int    `json:"parentId" form:"parentId"`
    ParentId  string `json:"parentId" form:"parentId"`
    CompanyId int    `json:"companyId" form:"companyId"`
}
request/warehouse.go
@@ -6,12 +6,16 @@
}
type AddWarehouse struct {
    Name          string   `json:"name" gorm:"index;type:varchar(255);not null;comment:仓库名称"`                                 //仓库名称
    Active        bool     `json:"active" gorm:"type:tinyint(1);not null;comment:是否激活"`                                       //是否启用,传true就行
    Code          string   `json:"code" binding:"required,min=1,max=5"  gorm:"index;type:varchar(255);not null;comment:仓库编码"` //仓库编码
    PartnerID     int      `json:"partnerId"  gorm:"type:int;not null;comment:合作伙伴id"`                                        //合作伙伴id
    BuyToResupply bool     `json:"buyToResupply"`                                                                             //购买补给,已购买产品能够发送到此仓库
    ResupplyWhIds []string `json:"resupplyWhIds"`                                                                             //补给来源仓库ID
    Name                   string   `json:"name" gorm:"index;type:varchar(255);not null;comment:仓库名称"`                                 //仓库名称
    Active                 bool     `json:"active" gorm:"type:tinyint(1);not null;comment:是否激活"`                                       //是否启用,传true就行
    Code                   string   `json:"code" binding:"required,min=1,max=5"  gorm:"index;type:varchar(255);not null;comment:仓库编码"` //仓库编码
    PartnerID              int      `json:"partnerId"  gorm:"type:int;not null;comment:合作伙伴id"`                                        //合作伙伴id
    BuyToResupply          bool     `json:"buyToResupply"`                                                                             //购买补给,已购买产品能够发送到此仓库
    ResupplyWhIds          []string `json:"resupplyWhIds"`                                                                             //补给来源仓库ID
    Address                string   `json:"address" gorm:"type:varchar(512);comment:地址"`                                               //地址
    InboundTransportation  int      `json:"inboundTransportation" gorm:"type:int;comment:入向运输"`                                        //入向运输
    OutboundTransportation int      `json:"outboundTransportation" gorm:"type:int;comment:出库运输"`                                       //出库运输
    LocationId             int      `json:"locationId" gorm:"type:int;comment:位置id"`                                                   //位置id
}
type UpdateWarehouse struct {
router/router.go
@@ -45,10 +45,11 @@
    warehouseController := new(controllers.WarehouseController)
    warehouseAPI := r.Group(urlPrefix + "/warehouse")
    {
        warehouseAPI.GET("warehouse", warehouseController.List)          // 获取仓库列表
        warehouseAPI.POST("warehouse", warehouseController.Add)          // 新增仓库
        warehouseAPI.PUT("warehouse/:id", warehouseController.Update)    // 修改仓库
        warehouseAPI.DELETE("warehouse/:id", warehouseController.Delete) // 删除仓库
        warehouseAPI.GET("warehouse", warehouseController.List)                              // 获取仓库列表
        warehouseAPI.POST("warehouse", warehouseController.Add)                              // 新增仓库
        warehouseAPI.POST("updateWarehouse", warehouseController.UpdateWarehouse)            // 修改仓库
        warehouseAPI.DELETE("warehouse/:id", warehouseController.Delete)                     // 删除仓库
        warehouseAPI.GET("getWarehouseDetails/:id", warehouseController.GetWarehouseDetails) // 获取仓库详情
    }
    // 业务类型