Package ek.rms.rtcAssignment

Examples of ek.rms.rtcAssignment.ShiftDetailsType


   * @throws ParseException
   */
  private EntDbStaffShift insertShift(String idJobTask, BigDecimal urno,
      StaffDetailsType _inputStaffDetail, Date msgSendDate, String recStatus) throws ParseException {
   
    ShiftDetailsType _inputShiftDetailsType = _inputStaffDetail.getShiftDetails();
    if(_inputShiftDetailsType == null){
      LOG.debug("No Shift Detail in input Staff <{}>.", _inputStaffDetail.getID());
      return null;
    }
   
    //INSERT SHIFT DETAIL
    EntDbStaffShift dbStaffShift = new EntDbStaffShift();

    if(_inputShiftDetailsType.getFunction()!= null)
      dbStaffShift.setShiftFunctionDate(convertDateToUTC(_inputShiftDetailsType.getFunction()));
    if(_inputShiftDetailsType.getRemarks() != null)
      dbStaffShift.setShiftRemarks(_inputShiftDetailsType.getRemarks());
   
    String mutCode = null;
    //if (isNullOrEmptyStr(_inputShiftDetailsType.getMutationCode())) {// check in MD table
    if (_inputShiftDetailsType.getMutationCode() != null) {// check in MD table
      for (EntDbMdRmsMutateCode mutateCode : clsEntStartUpInitSingleton.getMdRmsMutateCodeList()) {
        if (_inputShiftDetailsType.getMutationCode().equalsIgnoreCase(mutateCode.getMutationId())) {
          if(mutateCode.getStaffTypeCode().equalsIgnoreCase(HpEKConstants.RMS_STAFF_TYPE_ROP))
            mutCode = _inputStaffDetail.getShiftDetails().getMutationCode(); break;
        }
      }
      if(mutCode == null)
        LOG.debug("Mutation Code <{}> is not found in MdRmsMutateCode table.", _inputShiftDetailsType.getMutationCode());
      dbStaffShift.setMutateCode(_inputShiftDetailsType.getMutationCode());
    }

    if(_inputStaffDetail.getID() != null)//Conditional case
      dbStaffShift.setStaffNumber(_inputStaffDetail.getID());
    if(_inputStaffDetail.getName() != null)
      dbStaffShift.setStaffName(_inputStaffDetail.getName());
    if(_inputStaffDetail.getMobile() != null)
      dbStaffShift.setStaffMobileNo(_inputStaffDetail.getMobile());
    if(_inputStaffDetail.getWalkie() != null)
      dbStaffShift.setStaffWalkieNo(_inputStaffDetail.getWalkie());
    if(_inputStaffDetail.getHDD() != null)
      dbStaffShift.setStaffHhdNo(_inputStaffDetail.getHDD());
    if(_inputStaffDetail.getQualification() != null)
      dbStaffShift.setStaffQualification(_inputStaffDetail.getQualification());
    if(_inputShiftDetailsType.getSchStartTime() != null)
      dbStaffShift.setShiftScheStartDate(convertDateToUTC(_inputShiftDetailsType.getSchStartTime()));
    if(_inputShiftDetailsType.getSchEndTime() != null)
      dbStaffShift.setShiftScheEndDate(convertDateToUTC(_inputShiftDetailsType.getSchEndTime()));
    if(_inputShiftDetailsType.getEstStartTime() != null)
      dbStaffShift.setShiftEstStartDate(convertDateToUTC(_inputShiftDetailsType.getEstStartTime()));
    if(_inputShiftDetailsType.getEstEndTime() != null)
      dbStaffShift.setShiftEstEndDate(convertDateToUTC(_inputShiftDetailsType.getEstEndTime()));
    if(_inputShiftDetailsType.getActStartTime() != null)
      dbStaffShift.setShiftActualStartDate(convertDateToUTC(_inputShiftDetailsType.getActStartTime()));
    if(_inputShiftDetailsType.getActEndTime() != null)
      dbStaffShift.setShiftActualEndDate(convertDateToUTC(_inputShiftDetailsType.getActEndTime()));
   
    dbStaffShift.setMsgSendDate(msgSendDate);
    dbStaffShift.setIdFltJobTask(idJobTask);
    dbStaffShift.setIdFlight(urno);
    dbStaffShift.setDataSource(HpEKConstants.RMS_RTC_SOURCE);
View Full Code Here


      //merge JOB_ASSIGN to db
      EntDbFltJobAssign resultJobAssign = clsDlFltJobAssignLocal.merge(jobAssign);
      if(resultJobAssign != null)
        LOG.debug("Assigned job has been updated for Staff <{}>", resultJobAssign.getStaffNumber());
     
      ShiftDetailsType _inputShiftDetailsType = _inputStaffDetail.getShiftDetails();
     
      /** UPDATE shift **/
      if(isNullOrEmptyStr(jobAssign.getIdStaffShift())){
        LOG.debug("No input shift to update for staff <{}>", jobAssign.getStaffNumber());
      }else{
        EntDbStaffShift dbStaffShift = clsDlStaffShiftLocal.findById(jobAssign.getIdStaffShift());
        if(dbStaffShift != null){//is existing..
          dbStaffShift.setUpdatedDate(HpUfisCalendar.getCurrentUTCTime());
          dbStaffShift.setUpdatedUser(HpEKConstants.RMS_RTC_SOURCE);
        }
        else{
          dbStaffShift = new EntDbStaffShift();
          dbStaffShift.setCreatedDate(HpUfisCalendar.getCurrentUTCTime());
          dbStaffShift.setCreatedUser(HpEKConstants.RMS_RTC_SOURCE);
        }
       
        dbStaffShift.setMsgSendDate(msgSendDate);
        dbStaffShift.setRecStatus(rec_status);
        dbStaffShift.setStaffType(HpEKConstants.RMS_STAFF_TYPE_ROP);
       
        if(_inputStaffDetail.getID() != null)//Conditional case
          dbStaffShift.setStaffNumber(_inputStaffDetail.getID());
        if(_inputStaffDetail.getName() != null)
          dbStaffShift.setStaffName(_inputStaffDetail.getName());
        if(_inputStaffDetail.getMobile() != null)
          dbStaffShift.setStaffMobileNo(_inputStaffDetail.getMobile());
        if(_inputStaffDetail.getWalkie() != null)
          dbStaffShift.setStaffWalkieNo(_inputStaffDetail.getWalkie());
        if(_inputStaffDetail.getHDD() != null)
          dbStaffShift.setStaffHhdNo(_inputStaffDetail.getHDD());
        if(_inputStaffDetail.getQualification() != null)
          dbStaffShift.setStaffQualification(_inputStaffDetail.getQualification());
        // ShiftDetails
        if(_inputShiftDetailsType != null){
          if(_inputShiftDetailsType.getFunction()!= null)
            dbStaffShift.setShiftFunctionDate(convertDateToUTC(_inputShiftDetailsType.getFunction()));
          if(_inputShiftDetailsType.getRemarks() != null)
            dbStaffShift.setShiftRemarks(_inputShiftDetailsType.getRemarks());
         
          String mutCode = null;
          //if (isNullOrEmptyStr(_inputShiftDetailsType.getMutationCode())) {// check in MD table
          if (_inputShiftDetailsType.getMutationCode() != null) {// check in MD table
            for (EntDbMdRmsMutateCode mutateCode : clsEntStartUpInitSingleton.getMdRmsMutateCodeList()) {
              if (_inputShiftDetailsType.getMutationCode().equalsIgnoreCase(mutateCode.getMutationId())) {
                mutCode = _inputStaffDetail.getShiftDetails().getMutationCode(); break;
              }
            }
            if(mutCode == null)
              LOG.debug("Mutation Code <{}> is not found in MdRmsMutateCode table.", _inputShiftDetailsType.getMutationCode());
            dbStaffShift.setMutateCode(_inputShiftDetailsType.getMutationCode());
          }
         
          if(_inputShiftDetailsType.getSchStartTime() != null)
            dbStaffShift.setShiftScheStartDate(convertDateToUTC(_inputShiftDetailsType.getSchStartTime()));
          if(_inputShiftDetailsType.getSchEndTime() != null)
            dbStaffShift.setShiftScheEndDate(convertDateToUTC(_inputShiftDetailsType.getSchEndTime()));
          if(_inputShiftDetailsType.getEstStartTime() != null)
            dbStaffShift.setShiftEstStartDate(convertDateToUTC(_inputShiftDetailsType.getEstStartTime()));
          if(_inputShiftDetailsType.getEstEndTime() != null)
            dbStaffShift.setShiftEstEndDate(convertDateToUTC(_inputShiftDetailsType.getEstEndTime()));
          if(_inputShiftDetailsType.getActStartTime() != null)
            dbStaffShift.setShiftActualStartDate(convertDateToUTC(_inputShiftDetailsType.getActStartTime()));
          if(_inputShiftDetailsType.getActEndTime() != null)
            dbStaffShift.setShiftActualEndDate(convertDateToUTC(_inputShiftDetailsType.getActEndTime()));
        }
        EntDbStaffShift resultShift = clsDlStaffShiftLocal.merge(dbStaffShift);
        if(resultShift != null)
          LOG.debug("Assigned shift has been updated for Staff <{}>.", resultShift.getStaffNumber());
     
View Full Code Here

TOP

Related Classes of ek.rms.rtcAssignment.ShiftDetailsType

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.