From d4f06b57295cbedbf686cc0af3e48fe973aa4e3d Mon Sep 17 00:00:00 2001 From: ap007 Date: Mon, 2 Aug 2021 17:22:24 +0800 Subject: [PATCH 1/8] =?UTF-8?q?=E8=B5=84=E6=96=B9=E7=A7=9F=E9=87=91?= =?UTF-8?q?=E8=AE=A1=E5=88=92=E6=8B=B7=E8=B4=9D=E5=AE=9A=E6=97=B6=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E5=8F=8A=E5=8A=9F=E8=83=BD=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../quartzmession/CorpusSourceFileCopy.java | 352 ++++++++++++++++++ .../CorpusSourceRentPlanCopy.java | 295 +++------------ 2 files changed, 400 insertions(+), 247 deletions(-) create mode 100644 src_tenwa/com/tenwa/lease/app/quartzmession/CorpusSourceFileCopy.java diff --git a/src_tenwa/com/tenwa/lease/app/quartzmession/CorpusSourceFileCopy.java b/src_tenwa/com/tenwa/lease/app/quartzmession/CorpusSourceFileCopy.java new file mode 100644 index 000000000..691cb7e35 --- /dev/null +++ b/src_tenwa/com/tenwa/lease/app/quartzmession/CorpusSourceFileCopy.java @@ -0,0 +1,352 @@ +package com.tenwa.lease.app.quartzmession; + +import com.amarsoft.are.ARE; +import com.amarsoft.are.jbo.*; +import com.amarsoft.are.util.StringFunction; +import com.amarsoft.awe.util.Transaction; +import com.base.util.QuartzUtil; +import com.tenwa.comm.util.jboutil.DataOperatorUtil; +import com.tenwa.reckon.executor.CreateTransactionExecutor; +import jbo.app.tenwa.calc.LC_CALC_CONDITION; +import jbo.app.tenwa.calc.LC_RENT_PLAN; +import jbo.app.tenwa.calc.LC_RENT_PLAN_HIS; +import jbo.oti.FC_FILE_PUSH; +import jbo.oti.FC_YC_FILE_REPAY_PLAN; +import jbo.oti.LC_PROFIT_PLAN; +import org.quartz.Job; +import org.quartz.JobExecutionContext; +import org.quartz.JobExecutionException; + +import java.math.BigDecimal; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static java.math.BigDecimal.ROUND_HALF_UP; + +/** + * 资方租金计划拷贝 + */ +public class CorpusSourceFileCopy { + + private String contractId; + private String fileType; + + public void doCopy(JBOTransaction tx) throws JobExecutionException { + BizObjectManager ffpBom = null; + Transaction Sqlca = null; + try { + Sqlca = Transaction.createTransaction(tx); + ffpBom = JBOFactory.getBizObjectManager(FC_FILE_PUSH.CLASS_NAME,tx); + //todo 添加渠道商的选择,哪些需要拷表哪些不需要 + String fileSql = "select ID,FILE_STS from O where FILE_TYPE='"+fileType+"' and FILE_STS='2'"; + List ffpBoList = ffpBom.createQuery(fileSql).getResultList(true); + if(ffpBoList.size()==0){ + ARE.getLog().info("暂时没有需要拷表的资方文件"); + return; + } + //遍历解析每个文件 + for(BizObject ffpBo : ffpBoList){ + analyticalFile(ffpBo,tx); + ffpBo.setAttributeValue("FILE_STS","3"); + ffpBo.setAttributeValue("FILE_STS_DESC","拷贝成功"); + ffpBom.saveObject(ffpBo); + } + Sqlca.commit(); + } catch (Exception e) { + e.printStackTrace(); + try { + if (Sqlca != null) { + Sqlca.rollback(); + } + } catch (JBOException e1) { + e1.printStackTrace(); + } + throw new JobExecutionException(e); + } + } + + /** + * 解析文件 + * @param ffpBo + * @param tx + * @throws Exception + */ + public void analyticalFile(BizObject ffpBo,JBOTransaction tx) throws Exception { + String fcFileId = ffpBo.getAttribute("ID").toString(); + List fyfrpBoList = getFileInfoByFileId(fcFileId); + + respectiveDo(fyfrpBoList,tx); + + } + + /** + * 执行自己类所需的操作 + * @param fyfrpBoList + * @param tx + * @throws Exception + */ + public void respectiveDo(List fyfrpBoList , JBOTransaction tx) throws Exception { + //获取对应的合同 + Map contractMap = this.getContractIdMap(fyfrpBoList); + if(contractMap.size()==0){ + String fcFileId = fyfrpBoList.get(0).getAttribute("FC_REQUEST_ID").toString(); + ARE.getLog().error("未找到FC_REQUEST_ID: "+fcFileId+" 对应的合同ID"); + throw new Exception("未找到FC_REQUEST_ID: "+fcFileId+" 对应的合同ID"); + } + Transaction Sqlca = Transaction.createTransaction(tx); + //===顺序不能错=== + //0.将租金计划拷贝到历史表 + copyRentPlanFormatToHis(contractMap,tx); + //1.更新租金计划表(直接文件每条信息更新,不需要遍历) + updateRentPlan(fyfrpBoList,tx); + for(Map.Entry entry : contractMap.entrySet()){ + String contractId = entry.getKey(); + Map param = getParamByContractId(contractId,tx); + //2.更新剩余本金 + updateAllRemainCorpus(contractId,Sqlca); + //3.更新SP分润计划 + updateSplitSP(param,Sqlca); + //4.插入分润计划 + insertProfitPlan(param,tx); + } + + } + + /** + * 获取每个文件的文件信息 + * @param fcFileId + * @return + * @throws Exception + */ + public List getFileInfoByFileId(String fcFileId) throws Exception { + String sql = "select fr.CONTRACT_ID,O.FC_REQUEST_ID,O.LEND_TERM,O.ANS_REPAYMENT_DATE,O.ANS_PRINCIPAL,O.ANS_INTEREST,ANS_REPAYMENT_MONEY from O left join jbo.oti.FC_REQUEST fr on O.FC_REQUEST_ID=fr.ID where fr.DEL_FLAG='0' and O.FC_FILE_ID=:fcFileId"; + BizObjectManager fyfrpBom = JBOFactory.getBizObjectManager(FC_YC_FILE_REPAY_PLAN.CLASS_NAME); + List fyfrpBoList = fyfrpBom.createQuery(sql).setParameter("fcFileId",fcFileId).getResultList(false); + if(fyfrpBoList.size()==0){ + ARE.getLog().error("未找到FC_REQUEST_ID: "+fcFileId+" 对应的资方还款计划"); + throw new Exception("未找到FC_REQUEST_ID: "+fcFileId+" 对应的资方还款计划"); + } + return fyfrpBoList; + } + + /** + * copy租金计划到历史表 + * @param contractMap + * @param tx + * @throws Exception + */ + public void copyRentPlanFormatToHis(Map contractMap ,JBOTransaction tx) throws Exception { + for(Map.Entry entry: contractMap.entrySet()){ + Map fromCondtion=new HashMap(); + fromCondtion.put("CONTRACT_ID",entry.getKey()); + + Map otherProperty=new HashMap(); + otherProperty.put("MEMO", "安鹏原正式租金计划"); + otherProperty.put("FLOWUNID", entry.getValue()); + + DataOperatorUtil.copyJBOSet(LC_RENT_PLAN.CLASS_NAME, fromCondtion, LC_RENT_PLAN_HIS.CLASS_NAME,null, otherProperty, null, tx); + } + } + /** + * 获取对应的合同ID + * @param fyfrpBoList + * @return + * @throws JBOException + */ + public Map getContractIdMap(List fyfrpBoList) throws JBOException { + Map contractMap = new HashMap<>(); + for(BizObject bo : fyfrpBoList){ + String contractId = bo.getAttribute("CONTRACT_ID").toString(); + String fcRequestId = bo.getAttribute("FC_REQUEST_ID").toString(); + contractMap.put(contractId,fcRequestId); + } + return contractMap; + } + /** + * 租金计划拷贝 + * @param fyfrpBoList 每个回执文件包含的租金计划信息 + * @return 每个回执文件包含的contract_id + * @throws JBOException + * @throws ParseException + */ + public void updateRentPlan(List fyfrpBoList,JBOTransaction tx) throws JBOException, ParseException { + BizObjectManager lrpBom = null; + lrpBom = JBOFactory.getBizObjectManager(LC_RENT_PLAN.CLASS_NAME,tx); + //更新租金计划表 + for(BizObject bo : fyfrpBoList){ + //获取参数 + String contractId = bo.getAttribute("CONTRACT_ID").toString(); + String lendTerm = bo.getAttribute("LEND_TERM").toString(); + String principal = bo.getAttribute("ANS_PRINCIPAL").toString(); + String interest = bo.getAttribute("ANS_INTEREST").toString(); + String rent = new BigDecimal(principal).add(new BigDecimal(interest)).toString(); + String repaymentMoney = bo.getAttribute("ANS_REPAYMENT_MONEY").toString(); + String repaymentDate = bo.getAttribute("ANS_REPAYMENT_DATE").toString(); + //转换日期格式 + Date date = new SimpleDateFormat("yyyyMMdd").parse(repaymentDate); + repaymentDate = new SimpleDateFormat("yyyy/MM/dd").format(date); + //更新租金计划表 + BizObject lrpBo = lrpBom.createQuery("CONTRACT_ID=:contractId and PLAN_LIST=:lendTerm").setParameter("contractId",contractId).setParameter("lendTerm",lendTerm).getSingleResult(true); + lrpBo.setAttributeValue("RENT",rent); + lrpBo.setAttributeValue("CORPUS",principal); + lrpBo.setAttributeValue("INTEREST",interest); + lrpBo.setAttributeValue("CORPUS_BUSINESS",principal); + lrpBo.setAttributeValue("INTEREST_BUSINESS",interest); + lrpBo.setAttributeValue("PLAN_DATE",repaymentDate); + lrpBo.setAttributeValue("RENT",repaymentMoney); + lrpBom.saveObject(lrpBo); + } + } + + /** + * 更新剩余本金信息 + * @throws JBOException + */ + public void updateAllRemainCorpus(String contractId,JBOTransaction tx) throws JBOException { + BizObjectManager lrpBom = null; + lrpBom = JBOFactory.getBizObjectManager(LC_RENT_PLAN.CLASS_NAME,tx); + BizObjectManager lccBom = null; + lccBom = JBOFactory.getBizObjectManager(LC_CALC_CONDITION.CLASS_NAME,tx); + + BizObject lccBo = lccBom.createQuery("select CLEAN_LEASE_MONEY from O where contract_id=:contractId").setParameter("contractId",contractId).getSingleResult(false); + String clean_lease_money = lccBo.getAttribute("CLEAN_LEASE_MONEY").toString(); + BigDecimal cleanLeaseMoneyBd = new BigDecimal(clean_lease_money); + List lrpBos= lrpBom.createQuery("contract_id=:contractId order by plan_list").setParameter("contractId",contractId).getResultList(true); + for(BizObject bo :lrpBos){ + String corpus = bo.getAttribute("corpus").toString(); + BigDecimal corpusBd = new BigDecimal(corpus); + cleanLeaseMoneyBd = cleanLeaseMoneyBd.subtract(corpusBd).setScale(2,ROUND_HALF_UP); + bo.setAttributeValue("ALL_REMAIN_CORPUS",cleanLeaseMoneyBd.toString()); + lrpBom.saveObject(bo); + } + } + + /** + * 更新剩余本金信息 + * @throws JBOException + */ + public void updateAllRemainCorpus(JBOTransaction tx) throws JBOException { + updateAllRemainCorpus(contractId,tx); + } + + /** + * 更新分润信息 + * @throws Exception + */ + public void updateSplitSP(Map param,Transaction Sqlca) throws Exception { + + String splittingRatio = param.get("splittingRatio"); + //必须的判断条件(配置了灵活分润的产品可能没有配置分润) + // 判断顺序,是否分润--》是否灵活分润 + //是否灵活分润在insertRentPlan_SP()方法中判断 + if (!"".equals(splittingRatio) && splittingRatio != null) { + String paymentNumber = param.get("paymentNumber"); + String splitType = param.get("splitType"); + CreateTransactionExecutor cre = new CreateTransactionExecutor(); + cre.setPlannumber(paymentNumber); + cre.insertRentPlan_SP(splittingRatio, Sqlca, splitType); + } + + } + + /** + * 更新分润信息 + * @throws Exception + */ + public void updateSplitSP(JBOTransaction tx) { + Transaction Sqlca = null; + try { + Sqlca = Transaction.createTransaction(tx); + Map param = getParamByContractId(contractId,tx); + updateSplitSP(param,Sqlca); + } catch (JBOException e) { + e.printStackTrace(); + } catch (Exception e) { + e.printStackTrace(); + }finally { + try { + if (Sqlca != null) { + Sqlca.rollback(); + } + } catch (JBOException e1) { + e1.printStackTrace(); + } + } + } + + /** + * 获取每个合同的参数 + * @return + * @throws Exception + */ + public Map getParamByContractId(String contractId,JBOTransaction tx) throws Exception { + String sql = "select * from vi_corpus_source_param where contractId='" + contractId + "'"; + List> data = DataOperatorUtil.getDataBySql(sql,tx); + return data.get(0); + } + + /** + * 获取每个合同的参数 + * @return + * @throws Exception + */ + public Map getParamByContractId(JBOTransaction tx) throws Exception { + return getParamByContractId(contractId,tx); + } + + /** + * 插入分润计划 + * @param param + * @throws JBOException + */ + public void insertProfitPlan(Map param,JBOTransaction tx) throws JBOException { + BizObjectManager lppBom = null; + lppBom = JBOFactory.getBizObjectManager(LC_PROFIT_PLAN.CLASS_NAME,tx); + BizObjectManager lrpBom = null; + lrpBom = JBOFactory.getBizObjectManager(LC_RENT_PLAN.CLASS_NAME,tx); + BizObject lppBo = null; + String paymentNumber = param.get("paymentNumber"); + String corpusSourceRate = param.get("corpusSourceRate"); + List lrpBos = lrpBom.createQuery("PAYMENT_NUMBER=:paymentNumber order by plan_list").setParameter("paymentNumber",paymentNumber).getResultList(false); + for(BizObject bo :lrpBos){ + String rentPlanId = bo.getAttribute("ID").toString(); + String interest = bo.getAttribute("INTEREST").toString(); + String yearRate = bo.getAttribute("YEAR_RATE").toString(); + String profit = new BigDecimal(yearRate).subtract(new BigDecimal(corpusSourceRate)).divide(new BigDecimal(yearRate),6,BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(interest)).setScale(2,BigDecimal.ROUND_HALF_UP).toString(); + lppBo = lppBom.newObject(); + lppBo.setAttributeValue("rent_plan_id",rentPlanId); + lppBo.setAttributeValue("CORPUS_RATE",corpusSourceRate); + lppBo.setAttributeValue("profit",profit); + lppBo.setAttributeValue("inputtime",StringFunction.getTodayNow()); + lppBom.saveObject(lppBo); + } + + } + + /** + * 插入分润计划 + * @param tx + * @throws JBOException + */ + public void insertProfitPlan(JBOTransaction tx) throws Exception { + Map param = getParamByContractId(contractId,tx); + insertProfitPlan(param,tx); + } + + public String getContractId() { + return contractId; + } + + public void setContractId(String contractId) { + this.contractId = contractId; + } + + public String getFileType() { return fileType; } + + public void setFileType(String fileType) { this.fileType = fileType; } + +} diff --git a/src_tenwa/com/tenwa/lease/app/quartzmession/CorpusSourceRentPlanCopy.java b/src_tenwa/com/tenwa/lease/app/quartzmession/CorpusSourceRentPlanCopy.java index ad229dfe5..831f46ba0 100644 --- a/src_tenwa/com/tenwa/lease/app/quartzmession/CorpusSourceRentPlanCopy.java +++ b/src_tenwa/com/tenwa/lease/app/quartzmession/CorpusSourceRentPlanCopy.java @@ -27,86 +27,29 @@ import static java.math.BigDecimal.ROUND_HALF_UP; /** * 资方租金计划拷贝 */ -public class CorpusSourceRentPlanCopy implements Job { +public class CorpusSourceRentPlanCopy extends CorpusSourceFileCopy implements Job { private String contractId; @Override public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException { - String startime = StringFunction.getTodayNow(); Object userId = jobExecutionContext.getTrigger().getJobDataMap().get("CurUserId"); String curUserId = userId == null? "system" : userId.toString(); - BizObjectManager ffpBom = null; - BizObjectManager fyfrpBom = null; - JBOTransaction tx = null; - Transaction Sqlca = null; - try { tx = JBOFactory.createJBOTransaction(); - Sqlca = Transaction.createTransaction(tx); - ffpBom = JBOFactory.getBizObjectManager(FC_FILE_PUSH.CLASS_NAME,tx); - fyfrpBom = JBOFactory.getBizObjectManager(FC_YC_FILE_REPAY_PLAN.CLASS_NAME,tx); - //todo 添加渠道商的选择,哪些需要拷表哪些不需要 - List ffpBoList = ffpBom.createQuery("select ID,FILE_STS from O where FILE_STS='2'").getResultList(true); - if(ffpBoList.size()==0){ - ARE.getLog().info("暂时没有需要拷表的资方文件"); - return; - } - //遍历每个文件 - for(BizObject ffpBo : ffpBoList){ - String fcFileId = ffpBo.getAttribute("ID").toString(); - String sql = "select fr.CONTRACT_ID,O.FC_REQUEST_ID,O.LEND_TERM,O.ANS_REPAYMENT_DATE,O.ANS_PRINCIPAL,O.ANS_INTEREST,ANS_REPAYMENT_MONEY from O left join jbo.oti.FC_REQUEST fr on O.FC_REQUEST_ID=fr.ID where fr.DEL_FLAG='0' and O.FC_FILE_ID=:fcFileId"; - List fyfrpBoList = fyfrpBom.createQuery(sql).setParameter("fcFileId",fcFileId).getResultList(false); - if(fyfrpBoList.size()==0){ - ARE.getLog().error("未找到FC_REQUEST_ID: "+fcFileId+" 对应的资方还款计划"); - throw new Exception("未找到FC_REQUEST_ID: "+fcFileId+" 对应的资方还款计划"); - } - //获取对应的合同 - Map contractMap = this.getContractIdMap(fyfrpBoList); - if(contractMap.size()==0){ - ARE.getLog().error("未找到FC_REQUEST_ID: "+fcFileId+" 对应的合同ID"); - throw new Exception("未找到FC_REQUEST_ID: "+fcFileId+" 对应的合同ID"); - } - //0.租金计划正式表考入历史表 - for(Map.Entry entry: contractMap.entrySet()){ - Map fromCondtion=new HashMap(); - fromCondtion.put("CONTRACT_ID",entry.getKey()); - - Map otherProperty=new HashMap(); - otherProperty.put("MEMO", "安鹏原正式租金计划"); - otherProperty.put("FLOWUNID", entry.getValue()); - - DataOperatorUtil.copyJBOSet(LC_RENT_PLAN.CLASS_NAME, fromCondtion, LC_RENT_PLAN_HIS.CLASS_NAME,null, otherProperty, null, Sqlca); - } - //1.更新租金计划(直接文件每条信息更新,不需要遍历) - this.updateRentPlan(fyfrpBoList,tx); - - for(Map.Entry entry: contractMap.entrySet()){ - String contractId = entry.getKey(); - Map param= this.getParamByContractId(contractId,tx); - //2.更新租金计划剩余本金 - this.updateAllRemainCorpus(contractId,tx); - //3.更新租金计划分润信息 - this.updateSplitSP(param,Sqlca); - //4.插入分润计划 - this.insertProfitPlan(param,tx); - } - ffpBo.setAttributeValue("FILE_STS","3"); - ffpBo.setAttributeValue("FILE_STS_DESC","拷贝成功"); - ffpBom.saveObject(ffpBo); - } - - Sqlca.commit(); + setFileType("RepayPlan"); + doCopy(tx); + tx.commit(); QuartzUtil.insertLog(startime,"com.tenwa.lease.app.quartzmession.CorpusSourceRentPlanCopy", "success", "成功", curUserId); } catch (Exception e) { e.printStackTrace(); QuartzUtil.insertLog(startime,"com.tenwa.lease.app.quartzmession.CorpusSourceRentPlanCopy", "error", "失败", curUserId); try { - if (Sqlca != null) { - Sqlca.rollback(); + if (tx != null) { + tx.rollback(); } } catch (JBOException e1) { e1.printStackTrace(); @@ -116,196 +59,54 @@ public class CorpusSourceRentPlanCopy implements Job { } /** - * 获取对应的合同ID + * 执行自己类所需的操作 * @param fyfrpBoList - * @return - * @throws JBOException - */ - public Map getContractIdMap(List fyfrpBoList) throws JBOException { - Map contractMap = new HashMap<>(); - for(BizObject bo : fyfrpBoList){ - String contractId = bo.getAttribute("CONTRACT_ID").toString(); - String fcRequestId = bo.getAttribute("FC_REQUEST_ID").toString(); - contractMap.put(contractId,fcRequestId); - } - return contractMap; - } - /** - * 租金计划拷贝 - * @param fyfrpBoList 每个回执文件包含的租金计划信息 - * @return 每个回执文件包含的contract_id - * @throws JBOException - * @throws ParseException - */ - public void updateRentPlan(List fyfrpBoList,JBOTransaction tx) throws JBOException, ParseException { - BizObjectManager lrpBom = null; - lrpBom = JBOFactory.getBizObjectManager(LC_RENT_PLAN.CLASS_NAME,tx); - //更新租金计划表 - for(BizObject bo : fyfrpBoList){ - //获取参数 - String contractId = bo.getAttribute("CONTRACT_ID").toString(); - String lendTerm = bo.getAttribute("LEND_TERM").toString(); - String principal = bo.getAttribute("ANS_PRINCIPAL").toString(); - String interest = bo.getAttribute("ANS_INTEREST").toString(); - String repaymentMoney = bo.getAttribute("ANS_REPAYMENT_MONEY").toString(); - String repaymentDate = bo.getAttribute("ANS_REPAYMENT_DATE").toString(); - //转换日期格式 - Date date = new SimpleDateFormat("yyyyMMdd").parse(repaymentDate); - repaymentDate = new SimpleDateFormat("yyyy/MM/dd").format(date); - //更新租金计划表 - BizObject lrpBo = lrpBom.createQuery("CONTRACT_ID=:contractId and PLAN_LIST=:lendTerm").setParameter("contractId",contractId).setParameter("lendTerm",lendTerm).getSingleResult(true); - lrpBo.setAttributeValue("RENT",repaymentMoney); - lrpBo.setAttributeValue("CORPUS",principal); - lrpBo.setAttributeValue("INTEREST",interest); - lrpBo.setAttributeValue("CORPUS_BUSINESS",principal); - lrpBo.setAttributeValue("INTEREST_BUSINESS",interest); - lrpBo.setAttributeValue("PLAN_DATE",repaymentDate); - lrpBo.setAttributeValue("RENT",repaymentMoney); - lrpBom.saveObject(lrpBo); - } - } - - /** - * 更新剩余本金信息 - * @throws JBOException - */ - public void updateAllRemainCorpus(String contractId,JBOTransaction tx) throws JBOException { - BizObjectManager lrpBom = null; - lrpBom = JBOFactory.getBizObjectManager(LC_RENT_PLAN.CLASS_NAME,tx); - BizObjectManager lccBom = null; - lccBom = JBOFactory.getBizObjectManager(LC_CALC_CONDITION.CLASS_NAME,tx); - - BizObject lccBo = lccBom.createQuery("select CLEAN_LEASE_MONEY from O where contract_id=:contractId").setParameter("contractId",contractId).getSingleResult(false); - String clean_lease_money = lccBo.getAttribute("CLEAN_LEASE_MONEY").toString(); - BigDecimal cleanLeaseMoneyBd = new BigDecimal(clean_lease_money); - List lrpBos= lrpBom.createQuery("contract_id=:contractId order by plan_list").setParameter("contractId",contractId).getResultList(true); - for(BizObject bo :lrpBos){ - String corpus = bo.getAttribute("corpus").toString(); - BigDecimal corpusBd = new BigDecimal(corpus); - cleanLeaseMoneyBd = cleanLeaseMoneyBd.subtract(corpusBd).setScale(2,ROUND_HALF_UP); - bo.setAttributeValue("ALL_REMAIN_CORPUS",cleanLeaseMoneyBd.toString()); - lrpBom.saveObject(bo); - } - } - - /** - * 更新剩余本金信息 - * @throws JBOException - */ - public void updateAllRemainCorpus(JBOTransaction tx) throws JBOException { - this.updateAllRemainCorpus(contractId,tx); - } - - /** - * 更新分润信息 - * @throws Exception - */ - public void updateSplitSP(Map param,Transaction Sqlca) throws Exception { - - String splittingRatio = param.get("splittingRatio"); - //必须的判断条件(配置了灵活分润的产品可能没有配置分润) - // 判断顺序,是否分润--》是否灵活分润 - //是否灵活分润在insertRentPlan_SP()方法中判断 - if (!"".equals(splittingRatio) && splittingRatio != null) { - String paymentNumber = param.get("paymentNumber"); - String splitType = param.get("splitType"); - CreateTransactionExecutor cre = new CreateTransactionExecutor(); - cre.setPlannumber(paymentNumber); - cre.insertRentPlan_SP(splittingRatio, Sqlca, splitType); - } - - } - - /** - * 更新分润信息 - * @throws Exception - */ - public void updateSplitSP(JBOTransaction tx) { - Transaction Sqlca = null; - try { - Sqlca = Transaction.createTransaction(tx); - Map param = this.getParamByContractId(contractId,tx); - this.updateSplitSP(param,Sqlca); - } catch (JBOException e) { - e.printStackTrace(); - } catch (Exception e) { - e.printStackTrace(); - }finally { - try { - if (Sqlca != null) { - Sqlca.rollback(); - } - } catch (JBOException e1) { - e1.printStackTrace(); - } - } - } - - /** - * 获取每个合同的参数 - * @return - * @throws Exception - */ - public Map getParamByContractId(String contractId,JBOTransaction tx) throws Exception { - String sql = "select * from vi_corpus_source_param where contractId='" + contractId + "'"; - List> data = DataOperatorUtil.getDataBySql(sql,tx); - return data.get(0); - } - - /** - * 获取每个合同的参数 - * @return - * @throws Exception - */ - public Map getParamByContractId(JBOTransaction tx) throws Exception { - return this.getParamByContractId(contractId,tx); - } - - /** - * 插入分润计划 - * @param param - * @throws JBOException - */ - public void insertProfitPlan(Map param,JBOTransaction tx) throws JBOException { - BizObjectManager lppBom = null; - lppBom = JBOFactory.getBizObjectManager(LC_PROFIT_PLAN.CLASS_NAME,tx); - BizObjectManager lrpBom = null; - lrpBom = JBOFactory.getBizObjectManager(LC_RENT_PLAN.CLASS_NAME,tx); - BizObject lppBo = null; - String paymentNumber = param.get("paymentNumber"); - String corpusSourceRate = param.get("corpusSourceRate"); - List lrpBos = lrpBom.createQuery("PAYMENT_NUMBER=:paymentNumber order by plan_list").setParameter("paymentNumber",paymentNumber).getResultList(false); - for(BizObject bo :lrpBos){ - String rentPlanId = bo.getAttribute("ID").toString(); - String interest = bo.getAttribute("INTEREST").toString(); - String yearRate = bo.getAttribute("YEAR_RATE").toString(); - String profit = new BigDecimal(yearRate).subtract(new BigDecimal(corpusSourceRate)).divide(new BigDecimal(yearRate),6,BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(interest)).setScale(2,BigDecimal.ROUND_HALF_UP).toString(); - lppBo = lppBom.newObject(); - lppBo.setAttributeValue("rent_plan_id",rentPlanId); - lppBo.setAttributeValue("CORPUS_RATE",corpusSourceRate); - lppBo.setAttributeValue("profit",profit); - lppBo.setAttributeValue("inputtime",StringFunction.getTodayNow()); - lppBom.saveObject(lppBo); - } - - } - - /** - * 插入分润计划 * @param tx - * @throws JBOException + * @throws Exception */ - public void insertProfitPlan(JBOTransaction tx) throws Exception { - Map param = this.getParamByContractId(contractId,tx); - this.insertProfitPlan(param,tx); + public void respectiveDo(List fyfrpBoList , JBOTransaction tx) throws Exception { + //获取对应的合同 + Map contractMap = getContractIdMap(fyfrpBoList); + if(contractMap.size()==0){ + String fcFileId = fyfrpBoList.get(0).getAttribute("FC_REQUEST_ID").toString(); + ARE.getLog().error("未找到FC_REQUEST_ID: "+fcFileId+" 对应的合同ID"); + throw new Exception("未找到FC_REQUEST_ID: "+fcFileId+" 对应的合同ID"); + } + Transaction Sqlca = Transaction.createTransaction(tx); + //===顺序不能错=== + //0.将租金计划拷贝到历史表 + copyRentPlanFormatToHis(contractMap,tx); + //1.更新租金计划表(直接文件每条信息更新,不需要遍历) + updateRentPlan(fyfrpBoList,tx); + for(Map.Entry entry : contractMap.entrySet()){ + String contractId = entry.getKey(); + Map param = getParamByContractId(contractId,tx); + //2.更新剩余本金 + updateAllRemainCorpus(contractId,Sqlca); + //3.更新SP分润计划 + updateSplitSP(param,Sqlca); + //4.插入分润计划 + insertProfitPlan(param,tx); + } + } - public String getContractId() { - return contractId; + /** + * 根据文件ID获取《租金计划》信息 + * @param fcFileId + * @return + * @throws Exception + */ + public List getFileInfoByFileId(String fcFileId) throws Exception { + String sql = "select fr.CONTRACT_ID,O.FC_REQUEST_ID,O.LEND_TERM,O.ANS_REPAYMENT_DATE,O.ANS_PRINCIPAL,O.ANS_INTEREST,ANS_REPAYMENT_MONEY from O left join jbo.oti.FC_REQUEST fr on O.FC_REQUEST_ID=fr.ID where fr.DEL_FLAG='0' and O.FC_FILE_ID=:fcFileId"; + BizObjectManager fyfrpBom = JBOFactory.getBizObjectManager(FC_YC_FILE_REPAY_PLAN.CLASS_NAME); + List fyfrpBoList = fyfrpBom.createQuery(sql).setParameter("fcFileId",fcFileId).getResultList(false); + if(fyfrpBoList.size()==0){ + ARE.getLog().error("未找到FC_REQUEST_ID: "+fcFileId+" 对应的资方还款计划"); + throw new Exception("未找到FC_REQUEST_ID: "+fcFileId+" 对应的资方还款计划"); + } + return fyfrpBoList; } - public void setContractId(String contractId) { - this.contractId = contractId; - } } From 427d19b95813e328c234129a0776c26716bd2d7a Mon Sep 17 00:00:00 2001 From: ap007 Date: Thu, 5 Aug 2021 19:08:48 +0800 Subject: [PATCH 2/8] =?UTF-8?q?=E8=B5=84=E6=96=99=E4=B8=8A=E4=BC=A0bug?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9A=E5=BF=98=E8=AE=B0=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E4=BF=9D=E5=AD=98=E7=8A=B6=E6=80=81=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WebContent/Ample/Doc/DocListUploadNew.jsp | 1 + 1 file changed, 1 insertion(+) diff --git a/WebContent/Ample/Doc/DocListUploadNew.jsp b/WebContent/Ample/Doc/DocListUploadNew.jsp index 9065653b2..c129b728a 100644 --- a/WebContent/Ample/Doc/DocListUploadNew.jsp +++ b/WebContent/Ample/Doc/DocListUploadNew.jsp @@ -78,6 +78,7 @@ for(BizObject bo : frfBoList){ bo.setAttributeValue("FC_FILE_STS","2"); bo.setAttributeValue("FC_FILE_STS_DESC","用户添加待补传"); + frfBom.saveObject(bo); } BizObject frfBo = frfBom.newObject(); frfBo.setAttributeValue("FC_REQUEST_ID",params.get("fcRequestId")); From 4b4b5306d8fc84daa20b4b69af837ba5558acf97 Mon Sep 17 00:00:00 2001 From: ap007 Date: Fri, 13 Aug 2021 18:43:52 +0800 Subject: [PATCH 3/8] =?UTF-8?q?=E8=B4=B7=E5=90=8E=E5=88=9D=E7=89=88?= =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WebContent/WEB-INF/etc/jbo/jbo_oti.xml | 80 ++++- .../WEB-INF/etc/sql/insertIntoCashFlow.xml | 91 ++++++ .../settleLoan/CorpusSourceSettleLoanInfo.jsp | 26 ++ .../settleLoan/CorpusSourceSettleLoanList.jsp | 33 ++ src_jbo/jbo/oti/FC_REQUEST_CHANNEL_LOG.java | 51 ++++ src_jbo/jbo/oti/FC_YC_FILE_REPAY_RESULT.java | 79 +++++ src_jbo/jbo/oti/FC_YC_PREPAY_QUERY.java | 108 +++++++ .../quartzmession/CorpusSourceFileCopy.java | 288 +++++++++++++++--- .../CorpusSourceRentPlanCopy.java | 3 +- .../CorpusSourceRentResultCopy.java | 214 +++++++++++++ 10 files changed, 936 insertions(+), 37 deletions(-) create mode 100644 WebContent/WEB-INF/etc/sql/insertIntoCashFlow.xml create mode 100644 WebContent/com/tenwa/apzl/settleLoan/CorpusSourceSettleLoanInfo.jsp create mode 100644 WebContent/com/tenwa/apzl/settleLoan/CorpusSourceSettleLoanList.jsp create mode 100644 src_jbo/jbo/oti/FC_REQUEST_CHANNEL_LOG.java create mode 100644 src_jbo/jbo/oti/FC_YC_FILE_REPAY_RESULT.java create mode 100644 src_jbo/jbo/oti/FC_YC_PREPAY_QUERY.java create mode 100644 src_tenwa/com/tenwa/lease/app/quartzmession/CorpusSourceRentResultCopy.java diff --git a/WebContent/WEB-INF/etc/jbo/jbo_oti.xml b/WebContent/WEB-INF/etc/jbo/jbo_oti.xml index d7190b017..6f26d0323 100644 --- a/WebContent/WEB-INF/etc/jbo/jbo_oti.xml +++ b/WebContent/WEB-INF/etc/jbo/jbo_oti.xml @@ -392,7 +392,7 @@ - + @@ -410,6 +410,65 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -425,5 +484,24 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/WebContent/WEB-INF/etc/sql/insertIntoCashFlow.xml b/WebContent/WEB-INF/etc/sql/insertIntoCashFlow.xml new file mode 100644 index 000000000..251916275 --- /dev/null +++ b/WebContent/WEB-INF/etc/sql/insertIntoCashFlow.xml @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + dataSource + false + +
+
\ No newline at end of file diff --git a/WebContent/com/tenwa/apzl/settleLoan/CorpusSourceSettleLoanInfo.jsp b/WebContent/com/tenwa/apzl/settleLoan/CorpusSourceSettleLoanInfo.jsp new file mode 100644 index 000000000..4e1a3ea38 --- /dev/null +++ b/WebContent/com/tenwa/apzl/settleLoan/CorpusSourceSettleLoanInfo.jsp @@ -0,0 +1,26 @@ +<%@ page contentType="text/html; charset=GBK"%><%@ + include file="/Frame/resources/include/include_begin_info.jspf"%><% + + String fcPrepayQueryID = CurPage.getParameter("fcPrepayQueryID"); + + ASObjectModel doTemp = new ASObjectModel("FC_YC_PREPAY_QUERY"); + doTemp.setJboWhere("id='"+fcPrepayQueryID+"'"); + + ASObjectWindow dwTemp = new ASObjectWindow(CurPage,doTemp,request); + dwTemp.Style="2"; //设置DW风格 1:Grid 2:Freeform + dwTemp.ReadOnly = "1"; //设置是否只读 1:只读 0:可写 + dwTemp.genHTMLObjectWindow(""); + + String sButtons[][] = { + {"true","","Button","返回","返回","returnList()","","","",""}, + }; +%><%@include file="/Frame/resources/include/ui/include_info.jspf"%> + +<%@ include file="/Frame/resources/include/include_end.jspf"%> \ No newline at end of file diff --git a/WebContent/com/tenwa/apzl/settleLoan/CorpusSourceSettleLoanList.jsp b/WebContent/com/tenwa/apzl/settleLoan/CorpusSourceSettleLoanList.jsp new file mode 100644 index 000000000..c8abe1a46 --- /dev/null +++ b/WebContent/com/tenwa/apzl/settleLoan/CorpusSourceSettleLoanList.jsp @@ -0,0 +1,33 @@ +<%@ page contentType="text/html; charset=GBK"%> +<%@ include file="/Frame/resources/include/include_begin_list.jspf"%><% + /* + Author: undefined 2021-08-04 + Content: + History Log: + */ + ASObjectModel doTemp = new ASObjectModel("FC_YC_PREPAY_QUERY"); + ASObjectWindow dwTemp = new ASObjectWindow(CurPage,doTemp,request); + dwTemp.Style="1"; //--设置为Grid风格-- + dwTemp.ReadOnly = "1"; //只读模式 + dwTemp.setPageSize(20); + dwTemp.genHTMLObjectWindow(""); + + //0、是否展示 1、 权限控制 2、 展示类型 3、按钮显示名称 4、按钮解释文字 5、按钮触发事件代码 6、 7、 8、 9、图标,CSS层叠样式 10、风格 + String sButtons[][] = { + {"true","","Button","详情","详情","viewAndEdit()","","","","btn_icon_detail",""}, + }; +%><%@include file="/Frame/resources/include/ui/include_list.jspf"%> + +<%@ include file="/Frame/resources/include/include_end.jspf"%> \ No newline at end of file diff --git a/src_jbo/jbo/oti/FC_REQUEST_CHANNEL_LOG.java b/src_jbo/jbo/oti/FC_REQUEST_CHANNEL_LOG.java new file mode 100644 index 000000000..7921750f1 --- /dev/null +++ b/src_jbo/jbo/oti/FC_REQUEST_CHANNEL_LOG.java @@ -0,0 +1,51 @@ +package jbo.oti; + +/** +* 接口资料表 - JBO命名常量类

+* Note: This file is generated by ADE tools, dont modify it.
+ +*/ +public interface FC_REQUEST_CHANNEL_LOG { + /** + * 接口资料表

+ * 代表本类映射的BizObjectClass + */ + public static final String CLASS_NAME = "jbo.oti.LC_PROFIT_PLAN"; + /** + * 唯一标识 STRING(32)
+ */ + public static final String ID = "ID"; + /** + * 资方请求id STRING(32)
+ */ + public static final String FC_REQUEST_ID = "FC_REQUEST_ID"; + /** + * 修改前资方编号 STRING(32)
+ */ + public static final String PRE_CHANNEL_NO = "PRE_CHANNEL_NO"; + /** + * 修改前资方名称 STRING(32)
+ */ + public static final String PRE_CHANNEL_NAME = "PRE_CHANNEL_NAME"; + /** + * 修改后资方编号 STRING(32)
+ */ + public static final String CHANNEL_NO = "CHANNEL_NO"; + /** + * 修改后资方名称 STRING(32)
+ */ + public static final String CHANNEL_NAME = "CHANNEL_NAME"; + /** + * 描述 STRING(32)
+ */ + public static final String REMARK = "REMARK"; + /** + * 变更结果 STRING(32)
+ */ + public static final String CHANGE_RESULT = "CHANGE_RESULT"; + /** + * 创建时间 STRING(32)
+ */ + public static final String CREATETIME = "CREATETIME"; + +} \ No newline at end of file diff --git a/src_jbo/jbo/oti/FC_YC_FILE_REPAY_RESULT.java b/src_jbo/jbo/oti/FC_YC_FILE_REPAY_RESULT.java new file mode 100644 index 000000000..814f1ed02 --- /dev/null +++ b/src_jbo/jbo/oti/FC_YC_FILE_REPAY_RESULT.java @@ -0,0 +1,79 @@ +package jbo.oti; + +/** +* 接口资料表 - JBO命名常量类

+* Note: This file is generated by ADE tools, dont modify it.
+ +*/ +public interface FC_YC_FILE_REPAY_RESULT { + /** + * 接口资料表

+ * 代表本类映射的BizObjectClass + */ + public static final String CLASS_NAME = "jbo.oti.FC_YC_FILE_REPAY_RESULT"; + /** + * 唯一标识 STRING(32)
+ */ + public static final String ID = "ID"; + /** + * 文件ID STRING(32)
+ */ + public static final String FC_FILE_ID = "FC_FILE_ID"; + /** + * 放款请求编号 STRING(32)
+ */ + public static final String LOAN_NO = "LOAN_NO"; + /** + * 期次 STRING(32)
+ */ + public static final String LEND_TERM = "TERM_NO"; + /** + * 还款日期 STRING(32)
+ */ + public static final String ANS_REPAYMENT_DATE = "NEW_REPAY_DATE"; + /** + * 本金 STRING(32)
+ */ + public static final String ANS_PRINCIPAL = "ALR_PRINCIPAL"; + /** + * 利息 STRING(32)
+ */ + public static final String ANS_INTEREST = "ALR_INTEREST"; + /** + * 罚息 STRING(32)
+ */ + public static final String ALR_PENALTY = "ALR_PENALTY"; + /** + * 归还合计 STRING(32)
+ */ + public static final String ANS_REPAYMENT_MONEY = "ALR_REPAYMENT_MONEY"; + /** + * 还款标识:0-当期正常结清 、当期逾期结清、1-提前部分还款、2-逾期、3-提前结清 STRING(32)
+ */ + public static final String REPAYMENT_FLAG = "REPAYMENT_FLAG"; + /** + * 还款来源标识:0:借款人本人账户;1:非借款人本人账户 STRING(32)
+ */ + public static final String REPAYMENT_SOURCE = "REPAYMENT_SOURCE"; + /** + * 提前还款费用 STRING(32)
+ */ + public static final String TRADE_FEE = "TRADE_FEE"; + /** + * 还款账号 STRING(32)
+ */ + public static final String REPAYMENT_ACCOUNT_NO = "REPAYMENT_ACCOUNT_NO"; + /** + * 流水号 STRING(32)
+ */ + public static final String FLOWNO = "FLOWNO"; + /** + * 创建时间 STRING(32)
+ */ + public static final String CREATE_TIME = "CREATE_TIME"; + /** + * 修改时间 STRING(32)
+ */ + public static final String UPDATE_TIME = "UPDATE_TIME"; + +} \ No newline at end of file diff --git a/src_jbo/jbo/oti/FC_YC_PREPAY_QUERY.java b/src_jbo/jbo/oti/FC_YC_PREPAY_QUERY.java new file mode 100644 index 000000000..397b2b9ea --- /dev/null +++ b/src_jbo/jbo/oti/FC_YC_PREPAY_QUERY.java @@ -0,0 +1,108 @@ +package jbo.oti; + +import java.lang.String; + +/** +* 提前结清试算接口内容 - JBO命名常量类

+* Note: This file is generated by ADE tools, dont modify it.
+ +*/ +public interface FC_YC_PREPAY_QUERY{ + /** + * 提前结清试算接口内容

+ * 代表本类映射的BizObjectClass + */ + public static final String CLASS_NAME = "jbo.oti.FC_YC_PREPAY_QUERY"; + /** + * 唯一标识 STRING(32)
+ */ + public static final String ID = "ID"; + /** + * 资金渠道文件ID STRING(32)
+ */ + public static final String FC_FILE_ID = "FC_FILE_ID"; + /** + * 资金渠道申请ID STRING(32)
+ */ + public static final String FC_REQUEST_ID = "FC_REQUEST_ID"; + /** + * 放款申请编号 STRING(32)
+ */ + public static final String LOAN_NO = "LOAN_NO"; + /** + * 贷款余额 STRING(32)
+ */ + public static final String LOAN_CAPITAL_BALANCE = "LOAN_CAPITAL_BALANCE"; + /** + * STRING(32)
+ */ + public static final String FC_FILE_PUSH_NAME = "FC_FILE_PUSH_NAME"; + /** + * 币种 STRING(32)
+ */ + public static final String CURRENCY = "CURRENCY"; + /** + * 贷款利率 STRING(32)
+ */ + public static final String LOAN_RATE = "LOAN_RATE"; + /** + * 还款方式 STRING(32)
+ */ + public static final String REPAY_KIND = "REPAY_KIND"; + /** + * 贷款起期 STRING(32)
+ */ + public static final String LOAN_BEGIN_DATE = "LOAN_BEGIN_DATE"; + /** + * 贷款止期 STRING(32)
+ */ + public static final String LOAN_END_DATE = "LOAN_END_DATE"; + /** + * 还款账号 STRING(32)
+ */ + public static final String REPAY_ACC_NO = "REPAY_ACC_NO"; + /** + * 还款账号余额 STRING(32)
+ */ + public static final String REPAY_BALANCE = "REPAY_BALANCE"; + /** + * 提前还款类型 STRING(32)
+ */ + public static final String REPAY_TYPE = "REPAY_TYPE"; + /** + * 当期应还本息金额 STRING(32)
+ */ + public static final String CURRENT_CAPITAL_BALANCE = "CURRENT_CAPITAL_BALANCE"; + /** + * 当前应还利息 STRING(32)
+ */ + public static final String CURRENT_CAPITAL_INT = "CURRENT_CAPITAL_INT"; + /** + * 拖欠本金 STRING(32)
+ */ + public static final String OVERDUE_CAPITAL_BALANCE = "OVERDUE_CAPITAL_BALANCE"; + /** + * 拖欠利息 STRING(32)
+ */ + public static final String OVERDUE_CAPITAL_INT = "OVERDUE_CAPITAL_INT"; + /** + * 申请日期 STRING(32)
+ */ + public static final String RECORD_DATE = "RECORD_DATE"; + /** + * 归还本息金额 STRING(32)
+ */ + public static final String PREREPAY_AMOUNT = "PREREPAY_AMOUNT"; + /** + * 提前归还本金金额 STRING(32)
+ */ + public static final String PREREPAY_AMOUNT1 = "PREREPAY_AMOUNT1"; + /** + * 创建时间 STRING(32)
+ */ + public static final String CREATE_TIME = "CREATE_TIME"; + /** + * 修改时间 STRING(32)
+ */ + public static final String UPDATE_TIME = "UPDATE_TIME"; +} \ No newline at end of file diff --git a/src_tenwa/com/tenwa/lease/app/quartzmession/CorpusSourceFileCopy.java b/src_tenwa/com/tenwa/lease/app/quartzmession/CorpusSourceFileCopy.java index 691cb7e35..71d50f68d 100644 --- a/src_tenwa/com/tenwa/lease/app/quartzmession/CorpusSourceFileCopy.java +++ b/src_tenwa/com/tenwa/lease/app/quartzmession/CorpusSourceFileCopy.java @@ -7,10 +7,13 @@ import com.amarsoft.awe.util.Transaction; import com.base.util.QuartzUtil; import com.tenwa.comm.util.jboutil.DataOperatorUtil; import com.tenwa.reckon.executor.CreateTransactionExecutor; -import jbo.app.tenwa.calc.LC_CALC_CONDITION; -import jbo.app.tenwa.calc.LC_RENT_PLAN; -import jbo.app.tenwa.calc.LC_RENT_PLAN_HIS; +import jbo.app.tenwa.calc.*; +import jbo.com.tenwa.lease.comm.LB_CONTRACT_INFO; +import jbo.com.tenwa.lease.comm.LB_CONTRACT_INFO_TEMP; +import jbo.com.tenwa.lease.comm.LB_PROJECT_INFO; +import jbo.com.tenwa.lease.comm.LB_PROJECT_INFO_TEMP; import jbo.oti.FC_FILE_PUSH; +import jbo.oti.FC_REQUEST_CHANNEL_LOG; import jbo.oti.FC_YC_FILE_REPAY_PLAN; import jbo.oti.LC_PROFIT_PLAN; import org.quartz.Job; @@ -20,10 +23,7 @@ import org.quartz.JobExecutionException; import java.math.BigDecimal; import java.text.ParseException; import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; import static java.math.BigDecimal.ROUND_HALF_UP; @@ -35,11 +35,8 @@ public class CorpusSourceFileCopy { private String contractId; private String fileType; - public void doCopy(JBOTransaction tx) throws JobExecutionException { + public void doCopy(JBOTransaction tx) throws Exception { BizObjectManager ffpBom = null; - Transaction Sqlca = null; - try { - Sqlca = Transaction.createTransaction(tx); ffpBom = JBOFactory.getBizObjectManager(FC_FILE_PUSH.CLASS_NAME,tx); //todo 添加渠道商的选择,哪些需要拷表哪些不需要 String fileSql = "select ID,FILE_STS from O where FILE_TYPE='"+fileType+"' and FILE_STS='2'"; @@ -55,18 +52,6 @@ public class CorpusSourceFileCopy { ffpBo.setAttributeValue("FILE_STS_DESC","拷贝成功"); ffpBom.saveObject(ffpBo); } - Sqlca.commit(); - } catch (Exception e) { - e.printStackTrace(); - try { - if (Sqlca != null) { - Sqlca.rollback(); - } - } catch (JBOException e1) { - e1.printStackTrace(); - } - throw new JobExecutionException(e); - } } /** @@ -100,7 +85,7 @@ public class CorpusSourceFileCopy { Transaction Sqlca = Transaction.createTransaction(tx); //===顺序不能错=== //0.将租金计划拷贝到历史表 - copyRentPlanFormatToHis(contractMap,tx); + copyRentPlanFormatToHis(contractMap,"安鹏原正式租金计划",tx); //1.更新租金计划表(直接文件每条信息更新,不需要遍历) updateRentPlan(fyfrpBoList,tx); for(Map.Entry entry : contractMap.entrySet()){ @@ -139,18 +124,79 @@ public class CorpusSourceFileCopy { * @param tx * @throws Exception */ - public void copyRentPlanFormatToHis(Map contractMap ,JBOTransaction tx) throws Exception { + public void copyRentPlanFormatToHis(Map contractMap ,String memo,JBOTransaction tx) throws Exception { for(Map.Entry entry: contractMap.entrySet()){ - Map fromCondtion=new HashMap(); - fromCondtion.put("CONTRACT_ID",entry.getKey()); - - Map otherProperty=new HashMap(); - otherProperty.put("MEMO", "安鹏原正式租金计划"); - otherProperty.put("FLOWUNID", entry.getValue()); - - DataOperatorUtil.copyJBOSet(LC_RENT_PLAN.CLASS_NAME, fromCondtion, LC_RENT_PLAN_HIS.CLASS_NAME,null, otherProperty, null, tx); + this.copyRentPlanFormatToHis(entry.getKey(),entry.getValue(),memo,tx); } } + + /** + * copy租金计划到历史表 + * @param contractId + * @param fcRequestId + * @param tx + * @throws Exception + */ + public void copyRentPlanFormatToHis(String contractId,String fcRequestId,String memo,JBOTransaction tx) throws Exception { + + Map fromCondtion=new HashMap(); + fromCondtion.put("CONTRACT_ID",contractId); + + Map otherProperty=new HashMap(); + otherProperty.put("MEMO", memo); + otherProperty.put("FLOWUNID", fcRequestId); + + copyRentPlanFormatToHis(fromCondtion,null,otherProperty,tx); + + } + + /** + * copy租金计划到历史表 + * @param fromCondtion + * @param toCondtion + * @param otherProperty + * @param tx + * @throws Exception + */ + public void copyRentPlanFormatToHis(Map fromCondtion,Map toCondtion,Map otherProperty,JBOTransaction tx) throws Exception { + + DataOperatorUtil.copyJBOSet(LC_RENT_PLAN.CLASS_NAME, fromCondtion, LC_RENT_PLAN_HIS.CLASS_NAME,toCondtion, otherProperty, null, tx); + + } + + /** + * copy租金计划到历史表 + * @param contractId + * @param fcRequestId + * @param tx + * @throws Exception + */ + public void copyCashFlowFormatToHis(String contractId,String fcRequestId,JBOTransaction tx) throws Exception { + + Map fromCondtion=new HashMap(); + fromCondtion.put("CONTRACT_ID",contractId); + + Map otherProperty=new HashMap(); + otherProperty.put("FLOWUNID", fcRequestId); + + copyCashFlowFormatToHis(fromCondtion,null,otherProperty,tx); + + } + + /** + * copy租金计划到历史表 + * @param fromCondtion + * @param toCondtion + * @param otherProperty + * @param tx + * @throws Exception + */ + public void copyCashFlowFormatToHis(Map fromCondtion,Map toCondtion,Map otherProperty,JBOTransaction tx) throws Exception { + + DataOperatorUtil.copyJBOSet(LC_CASH_FLOW.CLASS_NAME, fromCondtion, LC_CASH_FLOW_HIS.CLASS_NAME,toCondtion, otherProperty, null, tx); + + } + /** * 获取对应的合同ID * @param fyfrpBoList @@ -197,7 +243,6 @@ public class CorpusSourceFileCopy { lrpBo.setAttributeValue("CORPUS_BUSINESS",principal); lrpBo.setAttributeValue("INTEREST_BUSINESS",interest); lrpBo.setAttributeValue("PLAN_DATE",repaymentDate); - lrpBo.setAttributeValue("RENT",repaymentMoney); lrpBom.saveObject(lrpBo); } } @@ -337,6 +382,181 @@ public class CorpusSourceFileCopy { insertProfitPlan(param,tx); } + /** + * 变更资方 + * @param param + * @param tx + * @throws JBOException + */ + public void changeCorpusSource(Map param,JBOTransaction tx) throws JBOException { + String sql = "update O set corpus_source='AP' where "; + JBOFactory.getBizObjectManager(LB_PROJECT_INFO.CLASS_NAME,tx).createQuery(sql+"id=:projectId").setParameter("projectId",param.get("projectId")).executeUpdate(); + JBOFactory.getBizObjectManager(LB_CONTRACT_INFO.CLASS_NAME,tx).createQuery(sql+"project_id=:projectId").setParameter("projectId",param.get("projectId")).executeUpdate(); + JBOFactory.getBizObjectManager(LB_PROJECT_INFO_TEMP.CLASS_NAME,tx).createQuery(sql+"project_no=:projectNo").setParameter("projectNo",param.get("projectNo")).executeUpdate(); + JBOFactory.getBizObjectManager(LB_CONTRACT_INFO_TEMP.CLASS_NAME,tx).createQuery(sql+"project_id=:projectId").setParameter("projectId",param.get("projectId")).executeUpdate(); + + } + + /** + * 资方变更插入日志 + * @param param + * @param tx + * @throws JBOException + */ + public void saveCorpusSourceChangeLog(Map param ,int result,JBOTransaction tx) throws JBOException { + BizObjectManager frclBom = JBOFactory.getBizObjectManager(FC_REQUEST_CHANNEL_LOG.CLASS_NAME,tx); + BizObject frclBo = frclBom.newObject(); + frclBo.setAttributeValue("FC_REQUEST_ID",param.get("fcRequestId")); + frclBo.setAttributeValue("PRE_CHANNEL_NO",param.get("channelNo")); + frclBo.setAttributeValue("PRE_CHANNEL_NAME",param.get("channelName")); + frclBo.setAttributeValue("CHANNEL_NO","AP"); + frclBo.setAttributeValue("CHANNEL_NAME","安鹏自有资金"); + frclBo.setAttributeValue("REMARK","回购为安鹏自有资金"); + frclBo.setAttributeValue("CHANGE_RESULT",result); + frclBo.setAttributeValue("CREATETIME",StringFunction.getTodayNow()); + frclBom.saveObject(frclBo); + } + + /** + * 更新租金计划(提前结清) + * @param param + * @param tx + * @throws JBOException + */ + public void updateSettleRentPlan(Map param ,JBOTransaction tx) throws JBOException { + BizObjectManager lrpBom = JBOFactory.getBizObjectManager(LC_RENT_PLAN.CLASS_NAME,tx); + //更新租金计划信息(提前结清当期期次) + BizObject lrpBo = lrpBom.createQuery("contract_id=:contractId and plan_list=:planList").setParameter("contractId",param.get("contractId")).setParameter("planList",param.get("termNo")).getSingleResult(true); + lrpBo.setAttributeValue("PLAN_DATE",param.get("repaymentDate")); + lrpBo.setAttributeValue("RENT",param.get("rent")); + lrpBo.setAttributeValue("CORPUS",param.get("principal")); + lrpBo.setAttributeValue("INTEREST",param.get("interest")); + lrpBo.setAttributeValue("CORPUS_BUSINESS",param.get("principal")); + lrpBo.setAttributeValue("INTEREST_BUSINESS",param.get("interest")); + lrpBo.setAttributeValue("ALL_REMAIN_CORPUS",param.get("0.00")); + lrpBom.saveObject(lrpBo); + //删除租金计划信息(大于提前结清当期期次的) + lrpBom.createQuery("delete from O where contract_id=:contractId and plan_list>:plan_list").setParameter("contractId",param.get("contractId")).setParameter("planList",param.get("termNo")).executeUpdate(); + } + + /** + * 获取插入租金实收表的所有参数 + * @param fyfrrBoList + * @param tx + * @return + * @throws Exception + */ + public List> getAllParam(List fyfrrBoList, JBOTransaction tx) throws Exception { + List> rentIncomeParams = new ArrayList<>(); + Set contractIdSet = new HashSet<>(); + BizObjectManager lrpBom = JBOFactory.getBizObjectManager(LC_RENT_PLAN.CLASS_NAME); + BizObjectQuery lrpBomQuery = lrpBom.createQuery("select ID from O where contract_id=:contractId and plan_list=:planList"); + for(BizObject bo : fyfrrBoList){ + Map rentIncomeParam = new HashMap<>(); + //获取参数 + String fcRequestId = bo.getAttribute("FC_REQUEST_ID").toString(); + String contractId = bo.getAttribute("CONTRACT_ID").toString(); + String termNo = bo.getAttribute("TERM_NO").toString(); + String principal = bo.getAttribute("ALR_PRINCIPAL").toString(); + String interest = bo.getAttribute("ALR_INTEREST").toString(); + String penalty = bo.getAttribute("ALR_PENALTY").toString(); + String rent = new BigDecimal(principal).add(new BigDecimal(interest)).toString(); + String repaymentMoney = bo.getAttribute("ALR_REPAYMENT_MONEY").toString(); + String repaymentDate = bo.getAttribute("NEW_REPAY_DATE").toString(); + //转换日期格式 + Date date = new SimpleDateFormat("yyyyMMdd").parse(repaymentDate); + repaymentDate = new SimpleDateFormat("yyyy/MM/dd").format(date); + String rentPlanId = null; + if(!contractIdSet.contains(contractId)){ + //获取对应租金计划Id + BizObject lrpBo = lrpBomQuery.setParameter("contractId",contractId).setParameter("planList",termNo).getSingleResult(false); + rentPlanId = lrpBo.getAttribute("ID").toString(); + //将由合同id获取的参数放进来 + Map param = getParamByContractId(contractId,tx); + rentIncomeParam.putAll(param); + + contractIdSet.add(contractId); + } + //存入参数 + rentIncomeParam.put("fcRequestId",fcRequestId); + rentIncomeParam.put("contractId",contractId); + rentIncomeParam.put("termNo",termNo); + rentIncomeParam.put("rentPlanId",rentPlanId); + rentIncomeParam.put("rent",rent); + rentIncomeParam.put("principal",principal); + rentIncomeParam.put("interest",interest); + rentIncomeParam.put("penalty",penalty); + rentIncomeParam.put("repaymentMoney",repaymentMoney); + rentIncomeParam.put("repaymentDate",repaymentDate); + + rentIncomeParams.add(rentIncomeParam); + } + return rentIncomeParams; + } + + /** + * 插入租金实收表 + * @param param + * @param tx + * @throws Exception + */ + public void insertRentIncome(Map param, JBOTransaction tx) throws Exception { + BizObjectManager lriBom = JBOFactory.getBizObjectManager(LC_RENT_INCOME.CLASS_NAME,tx); + + BizObject lriBo = lriBom.newObject(); + lriBo.setAttributeValue("PROJECT_ID",param.get("projectId")); + lriBo.setAttributeValue("PROJECT_PLAN_NUMBER",param.get("projectPlanNumber")); + lriBo.setAttributeValue("CONTRACT_ID",param.get("contractId")); + lriBo.setAttributeValue("CONTRACT_PLAN_NUMBER",param.get("contractPlanNumber")); + lriBo.setAttributeValue("PAYMENT_NUMBER",param.get("paymentNumber")); + lriBo.setAttributeValue("PLAN_ID",param.get("rentPlanId")); + lriBo.setAttributeValue("CORPUS_ADJUST","0.00"); + lriBo.setAttributeValue("INTEREST_ADJUST","0.00"); + lriBo.setAttributeValue("PENALTY_ADJUST","0.00"); + lriBo.setAttributeValue("SETTLE_METHOD","settlemethod6"); + lriBo.setAttributeValue("HIRE_BANK",param.get("bankName")); + lriBo.setAttributeValue("HIRE_ACCOUNT",param.get("account")); + lriBo.setAttributeValue("HIRE_NUMBER",param.get("accNumber")); + lriBo.setAttributeValue("ROLL_BACK","0"); + lriBo.setAttributeValue("charge_way","PSBC"); + lriBo.setAttributeValue("RENT",param.get("repaymentMoney")); + lriBo.setAttributeValue("CORPUS",param.get("principal")); + lriBo.setAttributeValue("INTEREST",param.get("interest")); + lriBo.setAttributeValue("PENALTY",param.get("penalty")); + lriBo.setAttributeValue("PLAN_LIST",param.get("termNo")); + lriBo.setAttributeValue("HIRE_LIST","1"); + lriBo.setAttributeValue("PLAN_DATE",param.get("repaymentDate")); + lriBo.setAttributeValue("INPUTUSERID","8009U00000002");//定时任务管理员 + lriBo.setAttributeValue("INPUTTIME",StringFunction.getTodayNow()); + lriBom.saveObject(lriBo); + } + + /** + * 更新租金计划状态 + * @param param + * @param tx + * @throws JBOException + */ + public void updateRentPlanStatus(Map param ,JBOTransaction tx) throws JBOException { + BizObjectManager lrpBom = JBOFactory.getBizObjectManager(LC_RENT_PLAN.CLASS_NAME,tx); + BizObject lrpBo = lrpBom.createQuery("contract_id=:contractId and plan_list=:planList").setParameter("contractId",param.get("contractId")).setParameter("planList",param.get("termNo")).getSingleResult(true); + lrpBo.setAttributeValue("COLLECT_STATUS","批量收款"); + lrpBo.setAttributeValue("COLLECT_MSG","邮储代收"); + lrpBom.saveObject(lrpBo); + } + /** + * 更新合同状态 + * @param contractId + * @param tx + * @throws JBOException + */ + public void updateContractStatus(String contractId ,String sts,JBOTransaction tx) throws JBOException { + BizObjectManager lciBom = JBOFactory.getBizObjectManager(LB_CONTRACT_INFO.CLASS_NAME,tx); + BizObject lciBo = lciBom.createQuery("ID=:contractId").setParameter("contractId",contractId).getSingleResult(true); + lciBo.setAttributeValue("CONTRACT_STATUS",sts); + lciBom.saveObject(lciBo); + } + public String getContractId() { return contractId; } diff --git a/src_tenwa/com/tenwa/lease/app/quartzmession/CorpusSourceRentPlanCopy.java b/src_tenwa/com/tenwa/lease/app/quartzmession/CorpusSourceRentPlanCopy.java index 831f46ba0..96d93ccc5 100644 --- a/src_tenwa/com/tenwa/lease/app/quartzmession/CorpusSourceRentPlanCopy.java +++ b/src_tenwa/com/tenwa/lease/app/quartzmession/CorpusSourceRentPlanCopy.java @@ -75,7 +75,7 @@ public class CorpusSourceRentPlanCopy extends CorpusSourceFileCopy implements Jo Transaction Sqlca = Transaction.createTransaction(tx); //===顺序不能错=== //0.将租金计划拷贝到历史表 - copyRentPlanFormatToHis(contractMap,tx); + copyRentPlanFormatToHis(contractMap,"安鹏原正式租金计划",tx); //1.更新租金计划表(直接文件每条信息更新,不需要遍历) updateRentPlan(fyfrpBoList,tx); for(Map.Entry entry : contractMap.entrySet()){ @@ -108,5 +108,4 @@ public class CorpusSourceRentPlanCopy extends CorpusSourceFileCopy implements Jo return fyfrpBoList; } - } diff --git a/src_tenwa/com/tenwa/lease/app/quartzmession/CorpusSourceRentResultCopy.java b/src_tenwa/com/tenwa/lease/app/quartzmession/CorpusSourceRentResultCopy.java new file mode 100644 index 000000000..43ff9ebbe --- /dev/null +++ b/src_tenwa/com/tenwa/lease/app/quartzmession/CorpusSourceRentResultCopy.java @@ -0,0 +1,214 @@ +package com.tenwa.lease.app.quartzmession; + +import com.amarsoft.app.als.sys.tools.Tools; +import com.amarsoft.app.util.ProductParamUtil; +import com.amarsoft.app.util.XMLDataUtil; +import com.amarsoft.are.ARE; +import com.amarsoft.are.jbo.*; +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.comm.util.jboutil.DataOperatorUtil; +import com.tenwa.reckon.util.DateUtils; +import com.tenwa.reckon.util.IRRCalculateUtil; +import com.tenwa.reckon.util.IrrTools; +import jbo.app.tenwa.calc.LC_RENT_INCOME; +import jbo.app.tenwa.calc.LC_RENT_PLAN; +import jbo.com.tenwa.lease.comm.LB_CONTRACT_INFO; +import jbo.com.tenwa.lease.comm.LB_CONTRACT_INFO_TEMP; +import jbo.com.tenwa.lease.comm.LB_PROJECT_INFO; +import jbo.com.tenwa.lease.comm.LB_PROJECT_INFO_TEMP; +import jbo.oti.FC_REQUEST; +import jbo.oti.FC_REQUEST_CHANNEL_LOG; +import jbo.oti.FC_YC_FILE_REPAY_RESULT; +import org.quartz.Job; +import org.quartz.JobExecutionContext; +import org.quartz.JobExecutionException; + +import java.math.BigDecimal; +import java.text.SimpleDateFormat; +import java.util.*; + + +/** + * 资方租金计划拷贝 + */ +public class CorpusSourceRentResultCopy extends CorpusSourceFileCopy implements Job { + + @Override + public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException { + + String startime = StringFunction.getTodayNow(); + Object userId = jobExecutionContext.getTrigger().getJobDataMap().get("CurUserId"); + String curUserId = userId == null? "system" : userId.toString(); + + JBOTransaction tx = null; + try { + tx = JBOFactory.createJBOTransaction(); + setFileType("RepayResult"); + doCopy(tx); + tx.commit(); + QuartzUtil.insertLog(startime,"com.tenwa.lease.app.quartzmession.CorpusSourceRentPlanCopy", "success", "成功", curUserId); + } catch (Exception e) { + e.printStackTrace(); + QuartzUtil.insertLog(startime,"com.tenwa.lease.app.quartzmession.CorpusSourceRentPlanCopy", "error", "失败", curUserId); + try { + if (tx != null) { + tx.rollback(); + } + } catch (JBOException e1) { + e1.printStackTrace(); + } + throw new JobExecutionException(e); + } + } + + /** + * 执行自己类所需的操作 + * @param fyfrpBoList + * @param tx + * @throws Exception + */ + @Override + public void respectiveDo(List fyfrpBoList , JBOTransaction tx) throws Exception { + Transaction Sqlca = Transaction.createTransaction(tx); + //0.获取所有参数(以文件信息为基础,将合同参数补充进去) + List> allParam = this.getAllParam(fyfrpBoList,tx); + for(Map param : allParam){ + //1.插入租金实收表 + this.insertRentIncome(param,tx); + // 2.0根据状态的不同,来进行不同的操作 + //2.1如果当期正常结清或者当期逾期结清, + if("0".equals(param.get("REPAYMENT_FLAG"))){ + updateRentPlanStatus(param,tx); + //2.2如果提前结清 并且 为借款人本人账户,则视为客户本人提前结清,直接变更租金计划表租金计划 + }else if("3".equals(param.get("REPAYMENT_FLAG"))&&"0".equals(param.get("REPAYMENT_SOURCE"))){ + //租金计划,现金流存历史表 + //每个合同只有一次提前结清,只有提前结清才会走这里,所以按照合同id来执行 + copyRentPlanFormatToHis(param.get("contractId"),param.get("fcRequestId"),"邮储提前结清前租金计划",tx); + copyCashFlowFormatToHis(param.get("contractId"),param.get("fcRequestId"),tx); + //变更租金计划 + updateSettleRentPlan(param,tx); + //变更合同状态 + updateContractStatus(param.get("contractId"),"100",tx); + //变更现金流 + createCashFlow(param,Sqlca); + //重新Irr计算 + + //2.3如果提请结清 并且 为非借款人本人账户,则视为我方回购,需改变资方状态,我方能继续扣款 + }else if("3".equals(param.get("REPAYMENT_FLAG"))&&"1".equals(param.get("REPAYMENT_SOURCE"))){ + int result = 1; + //变更资方资源(要有日志) + try{ + changeCorpusSource(param,tx); + }catch (JBOException e){ + result = 0; + e.printStackTrace(); + ARE.getLog().error(param.get("contractNo")+":变更资方时遇见错误"); + throw new Exception("变更资方时遇见错误"); + }finally{ + //存日志 + saveCorpusSourceChangeLog(param,result,tx); + } + + } + } + + } + + /** + * 根据文件ID获取《租金实收》信息 + * @param fcFileId + * @return + * @throws Exception + */ + @Override + public List getFileInfoByFileId(String fcFileId) throws Exception { + String sql = "select fr.CONTRACT_ID,O.FC_REQUEST_ID,O.TERM_NO,O.NEW_REPAY_DATE,O.ALR_PRINCIPAL,O.ALR_INTEREST,O.ALR_PENALTY,O.ALR_REPAYMENT_MONEY,REPAYMENT_FLAG,REPAYMENT_SOURCE from O left join jbo.oti.FC_REQUEST fr on O.LOAN_NO=fr.FC_LOAN_ID where fr.DEL_FLAG='0' and O.FC_FILE_ID=:fcFileId"; + BizObjectManager fyfrrBom = JBOFactory.getBizObjectManager(FC_YC_FILE_REPAY_RESULT.CLASS_NAME); + List fyfrrBoList = fyfrrBom.createQuery(sql).setParameter("fcFileId",fcFileId).getResultList(false); + if(fyfrrBoList.size()==0){ + ARE.getLog().error("未找到FC_REQUEST_ID: "+fcFileId+" 对应的资方还款计划"); + throw new Exception("未找到FC_REQUEST_ID: "+fcFileId+" 对应的资方还款计划"); + } + return fyfrrBoList; + } + + /** + * + * @throws JBOException + */ + public void createCashFlow(Mapparam ,Transaction Sqlca) throws Exception { + //0.删除原有现金流 + String deleteSql = "delete from lc_cash_flow where contract_id=:contractId"; + SqlObject sql = new SqlObject(deleteSql); + sql.setParameter("contractId",param.get("contractId")); + Sqlca.executeSQL(sql); + //1.插入新的现金流 + String appendInfo = " "; + String sqlPath = "/etc/sql/insertIntoCashFlow.xml"; + String xmlPath=ARE.getProperty("PRD_HOME").replace("/WEB-INF", "")+sqlPath; + Map xmlFile= XMLDataUtil.readTableInfoFromXmlFile(xmlPath); + String sqlCode=xmlFile.get("table_sql").replaceAll("\r|\n|\t", " "); + + String GPSDifference= ProductParamUtil.getProductParameterValue(param.get("product_id"),"PRD0390","GPSDifference","GPSDifference"); + if(GPSDifference!=null&&!"".equals(GPSDifference)){ + appendInfo = "union all select '','','','','',plan_date,'"+GPSDifference+"' flowin,'GPS差额:"+GPSDifference+"' flowindetail,'' flowout,'' flowoutdetil,'"+GPSDifference+"' cleanfow from lc_fund_plan where contract_id =:contractId and fee_type='feetype10' "; + } + sql = new SqlObject(sqlCode); + sql.setParameter("appendInfo",appendInfo); + sql.setParameter("contractId",param.get("contractId")); + Sqlca.executeSQL(sql); + } + + public String calcIRR(Map param,JBOTransaction tx) throws Exception { + String cashSql = "select NET_FLOW,PLAN_DATE from lc_cash_flow where contract_id='"+param.get("contractId")+"' order by plan_date"; + List> cashes = DataOperatorUtil.getDataBySql(tx, cashSql, null); + List netList = new ArrayList(); + List dateList = new ArrayList(); + for(Map cash :cashes){ + netList.add(cash.get("NET_FLOW")); + dateList.add(cash.get("PLAN_DATE")); + } + String irr=""; + if("STAGE_IRR".equals(IrrType)){//按期IRR + BigDecimal issueRate= IRRCalculateUtil.getIRR2(netList); + irr=issueRate.multiply( new BigDecimal(1200/cb.getIncomeIntervalMonth())).setScale(6,BigDecimal.ROUND_HALF_UP).toString(); + }else if("MONTH_IRR".equals(IrrType)){//按月IRR + String upperListDate=""; + List newNetList=new ArrayList(); + List newDateList=new ArrayList(); + for(int i=0;i inflowPour=new ArrayList(); + String plandate=""; + for(int i=0;i1){ + for(int y=1;y Date: Fri, 20 Aug 2021 10:12:25 +0800 Subject: [PATCH 4/8] =?UTF-8?q?=E8=B4=B7=E5=90=8E=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LBContractPersonBaseInfo.jsp | 4 +- WebContent/WEB-INF/etc/jbo/jbo_oti.xml | 5 +- .../WEB-INF/etc/sql/insertIntoCashFlow.xml | 22 +-- src_jbo/jbo/oti/FC_REQUEST_CHANNEL_LOG.java | 8 + src_jbo/jbo/oti/FC_YC_FILE_REPAY_RESULT.java | 4 + src_sql/鎶曚骇SQL/dailyfix/zhanglei20210728.sql | 47 +++++ .../quartzmession/CorpusSourceFileCopy.java | 171 +++++++++++++++--- .../CorpusSourceRentPlanCopy.java | 23 +-- .../CorpusSourceRentResultCopy.java | 107 +---------- 9 files changed, 236 insertions(+), 155 deletions(-) diff --git a/WebContent/Tenwa/Lease/Flow/Comm/LBContractPersonBaseInfo/LBContractPersonBaseInfo.jsp b/WebContent/Tenwa/Lease/Flow/Comm/LBContractPersonBaseInfo/LBContractPersonBaseInfo.jsp index 481955631..4d69908bd 100644 --- a/WebContent/Tenwa/Lease/Flow/Comm/LBContractPersonBaseInfo/LBContractPersonBaseInfo.jsp +++ b/WebContent/Tenwa/Lease/Flow/Comm/LBContractPersonBaseInfo/LBContractPersonBaseInfo.jsp @@ -77,9 +77,11 @@ $("#div_1390").find("[style='display:inline-block;width:6px;']").css("width","100"); $("#div_1054").find("[style='display:inline-block;width:6px;']").css("width","88"); $("#div_1058").find("[style='display:inline-block;width:6px;']").css("width","74"); - /* 右侧 样式微调*/ + + /!* 右侧 样式微调*!/ $("#A_div_900").find("[style='display:inline-block;width:6px;']").css("width","86"); $("#div_930").find("[style='display:inline-block;width:6px;']").css("width","86"); + $("#A_div_1070").find("[style='display:inline-block;width:6px;']").css("width","86"); function saveRend(){ //校验业务合同号唯一性 diff --git a/WebContent/WEB-INF/etc/jbo/jbo_oti.xml b/WebContent/WEB-INF/etc/jbo/jbo_oti.xml index 6f26d0323..483a6c531 100644 --- a/WebContent/WEB-INF/etc/jbo/jbo_oti.xml +++ b/WebContent/WEB-INF/etc/jbo/jbo_oti.xml @@ -446,7 +446,8 @@ - + + @@ -494,6 +495,8 @@ + + diff --git a/WebContent/WEB-INF/etc/sql/insertIntoCashFlow.xml b/WebContent/WEB-INF/etc/sql/insertIntoCashFlow.xml index 251916275..cfaf58eba 100644 --- a/WebContent/WEB-INF/etc/sql/insertIntoCashFlow.xml +++ b/WebContent/WEB-INF/etc/sql/insertIntoCashFlow.xml @@ -34,7 +34,7 @@ concat('绗', cfrp.plan_list, '鏈熷垎娑﹂噾棰:', format(lpp.profit, 2)) flowindetail, 0 flowout, '' flowoutdetail, - lpp.profit - 0 cleanfow + ifnull(lpp.profit, 0) - 0 cleanfow from lc_rent_plan cfrp left join lc_profit_plan lpp on lpp.rent_plan_id = cfrp.ID where cfrp.CONTRACT_ID = :contractId @@ -48,8 +48,7 @@ if(fundplan.pay_type = 'pay_type_in', fundplan.plan_money, 0) flowin, if(fundplan.pay_type = 'pay_type_in', concat(tdd.itemname, ':', fundplan.plan_money), '') flowindetail, if(fundplan.pay_type = 'pay_type_out', fundplan.plan_money, 0) flowout, - if(fundplan.pay_type = 'pay_type_out', concat(tdd.itemname, ':', fundplan.plan_money), - '') flowoutdetail, + if(fundplan.pay_type = 'pay_type_out', concat(tdd.itemname, ':', fundplan.plan_money),'') flowoutdetail, if(fundplan.pay_type = 'pay_type_in', fundplan.plan_money, -fundplan.plan_money) cleanfow from lc_fund_plan fundplan left join code_library tdd on fundplan.fee_type = tdd.itemno and tdd.codeno = 'FeeType' @@ -57,21 +56,22 @@ and fundplan.fee_type in ('feetype2', 'feetype1', 'feetype10', 'feetype16', 'feetype17', 'feetype33', 'feetype24') union all - select '', - '', - '', - '', - '', + select lcc.PROJECT_ID, + lcc.PROJECT_PLAN_NUMBER, + lcc.CONTRACT_ID, + lcc.CONTRACT_PLAN_NUMBER, + lcc.PAYMENT_NUMBER, DATE_FORMAT(substr(LOAN_DATE, 1, 8), '%Y/%m/%d') as plan_date, - frl.TRANS_AMT as flowin, + ifnull(frl.TRANS_AMT,0) as flowin, concat('閭偍鍥炴閲戦:', frl.TRANS_AMT) as flowindetail, 0 as flowout, '' as flowoutdetail, - frl.TRANS_AMT as cleanfow + ifnull(frl.TRANS_AMT,0) as cleanfow from fc_request_loan frl left join fc_request fr on frl.FC_REQUEST_ID = fr.ID and frl.LOAN_NO = fr.FC_LOAN_ID + left join lc_calc_condition lcc on fr.CONTRACT_ID = lcc.CONTRACT_ID where fr.CONTRACT_ID = :contractId - :appendInfo + appendInfo ) t group by t.plan_date; ]]> diff --git a/src_jbo/jbo/oti/FC_REQUEST_CHANNEL_LOG.java b/src_jbo/jbo/oti/FC_REQUEST_CHANNEL_LOG.java index 7921750f1..3ecc5c5a2 100644 --- a/src_jbo/jbo/oti/FC_REQUEST_CHANNEL_LOG.java +++ b/src_jbo/jbo/oti/FC_REQUEST_CHANNEL_LOG.java @@ -43,6 +43,14 @@ public interface FC_REQUEST_CHANNEL_LOG { * 变更结果 STRING(32)
*/ public static final String CHANGE_RESULT = "CHANGE_RESULT"; + /** + * 变更类型 STRING(32)
+ */ + public static final String CHANGE_TYPE = "CHANGE_TYPE"; + /** + * 实际回购金额 STRING(32)
+ */ + public static final String ACTUAL_PAYMENT_BACK_AMOUNT = "ACTUAL_PAYMENT_BACK_AMOUNT"; /** * 创建时间 STRING(32)
*/ diff --git a/src_jbo/jbo/oti/FC_YC_FILE_REPAY_RESULT.java b/src_jbo/jbo/oti/FC_YC_FILE_REPAY_RESULT.java index 814f1ed02..1790c42d6 100644 --- a/src_jbo/jbo/oti/FC_YC_FILE_REPAY_RESULT.java +++ b/src_jbo/jbo/oti/FC_YC_FILE_REPAY_RESULT.java @@ -19,6 +19,10 @@ public interface FC_YC_FILE_REPAY_RESULT { * 文件ID STRING(32)
*/ public static final String FC_FILE_ID = "FC_FILE_ID"; + /** + * 请求ID STRING(32)
+ */ + public static final String FC_REQUEST_ID = "FC_REQUEST_ID"; /** * 放款请求编号 STRING(32)
*/ diff --git a/src_sql/鎶曚骇SQL/dailyfix/zhanglei20210728.sql b/src_sql/鎶曚骇SQL/dailyfix/zhanglei20210728.sql index 9535e2231..76faa3bed 100644 --- a/src_sql/鎶曚骇SQL/dailyfix/zhanglei20210728.sql +++ b/src_sql/鎶曚骇SQL/dailyfix/zhanglei20210728.sql @@ -447,6 +447,18 @@ INSERT INTO apzl.awe_do_library (dono, colindex, sortno, isinuse, coltablename, INSERT INTO apzl.awe_do_library (dono, colindex, sortno, isinuse, coltablename, colactualname, colname, coltype, coldefaultvalue, colheader, colunit, colcolumntype, coleditstyle, colcheckformat, colalign, coleditsourcetype, coleditsource, colhtmlstyle, collimit, colvisible, colreadonly, colrequired, colsortable, isfilter, colspan, isautocomplete, groupid, colfilterrefid, inputuser, inputtime, updateuser, updatetime, isaudit, colfilterattrs, isupdate, parentcolindex, tips, colinnerbtevent, colfilteroptions) VALUES ('FC_REQUEST', '1070', '1070', '1', 'O', 'CONTRACT_NO', 'CONTRACT_NO', 'String', '', '合同编号', '', '1', 'Text', '1', '1', '', '', '', '32', '1', '0', '0', '1', '1', 1, '0', '', '', 'SYS_DESIGNER', '2021/05/31 14:18:55', 'administrator', '2021/07/08 17:03:12', '', '', '1', '', '', '', ''); INSERT INTO apzl.awe_do_library (dono, colindex, sortno, isinuse, coltablename, colactualname, colname, coltype, coldefaultvalue, colheader, colunit, colcolumntype, coleditstyle, colcheckformat, colalign, coleditsourcetype, coleditsource, colhtmlstyle, collimit, colvisible, colreadonly, colrequired, colsortable, isfilter, colspan, isautocomplete, groupid, colfilterrefid, inputuser, inputtime, updateuser, updatetime, isaudit, colfilterattrs, isupdate, parentcolindex, tips, colinnerbtevent, colfilteroptions) VALUES ('FC_REQUEST', '1080', '1080', '1', 'O', 'PRODUCT_ID', 'PRODUCT_ID', 'String', '', '产品ID', '', '1', 'Text', '1', '1', '', '', '', '32', '0', '0', '0', '1', '1', 1, '0', '', '', 'SYS_DESIGNER', '2021/05/31 14:18:55', 'administrator', '2021/07/08 17:03:12', '', '', '1', '', '', '', ''); INSERT INTO apzl.awe_do_library (dono, colindex, sortno, isinuse, coltablename, colactualname, colname, coltype, coldefaultvalue, colheader, colunit, colcolumntype, coleditstyle, colcheckformat, colalign, coleditsourcetype, coleditsource, colhtmlstyle, collimit, colvisible, colreadonly, colrequired, colsortable, isfilter, colspan, isautocomplete, groupid, colfilterrefid, inputuser, inputtime, updateuser, updatetime, isaudit, colfilterattrs, isupdate, parentcolindex, tips, colinnerbtevent, colfilteroptions) VALUES ('FC_REQUEST', '1090', '1090', '1', 'O', 'PRODUCT_NAME', 'PRODUCT_NAME', 'String', '', '产品名称', '', '1', 'Text', '1', '1', '', '', '', '32', '0', '0', '0', '1', '1', 1, '0', '', '', 'SYS_DESIGNER', '2021/05/31 14:18:55', 'administrator', '2021/07/08 17:03:12', '', '', '1', '', '', '', ''); +INSERT INTO apzl.awe_do_library (dono, colindex, sortno, isinuse, coltablename, colactualname, colname, coltype, coldefaultvalue, colheader, colunit, colcolumntype, coleditstyle, colcheckformat, colalign, coleditsourcetype, coleditsource, colhtmlstyle, collimit, colvisible, colreadonly, colrequired, colsortable, isfilter, colspan, isautocomplete, groupid, colfilterrefid, inputuser, inputtime, updateuser, updatetime, isaudit, colfilterattrs, isupdate, parentcolindex, tips, colinnerbtevent, colfilteroptions) VALUES ('FC_REQUEST', '1100', '1100', '1', 'O', 'DISTRIBUTOR_ID', 'DISTRIBUTOR_ID', 'String', '', '资经销商ID', '', '1', 'Text', '1', '1', '', '', '', '32', '0', '0', '0', '1', '1', 1, '0', '', '', 'SYS_DESIGNER', '2021/05/31 14:18:55', 'administrator', '2021/07/08 17:03:12', '', '', '1', '', '', '', ''); +INSERT INTO apzl.awe_do_library (dono, colindex, sortno, isinuse, coltablename, colactualname, colname, coltype, coldefaultvalue, colheader, colunit, colcolumntype, coleditstyle, colcheckformat, colalign, coleditsourcetype, coleditsource, colhtmlstyle, collimit, colvisible, colreadonly, colrequired, colsortable, isfilter, colspan, isautocomplete, groupid, colfilterrefid, inputuser, inputtime, updateuser, updatetime, isaudit, colfilterattrs, isupdate, parentcolindex, tips, colinnerbtevent, colfilteroptions) VALUES ('FC_REQUEST', '1110', '1110', '1', 'O', 'DISTRIBUTOR_NAME', 'DISTRIBUTOR_NAME', 'String', '', '经销商名称', '', '1', 'Text', '1', '1', '', '', '', '32', '0', '0', '0', '1', '1', 1, '0', '', '', 'SYS_DESIGNER', '2021/05/31 14:18:55', 'administrator', '2021/07/08 17:03:12', '', '', '1', '', '', '', ''); +INSERT INTO apzl.awe_do_library (dono, colindex, sortno, isinuse, coltablename, colactualname, colname, coltype, coldefaultvalue, colheader, colunit, colcolumntype, coleditstyle, colcheckformat, colalign, coleditsourcetype, coleditsource, colhtmlstyle, collimit, colvisible, colreadonly, colrequired, colsortable, isfilter, colspan, isautocomplete, groupid, colfilterrefid, inputuser, inputtime, updateuser, updatetime, isaudit, colfilterattrs, isupdate, parentcolindex, tips, colinnerbtevent, colfilteroptions) VALUES ('FC_REQUEST', '1120', '1120', '1', 'O', 'CUSTOMER_ID', 'CUSTOMER_ID', 'String', '', '客户ID', '', '1', 'Text', '1', '1', '', '', '', '32', '0', '0', '0', '1', '1', 1, '0', '', '', 'SYS_DESIGNER', '2021/05/31 14:18:55', 'administrator', '2021/07/08 17:03:12', '', '', '1', '', '', '', ''); +INSERT INTO apzl.awe_do_library (dono, colindex, sortno, isinuse, coltablename, colactualname, colname, coltype, coldefaultvalue, colheader, colunit, colcolumntype, coleditstyle, colcheckformat, colalign, coleditsourcetype, coleditsource, colhtmlstyle, collimit, colvisible, colreadonly, colrequired, colsortable, isfilter, colspan, isautocomplete, groupid, colfilterrefid, inputuser, inputtime, updateuser, updatetime, isaudit, colfilterattrs, isupdate, parentcolindex, tips, colinnerbtevent, colfilteroptions) VALUES ('FC_REQUEST', '1130', '1130', '1', 'O', 'CUSTOMER_NAME', 'CUSTOMER_NAME', 'String', '', '客户名称', '', '1', 'Text', '1', '2', '', '', '', '32', '1', '0', '0', '1', '1', 1, '0', '', '', 'SYS_DESIGNER', '2021/05/31 14:18:55', 'administrator', '2021/07/08 17:03:12', '', '', '1', '', '', '', ''); +INSERT INTO apzl.awe_do_library (dono, colindex, sortno, isinuse, coltablename, colactualname, colname, coltype, coldefaultvalue, colheader, colunit, colcolumntype, coleditstyle, colcheckformat, colalign, coleditsourcetype, coleditsource, colhtmlstyle, collimit, colvisible, colreadonly, colrequired, colsortable, isfilter, colspan, isautocomplete, groupid, colfilterrefid, inputuser, inputtime, updateuser, updatetime, isaudit, colfilterattrs, isupdate, parentcolindex, tips, colinnerbtevent, colfilteroptions) VALUES ('FC_REQUEST', '1140', '1140', '1', 'O', 'FC_STATUS', 'FC_STATUS', 'String', '', '当前状态', '', '1', 'Select', '1', '1', 'Code', 'fc_request_sts', 'style={width:200px}', '32', '1', '0', '0', '1', '1', 1, '0', '', '', 'SYS_DESIGNER', '2021/05/31 14:18:55', 'administrator', '2021/07/08 17:03:12', '', '', '1', '', '', '', ''); +INSERT INTO apzl.awe_do_library (dono, colindex, sortno, isinuse, coltablename, colactualname, colname, coltype, coldefaultvalue, colheader, colunit, colcolumntype, coleditstyle, colcheckformat, colalign, coleditsourcetype, coleditsource, colhtmlstyle, collimit, colvisible, colreadonly, colrequired, colsortable, isfilter, colspan, isautocomplete, groupid, colfilterrefid, inputuser, inputtime, updateuser, updatetime, isaudit, colfilterattrs, isupdate, parentcolindex, tips, colinnerbtevent, colfilteroptions) VALUES ('FC_REQUEST', '1150', '1150', '1', 'O', 'FC_REMARK', 'FC_REMARK', 'String', '', '当前状态', '', '1', 'Text', '1', '1', '', '', '', '32', '0', '0', '0', '1', '1', 1, '0', '', '', 'SYS_DESIGNER', '2021/05/31 14:18:55', 'administrator', '2021/07/08 17:03:12', '', '', '1', '', '', '', ''); +INSERT INTO apzl.awe_do_library (dono, colindex, sortno, isinuse, coltablename, colactualname, colname, coltype, coldefaultvalue, colheader, colunit, colcolumntype, coleditstyle, colcheckformat, colalign, coleditsourcetype, coleditsource, colhtmlstyle, collimit, colvisible, colreadonly, colrequired, colsortable, isfilter, colspan, isautocomplete, groupid, colfilterrefid, inputuser, inputtime, updateuser, updatetime, isaudit, colfilterattrs, isupdate, parentcolindex, tips, colinnerbtevent, colfilteroptions) VALUES ('FC_REQUEST', '1155', '1155', '1', 'O', 'SUPPLEMENT_STS', 'SUPPLEMENT_STS', 'String', '', '是否需要补充资料', '', '1', 'Text', '1', '2', 'CodeTable', '0,否,1,是,2,提交完成待发送', '', '32', '1', '0', '0', '1', '1', 1, '0', '', '', 'SYS_DESIGNER', '2021/05/31 14:18:55', 'administrator', '2021/07/08 17:03:12', '', '', '1', '', '', '', null); +INSERT INTO apzl.awe_do_library (dono, colindex, sortno, isinuse, coltablename, colactualname, colname, coltype, coldefaultvalue, colheader, colunit, colcolumntype, coleditstyle, colcheckformat, colalign, coleditsourcetype, coleditsource, colhtmlstyle, collimit, colvisible, colreadonly, colrequired, colsortable, isfilter, colspan, isautocomplete, groupid, colfilterrefid, inputuser, inputtime, updateuser, updatetime, isaudit, colfilterattrs, isupdate, parentcolindex, tips, colinnerbtevent, colfilteroptions) VALUES ('FC_REQUEST', '1156', '1156', '1', 'O', 'SUPPLEMENT_DESC', 'SUPPLEMENT_DESC', 'String', '', '补充描述', '', '1', 'Text', '1', '1', '', '', '', '32', '0', '0', '0', '1', '1', 1, '0', '', '', 'SYS_DESIGNER', '2021/05/31 14:18:55', 'administrator', '2021/07/08 17:03:12', '', '', '1', '', '', null, null); +INSERT INTO apzl.awe_do_library (dono, colindex, sortno, isinuse, coltablename, colactualname, colname, coltype, coldefaultvalue, colheader, colunit, colcolumntype, coleditstyle, colcheckformat, colalign, coleditsourcetype, coleditsource, colhtmlstyle, collimit, colvisible, colreadonly, colrequired, colsortable, isfilter, colspan, isautocomplete, groupid, colfilterrefid, inputuser, inputtime, updateuser, updatetime, isaudit, colfilterattrs, isupdate, parentcolindex, tips, colinnerbtevent, colfilteroptions) VALUES ('FC_REQUEST', '1157', '1157', '1', 'O', 'SUPPLEMENT_TIME', 'SUPPLEMENT_TIME', 'String', '', '资料补充时间', '', '1', 'Date', null, '2', '', '', '', '', '1', '1', '0', '1', '1', 1, null, '', '', null, null, 'administrator', '2021/07/08 17:03:12', null, '', null, '', '', '', null); +INSERT INTO apzl.awe_do_library (dono, colindex, sortno, isinuse, coltablename, colactualname, colname, coltype, coldefaultvalue, colheader, colunit, colcolumntype, coleditstyle, colcheckformat, colalign, coleditsourcetype, coleditsource, colhtmlstyle, collimit, colvisible, colreadonly, colrequired, colsortable, isfilter, colspan, isautocomplete, groupid, colfilterrefid, inputuser, inputtime, updateuser, updatetime, isaudit, colfilterattrs, isupdate, parentcolindex, tips, colinnerbtevent, colfilteroptions) VALUES ('FC_REQUEST', '1160', '1160', '1', 'O', 'CREATE_TIME', 'CREATE_TIME', 'String', '', '创建时间', '', '1', 'Date', '3', '2', '', '', '', '32', '1', '0', '0', '1', '1', 1, '0', '', '', 'SYS_DESIGNER', '2021/05/31 14:18:55', 'administrator', '2021/07/08 17:03:12', '', '', '1', '', '', '', ''); +INSERT INTO apzl.awe_do_library (dono, colindex, sortno, isinuse, coltablename, colactualname, colname, coltype, coldefaultvalue, colheader, colunit, colcolumntype, coleditstyle, colcheckformat, colalign, coleditsourcetype, coleditsource, colhtmlstyle, collimit, colvisible, colreadonly, colrequired, colsortable, isfilter, colspan, isautocomplete, groupid, colfilterrefid, inputuser, inputtime, updateuser, updatetime, isaudit, colfilterattrs, isupdate, parentcolindex, tips, colinnerbtevent, colfilteroptions) VALUES ('FC_REQUEST', '1170', '1170', '1', 'O', 'UPDATE_TIME', 'UPDATE_TIME', 'String', '', '修改时间', '', '1', 'Date', '3', '2', '', '', '', '32', '1', '0', '0', '1', '1', 1, '0', '', '', 'SYS_DESIGNER', '2021/05/31 14:18:55', 'administrator', '2021/07/08 17:02:37', '', '', '1', '', '', '', ''); +INSERT INTO apzl.awe_do_library (dono, colindex, sortno, isinuse, coltablename, colactualname, colname, coltype, coldefaultvalue, colheader, colunit, colcolumntype, coleditstyle, colcheckformat, colalign, coleditsourcetype, coleditsource, colhtmlstyle, collimit, colvisible, colreadonly, colrequired, colsortable, isfilter, colspan, isautocomplete, groupid, colfilterrefid, inputuser, inputtime, updateuser, updatetime, isaudit, colfilterattrs, isupdate, parentcolindex, tips, colinnerbtevent, colfilteroptions) VALUES ('FC_REQUEST', '1180', '1180', '1', 'O', 'DEL_FLAG', 'DEL_FLAG', 'String', '', '有效标志', '', '1', 'Text', '1', '1', '', '', '', '32', '0', '0', '0', '1', '1', 1, '0', '', '', 'SYS_DESIGNER', '2021/05/31 14:18:55', 'administrator', '2021/06/29 13:26:32', '', '', '1', '', '', '', ''); -- 资料清单页面模板 delete from awe_do_catalog where dono='FcRequestFileList'; @@ -462,6 +474,13 @@ INSERT INTO apzl.awe_do_library (dono, colindex, sortno, isinuse, coltablename, INSERT INTO apzl.awe_do_library (dono, colindex, sortno, isinuse, coltablename, colactualname, colname, coltype, coldefaultvalue, colheader, colunit, colcolumntype, coleditstyle, colcheckformat, colalign, coleditsourcetype, coleditsource, colhtmlstyle, collimit, colvisible, colreadonly, colrequired, colsortable, isfilter, colspan, isautocomplete, groupid, colfilterrefid, inputuser, inputtime, updateuser, updatetime, isaudit, colfilterattrs, isupdate, parentcolindex, tips, colinnerbtevent, colfilteroptions) VALUES ('FcRequestFileList', '1070', '1070', '1', 'O', 'FILE_NAME', 'FILE_NAME', 'String', '', '文件名称', '', '1', 'Text', '1', '1', '', '', 'style={width:200px;word-break:break-all;}', '32', '0', '0', '0', '1', '1', 1, '0', '', '', 'SYS_Designer', '2021/06/29 11:47:56', 'administrator', '2021/07/19 10:56:56', '', '', '1', '', '', '', ''); INSERT INTO apzl.awe_do_library (dono, colindex, sortno, isinuse, coltablename, colactualname, colname, coltype, coldefaultvalue, colheader, colunit, colcolumntype, coleditstyle, colcheckformat, colalign, coleditsourcetype, coleditsource, colhtmlstyle, collimit, colvisible, colreadonly, colrequired, colsortable, isfilter, colspan, isautocomplete, groupid, colfilterrefid, inputuser, inputtime, updateuser, updatetime, isaudit, colfilterattrs, isupdate, parentcolindex, tips, colinnerbtevent, colfilteroptions) VALUES ('FcRequestFileList', '1080', '1080', '1', 'O', 'FILE_PATH', 'FILE_PATH', 'String', '', '文件路径', '', '1', 'Text', '1', '1', '', '', '', '32', '0', '0', '0', '1', '1', 1, '0', '', '', 'SYS_Designer', '2021/06/29 11:47:56', 'administrator', '2021/07/19 10:56:56', '', '', '1', '', '', '', ''); INSERT INTO apzl.awe_do_library (dono, colindex, sortno, isinuse, coltablename, colactualname, colname, coltype, coldefaultvalue, colheader, colunit, colcolumntype, coleditstyle, colcheckformat, colalign, coleditsourcetype, coleditsource, colhtmlstyle, collimit, colvisible, colreadonly, colrequired, colsortable, isfilter, colspan, isautocomplete, groupid, colfilterrefid, inputuser, inputtime, updateuser, updatetime, isaudit, colfilterattrs, isupdate, parentcolindex, tips, colinnerbtevent, colfilteroptions) VALUES ('FcRequestFileList', '1090', '1090', '1', 'O', 'FC_FILE_STS', 'FC_FILE_STS', 'String', '', '文件状态', '', '1', 'Text', '1', '1', '', '', '', '32', '0', '1', '0', '1', '1', 1, '0', '', '', 'SYS_Designer', '2021/06/29 11:47:56', 'administrator', '2021/07/19 10:56:56', '0', '', '1', '', '', '', ''); +INSERT INTO apzl.awe_do_library (dono, colindex, sortno, isinuse, coltablename, colactualname, colname, coltype, coldefaultvalue, colheader, colunit, colcolumntype, coleditstyle, colcheckformat, colalign, coleditsourcetype, coleditsource, colhtmlstyle, collimit, colvisible, colreadonly, colrequired, colsortable, isfilter, colspan, isautocomplete, groupid, colfilterrefid, inputuser, inputtime, updateuser, updatetime, isaudit, colfilterattrs, isupdate, parentcolindex, tips, colinnerbtevent, colfilteroptions) VALUES ('FcRequestFileList', '1095', '1150', '1', 'O', 'FC_RES_VALUE', 'FC_RES_VALUE', 'String', '', '邮储返回状态', '', '1', 'Text', null, '2', '', '', '', '', '1', '0', '0', '1', '1', 1, null, '', '', null, null, 'administrator', '2021/07/19 10:56:57', null, '', null, '', '', '', null); +INSERT INTO apzl.awe_do_library (dono, colindex, sortno, isinuse, coltablename, colactualname, colname, coltype, coldefaultvalue, colheader, colunit, colcolumntype, coleditstyle, colcheckformat, colalign, coleditsourcetype, coleditsource, colhtmlstyle, collimit, colvisible, colreadonly, colrequired, colsortable, isfilter, colspan, isautocomplete, groupid, colfilterrefid, inputuser, inputtime, updateuser, updatetime, isaudit, colfilterattrs, isupdate, parentcolindex, tips, colinnerbtevent, colfilteroptions) VALUES ('FcRequestFileList', '1100', '1160', '1', 'O', 'FC_FILE_STS_DESC', 'FC_FILE_STS_DESC', 'String', '', '文件状态描述', '', '1', 'Text', '1', '2', '', '', '', '32', '1', '0', '0', '1', '1', 1, '0', '', '', 'SYS_Designer', '2021/06/29 11:47:56', 'administrator', '2021/07/19 10:56:57', '0', '', '1', '', '', '', ''); +INSERT INTO apzl.awe_do_library (dono, colindex, sortno, isinuse, coltablename, colactualname, colname, coltype, coldefaultvalue, colheader, colunit, colcolumntype, coleditstyle, colcheckformat, colalign, coleditsourcetype, coleditsource, colhtmlstyle, collimit, colvisible, colreadonly, colrequired, colsortable, isfilter, colspan, isautocomplete, groupid, colfilterrefid, inputuser, inputtime, updateuser, updatetime, isaudit, colfilterattrs, isupdate, parentcolindex, tips, colinnerbtevent, colfilteroptions) VALUES ('FcRequestFileList', '1110', '1110', '1', 'O', 'CREATE_TIME', 'CREATE_TIME', 'String', '', '创建时间', '', '1', 'Date', '3', '2', '', '', '', '32', '0', '0', '0', '1', '1', 1, '0', '', '', 'SYS_Designer', '2021/06/29 11:47:56', 'administrator', '2021/07/19 10:56:56', '', '', '1', '', '', '', ''); +INSERT INTO apzl.awe_do_library (dono, colindex, sortno, isinuse, coltablename, colactualname, colname, coltype, coldefaultvalue, colheader, colunit, colcolumntype, coleditstyle, colcheckformat, colalign, coleditsourcetype, coleditsource, colhtmlstyle, collimit, colvisible, colreadonly, colrequired, colsortable, isfilter, colspan, isautocomplete, groupid, colfilterrefid, inputuser, inputtime, updateuser, updatetime, isaudit, colfilterattrs, isupdate, parentcolindex, tips, colinnerbtevent, colfilteroptions) VALUES ('FcRequestFileList', '1120', '1120', '1', 'O', 'UPDATE_TIME', 'UPDATE_TIME', 'String', '', '修改时间', '', '1', 'Date', '3', '2', '', '', '', '32', '0', '0', '0', '1', '1', 1, '0', '', '', 'SYS_Designer', '2021/06/29 11:47:56', 'administrator', '2021/07/19 10:56:56', '', '', '1', '', '', '', ''); +INSERT INTO apzl.awe_do_library (dono, colindex, sortno, isinuse, coltablename, colactualname, colname, coltype, coldefaultvalue, colheader, colunit, colcolumntype, coleditstyle, colcheckformat, colalign, coleditsourcetype, coleditsource, colhtmlstyle, collimit, colvisible, colreadonly, colrequired, colsortable, isfilter, colspan, isautocomplete, groupid, colfilterrefid, inputuser, inputtime, updateuser, updatetime, isaudit, colfilterattrs, isupdate, parentcolindex, tips, colinnerbtevent, colfilteroptions) VALUES ('FcRequestFileList', '1130', '1130', '1', 'O', 'DEL_FLAG', 'DEL_FLAG', 'String', '', '有效标志', '', '1', 'Text', '1', '1', '', '', '', '32', '0', '0', '0', '1', '1', 1, '0', '', '', 'SYS_Designer', '2021/06/29 11:47:56', 'administrator', '2021/07/19 10:56:57', '', '', '1', '', '', '', ''); +INSERT INTO apzl.awe_do_library (dono, colindex, sortno, isinuse, coltablename, colactualname, colname, coltype, coldefaultvalue, colheader, colunit, colcolumntype, coleditstyle, colcheckformat, colalign, coleditsourcetype, coleditsource, colhtmlstyle, collimit, colvisible, colreadonly, colrequired, colsortable, isfilter, colspan, isautocomplete, groupid, colfilterrefid, inputuser, inputtime, updateuser, updatetime, isaudit, colfilterattrs, isupdate, parentcolindex, tips, colinnerbtevent, colfilteroptions) VALUES ('FcRequestFileList', '1140', '1140', '1', '', 'com.ample.fundchannel.doc.cache.DocListCache.getFileByRequestId(FC_REQUEST_ID,FC_FILE_CODE)', 'fileList', 'String', '', '附件清单', '', '1', 'Text', '1', '1', '', '', 'style={width:600px;word-break:break-all;}', null, '1', '0', '0', '1', '0', 0, '', '', '', 'SYS_Designer', '2021/06/29 11:47:56', 'administrator', '2021/07/19 10:56:57', '', '', '1', '', '', '', ''); +INSERT INTO apzl.awe_do_library (dono, colindex, sortno, isinuse, coltablename, colactualname, colname, coltype, coldefaultvalue, colheader, colunit, colcolumntype, coleditstyle, colcheckformat, colalign, coleditsourcetype, coleditsource, colhtmlstyle, collimit, colvisible, colreadonly, colrequired, colsortable, isfilter, colspan, isautocomplete, groupid, colfilterrefid, inputuser, inputtime, updateuser, updatetime, isaudit, colfilterattrs, isupdate, parentcolindex, tips, colinnerbtevent, colfilteroptions) VALUES ('FcRequestFileList', '1150', '1125', '1', '', '''''', 'operation', 'String', '', '操作', '', '1', 'Text', '1', '2', '', '', 'style={width:100px;word-break:break-all;}', null, '1', '0', '0', '1', '0', 0, '', '', '', 'SYS_Designer', '2021/06/29 11:47:56', 'administrator', '2021/07/19 10:56:57', '', '', '1', '', '', '', ''); -- 租金计划转换 定时任务配置(数据字典中配置,还需要在系统中去配置定时任务触发) delete from code_library where codeno='MissionName' and itemname='租金计划转换'; @@ -488,6 +507,34 @@ INSERT INTO apzl.code_library (codeno, itemno, itemname, bankno, sortno, isinuse CREATE ALGORITHM=UNDEFINED DEFINER=`apzl`@`%` SQL SECURITY DEFINER VIEW `vi_lb_identity_check_creditauth` AS (select `a`.`name` AS `fullName`,`a`.`certid` AS `certId`,`a`.`relation` AS `relation`,`a`.`creditauth` AS `creditauth`,`a`.`credittype` AS `credittype`,`a`.`flowunid` AS `flowunid`,`a`.`phone` AS `phone` from (select `ut`.`name` AS `name`,`ut`.`certid` AS `certid`,(case when (`ut`.`Partner_` = 'Y') then '共同申请人' when ((`ut`.`Partner_` = 'N') and (`ut`.`Spouse_` = 'Y')) then '配偶' when (`ut`.`Partner_` = 'gua') then '担保人' when (`ut`.`Partner_` = 'cust') then '申请人' else '' end) AS `relation`,(case when (`ut`.`creditauth` = 'ap') then '征信授权书_安鹏' when (`ut`.`creditauth` = 'yc') then '征信授权书_邮储' when (`ut`.`creditauth` = 'yc_audit') then '借款服务确认书_邮储' else '' end) AS `creditauth`,(case when (`ut`.`creditauth` = 'ap') then '99001' when (`ut`.`creditauth` = 'yc') then '99002' when (`ut`.`creditauth` = 'yc_audit') then '99003' else '' end) AS `credittype`,`ut`.`flowunid` AS `flowunid`,`ut`.`phone` AS `phone` from (select `cf1`.`name` AS `name`,`cf1`.`certid` AS `certid`,`cf1`.`Partner_` AS `Partner_`,`cf1`.`Spouse_` AS `Spouse_`,'ap' AS `creditauth`,`cf1`.`flowunid` AS `flowunid`,`cf1`.`tel` AS `phone` from `apzl`.`customer_family_temp` `cf1` where (`cf1`.`Partner_` = 'Y') union all (select `lgut`.`FULLNAME` AS `FULLNAME`,`lgut`.`CERTID` AS `CERTID`,'gua' AS `Partner_`,'gua' AS `Spouse_`,'ap' AS `creditauth`,`lgut`.`FLOWUNID` AS `flowunid`,`lgut`.`MOBILE` AS `phone` from `apzl`.`lb_guarantee_unit_temp` `lgut`) union all (select `ccpt`.`FULLNAME` AS `FULLNAME`,`ccpt`.`CERTID` AS `CERTID`,'cust' AS `Partner_`,'cust' AS `Spouse_`,'ap' AS `creditauth`,`ccpt`.`FLOWUNID` AS `flowunid`,`ccpt`.`mobile` AS `phone` from `apzl`.`customer_person_temp` `ccpt` where (`ccpt`.`BALANCESHEET` = '申请人'))) `ut`) `a`); CREATE ALGORITHM=UNDEFINED DEFINER=`apzl`@`%` SQL SECURITY DEFINER VIEW `vi_lb_identity_check_creditauth_loan` AS (select `a`.`name` AS `fullName`,`a`.`certid` AS `certId`,`a`.`relation` AS `relation`,`a`.`creditauth` AS `creditauth`,`a`.`credittype` AS `credittype`,`a`.`flowunid` AS `flowunid`,`a`.`phone` AS `phone` from (select `ut`.`name` AS `name`,`ut`.`certid` AS `certid`,(case when (`ut`.`Partner_` = 'Y') then '共同申请人' when ((`ut`.`Partner_` = 'N') and (`ut`.`Spouse_` = 'Y')) then '配偶' when (`ut`.`Partner_` = 'gua') then '担保人' when (`ut`.`Partner_` = 'cust') then '申请人' else '' end) AS `relation`,(case when (`ut`.`creditauth` = 'ap') then '征信授权书_安鹏' when (`ut`.`creditauth` = 'yc') then '征信授权书_邮储' when (`ut`.`creditauth` = 'yc_audit') then '借款服务确认书_邮储' else '' end) AS `creditauth`,(case when (`ut`.`creditauth` = 'ap') then '99001' when (`ut`.`creditauth` = 'yc') then '99002' when (`ut`.`creditauth` = 'yc_audit') then '99003' else '' end) AS `credittype`,`ut`.`flowunid` AS `flowunid`,`ut`.`phone` AS `phone` from (select `cf1`.`name` AS `name`,`cf1`.`certid` AS `certid`,`cf1`.`Partner_` AS `Partner_`,`cf1`.`Spouse_` AS `Spouse_`,'ap' AS `creditauth`,`cf1`.`PROJECT_ID` AS `flowunid`,`cf1`.`tel` AS `phone` from `apzl`.`customer_family` `cf1` where (`cf1`.`Partner_` = 'Y') union all (select `lgut`.`FULLNAME` AS `FULLNAME`,`lgut`.`CERTID` AS `CERTID`,'gua' AS `Partner_`,'gua' AS `Spouse_`,'ap' AS `creditauth`,`lgut`.`PROJECT_ID` AS `flowunid`,`lgut`.`MOBILE` AS `phone` from `apzl`.`lb_guarantee_unit` `lgut`) union all (select `ccpt`.`FULLNAME` AS `FULLNAME`,`ccpt`.`CERTID` AS `CERTID`,'cust' AS `Partner_`,'cust' AS `Spouse_`,'ap' AS `creditauth`,`lul`.`PROJECT_ID` AS `flowunid`,`ccpt`.`mobile` AS `phone` from (`apzl`.`customer_person` `ccpt` left join `apzl`.`lb_union_lessee` `lul` on((`ccpt`.`CUSTOMERID` = `lul`.`CUSTOMER_ID`))) where (`ccpt`.`BALANCESHEET` = '申请人'))) `ut`) `a`); +-- 获取参数视图 +create or replace view vi_corpus_source_param as +select `lci`.`ID` AS `contractId`, + lci.PROJECT_ID as projectId, + lcc.CONTRACT_PLAN_NUMBER as contractPlanNumber, + lcc.PROJECT_PLAN_NUMBER as projectPlanNumber, + `lci`.`PRODUCT_ID` AS `productId`, + `lci`.`distributor_id` AS `distributorId`, + `lci`.`corpus_source` AS `corpusSource`, + `lcc`.`PAYMENT_NUMBER` AS `paymentNumber`, + `bt`.`attribute5` AS `splitType`, + `lsr`.`splitting_ratio` AS `splittingRatio`, + `frl`.`BUSINESS_RATE` AS `corpusSourceRate`, + ca.bank_name as bankName, + ca.account as account, + ca.acc_number as accNumber +from + fc_request_loan frl + join `apzl`.`fc_request` `fr` on frl.LOAN_NO = fr.FC_LOAN_ID + left join `apzl`.`lb_contract_info` `lci` on `fr`.`CONTRACT_ID` = `lci`.`id` + left join `apzl`.`lc_calc_condition` `lcc` on `lci`.`ID` = `lcc`.`CONTRACT_ID` + left join `apzl`.`business_type` `bt` on `bt`.`typeno` = `lci`.`PRODUCT_ID` + left join `apzl`.`lb_splitting_ratio` `lsr` on `lsr`.`distributor_id` = `lci`.`distributor_id` and `lsr`.`product_id` = `lci`.`PRODUCT_ID` + left join `apzl`.`lb_product_corpus_source` `lpcs` on `lpcs`.`product_id` = `lci`.`PRODUCT_ID` and `lpcs`.`corpus_source` = `lci`.`corpus_source` + left join lb_union_lessee lul on lul.CONTRACT_ID=lci.ID and lul.IS_MAIN='Y' + left join customer_account ca on ca.customerid=lul.CUSTOMER_ID and ca.CONTRACT_ID=lci.id +where frl.DEL_FLAG='0' and fr.DEL_FLAG='0'; + diff --git a/src_tenwa/com/tenwa/lease/app/quartzmession/CorpusSourceFileCopy.java b/src_tenwa/com/tenwa/lease/app/quartzmession/CorpusSourceFileCopy.java index 71d50f68d..81daf61bb 100644 --- a/src_tenwa/com/tenwa/lease/app/quartzmession/CorpusSourceFileCopy.java +++ b/src_tenwa/com/tenwa/lease/app/quartzmession/CorpusSourceFileCopy.java @@ -1,12 +1,17 @@ package com.tenwa.lease.app.quartzmession; +import com.amarsoft.app.util.ProductParamUtil; +import com.amarsoft.app.util.XMLDataUtil; import com.amarsoft.are.ARE; import com.amarsoft.are.jbo.*; 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.comm.util.jboutil.DataOperatorUtil; import com.tenwa.reckon.executor.CreateTransactionExecutor; +import com.tenwa.reckon.util.DateUtils; +import com.tenwa.reckon.util.IRRCalculateUtil; +import com.tenwa.reckon.util.IrrTools; import jbo.app.tenwa.calc.*; import jbo.com.tenwa.lease.comm.LB_CONTRACT_INFO; import jbo.com.tenwa.lease.comm.LB_CONTRACT_INFO_TEMP; @@ -16,9 +21,6 @@ import jbo.oti.FC_FILE_PUSH; import jbo.oti.FC_REQUEST_CHANNEL_LOG; import jbo.oti.FC_YC_FILE_REPAY_PLAN; import jbo.oti.LC_PROFIT_PLAN; -import org.quartz.Job; -import org.quartz.JobExecutionContext; -import org.quartz.JobExecutionException; import java.math.BigDecimal; import java.text.ParseException; @@ -47,10 +49,11 @@ public class CorpusSourceFileCopy { } //遍历解析每个文件 for(BizObject ffpBo : ffpBoList){ - analyticalFile(ffpBo,tx); - ffpBo.setAttributeValue("FILE_STS","3"); - ffpBo.setAttributeValue("FILE_STS_DESC","拷贝成功"); - ffpBom.saveObject(ffpBo); + if(analyticalFile(ffpBo,tx)){ + ffpBo.setAttributeValue("FILE_STS","3"); + ffpBo.setAttributeValue("FILE_STS_DESC","拷贝成功"); + ffpBom.saveObject(ffpBo); + } } } @@ -60,12 +63,15 @@ public class CorpusSourceFileCopy { * @param tx * @throws Exception */ - public void analyticalFile(BizObject ffpBo,JBOTransaction tx) throws Exception { + public boolean analyticalFile(BizObject ffpBo,JBOTransaction tx) throws Exception { String fcFileId = ffpBo.getAttribute("ID").toString(); List fyfrpBoList = getFileInfoByFileId(fcFileId); - - respectiveDo(fyfrpBoList,tx); - + if(fyfrpBoList!=null&&fyfrpBoList.size()>0){ + respectiveDo(fyfrpBoList,tx); + return true; + }else{ + return false; + } } /** @@ -80,7 +86,6 @@ public class CorpusSourceFileCopy { if(contractMap.size()==0){ String fcFileId = fyfrpBoList.get(0).getAttribute("FC_REQUEST_ID").toString(); ARE.getLog().error("未找到FC_REQUEST_ID: "+fcFileId+" 对应的合同ID"); - throw new Exception("未找到FC_REQUEST_ID: "+fcFileId+" 对应的合同ID"); } Transaction Sqlca = Transaction.createTransaction(tx); //===顺序不能错=== @@ -113,7 +118,6 @@ public class CorpusSourceFileCopy { List fyfrpBoList = fyfrpBom.createQuery(sql).setParameter("fcFileId",fcFileId).getResultList(false); if(fyfrpBoList.size()==0){ ARE.getLog().error("未找到FC_REQUEST_ID: "+fcFileId+" 对应的资方还款计划"); - throw new Exception("未找到FC_REQUEST_ID: "+fcFileId+" 对应的资方还款计划"); } return fyfrpBoList; } @@ -413,6 +417,7 @@ public class CorpusSourceFileCopy { frclBo.setAttributeValue("CHANNEL_NAME","安鹏自有资金"); frclBo.setAttributeValue("REMARK","回购为安鹏自有资金"); frclBo.setAttributeValue("CHANGE_RESULT",result); + frclBo.setAttributeValue("CHANGE_TYPE","2"); frclBo.setAttributeValue("CREATETIME",StringFunction.getTodayNow()); frclBom.saveObject(frclBo); } @@ -433,10 +438,12 @@ public class CorpusSourceFileCopy { lrpBo.setAttributeValue("INTEREST",param.get("interest")); lrpBo.setAttributeValue("CORPUS_BUSINESS",param.get("principal")); lrpBo.setAttributeValue("INTEREST_BUSINESS",param.get("interest")); - lrpBo.setAttributeValue("ALL_REMAIN_CORPUS",param.get("0.00")); + lrpBo.setAttributeValue("ALL_REMAIN_CORPUS","0.00"); + lrpBo.setAttributeValue("COLLECT_STATUS","批量收款"); + lrpBo.setAttributeValue("COLLECT_MSG","邮储提前结清"); lrpBom.saveObject(lrpBo); //删除租金计划信息(大于提前结清当期期次的) - lrpBom.createQuery("delete from O where contract_id=:contractId and plan_list>:plan_list").setParameter("contractId",param.get("contractId")).setParameter("planList",param.get("termNo")).executeUpdate(); + lrpBom.createQuery("delete from O where contract_id=:contractId and plan_list>:planList").setParameter("contractId",param.get("contractId")).setParameter("planList",param.get("termNo")).executeUpdate(); } /** @@ -462,21 +469,22 @@ public class CorpusSourceFileCopy { String penalty = bo.getAttribute("ALR_PENALTY").toString(); String rent = new BigDecimal(principal).add(new BigDecimal(interest)).toString(); String repaymentMoney = bo.getAttribute("ALR_REPAYMENT_MONEY").toString(); + String repaymentFlag = bo.getAttribute("REPAYMENT_FLAG").toString(); + String repaymentSource = bo.getAttribute("REPAYMENT_SOURCE").toString(); String repaymentDate = bo.getAttribute("NEW_REPAY_DATE").toString(); //转换日期格式 Date date = new SimpleDateFormat("yyyyMMdd").parse(repaymentDate); repaymentDate = new SimpleDateFormat("yyyy/MM/dd").format(date); - String rentPlanId = null; - if(!contractIdSet.contains(contractId)){ - //获取对应租金计划Id - BizObject lrpBo = lrpBomQuery.setParameter("contractId",contractId).setParameter("planList",termNo).getSingleResult(false); - rentPlanId = lrpBo.getAttribute("ID").toString(); - //将由合同id获取的参数放进来 - Map param = getParamByContractId(contractId,tx); - rentIncomeParam.putAll(param); - contractIdSet.add(contractId); - } + //获取对应租金计划Id + BizObject lrpBo = lrpBomQuery.setParameter("contractId",contractId).setParameter("planList",termNo).getSingleResult(false); + String rentPlanId = lrpBo.getAttribute("ID").toString(); + //将由合同id获取的参数放进来 + Map param = getParamByContractId(contractId,tx); + rentIncomeParam.putAll(param); + + contractIdSet.add(contractId); + //存入参数 rentIncomeParam.put("fcRequestId",fcRequestId); rentIncomeParam.put("contractId",contractId); @@ -487,6 +495,8 @@ public class CorpusSourceFileCopy { rentIncomeParam.put("interest",interest); rentIncomeParam.put("penalty",penalty); rentIncomeParam.put("repaymentMoney",repaymentMoney); + rentIncomeParam.put("repaymentFlag",repaymentFlag); + rentIncomeParam.put("repaymentSource",repaymentSource); rentIncomeParam.put("repaymentDate",repaymentDate); rentIncomeParams.add(rentIncomeParam); @@ -525,7 +535,7 @@ public class CorpusSourceFileCopy { lriBo.setAttributeValue("PENALTY",param.get("penalty")); lriBo.setAttributeValue("PLAN_LIST",param.get("termNo")); lriBo.setAttributeValue("HIRE_LIST","1"); - lriBo.setAttributeValue("PLAN_DATE",param.get("repaymentDate")); + lriBo.setAttributeValue("HIRE_DATE",param.get("repaymentDate")); lriBo.setAttributeValue("INPUTUSERID","8009U00000002");//定时任务管理员 lriBo.setAttributeValue("INPUTTIME",StringFunction.getTodayNow()); lriBom.saveObject(lriBo); @@ -542,6 +552,7 @@ public class CorpusSourceFileCopy { BizObject lrpBo = lrpBom.createQuery("contract_id=:contractId and plan_list=:planList").setParameter("contractId",param.get("contractId")).setParameter("planList",param.get("termNo")).getSingleResult(true); lrpBo.setAttributeValue("COLLECT_STATUS","批量收款"); lrpBo.setAttributeValue("COLLECT_MSG","邮储代收"); + lrpBo.setAttributeValue("CHARGE_WAY","PSBC"); lrpBom.saveObject(lrpBo); } /** @@ -557,6 +568,112 @@ public class CorpusSourceFileCopy { lciBom.saveObject(lciBo); } + /** + * + * @throws JBOException + */ + public void createCashFlowByContractId(String contractId ,Transaction Sqlca) throws Exception { + //0.删除原有现金流 + String deleteSql = "delete from lc_cash_flow where contract_id=:contractId"; + SqlObject sql = new SqlObject(deleteSql); + sql.setParameter("contractId",contractId); + Sqlca.executeSQL(sql); + //1.插入新的现金流 + String appendInfo = " "; + String sqlPath = "/etc/sql/insertIntoCashFlow.xml"; + String xmlPath=ARE.getProperty("PRD_HOME")+sqlPath; + Map xmlFile= XMLDataUtil.readTableInfoFromXmlFile(xmlPath); + String sqlCode=xmlFile.get("table_sql").replaceAll("\r|\n|\t", " "); + String GPSsql = "select gps_difference from lc_calc_condition where contract_id='"+contractId+"'"; + String GPSDifference= Sqlca.getString(GPSsql); + if(GPSDifference!=null&&!"".equals(GPSDifference)&&!"0.00".equals(GPSDifference)){ + appendInfo = " union all select project_id,project_plan_number,contract_id,contract_plan_number,payment_number,plan_date,'"+GPSDifference+"' flowin,'GPS差额: "+GPSDifference+"' flowindetail,'' flowout,'' flowoutdetil,'"+GPSDifference+"' cleanfow from lc_fund_plan where contract_id =:contractId and fee_type='feetype10' "; + } + sqlCode = sqlCode.replace("appendInfo",appendInfo); + sql = new SqlObject(sqlCode); + sql.setParameter("contractId",contractId); + Sqlca.executeSQL(sql); + } + public void calcIRR(Map param,JBOTransaction tx) throws Exception { + String irr = getIRR(param,tx); + updateIRR(param.get("contractId"),irr,tx); + } + /** + * IRR计算,套用安硕计算方式 + * @param param + * @param tx + * @return + * @throws Exception + */ + public String getIRR(Map param,JBOTransaction tx) throws Exception { + BizObjectManager lccBom = JBOFactory.getBizObjectManager(LC_CALC_CONDITION.CLASS_NAME,tx); + BizObject lccBo = lccBom.createQuery("contract_id=:contractId").setParameter("contractId",contractId).getSingleResult(false); + String cashSql = "select NET_FLOW,PLAN_DATE from lc_cash_flow where contract_id='"+param.get("contractId")+"' order by plan_date"; + List> cashes = DataOperatorUtil.getDataBySql(tx, cashSql, null); + List netList = new ArrayList(); + List dateList = new ArrayList(); + for(Map cash :cashes){ + netList.add(cash.get("NET_FLOW")); + dateList.add(cash.get("PLAN_DATE")); + } + + String irr = ""; + String IrrType= ProductParamUtil.getProductParameterValue(param.get("productId"),"PRD0350","SYHS","SYHS"); + if("STAGE_IRR".equals(IrrType)){//按期IRR + BigDecimal issueRate= IRRCalculateUtil.getIRR2(netList); + irr=issueRate.multiply( new BigDecimal(1200/lccBo.getAttribute("INCOME_INTERVAL_MONTH").getInt())).setScale(6,BigDecimal.ROUND_HALF_UP).toString(); + }else if("MONTH_IRR".equals(IrrType)){//按月IRR + String upperListDate=""; + List newNetList=new ArrayList(); + List newDateList=new ArrayList(); + for(int i=0;i inflowPour=new ArrayList(); + String plandate=""; + for(int i=0;i1){ + for(int y=1;y fyfrrBoList = fyfrrBom.createQuery(sql).setParameter("fcFileId",fcFileId).getResultList(false); if(fyfrrBoList.size()==0){ ARE.getLog().error("未找到FC_REQUEST_ID: "+fcFileId+" 对应的资方还款计划"); - throw new Exception("未找到FC_REQUEST_ID: "+fcFileId+" 对应的资方还款计划"); } return fyfrrBoList; } - /** - * - * @throws JBOException - */ - public void createCashFlow(Mapparam ,Transaction Sqlca) throws Exception { - //0.删除原有现金流 - String deleteSql = "delete from lc_cash_flow where contract_id=:contractId"; - SqlObject sql = new SqlObject(deleteSql); - sql.setParameter("contractId",param.get("contractId")); - Sqlca.executeSQL(sql); - //1.插入新的现金流 - String appendInfo = " "; - String sqlPath = "/etc/sql/insertIntoCashFlow.xml"; - String xmlPath=ARE.getProperty("PRD_HOME").replace("/WEB-INF", "")+sqlPath; - Map xmlFile= XMLDataUtil.readTableInfoFromXmlFile(xmlPath); - String sqlCode=xmlFile.get("table_sql").replaceAll("\r|\n|\t", " "); - String GPSDifference= ProductParamUtil.getProductParameterValue(param.get("product_id"),"PRD0390","GPSDifference","GPSDifference"); - if(GPSDifference!=null&&!"".equals(GPSDifference)){ - appendInfo = "union all select '','','','','',plan_date,'"+GPSDifference+"' flowin,'GPS差额:"+GPSDifference+"' flowindetail,'' flowout,'' flowoutdetil,'"+GPSDifference+"' cleanfow from lc_fund_plan where contract_id =:contractId and fee_type='feetype10' "; - } - sql = new SqlObject(sqlCode); - sql.setParameter("appendInfo",appendInfo); - sql.setParameter("contractId",param.get("contractId")); - Sqlca.executeSQL(sql); - } - - public String calcIRR(Map param,JBOTransaction tx) throws Exception { - String cashSql = "select NET_FLOW,PLAN_DATE from lc_cash_flow where contract_id='"+param.get("contractId")+"' order by plan_date"; - List> cashes = DataOperatorUtil.getDataBySql(tx, cashSql, null); - List netList = new ArrayList(); - List dateList = new ArrayList(); - for(Map cash :cashes){ - netList.add(cash.get("NET_FLOW")); - dateList.add(cash.get("PLAN_DATE")); - } - String irr=""; - if("STAGE_IRR".equals(IrrType)){//按期IRR - BigDecimal issueRate= IRRCalculateUtil.getIRR2(netList); - irr=issueRate.multiply( new BigDecimal(1200/cb.getIncomeIntervalMonth())).setScale(6,BigDecimal.ROUND_HALF_UP).toString(); - }else if("MONTH_IRR".equals(IrrType)){//按月IRR - String upperListDate=""; - List newNetList=new ArrayList(); - List newDateList=new ArrayList(); - for(int i=0;i inflowPour=new ArrayList(); - String plandate=""; - for(int i=0;i1){ - for(int y=1;y Date: Thu, 26 Aug 2021 13:20:10 +0800 Subject: [PATCH 5/8] =?UTF-8?q?=E5=9B=9E=E8=B4=AD=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E5=BD=95=E5=85=A5=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WebContent/WEB-INF/etc/jbo/jbo_oti.xml | 26 ++++- .../tenwa/apzl/settleLoan/FcBuyBackInfo.jsp | 59 ++++++++++ .../tenwa/apzl/settleLoan/FcBuyBackList.jsp | 73 ++++++++++++ src/com/ap/BuyBack.java | 106 ++++++++++++++++++ src_jbo/jbo/oti/FC_BUYBACK_INFO.java | 75 +++++++++++++ src_jbo/jbo/oti/FC_REQUEST_CHANNEL_LOG.java | 6 +- .../quartzmession/CorpusSourceFileCopy.java | 32 +++--- 7 files changed, 355 insertions(+), 22 deletions(-) create mode 100644 WebContent/com/tenwa/apzl/settleLoan/FcBuyBackInfo.jsp create mode 100644 WebContent/com/tenwa/apzl/settleLoan/FcBuyBackList.jsp create mode 100644 src/com/ap/BuyBack.java create mode 100644 src_jbo/jbo/oti/FC_BUYBACK_INFO.java diff --git a/WebContent/WEB-INF/etc/jbo/jbo_oti.xml b/WebContent/WEB-INF/etc/jbo/jbo_oti.xml index 483a6c531..fe917c2b1 100644 --- a/WebContent/WEB-INF/etc/jbo/jbo_oti.xml +++ b/WebContent/WEB-INF/etc/jbo/jbo_oti.xml @@ -496,7 +496,6 @@ - @@ -506,5 +505,30 @@
+ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/WebContent/com/tenwa/apzl/settleLoan/FcBuyBackInfo.jsp b/WebContent/com/tenwa/apzl/settleLoan/FcBuyBackInfo.jsp new file mode 100644 index 000000000..0a9e5219d --- /dev/null +++ b/WebContent/com/tenwa/apzl/settleLoan/FcBuyBackInfo.jsp @@ -0,0 +1,59 @@ +<%@ page contentType="text/html; charset=GBK"%><%@ + include file="/Frame/resources/include/include_begin_info.jspf"%><% + + String id = CurPage.getParameter("ID"); + String fcRequestId = CurPage.getParameter("fcRequestId"); + String firstOverdueCorpus = CurPage.getParameter("firstOverdueCorpus"); + String firstOverdueInterest = CurPage.getParameter("firstOverdueInterest"); + String secondOverdueCorpus = CurPage.getParameter("secondOverdueCorpus"); + String secondOverdueInterest = CurPage.getParameter("secondOverdueInterest"); + String overdueList = CurPage.getParameter("overdueList"); + String voucherStatus = CurPage.getParameter("voucherStatus"); + String readOnly = "0"; + if("1".equals(voucherStatus)){ + readOnly="1"; + } + ASObjectModel doTemp = new ASObjectModel("FC_BUYBACK_INFO"); + ASObjectWindow dwTemp = new ASObjectWindow(CurPage,doTemp,request); + dwTemp.Style="2"; //设置DW风格 1:Grid 2:Freeform + dwTemp.ReadOnly = readOnly; //设置是否只读 1:只读 0:可写 + dwTemp.genHTMLObjectWindow(id); + + String sButtons[][] = { + {"0".equals(readOnly)?"true":"false","All","Button","保存","保存所有修改","save()","","","",""}, + {"true","","Button","返回","返回","returnList()","","","",""}, + }; + sButtonPosition = "south"; +%><%@include file="/Frame/resources/include/ui/include_info.jspf"%> + +<%@ include file="/Frame/resources/include/include_end.jspf"%> \ No newline at end of file diff --git a/WebContent/com/tenwa/apzl/settleLoan/FcBuyBackList.jsp b/WebContent/com/tenwa/apzl/settleLoan/FcBuyBackList.jsp new file mode 100644 index 000000000..40d1491d8 --- /dev/null +++ b/WebContent/com/tenwa/apzl/settleLoan/FcBuyBackList.jsp @@ -0,0 +1,73 @@ +<%@ page contentType="text/html; charset=GBK"%> +<%@ include file="/Frame/resources/include/include_begin_list.jspf"%><% + /* + Author: undefined 2021-08-04 + Content: + History Log: + */ + ASObjectModel doTemp = new ASObjectModel("FC_BUYBACK_LIST"); + ASObjectWindow dwTemp = new ASObjectWindow(CurPage,doTemp,request); + dwTemp.Style="1"; //--设置为Grid风格-- + dwTemp.ReadOnly = "1"; //只读模式 + dwTemp.setPageSize(20); + dwTemp.genHTMLObjectWindow(""); + + //0、是否展示 1、 权限控制 2、 展示类型 3、按钮显示名称 4、按钮解释文字 5、按钮触发事件代码 6、 7、 8、 9、图标,CSS层叠样式 10、风格 + String sButtons[][] = { + {"true","","Button","新增","新增","newRecord()","","","","btn_icon_detail",""}, + {"true","","Button","修改","修改","viewAndEdit()","","","","btn_icon_detail",""}, + {"true","","Button","删除","删除","do_delete()","","","","btn_icon_delete",""}, + }; +%><%@include file="/Frame/resources/include/ui/include_list.jspf"%> + +<%@ include file="/Frame/resources/include/include_end.jspf"%> \ No newline at end of file diff --git a/src/com/ap/BuyBack.java b/src/com/ap/BuyBack.java new file mode 100644 index 000000000..4a4e9583d --- /dev/null +++ b/src/com/ap/BuyBack.java @@ -0,0 +1,106 @@ +package com.ap; + +import com.alibaba.fastjson.JSONObject; +import com.amarsoft.are.jbo.*; +import jbo.app.tenwa.calc.LC_RENT_INCOME; +import jbo.app.tenwa.calc.LC_RENT_PLAN; +import jbo.oti.FC_BUYBACK_INFO; +import java.math.BigDecimal; + +public class BuyBack { + + private String contractId; + private String fcRequestId; + + /** + * 获取开始逾期的两期的本金利息以及开始期次 + * @return JSON格式的字符串 + * @throws JBOException + */ + public String getBuyBackInfoByContract() throws JBOException { + JSONObject jsonObject = new JSONObject(); + //获取实收表最后一期信息记录 + String sql = "select sum(rent) as v.rent,sum(CORPUS) as v.corpus,sum(INTEREST) as v.interest,PLAN_LIST,PLAN_ID from O where CONTRACT_ID='"+contractId+"' " + + "and plan_list=(select max(plan_list) from O where CONTRACT_ID='"+contractId+"') group by PLAN_LIST"; + BizObject boLRI = JBOFactory.getBizObjectManager(LC_RENT_INCOME.CLASS_NAME).createQuery(sql).getSingleResult(false); + //给出默认值,如果当查询结果为null时,就默认第一期开始就没还过钱,防止NPE + String rent_in = "0.00"; + String corpus = "0.00"; + String interest = "0.00"; + int planList = 1; + if(boLRI!=null){ + rent_in = boLRI.getAttribute("rent").getString(); + corpus = boLRI.getAttribute("corpus").getString(); + interest = boLRI.getAttribute("interest").getString(); + planList = boLRI.getAttribute("PLAN_LIST").getInt(); + } + + //获取当期对应租金计划 + BizObjectManager bomLRP = JBOFactory.getBizObjectManager(LC_RENT_PLAN.CLASS_NAME); + BizObjectQuery boqLRP = bomLRP.createQuery("contract_id=:contractId and plan_list=:planList").setParameter("contractId",contractId); + BizObject boLRP = boqLRP.setParameter("planList",planList).getSingleResult(false); + String rent_plan = boLRP.getAttribute("rent").getString(); + //检验当期是否结清 + boolean planListIsComplete = new BigDecimal(rent_in).compareTo(new BigDecimal(rent_plan))>=0; + + //不带0为当期;带1为下一期;带2为下两期 + //+1期为通用,故挪到上面来 + BizObject boLRP1 = boqLRP.setParameter("planList",planList+1).getSingleResult(false); + String corpus1 = "0.00"; + String interest1 = "0.00"; + if(boLRP1!=null){ + corpus1 = boLRP1.getAttribute("corpus").toString(); + interest1 = boLRP1.getAttribute("interest").toString(); + } + + if(planListIsComplete){ + BizObject boLRP2 = boqLRP.setParameter("planList",planList+2).getSingleResult(false); + String corpus2 = "0.00"; + String interest2 = "0.00"; + if(boLRP2!=null){ + corpus2 = boLRP2.getAttribute("corpus").toString(); + interest2 = boLRP2.getAttribute("interest").toString(); + } + jsonObject.put("FIRST_OVERDUE_CORPUS",corpus1); + jsonObject.put("FIRST_OVERDUE_INTEREST",interest1); + jsonObject.put("SECOND_OVERDUE_CORPUS",corpus2); + jsonObject.put("SECOND_OVERDUE_INTEREST",interest2); + jsonObject.put("OVERDUE_LIST",planList+1); + }else{ + String buyBackCorpus = new BigDecimal(boLRP.getAttribute("corpus").toString()).subtract(new BigDecimal(corpus)).setScale(2,BigDecimal.ROUND_HALF_UP).toString(); + String buyBackInterest = new BigDecimal(boLRP.getAttribute("interest").toString()).subtract(new BigDecimal(interest)).setScale(2,BigDecimal.ROUND_HALF_UP).toString(); + jsonObject.put("FIRST_OVERDUE_CORPUS",buyBackCorpus); + jsonObject.put("FIRST_OVERDUE_INTEREST",buyBackInterest); + jsonObject.put("SECOND_OVERDUE_CORPUS",corpus1); + jsonObject.put("SECOND_OVERDUE_INTEREST",interest1); + jsonObject.put("OVERDUE_LIST",planList); + } + return jsonObject.toString(); + } + + /** + * 检验是否已经回购 + * @return + * @throws JBOException + */ + public String isHasCheck() throws JBOException { + BizObjectManager bomFBI = JBOFactory.getBizObjectManager(FC_BUYBACK_INFO.CLASS_NAME); + int boFBI = bomFBI.createQuery("FC_REQUEST_ID=:fcRequestId").setParameter("fcRequestId",fcRequestId).getTotalCount(); + return boFBI+""; + } + + public String getContractId() { + return contractId; + } + + public void setContractId(String contractId) { + this.contractId = contractId; + } + public String getFcRequestId() { + return fcRequestId; + } + + public void setFcRequestId(String fcRequestId) { + this.fcRequestId = fcRequestId; + } +} diff --git a/src_jbo/jbo/oti/FC_BUYBACK_INFO.java b/src_jbo/jbo/oti/FC_BUYBACK_INFO.java new file mode 100644 index 000000000..48425d369 --- /dev/null +++ b/src_jbo/jbo/oti/FC_BUYBACK_INFO.java @@ -0,0 +1,75 @@ +package jbo.oti; + +/** +* 接口资料表 - JBO命名常量类

+* Note: This file is generated by ADE tools, dont modify it.
+ +*/ +public interface FC_BUYBACK_INFO { + /** + * 接口资料表

+ * 代表本类映射的BizObjectClass + */ + public static final String CLASS_NAME = "jbo.oti.FC_BUYBACK_INFO"; + /** + * 唯一标识 STRING(32)
+ */ + public static final String ID = "ID"; + /** + * 资方请求id STRING(32)
+ */ + public static final String FC_REQUEST_ID = "FC_REQUEST_ID"; + /** + * 逾期开始期次 STRING(32)
+ */ + public static final String OVERDUE_LIST = "OVERDUE_LIST"; + /** + * 逾期第一期本金 STRING(32)
+ */ + public static final String FIRST_OVERDUE_CORPUS = "FIRST_OVERDUE_CORPUS"; + /** + * 逾期第一期利息 STRING(32)
+ */ + public static final String FIRST_OVERDUE_INTEREST = "FIRST_OVERDUE_INTEREST"; + /** + * 逾期第一期罚息 STRING(32)
+ */ + public static final String FIRST_OVERDUE_PENALTY = "FIRST_OVERDUE_PENALTY"; + /** + * 逾期第二期本金 STRING(32)
+ */ + public static final String SECOND_OVERDUE_CORPUS = "SECOND_OVERDUE_CORPUS"; + /** + * 逾期第二期利息 STRING(32)
+ */ + public static final String SECOND_OVERDUE_INTEREST = "SECOND_OVERDUE_INTEREST"; + /** + * 逾期第二期罚息 STRING(32)
+ */ + public static final String SECOND_OVERDUE_PENALTY = "SECOND_OVERDUE_PENALTY"; + /** + * 实际回购总金额 STRING(32)
+ */ + public static final String BUYBACK_MONEY = "BUYBACK_MONEY"; + /** + * 凭证状态:0,未生成,1,已生成 STRING(32)
+ */ + public static final String VOUCHER_STATUS = "VOUCHER_STATUS"; + /** + * INPUTUSERID STRING(32)
+ */ + public static final String INPUTUSERID = "INPUTUSERID"; + /** + * INPUTTIME STRING(32)
+ */ + public static final String INPUTTIME = "INPUTTIME"; + /** + * UPDATEUSERID STRING(32)
+ */ + public static final String UPDATEUSERID = "UPDATEUSERID"; + /** + * UPDATETIME STRING(32)
+ */ + public static final String UPDATETIME = "UPDATETIME"; + +} \ No newline at end of file diff --git a/src_jbo/jbo/oti/FC_REQUEST_CHANNEL_LOG.java b/src_jbo/jbo/oti/FC_REQUEST_CHANNEL_LOG.java index 3ecc5c5a2..f764c5104 100644 --- a/src_jbo/jbo/oti/FC_REQUEST_CHANNEL_LOG.java +++ b/src_jbo/jbo/oti/FC_REQUEST_CHANNEL_LOG.java @@ -10,7 +10,7 @@ public interface FC_REQUEST_CHANNEL_LOG { * 接口资料表

* 代表本类映射的BizObjectClass */ - public static final String CLASS_NAME = "jbo.oti.LC_PROFIT_PLAN"; + public static final String CLASS_NAME = "jbo.oti.FC_REQUEST_CHANNEL_LOG"; /** * 唯一标识 STRING(32)
*/ @@ -47,10 +47,6 @@ public interface FC_REQUEST_CHANNEL_LOG { * 变更类型 STRING(32)
*/ public static final String CHANGE_TYPE = "CHANGE_TYPE"; - /** - * 实际回购金额 STRING(32)
- */ - public static final String ACTUAL_PAYMENT_BACK_AMOUNT = "ACTUAL_PAYMENT_BACK_AMOUNT"; /** * 创建时间 STRING(32)
*/ diff --git a/src_tenwa/com/tenwa/lease/app/quartzmession/CorpusSourceFileCopy.java b/src_tenwa/com/tenwa/lease/app/quartzmession/CorpusSourceFileCopy.java index 81daf61bb..462c89472 100644 --- a/src_tenwa/com/tenwa/lease/app/quartzmession/CorpusSourceFileCopy.java +++ b/src_tenwa/com/tenwa/lease/app/quartzmession/CorpusSourceFileCopy.java @@ -39,22 +39,22 @@ public class CorpusSourceFileCopy { public void doCopy(JBOTransaction tx) throws Exception { BizObjectManager ffpBom = null; - ffpBom = JBOFactory.getBizObjectManager(FC_FILE_PUSH.CLASS_NAME,tx); - //todo 添加渠道商的选择,哪些需要拷表哪些不需要 - String fileSql = "select ID,FILE_STS from O where FILE_TYPE='"+fileType+"' and FILE_STS='2'"; - List ffpBoList = ffpBom.createQuery(fileSql).getResultList(true); - if(ffpBoList.size()==0){ - ARE.getLog().info("暂时没有需要拷表的资方文件"); - return; - } - //遍历解析每个文件 - for(BizObject ffpBo : ffpBoList){ - if(analyticalFile(ffpBo,tx)){ - ffpBo.setAttributeValue("FILE_STS","3"); - ffpBo.setAttributeValue("FILE_STS_DESC","拷贝成功"); - ffpBom.saveObject(ffpBo); - } + ffpBom = JBOFactory.getBizObjectManager(FC_FILE_PUSH.CLASS_NAME,tx); + //todo 添加渠道商的选择,哪些需要拷表哪些不需要 + String fileSql = "select ID,FILE_STS from O where FILE_TYPE='"+fileType+"' and FILE_STS='2'"; + List ffpBoList = ffpBom.createQuery(fileSql).getResultList(true); + if(ffpBoList.size()==0){ + ARE.getLog().info("暂时没有需要拷表的资方文件"); + return; + } + //遍历解析每个文件 + for(BizObject ffpBo : ffpBoList){ + if(analyticalFile(ffpBo,tx)){ + ffpBo.setAttributeValue("FILE_STS","3"); + ffpBo.setAttributeValue("FILE_STS_DESC","拷贝成功"); + ffpBom.saveObject(ffpBo); } + } } /** @@ -607,7 +607,7 @@ public class CorpusSourceFileCopy { */ public String getIRR(Map param,JBOTransaction tx) throws Exception { BizObjectManager lccBom = JBOFactory.getBizObjectManager(LC_CALC_CONDITION.CLASS_NAME,tx); - BizObject lccBo = lccBom.createQuery("contract_id=:contractId").setParameter("contractId",contractId).getSingleResult(false); + BizObject lccBo = lccBom.createQuery("contract_id=:contractId").setParameter("contractId",param.get("contractId")).getSingleResult(false); String cashSql = "select NET_FLOW,PLAN_DATE from lc_cash_flow where contract_id='"+param.get("contractId")+"' order by plan_date"; List> cashes = DataOperatorUtil.getDataBySql(tx, cashSql, null); List netList = new ArrayList(); From 6bfa2b704f3b9f6c820decc1a4d5f78a121f6f37 Mon Sep 17 00:00:00 2001 From: ap007 Date: Fri, 27 Aug 2021 16:07:40 +0800 Subject: [PATCH 6/8] =?UTF-8?q?=E5=9B=9E=E8=B4=AD=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E5=BD=95=E5=85=A5=E6=A0=A1=E9=AA=8C=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WebContent/WEB-INF/etc/jbo/jbo_oti.xml | 1 + WebContent/com/tenwa/apzl/settleLoan/FcBuyBackInfo.jsp | 9 ++++----- WebContent/com/tenwa/apzl/settleLoan/FcBuyBackList.jsp | 5 +++-- src/com/ap/BuyBack.java | 3 +++ src_jbo/jbo/oti/FC_BUYBACK_INFO.java | 4 ++++ 5 files changed, 15 insertions(+), 7 deletions(-) diff --git a/WebContent/WEB-INF/etc/jbo/jbo_oti.xml b/WebContent/WEB-INF/etc/jbo/jbo_oti.xml index fe917c2b1..572077ce2 100644 --- a/WebContent/WEB-INF/etc/jbo/jbo_oti.xml +++ b/WebContent/WEB-INF/etc/jbo/jbo_oti.xml @@ -517,6 +517,7 @@ + diff --git a/WebContent/com/tenwa/apzl/settleLoan/FcBuyBackInfo.jsp b/WebContent/com/tenwa/apzl/settleLoan/FcBuyBackInfo.jsp index 0a9e5219d..7f87508e2 100644 --- a/WebContent/com/tenwa/apzl/settleLoan/FcBuyBackInfo.jsp +++ b/WebContent/com/tenwa/apzl/settleLoan/FcBuyBackInfo.jsp @@ -9,6 +9,7 @@ String secondOverdueInterest = CurPage.getParameter("secondOverdueInterest"); String overdueList = CurPage.getParameter("overdueList"); String voucherStatus = CurPage.getParameter("voucherStatus"); + String allRemainMoney = CurPage.getParameter("allRemainMoney"); String readOnly = "0"; if("1".equals(voucherStatus)){ readOnly="1"; @@ -35,20 +36,18 @@ setItemValue(0,0,"SECOND_OVERDUE_CORPUS","<%=secondOverdueCorpus%>"); setItemValue(0,0,"SECOND_OVERDUE_INTEREST","<%=secondOverdueInterest%>"); setItemValue(0,0,"OVERDUE_LIST","<%=overdueList%>"); + setItemValue(0,0,"ALL_REMAIN_MONEY","<%=allRemainMoney%>"); } } function returnList(){ AsControl.OpenComp("com/tenwa/apzl/settleLoan/FcBuyBackList.jsp","","_self",""); } function save(){ - var firstOverdueCorpus = getItemValue(0,0,"FIRST_OVERDUE_CORPUS"); - var firstOverdueInterest = getItemValue(0,0,"FIRST_OVERDUE_INTEREST"); - var secondOverdueCorpus = getItemValue(0,0,"SECOND_OVERDUE_CORPUS"); - var secondOverdueInterest = getItemValue(0,0,"SECOND_OVERDUE_INTEREST"); + var allRemainMoney = getItemValue(0,0,"ALL_REMAIN_MONEY"); var firstOverduePenalty = getItemValue(0,0,"FIRST_OVERDUE_PENALTY"); var secondOverduePenalty = getItemValue(0,0,"SECOND_OVERDUE_PENALTY"); var buybackMoney = getItemValue(0,0,"BUYBACK_MONEY"); - var buybackMoneySum = eval(firstOverdueCorpus +"+"+ firstOverdueInterest +"+"+ secondOverdueCorpus +"+"+ secondOverdueInterest +"+"+ firstOverduePenalty +"+"+ secondOverduePenalty) ; + var buybackMoneySum = eval( allRemainMoney +"+"+ firstOverduePenalty +"+"+ secondOverduePenalty) ; if(buybackMoney!=buybackMoneySum.toFixed(2)){ alert("本金利息罚息金额相加总额"+buybackMoneySum+"与所填‘回购总金额’不相等"); return; diff --git a/WebContent/com/tenwa/apzl/settleLoan/FcBuyBackList.jsp b/WebContent/com/tenwa/apzl/settleLoan/FcBuyBackList.jsp index 40d1491d8..1edbfd0f3 100644 --- a/WebContent/com/tenwa/apzl/settleLoan/FcBuyBackList.jsp +++ b/WebContent/com/tenwa/apzl/settleLoan/FcBuyBackList.jsp @@ -16,7 +16,7 @@ String sButtons[][] = { {"true","","Button","新增","新增","newRecord()","","","","btn_icon_detail",""}, {"true","","Button","修改","修改","viewAndEdit()","","","","btn_icon_detail",""}, - {"true","","Button","删除","删除","do_delete()","","","","btn_icon_delete",""}, + {"true","","Button","删除","删除","deleteRecord()","","","","btn_icon_delete",""}, }; %><%@include file="/Frame/resources/include/ui/include_list.jspf"%> -<%@ include file="/Frame/resources/include/include_end.jspf"%> \ No newline at end of file diff --git a/WebContent/com/tenwa/apzl/settleLoan/FcBuyBackList.jsp b/WebContent/com/tenwa/apzl/settleLoan/FcBuyBackList.jsp index 1edbfd0f3..ec71a122d 100644 --- a/WebContent/com/tenwa/apzl/settleLoan/FcBuyBackList.jsp +++ b/WebContent/com/tenwa/apzl/settleLoan/FcBuyBackList.jsp @@ -5,8 +5,10 @@ Content: History Log: */ + String userID = CurUser.getUserID(); ASObjectModel doTemp = new ASObjectModel("FC_BUYBACK_LIST"); ASObjectWindow dwTemp = new ASObjectWindow(CurPage,doTemp,request); + dwTemp.MultiSelect = true; dwTemp.Style="1"; //--设置为Grid风格-- dwTemp.ReadOnly = "1"; //只读模式 dwTemp.setPageSize(20); @@ -14,61 +16,39 @@ //0、是否展示 1、 权限控制 2、 展示类型 3、按钮显示名称 4、按钮解释文字 5、按钮触发事件代码 6、 7、 8、 9、图标,CSS层叠样式 10、风格 String sButtons[][] = { - {"true","","Button","新增","新增","newRecord()","","","","btn_icon_detail",""}, - {"true","","Button","修改","修改","viewAndEdit()","","","","btn_icon_detail",""}, - {"true","","Button","删除","删除","deleteRecord()","","","","btn_icon_delete",""}, + + {"true","","Button","确认","确认回购信息无误","confirmRecord()","","","","btn_icon_detail",""}, }; %><%@include file="/Frame/resources/include/ui/include_list.jspf"%> <%@ include file="/Frame/resources/include/include_end.jspf"%> \ No newline at end of file diff --git a/src/com/ap/BuyBack.java b/src/com/ap/BuyBack.java index ed9386e6d..c01ef3fb4 100644 --- a/src/com/ap/BuyBack.java +++ b/src/com/ap/BuyBack.java @@ -1,24 +1,29 @@ package com.ap; -import com.alibaba.fastjson.JSONObject; import com.amarsoft.are.jbo.*; +import com.amarsoft.are.util.StringFunction; import jbo.app.tenwa.calc.LC_RENT_INCOME; import jbo.app.tenwa.calc.LC_RENT_PLAN; import jbo.oti.FC_BUYBACK_INFO; +import jbo.oti.FC_REQUEST; + import java.math.BigDecimal; +import java.util.HashMap; +import java.util.Map; public class BuyBack { private String contractId; private String fcRequestId; - + private String fcRequestIds; + private String userID; /** - * 获取开始逾期的两期的本金利息以及开始期次 - * @return JSON格式的字符串 + * 获取剩余本金利息 + * @return * @throws JBOException */ - public String getBuyBackInfoByContract() throws JBOException { - JSONObject jsonObject = new JSONObject(); + public Map getBuyBackInfoByContract(String contractId) throws JBOException { + Map map = new HashMap<>(); //获取实收表最后一期信息记录 String sql = "select sum(rent) as v.rent,sum(CORPUS) as v.corpus,sum(INTEREST) as v.interest,PLAN_LIST,PLAN_ID from O where CONTRACT_ID='"+contractId+"' " + "and plan_list=(select max(plan_list) from O where CONTRACT_ID='"+contractId+"') group by PLAN_LIST"; @@ -47,63 +52,102 @@ public class BuyBack { //不带0为当期;带1为下一期;带2为下两期 //+1期为通用,故挪到上面来 BizObject boLRP1 = boqLRP.setParameter("planList",planList+1).getSingleResult(false); - String corpus1 = "0.00"; String interest1 = "0.00"; if(boLRP1!=null){ - corpus1 = boLRP1.getAttribute("corpus").toString(); interest1 = boLRP1.getAttribute("interest").toString(); } if(planListIsComplete){ BizObject boLRP2 = boqLRP.setParameter("planList",planList+2).getSingleResult(false); - String corpus2 = "0.00"; String interest2 = "0.00"; if(boLRP2!=null){ - corpus2 = boLRP2.getAttribute("corpus").toString(); interest2 = boLRP2.getAttribute("interest").toString(); } - jsonObject.put("FIRST_OVERDUE_CORPUS",corpus1); - jsonObject.put("FIRST_OVERDUE_INTEREST",interest1); - jsonObject.put("SECOND_OVERDUE_CORPUS",corpus2); - jsonObject.put("SECOND_OVERDUE_INTEREST",interest2); - jsonObject.put("OVERDUE_LIST",planList+1); - jsonObject.put("ALL_REMAIN_MONEY",new BigDecimal(allRemainCorpus).add(new BigDecimal(interest1)).add(new BigDecimal(interest2)).setScale(2,BigDecimal.ROUND_HALF_UP).toString()); + map.put("ALL_REMAIN_CORPUS",allRemainCorpus); + map.put("ALL_REMAIN_INTEREST",new BigDecimal(interest1).add(new BigDecimal(interest2)).setScale(2,BigDecimal.ROUND_HALF_UP).toString()); }else{ - String buyBackCorpus = new BigDecimal(boLRP.getAttribute("corpus").toString()).subtract(new BigDecimal(corpus)).setScale(2,BigDecimal.ROUND_HALF_UP).toString(); String buyBackInterest = new BigDecimal(boLRP.getAttribute("interest").toString()).subtract(new BigDecimal(interest)).setScale(2,BigDecimal.ROUND_HALF_UP).toString(); - jsonObject.put("FIRST_OVERDUE_CORPUS",buyBackCorpus); - jsonObject.put("FIRST_OVERDUE_INTEREST",buyBackInterest); - jsonObject.put("SECOND_OVERDUE_CORPUS",corpus1); - jsonObject.put("SECOND_OVERDUE_INTEREST",interest1); - jsonObject.put("OVERDUE_LIST",planList); - jsonObject.put("ALL_REMAIN_MONEY", new BigDecimal(allRemainCorpus).subtract(new BigDecimal(corpus)).add(new BigDecimal(buyBackInterest)).add(new BigDecimal(interest1)).setScale(2,BigDecimal.ROUND_HALF_UP).toString()); + map.put("ALL_REMAIN_CORPUS",new BigDecimal(allRemainCorpus).subtract(new BigDecimal(corpus)).setScale(2,BigDecimal.ROUND_HALF_UP).toString()); + map.put("ALL_REMAIN_INTEREST",new BigDecimal(buyBackInterest).add(new BigDecimal(interest1)).setScale(2,BigDecimal.ROUND_HALF_UP).toString()); } - return jsonObject.toString(); + return map; } /** - * 检验是否已经回购 + * 确认回购本金利息和系统计算出的是否相等 + * @param tx * @return * @throws JBOException */ - public String isHasCheck() throws JBOException { - BizObjectManager bomFBI = JBOFactory.getBizObjectManager(FC_BUYBACK_INFO.CLASS_NAME); - int boFBI = bomFBI.createQuery("FC_REQUEST_ID=:fcRequestId").setParameter("fcRequestId",fcRequestId).getTotalCount(); - return boFBI+""; + public String confirmBuyBack(JBOTransaction tx) throws JBOException { + String corpusResult = ""; + String interestResult = ""; + String[] idArray = fcRequestIds.split("@"); + for(String fcRequestId : idArray){ + BizObjectManager bomFBI = JBOFactory.getBizObjectManager(FC_BUYBACK_INFO.CLASS_NAME,tx); + BizObject boFR = JBOFactory.getBizObjectManager(FC_REQUEST.CLASS_NAME,tx).createQuery("ID=:fcRequestId") + .setParameter("fcRequestId",fcRequestId).getSingleResult(false); + if(boFR==null){ + continue; + } + String contractId = boFR.getAttribute("CONTRACT_ID").toString(); + String contractNo = boFR.getAttribute("CONTRACT_NO").toString(); + + BizObject boFBI = bomFBI.createQuery("FC_REQUEST_ID=:fcRequestId").setParameter("fcRequestId",fcRequestId).getSingleResult(false); + String allRemainCorpus = boFBI.getAttribute("ALL_REMAIN_CORPUS").toString(); + String allRemainInterest = boFBI.getAttribute("ALL_REMAIN_INTEREST").toString(); + Map buyBack= this.getBuyBackInfoByContract(contractId); + if(!allRemainCorpus.equals(buyBack.get("ALL_REMAIN_CORPUS"))){ + corpusResult = corpusResult + contractNo + ","; + } + if(!allRemainInterest.equals(buyBack.get("ALL_REMAIN_INTEREST"))){ + interestResult = interestResult + contractNo + ","; + } + } + corpusResult = corpusResult==""?"":"以下合同的回购本金与系统剩余应还本金不相等:"+corpusResult+"\n"; + interestResult = interestResult==""?"":"以下合同的回购利息与系统剩余应还利息不相等:"+interestResult+"\n"; + return corpusResult + interestResult ; + } + + /** + * 确认回购 + * @param tx + * @return + * @throws JBOException + */ + public String updateBuyBackConfirm(JBOTransaction tx) throws JBOException { + String[] idArray = fcRequestIds.split("@"); + BizObjectManager bomFBI = JBOFactory.getBizObjectManager(FC_BUYBACK_INFO.CLASS_NAME, tx); + BizObjectQuery boqFBI = bomFBI.createQuery("FC_REQUEST_ID=:fcRequestId"); + for(String fcRequestId : idArray) { + BizObject boFBI = boqFBI.setParameter("fcRequestId",fcRequestId).getSingleResult(true); + boFBI.setAttributeValue("IS_CONFIRM","1"); + boFBI.setAttributeValue("UPDATEUSERID",userID); + boFBI.setAttributeValue("UPDATETIME", StringFunction.getTodayNow()); + bomFBI.saveObject(boFBI); + } + return null; } public String getContractId() { return contractId; } - public void setContractId(String contractId) { this.contractId = contractId; } + public String getFcRequestId() { return fcRequestId; } - public void setFcRequestId(String fcRequestId) { this.fcRequestId = fcRequestId; } + public String getFcRequestIds() { + return fcRequestIds; + } + public void setFcRequestIds(String fcRequestIds) { + this.fcRequestIds = fcRequestIds; + } + public String getUserID() {return userID;} + public void setUserID(String userID) {this.userID = userID;} } diff --git a/src_jbo/jbo/oti/FC_BUYBACK_INFO.java b/src_jbo/jbo/oti/FC_BUYBACK_INFO.java index 135c44a68..fb060dc67 100644 --- a/src_jbo/jbo/oti/FC_BUYBACK_INFO.java +++ b/src_jbo/jbo/oti/FC_BUYBACK_INFO.java @@ -20,41 +20,25 @@ public interface FC_BUYBACK_INFO { */ public static final String FC_REQUEST_ID = "FC_REQUEST_ID"; /** - * 逾期开始期次 STRING(32)
+ * 回购本金 STRING(32)
*/ - public static final String OVERDUE_LIST = "OVERDUE_LIST"; + public static final String ALL_REMAIN_CORPUS = "ALL_REMAIN_CORPUS"; /** - * 逾期第一期本金 STRING(32)
+ * 回购利息 STRING(32)
*/ - public static final String FIRST_OVERDUE_CORPUS = "FIRST_OVERDUE_CORPUS"; + public static final String ALL_REMAIN_INTEREST = "ALL_REMAIN_INTEREST"; /** - * 逾期第一期利息 STRING(32)
+ * 回购罚息 STRING(32)
*/ - public static final String FIRST_OVERDUE_INTEREST = "FIRST_OVERDUE_INTEREST"; - /** - * 逾期第一期罚息 STRING(32)
- */ - public static final String FIRST_OVERDUE_PENALTY = "FIRST_OVERDUE_PENALTY"; - /** - * 逾期第二期本金 STRING(32)
- */ - public static final String SECOND_OVERDUE_CORPUS = "SECOND_OVERDUE_CORPUS"; - /** - * 逾期第二期利息 STRING(32)
- */ - public static final String SECOND_OVERDUE_INTEREST = "SECOND_OVERDUE_INTEREST"; - /** - * 逾期第二期罚息 STRING(32)
- */ - public static final String SECOND_OVERDUE_PENALTY = "SECOND_OVERDUE_PENALTY"; + public static final String ALL_REMAIN_PENALTY = "ALL_REMAIN_PENALTY"; /** * 实际回购总金额 STRING(32)
*/ public static final String BUYBACK_MONEY = "BUYBACK_MONEY"; /** - * 回购金额(本金+利息),不包含罚息 STRING(32)
+ * 是否已确认 STRING(32)
*/ - public static final String ALL_REMAIN_MONEY = "ALL_REMAIN_MONEY"; + public static final String IS_CONFIRM = "IS_CONFIRM"; /** * 凭证状态:0,未生成,1,已生成 STRING(32)
*/ diff --git a/src_tenwa/com/tenwa/lease/app/quartzmession/CorpusSourceRentResultCopy.java b/src_tenwa/com/tenwa/lease/app/quartzmession/CorpusSourceRentResultCopy.java index be3fd9c7c..b45d9d383 100644 --- a/src_tenwa/com/tenwa/lease/app/quartzmession/CorpusSourceRentResultCopy.java +++ b/src_tenwa/com/tenwa/lease/app/quartzmession/CorpusSourceRentResultCopy.java @@ -5,6 +5,7 @@ import com.amarsoft.are.jbo.*; import com.amarsoft.are.util.StringFunction; import com.amarsoft.awe.util.Transaction; import com.base.util.QuartzUtil; +import jbo.oti.FC_BUYBACK_INFO; import jbo.oti.FC_YC_FILE_REPAY_RESULT; import org.quartz.Job; import org.quartz.JobExecutionContext; @@ -59,14 +60,16 @@ public class CorpusSourceRentResultCopy extends CorpusSourceFileCopy implements //0.获取所有参数(以文件信息为基础,将合同参数补充进去) List> allParam = this.getAllParam(fyfrpBoList,tx); for(Map param : allParam){ - //1.插入租金实收表 - this.insertRentIncome(param,tx); - // 2.0根据状态的不同,来进行不同的操作 - //2.1如果当期正常结清或者当期逾期结清, + + // 1.0根据状态的不同,来进行不同的操作 + //1.1如果当期正常结清或者当期逾期结清, if("0".equals(param.get("repaymentFlag"))){ + this.insertRentIncome(param,tx); updateRentPlanStatus(param,tx); - //2.2如果提前结清 并且 为借款人本人账户,则视为客户本人提前结清,直接变更租金计划表租金计划 - }else if("3".equals(param.get("repaymentFlag"))&&"0".equals(param.get("repaymentSource"))){ + //1.2如果提前结清 并且 为借款人本人账户,则视为客户本人提前结清,直接变更租金计划表租金计划 + } + if("3".equals(param.get("repaymentFlag"))&&"0".equals(param.get("repaymentSource"))){ + this.insertRentIncome(param,tx); //租金计划,现金流存历史表 //每个合同只有一次提前结清,只有提前结清才会走这里,所以按照合同id来执行 copyRentPlanFormatToHis(param.get("contractId"),param.get("fcRequestId"),"邮储提前结清前租金计划",tx); @@ -79,12 +82,14 @@ public class CorpusSourceRentResultCopy extends CorpusSourceFileCopy implements createCashFlowByContractId(param.get("contractId"),Sqlca); //重新Irr计算 calcIRR(param,tx); - //2.3如果提请结清 并且 为非借款人本人账户,则视为我方回购,需改变资方状态,我方能继续扣款 - }else if("3".equals(param.get("repaymentFlag"))&&"1".equals(param.get("repaymentSource"))){ + //1.3如果提请结清 并且 为非借款人本人账户,则视为我方回购,需改变资方状态,我方能继续扣款 + } + if("3".equals(param.get("repaymentFlag"))&&"1".equals(param.get("repaymentSource"))){ int result = 1; //变更资方资源(要有日志) try{ changeCorpusSource(param,tx); + createBuyBackInfo(param,tx); }catch (JBOException e){ result = 0; e.printStackTrace(); @@ -99,6 +104,20 @@ public class CorpusSourceRentResultCopy extends CorpusSourceFileCopy implements } } + public void createBuyBackInfo(Map param, JBOTransaction tx) throws JBOException { + BizObjectManager bomFBI = JBOFactory.getBizObjectManager(FC_BUYBACK_INFO.CLASS_NAME,tx); + BizObject boFBI = bomFBI.newObject(); + boFBI.setAttributeValue("FC_REQUEST_ID",param.get("fcRequestId")); + boFBI.setAttributeValue("ALL_REMAIN_CORPUS",param.get("principal")); + boFBI.setAttributeValue("ALL_REMAIN_INTEREST",param.get("interest")); + boFBI.setAttributeValue("ALL_REMAIN_PENALTY",param.get("penalty")); + boFBI.setAttributeValue("BUYBACK_MONEY",param.get("repaymentMoney")); + boFBI.setAttributeValue("IS_CONFIRM","0"); + boFBI.setAttributeValue("VOUCHER_STATUS","0"); + boFBI.setAttributeValue("INPUTUSERID","system"); + boFBI.setAttributeValue("INPUTTIME",StringFunction.getTodayNow()); + bomFBI.saveObject(boFBI); + } /** * 根据文件ID获取《租金实收》信息 From ef60c04036774955fad3902b331db7f6344ae207 Mon Sep 17 00:00:00 2001 From: ap007 Date: Mon, 6 Sep 2021 15:19:24 +0800 Subject: [PATCH 8/8] =?UTF-8?q?=E6=97=A0=E6=94=B9=E5=8A=A8=EF=BC=8C?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=8B=E5=A4=87=E6=B3=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lease/app/quartzmession/CorpusSourceRentResultCopy.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src_tenwa/com/tenwa/lease/app/quartzmession/CorpusSourceRentResultCopy.java b/src_tenwa/com/tenwa/lease/app/quartzmession/CorpusSourceRentResultCopy.java index b45d9d383..0737dcc52 100644 --- a/src_tenwa/com/tenwa/lease/app/quartzmession/CorpusSourceRentResultCopy.java +++ b/src_tenwa/com/tenwa/lease/app/quartzmession/CorpusSourceRentResultCopy.java @@ -66,8 +66,8 @@ public class CorpusSourceRentResultCopy extends CorpusSourceFileCopy implements if("0".equals(param.get("repaymentFlag"))){ this.insertRentIncome(param,tx); updateRentPlanStatus(param,tx); - //1.2如果提前结清 并且 为借款人本人账户,则视为客户本人提前结清,直接变更租金计划表租金计划 } + //1.2如果提前结清 并且 为借款人本人账户,则视为客户本人提前结清,直接变更租金计划表租金计划 if("3".equals(param.get("repaymentFlag"))&&"0".equals(param.get("repaymentSource"))){ this.insertRentIncome(param,tx); //租金计划,现金流存历史表 @@ -82,8 +82,8 @@ public class CorpusSourceRentResultCopy extends CorpusSourceFileCopy implements createCashFlowByContractId(param.get("contractId"),Sqlca); //重新Irr计算 calcIRR(param,tx); - //1.3如果提请结清 并且 为非借款人本人账户,则视为我方回购,需改变资方状态,我方能继续扣款 } + //1.3如果提请结清 并且 为非借款人本人账户,则视为我方回购,需改变资方状态,我方能继续扣款 if("3".equals(param.get("repaymentFlag"))&&"1".equals(param.get("repaymentSource"))){ int result = 1; //变更资方资源(要有日志)