zhangqian
2023-11-24 313617ceb05dd5194d2091c717a25cbf33ef39b9
新增history加入索引
3个文件已修改
8 ■■■■ 已修改文件
controllers/operation.go 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
controllers/report_forms_controller.go 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
models/move_history.go 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
controllers/operation.go
@@ -29,6 +29,7 @@
    "wms/proto/purchase_wms"
    "wms/proto/supplier"
    "wms/request"
    "wms/service"
    "wms/utils/http"
    "wms/utils/upload"
)
@@ -716,6 +717,7 @@
                OperationTypeId:   operation.OperationTypeId,
                OperationTypeName: operation.OperationTypeName,
                OperationId:       operation.Id,
                ProductId:         v.ProductId,
                ProductName:       v.Product.Name,
                Amount:            v.Amount,
                Unit:              v.Product.Unit,
@@ -731,6 +733,9 @@
    if err := db.Model(&models.MoveHistory{}).Create(&histories).Error; err != nil {
        return err
    }
    for _, history := range histories {
        service.AddNewHistoryReportRecord(history.Id)
    }
    return nil
}
controllers/report_forms_controller.go
@@ -260,6 +260,7 @@
        }
        if len(ids) == 0 {
            util.ResponseFormatList(c, code.Success, result, 0)
            return
        }
    }
models/move_history.go
@@ -18,7 +18,7 @@
        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
        ProductId         int                        `json:"productId" 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:数量"`               //数量
        Unit              string                     `json:"unit" gorm:"type:char(10);not null;comment:单位"`                      //单位