Merge branch 'release20211231' of http://git2.tenwa.com.cn/ApzlDev/apzl_leasing into release20211231

This commit is contained in:
zhanglei@ap-leasing.com.cn 2023-09-22 09:07:52 +08:00
commit fa8a56fb50
15 changed files with 972 additions and 394 deletions

View File

@ -63,6 +63,8 @@
if(ReaderId.equals("")){
if (StringUtils.isEmpty(delTabs)) {
out.write(new Button("关闭流程", "关闭流程", "closePage()", "", "btn_icon_close").getHtmlText());
}else{
flag = true;
}
}else{
rightType = "ReadOnly";

View File

@ -9,7 +9,7 @@
String RightType=CurPage.getParameter("RightType");
String productId=CurPage.getParameter("ProductId");
String projectId=CurPage.getParameter("ProjectId");
String khcertid = Sqlca.getString("select ci.certid from lb_union_lessee_temp lul left join customer_info ci on ci.customerid = lul.CUSTOMER_ID where lul.IS_MAIN = 'Y' and lul.flowunid='"+flowunid+"'");
String khcertid = Sqlca.getString("select cpt.certid from lb_union_lessee_temp lul left join customer_person_temp cpt on cpt.FLOWUNID = lul.FLOWUNID where lul.IS_MAIN = 'Y' and lul.flowunid='"+flowunid+"'");
String gtcertid = Sqlca.getString("select cf.certid from customer_family_temp cf where cf.Partner_ = 'Y' and cf.flowunid='"+flowunid+"'");
String dbcertid = Sqlca.getString("select CERTID from lb_guarantee_unit_temp where flowunid='"+flowunid+"' order by CERTID asc limit 1");
String dbcertid2 = Sqlca.getString("select CERTID from lb_guarantee_unit_temp where flowunid='"+flowunid+"' order by CERTID desc limit 1");

View File

@ -27,8 +27,8 @@
String compClientID = request.getParameter("CompClientID");
dwTemp.replaceColumn("loaned", "<iframe type='iframe' id='frame_list' name=\"frame_list\" width=\"100%\" height=\"200px\" frameborder=\"0\" src=\""+sWebRootPath+ "/Tenwa/Customer/Lessee/Comm/CustomerHistory/LoanedInfo.jsp?CompClientID=" +compClientID+"&certId="+certId+"\"></iframe>", CurPage.getObjectWindowOutput());
dwTemp.replaceColumn("outstand", "<iframe type='iframe' id='frame_list' name=\"frame_list\" width=\"100%\" height=\"200px\" frameborder=\"0\" src=\""+sWebRootPath+ "/Tenwa/Customer/Lessee/Comm/CustomerHistory/OutstandInfo.jsp?CompClientID=" +compClientID+"&certId="+certId+"&flowunId="+flowunId+"\"></iframe>", CurPage.getObjectWindowOutput());
dwTemp.replaceColumn("loaned", "<iframe type='iframe' id='frame_list' name=\"frame_list\" width=\"100%\" height=\"220px\" frameborder=\"0\" src=\""+sWebRootPath+ "/Tenwa/Customer/Lessee/Comm/CustomerHistory/LoanedInfo.jsp?CompClientID=" +compClientID+"&certId="+certId+"\"></iframe>", CurPage.getObjectWindowOutput());
dwTemp.replaceColumn("outstand", "<iframe type='iframe' id='frame_list' name=\"frame_list\" width=\"100%\" height=\"220px\" frameborder=\"0\" src=\""+sWebRootPath+ "/Tenwa/Customer/Lessee/Comm/CustomerHistory/OutstandInfo.jsp?CompClientID=" +compClientID+"&certId="+certId+"&flowunId="+flowunId+"\"></iframe>", CurPage.getObjectWindowOutput());
String sButtons[][] = {

View File

@ -4,13 +4,17 @@
<%
String certId = CurPage.getParameter("certId");
ASObjectModel doTemp = new ASObjectModel("LoanedList");
doTemp.appendJboWhere(" and O.CONTRACT_STATUS >= 31 and O.CONTRACT_STATUS <> '104' and O.CONTRACT_STATUS <> '101' ");
String flowunId = CurPage.getParameter("flowunId");
CurPage.setAttribute("flowRowCount", "20");
CurPage.setAttribute("pageIdentify", "loan");
ASObjectModel doTemp = new ASObjectModel("LoanedListNew");
doTemp.setDataQueryClass("com.amarsoft.awe.dw.ui.list.FlowMonitorListHtmlGenerator");
doTemp.appendJboWhere(" and o.CONTRACT_STATUS in ('31','100','105')");
ASObjectWindow dwTemp = new ASObjectWindow(CurPage,doTemp,request);
dwTemp.Style="1";//--设置为Grid风格--
dwTemp.ReadOnly = "1";//只读模式
dwTemp.setPageSize(10);
dwTemp.setPageSize(20);
doTemp.setVisible("PROJECT_ID,FLOWUNID,CERTID_WITH_ROLE,CONTRACT_STATUS,business_status",false);
dwTemp.genHTMLObjectWindow(certId);
String sButtons[][] = {
@ -31,18 +35,16 @@
}
function viewHisTabLocal() {
var param = FlowFunction.loadFlowParam();
if (typeof(param.ObjectNo) == "undefined" || param.ObjectNo.length == 0) {
var flowunid = getItemValue(0,getRow(),"FLOWUNID");
var projectId = getItemValue(0,getRow(),"PROJECT_ID");
if (flowunid.length == 0 && projectId.length == 0) {
alert(getHtmlMessage('1'));//请选择一条信息!
return;
}
let sTaskNo = param["TaskNo"]
if(sTaskNo==""){
sTaskNo = AsControl.RunJavaMethodTrans("com.amarsoft.app.flow.FlowAction","getFlowEndRelativeTaskNo", "ObjectNo="+param["sObjectNo"]+",PhaseNo="+ param["sPhaseNo"]);
if(typeof(sTaskNo)=="undefined" || sTaskNo.length==0) {
alert("Á÷³Ìδ½áÊø,ÎÞ·¨²é¿´£¡");
return;
}
let sTaskNo = AsControl.RunJavaMethodTrans("com.amarsoft.app.flow.FlowAction","getFlowEndRelativeTaskNo", "ObjectNo="+flowunid+",projectId="+projectId);
if(typeof(sTaskNo)=="undefined" || sTaskNo.length==0) {
alert("Á÷³Ìδ½áÊø,ÎÞ·¨²é¿´£¡");
return;
}
var param ="TaskNo="+sTaskNo+"&ViewID=001&RightType=ReadOnly&delTabs=扣款卡信息,客户历史信息查询";
AsControl.OpenNewWin("/Tenwa/Core/FlowManager/FlowPage/FlowPageViewTab.jsp",param)

View File

@ -6,18 +6,19 @@
String certId = CurPage.getParameter("certId");
String flowunId = CurPage.getParameter("flowunId");
ASObjectModel doTemp = new ASObjectModel("LoanedList");
doTemp.appendJboWhere(" and (O.CONTRACT_STATUS < 31 or O.CONTRACT_STATUS = '104' or O.CONTRACT_STATUS = '101') and O.FLOWUNID <> '"+flowunId+"'");
CurPage.setAttribute("flowRowCount", "20");
ASObjectModel doTemp = new ASObjectModel("LoanedListNew");
doTemp.setDataQueryClass("com.amarsoft.awe.dw.ui.list.FlowMonitorListHtmlGenerator");
doTemp.appendJboWhere(" and o.CONTRACT_STATUS not in ('100','105','31') and (flowunid not in ('"+flowunId+"') or v.isnull(flowunid))");
ASObjectWindow dwTemp = new ASObjectWindow(CurPage,doTemp,request);
dwTemp.Style="1";//--设置为Grid风格--
dwTemp.ReadOnly = "1";//只读模式
dwTemp.setPageSize(10);
dwTemp.setPageSize(20);
doTemp.setVisible("PROJECT_ID,FLOWUNID,CERTID_WITH_ROLE,CONTRACT_STATUS,COUPUS_OVER,IS_OVERDUE",false);
dwTemp.genHTMLObjectWindow(certId);
String sButtons[][] = {
};
%><%@include file="/Frame/resources/include/ui/include_list.jspf"%>
String sButtons[][] = {};
%>
<%@include file="/Frame/resources/include/ui/include_list.jspf"%>
<script type="text/javascript">
function afterSearch(){
@ -33,18 +34,16 @@
}
function viewHisTabLocal() {
var param = FlowFunction.loadFlowParam();
if (typeof(param.ObjectNo) == "undefined" || param.ObjectNo.length == 0) {
var flowunid = getItemValue(0,getRow(),"FLOWUNID");
var projectId = getItemValue(0,getRow(),"PROJECT_ID");
if (flowunid.length == 0 && projectId.length == 0) {
alert(getHtmlMessage('1'));//请选择一条信息!
return;
}
let sTaskNo = param["TaskNo"]
if(sTaskNo==""){
sTaskNo = AsControl.RunJavaMethodTrans("com.amarsoft.app.flow.FlowAction","getFlowEndRelativeTaskNo", "ObjectNo="+param["sObjectNo"]+",PhaseNo="+ param["sPhaseNo"]);
if(typeof(sTaskNo)=="undefined" || sTaskNo.length==0) {
alert("Á÷³Ìδ½áÊø,ÎÞ·¨²é¿´£¡");
return;
}
let sTaskNo = AsControl.RunJavaMethodTrans("com.amarsoft.app.flow.FlowAction","getFlowEndRelativeTaskNo", "ObjectNo="+flowunid+",projectId="+projectId);
if(typeof(sTaskNo)=="undefined" || sTaskNo.length==0) {
alert("Á÷³Ìδ½áÊø,ÎÞ·¨²é¿´£¡");
return;
}
var param ="TaskNo="+sTaskNo+"&ViewID=001&RightType=ReadOnly&delTabs=扣款卡信息,客户历史信息查询";
AsControl.OpenNewWin("/Tenwa/Core/FlowManager/FlowPage/FlowPageViewTab.jsp",param)

View File

@ -1,13 +1,11 @@
<%@page import="java.lang.Integer"%>
<%@page import="java.lang.Double"%>
<%@page import="com.tenwa.reckon.product.ASObjectWindowCalc"%>
<%@ page import="jbo.oti.RC_SCORE_RESULT" %>
<%@page import="jbo.oti.RC_SCORE_RESULT"%>
<%@ page contentType="text/html; charset=GBK"%>
<%@ include file="/Frame/resources/include/include_begin_info.jspf"%><%
/*
Author: undefined 2017-07-12
Content: 示例详情页面
History Log:
History Log:
*/
String ishistory=CurPage.getParameter("IsHistory");
@ -29,7 +27,7 @@
}
double money = Double.parseDouble(clean_lease_money);
CurPage.getCurComp().setAttribute("RightType", null);
String sTempletNo = "VI_PROJECTINFO_APPROVAL";//--模板号--
ASObjectModel doTemp = new ASObjectModel(sTempletNo);
if("01".equals(customerType)){
@ -73,7 +71,7 @@
}else {
dwTemp.getDataObject().setVisible("subjectname", false);
}
if("0010".equals(phaseNo)){//经销商
dwTemp.setGroupHidden("0020,0030,0040,0050");
}else if("0030".equals(phaseNo)){//初审
@ -195,10 +193,11 @@
dwTemp.setGroupHidden("0030,0040,0050");
}
}
dwTemp.setGroupHidden("0040");//去除信审审批
dwTemp.genHTMLObjectWindow(flowunid);
String sButtons[][] = {
{"0010,0020".indexOf(phaseNo)>-1?"false":"true","","Button","保存","保存所有修改","save()","","","",""}
{"0010,0020".indexOf(phaseNo)>-1?"false":"true","","Button","保存","保存所有修改","save()","","","",""}
};
%><%@ include file="/Frame/resources/include/ui/include_info.jspf"%>
<script type="text/javascript">
@ -241,7 +240,7 @@
$("#A_div_1170").attr("style","display:none;");
$("#A_div_1180").attr("style","display:none;");
$("#A_div_1250").attr("style","display:none;");
}
}
_user_validator[0]['rules']['FIRSTCHOICE']['required0'] = true;
_user_validator[0]['messages']['FIRSTCHOICE']['required0'] = '请输入初审意见';
_user_validator[0]['rules']['FIRSTOPINION']['required0'] = true;
@ -252,7 +251,7 @@
proposal ='SECONDCHOICE';
$("#A_div_1250").attr("style","display:none;");
$("#A_div_1260").attr("style","display:none;");
$("#FIRSTCHOICE").attr("disabled","disabled");//初审意见
$("#FIRSTOPINION").attr("disabled","disabled");//审批意见
// $("#INTEROPINION1").attr("disabled","disabled");//初审内部意见
@ -273,13 +272,13 @@
$("#A_div_1250").attr("style","display:none;");
$("#A_Group_0020").attr("style","display:none;");
if("13"==<%=projectstatus%>){//添加业务二部风管领导审批意见0070显示
html='<tr id="contractsign" class="test"><td>业务审批结果: 通过</td></tr>';
html='<tr id="contractsign" class="test"><td>业务审批结果: 通过</td></tr>';
}else{
var firstopinionText= $("#FIRSTOPINION").find("option:selected").text();
html='<tr id="contractsign" class="test"><td>业务审批结果: 未通过('+firstopinionText+'</td></tr>';
}
$("#A_Group_0010").append(html);
}
}
_user_validator[0]['rules']['SECONDCHOICE']['required0'] = true;
_user_validator[0]['messages']['SECONDCHOICE']['required0'] = '请输入复审意见';
_user_validator[0]['rules']['SECONDOPINION']['required0'] = true;
@ -290,7 +289,7 @@
proposal ='SECONDCHOICE';
$("#A_div_1250").attr("style","display:none;");
$("#A_div_1260").attr("style","display:none;");
$("#FIRSTCHOICE").attr("disabled","disabled");//初审意见
$("#FIRSTOPINION").attr("disabled","disabled");//审批意见
// $("#INTEROPINION1").attr("disabled","disabled");//初审内部意见
@ -310,8 +309,8 @@
$("#A_div_1180").attr("style","display:none;");
$("#A_div_1250").attr("style","display:none;");
$("#A_Group_0020").attr("style","display:none;");
}
}
_user_validator[0]['rules']['SECONDCHOICE']['required0'] = true;
_user_validator[0]['messages']['SECONDCHOICE']['required0'] = '请输入复审意见';
_user_validator[0]['rules']['SECONDOPINION']['required0'] = true;
@ -340,13 +339,13 @@
$("#A_div_1250").attr("style","display:none;");
$("#A_Group_0020").attr("style","display:none;");
if("13"==<%=projectstatus%>){
html='<tr id="contractsign" class="test"><td>业务审批结果: 通过</td></tr>';
html='<tr id="contractsign" class="test"><td>业务审批结果: 通过</td></tr>';
}else{
var firstopinionText= $("#FIRSTOPINION").find("option:selected").text();
html='<tr id="contractsign" class="test"><td>业务审批结果: 未通过('+firstopinionText+'</td></tr>';
}
$("#A_Group_0010").append(html);
}
}
_user_validator[0]['rules']['THIRDCHOICE']['required0'] = true;
_user_validator[0]['messages']['THIRDCHOICE']['required0'] = '请输入部门负责人意见';
_user_validator[0]['rules']['THIRDOPINION']['required0'] = true;
@ -359,7 +358,7 @@
$("#A_div_1240").attr("style","display:none;");
$("#A_div_1250").attr("style","display:none;");
$("#A_div_1260").attr("style","display:none;");
$("#FIRSTCHOICE").attr("disabled","disabled");//初审意见
$("#FIRSTOPINION").attr("disabled","disabled");//审批意见
// $("#INTEROPINION1").attr("disabled","disabled");//初审内部意见
@ -383,7 +382,7 @@
$("#A_div_1170").attr("style","display:none;");
$("#A_div_1180").attr("style","display:none;");
$("#A_div_1250").attr("style","display:none;");
}
}
_user_validator[0]['rules']['FOURCHOICE']['required0'] = true;
_user_validator[0]['messages']['FOURCHOICE']['required0'] = '请输入总经理意见';
_user_validator[0]['rules']['FOUROPINION']['required0'] = true;
@ -393,7 +392,7 @@
if("true"=="<%=ishistory%>"&&<%=CurUser.hasRole("401")%>){
$("#A_Group_0020").attr("style","display:none;");
if("13"==<%=projectstatus%>){
html='<tr id="contractsign" class="test"><td>业务审批结果: 通过</td></tr>';
html='<tr id="contractsign" class="test"><td>业务审批结果: 通过</td></tr>';
}else{
var firstopinionText= $("#FIRSTOPINION").find("option:selected").text();
html='<tr id="contractsign" class="test"><td>业务审批结果: 未通过('+firstopinionText+'</td></tr>';
@ -402,9 +401,9 @@
}
break;
}
var certResult = checkCertId();
if(certResult=="4" && "false"=="<%=ishistory%>"){
if(certResult=="true" && "false"=="<%=ishistory%>"){
//$("#FULLNAME").attr("style","color:red;");
$("#CERTID").css("color","red");
}
@ -422,13 +421,13 @@
$("#FIRSTOPINION").attr("disabled","");
$("#SECONDOPINION").attr("disabled","");
$("#THIRDOPINION").attr("disabled",""); */
var obj=document.getElementById(selectOpinion);
var obj=document.getElementById(selectOpinion);
if(obj!=null&&""!=obj&&"null"!=obj){
for(var i=0;i<7;i++){
obj.options[i].style.display = "block";
obj.options[i].style.display = "block";
}
obj.options[7].style.display = "none";
obj.options[8].style.display = "none";
obj.options[7].style.display = "none";
obj.options[8].style.display = "none";
}
attribute1="1";
}
@ -438,11 +437,11 @@
var obj=document.getElementById(selectOpinion);
if(obj!=null&&""!=obj&&"null"!=obj){
for(var i=0;i<7;i++){
obj.options[i].style.display = "none";
obj.options[i].style.display = "none";
}
obj.options[0].style.display = "block";
obj.options[7].style.display = "block";
obj.options[8].style.display = "none";
obj.options[0].style.display = "block";
obj.options[7].style.display = "block";
obj.options[8].style.display = "none";
}
attribute1="2";
}
@ -455,9 +454,9 @@
if(obj!=null&&""!=obj&&"null"!=obj){
var obj=document.getElementById(selectOpinion);
for(var i=0;i<8;i++){
obj.options[i].style.display = "none";
obj.options[i].style.display = "none";
}
obj.options[0].style.display = "block";
obj.options[0].style.display = "block";
}
attribute1="3";
}
@ -566,14 +565,12 @@
}
function checkCertId(){//校验证件号
var customerType = "03";
//var customerName = getItemValue(0,getRow(),"CustomerName");
var certId = getItemValue(0,getRow(),"CERTID");
//var sParams = "CustomerName="+customerName+",certId="+certId+",customerType="+customerType;
var sParams = "certId="+certId+",customerType="+customerType;
var sReturnInfo = RunJavaMethodTrans("com.tenwa.lease.flow.project.businessapply.CustomerInfoCheck","checkCertId",sParams);
var sParams = "certId="+certId+",customerType="+customerType+",flowunid="+"<%=flowunid%>";
var sReturnInfo = RunJavaMethodTrans("com.tenwa.lease.flow.project.businessapply.CustomerInfoCheck","checkExistsByCertid",sParams);
return sReturnInfo;
}
function changeFirstChoice(){//根据初审意见,遍历相应的下拉选项
setItemValue(0,0,"firstopinion","");
var firstchoice = getItemValue(0,0,"firstchoice");
@ -589,9 +586,9 @@
// setItemRequired(0,"DistriOpinion1",false);
setItemRequired(0,"FIRSTOPINION",true);
$("#FIRSTOPINION").removeAttr("disabled");
/* var obj=document.getElementById('FIRSTOPINION');
/* var obj=document.getElementById('FIRSTOPINION');
for(var i=0;i<7;i++){
obj.options[i].style.display = "block";
obj.options[i].style.display = "block";
}
obj.options[7].style.display = "none"; */
attribute1="1";
@ -603,7 +600,7 @@
$("#FIRSTOPINION").removeAttr("disabled");
/* var obj=document.getElementById('FIRSTOPINION');
for(var i=0;i<7;i++){
obj.options[i].style.display = "none";
obj.options[i].style.display = "none";
}
obj.options[7].style.display = "block"; */
attribute1="2";
@ -634,7 +631,7 @@
}
});
}
function changeSecondChoice(){//根据复审意见,遍历相应的下拉选项
setItemValue(0,0,"secondopinion","");
var secondchoice = getItemValue(0,0,"secondchoice");
@ -652,7 +649,7 @@
$("#SECONDOPINION").removeAttr("disabled");//复审-信审意见
var obj=document.getElementById('SECONDOPINION');//复审-信审意见
/* for(var i=0;i<7;i++){
obj.options[i].style.display = "none";
obj.options[i].style.display = "none";
}
obj.options[7].style.display = "block"; */
attribute1="2";
@ -665,7 +662,7 @@
$("#SECONDOPINION").removeAttr("disabled");//复审-信审意见
var obj=document.getElementById('SECONDOPINION'); //复审-信审意见
/* for(var i=0;i<7;i++){
obj.options[i].style.display = "block";
obj.options[i].style.display = "block";
}
obj.options[7].style.display = "none"; */
attribute1="1";
@ -708,7 +705,7 @@
setItemValue(0, 0, "VETO", "");
}
}
function changeThirdChoice(){//根据信审意见,遍历相应的下拉选项
setItemValue(0,0,"thirdopinion","");
var thirdchoice = getItemValue(0,0,"thirdchoice");
@ -723,9 +720,9 @@
setItemRequired(0,"InterOpinion3",false);
//setItemRequired(0,"DistriOpinion3",true);
$("#THIRDOPINION").removeAttr("disabled");
var obj=document.getElementById('THIRDOPINION');
var obj=document.getElementById('THIRDOPINION');
/* for(var i=0;i<7;i++){
obj.options[i].style.display = "block";
obj.options[i].style.display = "block";
}
obj.options[7].style.display = "none"; */
attribute1="1";
@ -736,7 +733,7 @@
$("#THIRDOPINION").removeAttr("disabled");
var obj=document.getElementById('THIRDOPINION');
/* for(var i=0;i<7;i++){
obj.options[i].style.display = "none";
obj.options[i].style.display = "none";
}
obj.options[7].style.display = "block"; */
attribute1="2";
@ -910,50 +907,50 @@
resetDWDialog("保存失败!",false);
}
}
//index,要删除选项的序号,这里取当前选中选项的序号
//index,要删除选项的序号,这里取当前选中选项的序号
function chosefirstchoice(){
var obj=document.getElementById('FIRSTOPINION');
var obj=document.getElementById('FIRSTOPINION');
for(var i=0;i<8;i++){
obj.options[i].style.display = "block";
obj.options[i].style.display = "block";
}
var firstchoice=getItemValue(0, 0, "firstchoice");
if(firstchoice=="disagree"){
obj.options[7].style.display = "none";
}else{
for(var i=0;i<7;i++){
obj.options[i].style.display = "none";
obj.options[i].style.display = "none";
}
}
}
function chosesecondchoice(){
var obj=document.getElementById('SECONDOPINION');
var obj=document.getElementById('SECONDOPINION');
for(var i=0;i<8;i++){
obj.options[i].style.display = "block";
obj.options[i].style.display = "block";
}
var firstchoice=getItemValue(0, 0, "secondchoice");
if(firstchoice=="disagree"){
obj.options[7].style.display = "none";
}else{
for(var i=0;i<7;i++){
obj.options[i].style.display = "none";
obj.options[i].style.display = "none";
}
}
}
function chosethirdchoice(){
var obj=document.getElementById('THIRDOPINION');
var obj=document.getElementById('THIRDOPINION');
for(var i=0;i<8;i++){
obj.options[i].style.display = "block";
obj.options[i].style.display = "block";
}
var firstchoice=getItemValue(0, 0, "thirdchoice");
if(firstchoice=="disagree"){
obj.options[7].style.display = "none";
}else{
for(var i=0;i<7;i++){
obj.options[i].style.display = "none";
obj.options[i].style.display = "none";
}
}
}
</script>
<%@ include file="/Frame/resources/include/include_end.jspf"%>
<%@ include file="/Frame/resources/include/include_end.jspf"%>

View File

@ -281,10 +281,10 @@
// $("#FULLNAME").css("color","red");
// }
if("0030"=="<%=sPhaseNo%>" ||"0040"=="<%=sPhaseNo%>"||"0050"=="<%=sPhaseNo%>"||"0060"=="<%=sPhaseNo%>"|| ("0070"=="<%=sPhaseNo%>" && "false"=="<%=IsHistory%>")){//经销商阶段看不见标红,初审、复审、信审可以标红
if("0030"=="<%=sPhaseNo%>" ||"0040"=="<%=sPhaseNo%>"||/5/.test("<%=sPhaseNo%>")||"0060"=="<%=sPhaseNo%>"|| ("0070"=="<%=sPhaseNo%>" && "false"=="<%=IsHistory%>")){//经销商阶段看不见标红,初审、复审、信审可以标红
var certResult = checkCertIdAll();
if(certResult=="4"){
if(certResult=='true'){
//$("#FULLNAME").attr("style","color:red;");
$("#CERTID").css("color","red");
}
@ -989,7 +989,7 @@
function checkCertIdAll(){//УÑéÖ¤¼þºÅ
var certId = getItemValue(0,getRow(),"CERTID");
var sParams = "certId="+certId+",flowunid="+"<%=flowunid%>";
var sReturnInfo = RunJavaMethodTrans("com.tenwa.lease.flow.project.businessapply.CustomerInfoCheck","checkCertIdAll",sParams);
var sReturnInfo = RunJavaMethodTrans("com.tenwa.lease.flow.project.businessapply.CustomerInfoCheck","checkExistsByCertid",sParams);
return sReturnInfo;
}
function getIdentity(){

View File

@ -5241,6 +5241,28 @@
</managerProperties>
</manager>
</class>
<class name="VI_PROJECT_HIS_LIST" label="" keyAttributes="">
<attributes>
<attribute name="PROJECT_ID" label="項目id" type="STRING"/>
<attribute name="FLOWUNID" label="流程id" type="STRING"/>
<attribute name="PROJECT_NO" label="项目编号" type="STRING"/>
<attribute name="CONTRACT_NO" label="合同编号" type="STRING"/>
<attribute name="CUSTOMER_NAME" label="客户名称" type="STRING"/>
<attribute name="DISTRIBUTOR_NAME" label="经销商名称" type="STRING"/>
<attribute name="FIRST_PAYMENT_RATIO" label="首付款比例" type="STRING"/>
<attribute name="CLEAN_LEASE_MONEY" label="融资额" type="STRING"/>
<attribute name="LEASE_TERM" label="租赁期次" type="STRING"/>
<attribute name="contract_status" label="合同状态" type="STRING"/>
<attribute name="business_status" label="信审状态" type="STRING"/>
<attribute name="certid_with_role" label="客户合同角色" type="STRING"/>
</attributes>
<manager>
<managerProperties>
<property name="table" value="VI_PROJECT_HIS_LIST" />
<property name="createKey" value="true" />
</managerProperties>
</manager>
</class>
<class name="VERIFICATIONSPARE" label="" keyAttributes="ID">
<attributes>
<attribute name="ID" label="标识" type="STRING" length="32"/>

View File

@ -68,6 +68,7 @@ public class FlowAction {
private String AssignmentId;// 指派人员ID
private String AssignSumbitType;// 指派处理方式
private String nextNodeType;
private String projectId; //ÏîÄ¿id
private FlowService flowService;
@ -227,6 +228,14 @@ public class FlowAction {
this.flowService = flowService;
}
public void setProjectId(String projectId) {
this.projectId = projectId;
}
public String getProjectId() {
return projectId;
}
//处理重复提交数据重复,只适用单体服务
private static Set<String> taskSet = new HashSet<>();
@ -738,16 +747,16 @@ public class FlowAction {
*/
public String getFlowEndRelativeTaskNo(JBOTransaction tx) throws Exception {
String taskSerialNo = "";
if (phaseNo.equals("1000") || phaseNo.equals("8000")) {
BizObject bo = JBOFactory
.getBizObjectManager("jbo.sys.FLOW_TASK", tx)
.createQuery("select RELATIVESERIALNO from O where ObjectNo =:ObjectNo and PhaseNo =:PhaseNo ")
.setParameter("ObjectNo", objectNo)
.setParameter("PhaseNo", phaseNo)
.getSingleResult(false);
if (bo != null)
taskSerialNo = bo.getAttribute("RELATIVESERIALNO").getString();
String sql = "select ft.RELATIVESERIALNO from flow_bussiness_object fbo join flow_task ft on fbo.flow_unid = ft.objectno where fbo.flow_name = 'ÒµÎñÉêÇëÁ÷³Ì' and ft.phaseno = '1000'";
if (StringUtils.isNotBlank(objectNo)) {
sql += " and fbo.flow_unid = '" + objectNo + "'";
} else {
sql += " and fbo.proj_id = '" + projectId + "'";
}
Transaction Sqlca = Transaction.createTransaction(tx);
ASResultSet asResultSet = Sqlca.getASResultSet(new SqlObject(sql));
if (asResultSet.next()) {
taskSerialNo = asResultSet.getString("RELATIVESERIALNO");
}
return taskSerialNo;
}

View File

@ -1,36 +1,16 @@
package com.tenwa.flow.tabviewservice;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import javax.script.Bindings;
import javax.script.Invocable;
import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
import javax.script.ScriptException;
import jbo.com.tenwa.entity.comm.flow.FLOW_STEP_NODE;
import jbo.com.tenwa.lease.comm.LB_PROJECT_INFO;
import jbo.sys.CODE_LIBRARY;
import jbo.sys.FLOW_TASK;
import jbo.sys.OBJECTTYPE_RELA;
import com.amarsoft.amarscript.Any;
import com.amarsoft.amarscript.Expression;
import com.amarsoft.app.lc.workflow.action.GetFlowAction;
import com.amarsoft.are.jbo.BizObject;
import com.amarsoft.are.jbo.BizObjectManager;
import com.amarsoft.are.jbo.BizObjectQuery;
import com.amarsoft.are.jbo.JBOFactory;
import com.amarsoft.are.jbo.JBOTransaction;
import com.amarsoft.are.jbo.*;
import com.amarsoft.are.lang.StringX;
import com.amarsoft.are.util.StringFunction;
import com.amarsoft.awe.control.model.Page;
import com.amarsoft.awe.ui.widget.Button;
import com.amarsoft.awe.util.ASResultSet;
import com.amarsoft.awe.util.SqlObject;
import com.amarsoft.awe.util.Transaction;
import com.amarsoft.dict.als.manage.CodeManager;
import com.amarsoft.dict.als.object.Item;
@ -39,8 +19,20 @@ import com.tenwa.flow.treeview.action.BaseInitTreeView;
import com.tenwa.flow.treeview.action.TreeItemData;
import com.tenwa.lease.util.FlowViewUtil;
import com.tenwa.officetempalte.util.FileOperatorUtil;
import jbo.com.tenwa.entity.comm.flow.FLOW_STEP_NODE;
import jbo.com.tenwa.lease.comm.LB_PROJECT_INFO;
import jbo.sys.CODE_LIBRARY;
import jbo.sys.FLOW_TASK;
import jbo.sys.OBJECTTYPE_RELA;
import org.apache.commons.lang3.StringUtils;
import javax.script.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
public class FlowTaskViewTabService {
/**
* 根据按钮组及配置的按钮集合返回按钮属性列表
@ -326,10 +318,35 @@ public class FlowTaskViewTabService {
FlowTaskViewTabService.initFlowStepNodes(tx, FlowFixedParam, baseTreeView);
}
public static void deleteTreeTab(List<TreeItemData> treeItemDataList,HashMap<String,String> FlowFixedParam ){
if(StringUtils.isNotBlank(FlowFixedParam.get("delTabs"))){
public static void deleteTreeTab(List<TreeItemData> treeItemDataList, HashMap<String, String> FlowFixedParam) {
if (StringUtils.isNotBlank(FlowFixedParam.get("delTabs"))) {
List<TreeItemData> delTabs = treeItemDataList.stream().filter(item -> FlowFixedParam.get("delTabs").indexOf(item.getItemName()) > -1).collect(Collectors.toList());
treeItemDataList.removeAll(delTabs);
if (delTabs.size() > 0) treeItemDataList.removeAll(delTabs);
}
// 业务申请流程非草稿阶段删除无数据担保人及共申人页签
String flowUnid = FlowFixedParam.get("FlowUnid");
if ("BusinessApplyFlow".equals(FlowFixedParam.get("FlowNo")) && !"0010".equals(FlowFixedParam.get("PhaseNo")) && StringUtils.isNotBlank(flowUnid)) {
Transaction Sqlca = null;
try {
Sqlca = Transaction.createTransaction("als");
ASResultSet asResultSet = Sqlca.getASResultSet(new SqlObject("select count(cft.id) as cftNum,count(lgu.id) as lguNum from lb_project_info_temp lpit left join customer_family_temp cft on lpit.flowunid = cft.flowunid and cft.Partner_ = 'Y' left join lb_guarantee_unit_temp lgu on lpit.FLOWUNID = lgu.FLOWUNID where lpit.FLOWUNID = '" + flowUnid + "'"));
asResultSet.next();
StringBuilder sb = new StringBuilder();
if (asResultSet.getInt("cftNum") == 0) sb.append("共同申请人");
if (asResultSet.getInt("lguNum") == 0) sb.append(",担保人信息");
if (sb.length() > 0) {
List<TreeItemData> delTabs = treeItemDataList.stream().filter(item -> sb.toString().indexOf(item.getItemName()) > -1).collect(Collectors.toList());
if (delTabs.size() > 0) treeItemDataList.removeAll(delTabs);
}
Sqlca.commit();
} catch (Exception e) {
e.printStackTrace();
try {
Sqlca.rollback();
} catch (JBOException e1) {
e1.printStackTrace();
}
}
}
}

View File

@ -12,9 +12,12 @@ import com.tenwa.reckon.util.Conn;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static com.ctc.wstx.shaded.msv_core.datatype.xsd.WhiteSpaceProcessor.replace;
public class InsertCustomerHistoryInfo {
private String flowunid;
@ -35,13 +38,13 @@ public class InsertCustomerHistoryInfo {
Conn conn = new Conn(tx);
String flowunid = this.flowunid;
//获取客户基本信息
String sql = "select ci.customerid,ci.customername,ci.certtype,ci.certid,'主承租人' as customertype,ci.customer_num,lul.FLOWUNID,lul.project_id from customer_info ci left join lb_union_lessee_temp lul on lul.customer_id = ci.customerid where lul.IS_MAIN = 'Y' and lul.FLOWUNID = '" + flowunid + "' \n" +
String sql = "select cpt.customerid,cpt.FULLNAME as customername,cpt.certtype,cpt.certid,'主承租人' as customertype,'' as customer_num,lul.FLOWUNID,lul.project_id from customer_person_temp cpt left join lb_union_lessee_temp lul on cpt.FLOWUNID = lul.FLOWUNID where lul.IS_MAIN = 'Y' and lul.FLOWUNID = '"+flowunid+"' \n" +
"union \n" +
"select lgu.ASSUROR as customerid,lgu.FULLNAME as customername,lgu.CERTTYPE,lgu.certid,'担保人' as customertype,'' as customer_num,lgu.FLOWUNID,lgu.project_id from lb_guarantee_unit_temp lgu where lgu.FLOWUNID = '" + flowunid + "'\n" +
"select lgu.ASSUROR as customerid,lgu.FULLNAME as customername,lgu.CERTTYPE,lgu.certid,'担保人' as customertype,'' as customer_num,lgu.FLOWUNID,lgu.project_id from lb_guarantee_unit_temp lgu where lgu.FLOWUNID = '"+flowunid+"'\n" +
"union \n" +
"select '' as customerid,cf.name as customername,cf.CERTTYPE,cf.certid,'共同承租人' as customertype,'' as customer_num,cf.FLOWUNID,cf.PROJECT_ID from customer_family_temp cf where cf.FLOWUNID = '" + flowunid + "'\n";
"select '' as customerid,cf.name as customername,cf.CERTTYPE,cf.certid,'共同承租人' as customertype,'' as customer_num,cf.FLOWUNID,cf.PROJECT_ID from customer_family_temp cf where cf.FLOWUNID = '"+flowunid+"'";
List<Map<String, String>> customerinfo = conn.executeQuery(sql);
String customerid = "";
String certid = "";
//避免项目的历史客户信息重复录入
@ -55,249 +58,284 @@ public class InsertCustomerHistoryInfo {
if(customerinfo.size()>0){
for (int i = 0; i < customerinfo.size(); i++) {
customerid = customerinfo.get(i).get("customerid");
Conn con = new Conn(tx);
certid = customerinfo.get(i).get("certid");
//获取客户为主承租人订单总数
String gm_nu = "select count(lul.id) as num from customer_person cp left join lb_union_lessee lul on lul.CUSTOMER_ID = cp.CUSTOMERID where cp.CERTID = '"+certid+"' and lul.IS_MAIN = 'Y' group by cp.CERTID";
List<Map<String, String>> gm_number = conn.executeQuery(gm_nu);
String gmnum = "";
if(gm_number.size()>0){
gmnum = gm_number.get(0).get("num");
}else {
gmnum = "0";
}
///获取客户为主承租融资金额和
String sum_rz = "select format(sum(nvl(CLEAN_LEASE_MONEY,0)),2) as CLEAN_LEASE_MONEY from customer_person cp left join lb_union_lessee lul on lul.CUSTOMER_ID = cp.CUSTOMERID left join lb_contract_info lci on lci.id = lul.CONTRACT_ID left join lc_calc_condition lcc on lcc.CONTRACT_ID = lul.CONTRACT_ID where cp.CERTID = '"+certid+"' and lul.IS_MAIN = 'Y' and lci.CONTRACT_STATUS >=31 and lci.CONTRACT_STATUS <> '104' group by cp.CERTID";
List<Map<String, String>> rz = conn.executeQuery(sum_rz);
String CLEAN_LEASE_MONEY = "";
if(rz.size()>0){
CLEAN_LEASE_MONEY = rz.get(0).get("clean_lease_money");
}else {
CLEAN_LEASE_MONEY = "0";
}
//获取客户为主承租已结清合同数
String jq_contract_num = "select count(lci.ID) as num from customer_person cp left join lb_union_lessee lul on lul.CUSTOMER_ID = cp.CUSTOMERID left join lb_contract_info lci on lci.id = lul.CONTRACT_ID where cp.CERTID = '"+certid+"' and lul.IS_MAIN = 'Y' and lci.CONTRACT_STATUS in ('100','105') group by cp.CERTID";
List<Map<String, String>> jq_num = conn.executeQuery(jq_contract_num);
String jq_number = "";
if(jq_num.size()>0){
jq_number = jq_num.get(0).get("num");
}else {
jq_number = "0";
}
//获取客户为主承租未结清合同数
String wjq_contract_num = "select count(lci.ID) as num from customer_person cp left join lb_union_lessee lul on lul.CUSTOMER_ID = cp.CUSTOMERID left join lb_contract_info lci on lci.id = lul.CONTRACT_ID where cp.CERTID = '"+certid+"' and lul.IS_MAIN = 'Y' and lci.CONTRACT_STATUS >=31 and lci.CONTRACT_STATUS <= 100 group by cp.CERTID";
List<Map<String, String>> wjq_num = conn.executeQuery(wjq_contract_num);
String wjq_number = "";
if(wjq_num.size()>0){
wjq_number = wjq_num.get(0).get("num");
}else {
wjq_number = "0";
}
//获取客户为主承租车辆总和
String car_num = "select count(lec.ID) as num from customer_person cp left join lb_union_lessee lul on lul.CUSTOMER_ID = cp.CUSTOMERID left join lb_equipment_car lec on lec.CONTRACT_ID = lul.CONTRACT_ID where cp.CERTID = '"+certid+"' and lul.IS_MAIN = 'Y' and lec.car_attribute = 'head' group by cp.CERTID";
List<Map<String, String>> car_number = conn.executeQuery(car_num);
String carnumber = "";
if(car_number.size()>0){
carnumber = car_number.get(0).get("num");
}else {
carnumber = "0";
}
//获取客户为主承租结清车辆总和
String car_jq_num = "select count(lec.ID) as num from customer_person cp left join lb_union_lessee lul on lul.CUSTOMER_ID = cp.CUSTOMERID left join lb_equipment_car lec on lec.CONTRACT_ID = lul.CONTRACT_ID left join lb_contract_info lci on lci.id = lul.CONTRACT_ID where cp.CERTID = '"+certid+"' and lul.IS_MAIN = 'Y' and lci.CONTRACT_STATUS in ('100','105') and lec.car_attribute = 'head' group by cp.CERTID";
List<Map<String, String>> car_jq_number = conn.executeQuery(car_jq_num);
String carjqnumber = "";
if(car_jq_number.size()>0){
carjqnumber = car_jq_number.get(0).get("num");
}else {
carjqnumber = "0";
}
//获取客户为主承租未结清车辆总和
String car_wjq_num = "select count(lec.ID) as num from customer_person cp left join lb_union_lessee lul on lul.CUSTOMER_ID = cp.CUSTOMERID left join lb_equipment_car lec on lec.CONTRACT_ID = lul.CONTRACT_ID left join lb_contract_info lci on lci.id = lul.CONTRACT_ID where cp.CERTID = '"+certid+"' and lul.IS_MAIN = 'Y' and lci.CONTRACT_STATUS >='31' and lci.CONTRACT_STATUS <= '100' and lec.car_attribute = 'head' group by cp.CERTID";
List<Map<String, String>> car_wjq_number = conn.executeQuery(car_wjq_num);
String carwjqnumber = "";
if(car_wjq_number.size()>0){
carwjqnumber = car_wjq_number.get(0).get("num");
}else {
carwjqnumber = "0";
}
//获取客户为主承租剩余租金,逾期租金
String money_num = "select format(sum(nvl(corpus_over,0)),2) as corpus_over from customer_person cp left join lb_union_lessee lul on lul.CUSTOMER_ID = cp.CUSTOMERID left join vi_rent_plan vrps on lul.contract_id = vrps.contract_id where cp.CERTID = '"+certid+"' and lul.IS_MAIN = 'Y' group by cp.CERTID";
List<Map<String, String>> money_number = conn.executeQuery(money_num);
String yqmoney_num = "select format(sum(nvl(rent_over, 0)), 2) as yqrent_over from customer_person cp left join lb_union_lessee lul on lul.CUSTOMER_ID = cp.CUSTOMERID left join vi_rent_plan vrp on lul.contract_id = vrp.contract_id where cp.CERTID = '"+certid+"' and lul.IS_MAIN = 'Y' and STR_TO_DATE(vrp.plan_date,'%Y/%m/%d') < now() group by cp.CERTID";
List<Map<String, String>> yqmoney_number = conn.executeQuery(yqmoney_num);
String czr_rent_over = "";
String czr_yqrent_over = "";
if(money_number.size()>0){
czr_rent_over = money_number.get(0).get("corpus_over");
}else {
czr_rent_over = "0";
//根据证件号获取合同ID
//获取主承租人合同ID
String czrprojid = "select lul.CONTRACT_ID from customer_person cp left join lb_union_lessee lul on cp.CUSTOMERID = lul.CUSTOMER_ID left join lb_contract_info lci on lul.CONTRACT_ID = lci.ID where cp.CERTID = '"+certid+"' and lul.CONTRACT_ID <> '' and lul.IS_MAIN = 'Y' and lci.CONTRACT_STATUS <> '101' and lci.CONTRACT_STATUS <> '104'";
List<Map<String, String>> czrproj_id = con.executeQuery(czrprojid);
String czr_proj_id = "";
for (int j = 0; j < czrproj_id.size(); j++) {
if(czrproj_id.size()==j+1){
czr_proj_id = czr_proj_id+"'"+czrproj_id.get(j).get("contract_id")+"'";
}else {
czr_proj_id = czr_proj_id+"'"+czrproj_id.get(j).get("contract_id")+"'"+",";
}
}
//主承租人取值
String gmnum = "0";
String CLEAN_LEASE_MONEY = "0";
String jq_number = "0";
String wjq_number = "0";
String carnumber = "0";
String carjqnumber = "0";
String carwjqnumber = "0";
BigDecimal czr_rent_over = new BigDecimal(0);
String czr_yqrent_over = "0";
if(!"".equals(czr_proj_id)){
//获取客户为主承租人订单总数
String gm_nu = "select count(lci.id) as num from lb_contract_info lci where lci.id in ("+czr_proj_id+") and lci.CONTRACT_STATUS <> '104' and lci.CONTRACT_STATUS <> '101'";
List<Map<String, String>> gm_number = con.executeQuery(gm_nu);
if(gm_number.size()>0){
gmnum = gm_number.get(0).get("num");
}
///获取客户为主承租融资金额和
String sum_rz = "select format(sum(nvl(CLEAN_LEASE_MONEY,0)),2) as CLEAN_LEASE_MONEY from lb_contract_info lci left join lc_calc_condition lcc on lcc.CONTRACT_ID = lci.ID where lci.CONTRACT_STATUS >=31 and lci.CONTRACT_STATUS <> '104' and lci.CONTRACT_STATUS <> '101' and lci.ID in ("+czr_proj_id+")";
List<Map<String, String>> rz = con.executeQuery(sum_rz);
if(rz.size()>0){
CLEAN_LEASE_MONEY = rz.get(0).get("clean_lease_money");
}
//获取客户为主承租已结清合同数
String jq_contract_num = "select count(lci.ID) as num from lb_contract_info lci where lci.ID in ("+czr_proj_id+") and lci.CONTRACT_STATUS in ('100','105')";
List<Map<String, String>> jq_num = con.executeQuery(jq_contract_num);
if(jq_num.size()>0){
jq_number = jq_num.get(0).get("num");
}
//获取客户为主承租未结清合同数
String wjq_contract_num = "select count(lci.ID) as num from lb_contract_info lci where lci.ID in ("+czr_proj_id+") and lci.CONTRACT_STATUS >=31 and lci.CONTRACT_STATUS < 100";
List<Map<String, String>> wjq_num = con.executeQuery(wjq_contract_num);
if(wjq_num.size()>0){
wjq_number = wjq_num.get(0).get("num");
}
//获取客户为主承租车辆总和
String car_num = "select count(lec.ID) as num from lb_contract_info lci left join lb_equipment_car lec on lec.CONTRACT_ID = lci.id where lci.id in ("+czr_proj_id+") and lec.car_attribute = 'head'";
List<Map<String, String>> car_number = con.executeQuery(car_num);
if(car_number.size()>0){
carnumber = car_number.get(0).get("num");
}
//获取客户为主承租结清车辆总和
String car_jq_num = "select count(lec.ID) as num from lb_contract_info lci left join lb_equipment_car lec on lec.CONTRACT_ID = lci.ID where lci.CONTRACT_STATUS in ('100','105') and lec.car_attribute = 'head' and lci.ID in ("+czr_proj_id+")";
List<Map<String, String>> car_jq_number = con.executeQuery(car_jq_num);
if(car_jq_number.size()>0){
carjqnumber = car_jq_number.get(0).get("num");
}
//获取客户为主承租未结清车辆总和
String car_wjq_num = "select count(lec.ID) as num from lb_contract_info lci left join lb_equipment_car lec on lec.CONTRACT_ID = lci.ID where lci.CONTRACT_STATUS >=31 and lci.CONTRACT_STATUS < 100 and lec.car_attribute = 'head' and lci.ID in ("+czr_proj_id+")";
List<Map<String, String>> car_wjq_number = con.executeQuery(car_wjq_num);
if(car_wjq_number.size()>0){
carwjqnumber = car_wjq_number.get(0).get("num");
}
//获取客户为主承租剩余租金,逾期租金
//总实收
String ssmoney_num = "select replace(format(sum(nvl(lri.corpus,0)),2),',','') as corpus from lc_rent_income lri where lri.CONTRACT_ID in ("+czr_proj_id+")";
List<Map<String, String>> ssmoney_number = con.executeQuery(ssmoney_num);
BigDecimal ssmoney = new BigDecimal(0);
if(ssmoney_number.get(0).get("corpus")!=null || !"".equals(ssmoney_number.get(0).get("corpus"))){
ssmoney = new BigDecimal(ssmoney_number.get(0).get("corpus"));
}
//剩余本金
czr_rent_over = new BigDecimal(CLEAN_LEASE_MONEY.replace(",","")).subtract(ssmoney);
String yqmoney_num = "select format(sum(lrp.rent-nvl(t.RENT,0)),2) as yqrent_over from \n" +
"lc_rent_plan lrp\n" +
"left join (select CONTRACT_ID,lri.PLAN_LIST,sum(RENT) as RENT from lc_rent_income lri where lri.CONTRACT_ID in ("+czr_proj_id+") group by lri.CONTRACT_ID,lri.PLAN_LIST) t \n" +
" on t.CONTRACT_ID = lrp.CONTRACT_ID and t.PLAN_LIST = lrp.PLAN_LIST \n" +
"where STR_TO_DATE(lrp.plan_date,'%Y/%m/%d') < now()\n" +
"\tand lrp.contract_id in ("+czr_proj_id+")";
List<Map<String, String>> yqmoney_number = con.executeQuery(yqmoney_num);
if(yqmoney_number.size()>0){
czr_yqrent_over = yqmoney_number.get(0).get("yqrent_over");
}else {
czr_yqrent_over = "0";
}
//获取客户为共同承租人订单总数
String gt_gm_nu = "select count(cf.id) as num from customer_family cf where cf.Partner_ = 'Y' and cf.certid = '"+certid+"' group by certid";
List<Map<String, String>> gt_gm_number = conn.executeQuery(gt_gm_nu);
String gtgmnumber = "";
if(gt_gm_number.size()>0){
gtgmnumber = gt_gm_number.get(0).get("num");
}else {
gtgmnumber = "0";
}
//获取客户为共同承租人融资额和
String gt_sum_rz = "select format(sum(nvl(CLEAN_LEASE_MONEY,0)),2) as CLEAN_LEASE_MONEY from customer_family cf left join lb_union_lessee lul on cf.PROJECT_ID = lul.PROJECT_ID left join lb_contract_info lci on lci.id = lul.CONTRACT_ID left join lc_calc_condition lcc on lcc.CONTRACT_ID = lul.CONTRACT_ID where cf.certid = '"+certid+"' and cf.Partner_ = 'Y' and lci.CONTRACT_STATUS >=31 and lci.CONTRACT_STATUS <> '104' group by cf.certid";
List<Map<String, String>> gt_rz = conn.executeQuery(gt_sum_rz);
String GT_CLEAN_LEASE_MONEY = "";
if(gt_rz.size()>0){
GT_CLEAN_LEASE_MONEY = gt_rz.get(0).get("clean_lease_money");
}else {
GT_CLEAN_LEASE_MONEY = "0";
}
//获取客户为共同承租人已结清单数
String gt_jq_contract_num = "select count(lci.ID) as num from customer_family cf left join lb_union_lessee lul on lul.PROJECT_ID = cf.PROJECT_ID left join lb_contract_info lci on lci.id = lul.CONTRACT_ID where cf.certid = '"+certid+"' and cf.Partner_ = 'Y' and lci.CONTRACT_STATUS in ('100','105') group by cf.certid";
List<Map<String, String>> gt_jq_num = conn.executeQuery(gt_jq_contract_num);
String gt_jq_number = "";
if(gt_jq_num.size()>0){
gt_jq_number = gt_jq_num.get(0).get("num");
}else {
gt_jq_number = "0";
}
//获取客户为共同承租人未结清单数
String gt_wjq_contract_num = "select count(lci.ID) as num from customer_family cf left join lb_union_lessee lul on lul.PROJECT_ID = cf.PROJECT_ID left join lb_contract_info lci on lci.id = lul.CONTRACT_ID where cf.certid = '"+certid+"' and cf.Partner_ = 'Y' and lci.CONTRACT_STATUS >=31 and lci.CONTRACT_STATUS <= 100 group by cf.certid";
List<Map<String, String>> gt_wjq_num = conn.executeQuery(gt_wjq_contract_num);
String gt_wjq_number = "";
if(gt_wjq_num.size()>0){
gt_wjq_number = gt_wjq_num.get(0).get("num");
}else {
gt_wjq_number = "0";
}
//获取客户为共同承租人车辆总和
String gt_car_num = "select count(lec.ID) as num from customer_family cf left join lb_union_lessee lul on cf.PROJECT_ID = cf.PROJECT_ID left join lb_equipment_car lec on lec.CONTRACT_ID = lul.CONTRACT_ID where cf.certid = '"+certid+"' and cf.Partner_ = 'Y' and lec.car_attribute = 'head' group by cf.certid";
List<Map<String, String>> gt_car_number = conn.executeQuery(gt_car_num);
String gtcarnumber = "";
if(gt_car_number.size()>0){
gtcarnumber = gt_car_number.get(0).get("num");
}else {
gtcarnumber = "0";
}
//获取客户为共同承租人结清车辆总和
String gt_car_jq_num = "select count(lec.ID) as num from customer_family cf left join lb_union_lessee lul on cf.PROJECT_ID = cf.PROJECT_ID left join lb_equipment_car lec on lec.CONTRACT_ID = lul.CONTRACT_ID left join lb_contract_info lci on lci.id = lul.CONTRACT_ID where cf.certid = '"+certid+"' and cf.Partner_ = 'Y' and lci.CONTRACT_STATUS in ('100','105') and lec.car_attribute = 'head' group by cf.certid";
List<Map<String, String>> gt_car_jq_number = conn.executeQuery(gt_car_jq_num);
String gtcarjqnumber = "";
if(gt_car_jq_number.size()>0){
gtcarjqnumber = gt_car_jq_number.get(0).get("num");
}else {
gtcarjqnumber = "0";
}
//获取客户为共同承租人未结清车辆总和
String gt_car_wjq_num = "select count(lec.ID) as num from customer_family cf left join lb_union_lessee lul on cf.PROJECT_ID = cf.PROJECT_ID left join lb_equipment_car lec on lec.CONTRACT_ID = lul.CONTRACT_ID left join lb_contract_info lci on lci.id = lul.CONTRACT_ID where cf.certid = '"+certid+"' and cf.Partner_ = 'Y' and lci.CONTRACT_STATUS >='31' and lci.CONTRACT_STATUS <= '100' and lec.car_attribute = 'head' group by cf.certid";
List<Map<String, String>> gt_car_wjq_number = conn.executeQuery(gt_car_wjq_num);
String gtcarwjqnumber = "";
if(gt_car_wjq_number.size()>0){
gtcarwjqnumber = gt_car_wjq_number.get(0).get("num");
}else {
gtcarwjqnumber = "0";
}
//获取客户为共同承租人剩余租金,罚息
String gt_money_num = "select format(sum(nvl(corpus_over,0)),2) as corpus_over from customer_family cf left join lb_union_lessee lul on cf.PROJECT_ID = cf.PROJECT_ID left join vi_rent_plan vrps on lul.contract_id = vrps.contract_id where cf.certid = '"+certid+"' and cf.Partner_ = 'Y' group by cf.certid";
List<Map<String, String>> gt_money_number = conn.executeQuery(gt_money_num);
String gt_yqmoney_num = "select format(sum(nvl(rent_over, 0)), 2) as yqrent_over from customer_family cf left join lb_union_lessee lul on cf.PROJECT_ID = lul.PROJECT_ID left join vi_rent_plan vrp on lul.contract_id = vrp.contract_id where cf.certid = '"+certid+"' and cf.Partner_ = 'Y' and STR_TO_DATE(vrp.plan_date,'%Y/%m/%d') < now() group by cf.certid";
List<Map<String, String>> gt_yqmoney_number = conn.executeQuery(gt_yqmoney_num);
String gt_rent_over = "";
String gt_yqrent_over = "";
if(gt_money_number.size()>0){
gt_rent_over = gt_money_number.get(0).get("corpus_over");
}else {
gt_rent_over = "0";
//获取共同承租人合同ID
String gtprojid = "select lci.ID from customer_family cf left join lb_contract_info lci on cf.PROJECT_ID = lci.PROJECT_ID where cf.certid = '"+certid+"' and cf.Partner_ = 'Y' and lci.CONTRACT_STATUS <> '101' and lci.CONTRACT_STATUS <> '104'";
List<Map<String, String>> gtproj_id = con.executeQuery(gtprojid);
String gt_proj_id = "";
for (int j = 0; j < gtproj_id.size(); j++) {
if(gtproj_id.size()==j+1){
gt_proj_id = gt_proj_id+"'"+gtproj_id.get(j).get("id")+"'";
}else {
gt_proj_id = gt_proj_id+"'"+gtproj_id.get(j).get("id")+"'"+",";
}
}
//共同承租人取值
String gtgmnumber = "0";
String GT_CLEAN_LEASE_MONEY = "0";
String gt_jq_number = "0";
String gt_wjq_number = "0";
String gtcarnumber = "0";
String gtcarjqnumber = "0";
String gtcarwjqnumber = "0";
BigDecimal gt_rent_over = new BigDecimal(0);
String gt_yqrent_over = "0";
if(!"".equals(gt_proj_id)){
//获取客户为共同承租人订单总数
String gt_gm_nu = "select count(lci.ID) as num from lb_contract_info lci where lci.ID in ("+gt_proj_id+") and lci.CONTRACT_STATUS <> '104' and lci.CONTRACT_STATUS <> '101'";
List<Map<String, String>> gt_gm_number = con.executeQuery(gt_gm_nu);
if(gt_gm_number.size()>0){
gtgmnumber = gt_gm_number.get(0).get("num");
}
//获取客户为共同承租人融资额和
String gt_sum_rz = "select format(sum(nvl(CLEAN_LEASE_MONEY,0)),2) as CLEAN_LEASE_MONEY from lb_contract_info lci left join lc_calc_condition lcc on lcc.CONTRACT_ID = lci.ID where lci.CONTRACT_STATUS >=31 and lci.CONTRACT_STATUS <> '104' and lci.CONTRACT_STATUS <> '101' and lci.ID in ("+gt_proj_id+")";
List<Map<String, String>> gt_rz = con.executeQuery(gt_sum_rz);
if(gt_rz.size()>0){
GT_CLEAN_LEASE_MONEY = gt_rz.get(0).get("clean_lease_money");
}
//获取客户为共同承租人已结清单数
String gt_jq_contract_num = "select count(lci.ID) as num from lb_contract_info lci where lci.ID in ("+gt_proj_id+") and lci.CONTRACT_STATUS in ('100','105')";
List<Map<String, String>> gt_jq_num = con.executeQuery(gt_jq_contract_num);
if(gt_jq_num.size()>0){
gt_jq_number = gt_jq_num.get(0).get("num");
}
//获取客户为共同承租人未结清单数
String gt_wjq_contract_num = "select count(lci.ID) as num from lb_contract_info lci where lci.ID in ("+gt_proj_id+") and lci.CONTRACT_STATUS >=31 and lci.CONTRACT_STATUS < 100";
List<Map<String, String>> gt_wjq_num = con.executeQuery(gt_wjq_contract_num);
if(gt_wjq_num.size()>0){
gt_wjq_number = gt_wjq_num.get(0).get("num");
}
//获取客户为共同承租人车辆总和
String gt_car_num = "select count(lec.ID) as num from lb_contract_info lci left join lb_equipment_car lec on lec.CONTRACT_ID = lci.ID where lci.CONTRACT_STATUS in ('100','105') and lec.car_attribute = 'head' and lci.ID in ("+gt_proj_id+")";
List<Map<String, String>> gt_car_number = con.executeQuery(gt_car_num);
if(gt_car_number.size()>0){
gtcarnumber = gt_car_number.get(0).get("num");
}
//获取客户为共同承租人结清车辆总和
String gt_car_jq_num = "select count(lci.ID) as num from lb_contract_info lci where lci.ID in ("+gt_proj_id+") and lci.CONTRACT_STATUS in ('100','105')";
List<Map<String, String>> gt_car_jq_number = con.executeQuery(gt_car_jq_num);
if(gt_car_jq_number.size()>0){
gtcarjqnumber = gt_car_jq_number.get(0).get("num");
}
//获取客户为共同承租人未结清车辆总和
String gt_car_wjq_num = "select count(lec.ID) as num from lb_contract_info lci left join lb_equipment_car lec on lec.CONTRACT_ID = lci.ID where lci.CONTRACT_STATUS >=31 and lci.CONTRACT_STATUS < 100 and lec.car_attribute = 'head' and lci.ID in ("+gt_proj_id+")";
List<Map<String, String>> gt_car_wjq_number = con.executeQuery(gt_car_wjq_num);
if(gt_car_wjq_number.size()>0){
gtcarwjqnumber = gt_car_wjq_number.get(0).get("num");
}
//获取客户为共同承租人剩余租金,罚息
//总实收
String ssgt_money_num = "select replace(format(sum(nvl(lri.corpus,0)),2),',','') as corpus from lc_rent_income lri where lri.CONTRACT_ID in ("+gt_proj_id+")";
List<Map<String, String>> ssgt_money_number = con.executeQuery(ssgt_money_num);
BigDecimal ssgt_money = new BigDecimal(0);
if(ssgt_money_number.get(0).get("corpus")!=null||!"".equals(ssgt_money_number.get(0).get("corpus"))){
ssgt_money = new BigDecimal(ssgt_money_number.get(0).get("corpus"));
}
//总剩余本金
gt_rent_over = new BigDecimal(GT_CLEAN_LEASE_MONEY.replace(",","")).subtract(ssgt_money);
String gt_yqmoney_num = "select format(sum(lrp.rent-nvl(t.RENT,0)),2) as yqrent_over from \n" +
"lc_rent_plan lrp\n" +
"left join (select CONTRACT_ID,lri.PLAN_LIST,sum(RENT) as RENT from lc_rent_income lri where lri.CONTRACT_ID in ("+gt_proj_id+") group by lri.CONTRACT_ID,lri.PLAN_LIST) t \n" +
" on t.CONTRACT_ID = lrp.CONTRACT_ID and t.PLAN_LIST = lrp.PLAN_LIST \n" +
"where STR_TO_DATE(lrp.plan_date,'%Y/%m/%d') < now()\n" +
"\tand lrp.contract_id in ("+gt_proj_id+")";
List<Map<String, String>> gt_yqmoney_number = con.executeQuery(gt_yqmoney_num);
if(gt_yqmoney_number.size()>0){
gt_yqrent_over = gt_yqmoney_number.get(0).get("yqrent_over");
}else {
gt_yqrent_over = "0";
}
//获取客户为担保人订单总数
String db_gm_nu = "select count(lgu.id) as num from lb_guarantee_unit lgu where lgu.certid = '"+certid+"' group by lgu.certid";
List<Map<String, String>> db_gm_number = conn.executeQuery(db_gm_nu);
String dbgmnumber = "";
if(db_gm_number.size()>0){
dbgmnumber = db_gm_number.get(0).get("num");
}else {
dbgmnumber = "0";
}
//获取客户为担保人融资额和
String db_sum_rz = "select format(sum(nvl(CLEAN_LEASE_MONEY,0)),2) as CLEAN_LEASE_MONEY from lb_guarantee_unit lgu left join lb_contract_info lci on lci.id = lgu.CONTRACT_ID left join lc_calc_condition lcc on lcc.CONTRACT_ID = lgu.CONTRACT_ID where lgu.certid = '"+certid+"' and lci.CONTRACT_STATUS >=31 and lci.CONTRACT_STATUS <> '104' group by lgu.certid";
List<Map<String, String>> db_rz = conn.executeQuery(db_sum_rz);
String DB_CLEAN_LEASE_MONEY = "";
if(db_rz.size()>0){
DB_CLEAN_LEASE_MONEY = db_rz.get(0).get("clean_lease_money");
}else {
DB_CLEAN_LEASE_MONEY = "0";
}
//获取客户为担保人已结清单数
String db_jq_contract_num = "select count(lci.ID) as num from lb_guarantee_unit lgu left join lb_contract_info lci on lci.id = lgu.CONTRACT_ID where lgu.certid = '"+certid+"' and lci.CONTRACT_STATUS in ('100','105') group by lgu.certid";
List<Map<String, String>> db_jq_num = conn.executeQuery(db_jq_contract_num);
String db_jq_number = "";
if(db_jq_num.size()>0){
db_jq_number = db_jq_num.get(0).get("num");
}else {
db_jq_number = "0";
}
//获取客户为担保人未结清单数
String db_wjq_contract_num = "select count(lci.ID) as num from lb_guarantee_unit lgu left join lb_contract_info lci on lci.id = lgu.CONTRACT_ID where lgu.certid = '"+certid+"' and lci.CONTRACT_STATUS >=31 and lci.CONTRACT_STATUS <= 100 group by lgu.certid";
List<Map<String, String>> db_wjq_num = conn.executeQuery(db_wjq_contract_num);
String db_wjq_number = "";
if(db_wjq_num.size()>0){
db_wjq_number = db_wjq_num.get(0).get("num");
}else {
db_wjq_number = "0";
}
//获取客户为担保人车辆总和
String db_car_num = "select count(lec.ID) as num from lb_guarantee_unit lgu left join lb_equipment_car lec on lec.CONTRACT_ID = lgu.CONTRACT_ID where lgu.certid = '"+certid+"' and lec.car_attribute = 'head' group by lgu.certid";
List<Map<String, String>> db_car_number = conn.executeQuery(db_car_num);
String dbcarnumber = "";
if(db_car_number.size()>0){
dbcarnumber = db_car_number.get(0).get("num");
}else {
dbcarnumber = "0";
}
//获取客户为担保人结清车辆总和
String db_car_jq_num = "select count(lec.ID) as num from lb_guarantee_unit lgu left join lb_equipment_car lec on lec.CONTRACT_ID = lgu.CONTRACT_ID left join lb_contract_info lci on lci.id = lgu.CONTRACT_ID where lgu.certid = '"+certid+"' and lci.CONTRACT_STATUS in ('100','105') and lec.car_attribute = 'head' group by lgu.certid";
List<Map<String, String>> db_car_jq_number = conn.executeQuery(db_car_jq_num);
String dbcarjqnumber = "";
if(db_car_jq_number.size()>0){
dbcarjqnumber = db_car_jq_number.get(0).get("num");
}else {
dbcarjqnumber = "0";
}
//获取客户为担保人结清车辆总和
String db_car_wjq_num = "select count(lec.ID) as num from lb_guarantee_unit lgu left join lb_equipment_car lec on lec.CONTRACT_ID = lgu.CONTRACT_ID left join lb_contract_info lci on lci.id = lgu.CONTRACT_ID where lgu.certid = '"+certid+"' and lci.CONTRACT_STATUS >='31' and lci.CONTRACT_STATUS <= '100' and lec.car_attribute = 'head' group by lgu.certid";
List<Map<String, String>> db_car_wjq_number = conn.executeQuery(db_car_wjq_num);
String dbcarwjqnumber = "";
if(db_car_wjq_number.size()>0){
dbcarwjqnumber = db_car_wjq_number.get(0).get("num");
}else {
dbcarwjqnumber = "0";
}
//获取客户为担保人剩余租金,罚息
String db_money_num = "select format(sum(nvl(corpus_over, 0)), 2) as corpus_over from lb_guarantee_unit lgu left join vi_rent_plan vrp on lgu.contract_id = vrp.contract_id where lgu.certid = '"+certid+"' group by lgu.certid";
List<Map<String, String>> db_money_number = conn.executeQuery(db_money_num);
String db_yqmoney_num = "select format(sum(nvl(rent_over, 0)), 2) as yqrent_over from lb_guarantee_unit lgu left join vi_rent_plan vrp on lgu.contract_id = vrp.contract_id where lgu.certid = '"+certid+"' and STR_TO_DATE(vrp.plan_date,'%Y/%m/%d') < now() group by lgu.certid";
List<Map<String, String>> db_yqmoney_number = conn.executeQuery(db_yqmoney_num);
String db_rent_over = "";
String db_yqrent_over = "";
if(db_money_number.size()>0){
db_rent_over = db_money_number.get(0).get("corpus_over");
}else {
db_rent_over = "0";
//获取担保人合同ID
String dbprojid = "select lci.id from lb_guarantee_unit lgu left join lb_contract_info lci on lci.ID = lgu.CONTRACT_ID where lgu.certid = '"+certid+"' and lci.CONTRACT_STATUS <> '101' and lci.CONTRACT_STATUS <> '104'";
List<Map<String, String>> dbproj_id = con.executeQuery(dbprojid);
String db_proj_id = "";
for (int j = 0; j < dbproj_id.size(); j++) {
if(dbproj_id.size()==j+1){
db_proj_id = db_proj_id+"'"+dbproj_id.get(j).get("id")+"'";
}else {
db_proj_id = db_proj_id+"'"+dbproj_id.get(j).get("id")+"'"+",";
}
}
//担保人取值
String dbgmnumber = "0";
String DB_CLEAN_LEASE_MONEY = "0";
String db_jq_number = "0";
String db_wjq_number = "0";
String dbcarnumber = "0";
String dbcarjqnumber = "0";
String dbcarwjqnumber = "0";
BigDecimal db_rent_over = new BigDecimal(0);
String db_yqrent_over = "0";
if(!"".equals(db_proj_id)){
//获取客户为担保人订单总数
String db_gm_nu = "select count(lci.ID) as num from lb_contract_info lci where lci.ID in ("+db_proj_id+")";
List<Map<String, String>> db_gm_number = con.executeQuery(db_gm_nu);
if(db_gm_number.size()>0){
dbgmnumber = db_gm_number.get(0).get("num");
}
//获取客户为担保人融资额和
String db_sum_rz = "select format(sum(nvl(CLEAN_LEASE_MONEY,0)),2) as CLEAN_LEASE_MONEY from lb_contract_info lci left join lc_calc_condition lcc on lcc.CONTRACT_ID = lci.ID where lci.CONTRACT_STATUS >=31 and lci.CONTRACT_STATUS <> '104' and lci.CONTRACT_STATUS <> '101' and lci.ID in ("+db_proj_id+")";
List<Map<String, String>> db_rz = con.executeQuery(db_sum_rz);
if(db_rz.size()>0){
DB_CLEAN_LEASE_MONEY = db_rz.get(0).get("clean_lease_money");
}
//获取客户为担保人已结清单数
String db_jq_contract_num = "select count(lci.ID) as num from lb_contract_info lci where lci.ID in ("+db_proj_id+") and lci.CONTRACT_STATUS in ('100','105')";
List<Map<String, String>> db_jq_num = con.executeQuery(db_jq_contract_num);
if(db_jq_num.size()>0){
db_jq_number = db_jq_num.get(0).get("num");
}
//获取客户为担保人未结清单数
String db_wjq_contract_num = "select count(lci.ID) as num from lb_contract_info lci where lci.ID in ("+db_proj_id+") and lci.CONTRACT_STATUS >=31 and lci.CONTRACT_STATUS < 100";
List<Map<String, String>> db_wjq_num = con.executeQuery(db_wjq_contract_num);
if(db_wjq_num.size()>0){
db_wjq_number = db_wjq_num.get(0).get("num");
}
//获取客户为担保人车辆总和
String db_car_num = "select count(lec.ID) as num from lb_contract_info lci left join lb_equipment_car lec on lec.CONTRACT_ID = lci.ID where lci.CONTRACT_STATUS in ('100','105') and lec.car_attribute = 'head' and lci.ID in ("+db_proj_id+")";
List<Map<String, String>> db_car_number = con.executeQuery(db_car_num);
if(db_car_number.size()>0){
dbcarnumber = db_car_number.get(0).get("num");
}
//获取客户为担保人结清车辆总和
String db_car_jq_num = "select count(lci.ID) as num from lb_contract_info lci where lci.ID in ("+db_proj_id+") and lci.CONTRACT_STATUS in ('100','105')";
List<Map<String, String>> db_car_jq_number = con.executeQuery(db_car_jq_num);
if(db_car_jq_number.size()>0){
dbcarjqnumber = db_car_jq_number.get(0).get("num");
}
//获取客户为担保人未结清车辆总和
String db_car_wjq_num = "select count(lec.ID) as num from lb_contract_info lci left join lb_equipment_car lec on lec.CONTRACT_ID = lci.ID where lci.CONTRACT_STATUS >=31 and lci.CONTRACT_STATUS < 100 and lec.car_attribute = 'head' and lci.ID in ("+db_proj_id+")";
List<Map<String, String>> db_car_wjq_number = con.executeQuery(db_car_wjq_num);
if(db_car_wjq_number.size()>0){
dbcarwjqnumber = db_car_wjq_number.get(0).get("num");
}
//获取客户为担保人剩余租金,罚息
//总实收
String ssdb_money_num = "select replace(format(sum(nvl(lri.corpus,0)),2),',','') as corpus from lc_rent_income lri where lri.CONTRACT_ID in ("+db_proj_id+")";
List<Map<String, String>> ssdb_money_number = con.executeQuery(ssdb_money_num);
BigDecimal ssdb_money = new BigDecimal(0);
if(ssdb_money_number.get(0).get("corpus") != null || !"".equals(ssdb_money_number.get(0).get("corpus"))){
ssdb_money = new BigDecimal(ssdb_money_number.get(0).get("corpus"));
}
//总剩余本金
db_rent_over = new BigDecimal(DB_CLEAN_LEASE_MONEY.replace(",","")).subtract(ssdb_money);
String db_yqmoney_num = "select format(sum(lrp.rent-nvl(t.RENT,0)),2) as yqrent_over from \n" +
"lc_rent_plan lrp\n" +
"left join (select CONTRACT_ID,lri.PLAN_LIST,sum(RENT) as RENT from lc_rent_income lri where lri.CONTRACT_ID in ("+db_proj_id+") group by lri.CONTRACT_ID,lri.PLAN_LIST) t \n" +
" on t.CONTRACT_ID = lrp.CONTRACT_ID and t.PLAN_LIST = lrp.PLAN_LIST \n" +
"where STR_TO_DATE(lrp.plan_date,'%Y/%m/%d') < now()\n" +
"\tand lrp.contract_id in ("+db_proj_id+")";
List<Map<String, String>> db_yqmoney_number = con.executeQuery(db_yqmoney_num);
if(db_yqmoney_number.size()>0){
db_yqrent_over = db_yqmoney_number.get(0).get("yqrent_over");
}else {
db_yqrent_over = "0";
}
}
//客户敞口计算
Transaction sqlca = Transaction.createTransaction(tx);
BigDecimal exposureMoney = LBBusinessPrimary.obtainExposureMoney(sqlca,flowunid);
@ -305,10 +343,10 @@ public class InsertCustomerHistoryInfo {
exposureMoney = BigDecimal.valueOf(0);
}
//录入客户历史信息表
String ssql = "insert into customer_history_info_temp(id,customerid,customername,certtype,certid,customertype,customer_num,flowunid,project_id,clientbuynumber,clientfinancingamount,clientclosedaccount,clientunsettled,clientvehiclepopulation,clientclosedvehicle,clientoutstandingvehicle,clientloanbalance,clientoverdueamount,jointlybuynumber,jointlyfinancingamount,jointlyclosedaccount,jointlyunsettled,jointlyveh,jointlyclosedvehicle,jointlyout,jointlyloanbalance,jointlyoverdueamount,guaranteebuynumber,guaranteefin,guaranteeclosedaccount,guaranteeunsettled,guaranteeveh,guaranteeclosedvehicle,guaranteeout,guaranteeloanbalance,guaranteeoverdueamount,exposure)"+
String ssql = "insert into customer_history_info_temp(id,customerid,customername,certtype,certid,customertype,customer_num,flowunid,project_id,clientbuynumber,clientfinancingamount,clientclosedaccount,clientunsettled,clientvehiclepopulation,clientclosedvehicle,clientoutstandingvehicle,clientloanbalance,clientoverdueamount,jointlybuynumber,jointlyfinancingamount,jointlyclosedaccount,jointlyunsettled,jointlyveh,jointlyclosedvehicle,jointlyout,jointlyloanbalance,jointlyoverdueamount,guaranteebuynumber,guaranteefin,guaranteeclosedaccount,guaranteeunsettled,guaranteeveh,guaranteeclosedvehicle,guaranteeout,guaranteeloanbalance,guaranteeoverdueamount,exposure,inputtime)"+
"VALUES(replace(uuid(),'-',''),'"+customerinfo.get(i).get("customerid")+"','"+customerinfo.get(i).get("customername")+"','"+customerinfo.get(i).get("certtype")+"','"+customerinfo.get(i).get("certid")+"','"+customerinfo.get(i).get("customertype")+"','"+customerinfo.get(i).get("customer_num")+"','"+flowunid+"','"+customerinfo.get(i).get("project_id")+"','"+gmnum+"','"+CLEAN_LEASE_MONEY+"','"+jq_number+"','"+wjq_number+"','"+carnumber+"','"+carjqnumber+"','"+carwjqnumber+"','"+czr_rent_over+"','"+czr_yqrent_over+"',"+
"'"+gtgmnumber+"','"+GT_CLEAN_LEASE_MONEY+"','"+gt_jq_number+"','"+gt_wjq_number+"','"+gtcarnumber+"','"+gtcarjqnumber+"','"+gtcarwjqnumber+"','"+gt_rent_over+"','"+gt_yqrent_over+"',"+
"'"+dbgmnumber+"','"+DB_CLEAN_LEASE_MONEY+"','"+db_jq_number+"','"+db_wjq_number+"','"+dbcarnumber+"','"+dbcarjqnumber+"','"+dbcarwjqnumber+"','"+db_rent_over+"','"+db_yqrent_over+"','"+exposureMoney+"')";
"'"+dbgmnumber+"','"+DB_CLEAN_LEASE_MONEY+"','"+db_jq_number+"','"+db_wjq_number+"','"+dbcarnumber+"','"+dbcarjqnumber+"','"+dbcarwjqnumber+"','"+db_rent_over+"','"+db_yqrent_over+"','"+exposureMoney+"',replace(now(),'-','/'))";
SqlObject sqlObject = new SqlObject(ssql);
sqlca.executeSQL(sqlObject);
@ -329,11 +367,12 @@ public class InsertCustomerHistoryInfo {
Conn conn = new Conn(tx);
String flowunid = this.flowunid;
//获取客户基本信息
String sql = "select ci.customerid,ci.customername,ci.certtype,ci.certid,'主承租人' as customertype,ci.customer_num,lul.FLOWUNID,lul.project_id from customer_info ci left join lb_union_lessee_temp lul on lul.customer_id = ci.customerid where lul.IS_MAIN = 'Y' and lul.FLOWUNID = '" + flowunid + "' \n" +
String sql = "select cpt.customerid,cpt.FULLNAME as customername,cpt.certtype,cpt.certid,'主承租人' as customertype,'' as customer_num,lul.FLOWUNID,lul.project_id from customer_person_temp cpt left join lb_union_lessee_temp lul on cpt.FLOWUNID = lul.FLOWUNID where lul.IS_MAIN = 'Y' and lul.FLOWUNID = '"+flowunid+"' \n" +
"union \n" +
"select lgu.ASSUROR as customerid,lgu.FULLNAME as customername,lgu.CERTTYPE,lgu.certid,'担保人' as customertype,'' as customer_num,lgu.FLOWUNID,lgu.project_id from lb_guarantee_unit_temp lgu where lgu.FLOWUNID = '" + flowunid + "'\n" +
"select lgu.ASSUROR as customerid,lgu.FULLNAME as customername,lgu.CERTTYPE,lgu.certid,'担保人' as customertype,'' as customer_num,lgu.FLOWUNID,lgu.project_id from lb_guarantee_unit_temp lgu where lgu.FLOWUNID = '"+flowunid+"'\n" +
"union \n" +
"select '' as customerid,cf.name as customername,cf.CERTTYPE,cf.certid,'共同承租人' as customertype,'' as customer_num,cf.FLOWUNID,cf.PROJECT_ID from customer_family_temp cf where cf.FLOWUNID = '" + flowunid + "'\n";
"select '' as customerid,cf.name as customername,cf.CERTTYPE,cf.certid,'共同承租人' as customertype,'' as customer_num,cf.FLOWUNID,cf.PROJECT_ID from customer_family_temp cf where cf.FLOWUNID = '"+flowunid+"'";
List<Map<String, String>> customerinfo = conn.executeQuery(sql);
@ -373,4 +412,344 @@ public class InsertCustomerHistoryInfo {
}
public static Map CustomerHistoryInfo(String flowunid,String certid) throws Exception {
//承租人参数
String gmnum = "0";
String CLEAN_LEASE_MONEY = "0";
String jq_number = "0";
String wjq_number = "0";
String carnumber = "0";
String carjqnumber = "0";
String carwjqnumber = "0";
BigDecimal czr_rent_over = new BigDecimal(0);
String czr_yqrent_over = "0";
//共同申请人参数
String gtgmnumber = "0";
String GT_CLEAN_LEASE_MONEY = "0";
String gt_jq_number = "0";
String gt_wjq_number = "0";
String gtcarnumber = "0";
String gtcarjqnumber = "0";
String gtcarwjqnumber = "0";
BigDecimal gt_rent_over = new BigDecimal(0);
String gt_yqrent_over = "0";
//担保人参数
String dbgmnumber = "0";
String DB_CLEAN_LEASE_MONEY = "0";
String db_jq_number = "0";
String db_wjq_number = "0";
String dbcarnumber = "0";
String dbcarjqnumber = "0";
String dbcarwjqnumber = "0";
BigDecimal db_rent_over = new BigDecimal(0);
String db_yqrent_over = "0";
//敞口
BigDecimal exposureMoney = new BigDecimal(0);
try {
JBOTransaction tx = JBOFactory.createJBOTransaction();
Conn con = new Conn(tx);
//根据证件号获取合同ID
//获取主承租人合同ID
String czrprojid = "select lul.CONTRACT_ID from customer_person cp left join lb_union_lessee lul on cp.CUSTOMERID = lul.CUSTOMER_ID left join lb_contract_info lci on lul.CONTRACT_ID = lci.ID where cp.CERTID = '" + certid + "' and lul.CONTRACT_ID <> '' and lul.IS_MAIN = 'Y' and lci.CONTRACT_STATUS <> '101' and lci.CONTRACT_STATUS <> '104'";
List<Map<String, String>> czrproj_id = con.executeQuery(czrprojid);
String czr_proj_id = "";
for (int j = 0; j < czrproj_id.size(); j++) {
if (czrproj_id.size() == j + 1) {
czr_proj_id = czr_proj_id + "'" + czrproj_id.get(j).get("contract_id") + "'";
} else {
czr_proj_id = czr_proj_id + "'" + czrproj_id.get(j).get("contract_id") + "'" + ",";
}
}
//主承租人取值
if (!"".equals(czr_proj_id)) {
//获取客户为主承租人订单总数
String gm_nu = "select count(lci.id) as num from lb_contract_info lci where lci.id in (" + czr_proj_id + ") and lci.CONTRACT_STATUS <> '104' and lci.CONTRACT_STATUS <> '101'";
List<Map<String, String>> gm_number = con.executeQuery(gm_nu);
if (gm_number.size() > 0) {
gmnum = gm_number.get(0).get("num");
}
///获取客户为主承租融资金额和
String sum_rz = "select format(sum(nvl(CLEAN_LEASE_MONEY,0)),2) as CLEAN_LEASE_MONEY from lb_contract_info lci left join lc_calc_condition lcc on lcc.CONTRACT_ID = lci.ID where lci.CONTRACT_STATUS >=31 and lci.CONTRACT_STATUS <> '104' and lci.CONTRACT_STATUS <> '101' and lci.ID in (" + czr_proj_id + ")";
List<Map<String, String>> rz = con.executeQuery(sum_rz);
if (rz.size() > 0) {
CLEAN_LEASE_MONEY = rz.get(0).get("clean_lease_money");
}
//获取客户为主承租已结清合同数
String jq_contract_num = "select count(lci.ID) as num from lb_contract_info lci where lci.ID in (" + czr_proj_id + ") and lci.CONTRACT_STATUS in ('100','105')";
List<Map<String, String>> jq_num = con.executeQuery(jq_contract_num);
if (jq_num.size() > 0) {
jq_number = jq_num.get(0).get("num");
}
//获取客户为主承租未结清合同数
String wjq_contract_num = "select count(lci.ID) as num from lb_contract_info lci where lci.ID in (" + czr_proj_id + ") and lci.CONTRACT_STATUS >=31 and lci.CONTRACT_STATUS < 100";
List<Map<String, String>> wjq_num = con.executeQuery(wjq_contract_num);
if (wjq_num.size() > 0) {
wjq_number = wjq_num.get(0).get("num");
}
//获取客户为主承租车辆总和
String car_num = "select count(lec.ID) as num from lb_contract_info lci left join lb_equipment_car lec on lec.CONTRACT_ID = lci.id where lci.id in (" + czr_proj_id + ") and lec.car_attribute = 'head'";
List<Map<String, String>> car_number = con.executeQuery(car_num);
if (car_number.size() > 0) {
carnumber = car_number.get(0).get("num");
}
//获取客户为主承租结清车辆总和
String car_jq_num = "select count(lec.ID) as num from lb_contract_info lci left join lb_equipment_car lec on lec.CONTRACT_ID = lci.ID where lci.CONTRACT_STATUS in ('100','105') and lec.car_attribute = 'head' and lci.ID in (" + czr_proj_id + ")";
List<Map<String, String>> car_jq_number = con.executeQuery(car_jq_num);
if (car_jq_number.size() > 0) {
carjqnumber = car_jq_number.get(0).get("num");
}
//获取客户为主承租未结清车辆总和
String car_wjq_num = "select count(lec.ID) as num from lb_contract_info lci left join lb_equipment_car lec on lec.CONTRACT_ID = lci.ID where lci.CONTRACT_STATUS >=31 and lci.CONTRACT_STATUS < 100 and lec.car_attribute = 'head' and lci.ID in (" + czr_proj_id + ")";
List<Map<String, String>> car_wjq_number = con.executeQuery(car_wjq_num);
if (car_wjq_number.size() > 0) {
carwjqnumber = car_wjq_number.get(0).get("num");
}
//获取客户为主承租剩余租金,逾期租金
//总实收
String ssmoney_num = "select replace(format(sum(nvl(lri.corpus,0)),2),',','') as corpus from lc_rent_income lri where lri.CONTRACT_ID in (" + czr_proj_id + ")";
List<Map<String, String>> ssmoney_number = con.executeQuery(ssmoney_num);
BigDecimal ssmoney = new BigDecimal(0);
if (ssmoney_number.get(0).get("corpus") != null || !"".equals(ssmoney_number.get(0).get("corpus"))) {
ssmoney = new BigDecimal(ssmoney_number.get(0).get("corpus"));
}
//剩余本金
czr_rent_over = new BigDecimal(CLEAN_LEASE_MONEY.replace(",", "")).subtract(ssmoney);
String yqmoney_num = "select format(sum(lrp.rent-nvl(t.RENT,0)),2) as yqrent_over from \n" +
"lc_rent_plan lrp\n" +
"left join (select CONTRACT_ID,lri.PLAN_LIST,sum(RENT) as RENT from lc_rent_income lri where lri.CONTRACT_ID in (" + czr_proj_id + ") group by lri.CONTRACT_ID,lri.PLAN_LIST) t \n" +
" on t.CONTRACT_ID = lrp.CONTRACT_ID and t.PLAN_LIST = lrp.PLAN_LIST \n" +
"where STR_TO_DATE(lrp.plan_date,'%Y/%m/%d') < now()\n" +
"\tand lrp.contract_id in (" + czr_proj_id + ")";
List<Map<String, String>> yqmoney_number = con.executeQuery(yqmoney_num);
if (yqmoney_number.size() > 0) {
czr_yqrent_over = yqmoney_number.get(0).get("yqrent_over");
} else {
czr_yqrent_over = "0";
}
}
//获取共同承租人合同ID
String gtprojid = "select lci.ID from customer_family cf left join lb_contract_info lci on cf.PROJECT_ID = lci.PROJECT_ID where cf.certid = '" + certid + "' and cf.Partner_ = 'Y' and lci.CONTRACT_STATUS <> '101' and lci.CONTRACT_STATUS <> '104'";
List<Map<String, String>> gtproj_id = con.executeQuery(gtprojid);
String gt_proj_id = "";
for (int j = 0; j < gtproj_id.size(); j++) {
if (gtproj_id.size() == j + 1) {
gt_proj_id = gt_proj_id + "'" + gtproj_id.get(j).get("id") + "'";
} else {
gt_proj_id = gt_proj_id + "'" + gtproj_id.get(j).get("id") + "'" + ",";
}
}
//共同承租人取值
if (!"".equals(gt_proj_id)) {
//获取客户为共同承租人订单总数
String gt_gm_nu = "select count(lci.ID) as num from lb_contract_info lci where lci.ID in (" + gt_proj_id + ") and lci.CONTRACT_STATUS <> '104' and lci.CONTRACT_STATUS <> '101'";
List<Map<String, String>> gt_gm_number = con.executeQuery(gt_gm_nu);
if (gt_gm_number.size() > 0) {
gtgmnumber = gt_gm_number.get(0).get("num");
}
//获取客户为共同承租人融资额和
String gt_sum_rz = "select format(sum(nvl(CLEAN_LEASE_MONEY,0)),2) as CLEAN_LEASE_MONEY from lb_contract_info lci left join lc_calc_condition lcc on lcc.CONTRACT_ID = lci.ID where lci.CONTRACT_STATUS >=31 and lci.CONTRACT_STATUS <> '104' and lci.CONTRACT_STATUS <> '101' and lci.ID in (" + gt_proj_id + ")";
List<Map<String, String>> gt_rz = con.executeQuery(gt_sum_rz);
if (gt_rz.size() > 0) {
GT_CLEAN_LEASE_MONEY = gt_rz.get(0).get("clean_lease_money");
}
//获取客户为共同承租人已结清单数
String gt_jq_contract_num = "select count(lci.ID) as num from lb_contract_info lci where lci.ID in (" + gt_proj_id + ") and lci.CONTRACT_STATUS in ('100','105')";
List<Map<String, String>> gt_jq_num = con.executeQuery(gt_jq_contract_num);
if (gt_jq_num.size() > 0) {
gt_jq_number = gt_jq_num.get(0).get("num");
}
//获取客户为共同承租人未结清单数
String gt_wjq_contract_num = "select count(lci.ID) as num from lb_contract_info lci where lci.ID in (" + gt_proj_id + ") and lci.CONTRACT_STATUS >=31 and lci.CONTRACT_STATUS < 100";
List<Map<String, String>> gt_wjq_num = con.executeQuery(gt_wjq_contract_num);
if (gt_wjq_num.size() > 0) {
gt_wjq_number = gt_wjq_num.get(0).get("num");
}
//获取客户为共同承租人车辆总和
String gt_car_num = "select count(lec.ID) as num from lb_contract_info lci left join lb_equipment_car lec on lec.CONTRACT_ID = lci.ID where lci.CONTRACT_STATUS in ('100','105') and lec.car_attribute = 'head' and lci.ID in (" + gt_proj_id + ")";
List<Map<String, String>> gt_car_number = con.executeQuery(gt_car_num);
if (gt_car_number.size() > 0) {
gtcarnumber = gt_car_number.get(0).get("num");
}
//获取客户为共同承租人结清车辆总和
String gt_car_jq_num = "select count(lci.ID) as num from lb_contract_info lci where lci.ID in (" + gt_proj_id + ") and lci.CONTRACT_STATUS in ('100','105')";
List<Map<String, String>> gt_car_jq_number = con.executeQuery(gt_car_jq_num);
if (gt_car_jq_number.size() > 0) {
gtcarjqnumber = gt_car_jq_number.get(0).get("num");
}
//获取客户为共同承租人未结清车辆总和
String gt_car_wjq_num = "select count(lec.ID) as num from lb_contract_info lci left join lb_equipment_car lec on lec.CONTRACT_ID = lci.ID where lci.CONTRACT_STATUS >=31 and lci.CONTRACT_STATUS < 100 and lec.car_attribute = 'head' and lci.ID in (" + gt_proj_id + ")";
List<Map<String, String>> gt_car_wjq_number = con.executeQuery(gt_car_wjq_num);
if (gt_car_wjq_number.size() > 0) {
gtcarwjqnumber = gt_car_wjq_number.get(0).get("num");
}
//获取客户为共同承租人剩余租金,罚息
//总实收
String ssgt_money_num = "select replace(format(sum(nvl(lri.corpus,0)),2),',','') as corpus from lc_rent_income lri where lri.CONTRACT_ID in (" + gt_proj_id + ")";
List<Map<String, String>> ssgt_money_number = con.executeQuery(ssgt_money_num);
BigDecimal ssgt_money = new BigDecimal(0);
if (ssgt_money_number.get(0).get("corpus") != null || !"".equals(ssgt_money_number.get(0).get("corpus"))) {
ssgt_money = new BigDecimal(ssgt_money_number.get(0).get("corpus"));
}
//总剩余本金
gt_rent_over = new BigDecimal(GT_CLEAN_LEASE_MONEY.replace(",", "")).subtract(ssgt_money);
String gt_yqmoney_num = "select format(sum(lrp.rent-nvl(t.RENT,0)),2) as yqrent_over from \n" +
"lc_rent_plan lrp\n" +
"left join (select CONTRACT_ID,lri.PLAN_LIST,sum(RENT) as RENT from lc_rent_income lri where lri.CONTRACT_ID in (" + gt_proj_id + ") group by lri.CONTRACT_ID,lri.PLAN_LIST) t \n" +
" on t.CONTRACT_ID = lrp.CONTRACT_ID and t.PLAN_LIST = lrp.PLAN_LIST \n" +
"where STR_TO_DATE(lrp.plan_date,'%Y/%m/%d') < now()\n" +
"\tand lrp.contract_id in (" + gt_proj_id + ")";
List<Map<String, String>> gt_yqmoney_number = con.executeQuery(gt_yqmoney_num);
if (gt_yqmoney_number.size() > 0) {
gt_yqrent_over = gt_yqmoney_number.get(0).get("yqrent_over");
} else {
gt_yqrent_over = "0";
}
}
//获取担保人合同ID
String dbprojid = "select lci.id from lb_guarantee_unit lgu left join lb_contract_info lci on lci.ID = lgu.CONTRACT_ID where lgu.certid = '" + certid + "' and lci.CONTRACT_STATUS <> '101' and lci.CONTRACT_STATUS <> '104'";
List<Map<String, String>> dbproj_id = con.executeQuery(dbprojid);
String db_proj_id = "";
for (int j = 0; j < dbproj_id.size(); j++) {
if (dbproj_id.size() == j + 1) {
db_proj_id = db_proj_id + "'" + dbproj_id.get(j).get("id") + "'";
} else {
db_proj_id = db_proj_id + "'" + dbproj_id.get(j).get("id") + "'" + ",";
}
}
//担保人取值
if (!"".equals(db_proj_id)) {
//获取客户为担保人订单总数
String db_gm_nu = "select count(lci.ID) as num from lb_contract_info lci where lci.ID in (" + db_proj_id + ")";
List<Map<String, String>> db_gm_number = con.executeQuery(db_gm_nu);
if (db_gm_number.size() > 0) {
dbgmnumber = db_gm_number.get(0).get("num");
}
//获取客户为担保人融资额和
String db_sum_rz = "select format(sum(nvl(CLEAN_LEASE_MONEY,0)),2) as CLEAN_LEASE_MONEY from lb_contract_info lci left join lc_calc_condition lcc on lcc.CONTRACT_ID = lci.ID where lci.CONTRACT_STATUS >=31 and lci.CONTRACT_STATUS <> '104' and lci.CONTRACT_STATUS <> '101' and lci.ID in (" + db_proj_id + ")";
List<Map<String, String>> db_rz = con.executeQuery(db_sum_rz);
if (db_rz.size() > 0) {
DB_CLEAN_LEASE_MONEY = db_rz.get(0).get("clean_lease_money");
}
//获取客户为担保人已结清单数
String db_jq_contract_num = "select count(lci.ID) as num from lb_contract_info lci where lci.ID in (" + db_proj_id + ") and lci.CONTRACT_STATUS in ('100','105')";
List<Map<String, String>> db_jq_num = con.executeQuery(db_jq_contract_num);
if (db_jq_num.size() > 0) {
db_jq_number = db_jq_num.get(0).get("num");
}
//获取客户为担保人未结清单数
String db_wjq_contract_num = "select count(lci.ID) as num from lb_contract_info lci where lci.ID in (" + db_proj_id + ") and lci.CONTRACT_STATUS >=31 and lci.CONTRACT_STATUS < 100";
List<Map<String, String>> db_wjq_num = con.executeQuery(db_wjq_contract_num);
if (db_wjq_num.size() > 0) {
db_wjq_number = db_wjq_num.get(0).get("num");
}
//获取客户为担保人车辆总和
String db_car_num = "select count(lec.ID) as num from lb_contract_info lci left join lb_equipment_car lec on lec.CONTRACT_ID = lci.ID where lci.CONTRACT_STATUS in ('100','105') and lec.car_attribute = 'head' and lci.ID in (" + db_proj_id + ")";
List<Map<String, String>> db_car_number = con.executeQuery(db_car_num);
if (db_car_number.size() > 0) {
dbcarnumber = db_car_number.get(0).get("num");
}
//获取客户为担保人结清车辆总和
String db_car_jq_num = "select count(lci.ID) as num from lb_contract_info lci where lci.ID in (" + db_proj_id + ") and lci.CONTRACT_STATUS in ('100','105')";
List<Map<String, String>> db_car_jq_number = con.executeQuery(db_car_jq_num);
if (db_car_jq_number.size() > 0) {
dbcarjqnumber = db_car_jq_number.get(0).get("num");
}
//获取客户为担保人未结清车辆总和
String db_car_wjq_num = "select count(lec.ID) as num from lb_contract_info lci left join lb_equipment_car lec on lec.CONTRACT_ID = lci.ID where lci.CONTRACT_STATUS >=31 and lci.CONTRACT_STATUS < 100 and lec.car_attribute = 'head' and lci.ID in (" + db_proj_id + ")";
List<Map<String, String>> db_car_wjq_number = con.executeQuery(db_car_wjq_num);
if (db_car_wjq_number.size() > 0) {
dbcarwjqnumber = db_car_wjq_number.get(0).get("num");
}
//获取客户为担保人剩余租金,罚息
//总实收
String ssdb_money_num = "select replace(format(sum(nvl(lri.corpus,0)),2),',','') as corpus from lc_rent_income lri where lri.CONTRACT_ID in (" + db_proj_id + ")";
List<Map<String, String>> ssdb_money_number = con.executeQuery(ssdb_money_num);
BigDecimal ssdb_money = new BigDecimal(0);
if (ssdb_money_number.get(0).get("corpus") != null || !"".equals(ssdb_money_number.get(0).get("corpus"))) {
ssdb_money = new BigDecimal(ssdb_money_number.get(0).get("corpus"));
}
//总剩余本金
db_rent_over = new BigDecimal(DB_CLEAN_LEASE_MONEY.replace(",", "")).subtract(ssdb_money);
String db_yqmoney_num = "select format(sum(lrp.rent-nvl(t.RENT,0)),2) as yqrent_over from \n" +
"lc_rent_plan lrp\n" +
"left join (select CONTRACT_ID,lri.PLAN_LIST,sum(RENT) as RENT from lc_rent_income lri where lri.CONTRACT_ID in (" + db_proj_id + ") group by lri.CONTRACT_ID,lri.PLAN_LIST) t \n" +
" on t.CONTRACT_ID = lrp.CONTRACT_ID and t.PLAN_LIST = lrp.PLAN_LIST \n" +
"where STR_TO_DATE(lrp.plan_date,'%Y/%m/%d') < now()\n" +
"\tand lrp.contract_id in (" + db_proj_id + ")";
List<Map<String, String>> db_yqmoney_number = con.executeQuery(db_yqmoney_num);
if (db_yqmoney_number.size() > 0) {
db_yqrent_over = db_yqmoney_number.get(0).get("yqrent_over");
} else {
db_yqrent_over = "0";
}
}
//客户敞口计算
Transaction sqlca = Transaction.createTransaction(tx);
exposureMoney = LBBusinessPrimary.obtainExposureMoney(sqlca, flowunid);
if (exposureMoney == null || "".equals(exposureMoney)) {
exposureMoney = BigDecimal.valueOf(0);
}
} catch (Exception e) {
e.printStackTrace();
}
Map<String, String> map = new HashMap<>();
map.put("clientbuynumber", gmnum);
map.put("clientfinancingamount", CLEAN_LEASE_MONEY);
map.put("clientclosedaccount", jq_number);
map.put("clientunsettled", wjq_number);
map.put("clientvehiclepopulation", carnumber);
map.put("clientclosedvehicle", carjqnumber);
map.put("clientoutstandingvehicle", carwjqnumber);
map.put("clientloanbalance", czr_rent_over.toString());
map.put("clientoverdueamount", czr_yqrent_over);
map.put("jointlybuynumber", gtgmnumber);
map.put("jointlyfinancingamount", GT_CLEAN_LEASE_MONEY);
map.put("jointlyclosedaccount", gt_jq_number);
map.put("jointlyunsettled", gt_wjq_number);
map.put("jointlyveh", gtcarnumber);
map.put("jointlyclosedvehicle", gtcarjqnumber);
map.put("jointlyout", gtcarwjqnumber);
map.put("jointlyloanbalance", gt_rent_over.toString());
map.put("jointlyoverdueamount", gt_yqrent_over);
map.put("guaranteebuynumber", dbgmnumber);
map.put("guaranteefin", DB_CLEAN_LEASE_MONEY);
map.put("guaranteeclosedaccount", db_jq_number);
map.put("guaranteeunsettled", db_wjq_number);
map.put("guaranteeveh", dbcarnumber);
map.put("guaranteeclosedvehicle", dbcarjqnumber);
map.put("guaranteeout", dbcarwjqnumber);
map.put("guaranteeloanbalance", db_rent_over.toString());
map.put("guaranteeoverdueamount", db_yqrent_over);
map.put("exposure", exposureMoney.toString());
return map;
}
}

View File

@ -0,0 +1,103 @@
package com.tenwa.apzl.handle;
import com.amarsoft.are.jbo.BizObject;
import com.amarsoft.are.jbo.JBOFactory;
import com.amarsoft.awe.dw.handler.impl.CommonHandler;
import com.amarsoft.awe.util.ASResultSet;
import com.amarsoft.awe.util.SqlObject;
import com.amarsoft.awe.util.Transaction;
import jbo.app.LB_EQUIPMENT_CAR;
import jbo.app.LB_EQUIPMENT_CAR_TEMP;
import org.apache.commons.lang3.StringUtils;
import java.math.BigDecimal;
import java.util.Optional;
import java.util.stream.Stream;
public class ProjectHisListHandler extends CommonHandler {
@Override
protected void initDisplayForEdit(BizObject bo) throws Exception {
String projectId = bo.getAttribute("PROJECT_ID").getString();
String pageIdentify = this.asPage.getParameter("pageIdentify");
//车辆总数
int carNum = 0;
//合同状态
String statusName = null;
// 角色名称
String roleName = null;
if (StringUtils.isNotBlank(bo.getAttribute("CERTID_WITH_ROLE").getString())) {
String certId = this.asPage.getParameter("certId");
Optional<String> first = Stream.of(bo.getAttribute("CERTID_WITH_ROLE").getString().split(",")).filter(item -> item.indexOf(certId) > -1).findFirst();
if (first.isPresent()) {
roleName = first.get().split("-")[1];
}
}
if (StringUtils.isNotEmpty(projectId)) {
BizObject lbcSingleResult = JBOFactory.createBizObjectQuery(LB_EQUIPMENT_CAR.CLASS_NAME,
"select v.count(1) as v.carNum from O where PROJECT_ID='" + projectId + "' and car_attribute = 'head'")
.getSingleResult(false);
if (lbcSingleResult != null) carNum = lbcSingleResult.getAttribute("carNum").getInt();
Transaction Sqlca = null;
try {
Sqlca = Transaction.createTransaction("als");
ASResultSet asResultSet = Sqlca.getASResultSet(new SqlObject("select concat(fbo.flow_name,'中') as flow_name,flowno from flow_bussiness_object fbo left join flow_object fo on fbo.flow_unid = fo.objectno " +
"where fbo.proj_id = '" + projectId + "' and fo.phaseno not in ('1000')"));
if (asResultSet.next()) {
statusName = asResultSet.getString("flow_name");
} else {
String contractStatus = bo.getAttribute("contract_status").getString();
asResultSet = Sqlca.getASResultSet(new SqlObject("select STATUS_NAME from lb_contract_status where STATUS_CODE = '" + contractStatus + "'"));
if (asResultSet.next()) {
statusName = asResultSet.getString("STATUS_NAME");
}
}
Sqlca.commit();
} catch (Exception e) {
Sqlca.rollback();
}
} else {
// 业务申请数据处理流程中
String flowUnid = bo.getAttribute("FLOWUNID").getString();
BizObject lbctSingleResult = JBOFactory.createBizObjectQuery(LB_EQUIPMENT_CAR_TEMP.CLASS_NAME,
"select v.count(1) as v.carNum from O where flowunid='" + flowUnid + "' and car_attribute = 'head'")
.getSingleResult(false);
if (lbctSingleResult != null) carNum = lbctSingleResult.getAttribute("carNum").getInt();
statusName = bo.getAttribute("CONTRACT_STATUS").getString();
}
bo.setAttributeValue("CAR_NUM", carNum);
bo.setAttributeValue("STATUS_NAME", statusName);
bo.setAttributeValue("ROLE_NAME", roleName);
if ("loan".equals(pageIdentify)) {// 已放款列表
// 本金余额
Transaction Sqlca = null;
String leaseMoney = bo.getAttribute("CLEAN_LEASE_MONEY").getString();
BigDecimal incomeMoney = BigDecimal.ZERO;
String isOverdue = "";
if (StringUtils.isNotBlank(projectId)) {
try {
Sqlca = Transaction.createTransaction("als");
String querySql = "select ifnull(sum(corpus),0) as COUPUS_OVER from lc_rent_income where PROJECT_ID = '" + projectId + "'";
ASResultSet incomeMoneyRs = Sqlca.getASResultSet(new SqlObject(querySql));
if (incomeMoneyRs.next()) {
incomeMoney = incomeMoneyRs.getBigDecimal("COUPUS_OVER");
}
querySql = "select count(1) as over_num from lc_rent_plan where PROJECT_ID = '" + projectId + "' and PLAN_DATE < current_date() and (isnull(COLLECT_STATUS) or COLLECT_STATUS in ('未收款','部分收款','未收款lock'))";
ASResultSet asResultSet = Sqlca.getASResultSet(new SqlObject(querySql));
if (asResultSet.next() && asResultSet.getInt("over_num") > 0) isOverdue = "";
Sqlca.commit();
} catch (Exception e) {
Sqlca.rollback();
}
}
//是否逾期
bo.setAttributeValue("IS_OVERDUE", isOverdue);
//剩余本金
bo.setAttributeValue("COUPUS_OVER", new BigDecimal(leaseMoney).subtract(incomeMoney));
}
}
}

View File

@ -1,35 +1,20 @@
package com.tenwa.lease.flow.project.businessapply;
import com.amarsoft.are.jbo.*;
import com.amarsoft.awe.util.ASResultSet;
import com.amarsoft.awe.util.SqlObject;
import com.amarsoft.awe.util.Transaction;
import com.tenwa.reckon.util.Conn;
import jbo.app.tenwa.customer.CUSTOMER_COMPANY;
import jbo.app.tenwa.customer.CUSTOMER_COMPANY_TEMP;
import jbo.app.tenwa.customer.CUSTOMER_FAMILY;
import jbo.app.tenwa.customer.CUSTOMER_FAMILY_TEMP;
import jbo.app.tenwa.customer.CUSTOMER_PERSON;
import jbo.app.tenwa.customer.CUSTOMER_PERSON_TEMP;
import jbo.app.tenwa.customer.DISTRIBUTOR_INFO;
import jbo.app.tenwa.customer.*;
import jbo.com.tenwa.entity.comm.flow.FLOW_BUSSINESS_OBJECT;
import jbo.com.tenwa.lease.comm.LB_GUARANTEE_UNIT;
import jbo.com.tenwa.lease.comm.LB_GUARANTEE_UNIT_TEMP;
import jbo.com.tenwa.lease.comm.LB_MANY_SUBJECT;
import jbo.com.tenwa.lease.comm.LB_PROJECT_INFO;
import jbo.com.tenwa.lease.comm.LB_PROJECT_INFO_TEMP;
import jbo.sys.CODE_LIBRARY;
import java.text.SimpleDateFormat;
import java.util.Date;
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.JBOException;
import com.amarsoft.are.jbo.JBOFactory;
import com.amarsoft.are.jbo.JBOTransaction;
import com.amarsoft.awe.util.ASResultSet;
import com.amarsoft.awe.util.SqlObject;
import com.amarsoft.awe.util.Transaction;
public class CustomerInfoCheck {
private String CustomerName;
@ -48,7 +33,7 @@ public class CustomerInfoCheck {
private String projectNo;
private String FULLNAME;
private String SubjectId;
public String getFULLNAME() {
return FULLNAME;
}
@ -138,7 +123,7 @@ public class CustomerInfoCheck {
}
return mobileResult;
}
public String checkMobileRepeat(JBOTransaction tx) throws JBOException{//校验手机号是否重复
if(customerType.equals("03")){//自然人
//BizObject mobileP=JBOFactory.createBizObjectQuery(CUSTOMER_PERSON.CLASS_NAME,"mobile=:mobile").setParameter("mobile", this.mobile).getSingleResult(false);
@ -217,12 +202,12 @@ public class CustomerInfoCheck {
// return "手机号跟配偶人手机号重复!";
// }
// }
}
}
}
}
return "SUCCESS";
}
public String checkDebitCardMobile(JBOTransaction tx) throws JBOException{//校验扣款卡手机号
if(customerType.equals("03")){//自然人校验共同人和担保人
BizObject mobilePT=JBOFactory.createBizObjectQuery(CUSTOMER_PERSON_TEMP.CLASS_NAME,"FLOWUNID=:flowunid and mobile=:mobile").setParameter("flowunid", this.flowunid).setParameter("mobile", this.mobile).getSingleResult(false);
@ -243,7 +228,7 @@ public class CustomerInfoCheck {
}
return mobileResult;
}
public String checkSex(JBOTransaction tx) throws Exception{
BizObjectManager cptMange = JBOFactory.getBizObjectManager(CUSTOMER_PERSON_TEMP.CLASS_NAME, tx);
BizObject cpt = cptMange.createQuery("flowunid =:flowunid").setParameter("flowunid", flowunid).getSingleResult(false);
@ -257,7 +242,7 @@ public class CustomerInfoCheck {
}
return "error";
}
public String checkNameAndCertId(JBOTransaction tx)throws Exception{
String CustomerId="";
Transaction Sqlca=null;
@ -323,7 +308,7 @@ public class CustomerInfoCheck {
BizObject cptP = cptManage.createQuery("flowunid=:flowunid").setParameter("flowunid", flowunid).getSingleResult(false);
String MARRIAGE = cptP.getAttribute("MARRIAGE").getString();
String name1 = cft.getAttribute("name").getString();
if("01".equals(MARRIAGE) && name1.equals(FULLNAME)){
return "success";
}else{
@ -353,7 +338,7 @@ public class CustomerInfoCheck {
}
return returns;
}*/
public String getFlowunid() {
return flowunid;
}
@ -432,7 +417,7 @@ public class CustomerInfoCheck {
public void setId(String id) {
this.id = id;
}
public String getProjectNo() {
return projectNo;
}
@ -457,7 +442,7 @@ public class CustomerInfoCheck {
}
return mas;
}
public String checkProjectNo(JBOTransaction tx) throws JBOException{//校验姓名是否存在LB_PROJECT_INFO_TEMP
BizObjectManager lpitManage = JBOFactory.getBizObjectManager(LB_PROJECT_INFO_TEMP.CLASS_NAME, tx);
BizObjectManager lpiManage = JBOFactory.getBizObjectManager(LB_PROJECT_INFO.CLASS_NAME, tx);
@ -473,7 +458,7 @@ public class CustomerInfoCheck {
}else{
return "error";
}
}
return "success";
}
@ -506,6 +491,28 @@ public class CustomerInfoCheck {
}
return msg;
}
/**
* 校验当前证件号是否在本系统参与业务制作走过业务信审就算不包含当前单
* @param tx
* @return
* @throws JBOException
*/
public String checkExistsByCertid(JBOTransaction tx) throws Exception {
Transaction Sqlca = Transaction.createTransaction(tx);
StringBuilder querySqlSb = new StringBuilder();
querySqlSb.append("select sum(num) as allNum from (")
.append(" select count(1) as num from customer_info_temp ci left join flow_task ft on ci.FLOWUNID = ft.objectno and ft.phaseno = '0030' where ci.FLOWUNID <> '"+flowunid+"' and ft.flowno = 'BusinessApplyFlow' and ci.certid = '"+certId+"'")
.append(" union all")
.append(" select count(1) as num from customer_family_temp ci left join flow_task ft on ci.FLOWUNID = ft.objectno and ft.phaseno = '0030' where ci.FLOWUNID <> '"+flowunid+"' and ft.flowno = 'BusinessApplyFlow' and ci.certid = '"+certId+"'")
.append(" union all")
.append(" select count(1) as num from lb_guarantee_unit_temp ci left join flow_task ft on ci.FLOWUNID = ft.objectno and ft.phaseno = '0030' where ci.FLOWUNID <> '"+flowunid+"' and ft.flowno = 'BusinessApplyFlow' and ci.certid = '"+certId+"'")
.append(" ) t");
ASResultSet asResultSet = Sqlca.getASResultSet(new SqlObject(querySqlSb.toString()));
if (asResultSet.next() && asResultSet.getInt("allNum") > 0) return "true";
return "false";
}
//如果是北汽的产品修改FLOW_BUSSINESS_OBJECT中的flow_key
public String changFlowKey(JBOTransaction tx) throws Exception{
BizObjectManager fboManage = JBOFactory.getBizObjectManager(FLOW_BUSSINESS_OBJECT.CLASS_NAME, tx);

View File

@ -111,7 +111,8 @@ public class LBBusinessPrimary extends BaseBussiness {
}
}
//流程中金额获取(当前流程)
String InFlowSql = "select CLEAN_LEASE_MONEY-ifnull(CAUTION_MONEY,0) as inFlowMoney from lc_calc_condition_temp where FLOWUNID = '"+flowUnid+"'";
String InFlowSql = "select CLEAN_LEASE_MONEY-ifnull(CAUTION_MONEY,0) as inFlowMoney from lc_calc_condition_temp lcct " +
" left join flow_object fo on lcct.FLOWUNID = fo.objectno where lcct.FLOWUNID = '"+flowUnid+"' and fo.phaseno not in ('1000')";
ASResultSet rsIn = Sqlca.getASResultSet(new SqlObject(InFlowSql));
BigDecimal inFlowMoney = BigDecimal.valueOf(0);
if (rsIn.next()) {

View File

@ -0,0 +1,40 @@
package com.tenwa.lease.flow.project.commcheck;
import com.amarsoft.awe.util.Transaction;
import com.tenwa.lease.flow.project.businessapply.LBBusinessPrimary;
import com.tenwa.template.check.DefaultBussinessCheck;
import org.apache.commons.lang3.StringUtils;
import java.math.BigDecimal;
/**
* 业务申请-复审敞口校验
*/
public class ReviewExposureCheck extends DefaultBussinessCheck {
@Override
public Object run(Transaction Sqlca) throws Exception {
String flowunid = this.getAttribute("ObjectNo").toString();
String phaseNo = this.getAttribute("PhaseNo").toString();
String custType = Sqlca.getString("select cit.customertype from lb_union_lessee_temp lult join customer_info_temp cit on lult.FLOWUNID = cit.flowunid where lult.FLOWUNID = '" + flowunid + "' and lult.IS_MAIN = 'Y' ");
if (StringUtils.isEmpty(custType)) throw new RuntimeException("客户类型不存在,请联系管理员");
BigDecimal compareMoney = BigDecimal.ZERO;
if ("0040".equals(phaseNo)) {//个人小于等于60万法人小于等于100万 信审复审初级
compareMoney = "03".equals(custType) ? BigDecimal.valueOf(600000) : BigDecimal.valueOf(1000000);
} else if ("0050".equals(phaseNo)) {//个人小于等于100万法人小于等于200万 信审复审中级
compareMoney = "03".equals(custType) ? BigDecimal.valueOf(1000000) : BigDecimal.valueOf(2000000);
} else if ("0051".equals(phaseNo)) {//个人小于等于200万法人小于等于300万 信审复审高级
compareMoney = "03".equals(custType) ? BigDecimal.valueOf(2000000) : BigDecimal.valueOf(3000000);
} else if ("0052".equals(phaseNo)) {//个人小于等于300万法人小于等于500万 信审复审资深
compareMoney = "03".equals(custType) ? BigDecimal.valueOf(3000000) : BigDecimal.valueOf(5000000);
} else if ("0053".equals(phaseNo)) {//个人大于300万法人大于500万 信审会和贷审会
setPass(true);
}
BigDecimal exposureMoney = LBBusinessPrimary.obtainExposureMoney(Sqlca, flowunid);
if (exposureMoney.compareTo(compareMoney) > -1) {
setPass(false);
} else {
setPass(true);
}
return null;
}
}