Package com.ufis_as.ek_if.rms.entities

Examples of com.ufis_as.ek_if.rms.entities.EntDbFltJobTask


    BigDecimal urno = getFlightFromInputFlightId(_input.getFlightId());
    if(urno == null){//flight not found
      LOG.debug("Message dropped..");
      return;
    }
    EntDbFltJobTask entJobTask = null;
    String rec_status = " ";
   
    switch (subType) {
    case "INS":
      if ("FREE".equalsIgnoreCase(taskInfoStatus))
        rec_status = "X";
      else
        rec_status = " ";
      entJobTask = processFltJobTask(_input, urno, false, rec_status);
      if (entJobTask != null)
        // pass _input to include Audit, Equipment
        insertAllJobAndShift(_input, entJobTask.getId(), urno,
            rec_status);
      break;
    case "UPD":
      // 2013-11-22 updated by JGO - when auto and manual mark status as free
      //if ("FREE".equalsIgnoreCase(taskInfoStatus))
      if ("FREE".equalsIgnoreCase(taskInfoStatus)
          || "AUTO".equalsIgnoreCase(taskInfoStatus)
          || "MANUAL".equalsIgnoreCase(taskInfoStatus))
        rec_status = "X";
      else
        rec_status = " ";

      entJobTask = processFltJobTask(_input, urno, true, rec_status);
      if (entJobTask != null) {
        processFltJobAndShift(_input, urno, entJobTask.getId(),
            rec_status);
      }
      break;
    case "DEL":
      rec_status = "X";
      entJobTask = processFltJobTask(_input, urno, true, rec_status);
      if (entJobTask != null) {
        processFltJobAndShift(_input, urno, entJobTask.getId(),
            rec_status);
      }
      break;
    }
  }
View Full Code Here


   * @param input data RTCAssignmentType
   */
  @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
  private EntDbFltJobTask processFltJobTask(RTCAssignmentType _input, BigDecimal idFlight,
      boolean isUpdate, String recStatus)throws ParseException {
    EntDbFltJobTask inputJobTask = null;
    TaskInfoType taskInfo = _input.getTaskDetails().getTaskInfo();
    TaskTimesType taskTimes = _input.getTaskDetails().getTaskTimes();
   
    /**
     * .. check for Master Data ..
     */
    String type = null;
    for(EntDbMdRmsOrderType orderType : clsEntStartUpInitSingleton.getMdRmsOrderTypeList()){
      if(orderType.getOrderType().equalsIgnoreCase(taskInfo.getType())){
        if(orderType.getStaffTypeCode().equalsIgnoreCase(HpEKConstants.RMS_STAFF_TYPE_SPHL))
          type = taskInfo.getType(); break;
      }
    }
    if(type == null)
      LOG.debug("Order type <{}> is not found in MdRmsOrderType table.", taskInfo.getType());
   
    String workArea = null;
    for(EntDbMdRmsWorkArea wArea : clsEntStartUpInitSingleton.getMdRmsWorkAreasList()){
      if(wArea.getWorkArea().trim().equalsIgnoreCase(taskInfo.getWorkArea())){
        if(wArea.getStaffTypeCode().equalsIgnoreCase(HpEKConstants.RMS_STAFF_TYPE_SPHL))
          workArea = taskInfo.getWorkArea(); break;
      }
    }
    if(workArea == null)
      LOG.debug("Work Area <{}> is not found in MdRmsWorkArea table.", taskInfo.getWorkArea());
   
    String startLoc = null, stau = null;
    for(EntDbMdRmsWorkLoc loc : clsEntStartUpInitSingleton.getMdRmsWorkLocsList()){
      if(loc.getWorkLocationId().equalsIgnoreCase(taskInfo.getStartLoc())){
        if(loc.getStaffTypeCode().equalsIgnoreCase(HpEKConstants.RMS_STAFF_TYPE_SPHL))
          startLoc = taskInfo.getStartLoc();
      }
      if(loc.getWorkLocationId().equalsIgnoreCase(taskInfo.getEndLoc())){
        if(loc.getStaffTypeCode().equalsIgnoreCase(HpEKConstants.RMS_STAFF_TYPE_SPHL))
          stau = taskInfo.getStartLoc();
      }
    }
    if(startLoc == null)
      LOG.debug("Work start location <{}> is not found in MdRmsWorkLoc table.", taskInfo.getStartLoc());
    if(stau == null)
      LOG.debug("Work end location <{}> is not found in MdRmsWorkLoc table.", taskInfo.getEndLoc());
   
    String status = null;
    for(EntDbMdRmsTaskStatus taskStatus : clsEntStartUpInitSingleton.getMdRmsTaskStatusList()){
      if(taskStatus.getTaskStatusId().equalsIgnoreCase(taskInfo.getStatus())){
        if(taskStatus.getStaffTypeCode().equalsIgnoreCase(HpEKConstants.RMS_STAFF_TYPE_SPHL))
          status = taskInfo.getStatus(); break;
      }
    }
    if(status == null)
      LOG.debug("Task Status Id <{}> is not found in MdRmsTaskStatus table.", taskInfo.getStatus());
   
    /**
     * UPDATE/INSERT Flight Job Task
     */
    BigDecimal taskId = new BigDecimal(taskInfo.getSubTaskID());
    if (isUpdate) {
      // find the existing record
      inputJobTask = clsDlFltJobTaskLocal.findExistingFltJobTask(
          idFlight, taskId, HpEKConstants.RMS_STAFF_TYPE_SPHL);
      if (inputJobTask != null) {
        inputJobTask.setUpdatedDate(HpUfisCalendar.getCurrentUTCTime());
        inputJobTask.setUpdatedUser(HpEKConstants.RMS_RTC_SOURCE);
      }else{
        //flt Task is null to UPDATE
        LOG.debug("Input job task is not existing to Update. Message dropped.");
        return null;
      }
    } else {
      inputJobTask = new EntDbFltJobTask();
      inputJobTask.setCreatedDate(HpUfisCalendar.getCurrentUTCTime());
      inputJobTask.setCreatedUser(HpEKConstants.RMS_RTC_SOURCE);
    }
    inputJobTask.setRecStatus(recStatus);
    inputJobTask.setIdFlight(idFlight);
    inputJobTask.setStaffType(HpEKConstants.RMS_STAFF_TYPE_SPHL);
    inputJobTask.setDataSource(HpEKConstants.RMS_RTC_SOURCE);
   
    /** TaskInfo **/
    inputJobTask.setTaskId(taskId);
    inputJobTask.setTaskType(taskInfo.getType());
    inputJobTask.setTaskTypeDesc(taskInfo.getTypeDesc());
    inputJobTask.setTaskWorkArea(taskInfo.getWorkArea());
    inputJobTask.setTaskStartLoc(taskInfo.getStartLoc());
    inputJobTask.setTaskEndLoc(taskInfo.getEndLoc());
    inputJobTask.setTaskRemark(taskInfo.getRemarks());
    inputJobTask.setTaskStatus(taskInfo.getStatus());
    inputJobTask.setTaskStatusChngTime(convertDateToUTC(taskInfo.getStatusTimestamp()));
    inputJobTask.setTaskCreatedDate(convertDateToUTC(taskInfo.getCreationTime()));
   
    /** TaskTimes **/
    Date planStartDate = convertDateToUTC(taskTimes.getPlnStartTime());
    Date planEndDate = convertDateToUTC(taskTimes.getPlnEndTime());
   
    inputJobTask.setTaskPlanStartDate(planStartDate);
    inputJobTask.setTaskPlanEndDate(planEndDate);
    //calculate plan minute (duration = endTime - startTime)
    inputJobTask.setTaskPlanDuration(new BigDecimal((planEndDate.getTime() - planStartDate.getTime())/1000));

    if(taskTimes.getActStartTime() != null)//Conditional case
      inputJobTask.setTaskActualStartDate(convertDateToUTC(taskTimes.getActStartTime()));
   
    if(taskTimes.getActEndTime() != null)
      inputJobTask.setTaskActualEndDate(convertDateToUTC(taskTimes.getActEndTime()));
   
    Date taskActualStartDate = inputJobTask.getTaskActualStartDate();
    Date taskActualEndDate = inputJobTask.getTaskActualEndDate();
    if(taskActualEndDate != null && taskActualStartDate != null)
      inputJobTask.setTaskActualDuration(new BigDecimal((taskActualEndDate.getTime() - taskActualStartDate.getTime())/1000));
    else
      LOG.debug("One of Task Actual Start or End date is empty/null. Duration will be empty.");
   
    EntDbFltJobTask resultFltJobTask = clsDlFltJobTaskLocal.merge(inputJobTask);
    if(resultFltJobTask != null)
      LOG.debug("Input Flt Job Task has been inserted/updated.");
   
    return resultFltJobTask;
  }
View Full Code Here

TOP

Related Classes of com.ufis_as.ek_if.rms.entities.EntDbFltJobTask

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.