| | |
| | | util.ResponseFormat(c, code.Success, "修改成功") |
| | | } |
| | | |
| | | // finish |
| | | // Finish |
| | | // |
| | | // @Tags 库存盘点 |
| | | // @Summary 应用、验证 |
| | |
| | | } |
| | | util.ResponseFormat(c, code.Success, "操作成功") |
| | | } |
| | | |
| | | // GetLocationProductAmount |
| | | // |
| | | // @Tags 库存盘点 |
| | | // @Summary 获取位置产品信息 |
| | | // @Produce application/json |
| | | // @Param object body request.GetRuleList true "入参" |
| | | // @Success 200 {object} util.Response{data=models.LocationProductAmount} "成功" |
| | | // @Router /api-wms/v1/locationProductAmount/getLocationProductAmount [post] |
| | | func (slf LocationProductAmountController) GetLocationProductAmount(c *gin.Context) { |
| | | var params request.GetRuleList |
| | | if err := c.BindJSON(¶ms); err != nil { |
| | | util.ResponseFormat(c, code.RequestParamError, "参数解析失败,数据类型错误") |
| | | return |
| | | } |
| | | if params.LocationId == 0 || params.ProductId == "" { |
| | | util.ResponseFormat(c, code.Success, nil) |
| | | return |
| | | } |
| | | first, err := models.NewLocationProductAmountSearch().SetLocationId(params.LocationId).SetProductId(params.ProductId).First() |
| | | if err != nil { |
| | | util.ResponseFormat(c, code.RequestParamError, err.Error()) |
| | | return |
| | | } |
| | | util.ResponseFormat(c, code.Success, first) |
| | | } |
| | |
| | | } |
| | | } |
| | | }, |
| | | "/api-wms/v1/locationProductAmount/getLocationProductAmount": { |
| | | "post": { |
| | | "produces": [ |
| | | "application/json" |
| | | ], |
| | | "tags": [ |
| | | "库存盘点" |
| | | ], |
| | | "summary": "获取位置产品信息", |
| | | "parameters": [ |
| | | { |
| | | "description": "入参", |
| | | "name": "object", |
| | | "in": "body", |
| | | "required": true, |
| | | "schema": { |
| | | "$ref": "#/definitions/request.GetRuleList" |
| | | } |
| | | } |
| | | ], |
| | | "responses": { |
| | | "200": { |
| | | "description": "成功", |
| | | "schema": { |
| | | "allOf": [ |
| | | { |
| | | "$ref": "#/definitions/util.Response" |
| | | }, |
| | | { |
| | | "type": "object", |
| | | "properties": { |
| | | "data": { |
| | | "$ref": "#/definitions/models.LocationProductAmount" |
| | | } |
| | | } |
| | | } |
| | | ] |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "/api-wms/v1/locationProductAmount/getRuleList": { |
| | | "post": { |
| | | "produces": [ |
| | |
| | | } |
| | | } |
| | | }, |
| | | "models.LocationProductAmount": { |
| | | "type": "object", |
| | | "properties": { |
| | | "amount": { |
| | | "description": "库存数量", |
| | | "type": "number" |
| | | }, |
| | | "createDate": { |
| | | "description": "日期", |
| | | "type": "string" |
| | | }, |
| | | "createTime": { |
| | | "type": "string" |
| | | }, |
| | | "id": { |
| | | "type": "integer" |
| | | }, |
| | | "location": { |
| | | "$ref": "#/definitions/models.Location" |
| | | }, |
| | | "locationId": { |
| | | "description": "LocationProductId int ` + "`" + `json:\"locationProductId\" gorm:\"type:int;not null;comment:上架规则id\"` + "`" + ` //上架规则id\nLocationProduct LocationProduct ` + "`" + `json:\"locationProduct\" gorm:\"foreignKey:LocationProductId;references:Id\"` + "`" + `", |
| | | "type": "integer" |
| | | }, |
| | | "product": { |
| | | "$ref": "#/definitions/models.Material" |
| | | }, |
| | | "productCategory": { |
| | | "$ref": "#/definitions/models.ProductCategory" |
| | | }, |
| | | "productCategoryId": { |
| | | "description": "产品种类id", |
| | | "type": "integer" |
| | | }, |
| | | "productId": { |
| | | "description": "产品id", |
| | | "type": "string" |
| | | }, |
| | | "updateTime": { |
| | | "type": "string" |
| | | } |
| | | } |
| | | }, |
| | | "models.LogisticCompany": { |
| | | "type": "object", |
| | | "properties": { |
| | |
| | | } |
| | | } |
| | | }, |
| | | "/api-wms/v1/locationProductAmount/getLocationProductAmount": { |
| | | "post": { |
| | | "produces": [ |
| | | "application/json" |
| | | ], |
| | | "tags": [ |
| | | "库存盘点" |
| | | ], |
| | | "summary": "获取位置产品信息", |
| | | "parameters": [ |
| | | { |
| | | "description": "入参", |
| | | "name": "object", |
| | | "in": "body", |
| | | "required": true, |
| | | "schema": { |
| | | "$ref": "#/definitions/request.GetRuleList" |
| | | } |
| | | } |
| | | ], |
| | | "responses": { |
| | | "200": { |
| | | "description": "成功", |
| | | "schema": { |
| | | "allOf": [ |
| | | { |
| | | "$ref": "#/definitions/util.Response" |
| | | }, |
| | | { |
| | | "type": "object", |
| | | "properties": { |
| | | "data": { |
| | | "$ref": "#/definitions/models.LocationProductAmount" |
| | | } |
| | | } |
| | | } |
| | | ] |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "/api-wms/v1/locationProductAmount/getRuleList": { |
| | | "post": { |
| | | "produces": [ |
| | |
| | | } |
| | | } |
| | | }, |
| | | "models.LocationProductAmount": { |
| | | "type": "object", |
| | | "properties": { |
| | | "amount": { |
| | | "description": "库存数量", |
| | | "type": "number" |
| | | }, |
| | | "createDate": { |
| | | "description": "日期", |
| | | "type": "string" |
| | | }, |
| | | "createTime": { |
| | | "type": "string" |
| | | }, |
| | | "id": { |
| | | "type": "integer" |
| | | }, |
| | | "location": { |
| | | "$ref": "#/definitions/models.Location" |
| | | }, |
| | | "locationId": { |
| | | "description": "LocationProductId int `json:\"locationProductId\" gorm:\"type:int;not null;comment:上架规则id\"` //上架规则id\nLocationProduct LocationProduct `json:\"locationProduct\" gorm:\"foreignKey:LocationProductId;references:Id\"`", |
| | | "type": "integer" |
| | | }, |
| | | "product": { |
| | | "$ref": "#/definitions/models.Material" |
| | | }, |
| | | "productCategory": { |
| | | "$ref": "#/definitions/models.ProductCategory" |
| | | }, |
| | | "productCategoryId": { |
| | | "description": "产品种类id", |
| | | "type": "integer" |
| | | }, |
| | | "productId": { |
| | | "description": "产品id", |
| | | "type": "string" |
| | | }, |
| | | "updateTime": { |
| | | "type": "string" |
| | | } |
| | | } |
| | | }, |
| | | "models.LogisticCompany": { |
| | | "type": "object", |
| | | "properties": { |
| | |
| | | description: 仓库ID |
| | | type: integer |
| | | type: object |
| | | models.LocationProductAmount: |
| | | properties: |
| | | amount: |
| | | description: 库存数量 |
| | | type: number |
| | | createDate: |
| | | description: 日期 |
| | | type: string |
| | | createTime: |
| | | type: string |
| | | id: |
| | | type: integer |
| | | location: |
| | | $ref: '#/definitions/models.Location' |
| | | locationId: |
| | | description: |- |
| | | LocationProductId int `json:"locationProductId" gorm:"type:int;not null;comment:上架规则id"` //上架规则id |
| | | LocationProduct LocationProduct `json:"locationProduct" gorm:"foreignKey:LocationProductId;references:Id"` |
| | | type: integer |
| | | product: |
| | | $ref: '#/definitions/models.Material' |
| | | productCategory: |
| | | $ref: '#/definitions/models.ProductCategory' |
| | | productCategoryId: |
| | | description: 产品种类id |
| | | type: integer |
| | | productId: |
| | | description: 产品id |
| | | type: string |
| | | updateTime: |
| | | type: string |
| | | type: object |
| | | models.LogisticCompany: |
| | | properties: |
| | | contact: |
| | |
| | | summary: 应用、验证 |
| | | tags: |
| | | - 库存盘点 |
| | | /api-wms/v1/locationProductAmount/getLocationProductAmount: |
| | | post: |
| | | parameters: |
| | | - description: 入参 |
| | | in: body |
| | | name: object |
| | | required: true |
| | | schema: |
| | | $ref: '#/definitions/request.GetRuleList' |
| | | produces: |
| | | - application/json |
| | | responses: |
| | | "200": |
| | | description: 成功 |
| | | schema: |
| | | allOf: |
| | | - $ref: '#/definitions/util.Response' |
| | | - properties: |
| | | data: |
| | | $ref: '#/definitions/models.LocationProductAmount' |
| | | type: object |
| | | summary: 获取位置产品信息 |
| | | tags: |
| | | - 库存盘点 |
| | | /api-wms/v1/locationProductAmount/getRuleList: |
| | | post: |
| | | parameters: |
| | |
| | | locationProductAmountController := new(controllers.LocationProductAmountController) |
| | | locationProductAmountAPI := r.Group(urlPrefix + "/locationProductAmount") |
| | | { |
| | | locationProductAmountAPI.POST("add", locationProductAmountController.Add) //添加库存盘点信息 |
| | | locationProductAmountAPI.POST("list", locationProductAmountController.List) //查看库存盘点列表 |
| | | locationProductAmountAPI.POST("update", locationProductAmountController.Update) //修改库存盘点信息 |
| | | locationProductAmountAPI.POST("finish", locationProductAmountController.Finish) //应用、验证库存盘点信息 |
| | | locationProductAmountAPI.POST("getRuleList", locationProductAmountController.GetRuleList) //获取上架规则 |
| | | locationProductAmountAPI.POST("add", locationProductAmountController.Add) //添加库存盘点信息 |
| | | locationProductAmountAPI.POST("list", locationProductAmountController.List) //查看库存盘点列表 |
| | | locationProductAmountAPI.POST("update", locationProductAmountController.Update) //修改库存盘点信息 |
| | | locationProductAmountAPI.POST("finish", locationProductAmountController.Finish) //应用、验证库存盘点信息 |
| | | locationProductAmountAPI.POST("getRuleList", locationProductAmountController.GetRuleList) //获取上架规则 |
| | | locationProductAmountAPI.POST("getLocationProductAmount", locationProductAmountController.GetLocationProductAmount) //获取位置产品信息 |
| | | } |
| | | |
| | | //报表 |
| | |
| | | var ids []string |
| | | from := (page - 1) * pageSize |
| | | t, err := parseDateString(keyword) |
| | | m := make(map[string]interface{}) |
| | | if operationType > 0 { |
| | | m["baseOperationType"] = operationType |
| | | } |
| | | if err != nil && t.IsZero() { |
| | | ids, total, err = blevex.ComplexSearch(HistoryReportIndexName, keyword, map[string]interface{}{"baseOperationType": operationType}, from, pageSize) |
| | | ids, total, err = blevex.ComplexSearch(HistoryReportIndexName, keyword, m, from, pageSize) |
| | | } else { |
| | | ids, total, err = blevex.TimeSearch(HistoryReportIndexName, t, map[string]interface{}{"baseOperationType": operationType}, from, pageSize) |
| | | ids, total, err = blevex.TimeSearch(HistoryReportIndexName, t, m, from, pageSize) |
| | | } |
| | | |
| | | if err != nil { |