1.修改空指针问题。

This commit is contained in:
zhangbb 2019-09-17 18:19:21 +08:00
parent d88b4d55ee
commit 54fa151f4f

View File

@ -1135,15 +1135,21 @@ public class CreateTransactionExecutor implements Transaction {
BizObjectManager letManage = JBOFactory.getBizObjectManager(LB_EQUIPMENT_TEMP.CLASS_NAME);
List<BizObject> 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)+"";
}