From 5ba78261d8f9606d821c8bc1ea75ad215377541b Mon Sep 17 00:00:00 2001 From: lixuebo Date: Mon, 19 Aug 2019 17:58:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=B9=B3=E5=8F=B0=E4=B8=9A?= =?UTF-8?q?=E5=8A=A1=E7=94=B3=E8=AF=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WebContent/WEB-INF/etc/jbo/jbo_lease.xml | 2 + .../tenwa/doc/action/DocListInitAction.java | 4 +- .../flow/action/comm/FlowController.java | 2 +- .../commbusiness/PlatformDataToTemp.java | 312 ++++++++++-------- 4 files changed, 176 insertions(+), 144 deletions(-) diff --git a/WebContent/WEB-INF/etc/jbo/jbo_lease.xml b/WebContent/WEB-INF/etc/jbo/jbo_lease.xml index 0aeb8a158..0e74fc8a6 100644 --- a/WebContent/WEB-INF/etc/jbo/jbo_lease.xml +++ b/WebContent/WEB-INF/etc/jbo/jbo_lease.xml @@ -76,6 +76,7 @@ + @@ -218,6 +219,7 @@ + diff --git a/src_core/com/tenwa/doc/action/DocListInitAction.java b/src_core/com/tenwa/doc/action/DocListInitAction.java index 3747b5d02..77879dd6b 100644 --- a/src_core/com/tenwa/doc/action/DocListInitAction.java +++ b/src_core/com/tenwa/doc/action/DocListInitAction.java @@ -51,9 +51,7 @@ public class DocListInitAction { * @throws Exception */ @SuppressWarnings("unchecked") - public static synchronized void initDocList(Map param, - Map other, String docno, Configure curConfig) - throws Exception { + public static synchronized void initDocList(Map param,Map other, String docno, Configure curConfig)throws Exception { String CustomerType = other.get("CustomerType"); String[] itemnos = docno.split(","); String s = ""; diff --git a/src_sys/com/tenwa/flow/action/comm/FlowController.java b/src_sys/com/tenwa/flow/action/comm/FlowController.java index a2c5557ba..a877145ef 100644 --- a/src_sys/com/tenwa/flow/action/comm/FlowController.java +++ b/src_sys/com/tenwa/flow/action/comm/FlowController.java @@ -67,7 +67,7 @@ public class FlowController extends HttpServlet { throw new Exception( "ύʧ" ); } } - result = sResult.split("@")[1]; + result = sResult; } catch ( Exception e ) { e.printStackTrace(); result = "ERR-9999"; diff --git a/src_tenwa/com/tenwa/lease/flow/project/commbusiness/PlatformDataToTemp.java b/src_tenwa/com/tenwa/lease/flow/project/commbusiness/PlatformDataToTemp.java index e58e52d48..9c568508b 100644 --- a/src_tenwa/com/tenwa/lease/flow/project/commbusiness/PlatformDataToTemp.java +++ b/src_tenwa/com/tenwa/lease/flow/project/commbusiness/PlatformDataToTemp.java @@ -5,13 +5,10 @@ import java.text.SimpleDateFormat; import java.util.Date; import java.util.HashMap; import java.util.Map; - import org.apache.commons.lang3.time.DateUtils; - import jbo.app.tenwa.calc.LC_CALC_CONDITION_TEMP; import jbo.app.tenwa.customer.CUSTOMER_ACCOUNT_TEMP; import jbo.app.tenwa.customer.CUSTOMER_ADDRESS_TEMP; -import jbo.app.tenwa.customer.CUSTOMER_COMPANY_TEMP; import jbo.app.tenwa.customer.CUSTOMER_FAMILY_TEMP; import jbo.app.tenwa.customer.CUSTOMER_PERSON_TEMP; import jbo.com.tenwa.lease.comm.LB_GUARANTEE_UNIT_TEMP; @@ -19,12 +16,10 @@ import jbo.com.tenwa.lease.comm.LB_PROJECT_INFO_TEMP; import jbo.sys.PF_CALC_CONDITION; import jbo.sys.PF_CUSTOMER_ACCOUNT; import jbo.sys.PF_CUSTOMER_ADDRESS; -import jbo.sys.PF_CUSTOMER_COMPANY; import jbo.sys.PF_CUSTOMER_FAMILY; import jbo.sys.PF_CUSTOMER_PERSON; import jbo.sys.PF_GUARANTEE_UNIT; import jbo.sys.PF_PROJECT_INFO; - import com.amarsoft.app.als.sys.tools.DateUtil; import com.amarsoft.app.util.ProductParamUtil; import com.amarsoft.are.jbo.BizObject; @@ -56,178 +51,223 @@ public class PlatformDataToTemp extends BaseBussiness { String customerId = Sqlca.getString("SELECT customerid FROM customer_info_temp WHERE flowunid='"+flowunid+"'"); String projectId = this.getAttribute("ProjectId").toString(); String customerType = this.getAttribute("CustomerType").toString(); + String productId = this.getAttribute( "ProductId" ).toString(); + String planNumber = null; + String calType = "proj_process"; Map fromCondtion = new HashMap(); Map toCondtion = new HashMap(); + toCondtion.put("customerid",customerId); + toCondtion.put("flowunid",flowunid); + Map otherProperty = new HashMap(); - - int number = Integer.valueOf(Sqlca.getString("select count(1) from PF_CUSTOMER_ACCOUNT where flowunid='"+flowunid+"'")); - - //ж뻹޸룬û̱ţˮŲѯ޸̱ - fromCondtion.put("SERIAL",serial); - String sqlWhere = " SERIAL = '"+serial+"'"; - String bowhere ="SERIAL=:SERIAL"; - String boKey = "SERIAL"; - String boValue = serial; - if(number>0){ - fromCondtion.clear(); - fromCondtion.put("FLOWUNID",flowunid); - sqlWhere = " FLOWUNID = '"+flowunid+"'"; - bowhere ="FLOWUNID=:FLOWUNID"; - boKey = "FLOWUNID"; - boValue = flowunid; - } - /**ͬ˿żϢ*/ otherProperty.put("customerid",customerId); otherProperty.put("flowunid",flowunid); otherProperty.put("PROJECT_ID",projectId); - Sqlca.executeSQL(new SqlObject("delete from CUSTOMER_FAMILY_TEMP where flowunid='"+flowunid+"'")); - String sql = "select id from PF_CUSTOMER_FAMILY where "+sqlWhere; - ASResultSet res = Sqlca.getASResultSet(new SqlObject(sql)); - while(res.next()){ - fromCondtion.put("id",res.getString("id")); - DataOperatorUtil.copySingleJBO(PF_CUSTOMER_FAMILY.CLASS_NAME,fromCondtion,CUSTOMER_FAMILY_TEMP.CLASS_NAME,null,otherProperty,Sqlca); - } - res.close(); - fromCondtion.remove("id"); - /**Ȼ˿ͻסַϢ*/ - Sqlca.executeSQL(new SqlObject("delete from CUSTOMER_ADDRESS_TEMP where flowunid='"+flowunid+"'")); - String dressdetail = Sqlca.getString("select dressdetail from PF_CUSTOMER_ADDRESS where "+sqlWhere); - if(!"".equals(dressdetail)&&!"null".equals(dressdetail)){ - String province = Sqlca.getString("select province from PF_CUSTOMER_ADDRESS where "+sqlWhere); - String itemname = Sqlca.getString("select itemname from CODE_LIBRARY where codeno='AreaCode' and itemno='"+province+"'"); - otherProperty.remove("PROJECT_ID"); + int number = Integer.valueOf(Sqlca.getString("select count(1) from PF_CUSTOMER_ACCOUNT where flowunid='"+flowunid+"'")); + + String bowhere = null; + String boKey = null; + String boValue = null; + + /**жҵ뻹޸ҵ*/ + if(number==0){ + boKey="SERIAL"; + boValue=serial; + bowhere=boKey+"=:"+boKey; + }else{ + //޸ҵ + boKey="FLOWUNID"; + boValue=flowunid; + bowhere=boKey+"=:"+boKey; + } + + fromCondtion.put(boKey,boValue); + /**жϿͻ*/ + if("03".equals(customerType)){ + /**żϢ*/ + String marriage = Sqlca.getString("select MARRIAGE from PF_CUSTOMER_PERSON where SERIAL='"+serial+"'"); + /**жǷѻ*/ + if("01".equals(marriage)){ + fromCondtion.put("Spouse_","Y"); + toCondtion.put("Spouse_","Y"); + DataOperatorUtil.copySingleJBO(PF_CUSTOMER_FAMILY.CLASS_NAME,fromCondtion,CUSTOMER_FAMILY_TEMP.CLASS_NAME,toCondtion,otherProperty,Sqlca); + } + + /**ͬϢ*/ + fromCondtion.put("Spouse_","N"); + toCondtion.put("Spouse_","N"); + DataOperatorUtil.copySingleJBO(PF_CUSTOMER_FAMILY.CLASS_NAME,fromCondtion,CUSTOMER_FAMILY_TEMP.CLASS_NAME,toCondtion,otherProperty,Sqlca); + fromCondtion.remove("Spouse_"); + toCondtion.remove("Spouse_"); + + /**Ȼ˻Ϣ*/ + otherProperty.remove("PROJECT_ID"); + + otherProperty.put("CERTTYPE",this.getAttribute("certtype").toString()); + otherProperty.put("CERTID",this.getAttribute("certid").toString()); + otherProperty.put("INPUTUSERID",asUser.getUserID()); + otherProperty.put("INPUTORGID",asUser.getOrgID()); + otherProperty.put("inputtime",StringFunction.getTodayNow()); + otherProperty.put("FULLNAME",this.getAttribute("custname").toString()); + otherProperty.put("BALANCESHEET",""); + DataOperatorUtil.copySingleJBO(PF_CUSTOMER_PERSON.CLASS_NAME,fromCondtion,CUSTOMER_PERSON_TEMP.CLASS_NAME,toCondtion,otherProperty,Sqlca); + + /**Ȼ˿ͻסַϢ*/ + String dressdetail = Sqlca.getString("select dressdetail from PF_CUSTOMER_ADDRESS where "+boKey+"='"+boValue+"'"); + String itemname = Sqlca.getString("SELECT cl.itemname FROM PF_CUSTOMER_ADDRESS pca INNER JOIN CODE_LIBRARY cl ON pca.province=cl.itemno WHERE codeno='AreaCode' AND "+boKey+"='"+boValue+"'"); + otherProperty.clear(); + otherProperty.put("customerid",customerId); + otherProperty.put("flowunid",flowunid); otherProperty.put("addtype","0060"); otherProperty.put("isadd","yes"); otherProperty.put("isnew","yes"); otherProperty.put("country","CHN"); otherProperty.put("FULLADDRESS",itemname+dressdetail); - DataOperatorUtil.copySingleJBO(PF_CUSTOMER_ADDRESS.CLASS_NAME,fromCondtion,CUSTOMER_ADDRESS_TEMP.CLASS_NAME,null,otherProperty,Sqlca); - } - - /**ͻϢ*/ - otherProperty.clear(); - otherProperty.put("flowunid",flowunid); - otherProperty.put("customerid",customerId); - otherProperty.put("CERTTYPE",this.getAttribute("certtype").toString()); - otherProperty.put("CERTID",this.getAttribute("certid").toString()); - otherProperty.put("INPUTUSERID",asUser.getUserID()); - otherProperty.put("INPUTORGID",asUser.getOrgID()); - otherProperty.put("inputtime",StringFunction.getTodayNow()); - /**жϷ˿ͻȻ˿ͻ*/ - if("03".equals(customerType)){ - otherProperty.put("FULLNAME",this.getAttribute("custname").toString()); - otherProperty.put("BALANCESHEET",""); - Sqlca.executeSQL(new SqlObject("delete from CUSTOMER_PERSON_TEMP where flowunid='"+flowunid+"'")); - DataOperatorUtil.copySingleJBO(PF_CUSTOMER_PERSON.CLASS_NAME,fromCondtion,CUSTOMER_PERSON_TEMP.CLASS_NAME,null,otherProperty,Sqlca); + DataOperatorUtil.copySingleJBO(PF_CUSTOMER_ADDRESS.CLASS_NAME,fromCondtion,CUSTOMER_ADDRESS_TEMP.CLASS_NAME,toCondtion,otherProperty,Sqlca); }else{ - Sqlca.executeSQL(new SqlObject("delete from CUSTOMER_COMPANY_TEMP where flowunid='"+flowunid+"'")); + /**˿ͻϢ*/ + otherProperty.put("customerid",customerId); + otherProperty.put("flowunid",flowunid); + otherProperty.put("CERTTYPE",this.getAttribute("certtype").toString()); + otherProperty.put("CERTID",this.getAttribute("certid").toString()); + otherProperty.put("INPUTUSERID",asUser.getUserID()); + otherProperty.put("INPUTORGID",asUser.getOrgID()); + otherProperty.put("inputtime",StringFunction.getTodayNow()); otherProperty.put("company_name",this.getAttribute("custname").toString()); - DataOperatorUtil.copySingleJBO(PF_CUSTOMER_COMPANY.CLASS_NAME,fromCondtion,CUSTOMER_COMPANY_TEMP.CLASS_NAME,null,otherProperty,Sqlca); + DataOperatorUtil.copySingleJBO(PF_CUSTOMER_ADDRESS.CLASS_NAME,fromCondtion,CUSTOMER_ADDRESS_TEMP.CLASS_NAME,toCondtion,otherProperty,Sqlca); } - - /**ĿϢ*/ - BizObjectManager lpitBm = JBOFactory.getBizObjectManager(LB_PROJECT_INFO_TEMP.CLASS_NAME,Sqlca); - BizObject lpitBo = lpitBm.createQuery("flowunid=:flowunid").setParameter("flowunid",flowunid).getSingleResult(true); - BizObject ppiBo = JBOFactory.createBizObjectQuery(PF_PROJECT_INFO.CLASS_NAME,bowhere).setParameter(boKey,boValue).getSingleResult(false); - lpitBo.setAttributeValue("inputName",ppiBo.getAttribute("inputName").toString()); - lpitBo.setAttributeValue("inputTel",ppiBo.getAttribute("inputTel").toString()); - lpitBo.setAttributeValue("IS_NETCAR",ppiBo.getAttribute("IS_NETCAR").toString()); - if(!"0".equals(ppiBo.getAttribute("IS_NETCAR").toString())){ - lpitBo.setAttributeValue("IS_OPERATION",ppiBo.getAttribute("IS_OPERATION").toString()); - lpitBo.setAttributeValue("IS_AFFILIATED",ppiBo.getAttribute("IS_AFFILIATED").toString()); - lpitBo.setAttributeValue("IS_OPERATION_QUALIFICATION",ppiBo.getAttribute("IS_OPERATION_QUALIFICATION").toString()); - lpitBo.setAttributeValue("AFFILIATEDNAME",ppiBo.getAttribute("AFFILIATEDNAME").toString()); - lpitBo.setAttributeValue("TRANSPORTCERTID",ppiBo.getAttribute("TRANSPORTCERTID").toString()); - lpitBo.setAttributeValue("TRANSPORTDATE",ppiBo.getAttribute("TRANSPORTDATE").toString()); - lpitBo.setAttributeValue("NETCERTID",ppiBo.getAttribute("NETCERTID").toString()); - lpitBo.setAttributeValue("LEGALPERSONNAME",ppiBo.getAttribute("LEGALPERSONNAME").toString()); - lpitBo.setAttributeValue("LEGALPERSONID",ppiBo.getAttribute("LEGALPERSONID").toString()); - lpitBo.setAttributeValue("AFFILIATEDDATE",ppiBo.getAttribute("AFFILIATEDDATE").toString()); - lpitBo.setAttributeValue("AFFILIATEDENDDATE",ppiBo.getAttribute("AFFILIATEDENDDATE").toString()); - lpitBo.setAttributeValue("REGISTEREDMONEY",ppiBo.getAttribute("REGISTEREDMONEY").toString()); - lpitBo.setAttributeValue("AFFILIATEDACTUALADDRESS",ppiBo.getAttribute("AFFILIATEDACTUALADDRESS").toString()); - lpitBo.setAttributeValue("AFFILIATEDADDRESS",ppiBo.getAttribute("AFFILIATEDADDRESS").toString()); - } - lpitBm.saveObject(lpitBo); - - /**˿*/ - Sqlca.executeSQL(new SqlObject("delete from LB_GUARANTEE_UNIT_TEMP where flowunid='"+flowunid+"'")); + /**Ϣ*/ + Sqlca.executeSQL(new SqlObject("delete from PF_GUARANTEE_UNIT where flowunid='"+flowunid+"'")); otherProperty.clear(); - otherProperty.put("FLOWUNID",this.getAttribute("FlowUnid").toString()); - otherProperty.put("PROJECT_ID",this.getAttribute("ProjectId").toString()); - sql = "select id from PF_GUARANTEE_UNIT where "+sqlWhere; - res = Sqlca.getASResultSet(new SqlObject(sql)); + otherProperty.put("FLOWUNID",flowunid); + otherProperty.put("PROJECT_ID",projectId); + ASResultSet res = Sqlca.getASResultSet(new SqlObject("select id from PF_GUARANTEE_UNIT where "+boKey+"='"+boValue+"'")); while(res.next()){ fromCondtion.put("id",res.getString("id")); - DataOperatorUtil.copyJBOSet(PF_GUARANTEE_UNIT.CLASS_NAME,fromCondtion,LB_GUARANTEE_UNIT_TEMP.CLASS_NAME,null,otherProperty,null,Sqlca); + DataOperatorUtil.copySingleJBO(PF_GUARANTEE_UNIT.CLASS_NAME,fromCondtion,LB_GUARANTEE_UNIT_TEMP.CLASS_NAME,null,otherProperty,Sqlca); } res.close(); fromCondtion.remove("id"); /**ۿϢ*/ - Sqlca.executeSQL(new SqlObject("delete from CUSTOMER_ACCOUNT_TEMP where flowunid='"+flowunid+"'")); - otherProperty.clear(); - otherProperty.put("flowunid",flowunid); - otherProperty.put("customerid",customerId); - otherProperty.put("acc_info","Debit"); - otherProperty.put("acc_type","Debit"); - otherProperty.put("CUSTTYPE","lessee"); - DataOperatorUtil.copyJBOSet(PF_CUSTOMER_ACCOUNT.CLASS_NAME,fromCondtion,CUSTOMER_ACCOUNT_TEMP.CLASS_NAME,null,otherProperty,null,Sqlca); + BizObjectManager catBm = JBOFactory.getBizObjectManager(CUSTOMER_ACCOUNT_TEMP.CLASS_NAME,Sqlca); + BizObject catBo = catBm.createQuery("flowunid=:flowunid and customerid=:customerid").setParameter("flowunid",flowunid).setParameter("customerid",customerId).getSingleResult(true); + BizObject pcaBo = JBOFactory.createBizObjectQuery(PF_CUSTOMER_ACCOUNT.CLASS_NAME,bowhere).setParameter(boKey,boValue).getSingleResult(false); + if(catBo==null){ + catBo = catBm.newObject(); + catBo.setAttributeValue("flowunid",flowunid); + catBo.setAttributeValue("customerid",customerId); + catBo.setAttributeValue("acc_info","Debit"); + catBo.setAttributeValue("acc_type","Debit"); + catBo.setAttributeValue("CUSTTYPE","lessee"); + } + catBo.setAttributeValue("acc_number",pcaBo.getAttribute("acc_number")); + catBo.setAttributeValue("bank_name",pcaBo.getAttribute("bank_name")); + catBo.setAttributeValue("account",pcaBo.getAttribute("account")); + catBo.setAttributeValue("MOBILE",pcaBo.getAttribute("MOBILE")); + catBm.saveObject(catBo); - /***/ - Sqlca.executeSQL(new SqlObject("delete from LC_CALC_CONDITION_TEMP where flowunid='"+flowunid+"'")); - String calType = "proj_process"; - otherProperty.clear(); - otherProperty.put("FLOWUNID",this.getAttribute("FlowUnid").toString()); - String planNumber = SerialNumberUtil.getPlannumber(this.getAttribute("ProjectNo").toString(),calType,Sqlca); - otherProperty.put("PROJECT_PLAN_NUMBER", planNumber); - BizObject fcc = DataOperatorUtil.getSingleJBO(PF_CALC_CONDITION.CLASS_NAME,fromCondtion,Sqlca); + + /**ĿϢ*/ + BizObjectManager lpitBm = JBOFactory.getBizObjectManager(LB_PROJECT_INFO_TEMP.CLASS_NAME,Sqlca); + BizObject lpitBo = lpitBm.createQuery("flowunid=:flowunid").setParameter("flowunid",flowunid).getSingleResult(true); + BizObject ppiBo = JBOFactory.createBizObjectQuery(PF_PROJECT_INFO.CLASS_NAME,bowhere).setParameter(boKey,boValue).getSingleResult(false); + lpitBo.setAttributeValue("inputName",ppiBo.getAttribute("inputName")); + lpitBo.setAttributeValue("inputTel",ppiBo.getAttribute("inputTel")); + lpitBo.setAttributeValue("IS_NETCAR",ppiBo.getAttribute("IS_NETCAR")); + lpitBo.setAttributeValue("APPLICATION_NO",ppiBo.getAttribute("APPLICATION_NO")); + if(!"0".equals(ppiBo.getAttribute("IS_NETCAR").toString())){ + lpitBo.setAttributeValue("IS_OPERATION",ppiBo.getAttribute("IS_OPERATION")); + lpitBo.setAttributeValue("IS_AFFILIATED",ppiBo.getAttribute("IS_AFFILIATED")); + lpitBo.setAttributeValue("IS_OPERATION_QUALIFICATION",ppiBo.getAttribute("IS_OPERATION_QUALIFICATION").toString()); + lpitBo.setAttributeValue("AFFILIATEDNAME",ppiBo.getAttribute("AFFILIATEDNAME")); + lpitBo.setAttributeValue("TRANSPORTCERTID",ppiBo.getAttribute("TRANSPORTCERTID")); + lpitBo.setAttributeValue("TRANSPORTDATE",ppiBo.getAttribute("TRANSPORTDATE")); + lpitBo.setAttributeValue("NETCERTID",ppiBo.getAttribute("NETCERTID")); + lpitBo.setAttributeValue("LEGALPERSONNAME",ppiBo.getAttribute("LEGALPERSONNAME")); + lpitBo.setAttributeValue("LEGALPERSONID",ppiBo.getAttribute("LEGALPERSONID")); + lpitBo.setAttributeValue("AFFILIATEDDATE",ppiBo.getAttribute("AFFILIATEDDATE")); + lpitBo.setAttributeValue("AFFILIATEDENDDATE",ppiBo.getAttribute("AFFILIATEDENDDATE")); + lpitBo.setAttributeValue("REGISTEREDMONEY",ppiBo.getAttribute("REGISTEREDMONEY")); + lpitBo.setAttributeValue("AFFILIATEDACTUALADDRESS",ppiBo.getAttribute("AFFILIATEDACTUALADDRESS")); + lpitBo.setAttributeValue("AFFILIATEDADDRESS",ppiBo.getAttribute("AFFILIATEDADDRESS")); + } + lpitBm.saveObject(lpitBo); + + /***/ + BizObjectManager lcctBm = JBOFactory.getBizObjectManager(LC_CALC_CONDITION_TEMP.CLASS_NAME,Sqlca); + BizObject lcctBo = lcctBm.createQuery("flowunid=:flowunid").setParameter("flowunid",flowunid).getSingleResult(true); + BizObject pccBo = JBOFactory.createBizObjectQuery(PF_CALC_CONDITION.CLASS_NAME,bowhere).setParameter(boKey,boValue).getSingleResult(false); - String productId = this.getAttribute( "ProductId" ).toString(); - // ʶ - setCleanLeaseMoney( otherProperty, productId, fcc ); + if(lcctBo==null){ + lcctBo = lcctBm.newObject(); + } + + lcctBo.setAttributeValue("FLOWUNID",flowunid); + lcctBo.setAttributeValue("PROJECT_ID",projectId); + planNumber = SerialNumberUtil.getPlannumber(this.getAttribute("ProjectNo").toString(),calType,Sqlca); + lcctBo.setAttributeValue("PROJECT_PLAN_NUMBER",planNumber); // Ϣʽ - setProductAdjustRules( otherProperty, productId ); + setProductAdjustRules(otherProperty,productId); + lcctBo.setAttributeValue("ADJUST_TYPE",otherProperty.get("ADJUST_TYPE")); + lcctBo.setAttributeValue("ADJUST_STYLE",otherProperty.get("ADJUST_STYLE")); // Ͷ - String today = DateUtil.getToday(); - otherProperty.put( "LEASE_AMT_DATE", today ); - otherProperty.put( "START_DATE", today ); + lcctBo.setAttributeValue("LEASE_AMT_DATE",DateUtil.getToday()); + lcctBo.setAttributeValue("START_DATE",DateUtil.getToday()); // 㷽ʽ - otherProperty.put( "RENT_OR_RATE", "rate" ); + lcctBo.setAttributeValue("RENT_OR_RATE","rate"); // - setYearRate( otherProperty, productId ); + setYearRate(otherProperty,productId); + lcctBo.setAttributeValue("PERIOD_TYPE",otherProperty.get("PERIOD_TYPE")); + lcctBo.setAttributeValue("YEAR_RATE",otherProperty.get("YEAR_RATE")); // û - setIncomeNubmer( otherProperty, productId, fcc ); + lcctBo.setAttributeValue("INCOME_NUMBER_YEAR","income_12"); + lcctBo.setAttributeValue("INCOME_INTERVAL_MONTH","1"); + lcctBo.setAttributeValue("GPS_FEE",ProductParamUtil.getProductParameterValue(productId,"GPS_FEE","CostType08")); + //ʶ + lcctBo.setAttributeValue("CLEAN_LEASE_MONEY",setCleanLeaseMoney(pccBo,productId)); + lcctBo.setAttributeValue("LEASE_TERM",pccBo.getAttribute( "INCOME_NUMBER" )); // һڶ֧ - setFirstSecondPlan( otherProperty, productId, fcc ); - - DataOperatorUtil.copyJBOSet(PF_CALC_CONDITION.CLASS_NAME,fromCondtion,LC_CALC_CONDITION_TEMP.CLASS_NAME,null,otherProperty,null,Sqlca); - System.out.println( "=====================" + flowunid + "====================" ); - // Զ - autoCalc(flowunid,calType,planNumber,productId,Sqlca); + setFirstSecondPlan(otherProperty,productId,pccBo); + lcctBo.setAttributeValue("FIRST_PLAN_DATE",otherProperty.get("FIRST_PLAN_DATE")); + lcctBo.setAttributeValue("SECOND_PLAN_DATE",otherProperty.get("SECOND_PLAN_DATE")); + lcctBo.setAttributeValue("EQUIP_AMT",pccBo.getAttribute("EQUIP_AMT")); + lcctBo.setAttributeValue("FIRST_PAYMENT",pccBo.getAttribute("FIRST_PAYMENT")); + lcctBo.setAttributeValue("FINAL_PAYMENT",pccBo.getAttribute("FINAL_PAYMENT")); + lcctBo.setAttributeValue("NOMINAL_PRICE",pccBo.getAttribute("NOMINAL_PRICE")); + lcctBo.setAttributeValue("HANDLING_CHARGE_MONEY",pccBo.getAttribute("HANDLING_CHARGE_MONEY")); + lcctBo.setAttributeValue("CAUTION_MONEY",pccBo.getAttribute("CAUTION_MONEY")); + lcctBo.setAttributeValue("GPS_FEE_FINA",pccBo.getAttribute("GPS_FEE_FINA")); + lcctBo.setAttributeValue("PURCHASE_TAX",pccBo.getAttribute("PURCHASE_TAX")); + lcctBo.setAttributeValue("INSURANCE_PREMIUM",pccBo.getAttribute("INSURANCE_PREMIUM")); + lcctBo.setAttributeValue("SETTLE_METHOD",pccBo.getAttribute("SETTLE_METHOD")); + lcctBo.setAttributeValue("INCOME_NUMBER",pccBo.getAttribute("INCOME_NUMBER")); + lcctBo.setAttributeValue("DefaultDueDay",pccBo.getAttribute("DefaultDueDay")); + lcctBm.saveObject(lcctBo); + + // Զ + autoCalc(flowunid,calType,planNumber,productId,Sqlca); return "true"; } - public void setCleanLeaseMoney( Map otherProperty, String productId, BizObject fcc ) throws Exception { + public String setCleanLeaseMoney(BizObject fcc,String productId) throws Exception { String equipAmt = fcc.getAttribute( "EQUIP_AMT" ).toString(); String firstPayment = fcc.getAttribute( "FIRST_PAYMENT" ).toString(); - String gpsFee = fcc.getAttribute( "GPS_FEE" ).toString(); + String gpsFee = ProductParamUtil.getProductParameterValue(productId,"GPS_FEE","CostType08"); BigDecimal financingMoney = BigDecimal.ZERO; financingMoney = financingMoney.add( new BigDecimal( "".equals( gpsFee ) ? "0" : gpsFee ) ); // TODO - otherProperty.put( "CLEAN_LEASE_MONEY", - new BigDecimal( "".equals( equipAmt ) ? "0" : equipAmt ).subtract( - new BigDecimal( "".equals( firstPayment ) ? "0" : firstPayment ) ).add( financingMoney ).toString() ); + return new BigDecimal("".equals( equipAmt ) ? "0" : equipAmt ).subtract(new BigDecimal( "".equals( firstPayment ) ? "0" : firstPayment ) ).add( financingMoney ).toString(); } public void setProductAdjustRules( Map otherProperty, String productId ) throws Exception { - Map> map = ProductParamUtil.getProductComponentType( productId, "PRD0320" ); + Map> map = ProductParamUtil.getProductComponentType(productId,"PRD0320"); if ( map.containsKey( "ADJUST_INTEREST" ) ){ Map rule=map.get( "ADJUST_INTEREST" ); if ( null != rule.get( "rate_float_type" ) && null != rule.get( "adjust_style" ) ) { @@ -250,18 +290,10 @@ public class PlatformDataToTemp extends BaseBussiness { } } - public void setIncomeNubmer( Map otherProperty, String productId, BizObject fcc ) throws Exception { - otherProperty.put( "INCOME_NUMBER_YEAR", "income_12" ); - String incomeIntervalMonth = "1"; - otherProperty.put( "INCOME_INTERVAL_MONTH", incomeIntervalMonth ); - String incomeNumber = fcc.getAttribute( "INCOME_NUMBER" ).toString(); - otherProperty.put( "LEASE_TERM", Integer.parseInt( incomeNumber ) * Integer.parseInt( incomeIntervalMonth ) + "" ); - } - public void setFirstSecondPlan( Map otherProperty, String productId, BizObject fcc ) throws Exception { String periodType = otherProperty.get( "PERIOD_TYPE" ); - String leaseAmtDate = otherProperty.get( "LEASE_AMT_DATE" ); - String incomeIntervalMonth = otherProperty.get( "INCOME_INTERVAL_MONTH" ); + String leaseAmtDate = DateUtil.getToday(); + String incomeIntervalMonth = "1"; String defaultDueDay = fcc.getAttribute( "DefaultDueDay" ).toString(); SimpleDateFormat sdf = new SimpleDateFormat( "yyyy/MM/dd" ); Date lad = sdf.parse( leaseAmtDate );