|
@@ -5476,33 +5476,37 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
if (company.getIsInternational() == 1) {
|
|
|
operateDate = operateDate.plusSeconds(offsetSeconds);
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
String time = dtf.format(operateDate);
|
|
|
String msg= "";
|
|
|
- if(needCorpWxTranslate){
|
|
|
- Optional<User> first = userList.stream().filter(ul -> ul.getId().equals(audit.getOperatorId())).findFirst();
|
|
|
- if(first.isPresent()){
|
|
|
- String corpwxUserId = first.get().getCorpwxUserid();
|
|
|
- if (auditMsg.contains(corpwxUserId)) {
|
|
|
- if(auditMsg.contains("提交了")){
|
|
|
- int i = auditMsg.indexOf("提");
|
|
|
- String substring = auditMsg.substring(0, i);
|
|
|
- msg = time+" " + auditMsg.replace(substring,"\\$userName="+corpwxUserId+"\\$");
|
|
|
- }else if(auditMsg.contains("审核通过了")){
|
|
|
- int i = auditMsg.indexOf("审");
|
|
|
- String substring = auditMsg.substring(0, i);
|
|
|
- msg = time+" " + auditMsg.replace(substring,"\\$userName="+corpwxUserId+"\\$");
|
|
|
- }else if(auditMsg.contains("驳回了")) {
|
|
|
- int i = auditMsg.indexOf("驳");
|
|
|
- String substring = auditMsg.substring(0, i);
|
|
|
- msg = time+" " + auditMsg.replace(substring,"\\$userName="+corpwxUserId+"\\$");
|
|
|
- }
|
|
|
- } else {
|
|
|
- msg = time+" " + auditMsg;
|
|
|
- }
|
|
|
- }
|
|
|
- }else {
|
|
|
- msg = time+" " + auditMsg;
|
|
|
- }
|
|
|
+ if (auditMsg != null) {
|
|
|
+ if(needCorpWxTranslate){
|
|
|
+ Optional<User> first = userList.stream().filter(ul -> ul.getId().equals(audit.getOperatorId())).findFirst();
|
|
|
+ if(first.isPresent()){
|
|
|
+ String corpwxUserId = first.get().getCorpwxUserid();
|
|
|
+ if (!StringUtils.isEmpty(corpwxUserId) && auditMsg.contains(corpwxUserId)) {
|
|
|
+ if(auditMsg.contains("提交了")){
|
|
|
+ int i = auditMsg.indexOf("提");
|
|
|
+ String substring = auditMsg.substring(0, i);
|
|
|
+ msg = time+" " + auditMsg.replace(substring,"\\$userName="+corpwxUserId+"\\$");
|
|
|
+ }else if(auditMsg.contains("审核通过了")){
|
|
|
+ int i = auditMsg.indexOf("审");
|
|
|
+ String substring = auditMsg.substring(0, i);
|
|
|
+ msg = time+" " + auditMsg.replace(substring,"\\$userName="+corpwxUserId+"\\$");
|
|
|
+ }else if(auditMsg.contains("驳回了")) {
|
|
|
+ int i = auditMsg.indexOf("驳");
|
|
|
+ String substring = auditMsg.substring(0, i);
|
|
|
+ msg = time+" " + auditMsg.replace(substring,"\\$userName="+corpwxUserId+"\\$");
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ msg = time+" " + auditMsg;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ msg = time+" " + auditMsg;
|
|
|
+ }
|
|
|
+ }
|
|
|
if (!isFirst) {
|
|
|
sb.append("->");
|
|
|
} else {
|
|
@@ -7126,6 +7130,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
HttpRespMsg msg = new HttpRespMsg();
|
|
|
String userId = request.getHeader("TOKEN");
|
|
|
User user = userMapper.selectById(userId);
|
|
|
+ Company company = companyMapper.selectById(user.getCompanyId());
|
|
|
//根据targetDate获取本周的日期
|
|
|
DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
|
LocalDate date = LocalDate.parse(targetDate, dtf);
|
|
@@ -7141,10 +7146,12 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
List<Report> reportList = reportMapper.selectList(new QueryWrapper<Report>().eq("creator_id", userId).between("create_date", startDate, endDate).orderByAsc("create_date"));
|
|
|
|
|
|
List<Integer> collect = reportList.stream().map(Report::getProjectId).collect(Collectors.toList());
|
|
|
+ List<User> auditorList = new ArrayList<>();
|
|
|
//加载这段时间内已填报过的项目
|
|
|
List<Project> projectList = new ArrayList<>();
|
|
|
if (collect.size() > 0) {
|
|
|
projectList = projectMapper.selectList(new QueryWrapper<Project>().in("id", collect));
|
|
|
+ auditorList = userMapper.selectList(new QueryWrapper<User>().in("id", reportList.stream().map(Report::getProjectAuditorId)));
|
|
|
} else {
|
|
|
//没有项目,默认加载最近填报过的项目
|
|
|
List<Report> oldReport = reportMapper.selectList(new QueryWrapper<Report>().select("distinct project_id").eq("creator_id", userId).orderByDesc("id").last("limit 5"));
|
|
@@ -7152,13 +7159,57 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
projectList = projectMapper.selectList(new QueryWrapper<Project>().in("id", oldReport.stream().map(Report::getProjectId).collect(Collectors.toList())));
|
|
|
}
|
|
|
}
|
|
|
-//
|
|
|
-// List<TaskGroup> allGroupList = taskGroupMapper.selectList(new QueryWrapper<TaskGroup>().in("project_id", projectList.stream().map(Project::getId).collect(Collectors.toList())));
|
|
|
-// //获取当前日报项目下的所有任务分组
|
|
|
-// for (Report report : reportList) {
|
|
|
-// Integer targetPid = report.getProjectId();
|
|
|
-// report.setTaskGroups(allGroupList.stream().filter(tg->tg.getProjectId().equals(targetPid)).collect(Collectors.toList()));
|
|
|
-// }
|
|
|
+ List<SapProjectService> sapProjectServices = new ArrayList<>();
|
|
|
+ if (company.getId() == 3092) {
|
|
|
+ sapProjectServices = sapProjectServiceMapper.selectList(new QueryWrapper<SapProjectService>().eq("company_id",company.getId()));
|
|
|
+ }
|
|
|
+ //专业版要取任务分组
|
|
|
+ List<TaskGroup> allGroupList = new ArrayList<>();
|
|
|
+ List<Task> taskList = new ArrayList<>();
|
|
|
+ if (projectList.size() > 0) {
|
|
|
+ if (company.getPackageProject() == 1) {
|
|
|
+ allGroupList = taskGroupMapper.selectList(new QueryWrapper<TaskGroup>().in("project_id", projectList.stream().map(Project::getId).collect(Collectors.toList())));
|
|
|
+ taskList = taskMapper.selectList(new QueryWrapper<Task>().select("id, name").in("project_id", projectList.stream().map(Project::getId).collect(Collectors.toList())));
|
|
|
+ }
|
|
|
+ //获取当前日报项目下的所有任务分组
|
|
|
+ for (Report report : reportList) {
|
|
|
+ Integer targetPid = report.getProjectId();
|
|
|
+ if (company.getPackageProject() == 1) {
|
|
|
+ report.setTaskGroups(allGroupList.stream().filter(tg->tg.getProjectId().equals(targetPid)).collect(Collectors.toList()));
|
|
|
+ if (report.getGroupId() != null) {
|
|
|
+ //设置已经填报的任务分组名称
|
|
|
+ Optional<TaskGroup> optional = allGroupList.stream().filter(tg->tg.getId().equals(report.getGroupId())).findFirst();
|
|
|
+ if (optional.isPresent()) {
|
|
|
+ report.setGroupName(optional.get().getName());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //任务名称设置
|
|
|
+ if (report.getTaskId() != null) {
|
|
|
+ Optional<Task> optional = taskList.stream().filter(t->t.getId().equals(report.getTaskId())).findFirst();
|
|
|
+ if (optional.isPresent()) {
|
|
|
+ report.setTaskName(optional.get().getName());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //设置项目名称
|
|
|
+ Optional<Project> optional = projectList.stream().filter(p->p.getId().equals(report.getProjectId())).findFirst();
|
|
|
+ if (optional.isPresent()) {
|
|
|
+ report.setProjectName(optional.get().getProjectName());
|
|
|
+ }
|
|
|
+ //设置ProjectAuditorName
|
|
|
+ Optional<User> optionalUser = auditorList.stream().filter(u->u.getId().equals(report.getProjectAuditorId())).findFirst();
|
|
|
+ if (optionalUser.isPresent()) {
|
|
|
+ report.setProjectAuditorName(optionalUser.get().getName());
|
|
|
+ }
|
|
|
+ if (company.getId() == 3092) {
|
|
|
+ //依斯倍有SapServiceName
|
|
|
+ Optional<SapProjectService> optionalSap = sapProjectServices.stream().filter(s->s.getId().equals(report.getSapServiceId())).findFirst();
|
|
|
+ if (optionalSap.isPresent()) {
|
|
|
+ report.setSapServiceName(optionalSap.get().getServiceName());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
List cardTimeList = new ArrayList();
|
|
|
if (timeType.getShowDdCardtime() == 1) {
|