凭证相关

This commit is contained in:
amarsoft 2018-07-23 19:55:32 +08:00
parent a61c75410f
commit 7abf362443
10 changed files with 367 additions and 32 deletions

View File

@ -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<String,String> map=new HashMap<String, String>();
Map<String,String> param=new HashMap<String, String>();
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<Map<String,String>> dataList=DataOperatorUtil.getDataBySql(Sqlca, sql, map);
CreateVoucherServiceImpl vs=new CreateVoucherServiceImpl();
String VOUCHER_TYPE="1";// ƾ֤·ÖÀà ½ðµû
String userid ="admin";
for (int i=0;i<dataList.size();i++){
MONEY=dataList.get(i).get("MONEY").toString();
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();
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;
}
}

View File

@ -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<String,String> map=new HashMap<String, String>();
Map<String,String> param=new HashMap<String, String>();
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<Map<String,String>> 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();
}

View File

@ -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<String,String> map=new HashMap<String, String>();
Map<String,String> param=new HashMap<String, String>();
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,"

View File

@ -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<String,String> map=new HashMap<String, String>();
Map<String,String> param=new HashMap<String, String>();
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<Map<String,String>> dataList=DataOperatorUtil.getDataBySql(Sqlca, sql, map);
CreateVoucherServiceImpl vs=new CreateVoucherServiceImpl();

View File

@ -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<String,String> map=new HashMap<String, String>();
Map<String,String> param=new HashMap<String, String>();
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 "

View File

@ -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";
}
}

View File

@ -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 "";
}
}

View File

@ -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";
}
}

View File

@ -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";
}
}

View File

@ -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<String,String> map=new HashMap<String, String>();
Map<String,String> param=new HashMap<String, String>();
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<Map<String,String>> dataList=DataOperatorUtil.getDataBySql(Sqlca, sql, map);
CreateVoucherServiceImpl vs=new CreateVoucherServiceImpl();
String VOUCHER_TYPE="1";// ƾ֤·ÖÀà ½ðµû
String userid ="admin";
for (int i=0;i<dataList.size();i++){
MONEY=dataList.get(i).get("MONEY").toString();
if("".equals(MONEY)||MONEY==null) MONEY="0.00";
double mon=Double.parseDouble(MONEY);
if(mon>0){
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;
}
}