|
@@ -11576,6 +11576,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
laborHourRateVo.setChild_ids(deptIds);
|
|
laborHourRateVo.setChild_ids(deptIds);
|
|
//查询该公司下某头部部门及子部门在四种项目下的工时之和,某个时间段内
|
|
//查询该公司下某头部部门及子部门在四种项目下的工时之和,某个时间段内
|
|
List<Report> reportList= reportMapper.getSumWorkingTime(deptIds,startDate,endDate);
|
|
List<Report> reportList= reportMapper.getSumWorkingTime(deptIds,startDate,endDate);
|
|
|
|
+ List<String> userIds= reportMapper.getUserIds(deptIds,startDate,endDate);
|
|
|
|
+
|
|
|
|
|
|
ArrayList<Report> reports = new ArrayList<>();//按时填报的report
|
|
ArrayList<Report> reports = new ArrayList<>();//按时填报的report
|
|
for (Report report : reportList) {
|
|
for (Report report : reportList) {
|
|
@@ -11604,6 +11606,12 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
//-- 查询 有多少个 入职时间早于起始时间 并且是在职的员工
|
|
//-- 查询 有多少个 入职时间早于起始时间 并且是在职的员工
|
|
int isActiveCount=userMapper.getIsActiveCount(deptIds,startDate,endDate);
|
|
int isActiveCount=userMapper.getIsActiveCount(deptIds,startDate,endDate);
|
|
|
|
|
|
|
|
+ List<User> isActiveList = userMapper.getIsActiveList(deptIds, startDate, endDate);
|
|
|
|
+ List<String> collect = isActiveList.stream().map(User::getId).collect(Collectors.toList());
|
|
|
|
+ HashSet<String> idStrings = new HashSet<>();
|
|
|
|
+ idStrings.addAll(userIds);
|
|
|
|
+ idStrings.addAll(collect);
|
|
|
|
+
|
|
//-- 查询 有多少个 入职时间晚于起始时间 并且在这段时间离职的员工
|
|
//-- 查询 有多少个 入职时间晚于起始时间 并且在这段时间离职的员工
|
|
List<User> inActiveBewttenStartAndEndList=userMapper.getInActiveBewttenStartAndEndList(deptIds,startDate,endDate);
|
|
List<User> inActiveBewttenStartAndEndList=userMapper.getInActiveBewttenStartAndEndList(deptIds,startDate,endDate);
|
|
//获取入职时间晚于起始时间 并且在这段时间离职的员工在此期间工作多少天
|
|
//获取入职时间晚于起始时间 并且在这段时间离职的员工在此期间工作多少天
|
|
@@ -11616,14 +11624,15 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
|
|
|
laborHourRateVo.setWorking_time(timeSum);
|
|
laborHourRateVo.setWorking_time(timeSum);
|
|
laborHourRateVo.setDate_count(dayCount);
|
|
laborHourRateVo.setDate_count(dayCount);
|
|
- laborHourRateVo.setCount(isActiveCount);
|
|
|
|
- if (inActiveDays == 0) {
|
|
|
|
|
|
+ laborHourRateVo.setCount(idStrings.size());
|
|
|
|
+ int v = 8 * inActiveDays + idStrings.size() * 8 * dayCount;
|
|
|
|
+ if (v== 0) {
|
|
laborHourRateVo.setTotal_time(0L);
|
|
laborHourRateVo.setTotal_time(0L);
|
|
laborHourRateVo.setRate(0.0);
|
|
laborHourRateVo.setRate(0.0);
|
|
laborHourRateVos.add(laborHourRateVo);
|
|
laborHourRateVos.add(laborHourRateVo);
|
|
} else {
|
|
} else {
|
|
- laborHourRateVo.setTotal_time((long) (8*inActiveDays+isActiveCount*8*dayCount));//应报工时还少了在职的加上可能辞职的
|
|
|
|
- BigDecimal bd = new BigDecimal(timeSum/(8*inActiveDays+isActiveCount*8*dayCount)*100);
|
|
|
|
|
|
+ laborHourRateVo.setTotal_time((long) (v));//应报工时还少了在职的加上可能辞职的
|
|
|
|
+ BigDecimal bd = new BigDecimal(timeSum/(v)*100);
|
|
bd = bd.setScale(2, RoundingMode.HALF_UP);
|
|
bd = bd.setScale(2, RoundingMode.HALF_UP);
|
|
laborHourRateVo.setRate(bd.doubleValue());
|
|
laborHourRateVo.setRate(bd.doubleValue());
|
|
laborHourRateVos.add(laborHourRateVo);
|
|
laborHourRateVos.add(laborHourRateVo);
|