From 5e7e502afbf569f7c6d8e797b7cc3f4bb4645c12 Mon Sep 17 00:00:00 2001 From: tangfutang <3218982385@qq.com> Date: Thu, 30 Jun 2022 14:28:15 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BD=91=E9=93=B6=E6=A0=B8=E9=94=80=E5=87=AD?= =?UTF-8?q?=E8=AF=81=E7=94=9F=E6=88=90=E6=94=B9=E4=B8=BA=E5=AE=9A=E6=97=B6?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CreateVoucherRentIncomeMission.java | 122 ++++++++++++++++++ 1 file changed, 122 insertions(+) diff --git a/src_tenwa/com/tenwa/lease/app/quartzmession/CreateVoucherRentIncomeMission.java b/src_tenwa/com/tenwa/lease/app/quartzmession/CreateVoucherRentIncomeMission.java index 07792a107..25584493a 100644 --- a/src_tenwa/com/tenwa/lease/app/quartzmession/CreateVoucherRentIncomeMission.java +++ b/src_tenwa/com/tenwa/lease/app/quartzmession/CreateVoucherRentIncomeMission.java @@ -1,13 +1,28 @@ package com.tenwa.lease.app.quartzmession; +import java.util.List; +import java.util.Map; + import org.quartz.DisallowConcurrentExecution; import org.quartz.Job; import org.quartz.JobExecutionContext; import org.quartz.JobExecutionException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.amarsoft.are.jbo.JBOException; import com.amarsoft.are.util.StringFunction; +import com.amarsoft.awe.util.SqlObject; +import com.amarsoft.awe.util.Transaction; import com.base.util.QuartzUtil; +import com.tenwa.jbo.manager.DataUtil; +import com.tenwa.voucher.CreateVoucherProcess.CreateVoucherCustCautionMoneyIncome; +import com.tenwa.voucher.CreateVoucherProcess.CreateVoucherEbankMoney; +import com.tenwa.voucher.CreateVoucherProcess.CreateVoucherRedCompensatory; +import com.tenwa.voucher.CreateVoucherProcess.CreateVoucherRentIncome; import com.tenwa.voucher.CreateVoucherProcess.InsertVoucherRentCompensatory; import com.tenwa.voucher.CreateVoucherProcess.InsertVoucherRentIncome; +import com.tenwa.voucher.serviceImp.OverdueRepayPlanVoucherPSBC; /** * 生成卡扣凭证明细-定时任务 * @author xiezhiwen @@ -15,6 +30,7 @@ import com.tenwa.voucher.CreateVoucherProcess.InsertVoucherRentIncome; @DisallowConcurrentExecution public class CreateVoucherRentIncomeMission implements Job { + private static final Logger logger = LoggerFactory.getLogger(CreateVoucherRentIncomeMission.class); @Override public void execute(JobExecutionContext arg0) throws JobExecutionException { String startime = StringFunction.getTodayNow(); @@ -31,10 +47,116 @@ public class CreateVoucherRentIncomeMission implements Job { InsertVoucherRentIncome ivri=new InsertVoucherRentIncome(); ivri.execute(); + //生成网银凭证 + this.recordBank(); + QuartzUtil.insertLog(startime,"com.tenwa.lease.app.quartzmession.CreateVoucherRentIncomeMission", "success", "成功", curUserId); } catch (Exception e) { QuartzUtil.insertLog(startime,"com.tenwa.lease.app.quartzmession.CreateVoucherRentIncomeMission", "error", "失败", curUserId); } } + + + + public void recordBank() throws Exception { + Transaction Sqlca =null; + String querySql="SELECT ID,FLOWUNID,USERID FROM t_wyhx_middle WHERE STATUS='Y' "; + List> recordBankList = DataUtil.query(querySql); + if(recordBankList!=null && recordBankList.size() > 0 ) { + for (Map recordBank : recordBankList) { + try { + Sqlca = Transaction.createTransaction("als"); + String FlowUnid=recordBank.get("FLOWUNID"); + logger.info("IncomeVoucher 20210906 新增判断代码【开始】"); + OverdueRepayPlanVoucherPSBC overdueRepayPlanVoucherPSBC = new OverdueRepayPlanVoucherPSBC(); + if(overdueRepayPlanVoucherPSBC.findFcPSBCOverduce(FlowUnid)){ + logger.info("IncomeVoucher 网银收款流程结束后生成相应的凭证,当前是邮储相关订单凭证不执行以下操作。【结束】,未通过。"); + continue; + } + logger.info("IncomeVoucher 20210906 新增判断代码【结束】,通过。"); + String userid = recordBank.get("USERID"); + + /** + * 汽车网银回款-资金部分 + */ + CreateVoucherCustCautionMoneyIncome cvci=new CreateVoucherCustCautionMoneyIncome(); + // 汽车回租 + String sql="SELECT FEE_TYPE FROM LC_FUND_INCOME_TEMP WHERE FLOWUNID='"+FlowUnid+"' GROUP BY FEE_TYPE"; + List> queryList = DataUtil.query(sql); + for (Map map : queryList) { + String FEE_TYPE = map.get("FEE_TYPE"); + if("feetype30".equals(FEE_TYPE)) { + cvci.CreateVoucher(Sqlca,FlowUnid, "PZ2018072100000026", "feetype30",userid);//收到的违约金/罚款 --回租 + cvci.CreateVoucher(Sqlca,FlowUnid, "PZ2019070100000015", "feetype30",userid);//收到的违约金/罚款 --直租 + }else if("feetype4".equals(FEE_TYPE)) { + cvci.CreateVoucher(Sqlca,FlowUnid, "PZ2018072100000031", "feetype4",userid); //收到名义货价 --回租 + cvci.CreateVoucher(Sqlca,FlowUnid, "PZ2019070100000019", "feetype4",userid); //收到名义货价--直租 + }else if("feetype2".equals(FEE_TYPE)) { + cvci.CreateVoucher(Sqlca,FlowUnid, "PZ2019121600000162", "feetype2",userid); //回款-收到客户保证金 --回租 + cvci.CreateVoucher(Sqlca,FlowUnid, "PZ2020041000000003", "feetype2",userid); //直租-收到客户保证金-直租 + }else if("feetype1".equals(FEE_TYPE)) { + cvci.CreateVoucher(Sqlca,FlowUnid, "PZ2019121600000163", "feetype1",userid); //回款-收到客户手续费(一次性)--回租 + cvci.CreateVoucher(Sqlca,FlowUnid, "PZ2019121700000164", "feetype1",userid); //回款-收到客户手续费(按月) --回租 + }else if("feetype32".equals(FEE_TYPE)) { + cvci.CreateVoucher(Sqlca,FlowUnid, "PZ2021032400000006", "feetype32",userid); //回款-收到个人意外险(网银来款)--回租 + cvci.CreateVoucher(Sqlca,FlowUnid, "PZ2021032400000005", "feetype33",userid); //回款-收到客户贴息 --回租 + } + } + + cvci.CreateVoucher(Sqlca,FlowUnid, "PZ2020080400000003", "feetype5",userid); //直租-收到客户首付款 + + /** + * 汽车网银回款-租金部分 + */ + CreateVoucherRentIncome cvri=new CreateVoucherRentIncome(); + sql="SELECT LCI.LEAS_FORM FROM LC_RENT_INCOME_TEMP LFIT LEFT JOIN LB_CONTRACT_INFO LCI ON LCI.ID=LFIT.CONTRACT_ID WHERE LFIT.FLOWUNID='"+FlowUnid+"' GROUP BY LCI.LEAS_FORM"; + List> queryList2 = DataUtil.query(sql); + for (Map map : queryList2) { + // 汽车回租 + if("02".equals(map.get("LEAS_FORM"))) { + cvri.CreateVoucher(Sqlca,FlowUnid,"PZ2018072100000024",userid);//回款-收到的租金(网银)--当月(回租) + cvri.CreateVoucher(Sqlca,FlowUnid,"PZ2018080400000081",userid);//回款-收到的租金(网银)--跨月(回租) + cvri.CreateVoucher(Sqlca,FlowUnid,"PZ2018072100000025",userid);//回款-收到的逾期利息(网银)--(回租) + // 汽车直租 + }else { + cvri.CreateVoucher(Sqlca,FlowUnid,"PZ2019070100000016",userid);//回款-收到的租金(网银)--当月(直租) + cvri.CreateVoucher(Sqlca,FlowUnid,"PZ2019070100000017",userid);//回款-收到的租金(网银)--跨月(直租) + cvri.CreateVoucher(Sqlca,FlowUnid,"PZ2019070100000014",userid);//回款-收到的逾期利息(网银)--(直租) + } + } + /** + * 代偿反冲 + */ + CreateVoucherRedCompensatory cvrcs = new CreateVoucherRedCompensatory(); + cvrcs.CreateVoucher(FlowUnid,"PZ2019071500000030",userid,Sqlca);//代偿租金 + cvrcs.CreateVoucher(FlowUnid,"PZ2019071500000031",userid,Sqlca);//代偿逾期利息 + + CreateVoucherEbankMoney cvem = new CreateVoucherEbankMoney(); + sql="SELECT LE.ID FROM LC_EBANK_TEMP LE LEFT JOIN (SELECT MAX(F57) AS F57 FROM VOUCHER_V8 WHERE MODULE_NAME = '回款-多余回款分解' GROUP BY F3)V8 ON V8.F57=LE.EBANK_SN WHERE LE.FLOWUNID='"+FlowUnid+"' AND V8.F57 IS NULL"; + List> queryList3 = DataUtil.query(sql); + if(queryList3.size()>0) { + cvem.CreateVoucher(FlowUnid, "PZ2019070100000018", userid,Sqlca);// 回款-多余回款分解 + } + Sqlca.executeSQL(new SqlObject("UPDATE t_wyhx_middle SET STATUS='N' WHERE id='"+recordBank.get("ID")+"'")); + + } catch (Exception e) { + try { + Sqlca.rollback(); + } catch (JBOException e1) { + e1.printStackTrace(); + } + }finally { + try { + Sqlca.commit(); + Sqlca.disConnect(); + } catch (JBOException e) { + e.printStackTrace(); + } + + } + } + } + + } }