|
|
@@ -2590,6 +2590,8 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
|
|
|
@Override
|
|
|
public Map<String, List<DeptStatistic>> getDeptStatistic(DeptStatistic obj) {
|
|
|
List<CheckTaskPeriod> checkTaskPeriods = checkTaskPeriodDao.select(new CheckTaskPeriod());
|
|
|
+ SimpleDateFormat ff = new SimpleDateFormat("yyyy-MM");
|
|
|
+ SimpleDateFormat ff1 = new SimpleDateFormat("MM月");
|
|
|
|
|
|
for (CheckTaskPeriod p : checkTaskPeriods) {
|
|
|
if (obj.getStart_date() + 1 * 1000 * 60 * 60 == p.getEndtime().getTime()) {
|
|
|
@@ -2613,7 +2615,7 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
|
|
|
}
|
|
|
|
|
|
List<DeptStatistic> deptStatistics = checkDeptStatisticsDao.selectdepts(obj);
|
|
|
- if(deptStatistics.size()<1) return null;
|
|
|
+ if(deptStatistics.size()<1){return null;}
|
|
|
Map<String,List<DeptStatistic>> listMap = new HashMap<>();
|
|
|
Map<Long,List<DeptStatistic>> listMap1 = new HashMap<>();
|
|
|
for (DeptStatistic s :deptStatistics
|
|
|
@@ -2661,11 +2663,11 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
|
|
|
s+=ss.getIntegral();
|
|
|
}
|
|
|
}
|
|
|
- SimpleDateFormat ff = new SimpleDateFormat("yyyy-MM");
|
|
|
+
|
|
|
//赋值
|
|
|
for (DeptStatistic ss:deptStatistics1
|
|
|
) {
|
|
|
- if(ss.getPeriod_id()==p.getId()){
|
|
|
+ if(ss.getPeriod_id().equals(p.getId())){
|
|
|
ss.setTotal_integral(s);
|
|
|
ss.setDept_name(CacheUtil.getOrgannameFromMap(ss.getDept_id()));
|
|
|
ss.setTime(ff.format(p.getEndtime()));
|
|
|
@@ -2713,8 +2715,78 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
|
|
|
listMap.put(l.get(0).getDept_id()+"",l);
|
|
|
}
|
|
|
|
|
|
- return listMap;
|
|
|
+ if(obj.getType()!=null && obj.getType().equals(1)){
|
|
|
+ //excel数据
|
|
|
+ for (CheckTaskPeriod p :checkTaskPeriods) {
|
|
|
+ if (p.getId() >= obj.getStartperiod_id() && p.getId() <= obj.getEndperiod_id()) {
|
|
|
+ //符合要求的周期 计算得分
|
|
|
+ for (String i :listMap.keySet()
|
|
|
+ ) {
|
|
|
+ //单个部门的
|
|
|
+ List<DeptStatistic> l = listMap.get(i);
|
|
|
+ DeptStatistic temp = null;
|
|
|
+ if(l.size()<1){continue;}
|
|
|
+ boolean isin = false;
|
|
|
+ for (DeptStatistic s:l
|
|
|
+ ) {
|
|
|
+ if(s.getPeriod_id().equals(p.getId())){
|
|
|
+ isin = true;
|
|
|
+ temp = s;break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //不在里面
|
|
|
+ if(!isin){
|
|
|
+ DeptStatistic s = l.get(0).clone();
|
|
|
+ s.setScore((double)-1);
|
|
|
+ s.setPeriod_id(p.getId());
|
|
|
+ s.setIntegral(-1);
|
|
|
+ s.setTotal_integral(-1);
|
|
|
+ s.setTotal_ranking(-1);
|
|
|
+ temp = s;
|
|
|
+ l.add(s);
|
|
|
+ }
|
|
|
+
|
|
|
+ temp.setMString(ff1.format(p.getEndtime()));
|
|
|
+ listMap.put(i,l);
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //再次排序
|
|
|
+ for (String s:listMap.keySet()
|
|
|
+ ) {
|
|
|
+ List<DeptStatistic> l = listMap.get(s);
|
|
|
+ l.sort(new Comparator<DeptStatistic>() {
|
|
|
+ @Override
|
|
|
+ public int compare(DeptStatistic o1, DeptStatistic o2) {
|
|
|
+ return o1.getPeriod_id()> o2.getPeriod_id()?1:-1;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ listMap.put(l.get(0).getDept_id()+"",l);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ return listMap;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public void getDeptStatisticExcel(DeptStatistic obj,HttpServletRequest req,HttpServletResponse resp) {
|
|
|
+ obj.setType(1);
|
|
|
+ Map<String, List<DeptStatistic>> listMap = this.getDeptStatistic(obj);
|
|
|
+ SimpleDateFormat d = new SimpleDateFormat("yyyy/MM");
|
|
|
+ List<Integer> temp = new ArrayList<>();
|
|
|
+ for(int i=1;i<=listMap.keySet().size();i++){
|
|
|
+ temp.add(i);
|
|
|
+ }
|
|
|
+
|
|
|
+ Map<String, Object> map = new HashMap<String, Object>();
|
|
|
+ map.put("datas", listMap);
|
|
|
+ map.put("list", temp);
|
|
|
+ map.put("title","营运管理提升综合成绩汇总表"+"("+d.format(obj.getStart_date())+"---"+d.format(obj.getEnd_date())+")");
|
|
|
+ exportExcel("营运管理提升综合成绩汇总表", "dept_statistic", map, resp);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
}
|