|
@@ -576,7 +576,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
List<ReportExtraDegree> degreeList = reportExtraDegreeMapper.selectList(new QueryWrapper<ReportExtraDegree>().eq("company_id", companyId));
|
|
|
List<TaskGroup> taskGroups = integerList.size() > 0?taskGroupMapper.selectList(new QueryWrapper<TaskGroup>().in("project_id", integerList)):new ArrayList<>();
|
|
|
List<Stages> stagesList = integerList.size() > 0?stagesMapper.selectList(new QueryWrapper<Stages>().in("project_id", integerList)) : new ArrayList<>();
|
|
|
-
|
|
|
+ TimeType timeType = timeTypeMapper.selectById(companyId);
|
|
|
//获取当前项目的子项目列表,任务分组,任务列表,项目相关维度列表
|
|
|
reports.forEach(r->{
|
|
|
//设置项目名称
|
|
@@ -676,11 +676,32 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
}
|
|
|
//项目的审核人
|
|
|
if (reportAuditType == 0) {
|
|
|
- r.setAuditUserList(auditorList.stream().filter(au->au.getProjectId().equals(r.getProjectId())).collect(Collectors.toList()));
|
|
|
- if (r.getProjectAuditorId() != null) {
|
|
|
- Optional<ProjectAuditor> auItem = auditorList.stream().filter(au->au.getAuditorId().equals(r.getProjectAuditorId())).findFirst();
|
|
|
- if (auItem.isPresent()) {
|
|
|
- r.setProjectAuditorName(auItem.get().getAuditorName());
|
|
|
+ //对于简单模式的非项目,直接获取部门主管作为审核人
|
|
|
+ if (company.getNonProjectSimple() == 1) {
|
|
|
+ User user = userMapper.selectById(r.getCreatorId());
|
|
|
+ Department department = departmentMapper.selectById(user.getDepartmentId());
|
|
|
+ if (department != null) {
|
|
|
+ User deptManager = userMapper.selectById(department.getManagerId());
|
|
|
+ List<ProjectAuditor> auditorList1 = new ArrayList<>();
|
|
|
+ ProjectAuditor auditor = new ProjectAuditor();
|
|
|
+ auditor.setAuditorId(deptManager.getId());
|
|
|
+ auditor.setAuditorName(deptManager.getName());
|
|
|
+ auditorList1.add(auditor);
|
|
|
+ r.setAuditUserList(auditorList1);
|
|
|
+ }
|
|
|
+ if (r.getProjectAuditorId() != null) {
|
|
|
+ Optional<ProjectAuditor> auItem = r.getAuditUserList().stream().filter(au->au.getAuditorId().equals(r.getProjectAuditorId())).findFirst();
|
|
|
+ if (auItem.isPresent()) {
|
|
|
+ r.setProjectAuditorName(auItem.get().getAuditorName());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ r.setAuditUserList(auditorList.stream().filter(au->au.getProjectId().equals(r.getProjectId())).collect(Collectors.toList()));
|
|
|
+ if (r.getProjectAuditorId() != null) {
|
|
|
+ Optional<ProjectAuditor> auItem = auditorList.stream().filter(au->au.getAuditorId().equals(r.getProjectAuditorId())).findFirst();
|
|
|
+ if (auItem.isPresent()) {
|
|
|
+ r.setProjectAuditorName(auItem.get().getAuditorName());
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
} else if (reportAuditType == 1 || reportAuditType == 2) {
|
|
@@ -768,7 +789,6 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
}
|
|
|
});
|
|
|
resultMap.put("report", reports);
|
|
|
- TimeType timeType = timeTypeMapper.selectById(companyId);
|
|
|
boolean showRefresh = false;
|
|
|
if (timeType.getShowDdCardtime() == 1) {
|
|
|
List<UserDingdingTime> dingdingTimes = userDingdingTimeMapper.selectList(new QueryWrapper<UserDingdingTime>()
|
|
@@ -1385,11 +1405,12 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
ReportLog log = new ReportLog();
|
|
|
log.setCreatorId(report.getCreatorId());
|
|
|
log.setCreateDate(report.getCreateDate());
|
|
|
+ String msg = opName+"审核通过了日报";
|
|
|
//去重
|
|
|
Optional<ReportLog> oldLog = addLogList.stream().filter(add -> add.getCreateDate().isEqual(log.getCreateDate()) && add.getCreatorId().equals(log.getCreatorId())).findFirst();
|
|
|
if (!oldLog.isPresent()) {
|
|
|
log.setOperatorId(operatorId);
|
|
|
- log.setMsg(opName+"审核通过了日报");
|
|
|
+ log.setMsg(msg);
|
|
|
log.setCompanyId(companyId);
|
|
|
log.setReportIds(report.getId()+"");
|
|
|
addLogList.add(log);
|
|
@@ -1400,10 +1421,10 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
ReportLogDetail detail = new ReportLogDetail();
|
|
|
detail.setReportId(report.getId());
|
|
|
detail.setWorkDate(log.getCreateDate());
|
|
|
- detail.setOperatorId(log.getOperatorId());
|
|
|
+ detail.setOperatorId(operatorId);
|
|
|
detail.setOperateDate(log.getOperateDate());
|
|
|
detail.setCompanyId(companyId);
|
|
|
- detail.setMsg(log.getMsg());
|
|
|
+ detail.setMsg(msg);
|
|
|
addLogDetailList.add(detail);
|
|
|
}
|
|
|
reportLogService.saveBatch(addLogList);
|
|
@@ -4976,7 +4997,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
}
|
|
|
int deptColumnExtra = (hasDept?1:0);
|
|
|
//下标从0开始
|
|
|
- int projectNameStartIndex = (withCheckIn==null?2:(6 + deptColumnExtra));
|
|
|
+ int projectNameStartIndex = (withCheckIn==null?2:(7 + deptColumnExtra));
|
|
|
List<User> targetUserList=new ArrayList<>();
|
|
|
HttpRespMsg respMsg=new HttpRespMsg();
|
|
|
if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1&&userNameList.size()>0){
|
|
@@ -5059,6 +5080,23 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
} else {
|
|
|
dataCount++;
|
|
|
//数据行
|
|
|
+ //读取工作内容
|
|
|
+ String workContent = null;
|
|
|
+ if (withCheckIn!=null) {
|
|
|
+ int workContentIndex = projectNameStartIndex -1;
|
|
|
+ if (row.getCell(workContentIndex) == null) {
|
|
|
+ //msg.setError("第"+dataCount+"行缺少工作内容");工作内容为必填项
|
|
|
+ msg.setError(MessageUtils.message("data.LackWorkContentByRow",dataCount));
|
|
|
+ return msg;
|
|
|
+ }
|
|
|
+ workContent = row.getCell(workContentIndex).getStringCellValue().trim();
|
|
|
+ if (StringUtils.isEmpty(workContent)) {
|
|
|
+ //msg.setError("第"+dataCount+"行缺少工作内容");
|
|
|
+ msg.setError(MessageUtils.message("data.LackWorkContentByRow",dataCount));
|
|
|
+ return msg;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
for (int i=1;i<projectNameStartIndex+projectList.size(); i++) {
|
|
|
if (row.getCell(i) != null) {
|
|
|
row.getCell(i).setCellType(CellType.STRING);
|
|
@@ -5110,6 +5148,10 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
report.setCreatorId(reportCreator.getId());
|
|
|
report.setDeptId(reportCreator.getDepartmentId());
|
|
|
report.setProjectId(project.getId());
|
|
|
+ if (withCheckIn != null) {
|
|
|
+ report.setContent(workContent);
|
|
|
+ }
|
|
|
+
|
|
|
//子项目
|
|
|
if (!StringUtils.isEmpty(subPName)) {
|
|
|
Optional<SubProject> first = allSubProjectList.stream()
|
|
@@ -6095,13 +6137,14 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
item.add("");
|
|
|
}
|
|
|
}
|
|
|
+ String createDate = null;
|
|
|
if (map.get("createDate") instanceof java.sql.Date) {
|
|
|
- item.add(new SimpleDateFormat("yyyy-MM-dd")
|
|
|
- .format((java.sql.Date) map.get("createDate")));
|
|
|
+ createDate = new SimpleDateFormat("yyyy-MM-dd")
|
|
|
+ .format((java.sql.Date) map.get("createDate"));
|
|
|
} else {
|
|
|
- item.add((String)map.get("createDate"));
|
|
|
+ createDate = (String) map.get("createDate");
|
|
|
}
|
|
|
-
|
|
|
+ item.add(createDate);
|
|
|
// item.add(new SimpleDateFormat("yyyy-MM-dd")
|
|
|
// .format((java.sql.Date) map.get("createDate")));
|
|
|
item.add(map.get("duration").toString());
|
|
@@ -6435,8 +6478,8 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
}
|
|
|
|
|
|
if (timeType.getEnableNewWeeklyfill() == 1) {
|
|
|
- String createDate = new SimpleDateFormat("yyyy-MM-dd")
|
|
|
- .format((java.sql.Date) map.get("createDate"));
|
|
|
+// String createDate = new SimpleDateFormat("yyyy-MM-dd")
|
|
|
+// .format((java.sql.Date) map.get("createDate"));
|
|
|
ReportBatch batchItem = reportBatchMapper.selectOne(new QueryWrapper<ReportBatch>().eq("creator_id", map.get("creatorId")).eq("start_date", createDate).last("limit 1"));
|
|
|
if (batchItem != null) {
|
|
|
item.add(batchItem.getSummary());
|