|
@@ -25,6 +25,7 @@ import org.jxls.util.Util;
|
|
|
import org.slf4j.LoggerFactory;
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
+import org.thymeleaf.util.DateUtils;
|
|
|
|
|
|
|
|
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.cluster.UserInfoDao;
|
|
@@ -34,6 +35,7 @@ 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;
|
|
|
import com.xintong.visualinspection.util.CodeUtil;
|
|
import com.xintong.visualinspection.util.CodeUtil;
|
|
|
|
|
+import com.xintong.visualinspection.util.DateUtil;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 文件名:StatisticsServiceImpl 版本信息:日期:2017/3/30 Copyright 江苏省交通规划设计院 Corporation
|
|
* 文件名:StatisticsServiceImpl 版本信息:日期:2017/3/30 Copyright 江苏省交通规划设计院 Corporation
|
|
@@ -1119,19 +1121,28 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
|
|
|
u.setPosition_name(CacheUtil.getJobnameFromMap(new Long(u.getPositionid())));
|
|
u.setPosition_name(CacheUtil.getJobnameFromMap(new Long(u.getPositionid())));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ Map<Long,StatisticsBo> masterMap = getMasterNumAndScore(obj.getMth());
|
|
|
for (StatisticsBean statisticsBean : userLostScoreInfoList) {
|
|
for (StatisticsBean statisticsBean : userLostScoreInfoList) {
|
|
|
if (statisticBoMap.containsKey(statisticsBean.getUser_id())) {
|
|
if (statisticBoMap.containsKey(statisticsBean.getUser_id())) {
|
|
|
StatisticsBean tmp = statisticBoMap.get(statisticsBean.getUser_id());
|
|
StatisticsBean tmp = statisticBoMap.get(statisticsBean.getUser_id());
|
|
|
tmp.setAll_check_score(statisticsBean.getAll_check_score());
|
|
tmp.setAll_check_score(statisticsBean.getAll_check_score());
|
|
|
tmp.setChecked_num(statisticsBean.getChecked_num());
|
|
tmp.setChecked_num(statisticsBean.getChecked_num());
|
|
|
}
|
|
}
|
|
|
|
|
+ //计算班长总扣分和总稽查次数
|
|
|
|
|
+ if(masterMap.get(statisticsBean.getUser_id())!=null){
|
|
|
|
|
+ StatisticsBean tmp = statisticBoMap.get(statisticsBean.getUser_id());
|
|
|
|
|
+ StatisticsBo msb = masterMap.get(statisticsBean.getUser_id());
|
|
|
|
|
+ tmp.setAll_check_score(statisticsBean.getAll_check_score() + msb.getCheck_all_m_score());
|
|
|
|
|
+ tmp.setChecked_num(statisticsBean.getChecked_num() + msb.getChecked_m_num());
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
List<StatisticsBean> lists = new ArrayList<>();
|
|
List<StatisticsBean> lists = new ArrayList<>();
|
|
|
-
|
|
|
|
|
for(StatisticsBean bean:statisticBoMap.values()){
|
|
for(StatisticsBean bean:statisticBoMap.values()){
|
|
|
if(bean.getChecked_num()!=0){
|
|
if(bean.getChecked_num()!=0){
|
|
|
lists.add(bean);
|
|
lists.add(bean);
|
|
|
|
|
+ }else if(masterMap.get(bean.getUser_id())!=null){
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
// 进行排序
|
|
// 进行排序
|
|
@@ -1687,7 +1698,32 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
|
|
|
exportExcel("稽查人员工作量统计", "check_info", map, resp);
|
|
exportExcel("稽查人员工作量统计", "check_info", map, resp);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /*
|
|
|
|
|
+ * 获取班长班组内总得分和扣分
|
|
|
|
|
+ */
|
|
|
|
|
+ private Map<Long,StatisticsBo> getMasterNumAndScore(String month){
|
|
|
|
|
+ TaskAndScore temp = new TaskAndScore();
|
|
|
|
|
+ Calendar cal = Calendar.getInstance();
|
|
|
|
|
+ Date d = DateUtil.strParseDate(month, "yyyy/MM");
|
|
|
|
|
+ cal.setTime(d);
|
|
|
|
|
+ cal.set(cal.get(Calendar.YEAR), cal.get(Calendar.MONTH), 25, 23, 0, 0);
|
|
|
|
|
+ temp.setStart_time(cal.getTime());
|
|
|
|
|
+ cal.add(Calendar.MONTH, -1);
|
|
|
|
|
+ temp.setEnd_time(cal.getTime());
|
|
|
|
|
|
|
|
|
|
+ List<TaskAndScore> taskAndScores = statisticsDao.selectMList(temp);
|
|
|
|
|
+ Map<Long,StatisticsBo> masterMap = new HashMap<Long,StatisticsBo>();
|
|
|
|
|
+ for(TaskAndScore score:taskAndScores) {
|
|
|
|
|
+ if(!masterMap.containsKey(score.getChecked_person1())){
|
|
|
|
|
+ masterMap.put(score.getChecked_person1(), new StatisticsBo());
|
|
|
|
|
+ }
|
|
|
|
|
+ StatisticsBo sb = masterMap.get(score.getChecked_person1());
|
|
|
|
|
+ sb.setCheck_all_m_score(sb.getCheck_all_m_score()+score.getCheck_item_score());
|
|
|
|
|
+ sb.setChecked_m_num(sb.getChecked_m_num()+1);
|
|
|
|
|
+ }
|
|
|
|
|
+ return masterMap;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
private List<TaskAndScore> GET_M_SCORE(Date start_time,Date end_time){
|
|
private List<TaskAndScore> GET_M_SCORE(Date start_time,Date end_time){
|
|
|
TaskAndScore temp = new TaskAndScore();
|
|
TaskAndScore temp = new TaskAndScore();
|
|
|
temp.setStart_time(start_time);
|
|
temp.setStart_time(start_time);
|