if (irmtabRef > 0) {
msgLogged = Boolean.TRUE;
}
if (resourceAssignmentType != null){
EntDbFltJobAssign edpiodEntDbFltJobAssign = new EntDbFltJobAssign();
EntDbFltJobTask edpiodEntDbFltJobTask = new EntDbFltJobTask();
// EntDbStaffShift edpiodEntDbStaffShift = new EntDbStaffShift();
// SimpleDateFormat RTCdf = new SimpleDateFormat(HpEKConstants.EKRTC_TIME_FORMAT);
// convert local time to UTC
// RTCdf.setTimeZone(HpEKConstants.utcTz);
// check meta
if (resourceAssignmentType.getMeta() == null){
LOG.info("Mandatory field Meta is null, resourceAssignmentType message is rejected");
sendErroNotification(EnumExceptionCodes.EMAND);
return false;
}
// set message time
if (resourceAssignmentType.getMeta().getMessageTime() != null){
edpiodEntDbFltJobAssign.setMsgSendDate(convertXMLGregorianCalendarToDate(resourceAssignmentType.getMeta().getMessageTime()));
}else {
LOG.info("Mandatory field message time is null, resourceAssignmentType message is rejected");
sendErroNotification(EnumExceptionCodes.EMAND);
return false;
}
// check messageID
if (resourceAssignmentType.getMeta().getMessageID() == 0){
LOG.info("Mandatory field messageID time is 0, resourceAssignmentType message is rejected");
sendErroNotification(EnumExceptionCodes.EMAND);
return false;
}
// check message type
if (resourceAssignmentType.getMeta().getMessageType() == null || "".equals(resourceAssignmentType.getMeta().getMessageType())){
LOG.info("Mandatory field message type is null or empty string, ResourceShiftType message is rejected");
sendErroNotification(EnumExceptionCodes.EMAND);
return false;
}else if (!Arrays.asList(messageAssignmentTypeArray).contains(resourceAssignmentType.getMeta().getMessageType())){
LOG.info("Mandatory field message type {} is in possible value, ResourceShiftType message is rejected", resourceAssignmentType.getMeta().getMessageType());
sendErroNotification(EnumExceptionCodes.EENUM);
return false;
}
// check messageSubtype
if (resourceAssignmentType.getMeta().getMessageSubtype() == null || "".equals(resourceAssignmentType.getMeta().getMessageSubtype().trim())){
LOG.info("Mandatory field messageSubtype is null or empty string, resourceAssignmentType message is rejected");
sendErroNotification(EnumExceptionCodes.EMAND);
return false;
}else if (!Arrays.asList(messageAssignmentSubtypeArray).contains(resourceAssignmentType.getMeta().getMessageSubtype().toUpperCase().trim())){
LOG.info("Mandatory field messageSubtype {} is in possible value, resourceAssignmentType message is rejected", resourceAssignmentType.getMeta().getMessageSubtype());
sendErroNotification(EnumExceptionCodes.EENUM);
return false;
}else {
resAssignMsgSubType = resourceAssignmentType.getMeta().getMessageSubtype();
}
// set messageSource
if (resourceAssignmentType.getMeta().getMessageSource() != null && !"".equals(resourceAssignmentType.getMeta().getMessageSource().trim())){
if (Arrays.asList(messageSourceArray).contains(resourceAssignmentType.getMeta().getMessageSource().toUpperCase().trim())){
switch(resourceAssignmentType.getMeta().getMessageSource().toUpperCase().trim()){
case "EKRTC":
edpiodEntDbFltJobAssign.setStaffType("EK");
edpiodEntDbFltJobTask.setStaffType("EK");
break;
case "GXRTC":
edpiodEntDbFltJobAssign.setStaffType("GX");
edpiodEntDbFltJobTask.setStaffType("GX");
break;
case "CSRTC":
edpiodEntDbFltJobAssign.setStaffType("CS");
edpiodEntDbFltJobTask.setStaffType("CS");
break;
}
}else{
LOG.info("Mandatory field messageSource {} is not in possible value, resourceAssignmentType message is rejected", resourceAssignmentType.getMeta().getMessageSource());
sendErroNotification(EnumExceptionCodes.EENUM);
return false;
}
}else {
LOG.info("Mandatory field messageSource is null or empty string, ResourceShiftType message is rejected");
sendErroNotification(EnumExceptionCodes.EMAND);
return false;
}
// set TSK
if (resourceAssignmentType.getTSK() == null ){
LOG.info("Mandatory field messageSource is null or empty string, resourceAssignmentType message is rejected");
sendErroNotification(EnumExceptionCodes.EMAND);
return false;
}
// set AID
if (resourceAssignmentType.getTSK().getAID() != null && !"".equals(resourceAssignmentType.getTSK().getAID().trim())){
edpiodEntDbFltJobTask.setTaskId(new BigDecimal(resourceAssignmentType.getTSK().getAID()));
}else {
LOG.info("Mandatory field AID is null or empty string, resourceAssignmentType message is rejected");
sendErroNotification(EnumExceptionCodes.EMAND);
return false;
}
// set TRG (not mandatory for ORI = 0)
if (resourceAssignmentType.getTSK().getTRG() != null && !"".equals(resourceAssignmentType.getTSK().getTRG().trim())){
edpiodEntDbFltJobTask.setTaskRuleGrp(resourceAssignmentType.getTSK().getTRG());
}else {
if (!"0".equalsIgnoreCase(resourceAssignmentType.getTSK().getORI())){
LOG.info("Mandatory field TRG is null or empty string, resourceAssignmentType message is rejected");
sendErroNotification(EnumExceptionCodes.EMAND);
return false;
}
}
// set TRQ (not mandatory for ORI = 0)
if (resourceAssignmentType.getTSK().getTRQ() != null && !"".equals(resourceAssignmentType.getTSK().getTRQ().trim())){
if (entStartupInitSingleton.isMDTaskReqtListOn()){
// to check with master data
switch (edpiodEntDbFltJobTask.getStaffType()){
case "EK":
if (!entStartupInitSingleton.getEKASTaskReqtList().contains(resourceAssignmentType.getTSK().getTRQ().trim())){
LOG.warn("not matching the master data, staffType {}, taskReqtId {}", resourceAssignmentType.getTSK().getTRQ().trim() ,"EKAS");
}
break;
case "GX":
if (!entStartupInitSingleton.getGXTaskReqtList().contains(resourceAssignmentType.getTSK().getTRQ().trim())){
LOG.warn("not matching the master data, staffType {}, taskReqtId {}", resourceAssignmentType.getTSK().getTRQ().trim() ,"GX");
}
break;
case "CS":
if (!entStartupInitSingleton.getCSTaskReqtList().contains(resourceAssignmentType.getTSK().getTRQ().trim())){
LOG.warn("not matching the master data, staffType {}, taskReqtId {}", resourceAssignmentType.getTSK().getTRQ().trim() ,"CS");
}
break;
}
sendErroNotification(EnumExceptionCodes.WNOMD);
}
edpiodEntDbFltJobTask.setTaskRequirementId(resourceAssignmentType.getTSK().getTRQ());
}else {
if (!"0".equalsIgnoreCase(resourceAssignmentType.getTSK().getORI())){
LOG.info("Mandatory field TRQ is null or empty string, resourceAssignmentType message is rejected");
sendErroNotification(EnumExceptionCodes.EMAND);
return false;
}
}
// set TRD
if (resourceAssignmentType.getTSK().getTRD() != null && !"".equals(resourceAssignmentType.getTSK().getTRD().trim())){
if (entStartupInitSingleton.isMDTaskReqtListOn()){
// to check with master data
switch (edpiodEntDbFltJobTask.getStaffType()){
case "EK":
if (!entStartupInitSingleton.getEKASTaskReqtList().contains(resourceAssignmentType.getTSK().getTRD().trim())){
LOG.warn("not matching the master data, staffType {}, taskReqtId {}", resourceAssignmentType.getTSK().getTRD().trim() ,"EKAS");
}
break;
case "GX":
if (!entStartupInitSingleton.getGXTaskReqtList().contains(resourceAssignmentType.getTSK().getTRD().trim())){
LOG.warn("not matching the master data, staffType {}, taskReqtId {}", resourceAssignmentType.getTSK().getTRD().trim() ,"GX");
}
break;
case "CS":
if (!entStartupInitSingleton.getCSTaskReqtList().contains(resourceAssignmentType.getTSK().getTRD().trim())){
LOG.warn("not matching the master data, staffType {}, taskReqtId {}", resourceAssignmentType.getTSK().getTRD().trim() ,"CS");
}
break;
}
sendErroNotification(EnumExceptionCodes.WNOMD);
}
edpiodEntDbFltJobTask.setTaskDeptId(resourceAssignmentType.getTSK().getTRD());
}
// set DEP
if (resourceAssignmentType.getTSK().getDEP() != null && !"".equals(resourceAssignmentType.getTSK().getDEP().trim())){
if (entStartupInitSingleton.isMDDeptListOn()){
// to check master data
switch (edpiodEntDbFltJobTask.getStaffType()){
case "EK":
if (!entStartupInitSingleton.getEKASDeptList().contains(resourceAssignmentType.getTSK().getDEP().trim())){
LOG.warn("not matching the master data, staffType {}, deptId {}", resourceAssignmentType.getTSK().getDEP().trim() ,"EKAS");
}
break;
case "GX":
if (!entStartupInitSingleton.getGXDeptList().contains(resourceAssignmentType.getTSK().getDEP().trim())){
LOG.warn("not matching the master data, staffType {}, deptId {}", resourceAssignmentType.getTSK().getDEP().trim() ,"GX");
}
break;
case "CS":
if (!entStartupInitSingleton.getCSDeptList().contains(resourceAssignmentType.getTSK().getDEP().trim())){
LOG.warn("not matching the master data, staffType {}, deptId {}", resourceAssignmentType.getTSK().getDEP().trim() ,"CS");
}
break;
}
sendErroNotification(EnumExceptionCodes.WNOMD);
}
edpiodEntDbFltJobTask.setTaskDeptId(resourceAssignmentType.getTSK().getDEP());
}else {
LOG.info("Mandatory field DEP is null or empty string, resourceAssignmentType message is rejected");
sendErroNotification(EnumExceptionCodes.EMAND);
return false;
}
// set TYP
if (resourceAssignmentType.getTSK().getTYP() != null && !"".equals(resourceAssignmentType.getTSK().getTYP().trim())){
// // to check master data
// switch (edpiodEntDbFltJobTask.getStaffType()){
// case "EK":
// if (!entStartupInitSingleton.getEKASTaskTypesList().contains(resourceAssignmentType.getTSK().getTYP().trim())){
// LOG.warn("not matching the master data, staffType {}, deptId {}", resourceAssignmentType.getTSK().getTYP().trim() ,"EKAS");
// }
// break;
// case "GX":
// if (!entStartupInitSingleton.getGXTaskTypesList().contains(resourceAssignmentType.getTSK().getTYP().trim())){
// LOG.warn("not matching the master data, staffType {}, deptId {}", resourceAssignmentType.getTSK().getTYP().trim() ,"GX");
// }
// break;
// case "CS":
// if (!entStartupInitSingleton.getCSTaskTypesList().contains(resourceAssignmentType.getTSK().getTYP().trim())){
// LOG.warn("not matching the master data, staffType {}, deptId {}", resourceAssignmentType.getTSK().getTYP().trim() ,"CS");
// }
// break;
// }
edpiodEntDbFltJobTask.setTaskType(resourceAssignmentType.getTSK().getTYP());
}else {
LOG.info("Mandatory field TYP is null or empty string, resourceAssignmentType message is rejected");
sendErroNotification(EnumExceptionCodes.EMAND);
return false;
}
// // added according icd 2.0 and Mei's design, when ORI = 0 not related to flight
// if ("0".equalsIgnoreCase(resourceAssignmentType.getTSK().getORI())){
// LOG.info("ORI = 0, resourceAssignmentType message is rejected");
// return false;
// }
// set ORI
if (resourceAssignmentType.getTSK().getORI() != null && !"".equals(resourceAssignmentType.getTSK().getORI().trim())){
if (entStartupInitSingleton.isMDTaskGrptypeListOn()){
// to check master data
switch (edpiodEntDbFltJobTask.getStaffType()){
case "EK":
if (!entStartupInitSingleton.getEKASTaskGrptypeList().contains(resourceAssignmentType.getTSK().getORI().trim())){
LOG.warn("not matching the master data, staffType {}, taskGrptypeId {}", resourceAssignmentType.getTSK().getORI().trim() ,"EKAS");
}
break;
case "GX":
if (!entStartupInitSingleton.getGXTaskGrptypeList().contains(resourceAssignmentType.getTSK().getORI().trim())){
LOG.warn("not matching the master data, staffType {}, taskGrptypeId {}", resourceAssignmentType.getTSK().getORI().trim() ,"GX");
}
break;
case "CS":
if (!entStartupInitSingleton.getCSTaskGrptypeList().contains(resourceAssignmentType.getTSK().getORI().trim())){
LOG.warn("not matching the master data, staffType {}, taskGrptypeId {}", resourceAssignmentType.getTSK().getORI().trim() ,"CS");
}
break;
}
sendErroNotification(EnumExceptionCodes.WNOMD);
}
edpiodEntDbFltJobTask.setTaskGrpType(resourceAssignmentType.getTSK().getORI());
}else {
LOG.info("Mandatory field ORI is null or empty string, resourceAssignmentType message is rejected");
sendErroNotification(EnumExceptionCodes.EMAND);
return false;
}
// set SNO
if (resourceAssignmentType.getTSK().getSNO() != 0){
edpiodEntDbFltJobTask.setTaskNum(new BigDecimal(resourceAssignmentType.getTSK().getSNO()));
}else {
LOG.info("Mandatory field SNO is 0, resourceAssignmentType message is rejected");
sendErroNotification(EnumExceptionCodes.EMAND);
return false;
}
// set MNO
if (resourceAssignmentType.getTSK().getMNO() != 0){
edpiodEntDbFltJobTask.setMainTaskNum(new BigDecimal(resourceAssignmentType.getTSK().getMNO()));
}else {
LOG.info("Mandatory field MNO is 0, resourceAssignmentType message is rejected");
sendErroNotification(EnumExceptionCodes.EMAND);
return false;
}
// set RMK
if (resourceAssignmentType.getTSK().getRMK() != null && !"".equals(resourceAssignmentType.getTSK().getRMK().trim())){
edpiodEntDbFltJobTask.setTaskRemark(resourceAssignmentType.getTSK().getRMK());
}
// set STI
if (resourceAssignmentType.getTSK().getSTI() != null && !"".equals(resourceAssignmentType.getTSK().getSTI())){
try {
edpiodEntDbFltJobTask.setTaskActualStartDate(convertStringToDate(resourceAssignmentType.getTSK().getSTI()));
} catch (ParseException e) {
LOG.error("erro when parse String to Date STI, {}", e);
// LOG.info("Mandatory field STI can not be parsed correctly, resourceAssignmentType message is rejected");
// return false;
}
}
// set ETI
if (resourceAssignmentType.getTSK().getETI() != null){
try {
edpiodEntDbFltJobTask.setTaskActualEndDate(convertStringToDate(resourceAssignmentType.getTSK().getETI()));
} catch (ParseException e) {
LOG.error("erro when parse String to Date ETI, {}", e);
// LOG.info("Mandatory field ETI can not be parsed correctly, resourceAssignmentType message is rejected");
// return false;
}
}
// set DUR
if (resourceAssignmentType.getTSK().getDUR() != null && resourceAssignmentType.getTSK().getDUR() != 0){
edpiodEntDbFltJobTask.setTaskActualDuration(new BigDecimal(resourceAssignmentType.getTSK().getDUR()));
}
// set EST
if (resourceAssignmentType.getTSK().getEST() != null && !"".equals(resourceAssignmentType.getTSK().getEST() )){
try {
edpiodEntDbFltJobTask.setTaskPlanStartDate(convertStringToDate(resourceAssignmentType.getTSK().getEST()));
} catch (ParseException e) {
LOG.error("erro when parse String to Date DUR, {}", e);
// LOG.info("Mandatory field EST can not be parsed correctly, resourceAssignmentType message is rejected");
// return false;
}
}else {
LOG.info("Mandatory field EST is null, resourceAssignmentType message is rejected");
sendErroNotification(EnumExceptionCodes.EMAND);
return false;
}
// set LET
if (resourceAssignmentType.getTSK().getLET() != null && !"".equals(resourceAssignmentType.getTSK().getLET().trim())){
try {
edpiodEntDbFltJobTask.setTaskPlanEndDate(convertStringToDate(resourceAssignmentType.getTSK().getLET()));
// task_plan_duration = task_plan_end_date - task_plan_start_date
int days = Days.daysBetween(new DateTime(edpiodEntDbFltJobTask.getTaskPlanStartDate()), new DateTime(edpiodEntDbFltJobTask.getTaskPlanEndDate())).getDays();
int seconds = days * 24 * 60 * 60;
edpiodEntDbFltJobTask.setTaskPlanDuration(new BigDecimal(seconds));
} catch (ParseException e) {
LOG.error("erro when parse String to Date LET, {}", e);
// LOG.info("Mandatory field LET can not be parsed correctly, resourceAssignmentType message is rejected");
// return false;
}
}else {
LOG.info("Mandatory field LET is null, resourceAssignmentType message is rejected");
sendErroNotification(EnumExceptionCodes.EMAND);
return false;
}
// set SLO
if (resourceAssignmentType.getTSK().getSLO() != null && !"".equals(resourceAssignmentType.getTSK().getSLO().trim())){
edpiodEntDbFltJobTask.setTaskStartLoc(resourceAssignmentType.getTSK().getSLO());
}else {
LOG.info("Mandatory field SLO is null or empty string, resourceAssignmentType message is rejected");
sendErroNotification(EnumExceptionCodes.EMAND);
return false;
}
// set ELO
if (resourceAssignmentType.getTSK().getELO() != null && !"".equals(resourceAssignmentType.getTSK().getELO().trim())){
edpiodEntDbFltJobTask.setTaskEndLoc(resourceAssignmentType.getTSK().getELO());
}else {
LOG.info("Mandatory field ELO is null or empty string, resourceAssignmentType message is rejected");
sendErroNotification(EnumExceptionCodes.EMAND);
return false;
}
// set HST
if (resourceAssignmentType.getTSK().getHST() != null && !"".equals(resourceAssignmentType.getTSK().getHST().trim())){
edpiodEntDbFltJobTask.setTaskHandlingState(resourceAssignmentType.getTSK().getHST());
}else {
LOG.info("Mandatory field HST is null or empty string, resourceAssignmentType message is rejected");
sendErroNotification(EnumExceptionCodes.EMAND);
return false;
}
// set MWA (not available for DEP =CB)
if (!"CB".equalsIgnoreCase(resourceAssignmentType.getTSK().getDEP())){
if (resourceAssignmentType.getTSK().getMWA() != null && !"".equals(resourceAssignmentType.getTSK().getMWA().trim())){
if (entStartupInitSingleton.isMDWorkAreasListOn()){
// to check with master data
switch (edpiodEntDbFltJobTask.getStaffType()){
case "EK":
if (!entStartupInitSingleton.getEKASWorkAreasList().contains(resourceAssignmentType.getTSK().getMWA().trim())){
LOG.warn("not matching the master data, staffType {}, workArea {}", resourceAssignmentType.getTSK().getMWA().trim() ,"EKAS");
}
break;
case "GX":
if (!entStartupInitSingleton.getGXWorkAreasList().contains(resourceAssignmentType.getTSK().getMWA().trim())){
LOG.warn("not matching the master data, staffType {}, workArea {}", resourceAssignmentType.getTSK().getMWA().trim() ,"GX");
}
break;
case "CS":
if (!entStartupInitSingleton.getCSWorkAreasList().contains(resourceAssignmentType.getTSK().getMWA().trim())){
LOG.warn("not matching the master data, staffType {}, workArea {}", resourceAssignmentType.getTSK().getMWA().trim() ,"CS");
}
break;
}
sendErroNotification(EnumExceptionCodes.WNOMD);
}
edpiodEntDbFltJobTask.setTaskWorkArea(resourceAssignmentType.getTSK().getMWA());
}
// else {
// LOG.info("Mandatory field MWA is null or empty string, resourceAssignmentType message is rejected");
// return false;
// }
}
// set SWA
if (resourceAssignmentType.getTSK().getSWA() != null && !"".equals(resourceAssignmentType.getTSK().getSWA().trim())){
edpiodEntDbFltJobTask.setTaskSubworkArea(resourceAssignmentType.getTSK().getSWA());
}
// set WLD
if (resourceAssignmentType.getTSK().getWLD() != null && resourceAssignmentType.getTSK().getWLD() != 0){
edpiodEntDbFltJobTask.setTaskWorkloadFactor(new BigDecimal(resourceAssignmentType.getTSK().getWLD()));
}
// set PRI
if (resourceAssignmentType.getTSK().getPRI() != 0){
edpiodEntDbFltJobTask.setTaskPriority(new BigDecimal(resourceAssignmentType.getTSK().getPRI()));
}
// Attention ! make use of this info to search flight in AFTTAB (AFTTAB.ACT3 or ACT5)
// AFT
// if (resourceAssignmentType.getTSK().getAFT() != null && !"".equals(resourceAssignmentType.getTSK().getAFT().trim())){
// }
// set STS
if (resourceAssignmentType.getTSK().getSTS() != null && !"".equals(resourceAssignmentType.getTSK().getSTS().trim())){
// // to check with master data
// switch (edpiodEntDbFltJobTask.getStaffType()){
// case "EK":
// if (!entStartupInitSingleton.getEKASTaskStatusList().contains(resourceAssignmentType.getTSK().getSTS().trim())){
// LOG.warn("not matching the master data, staffType {}, workArea {}", resourceAssignmentType.getTSK().getSTS().trim() ,"EKAS");
// }
// break;
// case "GX":
// if (!entStartupInitSingleton.getGXTaskStatusList().contains(resourceAssignmentType.getTSK().getSTS().trim())){
// LOG.warn("not matching the master data, staffType {}, workArea {}", resourceAssignmentType.getTSK().getSTS().trim() ,"GX");
// }
// break;
// case "CS":
// if (!entStartupInitSingleton.getCSTaskStatusList().contains(resourceAssignmentType.getTSK().getSTS().trim())){
// LOG.warn("not matching the master data, staffType {}, workArea {}", resourceAssignmentType.getTSK().getSTS().trim() ,"CS");
// }
// break;
// }
edpiodEntDbFltJobTask.setTaskStatus(resourceAssignmentType.getTSK().getSTS());
}else {
LOG.info("Mandatory field STS is null or empty string, resourceAssignmentType message is rejected");
sendErroNotification(EnumExceptionCodes.EMAND);
return false;
}
// set STT
if (resourceAssignmentType.getTSK().getSTT() != null && !"".equals(resourceAssignmentType.getTSK().getSTT().trim())){
if (entStartupInitSingleton.isMDTaskGrptypeListOn()){
// to check with master data
switch (edpiodEntDbFltJobTask.getStaffType()){
case "EK":
if (!entStartupInitSingleton.getEKASTaskGrptypeList().contains(resourceAssignmentType.getTSK().getSTT().trim())){
LOG.warn("not matching the master data, staffType {}, taskGrptypeId {}", resourceAssignmentType.getTSK().getSTT().trim() ,"EKAS");
}
break;
case "GX":
if (!entStartupInitSingleton.getGXTaskGrptypeList().contains(resourceAssignmentType.getTSK().getSTT().trim())){
LOG.warn("not matching the master data, staffType {}, taskGrptypeId {}", resourceAssignmentType.getTSK().getSTT().trim() ,"GX");
}
break;
case "CS":
if (!entStartupInitSingleton.getCSTaskGrptypeList().contains(resourceAssignmentType.getTSK().getSTT().trim())){
LOG.warn("not matching the master data, staffType {}, taskGrptypeId {}", resourceAssignmentType.getTSK().getSTT().trim() ,"CS");
}
break;
}
sendErroNotification(EnumExceptionCodes.WNOMD);
}
edpiodEntDbFltJobTask.setSubtaskStatus(resourceAssignmentType.getTSK().getSTT());
}else {
LOG.info("Mandatory field STT is null or empty string, resourceAssignmentType message is rejected");
sendErroNotification(EnumExceptionCodes.EMAND);
return false;
}
// Attention ! Use this info to form the full flight number (AFTTAB.FLNO)
// set DNO
// if (resourceAssignmentType.getTSK().getDNO() != null && !"".equals(resourceAssignmentType.getTSK().getDNO().trim())){
// // TO CONTINUE>>>>>>
// }
// Make use of this info to search flight in AFTTAB Convert to UTC prior to search (AFTTAB.STOD)
// set DFD
// if (resourceAssignmentType.getTSK().getDFD() != null){
// // TO CONTINUE>>>>>>
// }
// Make use of this info to search flight in AFTTAB (AFTTAB.ORG3)
// set REG
// if (resourceAssignmentType.getTSK().getREG() != null && !"".equals(resourceAssignmentType.getTSK().getREG().trim())){
// // TO CONTINUE>>>>>>
// }
// Make use of this info to search flight in AFTTAB (AFTTAB.ORG3)
// check DSN (not mandatory for ORI = 0)
if (!"0".equalsIgnoreCase(resourceAssignmentType.getTSK().getORI())){
if (resourceAssignmentType.getTSK().getDSN() == null || "".equals(resourceAssignmentType.getTSK().getDSN().trim())){
LOG.info("Mandatory field DSN is null or empty string, resourceAssignmentType message is rejected");
sendErroNotification(EnumExceptionCodes.EMAND);
return false;
}
}
// Use this info to form the full flight number (AFTTAB.FLNO)
// check ASN (not mandatory for ORI = 0)
if (!"0".equalsIgnoreCase(resourceAssignmentType.getTSK().getORI())){
if (resourceAssignmentType.getTSK().getASN() == null || "".equals(resourceAssignmentType.getTSK().getASN().trim())){
LOG.info("Mandatory field ASN is null or empty string, resourceAssignmentType message is rejected");
sendErroNotification(EnumExceptionCodes.EMAND);
return false;
}
}
// set SID (chnage to conditional according to version 2)
if (resourceAssignmentType.getTSK().getSID() != null && !"".equals(resourceAssignmentType.getTSK().getSID().trim())){
edpiodEntDbFltJobAssign.setShiftId( new BigDecimal(resourceAssignmentType.getTSK().getSID()));
}
// else {
// LOG.info("Mandatory field SID is null or empty string, resourceAssignmentType message is rejected");
// return false;
// }