|
|
@@ -24,6 +24,7 @@ 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;
|
|
|
@@ -83,7 +84,9 @@ 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());
|
|
|
+// 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_total_score(company_bean.getAll_check_score());
|
|
|
}
|
|
|
for (FwqStatisticsBean third_bean : third_beans) {
|
|
|
@@ -101,20 +104,24 @@ 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) {
|
|
|
- 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();
|
|
|
+ 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;
|
|
|
}
|
|
|
+// 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>() {
|
|
|
@@ -158,6 +165,7 @@ 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());
|
|
|
@@ -406,11 +414,15 @@ public class StatisticsServiceImpl implements StatisticsService_F {
|
|
|
|
|
|
// 处理同一个服务区中,如果item的parent_id是一样的话,将这些数据结合在一起
|
|
|
for (FwqStatisticsBean sta : listCheckedScore) {
|
|
|
- sta.setItem_id(itemMap.get(sta.getCheck_item_id().longValue()).getParent_id().intValue());
|
|
|
+ Item item = itemMap.get(sta.getCheck_item_id().longValue());
|
|
|
+ if (item != null) {
|
|
|
+ sta.setItem_id(item.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().equals(listCheckedScore.get(i).getDept_id()) && listCheckedScore.get(j).getItem_id().equals(listCheckedScore.get(i).getItem_id())) {
|
|
|
+ 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())) {
|
|
|
listCheckedScore.get(i).setScore(listCheckedScore.get(i).getScore() + listCheckedScore.get(j).getScore());
|
|
|
listCheckedScore.remove(j);
|
|
|
}
|
|
|
@@ -476,8 +488,13 @@ public class StatisticsServiceImpl implements StatisticsService_F {
|
|
|
@Override
|
|
|
public FwqRankingData getEmployeeRankingData(FwqStatisticsBean obj) {
|
|
|
FwqRankingData data = new FwqRankingData();
|
|
|
-
|
|
|
- CheckTaskPeriod lastTaskPeriod = commonService.getCheckTaskPeriod(obj.getStart_date().getTime()+1 * 1000 * 60 * 60, obj.getEnd_date().getTime()+1 * 1000 * 60 * 60);
|
|
|
+ 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);
|
|
|
if (lastTaskPeriod != null) {
|
|
|
FwqStatisticsBean temp = new FwqStatisticsBean();
|
|
|
temp.setStart_date(new Date(lastTaskPeriod.getStarttime().getTime() - 1 * 1000 * 60 * 60));
|
|
|
@@ -606,11 +623,14 @@ public class StatisticsServiceImpl implements StatisticsService_F {
|
|
|
Map<Long, Organ> deptMap = commonService.getDeptMap();
|
|
|
// 将list中的数据找到项目的父项目,然后去除重复的
|
|
|
for (FwqStatisticsBean sta : list) {
|
|
|
- sta.setItem_id(itemMap.get(sta.getCheck_item_id().longValue()).getParent_id().intValue());
|
|
|
+ Item item = itemMap.get(sta.getCheck_item_id().longValue());
|
|
|
+ if (item != null) {
|
|
|
+ sta.setItem_id(item.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().equals(list.get(i).getItem_id())) {
|
|
|
+ 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())) {
|
|
|
list.get(i).setScore(list.get(i).getScore() + list.get(j).getScore());
|
|
|
list.remove(j);
|
|
|
}
|
|
|
@@ -643,7 +663,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()).getParent_id() != null) {
|
|
|
+ if (itemMap.get(statisticsBean.getCheck_item_id().longValue()) != null && 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());
|
|
|
@@ -990,15 +1010,18 @@ public class StatisticsServiceImpl implements StatisticsService_F {
|
|
|
objList = fwqStatisticsDao.selectCheckedItemScoreInfo(obj);
|
|
|
|
|
|
for (FwqStatisticsBean sta : objList) {
|
|
|
- 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());
|
|
|
+ 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.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().equals(objList.get(i).getDept_id()) && objList.get(j).getItem_id().equals(objList.get(i).getItem_id())) {
|
|
|
+ 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())) {
|
|
|
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);
|