diff --git a/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherContractTerminate.java b/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherContractTerminate.java new file mode 100644 index 000000000..8f3dffcb8 --- /dev/null +++ b/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherContractTerminate.java @@ -0,0 +1,127 @@ +package com.tenwa.voucher.CreateVoucherProcess; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import jbo.voucher.LV_VOUCHER_CONFIG; + +import com.amarsoft.are.jbo.BizObject; +import com.amarsoft.awe.util.Transaction; +import com.amarsoft.dict.als.cache.CacheLoaderFactory; +import com.tenwa.comm.util.jboutil.DataOperatorUtil; +import com.tenwa.voucher.serviceImp.CreateVoucherServiceImpl; + +public class CreateVoucherContractTerminate { + + public String CreateVoucher(String FlowUnid,String VOUCHERNO) throws Exception { + + Transaction Sqlca =null; + Map map=new HashMap(); + Map param=new HashMap(); + Sqlca = Transaction.createTransaction(CacheLoaderFactory.getDataSource()); + String MONEY=null; + String MONEYNOTAX=null; + String MONEYTAX=null; + String ACCOUNT_DATE=null; + String FACT_DATE=null; + String CONTRACT_ID=null; + String CONTRACT_NUMBER=null; + String PROJECT_NAME=null; + String leas_form=null; + String DISTRIBUTOR_ID=null; + String DISTRIBUTOR_NAME=null; + String CARID=null; + String CARMODEL=null; + String sql=""; + param.clear(); + map.put("FlowUnid", FlowUnid); + if("PZ2018072100000026".equals(VOUCHERNO)){ + sql= "SELECT IFNULL(HANDLING_CHARGE,0) AS MONEY ,ROUND(IFNULL(" + + "HANDLING_CHARGE,0)/1.06,2) AS MONEYNOTAX,(IFNULL(HANDLING_CHARGE,0)" + + "-ROUND(IFNULL(HANDLING_CHARGE,0)/1.06,2)) AS MONEYTAX,DATE_FORMAT(SYSDATE()" + + ",'%Y/%M/%D') AS ACCOUNT_DATE,DATE_FORMAT(SYSDATE(),'%Y/%M/%D') AS " + + "FACT_DATE,LCI.ID,LCI.CONTRACT_NUMBER,LCI.PROJECT_NAME,LCI.LEAS_FORM," + + "LCI.DISTRIBUTOR_ID,DI.DISTRIBUTOR_NAME FROM LC_FUND_RENT_ADJUST_TEMP LFRA" + + " INNER JOIN LC_CALC_CONDITION LCC ON LCC.PAYMENT_NUMBER=LFRA.PAYMENT_NUMBER " + + "INNER JOIN LB_CONTRACT_INFO LCI ON LCC.CONTRACT_ID=LCI.ID INNER JOIN " + + "DISTRIBUTOR_INFO DI ON DI.DISTRIBUTOR_NO=LCI.DISTRIBUTOR_ID WHERE " + + "LFRA.FLOWUNID=:FLOWUNID"; + } + if("PZ2018072100000027".equals(VOUCHERNO)){ + sql= "SELECT IFNULL(CORPUS_OVERAGE,0) AS MONEY ,0 AS MONEYNOTAX,0 AS MONEYTAX," + + "DATE_FORMAT(SYSDATE(),'%Y/%M/%D') AS ACCOUNT_DATE,DATE_FORMAT(SYSDATE()," + + "'%Y/%M/%D') AS FACT_DATE,LCI.ID,LCI.CONTRACT_NUMBER,LCI.PROJECT_NAME,LCI." + + "LEAS_FORM,LCI.DISTRIBUTOR_ID,DI.DISTRIBUTOR_NAME FROM " + + "LC_FUND_RENT_ADJUST_TEMP LFRA INNER JOIN LC_CALC_CONDITION LCC ON LCC." + + "PAYMENT_NUMBER=LFRA.PAYMENT_NUMBER INNER JOIN LB_CONTRACT_INFO LCI ON " + + "LCC.CONTRACT_ID=LCI.ID INNER JOIN DISTRIBUTOR_INFO DI ON DI.DISTRIBUTOR_NO" + + "=LCI.DISTRIBUTOR_ID WHERE LFRA.FLOWUNID=:FLOWUNID"; + } + + if("PZ2018072100000045".equals(VOUCHERNO)){ + sql="SELECT IFNULL(AGREED_INTEREST,0) AS MONEY ,0 AS MONEYNOTAX,0 AS MONEYTAX," + + "DATE_FORMAT(SYSDATE(),'%Y/%M/%D') AS ACCOUNT_DATE,DATE_FORMAT(SYSDATE()" + + ",'%Y/%M/%D') AS FACT_DATE,LCI.ID,LCI.CONTRACT_NUMBER,LCI.PROJECT_NAME," + + "LCI.LEAS_FORM,LCI.DISTRIBUTOR_ID,DI.DISTRIBUTOR_NAME FROM " + + "LC_FUND_RENT_ADJUST_TEMP LFRA INNER JOIN LC_CALC_CONDITION LCC ON " + + "LCC.PAYMENT_NUMBER=LFRA.PAYMENT_NUMBER INNER JOIN LB_CONTRACT_INFO LCI " + + "ON LCC.CONTRACT_ID=LCI.ID INNER JOIN DISTRIBUTOR_INFO DI ON DI." + + "DISTRIBUTOR_NO=LCI.DISTRIBUTOR_ID WHERE LFRA.FLOWUNID=:FLOWUNID"; + } + List> dataList=DataOperatorUtil.getDataBySql(Sqlca, sql, map); + + CreateVoucherServiceImpl vs=new CreateVoucherServiceImpl(); + String VOUCHER_TYPE="1";// 凭证分类 金蝶 + String userid ="admin"; + for (int i=0;i0){ + MONEYNOTAX=dataList.get(i).get("MONEYNOTAX").toString(); + MONEYTAX=dataList.get(i).get("MONEYTAX").toString(); + ACCOUNT_DATE=dataList.get(i).get("ACCOUNT_DATE").toString(); + FACT_DATE =dataList.get(i).get("FACT_DATE").toString(); + CONTRACT_ID=dataList.get(i).get("CONTRACT_ID").toString(); + CONTRACT_NUMBER=dataList.get(i).get("CONTRACT_NUMBER").toString(); + PROJECT_NAME=dataList.get(i).get("PROJECT_NAME").toString(); + leas_form=dataList.get(i).get("LEAS_FORM").toString(); + DISTRIBUTOR_ID=dataList.get(i).get("DISTRIBUTOR_ID"); + DISTRIBUTOR_NAME=dataList.get(i).get("DISTRIBUTOR_NAME"); + //CARID=dataList.get(i).get("CARID"); + //CARMODEL=dataList.get(i).get("MODEL"); + + param.put("FACT_MONEY",MONEY); + param.put("INTERESTNOTAX",MONEYNOTAX); + param.put("TAX",MONEYTAX); + param.put("ACCOUNT_DATE",ACCOUNT_DATE); + param.put("FACT_DATE",FACT_DATE); + param.put("CONTRACT_ID",CONTRACT_ID); + param.put("CONTRACT_NUMBER",CONTRACT_NUMBER); + param.put("PROJECT_NAME",PROJECT_NAME); + param.put("LEAS_FORM",leas_form); + param.put("DISTRIBUTOR_ID",DISTRIBUTOR_ID); + param.put("DISTRIBUTOR_NAME",DISTRIBUTOR_NAME); + //param.put("CARID",CARID); + //param.put("CARMODEL",CARMODEL); + + param.put("FlowUnid", FlowUnid); + map.clear(); + map.put("PROJ_TYPE", leas_form); + map.put("VOUCHER_NO", VOUCHERNO); + BizObject vouch=DataOperatorUtil.getSingleJBO(LV_VOUCHER_CONFIG.CLASS_NAME, map, Sqlca); + + if(vouch!=null){ + vs.createVoucher(vouch.getAttribute("MODULAR_NUMBER").getString(), vouch.getAttribute("OWNED_COMPANY").getString(), leas_form, VOUCHER_TYPE, userid,param, Sqlca); + }} + } + + if(Sqlca!=null){ + Sqlca.commit(); + } + + String sMessage="true"; + return sMessage; + } +} diff --git a/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherCustCautionMoneyIncome.java b/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherCustCautionMoneyIncome.java index 8e8655ae4..bc99dfb40 100644 --- a/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherCustCautionMoneyIncome.java +++ b/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherCustCautionMoneyIncome.java @@ -8,19 +8,22 @@ import jbo.voucher.LV_VOUCHER_CONFIG; import com.amarsoft.are.jbo.BizObject; import com.amarsoft.awe.util.Transaction; +import com.amarsoft.dict.als.cache.CacheLoaderFactory; import com.tenwa.comm.util.jboutil.DataOperatorUtil; import com.tenwa.flow.baseBussion.BaseBussiness; import com.tenwa.voucher.serviceImp.CreateVoucherServiceImpl; public class CreateVoucherCustCautionMoneyIncome extends BaseBussiness{ - @Override - public Object run(Transaction Sqlca) throws Exception { - this.initBussinessParam(Sqlca); + public String CreateVoucher(String FlowUnid,String VOUCHERNO,String FeeType) throws Exception { + + Transaction Sqlca =null; Map map=new HashMap(); Map param=new HashMap(); - + Sqlca = Transaction.createTransaction(CacheLoaderFactory.getDataSource()); String MONEY=null; + String MONEYNOTAX=null; + String MONEYTAX=null; String ACCOUNT_DATE=null; String FACT_DATE=null; String CONTRACT_ID=null; @@ -31,15 +34,12 @@ public class CreateVoucherCustCautionMoneyIncome extends BaseBussiness{ String DISTRIBUTOR_NAME=null; String CARID=null; String CARMODEL=null; - String FlowUnid=this.getAttribute("FlowUnid").toString(); String sql=""; - String VOUCHERNO=this.getAttribute("VoucherNo").toString(); - String FeeType=this.getAttribute("FeeType").toString(); param.clear(); map.put("FlowUnid", FlowUnid); map.put("FEE_TYPE", FeeType); - - sql= "SELECT LFIT.FACT_MONEY AS MONEY,DATE_FORMAT(SYSDATE(),'%Y/%m/%d') " + sql= "SELECT LFIT.FACT_MONEY AS MONEY,LFIT.FACT_MONEY/1.06 AS MONEYNOTAX," + + "(LFIT.FACT_MONEY-LFIT.FACT_MONEY/1.06) AS MONEYTAX,DATE_FORMAT(SYSDATE(),'%Y/%m/%d') " + "AS ACCOUNT_DATE,DATE_FORMAT(SYSDATE(),'%Y/%m/%d') AS FACT_DATE," + "LFIT.CONTRACT_ID,LCI.CONTRACT_NUMBER,LCI.PROJECT_NAME,LCI.LEAS_FORM," + "LCI.DISTRIBUTOR_ID,DI.DISTRIBUTOR_NAME,LEC.ID AS CARID,LEC.MODEL " @@ -49,6 +49,7 @@ public class CreateVoucherCustCautionMoneyIncome extends BaseBussiness{ + "LEC ON LEC.CONTRACT_ID=LCI.ID WHERE LFIT.FEE_TYPE=:FEE_TYPE " + "AND LFIT.FLOWUNID=:FLOWUNID "; + List> dataList=DataOperatorUtil.getDataBySql(Sqlca, sql, map); CreateVoucherServiceImpl vs=new CreateVoucherServiceImpl(); @@ -59,6 +60,8 @@ public class CreateVoucherCustCautionMoneyIncome extends BaseBussiness{ if("".equals(MONEY)||MONEY==null) MONEY="0.00"; double mon=Double.parseDouble(MONEY); if(mon>0){ + MONEYNOTAX=dataList.get(i).get("MONEYNOTAX").toString(); + MONEYTAX=dataList.get(i).get("MONEYTAX").toString(); ACCOUNT_DATE=dataList.get(i).get("ACCOUNT_DATE").toString(); FACT_DATE =dataList.get(i).get("FACT_DATE").toString(); CONTRACT_ID=dataList.get(i).get("CONTRACT_ID").toString(); @@ -71,6 +74,8 @@ public class CreateVoucherCustCautionMoneyIncome extends BaseBussiness{ CARMODEL=dataList.get(i).get("MODEL"); param.put("FACT_MONEY",MONEY); + param.put("INTERESTNOTAX",MONEYNOTAX); + param.put("TAX",MONEYTAX); param.put("ACCOUNT_DATE",ACCOUNT_DATE); param.put("FACT_DATE",FACT_DATE); param.put("CONTRACT_ID",CONTRACT_ID); @@ -93,7 +98,6 @@ public class CreateVoucherCustCautionMoneyIncome extends BaseBussiness{ }} } - if(Sqlca!=null){ Sqlca.commit(); } diff --git a/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherCustomerRentOrFee.java b/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherCustomerRentOrFee.java index dc87a0b7f..e79ad33a3 100644 --- a/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherCustomerRentOrFee.java +++ b/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherCustomerRentOrFee.java @@ -8,18 +8,20 @@ import jbo.voucher.LV_VOUCHER_CONFIG; import com.amarsoft.are.jbo.BizObject; import com.amarsoft.awe.util.Transaction; +import com.amarsoft.dict.als.cache.CacheLoaderFactory; import com.tenwa.comm.util.jboutil.DataOperatorUtil; import com.tenwa.flow.baseBussion.BaseBussiness; import com.tenwa.voucher.serviceImp.CreateVoucherServiceImpl; public class CreateVoucherCustomerRentOrFee extends BaseBussiness{ - @Override - public Object run(Transaction Sqlca) throws Exception { - this.initBussinessParam(Sqlca); +public String CreateVoucher(String FlowUnid,String VOUCHERNO) throws Exception { + + Transaction Sqlca =null; + //this.initBussinessParam(Sqlca); Map map=new HashMap(); Map param=new HashMap(); - + Sqlca = Transaction.createTransaction(CacheLoaderFactory.getDataSource()); String EQUIP_AMT=null; String FIRST_PAYMENT=null; String CLEAN_LEASE_MONEY=null; @@ -40,9 +42,9 @@ public class CreateVoucherCustomerRentOrFee extends BaseBussiness{ String DISTRIBUTOR_NAME=null; String CARID=null; String CARMODEL=null; - String FlowUnid=this.getAttribute("FlowUnid").toString(); + //String FlowUnid=this.getAttribute("FlowUnid").toString(); //String VOUCHERNO="PZ2018071000000005"; - String VOUCHERNO=this.getAttribute("VoucherNo").toString(); + //String VOUCHERNO=this.getAttribute("VoucherNo").toString(); String sql="SELECT LCCT.EQUIP_AMT,LCCT.FIRST_PAYMENT,LCCT.CLEAN_LEASE_MONEY," + "LCCT.INSURANCE_PREMIUM,LCCT.PURCHASE_TAX,LCCT.INCIDENTAL," + "LCCT.GPS_FEE_FINANCE,LRPT.INTEREST,LRPT.INTERESTNOTAX,LRPT.TAX," diff --git a/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherDistCautionMoneyRe.java b/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherDistCautionMoneyRe.java index df85ffb1a..9f78b8f0d 100644 --- a/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherDistCautionMoneyRe.java +++ b/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherDistCautionMoneyRe.java @@ -8,6 +8,7 @@ import jbo.voucher.LV_VOUCHER_CONFIG; import com.amarsoft.are.jbo.BizObject; import com.amarsoft.awe.util.Transaction; +import com.amarsoft.dict.als.cache.CacheLoaderFactory; import com.tenwa.comm.util.jboutil.DataOperatorUtil; import com.tenwa.flow.baseBussion.BaseBussiness; import com.tenwa.voucher.serviceImp.CreateVoucherServiceImpl; @@ -18,30 +19,37 @@ import com.tenwa.voucher.serviceImp.CreateVoucherServiceImpl; */ public class CreateVoucherDistCautionMoneyRe extends BaseBussiness{ - @Override - public Object run(Transaction Sqlca) throws Exception { - this.initBussinessParam(Sqlca); +public String CreateVoucher(String FlowUnid,String VOUCHERNO) throws Exception { + + Transaction Sqlca =null; + //this.initBussinessParam(Sqlca); Map map=new HashMap(); Map param=new HashMap(); - + Sqlca = Transaction.createTransaction(CacheLoaderFactory.getDataSource()); String MONEY=null; String ACCOUNT_DATE=null; String FACT_DATE=null; String leas_form=null; String DISTRIBUTOR_ID=null; String DISTRIBUTOR_NAME=null; - String FlowUnid=this.getAttribute("FlowUnid").toString(); String sql=""; - String VOUCHERNO=this.getAttribute("VoucherNo").toString(); param.clear(); - map.put("FlowUnid", FlowUnid); - + map.put("FLOWUNID", FlowUnid); + if("PZ2018071100000011".equals(VOUCHERNO)){ sql= "SELECT DDIT.CAUTION_MONEY,DATE_FORMAT(SYSDATE(),'%Y/%m/%d') " + "AS ACCOUNT_DATE,DATE_FORMAT(SYSDATE(),'%Y/%m/%d') AS FACT_DATE," + "DDIT.REFUND_PERSON,DIF.DISTRIBUTOR_NO,DIF.DISTRIBUTOR_NAME FROM D_DEPOSITRETURN_INFO_TEMP" + " DDIT LEFT JOIN DISTRIBUTOR_INFO DIF ON DIF.ID=DIF.DISTRIBUTOR_ID " + "WHERE DDIT.FLOWUNID=:FLOWUNID"; - + } + if("PZ2018072100000032".equals(VOUCHERNO)){ + sql= "SELECT DDIT.CAUTION_MONEY,DATE_FORMAT(SYSDATE(),'%Y/%m/%d')" + + " AS ACCOUNT_DATE,DATE_FORMAT(SYSDATE(),'%Y/%m/%d') " + + "AS FACT_DATE,DDIT.payer,DIF.DISTRIBUTOR_NO," + + "DIF.DISTRIBUTOR_NAME FROM D_DEPOSITCHARGE_INFO_TEMP " + + "DDIT LEFT JOIN DISTRIBUTOR_INFO DIF ON " + + "DIF.ID=DDIT.DISTRIBUTOR_ID WHERE DDIT.FLOWUNID=:FLOWUNID"; + } List> dataList=DataOperatorUtil.getDataBySql(Sqlca, sql, map); CreateVoucherServiceImpl vs=new CreateVoucherServiceImpl(); diff --git a/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherHandlingMoney.java b/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherHandlingMoney.java index 1f94ea702..d4323704a 100644 --- a/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherHandlingMoney.java +++ b/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherHandlingMoney.java @@ -8,18 +8,20 @@ import jbo.voucher.LV_VOUCHER_CONFIG; import com.amarsoft.are.jbo.BizObject; import com.amarsoft.awe.util.Transaction; +import com.amarsoft.dict.als.cache.CacheLoaderFactory; import com.tenwa.comm.util.jboutil.DataOperatorUtil; import com.tenwa.flow.baseBussion.BaseBussiness; import com.tenwa.voucher.serviceImp.CreateVoucherServiceImpl; public class CreateVoucherHandlingMoney extends BaseBussiness{ - @Override - public Object run(Transaction Sqlca) throws Exception { - this.initBussinessParam(Sqlca); +public String CreateVoucher(String FlowUnid,String VOUCHERNO) throws Exception { + + Transaction Sqlca =null; + //this.initBussinessParam(Sqlca); Map map=new HashMap(); Map param=new HashMap(); - + Sqlca = Transaction.createTransaction(CacheLoaderFactory.getDataSource()); String MONEY=null; String MONEYNOTAX=null; String MONEYTAX=null; @@ -33,9 +35,9 @@ public class CreateVoucherHandlingMoney extends BaseBussiness{ String DISTRIBUTOR_NAME=null; String CARID=null; String CARMODEL=null; - String FlowUnid=this.getAttribute("FlowUnid").toString(); + //String FlowUnid=this.getAttribute("FlowUnid").toString(); String sql=""; - String VOUCHERNO=this.getAttribute("VoucherNo").toString(); + //String VOUCHERNO=this.getAttribute("VoucherNo").toString(); param.clear(); map.put("FlowUnid", FlowUnid); sql= "SELECT LCCT.HANDLING_CHARGE_MONEY AS MONEY,LCCT.HANDLING_CHARGE_MONEY/1.06 " diff --git a/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherMethodSettle/ContractOnhireVoucher.java b/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherMethodSettle/ContractOnhireVoucher.java index 54abed9ba..9702a7fad 100644 --- a/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherMethodSettle/ContractOnhireVoucher.java +++ b/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherMethodSettle/ContractOnhireVoucher.java @@ -2,6 +2,10 @@ package com.tenwa.voucher.CreateVoucherProcess.CreateVoucherMethodSettle; import com.amarsoft.awe.util.Transaction; import com.tenwa.flow.baseBussion.BaseBussiness; +import com.tenwa.voucher.CreateVoucherProcess.CreateVoucherCustCautionMoneyIncome; +import com.tenwa.voucher.CreateVoucherProcess.CreateVoucherCustomerRentOrFee; +import com.tenwa.voucher.CreateVoucherProcess.CreateVoucherHandlingMoney; +import com.tenwa.voucher.CreateVoucherProcess.CreateVoucherLoanDistributor; public class ContractOnhireVoucher extends BaseBussiness { @@ -9,10 +13,23 @@ public class ContractOnhireVoucher extends BaseBussiness { public Object run(Transaction Sqlca) throws Exception { this.initBussinessParam(Sqlca); String FlowUnid=this.getAttribute("FlowUnid").toString(); + CreateVoucherLoanDistributor cvld=new CreateVoucherLoanDistributor(); + cvld.CreateVoucher(FlowUnid, "PZ2018070900000002");//记录给经销商放款-车款全款 + cvld.CreateVoucher(FlowUnid, "PZ2018070900000003");//经销商支付的预付款(首付) + cvld.CreateVoucher(FlowUnid, "PZ2018070900000004");//记录保证金(合同结束后要退回给客户,或者冲抵其他款项) + cvld.CreateVoucher(FlowUnid, "PZ2018071000000006");//给经销商放款冲抵客户保证金 + CreateVoucherCustomerRentOrFee cvcr=new CreateVoucherCustomerRentOrFee(); + cvcr.CreateVoucher(FlowUnid, "PZ2018071000000005");//客户支付的应收账款总金额 + CreateVoucherHandlingMoney cvhl=new CreateVoucherHandlingMoney(); + cvhl.CreateVoucher(FlowUnid, "PZ2018071000000007");//给经销商放款冲抵确认手续费收入(一次性确认收入) + cvhl.CreateVoucher(FlowUnid, "PZ2018071000000009");//给经销商放款冲抵确认收到手续费(按月分摊收入) - return null; + CreateVoucherCustCautionMoneyIncome cvci=new CreateVoucherCustCautionMoneyIncome(); + cvci.CreateVoucher(FlowUnid, "PZ2018071100000010", "feetype10");//给经销商放款-车款及其他绑定款项 + + return "true"; } } diff --git a/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherMethodSettle/ContractTerminate.java b/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherMethodSettle/ContractTerminate.java new file mode 100644 index 000000000..7030708ec --- /dev/null +++ b/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherMethodSettle/ContractTerminate.java @@ -0,0 +1,20 @@ +package com.tenwa.voucher.CreateVoucherProcess.CreateVoucherMethodSettle; + +import com.amarsoft.awe.util.Transaction; +import com.tenwa.flow.baseBussion.BaseBussiness; +import com.tenwa.voucher.CreateVoucherProcess.CreateVoucherContractTerminate; + +public class ContractTerminate extends BaseBussiness { + + @Override + public Object run(Transaction Sqlca) throws Exception { + this.initBussinessParam(Sqlca); + String FlowUnid=this.getAttribute("FlowUnid").toString(); + + CreateVoucherContractTerminate cvct=new CreateVoucherContractTerminate(); + cvct.CreateVoucher(FlowUnid, "PZ2018072100000026");//收到违约金 + cvct.CreateVoucher(FlowUnid, "PZ2018072100000027");//收到提前还款 + + return ""; + } +} diff --git a/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherMethodSettle/DistributorCautionMoneyVoucher.java b/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherMethodSettle/DistributorCautionMoneyVoucher.java new file mode 100644 index 000000000..ab787f048 --- /dev/null +++ b/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherMethodSettle/DistributorCautionMoneyVoucher.java @@ -0,0 +1,19 @@ +package com.tenwa.voucher.CreateVoucherProcess.CreateVoucherMethodSettle; + +import com.amarsoft.awe.util.Transaction; +import com.tenwa.flow.baseBussion.BaseBussiness; +import com.tenwa.voucher.CreateVoucherProcess.CreateVoucherDistCautionMoneyRe; + +public class DistributorCautionMoneyVoucher extends BaseBussiness { + + @Override + public Object run(Transaction Sqlca) throws Exception { + this.initBussinessParam(Sqlca); + String FlowUnid=this.getAttribute("FlowUnid").toString(); + + CreateVoucherDistCautionMoneyRe cvdc=new CreateVoucherDistCautionMoneyRe(); + cvdc.CreateVoucher(FlowUnid, "PZ2018071100000011");//退回经销商保证金 + return "true"; + } + +} diff --git a/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherMethodSettle/IncomeVoucher.java b/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherMethodSettle/IncomeVoucher.java new file mode 100644 index 000000000..9c5885384 --- /dev/null +++ b/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherMethodSettle/IncomeVoucher.java @@ -0,0 +1,28 @@ +package com.tenwa.voucher.CreateVoucherProcess.CreateVoucherMethodSettle; + +import com.amarsoft.awe.util.Transaction; +import com.tenwa.flow.baseBussion.BaseBussiness; +import com.tenwa.voucher.CreateVoucherProcess.CreateVoucherCustCautionMoneyIncome; +import com.tenwa.voucher.CreateVoucherProcess.CreateVoucherRentIncome; + +public class IncomeVoucher extends BaseBussiness { + + @Override + public Object run(Transaction Sqlca) throws Exception { + this.initBussinessParam(Sqlca); + String FlowUnid=this.getAttribute("FlowUnid").toString(); + + CreateVoucherCustCautionMoneyIncome cvci=new CreateVoucherCustCautionMoneyIncome(); + cvci.CreateVoucher(FlowUnid, "PZ2018071100000012", "feetype2");//收到客户保证金 + cvci.CreateVoucher(FlowUnid, "PZ2018072100000023", "feetype1");//按月分摊的保证金 + cvci.CreateVoucher(FlowUnid, "PZ2018072100000031", "feetype4");//都到留购价款 + + CreateVoucherRentIncome cvri=new CreateVoucherRentIncome(); + cvri.CreateVoucher(FlowUnid, "PZ2018072100000024");//收到租金 + cvri.CreateVoucher(FlowUnid, "PZ2018072100000025");//收到逾期利息 + + + return "true"; + } + +} diff --git a/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherRentIncome.java b/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherRentIncome.java new file mode 100644 index 000000000..825047542 --- /dev/null +++ b/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherRentIncome.java @@ -0,0 +1,108 @@ +package com.tenwa.voucher.CreateVoucherProcess; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import jbo.voucher.LV_VOUCHER_CONFIG; + +import com.amarsoft.are.jbo.BizObject; +import com.amarsoft.awe.util.Transaction; +import com.amarsoft.dict.als.cache.CacheLoaderFactory; +import com.tenwa.comm.util.jboutil.DataOperatorUtil; +import com.tenwa.voucher.serviceImp.CreateVoucherServiceImpl; + +public class CreateVoucherRentIncome { + + public String CreateVoucher(String FlowUnid,String VOUCHERNO) throws Exception { + + Transaction Sqlca =null; + Map map=new HashMap(); + Map param=new HashMap(); + Sqlca = Transaction.createTransaction(CacheLoaderFactory.getDataSource()); + String MONEY=null; + String ACCOUNT_DATE=null; + String FACT_DATE=null; + String CONTRACT_ID=null; + String CONTRACT_NUMBER=null; + String PROJECT_NAME=null; + String leas_form=null; + String DISTRIBUTOR_ID=null; + String DISTRIBUTOR_NAME=null; + String CARID=null; + String CARMODEL=null; + String sql=""; + param.clear(); + map.put("FlowUnid", FlowUnid); + if("PZ2018072100000024".equals(VOUCHERNO)){ + sql= "SELECT LrIT.rent AS MONEY,DATE_FORMAT(SYSDATE(),'%Y/%m/%d') " + + "AS ACCOUNT_DATE,DATE_FORMAT(SYSDATE(),'%Y/%m/%d') AS FACT_DATE," + + "LrIT.CONTRACT_ID,LCI.CONTRACT_NUMBER,LCI.PROJECT_NAME,LCI.LEAS_FORM," + + "LCI.DISTRIBUTOR_ID,DI.DISTRIBUTOR_NAME,LrIT.FLOWUNID FROM " + + "LC_rent_INCOME_TEMP LrIT LEFT JOIN LB_CONTRACT_INFO LCI ON " + + "LrIT.CONTRACT_ID=LCI.ID LEFT JOIN DISTRIBUTOR_INFO DI ON " + + "DI.DISTRIBUTOR_NO=LCI.DISTRIBUTOR_ID LEFT JOIN LB_EQUIPMENT_CAR " + + "LEC ON LEC.CONTRACT_ID=LCI.ID WHERE LrIT.FLOWUNID=:FLOWUNID "; + } + if("PZ2018072100000025".equals(VOUCHERNO)){ + sql= "SELECT LrIT.penalty AS MONEY,DATE_FORMAT(SYSDATE(),'%Y/%m/%d') " + + "AS ACCOUNT_DATE,DATE_FORMAT(SYSDATE(),'%Y/%m/%d') AS FACT_DATE," + + "LrIT.CONTRACT_ID,LCI.CONTRACT_NUMBER,LCI.PROJECT_NAME,LCI.LEAS_FORM," + + "LCI.DISTRIBUTOR_ID,DI.DISTRIBUTOR_NAME,LrIT.FLOWUNID FROM " + + "LC_rent_INCOME_TEMP LrIT LEFT JOIN LB_CONTRACT_INFO LCI ON " + + "LrIT.CONTRACT_ID=LCI.ID LEFT JOIN DISTRIBUTOR_INFO DI ON " + + "DI.DISTRIBUTOR_NO=LCI.DISTRIBUTOR_ID LEFT JOIN LB_EQUIPMENT_CAR " + + "LEC ON LEC.CONTRACT_ID=LCI.ID WHERE LrIT.FLOWUNID=:FLOWUNID "; + } + List> dataList=DataOperatorUtil.getDataBySql(Sqlca, sql, map); + + CreateVoucherServiceImpl vs=new CreateVoucherServiceImpl(); + String VOUCHER_TYPE="1";// 凭证分类 金蝶 + String userid ="admin"; + for (int i=0;i0){ + ACCOUNT_DATE=dataList.get(i).get("ACCOUNT_DATE").toString(); + FACT_DATE =dataList.get(i).get("FACT_DATE").toString(); + CONTRACT_ID=dataList.get(i).get("CONTRACT_ID").toString(); + CONTRACT_NUMBER=dataList.get(i).get("CONTRACT_NUMBER").toString(); + PROJECT_NAME=dataList.get(i).get("PROJECT_NAME").toString(); + leas_form=dataList.get(i).get("LEAS_FORM").toString(); + DISTRIBUTOR_ID=dataList.get(i).get("DISTRIBUTOR_ID"); + DISTRIBUTOR_NAME=dataList.get(i).get("DISTRIBUTOR_NAME"); + CARID=dataList.get(i).get("CARID"); + CARMODEL=dataList.get(i).get("MODEL"); + + param.put("FACT_MONEY",MONEY); + param.put("ACCOUNT_DATE",ACCOUNT_DATE); + param.put("FACT_DATE",FACT_DATE); + param.put("CONTRACT_ID",CONTRACT_ID); + param.put("CONTRACT_NUMBER",CONTRACT_NUMBER); + param.put("PROJECT_NAME",PROJECT_NAME); + param.put("LEAS_FORM",leas_form); + param.put("DISTRIBUTOR_ID",DISTRIBUTOR_ID); + param.put("DISTRIBUTOR_NAME",DISTRIBUTOR_NAME); + param.put("CARID",CARID); + param.put("CARMODEL",CARMODEL); + + param.put("FlowUnid", FlowUnid); + map.clear(); + map.put("PROJ_TYPE", leas_form); + map.put("VOUCHER_NO", VOUCHERNO); + BizObject vouch=DataOperatorUtil.getSingleJBO(LV_VOUCHER_CONFIG.CLASS_NAME, map, Sqlca); + + if(vouch!=null){ + vs.createVoucher(vouch.getAttribute("MODULAR_NUMBER").getString(), vouch.getAttribute("OWNED_COMPANY").getString(), leas_form, VOUCHER_TYPE, userid,param, Sqlca); + }} + } + + if(Sqlca!=null){ + Sqlca.commit(); + } + + String sMessage="true"; + return sMessage; + } +}