diff --git a/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherBackDealerMargin.java b/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherBackDealerMargin.java new file mode 100644 index 000000000..ee5830bea --- /dev/null +++ b/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherBackDealerMargin.java @@ -0,0 +1,98 @@ +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.tenwa.comm.util.jboutil.DataOperatorUtil; +import com.tenwa.flow.baseBussion.BaseBussiness; +import com.tenwa.voucher.serviceImp.CreateVoucherServiceImpl; + +public class CreateVoucherBackDealerMargin extends BaseBussiness{ + @Override + public Object run(Transaction Sqlca) throws Exception { + this.initBussinessParam(Sqlca); + Map map=new HashMap(); + Map param=new HashMap(); + + 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 ORGNAME=null; + String ORGID=null; + String MONEY=null; + String ACCOUNTNO=null; + String CUSTOMERID=null; + String CUSTOMERNAME=null; + String FlowUnid=this.getAttribute("FlowUnid").toString(); + param.clear(); + map.put("FlowUnid", FlowUnid); + map.put("FEE_TYPE", "feetype5"); + String sql= + " SELECT LFIT.FACT_MONEY AS MONEY,LFIT.ACCOUNTING_DATE AS ACCOUNT_DATE, " + +" LFIT.FACT_DATE,LFIT.CONTRACT_ID,LCI.CONTRACT_NUMBER, " + +" LCI.PROJECT_NAME,LCI.LEAS_FORM,IFNULL(LFIT.acc_number,'000000000000000') as ACCOUNTNO, " + +" ORG.ORGNAME,ORG.ORGID,LESS.CUSTOMER_ID as CUSTOMERID,LESS.CUSTOMER_NAME AS CUSTOMERNAME " + +" FROM LC_FUND_INCOME_TEMP LFIT " + +" LEFT JOIN LB_CONTRACT_INFO LCI ON LFIT.CONTRACT_ID=LCI.ID " + +" LEFT JOIN ORG_INFO ORG ON ORG.ORGID=LCI.PROJECT_DEPT " + +" LEFT JOIN LB_UNION_LESSEE LESS ON LESS.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(); + String VOUCHER_TYPE="1";// 凭证分类 金蝶 + String userid ="admin"; + for (int i=0;i map=new HashMap(); + Map param=new HashMap(); + 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 ORGNAME=null; + String ORGID=null; + //String MONEY=null; + String f10=null; + String f20=null; + String f21=null; + String f23=null; + String f24=null; + String ACCOUNTNO=null; + String DISTRIBUTORID=null; + String DISTRIBUTORNAME=null; + String FlowUnid=this.getAttribute("FlowUnid").toString(); + param.clear(); + map.put("FlowUnid", FlowUnid); + + String sql= + " SELECT SUM(CASE WHEN LFIT.FEE_TYPE='feetype10' THEN LFIT.FACT_MONEY ELSE 0 END) AS f10, " + +" SUM(CASE WHEN LFIT.FEE_TYPE='feetype20' THEN LFIT.FACT_MONEY ELSE 0 END) AS f20, " + +" SUM(CASE WHEN LFIT.FEE_TYPE='feetype21' THEN LFIT.FACT_MONEY ELSE 0 END) AS f21, " + +" SUM(CASE WHEN LFIT.FEE_TYPE='feetype24' THEN LFIT.FACT_MONEY ELSE 0 END) AS f24, " + +" SUM(CASE WHEN LFIT.FEE_TYPE='feetype23' THEN LFIT.FACT_MONEY ELSE 0 END) AS f23, " + +" MAX(LFIT.FEE_TYPE) AS FEE_TYPE,MAX(LFIT.ACCOUNTING_DATE) AS ACCOUNT_DATE, " + +" MAX(LFIT.FACT_DATE) AS FACT_DATE,MAX(LFIT.CONTRACT_ID) AS CONTRACT_ID,MAX(LCI.CONTRACT_NUMBER) AS CONTRACT_NUMBER, " + +" MAX(LCI.PROJECT_NAME) AS PROJECT_NAME,MAX(LCI.LEAS_FORM) AS LEAS_FORM,IFNULL(MAX(LFIT.acc_number),'000000000000000') AS ACCOUNTNO, " + +" MAX(ORG.ORGNAME) AS ORGNAME,MAX(ORG.ORGID) AS ORGID,MAX(LCI.DISTRIBUTOR_ID) AS DISTRIBUTORID,MAX(DI.DISTRIBUTOR_NAME) AS DISTRIBUTORNAME " + +" FROM LC_FUND_INCOME_TEMP LFIT " + +" LEFT JOIN LB_CONTRACT_INFO LCI ON LFIT.CONTRACT_ID=LCI.ID " + +" LEFT JOIN ORG_INFO ORG ON ORG.ORGID=LCI.PROJECT_DEPT " + +" LEFT JOIN DISTRIBUTOR_INFO DI ON DI.ID=LCI.DISTRIBUTOR_ID " + +" where LFIT.FEE_TYPE in ('feetype10','feetype20','feetype21','feetype24','feetype23') and LFIT.FLOWUNID=:FlowUnid GROUP BY LFIT.FLOWUNID"; + List> dataList=DataOperatorUtil.getDataBySql(Sqlca, sql, map); + + CreateVoucherServiceImpl vs=new CreateVoucherServiceImpl(); + String VOUCHER_TYPE="1";// 凭证分类 金蝶 + String userid ="admin"; + for (int i=0;i getJavaParam(JBOTransaction tx, + Map param) throws BusinessException { + MapreturnValue=new HashMap(); + returnValue.putAll(param); + //f10:车款-首付款 + returnValue.put("MONEY",param.get("f10")); + return returnValue; + } + +} diff --git a/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherLoan/AccountPayMargin.java b/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherLoan/AccountPayMargin.java new file mode 100644 index 000000000..7e940031e --- /dev/null +++ b/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherLoan/AccountPayMargin.java @@ -0,0 +1,20 @@ +package com.tenwa.voucher.CreateVoucherProcess.CreateVoucherLoan; + +import java.util.HashMap; +import java.util.Map; + +import com.amarsoft.are.jbo.JBOTransaction; +import com.tenwa.comm.exception.BusinessException; +import com.tenwa.voucher.service.VoucherJavaParamService; + +public class AccountPayMargin implements VoucherJavaParamService{ + + @Override + public Map getJavaParam(JBOTransaction tx, + Map param) throws BusinessException { + MapreturnValue=new HashMap(); + returnValue.putAll(param); + return returnValue; + } + +} diff --git a/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherLoan/AccountsPayable.java b/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherLoan/AccountsPayable.java new file mode 100644 index 000000000..b61b913d7 --- /dev/null +++ b/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherLoan/AccountsPayable.java @@ -0,0 +1,21 @@ +package com.tenwa.voucher.CreateVoucherProcess.CreateVoucherLoan; + +import java.util.HashMap; +import java.util.Map; + +import com.amarsoft.are.jbo.JBOTransaction; +import com.tenwa.comm.exception.BusinessException; +import com.tenwa.voucher.service.VoucherJavaParamService; + +public class AccountsPayable implements VoucherJavaParamService{ + + @Override + public Map getJavaParam(JBOTransaction tx, + Map param) throws BusinessException { + MapreturnValue=new HashMap(); + returnValue.putAll(param); + returnValue.put("MONEY",param.get("FACT_MONEY")); + return returnValue; + } + +} diff --git a/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherLoan/BankOrCash.java b/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherLoan/BankOrCash.java new file mode 100644 index 000000000..ce0801933 --- /dev/null +++ b/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherLoan/BankOrCash.java @@ -0,0 +1,29 @@ +package com.tenwa.voucher.CreateVoucherProcess.CreateVoucherLoan; + +import java.math.BigDecimal; +import java.util.HashMap; +import java.util.Map; + +import com.amarsoft.are.jbo.JBOTransaction; +import com.tenwa.comm.exception.BusinessException; +import com.tenwa.voucher.service.VoucherJavaParamService; + +public class BankOrCash implements VoucherJavaParamService{ + + @Override + public Map getJavaParam(JBOTransaction tx, + Map param) throws BusinessException { + //车款-首付款(f10)+购置税(f20)+保险(f21)+GPS(f24)+装饰装潢(f23) + BigDecimal total = new BigDecimal(param.get("f10")); + total=total.add(new BigDecimal(param.get("f20"))); + total=total.add(new BigDecimal(param.get("f21"))); + total=total.add(new BigDecimal(param.get("f23"))); + total=total.add(new BigDecimal(param.get("f24"))); + + MapreturnValue=new HashMap(); + returnValue.putAll(param); + returnValue.put("MONEY",param.get("total")); + return returnValue; + } + +} diff --git a/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherLoan/OtherAccountPayLend.java b/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherLoan/OtherAccountPayLend.java new file mode 100644 index 000000000..24da2e432 --- /dev/null +++ b/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherLoan/OtherAccountPayLend.java @@ -0,0 +1,28 @@ +package com.tenwa.voucher.CreateVoucherProcess.CreateVoucherLoan; + +import java.math.BigDecimal; +import java.util.HashMap; +import java.util.Map; + +import com.amarsoft.are.jbo.JBOTransaction; +import com.tenwa.comm.exception.BusinessException; +import com.tenwa.voucher.service.VoucherJavaParamService; + +public class OtherAccountPayLend implements VoucherJavaParamService{ + + @Override + public Map getJavaParam(JBOTransaction tx, + Map param) throws BusinessException { + //购置税(f20)+保险(f21)+GPS(f24)+装饰装潢(f23) + BigDecimal otherMoney=new BigDecimal(param.get("f20")); + otherMoney=otherMoney.add(new BigDecimal(param.get("f21"))); + otherMoney=otherMoney.add(new BigDecimal(param.get("f23"))); + otherMoney=otherMoney.add(new BigDecimal(param.get("f24"))); + + MapreturnValue=new HashMap(); + returnValue.putAll(param); + returnValue.put("MONEY",param.get("otherMoney")); + return returnValue; + } + +} diff --git a/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherLoan/SaveMargin.java b/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherLoan/SaveMargin.java new file mode 100644 index 000000000..9bc994407 --- /dev/null +++ b/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherLoan/SaveMargin.java @@ -0,0 +1,20 @@ +package com.tenwa.voucher.CreateVoucherProcess.CreateVoucherLoan; + +import java.util.HashMap; +import java.util.Map; + +import com.amarsoft.are.jbo.JBOTransaction; +import com.tenwa.comm.exception.BusinessException; +import com.tenwa.voucher.service.VoucherJavaParamService; + +public class SaveMargin implements VoucherJavaParamService{ + + @Override + public Map getJavaParam(JBOTransaction tx, + Map param) throws BusinessException { + MapreturnValue=new HashMap(); + returnValue.putAll(param); + return returnValue; + } + +}