diff --git a/calc/com/tenwa/reckon/executor/CreateTransactionExecutor.java b/calc/com/tenwa/reckon/executor/CreateTransactionExecutor.java index d3345ebfc..6aafd51f3 100644 --- a/calc/com/tenwa/reckon/executor/CreateTransactionExecutor.java +++ b/calc/com/tenwa/reckon/executor/CreateTransactionExecutor.java @@ -1128,18 +1128,14 @@ public class CreateTransactionExecutor implements Transaction { //校验融资金额是否超额 public String checkMoney()throws Exception{ - double sumMoney = 0.0; - BizObjectManager lcctManage = JBOFactory.getBizObjectManager(LC_CALC_CONDITION_TEMP.CLASS_NAME); + BigDecimal sumMoney = new BigDecimal("0") ; 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()); - sumMoney = sumMoney+equip_money; + List letms = letManage.createQuery("flowunid=:flowunid").setParameter("flowunid", this.flowunid).getResultList(false); + for(BizObject letm:letms){ + sumMoney = new BigDecimal(letm.getAttribute("EQUIP_PRICE").getString()).add(sumMoney); } - BizObject letm = letManage.createQuery("flowunid=:flowunid").setParameter("flowunid", this.flowunid).getSingleResult(false); - double equip_money = new Double(letm.getAttribute("EQUIP_PRICE").getString()).doubleValue(); - return (equip_money-sumMoney)+""; + sumMoney = sumMoney.setScale(2, BigDecimal.ROUND_HALF_UP); + return sumMoney.toString(); }