diff --git a/calc/com/tenwa/reckon/executor/CreateTransactionExecutor.java b/calc/com/tenwa/reckon/executor/CreateTransactionExecutor.java index 570783b9b..9a602fe9d 100644 --- a/calc/com/tenwa/reckon/executor/CreateTransactionExecutor.java +++ b/calc/com/tenwa/reckon/executor/CreateTransactionExecutor.java @@ -1135,15 +1135,21 @@ public class CreateTransactionExecutor implements Transaction { BizObjectManager letManage = JBOFactory.getBizObjectManager(LB_EQUIPMENT_TEMP.CLASS_NAME); List lccts = lcctManage.createQuery(" project_id=:projectid and flowunid<>:flowunid and contract_plan_number<>'' ").setParameter("projectid", projectId).setParameter("flowunid", flowunid).getResultList(false); for (BizObject lcct : lccts) { - lcct.getAttribute("EQUIP_AMT").getString(); - double equip_money = new Double(lcct.getAttribute("EQUIP_AMT").getString()); + double equip_money=0; + if(lcct.getAttribute("EQUIP_AMT")!=null&&!"".endsWith(lcct.getAttribute("EQUIP_AMT").getString())){ + equip_money = new Double(lcct.getAttribute("EQUIP_AMT").getString()); + }; sumMoney = sumMoney+equip_money; } com.amarsoft.awe.util.Transaction Sqlca =null; Sqlca = com.amarsoft.awe.util.Transaction.createTransaction(CacheLoaderFactory.getDataSource()); String sql = "select sum(EQUIP_PRICE) as EQUIP_PRICE from LB_EQUIPMENT_TEMP O where O.flowunid='"+flowunid+"'"; SqlObject sqlobj = new SqlObject(sql); - double equip_money = new Double(Sqlca.getString(sqlobj)); + String money = Sqlca.getString(sqlobj); + if(money==null||"".equals(money)){ + money="0"; + } + double equip_money = new Double(money); Sqlca.commit(); return (equip_money-sumMoney)+""; }