LOG.warn("Input Gate type is not in MD_GATE_TYPE table.");
addExptInfo(EnumExceptionCodes.WNOMD.name(), _input.getCrewStatusInfo().getGateDetails().getGateType());
}*/
statusChangeDtm = df.parse(convertFlDateToUTC(_input.getCrewStatusInfo().getStatusChageDTM()));
EntDbCrewImmigration entCrew = null, oldEntCrew = new EntDbCrewImmigration();
//find out existing crew immigration record
entCrew = clsDlCrewImmigration.getExistingCrewImmigration(flNum, flDate, String.valueOf(_input.getFlightID().getDepNum()),
String.valueOf(_input.getFlightID().getLegNum()), _input.getCrewDetails().getStaffNo(), _input.getCrewStatusInfo().getGateDetails().getGateType());
if(entCrew == null){
entCrew = new EntDbCrewImmigration();
entCrew.setCreatedUser(HpEKConstants.IAMS_SOURCE);
entCrew.setCreatedDate(HpUfisCalendar.getCurrentUTCTime());
//entCrew.setCreatedDate(statusChangeDtm);
entCrew.setDepNum(String.valueOf(_input.getFlightID().getDepNum()));
entCrew.setLegNum(String.valueOf(_input.getFlightID().getLegNum()));
entCrew.setStaffNumber(_input.getCrewDetails().getStaffNo());
entCrew.setGateType(_input.getCrewStatusInfo().getGateDetails().getGateType());
entCrew.setIdMdGateType(idGateType);
entCrew.setFlightNumber(flNum);
}
else{
oldEntCrew = new EntDbCrewImmigration(entCrew); //deep copy
cmd = UfisASCommands.URT.name();
entCrew.setUpdatedUser(HpEKConstants.IAMS_SOURCE);
entCrew.setUpdatedDate(HpUfisCalendar.getCurrentUTCTime());
}
entCrew.setIdFltJobAssign(idFltJobAssign);
if(_input.getTmStmp() != null)
entCrew.setMsgSendDate(df.parse(convertFlDateToUTC(_input.getTmStmp())));
entCrew.setStatusChangeDate(statusChangeDtm);
entCrew.setCrewTypeCode(_input.getCrewDetails().getCrewType());
entCrew.setCrewActivityStat(_input.getCrewStatusInfo().getStatus());
entCrew.setCrewActivityFlag(crewActivityFlag);
entCrew.setStatusRemarks(_input.getCrewStatusInfo().getReason());
entCrew.setGateNumber(_input.getCrewStatusInfo().getGateDetails().getGateNo());
entCrew.setGateLocation(_input.getCrewStatusInfo().getGateDetails().getWing());
entCrew.setIdFlight(urno);
entCrew.setFltDate(flDate);
entCrew.setFltOrigin3(_input.getFlightID().getDepStn());
entCrew.setFltDest3(_input.getFlightID().getArrStn());
entCrew.setDataSource(HpEKConstants.IAMS_SOURCE);
entCrew.setRecStatus(" ");
EntDbCrewImmigration resultEntCrew = clsDlCrewImmigration.merge(entCrew);
if(resultEntCrew != null){
sendNotifyUldInfoToInJson(resultEntCrew, oldEntCrew, cmd);
}
} catch (JAXBException e) {
LOG.error("JAXBContext when unmarshalling... {}", e.getMessage());