From c2eb11f47fc6985707c38eb26f397a4938dce007 Mon Sep 17 00:00:00 2001 From: zzk Date: Tue, 19 Sep 2023 18:37:35 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=A2=E6=88=B7=E5=8E=86=E5=8F=B2=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E4=BF=AE=E6=94=B9=E6=95=B0=E6=8D=AE=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CustomerHistoryInformation.jsp | 2 + .../InsertCustomerHistoryInfo.java | 46 +++++++++++++++++++ 2 files changed, 48 insertions(+) diff --git a/WebContent/Tenwa/Customer/Lessee/Comm/CustomerHistory/CustomerHistoryInformation.jsp b/WebContent/Tenwa/Customer/Lessee/Comm/CustomerHistory/CustomerHistoryInformation.jsp index 49e1ed6b5..1fb88e2ac 100644 --- a/WebContent/Tenwa/Customer/Lessee/Comm/CustomerHistory/CustomerHistoryInformation.jsp +++ b/WebContent/Tenwa/Customer/Lessee/Comm/CustomerHistory/CustomerHistoryInformation.jsp @@ -49,6 +49,8 @@ <%@ include file="/IncludeEnd.jsp"%> \ No newline at end of file diff --git a/src_core/com/tenwa/voucher/CreateVoucherProcess/InsertCustomerHistoryInfo.java b/src_core/com/tenwa/voucher/CreateVoucherProcess/InsertCustomerHistoryInfo.java index 9e3fe7726..ecc06aa1d 100644 --- a/src_core/com/tenwa/voucher/CreateVoucherProcess/InsertCustomerHistoryInfo.java +++ b/src_core/com/tenwa/voucher/CreateVoucherProcess/InsertCustomerHistoryInfo.java @@ -11,6 +11,7 @@ import com.tenwa.reckon.util.Conn; import java.math.BigDecimal; import java.math.BigInteger; +import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -321,4 +322,49 @@ public class InsertCustomerHistoryInfo { } + + public void InsertCustomerHistoryInfo(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,'主承租人' 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" + + "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" + + "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"; + List> customerinfo = conn.executeQuery(sql); + + String certid = ""; + + List> cfinfo = new ArrayList<>(); + + //避免项目的历史客户信息重复录入 + 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")+"'"; + cfinfo = conn.executeQuery(cfsql); + + } + + if(cfinfo.size()>0){ + for (int i = 0; i < cfinfo.size(); i++) { + String id = cfinfo.get(i).get("id"); + + Transaction sqlca = Transaction.createTransaction(tx); + + //删除客户历史信息表多余信息 + String ssql = "delete from CUSTOMER_HISTORY_INFO_TEMP where id = '"+id+"'"; + SqlObject sqlObject = new SqlObject(ssql); + sqlca.executeSQL(sqlObject); + tx.commit(); + } + } + + }catch (Exception e){ + e.printStackTrace(); + } + + } + }