Commit 24cf3c9a by shj

会议费的展示:数字的变化

parent e2ca3cf9
...@@ -34,8 +34,14 @@ public class Conference extends Item { ...@@ -34,8 +34,14 @@ public class Conference extends Item {
this.experts = experts; this.experts = experts;
} }
/**
* 不能简单的把乘以天数,天数与费用的关系详见专家费用规定
* @return
*/
@Override @Override
public double computeUnitPrice() { public double computeUnitPrice() {
int d=getDays();
return getPrice()*getPeople()*getDays(); return getPrice()*getPeople()*getDays();
} }
......
...@@ -86,14 +86,14 @@ public class DetailHandler { ...@@ -86,14 +86,14 @@ public class DetailHandler {
object.put("travel",sub); object.put("travel",sub);
req_sofar+=req;sum_sofar+=sum; req_sofar+=req;sum_sofar+=sum;
//劳务 //会议
sub=new JSONObject(); sub=new JSONObject();
req=budget.getRequirement().getLabour(); req=budget.getRequirement().getConference();
sum=detailService.sumLabour(budget.getLabour()); sum=detailService.sumConference(budget.getConferences());
sub.put("req",req); sub.put("req",req);
sub.put("sum",sum); sub.put("sum",sum);
sub.put("diff",req-sum); sub.put("diff",req-sum);
object.put("labour",sub); object.put("conference",sub);
req_sofar+=req;sum_sofar+=sum; req_sofar+=req;sum_sofar+=sum;
//产权费 //产权费
......
...@@ -13,4 +13,6 @@ public interface IDetailService { ...@@ -13,4 +13,6 @@ public interface IDetailService {
double sumLabour(Map<Labour, Integer> labour); double sumLabour(Map<Labour, Integer> labour);
double sumProperty(Map<Property, Integer> properties); double sumProperty(Map<Property, Integer> properties);
double sumConference(Map<Conference, Integer> conferences);
} }
...@@ -43,4 +43,13 @@ public class DetailService implements IDetailService { ...@@ -43,4 +43,13 @@ public class DetailService implements IDetailService {
} }
return sum; return sum;
} }
@Override
public double sumConference(Map<Conference, Integer> conferences) {
double sum=0.0;
for (Conference item : conferences.keySet()) {
sum+=(item.computeUnitPrice()*conferences.get(item));
}
return sum;
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment