public void processRecord(Object record) throws Exception {
   CreateSelectiveServiceRecordImpl ssRecord = (CreateSelectiveServiceRecordImpl) record;
   ssRecord.appendDebug(
       "Started Processing Record with Applicant ID = " + ssRecord.getApplicant().getId());
   Applicant applicant = null;
   try {
     applicant =
         applicantDao.findByIdBasicInfoForCreateSelectiveService(ssRecord.getApplicant().getId());
   } catch (DataAccessException e) {
     String msg = "DB Error: Failure to retrieve  applicant with id: " + applicant.getId();
     throw getBaseExceptionType(msg, e, logger, LOG_DEBUG);
   }
   if (applicant != null) {
     ssRecord.setApplicant(applicant);
     ssRecord.setAuditValues();
   } else {
     return;
   }
   try {
     OtherInfo otherInfo = applicant.getOtherInfo();
     applicantDao.updateSelectiveServiceStatus(
         otherInfo, DLRConstants.SELECTIVE_SERVICE_STATUS_SENT_TO_USSS);
     applicantDao.updateSelectiveServiceSentFlag(otherInfo, new Boolean(true));
     ssRecord.appendDebug("After Update Selective Service Status & SentFlag");
   } catch (DataAccessException e) {
     String msg =
         "DB Error: Failure to update Selective Service Status "
             + "for applicant with id "
             + applicant.getId();
     throw getBaseExceptionType(msg, e, logger, LOG_DEBUG);
   }
 }
Exemplo n.º 2
0
  protected void processSuspension(
      HashMap<String, Object> processorHashmap, String suspensionPeriod, Conviction[] allOffenses)
      throws ParseException, Exception {
    if (suspensionPeriod != null) {
      System.out.println("suspensionPeriod: " + suspensionPeriod);

      // Create the EA
      Enforcement newEA =
          createEa("9000", DLRConstants.ENF_STATUS_PROBATED, processorHashmap, allOffenses);
      vaDao.saveEventAudit(
          newEA.getApplicant().getId(),
          "Enforcement",
          (String) ListDataLoader.ALLENFORCEMENTACTIONCODES.get(newEA.getEnfActionCode())
              + " Submitted");
      if (logger.isDebug()) {
        logger.debug(
            "added new enforcement: id = "
                + newEA.getId()
                + " : app.id = "
                + newEA.getApplicant().getId());
      }
      processorHashmap.put("eaId", newEA.getId()); // for uniqueness of
      // letter generated.
      // generate suspension letter
      generatePDFLetter(processorHashmap);
      Applicant app = (Applicant) processorHashmap.get("applicant");

      vaDao.updateApplicantStatus(app.getId(), LiConstants.RecordStatus.NOT_ELIGIBLE);
      vaDao.updateIssuanceStatus(
          newEA.getApplicant().getId(),
          LiConstants.IssuanceStatus.SUSPENDED,
          DLRConstants.CARDTYPE_DRIVER_LICENSE);
      // vaDao.saveEventAudit(newEA.getApplicant().getId(),
      // "Enforcement Action", "Insert EA(6940) ");
    } else {

      // Create the EA
      Enforcement newEA =
          createEa(
              "9001", DLRConstants.ENF_STATUS_EVAL_FURTHER_ACTION, processorHashmap, allOffenses);
      vaDao.saveEventAudit(
          newEA.getApplicant().getId(),
          "Enforcement",
          (String) ListDataLoader.ALLENFORCEMENTACTIONCODES.get(newEA.getEnfActionCode())
              + " Submitted");
      System.out.println(newEA.getId());
      Applicant app = (Applicant) processorHashmap.get("applicant");

      if (logger.isDebug()) {
        logger.debug("added new enforcement: id = " + newEA.getId() + " : app.id = " + app.getId());
      }

      AdminStatus as = new AdminStatus();
      as.setAppliedDate(new Timestamp(new Date().getTime()));
      as.setStatus(DLRConstants.ADMIN_STATUS_FEE_OWED);
      as.setApplicant(app);
      as.setEnfActionId(newEA.getId());
      AdminStatusFee adminStatusFee = new AdminStatusFee();
      adminStatusFee.setStatus(as.getStatus());
      adminStatusFee.setAsfsAdminFee(new BigDecimal("500.00"));
      adminStatusFee.setAdminStatus(as);
      Set adminStatusFees = new HashSet();
      adminStatusFees.add(adminStatusFee);
      as.setAdminStatusFees(adminStatusFees);
      try {
        appDao.saveOrUpdateObject(as);
      } catch (DataAccessException e) {
        throw getBaseExceptionType(
            "Failure to update applicant (SSN : " + app.getSsn() + " ) - " + e.getMessage(),
            e,
            logger,
            LOG_DEBUG);
      }
      vaDao.saveEventAudit(app.getId(), "Admin Status", " Fee Owed Submitted");

      vaDao.updateIssuanceStatus(
          app.getId(), LiConstants.IssuanceStatus.SUSPENDED, app.getOccupationalDL().getCardType());

      processorHashmap.put("eaId", newEA.getId()); // for uniqueness of
      // letter generated.
      // processing for applicant
      // generate suspension letter, add admin status and update issuance
      // status
      generatePDFLetter(processorHashmap);
    }
  }