|
@@ -46,9 +46,6 @@ public class PmWorkContentServiceImpl extends AbstractCrudService<PmWorkContentM
|
|
|
@Autowired
|
|
|
private SysUserMapper sysUserMapper;
|
|
|
|
|
|
- @Autowired
|
|
|
- private PmProjectService pmProjectService;
|
|
|
-
|
|
|
@Autowired
|
|
|
private PmReceiveMapper pmReceiveMapper;
|
|
|
|
|
@@ -66,7 +63,7 @@ public class PmWorkContentServiceImpl extends AbstractCrudService<PmWorkContentM
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * @description: 查询报告时间段
|
|
|
+ * @description: 查询报告id时间段
|
|
|
* @author: fu
|
|
|
* @date: 2024/8/7 17:48
|
|
|
* @param: [startDate, endDate]
|
|
@@ -80,8 +77,15 @@ public class PmWorkContentServiceImpl extends AbstractCrudService<PmWorkContentM
|
|
|
.eq(PmWorkReport::getTenantId, tenantId)
|
|
|
.eq(PmWorkReport::getDeptId, deptId);
|
|
|
if (StringUtils.isNotBlank(startDate) && StringUtils.isNotBlank(endDate)) {
|
|
|
- LocalDate start = LocalDate.parse(startDate);
|
|
|
- LocalDate end = LocalDate.parse(endDate);
|
|
|
+ LocalDate start = null;
|
|
|
+ LocalDate end = null;
|
|
|
+ try {
|
|
|
+ start = LocalDate.parse(startDate);
|
|
|
+ end = LocalDate.parse(endDate);
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("时间格式错误:", e);
|
|
|
+ throw new BusinessException("时间格有误,请重新输入");
|
|
|
+ }
|
|
|
reportQuery.between(PmWorkReport::getReportDate, start, end);
|
|
|
}
|
|
|
List<PmWorkReport> reportIds = pmWorkReportMapper.selectList(reportQuery);
|
|
@@ -99,13 +103,16 @@ public class PmWorkContentServiceImpl extends AbstractCrudService<PmWorkContentM
|
|
|
* @param: []
|
|
|
* @return: java.util.List<java.lang.Integer>
|
|
|
**/
|
|
|
- private List<Integer> receive() {
|
|
|
+ private List<Integer> receive(LocalDate startDate, LocalDate endDate) {
|
|
|
Long userId = SecurityUtils.getUserId();
|
|
|
Integer tenantId = SecurityUtils.getTenantId();
|
|
|
LambdaQueryWrapper<PmWorkReport> reportQuery = Wrappers.lambdaQuery();
|
|
|
reportQuery.select(PmWorkReport::getId)
|
|
|
.eq(PmWorkReport::getTenantId, tenantId)
|
|
|
.apply("FIND_IN_SET(" + userId + ", cc_to) > 0");
|
|
|
+ if (startDate != null && endDate != null) {
|
|
|
+ reportQuery.between(PmWorkReport::getReportDate, startDate, endDate);
|
|
|
+ }
|
|
|
List<PmWorkReport> reportIds = pmWorkReportMapper.selectList(reportQuery);
|
|
|
return reportIds.stream().map(PmWorkReport::getId).collect(Collectors.toList());
|
|
|
}
|
|
@@ -117,13 +124,16 @@ public class PmWorkContentServiceImpl extends AbstractCrudService<PmWorkContentM
|
|
|
* @param: []
|
|
|
* @return: java.util.List<java.lang.Integer>
|
|
|
**/
|
|
|
- private List<Integer> sentOut() {
|
|
|
- Long usernid = SecurityUtils.getUserId();
|
|
|
+ private List<Integer> sentOut(LocalDate startDate, LocalDate endDate) {
|
|
|
+ Long userid = SecurityUtils.getUserId();
|
|
|
Integer tenantId = SecurityUtils.getTenantId();
|
|
|
LambdaQueryWrapper<PmWorkReport> reportQuery = Wrappers.lambdaQuery();
|
|
|
reportQuery.select(PmWorkReport::getId)
|
|
|
.eq(PmWorkReport::getTenantId, tenantId)
|
|
|
- .eq(PmWorkReport::getSubmitterId, usernid);
|
|
|
+ .eq(PmWorkReport::getSubmitterId, userid);
|
|
|
+ if (startDate != null && endDate != null) {
|
|
|
+ reportQuery.between(PmWorkReport::getReportDate, startDate, endDate);
|
|
|
+ }
|
|
|
List<PmWorkReport> reportIds = pmWorkReportMapper.selectList(reportQuery);
|
|
|
List<Integer> rIds = new ArrayList<>();
|
|
|
for (PmWorkReport report : reportIds) {
|
|
@@ -183,22 +193,46 @@ public class PmWorkContentServiceImpl extends AbstractCrudService<PmWorkContentM
|
|
|
* @return: java.util.List<com.usky.iot.domain.PmProject>
|
|
|
**/
|
|
|
@Override
|
|
|
- public List<PmWorkContent> projectQuery(String startDate, String endDate, String projectName, Integer projectAscription, Integer reportId) {
|
|
|
- if (reportId != null && reportId != 0) {
|
|
|
- LambdaQueryWrapper<PmWorkContent> contentLambdaQuery = Wrappers.lambdaQuery();
|
|
|
- contentLambdaQuery.select(PmWorkContent::getProjectId, PmWorkContent::getProjectName)
|
|
|
- .eq(PmWorkContent::getReportId, reportId)
|
|
|
- .groupBy(PmWorkContent::getProjectId, PmWorkContent::getProjectName);
|
|
|
- List<PmWorkContent> pmWorkContentList = this.list(contentLambdaQuery);
|
|
|
- return pmWorkContentList;
|
|
|
+ public List<PmWorkContent> projectQuery(String startDate, String endDate, String projectName, Integer projectAscription) {
|
|
|
+ LocalDateTime startDateTime = null;
|
|
|
+ LocalDateTime endDateTime = null;
|
|
|
+ LocalDate start = null;
|
|
|
+ LocalDate end = null;
|
|
|
+ if (StringUtils.isNotBlank(startDate) && StringUtils.isNotBlank(endDate)) {
|
|
|
+ DateTimeFormatter formatter = null;
|
|
|
+ try {
|
|
|
+ formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
|
+ } catch (Exception e) {
|
|
|
+ throw new BusinessException("时间传参格式不正确请重试");
|
|
|
+ }
|
|
|
+ start = LocalDate.parse(startDate, formatter);
|
|
|
+ end = LocalDate.parse(endDate, formatter);
|
|
|
+ startDateTime = start.atStartOfDay();
|
|
|
+ endDateTime = end.atTime(23, 59, 59);
|
|
|
}
|
|
|
+
|
|
|
+ List<PmWorkContent> workContentList = new ArrayList<>();
|
|
|
List<Integer> reportIds = new ArrayList<>();
|
|
|
if (StringUtils.isBlank(startDate) && StringUtils.isBlank(endDate)) {
|
|
|
reportIds = reportDateQuery(startDate, endDate);
|
|
|
}
|
|
|
- List<Integer> receiveList = receive();
|
|
|
- List<Integer> sentOutList = sentOut();
|
|
|
+
|
|
|
+ if (projectAscription != 1 && projectAscription != 2 && projectAscription != 3) {
|
|
|
+ throw new BusinessException("查询标识有误");
|
|
|
+ }
|
|
|
+ List<Integer> receiveList = receive(start, end);
|
|
|
+ if (projectAscription == 2 && receiveList.isEmpty()) {
|
|
|
+ return workContentList;
|
|
|
+ }
|
|
|
+ List<Integer> sentOutList = sentOut(start, end);
|
|
|
+ if (projectAscription == 3 && sentOutList.isEmpty()) {
|
|
|
+ return workContentList;
|
|
|
+ }
|
|
|
List<Integer> headProjects = head();
|
|
|
+ if (projectAscription == 1 && headProjects.isEmpty()) {
|
|
|
+ return workContentList;
|
|
|
+ }
|
|
|
+
|
|
|
LambdaQueryWrapper<PmWorkContent> contentLambdaQuery = Wrappers.lambdaQuery();
|
|
|
contentLambdaQuery.select(PmWorkContent::getProjectId, PmWorkContent::getProjectName);
|
|
|
if (!reportIds.isEmpty()) {
|
|
@@ -208,29 +242,44 @@ public class PmWorkContentServiceImpl extends AbstractCrudService<PmWorkContentM
|
|
|
contentLambdaQuery.like(PmWorkContent::getProjectName, projectName);
|
|
|
}
|
|
|
if (projectAscription == 1) {
|
|
|
- if (headProjects.isEmpty()) {
|
|
|
- return new ArrayList<PmWorkContent>();
|
|
|
- }
|
|
|
- contentLambdaQuery.in(PmWorkContent::getProjectId, headProjects);
|
|
|
+ contentLambdaQuery.in(PmWorkContent::getProjectId, headProjects)
|
|
|
+ .between(PmWorkContent::getCreateTime, startDateTime, endDateTime);
|
|
|
} else if (projectAscription == 2) {
|
|
|
- if (receiveList.isEmpty()) {
|
|
|
- return new ArrayList<PmWorkContent>();
|
|
|
- }
|
|
|
contentLambdaQuery.in(PmWorkContent::getReportId, receiveList);
|
|
|
- } else if (projectAscription == 3) {
|
|
|
- if (sentOutList.isEmpty()) {
|
|
|
- return new ArrayList<PmWorkContent>();
|
|
|
- }
|
|
|
+ } else {
|
|
|
contentLambdaQuery.in(PmWorkContent::getReportId, sentOutList);
|
|
|
}
|
|
|
- contentLambdaQuery.groupBy(PmWorkContent::getProjectId, PmWorkContent::getProjectName);
|
|
|
- List<PmWorkContent> pmWorkContentList = this.list(contentLambdaQuery);
|
|
|
- return pmWorkContentList;
|
|
|
+ contentLambdaQuery.groupBy(PmWorkContent::getProjectId)
|
|
|
+ .groupBy(PmWorkContent::getProjectName);
|
|
|
+ workContentList = this.list(contentLambdaQuery);
|
|
|
+
|
|
|
+ return workContentList;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * @description: 报告记录
|
|
|
+ * @author: fu
|
|
|
+ * @date: 2024/8/7 17:14
|
|
|
+ * @param: [projectIds]
|
|
|
+ * @return: java.util.List<com.usky.iot.domain.PmProject>
|
|
|
+ **/
|
|
|
@Override
|
|
|
public List<PmWorkReport> workReportQuery(String startDate, String endDate, String projectName, Integer projectAscription, Integer reportId) {
|
|
|
+
|
|
|
+ LocalDate start = null;
|
|
|
+ LocalDate end = null;
|
|
|
+ LocalDateTime startDateTime = null;
|
|
|
+ LocalDateTime endDateTime = null;
|
|
|
+ if (StringUtils.isNotBlank(startDate) && StringUtils.isNotBlank(endDate)) {
|
|
|
+ DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
|
+ start = LocalDate.parse(startDate, formatter);
|
|
|
+ end = LocalDate.parse(endDate, formatter);
|
|
|
+ startDateTime = start.atStartOfDay();
|
|
|
+ endDateTime = end.atTime(23, 59, 59);
|
|
|
+ }
|
|
|
+
|
|
|
List<PmWorkReport> reportList = new ArrayList<>();
|
|
|
+ List<PmWorkReport> reportList2 = new ArrayList<>();
|
|
|
List<PmWorkContent> pmWorkContentList = new ArrayList<>();
|
|
|
List<Long> userIds = new ArrayList<>();
|
|
|
if (reportId != null && reportId != 0) {
|
|
@@ -239,6 +288,9 @@ public class PmWorkContentServiceImpl extends AbstractCrudService<PmWorkContentM
|
|
|
PmWorkReport::getCreateTime, PmWorkReport::getReportDate)
|
|
|
.eq(PmWorkReport::getId, reportId);
|
|
|
PmWorkReport report = pmWorkReportMapper.selectOne(reportQuery);
|
|
|
+ if (report == null) {
|
|
|
+ throw new BusinessException("报告已经不存在了哟");
|
|
|
+ }
|
|
|
LambdaQueryWrapper<PmWorkContent> contentQuery = Wrappers.lambdaQuery();
|
|
|
contentQuery.select(PmWorkContent::getWorkContent, PmWorkContent::getWorkTime, PmWorkContent::getProjectName)
|
|
|
.eq(PmWorkContent::getReportId, reportId);
|
|
@@ -249,24 +301,32 @@ public class PmWorkContentServiceImpl extends AbstractCrudService<PmWorkContentM
|
|
|
userIds.add(c.getSubmitterId());
|
|
|
}
|
|
|
} else {
|
|
|
- List<Integer> receiveList2 = receive();
|
|
|
- List<Integer> sentOutList = sentOut();
|
|
|
+ if (projectAscription != 1 && projectAscription != 2 && projectAscription != 3) {
|
|
|
+ throw new BusinessException("查询标识有误");
|
|
|
+ }
|
|
|
+ List<Integer> receiveList2 = receive(start, end);
|
|
|
+ if (projectAscription == 2 && receiveList2.isEmpty()) {
|
|
|
+ return reportList2;
|
|
|
+ }
|
|
|
+ List<Integer> sentOutList = sentOut(start, end);
|
|
|
+ if (projectAscription == 3 && sentOutList.isEmpty()) {
|
|
|
+ return reportList2;
|
|
|
+ }
|
|
|
List<Integer> headProjects = head();
|
|
|
+ if (projectAscription == 1 && headProjects.isEmpty()) {
|
|
|
+ return reportList2;
|
|
|
+ }
|
|
|
LambdaQueryWrapper<PmWorkContent> contentLambdaQuery = Wrappers.lambdaQuery();
|
|
|
contentLambdaQuery.select(PmWorkContent::getReportId, PmWorkContent::getWorkContent, PmWorkContent::getWorkTime, PmWorkContent::getProjectName);
|
|
|
- if (StringUtils.isNotBlank(startDate) && StringUtils.isNotBlank(endDate)) {
|
|
|
- DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
|
- LocalDate start = LocalDate.parse(startDate, formatter);
|
|
|
- LocalDate end = LocalDate.parse(endDate, formatter);
|
|
|
- LocalDateTime startDateTime = start.atStartOfDay();
|
|
|
- LocalDateTime endDateTime = end.atTime(23, 59, 59);
|
|
|
+
|
|
|
+ if (startDateTime != null) {
|
|
|
contentLambdaQuery.between(PmWorkContent::getCreateTime, startDateTime, endDateTime);
|
|
|
}
|
|
|
if (projectAscription == 1) {
|
|
|
contentLambdaQuery.in(PmWorkContent::getProjectId, headProjects);
|
|
|
} else if (projectAscription == 2) {
|
|
|
contentLambdaQuery.in(PmWorkContent::getReportId, receiveList2);
|
|
|
- } else if (projectAscription == 3) {
|
|
|
+ } else {
|
|
|
contentLambdaQuery.in(PmWorkContent::getReportId, sentOutList);
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(projectName)) {
|
|
@@ -377,21 +437,53 @@ public class PmWorkContentServiceImpl extends AbstractCrudService<PmWorkContentM
|
|
|
return sysUserMapper.selectList(usersQuery);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * @description: 报告记录分页
|
|
|
+ * @author: fu
|
|
|
+ * @date: 2024/8/7 17:28
|
|
|
+ * @param: [startDate, endDate, projectName, projectAscription]
|
|
|
+ * @return: java.util.List<com.usky.system.domain.PmWorkContent>
|
|
|
+ **/
|
|
|
@Override
|
|
|
public CommonPage<PmWorkReport> reportPage(Integer projectAscription, Integer pageNum, Integer pageSize, Integer reportId, String startDate, String endDate, Integer projectId) {
|
|
|
+ LocalDateTime startDateTime = null;
|
|
|
+ LocalDateTime endDateTime = null;
|
|
|
+ LocalDate start = null;
|
|
|
+ LocalDate end = null;
|
|
|
+ if (StringUtils.isNotBlank(startDate) && StringUtils.isNotBlank(endDate)) {
|
|
|
+ DateTimeFormatter formatter = null;
|
|
|
+ try {
|
|
|
+ formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
|
+ } catch (Exception e) {
|
|
|
+ throw new BusinessException("时间传参格式不正确请重试");
|
|
|
+ }
|
|
|
+ start = LocalDate.parse(startDate, formatter);
|
|
|
+ end = LocalDate.parse(endDate, formatter);
|
|
|
+ startDateTime = start.atStartOfDay();
|
|
|
+ endDateTime = end.atTime(23, 59, 59);
|
|
|
+ }
|
|
|
+
|
|
|
CommonPage<PmWorkReport> returnPage = new CommonPage<>(new ArrayList<>(), 0, pageSize, pageNum);
|
|
|
Integer tenantId = SecurityUtils.getTenantId();
|
|
|
Long userId = SecurityUtils.getUserId();
|
|
|
- String userName = SecurityUtils.getUsername();
|
|
|
Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId();
|
|
|
+
|
|
|
+ if (projectAscription != 1 && projectAscription != 2 && projectAscription != 3) {
|
|
|
+ throw new BusinessException("查询标识有误");
|
|
|
+ }
|
|
|
List<Integer> headProjects = head();
|
|
|
if (projectAscription == 1 && headProjects.isEmpty()) {
|
|
|
return returnPage;
|
|
|
}
|
|
|
- List<Integer> receiveList2 = receive();
|
|
|
+ List<Integer> receiveList2 = receive(start, end);
|
|
|
if (projectAscription == 2 && receiveList2.isEmpty()) {
|
|
|
return returnPage;
|
|
|
}
|
|
|
+ List<Integer> sentOutList = sentOut(start, end);
|
|
|
+ if (projectAscription == 3 && sentOutList.isEmpty()) {
|
|
|
+ return returnPage;
|
|
|
+ }
|
|
|
+
|
|
|
List<Long> userIds = new ArrayList<>();
|
|
|
LambdaQueryWrapper<PmWorkContent> contentLambdaQuery = Wrappers.lambdaQuery();
|
|
|
contentLambdaQuery.select(PmWorkContent::getReportId, PmWorkContent::getWorkContent, PmWorkContent::getWorkTime, PmWorkContent::getProjectName);
|
|
@@ -399,17 +491,15 @@ public class PmWorkContentServiceImpl extends AbstractCrudService<PmWorkContentM
|
|
|
contentLambdaQuery.eq(PmWorkContent::getReportId, reportId);
|
|
|
} else {
|
|
|
contentLambdaQuery.eq(PmWorkContent::getTenantId, tenantId).eq(PmWorkContent::getDeptId, deptId);
|
|
|
+
|
|
|
if (projectId != null && projectId != 0) {
|
|
|
contentLambdaQuery.eq(PmWorkContent::getProjectId, projectId);
|
|
|
}
|
|
|
- if (StringUtils.isNotBlank(startDate) && StringUtils.isNotBlank(endDate)) {
|
|
|
- DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
|
- LocalDate start = LocalDate.parse(startDate, formatter);
|
|
|
- LocalDate end = LocalDate.parse(endDate, formatter);
|
|
|
- LocalDateTime startDateTime = start.atStartOfDay();
|
|
|
- LocalDateTime endDateTime = end.atTime(23, 59, 59);
|
|
|
+
|
|
|
+ if (startDateTime != null) {
|
|
|
contentLambdaQuery.between(PmWorkContent::getCreateTime, startDateTime, endDateTime);
|
|
|
}
|
|
|
+
|
|
|
switch (projectAscription) {
|
|
|
case 1:
|
|
|
contentLambdaQuery.in(PmWorkContent::getReportId, headProjects);
|
|
@@ -418,23 +508,23 @@ public class PmWorkContentServiceImpl extends AbstractCrudService<PmWorkContentM
|
|
|
contentLambdaQuery.in(PmWorkContent::getReportId, receiveList2);
|
|
|
break;
|
|
|
case 3:
|
|
|
- contentLambdaQuery.eq(PmWorkContent::getCreateBy, userName);
|
|
|
+ contentLambdaQuery.in(PmWorkContent::getReportId, sentOutList);
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
List<PmWorkContent> pmWorkContentList = pmWorkContentMapper.selectList(contentLambdaQuery);
|
|
|
- Set<Integer> reportIds = pmWorkContentList.stream().map(PmWorkContent::getReportId).collect(Collectors.toSet());
|
|
|
- if (reportIds.isEmpty()) {
|
|
|
+
|
|
|
+ if (receiveList2.isEmpty()) {
|
|
|
return returnPage;
|
|
|
}
|
|
|
|
|
|
LambdaQueryWrapper<PmWorkReport> reportQuery = Wrappers.lambdaQuery();
|
|
|
reportQuery.select(PmWorkReport::getId, PmWorkReport::getCoordinateWork, PmWorkReport::getTomorrowPlan, PmWorkReport::getCcTo, PmWorkReport::getSubmitterId,
|
|
|
- PmWorkReport::getCreateTime, PmWorkReport::getReportDate);
|
|
|
+ PmWorkReport::getSubmitDate, PmWorkReport::getReportDate, PmWorkReport::getCreateBy);
|
|
|
if (reportId != null && reportId != 0) {
|
|
|
reportQuery.eq(PmWorkReport::getId, reportId);
|
|
|
} else {
|
|
|
- reportQuery.in(PmWorkReport::getId, reportIds)
|
|
|
+ reportQuery.in(PmWorkReport::getId, receiveList2)
|
|
|
.orderByDesc(PmWorkReport::getCreateTime);
|
|
|
}
|
|
|
reportQuery.eq(PmWorkReport::getReportStatus, 1);
|
|
@@ -447,30 +537,15 @@ public class PmWorkContentServiceImpl extends AbstractCrudService<PmWorkContentM
|
|
|
|
|
|
LambdaQueryWrapper<PmReceive> statusQuery = Wrappers.lambdaQuery();
|
|
|
statusQuery.select(PmReceive::getReportId, PmReceive::getReadFlag)
|
|
|
- .eq(PmReceive::getReceiverId, userId)
|
|
|
- .eq(PmReceive::getTenantId, tenantId);
|
|
|
+ .eq(PmReceive::getReceiverId, userId);
|
|
|
if (reportId != null && reportId != 0) {
|
|
|
statusQuery.eq(PmReceive::getReportId, reportId);
|
|
|
- } else {
|
|
|
- statusQuery.in(PmReceive::getReportId, reportIds);
|
|
|
+ } else if (!receiveList2.isEmpty()) {
|
|
|
+ statusQuery.in(PmReceive::getReportId, receiveList2);
|
|
|
}
|
|
|
List<PmReceive> receiveList = pmReceiveMapper.selectList(statusQuery);
|
|
|
-/* Map<Integer, Integer> reportReadFlags = receiveList.stream()
|
|
|
- .collect(Collectors.toMap(PmReceive::getReportId, PmReceive::getReadFlag));
|
|
|
- reportList.forEach(report -> {
|
|
|
- List<PmWorkContent> contents = pmWorkContentList.stream()
|
|
|
- .filter(content -> content.getReportId().equals(report.getId()))
|
|
|
- .collect(Collectors.toList());
|
|
|
- report.setWorkContents(contents);
|
|
|
- userIds.add(report.getSubmitterId());
|
|
|
- if (reportReadFlags.containsKey(report.getId())) {
|
|
|
- report.setReadFlag(reportReadFlags.get(report.getId()));
|
|
|
- }
|
|
|
- });*/
|
|
|
-
|
|
|
|
|
|
Map<Integer, Integer> reportReadFlags = new HashMap<>();
|
|
|
-
|
|
|
for (PmReceive pmReceive : receiveList) {
|
|
|
Integer reportId2 = pmReceive.getReportId();
|
|
|
reportReadFlags.put(reportId2, pmReceive.getReadFlag());
|
|
@@ -483,22 +558,21 @@ public class PmWorkContentServiceImpl extends AbstractCrudService<PmWorkContentM
|
|
|
report.setWorkContents(contents);
|
|
|
userIds.add(report.getSubmitterId());
|
|
|
|
|
|
- report.setReadFlag(reportReadFlags.getOrDefault(report.getId(), 0));
|
|
|
- }
|
|
|
+ Integer readFlagValue = reportReadFlags.get(report.getId());
|
|
|
+ report.setReadFlag(readFlagValue);
|
|
|
|
|
|
- if (!userIds.isEmpty()) {
|
|
|
- List<SysUser> nickNames = nickNames(userIds);
|
|
|
- Map<Long, String> userNicknameMap = nickNames.stream()
|
|
|
- .collect(Collectors.toMap(SysUser::getUserId, SysUser::getNickName));
|
|
|
- reportList.forEach(report -> {
|
|
|
+ // 创建人名字替换
|
|
|
+ if (!userIds.isEmpty()) {
|
|
|
+ List<SysUser> nickNames = nickNames(userIds);
|
|
|
+ Map<Long, String> userNicknameMap = nickNames.stream()
|
|
|
+ .collect(Collectors.toMap(SysUser::getUserId, SysUser::getNickName));
|
|
|
report.setCreateBy(userNicknameMap.get(report.getSubmitterId()));
|
|
|
- });
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
- // 已读未读查询
|
|
|
- List<Integer> reportIdList = new ArrayList<>(reportIds);
|
|
|
- List<PmReceive> receives = receives(reportIdList);
|
|
|
|
|
|
+ // 已读未读查询
|
|
|
+ List<PmReceive> receives = receives(receiveList2);
|
|
|
List<Long> uId = new ArrayList<>();
|
|
|
for (PmReceive pmReceive : receives) {
|
|
|
Long receiverId = pmReceive.getReceiverId();
|
|
@@ -651,7 +725,6 @@ public class PmWorkContentServiceImpl extends AbstractCrudService<PmWorkContentM
|
|
|
public List<Object> workHourStatistic(Long userId, Integer projectId, Integer filter, String startDate, String endDate, Integer workerOrProject) {
|
|
|
List<ProjectWorkTimeVO> projectWorkTime = new ArrayList<>();
|
|
|
List<UserWorkTimeVO> userWorkTimeVO = new ArrayList<>();
|
|
|
- Integer tenantId = SecurityUtils.getTenantId();
|
|
|
List<Object> returnList = new ArrayList<>();
|
|
|
if (StringUtils.isBlank(startDate) && StringUtils.isBlank(endDate)) {
|
|
|
throw new BusinessException("请设置查询时间范围!");
|
|
@@ -700,9 +773,6 @@ public class PmWorkContentServiceImpl extends AbstractCrudService<PmWorkContentM
|
|
|
}
|
|
|
List<WorkHoursStatisticsVO> userAndProjectD = userAndProject;
|
|
|
|
|
|
- // userAndProject = baseMapper.workHoursStatistics(start, end, userId, tenantId);
|
|
|
- // Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId();
|
|
|
- // List<WorkHoursStatisticsVO> userAndProjectD = baseMapper.statisticsDept(start, end, userId, tenantId, deptId);
|
|
|
if (workerOrProject != 1) {
|
|
|
returnList.add(nickName);
|
|
|
// 重组返回数据结构
|
|
@@ -783,9 +853,6 @@ public class PmWorkContentServiceImpl extends AbstractCrudService<PmWorkContentM
|
|
|
start = LocalDate.parse(startDate);
|
|
|
end = LocalDate.parse(endDate);
|
|
|
}
|
|
|
-// else {
|
|
|
-// throw new BusinessException("导出数据过多请输入正确时间进行筛选");
|
|
|
-// }
|
|
|
return pmWorkContentMapper.workHourStatisticExport(userId, projectId, start, end, tenantId);
|
|
|
}
|
|
|
|