Merge branch 'master' of http://192.168.5.5:10010/r/aps/WMS
| | |
| | | if params.Keyword != "" { |
| | | search.SetKeyword(params.Keyword) |
| | | } |
| | | if params.ParentId != 0 { |
| | | if params.ParentId != "" { |
| | | search.SetParentId(params.ParentId) |
| | | } |
| | | if params.CompanyId != 0 { |
| | |
| | | if params.Type == 0 { |
| | | return errors.New("请选择正确的位置类型") |
| | | } |
| | | if params.ParentId < 0 { |
| | | if params.ParentId == "" { |
| | | return errors.New("错误参数ParentId") |
| | | } |
| | | if params.CompanyId < 0 { |
| | |
| | | "github.com/gin-gonic/gin" |
| | | "github.com/spf13/cast" |
| | | "gorm.io/gorm" |
| | | "strconv" |
| | | "wms/constvar" |
| | | "wms/extend/code" |
| | | "wms/extend/util" |
| | | "wms/models" |
| | |
| | | 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(¶ms); err != nil { |
| | | logx.Errorf("warehouse create err: %v", err) |
| | | util.ResponseFormat(c, code.SaveFail, "插入失败") |
| | |
| | | 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(¶ms); err != nil { |
| | | util.ResponseFormat(c, code.RequestParamError, fmt.Sprintf("参数解析失败: %v"+err.Error())) |
| | | return |
| | | } |
| | | if err := structx.AssignTo(reqParams, ¶ms); 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(¶ms) |
| | | err := models.NewWarehouseSearch().SetID(params.Id).Update(¶ms) |
| | | |
| | | if err != nil { |
| | | util.ResponseFormat(c, code.RequestParamError, "修改失败") |
| | |
| | | |
| | | 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 |
| | | } |
| | | |
| | |
| | | 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)) |
| | | } |
| | |
| | | // @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) |
| | | } |
| | |
| | | } |
| | | } |
| | | }, |
| | | "/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": [ |
| | |
| | | } |
| | | } |
| | | }, |
| | | "/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": { |
| | |
| | | "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" |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | } |
| | | }, |
| | | "/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": { |
| | |
| | | } |
| | | }, |
| | | "/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" |
| | |
| | | "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": [ |
| | |
| | | }, |
| | | "parentId": { |
| | | "description": "上级id", |
| | | "type": "integer" |
| | | "type": "string" |
| | | }, |
| | | "replenishLocation": { |
| | | "description": "是否补充位置", |
| | |
| | | "type": "object", |
| | | "properties": { |
| | | "HSCode": { |
| | | "description": "HS编码", |
| | | "type": "string" |
| | | }, |
| | | "amount": { |
| | | "description": "数量", |
| | | "type": "number" |
| | | }, |
| | | "barcode": { |
| | |
| | | "type": "string" |
| | | }, |
| | | "buyExplain": { |
| | | "description": "采购说明", |
| | | "type": "string" |
| | | }, |
| | | "canBePurchased": { |
| | |
| | | "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": { |
| | |
| | | "type": "number" |
| | | }, |
| | | "deliveryAdvanceTime": { |
| | | "description": "交货提前时间(天)", |
| | | "type": "integer" |
| | | }, |
| | | "id": { |
| | | "type": "string" |
| | | }, |
| | | "inStorageExplain": { |
| | | "description": "入库说明", |
| | | "type": "string" |
| | | }, |
| | | "internalNotes": { |
| | |
| | | "type": "string" |
| | | }, |
| | | "internalTransferExplain": { |
| | | "description": "内部调拨说明", |
| | | "type": "string" |
| | | }, |
| | | "invoicingStrategy": { |
| | | "description": "wms添加字段", |
| | | "description": "开票策略", |
| | | "allOf": [ |
| | | { |
| | | "$ref": "#/definitions/constvar.InvoicingStrategy" |
| | |
| | | "type": "boolean" |
| | | }, |
| | | "maxInventory": { |
| | | "description": "最大库存", |
| | | "type": "number" |
| | | }, |
| | | "minInventory": { |
| | |
| | | ] |
| | | }, |
| | | "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": { |
| | |
| | | "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": { |
| | |
| | | "type": "integer" |
| | | }, |
| | | "routeId": { |
| | | "description": "路线id", |
| | | "type": "integer" |
| | | }, |
| | | "routeName": { |
| | |
| | | "active": { |
| | | "description": "是否启用,传true就行", |
| | | "type": "boolean" |
| | | }, |
| | | "address": { |
| | | "description": "地址", |
| | | "type": "string" |
| | | }, |
| | | "buyToResupply": { |
| | | "description": "是否购买补给,已购买产品能够发送到此仓库", |
| | |
| | | "id": { |
| | | "type": "integer" |
| | | }, |
| | | "inboundTransportation": { |
| | | "description": "入向运输", |
| | | "type": "integer" |
| | | }, |
| | | "locationId": { |
| | | "description": "位置id", |
| | | "type": "integer" |
| | | }, |
| | | "name": { |
| | | "description": "仓库名称", |
| | | "type": "string" |
| | | }, |
| | | "outboundTransportation": { |
| | | "description": "出库运输", |
| | | "type": "integer" |
| | | }, |
| | | "partnerId": { |
| | | "description": "合作伙伴id", |
| | |
| | | } |
| | | }, |
| | | "updateTime": { |
| | | "type": "string" |
| | | }, |
| | | "warehouseLocation": { |
| | | "description": "库存位置", |
| | | "type": "string" |
| | | } |
| | | } |
| | |
| | | "description": "是否启用,传true就行", |
| | | "type": "boolean" |
| | | }, |
| | | "address": { |
| | | "description": "地址", |
| | | "type": "string" |
| | | }, |
| | | "buyToResupply": { |
| | | "description": "购买补给,已购买产品能够发送到此仓库", |
| | | "type": "boolean" |
| | |
| | | "maxLength": 5, |
| | | "minLength": 1 |
| | | }, |
| | | "inboundTransportation": { |
| | | "description": "入向运输", |
| | | "type": "integer" |
| | | }, |
| | | "locationId": { |
| | | "description": "位置id", |
| | | "type": "integer" |
| | | }, |
| | | "name": { |
| | | "description": "仓库名称", |
| | | "type": "string" |
| | | }, |
| | | "outboundTransportation": { |
| | | "description": "出库运输", |
| | | "type": "integer" |
| | | }, |
| | | "partnerId": { |
| | | "description": "合作伙伴id", |
| | |
| | | "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" |
| | | } |
| | | } |
| | | } |
| | | }, |
| | |
| | | } |
| | | } |
| | | }, |
| | | "/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": [ |
| | |
| | | } |
| | | } |
| | | }, |
| | | "/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": { |
| | |
| | | "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" |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | } |
| | | }, |
| | | "/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": { |
| | |
| | | } |
| | | }, |
| | | "/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" |
| | |
| | | "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": [ |
| | |
| | | }, |
| | | "parentId": { |
| | | "description": "上级id", |
| | | "type": "integer" |
| | | "type": "string" |
| | | }, |
| | | "replenishLocation": { |
| | | "description": "是否补充位置", |
| | |
| | | "type": "object", |
| | | "properties": { |
| | | "HSCode": { |
| | | "description": "HS编码", |
| | | "type": "string" |
| | | }, |
| | | "amount": { |
| | | "description": "数量", |
| | | "type": "number" |
| | | }, |
| | | "barcode": { |
| | |
| | | "type": "string" |
| | | }, |
| | | "buyExplain": { |
| | | "description": "采购说明", |
| | | "type": "string" |
| | | }, |
| | | "canBePurchased": { |
| | |
| | | "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": { |
| | |
| | | "type": "number" |
| | | }, |
| | | "deliveryAdvanceTime": { |
| | | "description": "交货提前时间(天)", |
| | | "type": "integer" |
| | | }, |
| | | "id": { |
| | | "type": "string" |
| | | }, |
| | | "inStorageExplain": { |
| | | "description": "入库说明", |
| | | "type": "string" |
| | | }, |
| | | "internalNotes": { |
| | |
| | | "type": "string" |
| | | }, |
| | | "internalTransferExplain": { |
| | | "description": "内部调拨说明", |
| | | "type": "string" |
| | | }, |
| | | "invoicingStrategy": { |
| | | "description": "wms添加字段", |
| | | "description": "开票策略", |
| | | "allOf": [ |
| | | { |
| | | "$ref": "#/definitions/constvar.InvoicingStrategy" |
| | |
| | | "type": "boolean" |
| | | }, |
| | | "maxInventory": { |
| | | "description": "最大库存", |
| | | "type": "number" |
| | | }, |
| | | "minInventory": { |
| | |
| | | ] |
| | | }, |
| | | "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": { |
| | |
| | | "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": { |
| | |
| | | "type": "integer" |
| | | }, |
| | | "routeId": { |
| | | "description": "路线id", |
| | | "type": "integer" |
| | | }, |
| | | "routeName": { |
| | |
| | | "active": { |
| | | "description": "是否启用,传true就行", |
| | | "type": "boolean" |
| | | }, |
| | | "address": { |
| | | "description": "地址", |
| | | "type": "string" |
| | | }, |
| | | "buyToResupply": { |
| | | "description": "是否购买补给,已购买产品能够发送到此仓库", |
| | |
| | | "id": { |
| | | "type": "integer" |
| | | }, |
| | | "inboundTransportation": { |
| | | "description": "入向运输", |
| | | "type": "integer" |
| | | }, |
| | | "locationId": { |
| | | "description": "位置id", |
| | | "type": "integer" |
| | | }, |
| | | "name": { |
| | | "description": "仓库名称", |
| | | "type": "string" |
| | | }, |
| | | "outboundTransportation": { |
| | | "description": "出库运输", |
| | | "type": "integer" |
| | | }, |
| | | "partnerId": { |
| | | "description": "合作伙伴id", |
| | |
| | | } |
| | | }, |
| | | "updateTime": { |
| | | "type": "string" |
| | | }, |
| | | "warehouseLocation": { |
| | | "description": "库存位置", |
| | | "type": "string" |
| | | } |
| | | } |
| | |
| | | "description": "是否启用,传true就行", |
| | | "type": "boolean" |
| | | }, |
| | | "address": { |
| | | "description": "地址", |
| | | "type": "string" |
| | | }, |
| | | "buyToResupply": { |
| | | "description": "购买补给,已购买产品能够发送到此仓库", |
| | | "type": "boolean" |
| | |
| | | "maxLength": 5, |
| | | "minLength": 1 |
| | | }, |
| | | "inboundTransportation": { |
| | | "description": "入向运输", |
| | | "type": "integer" |
| | | }, |
| | | "locationId": { |
| | | "description": "位置id", |
| | | "type": "integer" |
| | | }, |
| | | "name": { |
| | | "description": "仓库名称", |
| | | "type": "string" |
| | | }, |
| | | "outboundTransportation": { |
| | | "description": "出库运输", |
| | | "type": "integer" |
| | | }, |
| | | "partnerId": { |
| | | "description": "合作伙伴id", |
| | |
| | | "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" |
| | | } |
| | | } |
| | | } |
| | | }, |
| | |
| | | - 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 |
| | |
| | | type: string |
| | | parentId: |
| | | description: 上级id |
| | | type: integer |
| | | type: string |
| | | replenishLocation: |
| | | description: 是否补充位置 |
| | | type: boolean |
| | |
| | | models.Material: |
| | | properties: |
| | | HSCode: |
| | | description: HS编码 |
| | | type: string |
| | | amount: |
| | | description: 数量 |
| | | type: number |
| | | barcode: |
| | | description: 条码 |
| | | type: string |
| | | buyExplain: |
| | | description: 采购说明 |
| | | type: string |
| | | canBePurchased: |
| | | description: 是否可采购 |
| | |
| | | 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: 内部说明 |
| | |
| | | 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: |- |
| | |
| | | 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:锁定数量" |
| | |
| | | description: 上级id |
| | | type: integer |
| | | routeId: |
| | | description: 路线id |
| | | type: integer |
| | | routeName: |
| | | description: 公司 |
| | |
| | | active: |
| | | description: 是否启用,传true就行 |
| | | type: boolean |
| | | address: |
| | | description: 地址 |
| | | type: string |
| | | buyToResupply: |
| | | description: 是否购买补给,已购买产品能够发送到此仓库 |
| | | type: boolean |
| | |
| | | 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 |
| | |
| | | type: string |
| | | type: array |
| | | updateTime: |
| | | type: string |
| | | warehouseLocation: |
| | | description: 库存位置 |
| | | type: string |
| | | required: |
| | | - code |
| | |
| | | active: |
| | | description: 是否启用,传true就行 |
| | | type: boolean |
| | | address: |
| | | description: 地址 |
| | | type: string |
| | | buyToResupply: |
| | | description: 购买补给,已购买产品能够发送到此仓库 |
| | | type: boolean |
| | |
| | | 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 |
| | |
| | | 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: |
| | |
| | | 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: |
| | |
| | | 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: |
| | |
| | | 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: |
| | |
| | | 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: |
| | |
| | | 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" |
| | |
| | | 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 { |
| | |
| | | Keyword string |
| | | Orm *gorm.DB |
| | | Preload bool |
| | | Parents []string |
| | | } |
| | | ) |
| | | |
| | |
| | | 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 |
| | | } |
| | | |
| | |
| | | return slf |
| | | } |
| | | |
| | | func (slf *LocationSearch) SetParentId(parentId int) *LocationSearch { |
| | | func (slf *LocationSearch) SetParentId(parentId string) *LocationSearch { |
| | | slf.ParentId = parentId |
| | | return slf |
| | | } |
| | |
| | | } |
| | | |
| | | 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 != "" { |
| | |
| | | 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 |
| | |
| | | } |
| | | |
| | | 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 批量插入 |
| | |
| | | |
| | | 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) { |
| | |
| | | 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 |
| | |
| | | // 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 { |
| | |
| | | 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 { |
| | |
| | | // 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 { |
| | |
| | | return slf |
| | | } |
| | | |
| | | func (slf *WarehouseSearch) SetID(id uint) *WarehouseSearch { |
| | | slf.ID = id |
| | | func (slf *WarehouseSearch) SetID(id int) *WarehouseSearch { |
| | | slf.Id = id |
| | | return slf |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | 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 != "" { |
| | |
| | | |
| | | if slf.Preload { |
| | | db = db.Preload("Company") |
| | | } |
| | | if slf.Code != "" { |
| | | db = db.Where("code = ?", slf.Code) |
| | | } |
| | | |
| | | return db |
| | |
| | | |
| | | 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) { |
| | |
| | | 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"` |
| | | } |
| | |
| | | } |
| | | |
| | | 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 { |
| | |
| | | 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) // 获取仓库详情 |
| | | } |
| | | |
| | | // 业务类型 |