|
@@ -16,7 +16,9 @@ import com.xintong.visualinspection.bean.StatisticsBean;
|
|
|
import com.xintong.visualinspection.bean.StatisticsBo;
|
|
import com.xintong.visualinspection.bean.StatisticsBo;
|
|
|
import com.xintong.visualinspection.bean.User;
|
|
import com.xintong.visualinspection.bean.User;
|
|
|
import com.xintong.visualinspection.dao.cluster.DepartmentDao;
|
|
import com.xintong.visualinspection.dao.cluster.DepartmentDao;
|
|
|
|
|
+import com.xintong.visualinspection.dao.cluster.UserInfoDao;
|
|
|
import com.xintong.visualinspection.dao.master.StatisticsDao;
|
|
import com.xintong.visualinspection.dao.master.StatisticsDao;
|
|
|
|
|
+import com.xintong.visualinspection.dao.master.UserDao;
|
|
|
import com.xintong.visualinspection.service.BaseService;
|
|
import com.xintong.visualinspection.service.BaseService;
|
|
|
import com.xintong.visualinspection.service.StatisticsService;
|
|
import com.xintong.visualinspection.service.StatisticsService;
|
|
|
import com.xintong.visualinspection.util.CacheUtil;
|
|
import com.xintong.visualinspection.util.CacheUtil;
|
|
@@ -36,6 +38,9 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private DepartmentDao departmentDao ;
|
|
private DepartmentDao departmentDao ;
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private UserInfoDao userInfoDao;
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
public List<StatisticsBo> getEmployeeCheckedInfo(StatisticsBean obj) {
|
|
public List<StatisticsBo> getEmployeeCheckedInfo(StatisticsBean obj) {
|
|
|
// 查看是否有部门id
|
|
// 查看是否有部门id
|
|
@@ -46,17 +51,30 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
|
|
|
List<StatisticsBean> timesList = statisticsDao.selectCheckedTimes(obj);
|
|
List<StatisticsBean> timesList = statisticsDao.selectCheckedTimes(obj);
|
|
|
|
|
|
|
|
Map<Long,StatisticsBo> statisticBoMap = new HashMap<Long,StatisticsBo>();
|
|
Map<Long,StatisticsBo> statisticBoMap = new HashMap<Long,StatisticsBo>();
|
|
|
-
|
|
|
|
|
- for(User user:CacheUtil.userMap.values()){
|
|
|
|
|
- if(user.getPositionid() ==1){
|
|
|
|
|
- if(organId ==null || user.getOrganid()+0L == organId+0L ){
|
|
|
|
|
- StatisticsBo tmp = new StatisticsBo();
|
|
|
|
|
- tmp.setUser(user);
|
|
|
|
|
- statisticBoMap.put(user.getId()+0L,tmp);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+
|
|
|
|
|
+ User user = new User();
|
|
|
|
|
+ user.setPositionid(1);
|
|
|
|
|
+ if(obj.getDept_id()!=null)
|
|
|
|
|
+ user.setOrganid(obj.getDept_id().intValue());
|
|
|
|
|
+ List<User> listUserts = userInfoDao.getUsers(user);
|
|
|
|
|
+ for(User u:listUserts){
|
|
|
|
|
+ if(u.getFee_station_name()!=null){
|
|
|
|
|
+ StatisticsBo tmp = new StatisticsBo();
|
|
|
|
|
+ tmp.setUser(u);
|
|
|
|
|
+ statisticBoMap.put(u.getId()+0L, tmp);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// for(User user:CacheUtil.userMap.values()){
|
|
|
|
|
+// if(user.getPositionid() ==1){
|
|
|
|
|
+// if(organId ==null || user.getOrganid()+0L == organId+0L ){
|
|
|
|
|
+// StatisticsBo tmp = new StatisticsBo();
|
|
|
|
|
+// tmp.setUser(user);
|
|
|
|
|
+// statisticBoMap.put(user.getId()+0L,tmp);
|
|
|
|
|
+// }
|
|
|
|
|
+// }
|
|
|
|
|
+// }
|
|
|
|
|
+
|
|
|
for( StatisticsBean statisticsBean : list ){
|
|
for( StatisticsBean statisticsBean : list ){
|
|
|
if(statisticBoMap.containsKey(statisticsBean.getUser_id())){
|
|
if(statisticBoMap.containsKey(statisticsBean.getUser_id())){
|
|
|
StatisticsBo tmp = statisticBoMap.get(statisticsBean.getUser_id());
|
|
StatisticsBo tmp = statisticBoMap.get(statisticsBean.getUser_id());
|
|
@@ -78,7 +96,6 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
|
|
|
List<StatisticsBo> lists = new ArrayList<>(statisticBoMap.values());
|
|
List<StatisticsBo> lists = new ArrayList<>(statisticBoMap.values());
|
|
|
// 进行排序
|
|
// 进行排序
|
|
|
lists.sort(new Comparator<StatisticsBo>() {
|
|
lists.sort(new Comparator<StatisticsBo>() {
|
|
|
-
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public int compare(StatisticsBo o1, StatisticsBo o2) {
|
|
public int compare(StatisticsBo o1, StatisticsBo o2) {
|
|
|
if(o1.getCheck_all_score() >= o2.getCheck_all_score() ){
|
|
if(o1.getCheck_all_score() >= o2.getCheck_all_score() ){
|
|
@@ -101,11 +118,12 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
|
|
|
mapStationInfos.put(sta.getDept_id(), sta);
|
|
mapStationInfos.put(sta.getDept_id(), sta);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // 检索受检次数
|
|
|
|
|
|
|
+ // 检查人数 和 检查次数
|
|
|
List<StatisticsBean> listCheckNum = statisticsDao.selectFeeStationCheckNum(obj);
|
|
List<StatisticsBean> listCheckNum = statisticsDao.selectFeeStationCheckNum(obj);
|
|
|
for(StatisticsBean sta:listCheckNum){
|
|
for(StatisticsBean sta:listCheckNum){
|
|
|
if(mapStationInfos.containsKey(sta.getDept_id())){
|
|
if(mapStationInfos.containsKey(sta.getDept_id())){
|
|
|
mapStationInfos.get(sta.getDept_id()).setChecked_num(sta.getChecked_num());
|
|
mapStationInfos.get(sta.getDept_id()).setChecked_num(sta.getChecked_num());
|
|
|
|
|
+ mapStationInfos.get(sta.getDept_id()).setChecked_people_num(sta.getChecked_people_num());
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -129,8 +147,35 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public List<StatisticsBean> getFeeStationCheckItemScore(StatisticsBean obj) {
|
|
public List<StatisticsBean> getFeeStationCheckItemScore(StatisticsBean obj) {
|
|
|
- // TODO Auto-generated method stub
|
|
|
|
|
- return null;
|
|
|
|
|
|
|
+
|
|
|
|
|
+ // 获取收费站信息收费站人数
|
|
|
|
|
+ List<StatisticsBean> lists = departmentDao.selectFeeStationGroup(obj);
|
|
|
|
|
+ Map<Long,StatisticsBean> mapStationInfos = new HashMap<>();
|
|
|
|
|
+ for(StatisticsBean sta:lists){
|
|
|
|
|
+ mapStationInfos.put(sta.getDept_id(), sta);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 检查人数 和 检查次数
|
|
|
|
|
+ List<StatisticsBean> listCheckNum = statisticsDao.selectFeeStationCheckNum(obj);
|
|
|
|
|
+ for(StatisticsBean sta:listCheckNum){
|
|
|
|
|
+ if(mapStationInfos.containsKey(sta.getDept_id())){
|
|
|
|
|
+ mapStationInfos.get(sta.getDept_id()).setChecked_num(sta.getChecked_num());
|
|
|
|
|
+ mapStationInfos.get(sta.getDept_id()).setChecked_people_num(sta.getChecked_people_num());
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ List<StatisticsBean> listCheckedScore = statisticsDao.selectFeeStationCheckedPersonScoreDetail(obj);
|
|
|
|
|
+ for(StatisticsBean sta:listCheckedScore){
|
|
|
|
|
+ if(mapStationInfos.containsKey(sta.getDept_id())){
|
|
|
|
|
+ StatisticsBean statis = mapStationInfos.get(sta.getDept_id());
|
|
|
|
|
+ statis.setAll_check_score( statis.getAll_check_score()+sta.getScore());
|
|
|
|
|
+ statis.getChecked_socre_name().add(sta.getName());
|
|
|
|
|
+ statis.getChecked_score().add(sta.getScore());
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return new ArrayList<>(mapStationInfos.values());
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|