public void removePlateSearch(Number activityId) { XxntcCsCalendarActivitiesEOVOImpl activitesVo = getXxntcCsCalendarActivitiesEOVO1(); Key key = new Key(new Object[] {activityId}); Row rows[] = activitesVo.getRowSetIterator().findByKey(key, 1); if (rows.length > 0) { Row row = rows[0]; row.setAttribute("TagStatus", row.getAttribute("AssignFlag")); } /*activitesVo.removeApplyViewCriteriaName("SearchPlateCriteria"); activitesVo.executeQuery();*/ }
public Map<String, String> updateTask(String taskStatus) { Map<String, String> resultMap = new HashMap<String, String>(); String status = "E"; String message = null; XxntcCsCalendarActivitiesEOVOImpl vo = getXxntcCsCalendarActivitiesEOVO2Update(); Row row = vo.getCurrentRow(); Date startTime = (Date) row.getAttribute("StartTime"); Date endTime = (Date) row.getAttribute("EndTime"); Number incidentId = (Number) row.getAttribute("IncidentId"); Number resourceId = (Number) row.getAttribute("ResourceId"); _logger.warning("Before Calling API"); _logger.warning("taskStatus:" + taskStatus.toString()); _logger.warning("startTime:" + startTime.toString()); _logger.warning("endTime:" + endTime.toString()); _logger.warning("incidentId:" + incidentId.toString()); _logger.warning("resourceId:" + resourceId.toString()); CallableStatement cs = null; String statement = "BEGIN XXNTC_CALENDAR_PKG.SCHEDULE_SR_PRC(?, ?, ?, ?, ?, ?, ?); END;"; try { cs = getDBTransaction().createCallableStatement(statement, 0); cs.registerOutParameter(6, Types.VARCHAR); cs.registerOutParameter(7, Types.VARCHAR); cs.setString(1, taskStatus); cs.setDate(2, startTime.dateValue()); cs.setDate(3, endTime.dateValue()); cs.setInt(4, incidentId.intValue()); cs.setLong(5, resourceId.longValue()); cs.executeUpdate(); status = cs.getString(6); message = cs.getString(7); } catch (SQLException e) { _logger.severe("Sql Exception during statement call", e); } finally { try { if (cs != null) cs.close(); } catch (SQLException e) { _logger.severe("Sql Exception While Closing Callable Statement", e); } } resultMap.put("x_status", status); resultMap.put("x_error_message", message); _logger.warning("After API is called"); _logger.warning("x_status:" + status); _logger.warning("x_error_message:" + message); return resultMap; }
public Row findActivityBySrNumber(String incidentNumber) { XxntcCsCalendarActivitiesEOVOImpl searchVo = getXxntcCsCalendarActivitiesEOVOSearch(); searchVo.setApplyViewCriteriaName("GetSrNumberCriteria"); VariableValueManager vvm = searchVo.ensureVariableManager(); vvm.setVariableValue("pIncidentNumber", incidentNumber); vvm.setVariableValue("pResourceId", getResourceId()); searchVo.executeQuery(); if (searchVo.getRowCount() == 0) return null; return searchVo.first(); }
private Row getFirstDateForPlate(String plate) { Map<String, Object> resultMap = new HashMap<String, Object>(); XxntcCsCalendarActivitiesEOVOImpl searchVo = getXxntcCsCalendarActivitiesEOVOSearch(); searchVo.setApplyViewCriteriaName("GetDateCriteria"); VariableValueManager vvm = searchVo.ensureVariableManager(); vvm.setVariableValue("pTitle", plate); vvm.setVariableValue("pResourceId", getResourceId()); searchVo.executeQuery(); if (searchVo.getRowCount() == 0) return null; RowSetIterator iterator = searchVo.createRowSetIterator(null); iterator.reset(); List<Row> rows = new ArrayList<Row>(); while (iterator.hasNext()) { Row row = iterator.next(); rows.add(row); } iterator.closeRowSetIterator(); return getMaxStartTimeActRow(rows); }