|
|
@@ -522,7 +522,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
setConstructionStageList(reportList, stageList);
|
|
|
}
|
|
|
}
|
|
|
- if (timeType.getEnableNewWeeklyfill() == 1 || timeType.getEnableNewWeeklyfill() == 2) {
|
|
|
+ if (timeType.getEnableNewWeeklyfill() > 0) {
|
|
|
//新版按周填报有周总结
|
|
|
List<Integer> batchIds = new ArrayList<>();
|
|
|
for (Map map : nameList) {
|
|
|
@@ -1493,7 +1493,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
reportService.saveOrUpdateBatch(reportList);
|
|
|
//成都明夷电子,需要生成批量记录
|
|
|
Company company = companyMapper.selectById(companyId);
|
|
|
- if (company.getCompanyName().equals("成都明夷电子科技股份有限公司") || timeType.getEnableNewWeeklyfill() == 1 || timeType.getWeeklyChargeFilter() == 1) {//物奇需要填写周总结
|
|
|
+ if (company.getCompanyName().equals("成都明夷电子科技股份有限公司") || timeType.getEnableNewWeeklyfill() > 0 || timeType.getWeeklyChargeFilter() == 1) {//物奇需要填写周总结
|
|
|
if (date.contains("@")) {
|
|
|
//批量填报
|
|
|
String[] split = date.split("\\@");
|
|
|
@@ -1518,7 +1518,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
//每日或按周填报,为每天生成一条记录; 每日或者按周填报时,填报人就是操作人自己,不存在代填的情况
|
|
|
List<LocalDate> dateList = reportList.stream().map(Report::getCreateDate).distinct().collect(Collectors.toList());
|
|
|
String creatorId = reportList.get(0).getCreatorId();
|
|
|
- if (timeType.getEnableNewWeeklyfill() == 1 || timeType.getWeeklyChargeFilter() == 1) {
|
|
|
+ if (timeType.getEnableNewWeeklyfill() > 0 || timeType.getWeeklyChargeFilter() == 1) {
|
|
|
//按周填报,需要保存周总结
|
|
|
//获取本周开始和结束的日期
|
|
|
DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
|
@@ -1529,7 +1529,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
List<HashMap> dateRange = (List<HashMap>)mapItem.get("dateList");
|
|
|
minDate = LocalDate.parse((String)dateRange.get(0).get("date"), dtf);
|
|
|
maxDate = LocalDate.parse((String)dateRange.get(dateRange.size()-1).get("date"), dtf);
|
|
|
- } else if (timeType.getWeeklyChargeFilter() == 1) {
|
|
|
+ } else if (timeType.getEnableNewWeeklyfill() == 2 || timeType.getWeeklyChargeFilter() == 1) {
|
|
|
//根据targetDate获取本周的日期
|
|
|
LocalDate inWeekDate = dateList.get(0);
|
|
|
minDate = inWeekDate.with(DayOfWeek.MONDAY);
|
|
|
@@ -1773,8 +1773,8 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
userCorpwxTime.setName(user.getName());
|
|
|
userCorpwxTime.setCreateDate(createDate);
|
|
|
userCorpwxTime.setStartTime(abnormalStartTime);
|
|
|
- userCorpwxTime.setEndTime(abnormalEndTime);
|
|
|
String convertEndTime = (abnormalEndDay==1?"次日":"") + abnormalEndTime;
|
|
|
+ userCorpwxTime.setEndTime(convertEndTime);
|
|
|
userCorpwxTime.setWorkHours(DateTimeUtil.calculateWorkHours(abnormalStartTime, convertEndTime));
|
|
|
userCorpwxTime.setWeekDay(createDate.getDayOfWeek().getValue());
|
|
|
userCorpwxTime.setWeekDayTxt(DateTimeUtil.getWeekDayTxt(createDate.getDayOfWeek().getValue()));
|
|
|
@@ -1965,12 +1965,16 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
List<ReportLogDetail> addLogDetailList = new ArrayList<>();
|
|
|
// List<Integer> projectIds = reportList.stream().map(Report::getProjectId).collect(Collectors.toList());
|
|
|
// List<Project> projectList = projectMapper.selectList(new QueryWrapper<Project>().select("id, project_name").in("id", projectIds));
|
|
|
+ TimeType timeType = timeTypeMapper.selectById(companyId);
|
|
|
//操作审核通过
|
|
|
for (Report report : reportList) {
|
|
|
ReportLog log = new ReportLog();
|
|
|
log.setCreatorId(report.getCreatorId());
|
|
|
log.setCreateDate(report.getCreateDate());
|
|
|
String msg = opName+"审核通过了日报";
|
|
|
+ if (timeType.getReportAutoApprove() == 1 && timeType.getReportAutoApproveDays() == 0) {
|
|
|
+ msg += "(自动审核)";
|
|
|
+ }
|
|
|
//去重
|
|
|
Optional<ReportLog> oldLog = addLogList.stream().filter(add -> add.getCreateDate().isEqual(log.getCreateDate()) && add.getCreatorId().equals(log.getCreatorId())).findFirst();
|
|
|
if (!oldLog.isPresent()) {
|
|
|
@@ -2672,6 +2676,38 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ if (timeType.getEnableNewWeeklyfill() > 0) {
|
|
|
+ //新版按周填报有周总结
|
|
|
+ List<Integer> batchIds = new ArrayList<>();
|
|
|
+ for (Map map : nameList) {
|
|
|
+ List<Map<String, Object>> reportList = (List<Map<String, Object>>)map.get("data");
|
|
|
+ for (Map<String, Object> report : reportList) {
|
|
|
+ Integer batchId = (Integer)report.get("batchId");
|
|
|
+ if (!batchIds.contains(batchId)) {
|
|
|
+ batchIds.add(batchId);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (batchIds.size() > 0) {
|
|
|
+ List<ReportBatch> batchList = reportBatchMapper.selectList(new QueryWrapper<ReportBatch>().in("id", batchIds));
|
|
|
+ DateTimeFormatter sdf = DateTimeFormatter.ofPattern("MM/dd");
|
|
|
+ for (Map map : nameList) {
|
|
|
+ List<Map<String, Object>> reportList = (List<Map<String, Object>>)map.get("data");
|
|
|
+ if (reportList.size() > 0) {
|
|
|
+ Integer batchId = (Integer)((Map)reportList.get(0)).get("batchId");
|
|
|
+ Optional<ReportBatch> first = batchList.stream().filter(b -> b.getId().equals(batchId)).findFirst();
|
|
|
+ if (first.isPresent()) {
|
|
|
+ ReportBatch batchItem = first.get();
|
|
|
+ map.put("summaryTitle", sdf.format(batchItem.getStartDate())+"至"+sdf.format(batchItem.getEndDate())+"周总结:");
|
|
|
+ map.put("summary", batchItem.getSummary());
|
|
|
+ map.put("attachment", batchItem.getAttachment());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
//针对昱众,设置职能分工显示
|
|
|
if (companyId == 3385) {
|
|
|
List<ProjectFunctionalDivision> allDivList = projectFunctionalDivisionMapper.selectList(new QueryWrapper<ProjectFunctionalDivision>().eq("company_id", companyId));
|
|
|
@@ -2733,6 +2769,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
double wh = first.get().getWorkHours();
|
|
|
//赋值打卡时长
|
|
|
map.put("cardHours", wh);
|
|
|
+ map.put("modifiedByAdmin", first.get().getModifiedByAdmin());
|
|
|
map.put("startTime", first.get().getStartTime());
|
|
|
map.put("endTime", first.get().getEndTime());
|
|
|
if (company.getPackageOvertime() == 1) {
|
|
|
@@ -2745,6 +2782,8 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
map.put("overtime", first.get().getOtTime());//加班申请时长
|
|
|
}
|
|
|
map.put("askLeaveTime", first.get().getAskLeaveTime());//请假时长
|
|
|
+ map.put("outdoorTime", first.get().getOutdoorTime());//外出时长
|
|
|
+ map.put("askLeaveType", first.get().getAskLeaveType());//请假类型
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -9992,50 +10031,49 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
|
LocalDate date = LocalDate.parse(targetDate, dtf);
|
|
|
LocalDate firstDayOfWeek = date.with(DayOfWeek.MONDAY);
|
|
|
- LocalDate sunday = date.with(DayOfWeek.SUNDAY);
|
|
|
//需要填报的最后一天
|
|
|
- LocalDate lastDayOfWeek = sunday;
|
|
|
- int days = sunday.lengthOfMonth() - sunday.getDayOfMonth();
|
|
|
- if (days <= 3) {
|
|
|
- //周日距离月底相差天数在3天以内,比如周日是10.28,则10.29,10.30和10.31也算在本周内
|
|
|
- lastDayOfWeek = sunday.plusDays(days);
|
|
|
- }
|
|
|
+ LocalDate lastDayOfWeek = date.with(DayOfWeek.SUNDAY);
|
|
|
+// int days = sunday.lengthOfMonth() - sunday.getDayOfMonth();
|
|
|
+// if (days <= 3) {
|
|
|
+// //周日距离月底相差天数在3天以内,比如周日是10.28,则10.29,10.30和10.31也算在本周内
|
|
|
+// lastDayOfWeek = sunday.plusDays(days);
|
|
|
+// }
|
|
|
//如果上周只有2天以内工作日,需要并到这周来
|
|
|
- LocalDate lastSunday = firstDayOfWeek.minusDays(1);
|
|
|
- LocalDate lastSaturday = lastSunday.with(DayOfWeek.SATURDAY);
|
|
|
-
|
|
|
- if (WorkDayCalculateUtils.isWorkDay(lastSunday) && WorkDayCalculateUtils.isWorkDay(lastSaturday)) {
|
|
|
- //合并上周的工作日的情况:上周周末两天是工作日,并且只有2天以内工作日,需要并到这周来
|
|
|
- LocalDate lastMonday = lastSunday.with(DayOfWeek.MONDAY);
|
|
|
- boolean hasMoreWorkDays = false;
|
|
|
- while (lastMonday.isBefore(lastSaturday)) {
|
|
|
- if (WorkDayCalculateUtils.isWorkDay(lastMonday)) {
|
|
|
- hasMoreWorkDays = true;
|
|
|
- break;
|
|
|
- }
|
|
|
- lastMonday = lastMonday.plusDays(1);
|
|
|
- }
|
|
|
- if (!hasMoreWorkDays) {
|
|
|
- firstDayOfWeek = lastSaturday;
|
|
|
- }
|
|
|
- } else {
|
|
|
- //剔除被合并到上周的情况,如果本周一周二周三中有工作日,但是是上个月的月末,会被合并到上周去,本周要去掉
|
|
|
- boolean hasFirstDayOfMonth = false;
|
|
|
- LocalDate checkDate = firstDayOfWeek;
|
|
|
- int beforeDays = 0;
|
|
|
- while (!checkDate.isAfter(lastDayOfWeek)) {
|
|
|
- if (checkDate.getDayOfMonth() == 1) {
|
|
|
- hasFirstDayOfMonth = true;
|
|
|
- break;
|
|
|
- } else {
|
|
|
- beforeDays++;
|
|
|
- }
|
|
|
- checkDate = checkDate.plusDays(1);
|
|
|
- }
|
|
|
- if (hasFirstDayOfMonth && beforeDays <= 3) {
|
|
|
- firstDayOfWeek = checkDate;
|
|
|
- }
|
|
|
- }
|
|
|
+// LocalDate lastSunday = firstDayOfWeek.minusDays(1);
|
|
|
+// LocalDate lastSaturday = lastSunday.with(DayOfWeek.SATURDAY);
|
|
|
+
|
|
|
+// if (WorkDayCalculateUtils.isWorkDay(lastSunday) && WorkDayCalculateUtils.isWorkDay(lastSaturday)) {
|
|
|
+// //合并上周的工作日的情况:上周周末两天是工作日,并且只有2天以内工作日,需要并到这周来
|
|
|
+// LocalDate lastMonday = lastSunday.with(DayOfWeek.MONDAY);
|
|
|
+// boolean hasMoreWorkDays = false;
|
|
|
+// while (lastMonday.isBefore(lastSaturday)) {
|
|
|
+// if (WorkDayCalculateUtils.isWorkDay(lastMonday)) {
|
|
|
+// hasMoreWorkDays = true;
|
|
|
+// break;
|
|
|
+// }
|
|
|
+// lastMonday = lastMonday.plusDays(1);
|
|
|
+// }
|
|
|
+// if (!hasMoreWorkDays) {
|
|
|
+// firstDayOfWeek = lastSaturday;
|
|
|
+// }
|
|
|
+// } else {
|
|
|
+// //剔除被合并到上周的情况,如果本周一周二周三中有工作日,但是是上个月的月末,会被合并到上周去,本周要去掉
|
|
|
+// boolean hasFirstDayOfMonth = false;
|
|
|
+// LocalDate checkDate = firstDayOfWeek;
|
|
|
+// int beforeDays = 0;
|
|
|
+// while (!checkDate.isAfter(lastDayOfWeek)) {
|
|
|
+// if (checkDate.getDayOfMonth() == 1) {
|
|
|
+// hasFirstDayOfMonth = true;
|
|
|
+// break;
|
|
|
+// } else {
|
|
|
+// beforeDays++;
|
|
|
+// }
|
|
|
+// checkDate = checkDate.plusDays(1);
|
|
|
+// }
|
|
|
+// if (hasFirstDayOfMonth && beforeDays <= 3) {
|
|
|
+// firstDayOfWeek = checkDate;
|
|
|
+// }
|
|
|
+// }
|
|
|
|
|
|
// if (WorkDayCalculateUtils.isWorkDay(firstDayOfWeek) && firstDayOfWeek.getDayOfMonth() >= 30) {
|
|
|
// firstDayOfWeek = firstDayOfWeek.plusDays(1);
|
|
|
@@ -10044,10 +10082,10 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
// }
|
|
|
// }
|
|
|
//死代码 2025-01-27 周一 合并到1-26号那一周
|
|
|
- LocalDate specialDate = LocalDate.of(2025, 1, 27);
|
|
|
- if(lastDayOfWeek.plusDays(1).isEqual(specialDate)){
|
|
|
- lastDayOfWeek = specialDate;
|
|
|
- }
|
|
|
+// LocalDate specialDate = LocalDate.of(2025, 1, 27);
|
|
|
+// if(lastDayOfWeek.plusDays(1).isEqual(specialDate)){
|
|
|
+// lastDayOfWeek = specialDate;
|
|
|
+// }
|
|
|
|
|
|
|
|
|
|
|
|
@@ -10111,82 +10149,90 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
projectList = projectMapper.selectList(new QueryWrapper<Project>().in("id", collect));
|
|
|
final List<Project> finalProjectList = projectList;
|
|
|
//获取项目的任务分组列表
|
|
|
- //需要是他参与的任务分组
|
|
|
- List<GroupParticipator> groupParticipatorList = groupParticipatorMapper.selectList(new QueryWrapper<GroupParticipator>().eq("user_id", userId));
|
|
|
- List<Integer> joinGroupList = groupParticipatorList.stream().map(GroupParticipator::getGroupId).collect(Collectors.toList());
|
|
|
- if (joinGroupList.size() > 0) {
|
|
|
- List<TaskGroup> taskGroups = taskGroupMapper.selectList(new QueryWrapper<TaskGroup>().in("project_id", collect).in("id", joinGroupList));
|
|
|
- //获取负责人的用户集合
|
|
|
- List<String> inchargerIds = taskGroups.stream().map(TaskGroup::getInchargerId).collect(Collectors.toList());
|
|
|
- if (inchargerIds.size() == 0) {
|
|
|
- inchargerIds.add("-1");
|
|
|
- }
|
|
|
- List<User> userList = userMapper.selectList(new QueryWrapper<User>().in("id", inchargerIds));
|
|
|
- reportList.forEach(r->{
|
|
|
- r.setTaskGroups(taskGroups.stream().filter(tg->tg.getProjectId().equals(r.getProjectId())).collect(Collectors.toList()));
|
|
|
- for (TaskGroup gp : r.getTaskGroups()) {
|
|
|
- if (!StringUtils.isEmpty(gp.getInchargerId()) ) {
|
|
|
- if (gp.getInchargerId().equals(userId)) {
|
|
|
- //自己担任任务分组的负责人,自己的审核人是项目经理
|
|
|
- gp.setInchargerId(projectMapper.selectById(r.getProjectId()).getInchargerId());
|
|
|
- //如果自己就是项目经理,审核人变成自己的部门负责人
|
|
|
- if (gp.getInchargerId().equals(userId)) {
|
|
|
- Integer dpId = user.getDepartmentId();
|
|
|
- if (dpId != null && dpId > 0) {
|
|
|
- Department department = departmentMapper.selectById(dpId);
|
|
|
- if (department != null) {
|
|
|
- gp.setInchargerId(department.getManagerId());
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- //不存在的话,加上项目经理
|
|
|
- if (!userList.stream().anyMatch(u->u.getId().equals(gp.getInchargerId()))) {
|
|
|
- userList.add(userMapper.selectById(gp.getInchargerId()));
|
|
|
+
|
|
|
+
|
|
|
+ QueryWrapper<TaskGroup> taskGroupQueryWrapper = new QueryWrapper<TaskGroup>().in("project_id", collect);
|
|
|
+ if (timeType.getReportAuditType() == 1) {//分组负责人审核模式,需要按参与的任务分组显示
|
|
|
+ //需要是他参与的任务分组
|
|
|
+ List<GroupParticipator> groupParticipatorList = groupParticipatorMapper.selectList(new QueryWrapper<GroupParticipator>().eq("user_id", userId));
|
|
|
+ List<Integer> joinGroupList = groupParticipatorList.stream().map(GroupParticipator::getGroupId).collect(Collectors.toList());
|
|
|
+ if (joinGroupList.size() > 0) {
|
|
|
+ taskGroupQueryWrapper.in("id", joinGroupList);
|
|
|
+ } else {
|
|
|
+ taskGroupQueryWrapper.eq("id", -1);//没有分组
|
|
|
+ }
|
|
|
+ }
|
|
|
+ List<TaskGroup> taskGroups = taskGroupMapper.selectList(taskGroupQueryWrapper);
|
|
|
+ //获取负责人的用户集合
|
|
|
+ List<String> inchargerIds = taskGroups.stream().map(TaskGroup::getInchargerId).collect(Collectors.toList());
|
|
|
+ if (inchargerIds.size() == 0) {
|
|
|
+ inchargerIds.add("-1");
|
|
|
+ }
|
|
|
+ List<User> userList = userMapper.selectList(new QueryWrapper<User>().in("id", inchargerIds));
|
|
|
+ reportList.forEach(r->{
|
|
|
+ r.setTaskGroups(taskGroups.stream().filter(tg->tg.getProjectId().equals(r.getProjectId())).collect(Collectors.toList()));
|
|
|
+// for (TaskGroup gp : r.getTaskGroups()) {
|
|
|
+// if (!StringUtils.isEmpty(gp.getInchargerId()) ) {
|
|
|
+// if (gp.getInchargerId().equals(userId)) {
|
|
|
+// //自己担任任务分组的负责人,自己的审核人是项目经理
|
|
|
+// gp.setInchargerId(projectMapper.selectById(r.getProjectId()).getInchargerId());
|
|
|
+// //如果自己就是项目经理,审核人变成自己的部门负责人
|
|
|
+// if (gp.getInchargerId().equals(userId)) {
|
|
|
+// Integer dpId = user.getDepartmentId();
|
|
|
+// if (dpId != null && dpId > 0) {
|
|
|
+// Department department = departmentMapper.selectById(dpId);
|
|
|
+// if (department != null) {
|
|
|
+// gp.setInchargerId(department.getManagerId());
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// //不存在的话,加上项目经理
|
|
|
+// if (!userList.stream().anyMatch(u->u.getId().equals(gp.getInchargerId()))) {
|
|
|
+// userList.add(userMapper.selectById(gp.getInchargerId()));
|
|
|
+// }
|
|
|
+// }
|
|
|
+// Optional<User> first = userList.stream().filter(u -> u.getId().equals(gp.getInchargerId())).findFirst();
|
|
|
+// if (first.isPresent()) {
|
|
|
+// gp.setInchargerName(first.get().getName());
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+ //设置项目名称
|
|
|
+ Optional<Project> optional = finalProjectList.stream().filter(p->p.getId().equals(r.getProjectId())).findFirst();
|
|
|
+ if (optional.isPresent()) {
|
|
|
+ r.setProjectName(optional.get().getProjectName());
|
|
|
+ }
|
|
|
+ //设置自定义维度
|
|
|
+ if (timeType.getCustomDegreeActive() == 1) {
|
|
|
+ if (timeType.getCustomDegreeWithPro() == 1) {
|
|
|
+ String associateDegrees = optional.get().getAssociateDegrees();
|
|
|
+ List<HashMap> degreeMapList = new ArrayList<>();
|
|
|
+ if (associateDegrees != null) {
|
|
|
+ String[] split = associateDegrees.split("\\,");
|
|
|
+ for (int i=0;i<split.length; i++) {
|
|
|
+ HashMap map = new HashMap();
|
|
|
+ if (!StringUtils.isEmpty(split[i])) {
|
|
|
+ Integer id = Integer.parseInt(split[i]);
|
|
|
+ map.put("id", id);
|
|
|
+ map.put("name", degreeList.stream().filter(d->d.getId().equals(id)).findFirst().get().getName());
|
|
|
+ degreeMapList.add(map);
|
|
|
}
|
|
|
}
|
|
|
- Optional<User> first = userList.stream().filter(u -> u.getId().equals(gp.getInchargerId())).findFirst();
|
|
|
- if (first.isPresent()) {
|
|
|
- gp.setInchargerName(first.get().getName());
|
|
|
- }
|
|
|
}
|
|
|
- }
|
|
|
- //设置项目名称
|
|
|
- Optional<Project> optional = finalProjectList.stream().filter(p->p.getId().equals(r.getProjectId())).findFirst();
|
|
|
- if (optional.isPresent()) {
|
|
|
- r.setProjectName(optional.get().getProjectName());
|
|
|
- }
|
|
|
- //设置自定义维度
|
|
|
- if (timeType.getCustomDegreeActive() == 1) {
|
|
|
- if (timeType.getCustomDegreeWithPro() == 1) {
|
|
|
- String associateDegrees = optional.get().getAssociateDegrees();
|
|
|
- List<HashMap> degreeMapList = new ArrayList<>();
|
|
|
- if (associateDegrees != null) {
|
|
|
- String[] split = associateDegrees.split("\\,");
|
|
|
- for (int i=0;i<split.length; i++) {
|
|
|
- HashMap map = new HashMap();
|
|
|
- if (!StringUtils.isEmpty(split[i])) {
|
|
|
- Integer id = Integer.parseInt(split[i]);
|
|
|
- map.put("id", id);
|
|
|
- map.put("name", degreeList.stream().filter(d->d.getId().equals(id)).findFirst().get().getName());
|
|
|
- degreeMapList.add(map);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- r.setDegreeList(degreeMapList);
|
|
|
- } else {
|
|
|
- //把degreeList改成HashMap结构
|
|
|
- List<HashMap> mapDegreeList = new ArrayList<>();
|
|
|
- for (ReportExtraDegree degree : degreeList) {
|
|
|
- HashMap map = new HashMap();
|
|
|
- map.put("id", degree.getId());
|
|
|
- map.put("name", degree.getName());
|
|
|
- mapDegreeList.add(map);
|
|
|
- }
|
|
|
- r.setDegreeList(mapDegreeList);
|
|
|
+ r.setDegreeList(degreeMapList);
|
|
|
+ } else {
|
|
|
+ //把degreeList改成HashMap结构
|
|
|
+ List<HashMap> mapDegreeList = new ArrayList<>();
|
|
|
+ for (ReportExtraDegree degree : degreeList) {
|
|
|
+ HashMap map = new HashMap();
|
|
|
+ map.put("id", degree.getId());
|
|
|
+ map.put("name", degree.getName());
|
|
|
+ mapDegreeList.add(map);
|
|
|
}
|
|
|
+ r.setDegreeList(mapDegreeList);
|
|
|
}
|
|
|
- });
|
|
|
- }
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
reportMap.put("projectList", projectList);
|
|
|
@@ -10195,25 +10241,23 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
LocalDate today = LocalDate.now();
|
|
|
LocalDate itemDate = firstDayOfWeek;
|
|
|
while(true) {
|
|
|
- if (WorkDayCalculateUtils.isWorkDay(itemDate)) {
|
|
|
- HashMap item = new HashMap();
|
|
|
- item.put("date", itemDate.format(dtf));
|
|
|
- //计算显示的周几
|
|
|
- item.put("weekDayTxt", DateTimeUtil.getWeekDayTxt(itemDate.getDayOfWeek().getValue()));
|
|
|
- //不可提前填报
|
|
|
- if (timeType.getFillAhead() == 0 && itemDate.isAfter(today)) {
|
|
|
- item.put("canFill", 0);
|
|
|
- } else {
|
|
|
- item.put("canFill", 1);
|
|
|
- }
|
|
|
- //放入当天对应的日报
|
|
|
- final LocalDate finalItemDate = itemDate;
|
|
|
- List<Report> dateReportList = reportList.stream().filter(r -> r.getCreateDate().isEqual(finalItemDate)).collect(Collectors.toList());
|
|
|
- item.put("reportList", dateReportList);
|
|
|
- double sum = dateReportList.stream().mapToDouble(Report::getWorkingTime).sum();
|
|
|
- item.put("filledTime", sum);
|
|
|
- dateList.add(item);
|
|
|
+ HashMap item = new HashMap();
|
|
|
+ item.put("date", itemDate.format(dtf));
|
|
|
+ //计算显示的周几
|
|
|
+ item.put("weekDayTxt", DateTimeUtil.getWeekDayTxt(itemDate.getDayOfWeek().getValue()));
|
|
|
+ //不可提前填报
|
|
|
+ if (timeType.getFillAhead() == 0 && itemDate.isAfter(today)) {
|
|
|
+ item.put("canFill", 0);
|
|
|
+ } else {
|
|
|
+ item.put("canFill", 1);
|
|
|
}
|
|
|
+ //放入当天对应的日报
|
|
|
+ final LocalDate finalItemDate = itemDate;
|
|
|
+ List<Report> dateReportList = reportList.stream().filter(r -> r.getCreateDate().isEqual(finalItemDate)).collect(Collectors.toList());
|
|
|
+ item.put("reportList", dateReportList);
|
|
|
+ double sum = dateReportList.stream().mapToDouble(Report::getWorkingTime).sum();
|
|
|
+ item.put("filledTime", sum);
|
|
|
+ dateList.add(item);
|
|
|
//往后推一天
|
|
|
itemDate = itemDate.plusDays(1);
|
|
|
//超过最后一天了,跳出循环
|
|
|
@@ -10221,10 +10265,6 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
- //241226 当日期为 25-01-27 周一 时,去掉列表
|
|
|
- if(firstDayOfWeek.isEqual(specialDate)){
|
|
|
- dateList = new ArrayList<>();
|
|
|
- }
|
|
|
reportMap.put("dateList", dateList);
|
|
|
//查询考勤请假状态
|
|
|
WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", user.getCompanyId()));
|