From dcf8b368213c48835f9b0afbbeba6f6e50ca8dc7 Mon Sep 17 00:00:00 2001 From: amarsoft Date: Wed, 1 Aug 2018 09:33:23 +0800 Subject: [PATCH] =?UTF-8?q?=E5=87=AD=E8=AF=81=E7=9B=B8=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CreateVoucherCustCautionMoneyIncome.java | 6 ++-- .../IncomeVoucher.java | 7 ++-- .../CreateVoucherRentIncome.java | 32 ++++++++++++++----- .../CreateVoucherRentIncomeMission.java | 19 +++++++++++ 4 files changed, 52 insertions(+), 12 deletions(-) create mode 100644 src_tenwa/com/tenwa/lease/app/quartzmession/CreateVoucherRentIncomeMission.java diff --git a/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherCustCautionMoneyIncome.java b/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherCustCautionMoneyIncome.java index 1c94cb51d..b3d21c5e9 100644 --- a/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherCustCautionMoneyIncome.java +++ b/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherCustCautionMoneyIncome.java @@ -42,9 +42,11 @@ public class CreateVoucherCustCautionMoneyIncome extends BaseBussiness{ param.clear(); map.put("FlowUnid", FlowUnid); map.put("FEE_TYPE", FeeType); + if("PZ2018073100000062".equals(VOUCHERNO)){ + 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,DI.DISTRIBUTOR_CODING DISTRIBUTOR_ID,DI.DISTRIBUTOR_NAME,LEC.ID AS CARID,LEC.MODEL ,CIF.CUSTOMERID,CIF.CUSTOMERNAME,CIF.CUSTOMERTYPE,LPI.BUSINESSTYPE FROM LC_FUND_INCOME_TEMP LFIT LEFT JOIN LB_CONTRACT_INFO LCI ON LFIT.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 LEFT JOIN lb_union_lessee lul ON lul.contract_id=lci.id LEFT JOIN customer_info cif ON cif.customerid=lul.customer_id LEFT JOIN LB_PROJECT_INFO LPI ON LPI.ID = LUL.PROJECT_ID WHERE LFIT.FEE_TYPE in ('feetype20','feetype21','feetype22','feetype23') AND LFIT.FLOWUNID=:FLOWUNID "; + }else{ 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,DI.DISTRIBUTOR_CODING DISTRIBUTOR_ID,DI.DISTRIBUTOR_NAME,LEC.ID AS CARID,LEC.MODEL ,CIF.CUSTOMERID,CIF.CUSTOMERNAME,CIF.CUSTOMERTYPE,LPI.BUSINESSTYPE FROM LC_FUND_INCOME_TEMP LFIT LEFT JOIN LB_CONTRACT_INFO LCI ON LFIT.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 LEFT JOIN lb_union_lessee lul ON lul.contract_id=lci.id LEFT JOIN customer_info cif ON cif.customerid=lul.customer_id LEFT JOIN LB_PROJECT_INFO LPI ON LPI.ID = LUL.PROJECT_ID WHERE LFIT.FEE_TYPE=:FEE_TYPE AND LFIT.FLOWUNID=:FLOWUNID "; - - + } List> dataList=DataOperatorUtil.getDataBySql(Sqlca, sql, map); CreateVoucherServiceImpl vs=new CreateVoucherServiceImpl(); diff --git a/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherMethodSettle/IncomeVoucher.java b/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherMethodSettle/IncomeVoucher.java index 9c5885384..f26b20187 100644 --- a/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherMethodSettle/IncomeVoucher.java +++ b/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherMethodSettle/IncomeVoucher.java @@ -16,11 +16,14 @@ public class IncomeVoucher extends BaseBussiness { cvci.CreateVoucher(FlowUnid, "PZ2018071100000012", "feetype2");//收到客户保证金 cvci.CreateVoucher(FlowUnid, "PZ2018072100000023", "feetype1");//按月分摊的保证金 cvci.CreateVoucher(FlowUnid, "PZ2018072100000031", "feetype4");//都到留购价款 + cvci.CreateVoucher(FlowUnid, "PZ2018072100000028", "feetype27");//贴息 + cvci.CreateVoucher(FlowUnid, "PZ2018073100000062", null);//购置税+保险+装饰 + cvci.CreateVoucher(FlowUnid, "PZ2018073100000061", "feetype24");//GPS - CreateVoucherRentIncome cvri=new CreateVoucherRentIncome(); + /*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 index cdf3b92da..01916f223 100644 --- a/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherRentIncome.java +++ b/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherRentIncome.java @@ -7,6 +7,7 @@ import java.util.Map; import jbo.voucher.LV_VOUCHER_CONFIG; import com.amarsoft.are.jbo.BizObject; +import com.amarsoft.are.jbo.JBOException; import com.amarsoft.awe.util.Transaction; import com.amarsoft.dict.als.cache.CacheLoaderFactory; import com.tenwa.comm.util.jboutil.DataOperatorUtil; @@ -14,13 +15,16 @@ import com.tenwa.voucher.serviceImp.CreateVoucherServiceImpl; public class CreateVoucherRentIncome { - public String CreateVoucher(String FlowUnid,String VOUCHERNO) throws Exception { + public void CreateVoucher(String VOUCHERNO){ Transaction Sqlca =null; + try{ 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; @@ -37,12 +41,11 @@ public class CreateVoucherRentIncome { String BUSINESSTYPE=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,DI.DISTRIBUTOR_CODING DISTRIBUTOR_ID,DI.DISTRIBUTOR_NAME,LrIT.FLOWUNID,CIF.CUSTOMERID,CIF.CUSTOMERNAME,CIF.CUSTOMERTYPE,LPI.BUSINESSTYPE 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 LEFT JOIN lb_union_lessee lul ON lul.contract_id=lci.id LEFT JOIN customer_info cif ON cif.customerid=lul.customer_id LEFT JOIN LB_PROJECT_INFO LPI ON LPI.ID = LUL.PROJECT_ID WHERE LrIT.FLOWUNID=:FLOWUNID"; + sql= "SELECT LRIT.rent 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,LrIT.CONTRACT_ID,LCI.CONTRACT_NUMBER,LCI.PROJECT_NAME,LCI.LEAS_FORM,DI.DISTRIBUTOR_CODING DISTRIBUTOR_ID,DI.DISTRIBUTOR_NAME,LrIT.FLOWUNID,CIF.CUSTOMERID,CIF.CUSTOMERNAME,CIF.CUSTOMERTYPE,LPI.BUSINESSTYPE FROM LC_rent_INCOME 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 LEFT JOIN lb_union_lessee lul ON lul.contract_id=lci.id LEFT JOIN customer_info cif ON cif.customerid=lul.customer_id LEFT JOIN LB_PROJECT_INFO LPI ON LPI.ID = LUL.PROJECT_ID WHERE DATE_FORMAT(LrIT.hire_date,'%Y/%m/%d')=DATE_FORMAT(sysdate(),'%Y/%m/%d') "; } 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,DI.DISTRIBUTOR_CODING DISTRIBUTOR_ID,DI.DISTRIBUTOR_NAME,LrIT.FLOWUNID,CIF.CUSTOMERID,CIF.CUSTOMERNAME,CIF.CUSTOMERTYPE,LPI.BUSINESSTYPE 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 LEFT JOIN lb_union_lessee lul ON lul.contract_id=lci.id LEFT JOIN customer_info cif ON cif.customerid=lul.customer_id LEFT JOIN LB_PROJECT_INFO LPI ON LPI.ID = LUL.PROJECT_ID WHERE LrIT.FLOWUNID=:FLOWUNID"; + sql= "SELECT LrIT.penalty AS MONEY,ROUND(LrIT.penalty/1.06,2) AS MONEYNOTAX,LrIT.penalty-ROUND(LrIT.penalty/1.06,2) AS MONEYTAX,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,DI.DISTRIBUTOR_CODING DISTRIBUTOR_ID,DI.DISTRIBUTOR_NAME,LrIT.FLOWUNID,CIF.CUSTOMERID,CIF.CUSTOMERNAME,CIF.CUSTOMERTYPE,LPI.BUSINESSTYPE FROM LC_rent_INCOME 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 LEFT JOIN lb_union_lessee lul ON lul.contract_id=lci.id LEFT JOIN customer_info cif ON cif.customerid=lul.customer_id LEFT JOIN LB_PROJECT_INFO LPI ON LPI.ID = LUL.PROJECT_ID WHERE DATE_FORMAT(LrIT.hire_date,'%Y/%m/%d')=DATE_FORMAT(SYSDATE(),'%Y/%m/%d')"; } List> dataList=DataOperatorUtil.getDataBySql(Sqlca, sql, map); @@ -53,7 +56,9 @@ public class CreateVoucherRentIncome { MONEY=dataList.get(i).get("MONEY").toString(); if("".equals(MONEY)||MONEY==null) MONEY="0.00"; double mon=Double.parseDouble(MONEY); - if(mon>0){ + if(Math.abs(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(); @@ -70,6 +75,8 @@ public class CreateVoucherRentIncome { BUSINESSTYPE=dataList.get(i).get("BUSINESSTYPE"); 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); @@ -97,7 +104,6 @@ public class CreateVoucherRentIncome { //param.put("FUNDTYPE", ""); // 主营类型 param.put("BUSINESSTYPE", "06"); - param.put("FlowUnid", FlowUnid); map.clear(); map.put("PROJ_TYPE", leas_form); map.put("VOUCHER_NO", VOUCHERNO); @@ -112,7 +118,17 @@ public class CreateVoucherRentIncome { Sqlca.commit(); } - String sMessage="true"; - return sMessage; + }catch (Exception e){ + e.printStackTrace(); + }finally{ + if(Sqlca!=null){ + try { + Sqlca.disConnect(); + } catch (JBOException e) { + e.printStackTrace(); + } + Sqlca = null; + } + } } } diff --git a/src_tenwa/com/tenwa/lease/app/quartzmession/CreateVoucherRentIncomeMission.java b/src_tenwa/com/tenwa/lease/app/quartzmession/CreateVoucherRentIncomeMission.java new file mode 100644 index 000000000..9d1ca989d --- /dev/null +++ b/src_tenwa/com/tenwa/lease/app/quartzmession/CreateVoucherRentIncomeMission.java @@ -0,0 +1,19 @@ +package com.tenwa.lease.app.quartzmession; + +import org.quartz.Job; +import org.quartz.JobExecutionContext; +import org.quartz.JobExecutionException; + +import com.tenwa.voucher.CreateVoucherProcess.CreateVoucherMonthSettlement; +import com.tenwa.voucher.CreateVoucherProcess.CreateVoucherRentIncome; + +public class CreateVoucherRentIncomeMission implements Job { + + @Override + public void execute(JobExecutionContext arg0) throws JobExecutionException { + CreateVoucherRentIncome cvri=new CreateVoucherRentIncome(); + cvri.CreateVoucher("PZ2018072100000024");//收到租金 + cvri.CreateVoucher("PZ2018072100000025");//收到逾期利息 + } + +}