package wenrgise.hrms.ejb.business; import java.sql.Timestamp; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; import wenrgise.common.bean.BaseHeaderBean; import wenrgise.common.bean.LOVBean; import wenrgise.common.exception.EnrgiseApplicationException; import wenrgise.common.exception.EnrgiseMessageKeyException; import wenrgise.common.exception.EnrgiseSystemException; import wenrgise.common.utility.DateUtility; import wenrgise.common.utility.EnrgiseUtil; import wenrgise.common.utility.MessageKey; import wenrgise.common.utility.RecordMetaInfo; import wenrgise.common.utility.UserInfo; import wenrgise.common.vo.BaseDetailVO; import wenrgise.common.vo.BaseHeaderVO; import wenrgise.common.vo.LovQueryVO; import wenrgise.common.vo.LovVO; import wenrgise.ejb.common.helper.DBObject; import wenrgise.ejb.common.helper.QueryRow; import wenrgise.ejb.common.helper.QueryValue; import wenrgise.ejb.common.utility.DBUtilitiesBean; import wenrgise.hrms.bean.HrmAprslStartRuleDtlBean; import wenrgise.hrms.bean.HrmAprslStartRuleHdrBean; import wenrgise.hrms.vo.HrmAprslStartRuleQVO; public class HrmAprslStartRuleBO extends HrmBaseBO { public HrmAprslStartRuleBO() {} public HrmAprslStartRuleBO(UserInfo oUserInfo) { super(oUserInfo); } public void initializeBOImpl() { this.headerTable = "HRM_APRSL_START_ORDER_RULE_HDR"; } public void updateHeaderImpl(BaseHeaderBean oBaseHeaderBean) throws EnrgiseSystemException { System.out.println("Update ille!"); } public String saveNewHeaderImpl(BaseHeaderBean oBaseHeaderBean) throws EnrgiseSystemException { return ""; } public void saveDetailImpl(String sHeaderPrimaryKey, String sScreenName, ArrayList oDetailBeanArray) throws EnrgiseSystemException {} public String saveHeaderImpl(BaseHeaderBean oBaseHeaderBean, String ScreenMode) throws EnrgiseSystemException { String returnString = null; ArrayList arylstParam = new ArrayList(); DBUtilitiesBean oBean = new DBUtilitiesBean(); DateUtility d = new DateUtility(); HrmAprslStartRuleHdrBean oHrmAprslStartRuleHdrBean = (HrmAprslStartRuleHdrBean)oBaseHeaderBean; if (ScreenMode.equalsIgnoreCase("N")) { arylstParam = new ArrayList(); arylstParam.add(new DBObject(1, 1, 12, "N")); arylstParam.add(new DBObject(2, 1, 12, "")); arylstParam.add(new DBObject(3, 1, 12, oHrmAprslStartRuleHdrBean.getHdnAprslStOrdNo())); arylstParam.add(new DBObject(4, 1, 12, oHrmAprslStartRuleHdrBean.getHdnSiteCode())); arylstParam.add(new DBObject(5, 1, 12, oHrmAprslStartRuleHdrBean.getHdnWrkGrpCode())); arylstParam.add(new DBObject(6, 1, 12, oHrmAprslStartRuleHdrBean.getHdnClsHdrID())); arylstParam.add(new DBObject(7, 1, 12, oHrmAprslStartRuleHdrBean.getHdnClsDtlID())); arylstParam.add(new DBObject(8, 1, 12, oHrmAprslStartRuleHdrBean.getHdnEmpNum())); arylstParam.add(new DBObject(9, 1, 12, this.oUserInfo.getUserId())); arylstParam.add(new DBObject(10, 1, 12, this.oUserInfo.getSiteId())); arylstParam.add(new DBObject(11, 2, 12)); arylstParam.add(new DBObject(12, 2, 12)); arylstParam.add(new DBObject(13, 2, 12)); arylstParam.add(new DBObject(14, 2, 4)); ArrayList arylstOutArray = oBean.callProc(arylstParam, "HRMAPRSLSTRULE.proc_UpsertHrmAprslStRuleHdr(?,?,?,?,?,?,?,?,?,?,?,?,?,?)"); DBObject oOutObject = arylstOutArray.get(0); returnString = (String)oOutObject.getObject(); System.out.println(returnString); } else if (ScreenMode.equalsIgnoreCase("U")) { } saveDetailPart(returnString); return returnString; } public void saveDetailPart(String sHeaderPrimaryKey) throws EnrgiseSystemException { ArrayList oDetailBeanArray = new ArrayList(); HrmAprslStartRuleDtlBean oHrmAprslStartRuleDtlBean = new HrmAprslStartRuleDtlBean(); int count = 0; ArrayList oParameters = new ArrayList(); DBUtilitiesBean oBean = new DBUtilitiesBean(); oParameters = new ArrayList(); oParameters.add(new DBObject(1, 1, 12, sHeaderPrimaryKey)); oParameters.add(new DBObject(2, 2, -10)); oParameters.add(new DBObject(3, 2, 12)); oParameters.add(new DBObject(4, 2, 12)); oParameters.add(new DBObject(5, 2, 4)); ArrayList oOutArray = oBean.callProc(oParameters, "HRMAPRSLSTRULE.proc_DetailEmployee(?,?,?,?,?)"); DBObject oOutObject = oOutArray.get(0); ArrayList oList = (ArrayList)oOutObject.getObject(); QueryRow oRow = null; Iterator iter = oList.iterator(); while (iter.hasNext()) { if (count == 0) oList = new ArrayList(); count++; oRow = iter.next(); oHrmAprslStartRuleDtlBean = new HrmAprslStartRuleDtlBean(); oHrmAprslStartRuleDtlBean.setDtlEmplNo(oRow.get("EmpID").getString()); oHrmAprslStartRuleDtlBean.setStatus("N"); oList.add(oHrmAprslStartRuleDtlBean); } saveDetailData(sHeaderPrimaryKey, oList); } public void saveDetailData(String sHeaderPrimaryKey, ArrayList oDetailBeanArray) throws EnrgiseSystemException { boolean bInsert = false; boolean bUpdate = false; boolean bDelete = false; ArrayList oParameters = new ArrayList(); DBUtilitiesBean oBean = null; DBUtilitiesBean oBeanInsert = null; DBUtilitiesBean oBeanDelete = null; Iterator oIt = oDetailBeanArray.iterator(); while (oIt.hasNext()) { HrmAprslStartRuleDtlBean oHrmAprslStartRuleDtlBean = oIt.next(); if (oHrmAprslStartRuleDtlBean.getStatus().equals("N")) { if (!bInsert) { oBeanInsert = new DBUtilitiesBean(); oBeanInsert.createBatch("HRMAPRSLSTRULE.proc_UpsertHrmAprslStRuleDtl(?,?,?,?,?,?)"); bInsert = true; } oParameters = new ArrayList(); oParameters.add(new DBObject(1, 1, 12, new String("N"))); oParameters.add(new DBObject(2, 1, 12, new String(""))); oParameters.add(new DBObject(3, 1, 12, sHeaderPrimaryKey)); oParameters.add(new DBObject(4, 1, 12, new String(oHrmAprslStartRuleDtlBean.getDtlEmplNo()))); oParameters.add(new DBObject(5, 1, 12, new String(this.oUserInfo.getUserId()))); oParameters.add(new DBObject(6, 1, 12, new String(this.oUserInfo.getSiteId()))); oBeanInsert.addToBatch(oParameters); continue; } if (oHrmAprslStartRuleDtlBean.getStatus().equals("U")) { if (!bUpdate) { oBean = new DBUtilitiesBean(); oBean.createBatch("HRMAPRSLSTRULE.proc_UpsertHrmAprslStRuleDtl(?,?,?,?,?,?)"); bUpdate = true; } oParameters = new ArrayList(); oParameters.add(new DBObject(1, 1, 12, new String("U"))); oParameters.add(new DBObject(2, 1, 12, new String(oHrmAprslStartRuleDtlBean.getDetailId()))); oParameters.add(new DBObject(3, 1, 12, sHeaderPrimaryKey)); oParameters.add(new DBObject(4, 1, 12, new String(oHrmAprslStartRuleDtlBean.getDtlEmplNo()))); oParameters.add(new DBObject(5, 1, 12, new String(this.oUserInfo.getUserId()))); oParameters.add(new DBObject(6, 1, 12, new String(this.oUserInfo.getSiteId()))); oBean.addToBatch(oParameters); continue; } if (oHrmAprslStartRuleDtlBean.getStatus().equals("D")) { if (!bDelete) { oBeanDelete = new DBUtilitiesBean(); oBeanDelete.createBatch("HRMAPRSLSTRULE.proc_DeletePFDetail(?)"); bDelete = true; } oParameters = new ArrayList(); oParameters.add(new DBObject(1, 1, 12, new String(oHrmAprslStartRuleDtlBean.getDetailId()))); oBeanDelete.addToBatch(oParameters); } } try { if (bInsert) oBeanInsert.executeBatch(); } catch (Exception e) { System.out.println(e.getMessage()); } } public RecordMetaInfo getHrmAprslRuleHdrMetaInfo(HrmAprslStartRuleQVO oHrmAprslStartRuleQVO) throws EnrgiseApplicationException, EnrgiseSystemException { ArrayList arylstParam = new ArrayList(); DBUtilitiesBean oBean = new DBUtilitiesBean(); Timestamp oWhenPicked = null; int count = 0; BaseHeaderVO oBaseHeaderVO = new BaseHeaderVO(); arylstParam = new ArrayList(); arylstParam.add(new DBObject(1, 1, 12, oHrmAprslStartRuleQVO.getHdnAprslStOrdNo())); arylstParam.add(new DBObject(2, 1, 12, oHrmAprslStartRuleQVO.getHdnSiteCode())); arylstParam.add(new DBObject(3, 1, 12, oHrmAprslStartRuleQVO.getHdnWrkGrpCode())); arylstParam.add(new DBObject(4, 1, 12, oHrmAprslStartRuleQVO.getHdnEmpNum())); arylstParam.add(new DBObject(5, 1, 12, oHrmAprslStartRuleQVO.getHdnClsHdrID())); arylstParam.add(new DBObject(6, 1, 12, oHrmAprslStartRuleQVO.getHdnClsDtlID())); arylstParam.add(new DBObject(7, 1, 12, oHrmAprslStartRuleQVO.getHeaderPrimaryKey())); arylstParam.add(new DBObject(8, 2, -5)); arylstParam.add(new DBObject(9, 2, 93)); arylstParam.add(new DBObject(10, 2, 12)); arylstParam.add(new DBObject(11, 2, 12)); arylstParam.add(new DBObject(12, 2, 4)); ArrayList arylstOutArray = oBean.callProc(arylstParam, "HRMAPRSLSTRULE.procStOrderAppslHdrCount(?,?,?,?,?,?,?,?,?,?,?,?)"); RecordMetaInfo oRecordMetaInfo = new RecordMetaInfo(); DBObject oTimeObject = arylstOutArray.get(1); oRecordMetaInfo.setOWhenPicked((Timestamp)oTimeObject.getObject()); DBObject oTotalRecord = arylstOutArray.get(0); oRecordMetaInfo.setRecordCount(((Long)oTotalRecord.getObject()).longValue()); return oRecordMetaInfo; } public ArrayList getHrmAprslRuleHeaderInfo(HrmAprslStartRuleQVO oHrmAprslStartRuleQVO, long lStartPosition, long lLastPosition) throws EnrgiseApplicationException, EnrgiseSystemException { ArrayList arylstParam = new ArrayList(); DBUtilitiesBean oBean = new DBUtilitiesBean(); Timestamp oWhenPicked = null; int count = 0; BaseHeaderVO oBaseHeaderVO = new BaseHeaderVO(); ArrayList arylstHeaderList = null; if (oHrmAprslStartRuleQVO == null) oHrmAprslStartRuleQVO = new HrmAprslStartRuleQVO(); arylstParam = new ArrayList(); arylstParam.add(new DBObject(1, 1, -5, new Long(lStartPosition))); arylstParam.add(new DBObject(2, 1, -5, new Long(lLastPosition))); arylstParam.add(new DBObject(3, 1, 12, oHrmAprslStartRuleQVO.getHdnAprslStOrdNo())); arylstParam.add(new DBObject(4, 1, 12, oHrmAprslStartRuleQVO.getHdnSiteCode())); arylstParam.add(new DBObject(5, 1, 12, oHrmAprslStartRuleQVO.getHdnWrkGrpCode())); arylstParam.add(new DBObject(6, 1, 12, oHrmAprslStartRuleQVO.getHdnEmpNum())); arylstParam.add(new DBObject(7, 1, 12, oHrmAprslStartRuleQVO.getHdnClsHdrID())); arylstParam.add(new DBObject(8, 1, 12, oHrmAprslStartRuleQVO.getHdnClsDtlID())); arylstParam.add(new DBObject(9, 1, 12, oHrmAprslStartRuleQVO.getHeaderPrimaryKey())); arylstParam.add(new DBObject(10, 2, -10)); arylstParam.add(new DBObject(11, 2, 12)); arylstParam.add(new DBObject(12, 2, 12)); arylstParam.add(new DBObject(13, 2, 4)); ArrayList arylstOutArray = oBean.callProc(arylstParam, "HRMAPRSLSTRULE.procStOrderAppslHeader(?,?,?,?,?,?,?,?,?,?,?,?,?)"); DBObject oOutObject = arylstOutArray.get(0); ArrayList arylstList = (ArrayList)oOutObject.getObject(); if (arylstList.size() == 0) throw new EnrgiseApplicationException("wenrgise.hrms.norecordfound", "M"); QueryRow oRow = null; HashMap oColumns = null; Iterator oIt = arylstList.iterator(); while (oIt.hasNext()) { if (count == 0) arylstHeaderList = new ArrayList(); count++; oRow = oIt.next(); HrmAprslStartRuleHdrBean oHrmAprslStartRuleHdrBean = new HrmAprslStartRuleHdrBean(); oHrmAprslStartRuleHdrBean.setHeaderPrimaryKey(oRow.get("ID").getString()); oHrmAprslStartRuleHdrBean.setHdnAprslStOrdNo(oRow.get("APRSL_START_ORDER_ID").getString()); oHrmAprslStartRuleHdrBean.setTxtAprslStOrdNo(oRow.get("START_ORDER_NO").getString()); oHrmAprslStartRuleHdrBean.setHdnEmpNum(oRow.get("E_PER_DTL_ID").getString()); oHrmAprslStartRuleHdrBean.setTxtEmpNum(oRow.get("EMP_NO").getString()); oHrmAprslStartRuleHdrBean.setTxtEmpName(oRow.get("NAME").getString()); oHrmAprslStartRuleHdrBean.setHdnWrkGrpCode(oRow.get("WRKGRP_ID").getString()); oHrmAprslStartRuleHdrBean.setTxtWrkGrpCode(oRow.get("WRKGRPCODE").getString()); oHrmAprslStartRuleHdrBean.setTxtWrkGrpDesc(oRow.get("WRKGRPNAME").getString()); oHrmAprslStartRuleHdrBean.setHdnSiteCode(oRow.get("SITE_ID").getString()); oHrmAprslStartRuleHdrBean.setTxtSiteCode(oRow.get("SITECODE").getString()); oHrmAprslStartRuleHdrBean.setTxtSiteDesc(oRow.get("SITENAME").getString()); oHrmAprslStartRuleHdrBean.setHdnClsHdrID(oRow.get("CLS_MST_ID").getString()); oHrmAprslStartRuleHdrBean.setTxtClsHdr(oRow.get("MSTCODDE").getString()); oHrmAprslStartRuleHdrBean.setTxtClsHdrDesc(oRow.get("MSTNAME").getString()); oHrmAprslStartRuleHdrBean.setHdnClsDtlID(oRow.get("CLS_DT_ID").getString()); oHrmAprslStartRuleHdrBean.setTxtClsDtl(oRow.get("DTLCODE").getString()); oHrmAprslStartRuleHdrBean.setTxtClsDtlDesc(oRow.get("DTLNAME").getString()); arylstHeaderList.add(oHrmAprslStartRuleHdrBean); } return arylstHeaderList; } public RecordMetaInfo getHrmAprslRuleDtlMetaInfo(String lPrimaryKey) throws EnrgiseApplicationException, EnrgiseSystemException { ArrayList arylstParam = new ArrayList(); DBUtilitiesBean oBean = new DBUtilitiesBean(); arylstParam = new ArrayList(); arylstParam.add(new DBObject(1, 1, 12, lPrimaryKey)); arylstParam.add(new DBObject(2, 2, -5)); arylstParam.add(new DBObject(3, 2, 93)); arylstParam.add(new DBObject(4, 2, 12)); arylstParam.add(new DBObject(5, 2, 12)); arylstParam.add(new DBObject(6, 2, 4)); ArrayList arylstOutArray = oBean.callProc(arylstParam, "HRMAPRSLSTRULE.procStOrderAppslDtlCount(?,?,?,?,?,?)"); RecordMetaInfo oRecordMetaInfo = new RecordMetaInfo(); DBObject oTotalRecord = arylstOutArray.get(0); oRecordMetaInfo.setRecordCount(((Long)oTotalRecord.getObject()).longValue()); DBObject oTimeObject = arylstOutArray.get(1); oRecordMetaInfo.setOWhenPicked((Timestamp)oTimeObject.getObject()); return oRecordMetaInfo; } public ArrayList getHrmAprslRuleDetailInfo(String lPrimaryKey, long lDetailFirstPosition, long lDetailLastPosition) throws EnrgiseApplicationException, EnrgiseSystemException { ArrayList arylstParam = new ArrayList(); DBUtilitiesBean oBean = new DBUtilitiesBean(); int count = 0; BaseDetailVO oBaseDetailVO = null; ArrayList arylstHrmTempSecDetail = null; arylstParam = new ArrayList(); arylstParam.add(new DBObject(1, 1, -5, new Long(lDetailFirstPosition))); arylstParam.add(new DBObject(2, 1, -5, new Long(lDetailLastPosition))); arylstParam.add(new DBObject(3, 1, 12, lPrimaryKey)); arylstParam.add(new DBObject(4, 2, -10)); arylstParam.add(new DBObject(5, 2, 12)); arylstParam.add(new DBObject(6, 2, 12)); arylstParam.add(new DBObject(7, 2, 4)); ArrayList arylstOutArray = oBean.callProc(arylstParam, "HRMAPRSLSTRULE.procStOrderAppslDetail(?,?,?,?,?,?,?)"); DBObject oOutObject = arylstOutArray.get(0); ArrayList arylstList = (ArrayList)oOutObject.getObject(); if (arylstList.size() == 0) throw new EnrgiseApplicationException("wenrgise.hrms.norecordfound", "M"); QueryRow oRow = null; QueryValue oValue = null; HashMap oColumns = null; Iterator oIt = arylstList.iterator(); while (oIt.hasNext()) { if (count == 0) arylstHrmTempSecDetail = new ArrayList(); count++; oRow = oIt.next(); HrmAprslStartRuleDtlBean oHrmAprslStartRuleDtlBean = new HrmAprslStartRuleDtlBean(); oHrmAprslStartRuleDtlBean.setDetailId(oRow.get("ID").getString()); oHrmAprslStartRuleDtlBean.setTxtEmplNo(oRow.get("EMP_NO").getString()); oHrmAprslStartRuleDtlBean.setTxtEmplName(oRow.get("NAME").getString()); oHrmAprslStartRuleDtlBean.setDtlEmplNo(oRow.get("E_PER_DTL_ID").getString()); arylstHrmTempSecDetail.add(oHrmAprslStartRuleDtlBean); } return arylstHrmTempSecDetail; } public LovVO getClsMstData(LovQueryVO oLovQueryVO) throws EnrgiseApplicationException, EnrgiseSystemException { LovVO oLovVO = new LovVO(); ArrayList arylstHeaderNames = new ArrayList(); arylstHeaderNames.add("SelectOptionID"); arylstHeaderNames.add("hrm.HrmOrgIncrement.classHeaderCode"); arylstHeaderNames.add("hrm.HrmOrgIncrement.classHeaderDesc"); oLovVO.setHeaderList(arylstHeaderNames); ArrayList arylstVisibility = new ArrayList(); arylstVisibility.add("H"); arylstVisibility.add("V"); arylstVisibility.add("V"); oLovVO.setVisibilityList(arylstVisibility); int count = 0; ArrayList oParameters = new ArrayList(); DBUtilitiesBean oBean = new DBUtilitiesBean(); oParameters = new ArrayList(); oParameters.add(new DBObject(1, 1, 12, new String(oLovQueryVO.getSearchField1()))); oParameters.add(new DBObject(2, 2, -10)); oParameters.add(new DBObject(3, 2, 12)); oParameters.add(new DBObject(4, 2, 12)); oParameters.add(new DBObject(5, 2, 4)); ArrayList oOutArray = oBean.callProc(oParameters, "HRMAPRSLSTRULE.proc_ClsMstLOV(?,?,?,?,?)"); DBObject oOutObject = oOutArray.get(0); ArrayList oList = (ArrayList)oOutObject.getObject(); QueryRow oRow = null; Iterator iter = oList.iterator(); while (iter.hasNext()) { if (count == 0) oList = new ArrayList(); count++; oRow = iter.next(); LOVBean oLOVBean = new LOVBean(); oLOVBean.setDetailField1(oRow.get("id").getString()); oLOVBean.setDetailField2(oRow.get("code").getString()); oLOVBean.setDetailField3(oRow.get("name").getString()); oList.add(oLOVBean); } oLovVO.setDetailList(oList); return oLovVO; } public LovVO getClsDtlData(LovQueryVO oLovQueryVO) throws EnrgiseApplicationException, EnrgiseSystemException { LovVO oLovVO = new LovVO(); ArrayList arylstHeaderNames = new ArrayList(); arylstHeaderNames.add("OptionDetailID"); arylstHeaderNames.add("hrm.HrmOrgIncrement.classDetailCode"); arylstHeaderNames.add("hrm.HrmOrgIncrement.classDetailDesc"); oLovVO.setHeaderList(arylstHeaderNames); ArrayList arylstVisibility = new ArrayList(); arylstVisibility.add("H"); arylstVisibility.add("V"); arylstVisibility.add("V"); oLovVO.setVisibilityList(arylstVisibility); String sID = null; if (EnrgiseUtil.checkString(oLovQueryVO.getProperty("SelOpt"))) sID = oLovQueryVO.getProperty("SelOpt"); int count = 0; ArrayList oParameters = new ArrayList(); DBUtilitiesBean oBean = new DBUtilitiesBean(); oParameters = new ArrayList(); oParameters.add(new DBObject(1, 1, 12, sID)); oParameters.add(new DBObject(2, 1, 12, oLovQueryVO.getSearchField1())); oParameters.add(new DBObject(3, 2, -10)); oParameters.add(new DBObject(4, 2, 12)); oParameters.add(new DBObject(5, 2, 12)); oParameters.add(new DBObject(6, 2, 4)); ArrayList oOutArray = oBean.callProc(oParameters, "HRMAPRSLSTRULE.proc_ClsDtlLOV(?,?,?,?,?,?)"); DBObject oOutObject = oOutArray.get(0); ArrayList oList = (ArrayList)oOutObject.getObject(); QueryRow oRow = null; Iterator iter = oList.iterator(); while (iter.hasNext()) { if (count == 0) oList = new ArrayList(); count++; oRow = iter.next(); LOVBean oLOVBean = new LOVBean(); oLOVBean.setDetailField1(oRow.get("ID").getString()); oLOVBean.setDetailField2(oRow.get("CODE").getString()); oLOVBean.setDetailField3(oRow.get("NAME").getString()); oList.add(oLOVBean); } oLovVO.setDetailList(oList); return oLovVO; } public LovVO getClsMstDataQ(LovQueryVO oLovQueryVO) throws EnrgiseApplicationException, EnrgiseSystemException { LovVO oLovVO = new LovVO(); ArrayList arylstHeaderNames = new ArrayList(); arylstHeaderNames.add("SelectOptionID"); arylstHeaderNames.add("hrm.HrmWorkGroup.code"); arylstHeaderNames.add("hrm.HrmWorkGroup.name"); oLovVO.setHeaderList(arylstHeaderNames); ArrayList arylstVisibility = new ArrayList(); arylstVisibility.add("H"); arylstVisibility.add("V"); arylstVisibility.add("V"); oLovVO.setVisibilityList(arylstVisibility); int count = 0; ArrayList oParameters = new ArrayList(); DBUtilitiesBean oBean = new DBUtilitiesBean(); oParameters = new ArrayList(); oParameters.add(new DBObject(1, 1, 12, new String(oLovQueryVO.getSearchField1()))); oParameters.add(new DBObject(2, 2, -10)); oParameters.add(new DBObject(3, 2, 12)); oParameters.add(new DBObject(4, 2, 12)); oParameters.add(new DBObject(5, 2, 4)); ArrayList oOutArray = oBean.callProc(oParameters, "HRMAPRSLSTRULE.proc_ClsMstLOVQ(?,?,?,?,?)"); DBObject oOutObject = oOutArray.get(0); ArrayList oList = (ArrayList)oOutObject.getObject(); QueryRow oRow = null; Iterator iter = oList.iterator(); while (iter.hasNext()) { if (count == 0) oList = new ArrayList(); count++; oRow = iter.next(); LOVBean oLOVBean = new LOVBean(); oLOVBean.setDetailField1(oRow.get("id").getString()); oLOVBean.setDetailField2(oRow.get("code").getString()); oLOVBean.setDetailField3(oRow.get("name").getString()); oList.add(oLOVBean); } oLovVO.setDetailList(oList); return oLovVO; } public LovVO getClsDtlDataQ(LovQueryVO oLovQueryVO) throws EnrgiseApplicationException, EnrgiseSystemException { LovVO oLovVO = new LovVO(); ArrayList arylstHeaderNames = new ArrayList(); arylstHeaderNames.add("OptionDetailID"); arylstHeaderNames.add("hrm.HrmWorkGroup.code"); arylstHeaderNames.add("hrm.HrmWorkGroup.name"); oLovVO.setHeaderList(arylstHeaderNames); ArrayList arylstVisibility = new ArrayList(); arylstVisibility.add("H"); arylstVisibility.add("V"); arylstVisibility.add("V"); oLovVO.setVisibilityList(arylstVisibility); String sID = null; if (EnrgiseUtil.checkString(oLovQueryVO.getProperty("SelOpt"))) sID = oLovQueryVO.getProperty("SelOpt"); int count = 0; ArrayList oParameters = new ArrayList(); DBUtilitiesBean oBean = new DBUtilitiesBean(); oParameters = new ArrayList(); oParameters.add(new DBObject(1, 1, 12, sID)); oParameters.add(new DBObject(2, 2, -10)); oParameters.add(new DBObject(3, 2, 12)); oParameters.add(new DBObject(4, 2, 12)); oParameters.add(new DBObject(5, 2, 4)); ArrayList oOutArray = oBean.callProc(oParameters, "HRMAPRSLSTRULE.proc_ClsDtlLOVQ(?,?,?,?,?)"); DBObject oOutObject = oOutArray.get(0); ArrayList oList = (ArrayList)oOutObject.getObject(); QueryRow oRow = null; Iterator iter = oList.iterator(); while (iter.hasNext()) { if (count == 0) oList = new ArrayList(); count++; oRow = iter.next(); LOVBean oLOVBean = new LOVBean(); oLOVBean.setDetailField1(oRow.get("ID").getString()); oLOVBean.setDetailField2(oRow.get("CODE").getString()); oLOVBean.setDetailField3(oRow.get("NAME").getString()); oList.add(oLOVBean); } oLovVO.setDetailList(oList); return oLovVO; } public LovVO getEmployeeLOVData(LovQueryVO oLovQueryVO) throws EnrgiseApplicationException, EnrgiseSystemException { LovVO oLovVO = new LovVO(); ArrayList arylstHeaderNames = new ArrayList(); arylstHeaderNames.add("empId"); arylstHeaderNames.add("hrm.HrmAprslStartRule.employeeNo"); arylstHeaderNames.add("hrm.HrmAprslStartRule.employeeName"); oLovVO.setHeaderList(arylstHeaderNames); ArrayList arylstVisibility = new ArrayList(); arylstVisibility.add("H"); arylstVisibility.add("V"); arylstVisibility.add("V"); oLovVO.setVisibilityList(arylstVisibility); int count = 0; ArrayList oParameters = new ArrayList(); DBUtilitiesBean oBean = new DBUtilitiesBean(); oParameters = new ArrayList(); oParameters.add(new DBObject(1, 1, 12, oLovQueryVO.getSearchField1())); oParameters.add(new DBObject(2, 2, -10)); oParameters.add(new DBObject(3, 2, 12)); oParameters.add(new DBObject(4, 2, 12)); oParameters.add(new DBObject(5, 2, 4)); ArrayList oOutArray = oBean.callProc(oParameters, "HRMAPRSLSTRULE.proc_EmployeeLOV(?,?,?,?,?)"); DBObject oOutObject = oOutArray.get(0); ArrayList oList = (ArrayList)oOutObject.getObject(); QueryRow oRow = null; Iterator iter = oList.iterator(); while (iter.hasNext()) { if (count == 0) oList = new ArrayList(); count++; oRow = iter.next(); LOVBean oLOVBean = new LOVBean(); oLOVBean.setDetailField1(oRow.get("id").getString()); oLOVBean.setDetailField2(oRow.get("emp_no").getString()); oLOVBean.setDetailField3(oRow.get("Name").getString()); oList.add(oLOVBean); } oLovVO.setDetailList(oList); return oLovVO; } public LovVO getQueryEmployeeLOVData(LovQueryVO oLovQueryVO) throws EnrgiseApplicationException, EnrgiseSystemException { LovVO oLovVO = new LovVO(); ArrayList arylstHeaderNames = new ArrayList(); arylstHeaderNames.add("empId"); arylstHeaderNames.add("hrm.HrmAprslStartRule.employeeNo"); arylstHeaderNames.add("hrm.HrmAprslStartRule.employeeName"); oLovVO.setHeaderList(arylstHeaderNames); ArrayList arylstVisibility = new ArrayList(); arylstVisibility.add("H"); arylstVisibility.add("V"); arylstVisibility.add("V"); oLovVO.setVisibilityList(arylstVisibility); int count = 0; ArrayList oParameters = new ArrayList(); DBUtilitiesBean oBean = new DBUtilitiesBean(); oParameters = new ArrayList(); oParameters.add(new DBObject(1, 1, 12, oLovQueryVO.getSearchField1())); oParameters.add(new DBObject(2, 2, -10)); oParameters.add(new DBObject(3, 2, 12)); oParameters.add(new DBObject(4, 2, 12)); oParameters.add(new DBObject(5, 2, 4)); ArrayList oOutArray = oBean.callProc(oParameters, "HRMAPRSLSTRULE.proc_QueryEmployeeLOV(?,?,?,?,?)"); DBObject oOutObject = oOutArray.get(0); ArrayList oList = (ArrayList)oOutObject.getObject(); QueryRow oRow = null; Iterator iter = oList.iterator(); while (iter.hasNext()) { if (count == 0) oList = new ArrayList(); count++; oRow = iter.next(); LOVBean oLOVBean = new LOVBean(); oLOVBean.setDetailField1(oRow.get("id").getString()); oLOVBean.setDetailField2(oRow.get("emp_no").getString()); oLOVBean.setDetailField3(oRow.get("Name").getString()); oList.add(oLOVBean); } oLovVO.setDetailList(oList); return oLovVO; } public LovVO getQueryStOrdLOVData(LovQueryVO oLovQueryVO) throws EnrgiseApplicationException, EnrgiseSystemException { LovVO oLovVO = new LovVO(); ArrayList arylstHeaderNames = new ArrayList(); arylstHeaderNames.add("codeID"); arylstHeaderNames.add("hrm.HrmAprslStartRule.aprslStartOrderNo"); oLovVO.setHeaderList(arylstHeaderNames); ArrayList arylstVisibility = new ArrayList(); arylstVisibility.add("H"); arylstVisibility.add("V"); oLovVO.setVisibilityList(arylstVisibility); int count = 0; ArrayList oParameters = new ArrayList(); DBUtilitiesBean oBean = new DBUtilitiesBean(); oParameters = new ArrayList(); oParameters.add(new DBObject(1, 1, 12, oLovQueryVO.getSearchField1())); oParameters.add(new DBObject(2, 2, -10)); oParameters.add(new DBObject(3, 2, 12)); oParameters.add(new DBObject(4, 2, 12)); oParameters.add(new DBObject(5, 2, 4)); ArrayList oOutArray = oBean.callProc(oParameters, "HRMAPRSLSTRULE.proc_QueryStOrdLOV(?,?,?,?,?)"); DBObject oOutObject = oOutArray.get(0); ArrayList oList = (ArrayList)oOutObject.getObject(); QueryRow oRow = null; Iterator iter = oList.iterator(); while (iter.hasNext()) { if (count == 0) oList = new ArrayList(); count++; oRow = iter.next(); LOVBean oLOVBean = new LOVBean(); oLOVBean.setDetailField1(oRow.get("ID").getString()); oLOVBean.setDetailField2(oRow.get("START_ORDER_NO").getString()); oList.add(oLOVBean); } oLovVO.setDetailList(oList); return oLovVO; } public LovVO getWrkGrpLOVData(LovQueryVO oLovQueryVO) throws EnrgiseApplicationException, EnrgiseSystemException { LovVO oLovVO = new LovVO(); ArrayList arylstHeaderList = new ArrayList(); arylstHeaderList.add("Code ID"); arylstHeaderList.add("hrm.HrmWorkGroup.code"); arylstHeaderList.add("hrm.HrmWorkGroup.name"); oLovVO.setHeaderList(arylstHeaderList); ArrayList arylstVisibility = new ArrayList(); arylstVisibility.add("H"); arylstVisibility.add("V"); arylstVisibility.add("V"); oLovVO.setVisibilityList(arylstVisibility); String sID = null; if (EnrgiseUtil.checkString(oLovQueryVO.getProperty("SelOpt"))) sID = oLovQueryVO.getProperty("SelOpt"); int count = 0; ArrayList oParameters = new ArrayList(); DBUtilitiesBean oBean = new DBUtilitiesBean(); oParameters = new ArrayList(); oParameters.add(new DBObject(1, 1, 12, sID)); oParameters.add(new DBObject(2, 1, 12, oLovQueryVO.getSearchField1())); oParameters.add(new DBObject(3, 1, 12, oLovQueryVO.getSearchField2())); oParameters.add(new DBObject(4, 2, -10)); oParameters.add(new DBObject(5, 2, 12)); oParameters.add(new DBObject(6, 2, 12)); oParameters.add(new DBObject(7, 2, 4)); ArrayList oOutArray = oBean.callProc(oParameters, "HRMAPRSLSTRULE.proc_WrkGrpLOV(?,?,?,?,?,?,?)"); DBObject oOutObject = oOutArray.get(0); ArrayList oList = (ArrayList)oOutObject.getObject(); QueryRow oRow = null; Iterator iter = oList.iterator(); while (iter.hasNext()) { if (count == 0) oList = new ArrayList(); count++; oRow = iter.next(); LOVBean oLOVBean = new LOVBean(); oLOVBean.setDetailField1(oRow.get("ID").getString()); oLOVBean.setDetailField2(oRow.get("CODE").getString()); oLOVBean.setDetailField3(oRow.get("NAME").getString()); oList.add(oLOVBean); } oLovVO.setDetailList(oList); return oLovVO; } public LovVO getQueryWrkGrpLOVData(LovQueryVO oLovQueryVO) throws EnrgiseApplicationException, EnrgiseSystemException { LovVO oLovVO = new LovVO(); ArrayList arylstHeaderList = new ArrayList(); arylstHeaderList.add("Code ID"); arylstHeaderList.add("hrm.HrmWorkGroup.code"); arylstHeaderList.add("hrm.HrmWorkGroup.name"); oLovVO.setHeaderList(arylstHeaderList); ArrayList arylstVisibility = new ArrayList(); arylstVisibility.add("H"); arylstVisibility.add("V"); arylstVisibility.add("V"); oLovVO.setVisibilityList(arylstVisibility); String sID = null; if (EnrgiseUtil.checkString(oLovQueryVO.getProperty("SelOpt"))) sID = oLovQueryVO.getProperty("SelOpt"); int count = 0; ArrayList oParameters = new ArrayList(); DBUtilitiesBean oBean = new DBUtilitiesBean(); oParameters = new ArrayList(); oParameters.add(new DBObject(1, 1, 12, sID)); oParameters.add(new DBObject(2, 1, 12, oLovQueryVO.getSearchField1())); oParameters.add(new DBObject(3, 1, 12, oLovQueryVO.getSearchField2())); oParameters.add(new DBObject(4, 2, -10)); oParameters.add(new DBObject(5, 2, 12)); oParameters.add(new DBObject(6, 2, 12)); oParameters.add(new DBObject(7, 2, 4)); ArrayList oOutArray = oBean.callProc(oParameters, "HRMAPRSLSTRULE.proc_QueryWrkGrpLOV(?,?,?,?,?,?,?)"); DBObject oOutObject = oOutArray.get(0); ArrayList oList = (ArrayList)oOutObject.getObject(); QueryRow oRow = null; Iterator iter = oList.iterator(); while (iter.hasNext()) { if (count == 0) oList = new ArrayList(); count++; oRow = iter.next(); LOVBean oLOVBean = new LOVBean(); oLOVBean.setDetailField1(oRow.get("ID").getString()); oLOVBean.setDetailField2(oRow.get("CODE").getString()); oLOVBean.setDetailField3(oRow.get("NAME").getString()); oList.add(oLOVBean); } oLovVO.setDetailList(oList); return oLovVO; } public LovVO getQuerySiteCodeLOVData(LovQueryVO oLovQueryVO) throws EnrgiseApplicationException, EnrgiseSystemException { LovVO oLovVO = new LovVO(); ArrayList arylstHeaderNames = new ArrayList(); ArrayList arylstHeaderList = new ArrayList(); arylstHeaderList.add("Code ID"); arylstHeaderList.add("hrm.HrmWorkGroup.code"); arylstHeaderList.add("hrm.HrmWorkGroup.name"); oLovVO.setHeaderList(arylstHeaderList); ArrayList arylstVisibility = new ArrayList(); arylstVisibility.add("H"); arylstVisibility.add("V"); arylstVisibility.add("V"); oLovVO.setVisibilityList(arylstVisibility); int count = 0; ArrayList oParameters = new ArrayList(); DBUtilitiesBean oBean = new DBUtilitiesBean(); oParameters = new ArrayList(); oParameters.add(new DBObject(1, 1, 12, oLovQueryVO.getSearchField1())); oParameters.add(new DBObject(2, 1, 12, oLovQueryVO.getSearchField2())); oParameters.add(new DBObject(3, 2, -10)); oParameters.add(new DBObject(4, 2, 12)); oParameters.add(new DBObject(5, 2, 12)); oParameters.add(new DBObject(6, 2, 4)); ArrayList oOutArray = oBean.callProc(oParameters, "HRMAPRSLSTRULE.proc_QuerySiteIDLOV(?,?,?,?,?,?)"); DBObject oOutObject = oOutArray.get(0); ArrayList oList = (ArrayList)oOutObject.getObject(); QueryRow oRow = null; Iterator iter = oList.iterator(); while (iter.hasNext()) { if (count == 0) oList = new ArrayList(); count++; oRow = iter.next(); LOVBean oLOVBean = new LOVBean(); oLOVBean.setDetailField1(oRow.get("ID").getString()); oLOVBean.setDetailField2(oRow.get("CODE").getString()); oLOVBean.setDetailField3(oRow.get("NAME").getString()); oList.add(oLOVBean); } oLovVO.setDetailList(oList); return oLovVO; } public void additionalFieldValidationImpl(BaseHeaderBean oBaseHeaderBean, Timestamp oWhenPicked, String sScreenName, String sScreenMode, boolean bHeaderDataChanged, ArrayList arylstDetailBeanArray, boolean bDetailDataChanged, Timestamp oDetailPicked) throws EnrgiseApplicationException, EnrgiseSystemException { ArrayList oList = new ArrayList(); checkMandatoryHdr((HrmAprslStartRuleHdrBean)oBaseHeaderBean, oList); reportError(oList); } public void additionalTimestampValidationImpl(BaseHeaderBean param1, Timestamp param2, String param3, String param4, boolean param5, ArrayList param6, boolean param7, Timestamp param8) {} public void additionalBusinessValidationImpl(BaseHeaderBean oBaseHeaderBean, Timestamp oWhenPicked, String sScreenName, String sScreenMode, boolean bHeaderDataChanged, ArrayList oDetailBeanArray, boolean bDetailDataChanged, Timestamp oDetailPicked) throws EnrgiseApplicationException, EnrgiseSystemException {} private void checkMandatoryHdr(HrmAprslStartRuleHdrBean oHrmAprslStartRuleHdrBean, ArrayList oErrorList) throws EnrgiseSystemException, EnrgiseApplicationException { if (!EnrgiseUtil.checkString(oHrmAprslStartRuleHdrBean.getTxtAprslStOrdNo())) { MessageKey oMessageKey = new MessageKey("hrm.ApprslSpcTemp.stOrderNo"); ArrayList oParams = new ArrayList(); oParams.add(oMessageKey); oErrorList.add(new EnrgiseMessageKeyException("wenrgise.common.header.mandatoryFieldMissing", oParams, "E")); } if (EnrgiseUtil.checkString(oHrmAprslStartRuleHdrBean.getTxtEmpNum())) if (EnrgiseUtil.checkString(oHrmAprslStartRuleHdrBean.getTxtWrkGrpCode()) || EnrgiseUtil.checkString(oHrmAprslStartRuleHdrBean.getTxtSiteCode()) || EnrgiseUtil.checkString(oHrmAprslStartRuleHdrBean.getTxtClsHdr()) || EnrgiseUtil.checkString(oHrmAprslStartRuleHdrBean.getTxtClsDtl())) { MessageKey eMessageKey = new MessageKey("hrm.HrmAprslStartRule.employeeNo"); MessageKey wMessageKey = new MessageKey("hrm.HrmAprslStartRule.workGroupCode"); MessageKey sMessageKey = new MessageKey("hrm.HrmAprslStartRule.siteCode"); MessageKey chMessageKey = new MessageKey("hrm.HrmAprslStartRule.classHeaderCode"); MessageKey cdMessageKey = new MessageKey("hrm.HrmAprslStartRule.classDetailCode"); ArrayList oParams = new ArrayList(); oParams.add(eMessageKey); oParams.add(wMessageKey); oParams.add(sMessageKey); oParams.add(chMessageKey); oParams.add(cdMessageKey); oErrorList.add(new EnrgiseMessageKeyException("hrm.aprsl.rule.header.mandatoryFieldMissing", oParams, "E")); } if (EnrgiseUtil.checkString(oHrmAprslStartRuleHdrBean.getTxtWrkGrpCode())) if (!EnrgiseUtil.checkString(oHrmAprslStartRuleHdrBean.getTxtSiteCode())) { MessageKey oMessageKey = new MessageKey("hrm.HrmAprslStartRule.siteCode"); ArrayList oParams = new ArrayList(); oParams.add(oMessageKey); oErrorList.add(new EnrgiseMessageKeyException("hrm.StRule.SiteCode.mandatoryFieldMissing", oParams, "E")); } if (!EnrgiseUtil.checkString(oHrmAprslStartRuleHdrBean.getTxtEmpNum()) && !EnrgiseUtil.checkString(oHrmAprslStartRuleHdrBean.getTxtWrkGrpCode()) && !EnrgiseUtil.checkString(oHrmAprslStartRuleHdrBean.getTxtSiteCode()) && !EnrgiseUtil.checkString(oHrmAprslStartRuleHdrBean.getTxtClsHdr()) && !EnrgiseUtil.checkString(oHrmAprslStartRuleHdrBean.getTxtClsDtl())) { MessageKey eMessageKey = new MessageKey("hrm.HrmAprslStartRule.employeeNo"); MessageKey wMessageKey = new MessageKey("hrm.HrmAprslStartRule.workGroupCode"); MessageKey sMessageKey = new MessageKey("hrm.HrmAprslStartRule.siteCode"); MessageKey chMessageKey = new MessageKey("hrm.HrmAprslStartRule.classHeaderCode"); MessageKey cdMessageKey = new MessageKey("hrm.HrmAprslStartRule.classDetailCode"); ArrayList oParams = new ArrayList(); oParams.add(eMessageKey); oParams.add(wMessageKey); oParams.add(sMessageKey); oParams.add(chMessageKey); oParams.add(cdMessageKey); oErrorList.add(new EnrgiseMessageKeyException("hrm.aprsl.StRule.all.header.mandatoryFieldMissing", oParams, "E")); } } }