소스 검색

Merge remote-tracking branch 'origin/master'

yusm 1 개월 전
부모
커밋
18622e67c7

+ 19 - 2
fhKeeper/formulahousekeeper/collectdata/src/main/java/com/management/collectdata/controller/DataCollectController.java

@@ -425,7 +425,9 @@ public class DataCollectController {
         return localTime.format(df);
     }
 
-    private float calculateWorkHoursFromTime(UserFvTime userFvTime) {
+
+    public static float calculateWorkHoursFromTime(UserFvTime userFvTime) {
+        String baseMorningStart = "06:00";
         String baseMorningEnd = "12:00";
         String baseAfternoonStart = "13:00";
         double restTime = 1.0;
@@ -433,12 +435,27 @@ public class DataCollectController {
         DateTimeFormatter df = DateTimeFormatter.ofPattern("HH:mm");
         LocalTime startCardTime = LocalTime.parse(userFvTime.getStartTime(),df);
         LocalTime endCardTime = LocalTime.parse(userFvTime.getEndTime(),df);
+        if (userFvTime.getEndTime().compareTo(baseMorningStart) < 0) {
+            //算夜班加班
+            endCardTime.plusHours(24);
+        }
+
 //        System.out.println(", startTime="+startCardTime.format(df)
 //                +"endTime="+endCardTime.format(df));
         BigDecimal bigDecimal = new BigDecimal(Duration.between(startCardTime,endCardTime).toMinutes());
 //        System.out.println("打卡时长(分钟):" + bigDecimal);
+        if (endCardTime.compareTo(LocalTime.parse(baseMorningStart,df)) < 0) {
+            bigDecimal = bigDecimal.add(BigDecimal.valueOf(24*60));
+//            System.out.println("矫正后打卡时长(分钟):" + bigDecimal);
+            bigDecimal = bigDecimal.divide(BigDecimal.valueOf(60),1,BigDecimal.ROUND_HALF_UP);
+            if (startCardTime.compareTo(LocalTime.parse(baseMorningEnd,df)) <= 0) {
+                //重新计算打卡工时时,需要减去中间午休时间
+                bigDecimal = bigDecimal.subtract(new BigDecimal(restTime));
+            }
+            System.out.println("矫正后打卡时长(小时):" + bigDecimal);
+        }
         //开始时间在上午,结束时间在下午,要减去午休时长
-        if (startCardTime.compareTo(LocalTime.parse(baseMorningEnd,df)) <= 0 && endCardTime.compareTo(LocalTime.parse(baseAfternoonStart,df)) >= 0) {
+        else if (startCardTime.compareTo(LocalTime.parse(baseMorningEnd,df)) <= 0 && endCardTime.compareTo(LocalTime.parse(baseAfternoonStart,df)) >= 0) {
             //重新计算打卡工时时,需要减去中间午休时间
             bigDecimal = bigDecimal.divide(BigDecimal.valueOf(60),1,BigDecimal.ROUND_HALF_UP).subtract(new BigDecimal(restTime));
 //            System.out.println("午休时间:"+restTime+", 减去后,工作时长="+bigDecimal);

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

@@ -2147,8 +2147,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                     //项目经理换人,对应任务计划的第一审核人得换
                     String inchargerId_old = oldProject.getInchargerId();
                     if (!inchargerId.equals(inchargerId_old)){
-                        taskService.update(null,new UpdateWrapper<Task>().eq("project_id",oldProject.getId())
-                                .eq("task_plan",1).set("check_first_id",inchargerId));
+                        taskExecutorService.update(null, new UpdateWrapper<TaskExecutor>().eq("project_id", oldProject.getId()).set("first_auditor_id", inchargerId));
                     }
                     if (customerId == null) {
                         //去掉客户

+ 1 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/ProjectController.java

@@ -303,7 +303,7 @@ public class ProjectController {
         String token = request.getHeader("token");
         User user = userMapper.selectById(token);
         //苏州正北定制工时表
-        if (user.getCompanyId() == 8138 || user.getCompanyId() == 7) {
+        if (user.getCompanyId() == 8138 || user.getCompanyId() == 7703 || user.getCompanyId() == 7) {
             return projectService.exportZhengBeiTimeReport(date, request);
         }
         return projectService.exportTimeByProjectAndEmployee(date, request);

+ 1 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/ReportController.java

@@ -2014,7 +2014,7 @@ public class ReportController {
         }
         if (comTimeType.getFillOvertime() == 0) {
             //不允许填报加班
-            reportList.forEach(r->r.setIsOvertime(0));
+            reportList.forEach(r->r.setIsOvertime(0).setOvertimeHours(0.0));
         }
         HttpRespMsg httpRespMsg = reportService.editReport(reportList, createDate.length > 0 ? createDate[0] : null, targetUserList, hourCost, user.getCompanyId(), summary, weeklyAttachment);
         //填报自动通过功能:【上海绎维】、【火石演示】、【博通容合】、【威派格】使用;以及设置了自动审核通过的公司

+ 0 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ProjectServiceImpl.java

@@ -10149,7 +10149,6 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         List<LeaveSheet> leaveSheetList = leaveSheetMapper.selectList(new LambdaQueryWrapper<LeaveSheet>()
                 .eq(LeaveSheet::getCompanyId, targetUser.getCompanyId()).le(LeaveSheet::getStartDate,endDate).ge(LeaveSheet::getEndDate,startDate));
         List<TimelinessRateVO> resultList=new ArrayList<>();
-        //针对美莱德 去除2024-02-09
         //针对人员已经特殊节假日设置去除相对应的日期
         List<HolidaySetting> allUsersSetting = holidaySettingList.stream().filter(h -> h.getRangeType() == 0).collect(Collectors.toList());
         List<HolidaySetting> targetUserOrDeptSetting = holidaySettingList.stream().filter(h -> h.getRangeType() == 1).collect(Collectors.toList());

+ 49 - 84
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ReportServiceImpl.java

@@ -10971,8 +10971,8 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
         List<Integer> taskIds = reportRateTaskVOList.stream().distinct().map(r -> r.getTaskId()).collect(Collectors.toList());
         System.out.println(taskIds.toString());
         taskIds.add(-1);
-        List<Map<String,Object>> reportList=reportMapper.getUserReportTimelinessRateWithTask(companyId,taskIds);
-        Map<Object, List<Map<String, Object>>> listMap = reportList.stream().filter(item->!StringUtils.isEmpty(item.get("userName"))).collect(Collectors.groupingBy(rp -> rp.get("userName")));
+        List<Map<String,Object>> reportList = reportMapper.getUserReportTimelinessRateWithTask(companyId,taskIds);
+//        Map<Object, List<Map<String, Object>>> listMap = reportList.stream().filter(item->!StringUtils.isEmpty(item.get("taskId"))).collect(Collectors.groupingBy(rp -> rp.get("userName")));
         //获取到公司设置的特殊节假日设置
         List<HolidaySetting> holidaySettingList = holidaySettingService.list(new LambdaQueryWrapper<HolidaySetting>().eq(HolidaySetting::getCompanyId, companyId).isNotNull(HolidaySetting::getHolidayDate));
         List<HolidaySetting> allUsersSetting = holidaySettingList.stream().filter(h -> h.getRangeType() == 0).collect(Collectors.toList());
@@ -10991,21 +10991,21 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                     rateTaskVO.setDepartmentName(dept.getDepartmentName());
                 }
 
-                List<Map<String, Object>> mapList = listMap.get(user.getName());
+                List<Map<String, Object>> curTaskUserReportList = reportList.stream().filter(r->r.get("taskId")!=null
+                        &&Integer.parseInt(r.get("taskId").toString()) == rateTaskVO.getTaskId() && r.get("userId")!=null
+                        &&r.get("userId").equals(rateTaskVO.getUserId())).collect(Collectors.toList());
                 LocalDate startDate = rateTaskVO.getStartDate();
-                LocalDate endDate = rateTaskVO.getEndDate();
+                int lines = timeType.getTimeliness();//0-当天,1-次日,2-第二天
+                LocalDate maxEndDate = LocalDate.now().minusDays(lines + 1);//最大只检测到当前日期的前几天
+                LocalDate endDate = rateTaskVO.getEndDate() == null ? maxEndDate :(rateTaskVO.getEndDate().isAfter(maxEndDate)?maxEndDate:rateTaskVO.getEndDate());
                 AtomicReference<List<LocalDate>> listAtomicReference = new AtomicReference<>(getDays(startDate, endDate));
                 long days = listAtomicReference.get().size();
                 for (LocalDate localDateTime : listAtomicReference.get()) {
-                    if(mapList!=null){
-                        //在非工作日下 填报了的情况下 及时填报了就算作及时率计算的基数
-                        if(localDateTime!=null&& !WorkDayCalculateUtils.isWorkDay(localDateTime)&&!mapList.stream().anyMatch(ml->{
-                            Integer taskId=ml.get("taskId")!=null?Integer.parseInt(ml.get("taskId").toString()):null;
-                            if (taskId == null || !taskId.equals(rateTaskVO.getTaskId())) {
-                                return false;
-                            }
-                            Date date = (Date) ml.get("createDate");
-                            LocalDate createDate = date != null ? date.toInstant().atZone(ZoneId.systemDefault()).toLocalDate() : null;
+                    if(curTaskUserReportList!=null && curTaskUserReportList.size() > 0){
+                        //在非工作日下,并且没有填写日报,就不算填报基数。 如果非工作日填了,是要算成基数的
+                        if(!WorkDayCalculateUtils.isWorkDay(localDateTime)&&!curTaskUserReportList.stream().anyMatch(ml->{
+                            java.sql.Date date = (java.sql.Date) ml.get("createDate");
+                            LocalDate createDate = date.toLocalDate();
                             return createDate.isEqual(localDateTime);
                         })){
                             days-=1;
@@ -11074,13 +11074,9 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                                 days++;
                                 continue;
                             }
-                            if(mapList!=null&&mapList.stream().anyMatch(ml->{
-                                Integer taskId=ml.get("taskId")!=null?Integer.parseInt(ml.get("taskId").toString()):null;
-                                if (taskId == null || !taskId.equals(rateTaskVO.getTaskId())) {
-                                    return false;
-                                }
-                                Date date = (Date) ml.get("createDate");
-                                LocalDate createDate = date != null ? date.toInstant().atZone(ZoneId.systemDefault()).toLocalDate() : null;
+                            if(curTaskUserReportList!=null&&curTaskUserReportList.stream().anyMatch(ml->{
+                                java.sql.Date date = (java.sql.Date) ml.get("createDate");
+                                LocalDate createDate = date.toLocalDate();
                                 return createDate.isEqual(localDateTime.toLocalDate());
                             })){
                                 days++;
@@ -11090,22 +11086,16 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                 }
 
                 int num=0;
-                if(mapList!=null){
-                    for (Map<String, Object> map : mapList) {
+                if(curTaskUserReportList!=null){
+                    for (Map<String, Object> map : curTaskUserReportList) {
                         if (map.get("createDate")!=null && map.get("createTime")!=null) {
                             Map<String, Object> objectMap = new HashMap<>();
-                            Date date = (Date) map.get("createDate");
+                            java.sql.Date date = (java.sql.Date) map.get("createDate");
                             SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
                             //去掉sql返回的毫秒值
-                            java.sql.Date createTime = (java.sql.Date) map.get("createTime");
-                            LocalDate createDate = date != null ? date.toInstant().atZone(ZoneId.systemDefault()).toLocalDate() : null;
-                            // 针对美莱德 去除2024-02-09
-                            if (user.getCompanyId() == 876) {
-                                if (createDate.isEqual(LocalDate.parse("2024-02-09"))) {
-                                    continue;
-                                }
-                            }
-                            LocalDate createTimeDate = createTime.toLocalDate();
+                            java.sql.Timestamp createTime = (java.sql.Timestamp) map.get("createTime");
+                            LocalDate createDate = date.toLocalDate();
+                            LocalDate createTimeDate = createTime.toLocalDateTime().toLocalDate();
                             //根据设置
                             switch (timeliness) {
                                 case 1:
@@ -11133,14 +11123,6 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                         }
 
                     }
-                    //处理漏填的情况,漏填的也算不及时
-                    boolean hasMissReport = false;
-                    for (LocalDate localDateTime : listAtomicReference.get()) {
-                        if(localDateTime!=null&&!WorkDayCalculateUtils.isWorkDay(localDateTime)){
-                            continue;
-                        }
-                        hasMissReport = true;
-                    }
                     BigDecimal bigDecimal=new BigDecimal(num);
                     BigDecimal bigDecimalWithLeave=new BigDecimal(num+(daysWithLeave-days));
                     BigDecimal divide;
@@ -11148,7 +11130,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                     if(days!=0){
                         divide = bigDecimal.divide(BigDecimal.valueOf(days), 2, BigDecimal.ROUND_HALF_UP);
                     }else if(days==0){
-                        divide=new BigDecimal(1);
+                        divide=new BigDecimal(0);
                         //查看当天有请假直接算100%
                     }else if (days==0&&num!=0&&leaveSheetList.size()>0){
                         divide=new BigDecimal(1);
@@ -11162,7 +11144,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                     if(daysWithLeave!=0){
                         divideWithLeave = bigDecimalWithLeave.divide(BigDecimal.valueOf(daysWithLeave), 2, BigDecimal.ROUND_HALF_UP);
                     }else if(daysWithLeave==0){
-                        divideWithLeave=new BigDecimal(1);
+                        divideWithLeave=new BigDecimal(0);
                         //查看当天有请假直接算100%
                     }else if (daysWithLeave==0&&num!=0&&leaveSheetList.size()>0){
                         divideWithLeave=new BigDecimal(1);
@@ -11287,7 +11269,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
         System.out.println(taskIds.toString());
         taskIds.add(-1);
         List<Map<String,Object>> reportList=reportMapper.getUserReportTimelinessRateWithTask(companyId,taskIds);
-        Map<Object, List<Map<String, Object>>> listMap = reportList.stream().filter(item->!StringUtils.isEmpty(item.get("userName"))).collect(Collectors.groupingBy(rp -> rp.get("userName")));
+//        Map<Object, List<Map<String, Object>>> listMap = reportList.stream().filter(item->!StringUtils.isEmpty(item.get("userName"))).collect(Collectors.groupingBy(rp -> rp.get("userName")));
         //获取到公司设置的特殊节假日设置
         List<HolidaySetting> holidaySettingList = holidaySettingService.list(new LambdaQueryWrapper<HolidaySetting>().eq(HolidaySetting::getCompanyId, companyId).isNotNull(HolidaySetting::getHolidayDate));
         List<HolidaySetting> allUsersSetting = holidaySettingList.stream().filter(h -> h.getRangeType() == 0).collect(Collectors.toList());
@@ -11306,21 +11288,22 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                     rateTaskVO.setDepartmentName(dept.getDepartmentName());
                 }
 
-                List<Map<String, Object>> mapList = listMap.get(user.getName());
+                List<Map<String, Object>> curTaskUserReportList = reportList.stream().filter(r->r.get("taskId")!=null
+                        &&Integer.parseInt(r.get("taskId").toString()) == rateTaskVO.getTaskId() && r.get("userId")!=null
+                        &&r.get("userId").equals(rateTaskVO.getUserId())).collect(Collectors.toList());
                 LocalDate startDate = rateTaskVO.getStartDate();
-                LocalDate endDate = rateTaskVO.getEndDate();
+                int lines = timeType.getTimeliness();//0-当天,1-次日,2-第二天
+                LocalDate maxEndDate = LocalDate.now().minusDays(lines + 1);//最大只检测到当前日期的前几天
+                LocalDate endDate = rateTaskVO.getEndDate() == null ? maxEndDate :(rateTaskVO.getEndDate().isAfter(maxEndDate)?maxEndDate:rateTaskVO.getEndDate());
+
                 AtomicReference<List<LocalDate>> listAtomicReference = new AtomicReference<>(getDays(startDate, endDate));
                 long days = listAtomicReference.get().size();
                 for (LocalDate localDateTime : listAtomicReference.get()) {
-                    if(mapList!=null){
+                    if(curTaskUserReportList!=null){
                         //在非工作日下 填报了的情况下 及时填报了就算作及时率计算的基数
-                        if(localDateTime!=null&& !WorkDayCalculateUtils.isWorkDay(localDateTime)&&!mapList.stream().anyMatch(ml->{
-                            Integer taskId=ml.get("taskId")!=null?Integer.parseInt(ml.get("taskId").toString()):null;
-                            if (taskId == null || !taskId.equals(rateTaskVO.getTaskId())) {
-                                return false;
-                            }
-                            Date date = (Date) ml.get("createDate");
-                            LocalDate createDate = date != null ? date.toInstant().atZone(ZoneId.systemDefault()).toLocalDate() : null;
+                        if(localDateTime != null && !WorkDayCalculateUtils.isWorkDay(localDateTime)&&!curTaskUserReportList.stream().anyMatch(ml->{
+                            java.sql.Date date = (java.sql.Date) ml.get("createDate");
+                            LocalDate createDate = date.toLocalDate();
                             return createDate.isEqual(localDateTime);
                         })){
                             days-=1;
@@ -11389,13 +11372,9 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                                 days++;
                                 continue;
                             }
-                            if(mapList!=null&&mapList.stream().anyMatch(ml->{
-                                Integer taskId=ml.get("taskId")!=null?Integer.parseInt(ml.get("taskId").toString()):null;
-                                if (taskId == null || !taskId.equals(rateTaskVO.getTaskId())) {
-                                    return false;
-                                }
-                                Date date = (Date) ml.get("createDate");
-                                LocalDate createDate = date != null ? date.toInstant().atZone(ZoneId.systemDefault()).toLocalDate() : null;
+                            if(curTaskUserReportList!=null&&curTaskUserReportList.stream().anyMatch(ml->{
+                                java.sql.Date date = (java.sql.Date) ml.get("createDate");
+                                LocalDate createDate = date.toLocalDate();
                                 return createDate.isEqual(localDateTime.toLocalDate());
                             })){
                                 days++;
@@ -11405,22 +11384,16 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                 }
 
                 int num=0;
-                if(mapList!=null){
-                    for (Map<String, Object> map : mapList) {
+                if(curTaskUserReportList!=null){
+                    for (Map<String, Object> map : curTaskUserReportList) {
                         if (map.get("createDate")!=null && map.get("createTime")!=null) {
                             Map<String, Object> objectMap = new HashMap<>();
-                            Date date = (Date) map.get("createDate");
+                            java.sql.Date date = (java.sql.Date) map.get("createDate");
                             SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
                             //去掉sql返回的毫秒值
-                            java.sql.Date createTime = (java.sql.Date) map.get("createTime");
-                            LocalDate createDate = date != null ? date.toInstant().atZone(ZoneId.systemDefault()).toLocalDate() : null;
-                            // 针对美莱德 去除2024-02-09
-                            if (user.getCompanyId() == 876) {
-                                if (createDate.isEqual(LocalDate.parse("2024-02-09"))) {
-                                    continue;
-                                }
-                            }
-                            LocalDate createTimeDate = createTime.toLocalDate();
+                            java.sql.Timestamp createTime = (java.sql.Timestamp) map.get("createTime");
+                            LocalDate createDate = date.toLocalDate();
+                            LocalDate createTimeDate = createTime.toLocalDateTime().toLocalDate();
                             //根据设置
                             switch (timeliness) {
                                 case 1:
@@ -11448,14 +11421,6 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                         }
 
                     }
-                    //处理漏填的情况,漏填的也算不及时
-                    boolean hasMissReport = false;
-                    for (LocalDate localDateTime : listAtomicReference.get()) {
-                        if(localDateTime!=null&&!WorkDayCalculateUtils.isWorkDay(localDateTime)){
-                            continue;
-                        }
-                        hasMissReport = true;
-                    }
                     BigDecimal bigDecimal=new BigDecimal(num);
                     BigDecimal bigDecimalWithLeave=new BigDecimal(num+(daysWithLeave-days));
                     BigDecimal divide;
@@ -11463,7 +11428,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                     if(days!=0){
                         divide = bigDecimal.divide(BigDecimal.valueOf(days), 2, BigDecimal.ROUND_HALF_UP);
                     }else if(days==0){
-                        divide=new BigDecimal(1);
+                        divide=new BigDecimal(0);
                         //查看当天有请假直接算100%
                     }else if (days==0&&num!=0&&leaveSheetList.size()>0){
                         divide=new BigDecimal(1);
@@ -11477,7 +11442,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                     if(daysWithLeave!=0){
                         divideWithLeave = bigDecimalWithLeave.divide(BigDecimal.valueOf(daysWithLeave), 2, BigDecimal.ROUND_HALF_UP);
                     }else if(daysWithLeave==0){
-                        divideWithLeave=new BigDecimal(1);
+                        divideWithLeave=new BigDecimal(0);
                         //查看当天有请假直接算100%
                     }else if (daysWithLeave==0&&num!=0&&leaveSheetList.size()>0){
                         divideWithLeave=new BigDecimal(1);
@@ -11501,7 +11466,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                         System.out.println("及时日=="+num+","+days);
                         divide = bigDecimal.divide(BigDecimal.valueOf(days), 2, BigDecimal.ROUND_HALF_UP);
                     }else if(days==0){
-                        divide=new BigDecimal(1);
+                        divide=new BigDecimal(0);
                         //查看当天有请假直接算100%
                     }else if (days==0&&num!=0&&leaveSheetList.size()>0){
                         divide=new BigDecimal(1);
@@ -11517,7 +11482,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                     if(daysWithLeave!=0){
                         divideWithLeave = bigDecimalWithLeave.divide(BigDecimal.valueOf(daysWithLeave), 2, BigDecimal.ROUND_HALF_UP);
                     }else if(daysWithLeave==0){
-                        divideWithLeave=new BigDecimal(1);
+                        divideWithLeave=new BigDecimal(0);
                         //查看当天有请假直接算100%
                     }else if (daysWithLeave==0&&num!=0&&leaveSheetList.size()>0){
                         divideWithLeave=new BigDecimal(1);

+ 2 - 2
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/util/ExcelUtil.java

@@ -1487,9 +1487,9 @@ public class ExcelUtil {
         String result="系统提示:Excel文件导出成功!";
         String fileName="";
         if (type==0){
-            fileName= "任务工时填报及时表_任务"+".xlsx";
+            fileName= "任务工时填报及时表_任务"+System.currentTimeMillis()+".xlsx";
         }else {
-            fileName= "任务工时填报及时表_人员"+".xlsx";
+            fileName= "任务工时填报及时表_人员"+System.currentTimeMillis()+".xlsx";
         }
 
         try {

+ 3 - 2
fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/ReportMapper.xml

@@ -1117,7 +1117,8 @@
 
 
     <select id="getUserReportTimelinessRateWithTask" resultType="java.util.Map">
-        select `user`.name as userName,t.id taskId, `user`.corpwx_userid as corpwxUserId,`user`.corpwx_deptid as corpwxDeptId,rl.operate_date as createDate,MIN(rl.work_date )as createTime
+        select `user`.id as userId, `user`.name as userName,t.id taskId, `user`.corpwx_userid as corpwxUserId,`user`.corpwx_deptid as corpwxDeptId,
+               rl.work_date as createDate,MIN(rl.operate_date )as createTime
         from report_log_detail rl
         left join `user` on `user`.id=rl.operator_id
         left join report r on r.id =rl.report_id
@@ -1130,7 +1131,7 @@
                 #{item}
             </foreach>
         </if>
-        group by t.id
+        group by t.id,user.id,rl.work_date
     </select>
 
     <select id="getDefaultDegree" resultType="java.util.Map">

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

@@ -5079,7 +5079,8 @@ export default {
         this.obtainMonthlyFinancialStatementsRows = {
           ...res.data,
           detailList: (res.data.detailList || []).map(item => {
-            const timeFields = ['maintanceTime', 'debugTime', 'waitingTime', 'assistTime', 'publicTime'];
+            const timeFields = ['maintanceTime', 'debugTime', 'waitingTime', 'assistTime', 'publicTime', 'composeTime'];
+            // const timeFields = ['composeTime', 'repairTime', 'publicTime'];
             const projectWorkingHoursFields = ['bustripTime', 'cleanTime']
             const totalTime = timeFields.reduce((sum, key) => sum + (item[key] || 0), 0);
             const projectWorkingHours = projectWorkingHoursFields.reduce((sum, key) => sum + (item[key] || 0), 0)

+ 83 - 7
fhKeeper/formulahousekeeper/timesheet/src/views/project/financeComponents/salaryDetails.vue

@@ -9,10 +9,16 @@
                 <el-form-item :label="this.$t('Selectmonth')">
                     <el-date-picker size="small" v-model="date" :editable="false" format="yyyy-MM"
                         value-format="yyyy-MM" @change="loadMonthData" :clearable="false" type="month"
-                        :placeholder="$t('Selectmonth')" style="margin-right: 20px"></el-date-picker>
+                        :placeholder="$t('Selectmonth')" style="margin-right: 20px;width: 120px"></el-date-picker>
                     <el-link type="primary" :underline="false" @click="audits()"
                         v-if="user.timeType.financeAudit == '1'">{{ revaelse }}</el-link>
                 </el-form-item>
+                <el-form-item label="部门">
+                    <el-cascader v-model="departmentId" :placeholder="$t('qing-xuan-ze-bu-men')" style="width: 160px" @change="loadMonthData"
+                      :options="departmentArray" :props="{ checkStrictly: true,expandTrigger: 'hover' }" :show-all-levels="false"  clearable v-if="user.userNameNeedTranslate != 1" size="small"></el-cascader>
+
+                      <vueCascader :size="'small'" :widthStr="'160'" :clearable="true && user.userNameNeedTranslate != 1" :subject="departmentArray" :subjectId="departmentId" :radios="true" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1" ></vueCascader>
+                </el-form-item>
                 <!-- <el-radio-group v-model="radio" @change="switchList" style="margin-left:160px;margin-top:5px;"> -->
                 <el-radio-group size="small" v-model="radio" @change="switchList"
                     style="margin-left:150px;margin-top:5px;">
@@ -795,10 +801,13 @@ import { error } from 'dingtalk-jsapi';
 import util from "../../../common/js/util";
 // 自定义select组件
 import selectCat from "@/components/select.vue"
+ // 引入自定义级联组件
+import vueCascader from "@/components/cascader.vue"
 import dayjs from 'dayjs';
 export default {
     components: {
-        selectCat
+        selectCat,
+        vueCascader
     },
     props: {
         typeOfFunds: {
@@ -895,9 +904,62 @@ export default {
             notParticipatingInSharedProjectsLoading: false,
             notParticipatingInSharedAllProject: false,
             notParticipatingInSharedProjectDisabled: false,
+            departmentId: '',
+            departmentArray: []
         };
     },
     methods: {
+        // 获取部门列表
+        getDepartment() {
+            this.http.post(
+                this.port.manage.depList,
+                {},
+                (res) => {
+                if (res.code == "ok") {
+                    var list = res.data,
+                        list1 = JSON.parse(JSON.stringify(res.data));
+                        list.splice(0, 0, {
+                        id: -1,
+                        label: this.$t('lable.allStaff'),
+                    });
+                    list.push({
+                        id: 0,
+                        label: this.$t('lable.unassigned'),
+                    });
+                    this.departmentArray = this.changeArr(list1);
+                } else {
+                    this.$message({
+                        message: res.msg,
+                        type: "error",
+                    });
+                }
+                },
+                (error) => {
+                this.$message({
+                    message: error,
+                    type: "error",
+                });
+                }
+            );
+        },
+        // 修改数组
+        changeArr(arr) {
+        for (var i = 0; i < arr.length; i++) {
+            if (arr[i].id != -1 && arr[i].id != 0) {
+            if (arr[i].children != null && arr[i].children.length > 0) {
+                arr[i].children = this.changeArr(arr[i].children);
+            }
+            arr[i].id && (arr[i].value = arr[i].id);
+            delete arr[i].id;
+            }
+        }
+        for (var i in arr) {
+            if (arr[i].id == -1 || arr[i].id == 0) {
+            arr.splice(i, 1);
+            }
+        }
+        return arr;
+        },
         switchMenu() {
             this.$emit('switchMenu')
         },
@@ -1098,7 +1160,8 @@ export default {
         exportFinance() {
             this.isUploading = true;
             this.http.post('/finance/exportFinance', {
-                date: this.exportMonth
+                date: this.exportMonth,
+                deptId: this.departmentId[this.departmentId.length - 1]
             }, res => {
                 this.isUploading = false;
                 if (res.code == 'ok') {
@@ -1583,7 +1646,11 @@ export default {
         // },
         assignToProject() {
             var _this = this;
-            this.http.post('/finance/getTimeCost', { yearMonth: this.date, assignNoProUser: this.assignNoProUser },
+            this.http.post('/finance/getTimeCost', { 
+                yearMonth: this.date, 
+                assignNoProUser: this.assignNoProUser,
+                deptId: this.departmentId[this.departmentId.length - 1]
+            },
                 res => {
                     if (res.code == "ok") {
 
@@ -1717,7 +1784,8 @@ export default {
                 date: this.date,
                 assignNoProUser: this.assignNoProUser,
                 groupByCategory: this.groupByCategory,
-                onlyTotal: this.personnelAllocation ? 1 : 0
+                onlyTotal: this.personnelAllocation ? 1 : 0,
+                deptId: this.departmentId[this.departmentId.length - 1]
             },
                 res => {
                     this.exportDataProcessing = false;
@@ -1781,9 +1849,14 @@ export default {
             this.getList();
             this.assignToProject();
             this.getMonths()
-
             this.getAllocateSelectedItems()
         },
+        vueCasader(obj) {
+            if(obj.distinction == '1') {
+                this.departmentId = [obj.id]
+                this.loadMonthData()
+            }
+        },
         // 批量导入人员薪资
         importFinance(item) {
             //首先判断文件类型
@@ -1879,7 +1952,8 @@ export default {
             this.listLoading = true;
             this.http.post('/finance/getByMonth', {
                 companyId: this.user.companyId,
-                yearMonth: this.date
+                yearMonth: this.date,
+                deptId: this.departmentId[this.departmentId.length - 1]
             },
                 res => {
                     this.listLoading = false;
@@ -2156,6 +2230,8 @@ export default {
         this.scrollFunction()
         this.getAllProjectList()
         this.getAllocateSelectedItems()
+
+        this.getDepartment()
     },
     updated() {
         this.$nextTick(() => {

+ 3 - 3
fhKeeper/formulahousekeeper/timesheet_mld/src/i18n/zh.json

@@ -491,8 +491,8 @@
   "names": "名称",
   "bian-ji": "编辑",
   "addsubitems": "新增子项目",
-  "taskdefinition": "任务内容",
-  "enterthetaskcontent": "请输入任务内容",
+  "taskdefinition": "计划内容",
+  "enterthetaskcontent": "请输入计划内容",
   "pleaseselectadate": "请选择日期",
   "pleaseselectanexecutor": "请选择执行人",
   "plantime": "计划工时",
@@ -543,7 +543,7 @@
   "deletetheproject": "删除项目",
   "editingtasks": "编辑任务",
   "releasesuccess": "发布成功",
-  "createtask ": "创建任务",
+  "createtask ": "创建计划",
   "imageexceeds2MBpleaseuploaditagain": "图片超过了2MB,请重新上传",
   "pictureistoolargepleaseuploaditagain": "图片太大,请重新上传",
   "executorhasduplication": "执行人存在重复",

+ 101 - 30
fhKeeper/formulahousekeeper/timesheet_mld/src/views/project/project_gantt.vue

@@ -113,12 +113,12 @@
           <el-button size="small" @click="weekSwitching('next')">下周</el-button>
         </div>
 
-        <div class="eachLayout">
+        <!-- <div class="eachLayout">
           <div class="eachLayout-colorBlock" style="background: #ffa500">待审核</div>
           <div class="eachLayout-colorBlock" style="background: #32cd32">已通过</div>
-          <div class="eachLayout-colorBlock" style="background: #ff0000">已驳回/漏填</div>
+          <div class="eachLayout-colorBlock" style="background: #ff0000">已驳回</div>
           <div class="eachLayout-colorBlock" style="background: #e0e0e0">未提交</div>
-        </div>
+        </div> -->
       </template>
 
       <!-- 任务类型 -->
@@ -192,18 +192,33 @@
       </template>
     </div>
 
-    <div :style="`height: ${radio1 == $t('an-xiang-mu-cha-kan') ? '40' : '0'}px`"></div>
-
-    <gantt v-if="isDataLoaded && user.userNameNeedTranslate != 1" ref="ganttTable1" class="left-container" :tasks="tasks" 
-    :stafforpro="radio1"
-    :valueDate="valueDate"
-    :key="updatakey1" 
-    @closeBounced="closeBounced"
-    :style="`height: ${radio1 == $t('an-xiang-mu-cha-kan') ? '84' : '88'}vh`"
-    ></gantt>
-    <vueGantt v-if="isDataLoaded && user.userNameNeedTranslate == 1" ref="ganttTable1" :stafforpro="radio1"
-    :valueDate="valueDate"
-    :key="updatakey1" :tasks="tasks"></vueGantt>
+    <div class="ganttChartLayout" v-if="isDataLoaded && user.userNameNeedTranslate != 1">
+      <div class="ganttChartStatusLayout">
+        <div class="ganttChartStatusLayout-title">审核状态</div>
+        <div class="ganttChartLayout-sts">
+          <div class="eachLayout-colorBlock" style="background: #ffa500">待审核</div>
+          <div class="eachLayout-colorBlock" style="background: #32cd32">已通过</div>
+          <div class="eachLayout-colorBlock" style="background: #ff0000">已驳回</div>
+          <div class="eachLayout-colorBlock" style="background: #e0e0e0">未提交</div>
+        </div>
+        <div class="ganttChartStatusLayout-title">计划状态</div>
+        <div class="ganttChartPlanStatus">
+          <template v-if="typeList && typeList.length">
+            <div
+              class="planStatusItems"
+              v-for="items in typeList"
+              :key="items.id"
+              :style="getPlanStatusStyle(items)"
+            >
+              {{ items.name || [] }}
+            </div>
+          </template>
+        </div>
+      </div>
+      <gantt ref="ganttTable1" class="left-container" :tasks="tasks" :stafforpro="radio1":valueDate="valueDate":key="updatakey1" @closeBounced="closeBounced":style="`height: 88vh`"
+      ></gantt>
+    </div>
+    
 
   <div class="demand-container" v-if="!isDataLoaded">
     <el-table height="84vh" :loading="demandListLoading" :data="demandList" border>
@@ -374,6 +389,14 @@ export default {
     localStorage.removeItem('ganttChartTaskId')
   },
   methods: {
+    getPlanStatusStyle(items) {
+      const color = items.color || '';
+      return {
+        color: color ? '#fff' : '',
+        background: color ? color : '',
+        borderColor: color ? color : ''
+      };
+    },
     // 获取部门列表
     getDepartment() {
         this.http.post( this.port.manage.depList, {},
@@ -873,7 +896,26 @@ export default {
     display: flex;
     align-items: center;
   }
+  .ganttChartLayout {
+    width: 100%;
+    height: 88vh;
+    display: flex;
+    justify-content: space-between;
+  }
+  .ganttChartStatusLayout {
+    width: 200px;
+    margin-right: 16px;
+    height: 100%;
+    border: 1px solid #cecece;
+    display: flex;
+    box-sizing: border-box;
+    padding: 10px 0;
+    display: flex;
+    flex-direction: column;
+  }
+
   .left-container {
+    flex: 1;
     overflow: hidden;
     position: relative;
   }
@@ -926,24 +968,53 @@ export default {
       display: flex;
       flex-wrap: wrap;
       line-height: 18px;
+    }
 
-      .eachLayout {
-        display: flex;
-        align-items: center;
-        margin-right: 30px;
-        margin-bottom: 12px;
-
-        .eachLayout-title {
-          margin-right: 10px;
-        }
+    .eachLayout {
+      display: flex;
+      align-items: center;
+      margin-right: 30px;
+      margin-bottom: 12px;
 
-        .eachLayout-colorBlock {
-          padding: 6px 14px;
-          color: #fff;
-          border-radius: 4px;
-          margin-right: 10px;
-        }
+      .eachLayout-title {
+        margin-right: 10px;
       }
     }
+
+    .ganttChartStatusLayout-title {
+      line-height: 16px;
+      font-size: 16px;
+      font-weight: bold;
+      padding: 0 10px;
+    }
+
+    .ganttChartLayout-sts {
+      line-height: 16px;
+      margin-bottom: 20px;
+    }
+
+    .eachLayout-colorBlock {
+      padding: 8px 14px;
+      color: #fff;
+      border-radius: 4px;
+      margin: 12px 10px 0 10px;
+    }
+
+    .ganttChartPlanStatus {
+      margin-top: 12px;
+      padding: 0 10px;
+      line-height: 16px;
+      overflow-y: auto;
+      flex: 1;
+    }
+
+    .planStatusItems {
+      padding: 8px 14px;
+      color: #fff;
+      border-radius: 4px;
+      margin-bottom: 12px;
+      border: 1px solid #cecece;
+      color: #999;
+    }
   }
 </style>