|
|
|
@ -43,63 +43,63 @@ 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) { |
|
|
|
|
//获取每个计划时间差(结束时间-开始时间)
|
|
|
|
|
//long datePoorByDay = DateUtils.getDatePoorByDay(iProductionPlan.getEndTime(), iProductionPlan.getStartTime());
|
|
|
|
|
//获取每个计划每天应完成的百分比
|
|
|
|
|
BigDecimal daypercent = new BigDecimal(1).divide(new BigDecimal(iProductionPlan.getDuration()),2,BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)); |
|
|
|
|
//获取当前日期,减去开始日期,乘以每个计划每天应完成的百分比,算出截止今天应该完成的百分比
|
|
|
|
|
BigDecimal currentpercent = BigDecimal.valueOf(DateUtils.getDatePoorByDay(new Date(), iProductionPlan.getStartTime())).multiply(daypercent); |
|
|
|
|
if (DateUtils.getDatePoorByDay(new Date(), iProductionPlan.getEndTime()) > 0) { |
|
|
|
|
currentpercent = BigDecimal.valueOf(100); |
|
|
|
|
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());
|
|
|
|
|
//获取每个计划每天应完成的百分比
|
|
|
|
|
BigDecimal daypercent = new BigDecimal(1).divide(new BigDecimal(iProductionPlan.getDuration()), 2, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)); |
|
|
|
|
//获取当前日期,减去开始日期,乘以每个计划每天应完成的百分比,算出截止今天应该完成的百分比
|
|
|
|
|
BigDecimal currentpercent = BigDecimal.valueOf(DateUtils.getDatePoorByDay(new Date(), iProductionPlan.getStartTime())).multiply(daypercent); |
|
|
|
|
if (DateUtils.getDatePoorByDay(new Date(), iProductionPlan.getEndTime()) > 0) { |
|
|
|
|
currentpercent = BigDecimal.valueOf(100); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
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(); |
|
|
|
|
map.put("total", total); |
|
|
|
|
res.add(map); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
planlist.add(currentpercent); |
|
|
|
|
namelist.add(iProductionPlan.getPlanName()); |
|
|
|
|
//查询计划实际填报情况
|
|
|
|
|
List<IProgress> progresseslist = iProgressMapper.queryList(new IProgress().setPlanId(iProductionPlan.getId())); |
|
|
|
|
long total = progresseslist.stream().mapToLong(IProgress::getDayProgress).sum(); |
|
|
|
|
actuallist.add(total); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
|
|
|
|
public List<IProductionPlan> querywarn(Integer day) { |
|
|
|
|
List<IProductionPlan> iProductionPlans = iProductionPlanMapper.querywarn(); |
|
|
|
|
List<IProductionPlan> newiProductionPlans=new ArrayList<>(); |
|
|
|
|
List<IProductionPlan> newiProductionPlans = new ArrayList<>(); |
|
|
|
|
for (IProductionPlan iProductionPlan : iProductionPlans) { |
|
|
|
|
if (DateUtils.getDatePoorByDay(new Date(), iProductionPlan.getEndTime()) > day) { |
|
|
|
|
newiProductionPlans.add(iProductionPlan); |
|
|
|
|
IWarn i=iWarnMapper.selectByPlanId(iProductionPlan.getId()); |
|
|
|
|
if(ObjectUtils.isEmpty(i)){ |
|
|
|
|
IWarn warn=new IWarn(); |
|
|
|
|
IWarn i = iWarnMapper.selectByPlanId(iProductionPlan.getId()); |
|
|
|
|
if (ObjectUtils.isEmpty(i)) { |
|
|
|
|
IWarn warn = new IWarn(); |
|
|
|
|
warn.setPlanId(iProductionPlan.getId()); |
|
|
|
|
warn.setPlanName(iProductionPlan.getPlanName()); |
|
|
|
|
warn.setCreateTime(new Date()); |
|
|
|
@ -112,36 +112,37 @@ public class IProductionPlanServiceImpl extends ServiceImpl<IProductionPlanMappe |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public Map<String, Object> dataOverview() { |
|
|
|
|
int total=iProductionPlanMapper.queryTotal();//总工期
|
|
|
|
|
int sg=iManpowerMapper.querySg();//施工人员
|
|
|
|
|
int gl=iProductionPlanMapper.queryGl();//管理人员
|
|
|
|
|
List<IProgress> ysg=iProgressMapper.queryYsg(); //已施工
|
|
|
|
|
int total = iProductionPlanMapper.queryTotal();//总工期
|
|
|
|
|
int sg = iManpowerMapper.querySg();//施工人员
|
|
|
|
|
int gl = iProductionPlanMapper.queryGl();//管理人员
|
|
|
|
|
List<IProgress> ysg = iProgressMapper.queryYsg(); //已施工
|
|
|
|
|
//int gcjd=iProductionPlanMapper.queryGcjd();//工程进度
|
|
|
|
|
Map map=new HashMap(); |
|
|
|
|
map.put("list",total);//总工期
|
|
|
|
|
map.put("sg",sg);//施工人员
|
|
|
|
|
map.put("gl",gl);//管理人员
|
|
|
|
|
map.put("ysg",ysg.size());// //已施工
|
|
|
|
|
Map map = new HashMap(); |
|
|
|
|
map.put("list", total);//总工期
|
|
|
|
|
map.put("sg", sg);//施工人员
|
|
|
|
|
map.put("gl", gl);//管理人员
|
|
|
|
|
map.put("ysg", ysg.size());// //已施工
|
|
|
|
|
//查询一级计划
|
|
|
|
|
double day=0; |
|
|
|
|
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(); |
|
|
|
|
}else{ |
|
|
|
|
day+=0; |
|
|
|
|
double day = 0; |
|
|
|
|
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(); |
|
|
|
|
} else { |
|
|
|
|
day += 0; |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
totalday+=plan.get(i).getDuration(); |
|
|
|
|
totalday += plan.get(i).getDuration(); |
|
|
|
|
} |
|
|
|
|
map.put("gcjd",day/totalday);// //已施工
|
|
|
|
|
map.put("gcjd", day / totalday);// //已施工
|
|
|
|
|
|
|
|
|
|
return AjaxResult.success(map); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public List<IProductionPlan> bigscreenProgress() { |
|
|
|
|
return iProductionPlanMapper.bigscreenProgress(); |
|
|
|
|
return iProductionPlanMapper.bigscreenProgress(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//获取最近一周时间
|
|
|
|
|