From a3e54422a4498835698514288e5ae5ba7d2f91d4 Mon Sep 17 00:00:00 2001 From: liuzhao Date: Wed, 12 Sep 2018 18:13:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=A3=E9=87=91=E8=AE=BE=E7=BD=AE=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tenwa/apzl/commission/commissionSet.java | 28 ++++++++++++------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/src_tenwa/com/tenwa/apzl/commission/commissionSet.java b/src_tenwa/com/tenwa/apzl/commission/commissionSet.java index e3e0c4a8f..f9b33dd73 100644 --- a/src_tenwa/com/tenwa/apzl/commission/commissionSet.java +++ b/src_tenwa/com/tenwa/apzl/commission/commissionSet.java @@ -93,29 +93,37 @@ public class commissionSet { Transaction Sqlca=null; tx= JBOFactory.createJBOTransaction(); Sqlca=Transaction.createTransaction(tx); + String endDate = this.getEndDate(); + endDate = endDate.replaceAll("/", ""); + int end = Integer.parseInt(endDate); int start = 0; String sql="SELECT MIN(effect_start) AS effect_start FROM LB_PRODUCT_SALVAGE WHERE product_id=:product_id AND effect_start>:effect_start"; SqlObject asql = new SqlObject(sql).setParameter("product_id", leasForm).setParameter("effect_start", startDate); try { ASResultSet rs = Sqlca.getResultSet(asql); - if(rs.next()){ - String effectStart = rs.getString(1); - effectStart = effectStart.replaceAll("/", ""); - start = Integer.parseInt(effectStart); - } + + + if(rs.next()){ + String effectStart = rs.getString(1); + if(effectStart==null || "".equals(effectStart)){ + return "success"; + }else{ + + effectStart = effectStart.replaceAll("/", ""); + start = Integer.parseInt(effectStart); + } + } + } catch (Exception e) { e.printStackTrace(); } - - String endDate = this.getEndDate(); - endDate = endDate.replaceAll("/", ""); - int end = Integer.parseInt(endDate); - if(end>=start){ return "fail"; }else{ return "success"; } + + } }