QuYueTing пре 3 недеља
родитељ
комит
059421da5f

+ 4 - 4
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/OvertimeAllowanceController.java

@@ -114,8 +114,8 @@ public class OvertimeAllowanceController {
         if (isAllowance) {
             queryWrapper.ge("type", 0);
         } else {
-            //只取考勤加班的数据,type=-1或者白班加班,周末加班
-            queryWrapper.and(w->w.eq("type", -1).or().eq("type", 0).or().eq("type", 1).or().eq("type", 4));
+            //有加班时长的都算
+            queryWrapper.gt("overtime_duration", 0);
         }
 
         // 根据userId查询
@@ -588,8 +588,8 @@ public class OvertimeAllowanceController {
             if (isAllowance) {
                 queryWrapper.ge("type", 0);
             }  else {
-                //只取考勤加班的数据,type=-1或者白班加班,周末加班
-                queryWrapper.and(w->w.eq("type", -1).or().eq("type", 0).or().eq("type", 1).or().eq("type", 4));
+                //取有加班时长的
+                queryWrapper.gt("overtime_duration", 0);
             }
             // 根据userId查询
             if (!StringUtils.isEmpty(userId)) {

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

@@ -3757,9 +3757,11 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
             //日报的审核过程记录
             saveApproveReportLog(company.getId(), reportList, user.getId(), user.getName(), false);
 
+            LocalDate createDate = reportList.get(0).getCreateDate();
             if (company.getId().equals(Constant.XI_HE_CHAO_DAO_COMPANY_ID)) {
-                LocalDate createDate = reportList.get(0).getCreateDate();
                 hrAutoApprove(creatorId, createDate);
+            }
+            if (company.getId().equals(Constant.XI_HE_CHAO_DAO_COMPANY_ID) || company.getId().equals(Constant.XI_HE_CHAO_DAO_JIA_XING_COMPANY_ID)) {
                 //更新加班餐补表的日报状态
                 Report report = reportMapper.selectOne(new QueryWrapper<Report>().select("state").eq("company_id", company.getId()).eq("creator_id", creatorId).eq("create_date", createDate).last("limit 1"));
                 if (report.getState() == 1) {
@@ -5388,7 +5390,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
             if (membList.size() > 0) {
                 reportAlogMembdateService.saveBatch(membList);
             }
-            if (company.getId().equals(Constant.XI_HE_CHAO_DAO_COMPANY_ID)) {
+            if (company.getId().equals(Constant.XI_HE_CHAO_DAO_COMPANY_ID) || company.getId().equals(Constant.XI_HE_CHAO_DAO_JIA_XING_COMPANY_ID)) {
                 List<Report> distinctDayReport = new ArrayList<>();
                 for (Report r : allReports) {
                     LocalDate date = r.getCreateDate();
@@ -5398,7 +5400,9 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                     }
                 }
                 for (Report r : distinctDayReport) {
-                    hrAutoApprove(r.getCreatorId(), r.getCreateDate());
+                    if (company.getId().equals(Constant.XI_HE_CHAO_DAO_COMPANY_ID)) {
+                        hrAutoApprove(r.getCreatorId(), r.getCreateDate());
+                    }
                     //更新加班餐补表的日报状态
                     Report report = reportMapper.selectOne(new QueryWrapper<Report>().select("state").eq("company_id", company.getId()).eq("creator_id", r.getCreatorId()).eq("create_date", r.getCreateDate()).last("limit 1"));
                     if (report.getState() == 1) {

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

@@ -1248,7 +1248,6 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
         }
         LocalDate minDate = distinctReportList.stream().min(Comparator.comparing(Report::getCreateDate)).get().getCreateDate();
         LocalDate maxDate = distinctReportList.stream().max(Comparator.comparing(Report::getCreateDate)).get().getCreateDate();
-
         List<Report> sumReportList = reportMapper.selectList(new QueryWrapper<Report>()
                 .select("creator_id,create_date, sum(overtime_hours) as overtime_hours")
                 .in("creator_id", distinctUserIds).between("create_date", minDate, maxDate).ne("state", 2).groupBy("creator_id,create_date"));//驳回的不算
@@ -1260,6 +1259,7 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
             LocalDate date = item.getCreateDate();
             //查询日报的合计加班时长
             double reportOvertime = sumReportList.stream().filter(r -> r.getCreatorId().equals(userId) && r.getCreateDate().equals(date)).findFirst().map(Report::getOvertimeHours).orElse(0.0);
+
             User user = userList.stream().filter(u -> u.getId().equals(userId)).findFirst().orElse(null);
             UserCorpwxTime userCorpwxTime = userCorpwxTimes.stream().filter(u -> u.getCorpwxUserid().equals(user.getCorpwxUserid()) && u.getCreateDate().equals(date)).findFirst().orElse(null);
             if (userCorpwxTime != null) {
@@ -1356,14 +1356,14 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
         allowance.setStartTime(startTime);
         allowance.setEndTime(endTime);
         String startTimeTxt = userCorpwxTime.getStartTime();
-        String endTimeTxt = userCorpwxTime.getEndTime();
+        String endTimeTxt = endTimeStr.startsWith("次日")?endTimeStr.replace("次日",""):endTimeStr;
         BigDecimal bigDecimal = new BigDecimal(Duration.between(startTime,endTime).toMinutes());
         bigDecimal = bigDecimal.divide(BigDecimal.valueOf(60),1,BigDecimal.ROUND_HALF_UP);//按小时为单位
         double standWorkHours = 8.0;
         double onDutyTime = bigDecimal.doubleValue();
         allowance.setOnDutyHours(onDutyTime);
         double time = onDutyTime;
-        if (startTimeTxt.compareTo(baseMorningEnd) <= 0 && endTimeTxt.compareTo(baseAfternoonStart) >= 0) {
+        if (startTimeTxt.compareTo(baseMorningEnd) <= 0 && (endTimeTxt.compareTo(baseAfternoonStart) >= 0 || isNextDay)) {
             //重新计算实际工作工时时长,需要减去中间午休时间
             time = time - restTime;
             System.out.println("午休时间:" + restTime + ", 减去后,工作时长=" + time);

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

@@ -48,7 +48,7 @@
                 AND type &gt;= 0
             </when>
             <otherwise>
-                AND (type = -1 OR type = 0 OR type = 1 OR type = 4)
+                AND overtime_duration &gt; 0
             </otherwise>
         </choose>
         <if test="noRecords == true">

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

@@ -9883,7 +9883,10 @@
                                                     type: "error"
                                                 });
                                                 return;
-                                            } 
+                                            } else {
+                                                //放一个null进去
+                                                formData.append("projectAuditorId", this.workForm.domains[i].projectAuditorId);
+                                            }
                                         }
                                     } else {
                                         //无审批流