| | |
| | | response.FailWithMessage("参数缺失", c) |
| | | return |
| | | } |
| | | data, err := service.NewPurchaseService().GetPurchase(uint(id)) |
| | | server := service.NewPurchaseService() |
| | | data, err := server.GetPurchase(uint(id)) |
| | | if err != nil { |
| | | global.GVA_LOG.Error("获取失败!", zap.Error(err)) |
| | | response.FailWithMessage("获取失败", c) |
| | | return |
| | | } |
| | | productList, err := service.NewPurchaseService().GetPurchaseProductList(uint(id)) |
| | | productList, err := server.GetPurchaseProductList(uint(id)) |
| | | if err != nil { |
| | | global.GVA_LOG.Error("获取失败!", zap.Error(err)) |
| | | response.FailWithMessage("获取失败", c) |
| | | return |
| | | } |
| | | confirmInfo, err := server.GetPurchaseProductConfirmInfo(data.Number) |
| | | if err != nil { |
| | | global.GVA_LOG.Error("获取失败!", zap.Error(err)) |
| | | response.FailWithMessage("获取失败", c) |
| | |
| | | oi.Status = operation.Status |
| | | oi.Principal = data.Principal |
| | | oi.WarehouseName = data.Warehouse |
| | | oi.SendAmount = operation.Amount |
| | | if operation.OverTime != "" { |
| | | oi.OverTime = operation.OverTime |
| | | oi.OverAmount = operation.Amount |
| | |
| | | oi.Unit = products.Product.Unit |
| | | oi.Specifications = products.Product.Specifications |
| | | oi.ModelNumber = products.Product.ModelNumber |
| | | break |
| | | } |
| | | } |
| | | for _, confirm := range confirmInfo { |
| | | if operation.ProductId == confirm.ProductId { |
| | | oi.SendAmount = confirm.OverReceiveAmount.IntPart() |
| | | break |
| | | } |
| | | } |
| | |
| | | oi.Unit = products.Product.Unit |
| | | oi.Specifications = products.Product.Specifications |
| | | oi.ModelNumber = products.Product.ModelNumber |
| | | for _, confirm := range confirmInfo { |
| | | if products.Product.Number == confirm.ProductId { |
| | | oi.SendAmount = confirm.OverReceiveAmount.IntPart() |
| | | break |
| | | } |
| | | } |
| | | operationInfos = append(operationInfos, oi) |
| | | } |
| | | } |