网银收款核销-租金-审批页面-租金计划页面速度优化
This commit is contained in:
parent
356d4db955
commit
408ca1cc76
@ -1,57 +1,76 @@
|
|||||||
<%@page import="com.amarsoft.are.jbo.BizObject"%>
|
<%@page import="com.amarsoft.are.jbo.BizObject" %>
|
||||||
<%@page import="jbo.app.tenwa.calc.VI_LC_RENT_PLAN"%>
|
<%@page import="jbo.app.tenwa.calc.VI_LC_RENT_PLAN" %>
|
||||||
<%@page import="com.amarsoft.are.jbo.JBOFactory"%>
|
<%@page import="com.amarsoft.are.jbo.JBOFactory" %>
|
||||||
<%@page import="com.amarsoft.are.jbo.JBOTransaction"%>
|
<%@page import="com.amarsoft.are.jbo.JBOTransaction" %>
|
||||||
<%@page import="java.math.BigDecimal"%>
|
<%@page import="java.math.BigDecimal" %>
|
||||||
<%@ page contentType="text/html; charset=GBK"%>
|
<%@ page import="com.tenwa.util.SqlRunnerUtil" %>
|
||||||
<%@ include file="/IncludeBeginMDAJAX.jsp"%><%
|
<%@ page import="cn.hutool.db.Entity" %>
|
||||||
String flowunid = CurPage.getParameter("flowunid");
|
<%@ page import="cn.hutool.db.handler.EntityHandler" %>
|
||||||
String factDate = CurPage.getParameter("factDate");
|
<%@ page contentType="text/html; charset=GBK" %>
|
||||||
String planIDs = CurPage.getParameter("planIDs");
|
<%@ include file="/IncludeBeginMDAJAX.jsp" %>
|
||||||
String overCorpuss = CurPage.getParameter("overCorpuss");
|
<%
|
||||||
String overInterests = CurPage.getParameter("overInterests");
|
String flowunid = CurPage.getParameter("flowunid");
|
||||||
String overPenaltys = CurPage.getParameter("overPenaltys");
|
String factDate = CurPage.getParameter("factDate");
|
||||||
String mayopeMoney = CurPage.getParameter("mayopeMoney");
|
String planIDs = CurPage.getParameter("planIDs");
|
||||||
String[] planID = planIDs.split("@");
|
String overCorpuss = CurPage.getParameter("overCorpuss");
|
||||||
String[] overCorpus = overCorpuss.split("@");
|
String overInterests = CurPage.getParameter("overInterests");
|
||||||
String[] overInterest = overInterests.split("@");
|
String overPenaltys = CurPage.getParameter("overPenaltys");
|
||||||
String[] overPenalty = overPenaltys.split("@");
|
String mayopeMoney = CurPage.getParameter("mayopeMoney");
|
||||||
boolean flag = true;
|
String[] planID = planIDs.split("@");
|
||||||
SqlObject so = new SqlObject("select case when mayope_money != "+mayopeMoney+" then 0 else 1 end from lc_ebank_temp where flowunid='"+flowunid+"'");
|
String[] overCorpus = overCorpuss.split("@");
|
||||||
if("0".equals(Sqlca.getString(so))){
|
String[] overInterest = overInterests.split("@");
|
||||||
flag = false;
|
String[] overPenalty = overPenaltys.split("@");
|
||||||
}
|
boolean flag = true;
|
||||||
boolean flagR = true;
|
SqlObject so = new SqlObject("select case when mayope_money != " + mayopeMoney + " then 0 else 1 end from lc_ebank_temp where flowunid='" + flowunid + "'");
|
||||||
boolean flagP = true;
|
if ("0".equals(Sqlca.getString(so))) {
|
||||||
for(int i=0;i<planID.length;i++){
|
flag = false;
|
||||||
String sql = "select case when (corpus_over != " + overCorpus[i]+" or interest_over != " + overInterest[i] + ") then 0 else 1 end from vi_lc_rent_plan where id='"+planID[i]+"'";
|
}
|
||||||
so = new SqlObject(sql);
|
boolean flagR = true;
|
||||||
String result = Sqlca.getString(so);
|
boolean flagP = true;
|
||||||
if("0".equals(result)){
|
Map<String, Object> sqlParamMap = new HashMap<>();
|
||||||
flagR = false;
|
for (int i = 0; i < planID.length; i++) {
|
||||||
}
|
sqlParamMap.clear();
|
||||||
sql = "select case when round(getRentPenalty(payment_number,plan_list,'"+factDate+"')-fact_penalty,2) != " + overPenalty[i]+" then 0 else 1 end from vi_lc_rent_plan where id='"+planID[i]+"'";
|
sqlParamMap.put("planId", planID[i]);
|
||||||
so = new SqlObject(sql);
|
Entity entity1 = SqlRunnerUtil.query(Sqlca, "flow.FundCollectionFlow.queryRentPlanList", sqlParamMap, new EntityHandler());
|
||||||
result = Sqlca.getString(so);
|
// String sql = "select case when (corpus_over != " + overCorpus[i] + " or interest_over != " + overInterest[i] + ") then 0 else 1 end from vi_lc_rent_plan where id='" + planID[i] + "'";
|
||||||
if("0".equals(result)){
|
// so = new SqlObject(sql);
|
||||||
flagP = false;
|
// String result = Sqlca.getString(so);
|
||||||
}
|
if(new BigDecimal(overCorpus[i]).compareTo(entity1.getBigDecimal("corpus_over")) != 0 || new BigDecimal(overInterest[i]).compareTo(entity1.getBigDecimal("interest_over")) != 0) {
|
||||||
}
|
flagR = false;
|
||||||
String outResult = "";
|
}
|
||||||
if(!flagR){
|
// if ("0".equals(result)) {
|
||||||
outResult += "ERROR";
|
// flagR = false;
|
||||||
}else{
|
// }
|
||||||
outResult += "SUCCESS";
|
sqlParamMap.put("factDate", factDate.replaceAll("-", "/"));
|
||||||
}
|
Entity entity2 = SqlRunnerUtil.query(Sqlca, "flow.FundCollectionFlow.getRentPlanPenaltyByPlanId", sqlParamMap, new EntityHandler());
|
||||||
if(!flagP){
|
if(new BigDecimal(overPenalty[i]).compareTo(entity2.getBigDecimal("penalty_over")) != 0) {
|
||||||
outResult += "@ERROR";
|
flagP = false;
|
||||||
}else{
|
}
|
||||||
outResult += "@SUCCESS";
|
|
||||||
}
|
// sql = "select case when round(getRentPenalty(payment_number,plan_list,'" + factDate + "')-fact_penalty,2) != " + overPenalty[i] + " then 0 else 1 end from vi_lc_rent_plan where id='" + planID[i] + "'";
|
||||||
if(!flag){
|
// so = new SqlObject(sql);
|
||||||
outResult += "@ERROR";
|
// result = Sqlca.getString(so);
|
||||||
}else{
|
|
||||||
outResult += "@SUCCESS";
|
// if ("0".equals(result)) {
|
||||||
}
|
// flagP = false;
|
||||||
out.println(outResult);
|
// }
|
||||||
%><%@ include file="/IncludeEndAJAX.jsp"%>
|
}
|
||||||
|
String outResult = "";
|
||||||
|
if (!flagR) {
|
||||||
|
outResult += "ERROR";
|
||||||
|
} else {
|
||||||
|
outResult += "SUCCESS";
|
||||||
|
}
|
||||||
|
if (!flagP) {
|
||||||
|
outResult += "@ERROR";
|
||||||
|
} else {
|
||||||
|
outResult += "@SUCCESS";
|
||||||
|
}
|
||||||
|
if (!flag) {
|
||||||
|
outResult += "@ERROR";
|
||||||
|
} else {
|
||||||
|
outResult += "@SUCCESS";
|
||||||
|
}
|
||||||
|
out.println(outResult);
|
||||||
|
%>
|
||||||
|
<%@ include file="/IncludeEndAJAX.jsp" %>
|
||||||
@ -1,13 +1,25 @@
|
|||||||
<%@ page import="com.tenwa.jbo.manager.DataUtil" %>
|
<%@ page import="com.tenwa.jbo.manager.DataUtil" %>
|
||||||
|
<%@ page import="com.tenwa.util.SqlRunnerUtil" %>
|
||||||
|
<%@ page import="cn.hutool.db.handler.EntityListHandler" %>
|
||||||
|
<%@ page import="cn.hutool.db.Entity" %>
|
||||||
|
<%@ page import="java.math.BigDecimal" %>
|
||||||
<%@ page contentType="text/html; charset=GBK"%>
|
<%@ page contentType="text/html; charset=GBK"%>
|
||||||
<%@ include file="/IncludeBeginMDAJAX.jsp"%><%
|
<%@ include file="/IncludeBeginMDAJAX.jsp"%><%
|
||||||
String paymentNumber = CurPage.getParameter("paymentNumber");
|
String paymentNumber = CurPage.getParameter("paymentNumber");
|
||||||
String planList = CurPage.getParameter("planList");
|
String planList = CurPage.getParameter("planList");
|
||||||
//获取选择期次前所有的剩余租金的和,如果租金余额大于0,则返回false,禁止跨期核销
|
//获取选择期次前所有的剩余租金的和,如果租金余额大于0,则返回false,禁止跨期核销
|
||||||
String rentOver = DataUtil.getValueBySql("select sum(rent_over) from vi_rent_collect_4_ebank where payment_number = '"+paymentNumber+"' and plan_list < '"+planList+"';");
|
// String rentOver = DataUtil.getValueBySql("select sum(rent_over) from vi_rent_collect_4_ebank where payment_number = '"+paymentNumber+"' and plan_list < '"+planList+"';");
|
||||||
double doubleRentOver = Double.parseDouble(rentOver);
|
Map<String, Object> sqlParamMap = new HashMap<>();
|
||||||
|
sqlParamMap.put("paymentNumber", paymentNumber);
|
||||||
|
sqlParamMap.put("plan_listLess", planList);
|
||||||
|
List<Entity> resList = SqlRunnerUtil.query(Sqlca, "flow.FundCollectionFlow.queryRentPlanList", sqlParamMap, new EntityListHandler());
|
||||||
|
BigDecimal allOver = new BigDecimal(0);
|
||||||
|
for (Entity entity : resList) {
|
||||||
|
allOver = allOver.add(entity.getBigDecimal("all_over"));
|
||||||
|
}
|
||||||
|
// double doubleRentOver = Double.parseDouble(rentOver);
|
||||||
String result = "";
|
String result = "";
|
||||||
if(doubleRentOver>0){
|
if(allOver.compareTo(BigDecimal.ZERO) == 1){
|
||||||
result = "false";
|
result = "false";
|
||||||
}else{
|
}else{
|
||||||
result = "true";
|
result = "true";
|
||||||
|
|||||||
@ -35,8 +35,9 @@
|
|||||||
businessType="2,3";
|
businessType="2,3";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ASObjectModel doTemp = new ASObjectModel("VILCRentPlanList");
|
// ASObjectModel doTemp = new ASObjectModel("VILCRentPlanList");
|
||||||
doTemp.setDataQueryClass("com.amarsoft.awe.dw.ui.list.FlowMonitorListHtmlGenerator");
|
// doTemp.setDataQueryClass("com.amarsoft.awe.dw.ui.list.FlowMonitorListHtmlGenerator");
|
||||||
|
CustomASObjectModel doTemp = new CustomASObjectModel("VILCRentPlanList", "flow.FundCollectionFlow.queryRentPlanList" , true);
|
||||||
CurPage.setAttribute("flowRowCount","100");
|
CurPage.setAttribute("flowRowCount","100");
|
||||||
//检验客户名称是否为经销商
|
//检验客户名称是否为经销商
|
||||||
IsNullCheck inc = new IsNullCheck();
|
IsNullCheck inc = new IsNullCheck();
|
||||||
@ -105,6 +106,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function checkInputData(i){
|
function checkInputData(i){
|
||||||
|
// if(getCheckedRows(0).length == 0) {
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
TableBuilder.iCurrentRow['myiframe0'] = i;
|
TableBuilder.iCurrentRow['myiframe0'] = i;
|
||||||
TableBuilder.displaySelectedRows('myiframe0');
|
TableBuilder.displaySelectedRows('myiframe0');
|
||||||
if($("#period").attr("checked") != "checked"){
|
if($("#period").attr("checked") != "checked"){
|
||||||
|
|||||||
@ -687,6 +687,7 @@
|
|||||||
<attribute name="rent" label="租金" type="DOUBLE" length="32"/>
|
<attribute name="rent" label="租金" type="DOUBLE" length="32"/>
|
||||||
<attribute name="corpus" label="本金" type="DOUBLE" length="32"/>
|
<attribute name="corpus" label="本金" type="DOUBLE" length="32"/>
|
||||||
<attribute name="interest" label="利息" type="DOUBLE" length="32"/>
|
<attribute name="interest" label="利息" type="DOUBLE" length="32"/>
|
||||||
|
<attribute name="penalty" label="总罚息" type="DOUBLE" length="32"/>
|
||||||
<attribute name="rent_over" label="租金余额" type="DOUBLE" length="32"/>
|
<attribute name="rent_over" label="租金余额" type="DOUBLE" length="32"/>
|
||||||
<attribute name="corpus_over" label="本金余额" type="DOUBLE" length="32"/>
|
<attribute name="corpus_over" label="本金余额" type="DOUBLE" length="32"/>
|
||||||
<attribute name="interest_over" label="利息余额" type="DOUBLE" length="32"/>
|
<attribute name="interest_over" label="利息余额" type="DOUBLE" length="32"/>
|
||||||
|
|||||||
158
config/fenix/flow/FundCollectionFlow.xml
Normal file
158
config/fenix/flow/FundCollectionFlow.xml
Normal file
@ -0,0 +1,158 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<fenixs namespace="flow.FundCollectionFlow">
|
||||||
|
<fenix id="queryRentPlanList">
|
||||||
|
select lrpi.id,
|
||||||
|
lrpi.contract_id,
|
||||||
|
lrpi.contract_number,
|
||||||
|
lrpi.payment_number,
|
||||||
|
lrpi.customer_name as customername,
|
||||||
|
lrpi.plan_list,
|
||||||
|
lrpi.plan_date,
|
||||||
|
lrpi.rent,
|
||||||
|
lrpi.corpus,
|
||||||
|
lrpi.interest,
|
||||||
|
lrpi.penalty,
|
||||||
|
round(lrpi.rent - lrpi.rent_sum - lrpi.rent_sum_temp, 2) as rent_over,
|
||||||
|
round(lrpi.corpus - lrpi.corpus_sum - lrpi.corpus_sum_temp, 2) as corpus_over,
|
||||||
|
round(lrpi.interest - lrpi.interest_sum - lrpi.interest_sum_temp, 2) as interest_over,
|
||||||
|
round(lrpi.penalty - lrpi.penalty_sum - lrpi.penalty_sum_temp, 2) as penalty_over,
|
||||||
|
round(lrpi.rent + lrpi.penalty - lrpi.rent_sum - lrpi.rent_sum_temp - lrpi.penalty_sum -
|
||||||
|
lrpi.penalty_sum_temp, 2) as all_over,
|
||||||
|
case
|
||||||
|
when lrpi.rent_sum + lrpi.rent_sum_temp = 0 and lrpi.penalty_sum + lrpi.penalty_sum_temp = 0 then '未回笼'
|
||||||
|
when lrpi.rent - lrpi.rent_sum - lrpi.rent_sum_temp = 0 and
|
||||||
|
lrpi.penalty - lrpi.penalty_sum - lrpi.penalty_sum_temp = 0 then '已回笼'
|
||||||
|
else '部分回笼' end as planstatus,
|
||||||
|
round(lrpi.penalty_sum + lrpi.penalty_sum_temp, 2) as penalty_sum
|
||||||
|
from (select lrp.id,
|
||||||
|
lrp.contract_id,
|
||||||
|
lci.contract_number,
|
||||||
|
lrp.payment_number,
|
||||||
|
lul.customer_name,
|
||||||
|
lrp.plan_list,
|
||||||
|
lrp.plan_date,
|
||||||
|
lrp.rent,
|
||||||
|
lrp.corpus,
|
||||||
|
lrp.interest,
|
||||||
|
round(ifnull((select sum(lri.rent)
|
||||||
|
from lc_rent_income lri
|
||||||
|
where roll_back = '0'
|
||||||
|
and lri.payment_number = lrp.payment_number
|
||||||
|
and lri.plan_list = lrp.plan_list
|
||||||
|
), 0), 2) as rent_sum,
|
||||||
|
round(ifnull((select sum(lri.rent)
|
||||||
|
from lc_rent_income_temp lri
|
||||||
|
where is_flowing = '0'
|
||||||
|
and roll_back = '0'
|
||||||
|
and lri.payment_number = lrp.payment_number
|
||||||
|
and lri.plan_list = lrp.plan_list
|
||||||
|
), 0), 2) as rent_sum_temp,
|
||||||
|
round(ifnull((select sum(lri.corpus + lri.corpus_adjust)
|
||||||
|
from lc_rent_income lri
|
||||||
|
where roll_back = '0'
|
||||||
|
and lri.payment_number = lrp.payment_number
|
||||||
|
and lri.plan_list = lrp.plan_list
|
||||||
|
), 0), 2) as corpus_sum,
|
||||||
|
round(ifnull((select sum(lri.corpus + lri.corpus_adjust)
|
||||||
|
from lc_rent_income_temp lri
|
||||||
|
where is_flowing = '0'
|
||||||
|
and roll_back = '0'
|
||||||
|
and lri.payment_number = lrp.payment_number
|
||||||
|
and lri.plan_list = lrp.plan_list
|
||||||
|
), 0), 2) as corpus_sum_temp,
|
||||||
|
round(ifnull((select sum(lri.interest + lri.interest_adjust)
|
||||||
|
from lc_rent_income lri
|
||||||
|
where roll_back = '0'
|
||||||
|
and lri.payment_number = lrp.payment_number
|
||||||
|
and lri.plan_list = lrp.plan_list
|
||||||
|
), 0), 2) as interest_sum,
|
||||||
|
round(ifnull((select sum(lri.interest + lri.interest_adjust)
|
||||||
|
from lc_rent_income_temp lri
|
||||||
|
where is_flowing = '0'
|
||||||
|
and roll_back = '0'
|
||||||
|
and lri.payment_number = lrp.payment_number
|
||||||
|
and lri.plan_list = lrp.plan_list
|
||||||
|
), 0), 2) as interest_sum_temp,
|
||||||
|
round(ifnull((select sum(lri.penalty + penalty_adjust)
|
||||||
|
from lc_rent_income lri
|
||||||
|
where roll_back = '0'
|
||||||
|
and lri.payment_number = lrp.payment_number
|
||||||
|
and lri.plan_list = lrp.plan_list
|
||||||
|
), 0), 2) as penalty_sum,
|
||||||
|
round(ifnull((select sum(lri.penalty + penalty_adjust)
|
||||||
|
from lc_rent_income_temp lri
|
||||||
|
where is_flowing = '0'
|
||||||
|
and roll_back = '0'
|
||||||
|
and lri.payment_number = lrp.payment_number
|
||||||
|
and lri.plan_list = lrp.plan_list
|
||||||
|
), 0), 2) as penalty_sum_temp,
|
||||||
|
getrentpenalty(lrp.payment_number, lrp.plan_list, date_format(now(), '%Y/%m/%d')) as penalty
|
||||||
|
from lc_rent_plan lrp
|
||||||
|
left join lb_contract_info lci on lrp.contract_id = lci.id
|
||||||
|
left join lb_union_lessee lul on lrp.contract_id = lul.contract_id and lul.is_main = 'Y'
|
||||||
|
left join customer_account ca on ca.contract_id = lci.id
|
||||||
|
where lrp.plan_status <> '已回笼'
|
||||||
|
<andEqual field="lrp.id" value="planId" match="?planId != empty" />
|
||||||
|
<andEqual field="lul.customer_name" value="customername" match="?customername != empty" />
|
||||||
|
<andEqual field="lci.contract_number" value="contract_number" match="?contract_number != empty" />
|
||||||
|
<andGreaterThanEqual field="lrp.plan_date" value="plan_dateStart" match="?plan_dateStart != empty" />
|
||||||
|
<andLessThanEqual field="lrp.plan_date" value="plan_dateEnd" match="?plan_dateEnd != empty" />
|
||||||
|
<andEqual field="lrp.payment_number" value="paymentNumber" match="?paymentNumber != empty" />
|
||||||
|
<andLessThan field="lrp.plan_list" value="plan_listLess" match="?plan_listLess != empty" />
|
||||||
|
and lrp.plan_date < date_add(date_format(current_date(), '%Y-%m-01'), interval 1 month)
|
||||||
|
and lci.contract_status = '31'
|
||||||
|
and (lci.corpus_source <> 'PSBC' or isnull(lci.corpus_source))
|
||||||
|
and not exists(select 1
|
||||||
|
from lc_occupy_rent_list lorl
|
||||||
|
where lorl.payment_number = lrp.payment_number
|
||||||
|
and ((lorl.plan_id = lrp.id and
|
||||||
|
lorl.flow_name in ('微信银联收款', '微信支付收款', '网银收款')) or
|
||||||
|
lorl.flow_name in ('合同中途终止', '提前结清申请'))
|
||||||
|
)
|
||||||
|
) lrpi
|
||||||
|
</fenix>
|
||||||
|
<!-- lc_rent_income 表 plan_id字段未加索引,所以使用了 payment_number 和 plan_list 查询 -->
|
||||||
|
<!-- lc_rent_income_temp 表 plan_id字段未加索引,所以使用了 payment_number 和 plan_list 查询 -->
|
||||||
|
<fenix id="getRentPlanPenaltyByPlanId">
|
||||||
|
select tt.penalty,
|
||||||
|
tt.fact_penalty,
|
||||||
|
tt.penalty_adjust,
|
||||||
|
tt.penalty - tt.fact_penalty - tt.penalty_adjust as penalty_over
|
||||||
|
from (select round(getrentpenalty(lrp.payment_number, lrp.plan_list, ${factDate}),
|
||||||
|
2) as penalty,
|
||||||
|
round(ifnull(lri.fact_penalty, 0) + ifnull(lrit.fact_penalty, 0), 2) as fact_penalty,
|
||||||
|
round(ifnull(lri.penalty_adjust, 0) + ifnull(lrit.penalty_adjust, 0), 2) as penalty_adjust
|
||||||
|
from lc_rent_plan lrp
|
||||||
|
left join (select payment_number,
|
||||||
|
plan_list,
|
||||||
|
sum(penalty) as fact_penalty,
|
||||||
|
sum(penalty_adjust) as penalty_adjust
|
||||||
|
from lc_rent_income
|
||||||
|
where roll_back = '0'
|
||||||
|
@if{?planId != empty}
|
||||||
|
and (payment_number, plan_list) in (select lrp1.payment_number, lrp1.plan_list from lc_rent_plan lrp1 where id = #{planId})
|
||||||
|
@end{}
|
||||||
|
<andEqual field="payment_number" value="paymentNumber" match="?paymentNumber != empty" />
|
||||||
|
<andEqual field="plan_list" value="planList" match="?planList != empty" />
|
||||||
|
) lri on lrp.payment_number = lri.payment_number and lrp.plan_list = lri.plan_list
|
||||||
|
left join (select payment_number,
|
||||||
|
plan_list,
|
||||||
|
sum(penalty) as fact_penalty,
|
||||||
|
sum(penalty_adjust) as penalty_adjust
|
||||||
|
from lc_rent_income_temp
|
||||||
|
where is_flowing = '0'
|
||||||
|
and roll_back = '0'
|
||||||
|
@if{?planId != empty}
|
||||||
|
and (payment_number, plan_list) in (select lrp1.payment_number, lrp1.plan_list from lc_rent_plan lrp1 where id = #{planId})
|
||||||
|
@end{}
|
||||||
|
<andEqual field="payment_number" value="paymentNumber" match="?paymentNumber != empty" />
|
||||||
|
<andEqual field="plan_list" value="planList" match="?planList != empty" />
|
||||||
|
) lrit on lrp.payment_number = lrit.payment_number and lrp.plan_list = lrit.plan_list
|
||||||
|
<trimWhere>
|
||||||
|
<andEqual field="lrp.id" value="planId" match="?planId != empty" />
|
||||||
|
<andEqual field="lrp.payment_number" value="paymentNumber" match="?paymentNumber != empty" />
|
||||||
|
<andEqual field="lrp.plan_list" value="planList" match="?planList != empty" />
|
||||||
|
</trimWhere>
|
||||||
|
) tt
|
||||||
|
</fenix>
|
||||||
|
</fenixs>
|
||||||
File diff suppressed because it is too large
Load Diff
42
src/com/amarsoft/awe/dw/CustomASObjectModel.java
Normal file
42
src/com/amarsoft/awe/dw/CustomASObjectModel.java
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
package com.amarsoft.awe.dw;
|
||||||
|
|
||||||
|
import com.amarsoft.are.jbo.BizObjectManager;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @program: apzl_leasing
|
||||||
|
* @description:
|
||||||
|
* @author: À½Ü
|
||||||
|
* @create: 2024-12-16 17:00
|
||||||
|
*/
|
||||||
|
public class CustomASObjectModel extends ASObjectModel {
|
||||||
|
public CustomASObjectModel() throws Exception {
|
||||||
|
}
|
||||||
|
|
||||||
|
public CustomASObjectModel(String[] headers) throws Exception {
|
||||||
|
super(headers);
|
||||||
|
}
|
||||||
|
|
||||||
|
public CustomASObjectModel(BizObjectManager manager) throws Exception {
|
||||||
|
super(manager);
|
||||||
|
}
|
||||||
|
|
||||||
|
public CustomASObjectModel(String sDONo) throws Exception {
|
||||||
|
super(sDONo);
|
||||||
|
}
|
||||||
|
|
||||||
|
public CustomASObjectModel(String sDONo, String sWhere) throws Exception {
|
||||||
|
super(sDONo, sWhere);
|
||||||
|
}
|
||||||
|
|
||||||
|
public CustomASObjectModel(String sDONo, String sWhere, String sDatabase) throws Exception {
|
||||||
|
super(sDONo, sWhere, sDatabase);
|
||||||
|
}
|
||||||
|
|
||||||
|
public CustomASObjectModel(String sDONo, String fullFenixId, Boolean lazyLoad) throws Exception {
|
||||||
|
super(sDONo);
|
||||||
|
this.setFullFenixId(fullFenixId);
|
||||||
|
this.setLazyLoad(lazyLoad);
|
||||||
|
this.setDataQueryClass("com.tenwa.flow.comm.list_html_generator.FenixListHtmlGenerator");
|
||||||
|
this.setPageSize(20);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,100 @@
|
|||||||
|
package com.tenwa.flow.comm.list_html_generator;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import cn.hutool.db.Entity;
|
||||||
|
import cn.hutool.db.Page;
|
||||||
|
import cn.hutool.db.PageResult;
|
||||||
|
import com.amarsoft.are.jbo.BizObject;
|
||||||
|
import com.amarsoft.are.jbo.BizObjectManager;
|
||||||
|
import com.amarsoft.are.jbo.JBOException;
|
||||||
|
import com.amarsoft.are.jbo.JBOFactory;
|
||||||
|
import com.amarsoft.awe.dw.handler.BusinessProcessData;
|
||||||
|
import com.amarsoft.awe.dw.ui.htmlfactory.ListHtmlWithASDataObjectGenerator;
|
||||||
|
import com.amarsoft.awe.dw.ui.htmlfactory.QueryParamObject;
|
||||||
|
import com.amarsoft.awe.util.Transaction;
|
||||||
|
import com.tenwa.util.SqlRunnerUtil;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @program: apzl_leasing
|
||||||
|
* @description:
|
||||||
|
* @author: 李超杰
|
||||||
|
* @create: 2024-12-16 17:09
|
||||||
|
*/
|
||||||
|
public class FenixListHtmlGenerator extends ListHtmlWithASDataObjectGenerator {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run(BusinessProcessData arg0) throws Exception {
|
||||||
|
if (StrUtil.isEmpty(this.asObj.getFullFenixId())) {
|
||||||
|
throw new RuntimeException("参数【fullFenixId】不能为空!");
|
||||||
|
}
|
||||||
|
this.asObj.setParamstr(this.paramstr);
|
||||||
|
System.out.println("SQL参数:" + this.paramstr);
|
||||||
|
System.out.println("分页参数:pageSize=" + this.pageSize + ",curPage=" + this.curPage + ",pageCount=" + this.pageCount + ",rowCount="
|
||||||
|
+ this.rowCount + "");
|
||||||
|
//获得查询条件
|
||||||
|
List<QueryParamObject> queryParams = this.getQeuryParmObjects();
|
||||||
|
if (this.asObj.getLazyLoad() && queryParams.size() == 0) {
|
||||||
|
this.searchedDataList = new ArrayList<BizObject>();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Map<String, Object> paramMap = new HashMap<>();
|
||||||
|
if (StrUtil.isNotBlank(this.paramstr)) {
|
||||||
|
paramMap.put("paramstr", this.paramstr);
|
||||||
|
}
|
||||||
|
for (QueryParamObject queryParam : queryParams) {
|
||||||
|
System.out.println("查询条件:[colname=" + queryParam.getColName() + ",option=" + queryParam.getOption() + ",value0=" + queryParam.getValue0()
|
||||||
|
+ ",value1=" + queryParam.getValue1() + "]");
|
||||||
|
if ("Area".equals(queryParam.getOption())) {
|
||||||
|
if (StrUtil.isNotBlank(queryParam.getValue0())) {
|
||||||
|
paramMap.put(queryParam.getColName() + "Start", queryParam.getValue0());
|
||||||
|
}
|
||||||
|
if (StrUtil.isNotBlank(queryParam.getValue1())) {
|
||||||
|
paramMap.put(queryParam.getColName() + "End", queryParam.getValue1());
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
paramMap.put(queryParam.getColName(), queryParam.getValue0());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Transaction transaction = Transaction.createTransaction(JBOFactory.createJBOTransaction());
|
||||||
|
try {
|
||||||
|
PageResult<Entity> pageResult = SqlRunnerUtil.page(transaction, this.asObj.getFullFenixId(), paramMap,
|
||||||
|
Page.of(this.curPage, this.getPageSize()));
|
||||||
|
this.rowCount = pageResult.getTotal();
|
||||||
|
this.pageCount = pageResult.getTotalPage();
|
||||||
|
|
||||||
|
BizObjectManager manager = getBizObjectManager();
|
||||||
|
this.searchedDataList = new ArrayList<BizObject>();
|
||||||
|
for (Entity entity : pageResult) {
|
||||||
|
this.searchedDataList.add(createBizObject(manager, entity));
|
||||||
|
}
|
||||||
|
transaction.commit();
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
try {
|
||||||
|
if (transaction != null) transaction.rollback();
|
||||||
|
} catch (JBOException e1) {
|
||||||
|
e1.printStackTrace();
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
try {
|
||||||
|
if (transaction != null) {
|
||||||
|
transaction.disConnect();
|
||||||
|
}
|
||||||
|
} catch (JBOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void calPageCount(BusinessProcessData businessProcessData) throws Exception {
|
||||||
|
pageCount = (rowCount + this.pageSize - 1) / this.pageSize;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -8,9 +8,12 @@ import java.sql.ResultSet;
|
|||||||
import java.sql.Statement;
|
import java.sql.Statement;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
import cn.hutool.db.Entity;
|
||||||
|
import cn.hutool.db.handler.EntityHandler;
|
||||||
import cn.hutool.db.handler.NumberHandler;
|
import cn.hutool.db.handler.NumberHandler;
|
||||||
import com.google.common.collect.ImmutableMap;
|
import com.google.common.collect.ImmutableMap;
|
||||||
import com.tenwa.util.SqlRunnerUtil;
|
import com.tenwa.util.SqlRunnerUtil;
|
||||||
@ -202,19 +205,19 @@ public class RentIncomeMethod {
|
|||||||
/**
|
/**
|
||||||
* 租金核销
|
* 租金核销
|
||||||
*/
|
*/
|
||||||
public String setRentDataToRentIncome(JBOTransaction tx) throws JBOException{
|
public String setRentDataToRentIncome(JBOTransaction tx) throws JBOException {
|
||||||
try{
|
try {
|
||||||
boolean flag = false;
|
boolean flag = false;
|
||||||
if("Y".equals(isChanged)){
|
if ("Y".equals(isChanged)) {
|
||||||
flag = true;
|
flag = true;
|
||||||
}
|
}
|
||||||
BigDecimal bel = new BigDecimal(balance == null?"0":balance); //可核销金额
|
BigDecimal bel = new BigDecimal(balance == null ? "0" : balance); //可核销金额
|
||||||
BigDecimal allFactMoney = bel;
|
BigDecimal allFactMoney = bel;
|
||||||
BizObjectManager bomEb = JBOFactory.getBizObjectManager(LC_EBANK_TEMP.CLASS_NAME);
|
BizObjectManager bomEb = JBOFactory.getBizObjectManager(LC_EBANK_TEMP.CLASS_NAME);
|
||||||
tx.join(bomEb);
|
tx.join(bomEb);
|
||||||
BizObject boEb = bomEb.createQuery("FLOWUNID=:FLOWUNID")
|
BizObject boEb = bomEb.createQuery("FLOWUNID=:FLOWUNID")
|
||||||
.setParameter("FLOWUNID", flowunid).getSingleResult(true);
|
.setParameter("FLOWUNID", flowunid).getSingleResult(true);
|
||||||
if(flag){
|
if (flag) {
|
||||||
bel = new BigDecimal(boEb.getAttribute("MAYOPE_MONEY").getString());
|
bel = new BigDecimal(boEb.getAttribute("MAYOPE_MONEY").getString());
|
||||||
allFactMoney = bel;
|
allFactMoney = bel;
|
||||||
}
|
}
|
||||||
@ -222,36 +225,39 @@ public class RentIncomeMethod {
|
|||||||
String[] corpuss = new String[ids.length];
|
String[] corpuss = new String[ids.length];
|
||||||
String[] interests = new String[ids.length];
|
String[] interests = new String[ids.length];
|
||||||
String[] Penaltys = new String[ids.length];
|
String[] Penaltys = new String[ids.length];
|
||||||
if(overCorpuss != null){
|
if (overCorpuss != null) {
|
||||||
corpuss = overCorpuss.split("@");
|
corpuss = overCorpuss.split("@");
|
||||||
interests = overInterests.split("@");
|
interests = overInterests.split("@");
|
||||||
Penaltys = overPenaltys.split("@");
|
Penaltys = overPenaltys.split("@");
|
||||||
}
|
}
|
||||||
String factDate = boEb.getAttribute("FACT_DATE").getString();
|
String factDate = boEb.getAttribute("FACT_DATE").getString();
|
||||||
Date f = new SimpleDateFormat("yyyy/MM/dd").parse(factDate);
|
Date f = new SimpleDateFormat("yyyy/MM/dd").parse(factDate);
|
||||||
for(int i=0;i<ids.length;i++){
|
for (int i = 0; i < ids.length; i++) {
|
||||||
BizObject boVLRP = JBOFactory.createBizObjectQuery(LC_RENT_PLAN.CLASS_NAME, "ID=:ID").setParameter("ID", ids[i])
|
BizObject boVLRP = JBOFactory.createBizObjectQuery(LC_RENT_PLAN.CLASS_NAME, "ID=:ID").setParameter("ID", ids[i])
|
||||||
.getSingleResult(false);
|
.getSingleResult(false);
|
||||||
BizObject boLCI = JBOFactory.createBizObjectQuery(LB_CONTRACT_INFO.CLASS_NAME, "ID=:ID").setParameter("ID", boVLRP.getAttribute("CONTRACT_ID").getString())
|
BizObject boLCI = JBOFactory.createBizObjectQuery(LB_CONTRACT_INFO.CLASS_NAME, "ID=:ID")
|
||||||
|
.setParameter("ID", boVLRP.getAttribute("CONTRACT_ID").getString())
|
||||||
.getSingleResult(false);
|
.getSingleResult(false);
|
||||||
Map<String,List<Map<String,String>>> paymentOrders = ProductParamUtil.getProductComponentDecisionTable(boLCI.getAttribute("PRODUCT_ID").getString(), "PRD0307", "rmoname", "rmosortno");
|
Map<String, List<Map<String, String>>> paymentOrders = ProductParamUtil
|
||||||
String penaltyRule = ProductParamUtil.getProductParameterValue(boLCI.getAttribute("PRODUCT_ID").getString(), "PRD0307","PenaltyRule", "PenaltyRule");
|
.getProductComponentDecisionTable(boLCI.getAttribute("PRODUCT_ID").getString(), "PRD0307", "rmoname", "rmosortno");
|
||||||
|
String penaltyRule = ProductParamUtil
|
||||||
|
.getProductParameterValue(boLCI.getAttribute("PRODUCT_ID").getString(), "PRD0307", "PenaltyRule", "PenaltyRule");
|
||||||
String[] paymentOrder = new String[3];
|
String[] paymentOrder = new String[3];
|
||||||
String planDate = boVLRP.getAttribute("PLAN_DATE").getString();
|
String planDate = boVLRP.getAttribute("PLAN_DATE").getString();
|
||||||
if(f.compareTo(new SimpleDateFormat("yyyy/MM/dd").parse(planDate)) > 0){
|
if (f.compareTo(new SimpleDateFormat("yyyy/MM/dd").parse(planDate)) > 0) {
|
||||||
for(int j=0;j<paymentOrders.get("RMO-02").size();j++){
|
for (int j = 0; j < paymentOrders.get("RMO-02").size(); j++) {
|
||||||
paymentOrder[Integer.parseInt(paymentOrders.get("RMO-02").get(j).get("rmosortno"))-1] = paymentOrders.get("RMO-02").get(j).get("rmoname");
|
paymentOrder[Integer.parseInt(paymentOrders.get("RMO-02").get(j).get("rmosortno")) - 1] = paymentOrders.get("RMO-02").get(j).get("rmoname");
|
||||||
}
|
}
|
||||||
}else{
|
} else {
|
||||||
for(int j=0;j<paymentOrders.get("RMO-01").size();j++){
|
for (int j = 0; j < paymentOrders.get("RMO-01").size(); j++) {
|
||||||
paymentOrder[Integer.parseInt(paymentOrders.get("RMO-01").get(j).get("rmosortno"))-1] = paymentOrders.get("RMO-01").get(j).get("rmoname");
|
paymentOrder[Integer.parseInt(paymentOrders.get("RMO-01").get(j).get("rmosortno")) - 1] = paymentOrders.get("RMO-01").get(j).get("rmoname");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if("penalty_income".equals(penaltyRule)){
|
if ("penalty_income".equals(penaltyRule)) {
|
||||||
Penaltys[i] = "0.00";
|
Penaltys[i] = "0.00";
|
||||||
}
|
}
|
||||||
BizObjectManager boLRI = JBOFactory.getBizObjectManager(LC_RENT_INCOME_TEMP.CLASS_NAME);
|
BizObjectManager boLRI = JBOFactory.getBizObjectManager(LC_RENT_INCOME_TEMP.CLASS_NAME);
|
||||||
BizObjectManager bomLORL = JBOFactory.getBizObjectManager(LC_OCCUPY_RENT_LIST.CLASS_NAME,tx);
|
BizObjectManager bomLORL = JBOFactory.getBizObjectManager(LC_OCCUPY_RENT_LIST.CLASS_NAME, tx);
|
||||||
BizObject boLORL = bomLORL.newObject();
|
BizObject boLORL = bomLORL.newObject();
|
||||||
boLORL.setAttributeValue("ID", UUIDUtil.getUUID());
|
boLORL.setAttributeValue("ID", UUIDUtil.getUUID());
|
||||||
boLORL.setAttributeValue("PAYMENT_NUMBER", boVLRP.getAttribute("PAYMENT_NUMBER").getString());
|
boLORL.setAttributeValue("PAYMENT_NUMBER", boVLRP.getAttribute("PAYMENT_NUMBER").getString());
|
||||||
@ -259,6 +265,7 @@ public class RentIncomeMethod {
|
|||||||
boLORL.setAttributeValue("PLAN_ID", boVLRP.getAttribute("ID").getString());
|
boLORL.setAttributeValue("PLAN_ID", boVLRP.getAttribute("ID").getString());
|
||||||
boLORL.setAttributeValue("FLOW_NAME", "网银收款");
|
boLORL.setAttributeValue("FLOW_NAME", "网银收款");
|
||||||
boLORL.setAttributeValue("FLOWUNID", flowunid);
|
boLORL.setAttributeValue("FLOWUNID", flowunid);
|
||||||
|
boLORL.setAttributeValue(LC_OCCUPY_RENT_LIST.INPUTTIME, StringFunction.getTodayNow());
|
||||||
bomLORL.saveObject(boLORL);
|
bomLORL.saveObject(boLORL);
|
||||||
tx.join(boLRI);
|
tx.join(boLRI);
|
||||||
BizObject boLRIT = boLRI.newObject();
|
BizObject boLRIT = boLRI.newObject();
|
||||||
@ -278,54 +285,54 @@ public class RentIncomeMethod {
|
|||||||
.getResultList(false);
|
.getResultList(false);
|
||||||
List<BizObject> boLCRIT = JBOFactory.createBizObjectQuery(LC_RENT_INCOME_TEMP.CLASS_NAME, "PLAN_ID=:PLAN_ID and IS_FLOWING = 0").setParameter("PLAN_ID", ids[i])
|
List<BizObject> boLCRIT = JBOFactory.createBizObjectQuery(LC_RENT_INCOME_TEMP.CLASS_NAME, "PLAN_ID=:PLAN_ID and IS_FLOWING = 0").setParameter("PLAN_ID", ids[i])
|
||||||
.getResultList(false);
|
.getResultList(false);
|
||||||
boLRIT.setAttributeValue("HIRE_LIST", boLCRI.size()+boLCRIT.size()+1);
|
boLRIT.setAttributeValue("HIRE_LIST", boLCRI.size() + boLCRIT.size() + 1);
|
||||||
//安鹏要求改为网银到账日期
|
//安鹏要求改为网银到账日期
|
||||||
boLRIT.setAttributeValue("HIRE_DATE", factDate);
|
boLRIT.setAttributeValue("HIRE_DATE", factDate);
|
||||||
boLRIT.setAttributeValue("CHARGE_WAY", "Collection");
|
boLRIT.setAttributeValue("CHARGE_WAY", "Collection");
|
||||||
boLRIT.setAttributeValue("HIRE_OBJECT", boEb.getAttribute("CLIENT_NAME").getString());
|
boLRIT.setAttributeValue("HIRE_OBJECT", boEb.getAttribute("CLIENT_NAME").getString());
|
||||||
BigDecimal money;
|
BigDecimal money;
|
||||||
if(!flag){
|
if (!flag) {
|
||||||
money = new BigDecimal(corpuss[i]).add(new BigDecimal(interests[i])).add(new BigDecimal(Penaltys[i]));
|
money = new BigDecimal(corpuss[i]).add(new BigDecimal(interests[i])).add(new BigDecimal(Penaltys[i]));
|
||||||
if(!ids[i].equals(portionCollectionID)){
|
if (!ids[i].equals(portionCollectionID)) {
|
||||||
bel = bel.subtract(money);
|
bel = bel.subtract(money);
|
||||||
boLRIT.setAttributeValue("RENT", new BigDecimal(corpuss[i]).add(new BigDecimal(interests[i])));
|
boLRIT.setAttributeValue("RENT", new BigDecimal(corpuss[i]).add(new BigDecimal(interests[i])));
|
||||||
boLRIT.setAttributeValue("CORPUS", new BigDecimal(corpuss[i]));
|
boLRIT.setAttributeValue("CORPUS", new BigDecimal(corpuss[i]));
|
||||||
boLRIT.setAttributeValue("INTEREST", new BigDecimal(interests[i]));
|
boLRIT.setAttributeValue("INTEREST", new BigDecimal(interests[i]));
|
||||||
boLRIT.setAttributeValue("PENALTY", new BigDecimal(Penaltys[i]));
|
boLRIT.setAttributeValue("PENALTY", new BigDecimal(Penaltys[i]));
|
||||||
}else{
|
} else {
|
||||||
BigDecimal portionMoneys = new BigDecimal(portionMoney);
|
BigDecimal portionMoneys = new BigDecimal(portionMoney);
|
||||||
BigDecimal rentMoney = new BigDecimal(0);
|
BigDecimal rentMoney = new BigDecimal(0);
|
||||||
for(int j=0;j<paymentOrder.length;j++){ //获取产品还款次序
|
for (int j = 0; j < paymentOrder.length; j++) { //获取产品还款次序
|
||||||
BigDecimal subtractMoney = new BigDecimal(0);
|
BigDecimal subtractMoney = new BigDecimal(0);
|
||||||
String subtractMoneyName = "";
|
String subtractMoneyName = "";
|
||||||
if("本金".equals(paymentOrder[j])){
|
if ("本金".equals(paymentOrder[j])) {
|
||||||
subtractMoneyName = "CORPUS";
|
subtractMoneyName = "CORPUS";
|
||||||
subtractMoney = new BigDecimal(corpuss[i]);
|
subtractMoney = new BigDecimal(corpuss[i]);
|
||||||
}else if("利息".equals(paymentOrder[j])){
|
} else if ("利息".equals(paymentOrder[j])) {
|
||||||
subtractMoneyName = "INTEREST";
|
subtractMoneyName = "INTEREST";
|
||||||
subtractMoney = new BigDecimal(interests[i]);
|
subtractMoney = new BigDecimal(interests[i]);
|
||||||
}else if("罚息".equals(paymentOrder[j])){
|
} else if ("罚息".equals(paymentOrder[j])) {
|
||||||
subtractMoneyName = "PENALTY";
|
subtractMoneyName = "PENALTY";
|
||||||
subtractMoney = new BigDecimal(Penaltys[i]);
|
subtractMoney = new BigDecimal(Penaltys[i]);
|
||||||
}
|
}
|
||||||
if(portionMoneys.compareTo(new BigDecimal(0)) == 0){ //如果已经为0,则为对应的回笼对象赋值0
|
if (portionMoneys.compareTo(new BigDecimal(0)) == 0) { //如果已经为0,则为对应的回笼对象赋值0
|
||||||
if("CORPUS".equals(subtractMoneyName) || "INTEREST".equals(subtractMoneyName)){
|
if ("CORPUS".equals(subtractMoneyName) || "INTEREST".equals(subtractMoneyName)) {
|
||||||
rentMoney = rentMoney.add(new BigDecimal(0));
|
rentMoney = rentMoney.add(new BigDecimal(0));
|
||||||
}
|
}
|
||||||
//暂时解决报错问题
|
//暂时解决报错问题
|
||||||
if("".equals(subtractMoneyName)||subtractMoneyName==null){
|
if ("".equals(subtractMoneyName) || subtractMoneyName == null) {
|
||||||
subtractMoneyName="PENALTY";
|
subtractMoneyName = "PENALTY";
|
||||||
}
|
}
|
||||||
boLRIT.setAttributeValue(subtractMoneyName, 0);
|
boLRIT.setAttributeValue(subtractMoneyName, 0);
|
||||||
}else{
|
} else {
|
||||||
if(portionMoneys.compareTo(subtractMoney) >= 0){ //如果能正常减去,则为对应的回笼对象赋值对应值
|
if (portionMoneys.compareTo(subtractMoney) >= 0) { //如果能正常减去,则为对应的回笼对象赋值对应值
|
||||||
if("CORPUS".equals(subtractMoneyName) || "INTEREST".equals(subtractMoneyName)){
|
if ("CORPUS".equals(subtractMoneyName) || "INTEREST".equals(subtractMoneyName)) {
|
||||||
rentMoney = rentMoney.add(subtractMoney);
|
rentMoney = rentMoney.add(subtractMoney);
|
||||||
}
|
}
|
||||||
portionMoneys = portionMoneys.subtract(subtractMoney);
|
portionMoneys = portionMoneys.subtract(subtractMoney);
|
||||||
boLRIT.setAttributeValue(subtractMoneyName, subtractMoney);
|
boLRIT.setAttributeValue(subtractMoneyName, subtractMoney);
|
||||||
}else{ //如果不够减,则把剩余的值赋值给对应的回笼对象
|
} else { //如果不够减,则把剩余的值赋值给对应的回笼对象
|
||||||
if("CORPUS".equals(subtractMoneyName) || "INTEREST".equals(subtractMoneyName)){
|
if ("CORPUS".equals(subtractMoneyName) || "INTEREST".equals(subtractMoneyName)) {
|
||||||
rentMoney = rentMoney.add(portionMoneys);
|
rentMoney = rentMoney.add(portionMoneys);
|
||||||
}
|
}
|
||||||
boLRIT.setAttributeValue(subtractMoneyName, portionMoneys);
|
boLRIT.setAttributeValue(subtractMoneyName, portionMoneys);
|
||||||
@ -336,59 +343,62 @@ public class RentIncomeMethod {
|
|||||||
boLRIT.setAttributeValue("RENT", rentMoney);
|
boLRIT.setAttributeValue("RENT", rentMoney);
|
||||||
bel = bel.subtract(new BigDecimal(portionMoney));
|
bel = bel.subtract(new BigDecimal(portionMoney));
|
||||||
}
|
}
|
||||||
}else{
|
} else {
|
||||||
BizObject bo = JBOFactory.getBizObjectManager(VI_LC_RENT_PLAN.CLASS_NAME).createQuery("id=:planID").setParameter("planID", ids[i]).getSingleResult(false);
|
// BizObject bo = JBOFactory.getBizObjectManager(VI_LC_RENT_PLAN.CLASS_NAME).createQuery("id=:planID").setParameter("planID", ids[i]).getSingleResult(false);
|
||||||
String corpusOver = bo.getAttribute("corpus_over").getString();
|
Map<String, Object> sqlParamMap = new HashMap<>();
|
||||||
String interestOver = bo.getAttribute("interest_over").getString();
|
sqlParamMap.put("planId", ids[i]);
|
||||||
// String penaltyOver = bo.getAttribute("penalty_over").getString();
|
Entity entity = SqlRunnerUtil.query("flow.FundCollectionFlow.queryRentPlanList", sqlParamMap, new EntityHandler());
|
||||||
String factPenalty = bo.getAttribute("fact_penalty").getString();
|
String paymentNumber = entity.getStr("payment_number");
|
||||||
String penaltyAdjust = bo.getAttribute("penalty_adjust").getString();
|
String planList = entity.getStr("plan_list");
|
||||||
|
BigDecimal corpusOver = entity.getBigDecimal("corpus_over");
|
||||||
|
BigDecimal interestOver = entity.getBigDecimal("interest_over");
|
||||||
|
BigDecimal penaltySum = entity.getBigDecimal("penalty_sum");// 包含罚息实收和罚息调整
|
||||||
String penalty = JBOFactory.getBizObjectManager(LB_CONTRACT_INFO.CLASS_NAME)
|
String penalty = JBOFactory.getBizObjectManager(LB_CONTRACT_INFO.CLASS_NAME)
|
||||||
.createQuery("select v.round(v.getRentPenalty('"+bo.getAttribute("payment_number").getString()+"','"+bo.getAttribute("plan_list").getString()+"','"+factDate+"'),2) as v.penalty from O").getSingleResult(false).getAttribute("penalty").getString();
|
.createQuery("select v.round(v.getRentPenalty('" + paymentNumber + "','" + planList + "','" + factDate + "'),2) as v.penalty from O").getSingleResult(false).getAttribute("penalty").getString();
|
||||||
String penaltyOver = new BigDecimal(penalty).subtract(new BigDecimal(factPenalty)).subtract(new BigDecimal(penaltyAdjust)).toString();
|
BigDecimal penaltyOver = new BigDecimal(penalty).subtract(penaltySum);
|
||||||
|
|
||||||
if("penalty_income".equals(penaltyRule)){
|
if ("penalty_income".equals(penaltyRule)) {
|
||||||
penaltyOver = "0.00";
|
penaltyOver = BigDecimal.ZERO;
|
||||||
}else{
|
} else {
|
||||||
// penaltyOver = JBOFactory.getBizObjectManager(VI_LC_RENT_PLAN.CLASS_NAME).createQuery("select v.getRentPenalty('"+boVLRP.getAttribute("PAYMENT_NUMBER").getString()+"','"+boVLRP.getAttribute("PLAN_LIST").getString()+"','"+factDate+"') v.penalty from O").getSingleResult(false).getAttribute("penalty").getString();
|
// penaltyOver = JBOFactory.getBizObjectManager(VI_LC_RENT_PLAN.CLASS_NAME).createQuery("select v.getRentPenalty('"+boVLRP.getAttribute("PAYMENT_NUMBER").getString()+"','"+boVLRP.getAttribute("PLAN_LIST").getString()+"','"+factDate+"') v.penalty from O").getSingleResult(false).getAttribute("penalty").getString();
|
||||||
}
|
}
|
||||||
money = new BigDecimal(corpusOver).add(new BigDecimal(interestOver)).add(new BigDecimal(penaltyOver));
|
money = corpusOver.add(interestOver).add(penaltyOver);
|
||||||
if(money.compareTo(bel) <= 0){
|
if (money.compareTo(bel) <= 0) {
|
||||||
bel = bel.subtract(money);
|
bel = bel.subtract(money);
|
||||||
boLRIT.setAttributeValue("RENT", new BigDecimal(corpusOver).add(new BigDecimal(interestOver)));
|
boLRIT.setAttributeValue("RENT", corpusOver.add(interestOver));
|
||||||
boLRIT.setAttributeValue("CORPUS", new BigDecimal(corpusOver));
|
boLRIT.setAttributeValue("CORPUS", corpusOver);
|
||||||
boLRIT.setAttributeValue("INTEREST", new BigDecimal(interestOver));
|
boLRIT.setAttributeValue("INTEREST", interestOver);
|
||||||
boLRIT.setAttributeValue("PENALTY", new BigDecimal(penaltyOver));
|
boLRIT.setAttributeValue("PENALTY", penaltyOver);
|
||||||
}else{
|
} else {
|
||||||
BigDecimal portionMoneys = bel;
|
BigDecimal portionMoneys = bel;
|
||||||
BigDecimal rentMoney = new BigDecimal(0);
|
BigDecimal rentMoney = new BigDecimal(0);
|
||||||
for(int j=0;j<paymentOrder.length;j++){ //获取产品还款次序
|
for (int j = 0; j < paymentOrder.length; j++) { //获取产品还款次序
|
||||||
BigDecimal subtractMoney = new BigDecimal(0);
|
BigDecimal subtractMoney = new BigDecimal(0);
|
||||||
String subtractMoneyName = "";
|
String subtractMoneyName = "";
|
||||||
if("本金".equals(paymentOrder[j])){
|
if ("本金".equals(paymentOrder[j])) {
|
||||||
subtractMoneyName = "CORPUS";
|
subtractMoneyName = "CORPUS";
|
||||||
subtractMoney = new BigDecimal(corpusOver);
|
subtractMoney = corpusOver;
|
||||||
}else if("利息".equals(paymentOrder[j])){
|
} else if ("利息".equals(paymentOrder[j])) {
|
||||||
subtractMoneyName = "INTEREST";
|
subtractMoneyName = "INTEREST";
|
||||||
subtractMoney = new BigDecimal(interestOver);
|
subtractMoney = interestOver;
|
||||||
}else if("罚息".equals(paymentOrder[j])){
|
} else if ("罚息".equals(paymentOrder[j])) {
|
||||||
subtractMoneyName = "PENALTY";
|
subtractMoneyName = "PENALTY";
|
||||||
subtractMoney = new BigDecimal(penaltyOver);
|
subtractMoney = penaltyOver;
|
||||||
}
|
}
|
||||||
if(portionMoneys.compareTo(new BigDecimal(0)) == 0){ //如果已经为0,则为对应的回笼对象赋值0
|
if (portionMoneys.compareTo(new BigDecimal(0)) == 0) { //如果已经为0,则为对应的回笼对象赋值0
|
||||||
if("CORPUS".equals(subtractMoneyName) || "INTEREST".equals(subtractMoneyName)){
|
if ("CORPUS".equals(subtractMoneyName) || "INTEREST".equals(subtractMoneyName)) {
|
||||||
rentMoney = rentMoney.add(new BigDecimal(0));
|
rentMoney = rentMoney.add(new BigDecimal(0));
|
||||||
}
|
}
|
||||||
boLRIT.setAttributeValue(subtractMoneyName, 0);
|
boLRIT.setAttributeValue(subtractMoneyName, 0);
|
||||||
}else{
|
} else {
|
||||||
if(portionMoneys.compareTo(subtractMoney) >= 0){ //如果能正常减去,则为对应的回笼对象赋值对应值
|
if (portionMoneys.compareTo(subtractMoney) >= 0) { //如果能正常减去,则为对应的回笼对象赋值对应值
|
||||||
if("CORPUS".equals(subtractMoneyName) || "INTEREST".equals(subtractMoneyName)){
|
if ("CORPUS".equals(subtractMoneyName) || "INTEREST".equals(subtractMoneyName)) {
|
||||||
rentMoney = rentMoney.add(subtractMoney);
|
rentMoney = rentMoney.add(subtractMoney);
|
||||||
}
|
}
|
||||||
portionMoneys = portionMoneys.subtract(subtractMoney);
|
portionMoneys = portionMoneys.subtract(subtractMoney);
|
||||||
boLRIT.setAttributeValue(subtractMoneyName, subtractMoney);
|
boLRIT.setAttributeValue(subtractMoneyName, subtractMoney);
|
||||||
}else{ //如果不够减,则把剩余的值赋值给对应的回笼对象
|
} else { //如果不够减,则把剩余的值赋值给对应的回笼对象
|
||||||
if("CORPUS".equals(subtractMoneyName) || "INTEREST".equals(subtractMoneyName)){
|
if ("CORPUS".equals(subtractMoneyName) || "INTEREST".equals(subtractMoneyName)) {
|
||||||
rentMoney = rentMoney.add(portionMoneys);
|
rentMoney = rentMoney.add(portionMoneys);
|
||||||
}
|
}
|
||||||
boLRIT.setAttributeValue(subtractMoneyName, portionMoneys);
|
boLRIT.setAttributeValue(subtractMoneyName, portionMoneys);
|
||||||
@ -417,7 +427,7 @@ public class RentIncomeMethod {
|
|||||||
boLRIT.setAttributeValue("FLOWUNID", flowunid);
|
boLRIT.setAttributeValue("FLOWUNID", flowunid);
|
||||||
boLRI.saveObject(boLRIT);
|
boLRI.saveObject(boLRIT);
|
||||||
}
|
}
|
||||||
if(bel.compareTo(new BigDecimal(0)) > 0){
|
if (bel.compareTo(new BigDecimal(0)) > 0) {
|
||||||
allFactMoney = allFactMoney.subtract(bel);
|
allFactMoney = allFactMoney.subtract(bel);
|
||||||
}
|
}
|
||||||
BizObjectManager bomLEP = JBOFactory.getBizObjectManager(LC_EBANK_PROCESS.CLASS_NAME);
|
BizObjectManager bomLEP = JBOFactory.getBizObjectManager(LC_EBANK_PROCESS.CLASS_NAME);
|
||||||
@ -430,11 +440,11 @@ public class RentIncomeMethod {
|
|||||||
//已核销金额 = 到账总金额 - 剩余可核销金额
|
//已核销金额 = 到账总金额 - 剩余可核销金额
|
||||||
BigDecimal mayMoney = new BigDecimal(boEb.getAttribute("MAYOPE_MONEY").getDouble());
|
BigDecimal mayMoney = new BigDecimal(boEb.getAttribute("MAYOPE_MONEY").getDouble());
|
||||||
BigDecimal factMoney = new BigDecimal(boEb.getAttribute("FACT_MONEY").getDouble());
|
BigDecimal factMoney = new BigDecimal(boEb.getAttribute("FACT_MONEY").getDouble());
|
||||||
BigDecimal mayMoneyNew = mayMoney.subtract(allFactMoney);
|
BigDecimal mayMoneyNew = mayMoney.subtract(allFactMoney);
|
||||||
boEb.setAttributeValue("MAYOPE_MONEY",mayMoneyNew.toString());
|
boEb.setAttributeValue("MAYOPE_MONEY", mayMoneyNew.toString());
|
||||||
boEb.setAttributeValue("HAD_MONEY", factMoney.subtract(mayMoneyNew).toString());
|
boEb.setAttributeValue("HAD_MONEY", factMoney.subtract(mayMoneyNew).toString());
|
||||||
bomEb.saveObject(boEb);
|
bomEb.saveObject(boEb);
|
||||||
}catch(Exception e){
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
return "ERROR";
|
return "ERROR";
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user