yinbentan
2024-07-11 e042d530a290bb0e45e59fe5c06d813618d0e546
仓库位置查询从仓库缩写变更为仓库ID查询
2个文件已修改
20 ■■■■■ 已修改文件
request/report_forms_request.go 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/inventory_report_forms.go 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
request/report_forms_request.go
@@ -4,9 +4,10 @@
type GetInventoryForms struct {
    PageInfo
    CategoryIds   []int  `json:"categoryIds"`   //产品类型id
    WarehouseCode string `json:"warehouseCode"` //仓库缩写
    KeyWord       string `json:"keyWord"`       //搜索条件
    CategoryIds []int `json:"categoryIds"` //产品类型id
    //WarehouseCode string `json:"warehouseCode"` //仓库缩写
    WarehouseId int    `json:"warehouseId"` //仓库ID
    KeyWord     string `json:"keyWord"`     //搜索条件
}
type GetInventoryHistory struct {
service/inventory_report_forms.go
@@ -130,8 +130,11 @@
    err error) {
    productAmounts = make([]*models.LocationProductAmount, 0)
    locationSearch := models.NewLocationSearch()
    if params.WarehouseCode != "" {
        locationSearch.SetJointName(params.WarehouseCode)
    //if params.WarehouseCode != "" {
    //    locationSearch.SetJointName(params.WarehouseCode)
    //}
    if params.WarehouseId > 0 {
        locationSearch.SetWarehouseId(params.WarehouseId)
    }
    locations, err := locationSearch.FindNotTotal()
@@ -154,9 +157,9 @@
    //查询产品
    search = models.NewMaterialSearch()
    search.Orm = search.Orm.Model(&models.Material{}).
        Select(`material.id, material.name, material.cost, material.amount, material.unit, material.more_unit, material.more_unit_value, wms_product_category.name as category_name `).
        Joins("left join wms_product_category on material.category_id = wms_product_category.id")
    search.Orm = search.Orm.Model(&models.Material{}). // material
                                Select(`material.id, material.name, material.cost, material.amount, material.unit, material.more_unit, material.more_unit_value, wms_product_category.name as category_name `).
                                Joins("left join wms_product_category on material.category_id = wms_product_category.id")
    if len(params.CategoryIds) > 0 {
        search.Orm.Where("material.category_id in (?)", params.CategoryIds)
    }