2018-11-05 15:22:08 +08:00

67 lines
3.5 KiB
Plaintext

<%@page import="com.amarsoft.app.awe.config.InitDBType"%>
<%@ page contentType="text/html; charset=GBK"%><%@
include file="/Frame/resources/include/include_begin_list.jspf"%>
<%@ page import="com.amarsoft.app.lc.workflow.action.GetFlowAction" %>
<%@ page import="java.util.HashMap" %>
<%@ page import="java.util.List" %>
<%@ page import="java.util.Map" %>
<%@ page import="com.tenwa.comm.util.jboutil.DataOperatorUtil" %><%
String id=CurPage.getParameter("id");
String plannumber = CurPage.getParameter("plannumber");
List<Map<String,String>> list=new ArrayList<Map<String,String>>();
String[] headers = {"期次","计划日期","租金","本金","利息","租金余额","本金余额","利息余额"};
String[] head={"PLAN_LIST","PLAN_DATE","RENT","CORPUS","INTEREST","RENT_OVERAGE","CORPUS_OVERAGE","INTEREST_OVERAGE"};
ASObjectModel doTemp = new ASObjectModel(headers);
ASObjectWindow dwTemp = new ASObjectWindow(CurPage,doTemp,request);
dwTemp.ShowSummary="1"; //汇总
dwTemp.Style="1"; //设置为Grid风格
dwTemp.ReadOnly = "1";//只读模式
String sql="contract_id=:id";
if(plannumber!=null&&plannumber.length()>0&&!"null".equals(plannumber)){
sql+=" and payment_number='"+plannumber+"'";
}
BizObject status=JBOFactory.createBizObjectQuery("jbo.app.tenwa.calc.LC_CALC_CONDITION_STATUS",sql).setParameter("id", id).getSingleResult(false);
if(status==null){
sql="select PLAN_LIST,PLAN_DATE,RENT,CORPUS,INTEREST,RENT RENT_OVERAGE,CORPUS CORPUS_OVERAGE,INTEREST INTEREST_OVERAGE from lc_pay_rent_plan where contract_id='"+id+"'";
if(plannumber!=null&&plannumber.length()>0&&!"null".equals(plannumber)){
sql+=" and payment_number='"+plannumber+"'";
}
sql+=" order by plan_list";
}else{
if("MYSQL".equals(InitDBType.DBTYPE)){
sql="SELECT PLAN_LIST,PLAN_DATE,RENT,CORPUS,INTEREST,RENT-IFNULL(ri.rentincome,0) RENT_OVERAGE,CORPUS-IFNULL(ri.corpusincome,0) CORPUS_OVERAGE,INTEREST-IFNULL(ri.interestincome,0) INTEREST_OVERAGE FROM lc_rent_plan rp"+
" LEFT JOIN (SELECT plan_id,SUM(rent)+sum(interest_adjust) rentincome,SUM(CORPUS) corpusincome,SUM(INTEREST)+sum(interest_adjust) interestincome FROM lc_rent_income GROUP BY plan_id) ri ON rp.id=ri.plan_id where rp.contract_id='"+id+"'";
}
if("ORACLE".equals(InitDBType.DBTYPE)){
sql="SELECT PLAN_LIST,PLAN_DATE,RENT,CORPUS,INTEREST,RENT-NVL(ri.rentincome,0) RENT_OVERAGE,CORPUS-NVL(ri.corpusincome,0) CORPUS_OVERAGE,INTEREST-NVL(ri.interestincome,0) INTEREST_OVERAGE FROM lc_rent_plan rp"+
" LEFT JOIN (SELECT plan_id,SUM(rent)+sum(interest_adjust) rentincome,SUM(CORPUS) corpusincome,SUM(INTEREST)+sum(interest_adjust) interestincome FROM lc_rent_income GROUP BY plan_id) ri ON rp.id=ri.plan_id where rp.contract_id='"+id+"'";
}
if(plannumber!=null&&plannumber.length()>0&&!"null".equals(plannumber)){
sql+=" and rp.payment_number='"+plannumber+"'";
}
sql+=" order by plan_list";
}
JBOTransaction tx=JBOFactory.createJBOTransaction();
Map<String,String> params=new HashMap<String,String>();
list=DataOperatorUtil.getDataBySql(tx, sql, params);
tx.commit();
String[][] displayData = new String[list.size()][headers.length];
for(int i=0;i<displayData.length;i++){
for(int j=0;j<displayData[i].length;j++){
displayData[i][j]=list.get(i).get(head[j]);
}
}
dwTemp.genHTMLObjectWindow(displayData);
String sButtons[][] = {};
%><script type="text/javascript">
var sumCol=[2,3,4,5,6,7];
</script>
<%@ include file="/Frame/resources/include/ui/include_list.jspf"%>
<%@
include file="/Frame/resources/include/include_end.jspf"%>