added documentation

main
Said Gedik 2023-06-13 17:19:33 +02:00
parent 62a12ee29e
commit 71b44d09b2
2 changed files with 33 additions and 18 deletions

View File

@ -120,26 +120,23 @@ public class Change {
.filter(peopleFullName::equals) .filter(peopleFullName::equals)
.isPresent()); .isPresent());
// var state = getValue(entry, "State").getIntValue(); /*
// var inApproval = inApprovalList(api.getUser(), getValueStringByID(entry, * var state = getValue(entry, "State").getIntValue();
// "ChangeNr")); * var inApproval = inApprovalList(api.getUser(), getValueStringByID(entry,
* "ChangeNr"));
// change.setFlagPermit(flagPermit(state)); *
// change.setFlagApprove(flagApproval(inApproval, state)); * change.setFlagPermit(flagPermit(state));
// change.setFlagReject(flagApproval(inApproval, state)); * change.setFlagApprove(flagApproval(inApproval, state));
// change.setFlagCancel(flagCancel(getValueStringByID(entry, "SupportGroupId"), * change.setFlagReject(flagApproval(inApproval, state));
// state)); * change.setFlagCancel(flagCancel(getValueStringByID(entry, "SupportGroupId"),
* state));
*/
var ptMinutes = getValueStringByID(entry, "PlanTimeMinutes").isEmpty() ? "00" : getValueStringByID(entry, "PlanTimeMinutes"); var ptMinutes = getValueStringByID(entry, "PlanTimeMinutes").isEmpty() ? "00" : getValueStringByID(entry, "PlanTimeMinutes");
var ptHours = getValueStringByID(entry, "PlanTimeHours").isEmpty() ? "00" : getValueStringByID(entry, "PlanTimeHours"); var ptHours = getValueStringByID(entry, "PlanTimeHours").isEmpty() ? "00" : getValueStringByID(entry, "PlanTimeHours");
change.setPlanTime(convertPlanTime(ptHours, ptMinutes)); change.setPlanTime(convertPlanTime(ptHours, ptMinutes));
try { change.setPackageName(queryPackageName(getValueStringByID(entry, "PackageType").toString()));
change.setPackageName(
queryPackageName(getValueStringByID(entry, "PackageType").toString()));
} catch (ARException e) {
e.printStackTrace();
}
changes.add(change); changes.add(change);
} }
@ -184,12 +181,20 @@ public class Change {
return peopleInfos.get(0).get(queryPerson.getFieldId("FullName")).toString(); 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 { 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; return totalHours;
} }
//#region approval flags // #region approval flags
// /** // /**
// * Determines if the change item can be approved based on the approval status // * Determines if the change item can be approved based on the approval status
// * and the current state. // * and the current state.
@ -268,7 +273,7 @@ public class Change {
// approversOI.get(0).get(queryApprovalList.getFieldId("Approvers")).toString(); // approversOI.get(0).get(queryApprovalList.getFieldId("Approvers")).toString();
// return approvers != null ? approvers.contains(user) : false; // return approvers != null ? approvers.contains(user) : false;
// } // }
//#endregion // #endregion
/** /**
* Queries and retrieves the package name based on the provided package type. * Queries and retrieves the package name based on the provided package type.

View File

@ -243,10 +243,20 @@ public class ChangeItem {
// this.flagCancel = flagCancel; // this.flagCancel = flagCancel;
// } // }
/**
* Retrieves the planned time.
*
* @return the planned time
*/
public double getPlanTime() { public double getPlanTime() {
return this.planTime; return this.planTime;
} }
/**
* Sets the planned time.
*
* @param planTime the planned time to set
*/
public void setPlanTime(double planTime) { public void setPlanTime(double planTime) {
this.planTime = planTime; this.planTime = planTime;
} }