|
|
@@ -75,8 +75,7 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
|
|
|
for(int i =0 ;i<postions.length;i++){
|
|
|
positionList.add(Integer.parseInt(postions[i]));
|
|
|
}
|
|
|
-// positionList.add(1);
|
|
|
-// positionList.add(6);
|
|
|
+
|
|
|
user.setPosition_ids(positionList);
|
|
|
|
|
|
if (obj.getDept_id() != null)
|
|
|
@@ -739,5 +738,104 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
|
|
|
return map;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 道管中心或者收费站考核排名
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public List<StatisticsBean> getPersonalScoreInfo(StatisticsBean obj) {
|
|
|
+
|
|
|
+ if(obj.getQueryType() == 1){
|
|
|
+ // 道管中心
|
|
|
+ Organ organ =new Organ();
|
|
|
+ organ.setParentid(obj.getDept_id().intValue());
|
|
|
+ List<Organ> list = departmentDao.getOrgan(organ);
|
|
|
+ // 将导管中心下的收费站部门id 列表放入到list中
|
|
|
+ obj.setDept_list(list);
|
|
|
+ }
|
|
|
+
|
|
|
+ List<StatisticsBean> userLostScoreInfoList = statisticsDao.selectCheckedScoreList(obj);
|
|
|
+
|
|
|
+ Map<Long, StatisticsBean> statisticBoMap = new HashMap<Long, StatisticsBean>();
|
|
|
+
|
|
|
+ Constant t = CodeUtil.getCodeByFlagAndValue("feestation_check_jobs", "1");
|
|
|
+
|
|
|
+ String[] postions = t.getCode_name().split(",");
|
|
|
+
|
|
|
+ User user = new User();
|
|
|
+ List<Integer> positionList = new ArrayList<Integer>();
|
|
|
+ for(int i =0 ;i<postions.length;i++){
|
|
|
+ positionList.add(Integer.parseInt(postions[i]));
|
|
|
+ }
|
|
|
+ user.setPosition_ids(positionList);
|
|
|
+ if (obj.getQueryType() ==2 && obj.getDept_id() != null){
|
|
|
+ user.setOrganid(obj.getDept_id().intValue());
|
|
|
+ }else if(obj.getQueryType() ==1){
|
|
|
+ // 当前为道管的时候,部门id
|
|
|
+ user.setParent_organid(obj.getDept_id().intValue());
|
|
|
+ }
|
|
|
+ List<User> listUserts = userInfoDao.getUsers(user);
|
|
|
+ for (User u : listUserts) {
|
|
|
+ u.setPassword(null);
|
|
|
+ if (u.getFee_station_name() != null) {
|
|
|
+ StatisticsBean tmp = new StatisticsBean();
|
|
|
+ tmp.setUser(u);
|
|
|
+ statisticBoMap.put(u.getId() + 0L, tmp);
|
|
|
+ }
|
|
|
+ u.setPosition_name(CacheUtil.getJobnameFromMap(new Long(u.getPositionid())));
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ for (StatisticsBean statisticsBean : userLostScoreInfoList) {
|
|
|
+ if (statisticBoMap.containsKey(statisticsBean.getUser_id())) {
|
|
|
+ StatisticsBean tmp = statisticBoMap.get(statisticsBean.getUser_id());
|
|
|
+ tmp.setAll_check_score(statisticsBean.getAll_check_score());
|
|
|
+ tmp.setChecked_num(statisticsBean.getChecked_num());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ List<StatisticsBean> lists = new ArrayList<>(statisticBoMap.values());
|
|
|
+ // 进行排序
|
|
|
+ lists.sort(new Comparator<StatisticsBean>() {
|
|
|
+ @Override
|
|
|
+ public int compare(StatisticsBean o1, StatisticsBean o2) {
|
|
|
+ if(o1.getChecked_num()!=0 && o2.getChecked_num()!=0){
|
|
|
+ double a = o1.getAll_check_score() / (o1.getChecked_num()+0.00);
|
|
|
+ double b = o2.getAll_check_score() /(o2.getChecked_num()+0.00);
|
|
|
+ if (a > b ) {
|
|
|
+ return 1;
|
|
|
+ } else if (a < b) {
|
|
|
+ return -1;
|
|
|
+ } else {
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ if(o1.getChecked_num() == 0){
|
|
|
+ return -1 ;
|
|
|
+ }else if(o2.getChecked_num() ==0){
|
|
|
+ return 1;
|
|
|
+ }else{
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ if(obj.getQueryType()==1 && obj.getOrder_type() ==0 ){
|
|
|
+ // 道管 正序 前10
|
|
|
+ return lists.subList(0, 10);
|
|
|
+ }else if(obj.getQueryType()==1 && obj.getOrder_type() ==1){
|
|
|
+ return lists.subList(lists.size()-10, lists.size());
|
|
|
+ }
|
|
|
+
|
|
|
+ return lists;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 获取收费的进步Top5
|
|
|
+ public List<StatisticsBean> getPersonProgressTop5 (StatisticsBean obj){
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ return null ;
|
|
|
+ }
|
|
|
|
|
|
}
|