Compare commits
10 Commits
39cfe876f9
...
75ba44b242
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
75ba44b242 | ||
|
|
a2ec078ff1 | ||
|
|
77f52d3ed3 | ||
|
|
85d9ceb61c | ||
|
|
902192190d | ||
|
|
408ca1cc76 | ||
|
|
356d4db955 | ||
|
|
fd7a12904f | ||
|
|
17d27d75ba | ||
|
|
93c6a6cd3b |
@ -9,9 +9,9 @@
|
||||
String nodeNo=CurPage.getParameter("NodeNo");
|
||||
ASObjectModel doTemp = new ASObjectModel("LCRentPlanTempList");
|
||||
doTemp.appendJboWhere(" and payment_number='"+plannumber+"'");
|
||||
if(null!=ishistory&&ishistory.equals("true") && !flowNo.equals("RentDormantFlow")){
|
||||
/* if(null!=ishistory&&ishistory.equals("true") && !flowNo.equals("RentDormantFlow")){
|
||||
doTemp.setDataQueryClass("com.tenwa.lease.flow.flowarchive.calcarchive.CalcRentListArachiveShow");
|
||||
}
|
||||
} */
|
||||
CurPage.setAttribute("modelno","rent");
|
||||
ASObjectWindow dwTemp = new ASObjectWindow(CurPage,doTemp,request);
|
||||
dwTemp.Style="1"; //--ÉèÖÃΪGrid·ç¸ñ--
|
||||
|
||||
@ -450,6 +450,10 @@ AsControl.RunJavaMethodSqlca = function (ClassName,MethodName,Args) {
|
||||
return AsControl.GetJavaMethodReturn(AsControl.CallJavaMethod(ClassName,MethodName,Args,"&ArgsObject=Sqlca"),ClassName);
|
||||
};
|
||||
|
||||
AsControl.RunJavaMethodSqlcaCustom = function (ClassName,MethodName,Args) {
|
||||
return AsControl.GetJavaMethodReturn(AsControl.CallJavaMethodCustom(ClassName,MethodName,Args,"&ArgsObject=Sqlca"),ClassName);
|
||||
};
|
||||
|
||||
/**
|
||||
* 运行JBOTransaction Trans参数后台java方法
|
||||
* @param ClassName 类路径字符串,且必须有空构造
|
||||
@ -461,6 +465,10 @@ AsControl.RunJavaMethodTrans = function (ClassName,MethodName,Args) {
|
||||
return AsControl.GetJavaMethodReturn(AsControl.CallJavaMethod(ClassName,MethodName,Args,"&ArgsObject=Trans"),ClassName);
|
||||
};
|
||||
|
||||
AsControl.RunJavaMethodTransCustom = function (ClassName,MethodName,Args) {
|
||||
return AsControl.GetJavaMethodReturn(AsControl.CallJavaMethodCustom(ClassName,MethodName,Args,"&ArgsObject=Trans"),ClassName);
|
||||
};
|
||||
|
||||
/**
|
||||
* 运行后台java方法
|
||||
* @param ClassName 类路径字符串,且必须有空构造
|
||||
@ -522,6 +530,20 @@ AsControl.CallJavaMethod = function (ClassName,MethodName,Args,ArgsObjectText) {
|
||||
}).responseText.trim());
|
||||
};
|
||||
|
||||
AsControl.CallJavaMethodCustom = function (ClassName,MethodName,Args,ArgsObjectText) {
|
||||
return AsControl.dealAjaxText(jQuery.ajax({
|
||||
type: "POST",
|
||||
url: sWebRootPath+"/servlet/run?1=1"+ArgsObjectText,
|
||||
data : {
|
||||
"ClassName":ClassName,
|
||||
"MethodName":MethodName,
|
||||
"Args":Args.replace(/\+/g, '§¨').replace(/\%/g, '§×')
|
||||
},
|
||||
async: false,
|
||||
error: AsControl.ajaxError
|
||||
}).responseText.trim());
|
||||
};
|
||||
|
||||
AsControl.RewriteCallJavaMethod = function (ClassName,MethodName,Args,ArgsObjectText) {
|
||||
if(Args.length>0){
|
||||
Args=Args+AsControl.getParamToFixedParam(Args);
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
function TablePage(tableId,rowCount,displayPageSize,pageCount,curPage){
|
||||
this.tableId = tableId;
|
||||
this.rowCount = rowCount;
|
||||
this.displayPageSize = 10;
|
||||
this.displayPageSize = displayPageSize || 10;
|
||||
this.pageCount = pageCount;
|
||||
this.curPage = curPage+1;
|
||||
//alert(this.curPage);
|
||||
|
||||
@ -1,27 +1,38 @@
|
||||
<%@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 overPenaltys = CurPage.getParameter("overPenaltys");
|
||||
String[] planID = planIDs.split("@");
|
||||
String[] overPenalty = overPenaltys.split("@");
|
||||
boolean flag = true;
|
||||
for(int i=0;i<planID.length;i++){
|
||||
String sql = "select case when penalty_over!='"+overPenalty[i]+"' then 0 else 1 end from vi_lc_rent_plan where id='"+planID[i]+"'";
|
||||
SqlObject so = new SqlObject(sql);
|
||||
String result = Sqlca.getString(so);
|
||||
if("0".equals(result)){
|
||||
flag = false;
|
||||
}
|
||||
}
|
||||
if(!flag){
|
||||
out.println("ERROR");
|
||||
}else{
|
||||
out.println("SUCCESS");
|
||||
}
|
||||
%><%@ include file="/IncludeEndAJAX.jsp"%>
|
||||
<%@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 import="com.tenwa.util.SqlRunnerUtil" %>
|
||||
<%@ page import="com.google.common.collect.ImmutableMap" %>
|
||||
<%@ page import="cn.hutool.db.handler.NumberHandler" %>
|
||||
<%@ page contentType="text/html; charset=GBK" %>
|
||||
<%@ include file="/IncludeBeginMDAJAX.jsp" %>
|
||||
<%
|
||||
String flowunid = CurPage.getParameter("flowunid");
|
||||
String planIDs = CurPage.getParameter("planIDs");
|
||||
String overPenaltys = CurPage.getParameter("overPenaltys");
|
||||
String[] planID = planIDs.split("@");
|
||||
String[] overPenalty = overPenaltys.split("@");
|
||||
boolean flag = true;
|
||||
Map<String, Object> paramMap = new HashMap<>();
|
||||
for (int i = 0; i < planID.length; i++) {
|
||||
paramMap.put("planId", planID[i]);
|
||||
BigDecimal overPenaltyTmp = (BigDecimal) SqlRunnerUtil.query(Sqlca, "flow.PenaltyReductionFlow.queryRentPlanRemainPenalty", paramMap, new NumberHandler());
|
||||
if (new BigDecimal(overPenalty[i]).compareTo(overPenaltyTmp) != 0) {
|
||||
flag = false;
|
||||
}
|
||||
// String sql = "select case when penalty_over!='"+overPenalty[i]+"' then 0 else 1 end from vi_lc_rent_plan where id='"+planID[i]+"'";
|
||||
// SqlObject so = new SqlObject(sql);
|
||||
// String result = Sqlca.getString(so);
|
||||
// if("0".equals(result)){
|
||||
// flag = false;
|
||||
// }
|
||||
}
|
||||
if (!flag) {
|
||||
out.println("ERROR");
|
||||
} else {
|
||||
out.println("SUCCESS");
|
||||
}
|
||||
%>
|
||||
<%@ include file="/IncludeEndAJAX.jsp" %>
|
||||
@ -20,7 +20,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
AsDialog.OpenSelector("SelectPaymentHavePenaltyNew","businessType,"+businessType,"dialogWidth=" + parseInt(window.screen.width * 0.8) + "px dialogHeight=" + parseInt(window.screen.height * 0.6) + "px",function(sReturn){
|
||||
AsDialog.OpenSelector("SelectPaymentHavePenalty","businessType,"+businessType,"dialogWidth=" + parseInt(window.screen.width * 0.8) + "px dialogHeight=" + parseInt(window.screen.height * 0.6) + "px",function(sReturn){
|
||||
if(!sReturn||sReturn=="_CANCEL_"){
|
||||
//alert(getHtmlMessage('1'));//请选择一条信息!
|
||||
return;
|
||||
|
||||
@ -1,72 +1,94 @@
|
||||
<%@page import="java.math.BigDecimal"%>
|
||||
<%@page import="jbo.com.tenwa.entity.comm.flow.FLOW_BUSSINESS_OBJECT"%>
|
||||
<%@page import="jbo.app.tenwa.calc.LC_EBANK_PROCESS"%>
|
||||
<%@page import="jbo.app.tenwa.calc.LC_EBANK_TEMP"%>
|
||||
<%@ page contentType="text/html; charset=GBK"%>
|
||||
<%@ include file="/Frame/resources/include/include_begin_list.jspf"%><%
|
||||
|
||||
String phaseNo = CurPage.getParameter("PhaseNo");
|
||||
String flowunid = CurPage.getParameter("FlowUnid");
|
||||
String rightType = CurPage.getParameter("RightType");
|
||||
String paymentNumber = JBOFactory.createBizObjectQuery(FLOW_BUSSINESS_OBJECT.CLASS_NAME, "flow_unid=:flowunid")
|
||||
.setParameter("flowunid", flowunid).getSingleResult(false).getAttribute("flow_key").getString();
|
||||
ASObjectModel doTemp = new ASObjectModel("VILCRentPlanForReductionList");
|
||||
ASObjectWindow dwTemp = new ASObjectWindow(CurPage,doTemp,request);
|
||||
dwTemp.Style="1"; //--设置为Grid风格--
|
||||
dwTemp.ReadOnly = "1"; //只读模式
|
||||
dwTemp.MultiSelect = true;
|
||||
if("ReadOnly".equals(rightType)){
|
||||
dwTemp.MultiSelect = false;
|
||||
}
|
||||
dwTemp.setPageSize(10);
|
||||
dwTemp.genHTMLObjectWindow(paymentNumber);
|
||||
<%@page import="java.math.BigDecimal" %>
|
||||
<%@page import="jbo.com.tenwa.entity.comm.flow.FLOW_BUSSINESS_OBJECT" %>
|
||||
<%@page import="jbo.app.tenwa.calc.LC_EBANK_PROCESS" %>
|
||||
<%@page import="jbo.app.tenwa.calc.LC_EBANK_TEMP" %>
|
||||
<%@ page import="cn.hutool.core.util.StrUtil" %>
|
||||
<%@ page contentType="text/html; charset=GBK" %>
|
||||
<%@ include file="/Frame/resources/include/include_begin_list.jspf" %>
|
||||
<%
|
||||
|
||||
//0、是否展示 1、 权限控制 2、 展示类型 3、按钮显示名称 4、按钮解释文字 5、按钮触发事件代码 6、 7、 8、 9、图标,CSS层叠样式 10、风格
|
||||
String sButtons[][] = {
|
||||
{"ReadOnly".equals(rightType)?"false":"true","","Button","生成罚息减免","生成罚息减免","createPenaltyAdjust()","","","","btn_icon_add",""}
|
||||
};
|
||||
%><%@include file="/Frame/resources/include/ui/include_list.jspf"%>
|
||||
String phaseNo = CurPage.getParameter("PhaseNo");
|
||||
String flowunid = CurPage.getParameter("FlowUnid");
|
||||
String rightType = CurPage.getParameter("RightType");
|
||||
String paymentNumber = JBOFactory.createBizObjectQuery(FLOW_BUSSINESS_OBJECT.CLASS_NAME, "flow_unid=:flowunid")
|
||||
.setParameter("flowunid", flowunid).getSingleResult(false).getAttribute("flow_key").getString();
|
||||
CustomASObjectModel doTemp = new CustomASObjectModel("VILCRentPlanForReductionList", "flow.PenaltyReductionFlow.queryRentPlanList" , false);
|
||||
// ASObjectModel doTemp = new ASObjectModel("VILCRentPlanForReductionList");
|
||||
// doTemp.setDataQueryClass("com.tenwa.flow.rent.penalty_reduction.page.RentPlanListHtmlGenerator");
|
||||
ASObjectWindow dwTemp = new ASObjectWindow(CurPage, doTemp, request);
|
||||
dwTemp.Style = "1"; //--设置为Grid风格--
|
||||
dwTemp.ReadOnly = "1"; //只读模式
|
||||
dwTemp.MultiSelect = true;
|
||||
if ("ReadOnly".equals(rightType)) {
|
||||
dwTemp.MultiSelect = false;
|
||||
}
|
||||
dwTemp.setPageSize(Integer.valueOf(StrUtil.blankToDefault(pageSize, "10")));
|
||||
dwTemp.genHTMLObjectWindow(paymentNumber);
|
||||
|
||||
//0、是否展示 1、 权限控制 2、 展示类型 3、按钮显示名称 4、按钮解释文字 5、按钮触发事件代码 6、 7、 8、 9、图标,CSS层叠样式 10、风格
|
||||
String sButtons[][] = {
|
||||
{"ReadOnly".equals(rightType) ? "false" : "true", "", "Button", "生成罚息减免", "生成罚息减免", "createPenaltyAdjust()", "", "", "", "btn_icon_add", ""}
|
||||
};
|
||||
%>
|
||||
<%@include file="/Frame/resources/include/ui/include_list.jspf" %>
|
||||
<script type="text/javascript">
|
||||
function createPenaltyAdjust(){
|
||||
var planIDs = getItemValueArray(0,"ID")+","+TablePage.getCheckedItemValueArrayWithOtherPage("ID",s_c_p[0]);
|
||||
if(planIDs == ","){
|
||||
alert("请选中一行数据!");
|
||||
return;
|
||||
}
|
||||
var overPenaltys = getItemValueArray(0,"PENALTY_OVER")+","+TablePage.getCheckedItemValueArrayWithOtherPage("PENALTY_OVER",s_c_p[0]);
|
||||
var planLists = getItemValueArray(0,"PLAN_LIST")+","+TablePage.getCheckedItemValueArrayWithOtherPage("PLAN_LIST",s_c_p[0]);
|
||||
planIDs = planIDs.replace(/,/ig,"@");
|
||||
overPenaltys = overPenaltys.replace(/,/ig,"@");
|
||||
var sReturn = AsControl.RunJsp("/Tenwa/Lease/Flow/Rent/PenaltyReduction/CheckPlanOverMoney.jsp","planIDs="+planIDs+"&flowunid=<%=flowunid%>&overPenaltys="+overPenaltys);
|
||||
if("ERROR" == sReturn){
|
||||
if(confirm("罚息余额已产生变化,是否以最新的余额自动生成记录?")){
|
||||
var sReturn = RunJavaMethodTrans("com.tenwa.flow.rent.rentincome.RentIncomeMethod","setPenaltyDataToRentIncome","planIDs="+planIDs+",flowunid=<%=flowunid%>,isChanged=Y");
|
||||
if(sReturn == "SUCCESS"){
|
||||
planLists = planLists.split(",");
|
||||
var planList = "";
|
||||
for(var i=0;i<planLists.length;i++){
|
||||
planList += ",【"+planLists[i]+"】";
|
||||
}
|
||||
planList = planList.substring(1);
|
||||
alert("计划期项为"+planList+"的数据已添加到罚息减免计划中!");
|
||||
reloadSelf();
|
||||
}
|
||||
}else{
|
||||
reloadSelf();
|
||||
}
|
||||
}else{
|
||||
var sReturn = RunJavaMethodTrans("com.tenwa.flow.rent.rentincome.RentIncomeMethod","setPenaltyDataToRentIncome","planIDs="+planIDs+",overPenaltys="+overPenaltys+",flowunid=<%=flowunid%>,isChanged=N");
|
||||
if(sReturn == "SUCCESS"){
|
||||
planLists = planLists.split(",");
|
||||
var planList = "";
|
||||
for(var i=0;i<planLists.length;i++){
|
||||
planList += ",【"+planLists[i]+"】";
|
||||
}
|
||||
planList = planList.substring(1);
|
||||
alert("计划期项为"+planList+"的数据已添加到罚息减免计划中!");
|
||||
reloadSelf();
|
||||
}
|
||||
}
|
||||
}
|
||||
function createPenaltyAdjust() {
|
||||
var planIDs = getItemValueArray(0, "ID") + "," + TablePage.getCheckedItemValueArrayWithOtherPage("ID", s_c_p[0]);
|
||||
if (planIDs == ",") {
|
||||
alert("请选中一行数据!");
|
||||
return;
|
||||
}
|
||||
var overPenaltys = getItemValueArray(0, "PENALTY_OVER") + "," + TablePage.getCheckedItemValueArrayWithOtherPage("PENALTY_OVER", s_c_p[0]);
|
||||
var planLists = getItemValueArray(0, "PLAN_LIST") + "," + TablePage.getCheckedItemValueArrayWithOtherPage("PLAN_LIST", s_c_p[0]);
|
||||
|
||||
let params = {
|
||||
flowunid: '<%=flowunid%>',
|
||||
paymentNumber: '<%=paymentNumber%>',
|
||||
planLists: planLists
|
||||
};
|
||||
console.info('AsControl', AsControl.RunJavaMethodSqlcaCustom);
|
||||
let sReturn = AsControl.RunJavaMethodSqlcaCustom("com.tenwa.flow.rent.penalty_reduction_flow.PenaltyReductionFlowAction", "checkPlanIsAdded", JSON.stringify({params: JSON.stringify(params)}));
|
||||
if(sReturn !== "SUCCESS") {
|
||||
alert(sReturn.substring(6));
|
||||
return;
|
||||
}
|
||||
|
||||
planIDs = planIDs.replace(/,/ig, "@");
|
||||
overPenaltys = overPenaltys.replace(/,/ig, "@");
|
||||
sReturn = AsControl.RunJsp("/Tenwa/Lease/Flow/Rent/PenaltyReduction/CheckPlanOverMoney.jsp", "planIDs=" + planIDs + "&flowunid=<%=flowunid%>&overPenaltys=" + overPenaltys);
|
||||
if ("ERROR" == sReturn) {
|
||||
if (confirm("罚息余额已产生变化,是否以最新的余额自动生成记录?")) {
|
||||
sReturn = RunJavaMethodTrans("com.tenwa.flow.rent.rentincome.RentIncomeMethod", "setPenaltyDataToRentIncome", "planIDs=" + planIDs + ",flowunid=<%=flowunid%>,isChanged=Y");
|
||||
if (sReturn == "SUCCESS") {
|
||||
planLists = planLists.split(",");
|
||||
var planList = "";
|
||||
for (var i = 0; i < planLists.length; i++) {
|
||||
if(planLists[i]) {
|
||||
planList += ",【" + planLists[i] + "】";
|
||||
}
|
||||
}
|
||||
planList = planList.substring(1);
|
||||
alert("计划期项为" + planList + "的数据添加到罚息减免明细成功!");
|
||||
reloadSelf();
|
||||
}
|
||||
} else {
|
||||
reloadSelf();
|
||||
}
|
||||
} else {
|
||||
sReturn = RunJavaMethodTrans("com.tenwa.flow.rent.rentincome.RentIncomeMethod", "setPenaltyDataToRentIncome", "planIDs=" + planIDs + ",overPenaltys=" + overPenaltys + ",flowunid=<%=flowunid%>,isChanged=N");
|
||||
if (sReturn == "SUCCESS") {
|
||||
planLists = planLists.split(",");
|
||||
var planList = "";
|
||||
for (var i = 0; i < planLists.length; i++) {
|
||||
if(planLists[i]) {
|
||||
planList += ",【" + planLists[i] + "】";
|
||||
}
|
||||
}
|
||||
planList = planList.substring(1);
|
||||
alert("计划期项为" + planList + "的数据添加到罚息减免明细成功!");
|
||||
reloadSelf();
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<%@ include file="/Frame/resources/include/include_end.jspf"%>
|
||||
<%@ include file="/Frame/resources/include/include_end.jspf" %>
|
||||
@ -1,57 +1,76 @@
|
||||
<%@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 factDate = CurPage.getParameter("factDate");
|
||||
String planIDs = CurPage.getParameter("planIDs");
|
||||
String overCorpuss = CurPage.getParameter("overCorpuss");
|
||||
String overInterests = CurPage.getParameter("overInterests");
|
||||
String overPenaltys = CurPage.getParameter("overPenaltys");
|
||||
String mayopeMoney = CurPage.getParameter("mayopeMoney");
|
||||
String[] planID = planIDs.split("@");
|
||||
String[] overCorpus = overCorpuss.split("@");
|
||||
String[] overInterest = overInterests.split("@");
|
||||
String[] overPenalty = overPenaltys.split("@");
|
||||
boolean flag = true;
|
||||
SqlObject so = new SqlObject("select case when mayope_money != "+mayopeMoney+" then 0 else 1 end from lc_ebank_temp where flowunid='"+flowunid+"'");
|
||||
if("0".equals(Sqlca.getString(so))){
|
||||
flag = false;
|
||||
}
|
||||
boolean flagR = true;
|
||||
boolean flagP = true;
|
||||
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)){
|
||||
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)){
|
||||
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"%>
|
||||
<%@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 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" %>
|
||||
<%
|
||||
String flowunid = CurPage.getParameter("flowunid");
|
||||
String factDate = CurPage.getParameter("factDate");
|
||||
String planIDs = CurPage.getParameter("planIDs");
|
||||
String overCorpuss = CurPage.getParameter("overCorpuss");
|
||||
String overInterests = CurPage.getParameter("overInterests");
|
||||
String overPenaltys = CurPage.getParameter("overPenaltys");
|
||||
String mayopeMoney = CurPage.getParameter("mayopeMoney");
|
||||
String[] planID = planIDs.split("@");
|
||||
String[] overCorpus = overCorpuss.split("@");
|
||||
String[] overInterest = overInterests.split("@");
|
||||
String[] overPenalty = overPenaltys.split("@");
|
||||
boolean flag = true;
|
||||
SqlObject so = new SqlObject("select case when mayope_money != " + mayopeMoney + " then 0 else 1 end from lc_ebank_temp where flowunid='" + flowunid + "'");
|
||||
if ("0".equals(Sqlca.getString(so))) {
|
||||
flag = false;
|
||||
}
|
||||
boolean flagR = true;
|
||||
boolean flagP = true;
|
||||
Map<String, Object> sqlParamMap = new HashMap<>();
|
||||
for (int i = 0; i < planID.length; i++) {
|
||||
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;
|
||||
}
|
||||
// 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) {
|
||||
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.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"/>
|
||||
|
||||
BIN
WebContent/WEB-INF/lib/fenix-2.7.0.jar
Normal file
BIN
WebContent/WEB-INF/lib/fenix-2.7.0.jar
Normal file
Binary file not shown.
BIN
WebContent/WEB-INF/lib/hibernate-core-5.6.14.Final.jar
Normal file
BIN
WebContent/WEB-INF/lib/hibernate-core-5.6.14.Final.jar
Normal file
Binary file not shown.
BIN
WebContent/WEB-INF/lib/hutool-all-5.8.34.jar
Normal file
BIN
WebContent/WEB-INF/lib/hutool-all-5.8.34.jar
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
WebContent/WEB-INF/lib/javassist-3.28.0-GA.jar
Normal file
BIN
WebContent/WEB-INF/lib/javassist-3.28.0-GA.jar
Normal file
Binary file not shown.
BIN
WebContent/WEB-INF/lib/javax.persistence-api-2.2.jar
Normal file
BIN
WebContent/WEB-INF/lib/javax.persistence-api-2.2.jar
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
WebContent/WEB-INF/lib/jaxen-1.2.0.jar
Normal file
BIN
WebContent/WEB-INF/lib/jaxen-1.2.0.jar
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
WebContent/WEB-INF/lib/mvel2-2.5.2.Final.jar
Normal file
BIN
WebContent/WEB-INF/lib/mvel2-2.5.2.Final.jar
Normal file
Binary file not shown.
@ -476,6 +476,15 @@
|
||||
</init-param>
|
||||
<load-on-startup>1</load-on-startup>
|
||||
</servlet>
|
||||
<servlet>
|
||||
<servlet-name>InitCustomConfig</servlet-name>
|
||||
<servlet-class>com.amarsoft.app.awe.config.InitCustomConfig</servlet-class>
|
||||
<init-param>
|
||||
<param-name>shutdown-on-unload</param-name>
|
||||
<param-value>true</param-value>
|
||||
</init-param>
|
||||
<load-on-startup>2</load-on-startup>
|
||||
</servlet>
|
||||
<servlet>
|
||||
<servlet-name>QuartzInitializer</servlet-name>
|
||||
<servlet-class>com.tenwa.quartz.MyQuartzInitializerServlet</servlet-class>
|
||||
|
||||
@ -5,12 +5,14 @@ import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
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.tenwa.comm.exception.BusinessException;
|
||||
import com.tenwa.comm.util.jboutil.DataOperatorUtil;
|
||||
import com.tenwa.reckon.bean.ConditionBean;
|
||||
import com.tenwa.reckon.bean.FundRentPlanBean;
|
||||
import com.tenwa.reckon.bean.TabCalBean;
|
||||
@ -95,9 +97,20 @@ public abstract class FundRentPlanExecutor {
|
||||
String Sql = "INSERT INTO " + tcb.getRentPlan_tb().substring(tcb.getRentPlan_tb().lastIndexOf(".") + 1) + " ("
|
||||
+ "id, flowunid, " + tcb.getPlanCName() + ", plan_list, "
|
||||
+ "plan_date, INTEREST_DATE, plan_status, rent, corpus, "
|
||||
+ "year_rate, interest, all_remain_corpus, CORPUS_BUSINESS, INTEREST_BUSINESS) "
|
||||
+ " VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
|
||||
+ "year_rate, interest, all_remain_corpus, CORPUS_BUSINESS, INTEREST_BUSINESS,PROJECT_ID,CONTRACT_ID,PROJECT_PLAN_NUMBER,CONTRACT_PLAN_NUMBER) "
|
||||
+ " VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
|
||||
PreparedStatement ps = null;
|
||||
|
||||
String projectId = null;
|
||||
String projectPlanNumber = null;
|
||||
String contractPlanNumber = null;
|
||||
String PPCSql = " select PROJECT_ID,PROJECT_PLAN_NUMBER,CONTRACT_PLAN_NUMBER from lc_calc_condition_temp where FLOWUNID='"+tcb.getDocId()+"'";
|
||||
List<Map<String, String>> PPCSqldata = DataOperatorUtil.getDataBySql(PPCSql , tran);
|
||||
if( PPCSqldata!=null && PPCSqldata.size()>0 ) {
|
||||
projectId = PPCSqldata.get(0).get("PROJECT_ID");
|
||||
projectPlanNumber = PPCSqldata.get(0).get("PROJECT_PLAN_NUMBER");
|
||||
contractPlanNumber = PPCSqldata.get(0).get("CONTRACT_PLAN_NUMBER");
|
||||
}
|
||||
try {
|
||||
ps = conn.prepareStatement(Sql);
|
||||
for(int i = 0; i < rent_list.size(); i ++) {
|
||||
@ -115,6 +128,10 @@ public abstract class FundRentPlanExecutor {
|
||||
ps.setString(12, NumberUtils.nullToZero(corpusOverage_list.get(i)));
|
||||
ps.setString(13, fpb.getColumn_1().get(i));
|
||||
ps.setString(14, fpb.getColumn_2().get(i));
|
||||
ps.setString(15, projectId );
|
||||
ps.setString(16, tcb.getCb().getContractId() );
|
||||
ps.setString(17, projectPlanNumber);
|
||||
ps.setString(18, contractPlanNumber);
|
||||
ps.addBatch();
|
||||
startList++;
|
||||
}
|
||||
|
||||
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>
|
||||
133
config/fenix/flow/PenaltyReductionFlow.xml
Normal file
133
config/fenix/flow/PenaltyReductionFlow.xml
Normal file
@ -0,0 +1,133 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<fenixs namespace="flow.PenaltyReductionFlow">
|
||||
<!-- 审批页面-租金回笼计划 -->
|
||||
<fenix id="queryRentPlanList">
|
||||
select tt.*,
|
||||
tt.rent - tt.fact_rent as rent_over,
|
||||
tt.corpus - tt.fact_corpus - tt.corpus_adjust as corpus_over,
|
||||
tt.interest - tt.fact_interest - tt.interest_adjust as interest_over,
|
||||
tt.penalty - tt.fact_penalty - tt.penalty_adjust as penalty_over,
|
||||
case
|
||||
when tt.rent = tt.fact_rent and tt.penalty = tt.fact_penalty + tt.penalty_adjust then '已回笼'
|
||||
when tt.fact_rent > 0 then '部分回笼'
|
||||
else '未回笼' end as planstatus
|
||||
from (select lcf.id as id,
|
||||
lbc.project_id as project_id,
|
||||
lbc.id as contract_id,
|
||||
lbc.contract_status as contract_status,
|
||||
lbc.businesstype as businesstype,
|
||||
lbc.subjectid as subjectid,
|
||||
lbc.distributor_id as distributor_id,
|
||||
lbc.contract_number as contract_number,
|
||||
lcf.payment_number as payment_number,
|
||||
ifnull(lbu.customername, '') as customername,
|
||||
lbc.project_name as project_name,
|
||||
lcf.plan_list as plan_list,
|
||||
lcf.plan_date as plan_date,
|
||||
lcf.rent as rent,
|
||||
lcf.corpus as corpus,
|
||||
lcf.interest as interest,
|
||||
getrentpenalty(lcf.payment_number, lcf.plan_list, date_format(now(), '%Y/%m/%d')) as penalty,
|
||||
round(ifnull(lcfd.rent, 0) + ifnull(lcfi.rent, 0), 2) as fact_rent,
|
||||
round(ifnull(lcfd.corpus, 0) + ifnull(lcfi.corpus, 0), 2) as fact_corpus,
|
||||
round(ifnull(lcfd.interest, 0) + ifnull(lcfi.interest, 0), 2) as fact_interest,
|
||||
round(ifnull(lcfd.penalty, 0) + ifnull(lcfi.penalty, 0), 2) as fact_penalty,
|
||||
round(ifnull(lcfd.corpus_adjust, 0) + ifnull(lcfi.corpus_adjust, 0), 2) as corpus_adjust,
|
||||
round(ifnull(lcfd.interest_adjust, 0) + ifnull(lcfi.interest_adjust, 0), 2) as interest_adjust,
|
||||
round(ifnull(lcfd.penalty_adjust, 0) + ifnull(lcfi.penalty_adjust, 0), 2) as penalty_adjust
|
||||
from lc_rent_plan lcf
|
||||
left join lb_contract_info lbc
|
||||
on lcf.contract_id = lbc.id
|
||||
left join lc_calc_condition_status lccs
|
||||
on lccs.payment_number = lcf.payment_number
|
||||
left join lb_union_lessee_transfer lbu
|
||||
on lcf.contract_id = lbu.contract_id
|
||||
left join (select lri.payment_number as payment_number,
|
||||
lri.plan_list as plan_list,
|
||||
lri.plan_id as plan_id,
|
||||
sum(lri.rent) as rent,
|
||||
sum(lri.corpus) as corpus,
|
||||
sum(lri.interest) as interest,
|
||||
sum(lri.penalty) as penalty,
|
||||
sum(lri.corpus_adjust) as corpus_adjust,
|
||||
sum(lri.interest_adjust) as interest_adjust,
|
||||
sum(lri.penalty_adjust) as penalty_adjust
|
||||
from lc_rent_income lri
|
||||
where payment_number = #{paramstr}
|
||||
and lri.roll_back = '0'
|
||||
group by lri.payment_number, lri.plan_list
|
||||
) lcfd
|
||||
on lcf.payment_number = lcfd.payment_number and
|
||||
lcf.plan_list = lcfd.plan_list
|
||||
left join (select lrit.payment_number as payment_number,
|
||||
lrit.plan_list as plan_list,
|
||||
sum(lrit.rent) as rent,
|
||||
sum(lrit.corpus) as corpus,
|
||||
sum(lrit.interest) as interest,
|
||||
sum(lrit.penalty) as penalty,
|
||||
sum(lrit.corpus_adjust) as corpus_adjust,
|
||||
sum(lrit.interest_adjust) as interest_adjust,
|
||||
sum(lrit.penalty_adjust) as penalty_adjust
|
||||
from lc_rent_income_temp lrit
|
||||
where payment_number = #{paramstr}
|
||||
and lrit.is_flowing = 0
|
||||
and lrit.roll_back = '0'
|
||||
group by lrit.payment_number, lrit.plan_list
|
||||
) lcfi
|
||||
on lcf.payment_number = lcfi.payment_number and lcf.plan_list = lcfi.plan_list
|
||||
where lcf.payment_number = #{paramstr}
|
||||
) tt
|
||||
where tt.rent > tt.fact_rent or tt.penalty > tt.fact_penalty
|
||||
order by tt.payment_number, tt.plan_list
|
||||
</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 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 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>
|
||||
28
src/com/amarsoft/app/awe/config/InitCustomConfig.java
Normal file
28
src/com/amarsoft/app/awe/config/InitCustomConfig.java
Normal file
@ -0,0 +1,28 @@
|
||||
package com.amarsoft.app.awe.config;
|
||||
|
||||
import com.blinkfox.fenix.config.FenixConfig;
|
||||
import com.blinkfox.fenix.config.FenixConfigManager;
|
||||
|
||||
import javax.servlet.ServletConfig;
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServlet;
|
||||
|
||||
/**
|
||||
* @program: apzl_leasing
|
||||
* @description:
|
||||
* @author: À½Ü
|
||||
* @create: 2024-12-11 13:53
|
||||
*/
|
||||
public class InitCustomConfig extends HttpServlet {
|
||||
|
||||
public void init(ServletConfig cfg) throws ServletException {
|
||||
try {
|
||||
FenixConfig fenixConfig = new FenixConfig().setDebug(true).setPrintBanner(true).setPrintSqlInfo(true);
|
||||
FenixConfigManager.getInstance().initLoad(fenixConfig);
|
||||
}catch (Throwable e0) {
|
||||
e0.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
@ -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);
|
||||
|
||||
64
src_core/com/tenwa/util/JsonUtil.java
Normal file
64
src_core/com/tenwa/util/JsonUtil.java
Normal file
@ -0,0 +1,64 @@
|
||||
package com.tenwa.util;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import com.fasterxml.jackson.databind.DeserializationFeature;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.databind.SerializationFeature;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.text.SimpleDateFormat;
|
||||
|
||||
/**
|
||||
* @program: xdzl-uifm
|
||||
* @description:
|
||||
* @author: 李超杰
|
||||
* @create: 2023-07-12 11:36
|
||||
*/
|
||||
public class JsonUtil {
|
||||
|
||||
private static ObjectMapper objectMapper = new ObjectMapper();
|
||||
static {
|
||||
objectMapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);
|
||||
objectMapper.enable(DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT);
|
||||
// objectMapper.registerModule(new JavaTimeModule());
|
||||
objectMapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false);
|
||||
objectMapper.setDateFormat(new SimpleDateFormat("yyyy-MM-dd"));
|
||||
}
|
||||
|
||||
public static ObjectMapper getObjectMapper() {
|
||||
return objectMapper;
|
||||
}
|
||||
|
||||
public static String convertToJson(Object obj) {
|
||||
try {
|
||||
return objectMapper.writeValueAsString(obj);
|
||||
} catch (JsonProcessingException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public static <T> T convertToObj(String jsonStr, Class<T> tClass) {
|
||||
try {
|
||||
return objectMapper.readValue(jsonStr, tClass);
|
||||
} catch (JsonProcessingException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public static <T> T convertToObj(String xmlStr, TypeReference<T> typeReference) {
|
||||
try {
|
||||
return objectMapper.readValue(xmlStr, typeReference);
|
||||
} catch (JsonProcessingException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public static <T> T convertToObj(Object obj, Class<T> tClass) {
|
||||
return objectMapper.convertValue(obj, tClass);
|
||||
}
|
||||
|
||||
public static <T> T convertToObj(Object obj, TypeReference<T> typeReference) {
|
||||
return objectMapper.convertValue(obj, typeReference);
|
||||
}
|
||||
}
|
||||
122
src_core/com/tenwa/util/SqlRunnerUtil.java
Normal file
122
src_core/com/tenwa/util/SqlRunnerUtil.java
Normal file
@ -0,0 +1,122 @@
|
||||
package com.tenwa.util;
|
||||
|
||||
import cn.hutool.db.*;
|
||||
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;
|
||||
import com.blinkfox.fenix.core.Fenix;
|
||||
|
||||
import java.sql.SQLException;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @program: apzl_leasing
|
||||
* @description:
|
||||
* @author: 李超杰
|
||||
* @create: 2024-12-12 09:23
|
||||
*/
|
||||
public class SqlRunnerUtil {
|
||||
|
||||
private static SqlConnRunner sqlConnRunner = DbUtil.newSqlConnRunner(new MysqlDialect());
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param transaction
|
||||
* @param fullFenixId
|
||||
* @param paramMap
|
||||
* @param page
|
||||
* @return
|
||||
* @throws SQLException
|
||||
*/
|
||||
public static PageResult<Entity> page(Transaction transaction, String fullFenixId, Map<String, Object> paramMap, Page page) throws SQLException {
|
||||
SqlInfo xmlSqlInfo = Fenix.getXmlSqlInfo(fullFenixId, paramMap);
|
||||
Connection connection = transaction.getConnection();
|
||||
SqlBuilder sqlBuilder = SqlBuilder.of(xmlSqlInfo.getSql());
|
||||
sqlBuilder.addParams(xmlSqlInfo.getParams());
|
||||
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
|
||||
* @param <T>
|
||||
* @return
|
||||
* @throws SQLException
|
||||
*/
|
||||
public static <T> T query(Transaction transaction, String fullFenixId, Map<String, Object> paramMap, RsHandler<T> rsh) throws SQLException {
|
||||
SqlInfo xmlSqlInfo = Fenix.getXmlSqlInfo(fullFenixId, paramMap);
|
||||
Connection connection = transaction.getConnection();
|
||||
SqlBuilder sqlBuilder = SqlBuilder.of(xmlSqlInfo.getSql());
|
||||
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;
|
||||
}
|
||||
}
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,73 @@
|
||||
package com.tenwa.flow.rent.penalty_reduction_flow;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.db.Entity;
|
||||
import cn.hutool.db.handler.EntityListHandler;
|
||||
import cn.hutool.db.sql.SqlBuilder;
|
||||
import cn.hutool.db.sql.SqlExecutor;
|
||||
import com.amarsoft.awe.util.Transaction;
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import com.tenwa.util.JsonUtil;
|
||||
|
||||
import java.sql.SQLException;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @program: apzl_leasing
|
||||
* @description:
|
||||
* @author: 李超杰
|
||||
* @create: 2024-12-18 11:04
|
||||
*/
|
||||
public class PenaltyReductionFlowAction {
|
||||
|
||||
private String params;
|
||||
|
||||
|
||||
/**
|
||||
* 检查罚息减免租金计划是否已提交
|
||||
* @param transaction
|
||||
* @return
|
||||
* @throws SQLException
|
||||
*/
|
||||
public String checkPlanIsAdded(Transaction transaction) throws SQLException {
|
||||
Map<String, Object> paramMap = JsonUtil.convertToObj(this.params, new TypeReference<Map<String, Object>>() {
|
||||
});
|
||||
String flowunid = Objects.toString(paramMap.get("flowunid"));
|
||||
if (StrUtil.isBlank(flowunid)) {
|
||||
return "ERROR@flowunid不能为空";
|
||||
}
|
||||
String paymentNumber = Objects.toString(paramMap.get("paymentNumber"));
|
||||
if (StrUtil.isBlank(paymentNumber)) {
|
||||
return "ERROR@paymentNumber不能为空";
|
||||
}
|
||||
|
||||
String planList = Objects.toString(paramMap.get("planLists"), "");
|
||||
Object[] planListArr = Arrays.stream(planList.split(",")).filter(StrUtil::isNotBlank).map(Integer::parseInt).toArray();
|
||||
if (planListArr.length == 0) {
|
||||
return "ERROR@planListStr不能为空";
|
||||
}
|
||||
|
||||
Map<String, Object> sqlParams = new HashMap<>();
|
||||
sqlParams.put("flowunid", flowunid);
|
||||
sqlParams.put("paymentNumber", paymentNumber);
|
||||
sqlParams.put("planList", planListArr);
|
||||
String querySql = "select plan_list from lc_rent_income_temp where flowunid = :flowunid and payment_number = :paymentNumber and plan_list in (:planList)";
|
||||
SqlBuilder sqlBuilder = SqlBuilder.of(querySql);
|
||||
sqlBuilder.addParams(sqlParams);
|
||||
List<Entity> entityList = SqlExecutor.query(transaction.getConnection(), sqlBuilder, new EntityListHandler());
|
||||
if (entityList.size() > 0) {
|
||||
String errorPlanListStr = entityList.stream().map(entity -> "【" + entity.getStr("plan_list") + "】").collect(Collectors.joining());
|
||||
return "ERROR@租金计划期次" + errorPlanListStr + "已添加,请勿重复添加!";
|
||||
}
|
||||
return "SUCCESS";
|
||||
}
|
||||
|
||||
public String getParams() {
|
||||
return params;
|
||||
}
|
||||
|
||||
public void setParams(String params) {
|
||||
this.params = params;
|
||||
}
|
||||
}
|
||||
@ -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);
|
||||
|
||||
@ -8,9 +8,15 @@ 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;
|
||||
import org.springframework.web.context.ContextLoader;
|
||||
import org.springframework.web.context.WebApplicationContext;
|
||||
|
||||
@ -199,19 +205,19 @@ public class RentIncomeMethod {
|
||||
/**
|
||||
* 租金核销
|
||||
*/
|
||||
public String setRentDataToRentIncome(JBOTransaction tx) throws JBOException{
|
||||
try{
|
||||
public String setRentDataToRentIncome(JBOTransaction tx) throws JBOException {
|
||||
try {
|
||||
boolean flag = false;
|
||||
if("Y".equals(isChanged)){
|
||||
if ("Y".equals(isChanged)) {
|
||||
flag = true;
|
||||
}
|
||||
BigDecimal bel = new BigDecimal(balance == null?"0":balance); //可核销金额
|
||||
BigDecimal bel = new BigDecimal(balance == null ? "0" : balance); //可核销金额
|
||||
BigDecimal allFactMoney = bel;
|
||||
BizObjectManager bomEb = JBOFactory.getBizObjectManager(LC_EBANK_TEMP.CLASS_NAME);
|
||||
tx.join(bomEb);
|
||||
BizObject boEb = bomEb.createQuery("FLOWUNID=:FLOWUNID")
|
||||
.setParameter("FLOWUNID", flowunid).getSingleResult(true);
|
||||
if(flag){
|
||||
if (flag) {
|
||||
bel = new BigDecimal(boEb.getAttribute("MAYOPE_MONEY").getString());
|
||||
allFactMoney = bel;
|
||||
}
|
||||
@ -219,36 +225,39 @@ public class RentIncomeMethod {
|
||||
String[] corpuss = new String[ids.length];
|
||||
String[] interests = new String[ids.length];
|
||||
String[] Penaltys = new String[ids.length];
|
||||
if(overCorpuss != null){
|
||||
if (overCorpuss != null) {
|
||||
corpuss = overCorpuss.split("@");
|
||||
interests = overInterests.split("@");
|
||||
Penaltys = overPenaltys.split("@");
|
||||
}
|
||||
String factDate = boEb.getAttribute("FACT_DATE").getString();
|
||||
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])
|
||||
.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){
|
||||
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");
|
||||
if (f.compareTo(new SimpleDateFormat("yyyy/MM/dd").parse(planDate)) > 0) {
|
||||
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");
|
||||
}
|
||||
}else{
|
||||
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");
|
||||
} else {
|
||||
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");
|
||||
}
|
||||
}
|
||||
if("penalty_income".equals(penaltyRule)){
|
||||
if ("penalty_income".equals(penaltyRule)) {
|
||||
Penaltys[i] = "0.00";
|
||||
}
|
||||
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();
|
||||
boLORL.setAttributeValue("ID", UUIDUtil.getUUID());
|
||||
boLORL.setAttributeValue("PAYMENT_NUMBER", boVLRP.getAttribute("PAYMENT_NUMBER").getString());
|
||||
@ -256,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();
|
||||
@ -275,54 +285,54 @@ public class RentIncomeMethod {
|
||||
.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])
|
||||
.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("CHARGE_WAY", "Collection");
|
||||
boLRIT.setAttributeValue("HIRE_OBJECT", boEb.getAttribute("CLIENT_NAME").getString());
|
||||
BigDecimal money;
|
||||
if(!flag){
|
||||
if (!flag) {
|
||||
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);
|
||||
boLRIT.setAttributeValue("RENT", new BigDecimal(corpuss[i]).add(new BigDecimal(interests[i])));
|
||||
boLRIT.setAttributeValue("CORPUS", new BigDecimal(corpuss[i]));
|
||||
boLRIT.setAttributeValue("INTEREST", new BigDecimal(interests[i]));
|
||||
boLRIT.setAttributeValue("PENALTY", new BigDecimal(Penaltys[i]));
|
||||
}else{
|
||||
} else {
|
||||
BigDecimal portionMoneys = new BigDecimal(portionMoney);
|
||||
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);
|
||||
String subtractMoneyName = "";
|
||||
if("本金".equals(paymentOrder[j])){
|
||||
if ("本金".equals(paymentOrder[j])) {
|
||||
subtractMoneyName = "CORPUS";
|
||||
subtractMoney = new BigDecimal(corpuss[i]);
|
||||
}else if("利息".equals(paymentOrder[j])){
|
||||
} else if ("利息".equals(paymentOrder[j])) {
|
||||
subtractMoneyName = "INTEREST";
|
||||
subtractMoney = new BigDecimal(interests[i]);
|
||||
}else if("罚息".equals(paymentOrder[j])){
|
||||
} else if ("罚息".equals(paymentOrder[j])) {
|
||||
subtractMoneyName = "PENALTY";
|
||||
subtractMoney = new BigDecimal(Penaltys[i]);
|
||||
}
|
||||
if(portionMoneys.compareTo(new BigDecimal(0)) == 0){ //如果已经为0,则为对应的回笼对象赋值0
|
||||
if("CORPUS".equals(subtractMoneyName) || "INTEREST".equals(subtractMoneyName)){
|
||||
if (portionMoneys.compareTo(new BigDecimal(0)) == 0) { //如果已经为0,则为对应的回笼对象赋值0
|
||||
if ("CORPUS".equals(subtractMoneyName) || "INTEREST".equals(subtractMoneyName)) {
|
||||
rentMoney = rentMoney.add(new BigDecimal(0));
|
||||
}
|
||||
//暂时解决报错问题
|
||||
if("".equals(subtractMoneyName)||subtractMoneyName==null){
|
||||
subtractMoneyName="PENALTY";
|
||||
if ("".equals(subtractMoneyName) || subtractMoneyName == null) {
|
||||
subtractMoneyName = "PENALTY";
|
||||
}
|
||||
boLRIT.setAttributeValue(subtractMoneyName, 0);
|
||||
}else{
|
||||
if(portionMoneys.compareTo(subtractMoney) >= 0){ //如果能正常减去,则为对应的回笼对象赋值对应值
|
||||
if("CORPUS".equals(subtractMoneyName) || "INTEREST".equals(subtractMoneyName)){
|
||||
} else {
|
||||
if (portionMoneys.compareTo(subtractMoney) >= 0) { //如果能正常减去,则为对应的回笼对象赋值对应值
|
||||
if ("CORPUS".equals(subtractMoneyName) || "INTEREST".equals(subtractMoneyName)) {
|
||||
rentMoney = rentMoney.add(subtractMoney);
|
||||
}
|
||||
portionMoneys = portionMoneys.subtract(subtractMoney);
|
||||
boLRIT.setAttributeValue(subtractMoneyName, subtractMoney);
|
||||
}else{ //如果不够减,则把剩余的值赋值给对应的回笼对象
|
||||
if("CORPUS".equals(subtractMoneyName) || "INTEREST".equals(subtractMoneyName)){
|
||||
} else { //如果不够减,则把剩余的值赋值给对应的回笼对象
|
||||
if ("CORPUS".equals(subtractMoneyName) || "INTEREST".equals(subtractMoneyName)) {
|
||||
rentMoney = rentMoney.add(portionMoneys);
|
||||
}
|
||||
boLRIT.setAttributeValue(subtractMoneyName, portionMoneys);
|
||||
@ -333,59 +343,62 @@ public class RentIncomeMethod {
|
||||
boLRIT.setAttributeValue("RENT", rentMoney);
|
||||
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();
|
||||
} else {
|
||||
// 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();
|
||||
|
||||
if("penalty_income".equals(penaltyRule)){
|
||||
penaltyOver = "0.00";
|
||||
}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();
|
||||
.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 = 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));
|
||||
if(money.compareTo(bel) <= 0){
|
||||
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));
|
||||
}else{
|
||||
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);
|
||||
for(int j=0;j<paymentOrder.length;j++){ //获取产品还款次序
|
||||
for (int j = 0; j < paymentOrder.length; j++) { //获取产品还款次序
|
||||
BigDecimal subtractMoney = new BigDecimal(0);
|
||||
String subtractMoneyName = "";
|
||||
if("本金".equals(paymentOrder[j])){
|
||||
if ("本金".equals(paymentOrder[j])) {
|
||||
subtractMoneyName = "CORPUS";
|
||||
subtractMoney = new BigDecimal(corpusOver);
|
||||
}else if("利息".equals(paymentOrder[j])){
|
||||
subtractMoney = corpusOver;
|
||||
} else if ("利息".equals(paymentOrder[j])) {
|
||||
subtractMoneyName = "INTEREST";
|
||||
subtractMoney = new BigDecimal(interestOver);
|
||||
}else if("罚息".equals(paymentOrder[j])){
|
||||
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)){
|
||||
if (portionMoneys.compareTo(new BigDecimal(0)) == 0) { //如果已经为0,则为对应的回笼对象赋值0
|
||||
if ("CORPUS".equals(subtractMoneyName) || "INTEREST".equals(subtractMoneyName)) {
|
||||
rentMoney = rentMoney.add(new BigDecimal(0));
|
||||
}
|
||||
boLRIT.setAttributeValue(subtractMoneyName, 0);
|
||||
}else{
|
||||
if(portionMoneys.compareTo(subtractMoney) >= 0){ //如果能正常减去,则为对应的回笼对象赋值对应值
|
||||
if("CORPUS".equals(subtractMoneyName) || "INTEREST".equals(subtractMoneyName)){
|
||||
} else {
|
||||
if (portionMoneys.compareTo(subtractMoney) >= 0) { //如果能正常减去,则为对应的回笼对象赋值对应值
|
||||
if ("CORPUS".equals(subtractMoneyName) || "INTEREST".equals(subtractMoneyName)) {
|
||||
rentMoney = rentMoney.add(subtractMoney);
|
||||
}
|
||||
portionMoneys = portionMoneys.subtract(subtractMoney);
|
||||
boLRIT.setAttributeValue(subtractMoneyName, subtractMoney);
|
||||
}else{ //如果不够减,则把剩余的值赋值给对应的回笼对象
|
||||
if("CORPUS".equals(subtractMoneyName) || "INTEREST".equals(subtractMoneyName)){
|
||||
} else { //如果不够减,则把剩余的值赋值给对应的回笼对象
|
||||
if ("CORPUS".equals(subtractMoneyName) || "INTEREST".equals(subtractMoneyName)) {
|
||||
rentMoney = rentMoney.add(portionMoneys);
|
||||
}
|
||||
boLRIT.setAttributeValue(subtractMoneyName, portionMoneys);
|
||||
@ -414,7 +427,7 @@ public class RentIncomeMethod {
|
||||
boLRIT.setAttributeValue("FLOWUNID", flowunid);
|
||||
boLRI.saveObject(boLRIT);
|
||||
}
|
||||
if(bel.compareTo(new BigDecimal(0)) > 0){
|
||||
if (bel.compareTo(new BigDecimal(0)) > 0) {
|
||||
allFactMoney = allFactMoney.subtract(bel);
|
||||
}
|
||||
BizObjectManager bomLEP = JBOFactory.getBizObjectManager(LC_EBANK_PROCESS.CLASS_NAME);
|
||||
@ -427,11 +440,11 @@ public class RentIncomeMethod {
|
||||
//已核销金额 = 到账总金额 - 剩余可核销金额
|
||||
BigDecimal mayMoney = new BigDecimal(boEb.getAttribute("MAYOPE_MONEY").getDouble());
|
||||
BigDecimal factMoney = new BigDecimal(boEb.getAttribute("FACT_MONEY").getDouble());
|
||||
BigDecimal mayMoneyNew = mayMoney.subtract(allFactMoney);
|
||||
boEb.setAttributeValue("MAYOPE_MONEY",mayMoneyNew.toString());
|
||||
BigDecimal mayMoneyNew = mayMoney.subtract(allFactMoney);
|
||||
boEb.setAttributeValue("MAYOPE_MONEY", mayMoneyNew.toString());
|
||||
boEb.setAttributeValue("HAD_MONEY", factMoney.subtract(mayMoneyNew).toString());
|
||||
bomEb.saveObject(boEb);
|
||||
}catch(Exception e){
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return "ERROR";
|
||||
}
|
||||
@ -766,26 +779,28 @@ public class RentIncomeMethod {
|
||||
/**
|
||||
* 罚息减免
|
||||
*/
|
||||
public String setPenaltyDataToRentIncome(JBOTransaction tx) throws JBOException{
|
||||
try{
|
||||
String[] Penaltys = overPenaltys.split("@");
|
||||
Boolean flag = false;
|
||||
if("Y".equals(isChanged)){
|
||||
flag = true;
|
||||
}
|
||||
public String setPenaltyDataToRentIncome(JBOTransaction tx) throws JBOException {
|
||||
try {
|
||||
// String[] Penaltys = overPenaltys.split("@");
|
||||
// Boolean flag = false;
|
||||
// if ("Y".equals(isChanged)) {
|
||||
// flag = true;
|
||||
// }
|
||||
String[] ids = planIDs.split("@");
|
||||
for(int i=0;i<ids.length;i++){
|
||||
for (int i = 0; i < ids.length; i++) {
|
||||
BizObject boVLR = JBOFactory.createBizObjectQuery(LC_RENT_PLAN.CLASS_NAME, "ID=:ID").setParameter("ID", ids[i])
|
||||
.getSingleResult(false);
|
||||
BizObject boVLRP = JBOFactory.createBizObjectQuery(VI_LC_RENT_PLAN.CLASS_NAME, "ID=:ID").setParameter("ID", ids[i])
|
||||
.getSingleResult(false);
|
||||
|
||||
// BizObject boVLRP = JBOFactory.createBizObjectQuery(VI_LC_RENT_PLAN.CLASS_NAME, "ID=:ID").setParameter("ID", ids[i])
|
||||
// .getSingleResult(false);
|
||||
Transaction tran = Transaction.createTransaction(tx);
|
||||
BigDecimal penaltyOver = (BigDecimal)SqlRunnerUtil.query(tran, "flow.PenaltyReductionFlow.queryRentPlanRemainPenalty", ImmutableMap.of("planId", ids[i]), new NumberHandler());
|
||||
|
||||
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();
|
||||
boLORL.setAttributeValue("ID", UUIDUtil.getUUID());
|
||||
boLORL.setAttributeValue("PAYMENT_NUMBER", boVLRP.getAttribute("PAYMENT_NUMBER").getString());
|
||||
boLORL.setAttributeValue("PLAN_LIST", boVLRP.getAttribute("PLAN_LIST").getString());
|
||||
boLORL.setAttributeValue("PAYMENT_NUMBER", boVLR.getAttribute(LC_RENT_PLAN.PAYMENT_NUMBER).getString());
|
||||
boLORL.setAttributeValue("PLAN_LIST", boVLR.getAttribute(LC_RENT_PLAN.PLAN_LIST).getString());
|
||||
boLORL.setAttributeValue("FLOW_NAME", "罚息减免流程");
|
||||
boLORL.setAttributeValue("FLOWUNID", flowunid);
|
||||
bomLORL.saveObject(boLORL);
|
||||
@ -803,11 +818,15 @@ public class RentIncomeMethod {
|
||||
boLRIT.setAttributeValue("PLAN_LIST", boVLR.getAttribute("PLAN_LIST").getString());
|
||||
boLRIT.setAttributeValue("INTEREST_ADJUST", 0);
|
||||
boLRIT.setAttributeValue("SETTLE_METHOD", "settlemethod12");
|
||||
List<BizObject> boLCRI = JBOFactory.createBizObjectQuery(LC_RENT_INCOME.CLASS_NAME, "PLAN_ID=:PLAN_ID and ROLL_BACK='0'").setParameter("PLAN_ID", ids[i])
|
||||
List<BizObject> boLCRI = JBOFactory.createBizObjectQuery(LC_RENT_INCOME.CLASS_NAME, "PAYMENT_NUMBER=:paymentNumber AND PLAN_LIST = :planList and ROLL_BACK='0'")
|
||||
.setParameter("paymentNumber", boVLR.getAttribute(LC_RENT_PLAN.PAYMENT_NUMBER).getString())
|
||||
.setParameter("planList", boVLR.getAttribute(LC_RENT_PLAN.PLAN_LIST).getString())
|
||||
.getResultList(false);
|
||||
List<BizObject> boLCRIT = JBOFactory.createBizObjectQuery(LC_RENT_INCOME_TEMP.CLASS_NAME, "PLAN_ID=:PLAN_ID and IS_FLOWING = 0 and ROLL_BACK='0'").setParameter("PLAN_ID", ids[i])
|
||||
List<BizObject> boLCRIT = JBOFactory.createBizObjectQuery(LC_RENT_INCOME_TEMP.CLASS_NAME, "PAYMENT_NUMBER=:paymentNumber AND PLAN_LIST = :planList and IS_FLOWING = 0 and ROLL_BACK='0'")
|
||||
.setParameter("paymentNumber", boVLR.getAttribute(LC_RENT_PLAN.PAYMENT_NUMBER).getString())
|
||||
.setParameter("planList", boVLR.getAttribute(LC_RENT_PLAN.PLAN_LIST).getString())
|
||||
.getResultList(false);
|
||||
boLRIT.setAttributeValue("HIRE_LIST", boLCRI.size()+boLCRIT.size()+1);
|
||||
boLRIT.setAttributeValue("HIRE_LIST", boLCRI.size() + boLCRIT.size() + 1);
|
||||
boLRIT.setAttributeValue("HIRE_DATE", StringFunction.getToday());
|
||||
boLRIT.setAttributeValue("ACCOUNTING_DATE", StringFunction.getToday());
|
||||
boLRIT.setAttributeValue("RENT", 0);
|
||||
@ -816,14 +835,14 @@ public class RentIncomeMethod {
|
||||
boLRIT.setAttributeValue("INTEREST_ADJUST", 0);
|
||||
boLRIT.setAttributeValue("PENALTY", 0);
|
||||
boLRIT.setAttributeValue("CORPUS_ADJUST", 0);
|
||||
boLRIT.setAttributeValue("PENALTY_ADJUST", flag?boVLRP.getAttribute("PENALTY_OVER").getString():Penaltys[i]);
|
||||
boLRIT.setAttributeValue("PENALTY_ADJUST", penaltyOver);
|
||||
boLRIT.setAttributeValue("ROLL_BACK", 0);
|
||||
boLRIT.setAttributeValue("COIN", boVLR.getAttribute("COIN").getString());
|
||||
boLRIT.setAttributeValue("IS_FLOWING", 0);
|
||||
boLRIT.setAttributeValue("FLOWUNID", flowunid);
|
||||
boLRI.saveObject(boLRIT);
|
||||
}
|
||||
}catch(Exception e){
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return "ERROR";
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user