|
|
|
@ -43,26 +43,28 @@ public class IProductionPlanServiceImpl extends ServiceImpl<IProductionPlanMappe |
|
|
|
|
private IWarnMapper iWarnMapper; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public List<IProductionPlan> queryList(IProductionPlan iProductionPlan) { |
|
|
|
|
return iProductionPlanMapper.queryList(iProductionPlan); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public Map<String, Object> statistics() { |
|
|
|
|
public List<Map<String, Object>> statistics() { |
|
|
|
|
List<String> recentWeekDates = getRecentWeekDates(); |
|
|
|
|
List<String> namelist=new ArrayList<>(); |
|
|
|
|
List<BigDecimal> planlist=new ArrayList<>(); |
|
|
|
|
List<Long> actuallist=new ArrayList<>(); |
|
|
|
|
for(int i=0;i<recentWeekDates.size();i++){ |
|
|
|
|
List<IProductionPlan> iProductionPlans = iProductionPlanMapper.statistics(recentWeekDates.get(i)); |
|
|
|
|
if(iProductionPlans.size()==0){ |
|
|
|
|
planlist.add(new BigDecimal(0)); |
|
|
|
|
actuallist.add(Long.valueOf(0)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
List<Map<String, Object>> res = new ArrayList<>(); |
|
|
|
|
List<IProductionPlan> iProductionPlans = iProductionPlanMapper.statistics(); |
|
|
|
|
if (iProductionPlans.size() > 0) { |
|
|
|
|
for (IProductionPlan iProductionPlan : iProductionPlans) { |
|
|
|
|
for (int i = 0; i < recentWeekDates.size(); i++) { |
|
|
|
|
IProductionPlan iP = iProductionPlanMapper.statisticsByDateAndName(iProductionPlan.getId(),recentWeekDates.get(i)); |
|
|
|
|
Map map = new HashMap(); |
|
|
|
|
if(ObjectUtils.isEmpty(iP)){ |
|
|
|
|
map.put("name", iProductionPlan.getPlanName()); |
|
|
|
|
map.put("plan", 0); |
|
|
|
|
map.put("date", recentWeekDates.get(i)); |
|
|
|
|
map.put("sj", 0); |
|
|
|
|
res.add(map); |
|
|
|
|
}else{ |
|
|
|
|
//获取每个计划时间差(结束时间-开始时间)
|
|
|
|
|
//long datePoorByDay = DateUtils.getDatePoorByDay(iProductionPlan.getEndTime(), iProductionPlan.getStartTime());
|
|
|
|
|
//获取每个计划每天应完成的百分比
|
|
|
|
@ -72,22 +74,20 @@ public class IProductionPlanServiceImpl extends ServiceImpl<IProductionPlanMappe |
|
|
|
|
if (DateUtils.getDatePoorByDay(new Date(), iProductionPlan.getEndTime()) > 0) { |
|
|
|
|
currentpercent = BigDecimal.valueOf(100); |
|
|
|
|
} |
|
|
|
|
planlist.add(currentpercent); |
|
|
|
|
namelist.add(iProductionPlan.getPlanName()); |
|
|
|
|
|
|
|
|
|
map.put("name", iProductionPlan.getPlanName()); |
|
|
|
|
map.put("plan", currentpercent); |
|
|
|
|
map.put("date", recentWeekDates.get(i)); |
|
|
|
|
//查询计划实际填报情况
|
|
|
|
|
List<IProgress> progresseslist = iProgressMapper.queryList(new IProgress().setPlanId(iProductionPlan.getId())); |
|
|
|
|
long total = progresseslist.stream().mapToLong(IProgress::getDayProgress).sum(); |
|
|
|
|
actuallist.add(total); |
|
|
|
|
map.put("total", total); |
|
|
|
|
res.add(map); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Map<String, Object> result = new HashMap<>(); |
|
|
|
|
result.put("namelist",namelist); |
|
|
|
|
result.put("datelist",recentWeekDates); |
|
|
|
|
result.put("planlist",planlist); |
|
|
|
|
result.put("actuallist",actuallist); |
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return res; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@ -124,7 +124,8 @@ public class IProductionPlanServiceImpl extends ServiceImpl<IProductionPlanMappe |
|
|
|
|
map.put("ysg", ysg.size());// //已施工
|
|
|
|
|
//查询一级计划
|
|
|
|
|
double day = 0; |
|
|
|
|
int totalday=0;List<IProductionPlan> plan = iProductionPlanMapper.bigscreenProgress(); |
|
|
|
|
int totalday = 0; |
|
|
|
|
List<IProductionPlan> plan = iProductionPlanMapper.bigscreenProgress(); |
|
|
|
|
for (int i = 0; i < plan.size(); i++) { |
|
|
|
|
if (null != plan.get(i).getAccumulativeProgress()) { |
|
|
|
|
day += plan.get(i).getDuration() * plan.get(i).getAccumulativeProgress(); |
|
|
|
|