@Action(value = "/voucher/billVoucher-newform") public String newform() { if (getValidActions("designation").size() == 0) { addActionError(getText("pjv.designation.notmatching")); } else if (null == voucherHeader.getVouchermis().getDepartmentid()) { voucherHeader.getVouchermis().setDepartmentid(voucherService.getCurrentDepartment()); } if (LOGGER.isDebugEnabled()) LOGGER.debug("BillVoucherAction | newform | START"); List<String> listBillReg = billsMgr.getDistExpType(); Map<String, String> expTypeList = new LinkedHashMap<String, String>(); for (String expType : listBillReg) { expTypeList.put(expType, expType); } addDropdownData("expTypeList", listBillReg); return NEW; }
@SuppressWarnings("unchecked") private void loadApproverUser(String atype) { String scriptName = "paymentHeader.nextDesg"; if (paymentheader != null && paymentheader.getPaymentAmount() != null) { if (LOGGER.isInfoEnabled()) LOGGER.info( "paymentheader.getPaymentAmount() >>>>>>>>>>>>>>>>>>> :" + paymentheader.getPaymentAmount()); atype = atype + "|" + paymentheader.getPaymentAmount(); } else { atype = atype + "|"; } EgovMasterDataCaching masterCache = EgovMasterDataCaching.getInstance(); departmentId = voucherService.getCurrentDepartment().getId().intValue(); if (LOGGER.isInfoEnabled()) LOGGER.info("departmentId :" + departmentId); Map<String, Object> map = new HashMap<String, Object>(); if (paymentheader != null && paymentheader.getVoucherheader().getFiscalPeriodId() != null) { map = voucherService.getDesgByDeptAndTypeAndVoucherDate( atype, scriptName, paymentheader.getVoucherheader().getVoucherDate(), paymentheader); } else { map = voucherService.getDesgByDeptAndTypeAndVoucherDate( atype, scriptName, new Date(), paymentheader); } addDropdownData("departmentList", masterCache.get("egi-department")); List<Map<String, Object>> desgList = (List<Map<String, Object>>) map.get("designationList"); String strDesgId = "", dName = ""; boolean bDefaultDeptId = false; List<Map<String, Object>> designationList = new ArrayList<Map<String, Object>>(); Map<String, Object> desgFuncryMap; for (Map<String, Object> desgIdAndName : desgList) { desgFuncryMap = new HashMap<String, Object>(); if (desgIdAndName.get("designationName") != null) { desgFuncryMap.put("designationName", (String) desgIdAndName.get("designationName")); } if (desgIdAndName.get("designationId") != null) { strDesgId = (String) desgIdAndName.get("designationId"); if (strDesgId.indexOf("~") != -1) { strDesgId = strDesgId.substring(0, strDesgId.indexOf('~')); dName = (String) desgIdAndName.get("designationId"); dName = dName.substring(dName.indexOf('~') + 1); bDefaultDeptId = true; } desgFuncryMap.put("designationId", strDesgId); } designationList.add(desgFuncryMap); } map.put("designationList", designationList); addDropdownData("designationList", (List<Designation>) map.get("designationList")); if (bDefaultDeptId && !dName.equals("")) { Department dept = (Department) persistenceService.find("from Department where deptName like '%" + dName + "' "); departmentId = dept.getId().intValue(); } wfitemstate = map.get("wfitemstate") != null ? map.get("wfitemstate").toString() : ""; }