Parcourir la source

人员工时分配表添加加班时长字段

yusm il y a 1 an
Parent
commit
607dc8d3da

+ 8 - 2
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ProjectServiceImpl.java

@@ -7871,6 +7871,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
             double workTimeDouble = Double.parseDouble(map.get("workingTime").toString()) + leaveSum;
             BigDecimal workTimeBig = new BigDecimal(workTimeDouble);
             map.put("workingTime",workTimeBig.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue());
+            double overtimeHours = Double.parseDouble(map.get("overtimeHours").toString());
+            map.put("overtimeHours",overtimeHours + "h");
         }
         list.forEach(li->{
             double isPublic = (double) li.get("isPublic");
@@ -8025,8 +8027,11 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
             }
         }
         List<Map<String, Object>> list = projectMapper.getUserWorkingTimeList(userId, user.getCompanyId(), startDate, endDate, projectId,null,null,null,deptIds);
-        //String[] string={"人员","部门","工号","普通项目工时","公共项目工时","请假时长","总工时","公共项目工时占比"};
-        String[] string={MessageUtils.message("entry.personnel"),MessageUtils.message("excel.department"),MessageUtils.message("entry.No"),MessageUtils.message("entry.GenProHours"),MessageUtils.message("entry.PubProHours"),MessageUtils.message("leave.duration"),MessageUtils.message("entry.totalManHours"),MessageUtils.message("entry.PubProHoursProp")};
+        //String[] string={"人员","部门","工号","普通项目工时","公共项目工时","请假时长","加班时长",总工时","公共项目工时占比"};
+        String[] string={MessageUtils.message("entry.personnel"),MessageUtils.message("excel.department"),
+                MessageUtils.message("entry.No"),MessageUtils.message("entry.GenProHours"),
+                MessageUtils.message("entry.PubProHours"),MessageUtils.message("leave.duration"),MessageUtils.message("excel.workOvertime"),
+                MessageUtils.message("entry.totalManHours"),MessageUtils.message("entry.PubProHoursProp")};
         List<List<String>> dataList=new ArrayList<>();
         dataList.add(Arrays.asList(string));
         Integer companyId = user.getCompanyId();
@@ -8057,6 +8062,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
             subList.add(String.valueOf(item.get("unPublic")));
             subList.add(String.valueOf(item.get("isPublic")));
             subList.add(String.valueOf(item.get("leaveSum")));
+            subList.add(String.valueOf(item.get("overtimeHours")));
             subList.add(String.valueOf(item.get("workingTime")));
             subList.add(String.valueOf(item.get("proportion")));
             dataList.add(subList);

+ 2 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/ProjectMapper.xml

@@ -818,7 +818,8 @@
         user.department_id As deptId,
         ifnull(SUM(if(project.is_public=0,report.working_time,null)),0) as unPublic,
         ifnull(SUM(if(project.is_public=1,report.working_time,null)),0) as isPublic,
-        ifnull(SUM(report.`working_time`),0) AS workingTime
+        ifnull(SUM(report.`working_time`),0) AS workingTime,
+        ifnull(SUM(report.`overtime_hours`),0) AS overtimeHours
         FROM report LEFT JOIN user ON user.id = report.`creator_id`
         left join project on project.id = report.project_id
         WHERE

+ 2 - 0
fhKeeper/formulahousekeeper/timesheet/src/views/corpreport/list.vue

@@ -630,6 +630,8 @@
               </el-table-column>
               <el-table-column prop="leaveSum" :label="$t('qing-jia-gong-shi')" min-width="160" align="right">
               </el-table-column>
+              <el-table-column prop="overtimeHours" :label="$t('jia-ban-shi-chang')" min-width="160" align="right">
+              </el-table-column>
               <el-table-column prop="workingTime" :label="$t('other.totalworkinghours')" min-width="160" align="right">
                 <template slot-scope="scope">
                   <span>{{scope.row.workingTime == null? 0 + 'h' : scope.row.workingTime.toFixed(1) + 'h'}}</span>