|
@@ -51,7 +51,7 @@ public class FinanceMonthlyWorktimeServiceImpl extends ServiceImpl<FinanceMonthl
|
|
|
public static final String TIME_TYPE_DEBUG = "调试工时(车间)";
|
|
|
public static final String TIME_TYPE_WAIT = "等料工时(车间)";
|
|
|
public static final String TIME_TYPE_BUSTRIP = "出差工时(含上机、售后工时)";
|
|
|
- public static final String TIME_TYPE_CLEAN = "清洁打包工时(入库后)";
|
|
|
+ public static final String TIME_TYPE_CLEAN = "入库后工时";
|
|
|
|
|
|
static List<String> groupNameList = new ArrayList<>();
|
|
|
{
|
|
@@ -206,7 +206,7 @@ public class FinanceMonthlyWorktimeServiceImpl extends ServiceImpl<FinanceMonthl
|
|
|
//查询日报数据
|
|
|
List<Department> departmentList = departmentMapper.selectList(new LambdaQueryWrapper<Department>().eq(Department::getCompanyId, user.getCompanyId()));
|
|
|
List<Project> projectList = projectMapper.selectList(new LambdaQueryWrapper<Project>().eq(Project::getCompanyId, user.getCompanyId()));
|
|
|
- List<Project> publicProjectList = projectList.stream().filter(p -> p.getIsPublic() == 1).collect(Collectors.toList());
|
|
|
+ List<Project> publicProjectList = projectList.stream().filter(p -> p.getIsPublic() == 1 && !"HH-QJ-0000001".equals(p.getProjectCode())).collect(Collectors.toList());
|
|
|
List<User> userList = userMapper.selectList(new LambdaQueryWrapper<User>().select(User::getId, User::getName, User::getDepartmentId).eq(User::getCompanyId, user.getCompanyId()));
|
|
|
|
|
|
List<Report> reportList = reportMapper.getReportProjectGroupDetailList(user.getCompanyId(), firstDayOfMonth, lastDayOfMonth, groupNameList);
|
|
@@ -300,7 +300,8 @@ public class FinanceMonthlyWorktimeServiceImpl extends ServiceImpl<FinanceMonthl
|
|
|
List<User> deptUserList = userList.stream().filter(u -> u.getDepartmentId().equals(deptId)).collect(Collectors.toList());
|
|
|
List<String> deptUserIds = deptUserList.stream().map(User::getId).collect(Collectors.toList());
|
|
|
List<Report> deptUserReportGroupList = reportMapper.selectList(new QueryWrapper<Report>().select("project_id,extra_field4,extra_field5,dept_id, sum(working_time) working_time")
|
|
|
- .in("creator_id", deptUserIds).between("create_date", firstDayOfMonth, lastDayOfMonth).isNotNull("extra_field4").ne("extra_field4", "")
|
|
|
+ .in("creator_id", deptUserIds).between("create_date", firstDayOfMonth, lastDayOfMonth)
|
|
|
+ .isNotNull("extra_field4").ne("extra_field4", "").eq("state", 1)
|
|
|
.groupBy("project_id,extra_field4,extra_field5"));
|
|
|
double totalTime = deptUserReportGroupList.stream().mapToDouble(Report::getWorkingTime).sum();
|
|
|
System.out.println("处理公共工时分摊,总工时=="+totalTime);
|
|
@@ -322,7 +323,7 @@ public class FinanceMonthlyWorktimeServiceImpl extends ServiceImpl<FinanceMonthl
|
|
|
//处理非三大中心的公共工时分摊,按本部门的工单工时来统计
|
|
|
List<Report> deptUserReportGroupList = reportMapper.selectList(new QueryWrapper<Report>().select("project_id,extra_field4,extra_field5,dept_id, sum(working_time) working_time")
|
|
|
.eq("dept_id", deptId).between("create_date", firstDayOfMonth, lastDayOfMonth).isNotNull("extra_field4").ne("extra_field4", "")
|
|
|
- .eq("is_assist", 0)
|
|
|
+ .eq("is_assist", 0).eq("state", 1)
|
|
|
.groupBy("project_id,extra_field4,extra_field5"));
|
|
|
double totalTime = deptUserReportGroupList.stream().mapToDouble(Report::getWorkingTime).sum();
|
|
|
System.out.println("处理非三大中心公共工时分摊,总工时=="+totalTime);
|
|
@@ -560,7 +561,9 @@ public class FinanceMonthlyWorktimeServiceImpl extends ServiceImpl<FinanceMonthl
|
|
|
@Override
|
|
|
public HttpRespMsg getUnDistriibutedPublicTime(Integer fmwId, HttpServletRequest request) {
|
|
|
FinanceMonthlyWorktime financeMonthlyWorktime = financeMonthlyWorktimeMapper.selectById(fmwId);
|
|
|
- List<Project> publicProjectList = projectMapper.selectList(new LambdaQueryWrapper<Project>().eq(Project::getIsPublic, 1).eq(Project::getCompanyId, financeMonthlyWorktime.getCompanyId()));
|
|
|
+ List<Project> publicProjectList = projectMapper.selectList(new LambdaQueryWrapper<Project>().eq(Project::getIsPublic, 1)
|
|
|
+ .ne(Project::getProjectCode, "HH-QJ-0000001")//请假项目排除掉
|
|
|
+ .eq(Project::getCompanyId, financeMonthlyWorktime.getCompanyId()));
|
|
|
List<User> userList = userMapper.selectList(new LambdaQueryWrapper<User>().select(User::getId, User::getName, User::getDepartmentId).eq(User::getCompanyId, financeMonthlyWorktime.getCompanyId()));
|
|
|
// 处理公共项目工时分摊
|
|
|
List<Integer> publicProjectIds = publicProjectList.stream()
|
|
@@ -577,9 +580,11 @@ public class FinanceMonthlyWorktimeServiceImpl extends ServiceImpl<FinanceMonthl
|
|
|
//TODO: 需确认,员工填报公共项目工时的时候,会选择到工单吗?
|
|
|
//研发中心的公共工时不参与分摊; deptId=9508
|
|
|
int reserveDeptId = 9508;
|
|
|
+ //请假项目不参与
|
|
|
List<Report> publicReportList = reportMapper.selectList(
|
|
|
new LambdaQueryWrapper<Report>().select(Report::getCreatorId, Report::getDeptId, Report::getWorkingTime).eq(Report::getState, 1)
|
|
|
- .ne(Report::getDeptId, reserveDeptId)
|
|
|
+ .ne(Report::getDeptId, reserveDeptId).ne(Report::getProjectId, null)
|
|
|
+
|
|
|
.in(Report::getProjectId, publicProjectIds).between(Report::getCreateDate, firstDayOfMonth, lastDayOfMonth));
|
|
|
//按照人员所在的部门进行分组,汇总,如果公共项目没有工单,此步骤可以省略
|
|
|
publicReportList.forEach(report -> {
|
|
@@ -614,7 +619,8 @@ public class FinanceMonthlyWorktimeServiceImpl extends ServiceImpl<FinanceMonthl
|
|
|
List<User> deptUserList = userList.stream().filter(u -> u.getDepartmentId().equals(deptId)).collect(Collectors.toList());
|
|
|
List<String> deptUserIds = deptUserList.stream().map(User::getId).collect(Collectors.toList());
|
|
|
List<Report> deptUserReportGroupList = reportMapper.selectList(new QueryWrapper<Report>().select("project_id,extra_field4,extra_field5,dept_id, sum(working_time) working_time")
|
|
|
- .in("creator_id", deptUserIds).between("create_date", firstDayOfMonth, lastDayOfMonth).isNotNull("extra_field4").ne("extra_field4", "")
|
|
|
+ .in("creator_id", deptUserIds).between("create_date", firstDayOfMonth, lastDayOfMonth)
|
|
|
+ .isNotNull("extra_field4").ne("extra_field4", "").eq("state", 1)
|
|
|
.groupBy("project_id,extra_field4,extra_field5"));
|
|
|
double totalTime = deptUserReportGroupList.stream().mapToDouble(Report::getWorkingTime).sum();
|
|
|
System.out.println("处理公共工时分摊,总工时=="+totalTime);
|
|
@@ -627,7 +633,7 @@ public class FinanceMonthlyWorktimeServiceImpl extends ServiceImpl<FinanceMonthl
|
|
|
//处理非三大中心的公共工时分摊,按本部门的工单工时来统计
|
|
|
List<Report> deptUserReportGroupList = reportMapper.selectList(new QueryWrapper<Report>().select("project_id,extra_field4,extra_field5,dept_id, sum(working_time) working_time")
|
|
|
.eq("dept_id", deptId).between("create_date", firstDayOfMonth, lastDayOfMonth).isNotNull("extra_field4").ne("extra_field4", "")
|
|
|
- .eq("is_assist", 0)
|
|
|
+ .eq("is_assist", 0).eq("state", 1)
|
|
|
.groupBy("project_id,extra_field4,extra_field5"));
|
|
|
double totalTime = deptUserReportGroupList.stream().mapToDouble(Report::getWorkingTime).sum();
|
|
|
System.out.println("处理非三大中心公共工时分摊,总工时=="+totalTime);
|