三力士演示demo

yun-zuoyi
钮海涛 5 years ago
parent 32eb9dc797
commit c980c6c87c

@ -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 {

@ -420,7 +420,9 @@ public class ApsEnumUtil {
NEARLY_WORK("NEARLY_WORK", "前后工作"), NEARLY_WORK("NEARLY_WORK", "前后工作"),
POST_RESOURCE("POST_RESOURCE", "后资源制约"), POST_RESOURCE("POST_RESOURCE", "后资源制约"),
SAME_ASS_RESOURCE("SAME_ASS_RESOURCE", "相同副资源"), SAME_ASS_RESOURCE("SAME_ASS_RESOURCE", "相同副资源"),
RESOURCE_PRIORITY("RESOURCE_PRIORITY", "资源优先级"); RESOURCE_PRIORITY("RESOURCE_PRIORITY", "资源优先级"),
RESOURCE_USEAGE("RESOURCE_USEAGE", "资源使用率"),
CUST_EXPRESSION("CUST_EXPRESSION", "自定义表达式");
private String value; private String value;
private String description; private String description;

Loading…
Cancel
Save