⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 blinvest.java

📁 保单相互转化数据的流向生成各个表中数据并回写数据保证准确
💻 JAVA
📖 第 1 页 / 共 5 页
字号:
                if(isScenePolicy.equals("Y")){
                BLPrpDbankFacade blPrpDbankFacade = new BLPrpDbankFacade();
                ArrayList prpDbankDtoList = null;
                String strBankCode = bankInterFace_DetailDto.getBankbranchCode();
                String condition = " BankCode='" + strBankCode + "'";
                prpDbankDtoList = (ArrayList)blPrpDbankFacade.findByConditions(condition);
                 if(prpDbankDtoList.size() > 0) 
                 {
                	strTOCOMCODE = ((PrpDbankDto)prpDbankDtoList.get(0)).getComCode();//现场出单根据网点代码查询代理点/出单归属部门代码
                    System.out.println("strTOCOMCODE======现场出单===="+strTOCOMCODE);
                 }else
                 {
                	/*throw new UserException(-98, -1167, "BLInvest.build",
        					"PrpDbank表中没有配置银行代码"+strBankCode+"对应的数据" );  */
                	//strTOCOMCODE = "";
                 }
                }   
                else//非现场出单
                {
                	strTOCOMCODE = bankInterFace_DetailDto.getComCode();//非现场出单接口表直接取代理点/出单归属部门代码
                	System.out.println("strTOCOMCODE======非现场======"+strTOCOMCODE);
                }
                //add end by hezhuan at 20080523
                
                // 7、生成财务接口表数据
                blPrpJinvest = new BLPrpJinvest();
                bankInterFace_DetailDto.setRevolutionFlag(strTOCOMCODE);//富安居手续费处理收付扩建字段,借用RevolutionFlag当作strTOCOMCODE参存放在DTO传送到收付
                blPrpJinvest.generateObjectOfJinvest(dbPool,bankInterFace_DetailDto, blPolicy);
               
                blPrpJinvest.save(dbPool);
                // 8、修改BankInterFace_Detail表数据
                bankInterFace_DetailDto.setRevolutionFlag("1");
                blBankInterFace_DetailAction.update(dbManager, bankInterFace_DetailDto);
                // 9、反写BankInterFace_Detail表中的数据
                bankInterFace_DetailDto.setRevolutionFlag("1");
                blBankInterFace_DetailAction.update(dbManager,bankInterFace_DetailDto);
                // 10、准备放入Attribute中的对象
                policyNoList.add(strPolicyNo);
            }
            if(bankInterFace_DetailDtoList.size() <= 0) {
                strReturnMessage = "没有可生成的投保单、保单!";
            } else {
                // 11、将对象放入Attribute中
                request.setAttribute("bankInterFace_DetailDtoList", bankInterFace_DetailDtoList);
                request.setAttribute("policyNoList", policyNoList);
            }           
            dbPool.commitTransaction();
            //begin add by zhouming 20070831 直接出单模式需要单证销号
            for(int i = 0; i < bankInterFace_DetailDtoList.size(); i++) 
            {     
            	BankInterFace_DetailDto bankInterFaceDetailDto = null;
            	bankInterFaceDetailDto = (BankInterFace_DetailDto)bankInterFace_DetailDtoList.get(i);
            	String comcode = "";
            	String riskcode = "";
            	String usercode = "";
            	String printno = "";
                //modify begin by hezhuan at 20080601 reason:根据bankInterFace_Detail表ISEIESFLAG字段区分富安居和银保数据来生成Main表数据
                String strIsEiesFlag = "";
                //modify end by hezhuan at 20080601
            	comcode = bankInterFaceDetailDto.getComCode();
            	riskcode = bankInterFaceDetailDto.getRiskCode();
            	strIsEiesFlag = bankInterFaceDetailDto.getIseiesFlag();
                if(strIsEiesFlag.equals("1"))
                {
                	 usercode = bankInterFaceDetailDto.getVisaUserCode();
                	 System.out.println("VisaUsercode=======银保通单证归属人员===="+usercode);
                }
                else
                {
            	      usercode = bankInterFaceDetailDto.getHandlerCode();
            	      System.out.println("VisaUsercode======富安居单证归属人员===="+usercode);
                }
            	printno = bankInterFaceDetailDto.getPrintno();
            	Visa visaintef = new Visa();
            	if(!bankInterFaceDetailDto.getPolicyno().equals(""))
            	{
            		if(visaintef.checkUsedReady(usercode,vscode,printno))
            		{
            			visaintef.useTrans(usercode,vscode,printno,bankInterFaceDetailDto.getPolicyno());
            		}
            		else
            		{
            			strReturnMessage += bankInterFaceDetailDto.getPolicyno()+"、";
            		}
            		if(!strReturnMessage.equals(""))
            		{
            			if(i==bankInterFace_DetailDtoList.size()-1)
            			{
            				strReturnMessage = strReturnMessage.substring(0,strReturnMessage.lastIndexOf("、"));
            				strReturnMessage += "号保单单证销号不成功,请检查流水号是否可用!";
            			}
            		}
            	}
            }
            //end add by zhouming 20070831 
        } catch(Exception e) {
            dbPool.rollbackTransaction();
            throw e;
        }
        finally {
            dbPool.close();
        }

        return strReturnMessage;
    }

    /**
     * @desc 投联险由接口表数据生成保单数据:获得投保人、被保险人客户代码
     * @param dbPool
     * @param strComCode
     * @param strRelation
     * @return arrCustomerCode:arrCustomerCode[0] 投保人代码/arrCustomerCode[1] 被保险人代码
     * @throws Exception
     */
    public String[] getCustomerCodes(DbPool dbPool, String strComCode, String strRelation) throws Exception {
        BLPrpDcustomer blPrpDcustomer = new BLPrpDcustomer();
        String[] arrCustomerCode = new String[2];
        String strCustomerCode1 = "";
        String strCustomerCode2 = "";
        /* modify by yangkun 20071229 17:56 begin reason: 调整投联险由接口表数据生成保单数据时调用取oracle序列处理 */
        strCustomerCode1 = blPrpDcustomer.getPrpdCustomerId();
        if("01".equals(strRelation)) {
            strCustomerCode2 = strCustomerCode1;
        } else {
            long longCustomerCode2 = Long.parseLong(blPrpDcustomer.getPrpdCustomerId());
            strCustomerCode2 = new BigDecimal(longCustomerCode2).toString();
        }
        /* modify by yangkun 20071229 17:56 end reason: 调整投联险由接口表数据生成保单数据时调用取oracle序列处理 */
        arrCustomerCode[0] = strCustomerCode1;
        arrCustomerCode[1] = strCustomerCode2;
        return arrCustomerCode;
    }

    /**
     * @desc 投联险由接口表数据生成保单数据:生成客户资料信息PrpDcustomer
     * @param arrCustomerCode
     * @param bankInterFace_DetailDto
     * @return blPrpDcustomer
     * @throws Exception
     */
    public BLPrpDcustomer generateObjectOfDcustomer(String[] arrCustomerCode, BankInterFace_DetailDto bankInterFace_DetailDto) throws Exception {
        BLPrpDcustomer blPrpDcustomer = new BLPrpDcustomer();
        PrpDcustomerSchema prpDcustomerSchema1 = new PrpDcustomerSchema();
        PrpDcustomerSchema prpDcustomerSchema2 = new PrpDcustomerSchema();

        prpDcustomerSchema1.setCustomerType("1");
        prpDcustomerSchema1.setCustomerCode(arrCustomerCode[0]);
        prpDcustomerSchema1.setCustomerCName(bankInterFace_DetailDto.getAppliName());
        prpDcustomerSchema1.setAddressCName(bankInterFace_DetailDto.getAddress());
        prpDcustomerSchema1.setValidStatus("1");
        blPrpDcustomer.setArr(prpDcustomerSchema1);

        if(!arrCustomerCode[1].equals(arrCustomerCode[0])) {
            prpDcustomerSchema2.setCustomerType("1");
            prpDcustomerSchema2.setCustomerCode(arrCustomerCode[1]);
            prpDcustomerSchema2.setCustomerCName(bankInterFace_DetailDto.getInsuredName());
            prpDcustomerSchema2.setAddressCName(bankInterFace_DetailDto.getInsuredAdress());
            prpDcustomerSchema2.setValidStatus("1");
            blPrpDcustomer.setArr(prpDcustomerSchema2);
        }

        return blPrpDcustomer;
    }

    /**
     * @desc 投联险由接口表数据生成保单数据:生成客户资料信息PrpDcustomerIdv
     * @param arrCustomerCode
     * @param bankInterFace_DetailDto
     * @return blPrpDcustomerIdv
     * @throws Exception
     */
    public BLPrpDcustomerIdv generateObjectOfDcustomerIdv(String[] arrCustomerCode, BankInterFace_DetailDto bankInterFace_DetailDto) throws Exception {
        BLPrpDcustomerIdv blPrpDcustomerIdv = new BLPrpDcustomerIdv();
        PrpDcustomerIdvSchema prpDcustomerIdvSchema1 = new PrpDcustomerIdvSchema();
        PrpDcustomerIdvSchema prpDcustomerIdvSchema2 = new PrpDcustomerIdvSchema();

        DateTime currentDate = new DateTime().current();
        String strCurrentDate = "";
        //Add by hezhuan 20080122 begin reason:个人客户表inputdate字段值取bankinterface_detail表uploaddate字段值
        String strUploadDate = "";
        //Add by hezhuan 20080122 end
        int intYear = 0;
        int intMonth = 0;
        int intDay = 0;

        intYear = currentDate.getYear();
        intMonth = currentDate.getMonth();
        intDay = currentDate.getDay();
        strCurrentDate = new Integer(intYear).toString() + "-"
                       + new Integer(intMonth).toString() + "-"
                       + new Integer(intDay).toString();
        
        //Add by hezhuan 20080122 begin reason:投联生成保单main表inputdate字段取bankInterFace_Detail表uploaddate字段的值
        intYear = bankInterFace_DetailDto.getUploadDate().getYear();
        intMonth = bankInterFace_DetailDto.getUploadDate().getMonth();
        intDay = bankInterFace_DetailDto.getUploadDate().getDay();
        strUploadDate = new Integer(intYear).toString() + "-"
                      + new Integer(intMonth).toString() + "-"
                      + new Integer(intDay).toString();
        //Add by hezhuan 20080122 end

        prpDcustomerIdvSchema1.setCustomerCode(arrCustomerCode[0]);
        prpDcustomerIdvSchema1.setCustomerCName(bankInterFace_DetailDto.getAppliName());
        prpDcustomerIdvSchema1.setAddressCName(bankInterFace_DetailDto.getAddress());
        prpDcustomerIdvSchema1.setIdentifyType(bankInterFace_DetailDto.getIdType());
        prpDcustomerIdvSchema1.setIdentifyNumber(bankInterFace_DetailDto.getAppidNo());
        prpDcustomerIdvSchema1.setPhoneNumber(bankInterFace_DetailDto.getMobileCode());
        prpDcustomerIdvSchema1.setMobile(bankInterFace_DetailDto.getMobileCode());
        prpDcustomerIdvSchema1.setLinkAddress(bankInterFace_DetailDto.getAddress());
        prpDcustomerIdvSchema1.setPostCode(bankInterFace_DetailDto.getPostCode());
        prpDcustomerIdvSchema1.setEmail(bankInterFace_DetailDto.getEmail());
        prpDcustomerIdvSchema1.setNewCustomerCode(arrCustomerCode[0]);
        prpDcustomerIdvSchema1.setValidStatus("1");
        prpDcustomerIdvSchema1.setLowerViewFlag("0");
        prpDcustomerIdvSchema1.setOperatorCode(bankInterFace_DetailDto.getHandlerCode());
        //Add by hezhuan 20080122 begin reason:投联生成保单main表inputdate字段取bankInterFace_Detail表uploaddate字段的值
        prpDcustomerIdvSchema1.setInputDate(strUploadDate);
        //Add by hezhuan 20080122 end 
        prpDcustomerIdvSchema1.setUpdaterCode(bankInterFace_DetailDto.getHandlerCode());
        prpDcustomerIdvSchema1.setUpdateDate(strCurrentDate);
        prpDcustomerIdvSchema1.setComcode(bankInterFace_DetailDto.getComCode());
        blPrpDcustomerIdv.setArr(prpDcustomerIdvSchema1);

        if(!arrCustomerCode[1].equals(arrCustomerCode[0])) {
            prpDcustomerIdvSchema2.setCustomerCode(arrCustomerCode[1]);
            prpDcustomerIdvSchema2.setCustomerCName(bankInterFace_DetailDto.getInsuredName());
            prpDcustomerIdvSchema2.setAddressCName(bankInterFace_DetailDto.getInsuredAdress());
            prpDcustomerIdvSchema2.setPhoneNumber(bankInterFace_DetailDto.getInsuredPhone());
            prpDcustomerIdvSchema2.setMobile(bankInterFace_DetailDto.getInsuredPhone());
            prpDcustomerIdvSchema2.setLinkAddress(bankInterFace_DetailDto.getInsuredAdress());
            prpDcustomerIdvSchema2.setPostCode(bankInterFace_DetailDto.getInsurepostCode());
            prpDcustomerIdvSchema2.setNewCustomerCode(arrCustomerCode[1]);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -