List of usage examples for java.lang IllegalAccessException getMessage
public String getMessage()
From source file:com.yucheng.cmis.pvp.app.component.PvpAuthorizeComponent.java
/** * ??????????????/* 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 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 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 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
/** * ??????????????/* ww 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 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 ww . java 2 s .co 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; }
From source file:com.yucheng.cmis.pvp.app.component.PvpAuthorizeComponent.java
/** * ????????????????//from w w w . j a va 2 s . co 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
/** * ????????????????/* www. j ava 2s. co m*/ * * @param pvpSerno * ?? * @throws EMPException * @throws InvocationTargetException * @throws IllegalAccessException * @throws Exception * @since 2009-09-17 * @author modified by zhangwei */ public String addPvpTfOinsfAuthorize(String pvpSerno) throws EMPException, IllegalAccessException, InvocationTargetException { String strReturnMessage = CMISMessage.ADDDEFEAT;//?? //?? PvpTfOinsf pvpTfOinsf = new PvpTfOinsf(); PvpTfIface pvpTfIface = (PvpTfImpl) this.getComponentInterface("PvpTfImpl"); pvpTfOinsf = pvpTfIface.queryPvpTfOinsfBySerNo(pvpSerno); if (pvpTfOinsf == null || pvpTfOinsf.getContNo() == null) { System.out.println("?????"); return strReturnMessage; } //?? CustomIface customIface = (CustomIface) this.getComponentInterface(CusPubConstant.CUS_IFACE); AccTfCommComponent accTfCommComponent = (AccTfCommComponent) this.getComponent(PUBConstant.ACCTFCOMM); CusBase cusBase = customIface.getCusBase(pvpTfOinsf.getCusId()); String transCusId = cusBase.getTransCusId(); //???? CtrTfOinsf ctrTfOinsf = new CtrTfOinsf(); CtrTfLocImpl ctrTfLocImpl = (CtrTfLocImpl) this.getComponentInterface("CtrTfLoc"); ctrTfOinsf = ctrTfLocImpl.getCtrTfOinsf(pvpTfOinsf.getContNo()); if (ctrTfOinsf == null) { System.out.println("????????"); return strReturnMessage; } //???? accTfCommComponent.checkConditionBeforeAuthorize("PvpTfOinsf", pvpSerno, ctrTfOinsf.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 = ctrTfOinsf.getBillSeq(); String billSeq = String.valueOf(billSeqCtr); billSeq = billZero[billSeq.length()] + billSeq; String billNo = pvpTfOinsf.getContNo() + billSeq; // ??? ?????? billSeqCtr++; ctrTfOinsf.setBillSeq(billSeqCtr); //??? // ********************/ PvpAuthorize pvpAuthorize = new PvpAuthorize(); pvpAuthorize.setSerno(pvpSerno); //?? pvpAuthorize.setLoanNo(loanNo); //? pvpAuthorize.setCusManager(pvpTfOinsf.getCusManager()); //?? pvpAuthorize.setInputBrId(pvpTfOinsf.getInputBrId()); pvpAuthorize.setFinaBrId(pvpTfOinsf.getFinaBrId()); pvpAuthorize.setCusId(pvpTfOinsf.getCusId()); pvpAuthorize.setCusName(pvpTfOinsf.getCusName()); pvpAuthorize.setContNo(pvpTfOinsf.getContNo()); pvpAuthorize.setBillNo(billNo); //?? pvpAuthorize.setTradeAmount(pvpTfOinsf.getApplyAmount()); pvpAuthorize.setTradeDate(this.getOpenDay()); pvpAuthorize.setTradeStatus(TradeCodeConstant.WTZ); pvpAuthorize.setTradeCode("0018"); pvpAuthorize.setFieldNum(27); // pvpAuthorize.setFldvalue01("c@loanNo@" + loanNo); //? pvpAuthorize.setFldvalue02("c@contSerno@" + billNo); //???? pvpAuthorize.setFldvalue03("c@contNo@" + pvpTfOinsf.getContNo()); //??? pvpAuthorize.setFldvalue04("c@cusId@" + pvpTfOinsf.getCusId()); //? pvpAuthorize.setFldvalue05("c@cusName@" + pvpTfOinsf.getCusName()); //?? pvpAuthorize.setFldvalue06("c@bizType@" + "0018"); //?? pvpAuthorize.setFldvalue07("c@CurType@" + pvpTfOinsf.getApplyCurType()); //??? pvpAuthorize.setFldvalue08("c@Amount@" + pvpTfOinsf.getApplyAmount()); //? pvpAuthorize.setFldvalue09("c@startDate@" + (String) context.getDataValue("OPENDAY")); //(?) pvpAuthorize.setFldvalue10("c@dueDate@" + checkNull(pvpTfOinsf.getDueDate())); //?? pvpAuthorize.setFldvalue11("c@note@" + "???"); // pvpAuthorize.setFldvalue12("c@applyOrg@" + pvpTfOinsf.getFinaBrId()); // pvpAuthorize.setFldvalue13("c@inputDate@" + (String) context.getDataValue("OPENDAY")); // //? pvpAuthorize.setFldvalue14("c@oinsfNo@" + pvpTfOinsf.getOinsfNo()); pvpAuthorize.setFldvalue15("c@buyerId@" + pvpTfOinsf.getBuyerId()); pvpAuthorize.setFldvalue16("c@usedCrdRate@" + pvpTfOinsf.getUsedCrdRate()); pvpAuthorize.setFldvalue17( "c@avaCrdRate@" + String.valueOf(pvpTfOinsf.getAvaCrdRate() - pvpTfOinsf.getUsedCrdRate())); DecimalFormat df = new DecimalFormat("#.000000"); pvpAuthorize.setFldvalue18("c@realityIrY@" + df.format(pvpTfOinsf.getRealityIrY() * 100)); String sub = ""; if ("1".equals(pvpTfOinsf.getBizTypeSub())) { sub = "0"; } else if ("2".equals(pvpTfOinsf.getBizTypeSub())) { sub = "2"; } else if ("3".equals(pvpTfOinsf.getBizTypeSub())) { sub = "1"; } pvpAuthorize.setFldvalue19("c@bizTypeSub@" + sub); pvpAuthorize.setFldvalue20("c@enterAccount@" + pvpTfOinsf.getEnterAccount()); pvpAuthorize.setFldvalue21("c@ciNo@" + pvpTfOinsf.getCiNo()); pvpAuthorize.setFldvalue22("c@intCalType@" + pvpTfOinsf.getIntCalType()); String decNo = ""; if (pvpTfOinsf.getDecNo() != null) { decNo = pvpTfOinsf.getDecNo(); } String nvoiceNo = ""; if (pvpTfOinsf.getNvoiceNo() != null) { nvoiceNo = pvpTfOinsf.getNvoiceNo(); } pvpAuthorize.setFldvalue23("c@decNo@" + decNo); pvpAuthorize.setFldvalue24("c@nvoiceNo@" + nvoiceNo); pvpAuthorize.setFldvalue25("c@nvoiceCurType@" + pvpTfOinsf.getApplyCurType()); pvpAuthorize.setFldvalue26("c@nvoiceAmt@" + pvpTfOinsf.getNvoiceAmt()); pvpAuthorize.setFldvalue27("c@payTransferNo@" + pvpTfOinsf.getPayTransferContNo()); //pvpAuthorize.setFldvalue03("c@putoutSerialno@" + checkNull(loanNo)); //?????,? modified by wxy 20110108 int appterm = 0; String dueDate; if (!this.getOpenDay().equals(pvpTfOinsf.getStartDate())) { appterm = (int) pvpTfOinsf.getApplyTerm(); dueDate = TimeUtil.ADD_DAY(this.getOpenDay(), appterm); pvpTfOinsf.setStartDate(this.getOpenDay()); pvpTfOinsf.setDueDate(dueDate); //pvpTfIface.updatePvpTfOinsf(pvpTfOinsf); ctrTfOinsf.setStartDate(this.getOpenDay()); ctrTfOinsf.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; } //????? AccTfOinsf accTfOinsf = new AccTfOinsf(); AccTfOinsfAgent accTfOinsfAgent = (AccTfOinsfAgent) this.getAgentInstance(PUBConstant.ACCTFOINSF); BeanUtilsBean bub = new BeanUtilsBean(); try { bub.copyProperties(accTfOinsf, pvpTfOinsf); } catch (IllegalAccessException e) { new ComponentException("??????"); } catch (InvocationTargetException e) { new ComponentException("??????"); } accTfOinsf.setLoanForm4("10"); accTfOinsf.setCla("10"); accTfOinsf.setBillNo(billNo); accTfOinsf.setAccountStatus("0"); accTfOinsf.setMainBrId(pvpTfOinsf.getInvestigatorBrId()); accTfOinsf.setLoanAmount(pvpTfOinsf.getApplyAmount()); accTfOinsf.setLoanBalance(pvpTfOinsf.getApplyAmount()); accTfOinsfAgent.insertAccTfOinsf(accTfOinsf); //??? AccTfComm accTfComm = new AccTfComm(); try { bub.copyProperties(accTfComm, accTfOinsf); } catch (IllegalAccessException e) { new ComponentException("?????"); } catch (InvocationTargetException e) { new ComponentException("?????"); } accTfComm.setLimitAccNo(accTfOinsf.getLimitAccNo()); //??? accTfComm.setSendDate(this.getOpenDay()); try { accTfCommComponent.addAccTfComm(accTfComm); } catch (Exception e) { accTfCommComponent.updateDomain(accTfComm); } //?? pvpTfOinsf.setChargeoffStatus(Constant.PVPSTATUS3); pvpTfIface.updatePvpTfOinsf(pvpTfOinsf); //????? ctrTfLocImpl.modifyCtrTfOinsf(ctrTfOinsf); // 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
/** * ???????????????/*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 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 w w w . j a v a 2 s. c om*/ * * @param pvpSerno * ?? * @throws EMPException * @throws InvocationTargetException * @throws IllegalAccessException * @throws Exception * @author modified by zhangwei */ public String addPvpTfObcAuthorize(String pvpSerno) throws EMPException, IllegalAccessException, InvocationTargetException { String strReturnMessage = CMISMessage.ADDDEFEAT;// ?? PvpTfObcComponent pvpTfObcComponent = (PvpTfObcComponent) this.getComponent("PvpTfObc"); PvpAuthorizeAgent pvpAuthorizeAgent = (PvpAuthorizeAgent) this.getAgentInstance(PUBConstant.PVPAUTHORIZE); AccTfCommComponent accTfCommComponent = (AccTfCommComponent) this.getComponent(PUBConstant.ACCTFCOMM); PvpTfObc pvpTfObc = new PvpTfObc(); // ????? pvpTfObc = pvpTfObcComponent.queryPvpTfObc(pvpSerno); if (pvpTfObc == null || pvpTfObc.getContNo() == null) { System.out.println("??????"); return strReturnMessage; } // ?? //CustomIface customIface = (CustomIface) this.getComponentInterface(CusPubConstant.CUS_IFACE); //CusBase cusBase = customIface.getCusBase(pvpTfObc.getCusId()); // ? //String transCusId = cusBase.getTransCusId(); //???? CtrTfObc ctrTfObc = null; CtrTfObcComponent ctrTfObcComponent = (CtrTfObcComponent) this.getComponent("CtrTfObc"); ctrTfObc = ctrTfObcComponent.queryCtrTfObc(pvpTfObc.getContNo()); //? accTfCommComponent.checkConditionBeforeAuthorize("PvpTfObc", pvpSerno, ctrTfObc.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 = ctrTfObc.getBillSeq(); String billSeq = String.valueOf(billSeqCtr); billSeq = billZero[billSeq.length()] + billSeq; String billNo = pvpTfObc.getContNo() + billSeq; // ??? ?????? billSeqCtr++; ctrTfObc.setBillSeq(billSeqCtr); //???? PvpAuthorize pvpAuthorize = new PvpAuthorize(); pvpAuthorize.setTradeCode("0016"); // ? pvpAuthorize.setLoanNo(loanNo); // ?? pvpAuthorize.setContNo(billNo); // ??? pvpAuthorize.setContNo(pvpTfObc.getContNo()); // ??? pvpAuthorize.setCusId(pvpTfObc.getCusId()); // ? pvpAuthorize.setCusName(pvpTfObc.getCusName()); // ?? pvpAuthorize.setSerno(pvpSerno); // ?? pvpAuthorize.setCusManager(pvpTfObc.getCusManager()); // ? pvpAuthorize.setInputBrId(pvpTfObc.getInputBrId()); // ? pvpAuthorize.setFinaBrId(pvpTfObc.getFinaBrId()); // ? pvpAuthorize.setBillNo(billNo); // ?? if ("1".equals(pvpTfObc.getBizTypeSub())) {//1: 2: pvpAuthorize.setTradeAmount(pvpTfObc.getApplyAmount()); // ? } else { pvpAuthorize.setTradeAmount(pvpTfObc.getLocAmt()); // ? } pvpAuthorize.setTradeDate(this.getOpenDay()); // pvpAuthorize.setTradeStatus(TradeCodeConstant.WTZ); // ? pvpAuthorize.setFieldNum(18); // ? // pvpAuthorize.setFldvalue01("c@loanNo@" + loanNo); //? pvpAuthorize.setFldvalue02("c@contSerno@" + billNo); //???? pvpAuthorize.setFldvalue03("c@contNo@" + pvpTfObc.getContNo()); //??? pvpAuthorize.setFldvalue04("c@cusId@" + pvpTfObc.getCusId()); //? pvpAuthorize.setFldvalue05("c@cusName@" + pvpTfObc.getCusName()); //?? pvpAuthorize.setFldvalue06("c@bizType@" + "0016"); //?? pvpAuthorize.setFldvalue07("c@CurType@" + pvpTfObc.getLocCurType()); //??? if ("1".equals(pvpTfObc.getBizTypeSub())) {//1: 2: pvpAuthorize.setFldvalue08("c@Amount@" + pvpTfObc.getApplyAmount()); // ? } else { pvpAuthorize.setFldvalue08("c@Amount@" + pvpTfObc.getLocAmt()); // ? } //? pvpAuthorize.setFldvalue09("c@startDate@" + (String) context.getDataValue("OPENDAY")); //(?) pvpAuthorize.setFldvalue10("c@dueDate@" + pvpTfObc.getDueDate()); //?? pvpAuthorize.setFldvalue11("c@note@" + ""); // //pvpAuthorize.setFldvalue12("c@applyOrg@" + (String)context.getDataValue("S_organno")); // pvpAuthorize.setFldvalue12("c@applyOrg@" + pvpTfObc.getFinaBrId()); // pvpAuthorize.setFldvalue13("c@inputDate@" + (String) context.getDataValue("OPENDAY")); // //? pvpAuthorize.setFldvalue14("c@bpNo@" + pvpTfObc.getBpNo()); //? //pvpAuthorize.setFldvalue15("c@applyAmount@" + pvpTfObc.getApplyAmount()); //? DecimalFormat df = new DecimalFormat("#.000000"); pvpAuthorize.setFldvalue15("c@realityIrY@" + df.format(pvpTfObc.getRealityIrY() * 100)); // //pvpAuthorize.setFldvalue16("c@feeRate@" + df.format(pvpTfObc.getFeeRate()*100)); // String bizTypeSub = ""; if (pvpTfObc.getBizTypeSub().equals("1")) {// bizTypeSub = "0"; } else if (pvpTfObc.getBizTypeSub().equals("2")) {// bizTypeSub = "1"; } else { throw new ComponentException("[" + bizTypeSub + "]"); } pvpAuthorize.setFldvalue16("c@bizTypeSub@" + bizTypeSub); //? pvpAuthorize.setFldvalue17("c@entAccNo@" + pvpTfObc.getEntAccNo()); //?? pvpAuthorize.setFldvalue18("c@intCalType@" + pvpTfObc.getIntCalType()); //?? //?????,???, modified by wxy 20110108 int appterm = 0; String dueDate; if (!this.getOpenDay().equals(pvpTfObc.getStartDate())) { System.out.println("------------openday----" + this.getOpenDay()); appterm = (int) pvpTfObc.getApplyTerm(); dueDate = TimeUtil.ADD_DAY(this.getOpenDay(), appterm); pvpTfObc.setStartDate(this.getOpenDay()); pvpTfObc.setDueDate(dueDate); ctrTfObc.setStartDate(this.getOpenDay()); ctrTfObc.setDueDate(dueDate); pvpAuthorize.setFldvalue10("c@dueDate@" + dueDate); } // ??? strReturnMessage = pvpAuthorizeAgent.insertPvpAuthorize(pvpAuthorize); if (!strReturnMessage.equals(CMISMessage.ADDSUCCEESS)) { System.out.println("?/??"); return strReturnMessage; } // ???? AccTfObc accTfObc = new AccTfObc(); AccTfObcAgent accTfObcAgent = (AccTfObcAgent) this.getAgentInstance("AccTfObc"); BeanUtilsBean bub = new BeanUtilsBean(); System.err.println("pvpTfObc acpt_amt==" + pvpTfObc.getAcptAmt()); try { bub.copyProperties(accTfObc, pvpTfObc); } catch (IllegalAccessException e) { new ComponentException("???"); } catch (InvocationTargetException e) { new ComponentException("???"); } accTfObc.setLoanForm4("10"); accTfObc.setCla("10"); accTfObc.setBillNo(billNo); accTfObc.setAccountStatus("0"); accTfObc.setMainBrId(pvpTfObc.getInvestigatorBrId()); accTfObc.setLoanAmount(pvpTfObc.getApplyAmount()); accTfObc.setLoanBalance(pvpTfObc.getApplyAmount()); System.err.println("pvpTfObc acpt_amt==" + accTfObc.getAcptAmt()); accTfObcAgent.insertAccTfObc(accTfObc); // ?? AccTfComm accTfComm = new AccTfComm(); try { bub.copyProperties(accTfComm, accTfObc); } catch (IllegalAccessException e) { new ComponentException("????"); } catch (InvocationTargetException e) { new ComponentException("????"); } accTfComm.setLimitAccNo(accTfObc.getLimitAccNo()); accTfComm.setSendDate(this.getOpenDay()); try { accTfCommComponent.addAccTfComm(accTfComm); } catch (Exception e) { accTfCommComponent.updateDomain(accTfComm); } // ? pvpTfObc.setChargeoffStatus(Constant.PVPSTATUS3); pvpTfObc.setBillNo(billNo); pvpTfObcComponent.updatePvpTfObc(pvpTfObc); //????? ctrTfObcComponent.modifyCtrTfObc(ctrTfObc); /** ???? */ System.err.println("????"); 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; }