added documentation
parent
62a12ee29e
commit
71b44d09b2
|
|
@ -120,26 +120,23 @@ public class Change {
|
|||
.filter(peopleFullName::equals)
|
||||
.isPresent());
|
||||
|
||||
// var state = getValue(entry, "State").getIntValue();
|
||||
// var inApproval = inApprovalList(api.getUser(), getValueStringByID(entry,
|
||||
// "ChangeNr"));
|
||||
|
||||
// change.setFlagPermit(flagPermit(state));
|
||||
// change.setFlagApprove(flagApproval(inApproval, state));
|
||||
// change.setFlagReject(flagApproval(inApproval, state));
|
||||
// change.setFlagCancel(flagCancel(getValueStringByID(entry, "SupportGroupId"),
|
||||
// state));
|
||||
/*
|
||||
* var state = getValue(entry, "State").getIntValue();
|
||||
* var inApproval = inApprovalList(api.getUser(), getValueStringByID(entry,
|
||||
* "ChangeNr"));
|
||||
*
|
||||
* change.setFlagPermit(flagPermit(state));
|
||||
* change.setFlagApprove(flagApproval(inApproval, state));
|
||||
* change.setFlagReject(flagApproval(inApproval, state));
|
||||
* change.setFlagCancel(flagCancel(getValueStringByID(entry, "SupportGroupId"),
|
||||
* state));
|
||||
*/
|
||||
|
||||
var ptMinutes = getValueStringByID(entry, "PlanTimeMinutes").isEmpty() ? "00" : getValueStringByID(entry, "PlanTimeMinutes");
|
||||
var ptHours = getValueStringByID(entry, "PlanTimeHours").isEmpty() ? "00" : getValueStringByID(entry, "PlanTimeHours");
|
||||
change.setPlanTime(convertPlanTime(ptHours, ptMinutes));
|
||||
|
||||
try {
|
||||
change.setPackageName(
|
||||
queryPackageName(getValueStringByID(entry, "PackageType").toString()));
|
||||
} catch (ARException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
change.setPackageName(queryPackageName(getValueStringByID(entry, "PackageType").toString()));
|
||||
changes.add(change);
|
||||
}
|
||||
|
||||
|
|
@ -184,12 +181,20 @@ public class Change {
|
|||
return peopleInfos.get(0).get(queryPerson.getFieldId("FullName")).toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts the planned time which is passed in hours and minutes to total hours
|
||||
*
|
||||
* @param hours the hours as a String
|
||||
* @param minutes the minutes as a String
|
||||
* @return the hours and minutes as total hours
|
||||
* @throws ARException
|
||||
*/
|
||||
public double convertPlanTime(String hours, String minutes) throws ARException {
|
||||
double totalHours = Integer.valueOf(hours) + (Integer.valueOf(minutes)/60.0);
|
||||
double totalHours = Integer.valueOf(hours) + (Integer.valueOf(minutes) / 60.0);
|
||||
return totalHours;
|
||||
}
|
||||
|
||||
//#region approval flags
|
||||
// #region approval flags
|
||||
// /**
|
||||
// * Determines if the change item can be approved based on the approval status
|
||||
// * and the current state.
|
||||
|
|
@ -268,7 +273,7 @@ public class Change {
|
|||
// approversOI.get(0).get(queryApprovalList.getFieldId("Approvers")).toString();
|
||||
// return approvers != null ? approvers.contains(user) : false;
|
||||
// }
|
||||
//#endregion
|
||||
// #endregion
|
||||
|
||||
/**
|
||||
* Queries and retrieves the package name based on the provided package type.
|
||||
|
|
|
|||
|
|
@ -243,10 +243,20 @@ public class ChangeItem {
|
|||
// this.flagCancel = flagCancel;
|
||||
// }
|
||||
|
||||
/**
|
||||
* Retrieves the planned time.
|
||||
*
|
||||
* @return the planned time
|
||||
*/
|
||||
public double getPlanTime() {
|
||||
return this.planTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the planned time.
|
||||
*
|
||||
* @param planTime the planned time to set
|
||||
*/
|
||||
public void setPlanTime(double planTime) {
|
||||
this.planTime = planTime;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue