网银收款核销-租金-审批页面-租金计划页面速度优化
This commit is contained in:
parent
356d4db955
commit
408ca1cc76
@ -3,8 +3,12 @@
|
||||
<%@page import="com.amarsoft.are.jbo.JBOFactory" %>
|
||||
<%@page import="com.amarsoft.are.jbo.JBOTransaction" %>
|
||||
<%@page import="java.math.BigDecimal" %>
|
||||
<%@ page import="com.tenwa.util.SqlRunnerUtil" %>
|
||||
<%@ page import="cn.hutool.db.Entity" %>
|
||||
<%@ page import="cn.hutool.db.handler.EntityHandler" %>
|
||||
<%@ page contentType="text/html; charset=GBK" %>
|
||||
<%@ include file="/IncludeBeginMDAJAX.jsp"%><%
|
||||
<%@ include file="/IncludeBeginMDAJAX.jsp" %>
|
||||
<%
|
||||
String flowunid = CurPage.getParameter("flowunid");
|
||||
String factDate = CurPage.getParameter("factDate");
|
||||
String planIDs = CurPage.getParameter("planIDs");
|
||||
@ -23,19 +27,33 @@
|
||||
}
|
||||
boolean flagR = true;
|
||||
boolean flagP = true;
|
||||
Map<String, Object> sqlParamMap = new HashMap<>();
|
||||
for (int i = 0; i < planID.length; i++) {
|
||||
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);
|
||||
String result = Sqlca.getString(so);
|
||||
if("0".equals(result)){
|
||||
sqlParamMap.clear();
|
||||
sqlParamMap.put("planId", planID[i]);
|
||||
Entity entity1 = SqlRunnerUtil.query(Sqlca, "flow.FundCollectionFlow.queryRentPlanList", sqlParamMap, new EntityHandler());
|
||||
// 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);
|
||||
// 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;
|
||||
}
|
||||
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]+"'";
|
||||
so = new SqlObject(sql);
|
||||
result = Sqlca.getString(so);
|
||||
if("0".equals(result)){
|
||||
// if ("0".equals(result)) {
|
||||
// flagR = false;
|
||||
// }
|
||||
sqlParamMap.put("factDate", factDate.replaceAll("-", "/"));
|
||||
Entity entity2 = SqlRunnerUtil.query(Sqlca, "flow.FundCollectionFlow.getRentPlanPenaltyByPlanId", sqlParamMap, new EntityHandler());
|
||||
if(new BigDecimal(overPenalty[i]).compareTo(entity2.getBigDecimal("penalty_over")) != 0) {
|
||||
flagP = false;
|
||||
}
|
||||
|
||||
// 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] + "'";
|
||||
// so = new SqlObject(sql);
|
||||
// result = Sqlca.getString(so);
|
||||
|
||||
// if ("0".equals(result)) {
|
||||
// flagP = false;
|
||||
// }
|
||||
}
|
||||
String outResult = "";
|
||||
if (!flagR) {
|
||||
@ -54,4 +72,5 @@
|
||||
outResult += "@SUCCESS";
|
||||
}
|
||||
out.println(outResult);
|
||||
%><%@ include file="/IncludeEndAJAX.jsp"%>
|
||||
%>
|
||||
<%@ include file="/IncludeEndAJAX.jsp" %>
|
||||
@ -1,13 +1,25 @@
|
||||
<%@ 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"%>
|
||||
<%@ include file="/IncludeBeginMDAJAX.jsp"%><%
|
||||
String paymentNumber = CurPage.getParameter("paymentNumber");
|
||||
String planList = CurPage.getParameter("planList");
|
||||
//获取选择期次前所有的剩余租金的和,如果租金余额大于0,则返回false,禁止跨期核销
|
||||
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);
|
||||
// String rentOver = DataUtil.getValueBySql("select sum(rent_over) from vi_rent_collect_4_ebank where payment_number = '"+paymentNumber+"' and plan_list < '"+planList+"';");
|
||||
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 = "";
|
||||
if(doubleRentOver>0){
|
||||
if(allOver.compareTo(BigDecimal.ZERO) == 1){
|
||||
result = "false";
|
||||
}else{
|
||||
result = "true";
|
||||
|
||||
@ -35,8 +35,9 @@
|
||||
businessType="2,3";
|
||||
}
|
||||
}
|
||||
ASObjectModel doTemp = new ASObjectModel("VILCRentPlanList");
|
||||
doTemp.setDataQueryClass("com.amarsoft.awe.dw.ui.list.FlowMonitorListHtmlGenerator");
|
||||
// ASObjectModel doTemp = new ASObjectModel("VILCRentPlanList");
|
||||
// doTemp.setDataQueryClass("com.amarsoft.awe.dw.ui.list.FlowMonitorListHtmlGenerator");
|
||||
CustomASObjectModel doTemp = new CustomASObjectModel("VILCRentPlanList", "flow.FundCollectionFlow.queryRentPlanList" , true);
|
||||
CurPage.setAttribute("flowRowCount","100");
|
||||
//检验客户名称是否为经销商
|
||||
IsNullCheck inc = new IsNullCheck();
|
||||
@ -105,6 +106,9 @@
|
||||
}
|
||||
|
||||
function checkInputData(i){
|
||||
// if(getCheckedRows(0).length == 0) {
|
||||
// return;
|
||||
// }
|
||||
TableBuilder.iCurrentRow['myiframe0'] = i;
|
||||
TableBuilder.displaySelectedRows('myiframe0');
|
||||
if($("#period").attr("checked") != "checked"){
|
||||
|
||||
@ -687,6 +687,7 @@
|
||||
<attribute name="rent" label="租金" type="DOUBLE" length="32"/>
|
||||
<attribute name="corpus" 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="corpus_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.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import cn.hutool.db.Entity;
|
||||
import cn.hutool.db.handler.EntityHandler;
|
||||
import cn.hutool.db.handler.NumberHandler;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.tenwa.util.SqlRunnerUtil;
|
||||
@ -232,10 +235,13 @@ public class RentIncomeMethod {
|
||||
for (int i = 0; i < ids.length; i++) {
|
||||
BizObject boVLRP = JBOFactory.createBizObjectQuery(LC_RENT_PLAN.CLASS_NAME, "ID=:ID").setParameter("ID", ids[i])
|
||||
.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);
|
||||
Map<String,List<Map<String,String>>> paymentOrders = ProductParamUtil.getProductComponentDecisionTable(boLCI.getAttribute("PRODUCT_ID").getString(), "PRD0307", "rmoname", "rmosortno");
|
||||
String penaltyRule = ProductParamUtil.getProductParameterValue(boLCI.getAttribute("PRODUCT_ID").getString(), "PRD0307","PenaltyRule", "PenaltyRule");
|
||||
Map<String, List<Map<String, String>>> paymentOrders = ProductParamUtil
|
||||
.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 planDate = boVLRP.getAttribute("PLAN_DATE").getString();
|
||||
if (f.compareTo(new SimpleDateFormat("yyyy/MM/dd").parse(planDate)) > 0) {
|
||||
@ -259,6 +265,7 @@ public class RentIncomeMethod {
|
||||
boLORL.setAttributeValue("PLAN_ID", boVLRP.getAttribute("ID").getString());
|
||||
boLORL.setAttributeValue("FLOW_NAME", "网银收款");
|
||||
boLORL.setAttributeValue("FLOWUNID", flowunid);
|
||||
boLORL.setAttributeValue(LC_OCCUPY_RENT_LIST.INPUTTIME, StringFunction.getTodayNow());
|
||||
bomLORL.saveObject(boLORL);
|
||||
tx.join(boLRI);
|
||||
BizObject boLRIT = boLRI.newObject();
|
||||
@ -337,28 +344,31 @@ public class RentIncomeMethod {
|
||||
bel = bel.subtract(new BigDecimal(portionMoney));
|
||||
}
|
||||
} else {
|
||||
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();
|
||||
String interestOver = bo.getAttribute("interest_over").getString();
|
||||
// String penaltyOver = bo.getAttribute("penalty_over").getString();
|
||||
String factPenalty = bo.getAttribute("fact_penalty").getString();
|
||||
String penaltyAdjust = bo.getAttribute("penalty_adjust").getString();
|
||||
// BizObject bo = JBOFactory.getBizObjectManager(VI_LC_RENT_PLAN.CLASS_NAME).createQuery("id=:planID").setParameter("planID", ids[i]).getSingleResult(false);
|
||||
Map<String, Object> sqlParamMap = new HashMap<>();
|
||||
sqlParamMap.put("planId", ids[i]);
|
||||
Entity entity = SqlRunnerUtil.query("flow.FundCollectionFlow.queryRentPlanList", sqlParamMap, new EntityHandler());
|
||||
String paymentNumber = entity.getStr("payment_number");
|
||||
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)
|
||||
.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();
|
||||
String penaltyOver = new BigDecimal(penalty).subtract(new BigDecimal(factPenalty)).subtract(new BigDecimal(penaltyAdjust)).toString();
|
||||
.createQuery("select v.round(v.getRentPenalty('" + paymentNumber + "','" + planList + "','" + factDate + "'),2) as v.penalty from O").getSingleResult(false).getAttribute("penalty").getString();
|
||||
BigDecimal penaltyOver = new BigDecimal(penalty).subtract(penaltySum);
|
||||
|
||||
if ("penalty_income".equals(penaltyRule)) {
|
||||
penaltyOver = "0.00";
|
||||
penaltyOver = BigDecimal.ZERO;
|
||||
} 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();
|
||||
}
|
||||
money = new BigDecimal(corpusOver).add(new BigDecimal(interestOver)).add(new BigDecimal(penaltyOver));
|
||||
money = corpusOver.add(interestOver).add(penaltyOver);
|
||||
if (money.compareTo(bel) <= 0) {
|
||||
bel = bel.subtract(money);
|
||||
boLRIT.setAttributeValue("RENT", new BigDecimal(corpusOver).add(new BigDecimal(interestOver)));
|
||||
boLRIT.setAttributeValue("CORPUS", new BigDecimal(corpusOver));
|
||||
boLRIT.setAttributeValue("INTEREST", new BigDecimal(interestOver));
|
||||
boLRIT.setAttributeValue("PENALTY", new BigDecimal(penaltyOver));
|
||||
boLRIT.setAttributeValue("RENT", corpusOver.add(interestOver));
|
||||
boLRIT.setAttributeValue("CORPUS", corpusOver);
|
||||
boLRIT.setAttributeValue("INTEREST", interestOver);
|
||||
boLRIT.setAttributeValue("PENALTY", penaltyOver);
|
||||
} else {
|
||||
BigDecimal portionMoneys = bel;
|
||||
BigDecimal rentMoney = new BigDecimal(0);
|
||||
@ -367,13 +377,13 @@ public class RentIncomeMethod {
|
||||
String subtractMoneyName = "";
|
||||
if ("本金".equals(paymentOrder[j])) {
|
||||
subtractMoneyName = "CORPUS";
|
||||
subtractMoney = new BigDecimal(corpusOver);
|
||||
subtractMoney = corpusOver;
|
||||
} else if ("利息".equals(paymentOrder[j])) {
|
||||
subtractMoneyName = "INTEREST";
|
||||
subtractMoney = new BigDecimal(interestOver);
|
||||
subtractMoney = interestOver;
|
||||
} else if ("罚息".equals(paymentOrder[j])) {
|
||||
subtractMoneyName = "PENALTY";
|
||||
subtractMoney = new BigDecimal(penaltyOver);
|
||||
subtractMoney = penaltyOver;
|
||||
}
|
||||
if (portionMoneys.compareTo(new BigDecimal(0)) == 0) { //如果已经为0,则为对应的回笼对象赋值0
|
||||
if ("CORPUS".equals(subtractMoneyName) || "INTEREST".equals(subtractMoneyName)) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user