List of usage examples for org.apache.commons.beanutils BeanUtilsBean BeanUtilsBean
BeanUtilsBean
From source file:com.yucheng.cmis.pvp.app.component.PvpAuthorizeComponent.java
/** * ???????????????/*from w w w. j a v a 2 s . co m*/ * * @param pvpSerno * ?? * @throws EMPException * @throws InvocationTargetException * @throws IllegalAccessException * @throws Exception * @since 2009-09-17 * @author modified by zhangwei */ public String addPvpTfObocAuthorize(String pvpSerno) throws EMPException, IllegalAccessException, InvocationTargetException { String strReturnMessage = CMISMessage.ADDDEFEAT;//? //?? PvpTfOboc pvpTfOboc = new PvpTfOboc(); PvpTfObocComponent pvpTfObocComponent = (PvpTfObocComponent) this.getComponent("PvpTfOboc"); pvpTfOboc = pvpTfObocComponent.queryPvpTfOboc(pvpSerno); if (pvpTfOboc == null || pvpTfOboc.getContNo() == null) { System.out.println("??"); return strReturnMessage; } //?? CustomIface customIface = (CustomIface) this.getComponentInterface(CusPubConstant.CUS_IFACE); CusBase cusBase = customIface.getCusBase(pvpTfOboc.getCusId()); String transCusId = cusBase.getTransCusId(); //???? CtrTfOboc ctrTfOboc = new CtrTfOboc(); CtrTfLocImpl ctrTfLocImpl = (CtrTfLocImpl) this.getComponentInterface("CtrTfLoc"); ctrTfOboc = ctrTfLocImpl.getCtrTfOboc(pvpTfOboc.getContNo()); if (ctrTfOboc == null) { System.out.println("????????"); return strReturnMessage; } //? AccTfCommComponent accTfCommComponent = (AccTfCommComponent) this.getComponent(PUBConstant.ACCTFCOMM); accTfCommComponent.checkConditionBeforeAuthorize("PvpTfOboc", pvpSerno, ctrTfOboc.getContNo()); //?? ?? Context context = this.getContext(); Connection connection = this.getConnection(); CMISSequenceService sequenceService = (CMISSequenceService) context.getService("sequenceService"); String loanNo = sequenceService.getSequence(TradeCodeConstant.SERNONC, "44", context, connection); //??? String[] billZero = { "", "00", "0", "" }; int billSeqCtr = ctrTfOboc.getBillSeq(); String billSeq = String.valueOf(billSeqCtr); billSeq = billZero[billSeq.length()] + billSeq; String billNo = pvpTfOboc.getContNo() + billSeq; // ??? ?????? billSeqCtr++; ctrTfOboc.setBillSeq(billSeqCtr); //??? PvpAuthorize pvpAuthorize = new PvpAuthorize(); pvpAuthorize.setSerno(pvpSerno); pvpAuthorize.setLoanNo(loanNo); pvpAuthorize.setCusManager(pvpTfOboc.getCusManager()); pvpAuthorize.setInputBrId(pvpTfOboc.getInputBrId()); pvpAuthorize.setFinaBrId(pvpTfOboc.getFinaBrId()); pvpAuthorize.setCusId(pvpTfOboc.getCusId()); pvpAuthorize.setCusName(pvpTfOboc.getCusName()); pvpAuthorize.setContNo(pvpTfOboc.getContNo()); pvpAuthorize.setBillNo(billNo); if ("1".equals(pvpTfOboc.getBizTypeSub())) {//1 2 pvpAuthorize.setTradeAmount(pvpTfOboc.getApplyAmount()); } else { pvpAuthorize.setTradeAmount(pvpTfOboc.getAbAmt()); } pvpAuthorize.setTradeDate(this.getOpenDay()); pvpAuthorize.setTradeStatus(TradeCodeConstant.WTZ); pvpAuthorize.setTradeCode("0017"); pvpAuthorize.setFieldNum(19); // pvpAuthorize.setFldvalue01("c@loanNo@" + loanNo); //? pvpAuthorize.setFldvalue02("c@contSerno@" + billNo); //???? pvpAuthorize.setFldvalue03("c@contNo@" + pvpTfOboc.getContNo()); //??? pvpAuthorize.setFldvalue04("c@cusId@" + pvpTfOboc.getCusId()); //? pvpAuthorize.setFldvalue05("c@cusName@" + pvpTfOboc.getCusName()); //?? pvpAuthorize.setFldvalue06("c@bizType@" + "0017"); //?? pvpAuthorize.setFldvalue07("c@CurType@" + pvpTfOboc.getApplyCurType()); //??? if ("1".equals(pvpTfOboc.getBizTypeSub())) {//1 2 pvpAuthorize.setFldvalue08("c@Amount@" + pvpTfOboc.getApplyAmount()); //? } else { pvpAuthorize.setFldvalue08("c@Amount@" + pvpTfOboc.getAbAmt()); } pvpAuthorize.setFldvalue09("c@startDate@" + (String) context.getDataValue("OPENDAY")); //(?) pvpAuthorize.setFldvalue10("c@dueDate@" + pvpTfOboc.getDueDate()); //? pvpAuthorize.setFldvalue11("c@note@" + ""); // pvpAuthorize.setFldvalue12("c@applyOrg@" + pvpTfOboc.getFinaBrId()); // pvpAuthorize.setFldvalue13("c@inputDate@" + (String) context.getDataValue("OPENDAY")); // //? pvpAuthorize.setFldvalue14("c@ocNo@" + checkNull(pvpTfOboc.getOcNo())); pvpAuthorize.setFldvalue15("c@locAmt@" + pvpTfOboc.getAbAmt()); DecimalFormat df = new DecimalFormat("#.000000"); pvpAuthorize.setFldvalue16("c@realityIrY@" + df.format(pvpTfOboc.getRealityIrY() * 100)); //pvpAuthorize.setFldvalue17("c@feeRate@" + df.format(pvpTfOboc.getFeeRate()*100)); // pvpAuthorize.setFldvalue17("c@enterAccount@" + checkNull(pvpTfOboc.getEnterAccount())); String bizTypeSub = ""; if (pvpTfOboc.getBizTypeSub().equals("1")) {// bizTypeSub = "0"; } else if (pvpTfOboc.getBizTypeSub().equals("2")) {// bizTypeSub = "1"; } else { throw new ComponentException("[" + bizTypeSub + "]"); } pvpAuthorize.setFldvalue18("c@bizTypeSub@" + checkNull(bizTypeSub)); pvpAuthorize.setFldvalue19("c@intCalType@" + checkNull(pvpTfOboc.getIntCalType())); //pvpAuthorize.setFldvalue18("c@businessrate@" + BigDecimalUtil.mul(pvpTfOboc.getRulingIr(), 100, 6, BigDecimal.ROUND_HALF_UP)); // ???(y?Y?a?D?Y?T) //pvpAuthorize.setFldvalue19("c@BillNo@" + checkNull(pvpTfOboc.getOcNo())); // o??? //pvpAuthorize.setFldvalue20("c@invamount@" + new BigDecimal(pvpTfOboc.getAbAmt()));// ?Y?e?? //?????,? modified by wxy 20110108 int appterm = 0; String dueDate; if (!this.getOpenDay().equals(pvpTfOboc.getStartDate())) { appterm = (int) pvpTfOboc.getApplyTerm(); dueDate = TimeUtil.ADD_DAY(this.getOpenDay(), appterm); pvpTfOboc.setStartDate(this.getOpenDay()); pvpTfOboc.setDueDate(dueDate); //pvpTfObocComponent.updatePvpTfOboc(pvpTfOboc); ctrTfOboc.setStartDate(this.getOpenDay()); ctrTfOboc.setDueDate(dueDate); //ctrTfLocImpl.modifyCtrTfOboc(ctrTfOboc); pvpAuthorize.setFldvalue10("c@dueDate@" + dueDate); //? } //?? PvpAuthorizeAgent pvpAuthorizeAgent = (PvpAuthorizeAgent) this.getAgentInstance(PUBConstant.PVPAUTHORIZE); try { strReturnMessage = pvpAuthorizeAgent.insertPvpAuthorize(pvpAuthorize); } catch (Exception e) { throw new ComponentException("???"); } if (!strReturnMessage.equals(CMISMessage.ADDSUCCEESS)) { System.out.println("???"); return strReturnMessage; } //??? AccTfOboc accTfOboc = new AccTfOboc(); AccTfObocAgent accTfObocAgent = (AccTfObocAgent) this.getAgentInstance("AccTfOboc"); BeanUtilsBean bub = new BeanUtilsBean(); try { bub.copyProperties(accTfOboc, pvpTfOboc); } catch (IllegalAccessException e) { new ComponentException("????"); } catch (InvocationTargetException e) { new ComponentException("????"); } accTfOboc.setLoanForm4("10"); accTfOboc.setCla("10"); accTfOboc.setBillNo(billNo); accTfOboc.setAccountStatus("0"); accTfOboc.setMainBrId(pvpTfOboc.getInvestigatorBrId()); accTfOboc.setLoanAmount(pvpTfOboc.getApplyAmount()); accTfOboc.setLoanBalance(pvpTfOboc.getApplyAmount()); accTfObocAgent.insertAccTfOboc(accTfOboc); //???? AccTfComm accTfComm = new AccTfComm(); try { bub.copyProperties(accTfComm, accTfOboc); } catch (IllegalAccessException e) { new ComponentException("?????"); } catch (InvocationTargetException e) { new ComponentException("?????"); } accTfComm.setLimitAccNo(accTfOboc.getLimitAccNo()); accTfComm.setSendDate(this.getOpenDay()); try { accTfCommComponent.addAccTfComm(accTfComm); } catch (Exception e) { accTfCommComponent.updateDomain(accTfComm); } //? pvpTfOboc.setChargeoffStatus(Constant.PVPSTATUS3); pvpTfOboc.setBillNo(billNo); pvpTfObocComponent.updatePvpTfOboc(pvpTfOboc); //????? ctrTfLocImpl.modifyCtrTfOboc(ctrTfOboc); // try { /*?? IndexedCollection icoll = cbqService.queryAccreditNotice4Trade( loanNo, connection, connection, context); KeyedCollection reqPkg = (KeyedCollection) icoll.get(0); String hostSerNo = (String) reqPkg.get("hostSerNo").toString() .trim(); pvpAuthorize.setHostSerno(hostSerNo); pvpAuthorize.setTradeStatus(TradeCodeConstant.YTZ); pvpAuthorizeAgent.modifyCMISDomain(pvpAuthorize, "PvpAuthorize"); */ //??? CreditBusinessQuartzService cbqService = new CreditBusinessQuartzService(); cbqService.queryAccreditNotice(connection, context); } catch (Exception e) { e.printStackTrace(); throw new ComponentException("??" + e.getMessage()); } // ???? return strReturnMessage; }
From source file:com.yucheng.cmis.pvp.app.component.PvpAuthorizeComponent.java
/** * ???????????????/* w w w .ja v a 2s . co m*/ * * @param pvpSerno * ?? * @throws EMPException * @throws InvocationTargetException * @throws IllegalAccessException * @throws Exception * @since 2009-09-17 * @author modified by zhangwei */ public String addPvpTfLocAuthorize(String pvpSerno) throws EMPException, IllegalAccessException, InvocationTargetException { String strReturnMessage = CMISMessage.ADDDEFEAT; PvpTfImpl pvpTfImpl = (PvpTfImpl) this.getComponentInterface("PvpTfImpl"); PvpAuthorizeAgent pvpAuthorizeAgent = (PvpAuthorizeAgent) this.getAgentInstance(PUBConstant.PVPAUTHORIZE); //??? PvpTfLoc pvpTfLoc = new PvpTfLoc(); pvpTfLoc = pvpTfImpl.queryPvpTfLoc(pvpSerno); if (pvpTfLoc == null || pvpTfLoc.getContNo() == null) { System.out.println("??"); return strReturnMessage; } //?? CustomIface customIface = (CustomIface) this.getComponentInterface(CusPubConstant.CUS_IFACE); CusBase cusBase = customIface.getCusBase(pvpTfLoc.getCusId()); String transCusId = cusBase.getTransCusId(); //???? CtrTfLoc ctrTfLoc = null; CtrTfLocComponent ctrTfLocComponent = (CtrTfLocComponent) this.getComponent("CtrTfLoc"); ctrTfLoc = ctrTfLocComponent.queryCtrTfLocByContno(pvpTfLoc.getContNo()); //???? AccTfCommComponent accTfCommComponent = (AccTfCommComponent) this.getComponent(PUBConstant.ACCTFCOMM); accTfCommComponent.checkConditionBeforeAuthorize("PvpTfLoc", pvpSerno, ctrTfLoc.getContNo()); CtrTfCvrgComponent ctrTfCvrgComponent = (CtrTfCvrgComponent) this.getComponent("CtrTfCvrg"); //?????? //String orgId = pvpTfLoc.getInputBrId(); //billNo = sequenceService.getSequence(orgId, "fromOrg", 15, context); //String loanNo = sequenceService.getSequence("CZ", "fromDate", 15,context); Context context = this.getContext(); Connection connection = this.getConnection(); CMISSequenceService sequenceService = (CMISSequenceService) context.getService("sequenceService"); String loanNo = sequenceService.getSequence(TradeCodeConstant.SERNONC, "44", context, connection); //??? String[] billZero = { "", "00", "0", "" }; int billSeqCtr = ctrTfLoc.getBillSeq(); String billSeq = String.valueOf(billSeqCtr); billSeq = billZero[billSeq.length()] + billSeq; String billNo = pvpTfLoc.getContNo() + billSeq; // ??? ?????? billSeqCtr++; ctrTfLoc.setBillSeq(billSeqCtr); //??? PvpAuthorize pvpAuthorize = new PvpAuthorize(); pvpAuthorize.setSerno(pvpSerno); pvpAuthorize.setLoanNo(loanNo); pvpAuthorize.setCusManager(pvpTfLoc.getCusManager()); pvpAuthorize.setInputBrId(pvpTfLoc.getMainBrId()); pvpAuthorize.setFinaBrId(pvpTfLoc.getFinaBrId()); pvpAuthorize.setCusId(pvpTfLoc.getCusId()); pvpAuthorize.setCusName(pvpTfLoc.getCusName()); pvpAuthorize.setContNo(pvpTfLoc.getContNo()); pvpAuthorize.setBillNo(billNo); pvpAuthorize.setTradeAmount(pvpTfLoc.getApplyAmount()); pvpAuthorize.setTradeDate(this.getOpenDay()); pvpAuthorize.setTradeStatus(TradeCodeConstant.WTZ); pvpAuthorize.setTradeCode("0011"); pvpAuthorize.setFieldNum(27); // pvpAuthorize.setFldvalue01("c@loanNo@" + loanNo); //? pvpAuthorize.setFldvalue02("c@contSerno@" + billNo); //???? pvpAuthorize.setFldvalue03("c@contNo@" + pvpTfLoc.getImpContractNo()); //???(2013-04-22?) pvpAuthorize.setFldvalue04("c@cusId@" + pvpTfLoc.getCusId()); //? pvpAuthorize.setFldvalue05("c@cusName@" + pvpTfLoc.getCusName()); //?? pvpAuthorize.setFldvalue06("c@bizType@" + "0011"); //?? pvpAuthorize.setFldvalue07("c@CurType@" + pvpTfLoc.getApplyCurType()); //??? pvpAuthorize.setFldvalue08("c@Amount@" + pvpTfLoc.getApplyAmount()); //? pvpAuthorize.setFldvalue09("c@startDate@" + pvpTfLoc.getDueDate()); //(?) pvpAuthorize.setFldvalue10("c@dueDate@" + pvpTfLoc.getIocDate()); //?? pvpAuthorize.setFldvalue11("c@note@" + ""); // pvpAuthorize.setFldvalue12("c@applyOrg@" + pvpTfLoc.getFinaBrId()); // pvpAuthorize.setFldvalue13("c@inputDate@" + (String) context.getDataValue("OPENDAY")); // //? pvpAuthorize.setFldvalue14("c@locType@" + pvpTfLoc.getLocType()); //? pvpAuthorize.setFldvalue15("c@locDate@" + pvpTfLoc.getFastDay()); //?? pvpAuthorize.setFldvalue16("c@securityMoneyRt@" + 100 * pvpTfLoc.getSecurityMoneyRt()); //?? DecimalFormat df = new DecimalFormat("#0.00"); //todo:modified by wangxuyu 20101105 ???? //?? business_phase = '2' List securitylist = ctrTfCvrgComponent.querySecurityByContNo(pvpTfLoc.getContNo()); if (securitylist.size() == 0) { pvpAuthorize.setFldvalue17("c@securityMoneyAcNo@" + " "); //???1 pvpAuthorize.setFldvalue18("c@securityMoneyAmt@" + " "); //???1 pvpAuthorize.setFldvalue19("c@securityMoneyCur@" + " "); pvpAuthorize.setFldvalue20("c@securityMoneyType@" + " "); //???1 pvpAuthorize.setFldvalue21("c@securityMoneyDueDate@" + " "); pvpAuthorize.setFldvalue22("c@securityMoneyAcNo1@" + " "); //???2 pvpAuthorize.setFldvalue23("c@securityMoneyAmt1@" + " "); //???2 pvpAuthorize.setFldvalue24("c@securityMoneyCur1@" + " "); //????2 pvpAuthorize.setFldvalue25("c@securityMoneyType1@" + " "); //???1 pvpAuthorize.setFldvalue26("c@securityMoneyDueDate1@" + " "); } else if (securitylist.size() == 1) { TfSecurityMsg tfmsg = (TfSecurityMsg) securitylist.get(0); pvpAuthorize.setFldvalue17("c@securityMoneyAcNo@" + tfmsg.getSecurityMoneyAcNo()); pvpAuthorize.setFldvalue18("c@securityMoneyAmt@" + df.format(tfmsg.getSecurityMoneyAmt())); pvpAuthorize.setFldvalue19("c@securityMoneyCur@" + tfmsg.getSecurityMoneyCur()); pvpAuthorize.setFldvalue20("c@securityMoneyType@" + tfmsg.getSecurityMoneyType()); pvpAuthorize.setFldvalue21("c@securityMoneyDueDate@" + tfmsg.getSecurityMoneyDueDate()); pvpAuthorize.setFldvalue22("c@securityMoneyAcNo1@" + " "); pvpAuthorize.setFldvalue23("c@securityMoneyAmt1@" + " "); pvpAuthorize.setFldvalue24("c@securityMoneyCur1@" + " "); pvpAuthorize.setFldvalue25("c@securityMoneyType1@" + " "); pvpAuthorize.setFldvalue26("c@securityMoneyDueDate1@" + " "); } else if (securitylist.size() == 2) { TfSecurityMsg tfmsg = (TfSecurityMsg) securitylist.get(0); pvpAuthorize.setFldvalue17("c@securityMoneyAcNo@" + tfmsg.getSecurityMoneyAcNo()); pvpAuthorize.setFldvalue18("c@securityMoneyAmt@" + df.format(tfmsg.getSecurityMoneyAmt())); pvpAuthorize.setFldvalue19("c@securityMoneyCur@" + tfmsg.getSecurityMoneyCur()); pvpAuthorize.setFldvalue20("c@securityMoneyType@" + tfmsg.getSecurityMoneyType()); pvpAuthorize.setFldvalue21("c@securityMoneyDueDate@" + tfmsg.getSecurityMoneyDueDate()); TfSecurityMsg tfmsg2 = (TfSecurityMsg) securitylist.get(1); pvpAuthorize.setFldvalue22("c@securityMoneyAcNo1@" + tfmsg2.getSecurityMoneyAcNo()); pvpAuthorize.setFldvalue23("c@securityMoneyAmt1@" + df.format(tfmsg2.getSecurityMoneyAmt())); pvpAuthorize.setFldvalue24("c@securityMoneyCur1@" + tfmsg2.getSecurityMoneyCur()); pvpAuthorize.setFldvalue25("c@securityMoneyType1@" + tfmsg2.getSecurityMoneyType()); pvpAuthorize.setFldvalue26("c@securityMoneyDueDate1@" + tfmsg2.getSecurityMoneyDueDate()); } pvpAuthorize.setFldvalue27("c@assureMeansMain@" + pvpTfLoc.getAssureMeansMain()); //?? /** pvpAuthorize.setFldvalue17("c@seLimitAccNo@" + pvpTfLoc.getSecurityMoneyAcNo()); //???1 pvpAuthorize.setFldvalue18("c@securityMoneyAmt@" + pvpTfLoc.getSecurityMoneyAmt()); //???1 pvpAuthorize.setFldvalue19("c@securityMoneyCur@" + pvpTfLoc.getSecurityMoneyCur()); //????1 String acNo = (String)pvpTfLoc.getSecurityMoneyAcNo1(); int count = pvpTfLoc.getSecurityCount(); if((acNo == null || acNo.equals("null") || acNo.trim().equals("")) && count == 1){ pvpAuthorize.setFldvalue20("c@seLimitAccNo1@" + " "); //???2 pvpAuthorize.setFldvalue21("c@securityMoneyAmt1@" + " "); //???2 pvpAuthorize.setFldvalue22("c@securityMoneyCur1@" + " "); //????2 }else{ pvpAuthorize.setFldvalue20("c@seLimitAccNo1@" + pvpTfLoc.getSecurityMoneyAcNo1()); //???2 pvpAuthorize.setFldvalue21("c@securityMoneyAmt1@" + pvpTfLoc.getSecurityMoneyAmt1()); //???2 pvpAuthorize.setFldvalue22("c@securityMoneyCur1@" + pvpTfLoc.getSecurityMoneyCur1()); //????2 } */ strReturnMessage = pvpAuthorizeAgent.insertPvpAuthorize(pvpAuthorize); if (!strReturnMessage.equals(CMISMessage.ADDSUCCEESS)) { System.out.println("???"); return strReturnMessage; } //?????,? modified by wxy 20110108 // if(!this.getOpenDay().equals(pvpTfLoc.getStartDate())) { // System.out.println("------------openday----"+this.getOpenDay()); // appterm = String.valueOf(TimeUtil.getBetweenDays(this.getOpenDay(), pvpTfLoc.getDueDate())); // pvpTfLoc.setStartDate(this.getOpenDay()) ; // pvpTfLoc.setApplyTerm(appterm); // // ctrTfLoc.setStartDate(this.getOpenDay()); // ctrTfLoc.setApplyTerm(appterm); // // } AccTfLoc accTfLoc = new AccTfLoc(); AccTfLocAgent AccTfLocAgent = (AccTfLocAgent) this.getAgentInstance("AccTfLoc"); BeanUtilsBean bub = new BeanUtilsBean(); try { bub.copyProperties(accTfLoc, pvpTfLoc); } catch (IllegalAccessException e) { new ComponentException("??????"); } catch (InvocationTargetException e) { new ComponentException("??????"); } accTfLoc.setLoanForm4("10"); accTfLoc.setCla("10"); accTfLoc.setBillNo(billNo); accTfLoc.setAccountStatus("0"); accTfLoc.setMainBrId(pvpTfLoc.getInvestigatorBrId()); accTfLoc.setLoanAmount(pvpTfLoc.getApplyAmount()); accTfLoc.setLoanBalance(pvpTfLoc.getApplyAmount()); accTfLoc.setStartDate(this.getOpenDay()); AccTfLocAgent.insertAccTfLoc(accTfLoc); //??? AccTfComm accTfComm = new AccTfComm(); try { bub.copyProperties(accTfComm, accTfLoc); accTfComm.setDueDate(pvpTfLoc.getIocDate());//? accTfComm.setSendDate(this.getOpenDay()); } catch (IllegalAccessException e) { new ComponentException("????"); } catch (InvocationTargetException e) { new ComponentException("????"); } try { accTfCommComponent.addAccTfComm(accTfComm); } catch (Exception e) { accTfCommComponent.updateDomain(accTfComm); } // pvpTfLoc.setChargeoffStatus(Constant.PVPSTATUS3); pvpTfLoc.setBillNo(billNo); pvpTfImpl.updatePvpTfLoc(pvpTfLoc); //????? ctrTfLocComponent.modifyCtrTfLoc(ctrTfLoc); // try { /*? CreditBusinessQuartzService cbqService = new CreditBusinessQuartzService(); IndexedCollection icoll = cbqService.queryAccreditNotice4Trade( loanNo, connection, connection, context); KeyedCollection reqPkg = (KeyedCollection) icoll.get(0); String hostSerNo = (String) reqPkg.get("hostSerNo").toString().trim(); pvpAuthorize.setHostSerno(hostSerNo); pvpAuthorize.setTradeStatus(TradeCodeConstant.YTZ); pvpAuthorizeAgent.modifyCMISDomain(pvpAuthorize, "PvpAuthorize"); */ //??? CreditBusinessQuartzService cbqService = new CreditBusinessQuartzService(); cbqService.queryAccreditNotice(connection, context); } catch (Exception e) { e.printStackTrace(); throw new ComponentException("?" + e.getMessage()); } return strReturnMessage; }
From source file:com.yucheng.cmis.pvp.app.component.PvpAuthorizeComponent.java
/** * ???????????????//from www . j a v a 2 s.c o m * * @param pvpSerno * ?? * @throws EMPException * @throws InvocationTargetException * @throws IllegalAccessException * @throws Exception * @since 2009-09-17 * @author modified by zhangwei * @throws ParseException */ public String addPvpTfIbcAuthorize(String pvpSerno) throws EMPException, IllegalAccessException, InvocationTargetException, ParseException { String strReturnMessage = CMISMessage.ADDDEFEAT; PvpTfIface pvpTfIface = (PvpTfIface) this.getComponentInterface("PvpTfImpl"); PvpAuthorizeAgent pvpAuthorizeAgent = (PvpAuthorizeAgent) this.getAgentInstance(PUBConstant.PVPAUTHORIZE); PvpTfIbc pvpTfIbc = new PvpTfIbc(); //?? pvpTfIbc = pvpTfIface.queryPvpTfIbcBySerNo(pvpSerno); if (pvpTfIbc == null || pvpTfIbc.getContNo() == null) { System.out.println("???"); return strReturnMessage; } // ?? CustomIface customIface = (CustomIface) this.getComponentInterface(CusPubConstant.CUS_IFACE); CusBase cusBase = customIface.getCusBase(pvpTfIbc.getCusId()); String transCusId = cusBase.getTransCusId(); //???? CtrTfIbc ctrTfIbc = null; CtrTfIbcComponent ctrTfIbcComponent = (CtrTfIbcComponent) this.getComponent("CtrTfIbc"); ctrTfIbc = ctrTfIbcComponent.queryCtrTfIbcDetail(pvpTfIbc.getContNo()); //? AccTfCommComponent accTfCommComponent = (AccTfCommComponent) this.getComponent(PUBConstant.ACCTFCOMM); accTfCommComponent.checkConditionBeforeAuthorize("PvpTfIbc", pvpSerno, ctrTfIbc.getContNo()); // ????? //CMISSequenceService sequenceService = (CMISSequenceService) context.getService("sequenceService"); //String orgId = pvpTfIbc.getInputBrId(); //billNo = sequenceService.getSequence(orgId, "fromOrg", 15, context); //String loanNo = sequenceService.getSequence("CZ", "fromDate", 15, context); //loanNo = loanNo.substring(2); Context context = this.getContext(); Connection connection = this.getConnection(); CMISSequenceService sequenceService = (CMISSequenceService) context.getService("sequenceService"); String loanNo = sequenceService.getSequence(TradeCodeConstant.SERNONC, "44", context, connection); //??? String[] billZero = { "", "00", "0", "" }; int billSeqCtr = ctrTfIbc.getBillSeq(); String billSeq = String.valueOf(billSeqCtr); billSeq = billZero[billSeq.length()] + billSeq; String billNo = pvpTfIbc.getContNo() + billSeq; // ??? ?????? billSeqCtr++; ctrTfIbc.setBillSeq(billSeqCtr); PvpAuthorize pvpAuthorize = new PvpAuthorize(); pvpAuthorize.setSerno(pvpSerno); pvpAuthorize.setLoanNo(loanNo); pvpAuthorize.setCusManager(pvpTfIbc.getCusManager()); pvpAuthorize.setInputBrId(pvpTfIbc.getInputBrId()); pvpAuthorize.setFinaBrId(pvpTfIbc.getFinaBrId()); pvpAuthorize.setCusId(pvpTfIbc.getCusId()); pvpAuthorize.setCusName(pvpTfIbc.getCusName()); pvpAuthorize.setContNo(pvpTfIbc.getContNo()); pvpAuthorize.setBillNo(billNo); pvpAuthorize.setTradeAmount(pvpTfIbc.getApplyAmount()); pvpAuthorize.setTradeDate(this.getOpenDay()); pvpAuthorize.setTradeStatus(TradeCodeConstant.WTZ); pvpAuthorize.setTradeCode("0012"); pvpAuthorize.setFieldNum(18); // pvpAuthorize.setFldvalue01("c@loanNo@" + loanNo); //? pvpAuthorize.setFldvalue02("c@contSerno@" + billNo); //???? pvpAuthorize.setFldvalue03("c@contNo@" + pvpTfIbc.getContNo()); //??? pvpAuthorize.setFldvalue04("c@cusId@" + pvpTfIbc.getCusId()); //? pvpAuthorize.setFldvalue05("c@cusName@" + pvpTfIbc.getCusName()); //?? pvpAuthorize.setFldvalue06("c@bizType@" + "0012"); //?? pvpAuthorize.setFldvalue07("c@CurType@" + pvpTfIbc.getApplyCurType()); //??? pvpAuthorize.setFldvalue08("c@Amount@" + pvpTfIbc.getApplyAmount()); //? pvpAuthorize.setFldvalue09("c@startDate@" + (String) context.getDataValue("OPENDAY")); //(?) //??? /* * Calendar cal = Calendar.getInstance(); cal.setTime(ft.parse(billDueDay_Holiday)); cal.add(Calendar.DATE,3); billDueDay_Holiday_billIssue_Date = cal.getTime(); */ SimpleDateFormat ft = new SimpleDateFormat("yyyy-MM-dd"); Date openday = ft.parse((String) context.getDataValue("OPENDAY")); Calendar cal = Calendar.getInstance(); cal.setTime(openday); cal.add(Calendar.DATE, pvpTfIbc.getApplyTerm()); Date dueDate = cal.getTime(); String dueDateStr = ft.format(dueDate); pvpAuthorize.setFldvalue10("c@dueDate@" + dueDateStr); //?? pvpAuthorize.setFldvalue11("c@note@" + ""); // pvpAuthorize.setFldvalue12("c@applyOrg@" + pvpTfIbc.getFinaBrId()); // pvpAuthorize.setFldvalue13("c@inputDate@" + (String) context.getDataValue("OPENDAY")); // //? DecimalFormat df = new DecimalFormat("#.000000"); pvpAuthorize.setFldvalue14("c@realityIrY@" + df.format(pvpTfIbc.getRealityIrY() * 100)); // pvpAuthorize.setFldvalue15("c@iocNo@" + pvpTfIbc.getIocNo()); //??? pvpAuthorize.setFldvalue16("c@tfBillNo@" + pvpTfIbc.getTfBillNo()); //???? pvpAuthorize.setFldvalue17("c@enterAccount@" + pvpTfIbc.getEnterAccount()); //? pvpAuthorize.setFldvalue18("c@intCalType@" + pvpTfIbc.getIntCalType()); //?? //pvpAuthorize.setFldvalue18("c@businessrate@" + BigDecimalUtil.mul(pvpTfIbc.getRulingIr(), 100, 6, BigDecimal.ROUND_HALF_UP)); //pvpAuthorize.setFldvalue20("c@BillNo@" + checkNull(pvpTfIbc.getTfBillNo())); strReturnMessage = pvpAuthorizeAgent.insertPvpAuthorize(pvpAuthorize); if (!strReturnMessage.equals(CMISMessage.ADDSUCCEESS)) { System.out.println("???"); return strReturnMessage; } //?????,? modified by wxy 20110108 int appterm = 0; if (!this.getOpenDay().equals(pvpTfIbc.getStartDate())) { System.out.println("------------openday----" + this.getOpenDay()); appterm = pvpTfIbc.getApplyTerm(); pvpTfIbc.setStartDate(this.getOpenDay()); pvpTfIbc.setApplyTerm(appterm); pvpTfIbc.setDueDate(dueDateStr); ctrTfIbc.setStartDate(this.getOpenDay()); ctrTfIbc.setApplyTerm(appterm); ctrTfIbc.setDueDate(dueDateStr); } //???? AccTfIbc accTfIbc = new AccTfIbc(); AccTfIbcAgent accTfIbcAgent = (AccTfIbcAgent) this.getAgentInstance(PUBConstant.ACCTFIBC); BeanUtilsBean bub = new BeanUtilsBean(); try { bub.copyProperties(accTfIbc, pvpTfIbc); } catch (IllegalAccessException e) { new ComponentException("?????"); } catch (InvocationTargetException e) { new ComponentException("?????"); } accTfIbc.setLoanForm4("10"); accTfIbc.setCla("10"); accTfIbc.setBillNo(billNo); accTfIbc.setAccountStatus("0"); accTfIbc.setMainBrId(pvpTfIbc.getInvestigatorBrId()); accTfIbc.setLoanAmount(pvpTfIbc.getApplyAmount()); accTfIbc.setLoanBalance(pvpTfIbc.getApplyAmount()); accTfIbcAgent.insertAccTfIbc(accTfIbc); //???? AccTfComm accTfComm = new AccTfComm(); try { bub.copyProperties(accTfComm, accTfIbc); } catch (IllegalAccessException e) { new ComponentException("?????"); } catch (InvocationTargetException e) { new ComponentException("?????"); } accTfComm.setLimitAccNo(accTfIbc.getLimitAccNo()); accTfComm.setSendDate(this.getOpenDay()); try { accTfCommComponent.addAccTfComm(accTfComm); } catch (Exception e) { accTfCommComponent.updateDomain(accTfComm); } //? pvpTfIbc.setChargeoffStatus(Constant.PVPSTATUS3); pvpTfIbc.setBillNo(billNo); pvpTfIface.updatePvpTfIbc(pvpTfIbc); //????? ctrTfIbcComponent.modifyCtrTfIbc(ctrTfIbc); // try { /* IndexedCollection icoll = cbqService.queryAccreditNotice4Trade( loanNo, connection, connection, context); KeyedCollection reqPkg = (KeyedCollection) icoll.get(0); String hostSerNo = (String) reqPkg.get("hostSerNo").toString() .trim(); pvpAuthorize.setHostSerno(hostSerNo); pvpAuthorize.setTradeStatus(TradeCodeConstant.YTZ); pvpAuthorizeAgent.modifyCMISDomain(pvpAuthorize, "PvpAuthorize"); */ //??? CreditBusinessQuartzService cbqService = new CreditBusinessQuartzService(); cbqService.queryAccreditNotice(connection, context); } catch (Exception e) { e.printStackTrace(); throw new ComponentException("??" + e.getMessage()); } return strReturnMessage; }
From source file:com.yucheng.cmis.pvp.app.component.PvpAuthorizeComponent.java
/** * ??????????????/*from w w w. jav a 2 s . c o m*/ * * @param pvpSerno * ?? * @throws EMPException * @throws InvocationTargetException * @throws IllegalAccessException * @throws Exception * @since 2009-09-17 * @author modified by zhangwei */ public String addPvpTfCvrgAuthorize(String pvpSerno) throws EMPException, IllegalAccessException, InvocationTargetException { String strReturnMessage = CMISMessage.ADDDEFEAT; PvpTfIface pvpTfIface = (PvpTfIface) this.getComponentInterface("PvpTfImpl"); PvpAuthorizeAgent pvpAuthorizeAgent = (PvpAuthorizeAgent) this.getAgentInstance(PUBConstant.PVPAUTHORIZE); PvpTfCvrg pvpTfCvrg = new PvpTfCvrg(); //?? pvpTfCvrg = pvpTfIface.queryPvpTfCvrgBySerNo(pvpSerno); if (pvpTfCvrg == null || pvpTfCvrg.getContNo() == null) { System.out.println("???"); return strReturnMessage; } // ?? CustomIface customIface = (CustomIface) this.getComponentInterface(CusPubConstant.CUS_IFACE); CusBase cusBase = customIface.getCusBase(pvpTfCvrg.getCusId()); String transCusId = cusBase.getTransCusId(); //???? CtrTfCvrg ctrTfCvrg = null; CtrTfCvrgComponent ctrTfCvrgComponent = (CtrTfCvrgComponent) this.getComponent("CtrTfCvrg"); ctrTfCvrg = ctrTfCvrgComponent.queryCtrTfCvrgDetail(pvpTfCvrg.getContNo()); //? AccTfCommComponent accTfCommComponent = (AccTfCommComponent) this.getComponent(PUBConstant.ACCTFCOMM); accTfCommComponent.checkConditionBeforeAuthorize("PvpTfCvrg", pvpSerno, ctrTfCvrg.getContNo()); // ????? //CMISSequenceService sequenceService = (CMISSequenceService) context.getService("sequenceService"); //String orgId = pvpTfCvrg.getInputBrId(); //billNo = sequenceService.getSequence(orgId, "fromOrg", 15, context); //String loanNo = sequenceService.getSequence("CZ", "fromDate", 15, context); //loanNo = loanNo.substring(2); Context context = this.getContext(); Connection connection = this.getConnection(); CMISSequenceService sequenceService = (CMISSequenceService) context.getService("sequenceService"); String loanNo = sequenceService.getSequence(TradeCodeConstant.SERNONC, "44", context, connection); //??? String[] billZero = { "", "00", "0", "" }; int billSeqCtr = ctrTfCvrg.getBillSeq(); String billSeq = String.valueOf(billSeqCtr); billSeq = billZero[billSeq.length()] + billSeq; String billNo = pvpTfCvrg.getContNo() + billSeq; // ??? ?????? billSeqCtr++; ctrTfCvrg.setBillSeq(billSeqCtr); PvpAuthorize pvpAuthorize = new PvpAuthorize(); pvpAuthorize.setSerno(pvpSerno); pvpAuthorize.setLoanNo(loanNo); pvpAuthorize.setCusManager(pvpTfCvrg.getCusManager()); pvpAuthorize.setInputBrId(pvpTfCvrg.getInputBrId()); pvpAuthorize.setFinaBrId(pvpTfCvrg.getFinaBrId()); pvpAuthorize.setCusId(pvpTfCvrg.getCusId()); pvpAuthorize.setCusName(pvpTfCvrg.getCusName()); pvpAuthorize.setContNo(pvpTfCvrg.getContNo()); pvpAuthorize.setBillNo(billNo); pvpAuthorize.setTradeAmount(pvpTfCvrg.getApplyAmount()); pvpAuthorize.setTradeDate(this.getOpenDay()); pvpAuthorize.setTradeStatus(TradeCodeConstant.WTZ); pvpAuthorize.setTradeCode("0013"); pvpAuthorize.setFieldNum(28); // pvpAuthorize.setFldvalue01("c@loanNo@" + loanNo); //? pvpAuthorize.setFldvalue02("c@contSerno@" + billNo); //???? pvpAuthorize.setFldvalue03("c@contNo@" + pvpTfCvrg.getContNo()); //??? pvpAuthorize.setFldvalue04("c@cusId@" + pvpTfCvrg.getCusId()); //? pvpAuthorize.setFldvalue05("c@cusName@" + pvpTfCvrg.getCusName()); //?? pvpAuthorize.setFldvalue06("c@bizType@" + "0013"); //?? pvpAuthorize.setFldvalue07("c@CurType@" + pvpTfCvrg.getApplyCurType()); //??? pvpAuthorize.setFldvalue08("c@Amount@" + pvpTfCvrg.getApplyAmount()); //? pvpAuthorize.setFldvalue09("c@startDate@" + (String) context.getDataValue("OPENDAY")); //(?) pvpAuthorize.setFldvalue10("c@dueDate@" + pvpTfCvrg.getDueDate()); //? pvpAuthorize.setFldvalue11("c@note@" + ""); // pvpAuthorize.setFldvalue12("c@applyOrg@" + pvpTfCvrg.getFinaBrId()); // pvpAuthorize.setFldvalue13("c@inputDate@" + (String) context.getDataValue("OPENDAY")); // //? pvpAuthorize.setFldvalue14("c@guaranteeType@" + pvpTfCvrg.getGuaranteeType()); //? pvpAuthorize.setFldvalue15("c@cvrgType@" + pvpTfCvrg.getCvrgType()); //?? String cvrgType = pvpTfCvrg.getCvrgType(); if (cvrgType.equals("1")) { pvpAuthorize.setFldvalue16("c@applyTerm@" + " "); //? } else { pvpAuthorize.setFldvalue16("c@applyTerm@" + pvpTfCvrg.getApplyTerm()); //? } pvpAuthorize.setFldvalue17("c@securityMoneyRt@" + 100 * pvpTfCvrg.getSecurityMoneyRt()); //?? DecimalFormat df = new DecimalFormat("#0.00"); //todo:modified by wangxuyu 20101105 ???? List securitylist = ctrTfCvrgComponent.querySecurityByContNo(pvpTfCvrg.getContNo()); if (securitylist.size() == 0) { pvpAuthorize.setFldvalue18("c@securityMoneyAcNo@" + " "); //???1 pvpAuthorize.setFldvalue19("c@securityMoneyAmt@" + " "); //???1 pvpAuthorize.setFldvalue20("c@securityMoneyCur@" + " "); pvpAuthorize.setFldvalue21("c@securityMoneyType@" + " "); //???1 pvpAuthorize.setFldvalue22("c@securityMoneyDueDate@" + " "); pvpAuthorize.setFldvalue23("c@securityMoneyAcNo1@" + " "); //???2 pvpAuthorize.setFldvalue24("c@securityMoneyAmt1@" + " "); //???2 pvpAuthorize.setFldvalue25("c@securityMoneyCur1@" + " "); //????2 pvpAuthorize.setFldvalue26("c@securityMoneyType1@" + " "); //???1 pvpAuthorize.setFldvalue27("c@securityMoneyDueDate1@" + " "); } else if (securitylist.size() == 1) { TfSecurityMsg tfmsg = (TfSecurityMsg) securitylist.get(0); pvpAuthorize.setFldvalue18("c@securityMoneyAcNo@" + tfmsg.getSecurityMoneyAcNo()); pvpAuthorize.setFldvalue19("c@securityMoneyAmt@" + df.format(tfmsg.getSecurityMoneyAmt())); pvpAuthorize.setFldvalue20("c@securityMoneyCur@" + tfmsg.getSecurityMoneyCur()); pvpAuthorize.setFldvalue21("c@securityMoneyType@" + tfmsg.getSecurityMoneyType()); pvpAuthorize.setFldvalue22("c@securityMoneyDueDate@" + tfmsg.getSecurityMoneyDueDate()); pvpAuthorize.setFldvalue23("c@securityMoneyAcNo1@" + " "); pvpAuthorize.setFldvalue24("c@securityMoneyAmt1@" + " "); pvpAuthorize.setFldvalue25("c@securityMoneyCur1@" + " "); pvpAuthorize.setFldvalue26("c@securityMoneyType1@" + " "); pvpAuthorize.setFldvalue27("c@securityMoneyDueDate1@" + " "); } else if (securitylist.size() == 2) { TfSecurityMsg tfmsg = (TfSecurityMsg) securitylist.get(0); pvpAuthorize.setFldvalue18("c@securityMoneyAcNo@" + tfmsg.getSecurityMoneyAcNo()); pvpAuthorize.setFldvalue19("c@securityMoneyAmt@" + df.format(tfmsg.getSecurityMoneyAmt())); pvpAuthorize.setFldvalue20("c@securityMoneyCur@" + tfmsg.getSecurityMoneyCur()); pvpAuthorize.setFldvalue21("c@securityMoneyType@" + tfmsg.getSecurityMoneyType()); pvpAuthorize.setFldvalue22("c@securityMoneyDueDate@" + tfmsg.getSecurityMoneyDueDate()); TfSecurityMsg tfmsg2 = (TfSecurityMsg) securitylist.get(1); pvpAuthorize.setFldvalue23("c@securityMoneyAcNo1@" + tfmsg2.getSecurityMoneyAcNo()); pvpAuthorize.setFldvalue24("c@securityMoneyAmt1@" + df.format(tfmsg2.getSecurityMoneyAmt())); pvpAuthorize.setFldvalue25("c@securityMoneyCur1@" + tfmsg2.getSecurityMoneyCur()); pvpAuthorize.setFldvalue26("c@securityMoneyType1@" + tfmsg2.getSecurityMoneyType()); pvpAuthorize.setFldvalue27("c@securityMoneyDueDate1@" + tfmsg2.getSecurityMoneyDueDate()); } pvpAuthorize.setFldvalue28("c@assureMeansMain@" + pvpTfCvrg.getAssureMeansMain()); //?? /** pvpAuthorize.setFldvalue18("c@securityMoneyAcNo@" + pvpTfCvrg.getSecurityMoneyAcNo()); //???1 pvpAuthorize.setFldvalue19("c@securityMoneyAmt@" + pvpTfCvrg.getSecurityMoneyAmt()); //???1 pvpAuthorize.setFldvalue20("c@securityMoneyCur@" + pvpTfCvrg.getSecurityMoneyCur()); //????1 String acNo1 = pvpTfCvrg.getSecurityMoneyAcNo1(); if(acNo1 == null || acNo1.equals("null") || acNo1.trim().equals("")){ pvpAuthorize.setFldvalue21("c@securityMoneyAcNo1@" + " "); //???2 pvpAuthorize.setFldvalue22("c@securityMoneyAmt1@" + " "); //???2 pvpAuthorize.setFldvalue23("c@securityMoneyCur1@" + " "); //????2 }else{ pvpAuthorize.setFldvalue21("c@securityMoneyAcNo1@" + pvpTfCvrg.getSecurityMoneyAcNo1()); //???2 pvpAuthorize.setFldvalue22("c@securityMoneyAmt1@" + pvpTfCvrg.getSecurityMoneyAmt1()); //???2 pvpAuthorize.setFldvalue23("c@securityMoneyCur1@" + pvpTfCvrg.getSecurityMoneyCur1()); //????2 } */ //pvpAuthorize.setFldvalue18("c@businessrate@" + BigDecimalUtil.mul(pvpTfCvrg.getRulingIr(), 100, 6, BigDecimal.ROUND_HALF_UP)); //pvpAuthorize.setFldvalue20("c@BillNo@" + checkNull(pvpTfCvrg.getTfBillNo())); //?????,? modified by wxy 20110108 // int appterm =0; // String dueDate; // if(!this.getOpenDay().equals(pvpTfCvrg.getStartDate())) { // System.out.println("------------openday----"+this.getOpenDay()); // appterm =(int)pvpTfCvrg.getApplyTerm(); // dueDate = TimeUtil.ADD_DAY(this.getOpenDay(),appterm); // // pvpTfCvrg.setStartDate(this.getOpenDay()) ; // pvpTfCvrg.setDueDate(dueDate); // // ctrTfCvrg.setStartDate(this.getOpenDay()); // ctrTfCvrg.setDueDate(dueDate); // // pvpAuthorize.setFldvalue10("c@dueDate@" + dueDate); // //ctrTfLocImpl.modifyCtrTfOinsf(ctrTfOinsf); // // } strReturnMessage = pvpAuthorizeAgent.insertPvpAuthorize(pvpAuthorize); if (!strReturnMessage.equals(CMISMessage.ADDSUCCEESS)) { System.out.println("???"); return strReturnMessage; } //???? AccTfCvrg accTfCvrg = new AccTfCvrg(); AccTfCvrgAgent accTfCvrgAgent = (AccTfCvrgAgent) this.getAgentInstance(PUBConstant.ACCTFCVRG); BeanUtilsBean bub = new BeanUtilsBean(); try { bub.copyProperties(accTfCvrg, pvpTfCvrg); } catch (IllegalAccessException e) { new ComponentException("?????"); } catch (InvocationTargetException e) { new ComponentException("?????"); } accTfCvrg.setLoanForm4("10"); accTfCvrg.setCla("10"); accTfCvrg.setBillNo(billNo); accTfCvrg.setAccountStatus("0"); accTfCvrg.setMainBrId(pvpTfCvrg.getMainBrId()); accTfCvrg.setLoanAmount(pvpTfCvrg.getApplyAmount()); accTfCvrg.setLoanBalance(pvpTfCvrg.getApplyAmount()); accTfCvrgAgent.insertAccTfCvrg(accTfCvrg); //???? AccTfComm accTfComm = new AccTfComm(); try { bub.copyProperties(accTfComm, accTfCvrg); } catch (IllegalAccessException e) { new ComponentException("?????"); } catch (InvocationTargetException e) { new ComponentException("?????"); } accTfComm.setLimitAccNo(accTfCvrg.getLimitAccNo()); accTfComm.setSendDate(this.getOpenDay()); try { accTfCommComponent.addAccTfComm(accTfComm); } catch (Exception e) { accTfCommComponent.updateDomain(accTfComm); } // pvpTfCvrg.setChargeoffStatus(Constant.PVPSTATUS3); pvpTfIface.updatePvpTfCvrg(pvpTfCvrg); //????? ctrTfCvrgComponent.modifyCtrTfCvrg(ctrTfCvrg); // try { /* IndexedCollection icoll = cbqService.queryAccreditNotice4Trade( loanNo, connection, connection, context); KeyedCollection reqPkg = (KeyedCollection) icoll.get(0); String hostSerNo = (String) reqPkg.get("hostSerNo").toString() .trim(); pvpAuthorize.setHostSerno(hostSerNo); pvpAuthorize.setTradeStatus(TradeCodeConstant.YTZ); pvpAuthorizeAgent.modifyCMISDomain(pvpAuthorize, "PvpAuthorize"); */ //??? CreditBusinessQuartzService cbqService = new CreditBusinessQuartzService(); cbqService.queryAccreditNotice(connection, context); } catch (Exception e) { e.printStackTrace(); throw new ComponentException("??" + e.getMessage()); } return strReturnMessage; }
From source file:com.yucheng.cmis.pvp.app.component.PvpAuthorizeComponent.java
/** * ??????????????// w w w .j ava2s . c o m * * @param pvpSerno * ?? * @throws EMPException * @throws InvocationTargetException * @throws IllegalAccessException * @throws Exception * @since 2009-09-17 * @author modified by zhangwei */ public String addPvpTfCvrgExtAuthorize(String pvpSerno) throws EMPException, IllegalAccessException, InvocationTargetException { String strReturnMessage = CMISMessage.ADDDEFEAT; PvpTfIface pvpTfIface = (PvpTfIface) this.getComponentInterface("PvpTfImpl"); PvpAuthorizeAgent pvpAuthorizeAgent = (PvpAuthorizeAgent) this.getAgentInstance(PUBConstant.PVPAUTHORIZE); PvpTfCvrgExt pvpTfCvrgExt = new PvpTfCvrgExt(); //?? pvpTfCvrgExt = pvpTfIface.queryPvpTfCvrgExtBySerNo(pvpSerno); if (pvpTfCvrgExt == null || pvpTfCvrgExt.getContNo() == null) { System.out.println("???"); return strReturnMessage; } // ?? CustomIface customIface = (CustomIface) this.getComponentInterface(CusPubConstant.CUS_IFACE); CusBase cusBase = customIface.getCusBase(pvpTfCvrgExt.getCusId()); String transCusId = cusBase.getTransCusId(); //???? CtrTfCvrgExt ctrTfCvrgExt = null; CtrTfCvrgExtComponent ctrTfCvrgExtComponent = (CtrTfCvrgExtComponent) this.getComponent("CtrTfCvrgExt"); ctrTfCvrgExt = ctrTfCvrgExtComponent.queryCtrTfCvrgExtDetail(pvpTfCvrgExt.getContNo()); //??? AccTfCvrg accTfCvrg = null; AccTfCvrgComponent accTfCvrgComponent = (AccTfCvrgComponent) this.getComponent("AccTfCvrg"); accTfCvrg = accTfCvrgComponent.queryAccTfCvrgByContNoAndCondition(ctrTfCvrgExt.getOldContNo()); AccTfCommComponent accTfCommComponent = (AccTfCommComponent) this.getComponent(PUBConstant.ACCTFCOMM); AccTfComm accTfCommIns = new AccTfComm(); accTfCommIns = accTfCommComponent.findAccTfCommByBillNo(ctrTfCvrgExt.getOldBillNo()); //? accTfCommComponent.checkConditionBeforeAuthorize("PvpTfCvrgExt", pvpSerno, ctrTfCvrgExt.getContNo()); Context context = this.getContext(); Connection connection = this.getConnection(); CMISSequenceService sequenceService = (CMISSequenceService) context.getService("sequenceService"); String loanNo = sequenceService.getSequence(TradeCodeConstant.SERNONC, "44", context, connection); //??? String[] billZero = { "", "00", "0", "" }; int billSeqCtr = ctrTfCvrgExt.getBillSeq(); String billSeq = String.valueOf(billSeqCtr); billSeq = billZero[billSeq.length()] + billSeq; String billNo = pvpTfCvrgExt.getContNo() + billSeq; // ??? ?????? billSeqCtr++; ctrTfCvrgExt.setBillSeq(billSeqCtr); PvpAuthorize pvpAuthorize = new PvpAuthorize(); pvpAuthorize.setSerno(pvpSerno); pvpAuthorize.setLoanNo(loanNo); pvpAuthorize.setCusManager(pvpTfCvrgExt.getCusManager()); pvpAuthorize.setInputBrId(pvpTfCvrgExt.getInputBrId()); pvpAuthorize.setFinaBrId(pvpTfCvrgExt.getFinaBrId()); pvpAuthorize.setCusId(pvpTfCvrgExt.getCusId()); pvpAuthorize.setCusName(pvpTfCvrgExt.getCusName()); pvpAuthorize.setContNo(pvpTfCvrgExt.getContNo()); pvpAuthorize.setBillNo(billNo); pvpAuthorize.setTradeAmount(pvpTfCvrgExt.getApplyAmount()); pvpAuthorize.setTradeDate(this.getOpenDay()); pvpAuthorize.setTradeStatus(TradeCodeConstant.WTZ); pvpAuthorize.setTradeCode("0034"); pvpAuthorize.setFieldNum(26); // pvpAuthorize.setFldvalue01("c@loanNo@" + loanNo); //? pvpAuthorize.setFldvalue02("c@contSerno@" + billNo); //???? pvpAuthorize.setFldvalue03("c@contNo@" + pvpTfCvrgExt.getContNo()); //??? pvpAuthorize.setFldvalue04("c@cusId@" + pvpTfCvrgExt.getCusId()); //? pvpAuthorize.setFldvalue05("c@cusName@" + pvpTfCvrgExt.getCusName()); //?? pvpAuthorize.setFldvalue06("c@bizType@" + "0034"); //?? pvpAuthorize.setFldvalue07("c@CurType@" + pvpTfCvrgExt.getApplyCurType()); //??? pvpAuthorize.setFldvalue08("c@Amount@" + pvpTfCvrgExt.getNewApplyAmount()); //? pvpAuthorize.setFldvalue09("c@startDate@" + (String) context.getDataValue("OPENDAY")); //(?) pvpAuthorize.setFldvalue10("c@dueDate@" + pvpTfCvrgExt.getNewDueDate()); //? pvpAuthorize.setFldvalue11("c@note@" + ""); // pvpAuthorize.setFldvalue12("c@applyOrg@" + pvpTfCvrgExt.getFinaBrId()); // pvpAuthorize.setFldvalue13("c@inputDate@" + (String) context.getDataValue("OPENDAY")); // //? pvpAuthorize.setFldvalue14("c@iocNo@" + accTfCommIns.getSernoInternation()); //? pvpAuthorize.setFldvalue15("c@applyTerm@" + " "); //pvpAuthorize.setFldvalue16("c@securityMoneyRt@" + pvpTfCvrgExt.getSecurityMoneyRt()); DecimalFormat df = new DecimalFormat("#0.00");//?? pvpAuthorize.setFldvalue16("c@securityMoneyRt@" + 100 * pvpTfCvrgExt.getSecurityMoneyRt()); //?? List<TfSecurityMsg> securitylist = ctrTfCvrgExtComponent.querySecurityByCont(pvpTfCvrgExt.getContNo()); //????? if (securitylist.size() == 0) { pvpAuthorize.setFldvalue17("c@securityMoneyAcNo@" + " "); //???1 pvpAuthorize.setFldvalue18("c@securityMoneyAmt@" + " "); //???1 pvpAuthorize.setFldvalue19("c@securityMoneyCur@" + " "); pvpAuthorize.setFldvalue20("c@securityMoneyType@" + " "); //???1 pvpAuthorize.setFldvalue21("c@securityMoneyDueDate@" + " "); pvpAuthorize.setFldvalue22("c@securityMoneyAcNo1@" + " "); //???2 pvpAuthorize.setFldvalue23("c@securityMoneyAmt1@" + " "); //???2 pvpAuthorize.setFldvalue24("c@securityMoneyCur1@" + " "); //????2 pvpAuthorize.setFldvalue25("c@securityMoneyType1@" + " "); //???1 pvpAuthorize.setFldvalue26("c@securityMoneyDueDate1@" + " "); //????2 } else if (securitylist.size() == 1) { TfSecurityMsg tfmsg = (TfSecurityMsg) securitylist.get(0); pvpAuthorize.setFldvalue17("c@securityMoneyAcNo@" + tfmsg.getSecurityMoneyAcNo()); pvpAuthorize.setFldvalue18("c@securityMoneyAmt@" + df.format(tfmsg.getSecurityMoneyAmt())); pvpAuthorize.setFldvalue19("c@securityMoneyCur@" + tfmsg.getSecurityMoneyCur()); pvpAuthorize.setFldvalue20("c@securityMoneyType@" + tfmsg.getSecurityMoneyType()); pvpAuthorize.setFldvalue21("c@securityMoneyDueDate@" + tfmsg.getSecurityMoneyDueDate()); pvpAuthorize.setFldvalue22("c@securityMoneyAcNo1@" + " "); pvpAuthorize.setFldvalue23("c@securityMoneyAmt1@" + " "); pvpAuthorize.setFldvalue24("c@securityMoneyCur1@" + " "); pvpAuthorize.setFldvalue25("c@securityMoneyType1@" + " "); pvpAuthorize.setFldvalue26("c@securityMoneyDueDate1@" + " "); //????2 } else if (securitylist.size() == 2) { TfSecurityMsg tfmsg = (TfSecurityMsg) securitylist.get(0); pvpAuthorize.setFldvalue17("c@securityMoneyAcNo@" + tfmsg.getSecurityMoneyAcNo()); pvpAuthorize.setFldvalue18("c@securityMoneyAmt@" + df.format(tfmsg.getSecurityMoneyAmt())); pvpAuthorize.setFldvalue19("c@securityMoneyCur@" + tfmsg.getSecurityMoneyCur()); pvpAuthorize.setFldvalue20("c@securityMoneyType@" + tfmsg.getSecurityMoneyType()); pvpAuthorize.setFldvalue21("c@securityMoneyDueDate@" + tfmsg.getSecurityMoneyDueDate()); TfSecurityMsg tfmsg2 = (TfSecurityMsg) securitylist.get(1); pvpAuthorize.setFldvalue22("c@securityMoneyAcNo1@" + tfmsg2.getSecurityMoneyAcNo()); pvpAuthorize.setFldvalue23("c@securityMoneyAmt1@" + df.format(tfmsg2.getSecurityMoneyAmt())); pvpAuthorize.setFldvalue24("c@securityMoneyCur1@" + tfmsg2.getSecurityMoneyCur()); pvpAuthorize.setFldvalue25("c@securityMoneyType1@" + tfmsg2.getSecurityMoneyType()); pvpAuthorize.setFldvalue26("c@securityMoneyDueDate1@" + tfmsg2.getSecurityMoneyDueDate()); } strReturnMessage = pvpAuthorizeAgent.insertPvpAuthorize(pvpAuthorize); if (!strReturnMessage.equals(CMISMessage.ADDSUCCEESS)) { System.out.println("???"); return strReturnMessage; } //???? AccTfCvrgExt accTfCvrgExt = new AccTfCvrgExt(); AccTfCvrgExtAgent accTfCvrgExtAgent = (AccTfCvrgExtAgent) this.getAgentInstance(PUBConstant.ACCTFCVRGEXT); BeanUtilsBean bub = new BeanUtilsBean(); try { bub.copyProperties(accTfCvrgExt, pvpTfCvrgExt); } catch (IllegalAccessException e) { new ComponentException("?????"); } catch (InvocationTargetException e) { new ComponentException("?????"); } accTfCvrgExt.setLoanForm4("10"); accTfCvrgExt.setCla("10"); accTfCvrgExt.setBillNo(billNo); accTfCvrgExt.setAccountStatus("0"); accTfCvrgExt.setLoanAmount(pvpTfCvrgExt.getApplyAmount()); accTfCvrgExt.setLoanBalance(pvpTfCvrgExt.getApplyAmount()); accTfCvrgExtAgent.insertAccTfCvrgExt(accTfCvrgExt); //???? AccTfComm accTfComm = new AccTfComm(); try { bub.copyProperties(accTfComm, accTfCvrgExt); } catch (IllegalAccessException e) { new ComponentException("?????"); } catch (InvocationTargetException e) { new ComponentException("?????"); } accTfComm.setLimitAccNo(accTfCvrgExt.getLimitAccNo()); accTfComm.setApplyAmount(accTfCvrgExt.getNewApplyAmount()); accTfComm.setLoanAmount(accTfCvrgExt.getNewApplyAmount()); try { accTfCommComponent.addAccTfComm(accTfComm); } catch (Exception e) { accTfCommComponent.updateDomain(accTfComm); } // pvpTfCvrgExt.setChargeoffStatus(Constant.PVPSTATUS3); pvpTfCvrgExt.setBillNo(billNo); pvpTfIface.updatePvpTfCvrgExt(pvpTfCvrgExt); //????? ctrTfCvrgExtComponent.modifyCtrTfCvrgExt(ctrTfCvrgExt); // try { //??? CreditBusinessQuartzService cbqService = new CreditBusinessQuartzService(); cbqService.queryAccreditNotice(connection, context); } catch (Exception e) { e.printStackTrace(); throw new ComponentException("??" + e.getMessage()); } return strReturnMessage; }
From source file:com.yucheng.cmis.pvp.app.component.PvpAuthorizeComponent.java
/** * ????????????????//from ww w. j a va 2s . c o m * * @param pvpSerno * ?? * @throws EMPException * @throws InvocationTargetException * @throws IllegalAccessException * @throws Exception * @since 2009-09-17 * @author modified by zhangwei */ public String addPvpTfPgasAuthorize(String pvpSerno) throws EMPException, IllegalAccessException, InvocationTargetException { String strReturnMessage = CMISMessage.ADDDEFEAT; PvpTfPgasComponent pvpTfPgasComponent = (PvpTfPgasComponent) this.getComponent("PvpTfPgas"); PvpAuthorizeAgent pvpAuthorizeAgent = (PvpAuthorizeAgent) this.getAgentInstance(PUBConstant.PVPAUTHORIZE); PvpTfPgas pvpTfPgas = new PvpTfPgas(); //? pvpTfPgas = pvpTfPgasComponent.queryPvpTfPgasBySerNo(pvpSerno); if (pvpTfPgas == null || pvpTfPgas.getContNo() == null) { System.out.println("??"); return strReturnMessage; } //?? CustomIface customIface = (CustomIface) this.getComponentInterface(CusPubConstant.CUS_IFACE); CusBase cusBase = customIface.getCusBase(pvpTfPgas.getCusId()); String transCusId = cusBase.getTransCusId(); //???? CtrTfPgas ctrTfPgas = null; CtrTfPgasComponent ctrTfPgasComponent = (CtrTfPgasComponent) this.getComponent("CtrTfPgas"); ctrTfPgas = ctrTfPgasComponent.queryCtrTfPgasDetail(pvpTfPgas.getContNo()); //? AccTfCommComponent accTfCommComponent = (AccTfCommComponent) this.getComponent(PUBConstant.ACCTFCOMM); // accTfCommComponent.checkConditionBeforeAuthorize("PvpTfPgas", pvpSerno, ctrTfPgas.getContNo()); // ????? //CMISSequenceService sequenceService = (CMISSequenceService) context.getService("sequenceService"); //String orgId = pvpTfPgas.getInputBrId(); //billNo = sequenceService.getSequence(orgId, "fromOrg", 15, context); //String loanNo = sequenceService.getSequence("CZ", "fromDate", 15, context); //loanNo = loanNo.substring(2); Context context = this.getContext(); Connection connection = this.getConnection(); CMISSequenceService sequenceService = (CMISSequenceService) context.getService("sequenceService"); String loanNo = sequenceService.getSequence(TradeCodeConstant.SERNONC, "44", context, connection); //??? String[] billZero = { "", "00", "0", "" }; int billSeqCtr = ctrTfPgas.getBillSeq(); String billSeq = String.valueOf(billSeqCtr); billSeq = billZero[billSeq.length()] + billSeq; String billNo = pvpTfPgas.getContNo() + billSeq; // ??? ?????? billSeqCtr++; ctrTfPgas.setBillSeq(billSeqCtr); //??? PvpAuthorize pvpAuthorize = new PvpAuthorize(); pvpAuthorize.setSerno(pvpSerno); pvpAuthorize.setLoanNo(loanNo); pvpAuthorize.setCusManager(pvpTfPgas.getCusManager()); pvpAuthorize.setInputBrId(pvpTfPgas.getInputBrId()); pvpAuthorize.setFinaBrId(pvpTfPgas.getFinaBrId()); pvpAuthorize.setCusId(pvpTfPgas.getCusId()); pvpAuthorize.setCusName(pvpTfPgas.getCusName()); pvpAuthorize.setContNo(pvpTfPgas.getContNo()); pvpAuthorize.setBillNo(billNo); pvpAuthorize.setTradeAmount(pvpTfPgas.getApplyAmount()); pvpAuthorize.setTradeDate(this.getOpenDay()); pvpAuthorize.setTradeStatus(TradeCodeConstant.WTZ); pvpAuthorize.setTradeCode("0015"); pvpAuthorize.setFieldNum(26); // pvpAuthorize.setFldvalue01("c@loanNo@" + loanNo); //? pvpAuthorize.setFldvalue02("c@contSerno@" + billNo); //???? pvpAuthorize.setFldvalue03("c@contNo@" + pvpTfPgas.getContNo()); //??? pvpAuthorize.setFldvalue04("c@cusId@" + pvpTfPgas.getCusId()); //? pvpAuthorize.setFldvalue05("c@cusName@" + pvpTfPgas.getCusName()); //?? pvpAuthorize.setFldvalue06("c@bizType@" + "0015"); //?? pvpAuthorize.setFldvalue07("c@CurType@" + pvpTfPgas.getApplyCurType()); //??? pvpAuthorize.setFldvalue08("c@Amount@" + pvpTfPgas.getApplyAmount()); //? pvpAuthorize.setFldvalue09("c@startDate@" + checkNull(pvpTfPgas.getStartDate())); //(?) pvpAuthorize.setFldvalue10("c@dueDate@" + checkNull(pvpTfPgas.getDueDate())); //? pvpAuthorize.setFldvalue11("c@note@" + ""); // pvpAuthorize.setFldvalue12("c@applyOrg@" + pvpTfPgas.getFinaBrId()); // pvpAuthorize.setFldvalue13("c@inputDate@" + (String) context.getDataValue("OPENDAY")); // pvpAuthorize.setFldvalue14("c@billId@" + pvpTfPgas.getBillId()); //????? pvpAuthorize.setFldvalue15("c@iocNo@" + pvpTfPgas.getIocNo()); //??? pvpAuthorize.setFldvalue16("c@securityMoneyRt@" + 100 * pvpTfPgas.getSecurityMoneyRt()); //?? //????Tf_Security_Msg????() String conditionStr = " where cont_no ='" + checkNull(pvpTfPgas.getContNo()) + "'"; PubOperaInterface pubOperaInterface = (PubOperaInterface) CMISComponentFactory.getComponentFactoryInstance() .getComponentInterface(PUBConstant.PUBOPERA, context, connection); List<CMISDomain> TfSecurityMsgList = new ArrayList<CMISDomain>(); TfSecurityMsgList = pubOperaInterface.getCMISDomainByCondition(TfSecurityMsg.class, conditionStr); KeyedCollection tempKcoll = new KeyedCollection(); if (TfSecurityMsgList.size() == 0) { pvpAuthorize.setFldvalue17("c@securityMoneyAcNo@"); //????1 pvpAuthorize.setFldvalue18("c@securityMoneyAmt@"); //???1 pvpAuthorize.setFldvalue19("c@securityMoneyCur@"); //????1 pvpAuthorize.setFldvalue20("c@securityMoneyAcNo1@"); //????2 pvpAuthorize.setFldvalue21("c@securityMoneyAmt1@"); //???2 pvpAuthorize.setFldvalue22("c@securityMoneyCur1@"); } else if (TfSecurityMsgList.size() == 1) { TfSecurityMsg tfSecurityMsg = (TfSecurityMsg) TfSecurityMsgList.get(0); pvpAuthorize.setFldvalue17("c@securityMoneyAcNo@" + checkNull(tfSecurityMsg.getSecurityMoneyAcNo())); //????1 pvpAuthorize.setFldvalue18("c@securityMoneyAmt@" + tfSecurityMsg.getSecurityMoneyAmt()); //???1 pvpAuthorize.setFldvalue19("c@securityMoneyCur@" + checkNull(tfSecurityMsg.getSecurityMoneyCur())); //????1 pvpAuthorize.setFldvalue20("c@securityMoneyAcNo1@"); //????2 pvpAuthorize.setFldvalue21("c@securityMoneyAmt1@"); //???2 pvpAuthorize.setFldvalue22("c@securityMoneyCur1@"); //????2 } else if (TfSecurityMsgList.size() == 2) { TfSecurityMsg tfSecurityMsg = (TfSecurityMsg) TfSecurityMsgList.get(0); pvpAuthorize.setFldvalue17("c@securityMoneyAcNo@" + checkNull(tfSecurityMsg.getSecurityMoneyAcNo())); //????1 pvpAuthorize.setFldvalue18("c@securityMoneyAmt@" + tfSecurityMsg.getSecurityMoneyAmt()); //???1 pvpAuthorize.setFldvalue19("c@securityMoneyCur@" + checkNull(tfSecurityMsg.getSecurityMoneyCur())); //????1 TfSecurityMsg tfSecurityMsg1 = (TfSecurityMsg) TfSecurityMsgList.get(1); pvpAuthorize.setFldvalue20("c@securityMoneyAcNo1@" + checkNull(tfSecurityMsg1.getSecurityMoneyAcNo())); //????2 pvpAuthorize.setFldvalue21("c@securityMoneyAmt1@" + tfSecurityMsg.getSecurityMoneyAmt()); //???2 pvpAuthorize.setFldvalue22("c@securityMoneyCur1@" + checkNull(tfSecurityMsg.getSecurityMoneyCur())); //????2 } else if (TfSecurityMsgList.size() > 2) { throw new EMPException("????"); } //??????, for (int i = 0; i < TfSecurityMsgList.size(); i++) { TfSecurityMsg tfSecurityMsg = (TfSecurityMsg) TfSecurityMsgList.get(i); tfSecurityMsg.setBillNo(billNo); pubOperaInterface.updateCMISDomain(tfSecurityMsg); } // pvpAuthorize.setFldvalue17("c@securityMoneyAcNo@" + checkNull(pvpTfPgas.getSecurityMoneyAcNo())); //????1 // pvpAuthorize.setFldvalue18("c@securityMoneyAmt@" + pvpTfPgas.getSecurityMoneyAmt()); //???1 // pvpAuthorize.setFldvalue19("c@securityMoneyCur@" + checkNull(pvpTfPgas.getSecurityMoneyCur())); //????1 // String securityMoneyAcNo1 = pvpTfPgas.getSecurityMoneyAcNo1(); // if(securityMoneyAcNo1 == null || securityMoneyAcNo1.equals("null") || securityMoneyAcNo1.trim().equals("")){ // pvpAuthorize.setFldvalue20("c@securityMoneyAcNo1@"); //????2 // pvpAuthorize.setFldvalue21("c@securityMoneyAmt1@"); //???2 // pvpAuthorize.setFldvalue22("c@securityMoneyCur1@"); //????2 // }else{ // pvpAuthorize.setFldvalue20("c@securityMoneyAcNo1@" + pvpTfPgas.getSecurityMoneyAcNo1()); //????2 // pvpAuthorize.setFldvalue21("c@securityMoneyAmt1@" + pvpTfPgas.getSecurityMoneyAmt1()); //???2 // pvpAuthorize.setFldvalue22("c@securityMoneyCur1@" + pvpTfPgas.getSecurityMoneyCur1()); //????2 // } //pvpAuthorize.setFldvalue05("c@artificialno@" + checkNull(pvpTfPgas.getCnContNo())); //pvpAuthorize.setFldvalue18("c@businessrate@" + BigDecimalUtil.mul(pvpTfPgas.getRulingIr(), 100, 6, BigDecimal.ROUND_HALF_UP)); //pvpAuthorize.setFldvalue23("c@Bailrate@" + BigDecimalUtil.mul(pvpTfPgas.getSecurityMoneyRt(), 100, 6, BigDecimal.ROUND_HALF_UP)); strReturnMessage = pvpAuthorizeAgent.insertPvpAuthorize(pvpAuthorize); if (!strReturnMessage.equals(CMISMessage.ADDSUCCEESS)) { System.out.println("???"); return strReturnMessage; } //?????,? modified by wxy 20110108 // double appterm =0; // if(pvpTfPgas.getStartDate()!=null&&!this.getOpenDay().equals(pvpTfPgas.getStartDate())) { // System.out.println("------------openday----"+this.getOpenDay()); // appterm = TimeUtil.getBetweenDays(this.getOpenDay(), pvpTfPgas.getDueDate()); // pvpTfPgas.setStartDate(this.getOpenDay()) ; // pvpTfPgas.setApplyTerm(appterm); // // ctrTfPgas.setStartDate(this.getOpenDay()); // ctrTfPgas.setApplyTerm(appterm); // // //ctrTfLocImpl.modifyCtrTfOinsf(ctrTfOinsf); // // } //???? AccTfPgas accTfPgas = new AccTfPgas(); AccTfPgasAgent accTfPgasAgent = (AccTfPgasAgent) this.getAgentInstance("AccTfPgas"); BeanUtilsBean bub = new BeanUtilsBean(); try { bub.copyProperties(accTfPgas, pvpTfPgas); } catch (IllegalAccessException e) { new ComponentException("????????"); } catch (InvocationTargetException e) { new ComponentException("???????"); } accTfPgas.setLoanForm4("10"); accTfPgas.setCla("10"); accTfPgas.setBillNo(billNo); accTfPgas.setAccountStatus("0"); accTfPgas.setMainBrId(pvpTfPgas.getInvestigatorBrId()); accTfPgas.setLoanAmount(pvpTfPgas.getApplyAmount()); accTfPgas.setLoanBalance(pvpTfPgas.getApplyAmount()); accTfPgasAgent.insertAccTfPgas(accTfPgas); //???? AccTfComm accTfComm = new AccTfComm(); try { bub.copyProperties(accTfComm, accTfPgas); } catch (IllegalAccessException e) { new ComponentException("?????"); } catch (InvocationTargetException e) { new ComponentException("?????"); } accTfComm.setLimitAccNo(accTfPgas.getLimitAccNo()); accTfComm.setSendDate(this.getOpenDay()); try { accTfCommComponent.addAccTfComm(accTfComm); } catch (Exception e) { accTfCommComponent.updateDomain(accTfComm); } // pvpTfPgas.setChargeoffStatus(Constant.PVPSTATUS3); pvpTfPgas.setBillNo(billNo); pvpTfPgasComponent.updatePvpTfPgas(pvpTfPgas); //????? ctrTfPgasComponent.modifyCtrTfPgas(ctrTfPgas); // try { /*?? IndexedCollection icoll = cbqService.queryAccreditNotice4Trade( loanNo, connection, connection, context); KeyedCollection reqPkg = (KeyedCollection) icoll.get(0); String hostSerNo = (String) reqPkg.get("hostSerNo").toString() .trim(); pvpAuthorize.setHostSerno(hostSerNo); pvpAuthorize.setTradeStatus(TradeCodeConstant.YTZ); pvpAuthorizeAgent.modifyCMISDomain(pvpAuthorize, "PvpAuthorize"); */ //??? CreditBusinessQuartzService cbqService = new CreditBusinessQuartzService(); cbqService.queryAccreditNotice(connection, context); } catch (Exception e) { e.printStackTrace(); throw new ComponentException("??" + e.getMessage()); } return strReturnMessage; }
From source file:com.yucheng.cmis.pvp.app.component.PvpAuthorizeComponent.java
/** * ????????????????/*from w w w . j a v a2 s .co m*/ * * @param pvpSerno * ?? * @throws EMPException * @throws InvocationTargetException * @throws IllegalAccessException * @throws Exception * @since 2009-09-17 * @author modified by zhangwei */ public String addPvpTfOiffAuthorize(String pvpSerno) throws EMPException, IllegalAccessException, InvocationTargetException { String strReturnMessage = CMISMessage.ADDDEFEAT; //?? PvpTfOiffComponent pvpTfOiffComponent = (PvpTfOiffComponent) this.getComponent("PvpTfOiff"); PvpTfOiff pvpTfOiff = new PvpTfOiff(); pvpTfOiff = pvpTfOiffComponent.queryPvpTfOiff(pvpSerno); if (pvpTfOiff == null || pvpTfOiff.getContNo() == null) { return strReturnMessage; } //?? CustomIface customIface = (CustomIface) this.getComponentInterface(CusPubConstant.CUS_IFACE); CusBase cusBase = customIface.getCusBase(pvpTfOiff.getCusId()); String transCusId = cusBase.getTransCusId(); //???? CtrTfOiff ctrTfOiff = null; CtrTfOiffComponent ctrTfOiffComponent = (CtrTfOiffComponent) this.getComponent("CtrTfOiff"); ctrTfOiff = ctrTfOiffComponent.queryCtrTfOiff(pvpTfOiff.getContNo()); //? AccTfCommComponent accTfCommComponent = (AccTfCommComponent) this.getComponent(PUBConstant.ACCTFCOMM); accTfCommComponent.checkConditionBeforeAuthorize("PvpTfOiff", pvpSerno, ctrTfOiff.getContNo()); // ????? //CMISSequenceService sequenceService = (CMISSequenceService) context.getService("sequenceService"); //String orgId = pvpTfOiff.getInputBrId(); //billNo = sequenceService.getSequence(orgId, "fromOrg", 15, context); //String loanNo = sequenceService.getSequence("CZ", "fromDate", 15, context); //loanNo = loanNo.substring(2); //??? Context context = this.getContext(); Connection connection = this.getConnection(); CMISSequenceService sequenceService = (CMISSequenceService) context.getService("sequenceService"); String loanNo = sequenceService.getSequence(TradeCodeConstant.SERNONC, "44", context, connection); //??? String[] billZero = { "", "00", "0", "" }; int billSeqCtr = ctrTfOiff.getBillSeq(); String billSeq = String.valueOf(billSeqCtr); billSeq = billZero[billSeq.length()] + billSeq; String billNo = pvpTfOiff.getContNo() + billSeq; // ??? ?????? billSeqCtr++; ctrTfOiff.setBillSeq(billSeqCtr); PvpAuthorize pvpAuthorize = new PvpAuthorize(); pvpAuthorize.setSerno(pvpSerno); pvpAuthorize.setLoanNo(loanNo); pvpAuthorize.setCusManager(pvpTfOiff.getCusManager()); pvpAuthorize.setInputBrId(pvpTfOiff.getInputBrId()); pvpAuthorize.setFinaBrId(pvpTfOiff.getFinaBrId()); pvpAuthorize.setCusId(pvpTfOiff.getCusId()); pvpAuthorize.setCusName(pvpTfOiff.getCusName()); pvpAuthorize.setContNo(pvpTfOiff.getContNo()); pvpAuthorize.setBillNo(billNo); pvpAuthorize.setTradeAmount(pvpTfOiff.getApplyAmount()); pvpAuthorize.setTradeDate(this.getOpenDay()); pvpAuthorize.setTradeStatus(TradeCodeConstant.WTZ); pvpAuthorize.setTradeCode("0019"); pvpAuthorize.setFieldNum(17); // pvpAuthorize.setFldvalue01("c@loanNo@" + loanNo); //? pvpAuthorize.setFldvalue02("c@contSerno@" + billNo); //???? pvpAuthorize.setFldvalue03("c@contNo@" + pvpTfOiff.getContNo()); //??? pvpAuthorize.setFldvalue04("c@cusId@" + pvpTfOiff.getCusId()); //? pvpAuthorize.setFldvalue05("c@cusName@" + pvpTfOiff.getCusName()); //?? pvpAuthorize.setFldvalue06("c@bizType@" + "0019"); //?? pvpAuthorize.setFldvalue07("c@CurType@" + pvpTfOiff.getApplyCurType()); //??? pvpAuthorize.setFldvalue08("c@Amount@" + pvpTfOiff.getApplyAmount()); //? pvpAuthorize.setFldvalue09("c@startDate@" + (String) context.getDataValue("OPENDAY")); //(?) pvpAuthorize.setFldvalue10("c@dueDate@" + checkNull(pvpTfOiff.getDueDate())); //? pvpAuthorize.setFldvalue11("c@note@" + ""); // pvpAuthorize.setFldvalue12("c@applyOrg@" + pvpTfOiff.getFinaBrId()); // pvpAuthorize.setFldvalue13("c@inputDate@" + (String) context.getDataValue("OPENDAY")); // //? pvpAuthorize.setFldvalue14("c@ifNo@" + checkNull(pvpTfOiff.getIfNo())); //??? DecimalFormat df = new DecimalFormat("#.000000"); pvpAuthorize.setFldvalue15("c@realityIrY@" + df.format(pvpTfOiff.getRealityIrY() * 100)); // pvpAuthorize.setFldvalue16("c@enterAccount@" + checkNull(pvpTfOiff.getEnterAccount())); //? pvpAuthorize.setFldvalue17("c@intCalType@" + pvpTfOiff.getIntCalType()); //? //?????,? modified by wxy 20110108 int appterm = 0; String dueDate; if (!this.getOpenDay().equals(pvpTfOiff.getStartDate())) { System.out.println("------------openday----" + this.getOpenDay()); appterm = (int) pvpTfOiff.getApplyTerm(); dueDate = TimeUtil.ADD_DAY(this.getOpenDay(), appterm); pvpTfOiff.setStartDate(this.getOpenDay()); pvpTfOiff.setDueDate(dueDate); //pvpTfOiffComponent.updatePvpTfOiff(pvpTfOiff); ctrTfOiff.setStartDate(this.getOpenDay()); ctrTfOiff.setDueDate(dueDate); // ctrTfOiffComponent.modifyCtrTfOiff(ctrTfOiff); pvpAuthorize.setFldvalue10("c@dueDate@" + dueDate); } //?? PvpAuthorizeAgent pvpAuthorizeAgent = (PvpAuthorizeAgent) this.getAgentInstance(PUBConstant.PVPAUTHORIZE); strReturnMessage = pvpAuthorizeAgent.insertPvpAuthorize(pvpAuthorize); if (!strReturnMessage.equals(CMISMessage.ADDSUCCEESS)) { return strReturnMessage; } //?????? AccTfOiff accTfOiff = new AccTfOiff(); AccTfOiffAgent accTfOiffAgent = (AccTfOiffAgent) this.getAgentInstance("AccTfOiff"); BeanUtilsBean bub = new BeanUtilsBean(); try { bub.copyProperties(accTfOiff, pvpTfOiff); } catch (IllegalAccessException e) { new ComponentException("???????"); } catch (InvocationTargetException e) { new ComponentException("???????"); } accTfOiff.setBillNo(billNo); accTfOiff.setAccountStatus("0"); accTfOiff.setMainBrId(pvpTfOiff.getInvestigatorBrId()); accTfOiff.setLoanAmount(pvpTfOiff.getApplyAmount()); accTfOiff.setLoanBalance(pvpTfOiff.getApplyAmount()); accTfOiffAgent.insertAccTfOiff(accTfOiff); //???? AccTfComm accTfComm = new AccTfComm(); try { bub.copyProperties(accTfComm, accTfOiff); } catch (IllegalAccessException e) { new ComponentException("??????"); } catch (InvocationTargetException e) { new ComponentException("??????"); } accTfComm.setLimitAccNo(accTfOiff.getLimitAccNo()); accTfComm.setSendDate(this.getOpenDay()); try { accTfCommComponent.addAccTfComm(accTfComm); } catch (Exception e) { accTfCommComponent.updateDomain(accTfComm); } // pvpTfOiff.setChargeoffStatus(Constant.PVPSTATUS3); pvpTfOiff.setBillNo(billNo); pvpTfOiffComponent.updatePvpTfOiff(pvpTfOiff); //????? ctrTfOiffComponent.modifyCtrTfOiff(ctrTfOiff); try { /*?? IndexedCollection icoll = cbqService.queryAccreditNotice4Trade(loanNo, connection, connection, context); KeyedCollection reqPkg = (KeyedCollection) icoll.get(0); String hostSerNo = (String) reqPkg.get("hostSerNo").toString().trim(); pvpAuthorize.setHostSerno(hostSerNo); pvpAuthorize.setTradeStatus(TradeCodeConstant.YTZ); pvpAuthorizeAgent.modifyCMISDomain(pvpAuthorize, "PvpAuthorize"); */ CreditBusinessQuartzService cbqService = new CreditBusinessQuartzService(); cbqService.queryAccreditNotice(connection, context); } catch (Exception e) { e.printStackTrace(); throw new ComponentException("?????" + e.getMessage()); } return strReturnMessage; }
From source file:com.yucheng.cmis.pvp.app.component.PvpAuthorizeComponent.java
/** * ????????????????/* ww w . j a v a 2s. c om*/ * * @param pvpSerno * ?? * @throws EMPException * @throws InvocationTargetException * @throws IllegalAccessException * @throws Exception * @since 2009-09-17 * @author modified by zhangwei */ public String addPvpTfOinvfAuthorize(String pvpSerno) throws EMPException, IllegalAccessException, InvocationTargetException { String strReturnMessage = CMISMessage.ADDDEFEAT;// ??231|?? //?? PvpTfOinvfComponent pvpTfOinvfComponent = (PvpTfOinvfComponent) this.getComponent("PvpTfOinvf"); PvpTfOinvf pvpTfOinvf = new PvpTfOinvf(); pvpTfOinvf = pvpTfOinvfComponent.queryPvpTfOinvf(pvpSerno); if (pvpTfOinvf == null || pvpTfOinvf.getContNo() == null) { return strReturnMessage; } //?? CustomIface customIface = (CustomIface) this.getComponentInterface(CusPubConstant.CUS_IFACE); CusBase cusBase = customIface.getCusBase(pvpTfOinvf.getCusId()); String transCusId = cusBase.getTransCusId(); //???? CtrTfOinvf ctrTfOinvf = null; CtrTfOinvfComponent ctrTfOinvfComponent = (CtrTfOinvfComponent) this.getComponent("CtrTfOinvf"); ctrTfOinvf = ctrTfOinvfComponent.queryCtrTfOinvf(pvpTfOinvf.getContNo()); //? AccTfCommComponent accTfCommComponent = (AccTfCommComponent) this.getComponent(PUBConstant.ACCTFCOMM); accTfCommComponent.checkConditionBeforeAuthorize("PvpTfOinvf", pvpSerno, ctrTfOinvf.getContNo()); //CMISSequenceService sequenceService = (CMISSequenceService) context.getService("sequenceService"); //String orgId = pvpTfOinvf.getInputBrId(); //billNo = sequenceService.getSequence(orgId, "fromOrg", 15, context); //String loanNo = sequenceService.getSequence("CZ", "fromDate", 15, context); //loanNo = loanNo.substring(2); //??? Context context = this.getContext(); Connection connection = this.getConnection(); CMISSequenceService sequenceService = (CMISSequenceService) context.getService("sequenceService"); String loanNo = sequenceService.getSequence(TradeCodeConstant.SERNONC, "44", context, connection); //??? String[] billZero = { "", "00", "0", "" }; int billSeqCtr = ctrTfOinvf.getBillSeq(); String billSeq = String.valueOf(billSeqCtr); billSeq = billZero[billSeq.length()] + billSeq; String billNo = pvpTfOinvf.getContNo() + billSeq; // ??? ?????? billSeqCtr++; ctrTfOinvf.setBillSeq(billSeqCtr); PvpAuthorize pvpAuthorize = new PvpAuthorize(); pvpAuthorize.setSerno(pvpSerno); pvpAuthorize.setLoanNo(loanNo); pvpAuthorize.setCusManager(pvpTfOinvf.getCusManager()); pvpAuthorize.setInputBrId(pvpTfOinvf.getInputBrId()); pvpAuthorize.setFinaBrId(pvpTfOinvf.getFinaBrId()); pvpAuthorize.setCusId(pvpTfOinvf.getCusId()); pvpAuthorize.setCusName(pvpTfOinvf.getCusName()); pvpAuthorize.setContNo(pvpTfOinvf.getContNo()); pvpAuthorize.setBillNo(billNo); pvpAuthorize.setTradeAmount(pvpTfOinvf.getApplyAmount()); pvpAuthorize.setTradeDate(this.getOpenDay()); pvpAuthorize.setTradeStatus(TradeCodeConstant.WTZ); pvpAuthorize.setTradeCode("0022"); pvpAuthorize.setFieldNum(23); // pvpAuthorize.setFldvalue01("c@loanNo@" + loanNo); //? pvpAuthorize.setFldvalue02("c@contSerno@" + billNo); //???? pvpAuthorize.setFldvalue03("c@contNo@" + pvpTfOinvf.getContNo()); //??? pvpAuthorize.setFldvalue04("c@cusId@" + pvpTfOinvf.getCusId()); //? pvpAuthorize.setFldvalue05("c@cusName@" + pvpTfOinvf.getCusName()); //?? pvpAuthorize.setFldvalue06("c@bizType@" + "0022"); //?? pvpAuthorize.setFldvalue07("c@CurType@" + pvpTfOinvf.getApplyCurType()); //??? pvpAuthorize.setFldvalue08("c@Amount@" + pvpTfOinvf.getApplyAmount()); //? pvpAuthorize.setFldvalue09("c@startDate@" + (String) context.getDataValue("OPENDAY")); //(?) pvpAuthorize.setFldvalue10("c@dueDate@" + checkNull(pvpTfOinvf.getDueDate())); //? pvpAuthorize.setFldvalue11("c@note@" + ""); // pvpAuthorize.setFldvalue12("c@applyOrg@" + pvpTfOinvf.getFinaBrId()); // pvpAuthorize.setFldvalue13("c@inputDate@" + (String) context.getDataValue("OPENDAY")); // //? DecimalFormat df = new DecimalFormat("#.000000"); pvpAuthorize.setFldvalue14("c@realityIrY@" + df.format(pvpTfOinvf.getRealityIrY() * 100)); // pvpAuthorize.setFldvalue15("c@buyerName@" + pvpTfOinvf.getBuyerName()); //?? pvpAuthorize.setFldvalue16("c@tranDocDate@" + pvpTfOinvf.getTranDocDate()); //??? pvpAuthorize.setFldvalue17("c@enterAccount@" + pvpTfOinvf.getEnterAccount()); //? pvpAuthorize.setFldvalue18("c@decNo@" + pvpTfOinvf.getDecNo()); //?? pvpAuthorize.setFldvalue19("c@intCalType@" + pvpTfOinvf.getIntCalType()); //?? pvpAuthorize.setFldvalue20("c@oinvfBizType@" + "0"); // pvpAuthorize.setFldvalue21("c@nvoiceNo@" + pvpTfOinvf.getNvoiceNo()); //??? pvpAuthorize.setFldvalue22("c@nvoiceCurType@" + pvpTfOinvf.getNvoiceCurType()); //??? pvpAuthorize.setFldvalue23("c@nvoiceAmt@" + pvpTfOinvf.getNvoiceAmt()); //?? //?????,??? modified by wxy 20110108 int appterm = 0; String dueDate; if (!this.getOpenDay().equals(pvpTfOinvf.getStartDate())) { appterm = (int) pvpTfOinvf.getApplyTerm(); dueDate = TimeUtil.ADD_DAY(this.getOpenDay(), appterm); pvpTfOinvf.setStartDate(this.getOpenDay()); pvpTfOinvf.setDueDate(dueDate); //pvpTfOinvfComponent.updatePvpTfOinvf(pvpTfOinvf); ctrTfOinvf.setStartDate(this.getOpenDay()); ctrTfOinvf.setDueDate(dueDate); //ctrTfOinvfComponent.modifyCtrTfOinvf(ctrTfOinvf); pvpAuthorize.setFldvalue10("c@dueDate@" + dueDate); } //?? PvpAuthorizeAgent pvpAuthorizeAgent = (PvpAuthorizeAgent) this.getAgentInstance(PUBConstant.PVPAUTHORIZE); strReturnMessage = pvpAuthorizeAgent.insertPvpAuthorize(pvpAuthorize); if (!strReturnMessage.equals(CMISMessage.ADDSUCCEESS)) { System.out.println("???"); return strReturnMessage; } //?????? AccTfOinvf accTfOinvf = new AccTfOinvf(); AccTfOinvfAgent accTfOinvfAgent = (AccTfOinvfAgent) this.getAgentInstance("AccTfOinvf"); BeanUtilsBean bub = new BeanUtilsBean(); try { bub.copyProperties(accTfOinvf, pvpTfOinvf); } catch (IllegalAccessException e) { new ComponentException("???????"); } catch (InvocationTargetException e) { new ComponentException("???????"); } accTfOinvf.setLoanForm4("10"); accTfOinvf.setCla("10"); accTfOinvf.setBillNo(billNo); accTfOinvf.setAccountStatus("0"); accTfOinvf.setMainBrId(pvpTfOinvf.getInvestigatorBrId()); accTfOinvf.setLoanAmount(pvpTfOinvf.getApplyAmount()); accTfOinvf.setLoanBalance(pvpTfOinvf.getApplyAmount()); accTfOinvfAgent.insertAccTfOinvf(accTfOinvf); //???? AccTfComm accTfComm = new AccTfComm(); try { bub.copyProperties(accTfComm, accTfOinvf); } catch (IllegalAccessException e) { new ComponentException("?????"); } catch (InvocationTargetException e) { new ComponentException("?????"); } accTfComm.setLimitAccNo(accTfOinvf.getLimitAccNo()); accTfComm.setSendDate(this.getOpenDay()); try { accTfCommComponent.addAccTfComm(accTfComm); } catch (Exception e) { accTfCommComponent.updateDomain(accTfComm); } // pvpTfOinvf.setChargeoffStatus(Constant.PVPSTATUS3); pvpTfOinvf.setBillNo(billNo); pvpTfOinvfComponent.updatePvpTfOinvf(pvpTfOinvf); //????? ctrTfOinvfComponent.modifyCtrTfOinvf(ctrTfOinvf); // try { /*?? IndexedCollection icoll = cbqService.queryAccreditNotice4Trade(loanNo, connection, connection, context); KeyedCollection reqPkg = (KeyedCollection) icoll.get(0); String hostSerNo = (String) reqPkg.get("hostSerNo").toString().trim(); pvpAuthorize.setHostSerno(hostSerNo); pvpAuthorize.setTradeStatus(TradeCodeConstant.YTZ); pvpAuthorizeAgent.modifyCMISDomain(pvpAuthorize, "PvpAuthorize"); */ CreditBusinessQuartzService cbqService = new CreditBusinessQuartzService(); cbqService.queryAccreditNotice(connection, context); } catch (Exception e) { e.printStackTrace(); throw new ComponentException("?????" + e.getMessage()); } return strReturnMessage; }
From source file:com.yucheng.cmis.pvp.app.component.PvpAuthorizeComponent.java
/** * ??????????????//from w w w. j a v a 2s . c o m * * @param pvpSerno * ?? * @throws EMPException * @throws InvocationTargetException * @throws IllegalAccessException * @throws Exception * @since 2009-09-17 * @author modified by zhangwei */ public String addPvpTfLocExtAuthorize(String pvpSerno) throws EMPException, IllegalAccessException, InvocationTargetException { String strReturnMessage = CMISMessage.ADDDEFEAT; //?? PvpTfLocExtComponent pvpTfLocExtComponent = (PvpTfLocExtComponent) this .getComponent(PUBConstant.PVPTFLOCEXT); PvpTfLocExt pvpTfLocExt = pvpTfLocExtComponent.queryPvpTfLocExtBySerNo(pvpSerno); if (pvpTfLocExt == null || pvpTfLocExt.getContNo() == null) { return strReturnMessage; } //? AccTfCommComponent accTfCommComponent = (AccTfCommComponent) this.getComponent(PUBConstant.ACCTFCOMM); accTfCommComponent.checkConditionBeforeAuthorize("PvpTfLocExt", pvpSerno, pvpTfLocExt.getContNo()); CtrTfCvrgComponent ctrTfCvrgComponent = (CtrTfCvrgComponent) this.getComponent("CtrTfCvrg"); //AccTfLocComponent accTfLocComponent = (AccTfLocComponent) this.getComponent("AccTfLoc"); //AccTfLoc accTfLoc = accTfLocComponent.queryAccTfLocByIocNo(pvpTfLocExt.getIocNo()); //?? CustomIface customIface = (CustomIface) this.getComponentInterface(CusPubConstant.CUS_IFACE); CusBase cusBase = customIface.getCusBase(pvpTfLocExt.getCusId()); String transCusId = cusBase.getTransCusId(); //CMISSequenceService sequenceService = (CMISSequenceService) context.getService("sequenceService"); //String orgId = pvpTfOinvf.getInputBrId(); //billNo = sequenceService.getSequence(orgId, "fromOrg", 15, context); //String loanNo = sequenceService.getSequence("CZ", "fromDate", 15, context); //loanNo = loanNo.substring(2); //???1 = ???1 + ???1 // double securityMoneyAmtFin = pvpTfLocExt.getSecurityAmtFin(); double securityMoneyOld = pvpTfLocExt.getSecurityAmtOld(); //???1 double securitymoneyAmt = pvpTfLocExt.getSecurityMoneyAmt();//???1 double securityMoneyAmt = securitymoneyAmt; //???1 String smt = securityMoneyAmt + ""; if (securityMoneyAmt == 0) smt = ""; //???2 = ???2 + ???2 // double securityMoneyAmtFin1 = pvpTfLocExt.getSecurityAmtFin1(); double securityMoneyOld1 = pvpTfLocExt.getSecurityAmtOld1(); //???2 double securitymoneyAmt1 = pvpTfLocExt.getSecurityMoneyAmt1(); //???2 double securityMoneyAmt1 = securitymoneyAmt1;//???2 String smt1 = securityMoneyAmt1 + ""; if (securityMoneyAmt1 == 0) smt1 = ""; //??? Context context = this.getContext(); Connection connection = this.getConnection(); CMISSequenceService sequenceService = (CMISSequenceService) context.getService("sequenceService"); String loanNo = sequenceService.getSequence(TradeCodeConstant.SERNONC, "44", context, connection); //???? CtrTfLocExt ctrTfLocExt = null; CtrTfLocExtComponent ctrTfLocExtComponent = (CtrTfLocExtComponent) this.getComponent("CtrTfLocExt"); ctrTfLocExt = ctrTfLocExtComponent.queryCtrTfLocExtDetail(pvpTfLocExt.getContNo()); ctrTfLocExt.setBillSeq(1); //??? //??? String[] billZero = { "", "00", "0", "" }; int billSeqCtr = ctrTfLocExt.getBillSeq();//??????????????? String billSeq = String.valueOf(billSeqCtr); billSeq = billZero[billSeq.length()] + billSeq; String billNo = pvpTfLocExt.getContNo() + billSeq; // ??? ?????? //??? PvpAuthorize pvpAuthorize = new PvpAuthorize(); pvpAuthorize.setSerno(pvpSerno); pvpAuthorize.setLoanNo(loanNo); pvpAuthorize.setCusManager(pvpTfLocExt.getCusManager()); pvpAuthorize.setInputBrId(pvpTfLocExt.getInputBrId()); pvpAuthorize.setFinaBrId(pvpTfLocExt.getFinaBrId()); pvpAuthorize.setCusId(pvpTfLocExt.getCusId()); pvpAuthorize.setCusName(pvpTfLocExt.getCusName()); pvpAuthorize.setContNo(pvpTfLocExt.getContNo()); //pvpAuthorize.setBillNo(accTfLoc.getBillNo()); pvpAuthorize.setTradeAmount(pvpTfLocExt.getApplyAmount()); pvpAuthorize.setTradeDate(this.getOpenDay()); pvpAuthorize.setTradeStatus(TradeCodeConstant.WTZ); pvpAuthorize.setTradeCode("0024"); pvpAuthorize.setFieldNum(26); // pvpAuthorize.setFldvalue01("c@loanNo@" + loanNo); //? pvpAuthorize.setFldvalue02("c@contSerno@" + pvpTfLocExt.getBillNoOld()); //????(???) pvpAuthorize.setFldvalue03("c@contNo@" + pvpTfLocExt.getContNo()); //??? pvpAuthorize.setFldvalue04("c@cusId@" + pvpTfLocExt.getCusId()); //? pvpAuthorize.setFldvalue05("c@cusName@" + pvpTfLocExt.getCusName()); //?? pvpAuthorize.setFldvalue06("c@bizType@" + "0024"); //?? pvpAuthorize.setFldvalue07("c@CurType@" + pvpTfLocExt.getApplyCurType()); //??? pvpAuthorize.setFldvalue08("c@Amount@" + pvpTfLocExt.getApplyAmountFin()); //?--??? pvpAuthorize.setFldvalue09("c@startDate@" + (String) context.getDataValue("OPENDAY")); //(?) pvpAuthorize.setFldvalue10("c@dueDate@" + checkNull(pvpTfLocExt.getDueDate())); //? pvpAuthorize.setFldvalue11("c@note@" + ""); // pvpAuthorize.setFldvalue12("c@applyOrg@" + pvpTfLocExt.getFinaBrId()); // pvpAuthorize.setFldvalue13("c@inputDate@" + (String) context.getDataValue("OPENDAY")); // //? pvpAuthorize.setFldvalue14("c@iocNo@" + pvpTfLocExt.getIocNo()); //? pvpAuthorize.setFldvalue15("c@applyTerm@" + pvpTfLocExt.getApplyTerm()); //?? pvpAuthorize.setFldvalue16("c@securityMoneyRt@" + 100 * pvpTfLocExt.getSecurityMoneyRt()); //?? DecimalFormat df = new DecimalFormat("#0.00"); //??? List securitylist = ctrTfCvrgComponent.querySecurityByContNo(pvpTfLocExt.getContNo()); if (securitylist.size() == 0) { pvpAuthorize.setFldvalue17("c@securityMoneyAcNo@" + " "); //???1 pvpAuthorize.setFldvalue18("c@securityMoneyAmt@" + " "); //???1 pvpAuthorize.setFldvalue19("c@securityMoneyCur@" + " "); pvpAuthorize.setFldvalue20("c@securityMoneyType@" + " "); //???1 pvpAuthorize.setFldvalue21("c@securityMoneyDueDate@" + " "); pvpAuthorize.setFldvalue22("c@securityMoneyAcNo1@" + " "); //???2 pvpAuthorize.setFldvalue23("c@securityMoneyAmt1@" + " "); //???2 pvpAuthorize.setFldvalue24("c@securityMoneyCur1@" + " "); //????2 pvpAuthorize.setFldvalue25("c@securityMoneyType1@" + " "); //???1 pvpAuthorize.setFldvalue26("c@securityMoneyDueDate1@" + " "); //????2 } else if (securitylist.size() == 1) { TfSecurityMsg tfmsg = (TfSecurityMsg) securitylist.get(0); pvpAuthorize.setFldvalue17("c@securityMoneyAcNo@" + tfmsg.getSecurityMoneyAcNo()); pvpAuthorize.setFldvalue18("c@securityMoneyAmt@" + df.format(tfmsg.getSecurityMoneyAmt())); pvpAuthorize.setFldvalue19("c@securityMoneyCur@" + tfmsg.getSecurityMoneyCur()); pvpAuthorize.setFldvalue20("c@securityMoneyType@" + tfmsg.getSecurityMoneyType()); pvpAuthorize.setFldvalue21("c@securityMoneyDueDate@" + tfmsg.getSecurityMoneyDueDate()); pvpAuthorize.setFldvalue22("c@securityMoneyAcNo1@" + " "); pvpAuthorize.setFldvalue23("c@securityMoneyAmt1@" + " "); pvpAuthorize.setFldvalue24("c@securityMoneyCur1@" + " "); pvpAuthorize.setFldvalue25("c@securityMoneyType1@" + " "); pvpAuthorize.setFldvalue26("c@securityMoneyDueDate1@" + " "); //????2 } else if (securitylist.size() == 2) { TfSecurityMsg tfmsg = (TfSecurityMsg) securitylist.get(0); pvpAuthorize.setFldvalue17("c@securityMoneyAcNo@" + tfmsg.getSecurityMoneyAcNo()); pvpAuthorize.setFldvalue18("c@securityMoneyAmt@" + df.format(tfmsg.getSecurityMoneyAmt())); pvpAuthorize.setFldvalue19("c@securityMoneyCur@" + tfmsg.getSecurityMoneyCur()); pvpAuthorize.setFldvalue20("c@securityMoneyType@" + tfmsg.getSecurityMoneyType()); pvpAuthorize.setFldvalue21("c@securityMoneyDueDate@" + tfmsg.getSecurityMoneyDueDate()); TfSecurityMsg tfmsg2 = (TfSecurityMsg) securitylist.get(1); pvpAuthorize.setFldvalue22("c@securityMoneyAcNo1@" + tfmsg2.getSecurityMoneyAcNo()); pvpAuthorize.setFldvalue23("c@securityMoneyAmt1@" + df.format(tfmsg2.getSecurityMoneyAmt())); pvpAuthorize.setFldvalue24("c@securityMoneyCur1@" + tfmsg2.getSecurityMoneyCur()); pvpAuthorize.setFldvalue25("c@securityMoneyType1@" + tfmsg2.getSecurityMoneyType()); pvpAuthorize.setFldvalue26("c@securityMoneyDueDate1@" + tfmsg2.getSecurityMoneyDueDate()); //????2 } PvpAuthorizeAgent pvpAuthorizeAgent = (PvpAuthorizeAgent) this.getAgentInstance(PUBConstant.PVPAUTHORIZE); strReturnMessage = pvpAuthorizeAgent.insertPvpAuthorize(pvpAuthorize); if (!strReturnMessage.equals(CMISMessage.ADDSUCCEESS)) { System.out.println("???"); return strReturnMessage; } //???? AccTfLocExt accTfLocExt = new AccTfLocExt(); AccTfLocExtAgent accTfLocExtAgent = (AccTfLocExtAgent) this.getAgentInstance("AccTfLocExt"); BeanUtilsBean bub = new BeanUtilsBean(); try { bub.copyProperties(accTfLocExt, pvpTfLocExt); } catch (IllegalAccessException e) { new ComponentException("???????"); } catch (InvocationTargetException e) { new ComponentException("???????"); } accTfLocExt.setBillNo(billNo); accTfLocExt.setAccountStatus("0");// accTfLocExt.setMainBrId(pvpTfLocExt.getInvestigatorBrId()); accTfLocExtAgent.insertAccTfLocExt(accTfLocExt); //???? AccTfComm accTfComm = new AccTfComm(); try { bub.copyProperties(accTfComm, accTfLocExt); } catch (IllegalAccessException e) { new ComponentException("?????"); } catch (InvocationTargetException e) { new ComponentException("?????"); } accTfComm.setLimitAccNo(accTfLocExt.getLimitAccNo()); accTfComm.setApplyAmount(accTfLocExt.getApplyAmountFin());//????????? accTfComm.setLoanAmount(accTfLocExt.getApplyAmountFin());//?? try { accTfCommComponent.addAccTfComm(accTfComm); } catch (Exception e) { accTfCommComponent.updateDomain(accTfComm); } // pvpTfLocExt.setChargeoffStatus(Constant.PVPSTATUS3); pvpTfLocExt.setBillNo(billNo); pvpTfLocExtComponent.updatePvpTfLocExt(pvpTfLocExt); // try { /*?? IndexedCollection icoll = cbqService.queryAccreditNotice4Trade( loanNo, connection, connection, context); KeyedCollection reqPkg = (KeyedCollection) icoll.get(0); String hostSerNo = (String) reqPkg.get("hostSerNo").toString() .trim(); pvpAuthorize.setHostSerno(hostSerNo); pvpAuthorize.setTradeStatus(TradeCodeConstant.YTZ); pvpAuthorizeAgent.modifyCMISDomain(pvpAuthorize, "PvpAuthorize"); */ CreditBusinessQuartzService cbqService = new CreditBusinessQuartzService(); cbqService.queryAccreditNotice(connection, context); } catch (Exception e) { e.printStackTrace(); throw new ComponentException("???" + e.getMessage()); } return strReturnMessage; }
From source file:com.yucheng.cmis.pvp.app.component.PvpAuthorizeComponent.java
/** * ?????????????/*from ww w. j av a2 s. c o m*/ * * @param pvpSerno * ?? * @throws EMPException * @throws InvocationTargetException * @throws IllegalAccessException * @throws Exception * @since 2009-09-17 * @author modified by zhangwei */ public String addPvpTfRemitAuthorize(String pvpSerno) throws EMPException, IllegalAccessException, InvocationTargetException { String strReturnMessage = CMISMessage.ADDDEFEAT; //?? PvpTfRemitComponent pvpTfRemitComponent = (PvpTfRemitComponent) this.getComponent("PvpTfRemit"); PvpTfRemit pvpTfRemit = new PvpTfRemit(); pvpTfRemit = pvpTfRemitComponent.queryPvpTfRemit(pvpSerno); if (pvpTfRemit == null || pvpTfRemit.getContNo() == null) { System.out.println("???"); return strReturnMessage; } //?? CustomIface customIface = (CustomIface) this.getComponentInterface(CusPubConstant.CUS_IFACE); CusBase cusBase = customIface.getCusBase(pvpTfRemit.getCusId()); String transCusId = cusBase.getTransCusId(); //???? CtrTfRemit ctrTfRemit = null; CtrTfRemitComponent ctrTfRemitComponent = (CtrTfRemitComponent) this.getComponent("CtrTfRemit"); ctrTfRemit = ctrTfRemitComponent.queryCtrTfRemit(pvpTfRemit.getContNo()); //? AccTfCommComponent accTfCommComponent = (AccTfCommComponent) this.getComponent(PUBConstant.ACCTFCOMM); accTfCommComponent.checkConditionBeforeAuthorize("PvpTfRemit", pvpSerno, ctrTfRemit.getContNo()); //CMISSequenceService sequenceService = (CMISSequenceService) context.getService("sequenceService"); //String orgId = pvpTfOinvf.getInputBrId(); //billNo = sequenceService.getSequence(orgId, "fromOrg", 15, context); //String loanNo = sequenceService.getSequence("CZ", "fromDate", 15, context); //loanNo = loanNo.substring(2); //??? Context context = this.getContext(); Connection connection = this.getConnection(); CMISSequenceService sequenceService = (CMISSequenceService) context.getService("sequenceService"); String loanNo = sequenceService.getSequence(TradeCodeConstant.SERNONC, "44", context, connection); //??? String[] billZero = { "", "00", "0", "" }; int billSeqCtr = ctrTfRemit.getBillSeq(); String billSeq = String.valueOf(billSeqCtr); billSeq = billZero[billSeq.length()] + billSeq; String billNo = pvpTfRemit.getContNo() + billSeq; // ??? ?????? billSeqCtr++; ctrTfRemit.setBillSeq(billSeqCtr); //??? PvpAuthorize pvpAuthorize = new PvpAuthorize(); pvpAuthorize.setSerno(pvpSerno); pvpAuthorize.setLoanNo(loanNo); pvpAuthorize.setCusManager(pvpTfRemit.getCusManager()); pvpAuthorize.setInputBrId(pvpTfRemit.getInputBrId()); pvpAuthorize.setFinaBrId(pvpTfRemit.getFinaBrId()); pvpAuthorize.setCusId(pvpTfRemit.getCusId()); pvpAuthorize.setCusName(pvpTfRemit.getCusName()); pvpAuthorize.setContNo(pvpTfRemit.getContNo()); pvpAuthorize.setBillNo(billNo); pvpAuthorize.setTradeAmount(pvpTfRemit.getApplyAmount()); pvpAuthorize.setTradeDate(this.getOpenDay()); pvpAuthorize.setTradeStatus(TradeCodeConstant.WTZ); pvpAuthorize.setTradeCode("0023"); pvpAuthorize.setFieldNum(19); // pvpAuthorize.setFldvalue01("c@loanNo@" + loanNo); //? pvpAuthorize.setFldvalue02("c@contSerno@" + billNo); //???? pvpAuthorize.setFldvalue03("c@contNo@" + pvpTfRemit.getContNo()); //??? pvpAuthorize.setFldvalue04("c@cusId@" + pvpTfRemit.getCusId()); //? pvpAuthorize.setFldvalue05("c@cusName@" + pvpTfRemit.getCusName()); //?? pvpAuthorize.setFldvalue06("c@bizType@" + "0023"); //?? pvpAuthorize.setFldvalue07("c@CurType@" + pvpTfRemit.getApplyCurType()); //??? pvpAuthorize.setFldvalue08("c@Amount@" + pvpTfRemit.getApplyAmount()); //? pvpAuthorize.setFldvalue09("c@startDate@" + (String) context.getDataValue("OPENDAY")); //(?) pvpAuthorize.setFldvalue10("c@dueDate@" + checkNull(pvpTfRemit.getDueDate())); //? pvpAuthorize.setFldvalue11("c@note@" + ""); // pvpAuthorize.setFldvalue12("c@applyOrg@" + pvpTfRemit.getFinaBrId()); // pvpAuthorize.setFldvalue13("c@inputDate@" + (String) context.getDataValue("OPENDAY")); // //? DecimalFormat df = new DecimalFormat("#.000000"); pvpAuthorize.setFldvalue14("c@realityIrY@" + df.format(pvpTfRemit.getRealityIrY() * 100)); pvpAuthorize.setFldvalue15("c@remitType@" + "3"); pvpAuthorize.setFldvalue16("c@intCalType@" + pvpTfRemit.getIntCalType()); //?? pvpAuthorize.setFldvalue17("c@nvoiceNo@" + pvpTfRemit.getNvoiceNo()); pvpAuthorize.setFldvalue18("c@nvoiceCurType@" + pvpTfRemit.getNvoiceCur()); //pvpAuthorize.setFldvalue17("c@nvoiceCurType@" + "USD"); pvpAuthorize.setFldvalue19("c@nvoiceAmt@" + pvpTfRemit.getNvoiceAmt()); //?????,? modified by wxy 20110108 int appterm = 0; String dueDate; if (!this.getOpenDay().equals(pvpTfRemit.getStartDate())) { System.out.println("------------openday----" + this.getOpenDay()); appterm = (int) pvpTfRemit.getApplyTerm(); dueDate = TimeUtil.ADD_DAY(this.getOpenDay(), appterm); pvpTfRemit.setStartDate(this.getOpenDay()); pvpTfRemit.setDueDate(dueDate); pvpTfRemit.setStartDate(this.getOpenDay()); pvpTfRemit.setDueDate(dueDate); pvpAuthorize.setFldvalue10("c@dueDate@" + dueDate); } //?? PvpAuthorizeAgent pvpAuthorizeAgent = (PvpAuthorizeAgent) this.getAgentInstance(PUBConstant.PVPAUTHORIZE); strReturnMessage = pvpAuthorizeAgent.insertPvpAuthorize(pvpAuthorize); if (!strReturnMessage.equals(CMISMessage.ADDSUCCEESS)) { System.out.println("???"); return strReturnMessage; } //??? AccTfRemit accTfRemit = new AccTfRemit(); AccTfRemitAgent accTfRemitAgent = (AccTfRemitAgent) this.getAgentInstance("AccTfRemit"); BeanUtilsBean bub = new BeanUtilsBean(); try { bub.copyProperties(accTfRemit, pvpTfRemit); } catch (IllegalAccessException e) { new ComponentException("????"); } catch (InvocationTargetException e) { new ComponentException("????"); } accTfRemit.setLoanForm4("10"); accTfRemit.setCla("10"); accTfRemit.setBillNo(billNo); accTfRemit.setAccountStatus("0"); accTfRemit.setMainBrId(pvpTfRemit.getInvestigatorBrId()); accTfRemit.setLoanAmount(pvpTfRemit.getApplyAmount()); accTfRemit.setLoanBalance(pvpTfRemit.getApplyAmount()); accTfRemitAgent.insertAccTfRemit(accTfRemit); //???? AccTfComm accTfComm = new AccTfComm(); try { bub.copyProperties(accTfComm, accTfRemit); } catch (IllegalAccessException e) { new ComponentException("?????"); } catch (InvocationTargetException e) { new ComponentException("?????"); } accTfComm.setLimitAccNo(accTfRemit.getLimitAccNo()); accTfComm.setSendDate(this.getOpenDay()); try { accTfCommComponent.addAccTfComm(accTfComm); } catch (Exception e) { accTfCommComponent.updateDomain(accTfComm); } // pvpTfRemit.setChargeoffStatus(Constant.PVPSTATUS3); pvpTfRemit.setBillNo(billNo); pvpTfRemitComponent.updatePvpTfRemit(pvpTfRemit); //????? ctrTfRemitComponent.modifyCtrTfRemit(ctrTfRemit); // try { /*?? IndexedCollection icoll = cbqService.queryAccreditNotice4Trade( loanNo, connection, connection, context); KeyedCollection reqPkg = (KeyedCollection) icoll.get(0); String hostSerNo = (String) reqPkg.get("hostSerNo").toString() .trim(); pvpAuthorize.setHostSerno(hostSerNo); pvpAuthorize.setTradeStatus(TradeCodeConstant.YTZ); pvpAuthorizeAgent.modifyCMISDomain(pvpAuthorize, "PvpAuthorize"); */ CreditBusinessQuartzService cbqService = new CreditBusinessQuartzService(); cbqService.queryAccreditNotice(connection, context); } catch (Exception e) { e.printStackTrace(); throw new ComponentException("??" + e.getMessage()); } return strReturnMessage; }