客户历史信息查询

This commit is contained in:
zzk 2023-09-10 10:58:37 +08:00
parent 2c99352da5
commit 71e8087c24
8 changed files with 857 additions and 0 deletions

View File

@ -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.URL3参数串, 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"%>
<script type="text/javascript">
window.onload=function(){
AsControl.RunJavaMethodTrans("com.tenwa.voucher.CreateVoucherProcess.InsertCustomerHistoryInfo","InsertCustomerHistoryInfoTemp","flowunid=<%=flowunid%>");
}
</script>
<%@ include file="/IncludeEnd.jsp"%>

View File

@ -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", "<iframe type='iframe' id='frame_list' name=\"frame_list\" width=\"100%\" height=\"400px\" 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=\"400px\" frameborder=\"0\" src=\""+sWebRootPath+ "/Tenwa/Customer/Lessee/Comm/CustomerHistory/OutstandInfo.jsp?CompClientID=" +compClientID+"&certId="+certId+"\"></iframe>", CurPage.getObjectWindowOutput());
String sButtons[][] = {
};
%><%@ include file="/Frame/resources/include/ui/include_info.jspf"%>
<script type="text/javascript">
</script>
<%@ include file="/Frame/resources/include/include_end.jspf"%>

View File

@ -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"%>
<script type="text/javascript">
function afterSearch(){
for(var i=0;i<getRowCount(0);i++){
var userId=getItemValue(0,i,"USERID");
if(userId=="system"){
getObj(0,i,"ENDTIME").innerHTML=getObj(0,i,"BEGINTIME").textContent;
}
getObj(0,i,"ACTION").innerHTML= '<a href=# onclick="javascript:viewHisTab()">申请详情</a> ';
}
setColumnWidth(0,"ACTION",100);
}
</script>
<%@ include file="/Frame/resources/include/include_end.jspf"%>

View File

@ -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"%>
<script type="text/javascript">
function afterSearch(){
for(var i=0;i<getRowCount(0);i++){
var userId=getItemValue(0,i,"USERID");
if(userId=="system"){
getObj(0,i,"ENDTIME").innerHTML=getObj(0,i,"BEGINTIME").textContent;
}
getObj(0,i,"ACTION").innerHTML= '<a href=# onclick="javascript:viewHisTab()">申请详情</a> ';
}
setColumnWidth(0,"ACTION",100);
}
</script>
<%@ include file="/Frame/resources/include/include_end.jspf"%>

View File

@ -927,6 +927,83 @@
</managerProperties>
</manager>
</class>
<class name="CUSTOMER_HISTORY_INFO_TEMP" label="客户历史信息临时" keyAttributes="id">
<attributes>
<attribute name="id" label="唯一标识" type="STRING" length="32"/>
<attribute name="customerid" label="客户编号" type="STRING" length="40"/>
<attribute name="customername" label="客户名称" type="STRING" length="200"/>
<attribute name="certtype" label="证件类型" type="STRING" length="20"/>
<attribute name="certid" label="证件号" type="STRING" length="20"/>
<attribute name="customertype" label="客户类别" type="STRING" length="20"/>
<attribute name="flowunid" label="流程编号" type="STRING" length="32"/>
<attribute name="project_id" label="项目编号" type="STRING" length="32"/>
<attribute name="clientbuynumber" label="客户购买次数" type="STRING" length="10"/>
<attribute name="clientfinancingamount" label="客户融资金额" type="STRING" length="32"/>
<attribute name="clientclosedaccount" label="客户已结清单数" type="STRING" length="10"/>
<attribute name="clientunsettled" label="客户未结清单数" type="STRING" length="10"/>
<attribute name="clientvehiclepopulation" label="客户车辆总数" type="STRING" length="10"/>
<attribute name="clientclosedvehicle" label="客户结清车辆数" type="STRING" length="10"/>
<attribute name="clientoutstandingvehicle" label="客户未结清车辆数" type="STRING" length="10"/>
<attribute name="clientloanbalance" label="客户贷款余额" type="STRING" length="10"/>
<attribute name="clientoverdueamount" label="客户逾期金额" type="STRING" length="10"/>
<attribute name="jointlybuynumber" label="共同购买次数" type="STRING" length="10"/>
<attribute name="jointlyfinancingamount" label="共同融资金额" type="STRING" length="32"/>
<attribute name="jointlyclosedaccount" label="共同已结清单数" type="STRING" length="10"/>
<attribute name="jointlyunsettled" label="共同未结清单数" type="STRING" length="10"/>
<attribute name="jointlyveh" label="共同车辆总数" type="STRING" length="10"/>
<attribute name="jointlyclosedvehicle" label="共同结清车辆数" type="STRING" length="10"/>
<attribute name="jointlyout" label="共同未结清车辆数" type="STRING" length="10"/>
<attribute name="jointlyloanbalance" label="共同贷款余额" type="STRING" length="10"/>
<attribute name="jointlyoverdueamount" label="共同逾期金额" type="STRING" length="10"/>
<attribute name="guaranteebuynumber" label="担保单数" type="STRING" length="10"/>
<attribute name="guaranteefin" label="担保金额" type="STRING" length="32"/>
<attribute name="guaranteeclosedaccount" label="担保已结清单数" type="STRING" length="10"/>
<attribute name="guaranteeunsettled" label="担保未结清单数" type="STRING" length="10"/>
<attribute name="guaranteeveh" label="担保车辆总数" type="STRING" length="10"/>
<attribute name="guaranteeclosedvehicle" label="担保结清车辆数" type="STRING" length="10"/>
<attribute name="guaranteeout" label="担保未结清车辆数" type="STRING" length="10"/>
<attribute name="guaranteeloanbalance" label="担保贷款余额" type="STRING" length="10"/>
<attribute name="guaranteeoverdueamount" label="担保逾期金额" type="STRING" length="10"/>
<attribute name="remark" label="备注" type="STRING" length="250"/>
<attribute name="customer_num" label="客户编码" type="STRING" length="32"/>
<attribute name="inputuserid" label="登记人" type="STRING" length="32"/>
<attribute name="inputorgid" label="登记机构" type="STRING" length="32"/>
<attribute name="inputtime" label="登记时间" type="STRING" length="32"/>
<attribute name="updateuserid" label="更新人" type="STRING" length="32"/>
<attribute name="updateorgid" label="更新部门" type="STRING" length="32"/>
<attribute name="updatetime" label="更新时间" type="STRING" length="32"/>
<attribute name="exposure" label="敞口" type="STRING" length="32"/>
</attributes>
<manager>
<managerProperties>
<property name="table" value="customer_history_info_temp" />
<property name="createKey" value="true" />
</managerProperties>
</manager>
</class>
<class name="VI_CUSTOMERHISTORY" label="放款订单信息" keyAttributes="">
<attributes>
<attribute name="CUSTOMER_ID" label="合同ID" type="STRING" length="32"/>
<attribute name="CERTID" label="证件号" type="STRING" length="32"/>
<attribute name="CONTRACT_NO" label="合同编号" type="STRING" length="32"/>
<attribute name="CUSTOMER_NAME" label="客户名称" type="STRING" length="200"/>
<attribute name="CHARACTERS" label="客户角色" type="STRING" length="200"/>
<attribute name="DISTRIBUTOR_NAME" label="经销商名称" type="STRING" length="200"/>
<attribute name="CAR_NUM" label="车辆台数" type="STRING" length="32"/>
<attribute name="FIRST_PAYMENT_RATIO" label="首付款比例" type="STRING" length="32"/>
<attribute name="CLEAN_LEASE_MONEY" label="融资额" type="STRING" length="32"/>
<attribute name="LEASE_TERM" label="合同期次" type="STRING" length="32"/>
<attribute name="STATUS_NAME" label="合同状态名称" type="STRING" length="32"/>
<attribute name="CONTRACT_STATUS" label="合同状态" type="STRING" length="32"/>
</attributes>
<manager>
<managerProperties>
<property name="table" value="vi_customerhistory" />
<property name="createKey" value="true" />
</managerProperties>
</manager>
</class>
</package>
<package name="jbo.com.tenwa.entity.comm.taxinfo" >
<class name="TAX_INFO" label="税率信息维护" keyAttributes="ID">

View File

@ -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<Map<String, String>> 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<Map<String, String>> 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<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 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<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 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<Map<String, String>> 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<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 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<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 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<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 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<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 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<Map<String, String>> 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<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 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<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 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<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 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<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 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<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 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<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 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<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 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<Map<String, String>> 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<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 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<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 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<Map<String, String>> 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<Map<String, String>> ckmoney_rz = conn.executeQuery(ck_money_rz);
List<Map<String, String>> ckmoeny_bz = conn.executeQuery(ck_moeny_bz);
List<Map<String, String>> 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<Map<String, String>> dbckmoneny_rz = conn.executeQuery(dbck_moneny_rz);
List<Map<String, String>> dbckmoeny_bz = conn.executeQuery(dbck_moeny_bz);
List<Map<String, String>> 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();
}
}
}

View File

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

View File

@ -0,0 +1,75 @@
package jbo.com.tenwa.entity.comm.flow;
import java.lang.String;
/**
* 放款订单信息 - JBO命名常量类<br><br>
* Note: This file is generated by ADE tools, <em>dont</em> modify it.<br>
*/
public interface VI_CUSTOMERHISTORY {
/**
* 放款订单信息<br><br>
* 代表本类映射的BizObjectClass
*/
public static final String CLASS_NAME = "jbo.com.tenwa.entity.comm.flow.VI_CUSTOMERHISTORY";
/**
* 客户ID STRING(32)<br>
*/
public static final String CUSTOMER_ID = "CUSTOMER_ID";
/**
* 证件号 STRING(32)<br>
*/
public static final String CERTID = "CERTID";
/**
* 合同编号 STRING(32)<br>
*/
public static final String CONTRACT_NO = "CONTRACT_NO";
/**
* 客户名称 STRING(32)<br>
*/
public static final String CUSTOMER_NAME = "CUSTOMER_NAME";
/**
* 客户角色 STRING(200)<br>
*/
public static final String CHARACTERS = "CHARACTERS";
/**
* 经销商名称 STRING(200)<br>
*/
public static final String DISTRIBUTOR_NAME = "DISTRIBUTOR_NAME";
/**
* 车辆台数 STRING(10<br>
*/
public static final String CAR_NUM = "CAR_NUM";
/**
* 首付款比例 STRING(32)<br>
*/
public static final String FIRST_PAYMENT_RATIO = "FIRST_PAYMENT_RATIO";
/**
* 融资额 STRING(32)<br>
*/
public static final String CLEAN_LEASE_MONEY = "CLEAN_LEASE_MONEY";
/**
* 合同期次 STRING(32)<br>
*/
public static final String LEASE_TERM = "LEASE_TERM";
/**
* 合同状态名称 STRING(32)<br>
*/
public static final String STATUS_NAME = "STATUS_NAME";
/**
* 合同状态 STRING(32)<br>
*/
public static final String CONTRACT_STATUS = "CONTRACT_STATUS";
}