예제 #1
0
        public (int requestId, int onlineStatusId, string incomingNum, int barcode) RequisitionDocumentAdd(RequisitionSendArgument argument)
        {
            var protectionDocTypeId = argument.PatentType.UID;
            //var protectionDocTypeCode = _dictionaryHelper.GetDictionaryCodeById(nameof(DicProtectionDocType), protectionDocTypeId);
            var         protectionDocTypeCode = _dictionaryHelper.GetDictionaryCodeByExternalId(nameof(DicProtectionDocType), protectionDocTypeId);
            var         receiveRypeCode       = _integrationDictionaryHelper.GetReceiveTypeCode(argument.SystemInfo.Sender);
            var         receiveTypeId         = _dictionaryHelper.GetDictionaryIdByCode(nameof(DicReceiveType), receiveRypeCode);
            var         departmentCode        = _integrationEnumMapper.MapToDepartment(protectionDocTypeCode);
            var         departmentId          = _dictionaryHelper.GetDictionaryIdByCode(nameof(DicDepartment), departmentCode);
            var         speciesTradeMarkId    = _dictionaryHelper.GetSpeciesTradeMarkId(argument.IsCollectiveTradeMark);
            var         typeTrademarkId       = _dictionaryHelper.GetNullableDictionaryIdByCode(nameof(DicTypeTrademark), argument.PatentSubType);
            DicCustomer customer = null;

            customer = Mapper.Map <DicCustomer>(
                argument,
                el => el.Items[nameof(customer.TypeId)] = _dictionaryHelper.GetDictionaryEntityByExternalId(nameof(DicCustomerType), argument.CustomerType.UID).Id);

            var addressee = _integrationDictionaryHelper.GetCustomerIdOrCreateNew(customer);

            var subTypeCode   = GetSubType(protectionDocTypeCode);
            var requestTypeId = _dictionaryHelper.GetDictionaryIdByCode(nameof(DicProtectionDocSubType), subTypeCode);

            //if (int.TryParse(argument.PatentSubType, out var patentSubType))
            //{
            //    _dictionaryHelper.ChechDictionaryId(nameof(DicProtectionDocSubType), patentSubType);
            //    requestTypeId = patentSubType;
            //}

            var request = new Request
            {
                ProtectionDocTypeId = protectionDocTypeId,
                ReceiveTypeId       = receiveTypeId,
                DepartmentId        = departmentId,
                DivisionId          = _dictionaryHelper.GetDictionaryIdByCode(nameof(DicDivision), DicDivisionCodes.RGP_NIIS),
                FlDivisionId        = _integrationDictionaryHelper.GetDivisionId(_configuration.MainExecutorIds[protectionDocTypeCode]),
                IsComplete          = false,
                AddresseeId         = addressee.Id,
                AddresseeAddress    = addressee.Address,
                UserId             = _configuration.MainExecutorIds[protectionDocTypeCode],
                SpeciesTradeMarkId = speciesTradeMarkId,
                TypeTrademarkId    = typeTrademarkId,
                RequestTypeId      = requestTypeId,
                IsFromLk           = true
            };

            if (argument.BlockFile.Any(d => d.Type.UID == 292))
            {
                request.Referat = argument.BlockFile.First(d => d.Type.UID == 292).Type.Note;
            }

            if (argument.BlockFile != null)
            {
                var imageFile = _attachFileHelper.GetImageFile(argument.BlockFile,
                                                               _validationHelper.SenderIsPep(argument.SystemInfo.Sender));
                if (imageFile != null)
                {
                    request.Image           = imageFile;
                    request.IsImageFromName = false;
                }
            }

            CreateRequest(Mapper.Map(argument, request));

            if (argument.BlockFile != null)
            {
                var meidaFile = argument.BlockFile.Where(d => d.Type.UID == 4421).ToList();
                if (meidaFile.Any())
                {
                    foreach (var attachedFile in meidaFile)
                    {
                        _attachFileHelper.AttachFile(new AttachedFileModel
                        {
                            PageCount = attachedFile.PageCount,
                            CopyCount = 0,
                            File      = attachedFile.File.Content,
                            Length    = attachedFile.File.Content.Length,
                            IsMain    = false,
                            Name      = attachedFile.File.Name
                        }, request.Id);
                    }
                }
            }

            var requestInfo = new RequestInfo
            {
                RequestId            = request.Id,
                FlagTth              = false,
                IsConventionPriority = false,
                IsExhibitPriority    = false,
                IsStandardFont       = false,
                IsTransliteration    = false,
                IsTranslation        = false,
                IsVolumeTZ           = false,
                IsColorPerformance   = false,
                AcceptAgreement      = false,
                BreedCountryId       = argument.BreedCountry != null ? (argument.BreedCountry.UID > 0 ? _dictionaryHelper.GetDictionaryIdByExternalId(nameof(DicCountry), argument.BreedCountry.UID) : (int?)null) : null
            };

            _niisContext.RequestInfos.Add(Mapper.Map(argument, requestInfo));
            _niisContext.SaveChanges();

            var dicDocTypeCode = _integrationEnumMapper.MapProtectionDocTypeToDocumentType(protectionDocTypeCode);
            var docTypeId      = _dictionaryHelper.GetDictionaryIdByCode(nameof(DicDocumentType), dicDocTypeCode);

            var document = new Document(_dictionaryHelper.GetDocumentType(docTypeId).type)
            {
                TypeId        = docTypeId,
                DateCreate    = DateTimeOffset.Now,
                AddresseeId   = addressee.Id,
                StatusId      = _dictionaryHelper.GetDictionaryIdByCode(nameof(DicDocumentStatus), DicDocumentStatusCodes.InWork),
                ReceiveTypeId = _dictionaryHelper.GetDictionaryIdByCode(nameof(DicReceiveType), DicReceiveTypeCodes.ElectronicFeed)
            };

            _documentHelper.CreateDocument(document);

            _attachFileHelper.AttachFile(new AttachedFileModel
            {
                PageCount = argument.PageCount,
                CopyCount = argument.CopyCount,
                File      = argument.RequisitionFile.Content,
                Length    = argument.RequisitionFile.Content.Length,
                IsMain    = true,
                Name      = argument.RequisitionFile.Name
            }, document);


            _niisContext.Documents.Update(document);
            _niisContext.SaveChanges();

            _niisContext.RequestsDocuments.Add(new RequestDocument
            {
                DocumentId = document.Id,
                RequestId  = request.Id
            });
            _niisContext.SaveChanges();

            var routeId = _integrationDictionaryHelper.GetRouteIdByProtectionDocType(protectionDocTypeId);
            var stage   = _integrationDictionaryHelper.GetRouteStage(routeId);

            var requestWorkflow = new RequestWorkflow
            {
                OwnerId        = request.Id,
                DateCreate     = DateTimeOffset.Now,
                RouteId        = routeId,
                CurrentStageId = stage.Id,
                CurrentUserId  = _configuration.MainExecutorIds[protectionDocTypeCode],
                IsComplete     = stage.IsLast,
                IsSystem       = stage.IsSystem,
                IsMain         = stage.IsMain
            };

            _niisContext.RequestWorkflows.Add(requestWorkflow);
            _niisContext.SaveChanges();

            request.CurrentWorkflowId = requestWorkflow.Id;
            _niisContext.Requests.Update(request);
            _niisContext.SaveChanges();

            _integrationStatusUpdater.Add(requestWorkflow.Id);

            var dicCustomer = _integrationDictionaryHelper.GetCustomerIdOrCreateNew(new DicCustomer
            {
                TypeId   = _dictionaryHelper.GetDictionaryIdByCode(nameof(DicCustomerType), DicCustomerTypeCodes.Undefined),
                NameRu   = argument.AdrCustomerName,
                Phone    = argument.AdrPhone,
                PhoneFax = argument.AdrFax,
                Email    = argument.AdrEmail,
                Address  = $"{argument.AdrRegion}, {argument.AdrStreet}, {argument.AdrPostCode}"
            });

            _niisContext.RequestCustomers.Add(new RequestCustomer
            {
                CustomerId     = dicCustomer.Id,
                RequestId      = request.Id,
                DateCreate     = DateTimeOffset.Now,
                CustomerRoleId = _dictionaryHelper.GetDictionaryIdByCode(nameof(DicCustomerRole), DicCustomerRole.Codes.Correspondence)
            });
            _niisContext.SaveChanges();

            _egovPayHelper.CreatePay(argument.Pay);

            var onlineStatusId = 0;

            if (requestWorkflow.CurrentStageId != null)
            {
                onlineStatusId = _integrationDictionaryHelper.GetOnlineStatus(requestWorkflow.CurrentStageId.Value);
            }

            return(requestId : request.Id, onlineStatusId : onlineStatusId, incomingNum : request.IncomingNumber, barcode : request.Barcode);
        }
예제 #2
0
        protected Action SendRequestToNextStage(string stageCode, int?nextUserId = null)
        {
            return(() =>
            {
                //var fromStageId = WorkflowRequest.CurrentWorkflowObject.CurrentWorkflow.CurrentStageId.Value;

                var nextWorkFlow = CreateRequestWorkFlow(stageCode, nextUserId);

                var currentStage = nextWorkFlow.CurrentStage;
                nextWorkFlow.CurrentStage = null;

                Executor.GetCommand <CreateRequestWorkflowCommand>().Process(r => r.Execute(nextWorkFlow));

                _integrationStatusUpdater.Add(nextWorkFlow.Id);
                _integrationDocumentUpdater.Add(nextWorkFlow);

                var request = Executor.GetQuery <GetRequestByIdQuery>().Process(r => r.Execute(WorkflowRequest.CurrentWorkflowObject.Id));
                request.CurrentWorkflow = nextWorkFlow;
                request.CurrentWorkflowId = nextWorkFlow.Id;
                request.IsComplete = nextWorkFlow.IsComplete ?? false;

                var expertise = new[]
                {
                    RouteStageCodes.TZ_03_2_2,
                    RouteStageCodes.SA_032
                };

                if (expertise.Contains(currentStage?.Code))
                {
                    request.PublicDate = DateTimeOffset.Now;
                }

                var nextStage = Executor.GetQuery <GetDicRouteStageByCodeQuery>().Process(q => q.Execute(stageCode));

                request.StatusId = nextStage.RequestStatusId ?? request.StatusId;

                Executor.GetCommand <UpdateRequestCommand>().Process(r => r.Execute(request));
                request = Executor.GetQuery <GetRequestByIdQuery>().Process(r => r.Execute(request.Id));

                Executor.GetCommand <UpdateMarkAsExecutedWorkflowTaskEvenstByRequestIdCommand>().Process(r => r.Execute(request.Id));

                #region генерируем дату подачи заявки

                var formationStageCodes = new[]
                {
                    RouteStageCodes.NMPT_02_1,
                    RouteStageCodes.UM_02_1
                };

                if (formationStageCodes.Contains(stageCode))
                {
                    request.RequestDate = request.DateCreate;
                    Executor.GetCommand <UpdateRequestCommand>().Process(r => r.Execute(request));
                }

                #endregion

                #region Запланируем автоэтап.

                CreateWorkflowAutomaticStageTask();

                #endregion

                var conversionStages = new[]
                {
                    RouteStageCodes.UM_03_2_4,
                    RouteStageCodes.I_03_3_1__1
                };

                if (conversionStages.Contains(stageCode))
                {
                    ConvertRequest(WorkflowRequest.RequestId);
                }

                //Executor.GetHandler<GenerateAutoNotificationHandler>()
                //    .Process(h => h.Execute(WorkflowRequest.CurrentWorkflowObject.Id));

                //Executor.GetHandler<GenerateAutoPaymentHandler>()
                //    .Process(h => h.Execute(WorkflowRequest.CurrentWorkflowObject.Id));

                //Executor.GetHandler<AutoChargeRequestPaymentInvoicesHandler>()
                //    .Process(handler => handler.Execute(WorkflowRequest.CurrentWorkflowObject.Id, fromStageId, nextStage.Id));

                var abortStages = new[]
                {
                    RouteStageCodes.TZ_03_3_9
                };
                if (abortStages.Contains(stageCode))
                {
                    string newStatusCode;
                    var termStageCodes = new[]
                    {
                        //RouteStageCodes.TZTermProlongationFull,
                        //RouteStageCodes.TZTermProlongationChange,
                        //RouteStageCodes.TZTermProlongationConvert,
                        //RouteStageCodes.TZTermProlongationFormal,
                        //RouteStageCodes.TZTermProlongationObjection,
                        //RouteStageCodes.TZTermProlongationSplit,
                        RouteStageCodes.TZ_03_3_7_3,
                        RouteStageCodes.TZ_03_3_7_4
                    };
                    var examAwaitPaymentStageCodes = new[]
                    {
                        RouteStageCodes.TZ_03_2_2_0,
                        RouteStageCodes.TZAwaitingRegistrationTermRestoration
                    };
                    if (termStageCodes.Contains(request.CurrentWorkflow.FromStage.Code))
                    {
                        newStatusCode = DicRequestStatusCodes.RecallByNotAnswered;
                    }
                    else if (examAwaitPaymentStageCodes.Contains(request.CurrentWorkflow.FromStage.Code))
                    {
                        newStatusCode = DicRequestStatusCodes.RecallByNotPaid;
                    }
                    else
                    {
                        newStatusCode = DicRequestStatusCodes.RecalByRequest;
                    }
                    var newStatus = Executor.GetQuery <GetDicRequestStatusByCodeQuery>()
                                    .Process(q => q.Execute(newStatusCode));
                    request.StatusId = newStatus.Id;
                    Executor.GetCommand <UpdateRequestCommand>().Process(q => q.Execute(request));
                }

                var generateProtectionDocumentStage = new[]
                {
                    RouteStageCodes.PO_04,
                    RouteStageCodes.SA_04,
                    RouteStageCodes.TZ_04,
                    RouteStageCodes.TZRegistration,
                    RouteStageCodes.UM_04,
                    RouteStageCodes.NMPT_04_1,
                    RouteStageCodes.I_04_1
                };

                //var вecisionSentToApplicant = new[]
                //{
                //    RouteStageCodes.TZ_03_3_7,
                //    RouteStageCodes.PO_03_8,
                //    RouteStageCodes.NMPT_03_7,
                //    RouteStageCodes.I_03_3_7_0,
                //    RouteStageCodes.UM_03_7_0,
                //    RouteStageCodes.SA_03_3_3_8,
                //    RouteStageCodes.I_03_3_2_3,
                //};

                //if (вecisionSentToApplicant.Contains(WorkflowRequest.NextStageCode))
                //{
                //    SendRequestToLk(request);
                //}

                if (generateProtectionDocumentStage.Contains(WorkflowRequest.NextStageCode))
                {
                    //Создание Охранного документа(ОД)
                    GenerateProtectionDocument(WorkflowRequest);
                }

                if (_registryCodes.Contains(WorkflowRequest.NextStageCode))
                {
                    ProcessStateRegistryWorkflow();
                }
            });
        }
예제 #3
0
        /// <summary>
        /// Добавление договора
        /// </summary>
        /// <param name="request">Входные параметры</param>
        /// <param name="response">Данные для ответа</param>
        /// <returns></returns>
        public ContractResponse AddContract(ContractRequest request, ContractResponse response)
        {
            var         typeId = _dictionaryHelper.GetDictionaryIdByExternalId(nameof(DicDocumentType), request.DocumentType.Id);
            DicCustomer customer;

            customer = Mapper.Map <DicCustomer>(
                request,
                el => el.Items[nameof(customer.TypeId)] = _dictionaryHelper.GetDictionaryEntityByExternalId(nameof(DicCustomerType), request.Addressee.CustomerType.Id).Id);

            customer.CountryId = _dictionaryHelper.GetDictionaryIdByExternalId(nameof(DicCountry), request.Addressee.CountryInfo.Id);

            var addressee = _integrationDictionaryHelper.GetCustomerIdOrCreateNew(customer);


            var correspondence      = request.CorrespondenceAddress;
            var protectionDocTypeId = _dictionaryHelper.GetDictionaryIdByCode(nameof(DicProtectionDocType),
                                                                              DicProtectionDocTypeCodes.ProtectionDocTypeContractCode);

            #region Добавление договора
            var contract = new Contract
            {
                ProtectionDocTypeId = protectionDocTypeId,
                Description         = request.DocumentDescriptionRu,
                ReceiveTypeId       = int.Parse(DicReceiveTypeCodes.ElectronicFeed),
                DivisionId          = _dictionaryHelper.GetDictionaryIdByCode(nameof(DicDivision), DicDivisionCodes.RGP_NIIS),
                AddresseeId         = addressee.Id,
                AddresseeAddress    = addressee.Address,
                StatusId            = 1
            };

            CreateContract(Mapper.Map(request, contract));
            #endregion

            #region Добавление адресата для переписки
            if (correspondence != null)
            {
                var correspondenceCustomer = _integrationDictionaryHelper.GetCustomerIdOrCreateNew(new DicCustomer
                {
                    TypeId   = _dictionaryHelper.GetDictionaryIdByCode(nameof(DicCustomerType), DicCustomerTypeCodes.Undefined),
                    NameRu   = correspondence.CustomerName,
                    Phone    = correspondence.Phone,
                    PhoneFax = correspondence.Fax,
                    Email    = correspondence.Email
                });

                _niisWebContext.ContractCustomers.Add(new ContractCustomer
                {
                    CustomerId     = correspondenceCustomer.Id,
                    ContractId     = contract.Id,
                    DateCreate     = DateTimeOffset.Now,
                    CustomerRoleId = _dictionaryHelper.GetDictionaryIdByCode(nameof(DicCustomerRole), DicCustomerRole.Codes.Correspondence)
                });
                _niisWebContext.SaveChanges();
            }
            #endregion

            #region Добавление контрагентов

            foreach (var item in request.BlockCustomers)
            {
                if (item.CustomerType == null)
                {
                    continue;
                }

                if (item.CustomerType.Id == 0)
                {
                    item.CustomerType.Id =
                        _dictionaryHelper.GetDictionaryIdByCode(nameof(DicCustomerType),
                                                                DicCustomerTypeCodes.Undefined);
                }

                var dicCustomer = new DicCustomer
                {
                    TypeId            = _dictionaryHelper.GetDictionaryEntityByExternalId(nameof(DicCustomerType), item.CustomerType.Id).Id,
                    NameRu            = item.NameRu,
                    NameKz            = item.NameKz,
                    NameEn            = item.NameEn,
                    Phone             = item.Phone,
                    PhoneFax          = item.Fax,
                    Email             = item.Email,
                    Address           = $"{item.Region}, {item.Street}, {item.Index}",
                    CertificateNumber = item.CertificateNumber,
                    CertificateSeries = item.CertificateSeries,
                    Opf                  = item.Opf,
                    ApplicantsInfo       = item.ApplicantsInfo,
                    PowerAttorneyFullNum = item.PowerAttorneyFullNum,
                    ShortDocContent      = item.ShortDocContent,
                    Xin                  = item.Xin,
                    NotaryName           = item.NotaryName,
                    DateCreate           = DateTimeOffset.Now
                };

                if (item.RegistrationDate != DateTime.MinValue)
                {
                    dicCustomer.RegDate = new DateTimeOffset(item.RegistrationDate.GetValueOrDefault());
                }

                var contractCustomer = new ContractCustomer
                {
                    CustomerId     = _integrationDictionaryHelper.GetCustomerIdOrCreateNew(dicCustomer).Id,
                    ContractId     = contract.Id,
                    DateCreate     = DateTimeOffset.Now,
                    CustomerRoleId = _dictionaryHelper.GetDictionaryEntityByExternalId(nameof(DicCustomerRole), item.CustomerRole.Id)?.Id
                };

                _niisWebContext.ContractCustomers.Add(contractCustomer);
                _niisWebContext.SaveChanges();
            }

            #endregion

            #region Добавление прикрепленного документа заявления
            var document = new Document(_dictionaryHelper.GetDocumentType(typeId).type)
            {
                TypeId        = typeId,
                DateCreate    = DateTimeOffset.Now,
                AddresseeId   = addressee.Id,
                StatusId      = _dictionaryHelper.GetDictionaryIdByCode(nameof(DicDocumentStatus), DicDocumentStatusCodes.InWork),
                ReceiveTypeId = _dictionaryHelper.GetDictionaryIdByCode(nameof(DicReceiveType), DicReceiveTypeCodes.ElectronicFeed)
            };
            _documentHelper.CreateDocument(document);

            _attachFileHelper.AttachFile(new AttachedFileModel
            {
                PageCount = request.RequisitionFile.PageCount.GetValueOrDefault(),
                CopyCount = request.RequisitionFile.CopyCount.GetValueOrDefault(),
                File      = request.RequisitionFile.Content,
                Length    = request.RequisitionFile.Content.Length,
                IsMain    = true,
                Name      = request.RequisitionFile.Name
            }, document);

            _niisWebContext.Documents.Update(document);
            _niisWebContext.SaveChanges();

            _niisWebContext.ContractsDocuments.Add(new ContractDocument
            {
                DocumentId = document.Id,
                ContractId = contract.Id
            });
            _niisWebContext.SaveChanges();
            #endregion

            #region Добавление документов
            foreach (var attachedFile in request.AttachmentFiles)
            {
                if (attachedFile.File == null)
                {
                    continue;
                }

                var documentType   = _dictionaryHelper.GetDocumentType(attachedFile.FileType.Id);
                var inWorkStatusId =
                    _dictionaryHelper.GetDictionaryIdByCode(nameof(DicDocumentStatus), DicDocumentStatusCodes.InWork);
                var completedStatusId =
                    _dictionaryHelper.GetDictionaryIdByCode(nameof(DicDocumentStatus), DicDocumentStatusCodes.Completed);

                var attachmentDocument = new Document(documentType.type)
                {
                    TypeId        = documentType.typeId,
                    DateCreate    = DateTimeOffset.Now,
                    StatusId      = documentType.type == DocumentType.DocumentRequest ? completedStatusId : inWorkStatusId,
                    AddresseeId   = addressee.Id,
                    ReceiveTypeId = _dictionaryHelper.GetDictionaryIdByCode(nameof(DicReceiveType), DicReceiveTypeCodes.ElectronicFeed)
                };
                _documentHelper.CreateDocument(attachmentDocument);
                var attached = new AttachedFileModel
                {
                    Length    = attachedFile.File.Content.Length,
                    PageCount = attachedFile.File.PageCount.GetValueOrDefault(),
                    File      = attachedFile.File?.Content,
                    Name      = attachedFile.File.Name,
                    IsMain    = true,
                    CopyCount = 1
                };

                _attachFileHelper.AttachFile(attached, document);
                _niisWebContext.ContractsDocuments.Add(new ContractDocument
                {
                    DocumentId = attachmentDocument.Id,
                    ContractId = contract.Id
                });
                _niisWebContext.SaveChanges();
            }
            #endregion

            #region Добавление связи с ОД
            foreach (var contractPatent in request.PatentNumbers)
            {
                //Получаем типа патента
                if (!(_dictionaryHelper.GetDictionaryByExternalId(nameof(DicProtectionDocType), contractPatent.PatentType.Id) is DicProtectionDocType type))
                {
                    throw new NotSupportedException($"Тип с идентефикатором {contractPatent.PatentType.Id} не найден");
                }

                var patentId = _niisWebContext
                               .ProtectionDocs
                               .Where(d => d.GosNumber == contractPatent.PatentNumber && d.Request.ProtectionDocTypeId == type.Id)
                               .Select(d => d.Id).FirstOrDefault();

                _niisWebContext.ContractProtectionDocRelations.Add(new ContractProtectionDocRelation
                {
                    ProtectionDocId = patentId,
                    ContractId      = contract.Id
                });
                _niisWebContext.SaveChanges();
            }
            #endregion

            #region Добавление этапа обработки
            var routeId = _integrationDictionaryHelper.GetRouteIdByProtectionDocType(protectionDocTypeId);
            var stage   = _integrationDictionaryHelper.GetRouteStage(routeId);

            var contractWorkflow = new ContractWorkflow
            {
                OwnerId        = contract.Id,
                DateCreate     = DateTimeOffset.Now,
                RouteId        = routeId,
                CurrentStageId = stage.Id,
                CurrentUserId  = _configuration.AuthorAttachmentDocumentId,
                IsComplete     = stage.IsLast,
                IsSystem       = stage.IsSystem,
                IsMain         = stage.IsMain
            };
            _niisWebContext.ContractWorkflows.Add(contractWorkflow);
            _niisWebContext.SaveChanges();

            contract.CurrentWorkflowId = contractWorkflow.Id;
            _niisWebContext.Contracts.Update(contract);
            _niisWebContext.SaveChanges();
            #endregion


            _integrationStatusUpdater.Add(contractWorkflow.Id);

            var onlineStatusId = 0;
            if (contractWorkflow.CurrentStageId != null)
            {
                onlineStatusId = _integrationDictionaryHelper.GetOnlineStatus(contractWorkflow.CurrentStageId.Value);
            }

            response.DocumentId        = contract.Barcode;
            response.DocumentNumber    = contract.IncomingNumber;
            response.RequisitionStatus = onlineStatusId;


            return(response);
        }