博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
applicationBo.getCiConsolidationOptions
阅读量:6067 次
发布时间:2019-06-20

本文共 9772 字,大约阅读时间需要 32 分钟。

 public Vector getCiConsolidationOptions(String productSelectedIndex,Vector vtSugProducts,Vector vtExistingLoans)

  throws FunctionalException,ProcessException,FatalException{
//  LogProviderFactory.getLogInstance().info("Method  --> appBO:getCiConsolidationOptions(productSelectedIndex, vtSugProducts, vtExistingLoans) Start--> : "+ new Date(System.currentTimeMillis()));
  HashMap hmTemp = null;
  HashMap hmOptions = null;
  HashMap hmPrevOptions = null;
  HashMap hmExistingProduct = null;
  HashMap hmSuggestedProducts = null;
  HashMap hmConsolidationInput = null;
  Vector vtConsolidationOption = null;
  try {
   LogProviderFactory.getLogInstance().info("ApplicationBo.getCiConsolidationOptions(yj63318) i/p productSelectedIndex -->"+productSelectedIndex);
   LogProviderFactory.getLogInstance().info("ApplicationBo.getCiConsolidationOptions(yj63318) i/p vtSugProducts -->"+vtSugProducts);
   LogProviderFactory.getLogInstance().info("ApplicationBo.getCiConsolidationOptions(yj63318) i/p vtExistingLoans -->"+vtExistingLoans);
   String repayModifyValue = CIUtils.getParamCodeFromGenericParam("EN","G015",RepayOrModify);
   String modifyValue = CIUtils.getParamCodeFromGenericParam("EN","G015",Modify);
   boolean conSolIndFound = false;
   if ((vtSugProducts!=null) && (vtSugProducts.size()>0)&&(vtExistingLoans!=null)&&(vtExistingLoans.size()>0)) {      
    hmConsolidationInput = new HashMap(7,0.8f);
    //Details of the consolidating product
    
    int suggProdSize = vtSugProducts!=null ? vtSugProducts.size() : 0;
    
    //find the product to be consolidated
    for (int i=0;i< suggProdSize;i++){
     HashMap hmSuggestedProd = (HashMap) vtSugProducts.get(i);
     String consolidationFlag = hmSuggestedProd!=null ?  CIUtils.getStringVal(hmSuggestedProd.get(CONSOLIDATEIND)) : null;
     if (CIUtils.isEqualParamValue(consolidationFlag,YES_FLAG)){
      hmConsolidationInput.put(SUGGESTEDPRODCD,CIUtils.getStringVal(hmSuggestedProd.get(PRODCD)));
      hmConsolidationInput.put(SUGGESTEDPRODUCTLINE,CIUtils.getStringVal(hmSuggestedProd.get(PRODUCTLINE)));
      String professionalUseVal = CIUtils.getStringVal(hmSuggestedProd.get(PROFESSIONAL_USE));
      if (CIUtils.isNull(professionalUseVal)){
       professionalUseVal = NO_FLAG;
      }
      hmConsolidationInput.put(SUGGESTEDPROFESSIONALUSE,professionalUseVal);
      conSolIndFound = true;
     }
    }
    
    if (CIUtils.isParamNotNull(productSelectedIndex)){
     hmSuggestedProducts = (HashMap) vtSugProducts.get(Integer.parseInt(productSelectedIndex));
     LogProviderFactory.getLogInstance().info("ApplicationBO.getCiConsolidationOptions(yj63318) hmSuggestedProducts-"+productSelectedIndex+"-->"+hmSuggestedProducts);
     if ((hmSuggestedProducts!=null)&&(hmSuggestedProducts.size()>0)) {
      hmConsolidationInput.put(SUGGESTEDPRODCD,CIUtils.getStringVal(hmSuggestedProducts.get(PRODCD)));
      hmConsolidationInput.put(SUGGESTEDPRODUCTLINE,CIUtils.getStringVal(hmSuggestedProducts.get(PRODUCTLINE)));
      String professionalUse = CIUtils.getStringVal(hmSuggestedProducts.get(PROFESSIONAL_USE));
      if (!CIUtils.isParamNotNull(professionalUse))
       professionalUse = NO_FLAG;
      hmConsolidationInput.put(SUGGESTEDPROFESSIONALUSE,professionalUse);
     }else
      LogProviderFactory.getLogInstance().info("hmSuggestedProducts is null in vtSugProducts in Method getCiConsolidationOptions");
    } 
    //Details of the external products, set the close or repay option
    for (int j=0;j<vtExistingLoans.size();j++){
     hmExistingProduct = (HashMap) vtExistingLoans.get(j);
     LogProviderFactory.getLogInstance().info("hmExistingProduct-"+j+"-->"+hmExistingProduct);
     if  ((hmExistingProduct!=null)&&(hmExistingProduct.size()>0)) { 
      String systemId = CIUtils.getStringVal(hmExistingProduct.get(SYSTEMID));
      boolean rejectedProduct = CIUtils.getObjBooleanValue(hmExistingProduct.get(REJECTEDEXISTINGPRODUCTS));
      LogProviderFactory.getLogInstance().info("ApplicationBO.getCiConsolidationOptions(yj63318) productSelectedIndex -->"+productSelectedIndex);
      LogProviderFactory.getLogInstance().info("ApplicationBO.getCiConsolidationOptions(yj63318) systemId -->"+systemId);
      LogProviderFactory.getLogInstance().info("ApplicationBO.getCiConsolidationOptions(yj63318) rejectedProduct -->"+rejectedProduct);
      LogProviderFactory.getLogInstance().info("ApplicationBO.getCiConsolidationOptions(yj63318) isConsolidatedProduct -->"+CIUtils.isConsolidatedProduct(productSelectedIndex,rejectedProduct,systemId));
      if (CIUtils.isConsolidatedProduct(productSelectedIndex,rejectedProduct,systemId)){
       hmPrevOptions = CIUtils.getHashMapObj(hmExistingProduct.get(CloseRepay));
       hmConsolidationInput.put(PRODCD,CIUtils.getStringVal(hmExistingProduct.get(PRODCD)));
       hmConsolidationInput.put(PRODUCTLINE,CIUtils.getStringVal(hmExistingProduct.get(PRODUCTLINE)));
       String sourceType = CIUtils.getStringVal(hmExistingProduct.get(SOURCE));
       if(!conSolIndFound){
        hmConsolidationInput.put(SUGGESTEDPROFESSIONALUSE,"");
       }
       if (CIUtils.isEqualParamValue(sourceType,External))
        hmConsolidationInput.put(SOURCE,EXTERNAL); 
       else if (CIUtils.isEqualParamValue(sourceType,Internal))
        hmConsolidationInput.put(SOURCE,INTERNAL);
       hmConsolidationInput.put(SYSTEMID,systemId);
       //Consolidation Option choosed before consolting the DB
       String defaultConsdOption = CIUtils.getStringVal(hmExistingProduct.get(CONSINDLOVVALUE));//CONSINDLOVVALUE: the pre-choosed option
       String lineModifiedProduct = CIUtils.getStringVal(hmExistingProduct.get(LINE_OR_CARD_MODIFY));
       vtConsolidationOption = getConsolidationOptions(hmConsolidationInput);
       if  ((vtConsolidationOption!=null)&&(vtConsolidationOption.size()>0)) {
        hmOptions = new HashMap(); 
        boolean noDefaultFlag = true;
        boolean optionsFlag = false;
        for (int k=0;k<vtConsolidationOption.size();k++){
         hmTemp =  (HashMap)vtConsolidationOption.get(k);
//         LogProviderFactory.getLogInstance().info("Options-"+k+"-->"+hmTemp);
         if  ((hmTemp!=null)&&(hmTemp.size()>0)) {
          optionsFlag = true;
          String consolidationOption = CIUtils.getStringVal(hmTemp.get(CONSO_OPTION));
          hmOptions.put((CONSINDLOV+(k+1)),consolidationOption);
          String defaultFlag = CIUtils.getStringVal(hmTemp.get(DEFAULT_FLG));
          if (CIUtils.isEqualParamValue(defaultFlag,YES_FLAG)){// set the default choosed option
           noDefaultFlag = false;
           hmExistingProduct.put(CONSINDLOVVALUE,consolidationOption);
          }
          //If MR is in options it should be added
          if  ((CIUtils.isParamNotNull(productSelectedIndex))&&(hmPrevOptions!=null)&&(hmPrevOptions.size()>0)) {
           if ((hmPrevOptions.containsValue(repayModifyValue))&&(!hmOptions.containsValue(repayModifyValue))){
            int closeRepaySize = hmOptions!= null ? hmOptions.size() : 0;
            closeRepaySize=closeRepaySize+1;
            hmOptions.put(CONSINDLOV+(closeRepaySize),repayModifyValue);
           }
          }
          //For Line Modified Product the default consolidation option to be selected
          if (CIUtils.isEqualParamValue(lineModifiedProduct,YES_FLAG)){
           noDefaultFlag = false;
           //For Line Modified Product the default consolidation option to be selected in consolidating product available
           if (CIUtils.isParamNotNull(productSelectedIndex)){
            hmExistingProduct.put(CONSINDLOVVALUE,defaultConsdOption);
            int closeRepaySize = hmOptions!= null ? hmOptions.size() : 0;
            if (!hmOptions.containsValue(defaultConsdOption)){
             closeRepaySize=closeRepaySize+1;
             hmOptions.put(CONSINDLOV+(closeRepaySize),defaultConsdOption);
            }
           }else{
            //For Line Modified Product the default consolidation option to be selected in consolidating product is not available
            if (hmOptions.containsValue(repayModifyValue)){
             for (int i=0;i<hmOptions.size();i++){
              String options = CIUtils.getStringVal(hmOptions.get(CONSINDLOV+i));
              if (CIUtils.isEqualParamValue(options,repayModifyValue))
               hmOptions.remove(CONSINDLOV+i);
             }
             if (!hmOptions.containsValue(modifyValue)){
              int closeRepaySize = hmOptions!= null ? hmOptions.size() : 0;
              closeRepaySize=closeRepaySize+1;
              hmOptions.put(CONSINDLOV+(closeRepaySize),modifyValue);
             }   
             hmExistingProduct.put(CONSINDLOVVALUE,modifyValue);
            }
           }
          }
          hmExistingProduct.put(CloseRepay,hmOptions); 
          //R3-2008-TIL-398-FIX
          addMRApplicableExistProduct(hmExistingProduct);
          
          //hmExistingProduct.put(CloseRepay,removeDuplicateConslnOptions(hmOptions)); 
          LogProviderFactory.getLogInstance().info("ApplicationBO.getCiConsolidationOptions(yj63318) New CloseRepay hmExistingProduct-"+j+"-->"+hmExistingProduct);
         }else
          LogProviderFactory.getLogInstance().info("hmTemp in "+k+"the index is null in vtConsolidationOption Vector");
         hmTemp =  null; 
        }
        if (optionsFlag && noDefaultFlag){
//         LogProviderFactory.getLogInstance().info("<-- No Default Flag present in Consolidation Options. Blank to be Defaulted -->");
         hmExistingProduct.put(CONSINDLOVVALUE,BLANKLOV);
        }
        hmOptions=null;    
       }else
        LogProviderFactory.getLogInstance().info("vtConsolidationOption is null in getCiConsolidationOptions");
      }else if (rejectedProduct && (CIUtils.isALSECSNBB(systemId))) {
       //To remove the consolidation option for the External product greater than 100
       hmExistingProduct.put(CloseRepay,hmOptions);
      }
     }else
      LogProviderFactory.getLogInstance().info("hmExistingProduct in "+j+"the index is null in vtExistingLoans Vector");
    } 
   }else
    LogProviderFactory.getLogInstance().info("vtSugProducts / vtExistingLoans is null in Method getCiConsolidationOptions"); 
//   LogProviderFactory.getLogInstance().info("getCiConsolidationOptions Output hmConsolidateCNA -->"+vtExistingLoans);   
  } catch (Exception e) {
   LogProviderFactory.getLogInstance().fatal("Exception in getCiConsolidationOptions--->"+e.getMessage(),e);
   throw new FatalException (e,"CICP","getCiConsolidationOptions");
  }finally{
   hmTemp = null;
   hmOptions = null;
   hmPrevOptions = null;
   hmExistingProduct = null;
   hmSuggestedProducts = null;
   hmConsolidationInput = null;
   vtSugProducts = null;
   vtConsolidationOption = null;
  } 
//  LogProviderFactory.getLogInstance().info("Method  --> appBO:getCiConsolidationOptions(productSelectedIndex, vtSugProducts, vtExistingLoans) End--> : "+ new Date(System.currentTimeMillis()));
  return vtExistingLoans;
 }  

转载于:https://www.cnblogs.com/ray1987/archive/2011/09/28/2194721.html

你可能感兴趣的文章
搭建maven环境
查看>>
HBase describe table 参数说明
查看>>
Jvm(48),指令集----方法调用和指令返回
查看>>
gitlab 502 报错
查看>>
Java – How to get current date time
查看>>
LeetCode: Remove Nth Node From End of List 解题报告
查看>>
Linq to Sql : 并发冲突及处理策略
查看>>
Selenium Webdriver——操作隐藏的元素(二)display属性
查看>>
C++&&XML; “未使用调试信息生成二进制文件” vs assist
查看>>
配置struts2 web.xml 报错
查看>>
如何清除自动保存的远程目录登录密码
查看>>
解决 - java.lang.OutOfMemoryError: unable to create new native thread
查看>>
正整数分解为几个连续自然数之和
查看>>
工作中经常使用的TabWidget标签分页
查看>>
HTML5 Canvas动画效果演示
查看>>
struts2入门程序
查看>>
JqueryEasyUI 解决IE下datagrid无法刷新的问题 分类: ...
查看>>
两个人的人生抉择
查看>>
GeoServer+MySQL安装及配置过程
查看>>
【mysql】索引的优化
查看>>