liujiandao
2023-11-24 7144c4cb9615ca3d60e12c6286271353b1c8b29d
查询指定操作详情修改
8个文件已修改
48 ■■■■■ 已修改文件
controllers/operation.go 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
controllers/report_forms_controller.go 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
docs/docs.go 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
docs/swagger.json 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
docs/swagger.yaml 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
models/move_history.go 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
response/report_forms_response.go 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
router/router.go 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
controllers/operation.go
@@ -177,17 +177,18 @@
// @Summary   入库/出库列表
// @Produce   application/json
//
//    @Param        number    path        string            true    "单号"
//    @Param        id    path        string            true    "id"
//
// @Success   200 {object} util.Response    "成功"
// @Router    /api-wms/v1/operation/getOperationInfo/{number} [post]
// @Router    /api-wms/v1/operation/getOperationInfo/{id} [get]
func (slf OperationController) GetOperationInfo(c *gin.Context) {
    number := c.Param("number")
    number := c.Param("id")
    if number == "" {
        util.ResponseFormat(c, code.RequestParamError, "参数解析失败,参数不能为空")
        return
    }
    operation, err := models.NewOperationSearch().SetNumber(number).SetPreload(true).First()
    id, _ := strconv.Atoi(number)
    operation, err := models.NewOperationSearch().SetID(id).SetPreload(true).First()
    if err != nil {
        util.ResponseFormat(c, code.RequestParamError, err.Error())
        return
controllers/report_forms_controller.go
@@ -265,7 +265,7 @@
    }
    detailsSearch.Orm = detailsSearch.Orm.Model(&models.MoveHistory{}).
        Select("number, updated_at as date, product_name as product_name, from_location_id," +
        Select("number, updated_at as date, product_name as product_name, from_location_id, operation_id," +
            "to_location_id, amount, unit, operator as contacted_name, base_operation_type, weight, product_id, from_location, to_location").Order("id desc")
    if len(ids) > 0 {
        detailsSearch.Orm = detailsSearch.Orm.Where("id in ?", ids)
docs/docs.go
@@ -1150,8 +1150,8 @@
                }
            }
        },
        "/api-wms/v1/operation/getOperationInfo/{number}": {
            "post": {
        "/api-wms/v1/operation/getOperationInfo/{id}": {
            "get": {
                "produces": [
                    "application/json"
                ],
@@ -1162,8 +1162,8 @@
                "parameters": [
                    {
                        "type": "string",
                        "description": "单号",
                        "name": "number",
                        "description": "id",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
@@ -4656,6 +4656,9 @@
                    "description": "单号",
                    "type": "string"
                },
                "operationId": {
                    "type": "integer"
                },
                "productId": {
                    "type": "string"
                },
docs/swagger.json
@@ -1138,8 +1138,8 @@
                }
            }
        },
        "/api-wms/v1/operation/getOperationInfo/{number}": {
            "post": {
        "/api-wms/v1/operation/getOperationInfo/{id}": {
            "get": {
                "produces": [
                    "application/json"
                ],
@@ -1150,8 +1150,8 @@
                "parameters": [
                    {
                        "type": "string",
                        "description": "单号",
                        "name": "number",
                        "description": "id",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
@@ -4644,6 +4644,9 @@
                    "description": "单号",
                    "type": "string"
                },
                "operationId": {
                    "type": "integer"
                },
                "productId": {
                    "type": "string"
                },
docs/swagger.yaml
@@ -1519,6 +1519,8 @@
      number:
        description: 单号
        type: string
      operationId:
        type: integer
      productId:
        type: string
      productName:
@@ -2292,12 +2294,12 @@
      summary: 获取物流公司列表
      tags:
      - 入库/出库
  /api-wms/v1/operation/getOperationInfo/{number}:
    post:
  /api-wms/v1/operation/getOperationInfo/{id}:
    get:
      parameters:
      - description: 单号
      - description: id
        in: path
        name: number
        name: id
        required: true
        type: string
      produces:
models/move_history.go
@@ -17,7 +17,7 @@
        BaseOperationType constvar.BaseOperationType `json:"baseOperationType" gorm:"type:tinyint;not null;comment:基础作业类型"`      //基础作业类型
        OperationTypeId   int                        `json:"operationTypeId" gorm:"type:int;not null;comment:作业类型id"`            //作业类型id
        OperationTypeName string                     `json:"operationTypeName" gorm:"type:varchar(127);not null;comment:作业类型名称"` //作业类型名称
        OperationId       int                        `json:"operationRecordId" gorm:"type:int;not null;comment:操作id"`            //操作id
        OperationId       int                        `json:"operationId" gorm:"type:int;not null;comment:操作id"`                  //操作id
        ProductId         string                     `json:"productId" gorm:"type:varchar(255);not null;comment:产品id"`           //产品id
        ProductName       string                     `json:"productName" gorm:"type:varchar(255);not null;comment:产品名称"`         //产品名称
        Amount            decimal.Decimal            `json:"amount" gorm:"type:decimal(20,2);not null;comment:数量"`               //数量
response/report_forms_response.go
@@ -33,6 +33,7 @@
    ProductId         string                     `json:"productId"`
    FromLocationId    int                        `json:"fromLocationId"`
    ToLocationId      int                        `json:"toLocationId"`
    OperationId       int                        `json:"operationId"`
}
type LocationForms struct {
router/router.go
@@ -81,7 +81,7 @@
    operationAPI := r.Group(urlPrefix + "/operation")
    {
        operationAPI.POST("list", operationController.List)
        operationAPI.POST("getOperationInfo/:number", operationController.GetOperationInfo)
        operationAPI.GET("getOperationInfo/:id", operationController.GetOperationInfo)
        operationAPI.POST("operation", operationController.Add)
        operationAPI.POST("update", operationController.Update)
        operationAPI.DELETE("operation/:id", operationController.Delete)