From 0b12270f6bc647819b1603087e488b7485a22efa Mon Sep 17 00:00:00 2001 From: zhangbb Date: Thu, 13 Dec 2018 20:25:13 +0800 Subject: [PATCH] =?UTF-8?q?1.=E6=89=A3=E6=AC=BE=E5=A4=8D=E6=A0=B8=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E6=94=B9=E4=B8=BA=E5=AD=98=E5=82=A8=E8=BF=87=E7=A8=8B?= =?UTF-8?q?=E3=80=82=EF=BC=88=E8=BE=89=E6=80=BB=E5=86=99=E7=9A=84=E5=AD=98?= =?UTF-8?q?=E5=82=A8=E8=BF=87=E7=A8=8B=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cache/CollectAuditInfoCache.java | 70 ++++++++++++------- 1 file changed, 46 insertions(+), 24 deletions(-) diff --git a/src_tenwa/com/tenwa/collectaudit/cache/CollectAuditInfoCache.java b/src_tenwa/com/tenwa/collectaudit/cache/CollectAuditInfoCache.java index bee072c7b..ad88ea74d 100644 --- a/src_tenwa/com/tenwa/collectaudit/cache/CollectAuditInfoCache.java +++ b/src_tenwa/com/tenwa/collectaudit/cache/CollectAuditInfoCache.java @@ -2,6 +2,7 @@ package com.tenwa.collectaudit.cache; import java.io.File; import java.math.BigDecimal; +import java.sql.SQLException; import java.text.DecimalFormat; import java.util.HashMap; import java.util.List; @@ -9,6 +10,8 @@ import java.util.Map; import java.util.regex.Matcher; import java.util.regex.Pattern; +import org.springframework.jdbc.object.SqlCall; + import jbo.app.tenwa.calc.LC_RENT_PLAN; import jbo.app.tenwa.customer.CUSTOMER_ACCOUNT; import jbo.com.tenwa.lease.comm.LB_BUCKLE_LOG; @@ -415,9 +418,11 @@ public class CollectAuditInfoCache { * @param bo * @param rent * @return + * @throws JBOException + * @throws SQLException * @throws Exception */ - public Map handcraftsingleCollectMoeny(JBOTransaction tx,BizObjectManager bc,BizObject bo,String rent,String hire_list) throws Exception{ + public Map handcraftsingleCollectMoeny(JBOTransaction tx,BizObjectManager bc,BizObject bo,String rent,String hire_list) throws JBOException, SQLException { String cerrentDate = DateAssistant.getToday();//获取当前日期,格式为:yyyy/MM/dd Map map = new HashMap(); //改为存储过程实现 @@ -447,25 +452,34 @@ public class CollectAuditInfoCache { transaction.commit();*/ Transaction Sqlca =null; - Sqlca = Transaction.createTransaction(tx); - String ln_contract_id = bo.getAttribute("contract_id").toString(); - String ln_plan_date = bo.getAttribute("plan_date").toString(); - String in_rent = rent; - String in_hire_list = hire_list; - String in_type = "1"; - String SQL="{call proc_insert_hexiao('"+ln_contract_id+"','"+ln_plan_date+"','"+in_rent+"','"+in_hire_list+"','"+in_type+"')} "; - SqlObject asql = new SqlObject(SQL); - ASResultSet rs = null; - - rs = Sqlca.getASResultSet(asql); + ASResultSet rs = null; + try { + + Sqlca = Transaction.createTransaction(tx); + String ln_contract_id = bo.getAttribute("contract_id").toString(); + String ln_plan_date = bo.getAttribute("plan_date").toString(); + String in_rent = rent; + String in_hire_list = hire_list; + String in_type = "1"; + String SQL="{call proc_insert_hexiao('"+ln_contract_id+"','"+ln_plan_date+"','"+in_rent+"','"+in_hire_list+"','"+in_type+"')} "; + SqlObject asql = new SqlObject(SQL); + rs = Sqlca.getASResultSet(asql); + } catch (Exception e) { + e.printStackTrace(); + }finally{ + if(rs != null) rs.close(); + if(Sqlca!=null)Sqlca.commit(); + } - BizObject bco = bc.createQuery("id=:id").setParameter("id", bo.getAttribute("id").toString()).getSingleResult(false); + + + /*BizObject bco = bc.createQuery("id=:id").setParameter("id", bo.getAttribute("id").toString()).getSingleResult(false); String batch_number = bco.getAttribute("BATCH_NO").toString(); if (batch_number.length() == 0) { batch_number += "手工付款金额:"+rent; }else{ batch_number += ";手工付款金额:"+rent; - } + }*/ //更新收付状态 bc.createQuery("update O set O.COLLECT_STATUS=:COLLECT_STATUS ,O.COLLECT_MSG=:COLLECT_MSG where O.id=:id") .setParameter("COLLECT_STATUS", "收款成功") @@ -840,16 +854,24 @@ public class CollectAuditInfoCache { transaction.commit();*/ Transaction Sqlca =null; - Sqlca = Transaction.createTransaction(tx); - String ln_contract_id = bo.getAttribute("contract_id").toString(); - String ln_plan_date = bo.getAttribute("plan_date").toString(); - String in_rent = rent; - String in_hire_list = hire_list; - String in_type = "1"; - String SQL="{call proc_insert_hexiao('"+ln_contract_id+"','"+ln_plan_date+"','"+in_rent+"','"+in_hire_list+"','"+in_type+"')} "; - SqlObject asql = new SqlObject(SQL); - ASResultSet rs = null; - rs = Sqlca.getASResultSet(asql); + ASResultSet rs = null; + try { + + Sqlca = Transaction.createTransaction(tx); + String ln_contract_id = bo.getAttribute("contract_id").toString(); + String ln_plan_date = bo.getAttribute("plan_date").toString(); + String in_rent = rent; + String in_hire_list = hire_list; + String in_type = "2"; + String SQL="{call proc_insert_hexiao('"+ln_contract_id+"','"+ln_plan_date+"','"+in_rent+"','"+in_hire_list+"','"+in_type+"')} "; + SqlObject asql = new SqlObject(SQL); + rs = Sqlca.getASResultSet(asql); + } catch (Exception e) { + e.printStackTrace(); + }finally{ + if(rs != null) rs.close(); + if(Sqlca!=null)Sqlca.commit(); + } return map; }