diff --git a/WebContent/Tenwa/Customer/Lessee/Comm/CustomerHistory/CustomerHistoryInformation.jsp b/WebContent/Tenwa/Customer/Lessee/Comm/CustomerHistory/CustomerHistoryInformation.jsp new file mode 100644 index 000000000..50d0e6b21 --- /dev/null +++ b/WebContent/Tenwa/Customer/Lessee/Comm/CustomerHistory/CustomerHistoryInformation.jsp @@ -0,0 +1,40 @@ +<%@ page contentType="text/html; charset=GBK"%> +<%@ include file="/IncludeBegin.jsp"%> +<% + String flowunid = CurPage.getParameter("ObjectNo"); + String plannumber=CurPage.getParameter("plannumber"); + String planCName=CurPage.getParameter("planCName"); + String calType=CurPage.getParameter("calType"); + String IsHistory=CurPage.getParameter("IsHistory"); + 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 gtcertid = 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 = 'N' and lul.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"); + //客户传参 + String params="flowunid="+flowunid+"&plannumber="+plannumber+"&planCName="+planCName+"&calType="+calType+"&IsHistory="+IsHistory+"&RightType="+RightType+"&ProductId="+productId+"&projectId="+projectId+"&certId="+khcertid+"&type=client"; + //共同承租人传参 + String params2="flowunid="+flowunid+"&plannumber="+plannumber+"&planCName="+planCName+"&calType="+calType+"&IsHistory="+IsHistory+"&RightType="+RightType+"&ProductId="+productId+"&projectId="+projectId+"&certId="+gtcertid+"&type=jointly"; + //担保人1传参 + String params3="flowunid="+flowunid+"&plannumber="+plannumber+"&planCName="+planCName+"&calType="+calType+"&IsHistory="+IsHistory+"&RightType="+RightType+"&ProductId="+productId+"&projectId="+projectId+"&certId="+dbcertid+"&type=guarantee"; + //担保人2参数 + String params4="flowunid="+flowunid+"&plannumber="+plannumber+"&planCName="+planCName+"&calType="+calType+"&IsHistory="+IsHistory+"&RightType="+RightType+"&ProductId="+productId+"&projectId="+projectId+"&certId="+dbcertid2+"&type=guarantee"; + //参数:0.是否显示, 1.标题,2.URL,3,参数串, 4. Strip高度(默认600px),5. 是否有关闭按钮(默认无) 6. 是否缓存(默认是) +// String userid = CurUser.getUserID(); + String orgid = CurUser.getOrgID(); + String sTabStrip[][] = { + {"true", "客户", "/Tenwa/Customer/Lessee/Comm/CustomerHistory/CustomerHistory_Info_temp.jsp",params, "", "", "false"}, + {"true", "共同承租人", "/Tenwa/Customer/Lessee/Comm/CustomerHistory/CustomerHistory_Info_temp.jsp",params2, "", "", "false"}, + {"true", "担保人", "/Tenwa/Customer/Lessee/Comm/CustomerHistory/CustomerHistory_Info_temp.jsp",params3, "", "", "false"}, + {"true", "担保人2", "/Tenwa/Customer/Lessee/Comm/CustomerHistory/CustomerHistory_Info_temp.jsp",params4, "", "", "false"}, + }; +%> +<%@ include file="/Resources/CodeParts/Tab01.jsp"%> + +<%@ include file="/IncludeEnd.jsp"%> \ No newline at end of file diff --git a/WebContent/Tenwa/Customer/Lessee/Comm/CustomerHistory/CustomerHistory_Info_temp.jsp b/WebContent/Tenwa/Customer/Lessee/Comm/CustomerHistory/CustomerHistory_Info_temp.jsp new file mode 100644 index 000000000..57251de50 --- /dev/null +++ b/WebContent/Tenwa/Customer/Lessee/Comm/CustomerHistory/CustomerHistory_Info_temp.jsp @@ -0,0 +1,37 @@ +<%@page import="com.itextpdf.text.log.SysoCounter"%> +<%@ page contentType="text/html; charset=GBK"%> +<%@include file="/Frame/resources/include/include_begin_info.jspf"%><% + /* + Author: undefined 2023-09-04 + Content: 示例详情页面 + History Log: + */ + + String flowunId=CurPage.getParameter("flowunid");//客户编号 + String certId=CurPage.getParameter("certId");//客户证件号 + +// String sPrevUrl = CurPage.getParameter("PrevUrl"); +// if(sPrevUrl == null) sPrevUrl = ""; + + String sTempletNo = "CustomerHistoryInfoTemp";//--模板号-- + ASObjectModel doTemp = new ASObjectModel(sTempletNo); + ASObjectWindow dwTemp = new ASObjectWindow(CurPage, doTemp,request); + dwTemp.setPageSize(10); + dwTemp.Style = "2"; + dwTemp.ReadOnly = "1"; + dwTemp.genHTMLObjectWindow(flowunId+","+certId); + + String compClientID = request.getParameter("CompClientID"); + + dwTemp.replaceColumn("loaned", "", CurPage.getObjectWindowOutput()); + dwTemp.replaceColumn("outstand", "", CurPage.getObjectWindowOutput()); + + String sButtons[][] = { + + }; + +%><%@ include file="/Frame/resources/include/ui/include_info.jspf"%> + +<%@ include file="/Frame/resources/include/include_end.jspf"%> diff --git a/WebContent/Tenwa/Customer/Lessee/Comm/CustomerHistory/LoanedInfo.jsp b/WebContent/Tenwa/Customer/Lessee/Comm/CustomerHistory/LoanedInfo.jsp new file mode 100644 index 000000000..dcd545c5f --- /dev/null +++ b/WebContent/Tenwa/Customer/Lessee/Comm/CustomerHistory/LoanedInfo.jsp @@ -0,0 +1,35 @@ +<%@page import="com.tenwa.comm.dataRightmanager.DataRightManager"%> +<%@ page contentType="text/html; charset=GBK"%> +<%@ include file="/Frame/resources/include/include_begin_list.jspf"%> +<%@include file="/Tenwa/Core/FlowManager/BaseFunction/BaseFlowListFunction.jspf" %> +<% + + String certId = CurPage.getParameter("certId"); + + ASObjectModel doTemp = new ASObjectModel("LoanedList"); + doTemp.appendJboWhere(" and O.CONTRACT_STATUS >= 31 and O.CONTRACT_STATUS <> '104' "); + ASObjectWindow dwTemp = new ASObjectWindow(CurPage,doTemp,request); + dwTemp.Style="1";//--设置为Grid风格-- + dwTemp.ReadOnly = "1";//只读模式 + dwTemp.setPageSize(10); + dwTemp.genHTMLObjectWindow(certId); + String sButtons[][] = { + + }; +%><%@include file="/Frame/resources/include/ui/include_list.jspf"%> + +<%@ include file="/Frame/resources/include/include_end.jspf"%> \ No newline at end of file diff --git a/WebContent/Tenwa/Customer/Lessee/Comm/CustomerHistory/OutstandInfo.jsp b/WebContent/Tenwa/Customer/Lessee/Comm/CustomerHistory/OutstandInfo.jsp new file mode 100644 index 000000000..bc184bf9c --- /dev/null +++ b/WebContent/Tenwa/Customer/Lessee/Comm/CustomerHistory/OutstandInfo.jsp @@ -0,0 +1,35 @@ +<%@page import="com.tenwa.comm.dataRightmanager.DataRightManager"%> +<%@ page contentType="text/html; charset=GBK"%> +<%@ include file="/Frame/resources/include/include_begin_list.jspf"%> +<%@include file="/Tenwa/Core/FlowManager/BaseFunction/BaseFlowListFunction.jspf" %> +<% + + String certId = CurPage.getParameter("certId"); + + ASObjectModel doTemp = new ASObjectModel("LoanedList"); + doTemp.appendJboWhere(" and O.CONTRACT_STATUS < 31 "); + ASObjectWindow dwTemp = new ASObjectWindow(CurPage,doTemp,request); + dwTemp.Style="1";//--设置为Grid风格-- + dwTemp.ReadOnly = "1";//只读模式 + dwTemp.setPageSize(10); + dwTemp.genHTMLObjectWindow(certId); + String sButtons[][] = { + + }; +%><%@include file="/Frame/resources/include/ui/include_list.jspf"%> + +<%@ include file="/Frame/resources/include/include_end.jspf"%> \ No newline at end of file diff --git a/WebContent/WEB-INF/etc/jbo/jbo_comm.xml b/WebContent/WEB-INF/etc/jbo/jbo_comm.xml index aaf3a016f..8e631b760 100644 --- a/WebContent/WEB-INF/etc/jbo/jbo_comm.xml +++ b/WebContent/WEB-INF/etc/jbo/jbo_comm.xml @@ -927,6 +927,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src_core/com/tenwa/voucher/CreateVoucherProcess/InsertCustomerHistoryInfo.java b/src_core/com/tenwa/voucher/CreateVoucherProcess/InsertCustomerHistoryInfo.java new file mode 100644 index 000000000..31a282fd9 --- /dev/null +++ b/src_core/com/tenwa/voucher/CreateVoucherProcess/InsertCustomerHistoryInfo.java @@ -0,0 +1,366 @@ +package com.tenwa.voucher.CreateVoucherProcess; + +import com.amarsoft.are.jbo.JBOFactory; +import com.amarsoft.are.jbo.JBOTransaction; +import com.amarsoft.awe.util.SqlObject; +import com.amarsoft.awe.util.Transaction; +import com.amarsoft.context.ASUser; +import com.tenwa.comm.util.date.DateAssistant; +import com.tenwa.reckon.util.Conn; + +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.List; +import java.util.Map; + +public class InsertCustomerHistoryInfo { + + private String flowunid; + + public String getFlowunid() { + return flowunid; + } + + + public void setFlowunid(String flowunid) { + this.flowunid = flowunid; + } + + //获取客户历史信息 + public void InsertCustomerHistoryInfoTemp(JBOTransaction tx) throws Exception{ + try { + tx= JBOFactory.createJBOTransaction(); + Conn conn = new Conn(tx); + String flowunid = this.flowunid; + //获取客户基本信息 + String sql = "select ci.customerid,ci.customername,ci.certtype,ci.certid,(case when lul.IS_MAIN = 'Y' then '主承租人' else '共同承租人' end) 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.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 + "'"; + List> customerinfo = conn.executeQuery(sql); + String customerid = ""; + String certid = ""; + + //避免项目的历史客户信息重复录入 + for (int i = customerinfo.size()-1; i >= 0; i--) { + String cfsql = "select id from customer_history_info_temp where certid = '"+customerinfo.get(i).get("certid")+"' and flowunid = '"+customerinfo.get(i).get("flowunid")+"'"; + List> cfinfo = conn.executeQuery(cfsql); + if(cfinfo.size()>0){ + customerinfo.remove(i); + } + } + + if(customerinfo.size()>0){ + for (int i = 0; i < customerinfo.size(); i++) { + customerid = customerinfo.get(i).get("customerid"); + certid = customerinfo.get(i).get("certid"); + + //获取客户为主承租人订单总数 + String gm_nu = "select count(lul.id) as num from lb_union_lessee lul where lul.CUSTOMER_ID = '"+customerid+"' and lul.IS_MAIN = 'Y' group by lul.CUSTOMER_ID"; + List> 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 sum(nvl(CLEAN_LEASE_MONEY,0)) as CLEAN_LEASE_MONEY from lb_union_lessee lul 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 lul.customer_id = '"+customerid+"' and lul.IS_MAIN = 'Y' and lci.CONTRACT_STATUS >=31 and lci.CONTRACT_STATUS <> '104' group by lul.customer_id"; + List> 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 lb_union_lessee lul left join lb_contract_info lci on lci.id = lul.CONTRACT_ID where lul.customer_id = '"+customerid+"' and lul.IS_MAIN = 'Y' and lci.CONTRACT_STATUS in ('100','105') group by lul.customer_id"; + List> jq_num = conn.executeQuery(jq_contract_num); + String jq_number = ""; + if(rz.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 lb_union_lessee lul left join lb_contract_info lci on lci.id = lul.CONTRACT_ID where lul.customer_id = '"+customerid+"' and lul.IS_MAIN = 'Y' and lci.CONTRACT_STATUS >=31 and lci.CONTRACT_STATUS <= 100 group by lul.customer_id"; + List> 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 lb_union_lessee lul left join lb_equipment_car lec on lec.CONTRACT_ID = lul.CONTRACT_ID where lul.customer_id = '"+customerid+"' and lul.IS_MAIN = 'Y' and lec.car_attribute = 'head' group by lul.customer_id"; + List> 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 lb_union_lessee lul 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 lul.customer_id = '"+customerid+"' and lul.IS_MAIN = 'Y' and lci.CONTRACT_STATUS in ('100','105') and lec.car_attribute = 'head' group by lul.customer_id"; + List> 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 lb_union_lessee lul 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 lul.customer_id = '"+customerid+"' and lul.IS_MAIN = 'Y' and lci.CONTRACT_STATUS >='31' and lci.CONTRACT_STATUS <= '100' and lec.car_attribute = 'head' group by lul.customer_id"; + List> 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 sum(nvl(rent_over,0)) as rent_over,sum(nvl(penalty_over,0)) as penalty_over from lb_union_lessee lul left join vi_rent_plan_sum vrps on lul.contract_id = vrps.contract_id where lul.CUSTOMER_ID = '"+customerid+"' and lul.IS_MAIN = 'Y' group by lul.CUSTOMER_ID"; + List> money_number = conn.executeQuery(money_num); + String czr_rent_over = ""; + String czr_penalty_over = ""; + if(money_number.size()>0){ + czr_rent_over = money_number.get(0).get("rent_over"); + }else { + czr_rent_over = "0"; + } + if(money_number.size()>0){ + czr_penalty_over = money_number.get(0).get("rent_over"); + }else { + czr_penalty_over = "0"; + } + //获取客户为共同承租人订单总数 + String gt_gm_nu = "select count(lul.id) as num from lb_union_lessee lul where lul.CUSTOMER_ID = '"+customerid+"' and lul.IS_MAIN = 'N' group by lul.CUSTOMER_ID"; + List> 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 sum(nvl(CLEAN_LEASE_MONEY,0)) as CLEAN_LEASE_MONEY from lb_union_lessee lul 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 lul.customer_id = '"+customerid+"' and lul.IS_MAIN = 'N' and lci.CONTRACT_STATUS >=31 and lci.CONTRACT_STATUS <> '104' group by lul.customer_id"; + List> 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 lb_union_lessee lul left join lb_contract_info lci on lci.id = lul.CONTRACT_ID where lul.customer_id = '"+customerid+"' and lul.IS_MAIN = 'N' and lci.CONTRACT_STATUS in ('100','105') group by lul.customer_id"; + List> 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 lb_union_lessee lul left join lb_contract_info lci on lci.id = lul.CONTRACT_ID where lul.customer_id = '"+customerid+"' and lul.IS_MAIN = 'N' and lci.CONTRACT_STATUS >=31 and lci.CONTRACT_STATUS <= 100 group by lul.customer_id"; + List> 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 lb_union_lessee lul left join lb_equipment_car lec on lec.CONTRACT_ID = lul.CONTRACT_ID where lul.customer_id = '"+customerid+"' and lul.IS_MAIN = 'N' and lec.car_attribute = 'head' group by lul.customer_id"; + List> 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 lb_union_lessee lul 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 lul.customer_id = '"+customerid+"' and lul.IS_MAIN = 'N' and lci.CONTRACT_STATUS in ('100','105') and lec.car_attribute = 'head' group by lul.customer_id"; + List> 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 lb_union_lessee lul 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 lul.customer_id = '"+customerid+"' and lul.IS_MAIN = 'N' and lci.CONTRACT_STATUS >='31' and lci.CONTRACT_STATUS <= '100' and lec.car_attribute = 'head' group by lul.customer_id"; + List> 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 sum(nvl(rent_over,0)) as rent_over,sum(nvl(penalty_over,0)) as penalty_over from lb_union_lessee lul left join vi_rent_plan_sum vrps on lul.contract_id = vrps.contract_id where lul.CUSTOMER_ID = '"+customerid+"' and lul.IS_MAIN = 'N' group by lul.CUSTOMER_ID"; + List> gt_money_number = conn.executeQuery(gt_money_num); + String gt_rent_over = ""; + String gt_penalty_over = ""; + if(gt_money_number.size()>0){ + gt_rent_over = gt_money_number.get(0).get("rent_over"); + }else { + gt_rent_over = "0"; + } + if(gt_money_number.size()>0){ + gt_penalty_over = gt_money_number.get(0).get("penalty_over"); + }else { + gt_penalty_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> 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 sum(nvl(CLEAN_LEASE_MONEY,0)) 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> 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> 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> 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> 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> 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> 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 sum(nvl(rent_over,0)) as rent_over,sum(nvl(penalty_over,0)) as penalty_over from lb_guarantee_unit lgu left join vi_rent_plan_sum vrps on lgu.contract_id = vrps.contract_id where lgu.certid = '"+certid+"' group by lgu.certid"; + List> db_money_number = conn.executeQuery(db_money_num); + String db_rent_over = ""; + String db_penalty_over = ""; + if(db_money_number.size()>0){ + db_rent_over = db_money_number.get(0).get("rent_over"); + }else { + db_rent_over = "0"; + } + if(db_money_number.size()>0){ + db_penalty_over = db_money_number.get(0).get("penalty_over"); + }else { + db_penalty_over = "0"; + } + //客户敞口计算 + String ck_money_rz = "select sum(nvl(PLAN_MONEY,0)) as money from lb_union_lessee lul left join lc_fund_plan lfp on lul.CONTRACT_ID = lfp.CONTRACT_ID and lfp.FEE_TYPE = 'feetype10' where lul.CUSTOMER_ID = '"+customerid+"' group by lul.CUSTOMER_ID"; + String ck_moeny_bz = "select sum(nvl(PLAN_MONEY,0)) as money from lb_union_lessee lul left join lc_fund_plan lfp on lul.CONTRACT_ID = lfp.CONTRACT_ID and lfp.FEE_TYPE = 'feetype2' where lul.CUSTOMER_ID = '"+customerid+"' group by lul.CUSTOMER_ID"; + String ck_money_bc = "select nvl(CLEAN_LEASE_MONEY,0) - nvl(CAUTION_MONEY,0) as bc_money from lc_calc_condition_temp lcct where FLOWUNID = '"+flowunid+"'"; + //担保人敞口计算 + String dbck_moneny_rz = "select sum(nvl(PLAN_MONEY,0)) as money from LB_GUARANTEE_UNIT lgu left join lc_fund_income lfi on lgu.CONTRACT_ID lgu.CONTRACT_ID and lfi.FEE_TYPE = 'feetype10' where lgu.CERTID = '"+certid+"'"; + String dbck_moeny_bz = "select sum(nvl(PLAN_MONEY,0)) as money from LB_GUARANTEE_UNIT lgu left join lc_fund_income lfi on lgu.CONTRACT_ID lgu.CONTRACT_ID and lfi.FEE_TYPE = 'feetype2' where lgu.CERTID = '"+certid+"'"; + String dbck_money_bq = "select nvl(CLEAN_LEASE_MONEY,0) - nvl(CAUTION_MONEY,0) as bc_money from lb_guarantee_unit_temp lgut left join lc_calc_condition_temp lcct on lgut.FLOWUNID = lcct.FLOWUNID where lgut.FLOWUNID = '"+flowunid+"'"; + + List> ckmoney_rz = conn.executeQuery(ck_money_rz); + List> ckmoeny_bz = conn.executeQuery(ck_moeny_bz); + List> ckmoney_bc = conn.executeQuery(ck_money_bc); + String ckmoney_rzy = ""; + String ckmoeny_bzy = ""; + String ckmoney_bcy = ""; + if(ckmoney_rz.size()>0){ + ckmoney_rzy = ckmoney_rz.get(0).get("money"); + }else { + ckmoney_rzy = "0"; + } + if(ckmoeny_bz.size()>0){ + ckmoeny_bzy = ckmoeny_bz.get(0).get("money"); + }else { + ckmoeny_bzy = "0"; + } + if(ckmoney_bc.size()>0){ + ckmoney_bcy = ckmoney_bc.get(0).get("bc_money"); + }else { + ckmoney_bcy = "0"; + } + + List> dbckmoneny_rz = conn.executeQuery(dbck_moneny_rz); + List> dbckmoeny_bz = conn.executeQuery(dbck_moeny_bz); + List> dbckmoney_bq = conn.executeQuery(dbck_money_bq); + + String dbckmoneny_rzy = ""; + String dbckmoeny_bzy = ""; + String dbckmoney_bqy = ""; + if(dbckmoneny_rz.size()>0){ + dbckmoneny_rzy = dbckmoneny_rz.get(0).get("money"); + }else { + dbckmoneny_rzy = "0"; + } + if(dbckmoeny_bz.size()>0){ + dbckmoeny_bzy = dbckmoeny_bz.get(0).get("money"); + }else { + dbckmoeny_bzy = "0"; + } + if(dbckmoney_bq.size()>0){ + dbckmoney_bqy = dbckmoney_bq.get(0).get("bc_money"); + }else { + dbckmoney_bqy = "0"; + } + + BigDecimal money = new BigDecimal(ckmoney_rzy).subtract(new BigDecimal(ckmoeny_bzy)).add(new BigDecimal(ckmoney_bcy)).add(new BigDecimal(dbckmoneny_rzy)).subtract(new BigDecimal(dbckmoeny_bzy)).add(new BigDecimal(dbckmoney_bqy)); + + //录入客户历史信息表 + Transaction sqlca = Transaction.createTransaction(tx); + 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)"+ + "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_penalty_over+"',"+ + "'"+gtgmnumber+"','"+GT_CLEAN_LEASE_MONEY+"','"+gt_jq_number+"','"+gt_wjq_number+"','"+gtcarnumber+"','"+gtcarjqnumber+"','"+gtcarwjqnumber+"','"+gt_rent_over+"','"+gt_penalty_over+"',"+ + "'"+dbgmnumber+"','"+DB_CLEAN_LEASE_MONEY+"','"+db_jq_number+"','"+db_wjq_number+"','"+dbcarnumber+"','"+dbcarjqnumber+"','"+dbcarwjqnumber+"','"+db_rent_over+"','"+db_penalty_over+"','"+money+"')"; + + SqlObject sqlObject = new SqlObject(ssql); + sqlca.executeSQL(sqlObject); + tx.commit(); + } + } + + }catch (Exception e){ + e.printStackTrace(); + } + + } + +} diff --git a/src_jbo/jbo/com/tenwa/entity/comm/flow/CUSTOMER_HISTORY_INFO_TEMP.java b/src_jbo/jbo/com/tenwa/entity/comm/flow/CUSTOMER_HISTORY_INFO_TEMP.java new file mode 100644 index 000000000..fb8886744 --- /dev/null +++ b/src_jbo/jbo/com/tenwa/entity/comm/flow/CUSTOMER_HISTORY_INFO_TEMP.java @@ -0,0 +1,192 @@ +package jbo.com.tenwa.entity.comm.flow; + +import java.lang.String; + +/** + * 客户历史信息 - JBO命名常量类

+ * Note: This file is generated by ADE tools, dont modify it.
+ + */ +public interface CUSTOMER_HISTORY_INFO_TEMP { + /** + * 客户历史信息

+ * 代表本类映射的BizObjectClass + */ + public static final String CLASS_NAME = "jbo.com.tenwa.entity.comm.flow.CUSTOMER_HISTORY_INFO_TEMP"; + /** + * ID STRING(32)
+ */ + public static final String id = "id"; + /** + * 客户编号 STRING(40)
+ */ + public static final String customerid = "customerid"; + /** + * 客户名称 STRING(200)
+ */ + public static final String customername = "customername"; + /** + * 证件类型 STRING(20)
+ */ + public static final String certtype = "certtype"; + /** + * 证件号 STRING(20)
+ */ + public static final String certid = "certid"; + /** + * 客户类别 STRING(20)
+ */ + public static final String customertype = "customertype"; + /** + * 流程编号 STRING(32)
+ */ + public static final String flowunid = "flowunid"; + /** + * 项目编号 STRING(32)
+ */ + public static final String project_id = "project_id"; + /** + * 客户购买次数 STRING(10)
+ */ + public static final String clientbuynumber = "clientbuynumber"; + /** + * 客户融资金额 STRING(32)
+ */ + public static final String clientfinancingamount = "clientfinancingamount"; + /** + * 客户已结清单数 STRING(10)
+ */ + public static final String clientclosedaccount = "clientclosedaccount"; + /** + * 客户未结清单数 STRING(10)
+ */ + public static final String clientunsettled = "clientunsettled"; + /** + * 客户车辆总数 STRING(10)
+ */ + public static final String clientvehiclepopulation = "clientvehiclepopulation"; + /** + * 客户结清车辆数 STRING(10)
+ */ + public static final String clientclosedvehicle = "clientclosedvehicle"; + /** + * 客户未结清车辆数 STRING(10)
+ */ + public static final String clientoutstandingvehicle = "clientoutstandingvehicle"; + /** + * 客户贷款余额 STRING(10)
+ */ + public static final String clientloanbalance = "clientloanbalance"; + /** + * 客户逾期金额 STRING(10)
+ */ + public static final String clientoverdueamount = "clientoverdueamount"; + /** + * 共同购买次数 STRING(10)
+ */ + public static final String jointlybuynumber = "jointlybuynumber"; + /** + * 共同融资金额 STRING(32)
+ */ + public static final String jointlyfinancingamount = "jointlyfinancingamount"; + /** + * 共同已结清单数 STRING(10)
+ */ + public static final String jointlyclosedaccount = "jointlyclosedaccount"; + /** + * 共同未结清单数 STRING(10)
+ */ + public static final String jointlyunsettled = "jointlyunsettled"; + /** + * 共同车辆总数 STRING(10)
+ */ + public static final String jointlyveh = "jointlyveh"; + /** + * 共同结清车辆数 STRING(10)
+ */ + public static final String jointlyclosedvehicle = "jointlyclosedvehicle"; + /** + * 共同未结清车辆数 STRING(10)
+ */ + public static final String jointlyout = "jointlyout"; + /** + * 共同贷款余额 STRING(10)
+ */ + public static final String jointlyloanbalance = "jointlyloanbalance"; + /** + * 共同逾期金额 STRING(10)
+ */ + public static final String jointlyoverdueamount = "jointlyoverdueamount"; + /** + * 担保单数 STRING(10)
+ */ + public static final String guaranteebuynumber = "guaranteebuynumber"; + /** + * 担保金额 STRING(32)
+ */ + public static final String guaranteefin = "guaranteefin"; + /** + * 担保已结清单数 STRING(10)
+ */ + public static final String guaranteeclosedaccount = "guaranteeclosedaccount"; + /** + * 担保未结清单数 STRING(10)
+ */ + public static final String guaranteeunsettled = "guaranteeunsettled"; + /** + * 担保车辆总数 STRING(10)
+ */ + public static final String guaranteeveh = "guaranteeveh"; + /** + * 担保结清车辆数 STRING(10)
+ */ + public static final String guaranteeclosedvehicle = "guaranteeclosedvehicle"; + /** + * 担保未结清车辆数 STRING(10)
+ */ + public static final String guaranteeout = "guaranteeout"; + /** + * 担保贷款余额 STRING(10)
+ */ + public static final String guaranteeloanbalance = "guaranteeloanbalance"; + /** + * 担保逾期金额 STRING(10)
+ */ + public static final String guaranteeoverdueamount = "guaranteeoverdueamount"; + /** + * 备注 STRING(250)
+ */ + public static final String remark = "remark"; + /** + * 客户编码 STRING(32)
+ */ + public static final String customer_num = "customer_num"; + /** + * 登记人 STRING(32)
+ */ + public static final String inputuserid = "inputuserid"; + /** + * 登记机构 STRING(32)
+ */ + public static final String inputorgid = "inputorgid"; + /** + * 登记时间 STRING(32)
+ */ + public static final String inputtime = "inputtime"; + /** + * 更新人 STRING(32)
+ */ + public static final String updateuserid = "updateuserid"; + /** + * 更新部门 STRING(32)
+ */ + public static final String updateorgid = "updateorgid"; + /** + * 更新时间 STRING(32)
+ */ + public static final String updatetime = "updatetime"; + /** + * 敞口 STRING(32)
+ */ + public static final String exposure = "exposure"; +} diff --git a/src_jbo/jbo/com/tenwa/entity/comm/flow/VI_CUSTOMERHISTORY.java b/src_jbo/jbo/com/tenwa/entity/comm/flow/VI_CUSTOMERHISTORY.java new file mode 100644 index 000000000..0357590b1 --- /dev/null +++ b/src_jbo/jbo/com/tenwa/entity/comm/flow/VI_CUSTOMERHISTORY.java @@ -0,0 +1,75 @@ +package jbo.com.tenwa.entity.comm.flow; + +import java.lang.String; + +/** + * 放款订单信息 - JBO命名常量类

+ * Note: This file is generated by ADE tools, dont modify it.
+ + */ +public interface VI_CUSTOMERHISTORY { + + /** + * 放款订单信息

+ * 代表本类映射的BizObjectClass + */ + public static final String CLASS_NAME = "jbo.com.tenwa.entity.comm.flow.VI_CUSTOMERHISTORY"; + /** + * 客户ID STRING(32)
+ */ + public static final String CUSTOMER_ID = "CUSTOMER_ID"; + /** + * 证件号 STRING(32)
+ */ + public static final String CERTID = "CERTID"; + /** + * 合同编号 STRING(32)
+ */ + public static final String CONTRACT_NO = "CONTRACT_NO"; + + /** + * 客户名称 STRING(32)
+ */ + public static final String CUSTOMER_NAME = "CUSTOMER_NAME"; + + /** + * 客户角色 STRING(200)
+ */ + public static final String CHARACTERS = "CHARACTERS"; + + /** + * 经销商名称 STRING(200)
+ */ + public static final String DISTRIBUTOR_NAME = "DISTRIBUTOR_NAME"; + + /** + * 车辆台数 STRING(10
+ */ + public static final String CAR_NUM = "CAR_NUM"; + + /** + * 首付款比例 STRING(32)
+ */ + public static final String FIRST_PAYMENT_RATIO = "FIRST_PAYMENT_RATIO"; + + /** + * 融资额 STRING(32)
+ */ + public static final String CLEAN_LEASE_MONEY = "CLEAN_LEASE_MONEY"; + + /** + * 合同期次 STRING(32)
+ */ + public static final String LEASE_TERM = "LEASE_TERM"; + + /** + * 合同状态名称 STRING(32)
+ */ + public static final String STATUS_NAME = "STATUS_NAME"; + + /** + * 合同状态 STRING(32)
+ */ + public static final String CONTRACT_STATUS = "CONTRACT_STATUS"; + +}