コード例 #1
0
 // for associate with goal
 @POST
 @Consumes(MediaType.APPLICATION_JSON)
 @Produces(MediaType.APPLICATION_JSON)
 @Path("/getRecommandedProductGoalList")
 public Response getRecommandedProductGoalList(
     @Context HttpServletRequest request, RecommandedProdForGoal recommandedProdForGoal)
     throws Exception {
   String buId = request.getHeader("buId");
   BaseResponse<RecommandedGoalProdResult> br = new BaseResponse<RecommandedGoalProdResult>();
   br.setResponseListObject(
       commonProdRecommService.getRecommandedProductForGoal(
           recommandedProdForGoal, Integer.parseInt(buId)));
   response = FiinfraResponseBuilder.getSuccessResponse(br, null);
   return response;
 }
コード例 #2
0
  @POST
  @Consumes(MediaType.APPLICATION_JSON)
  @Produces(MediaType.APPLICATION_JSON)
  @Path(value = "/getRecommandedProductForQuickAdviceTool")
  public Response getRecommandedProductForQuickAdviceTool(
      @Context HttpServletRequest request, AutoPlanData autoPlanData) {
    String buId = request.getHeader("buId");
    String dataXML = "<Root>";
    dataXML += "<Title>";
    if (autoPlanData.getTitle() != null) {
      dataXML += autoPlanData.getTitle();
    } else {
      dataXML += "0";
    }
    dataXML += "</Title>";

    dataXML += "<FirstName>";
    if (autoPlanData.getFirstname() != null) {
      dataXML += autoPlanData.getFirstname();
    } else {
      dataXML += "";
    }
    dataXML += "</FirstName>";

    dataXML += "<LastName>";
    if (autoPlanData.getLastname() != null) {
      dataXML += autoPlanData.getLastname();
    } else {
      dataXML += "";
    }
    dataXML += "</LastName>";

    dataXML += "<ResStatus>";
    if (autoPlanData.getResidentialStatus() != null) {
      dataXML += autoPlanData.getResidentialStatus();
    } else {
      dataXML += "";
    }
    dataXML += "</ResStatus>";

    dataXML += "<DOB>";
    if (autoPlanData.getDob() != null) {
      dataXML += autoPlanData.getDob();
    } else {
      dataXML += "";
    }
    dataXML += "</DOB>";

    dataXML += "<MaritalStatus>";
    if (autoPlanData.getMaritalStatus() != null) {
      dataXML += autoPlanData.getMaritalStatus();
    } else {
      dataXML += "";
    }
    dataXML += "</MaritalStatus>";

    dataXML += "<Occupation>";
    if (autoPlanData.getOccupation() != null) {
      dataXML += autoPlanData.getOccupation();
    } else {
      dataXML += "";
    }
    dataXML += "</Occupation>";

    dataXML += "<ContactNo>";
    if (autoPlanData.getContactNo() != null) {
      dataXML += autoPlanData.getContactNo();
    } else {
      dataXML += "";
    }
    dataXML += "</ContactNo>";

    dataXML += "<EmailId>";
    if (autoPlanData.getEmailId() != null) {
      dataXML += autoPlanData.getEmailId();
    } else {
      dataXML += "";
    }
    dataXML += "</EmailId>";

    dataXML += "<RiskProfileId>";
    if (autoPlanData.getRiskProfileId() != null) {
      dataXML += autoPlanData.getRiskProfileId();
    } else {
      dataXML += "";
    }
    dataXML += "</RiskProfileId>";

    dataXML += "<Will>";
    if (autoPlanData.getWill() != null) {
      dataXML += autoPlanData.getWill();
    } else {
      dataXML += "";
    }
    dataXML += "</Will>";

    dataXML += "<Gender>";
    if (autoPlanData.getGender() != null) {
      dataXML += autoPlanData.getGender();
    } else {
      dataXML += "";
    }
    dataXML += "</Gender>";

    dataXML += "<EMI>";
    if (autoPlanData.getEMI() != null) {
      dataXML += autoPlanData.getEMI();
    } else {
      dataXML += "";
    }
    dataXML += "</EMI>";

    dataXML += "<MonthlyInvesment>";
    if (autoPlanData.getMonthlyInvestment() != null) {
      dataXML += autoPlanData.getMonthlyInvestment();
    } else {
      dataXML += "";
    }
    dataXML += "</MonthlyInvesment>";

    dataXML += "</Root>";

    autoPlanData.setDataXML(dataXML);

    String goalXML = "<Root>";
    for (int i = 0; i < autoPlanData.getGoalDatas().size(); i++) {
      goalXML += "<Goal>";

      goalXML += "<GoalDescription>";
      goalXML += autoPlanData.getGoalDatas().get(i).getGoalName();
      goalXML += "</GoalDescription>";

      goalXML += "<GoalEndYear>";
      goalXML += autoPlanData.getGoalDatas().get(i).getGoalEndYear();
      goalXML += "</GoalEndYear>";

      goalXML += "<GoalAmountPv>";
      goalXML += autoPlanData.getGoalDatas().get(i).getGoalAmountPv();
      goalXML += "</GoalAmountPv>";

      goalXML += "<GoalTypeId>";
      goalXML += autoPlanData.getGoalDatas().get(i).getGoalTypeId();
      goalXML += "</GoalTypeId>";

      goalXML += "<GoalFamilyPartyID>";
      goalXML += autoPlanData.getGoalDatas().get(i).getGoalFamilyPartyId();
      goalXML += "</GoalFamilyPartyID>";

      goalXML += "<GoalStartYear>";
      goalXML += autoPlanData.getGoalDatas().get(i).getGoalStartYear();
      goalXML += "</GoalStartYear>";

      goalXML += "<IsLoan>";
      goalXML += autoPlanData.getGoalDatas().get(i).getIsLoan();
      goalXML += "</IsLoan>";

      goalXML += "<LoanAmount>";
      goalXML += autoPlanData.getGoalDatas().get(i).getLoanAmount();
      goalXML += "</LoanAmount>";

      goalXML += "<LoanDownPayment>";
      goalXML += autoPlanData.getGoalDatas().get(i).getLoanDownPayment();
      goalXML += "</LoanDownPayment>";

      goalXML += "<LoanInterestPercentage>";
      goalXML += autoPlanData.getGoalDatas().get(i).getLoanInterestPercentage();
      goalXML += "</LoanInterestPercentage>";

      goalXML += "<LoanDurationYears>";
      goalXML += autoPlanData.getGoalDatas().get(i).getLoanDurationYears();
      goalXML += "</LoanDurationYears>";

      goalXML += "<GoalName>";
      goalXML += autoPlanData.getGoalDatas().get(i).getGoalName();
      goalXML += "</GoalName>";

      goalXML += "</Goal>";
    }

    goalXML += "</Root>";
    autoPlanData.setGoalXML(goalXML);

    String partyttributeDataXML = "<Root>";
    for (int i = 0; i < autoPlanData.getPartyAttributeDatas().size(); i++) {
      partyttributeDataXML += "<Data>";

      partyttributeDataXML += "<AttributeCodeId>";
      partyttributeDataXML += autoPlanData.getPartyAttributeDatas().get(i).getAttributeCodeId();
      partyttributeDataXML += "</AttributeCodeId>";

      partyttributeDataXML += "<AttributeValue>";
      partyttributeDataXML += autoPlanData.getPartyAttributeDatas().get(i).getAttributeValue();
      partyttributeDataXML += "</AttributeValue>";

      partyttributeDataXML += "<AttributeReferenceValue>";
      partyttributeDataXML +=
          autoPlanData.getPartyAttributeDatas().get(i).getAttributereferenceValue();
      partyttributeDataXML += "</AttributeReferenceValue>";

      partyttributeDataXML += "</Data>";
    }

    partyttributeDataXML += "</Root>";

    String familyMemberDataXML = "<Root>";
    familyMemberDataXML += "</Root>";

    autoPlanData.setFamilyMemberDataXML(familyMemberDataXML);

    autoPlanData.setLastModifiedBy(1);
    // BaseResponse<Integer> baseResponse = new BaseResponse<>();
    int partyid = partnerService.updateQuickDCDetails(autoPlanData, Integer.parseInt(buId));

    BaseResponse<RecommandedGoalProdResult> br = new BaseResponse<RecommandedGoalProdResult>();
    br.setResponseListObject(
        commonProdRecommService.getRecommandedProductForQuickAdvice(
            partyid, Integer.parseInt(buId)));
    response = FiinfraResponseBuilder.getSuccessResponse(br, null);
    return response;
  }