Selaa lähdekoodia

日报和企业微信考勤同步

seyason 3 vuotta sitten
vanhempi
commit
5abafe0597

+ 9 - 2
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ReportServiceImpl.java

@@ -1786,8 +1786,15 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                                         curReport.setIsDeptAudit(nextNode.getIsDeptAudit());
                                         if (curReport.getIsDeptAudit() == 1) {
                                             curReport.setAuditDeptid(nextNode.getAuditDeptId());
-                                            curReport.setAuditDeptManagerid(allDepts.stream()
-                                                    .filter(ad->ad.getDepartmentId().equals(nextNode.getAuditDeptId())).findFirst().get().getManagerId());
+                                            Optional<Department> first = allDepts.stream()
+                                                    .filter(ad -> ad.getDepartmentId().equals(nextNode.getAuditDeptId())).findFirst();
+                                            if (!first.isPresent()) {
+
+                                                System.out.println(item.getId()+"下个节点找不到: "+nextNode.getAuditDeptId()+", "+nextNode.getAuditDeptName());
+
+                                            }
+                                            String managerId = first.get().getManagerId();
+                                            curReport.setAuditDeptManagerid(managerId);
                                         }
                                         curReport.setIsFinalAudit(nextNode.getIsFinal());
                                         break;

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

@@ -280,7 +280,6 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
         }
         String url = null;
         try {
-
             startDateTime = startDateTime.withHour(0).withMinute(0).withSecond(0).withNano(0);
             long startTime = startDateTime.toEpochSecond(ZoneOffset.of("+8"));
             endDateTime = endDateTime.withHour(0).withMinute(0).withSecond(0).withNano(0);
@@ -511,6 +510,7 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
                         //超过下午上班的开始时间,需要减去午休的时间
                         if (ct.getEndTime().compareTo(baseAfternoonStart) >= 0) {
                             //重新计算打卡工时时,需要减去中间午休时间
+
                             timeDelta -= restTime;
                         }
                     } else {
@@ -570,8 +570,11 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
                                 //检查请假时间段是否在打卡的时间范围内
                                 if ("上午".equals(leaveEnd) || "下午".equals(leaveEnd)) {
                                     //半天或者全天请假, 上面已经处理过结束时间为请假之前的时间了,此处不需要再处理了
-                                    if (showLog)System.out.println("====半天或者全天请假 =转化为8小时制下的时间="+(ct.getAskLeaveTime()/24*8.0));
-                                    ct.setAskLeaveTime(ct.getAskLeaveTime()/24*8.0);//转换成一天8小时工作制
+                                    if (ct.getAskLeaveTime() >= 12) {
+                                        if (showLog)System.out.println("====半天或者全天请假 =转化为8小时制下的时间="+(ct.getAskLeaveTime()/24*8.0));
+                                        //12小时以上的,是请假半天或者全天的。 防止1天有2次上下午分开的请假,导致计算两次的错误
+                                        ct.setAskLeaveTime(ct.getAskLeaveTime()/24*8.0);//转换成一天8小时工作制
+                                    }
                                 } else if (ct.getStartTime().compareTo(leaveStart) <= 0 && ct.getEndTime().compareTo(leaveEnd) >= 0) {
                                     String hourLeaveTime = leaveText.replaceAll("请假", "").replaceAll("小时", "");
                                     if (showLog)System.out.println("请假时长=" + hourLeaveTime);