| | |
| | | if res := models.NewOperationSearch().Orm.Preload("Details", "product_id=?", v.ProductId).Where("wms_operation.base_operation_type=? and wms_operation.status=? and wms_operation.to_location_id=?", constvar.BaseOperationTypeAdjust, constvar.OperationStatus_Ready, v.LocationId).First(&operation); res.Error != nil { |
| | | if errors.Is(res.Error, gorm.ErrRecordNotFound) { |
| | | records[k].Status = constvar.OperationStatus_Finish |
| | | records[k].BaseOperationType = constvar.BaseOperationTypeAdjust |
| | | continue |
| | | } else { |
| | | util.ResponseFormat(c, code.RequestError, fmt.Errorf("find operation err: %v", res.Error.Error())) |
| | |
| | | records[k].OperationId = operation.Id |
| | | records[k].Status = operation.Status |
| | | } |
| | | records[k].BaseOperationType = constvar.BaseOperationTypeAdjust |
| | | } |
| | | util.ResponseFormatListWithPage(c, code.Success, records, int(total), params.Page, params.PageSize) |
| | | } |