dsmzx
2024-06-14 eff5bd84bc43bec2fec99d829b6f3216dee509f0
出入库调拨产品明细增加备注字段(同步产品的备注字段)添加字段
3个文件已修改
20 ■■■■ 已修改文件
controllers/operation.go 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
models/operation_details.go 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
request/operation.go 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
controllers/operation.go
@@ -91,23 +91,6 @@
        return
    }
    var productIds []string
    for _, v := range params.Details {
        productIds = append(productIds, v.ProductId)
    }
    products, err := models.NewMaterialSearch().SetIDs(productIds).FindNotTotal()
    if err != nil {
        logx.Errorf("MonthStats get products err:%v", err)
        return
    }
    productMap := models.MaterialMap(products)
    for i, v := range params.Details {
        material := productMap[v.ProductId]
        if material != nil {
            params.Details[i].Note = material.Note
        }
    }
    if err := models.NewOperationSearch().Create(&params); err != nil {
        logx.Errorf("Operation create err: %v", err)
        util.ResponseFormat(c, code.SaveFail, "添加失败:"+err.Error())
models/operation_details.go
@@ -27,7 +27,7 @@
        TotalNetWeight   decimal.Decimal `json:"totalNetWeight" gorm:"type:decimal(20,3);comment:总净重"`
        AuxiliaryAmount  decimal.Decimal `json:"auxiliaryAmount" gorm:"type:decimal(20,3);comment:辅助数量"`
        AuxiliaryUnit    string          `json:"auxiliaryUnit" gorm:"type:varchar(191);comment:辅助单位"`
        Note             string          `gorm:"type:varchar(1024);comment:备注" json:"note"`
        Remark           string          `gorm:"type:varchar(1024);comment:备注" json:"remark"`
    }
    OperationDetailsSearch struct {
request/operation.go
@@ -51,6 +51,7 @@
    TotalNetWeight   decimal.Decimal `json:"totalNetWeight" gorm:"type:decimal(20,3);comment:总净重"`    //总净重
    AuxiliaryAmount  decimal.Decimal `json:"auxiliaryAmount" gorm:"type:decimal(20,3);comment:辅助数量"`  //辅助数量
    AuxiliaryUnit    string          `json:"auxiliaryUnit" gorm:"type:varchar(191);comment:辅助单位"`     //辅助单位
    Remark           string          `gorm:"type:varchar(1024);comment:备注" json:"remark"`
}
type OperationList struct {