diff --git a/src_app_fresh/apx/com/amarsoft/als/apzl/flow/data/service/Impl/FlowDataServiceImpl.java b/src_app_fresh/apx/com/amarsoft/als/apzl/flow/data/service/Impl/FlowDataServiceImpl.java index aa6e3a072..16041418c 100644 --- a/src_app_fresh/apx/com/amarsoft/als/apzl/flow/data/service/Impl/FlowDataServiceImpl.java +++ b/src_app_fresh/apx/com/amarsoft/als/apzl/flow/data/service/Impl/FlowDataServiceImpl.java @@ -259,8 +259,12 @@ public class FlowDataServiceImpl implements FlowDataService{ }else{ BizObjectManager cahManage = JBOFactory.getFactory().getManager(CUSTOMER_ACCOUNT_HIS.CLASS_NAME); BizObjectManager caManage = JBOFactory.getFactory().getManager(CUSTOMER_ACCOUNT.CLASS_NAME,tx); - BizObject ca = caManage.createQuery(" project_id=:project_id ").setParameter("project_id", projectId).getSingleResult(true); - if( ca!=null && "Y".equals(ca.getAttribute("sign_status")==null?"":ca.getAttribute("sign_status").toString())){ + BizObject ca = caManage.createQuery(" acc_type='Debit' and project_id=:project_id ").setParameter("project_id", projectId).getSingleResult(true); + if(ca==null){ + ca = caManage.newObject(); + BizObject lul = JBOFactory.getFactory().getManager(LB_UNION_LESSEE.CLASS_NAME).createQuery(" project_id=:project_id ").setParameter("project_id", projectId).getSingleResult(false); + ca.setAttributeValue("customerid", lul.getAttribute("customer_id").getString()); + }else if(ca!=null && "Y".equals(ca.getAttribute("sign_status")==null?"":ca.getAttribute("sign_status").toString())){ BizObject cah = cahManage.createQuery(" account=:account and acc_number=:acc_number and bank_name=:bank_name and mobile=:mobile ") .setParameter("account", ca.getAttribute("account").toString()).setParameter("acc_number", ca.getAttribute("acc_number").toString()).setParameter("bank_name", ca.getAttribute("bank_name").toString()).setParameter("mobile", ca.getAttribute("mobile").toString()).getSingleResult(false); if(cah == null ){ @@ -268,10 +272,6 @@ public class FlowDataServiceImpl implements FlowDataService{ signFromCondtion.put("PROJECT_ID",projectId); DataOperatorUtil.copyJBOSet(CUSTOMER_ACCOUNT.CLASS_NAME, signFromCondtion,CUSTOMER_ACCOUNT_HIS.CLASS_NAME, null, null,null, tx); } - }else{ - ca = caManage.newObject(); - BizObject lul = JBOFactory.getFactory().getManager(LB_UNION_LESSEE.CLASS_NAME).createQuery(" project_id=:project_id ").setParameter("project_id", projectId).getSingleResult(false); - ca.setAttributeValue("customerid", lul.getAttribute("customer_id").getString()); } ca.setAttributeValue("acc_number", acc_number); ca.setAttributeValue("bank_name", bank_name);