|
|
@ -28,6 +28,7 @@ public class DateDuration {
|
|
|
|
private int time = 0;
|
|
|
|
private int time = 0;
|
|
|
|
private double rate = 0.0;
|
|
|
|
private double rate = 0.0;
|
|
|
|
private boolean bValid = false;
|
|
|
|
private boolean bValid = false;
|
|
|
|
|
|
|
|
private int unit = 0;
|
|
|
|
|
|
|
|
|
|
|
|
public DateDuration(int value) {
|
|
|
|
public DateDuration(int value) {
|
|
|
|
this.time = value;
|
|
|
|
this.time = value;
|
|
|
@ -147,6 +148,9 @@ public class DateDuration {
|
|
|
|
if (amount < PRECISION)
|
|
|
|
if (amount < PRECISION)
|
|
|
|
return getTime();
|
|
|
|
return getTime();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (this.unit > 0) {
|
|
|
|
|
|
|
|
amount = Math.ceil(amount / this.unit);
|
|
|
|
|
|
|
|
}
|
|
|
|
double result = (amount * this.rate) + this.time;
|
|
|
|
double result = (amount * this.rate) + this.time;
|
|
|
|
return (int)Math.ceil(result);
|
|
|
|
return (int)Math.ceil(result);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -184,10 +188,11 @@ public class DateDuration {
|
|
|
|
for (EV_STRING evs : lst) {
|
|
|
|
for (EV_STRING evs : lst) {
|
|
|
|
if (evs.type == EV_STRING_TYPE.EVS_GOOD) {
|
|
|
|
if (evs.type == EV_STRING_TYPE.EVS_GOOD) {
|
|
|
|
AbstractMap.SimpleEntry<Boolean, Integer> extraTime = transTimeEach(evs.value);
|
|
|
|
AbstractMap.SimpleEntry<Boolean, Integer> extraTime = transTimeEach(evs.value);
|
|
|
|
if (extraTime.getKey() || !oFlg) {
|
|
|
|
if (extraTime.getKey() || oFlg) {
|
|
|
|
this.time += extraTime.getValue();
|
|
|
|
this.time += extraTime.getValue();
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
this.time += extraTime.getValue() * 1;
|
|
|
|
//this.time += extraTime.getValue() * 1;
|
|
|
|
|
|
|
|
this.unit = extraTime.getValue();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|