62 lines
3.7 KiB
Plaintext
62 lines
3.7 KiB
Plaintext
<%@page import="com.amarsoft.app.awe.config.InitDBType"%>
|
|
<%@page import="com.amarsoft.are.jbo.BizObject"%>
|
|
<%@page import="jbo.app.tenwa.calc.VI_LC_RENT_PLAN"%>
|
|
<%@page import="com.amarsoft.are.jbo.JBOFactory"%>
|
|
<%@page import="com.amarsoft.are.jbo.JBOTransaction"%>
|
|
<%@page import="java.math.BigDecimal"%>
|
|
<%@ page contentType="text/html; charset=GBK"%>
|
|
<%@ include file="/IncludeBeginMDAJAX.jsp"%><%
|
|
String flowunid = CurPage.getParameter("flowunid");
|
|
String planIDs = CurPage.getParameter("planIDs");
|
|
String overCorpuss = CurPage.getParameter("overCorpuss");
|
|
String overInterests = CurPage.getParameter("overInterests");
|
|
String overPenaltys = CurPage.getParameter("overPenaltys");
|
|
String cautionDeduction = CurPage.getParameter("cautionDeduction");
|
|
String[] planID = planIDs.split("@");
|
|
String[] overCorpus = overCorpuss.split("@");
|
|
String[] overInterest = overInterests.split("@");
|
|
String[] overPenalty = overPenaltys.split("@");
|
|
boolean flag = true;
|
|
String sql="SELECT case when lcc.CAUTION_DEDUCTION_MONEY-IFNULL(lr.fact_money,0) != "+cautionDeduction+" then 0 else 1 end FROM flow_bussiness_object fbo LEFT JOIN LC_CALC_CONDITION lcc ON lcc.PAYMENT_NUMBER=fbo.flow_key LEFT JOIN(SELECT lr.payment_number,SUM(lr.fact_money) AS fact_money FROM(SELECT lri.payment_number,SUM(IFNULL(lri.RENT,0))+SUM(IFNULL(lri.PENALTY,0)) AS fact_money FROM lc_rent_income lri WHERE lri.ROLL_BACK='0' AND lri.settle_method='settlemethod7' GROUP BY lri.payment_number UNION SELECT lrit.payment_number,SUM(IFNULL(lrit.RENT,0))+SUM(IFNULL(lrit.PENALTY,0)) AS fact_money FROM lc_rent_income_temp lrit WHERE lrit.ROLL_BACK='0' AND lrit.IS_FLOWING='0' AND lrit.SETTLE_METHOD='settlemethod7' GROUP BY lrit.payment_number) AS lr GROUP BY lr.payment_number) AS lr ON lr.payment_number=fbo.flow_key WHERE fbo.flow_unid=:flowunid";
|
|
if(InitDBType.DBTYPE.equals("ORACLE")){
|
|
sql="SELECT case when lcc.CAUTION_DEDUCTION_MONEY-nvl(lr.fact_money,0) != "+cautionDeduction+" then 0 else 1 end FROM flow_bussiness_object fbo LEFT JOIN LC_CALC_CONDITION lcc ON lcc.PAYMENT_NUMBER=fbo.flow_key LEFT JOIN(SELECT lr.payment_number,SUM(lr.fact_money) AS fact_money FROM(SELECT lri.payment_number,SUM(nvl(lri.RENT,0))+SUM(nvl(lri.PENALTY,0)) AS fact_money FROM lc_rent_income lri WHERE lri.ROLL_BACK='0' AND lri.settle_method='settlemethod7' GROUP BY lri.payment_number UNION SELECT lrit.payment_number,SUM(nvl(lrit.RENT,0))+SUM(nvl(lrit.PENALTY,0)) AS fact_money FROM lc_rent_income_temp lrit WHERE lrit.ROLL_BACK='0' AND lrit.IS_FLOWING='0' AND lrit.SETTLE_METHOD='settlemethod7' GROUP BY lrit.payment_number) lr GROUP BY lr.payment_number) AS lr ON lr.payment_number=fbo.flow_key WHERE fbo.flow_unid=:flowunid";
|
|
}
|
|
SqlObject so = new SqlObject(sql);
|
|
so.setParameter("flowunid", flowunid);
|
|
if("0".equals(Sqlca.getString(so))){
|
|
flag = false;
|
|
}
|
|
boolean flagR = true;
|
|
boolean flagP = true;
|
|
for(int i=0;i<planID.length;i++){
|
|
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)){
|
|
flagR = false;
|
|
}
|
|
sql = "select case when penalty_over != " + overPenalty[i]+" then false else true 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){
|
|
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"%> |