贷后初版提交
This commit is contained in:
parent
427d19b958
commit
4b4b5306d8
@ -392,7 +392,7 @@
|
||||
<class name="FC_YC_FILE_REPAY_PLAN" label="资方租金计划信息" describe="资方租金计划信息" keyAttributes="ID">
|
||||
<attributes>
|
||||
<attribute name="ID" label="唯一标识" type="STRING" length="32" />
|
||||
<attribute name="FC_FILE_ID" label="×ʽðÇþµÀÉêÇëID" type="STRING" length="32"/>
|
||||
<attribute name="FC_FILE_ID" label="资金渠道文件ID" type="STRING" length="32"/>
|
||||
<attribute name="FC_REQUEST_ID" label="资金渠道申请ID" type="STRING" length="32"/>
|
||||
<attribute name="LOAN_NO" label="放款申请编号" type="STRING" length="32"/>
|
||||
<attribute name="LEND_TERM" label="期次" type="STRING" length="32"/>
|
||||
@ -410,6 +410,65 @@
|
||||
</managerProperties>
|
||||
</manager>
|
||||
</class>
|
||||
<class name="FC_YC_PREPAY_QUERY" label="提前结清试算接口内容" describe="提前结清试算接口内容" keyAttributes="ID">
|
||||
<attributes>
|
||||
<attribute name="ID" label="唯一标识" type="STRING" length="32" />
|
||||
<attribute name="FC_FILE_ID" label="资金渠道文件ID" type="STRING" length="32"/>
|
||||
<attribute name="FC_REQUEST_ID" label="资金渠道申请ID" type="STRING" length="32"/>
|
||||
<attribute name="LOAN_NO" label="放款申请编号" type="STRING" length="32"/>
|
||||
<attribute name="LOAN_CAPITAL_BALANCE" label="贷款余额" type="STRING" length="32"/>
|
||||
<attribute name="FC_FILE_PUSH_NAME" label="" type="STRING" length="32"/>
|
||||
<attribute name="CURRENCY" label="币种" type="STRING" length="32"/>
|
||||
<attribute name="LOAN_RATE" label="贷款利率" type="STRING" length="32"/>
|
||||
<attribute name="REPAY_KIND" label="还款方式" type="STRING" length="32"/>
|
||||
<attribute name="LOAN_BEGIN_DATE" label="贷款起期" type="STRING" length="32"/>
|
||||
<attribute name="LOAN_END_DATE" label="贷款止期" type="STRING" length="32"/>
|
||||
<attribute name="REPAY_ACC_NO" label="还款账号" type="STRING" length="32"/>
|
||||
<attribute name="REPAY_BALANCE" label="还款账号余额" type="STRING" length="32"/>
|
||||
<attribute name="REPAY_TYPE" label="提前还款类型" type="STRING" length="32"/>
|
||||
<attribute name="CURRENT_CAPITAL_BALANCE" label="当期应还本息金额" type="STRING" length="32"/>
|
||||
<attribute name="CURRENT_CAPITAL_INT" label="当前应还利息" type="STRING" length="32"/>
|
||||
<attribute name="OVERDUE_CAPITAL_BALANCE" label="拖欠本金" type="STRING" length="32"/>
|
||||
<attribute name="OVERDUE_CAPITAL_INT" label="拖欠利息" type="STRING" length="32"/>
|
||||
<attribute name="RECORD_DATE" label="申请日期" type="STRING" length="32"/>
|
||||
<attribute name="PREREPAY_AMOUNT" label="归还本息金额" type="STRING" length="32"/>
|
||||
<attribute name="PREREPAY_AMOUNT1" label="提前归还本金金额" type="STRING" length="32"/>
|
||||
<attribute name="CREATE_TIME" label="创建时间" type="STRING" length="32"/>
|
||||
<attribute name="UPDATE_TIME" label="修改时间" type="STRING" length="32"/>
|
||||
</attributes>
|
||||
<manager>
|
||||
<managerProperties>
|
||||
<property name="table" value="fc_yc_prepay_query"/>
|
||||
<property name="createKey" value="true" />
|
||||
</managerProperties>
|
||||
</manager>
|
||||
</class>
|
||||
<class name="FC_YC_FILE_REPAY_RESULT" label="资方租金还款结果信息" describe="资方租金计划信息" keyAttributes="ID">
|
||||
<attributes>
|
||||
<attribute name="ID" label="唯一标识" type="STRING" length="32" />
|
||||
<attribute name="FC_FILE_ID" label="资金渠道申请ID" type="STRING" length="32"/>
|
||||
<attribute name="LOAN_NO" label="放款申请编号" type="STRING" length="32"/>
|
||||
<attribute name="TERM_NO" label="期次" type="STRING" length="32"/>
|
||||
<attribute name="NEW_REPAY_DATE" label="还款日期" type="STRING" length="32"/>
|
||||
<attribute name="ALR_PRINCIPAL" label="本金" type="STRING" length="32"/>
|
||||
<attribute name="ALR_INTEREST" label="利息" type="STRING" length="32"/>
|
||||
<attribute name="ALR_PENALTY" label="罚息" type="STRING" length="32"/>
|
||||
<attribute name="ALR_REPAYMENT_MONEY" label="归还合计" type="STRING" length="32"/>
|
||||
<attribute name="REPAYMENT_FLAG" label="还款标识:0-当期正常结清 、当期逾期结清、1-提前部分还款、2-逾期、3-提前结清" type="STRING" length="32"/>
|
||||
<attribute name="REPAYMENT_SOURCE" label="还款来源标识:0:借款人本人账户;1:非借款人本人账户" type="STRING" length="32"/>
|
||||
<attribute name="TRADE_FEE" label="提前还款费用" type="STRING" length="32"/>
|
||||
<attribute name="REPAYMENT_ACCOUNT_NO" label="还款账号" type="STRING" length="32"/>
|
||||
<attribute name="FLOWNO" label="流水号" type="STRING" length="32"/>
|
||||
<attribute name="CREATE_TIME" label="创建时间" type="STRING" length="32"/>
|
||||
<attribute name="UPDATE_TIME" label="修改时间" type="STRING" length="32"/>
|
||||
</attributes>
|
||||
<manager>
|
||||
<managerProperties>
|
||||
<property name="table" value="fc_yc_file_repay_result"/>
|
||||
<property name="createKey" value="true" />
|
||||
</managerProperties>
|
||||
</manager>
|
||||
</class>
|
||||
<class name="LC_PROFIT_PLAN" label="资方分润计划信息" describe="资方分润计划信息" keyAttributes="ID">
|
||||
<attributes>
|
||||
<attribute name="ID" label="唯一标识" type="STRING" length="32" />
|
||||
@ -425,5 +484,24 @@
|
||||
</managerProperties>
|
||||
</manager>
|
||||
</class>
|
||||
<class name="FC_REQUEST_CHANNEL_LOG" label="资方变更日志表" describe="资方分润计划信息" keyAttributes="ID">
|
||||
<attributes>
|
||||
<attribute name="ID" label="唯一标识" type="STRING" length="32" />
|
||||
<attribute name="FC_REQUEST_ID" label="资方请求id" type="STRING" length="32"/>
|
||||
<attribute name="PRE_CHANNEL_NO" label="修改前资方编号" type="STRING" length="32"/>
|
||||
<attribute name="PRE_CHANNEL_NAME" label="修改前资方名称" type="STRING" length="32"/>
|
||||
<attribute name="CHANNEL_NO" label="修改后资方编号" type="STRING" length="32"/>
|
||||
<attribute name="CHANNEL_NAME" label="修改后资方名称" type="STRING" length="32"/>
|
||||
<attribute name="REMARK" label="描述" type="STRING" length="32"/>
|
||||
<attribute name="CHANGE_RESULT" label="变更结果" type="STRING" length="32"/>
|
||||
<attribute name="CREATETIME" label="创建时间" type="STRING" length="32"/>
|
||||
</attributes>
|
||||
<manager>
|
||||
<managerProperties>
|
||||
<property name="table" value="fc_request_channel_log"/>
|
||||
<property name="createKey" value="true" />
|
||||
</managerProperties>
|
||||
</manager>
|
||||
</class>
|
||||
</package>
|
||||
</jbo>
|
||||
91
WebContent/WEB-INF/etc/sql/insertIntoCashFlow.xml
Normal file
91
WebContent/WEB-INF/etc/sql/insertIntoCashFlow.xml
Normal file
@ -0,0 +1,91 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<table-root
|
||||
xmlns="http://www.tracywindy.org/table"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.tracywindy.org/table http://www.tracywindy.org/table/table-1.0.xsd">
|
||||
<table>
|
||||
<data>
|
||||
<MYSQL>
|
||||
<table_sql>
|
||||
<![CDATA[
|
||||
INSERT INTO LC_CASH_FLOW (id, project_id, project_plan_number, contract_id, contract_plan_number, payment_number,
|
||||
plan_date, fund_in, fund_in_details, fund_out, fund_out_details, net_flow)
|
||||
select replace(uuid(), '-', '') id,
|
||||
max(t.project_id),
|
||||
max(t.project_plan_number),
|
||||
max(t.contract_id),
|
||||
max(t.contract_plan_number),
|
||||
max(t.payment_number),
|
||||
t.plan_date,
|
||||
sum(t.flowin) fundin,
|
||||
ifnull(group_concat(if(t.flowindetail = '', null, t.flowindetail)), '-') fundindetails,
|
||||
sum(t.flowout) fundout,
|
||||
ifnull(group_concat(if(t.flowoutdetail = '', null, t.flowoutdetail)), '-') fundoutdetails,
|
||||
sum(t.cleanfow) netflow
|
||||
from (
|
||||
select cfrp.project_id,
|
||||
cfrp.project_plan_number,
|
||||
cfrp.contract_id,
|
||||
cfrp.contract_plan_number,
|
||||
cfrp.payment_number,
|
||||
cfrp.plan_date,
|
||||
ifnull(lpp.profit, 0) flowin,
|
||||
concat('第', cfrp.plan_list, '期分润金额:', format(lpp.profit, 2)) flowindetail,
|
||||
0 flowout,
|
||||
'' flowoutdetail,
|
||||
lpp.profit - 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
|
||||
union all
|
||||
select fundplan.project_id,
|
||||
fundplan.project_plan_number,
|
||||
fundplan.contract_id,
|
||||
fundplan.contract_plan_number,
|
||||
fundplan.payment_number,
|
||||
fundplan.plan_date,
|
||||
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_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'
|
||||
where fundplan.CONTRACT_ID = :contractId
|
||||
and fundplan.fee_type in
|
||||
('feetype2', 'feetype1', 'feetype10', 'feetype16', 'feetype17', 'feetype33', 'feetype24')
|
||||
union all
|
||||
select '',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
DATE_FORMAT(substr(LOAN_DATE, 1, 8), '%Y/%m/%d') as plan_date,
|
||||
frl.TRANS_AMT as flowin,
|
||||
concat('邮储回款金额:', frl.TRANS_AMT) as flowindetail,
|
||||
0 as flowout,
|
||||
'' as flowoutdetail,
|
||||
frl.TRANS_AMT 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
|
||||
where fr.CONTRACT_ID = :contractId
|
||||
:appendInfo
|
||||
) t
|
||||
group by t.plan_date;
|
||||
]]>
|
||||
</table_sql>
|
||||
</MYSQL>
|
||||
<ORACLE>
|
||||
<table_sql>
|
||||
<![CDATA[
|
||||
|
||||
]]>
|
||||
</table_sql>
|
||||
</ORACLE>
|
||||
<dataSource>dataSource</dataSource>
|
||||
<show_sql>false</show_sql>
|
||||
</data>
|
||||
</table>
|
||||
</table-root>
|
||||
@ -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"%>
|
||||
<script type="text/javascript">
|
||||
function returnList(){
|
||||
AsControl.OpenComp("com/tenwa/apzl/settleLoan/CorpusSourceSettleLoanList.jsp","","_self","");
|
||||
}
|
||||
function newRecord(){
|
||||
AsControl.OpenComp("com/tenwa/apzl/settleLoan/CorpusSourceSettleLoanList.jsp","","_self","");
|
||||
}
|
||||
</script>
|
||||
<%@ include file="/Frame/resources/include/include_end.jspf"%>
|
||||
@ -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"%>
|
||||
<script type="text/javascript">
|
||||
|
||||
function viewAndEdit(){
|
||||
var sUrl = "com/tenwa/apzl/settleLoan/CorpusSourceSettleLoanInfo.jsp";
|
||||
var fcPrepayQueryID = getItemValue(0,getRow(0),'ID');
|
||||
if(fcPrepayQueryID==null){
|
||||
alert("请先选择对应的数据");
|
||||
return;
|
||||
}
|
||||
var sPara ='fcPrepayQueryID='+fcPrepayQueryID;
|
||||
AsControl.OpenView(sUrl,sPara ,'_self','');
|
||||
}
|
||||
</script>
|
||||
<%@ include file="/Frame/resources/include/include_end.jspf"%>
|
||||
51
src_jbo/jbo/oti/FC_REQUEST_CHANNEL_LOG.java
Normal file
51
src_jbo/jbo/oti/FC_REQUEST_CHANNEL_LOG.java
Normal file
@ -0,0 +1,51 @@
|
||||
package jbo.oti;
|
||||
|
||||
/**
|
||||
* 接口资料表 - JBO命名常量类<br><br>
|
||||
* Note: This file is generated by ADE tools, <em>dont</em> modify it.<br>
|
||||
|
||||
*/
|
||||
public interface FC_REQUEST_CHANNEL_LOG {
|
||||
/**
|
||||
* 接口资料表<br><br>
|
||||
* 代表本类映射的BizObjectClass
|
||||
*/
|
||||
public static final String CLASS_NAME = "jbo.oti.LC_PROFIT_PLAN";
|
||||
/**
|
||||
* 唯一标识 STRING(32)<br>
|
||||
*/
|
||||
public static final String ID = "ID";
|
||||
/**
|
||||
* 资方请求id STRING(32)<br>
|
||||
*/
|
||||
public static final String FC_REQUEST_ID = "FC_REQUEST_ID";
|
||||
/**
|
||||
* 修改前资方编号 STRING(32)<br>
|
||||
*/
|
||||
public static final String PRE_CHANNEL_NO = "PRE_CHANNEL_NO";
|
||||
/**
|
||||
* 修改前资方名称 STRING(32)<br>
|
||||
*/
|
||||
public static final String PRE_CHANNEL_NAME = "PRE_CHANNEL_NAME";
|
||||
/**
|
||||
* 修改后资方编号 STRING(32)<br>
|
||||
*/
|
||||
public static final String CHANNEL_NO = "CHANNEL_NO";
|
||||
/**
|
||||
* 修改后资方名称 STRING(32)<br>
|
||||
*/
|
||||
public static final String CHANNEL_NAME = "CHANNEL_NAME";
|
||||
/**
|
||||
* 描述 STRING(32)<br>
|
||||
*/
|
||||
public static final String REMARK = "REMARK";
|
||||
/**
|
||||
* 变更结果 STRING(32)<br>
|
||||
*/
|
||||
public static final String CHANGE_RESULT = "CHANGE_RESULT";
|
||||
/**
|
||||
* 创建时间 STRING(32)<br>
|
||||
*/
|
||||
public static final String CREATETIME = "CREATETIME";
|
||||
|
||||
}
|
||||
79
src_jbo/jbo/oti/FC_YC_FILE_REPAY_RESULT.java
Normal file
79
src_jbo/jbo/oti/FC_YC_FILE_REPAY_RESULT.java
Normal file
@ -0,0 +1,79 @@
|
||||
package jbo.oti;
|
||||
|
||||
/**
|
||||
* 接口资料表 - JBO命名常量类<br><br>
|
||||
* Note: This file is generated by ADE tools, <em>dont</em> modify it.<br>
|
||||
|
||||
*/
|
||||
public interface FC_YC_FILE_REPAY_RESULT {
|
||||
/**
|
||||
* 接口资料表<br><br>
|
||||
* 代表本类映射的BizObjectClass
|
||||
*/
|
||||
public static final String CLASS_NAME = "jbo.oti.FC_YC_FILE_REPAY_RESULT";
|
||||
/**
|
||||
* 唯一标识 STRING(32)<br>
|
||||
*/
|
||||
public static final String ID = "ID";
|
||||
/**
|
||||
* 文件ID STRING(32)<br>
|
||||
*/
|
||||
public static final String FC_FILE_ID = "FC_FILE_ID";
|
||||
/**
|
||||
* 放款请求编号 STRING(32)<br>
|
||||
*/
|
||||
public static final String LOAN_NO = "LOAN_NO";
|
||||
/**
|
||||
* 期次 STRING(32)<br>
|
||||
*/
|
||||
public static final String LEND_TERM = "TERM_NO";
|
||||
/**
|
||||
* 还款日期 STRING(32)<br>
|
||||
*/
|
||||
public static final String ANS_REPAYMENT_DATE = "NEW_REPAY_DATE";
|
||||
/**
|
||||
* 本金 STRING(32)<br>
|
||||
*/
|
||||
public static final String ANS_PRINCIPAL = "ALR_PRINCIPAL";
|
||||
/**
|
||||
* 利息 STRING(32)<br>
|
||||
*/
|
||||
public static final String ANS_INTEREST = "ALR_INTEREST";
|
||||
/**
|
||||
* 罚息 STRING(32)<br>
|
||||
*/
|
||||
public static final String ALR_PENALTY = "ALR_PENALTY";
|
||||
/**
|
||||
* 归还合计 STRING(32)<br>
|
||||
*/
|
||||
public static final String ANS_REPAYMENT_MONEY = "ALR_REPAYMENT_MONEY";
|
||||
/**
|
||||
* 还款标识:0-当期正常结清 、当期逾期结清、1-提前部分还款、2-逾期、3-提前结清 STRING(32)<br>
|
||||
*/
|
||||
public static final String REPAYMENT_FLAG = "REPAYMENT_FLAG";
|
||||
/**
|
||||
* 还款来源标识:0:借款人本人账户;1:非借款人本人账户 STRING(32)<br>
|
||||
*/
|
||||
public static final String REPAYMENT_SOURCE = "REPAYMENT_SOURCE";
|
||||
/**
|
||||
* 提前还款费用 STRING(32)<br>
|
||||
*/
|
||||
public static final String TRADE_FEE = "TRADE_FEE";
|
||||
/**
|
||||
* 还款账号 STRING(32)<br>
|
||||
*/
|
||||
public static final String REPAYMENT_ACCOUNT_NO = "REPAYMENT_ACCOUNT_NO";
|
||||
/**
|
||||
* 流水号 STRING(32)<br>
|
||||
*/
|
||||
public static final String FLOWNO = "FLOWNO";
|
||||
/**
|
||||
* 创建时间 STRING(32)<br>
|
||||
*/
|
||||
public static final String CREATE_TIME = "CREATE_TIME";
|
||||
/**
|
||||
* 修改时间 STRING(32)<br>
|
||||
*/
|
||||
public static final String UPDATE_TIME = "UPDATE_TIME";
|
||||
|
||||
}
|
||||
108
src_jbo/jbo/oti/FC_YC_PREPAY_QUERY.java
Normal file
108
src_jbo/jbo/oti/FC_YC_PREPAY_QUERY.java
Normal file
@ -0,0 +1,108 @@
|
||||
package jbo.oti;
|
||||
|
||||
import java.lang.String;
|
||||
|
||||
/**
|
||||
* 提前结清试算接口内容 - JBO命名常量类<br><br>
|
||||
* Note: This file is generated by ADE tools, <em>dont</em> modify it.<br>
|
||||
|
||||
*/
|
||||
public interface FC_YC_PREPAY_QUERY{
|
||||
/**
|
||||
* 提前结清试算接口内容<br><br>
|
||||
* 代表本类映射的BizObjectClass
|
||||
*/
|
||||
public static final String CLASS_NAME = "jbo.oti.FC_YC_PREPAY_QUERY";
|
||||
/**
|
||||
* 唯一标识 STRING(32)<br>
|
||||
*/
|
||||
public static final String ID = "ID";
|
||||
/**
|
||||
* 资金渠道文件ID STRING(32)<br>
|
||||
*/
|
||||
public static final String FC_FILE_ID = "FC_FILE_ID";
|
||||
/**
|
||||
* 资金渠道申请ID STRING(32)<br>
|
||||
*/
|
||||
public static final String FC_REQUEST_ID = "FC_REQUEST_ID";
|
||||
/**
|
||||
* 放款申请编号 STRING(32)<br>
|
||||
*/
|
||||
public static final String LOAN_NO = "LOAN_NO";
|
||||
/**
|
||||
* 贷款余额 STRING(32)<br>
|
||||
*/
|
||||
public static final String LOAN_CAPITAL_BALANCE = "LOAN_CAPITAL_BALANCE";
|
||||
/**
|
||||
* STRING(32)<br>
|
||||
*/
|
||||
public static final String FC_FILE_PUSH_NAME = "FC_FILE_PUSH_NAME";
|
||||
/**
|
||||
* 币种 STRING(32)<br>
|
||||
*/
|
||||
public static final String CURRENCY = "CURRENCY";
|
||||
/**
|
||||
* 贷款利率 STRING(32)<br>
|
||||
*/
|
||||
public static final String LOAN_RATE = "LOAN_RATE";
|
||||
/**
|
||||
* 还款方式 STRING(32)<br>
|
||||
*/
|
||||
public static final String REPAY_KIND = "REPAY_KIND";
|
||||
/**
|
||||
* 贷款起期 STRING(32)<br>
|
||||
*/
|
||||
public static final String LOAN_BEGIN_DATE = "LOAN_BEGIN_DATE";
|
||||
/**
|
||||
* 贷款止期 STRING(32)<br>
|
||||
*/
|
||||
public static final String LOAN_END_DATE = "LOAN_END_DATE";
|
||||
/**
|
||||
* 还款账号 STRING(32)<br>
|
||||
*/
|
||||
public static final String REPAY_ACC_NO = "REPAY_ACC_NO";
|
||||
/**
|
||||
* 还款账号余额 STRING(32)<br>
|
||||
*/
|
||||
public static final String REPAY_BALANCE = "REPAY_BALANCE";
|
||||
/**
|
||||
* 提前还款类型 STRING(32)<br>
|
||||
*/
|
||||
public static final String REPAY_TYPE = "REPAY_TYPE";
|
||||
/**
|
||||
* 当期应还本息金额 STRING(32)<br>
|
||||
*/
|
||||
public static final String CURRENT_CAPITAL_BALANCE = "CURRENT_CAPITAL_BALANCE";
|
||||
/**
|
||||
* 当前应还利息 STRING(32)<br>
|
||||
*/
|
||||
public static final String CURRENT_CAPITAL_INT = "CURRENT_CAPITAL_INT";
|
||||
/**
|
||||
* 拖欠本金 STRING(32)<br>
|
||||
*/
|
||||
public static final String OVERDUE_CAPITAL_BALANCE = "OVERDUE_CAPITAL_BALANCE";
|
||||
/**
|
||||
* 拖欠利息 STRING(32)<br>
|
||||
*/
|
||||
public static final String OVERDUE_CAPITAL_INT = "OVERDUE_CAPITAL_INT";
|
||||
/**
|
||||
* 申请日期 STRING(32)<br>
|
||||
*/
|
||||
public static final String RECORD_DATE = "RECORD_DATE";
|
||||
/**
|
||||
* 归还本息金额 STRING(32)<br>
|
||||
*/
|
||||
public static final String PREREPAY_AMOUNT = "PREREPAY_AMOUNT";
|
||||
/**
|
||||
* 提前归还本金金额 STRING(32)<br>
|
||||
*/
|
||||
public static final String PREREPAY_AMOUNT1 = "PREREPAY_AMOUNT1";
|
||||
/**
|
||||
* 创建时间 STRING(32)<br>
|
||||
*/
|
||||
public static final String CREATE_TIME = "CREATE_TIME";
|
||||
/**
|
||||
* 修改时间 STRING(32)<br>
|
||||
*/
|
||||
public static final String UPDATE_TIME = "UPDATE_TIME";
|
||||
}
|
||||
@ -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<String,String> entry : contractMap.entrySet()){
|
||||
@ -139,18 +124,79 @@ public class CorpusSourceFileCopy {
|
||||
* @param tx
|
||||
* @throws Exception
|
||||
*/
|
||||
public void copyRentPlanFormatToHis(Map<String,String> contractMap ,JBOTransaction tx) throws Exception {
|
||||
public void copyRentPlanFormatToHis(Map<String,String> contractMap ,String memo,JBOTransaction tx) throws Exception {
|
||||
for(Map.Entry<String,String> entry: contractMap.entrySet()){
|
||||
Map<String,String> fromCondtion=new HashMap<String,String>();
|
||||
fromCondtion.put("CONTRACT_ID",entry.getKey());
|
||||
|
||||
Map<String,String> otherProperty=new HashMap<String,String>();
|
||||
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<String,String> fromCondtion=new HashMap<String,String>();
|
||||
fromCondtion.put("CONTRACT_ID",contractId);
|
||||
|
||||
Map<String,String> otherProperty=new HashMap<String,String>();
|
||||
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<String,String> fromCondtion,Map<String,String> toCondtion,Map<String,String> 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<String,String> fromCondtion=new HashMap<String,String>();
|
||||
fromCondtion.put("CONTRACT_ID",contractId);
|
||||
|
||||
Map<String,String> otherProperty=new HashMap<String,String>();
|
||||
otherProperty.put("FLOWUNID", fcRequestId);
|
||||
|
||||
copyCashFlowFormatToHis(fromCondtion,null,otherProperty,tx);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* copy租金计划到历史表
|
||||
* @param fromCondtion
|
||||
* @param toCondtion
|
||||
* @param otherProperty
|
||||
* @param tx
|
||||
* @throws Exception
|
||||
*/
|
||||
public void copyCashFlowFormatToHis(Map<String,String> fromCondtion,Map<String,String> toCondtion,Map<String,String> 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<String,String> 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<String,String> 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<String,String> 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<Map<String,String>> getAllParam(List<BizObject> fyfrrBoList, JBOTransaction tx) throws Exception {
|
||||
List<Map<String,String>> rentIncomeParams = new ArrayList<>();
|
||||
Set<String> 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<String,String> 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<String,String> 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<String,String> 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<String,String> 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;
|
||||
}
|
||||
|
||||
@ -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<String,String> entry : contractMap.entrySet()){
|
||||
@ -108,5 +108,4 @@ public class CorpusSourceRentPlanCopy extends CorpusSourceFileCopy implements Jo
|
||||
return fyfrpBoList;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -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<BizObject> fyfrpBoList , JBOTransaction tx) throws Exception {
|
||||
Transaction Sqlca = Transaction.createTransaction(tx);
|
||||
//0.获取所有参数(以文件信息为基础,将合同参数补充进去)
|
||||
List<Map<String,String>> allParam = this.getAllParam(fyfrpBoList,tx);
|
||||
for(Map<String,String> 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<BizObject> 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<BizObject> 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(Map<String,String>param ,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<String,String> 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<String,String> 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<Map<String, String>> cashes = DataOperatorUtil.getDataBySql(tx, cashSql, null);
|
||||
List<String > netList = new ArrayList<String>();
|
||||
List<String > dateList = new ArrayList<String>();
|
||||
for(Map<String, String> 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<BigDecimal> newNetList=new ArrayList<BigDecimal>();
|
||||
List<String> newDateList=new ArrayList<String>();
|
||||
for(int i=0;i<dateList.size();i++){
|
||||
String monthFistDay=dateList.get(i).substring(0, dateList.get(i).length()-2)+"01";
|
||||
if(monthFistDay.equals(upperListDate)){
|
||||
newNetList.set(newNetList.size()-1, newNetList.get(newNetList.size()-1).add(new BigDecimal(netList.get(i))));
|
||||
}else{
|
||||
newNetList.add(new BigDecimal(netList.get(i)));
|
||||
newDateList.add(monthFistDay);
|
||||
}
|
||||
upperListDate=monthFistDay;
|
||||
}
|
||||
List<BigDecimal> inflowPour=new ArrayList<BigDecimal>();
|
||||
String plandate="";
|
||||
for(int i=0;i<newDateList.size();i++){
|
||||
if(i==0){
|
||||
inflowPour.add(newNetList.get(i));
|
||||
}else{
|
||||
int month= DateUtils.getBetweenMonths(plandate, newDateList.get(i),"yyyy/MM/dd");
|
||||
if(month>1){
|
||||
for(int y=1;y<month;y++){
|
||||
inflowPour.add(BigDecimal.ZERO);
|
||||
}
|
||||
}
|
||||
inflowPour.add(newNetList.get(i));
|
||||
}
|
||||
plandate=newDateList.get(i);
|
||||
}
|
||||
irr=IRRCalculateUtil.getIRR(inflowPour, BigDecimal.ONE).multiply(new BigDecimal(100)).toString();
|
||||
}else{
|
||||
irr = IrrTools.getIrrNew(netList,dateList, CalType);//起租还是
|
||||
}
|
||||
return irr;
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user