|
|
@@ -23,6 +23,7 @@ import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import com.xintong.visualinspection.bean.FeeStation;
|
|
|
import com.xintong.visualinspection.bean.Organ;
|
|
|
import com.xintong.visualinspection.bean.StatisticsBean;
|
|
|
import com.xintong.visualinspection.bean.StatisticsBo;
|
|
|
@@ -412,6 +413,7 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
@Override
|
|
|
public List<StatisticsBean> getYearScoreChange(StatisticsBean obj) {
|
|
|
// 导管中心
|
|
|
@@ -427,4 +429,141 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
|
|
|
List<StatisticsBean> lists = statisticsDao.selectYearScoreInfo(obj);
|
|
|
return lists;
|
|
|
}
|
|
|
+
|
|
|
+ private List<StatisticsBean> reFeeStationScoreInfo(StatisticsBean obj){
|
|
|
+ List<StatisticsBean> scoreList = statisticsDao.selectFeeStationScoreInfo(obj);
|
|
|
+ Map<Long,FeeStation> feeStationMap = new HashMap<>();
|
|
|
+ // 获取所有的收费站
|
|
|
+ List<FeeStation> feeList = departmentDao.getAllFS();
|
|
|
+ for(FeeStation feeObj : feeList){
|
|
|
+ if(!feeStationMap.containsKey(feeObj.getDeptid())){
|
|
|
+ feeStationMap.put(Long.parseLong(feeObj.getDeptid()) , feeObj);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 需要补充的
|
|
|
+ List<StatisticsBean> reList = new ArrayList<>();
|
|
|
+
|
|
|
+ for(StatisticsBean sta:scoreList){
|
|
|
+ if(feeStationMap.containsKey(sta.getDept_id())){
|
|
|
+ sta.setFeeStationName(feeStationMap.get(sta.getDept_id()).getName());
|
|
|
+ }else{
|
|
|
+ StatisticsBean e = new StatisticsBean();
|
|
|
+ e.setAll_check_score(0);
|
|
|
+ e.setChecked_num(0);
|
|
|
+ e.setFeeStationName(feeStationMap.get(sta.getDept_id()).getName());
|
|
|
+ reList.add(e);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ scoreList.addAll(reList);
|
|
|
+ return scoreList;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 检索公司收费站的排名
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public List<StatisticsBean> getFeeStationScoreInfo(StatisticsBean obj) {
|
|
|
+ List<StatisticsBean> scoreList = reFeeStationScoreInfo(obj);
|
|
|
+
|
|
|
+ scoreList.sort(new Comparator<StatisticsBean>() {
|
|
|
+ @Override
|
|
|
+ public int compare(StatisticsBean o1, StatisticsBean o2) {
|
|
|
+ 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;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ return scoreList;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 检索某个导管中心下的收费站排名
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public List<StatisticsBean> getSingleFeeStationScoreInfo(StatisticsBean obj) {
|
|
|
+ List<StatisticsBean> resultList = new ArrayList<>();
|
|
|
+
|
|
|
+ List<StatisticsBean> scoreList = reFeeStationScoreInfo(obj);
|
|
|
+ Map<Long,StatisticsBean> centerManageMap = new HashMap<>();
|
|
|
+ for(StatisticsBean sta : scoreList){
|
|
|
+ if(! centerManageMap.containsKey(sta.getDept_id())){
|
|
|
+ centerManageMap.put(sta.getDept_id(), sta);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ Organ organ =new Organ();
|
|
|
+ organ.setParentid(obj.getDept_id().intValue());
|
|
|
+ List<Organ> list = departmentDao.getOrgan(organ);
|
|
|
+
|
|
|
+ for(Organ org : list){
|
|
|
+ if(centerManageMap.containsKey( org.getId()+0L)){
|
|
|
+ resultList.add(centerManageMap.get(org.getId()+0L));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return resultList;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 检索导管中心排名和数据
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public List<StatisticsBean> getCenterManageScoreInfo(StatisticsBean obj) {
|
|
|
+
|
|
|
+ // 导管中心
|
|
|
+ List<StatisticsBean> centerManageList = new ArrayList<>();
|
|
|
+ for(int i=0;i<3;i++){
|
|
|
+ StatisticsBean e =new StatisticsBean();
|
|
|
+ centerManageList.add(e);
|
|
|
+ }
|
|
|
+
|
|
|
+ List<StatisticsBean> scoreList = reFeeStationScoreInfo(obj);
|
|
|
+ Map<Long,StatisticsBean> centerManageMap = new HashMap<>();
|
|
|
+ for(StatisticsBean sta : scoreList){
|
|
|
+ if(! centerManageMap.containsKey(sta.getDept_id())){
|
|
|
+ centerManageMap.put(sta.getDept_id(), sta);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ List<StatisticsBean> lists = departmentDao.selectFeeStationGroup(obj);
|
|
|
+ int i = 0;
|
|
|
+ for (StatisticsBean sta : lists) {
|
|
|
+ if (i < 7) {
|
|
|
+ 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 (i < 13) {
|
|
|
+ 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 {
|
|
|
+ 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("南通");
|
|
|
+ }
|
|
|
+ i++ ;
|
|
|
+ }
|
|
|
+
|
|
|
+ return centerManageList;
|
|
|
+ }
|
|
|
}
|