Example usage for java.lang IllegalAccessException printStackTrace

List of usage examples for java.lang IllegalAccessException printStackTrace

Introduction

In this page you can find the example usage for java.lang IllegalAccessException printStackTrace.

Prototype

public void printStackTrace() 

Source Link

Document

Prints this throwable and its backtrace to the standard error stream.

Usage

From source file:com.yucheng.cmis.pvp.app.component.PvpAuthorizeComponent.java

/**
 * ???????????????/*from  w w  w . j  av  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  www  . j  a  v  a 2  s  . 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  av a2  s.co 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 . j a va 2  s.c  om
 * 
 * @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 ava  2  s  .com
 * 
 * @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  ww .  j  av 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 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

/**
 * ???????????????/* w  w w .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
 */
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

/**
 * ???????? ????/* ww  w.j  a  va2  s  .c  o m*/
 * 
 * @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;
}

From source file:cn.jcenterhome.web.action.CpAction.java

public ActionForward cp_import(HttpServletRequest request, HttpServletResponse response) {
    Map<String, Object> sGlobal = (Map<String, Object>) request.getAttribute("sGlobal");
    Map<String, Object> sConfig = (Map<String, Object>) request.getAttribute("sConfig");
    if (!Common.checkPerm(request, response, "allowblog")) {
        MessageVO msgVO = Common.ckSpaceLog(request);
        if (msgVO != null) {
            return showMessage(request, response, msgVO);
        }/* w  w w.ja v a 2 s  .com*/
        return showMessage(request, response, "no_privilege");
    }
    if (!cpService.checkRealName(request, "blog")) {
        return showMessage(request, response, "no_privilege_realname");
    }
    if (!cpService.checkVideoPhoto(request, response, "blog")) {
        return showMessage(request, response, "no_privilege_videophoto");
    }
    switch (cpService.checkNewUser(request, response)) {
    case 1:
        break;
    case 2:
        return showMessage(request, response, "no_privilege_newusertime", "", 1,
                String.valueOf(sConfig.get("newusertime")));
    case 3:
        return showMessage(request, response, "no_privilege_avatar");
    case 4:
        return showMessage(request, response, "no_privilege_friendnum", "", 1,
                String.valueOf(sConfig.get("need_friendnum")));
    case 5:
        return showMessage(request, response, "no_privilege_email");
    }
    int waitTime = Common.checkInterval(request, response, "post");
    if (waitTime > 0) {
        return showMessage(request, response, "operating_too_fast", "", 1, String.valueOf(waitTime));
    }
    try {
        String siteUrl = Common.getSiteUrl(request);
        File userFile = new File(JavaCenterHome.jchRoot + "./data/temp/" + sGlobal.get("supe_uid") + ".data");
        if (submitCheck(request, "importsubmit")) {
            Map reward = Common.getReward("blogimport", false, 0, "", true, request, response);
            Map space = (Map) request.getAttribute("space");
            int spaceExperience = (Integer) space.get("experience");
            int spaceCredit = (Integer) space.get("credit");
            int rewardExperience = (Integer) reward.get("experience");
            int rewardCredit = (Integer) reward.get("credit");
            if (spaceExperience < rewardExperience) {
                return showMessage(request, response, "experience_inadequate", "", 1,
                        new String[] { String.valueOf(spaceExperience), String.valueOf(rewardExperience) });
            }
            if (spaceCredit < rewardCredit) {
                return showMessage(request, response, "integral_inadequate", "", 1,
                        new String[] { String.valueOf(spaceCredit), String.valueOf(rewardCredit) });
            }
            String url = request.getParameter("url").trim();
            Map urls = cpService.parseUrl(url);
            if (Common.empty(url) || urls.isEmpty()) {
                return showMessage(request, response, "url_is_not_correct");
            }
            XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
            config.setServerURL(new URL(url));
            XmlRpcClient client = new XmlRpcClient();
            client.setConfig(config);
            Vector params = new Vector();
            params.addElement("blog");
            params.addElement(
                    Common.sHtmlSpecialChars(Common.siconv(request.getParameter("username"), "utf-8", "", "")));
            params.addElement(Common.sHtmlSpecialChars(request.getParameter("password")));
            params.addElement(sConfig.get("importnum"));
            Object[] results = (Object[]) client.execute("metaWeblog.getRecentPosts", params);
            if (results == null || results.length == 0) {
                return showMessage(request, response, "blog_import_no_data", null, 1,
                        "<textarea name=\"tmp[]\" style=\"width:98%;\" rows=\"4\">no data</textarea>");
            }
            HashMap last = (HashMap) results[results.length - 1];
            if (last.containsKey("postid") == false) {
                return showMessage(request, response, "blog_import_no_data", null, 1,
                        Common.implode(last, ","));
            }
            PHPSerializer phpSerializer = new PHPSerializer(JavaCenterHome.JCH_CHARSET);
            FileHelper.writeFile(userFile, phpSerializer.serialize(results));
            request.setAttribute("results", results);
            request.setAttribute("incount", 0);
        } else if (submitCheck(request, "import2submit")) {
            ArrayList results = null;
            if (userFile.exists()) {
                String result = FileHelper.readFile(userFile);
                if (Common.empty(result) == false) {
                    PHPSerializer phpSerializer = new PHPSerializer(JavaCenterHome.JCH_CHARSET);
                    results = ((AssocArray) phpSerializer.unserialize(result)).toArrayList();
                }
            }
            String[] ids = request.getParameterValues("ids[]");
            if (Common.empty(results) || Common.empty(ids)) {
                return showMessage(request, response, "choose_at_least_one_log", "cp.jsp?ac=import");
            }
            int allCount = 0;
            int inCount = 0;
            ArrayList newResults = new ArrayList();
            for (int i = 0, size = results.size(); i < size; i++) {
                int key = i;
                allCount += 1;
                Map currBlog = ((AssocArray) results.get(i)).toHashMap();
                if (currBlog.get("dateCreated") instanceof Calendar) {
                    Calendar calendar = (Calendar) currBlog.get("dateCreated");
                    int dateline = (int) (calendar.getTimeInMillis() / 1000);
                    currBlog.put("dateCreated", Common.gmdate("yyyyMMdd'T'HH:mm:ss", dateline,
                            String.valueOf(sConfig.get("timeoffset"))));
                }
                if (Common.in_array(ids, key)) {
                    Map value = (Map) Common.sAddSlashes(currBlog);
                    int dateline = Common.strToTime(value.get("dateCreated").toString(),
                            String.valueOf(sConfig.get("timeoffset")), "yyyyMMdd'T'HH:mm:ss");
                    String subject = Common.getStr(value.get("title").toString(), 80, true, true, true, 0, 0,
                            request, response);
                    String message = value.containsKey("description") ? value.get("description").toString()
                            : value.get("content").toString();
                    message = Common.getStr(message, 0, true, true, true, 0, 1, request, response);
                    message = blogService.checkHtml(request, response, message);
                    if (Common.empty(subject) || Common.empty(message)) {
                        currBlog.put("status", "--");
                        currBlog.put("blogid", 0);
                        continue;
                    }
                    Map blogarr = new HashMap();
                    blogarr.put("uid", sGlobal.get("supe_uid"));
                    blogarr.put("username", sGlobal.get("supe_username"));
                    blogarr.put("subject", subject);
                    blogarr.put("pic", blogService.getMessagePic(message));
                    blogarr.put("dateline", dateline != 0 ? dateline : sGlobal.get("timestamp"));
                    int blogId = dataBaseService.insertTable("blog", blogarr, true, false);
                    Map fieldarr = new HashMap();
                    fieldarr.put("blogid", blogId);
                    fieldarr.put("uid", sGlobal.get("supe_uid"));
                    fieldarr.put("message", message);
                    fieldarr.put("postip", Common.getOnlineIP(request));
                    fieldarr.put("related", "");
                    fieldarr.put("target_ids", "");
                    fieldarr.put("hotuser", "");
                    dataBaseService.insertTable("blogfield", fieldarr, false, false);
                    inCount += 1;
                    currBlog.put("status", "OK");
                    currBlog.put("blogid", blogId);
                } else {
                    currBlog.put("status", "--");
                    currBlog.put("blogid", 0);
                }
                newResults.add(currBlog);
            }
            if (inCount != 0) {
                Common.getReward("blogimport", true, 0, "", true, request, response);
                userFile.delete();
            }
            request.setAttribute("results", newResults);
            request.setAttribute("incount", inCount);
        } else if (submitCheck(request, "resubmit")) {
            userFile.delete();
        }
        request.setAttribute("siteurl", siteUrl);
    } catch (XmlRpcException xre) {
        return showMessage(request, response, "blog_import_no_data", null, 1,
                "<textarea name=\"tmp[]\" style=\"width:98%;\" rows=\"4\">" + xre.code + ", " + xre.getMessage()
                        + "</textarea>");
    } catch (IllegalAccessException iace) {
        iace.printStackTrace();
    } catch (IllegalArgumentException iare) {
        iare.printStackTrace();
    } catch (InvocationTargetException ite) {
        ite.printStackTrace();
    } catch (Exception e) {
        e.printStackTrace();
        return showMessage(request, response, e.getMessage());
    }
    return include(request, response, sConfig, sGlobal, "cp_import.jsp");
}