zhangqian
2024-03-22 2dc22e8068ac5616a3581d4a261725d4ac02cf2b
产品列表增加型号字段,发货历史倒序
6个文件已修改
25 ■■■■■ 已修改文件
controllers/order.go 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
docs/docs.go 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
docs/swagger.json 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
docs/swagger.yaml 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
models/outsourcing_order_delivery_details.go 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
models/outsourcing_order_product.go 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
controllers/order.go
@@ -282,7 +282,11 @@
        util.ResponseFormat(c, code.RequestParamError, "参数解析失败,数据类型错误")
        return
    }
    list, err := models.NewOutsourcingOrderDeliveryDetailsSearch().SetOutsourcingOrderID(params.OutsourcingOrderID).SetPreload(true).FindNotTotal()
    list, err := models.NewOutsourcingOrderDeliveryDetailsSearch().
        SetOutsourcingOrderID(params.OutsourcingOrderID).
        SetPreload(true).
        SetOrder("id desc").
        FindNotTotal()
    if err != nil {
        util.ResponseFormat(c, code.RequestParamError, "查询失败")
        return
docs/docs.go
@@ -453,6 +453,9 @@
                "specs": {
                    "type": "string"
                },
                "type": {
                    "type": "string"
                },
                "unit": {
                    "type": "string"
                }
docs/swagger.json
@@ -441,6 +441,9 @@
                "specs": {
                    "type": "string"
                },
                "type": {
                    "type": "string"
                },
                "unit": {
                    "type": "string"
                }
docs/swagger.yaml
@@ -83,6 +83,8 @@
        type: number
      specs:
        type: string
      type:
        type: string
      unit:
        type: string
    type: object
models/outsourcing_order_delivery_details.go
@@ -22,6 +22,7 @@
        PageNum  int
        PageSize int
        Orm      *gorm.DB
        Order    string
        Preload  bool
    }
)
@@ -36,6 +37,11 @@
func (slf *OutsourcingOrderDeliveryDetailsSearch) SetOrm(tx *gorm.DB) *OutsourcingOrderDeliveryDetailsSearch {
    slf.Orm = tx
    return slf
}
func (slf *OutsourcingOrderDeliveryDetailsSearch) SetOrder(order string) *OutsourcingOrderDeliveryDetailsSearch {
    slf.Order = order
    return slf
}
@@ -70,6 +76,10 @@
        db = db.Where("outsourcing_order_id = ?", slf.OutsourcingOrderID)
    }
    if slf.Order != "" {
        db = db.Order(slf.Order)
    }
    if slf.Preload {
        db = db.Preload("OutsourcingOrderDelivery").Preload("OutsourcingOrderProduct")
    }
models/outsourcing_order_product.go
@@ -16,6 +16,7 @@
        ProductId          string          `gorm:"type:varchar(191);comment:产品id" json:"productId"`
        ProductName        string          `gorm:"type:varchar(191);comment:产品名称" json:"productName"`
        Specs              string          `gorm:"type:varchar(191);comment:物料规格" json:"specs"`
        Type               string          `gorm:"type:varchar(191);comment:物料型号" json:"type"`
        Amount             int64           `gorm:"type:int(11);comment:订单数量" json:"amount"`
        Unit               string          `gorm:"type:varchar(100);comment:单位" json:"unit"`
        BomID              string          `gorm:"type:varchar(255);default '';comment:bomID" json:"bomID"`