|
|
@@ -24,7 +24,6 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import java.text.DecimalFormat;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.ArrayList;
|
|
|
-import java.util.Calendar;
|
|
|
import java.util.Comparator;
|
|
|
import java.util.Date;
|
|
|
import java.util.HashMap;
|
|
|
@@ -84,9 +83,7 @@ public class StatisticsServiceImpl implements StatisticsService_F {
|
|
|
List<FwqStatisticsBean> onsite_beans = fwqStatisticsDao.getselectFeeStationOperationScoreDetail(obj);
|
|
|
|
|
|
for (FwqStatisticsBean company_bean : company_beans) {
|
|
|
-// mapStationInfos.get(company_bean.getDept_id()).setCompany_check_num(company_bean.getChecked_num());
|
|
|
- // 公司稽查固定15次稽查
|
|
|
- mapStationInfos.get(company_bean.getDept_id()).setCompany_check_num(15);
|
|
|
+ mapStationInfos.get(company_bean.getDept_id()).setCompany_check_num(company_bean.getChecked_num());
|
|
|
mapStationInfos.get(company_bean.getDept_id()).setCompany_total_score(company_bean.getAll_check_score());
|
|
|
}
|
|
|
for (FwqStatisticsBean third_bean : third_beans) {
|
|
|
@@ -104,24 +101,20 @@ public class StatisticsServiceImpl implements StatisticsService_F {
|
|
|
DecimalFormat df = new DecimalFormat("0.00");
|
|
|
for (Map.Entry<Long, FwqStatisticsBean> station : stationInfos) {
|
|
|
float avg = 0;
|
|
|
- float avgWxfw = 0;
|
|
|
FwqStatisticsBean value = station.getValue();
|
|
|
value.setThird_check_num(1);
|
|
|
value.setOnsite_check_num(1);
|
|
|
// 设置总平均扣分
|
|
|
if (value.getCompany_check_num() > 0 || value.getThird_check_num() > 0) {
|
|
|
- avgWxfw += value.getCompany_total_score() / 15.0;
|
|
|
- avg += value.getCompany_total_score() / 15.0 * 0.3 + value.getThird_total_score() * 0.4 + value.getOnsite_total_score() * 0.3;
|
|
|
+ avg += (value.getCompany_total_score() + value.getThird_total_score()) / 2.0 / (value.getCompany_check_num() + value.getThird_check_num());
|
|
|
+ }
|
|
|
+ if (value.getOnsite_check_num() > 0) {
|
|
|
+ avg += value.getOnsite_total_score() / 2.0 / value.getOnsite_check_num();
|
|
|
}
|
|
|
-// if (value.getOnsite_check_num() > 0) {
|
|
|
-// avg += value.getOnsite_total_score() / 2.0 / value.getOnsite_check_num();
|
|
|
-// }
|
|
|
value.setCheck_total_avg(df.format(avg));
|
|
|
// 设置平均得分
|
|
|
Float score_avg = (1000 - Float.valueOf(df.format(avg)));
|
|
|
- Float score_wxfw_avg = (1000-Float.valueOf(df.format(avgWxfw)));
|
|
|
value.setScore_avg(score_avg.toString());
|
|
|
- value.setScore_wxfw_avg(score_wxfw_avg.toString());
|
|
|
}
|
|
|
List<FwqStatisticsBean> sortList = new ArrayList<>(mapStationInfos.values());
|
|
|
sortList.sort(new Comparator<FwqStatisticsBean>() {
|
|
|
@@ -165,7 +158,6 @@ public class StatisticsServiceImpl implements StatisticsService_F {
|
|
|
for (FwqStatisticsBean s : sortList) {
|
|
|
FwqDeptStatistic ss = new FwqDeptStatistic();
|
|
|
ss.setScore(Double.parseDouble(s.getScore_avg()));
|
|
|
- ss.setScoreWxfw(Double.parseDouble(s.getScore_wxfw_avg()));
|
|
|
ss.setIntegral(sortList.size() - s.getCompany_ranking2() + 1);
|
|
|
ss.setDept_id(s.getDept_id());
|
|
|
ss.setPeriod_id(period.getId());
|
|
|
@@ -414,15 +406,11 @@ public class StatisticsServiceImpl implements StatisticsService_F {
|
|
|
|
|
|
// 处理同一个服务区中,如果item的parent_id是一样的话,将这些数据结合在一起
|
|
|
for (FwqStatisticsBean sta : listCheckedScore) {
|
|
|
- Item item = itemMap.get(sta.getCheck_item_id().longValue());
|
|
|
- if (item != null) {
|
|
|
- sta.setItem_id(item.getParent_id().intValue());
|
|
|
- }
|
|
|
+ sta.setItem_id(itemMap.get(sta.getCheck_item_id().longValue()).getParent_id().intValue());
|
|
|
}
|
|
|
for (int i = 0; i < listCheckedScore.size(); i++) {
|
|
|
for (int j = listCheckedScore.size() - 1; j > i; j--) {
|
|
|
- if (listCheckedScore.get(j).getDept_id() != null && listCheckedScore.get(j).getDept_id().equals(listCheckedScore.get(i).getDept_id()) && listCheckedScore.get(j).getItem_id() != null && listCheckedScore.get(j).getItem_id().equals
|
|
|
- (listCheckedScore.get(i).getItem_id())) {
|
|
|
+ if (listCheckedScore.get(j).getDept_id().equals(listCheckedScore.get(i).getDept_id()) && listCheckedScore.get(j).getItem_id().equals(listCheckedScore.get(i).getItem_id())) {
|
|
|
listCheckedScore.get(i).setScore(listCheckedScore.get(i).getScore() + listCheckedScore.get(j).getScore());
|
|
|
listCheckedScore.remove(j);
|
|
|
}
|
|
|
@@ -488,13 +476,8 @@ public class StatisticsServiceImpl implements StatisticsService_F {
|
|
|
@Override
|
|
|
public FwqRankingData getEmployeeRankingData(FwqStatisticsBean obj) {
|
|
|
FwqRankingData data = new FwqRankingData();
|
|
|
- Calendar cal = Calendar.getInstance();
|
|
|
- cal.setTime(obj.getStart_date());
|
|
|
- cal.add(Calendar.MONTH, -1);
|
|
|
- Calendar cal2 = Calendar.getInstance();
|
|
|
- cal2.setTime(obj.getEnd_date());
|
|
|
- cal2.add(Calendar.MONTH, -1);
|
|
|
- CheckTaskPeriod lastTaskPeriod = commonService.getCheckTaskPeriod(cal.getTime().getTime()+1 * 1000 * 60 * 60, cal2.getTime().getTime()+1 * 1000 * 60 * 60);
|
|
|
+
|
|
|
+ CheckTaskPeriod lastTaskPeriod = commonService.getCheckTaskPeriod(obj.getStart_date().getTime()+1 * 1000 * 60 * 60, obj.getEnd_date().getTime()+1 * 1000 * 60 * 60);
|
|
|
if (lastTaskPeriod != null) {
|
|
|
FwqStatisticsBean temp = new FwqStatisticsBean();
|
|
|
temp.setStart_date(new Date(lastTaskPeriod.getStarttime().getTime() - 1 * 1000 * 60 * 60));
|
|
|
@@ -623,14 +606,11 @@ public class StatisticsServiceImpl implements StatisticsService_F {
|
|
|
Map<Long, Organ> deptMap = commonService.getDeptMap();
|
|
|
// 将list中的数据找到项目的父项目,然后去除重复的
|
|
|
for (FwqStatisticsBean sta : list) {
|
|
|
- Item item = itemMap.get(sta.getCheck_item_id().longValue());
|
|
|
- if (item != null) {
|
|
|
- sta.setItem_id(item.getParent_id().intValue());
|
|
|
- }
|
|
|
+ sta.setItem_id(itemMap.get(sta.getCheck_item_id().longValue()).getParent_id().intValue());
|
|
|
}
|
|
|
for (int i = 0; i < list.size(); i++) {
|
|
|
for (int j = list.size() - 1; j > i; j--) {
|
|
|
- if (list.get(j).getDept_id().equals(list.get(i).getDept_id()) && list.get(j).getItem_id() != null && list.get(j).getItem_id().equals(list.get(i).getItem_id())) {
|
|
|
+ if (list.get(j).getDept_id().equals(list.get(i).getDept_id()) && list.get(j).getItem_id().equals(list.get(i).getItem_id())) {
|
|
|
list.get(i).setScore(list.get(i).getScore() + list.get(j).getScore());
|
|
|
list.remove(j);
|
|
|
}
|
|
|
@@ -663,7 +643,7 @@ public class StatisticsServiceImpl implements StatisticsService_F {
|
|
|
if (statisticBoMap.containsKey(statisticsBean.getDept_id())) {
|
|
|
FwqStatisticsBo tmp = statisticBoMap.get(statisticsBean.getDept_id());
|
|
|
// 组装扣分类型内容
|
|
|
- if (itemMap.get(statisticsBean.getCheck_item_id().longValue()) != null && itemMap.get(statisticsBean.getCheck_item_id().longValue()).getParent_id() != null) {
|
|
|
+ if (itemMap.get(statisticsBean.getCheck_item_id().longValue()).getParent_id() != null) {
|
|
|
statisticsBean.setId(itemMap.get(statisticsBean.getCheck_item_id().longValue()).getParent_id().intValue());
|
|
|
if (itemMap.get(statisticsBean.getCheck_item_id().longValue()).getScore() == null) {
|
|
|
statisticsBean.setName(itemMap.get(statisticsBean.getCheck_item_id().longValue()).getName());
|
|
|
@@ -790,15 +770,14 @@ public class StatisticsServiceImpl implements StatisticsService_F {
|
|
|
FwqStatisticsBean obj2 = new FwqStatisticsBean();
|
|
|
obj2.setDept_id(Long.valueOf(sta.getDeptid()));
|
|
|
obj2.setName(sta.getName());
|
|
|
-// // 30:连云港道管;31:盐城道管;32:南通道管
|
|
|
-// if ("30".equals(sta.getParentid())) {
|
|
|
-// obj2.setId(1);
|
|
|
-// } else if ("31".equals(sta.getParentid())) {
|
|
|
-// obj2.setId(2);
|
|
|
-// } else if ("32".equals(sta.getParentid())) {
|
|
|
-// obj2.setId(3);
|
|
|
-// }
|
|
|
- obj2.setChecked_num(15);
|
|
|
+ // 30:连云港道管;31:盐城道管;32:南通道管
|
|
|
+ if ("30".equals(sta.getParentid())) {
|
|
|
+ obj2.setId(1);
|
|
|
+ } else if ("31".equals(sta.getParentid())) {
|
|
|
+ obj2.setId(2);
|
|
|
+ } else if ("32".equals(sta.getParentid())) {
|
|
|
+ obj2.setId(3);
|
|
|
+ }
|
|
|
mapStationInfos.put(Long.valueOf(sta.getDeptid()), obj2);
|
|
|
}
|
|
|
|
|
|
@@ -809,13 +788,13 @@ public class StatisticsServiceImpl implements StatisticsService_F {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- // 检查次数 此处注释是为了统一每个服务区的检查次数都是15次
|
|
|
-// List<FwqStatisticsBean> listCheckNum = fwqStatisticsDao.selectFeeStationCheckNum(obj);
|
|
|
-// for (FwqStatisticsBean sta : listCheckNum) {
|
|
|
-// if (mapStationInfos.containsKey(sta.getDept_id())) {
|
|
|
-// mapStationInfos.get(sta.getDept_id()).setChecked_num(sta.getChecked_num());
|
|
|
-// }
|
|
|
-// }
|
|
|
+ // 检查次数
|
|
|
+ List<FwqStatisticsBean> listCheckNum = fwqStatisticsDao.selectFeeStationCheckNum(obj);
|
|
|
+ for (FwqStatisticsBean sta : listCheckNum) {
|
|
|
+ if (mapStationInfos.containsKey(sta.getDept_id())) {
|
|
|
+ mapStationInfos.get(sta.getDept_id()).setChecked_num(sta.getChecked_num());
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
List<FwqStatisticsBo> list = getEmployeeCheckedInfo(obj);
|
|
|
Map<Integer, FwqStatisticsBo> listmap = new HashMap<>();
|
|
|
@@ -850,36 +829,36 @@ public class StatisticsServiceImpl implements StatisticsService_F {
|
|
|
|
|
|
List<FwqStatisticsBean> sortList = new ArrayList<>(mapStationInfos.values());
|
|
|
|
|
|
-// sortList.sort(new Comparator<FwqStatisticsBean>() {
|
|
|
-// @Override
|
|
|
-// public int compare(FwqStatisticsBean o1, FwqStatisticsBean o2) {
|
|
|
-// if (o1.getId() > o2.getId()) {
|
|
|
-// return 1;
|
|
|
-// } else if (o1.getId().equals(o2.getId())) {
|
|
|
-// if (o1.getChecked_num() != 0 && o2.getChecked_num() != 0) {
|
|
|
-// if (o1.getAll_check_score() / (o1.getChecked_num() + 0.0) > o2.getAll_check_score()
|
|
|
-// / (o2.getChecked_num() + 0.0)) {
|
|
|
-// return 1;
|
|
|
-// } else if (o1.getAll_check_score() / (o1.getChecked_num() + 0.0) < o2.getAll_check_score()
|
|
|
-// / (o2.getChecked_num() + 0.0)) {
|
|
|
-// return -1;
|
|
|
-// } else {
|
|
|
-// return 0;
|
|
|
-// }
|
|
|
-// } else {
|
|
|
-// if (o1.getChecked_num() == 0) {
|
|
|
-// return -1;
|
|
|
-// } else if (o2.getChecked_num() == 0) {
|
|
|
-// return 1;
|
|
|
-// } else {
|
|
|
-// return 0;
|
|
|
-// }
|
|
|
-// }
|
|
|
-// } else {
|
|
|
-// return -1;
|
|
|
-// }
|
|
|
-// }
|
|
|
-// });
|
|
|
+ sortList.sort(new Comparator<FwqStatisticsBean>() {
|
|
|
+ @Override
|
|
|
+ public int compare(FwqStatisticsBean o1, FwqStatisticsBean o2) {
|
|
|
+ if (o1.getId() > o2.getId()) {
|
|
|
+ return 1;
|
|
|
+ } else if (o1.getId().equals(o2.getId())) {
|
|
|
+ if (o1.getChecked_num() != 0 && o2.getChecked_num() != 0) {
|
|
|
+ if (o1.getAll_check_score() / (o1.getChecked_num() + 0.0) > o2.getAll_check_score()
|
|
|
+ / (o2.getChecked_num() + 0.0)) {
|
|
|
+ return 1;
|
|
|
+ } else if (o1.getAll_check_score() / (o1.getChecked_num() + 0.0) < o2.getAll_check_score()
|
|
|
+ / (o2.getChecked_num() + 0.0)) {
|
|
|
+ return -1;
|
|
|
+ } else {
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (o1.getChecked_num() == 0) {
|
|
|
+ return -1;
|
|
|
+ } else if (o2.getChecked_num() == 0) {
|
|
|
+ return 1;
|
|
|
+ } else {
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
|
|
|
return sortList;
|
|
|
}
|
|
|
@@ -1011,18 +990,15 @@ public class StatisticsServiceImpl implements StatisticsService_F {
|
|
|
objList = fwqStatisticsDao.selectCheckedItemScoreInfo(obj);
|
|
|
|
|
|
for (FwqStatisticsBean sta : objList) {
|
|
|
- Item item = itemMap.get(sta.getCheck_item_id().longValue());
|
|
|
- if (item != null) {
|
|
|
- sta.setItem_id(item.getParent_id().intValue());
|
|
|
- sta.setName(itemMap.get(item.getParent_id()).getName());
|
|
|
- }
|
|
|
+ sta.setItem_id(itemMap.get(sta.getCheck_item_id().longValue()).getParent_id().intValue());
|
|
|
+ sta.setName(itemMap.get(itemMap.get(sta.getCheck_item_id().longValue()).getParent_id()).getName());
|
|
|
sta.setFeeStationName(deptMap.get(sta.getDept_id()).getOrganname());
|
|
|
sta.setPfeeStationName(deptMap.get(deptMap.get(sta.getDept_id()).getParentid().longValue()).getOrganname());
|
|
|
sta.setParent_dept_id(deptMap.get(sta.getDept_id()).getParentid().longValue());
|
|
|
}
|
|
|
for (int i = 0; i < objList.size(); i++) {
|
|
|
for (int j = objList.size() - 1; j > i; j--) {
|
|
|
- if (objList.get(j).getDept_id() != null && objList.get(j).getDept_id().equals(objList.get(i).getDept_id()) && objList.get(j).getItem_id() != null && objList.get(j).getItem_id().equals(objList.get(i).getItem_id())) {
|
|
|
+ if (objList.get(j).getDept_id().equals(objList.get(i).getDept_id()) && objList.get(j).getItem_id().equals(objList.get(i).getItem_id())) {
|
|
|
objList.get(i).setAll_check_score(objList.get(i).getAll_check_score() + objList.get(j).getAll_check_score());
|
|
|
objList.get(i).setChecked_num(objList.get(i).getChecked_num() + objList.get(j).getChecked_num());
|
|
|
objList.remove(j);
|