Java 类ims.ocrr.vo.ServiceQuestionAnswerVoCollection 实例源码

项目:AvoinApotti    文件:MyOrderQuestionsPopulation.java   
private CategoryQuestionAnswerVo getCategoryQuestionAnswer(Category category, OcsQASessionVo voOcsQASession)
{
    for (int i = 0; voOcsQASession != null && i < voOcsQASession.getCategoryQuestionAnswers().size(); i++)
    {
        if(voOcsQASession.getCategoryQuestionAnswers().get(i).getCategory().equals(category))
            return voOcsQASession.getCategoryQuestionAnswers().get(i);
    }

    CategoryQuestionAnswerVo voCategoryQuestionAnswer = new CategoryQuestionAnswerVo();
    voCategoryQuestionAnswer.setCategory(category);
    voCategoryQuestionAnswer.setServiceQuestionAnswers(new ServiceQuestionAnswerVoCollection());
    voCategoryQuestionAnswer.setCategoryQuestionAnswers(new GeneralQuestionAnswerVoCollection());

    return voCategoryQuestionAnswer;
}
项目:AvoinApotti    文件:MyOrderQuestionsPopulation.java   
private void buildServiceQuestions(Category category, CategoryQuestionAnswerVo voCategoryQuestionAnswerVo, ServiceQuestionShortVoCollection serviceConfigQuestions, GeneralQuestionAnswerVoCollection askedInEveryInvestigations, InvestigationOcsQuestionsVo voInvOcs)
{
    if (voInvOcs != null)
    {
        Category investigationCategory = voInvOcs.getInvestigationIndexIsNotNull() && voInvOcs.getInvestigationIndex().getCategoryIsNotNull() ? voInvOcs.getInvestigationIndex().getCategory() : null;
        if (investigationCategory != null && investigationCategory.equals(category))
        {
            ServiceLiteVo serviceVo = voInvOcs.getProviderServiceIsNotNull() && voInvOcs.getProviderService().getLocationServiceIsNotNull() ? voInvOcs.getProviderService().getLocationService().getService() : null;
            if(serviceVo != null)
            {
                ServiceQuestionAnswerVo voServiceQA = getInstServiceQuestionAnswerFromConfigService(serviceConfigQuestions, voCategoryQuestionAnswerVo, askedInEveryInvestigations, serviceVo, voInvOcs);
                boolean questionsAdded = voServiceQA  != null && voServiceQA.getServiceQuestionAnswersIsNotNull() && voServiceQA.getServiceQuestionAnswers().size() > 0;
                boolean investigationQuestionsAdded = voServiceQA  != null && voServiceQA.getInvestigationQuestionAnswersIsNotNull() && voServiceQA.getInvestigationQuestionAnswers().size() > 0;
                //Add the Service only if there is at least one Service or Investigation Question
                if(questionsAdded || investigationQuestionsAdded)
                {
                    if (voCategoryQuestionAnswerVo.getServiceQuestionAnswers() == null)
                        voCategoryQuestionAnswerVo.setServiceQuestionAnswers(new ServiceQuestionAnswerVoCollection());

                    int index = voCategoryQuestionAnswerVo.getServiceQuestionAnswers().indexOf(voServiceQA);
                    if(index < 0)
                        voCategoryQuestionAnswerVo.getServiceQuestionAnswers().add(voServiceQA);
                    else
                        voCategoryQuestionAnswerVo.getServiceQuestionAnswers().set(index, voServiceQA);
                }
            }
        }
    }
    else
    {
        voCategoryQuestionAnswerVo.setServiceQuestionAnswers(null);
    }
}
项目:openMAXIMS    文件:MyOrderQuestionsPopulation.java   
private CategoryQuestionAnswerVo getCategoryQuestionAnswer(Category category, OcsQASessionVo voOcsQASession)
{
    for (int i = 0; voOcsQASession != null && i < voOcsQASession.getCategoryQuestionAnswers().size(); i++)
    {
        if(voOcsQASession.getCategoryQuestionAnswers().get(i).getCategory().equals(category))
            return voOcsQASession.getCategoryQuestionAnswers().get(i);
    }

    CategoryQuestionAnswerVo voCategoryQuestionAnswer = new CategoryQuestionAnswerVo();
    voCategoryQuestionAnswer.setCategory(category);
    voCategoryQuestionAnswer.setServiceQuestionAnswers(new ServiceQuestionAnswerVoCollection());
    voCategoryQuestionAnswer.setCategoryQuestionAnswers(new GeneralQuestionAnswerVoCollection());

    return voCategoryQuestionAnswer;
}
项目:openMAXIMS    文件:MyOrderQuestionsPopulation.java   
private void buildServiceQuestions(Category category, CategoryQuestionAnswerVo voCategoryQuestionAnswerVo, ServiceQuestionShortVoCollection serviceConfigQuestions, GeneralQuestionAnswerVoCollection askedInEveryInvestigations, InvestigationOcsQuestionsVo voInvOcs)
{
    if (voInvOcs != null)
    {
        Category investigationCategory = voInvOcs.getInvestigationIndexIsNotNull() && voInvOcs.getInvestigationIndex().getCategoryIsNotNull() ? voInvOcs.getInvestigationIndex().getCategory() : null;
        if (investigationCategory != null && investigationCategory.equals(category))
        {
            ServiceLiteVo serviceVo = voInvOcs.getProviderServiceIsNotNull() && voInvOcs.getProviderService().getLocationServiceIsNotNull() ? voInvOcs.getProviderService().getLocationService().getService() : null;
            if(serviceVo != null)
            {
                ServiceQuestionAnswerVo voServiceQA = getInstServiceQuestionAnswerFromConfigService(serviceConfigQuestions, voCategoryQuestionAnswerVo, askedInEveryInvestigations, serviceVo, voInvOcs);
                boolean questionsAdded = voServiceQA  != null && voServiceQA.getServiceQuestionAnswersIsNotNull() && voServiceQA.getServiceQuestionAnswers().size() > 0;
                boolean investigationQuestionsAdded = voServiceQA  != null && voServiceQA.getInvestigationQuestionAnswersIsNotNull() && voServiceQA.getInvestigationQuestionAnswers().size() > 0;
                //Add the Service only if there is at least one Service or Investigation Question
                if(questionsAdded || investigationQuestionsAdded)
                {
                    if (voCategoryQuestionAnswerVo.getServiceQuestionAnswers() == null)
                        voCategoryQuestionAnswerVo.setServiceQuestionAnswers(new ServiceQuestionAnswerVoCollection());

                    int index = voCategoryQuestionAnswerVo.getServiceQuestionAnswers().indexOf(voServiceQA);
                    if(index < 0)
                        voCategoryQuestionAnswerVo.getServiceQuestionAnswers().add(voServiceQA);
                    else
                        voCategoryQuestionAnswerVo.getServiceQuestionAnswers().set(index, voServiceQA);
                }
            }
        }
    }
    else
    {
        voCategoryQuestionAnswerVo.setServiceQuestionAnswers(null);
    }
}
项目:openMAXIMS    文件:MyOrderQuestionsPopulation.java   
private CategoryQuestionAnswerVo getCategoryQuestionAnswer(Category category, OcsQASessionVo voOcsQASession)
{
    for (int i = 0; voOcsQASession != null && i < voOcsQASession.getCategoryQuestionAnswers().size(); i++)
    {
        if(voOcsQASession.getCategoryQuestionAnswers().get(i).getCategory().equals(category))
            return voOcsQASession.getCategoryQuestionAnswers().get(i);
    }

    CategoryQuestionAnswerVo voCategoryQuestionAnswer = new CategoryQuestionAnswerVo();
    voCategoryQuestionAnswer.setCategory(category);
    voCategoryQuestionAnswer.setServiceQuestionAnswers(new ServiceQuestionAnswerVoCollection());
    voCategoryQuestionAnswer.setCategoryQuestionAnswers(new GeneralQuestionAnswerVoCollection());

    return voCategoryQuestionAnswer;
}
项目:openMAXIMS    文件:MyOrderQuestionsPopulation.java   
private void buildServiceQuestions(Category category, CategoryQuestionAnswerVo voCategoryQuestionAnswerVo, ServiceQuestionShortVoCollection serviceConfigQuestions, GeneralQuestionAnswerVoCollection askedInEveryInvestigations, InvestigationOcsQuestionsVo voInvOcs)
{
    if (voInvOcs != null)
    {
        Category investigationCategory = voInvOcs.getInvestigationIndexIsNotNull() && voInvOcs.getInvestigationIndex().getCategoryIsNotNull() ? voInvOcs.getInvestigationIndex().getCategory() : null;
        if (investigationCategory != null && investigationCategory.equals(category))
        {
            ServiceLiteVo serviceVo = voInvOcs.getProviderServiceIsNotNull() && voInvOcs.getProviderService().getLocationServiceIsNotNull() ? voInvOcs.getProviderService().getLocationService().getService() : null;
            if(serviceVo != null)
            {
                ServiceQuestionAnswerVo voServiceQA = getInstServiceQuestionAnswerFromConfigService(serviceConfigQuestions, voCategoryQuestionAnswerVo, askedInEveryInvestigations, serviceVo, voInvOcs);
                boolean questionsAdded = voServiceQA  != null && voServiceQA.getServiceQuestionAnswersIsNotNull() && voServiceQA.getServiceQuestionAnswers().size() > 0;
                boolean investigationQuestionsAdded = voServiceQA  != null && voServiceQA.getInvestigationQuestionAnswersIsNotNull() && voServiceQA.getInvestigationQuestionAnswers().size() > 0;
                //Add the Service only if there is at least one Service or Investigation Question
                if(questionsAdded || investigationQuestionsAdded)
                {
                    if (voCategoryQuestionAnswerVo.getServiceQuestionAnswers() == null)
                        voCategoryQuestionAnswerVo.setServiceQuestionAnswers(new ServiceQuestionAnswerVoCollection());

                    int index = voCategoryQuestionAnswerVo.getServiceQuestionAnswers().indexOf(voServiceQA);
                    if(index < 0)
                        voCategoryQuestionAnswerVo.getServiceQuestionAnswers().add(voServiceQA);
                    else
                        voCategoryQuestionAnswerVo.getServiceQuestionAnswers().set(index, voServiceQA);
                }
            }
        }
    }
    else
    {
        voCategoryQuestionAnswerVo.setServiceQuestionAnswers(null);
    }
}
项目:openmaxims-linux    文件:MyOrderQuestionsPopulation.java   
private CategoryQuestionAnswerVo getCategoryQuestionAnswer(Category category, OcsQASessionVo voOcsQASession)
{
    for (int i = 0; voOcsQASession != null && i < voOcsQASession.getCategoryQuestionAnswers().size(); i++)
    {
        if(voOcsQASession.getCategoryQuestionAnswers().get(i).getCategory().equals(category))
            return voOcsQASession.getCategoryQuestionAnswers().get(i);
    }

    CategoryQuestionAnswerVo voCategoryQuestionAnswer = new CategoryQuestionAnswerVo();
    voCategoryQuestionAnswer.setCategory(category);
    voCategoryQuestionAnswer.setServiceQuestionAnswers(new ServiceQuestionAnswerVoCollection());
    voCategoryQuestionAnswer.setCategoryQuestionAnswers(new GeneralQuestionAnswerVoCollection());

    return voCategoryQuestionAnswer;
}
项目:openmaxims-linux    文件:MyOrderQuestionsPopulation.java   
private void buildServiceQuestions(Category category, CategoryQuestionAnswerVo voCategoryQuestionAnswerVo, ServiceQuestionShortVoCollection serviceConfigQuestions, GeneralQuestionAnswerVoCollection askedInEveryInvestigations, InvestigationOcsQuestionsVo voInvOcs)
{
    if (voInvOcs != null)
    {
        Category investigationCategory = voInvOcs.getInvestigationIndexIsNotNull() && voInvOcs.getInvestigationIndex().getCategoryIsNotNull() ? voInvOcs.getInvestigationIndex().getCategory() : null;
        if (investigationCategory != null && investigationCategory.equals(category))
        {
            ServiceLiteVo serviceVo = voInvOcs.getProviderServiceIsNotNull() && voInvOcs.getProviderService().getLocationServiceIsNotNull() ? voInvOcs.getProviderService().getLocationService().getService() : null;
            if(serviceVo != null)
            {
                ServiceQuestionAnswerVo voServiceQA = getInstServiceQuestionAnswerFromConfigService(serviceConfigQuestions, voCategoryQuestionAnswerVo, askedInEveryInvestigations, serviceVo, voInvOcs);
                boolean questionsAdded = voServiceQA  != null && voServiceQA.getServiceQuestionAnswersIsNotNull() && voServiceQA.getServiceQuestionAnswers().size() > 0;
                boolean investigationQuestionsAdded = voServiceQA  != null && voServiceQA.getInvestigationQuestionAnswersIsNotNull() && voServiceQA.getInvestigationQuestionAnswers().size() > 0;
                //Add the Service only if there is at least one Service or Investigation Question
                if(questionsAdded || investigationQuestionsAdded)
                {
                    if (voCategoryQuestionAnswerVo.getServiceQuestionAnswers() == null)
                        voCategoryQuestionAnswerVo.setServiceQuestionAnswers(new ServiceQuestionAnswerVoCollection());

                    int index = voCategoryQuestionAnswerVo.getServiceQuestionAnswers().indexOf(voServiceQA);
                    if(index < 0)
                        voCategoryQuestionAnswerVo.getServiceQuestionAnswers().add(voServiceQA);
                    else
                        voCategoryQuestionAnswerVo.getServiceQuestionAnswers().set(index, voServiceQA);
                }
            }
        }
    }
    else
    {
        voCategoryQuestionAnswerVo.setServiceQuestionAnswers(null);
    }
}