jiangshuai
2023-11-08 47000c8d61e28bc590d085753c8b9ceff8546121
Merge branch 'master' of http://192.168.5.5:10010/r/aps/WMS
1个文件已修改
6 ■■■■ 已修改文件
proto/product_inventory/server.go 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
proto/product_inventory/server.go
@@ -29,12 +29,16 @@
    //查询产品id
    var details []ProductAndLocationInfo
    var productIds []string
    resp := new(GetInventoryProductInfoResponse)
    err := models.NewOperationDetailsSearch().Orm.Model(&models.OperationDetails{}).
        Select("wms_operation_details.product_id,wms_operation_details.amount,wms_operation.from_location_id as location_id").
        Joins("left join wms_operation on wms_operation.id = wms_operation_details.operation_id").
        Where("wms_operation.source_number = ?", req.Number).Find(&details).Error
    if err != nil {
        return nil, err
    }
    if len(details) == 0 {
        return resp, nil
    }
    var locationId int
    for _, detail := range details {
@@ -97,6 +101,7 @@
        for _, detail := range details {
            if material.ID == detail.ProductId {
                p.OrderAmount = detail.Amount.String()
                p.Valorem = detail.Amount.Mul(material.SalePrice).String()
                break
            }
        }
@@ -120,7 +125,6 @@
        products = append(products, &p)
    }
    resp := new(GetInventoryProductInfoResponse)
    resp.ProductList = products
    return resp, nil
}