贷后功能

This commit is contained in:
ap007 2021-08-20 10:12:25 +08:00
parent 4b4b5306d8
commit e26448a418
9 changed files with 236 additions and 155 deletions

View File

@ -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(){
//校验业务合同号唯一性

View File

@ -446,7 +446,8 @@
<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="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="TERM_NO" label="期次" type="STRING" length="32"/>
<attribute name="NEW_REPAY_DATE" label="还款日期" type="STRING" length="32"/>
@ -494,6 +495,8 @@
<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="CHANGE_TYPE" label="变更类型1.资方审批拒绝变更2.逾期回购" type="STRING" length="32"/>
<attribute name="ACTUAL_PAYMENT_BACK_AMOUNT" label="实际回购金额" type="STRING" length="32"/>
<attribute name="CREATETIME" label="创建时间" type="STRING" length="32"/>
</attributes>
<manager>

View File

@ -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;
]]>

View File

@ -43,6 +43,14 @@ public interface FC_REQUEST_CHANNEL_LOG {
* 变更结果 STRING(32)<br>
*/
public static final String CHANGE_RESULT = "CHANGE_RESULT";
/**
* 变更类型 STRING(32)<br>
*/
public static final String CHANGE_TYPE = "CHANGE_TYPE";
/**
* 实际回购金额 STRING(32)<br>
*/
public static final String ACTUAL_PAYMENT_BACK_AMOUNT = "ACTUAL_PAYMENT_BACK_AMOUNT";
/**
* 创建时间 STRING(32)<br>
*/

View File

@ -19,6 +19,10 @@ public interface FC_YC_FILE_REPAY_RESULT {
* 文件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>
*/

View File

@ -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';

View File

@ -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<BizObject> 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<BizObject> 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<String,String> 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<String,String> 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<String,String> 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<String,String> 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<String,String> 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<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 = "";
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<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, null);
}
return irr;
}
/**
* 更新测算表的IRR字段
* @param contractId
* @param irr
* @param tx
* @throws JBOException
*/
public void updateIRR(String contractId,String irr ,JBOTransaction tx) throws JBOException {
BizObjectManager lccBom = JBOFactory.getBizObjectManager(LC_CALC_CONDITION.CLASS_NAME,tx);
BizObject lccBo = lccBom.createQuery("contract_id=:contractId").setParameter("contractId",contractId).getSingleResult(true);
if(!"".equals(irr)){
lccBo.setAttributeValue("irr",irr);
lccBom.saveObject(lccBo);
}
}
public String getContractId() {
return contractId;
}

View File

@ -5,32 +5,19 @@ 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.*;
import static java.math.BigDecimal.ROUND_HALF_UP;
import java.util.List;
import java.util.Map;
/**
* 资方租金计划拷贝
*/
public class CorpusSourceRentPlanCopy extends CorpusSourceFileCopy implements Job {
private String contractId;
@Override
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
String startime = StringFunction.getTodayNow();
@ -87,6 +74,12 @@ public class CorpusSourceRentPlanCopy extends CorpusSourceFileCopy implements Jo
updateSplitSP(param,Sqlca);
//4.插入分润计划
insertProfitPlan(param,tx);
//5.拷贝现金流到历史表
copyCashFlowFormatToHis(contractId,"安鹏原正式现金流",tx);
//6.生成新的现金流
createCashFlowByContractId(contractId,Sqlca);
//7.测算IRR
calcIRR(param,tx);
}
}

View File

@ -1,34 +1,17 @@
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.*;
import java.util.List;
import java.util.Map;
/**
@ -80,10 +63,10 @@ public class CorpusSourceRentResultCopy extends CorpusSourceFileCopy implements
this.insertRentIncome(param,tx);
// 2.0根据状态的不同来进行不同的操作
//2.1如果当期正常结清或者当期逾期结清
if("0".equals(param.get("REPAYMENT_FLAG"))){
if("0".equals(param.get("repaymentFlag"))){
updateRentPlanStatus(param,tx);
//2.2如果提前结清 并且 为借款人本人账户则视为客户本人提前结清直接变更租金计划表租金计划
}else if("3".equals(param.get("REPAYMENT_FLAG"))&&"0".equals(param.get("REPAYMENT_SOURCE"))){
}else if("3".equals(param.get("repaymentFlag"))&&"0".equals(param.get("repaymentSource"))){
//租金计划,现金流存历史表
//每个合同只有一次提前结清只有提前结清才会走这里所以按照合同id来执行
copyRentPlanFormatToHis(param.get("contractId"),param.get("fcRequestId"),"邮储提前结清前租金计划",tx);
@ -93,11 +76,11 @@ public class CorpusSourceRentResultCopy extends CorpusSourceFileCopy implements
//变更合同状态
updateContractStatus(param.get("contractId"),"100",tx);
//变更现金流
createCashFlow(param,Sqlca);
createCashFlowByContractId(param.get("contractId"),Sqlca);
//重新Irr计算
calcIRR(param,tx);
//2.3如果提请结清 并且 为非借款人本人账户则视为我方回购需改变资方状态我方能继续扣款
}else if("3".equals(param.get("REPAYMENT_FLAG"))&&"1".equals(param.get("REPAYMENT_SOURCE"))){
}else if("3".equals(param.get("repaymentFlag"))&&"1".equals(param.get("repaymentSource"))){
int result = 1;
//变更资方资源要有日志
try{
@ -130,85 +113,9 @@ public class CorpusSourceRentResultCopy extends CorpusSourceFileCopy implements
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;
}
}