| | |
| | | for _, detail := range details { |
| | | operationIds = append(operationIds, detail.OperationID) |
| | | } |
| | | //获取操作记录 |
| | | //获取已完成的操作记录 |
| | | operations, err := models.NewOperationSearch().SetIds(operationIds).SetStatus(constvar.OperationStatus_Finish).FindNotTotal() |
| | | if err != nil { |
| | | util.ResponseFormat(c, code.RequestParamError, "查询操作记录失败") |
| | |
| | | var resp response.InventoryHistory |
| | | resp.Amount = detail.Amount |
| | | resp.Unit = params.Unit |
| | | resp.ProductName = params.ProductName |
| | | for _, operation := range operations { |
| | | if detail.OperationID == operation.Id { |
| | | resp.Number = operation.Number |
| | | resp.Date = operation.UpdateTime |
| | | resp.BaseOperationType = operation.BaseOperationType |
| | | resp.Status = "完成" |
| | | resp.ContactedName = operation.ContacterName |
| | | resp.FromLocation = operation.FromLocation.Name |
| | | resp.ToLocation = operation.ToLocation.Name |