|
|
@@ -33,7 +33,7 @@ import java.util.Set;
|
|
|
* 文件名:StatisticsServiceImpl
|
|
|
* 版本信息:日期:2017/4/7 Copyright 江苏省交通规划设计院 Corporation 2017 版权所有.
|
|
|
*
|
|
|
- * @author wenhongquan
|
|
|
+ * @author huangcheng
|
|
|
* @date 2018/05/02
|
|
|
*/
|
|
|
|
|
|
@@ -599,7 +599,7 @@ public class StatisticsServiceImpl implements StatisticsService_F {
|
|
|
}
|
|
|
|
|
|
// 查询服务区受检次数
|
|
|
- FwqStatisticsBean timesList = fwqStatisticsDao.selectCheckedTimes(obj);
|
|
|
+ List<FwqStatisticsBean> timesList = fwqStatisticsDao.selectCheckedTimes(obj);
|
|
|
|
|
|
Map<Long, FwqStatisticsBo> statisticBoMap = new HashMap<>();
|
|
|
|
|
|
@@ -638,9 +638,11 @@ public class StatisticsServiceImpl implements StatisticsService_F {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if (statisticBoMap.containsKey(timesList.getDept_id())) {
|
|
|
- FwqStatisticsBo tmp = statisticBoMap.get(timesList.getDept_id());
|
|
|
- tmp.setChecked_num(timesList.getChecked_num());
|
|
|
+ for (FwqStatisticsBean statisticsBean : timesList) {
|
|
|
+ if (statisticBoMap.containsKey(statisticsBean.getDept_id())) {
|
|
|
+ FwqStatisticsBo tmp = statisticBoMap.get(statisticsBean.getDept_id());
|
|
|
+ tmp.setChecked_num(statisticsBean.getChecked_num());
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
List<FwqStatisticsBo> lists = new ArrayList<>(statisticBoMap.values());
|
|
|
@@ -731,4 +733,322 @@ public class StatisticsServiceImpl implements StatisticsService_F {
|
|
|
|
|
|
return lists;
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<FwqStatisticsBean> getYearScoreChange(FwqStatisticsBean obj) {
|
|
|
+ // 道管中心
|
|
|
+// if (obj.getQueryType() != null && obj.getQueryType() == 1) {
|
|
|
+// // 检索当前导管中心下的deptid
|
|
|
+// Organ organ = new Organ();
|
|
|
+// if (obj.getDept_id() == null) {
|
|
|
+// return null;
|
|
|
+// }
|
|
|
+// organ.setParentid(obj.getDept_id().intValue());
|
|
|
+//
|
|
|
+// List<Organ> list = departmentDao.getOrgan(organ);
|
|
|
+// // 将导管中心下的收费站部门id 列表放入到list中
|
|
|
+// obj.setDept_list(list);
|
|
|
+// }
|
|
|
+
|
|
|
+ // Constant t = CodeUtil.getCodeByFlagAndValue("feestation_check_jobs",
|
|
|
+ // "1");
|
|
|
+ // String[] postions = t.getCode_name().split(",");
|
|
|
+ // List<Integer> positionList = new ArrayList<Integer>();
|
|
|
+ // for (int i = 0; i < postions.length; i++) {
|
|
|
+ // positionList.add(Integer.parseInt(postions[i]));
|
|
|
+ // }
|
|
|
+ // //未计算未扣分的稽查次数
|
|
|
+ // obj.setPosition_ids(positionList);
|
|
|
+ // List<StatisticsBean> listCheckNum =
|
|
|
+ // statisticsDao.selectFeeStationCheckNum(obj);
|
|
|
+
|
|
|
+ return fwqStatisticsDao.selectYearScoreInfo(obj);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<FwqStatisticsBean> getFeeStationCheckedScore(FwqStatisticsBean obj) {
|
|
|
+
|
|
|
+ Map<Long, FwqStatisticsBean> mapStationInfos = new HashMap<>();
|
|
|
+ // 获得所有服务区数据,将服务区数据保存在map中
|
|
|
+ List<FeeStation> saList = commonService.getAllDeptByLayer("SA");
|
|
|
+ for (FeeStation sta : saList) {
|
|
|
+ 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);
|
|
|
+ }
|
|
|
+ mapStationInfos.put(Long.valueOf(sta.getDeptid()), obj2);
|
|
|
+ }
|
|
|
+
|
|
|
+ if(obj.getStart_date()!=null && obj.getEnd_date()!=null){
|
|
|
+ CheckTaskPeriod p = commonService.getCheckTaskPeriod(obj.getStart_date().getTime(), obj.getEnd_date().getTime());
|
|
|
+ if(p!=null){
|
|
|
+ obj.setPeriod_id(p.getId());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 检查次数
|
|
|
+ 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<>();
|
|
|
+ for (FwqStatisticsBo b : list) {
|
|
|
+ listmap.put(b.getDept_id().intValue(), b);
|
|
|
+ }
|
|
|
+
|
|
|
+ List<FwqStatisticsBean> listCheckedScore = fwqStatisticsDao.selectFeeStationCheckedScore(obj);
|
|
|
+ for (FwqStatisticsBean sta : listCheckedScore) {
|
|
|
+ if (mapStationInfos.containsKey(sta.getDept_id())) {
|
|
|
+
|
|
|
+ FwqStatisticsBean statis = mapStationInfos.get(sta.getDept_id());
|
|
|
+ statis.setAll_check_score(statis.getAll_check_score() + sta.getScore());
|
|
|
+
|
|
|
+ FwqStatisticsBo b = listmap.get(sta.getDept_id().intValue());
|
|
|
+
|
|
|
+ if (b == null || b.getCheck_score_avg() == null) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ double sc = Double.parseDouble(b.getCheck_score_avg());
|
|
|
+ if (sc == 0) {
|
|
|
+ statis.setScore(statis.getScore() + 1);
|
|
|
+ } else if (sc <= 15) {
|
|
|
+ statis.setScore_fifteen(statis.getScore_fifteen() + 1);
|
|
|
+ } else if (sc <= 50) {
|
|
|
+ statis.setScore_fifty(statis.getScore_fifty() + 1);
|
|
|
+ } else {
|
|
|
+ statis.setScore_over_fifty(statis.getScore_over_fifty() + 1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ 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;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ return sortList;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<FwqStatisticsBean> getCenterManageScoreInfo(FwqStatisticsBean obj) {
|
|
|
+ // 道管中心
|
|
|
+ List<FwqStatisticsBean> centerManageList = new ArrayList<>();
|
|
|
+ for (int i = 0; i < 3; i++) {
|
|
|
+ FwqStatisticsBean e = new FwqStatisticsBean();
|
|
|
+ centerManageList.add(e);
|
|
|
+ }
|
|
|
+
|
|
|
+ List<FwqStatisticsBean> scoreList = reFeeStationScoreInfo(obj);
|
|
|
+ Map<Long, FwqStatisticsBean> centerManageMap = new HashMap<>();
|
|
|
+ for (FwqStatisticsBean sta : scoreList) {
|
|
|
+ if (!centerManageMap.containsKey(sta.getDept_id())) {
|
|
|
+ centerManageMap.put(sta.getDept_id(), sta);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 获取所有的服务区
|
|
|
+ List<FwqStatisticsBean> lists = new ArrayList<>();
|
|
|
+ List<FeeStation> saList = commonService.getAllDeptByLayer("SA");
|
|
|
+ for (FeeStation sta : saList) {
|
|
|
+ FwqStatisticsBean obj2 = new FwqStatisticsBean();
|
|
|
+ obj2.setDept_id(Long.valueOf(sta.getDeptid()));
|
|
|
+ obj2.setName(sta.getName());
|
|
|
+ obj2.setParent_dept_id(Long.valueOf(sta.getParentid()));
|
|
|
+ lists.add(obj2);
|
|
|
+ }
|
|
|
+
|
|
|
+ for (FwqStatisticsBean sta : lists) {
|
|
|
+ if (sta.getParent_dept_id() == 30) {
|
|
|
+ centerManageList.get(0).setAll_check_score(centerManageList.get(0).getAll_check_score()
|
|
|
+ + centerManageMap.get(sta.getDept_id()).getAll_check_score());
|
|
|
+ centerManageList.get(0).setChecked_num(centerManageList.get(0).getChecked_num()
|
|
|
+ + centerManageMap.get(sta.getDept_id()).getChecked_num());
|
|
|
+ centerManageList.get(0).setFeeStationName("连云港");
|
|
|
+ } else if (sta.getParent_dept_id() == 31) {
|
|
|
+ centerManageList.get(1).setAll_check_score(centerManageList.get(1).getAll_check_score()
|
|
|
+ + centerManageMap.get(sta.getDept_id()).getAll_check_score());
|
|
|
+ centerManageList.get(1).setChecked_num(centerManageList.get(1).getChecked_num()
|
|
|
+ + centerManageMap.get(sta.getDept_id()).getChecked_num());
|
|
|
+ centerManageList.get(1).setFeeStationName("盐城");
|
|
|
+ } else if (sta.getParent_dept_id() == 32){
|
|
|
+ centerManageList.get(2).setAll_check_score(centerManageList.get(2).getAll_check_score()
|
|
|
+ + centerManageMap.get(sta.getDept_id()).getAll_check_score());
|
|
|
+ centerManageList.get(2).setChecked_num(centerManageList.get(2).getChecked_num()
|
|
|
+ + centerManageMap.get(sta.getDept_id()).getChecked_num());
|
|
|
+ centerManageList.get(2).setFeeStationName("南通");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 进行排序
|
|
|
+ centerManageList.sort(new Comparator<FwqStatisticsBean>() {
|
|
|
+ @Override
|
|
|
+ public int compare(FwqStatisticsBean o1, FwqStatisticsBean o2) {
|
|
|
+ return o1.compareTo(o2);
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ return centerManageList;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<FwqStatisticsBean> getFeeStationScoreInfo(FwqStatisticsBean obj) {
|
|
|
+ List<FwqStatisticsBean> scoreList = reFeeStationScoreInfo(obj);
|
|
|
+
|
|
|
+ scoreList.sort(new Comparator<FwqStatisticsBean>() {
|
|
|
+ @Override
|
|
|
+ public int compare(FwqStatisticsBean o1, FwqStatisticsBean o2) {
|
|
|
+ return o1.compareTo(o2);
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ return scoreList;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<FwqStatisticsBean> getCheckedItemScoreInfo(FwqStatisticsBean obj) {
|
|
|
+ List<FwqStatisticsBean> list = fwqStatisticsDao.selectCheckedItemScoreInfo(obj);
|
|
|
+ Map<Long, Item> itemMap = commonService.getItemMap();
|
|
|
+ Map<Long, Organ> deptMap = commonService.getDeptMap();
|
|
|
+ for (FwqStatisticsBean sta : list) {
|
|
|
+ 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.setParent_dept_id(deptMap.get(sta.getDept_id()).getParentid().longValue());
|
|
|
+ }
|
|
|
+ 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())) {
|
|
|
+ list.get(i).setAll_check_score(list.get(i).getAll_check_score() + list.get(j).getAll_check_score());
|
|
|
+ list.get(i).setChecked_num(list.get(i).getChecked_num() + list.get(j).getChecked_num());
|
|
|
+ list.remove(j);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return list;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Map<String, List<FwqStatisticsBean>> get2CheckedItemScoreInfo(FwqStatisticsBean obj) {
|
|
|
+
|
|
|
+ Map<String, List<FwqStatisticsBean>> map = new HashMap<>();
|
|
|
+ List<FwqStatisticsBean> objList = fwqStatisticsDao.selectCheckedItemScoreInfo(obj);
|
|
|
+ Map<Long, Item> itemMap = commonService.getItemMap();
|
|
|
+ Map<Long, Organ> deptMap = commonService.getDeptMap();
|
|
|
+ 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());
|
|
|
+ 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())) {
|
|
|
+ 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);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ map.put("Tmth", objList);
|
|
|
+ obj.setMth(obj.getPrev_mth());
|
|
|
+ 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());
|
|
|
+ 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())) {
|
|
|
+ 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);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ map.put("Pmth", objList);
|
|
|
+
|
|
|
+ return map;
|
|
|
+ }
|
|
|
+
|
|
|
+ private List<FwqStatisticsBean> reFeeStationScoreInfo(FwqStatisticsBean obj) {
|
|
|
+ List<FwqStatisticsBean> scoreList = fwqStatisticsDao.selectFeeStationScoreInfo(obj);
|
|
|
+ Map<Long, FwqStatisticsBean> feeStationMap = new HashMap<>();
|
|
|
+
|
|
|
+ for (FwqStatisticsBean feeObj : scoreList) {
|
|
|
+ if (!feeStationMap.containsKey(feeObj.getDept_id())) {
|
|
|
+ feeStationMap.put(feeObj.getDept_id(), feeObj);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 需要补充的
|
|
|
+ List<FwqStatisticsBean> reList = new ArrayList<>();
|
|
|
+
|
|
|
+ // 获取所有的服务区
|
|
|
+ List<FwqStatisticsBean> feeStationList = new ArrayList<>();
|
|
|
+ List<FeeStation> saList = commonService.getAllDeptByLayer("SA");
|
|
|
+ for (FeeStation sta : saList) {
|
|
|
+ FwqStatisticsBean obj2 = new FwqStatisticsBean();
|
|
|
+ obj2.setDept_id(Long.valueOf(sta.getDeptid()));
|
|
|
+ obj2.setName(sta.getName());
|
|
|
+ feeStationList.add(obj2);
|
|
|
+ }
|
|
|
+ for (FwqStatisticsBean sta : feeStationList) {
|
|
|
+ if (feeStationMap.containsKey(sta.getDept_id())) {
|
|
|
+ feeStationMap.get(sta.getDept_id()).setFeeStationName(sta.getName());
|
|
|
+ } else {
|
|
|
+ sta.setAll_check_score(0);
|
|
|
+ sta.setChecked_num(0);
|
|
|
+ sta.setFeeStationName(sta.getName());
|
|
|
+ reList.add(sta);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ scoreList.addAll(reList);
|
|
|
+ return scoreList;
|
|
|
+ }
|
|
|
}
|