Browse Source

日报工时修改

QuYueTing 3 weeks ago
parent
commit
a3ffb8826e

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

@@ -839,7 +839,7 @@ public class UserCorpwxTimeController {
                 msg.setError("数据格式有误:" +l.getName()+","+l.getCreateDate());
             }
             //工作时长四舍五入
-            l.setWorkHours(DateTimeUtil.getHalfHoursFromDouble(l.getWorkHours()));
+            l.setWorkHours(l.getWorkHours());
             l.setWeekDay(l.getCreateDate().getDayOfWeek().getValue());
             l.setWeekDayTxt(DateTimeUtil.getWeekDayTxt(l.getWeekDay()));
         });

+ 19 - 2
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/ExcelParserService.java

@@ -1,6 +1,7 @@
 package com.management.platform.service;
 
 import com.management.platform.entity.UserCorpwxTime;
+import com.management.platform.util.DateTimeUtil;
 import org.apache.poi.ss.usermodel.*;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 import org.springframework.stereotype.Service;
@@ -143,7 +144,15 @@ public class ExcelParserService {
         }
     }
 
-    private double calculateWorkHours(String startTime, String endTime) {
+    public static void main(String[] args) {
+        String startTime = "08:30";
+        String endTime = "18:16";
+        double workHours = calculateWorkHours(startTime, endTime);
+
+        System.out.println("工作时长:" + workHours + "小时");
+    }
+
+    public static double calculateWorkHours(String startTime, String endTime) {
         // 简单计算工作时长(小时)
         // 实际应用中需要更精确的计算,考虑午休时间等
         String[] startParts = startTime.split(":");
@@ -166,9 +175,17 @@ public class ExcelParserService {
             hours -= 1;
         }
         //减去晚休时间,17:30-18:00
-        if (startHour <= 17 && endHour > 18) {
+        if (startHour <= 17 && endHour >= 18) {
             hours -= 0.5;
         }
+        double minPart = hours - (int)hours;
+
+        if (minPart > 0 && minPart < 0.5) {
+            minPart = 0;
+        } else if (minPart > 0.5) {
+            minPart = 0.5;
+        }
+        hours = (int)hours + minPart;
 
         return hours;
     }

+ 3 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ReportServiceImpl.java

@@ -8740,7 +8740,9 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
             List<Stages> stagesList = integerList.size() > 0?stagesMapper.selectList(new QueryWrapper<Stages>().in("project_id", integerList)) : new ArrayList<>();
             //获取当前项目的子项目列表,任务分组,任务列表,项目相关维度列表
             reports.forEach(r->{
-                r.setContent(null);
+                if (!(companyId == 8138 || companyId == 7703)) {
+                    r.setContent(null);
+                }
                 allProjectList.stream().filter(pItem->pItem.getId().equals(r.getProjectId())).findFirst().ifPresent(p->r.setProjectName(p.getProjectName()));
                 r.setSubProjectList(subProjectList.stream().filter(s->s.getProjectId().equals(r.getProjectId())).collect(Collectors.toList()));
                 r.setTaskList(taskMapper.recentSimpleList(r.getProjectId(), userId, r.getStage(), r.getGroupId()));

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

@@ -454,7 +454,7 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
                         }
                     }
                     if (groupId == null) {
-                        throw new Exception("任务分组不存在:"+taskGroupName);
+                        throw new Exception(projectName+"项目下的任务分组不存在:"+taskGroupName);
                     }
                 }
                 task.setProjectId(projectId);

File diff suppressed because it is too large
+ 0 - 1088
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/TaskServiceImpl.java~


+ 1 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/util/DateTimeUtil.java

@@ -62,6 +62,7 @@ public class DateTimeUtil {
         return decimal.setScale(0, BigDecimal.ROUND_HALF_UP).doubleValue()/2;
     }
 
+
     public static LocalDate getLocalDateFromSeconds(long time) {
         LocalDate localDate = LocalDateTime.ofInstant(Instant.ofEpochSecond(time), ZoneId.systemDefault()).toLocalDate();
         return localDate;

+ 2 - 1
fhKeeper/formulahousekeeper/timesheet/src/views/workReport/daily.vue

@@ -6500,7 +6500,8 @@
                                     auditorSec: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorSec ? aiReportData[i].auditorSetting.auditorSec : '',
                                     auditorThird: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorThird ? aiReportData[i].auditorSetting.auditorThird : '',
                                     ccUserid: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.ccUserid ? aiReportData[i].auditorSetting.ccUserid : '',
-                                    canEdit: true
+                                    canEdit: true,
+                                    content: aiReportData[i].content
                                 })
                             }
                             this.workForm.domains = arr;

+ 2 - 1
fhKeeper/formulahousekeeper/timesheet_h5/src/views/edit/index.vue

@@ -1786,7 +1786,8 @@ export default {
                                 sapServiceName: list[i].sapServiceName,
                                 serviceList: list[i].serviceList,
                                 userReportDeptName: list[i].userReportDeptName,
-                                reportTargetDeptId: list[i].deptId
+                                reportTargetDeptId: list[i].deptId,
+                                content: list[i].content
                             })
                         }
                         this.form.domains = arr;