liujiandao
2024-04-16 1115ba492bd6afe4b9ae07284accbaa3ad4e1596
添加重量字段
4个文件已修改
12 ■■■■■ 已修改文件
controllers/location_product_amount.go 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
controllers/operation.go 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
models/location_product_amount.go 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/input_history_search.go 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
controllers/location_product_amount.go
@@ -45,7 +45,9 @@
    //wms_operation_details.amount as adjust_amount,wms_operation.id as operation_id,wms_operation.status
    search.Orm = search.Orm.
        Table("wms_location_product_amount").
        Select(`wms_location_product_amount.id as location_product_amount_id,wms_location.id as location_id,wms_location.name as location_name,material.id as product_id,material.name as product_name,wms_location_product_amount.amount,material.unit,wms_location_product_amount.create_date`).
        Select(`wms_location_product_amount.id as location_product_amount_id,wms_location.id as location_id,wms_location.name as location_name,
        material.id as product_id,material.name as product_name,wms_location_product_amount.amount,material.unit,
        wms_location_product_amount.create_date,material.weight`).
        InnerJoins("inner join material on material.id=wms_location_product_amount.product_id").
        InnerJoins("inner join wms_location on wms_location.id=wms_location_product_amount.location_id")
controllers/operation.go
@@ -1106,7 +1106,7 @@
        Select("wms_operation.id as operation_id,wms_operation.number,wms_operation.base_operation_type,material.id AS product_id," +
            "material.`name` AS product_name,wms_operation_details.amount,material.unit,wms_operation_details.from_location_id," +
            "from_location.`name` AS from_location,wms_operation_details.to_location_id,to_location.`name` AS to_location," +
            "wms_operation.operation_date as date,wms_operation.`status`,material.weight").
            "wms_operation.operation_date as date,wms_operation.`status`,material.weight,wms_operation.operation_type_name").
        InnerJoins("inner join wms_operation_details ON wms_operation_details.operation_id = wms_operation.id").
        InnerJoins("INNER JOIN material ON material.id = wms_operation_details.product_id").
        InnerJoins("INNER JOIN wms_location AS from_location ON from_location.id = wms_operation_details.from_location_id").
models/location_product_amount.go
@@ -54,6 +54,7 @@
        OperationId             int                        `json:"operationId" gorm:"column:operation_id"`
        Status                  constvar.OperationStatus   `json:"status" gorm:"status"`
        BaseOperationType       constvar.BaseOperationType `json:"baseOperationType" gorm:"base_operation_type"`
        Weight                  decimal.Decimal            `gorm:"type:decimal(20,3);comment:重量" json:"weight"` //重量
    }
)
service/input_history_search.go
@@ -97,12 +97,13 @@
func SearchHistoryReport(keyword string, operationType constvar.BaseOperationType, page, pageSize int) (recordIds []int, total uint64, err error) {
    var ids []string
    from := (page - 1) * pageSize
    t, err := parseDateString(keyword)
    t, err := time.ParseInLocation("20060102", keyword, time.Local)
    //t, err := parseDateString(keyword)
    m := make(map[string]interface{})
    if operationType > 0 {
        m["baseOperationType"] = operationType
    }
    if err != nil && t.IsZero() {
    if err != nil || t.IsZero() {
        ids, total, err = blevex.ComplexSearch(HistoryReportIndexName, keyword, m, from, pageSize)
    } else {
        ids, total, err = blevex.TimeSearch(HistoryReportIndexName, t, m, from, pageSize)