罚息减免申请流程审批页面-罚息减免明细页面加载速度优化
This commit is contained in:
parent
fd7a12904f
commit
356d4db955
@ -67,8 +67,7 @@
|
||||
sum(lc_rent_income.PENALTY_ADJUST) AS penalty_adjust
|
||||
from lc_rent_income
|
||||
where lc_rent_income.ROLL_BACK = '0'
|
||||
<andEqual field="payment_number" value="paymentNumber" match="?paymentNumber != empty" />
|
||||
<andEqual field="plan_id" value="planId" match="?planId != empty" />
|
||||
and PAYMENT_NUMBER = #{paymentNumber}
|
||||
group by lc_rent_income.PAYMENT_NUMBER, lc_rent_income.PLAN_LIST) lcfd
|
||||
on lcf.PAYMENT_NUMBER = lcfd.payment_number and
|
||||
lcf.PLAN_LIST = lcfd.plan_list
|
||||
@ -84,29 +83,59 @@
|
||||
from lc_rent_income_temp
|
||||
where lc_rent_income_temp.IS_FLOWING = 0
|
||||
and lc_rent_income_temp.ROLL_BACK = '0'
|
||||
<andEqual field="payment_number" value="paymentNumber" match="?paymentNumber != empty" />
|
||||
<andEqual field="plan_id" value="planId" match="?planId != empty" />
|
||||
and PAYMENT_NUMBER = #{paymentNumber}
|
||||
group by lc_rent_income_temp.PAYMENT_NUMBER, lc_rent_income_temp.PLAN_LIST) lcfi
|
||||
on lcf.PAYMENT_NUMBER = lcfi.payment_number and lcf.PLAN_LIST = lcfi.plan_list
|
||||
<trimWhere>
|
||||
<andEqual field="lcf.PAYMENT_NUMBER" value="paymentNumber" match="?paymentNumber != empty" />
|
||||
<andEqual field="lcf.ID" value="planId" match="?planId != empty" />
|
||||
</trimWhere>
|
||||
where lcf.PAYMENT_NUMBER = #{paymentNumber}
|
||||
</fenix>
|
||||
|
||||
<fenix id="queryRentPlanRemainPenalty">
|
||||
select round(getRentPenalty(lrp.PAYMENT_NUMBER, lrp.PLAN_LIST, date_format(now(), '%Y/%m/%d')) -
|
||||
ifnull((select sum(lri.PENALTY + PENALTY_ADJUST)
|
||||
from lc_rent_income lri
|
||||
where lri.PAYMENT_NUMBER = lrp.PAYMENT_NUMBER
|
||||
where roll_back = '0' and lri.PAYMENT_NUMBER = lrp.PAYMENT_NUMBER
|
||||
and lri.PLAN_LIST = lrp.PLAN_LIST
|
||||
), 0) - ifnull((select sum(lri.PENALTY + PENALTY_ADJUST)
|
||||
from lc_rent_income_temp lri
|
||||
where lri.PAYMENT_NUMBER = lrp.PAYMENT_NUMBER
|
||||
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 over_penalty
|
||||
from lc_rent_plan lrp
|
||||
where lrp.id = #{planId}
|
||||
</fenix>
|
||||
|
||||
<fenix id="queryRentPlanPenalty">
|
||||
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, date_format(now(), '%Y/%m/%d')),
|
||||
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'
|
||||
and payment_number = #{paymentNumber}
|
||||
and plan_list = #{planList}
|
||||
) 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'
|
||||
and payment_number = #{paymentNumber}
|
||||
and plan_list = #{planList}
|
||||
) lrit on lrp.payment_number = lrit.payment_number and lrp.plan_list = lrit.plan_list
|
||||
where lrp.payment_number = #{paymentNumber}
|
||||
and lrp.plan_list = #{planList}
|
||||
) tt
|
||||
</fenix>
|
||||
</fenixs>
|
||||
@ -74,7 +74,6 @@ public class AppTemplateCache extends AbstractCache {
|
||||
.getAttribute("ISLIST").toString();
|
||||
String doName = bo.getAttribute("GROUP_NAME") == null ? "" : bo
|
||||
.getAttribute("GROUP_NAME").toString();
|
||||
System.out.println("doNo:" + doNo);
|
||||
|
||||
colMap.put("doNo".toLowerCase(), doNo);
|
||||
colMap.put("groupCode".toLowerCase(), groupCode);
|
||||
|
||||
@ -5,6 +5,8 @@ import cn.hutool.db.dialect.impl.MysqlDialect;
|
||||
import cn.hutool.db.handler.RsHandler;
|
||||
import cn.hutool.db.sql.SqlBuilder;
|
||||
import cn.hutool.db.sql.SqlExecutor;
|
||||
import com.amarsoft.are.jbo.JBOException;
|
||||
import com.amarsoft.are.jbo.JBOFactory;
|
||||
import com.amarsoft.are.sql.Connection;
|
||||
import com.amarsoft.awe.util.Transaction;
|
||||
import com.blinkfox.fenix.bean.SqlInfo;
|
||||
@ -25,6 +27,7 @@ public class SqlRunnerUtil {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param transaction
|
||||
* @param fullFenixId
|
||||
* @param paramMap
|
||||
@ -40,14 +43,44 @@ public class SqlRunnerUtil {
|
||||
return sqlConnRunner.page(connection, sqlBuilder, page);
|
||||
}
|
||||
|
||||
public static PageResult<Entity> page(String fullFenixId, Map<String, Object> paramMap, Page page) throws SQLException, JBOException {
|
||||
Transaction transaction = Transaction.createTransaction(JBOFactory.createJBOTransaction());
|
||||
try {
|
||||
SqlInfo xmlSqlInfo = Fenix.getXmlSqlInfo(fullFenixId, paramMap);
|
||||
Connection connection = transaction.getConnection();
|
||||
SqlBuilder sqlBuilder = SqlBuilder.of(xmlSqlInfo.getSql());
|
||||
sqlBuilder.addParams(xmlSqlInfo.getParams());
|
||||
PageResult<Entity> pageResult = sqlConnRunner.page(connection, sqlBuilder, page);
|
||||
transaction.commit();
|
||||
return pageResult;
|
||||
} 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();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询对象、列表、值、值列表等
|
||||
*
|
||||
* @param transaction
|
||||
* @param fullFenixId
|
||||
* @param paramMap
|
||||
* @param rsh
|
||||
* @return
|
||||
* @param <T>
|
||||
* @return
|
||||
* @throws SQLException
|
||||
*/
|
||||
public static <T> T query(Transaction transaction, String fullFenixId, Map<String, Object> paramMap, RsHandler<T> rsh) throws SQLException {
|
||||
@ -57,4 +90,33 @@ public class SqlRunnerUtil {
|
||||
sqlBuilder.addParams(xmlSqlInfo.getParams());
|
||||
return SqlExecutor.query(connection, sqlBuilder, rsh);
|
||||
}
|
||||
|
||||
public static <T> T query(String fullFenixId, Map<String, Object> paramMap, RsHandler<T> rsh) throws SQLException, JBOException {
|
||||
Transaction transaction = Transaction.createTransaction(JBOFactory.createJBOTransaction());
|
||||
try {
|
||||
SqlInfo xmlSqlInfo = Fenix.getXmlSqlInfo(fullFenixId, paramMap);
|
||||
Connection connection = transaction.getConnection();
|
||||
SqlBuilder sqlBuilder = SqlBuilder.of(xmlSqlInfo.getSql());
|
||||
sqlBuilder.addParams(xmlSqlInfo.getParams());
|
||||
T t = SqlExecutor.query(connection, sqlBuilder, rsh);
|
||||
transaction.commit();
|
||||
return t;
|
||||
} 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();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,16 +1,19 @@
|
||||
package com.tenwa.flow.rent.rentincome;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import jbo.app.tenwa.calc.LC_RENT_INCOME_TEMP;
|
||||
import jbo.app.tenwa.calc.VI_LC_RENT_PLAN;
|
||||
import jbo.com.tenwa.lease.comm.LC_OCCUPY_RENT_LIST;
|
||||
|
||||
import cn.hutool.db.Entity;
|
||||
import cn.hutool.db.handler.EntityHandler;
|
||||
import com.amarsoft.are.jbo.BizObject;
|
||||
import com.amarsoft.are.jbo.BizObjectManager;
|
||||
import com.amarsoft.are.jbo.JBOFactory;
|
||||
import com.amarsoft.are.jbo.JBOTransaction;
|
||||
import com.amarsoft.awe.dw.handler.impl.CommonHandler;
|
||||
import com.tenwa.util.SqlRunnerUtil;
|
||||
import jbo.app.tenwa.calc.LC_RENT_INCOME_TEMP;
|
||||
import jbo.com.tenwa.lease.comm.LC_OCCUPY_RENT_LIST;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class LCRentIncomeTempReductionListHandler extends CommonHandler {
|
||||
|
||||
@ -18,12 +21,23 @@ public class LCRentIncomeTempReductionListHandler extends CommonHandler {
|
||||
protected void initDisplayForEdit(BizObject bo) throws Exception {
|
||||
String flowunid = this.asPage.getParameter("FlowUnid");
|
||||
String planID = bo.getAttribute("PLAN_ID").getString();
|
||||
BizObject boVLRP = JBOFactory.createBizObjectQuery(VI_LC_RENT_PLAN.CLASS_NAME, "select penalty,fact_penalty,penalty_adjust,penalty_over from O where id='"+planID+"'")
|
||||
.getSingleResult(false);
|
||||
String penalty = boVLRP.getAttribute("penalty").getString();
|
||||
String factPenalty = boVLRP.getAttribute("fact_penalty").getString();
|
||||
String penaltyAdjust = boVLRP.getAttribute("penalty_adjust").getString();
|
||||
String penaltyOver = boVLRP.getAttribute("penalty_over").getString();
|
||||
String paymentNumber = bo.getAttribute(LC_RENT_INCOME_TEMP.PAYMENT_NUMBER).getString();
|
||||
String planList = bo.getAttribute(LC_RENT_INCOME_TEMP.PLAN_LIST).getString();
|
||||
// BizObject boVLRP = JBOFactory.createBizObjectQuery(VI_LC_RENT_PLAN.CLASS_NAME, "select penalty,fact_penalty,penalty_adjust,penalty_over from O where id='"+planID+"'")
|
||||
// .getSingleResult(false);
|
||||
Map<String, Object> paramMap = new HashMap<>();
|
||||
paramMap.put("paymentNumber", paymentNumber);
|
||||
paramMap.put("planList", planList);
|
||||
Entity entity = SqlRunnerUtil.query("flow.PenaltyReductionFlow.queryRentPlanPenalty", paramMap, new EntityHandler());
|
||||
String penalty = entity.getBigDecimal("penalty").toString();
|
||||
String factPenalty = entity.getBigDecimal("fact_penalty").toString();
|
||||
String penaltyAdjust = entity.getBigDecimal("penalty_adjust").toString();
|
||||
String penaltyOver = entity.getBigDecimal("penalty_over").toString();
|
||||
|
||||
// String penalty = boVLRP.getAttribute("penalty").getString();
|
||||
// String factPenalty = boVLRP.getAttribute("fact_penalty").getString();
|
||||
// String penaltyAdjust = boVLRP.getAttribute("penalty_adjust").getString();
|
||||
// String penaltyOver = boVLRP.getAttribute("penalty_over").getString();
|
||||
BizObject boLRIT = JBOFactory.createBizObjectQuery(LC_RENT_INCOME_TEMP.CLASS_NAME, "select v.sum(penalty_adjust) as v.penalty_adjust from O where flowunid='"+flowunid+"' and plan_id='"+planID+"' group by plan_id")
|
||||
.getSingleResult(false);
|
||||
BigDecimal penaltyAdjustOther = new BigDecimal(penaltyAdjust);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user