first commit
This commit is contained in:
585
hrmsEjb/wenrgise/hrms/ejb/business/HrmOrgWorkGroupMstBO.java
Normal file
585
hrmsEjb/wenrgise/hrms/ejb/business/HrmOrgWorkGroupMstBO.java
Normal file
@@ -0,0 +1,585 @@
|
||||
package wenrgise.hrms.ejb.business;
|
||||
|
||||
import java.sql.Timestamp;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
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.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.utility.DBUtilitiesBean;
|
||||
import wenrgise.hrms.bean.HrmOrgWorkGroupMstHdrBean;
|
||||
import wenrgise.hrms.vo.HrmOrgWorkGroupMstQVO;
|
||||
|
||||
public class HrmOrgWorkGroupMstBO extends HrmBaseBO {
|
||||
public HrmOrgWorkGroupMstBO() {}
|
||||
|
||||
public HrmOrgWorkGroupMstBO(UserInfo oUserInfo) {
|
||||
super(oUserInfo);
|
||||
}
|
||||
|
||||
public RecordMetaInfo getHrmOrgWorkGroupMstHeaderMetaInfo(HrmOrgWorkGroupMstQVO oHrmOrgWorkGroupMstQVO) throws EnrgiseApplicationException, EnrgiseSystemException {
|
||||
ArrayList arylstParameters = new ArrayList();
|
||||
DBUtilitiesBean oBean = new DBUtilitiesBean();
|
||||
Timestamp oWhenPicked = null;
|
||||
int count = 0;
|
||||
BaseHeaderVO oBaseHeaderVO = new BaseHeaderVO();
|
||||
arylstParameters = new ArrayList();
|
||||
arylstParameters.add(new DBObject(1, 1, 12, oHrmOrgWorkGroupMstQVO.getHeaderPrimaryKey()));
|
||||
arylstParameters.add(new DBObject(2, 1, 12, oHrmOrgWorkGroupMstQVO.getCode()));
|
||||
arylstParameters.add(new DBObject(3, 2, -5));
|
||||
arylstParameters.add(new DBObject(4, 2, 93));
|
||||
arylstParameters.add(new DBObject(5, 2, 12));
|
||||
arylstParameters.add(new DBObject(6, 2, 12));
|
||||
arylstParameters.add(new DBObject(7, 2, 4));
|
||||
ArrayList arylstOutArray = oBean.callProc(arylstParameters, "HRMORGWORKGROUPMST.proc_HrWorkGroupHdrCount(?,?,?,?,?,?,?)");
|
||||
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 getHrmOrgWorkGroupMstHeader(HrmOrgWorkGroupMstQVO oHrmOrgWorkGroupMstQVO, long lStartPosition, long lLastPosition) throws EnrgiseApplicationException, EnrgiseSystemException {
|
||||
ArrayList arylstParameters = new ArrayList();
|
||||
DBUtilitiesBean oBean = new DBUtilitiesBean();
|
||||
Timestamp oWhenPicked = null;
|
||||
int count = 0;
|
||||
BaseHeaderVO oBaseHeaderVO = new BaseHeaderVO();
|
||||
ArrayList arylstHeaderList = null;
|
||||
if (oHrmOrgWorkGroupMstQVO == null)
|
||||
oHrmOrgWorkGroupMstQVO = new HrmOrgWorkGroupMstQVO();
|
||||
arylstParameters = new ArrayList();
|
||||
arylstParameters.add(new DBObject(1, 1, -5, new Long(lStartPosition)));
|
||||
arylstParameters.add(new DBObject(2, 1, -5, new Long(lLastPosition)));
|
||||
arylstParameters.add(new DBObject(3, 1, 12, oHrmOrgWorkGroupMstQVO.getHeaderPrimaryKey()));
|
||||
arylstParameters.add(new DBObject(4, 1, 12, oHrmOrgWorkGroupMstQVO.getCode()));
|
||||
arylstParameters.add(new DBObject(5, 2, -10));
|
||||
arylstParameters.add(new DBObject(6, 2, 12));
|
||||
arylstParameters.add(new DBObject(7, 2, 12));
|
||||
arylstParameters.add(new DBObject(8, 2, 4));
|
||||
ArrayList arylstOutArray = oBean.callProc(arylstParameters, "HRMORGWORKGROUPMST.proc_GetHrWorkGroupMstHdr(?,?,?,?,?,?,?,?)");
|
||||
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 itrBean = arylstList.iterator();
|
||||
while (itrBean.hasNext()) {
|
||||
if (count == 0)
|
||||
arylstHeaderList = new ArrayList();
|
||||
count++;
|
||||
oRow = itrBean.next();
|
||||
HrmOrgWorkGroupMstHdrBean oHrmOrgWorkGroupMstHdr = new HrmOrgWorkGroupMstHdrBean();
|
||||
oHrmOrgWorkGroupMstHdr.setHeaderPrimaryKey(oRow.get("ID").getString());
|
||||
oHrmOrgWorkGroupMstHdr.setBudgetCode(oRow.get("BUDGET_CODE").getString());
|
||||
oHrmOrgWorkGroupMstHdr.setBudgetId(oRow.get("PROFIT_CENTRE_ID").getString());
|
||||
oHrmOrgWorkGroupMstHdr.setWorkGroupCodeId(oRow.get("ID").getString());
|
||||
oHrmOrgWorkGroupMstHdr.setCode(oRow.get("CODE").getString());
|
||||
oHrmOrgWorkGroupMstHdr.setContactAddress(oRow.get("CONTACT_ADDR").getString());
|
||||
oHrmOrgWorkGroupMstHdr.setContactEmployeeNo(oRow.get("CONTACT_PERSON_NAME").getString());
|
||||
oHrmOrgWorkGroupMstHdr.setContactEmployeeId(oRow.get("CONTACT_PERSON_ID").getString());
|
||||
oHrmOrgWorkGroupMstHdr.setCostId(oRow.get("COST_ID").getString());
|
||||
oHrmOrgWorkGroupMstHdr.setCostCentre(oRow.get("COST_DESC").getString());
|
||||
oHrmOrgWorkGroupMstHdr.setCreationDate(EnrgiseUtil.convertToString(oRow.get("CREATION_DATE").getDate()));
|
||||
oHrmOrgWorkGroupMstHdr.setDeptFlag(oRow.get("DEPT_WG_FLAG").getString());
|
||||
oHrmOrgWorkGroupMstHdr.setDocumentDate(EnrgiseUtil.convertToString(oRow.get("DOCUMENT_DATE").getDate()));
|
||||
oHrmOrgWorkGroupMstHdr.setEMail(oRow.get("EMAIL").getString());
|
||||
oHrmOrgWorkGroupMstHdr.setEndDate(EnrgiseUtil.convertToString(oRow.get("END_DATE").getDate()));
|
||||
oHrmOrgWorkGroupMstHdr.setFax(oRow.get("FAX").getString());
|
||||
oHrmOrgWorkGroupMstHdr.setHierarchyLevel(oRow.get("HEIRARCHY_LEVEL").getString());
|
||||
oHrmOrgWorkGroupMstHdr.setName(oRow.get("NAME").getString());
|
||||
oHrmOrgWorkGroupMstHdr.setSiteId(oRow.get("SITE_ID").getString());
|
||||
oHrmOrgWorkGroupMstHdr.setOwingSite(oRow.get("SITENAME").getString());
|
||||
oHrmOrgWorkGroupMstHdr.setParentGroupCode(oRow.get("PARENTWRKGRPNAME").getString());
|
||||
oHrmOrgWorkGroupMstHdr.setParentGroupCodeId(oRow.get("PARENT_WRKGRP_ID").getString());
|
||||
oHrmOrgWorkGroupMstHdr.setPhone(oRow.get("PHONE").getString());
|
||||
oHrmOrgWorkGroupMstHdr.setRefDocNo(oRow.get("DOCUMENT_REF_NO").getString());
|
||||
oHrmOrgWorkGroupMstHdr.setSpecialRemarks(oRow.get("SPECIAL_REMARKS").getString());
|
||||
oHrmOrgWorkGroupMstHdr.setTemporaryFlag(oRow.get("TEMPORARY_FLAG").getString());
|
||||
arylstHeaderList.add(oHrmOrgWorkGroupMstHdr);
|
||||
}
|
||||
return arylstHeaderList;
|
||||
}
|
||||
|
||||
public void initializeBOImpl() {
|
||||
this.headerTable = "GEN_WRKGRP_MST";
|
||||
}
|
||||
|
||||
public String saveHeaderImpl(BaseHeaderBean oBaseHeaderBean, String ScreenMode) throws EnrgiseSystemException {
|
||||
String returnString = null;
|
||||
ArrayList arylstParameters = new ArrayList();
|
||||
DBUtilitiesBean oBean = new DBUtilitiesBean();
|
||||
DateUtility d = new DateUtility();
|
||||
HrmOrgWorkGroupMstHdrBean oHrmOrgWorkGroupMstHdrBean = (HrmOrgWorkGroupMstHdrBean)oBaseHeaderBean;
|
||||
if (ScreenMode.equalsIgnoreCase("N")) {
|
||||
arylstParameters = new ArrayList();
|
||||
arylstParameters.add(new DBObject(1, 1, 12, "i"));
|
||||
arylstParameters.add(new DBObject(2, 1, 12, oHrmOrgWorkGroupMstHdrBean.getCode()));
|
||||
arylstParameters.add(new DBObject(3, 1, 12, oHrmOrgWorkGroupMstHdrBean.getName()));
|
||||
arylstParameters.add(new DBObject(4, 1, 12, oHrmOrgWorkGroupMstHdrBean.getDeptFlag()));
|
||||
arylstParameters.add(new DBObject(5, 1, 12, oHrmOrgWorkGroupMstHdrBean.getContactEmployeeId()));
|
||||
arylstParameters.add(new DBObject(6, 1, 12, oHrmOrgWorkGroupMstHdrBean.getContactAddress()));
|
||||
arylstParameters.add(new DBObject(7, 1, 12, oHrmOrgWorkGroupMstHdrBean.getFax()));
|
||||
arylstParameters.add(new DBObject(8, 1, 12, oHrmOrgWorkGroupMstHdrBean.getPhone()));
|
||||
arylstParameters.add(new DBObject(9, 1, 12, oHrmOrgWorkGroupMstHdrBean.getEMail()));
|
||||
arylstParameters.add(new DBObject(10, 1, 12, oHrmOrgWorkGroupMstHdrBean.getHierarchyLevel()));
|
||||
arylstParameters.add(new DBObject(11, 1, 12, oHrmOrgWorkGroupMstHdrBean.getTemporaryFlag()));
|
||||
arylstParameters.add(new DBObject(12, 1, 12, oHrmOrgWorkGroupMstHdrBean.getRefDocNo()));
|
||||
arylstParameters.add(new DBObject(13, 1, 93, EnrgiseUtil.convertToSqlDate(oHrmOrgWorkGroupMstHdrBean.getDocumentDate())));
|
||||
arylstParameters.add(new DBObject(14, 1, 93, EnrgiseUtil.convertToSqlDate(oHrmOrgWorkGroupMstHdrBean.getCreationDate())));
|
||||
arylstParameters.add(new DBObject(15, 1, 93, EnrgiseUtil.convertToSqlDate(oHrmOrgWorkGroupMstHdrBean.getEndDate())));
|
||||
arylstParameters.add(new DBObject(16, 1, 12, oHrmOrgWorkGroupMstHdrBean.getSpecialRemarks()));
|
||||
arylstParameters.add(new DBObject(17, 1, 12, oHrmOrgWorkGroupMstHdrBean.getProfitCentreId()));
|
||||
arylstParameters.add(new DBObject(18, 1, 12, oHrmOrgWorkGroupMstHdrBean.getCostId()));
|
||||
arylstParameters.add(new DBObject(19, 1, 12, oHrmOrgWorkGroupMstHdrBean.getSiteId()));
|
||||
arylstParameters.add(new DBObject(20, 1, 12, oHrmOrgWorkGroupMstHdrBean.getParentGroupCodeId()));
|
||||
arylstParameters.add(new DBObject(21, 1, 12, this.oUserInfo.getUserTypeId()));
|
||||
arylstParameters.add(new DBObject(22, 1, 12, this.oUserInfo.getSiteId()));
|
||||
arylstParameters.add(new DBObject(23, 1, 12, null));
|
||||
arylstParameters.add(new DBObject(24, 2, 12));
|
||||
arylstParameters.add(new DBObject(25, 2, 12));
|
||||
arylstParameters.add(new DBObject(26, 2, 12));
|
||||
arylstParameters.add(new DBObject(27, 2, 4));
|
||||
ArrayList arylstOutArray = oBean.callProc(arylstParameters, "HRMORGWORKGROUPMST.proc_UpsertHrWorkGroupMst(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
|
||||
DBObject oOutObject = arylstOutArray.get(0);
|
||||
returnString = (String)oOutObject.getObject();
|
||||
System.out.println(returnString);
|
||||
} else if (ScreenMode.equalsIgnoreCase("U")) {
|
||||
arylstParameters = new ArrayList();
|
||||
arylstParameters.add(new DBObject(1, 1, 12, "u"));
|
||||
arylstParameters.add(new DBObject(2, 1, 12, oHrmOrgWorkGroupMstHdrBean.getCode()));
|
||||
arylstParameters.add(new DBObject(3, 1, 12, oHrmOrgWorkGroupMstHdrBean.getName()));
|
||||
arylstParameters.add(new DBObject(4, 1, 12, oHrmOrgWorkGroupMstHdrBean.getDeptFlag()));
|
||||
arylstParameters.add(new DBObject(5, 1, 12, oHrmOrgWorkGroupMstHdrBean.getContactEmployeeId()));
|
||||
arylstParameters.add(new DBObject(6, 1, 12, oHrmOrgWorkGroupMstHdrBean.getContactAddress()));
|
||||
arylstParameters.add(new DBObject(7, 1, 12, oHrmOrgWorkGroupMstHdrBean.getFax()));
|
||||
arylstParameters.add(new DBObject(8, 1, 12, oHrmOrgWorkGroupMstHdrBean.getPhone()));
|
||||
arylstParameters.add(new DBObject(9, 1, 12, oHrmOrgWorkGroupMstHdrBean.getEMail()));
|
||||
arylstParameters.add(new DBObject(10, 1, 12, oHrmOrgWorkGroupMstHdrBean.getHierarchyLevel()));
|
||||
arylstParameters.add(new DBObject(11, 1, 12, oHrmOrgWorkGroupMstHdrBean.getTemporaryFlag()));
|
||||
arylstParameters.add(new DBObject(12, 1, 12, oHrmOrgWorkGroupMstHdrBean.getRefDocNo()));
|
||||
arylstParameters.add(new DBObject(13, 1, 93, EnrgiseUtil.convertToSqlDate(oHrmOrgWorkGroupMstHdrBean.getDocumentDate())));
|
||||
arylstParameters.add(new DBObject(14, 1, 93, EnrgiseUtil.convertToSqlDate(oHrmOrgWorkGroupMstHdrBean.getCreationDate())));
|
||||
arylstParameters.add(new DBObject(15, 1, 93, EnrgiseUtil.convertToSqlDate(oHrmOrgWorkGroupMstHdrBean.getEndDate())));
|
||||
arylstParameters.add(new DBObject(16, 1, 12, oHrmOrgWorkGroupMstHdrBean.getSpecialRemarks()));
|
||||
arylstParameters.add(new DBObject(17, 1, 12, oHrmOrgWorkGroupMstHdrBean.getProfitCentreId()));
|
||||
arylstParameters.add(new DBObject(18, 1, 12, oHrmOrgWorkGroupMstHdrBean.getCostId()));
|
||||
arylstParameters.add(new DBObject(19, 1, 12, oHrmOrgWorkGroupMstHdrBean.getSiteId()));
|
||||
arylstParameters.add(new DBObject(20, 1, 12, oHrmOrgWorkGroupMstHdrBean.getParentGroupCodeId()));
|
||||
arylstParameters.add(new DBObject(21, 1, 12, this.oUserInfo.getUserTypeId()));
|
||||
arylstParameters.add(new DBObject(22, 1, 12, this.oUserInfo.getSiteId()));
|
||||
arylstParameters.add(new DBObject(23, 1, 12, oHrmOrgWorkGroupMstHdrBean.getHeaderPrimaryKey()));
|
||||
arylstParameters.add(new DBObject(24, 2, 12));
|
||||
arylstParameters.add(new DBObject(25, 2, 12));
|
||||
arylstParameters.add(new DBObject(26, 2, 12));
|
||||
arylstParameters.add(new DBObject(27, 2, 4));
|
||||
ArrayList arylstOutArray = oBean.callProc(arylstParameters, "HRMORGWORKGROUPMST.proc_UpsertHrWorkGroupMst(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
|
||||
DBObject oOutObject = arylstOutArray.get(0);
|
||||
returnString = (String)oOutObject.getObject();
|
||||
}
|
||||
return returnString;
|
||||
}
|
||||
|
||||
public void saveDetailImpl(String sHeaderPrimaryKey, String sScreenName, ArrayList arylstDetailBeanArray) throws EnrgiseSystemException {
|
||||
System.out.println("Save Ille!");
|
||||
}
|
||||
|
||||
public LovVO getHrmWorkGroupCodeLOVdata(LovQueryVO oLovQueryVO) throws 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);
|
||||
int count = 0;
|
||||
ArrayList arylstParameters = new ArrayList();
|
||||
DBUtilitiesBean oBean = new DBUtilitiesBean();
|
||||
String sQuerySearch1 = new String();
|
||||
String sQuerySearch2 = new String();
|
||||
if (oLovQueryVO.getSearchField1() != null)
|
||||
sQuerySearch1 = oLovQueryVO.getSearchField1();
|
||||
if (oLovQueryVO.getSearchField2() != null)
|
||||
sQuerySearch2 = oLovQueryVO.getSearchField2();
|
||||
arylstParameters = new ArrayList();
|
||||
arylstParameters.add(new DBObject(1, 1, 12, sQuerySearch1));
|
||||
arylstParameters.add(new DBObject(2, 1, 12, sQuerySearch2));
|
||||
arylstParameters.add(new DBObject(3, 2, -10));
|
||||
arylstParameters.add(new DBObject(4, 2, 12));
|
||||
arylstParameters.add(new DBObject(5, 2, 12));
|
||||
arylstParameters.add(new DBObject(6, 2, 4));
|
||||
ArrayList arylstOutArray = oBean.callProc(arylstParameters, "HRMORGSETUPLOV.proc_GetWorkGroupCodeLOV(?,?,?,?,?,?)");
|
||||
DBObject oOutObject = arylstOutArray.get(0);
|
||||
ArrayList arylstList = (ArrayList)oOutObject.getObject();
|
||||
QueryRow oRow = null;
|
||||
Iterator iter = arylstList.iterator();
|
||||
while (iter.hasNext()) {
|
||||
if (count == 0)
|
||||
arylstList = 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());
|
||||
arylstList.add(oLOVBean);
|
||||
}
|
||||
oLovVO.setDetailList(arylstList);
|
||||
return oLovVO;
|
||||
}
|
||||
|
||||
public LovVO getHrmSiteCodeLOVdata(LovQueryVO oLovQueryVO) throws 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);
|
||||
int count = 0;
|
||||
ArrayList arylstParameters = new ArrayList();
|
||||
DBUtilitiesBean oBean = new DBUtilitiesBean();
|
||||
String sQuerySearch1 = new String();
|
||||
String sQuerySearch2 = new String();
|
||||
if (oLovQueryVO.getSearchField1() != null)
|
||||
sQuerySearch1 = oLovQueryVO.getSearchField1();
|
||||
if (oLovQueryVO.getSearchField2() != null)
|
||||
sQuerySearch2 = oLovQueryVO.getSearchField2();
|
||||
arylstParameters = new ArrayList();
|
||||
arylstParameters.add(new DBObject(1, 1, 12, sQuerySearch1));
|
||||
arylstParameters.add(new DBObject(2, 1, 12, sQuerySearch2));
|
||||
arylstParameters.add(new DBObject(3, 2, -10));
|
||||
arylstParameters.add(new DBObject(4, 2, 12));
|
||||
arylstParameters.add(new DBObject(5, 2, 12));
|
||||
arylstParameters.add(new DBObject(6, 2, 4));
|
||||
ArrayList arylstOutArray = oBean.callProc(arylstParameters, "HRMORGSETUPLOV.proc_GetSiteCodeLOV(?,?,?,?,?,?)");
|
||||
DBObject oOutObject = arylstOutArray.get(0);
|
||||
ArrayList arylstList = (ArrayList)oOutObject.getObject();
|
||||
QueryRow oRow = null;
|
||||
Iterator iter = arylstList.iterator();
|
||||
while (iter.hasNext()) {
|
||||
if (count == 0)
|
||||
arylstList = 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());
|
||||
arylstList.add(oLOVBean);
|
||||
}
|
||||
oLovVO.setDetailList(arylstList);
|
||||
return oLovVO;
|
||||
}
|
||||
|
||||
public LovVO getHrmCostCodeLOVdata(LovQueryVO oLovQueryVO) throws 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);
|
||||
int count = 0;
|
||||
ArrayList arylstParameters = new ArrayList();
|
||||
DBUtilitiesBean oBean = new DBUtilitiesBean();
|
||||
String sQuerySearch1 = new String();
|
||||
String sQuerySearch2 = new String();
|
||||
if (oLovQueryVO.getSearchField1() != null)
|
||||
sQuerySearch1 = oLovQueryVO.getSearchField1();
|
||||
if (oLovQueryVO.getSearchField2() != null)
|
||||
sQuerySearch2 = oLovQueryVO.getSearchField2();
|
||||
arylstParameters = new ArrayList();
|
||||
arylstParameters.add(new DBObject(1, 1, 12, sQuerySearch1));
|
||||
arylstParameters.add(new DBObject(2, 1, 12, sQuerySearch2));
|
||||
arylstParameters.add(new DBObject(3, 2, -10));
|
||||
arylstParameters.add(new DBObject(4, 2, 12));
|
||||
arylstParameters.add(new DBObject(5, 2, 12));
|
||||
arylstParameters.add(new DBObject(6, 2, 4));
|
||||
ArrayList arylstOutArray = oBean.callProc(arylstParameters, "HRMORGSETUPLOV.proc_GetCostCodeLOV(?,?,?,?,?,?)");
|
||||
DBObject oOutObject = arylstOutArray.get(0);
|
||||
ArrayList arylstList = (ArrayList)oOutObject.getObject();
|
||||
QueryRow oRow = null;
|
||||
Iterator iter = arylstList.iterator();
|
||||
while (iter.hasNext()) {
|
||||
if (count == 0)
|
||||
arylstList = 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());
|
||||
arylstList.add(oLOVBean);
|
||||
}
|
||||
oLovVO.setDetailList(arylstList);
|
||||
return oLovVO;
|
||||
}
|
||||
|
||||
public LovVO getHrmBudgetCodeLOVdata(LovQueryVO oLovQueryVO) throws 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);
|
||||
int count = 0;
|
||||
ArrayList arylstParameters = new ArrayList();
|
||||
DBUtilitiesBean oBean = new DBUtilitiesBean();
|
||||
String sQuerySearch1 = new String();
|
||||
String sQuerySearch2 = new String();
|
||||
if (oLovQueryVO.getSearchField1() != null)
|
||||
sQuerySearch1 = oLovQueryVO.getSearchField1();
|
||||
if (oLovQueryVO.getSearchField2() != null)
|
||||
sQuerySearch2 = oLovQueryVO.getSearchField2();
|
||||
arylstParameters = new ArrayList();
|
||||
arylstParameters.add(new DBObject(1, 1, 12, sQuerySearch1));
|
||||
arylstParameters.add(new DBObject(2, 1, 12, sQuerySearch2));
|
||||
arylstParameters.add(new DBObject(3, 2, -10));
|
||||
arylstParameters.add(new DBObject(4, 2, 12));
|
||||
arylstParameters.add(new DBObject(5, 2, 12));
|
||||
arylstParameters.add(new DBObject(6, 2, 4));
|
||||
ArrayList arylstOutArray = oBean.callProc(arylstParameters, "HRMORGSETUPLOV.proc_GetBudgetCodeLOV(?,?,?,?,?,?)");
|
||||
DBObject oOutObject = arylstOutArray.get(0);
|
||||
ArrayList arylstList = (ArrayList)oOutObject.getObject();
|
||||
QueryRow oRow = null;
|
||||
Iterator iter = arylstList.iterator();
|
||||
while (iter.hasNext()) {
|
||||
if (count == 0)
|
||||
arylstList = 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());
|
||||
arylstList.add(oLOVBean);
|
||||
}
|
||||
oLovVO.setDetailList(arylstList);
|
||||
return oLovVO;
|
||||
}
|
||||
|
||||
public LovVO getHrmWorkParentCodeLOVdata(LovQueryVO oLovQueryVO) throws EnrgiseSystemException {
|
||||
LovVO oLovVO = new LovVO();
|
||||
ArrayList arylstHeaderList = new ArrayList();
|
||||
arylstHeaderList.add("Code ID");
|
||||
arylstHeaderList.add("hrm.HrmWorkGroup.code");
|
||||
arylstHeaderList.add("hrm.HrmWorkGroup.name");
|
||||
arylstHeaderList.add("hrm.HrmWorkGroup.hierarchyLevel");
|
||||
oLovVO.setHeaderList(arylstHeaderList);
|
||||
ArrayList arylstVisibility = new ArrayList();
|
||||
arylstVisibility.add("H");
|
||||
arylstVisibility.add("V");
|
||||
arylstVisibility.add("V");
|
||||
arylstVisibility.add("V");
|
||||
oLovVO.setVisibilityList(arylstVisibility);
|
||||
int count = 0;
|
||||
ArrayList arylstParameters = new ArrayList();
|
||||
DBUtilitiesBean oBean = new DBUtilitiesBean();
|
||||
String sQuerySearch1 = new String();
|
||||
String sQuerySearch2 = new String();
|
||||
if (oLovQueryVO.getProperty("hierarchyLevel") != null)
|
||||
sQuerySearch1 = oLovQueryVO.getProperty("hierarchyLevel");
|
||||
if (oLovQueryVO.getSearchField1() != null)
|
||||
sQuerySearch2 = oLovQueryVO.getSearchField2();
|
||||
arylstParameters = new ArrayList();
|
||||
arylstParameters.add(new DBObject(1, 1, 12, sQuerySearch1));
|
||||
arylstParameters.add(new DBObject(2, 1, 12, sQuerySearch2));
|
||||
arylstParameters.add(new DBObject(3, 2, -10));
|
||||
arylstParameters.add(new DBObject(4, 2, 12));
|
||||
arylstParameters.add(new DBObject(5, 2, 12));
|
||||
arylstParameters.add(new DBObject(6, 2, 4));
|
||||
ArrayList arylstOutArray = oBean.callProc(arylstParameters, "HRMORGSETUPLOV.proc_GetWorkParentCodeLOV(?,?,?,?,?,?)");
|
||||
DBObject oOutObject = arylstOutArray.get(0);
|
||||
ArrayList arylstList = (ArrayList)oOutObject.getObject();
|
||||
QueryRow oRow = null;
|
||||
Iterator iter = arylstList.iterator();
|
||||
while (iter.hasNext()) {
|
||||
if (count == 0)
|
||||
arylstList = 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());
|
||||
oLOVBean.setDetailField4(oRow.get("HEIRARCHY_LEVEL").getString());
|
||||
arylstList.add(oLOVBean);
|
||||
}
|
||||
oLovVO.setDetailList(arylstList);
|
||||
return oLovVO;
|
||||
}
|
||||
|
||||
public LovVO getHrmWorkEmpNameLOVdata(LovQueryVO oLovQueryVO) throws 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);
|
||||
int count = 0;
|
||||
ArrayList arylstParameters = new ArrayList();
|
||||
DBUtilitiesBean oBean = new DBUtilitiesBean();
|
||||
String sQuerySearch1 = new String();
|
||||
String sQuerySearch2 = new String();
|
||||
if (oLovQueryVO.getSearchField1() != null)
|
||||
sQuerySearch1 = oLovQueryVO.getSearchField1();
|
||||
if (oLovQueryVO.getSearchField2() != null)
|
||||
sQuerySearch2 = oLovQueryVO.getSearchField2();
|
||||
arylstParameters = new ArrayList();
|
||||
arylstParameters.add(new DBObject(1, 1, 12, sQuerySearch1));
|
||||
arylstParameters.add(new DBObject(2, 1, 12, sQuerySearch2));
|
||||
arylstParameters.add(new DBObject(3, 2, -10));
|
||||
arylstParameters.add(new DBObject(4, 2, 12));
|
||||
arylstParameters.add(new DBObject(5, 2, 12));
|
||||
arylstParameters.add(new DBObject(6, 2, 4));
|
||||
ArrayList arylstOutArray = oBean.callProc(arylstParameters, "HRMORGSETUPLOV.proc_GetWorkEmpCodeLOV(?,?,?,?,?,?)");
|
||||
DBObject oOutObject = arylstOutArray.get(0);
|
||||
ArrayList arylstList = (ArrayList)oOutObject.getObject();
|
||||
QueryRow oRow = null;
|
||||
Iterator iter = arylstList.iterator();
|
||||
while (iter.hasNext()) {
|
||||
if (count == 0)
|
||||
arylstList = 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());
|
||||
arylstList.add(oLOVBean);
|
||||
}
|
||||
oLovVO.setDetailList(arylstList);
|
||||
return oLovVO;
|
||||
}
|
||||
|
||||
public void updateHeaderImpl(BaseHeaderBean oBaseHeaderBean) throws EnrgiseSystemException {}
|
||||
|
||||
public String saveNewHeaderImpl(BaseHeaderBean oBaseHeaderBean) throws EnrgiseSystemException {
|
||||
return new String();
|
||||
}
|
||||
|
||||
public void additionalTimestampValidationImpl(BaseHeaderBean param1, Timestamp param2, String param3, String param4, boolean param5, ArrayList param6, boolean param7, Timestamp param8) {}
|
||||
|
||||
public void additionalFieldValidationImpl(BaseHeaderBean oBaseHeaderBean, Timestamp oWhenPicked, String sScreenName, String sScreenMode, boolean bHeaderDataChanged, ArrayList arylstDetailBeanArray, boolean bDetailDataChanged, Timestamp oDetailPicked) throws EnrgiseApplicationException, EnrgiseSystemException {
|
||||
ArrayList arylstErrorList = new ArrayList();
|
||||
if (bHeaderDataChanged)
|
||||
if (!sScreenMode.equalsIgnoreCase("D"))
|
||||
checkMandatoryHeader((HrmOrgWorkGroupMstHdrBean)oBaseHeaderBean);
|
||||
reportError(arylstErrorList);
|
||||
}
|
||||
|
||||
private void checkMandatoryHeader(HrmOrgWorkGroupMstHdrBean oHrmOrgWorkGroupMstHdrBean) throws EnrgiseSystemException, EnrgiseApplicationException {
|
||||
ArrayList oErrorList = new ArrayList();
|
||||
ArrayList oParams = new ArrayList();
|
||||
if (!EnrgiseUtil.checkString(oHrmOrgWorkGroupMstHdrBean.getCode())) {
|
||||
MessageKey oMessageKey = new MessageKey("hrm.HrmWorkGroup.code");
|
||||
oParams = new ArrayList();
|
||||
oParams.add(oMessageKey);
|
||||
oErrorList.add(new EnrgiseMessageKeyException("wenrgise.common.header.mandatoryFieldMissing", oParams, "E"));
|
||||
}
|
||||
if (!EnrgiseUtil.checkString(oHrmOrgWorkGroupMstHdrBean.getName())) {
|
||||
MessageKey oMessageKey = new MessageKey("hrm.HrmWorkGroup.name");
|
||||
oParams = new ArrayList();
|
||||
oParams.add(oMessageKey);
|
||||
oErrorList.add(new EnrgiseMessageKeyException("wenrgise.common.header.mandatoryFieldMissing", oParams, "E"));
|
||||
}
|
||||
if (!EnrgiseUtil.checkString(oHrmOrgWorkGroupMstHdrBean.getDeptFlag())) {
|
||||
MessageKey oMessageKey = new MessageKey("hrm.HrmWorkGroup.deptFlag");
|
||||
oParams = new ArrayList();
|
||||
oParams.add(oMessageKey);
|
||||
oErrorList.add(new EnrgiseMessageKeyException("wenrgise.common.header.mandatoryFieldMissing", oParams, "E"));
|
||||
}
|
||||
if (!EnrgiseUtil.checkString(oHrmOrgWorkGroupMstHdrBean.getTemporaryFlag())) {
|
||||
MessageKey oMessageKey = new MessageKey("hrm.HrmWorkGroup.temporaryFlag");
|
||||
oParams = new ArrayList();
|
||||
oParams.add(oMessageKey);
|
||||
oErrorList.add(new EnrgiseMessageKeyException("wenrgise.common.header.mandatoryFieldMissing", oParams, "E"));
|
||||
}
|
||||
reportError(oErrorList);
|
||||
}
|
||||
|
||||
public void additionalBusinessValidationImpl(BaseHeaderBean oBaseHeaderBean, Timestamp oWhenPicked, String sScreenName, String sScreenMode, boolean bHeaderDataChanged, ArrayList arylstDetailBeanArray, boolean bDetailDataChanged, Timestamp oDetailPicked) throws EnrgiseApplicationException, EnrgiseSystemException {
|
||||
ArrayList arylstErrorList = new ArrayList();
|
||||
HrmOrgWorkGroupMstHdrBean oHrmOrgWorkGroupMstHdrBean = (HrmOrgWorkGroupMstHdrBean)oBaseHeaderBean;
|
||||
if (bHeaderDataChanged)
|
||||
if (!sScreenMode.equalsIgnoreCase("D")) {
|
||||
checkUniqueHeader((HrmOrgWorkGroupMstHdrBean)oBaseHeaderBean);
|
||||
checkDatesConstraint((HrmOrgWorkGroupMstHdrBean)oBaseHeaderBean, arylstErrorList);
|
||||
}
|
||||
reportError(arylstErrorList);
|
||||
}
|
||||
|
||||
private void checkUniqueHeader(HrmOrgWorkGroupMstHdrBean oHrmOrgWorkGroupMstHdrBean) throws EnrgiseApplicationException, EnrgiseSystemException {
|
||||
ArrayList arylstList1 = new ArrayList();
|
||||
ArrayList arylstParam = new ArrayList();
|
||||
String sQuery = String.valueOf(String.valueOf(" Select ID as ID from GEN_WRKGRP_MST where CODE='").concat(String.valueOf(oHrmOrgWorkGroupMstHdrBean.getCode()))).concat(String.valueOf("'"));
|
||||
System.out.println(sQuery);
|
||||
DBUtilitiesBean oBean = new DBUtilitiesBean();
|
||||
ArrayList arylstList = oBean.executeQuery(sQuery);
|
||||
Iterator itrBean = arylstList.iterator();
|
||||
if (itrBean.hasNext()) {
|
||||
QueryRow oRow = itrBean.next();
|
||||
if (!oRow.get("ID").getString().equalsIgnoreCase(oHrmOrgWorkGroupMstHdrBean.getHeaderPrimaryKey())) {
|
||||
arylstParam = new ArrayList();
|
||||
arylstParam.add("");
|
||||
arylstParam.add(new Integer(0));
|
||||
arylstList1.add(new EnrgiseMessageKeyException("wenrgise.common.uniqueConstraintViolated", arylstParam));
|
||||
}
|
||||
}
|
||||
reportError(arylstList1);
|
||||
}
|
||||
|
||||
private void checkDatesConstraint(HrmOrgWorkGroupMstHdrBean oHrmOrgWorkGroupMstHdrBean, ArrayList arylstErrorList) throws EnrgiseApplicationException, EnrgiseSystemException {
|
||||
DateFormat dateFormat = new SimpleDateFormat("dd-MMM-yyyy");
|
||||
if (EnrgiseUtil.checkString(oHrmOrgWorkGroupMstHdrBean.getEndDate())) {
|
||||
int dateFlag = EnrgiseUtil.compareDates(dateFormat, oHrmOrgWorkGroupMstHdrBean.getEndDate(), oHrmOrgWorkGroupMstHdrBean.getCreationDate());
|
||||
if (dateFlag == -1 && dateFlag != -2)
|
||||
arylstErrorList.add(new EnrgiseApplicationException("wenrgise.workGroup.dateConstraintViolated"));
|
||||
}
|
||||
if (EnrgiseUtil.checkString(oHrmOrgWorkGroupMstHdrBean.getCreationDate())) {
|
||||
int dateFlag1 = EnrgiseUtil.compareDates(dateFormat, EnrgiseUtil.convertToString(EnrgiseUtil.getSysDate()), oHrmOrgWorkGroupMstHdrBean.getCreationDate());
|
||||
if (dateFlag1 == -1 && dateFlag1 != -2)
|
||||
arylstErrorList.add(new EnrgiseApplicationException("wenrgise.workGroup.dateConstraintViolated1"));
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user