|
@@ -5317,16 +5317,6 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
}
|
|
|
}
|
|
|
List<User> userList = userMapper.selectList(new QueryWrapper<User>().eq("company_id", companyId));
|
|
|
- long t1 = System.currentTimeMillis();
|
|
|
- long calculateTime1 = 0;
|
|
|
- long c1 = 0;
|
|
|
- long c2 = 0;
|
|
|
- long calculateTime2 = 0;
|
|
|
- long calculateTime3 = 0;
|
|
|
- long calculateTime4 = 0;
|
|
|
- long calculateTime5 = 0;
|
|
|
- long initListTime = 0;
|
|
|
- long addStringNumTime = 0;
|
|
|
DateTimeFormatter dft = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
for (Map<String, Object> map : allReportByDate) {
|
|
|
long p1 = System.currentTimeMillis();
|
|
@@ -5349,28 +5339,16 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
}
|
|
|
item.add(value);
|
|
|
}
|
|
|
- long k = System.currentTimeMillis();
|
|
|
- initListTime += (k-p1);
|
|
|
-
|
|
|
Department dept = null;
|
|
|
Department targetDept = new Department();
|
|
|
- targetDept.setDepartmentId(Integer.valueOf(map.get("departmentId").toString()));
|
|
|
- int index = Arrays.binarySearch(deptArray, targetDept, Comparator.comparing(Department::getDepartmentId));
|
|
|
- if (index >= 0) {
|
|
|
- dept = deptArray[index];
|
|
|
- }
|
|
|
-// for (int p=0;p<departments.size();p++) {
|
|
|
-// Department department = departments.get(p);
|
|
|
-// if (department.getDepartmentId().equals((Long)map.get("departmentId"))){
|
|
|
-// dept = department;
|
|
|
-// break;
|
|
|
-// }
|
|
|
-// }
|
|
|
- long q1 = System.currentTimeMillis();
|
|
|
- calculateTime5 += (q1-k);
|
|
|
- long t2 = System.currentTimeMillis();
|
|
|
- c1 += (t2-p1);
|
|
|
- long m1 = System.currentTimeMillis();
|
|
|
+ if (map.get("departmentId") != null) {
|
|
|
+ targetDept.setDepartmentId(Integer.valueOf(map.get("departmentId").toString()));
|
|
|
+ int index = Arrays.binarySearch(deptArray, targetDept, Comparator.comparing(Department::getDepartmentId));
|
|
|
+ if (index >= 0) {
|
|
|
+ dept = deptArray[index];
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
if(needCorpWxTranslate){
|
|
|
item.add("$userName="+(map.get("corpwxUserId")==null?"":map.get("corpwxUserId"))+"$");
|
|
|
item.add(departmentService.exportWxDepartment(dept,departments));
|
|
@@ -5378,10 +5356,8 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
item.add((String) map.get("name"));
|
|
|
item.add(departmentService.getSupDepartment(dept,departments));
|
|
|
}
|
|
|
-
|
|
|
item.add((String) map.get("projectCode"));
|
|
|
item.add((String) map.get("project"));
|
|
|
-
|
|
|
if(companyId==936){
|
|
|
String projectStatus="";
|
|
|
switch (Integer.valueOf(String.valueOf(map.get("projectStatus")))){
|
|
@@ -5397,8 +5373,6 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
item.add(projectStatus.equals("已完成")?projectStatus+"("+map.get("finishDate")+")":projectStatus);
|
|
|
item.add((String)map.get("projectCategorySub"));
|
|
|
}
|
|
|
- long m2 = System.currentTimeMillis();
|
|
|
- c2 += (m2-m1);
|
|
|
item.add((String) map.get("categoryName"));
|
|
|
if(timeType.getMainProjectState()==1){
|
|
|
item.add((String) map.get("projectMainName"));
|
|
@@ -5409,14 +5383,9 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
if (company.getPackageProject() == 1) {
|
|
|
item.add((String) map.get("taskName"));
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
item.add(new SimpleDateFormat("yyyy-MM-dd")
|
|
|
.format((java.sql.Date) map.get("createDate")));
|
|
|
item.add(map.get("duration").toString());
|
|
|
-
|
|
|
- long p2 = System.currentTimeMillis();
|
|
|
- calculateTime1 += (p2-p1);
|
|
|
if (timeType.getMultiWorktime() == 1) {
|
|
|
if ((Integer)map.get("multiWorktime") == 1) {
|
|
|
item.add(map.get("startTime").toString()+"-"+map.get("endTime").toString());
|
|
@@ -5447,8 +5416,6 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
item.add(map.get("groupName") != null? map.get("groupName").toString():"");
|
|
|
item.add(map.get("stage") != null?map.get("stage").toString():"");
|
|
|
}
|
|
|
- long p3 = System.currentTimeMillis();
|
|
|
- calculateTime2 += (p3-p2);
|
|
|
if (timeType.getShowFillauditTime() == 1) {
|
|
|
item.add(sdf.format((Date)map.get("time")));
|
|
|
if(needCorpWxTranslate){
|
|
@@ -5519,9 +5486,6 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
}
|
|
|
item.add(sb.toString());
|
|
|
}
|
|
|
- long p4 = System.currentTimeMillis();
|
|
|
- calculateTime3 += (p4-p3);
|
|
|
- item.add((String) map.get("content"));
|
|
|
if(stateKey==1){
|
|
|
Integer state = (Integer) map.get("state");
|
|
|
switch (state){
|
|
@@ -5579,11 +5543,9 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
}else {
|
|
|
item.add("待" + departmentName + "(" + userItem.getName() + ")审核");
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
break;
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
}else {
|
|
|
//项目审核或分组审核
|
|
@@ -5605,19 +5567,11 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- long p5 = System.currentTimeMillis();
|
|
|
- calculateTime4 += (p5-p4);
|
|
|
dataList.add(item);
|
|
|
rowNum++;
|
|
|
}
|
|
|
//生成Excel文件
|
|
|
String fileUrlSuffix = (startDate==null?"":(startDate+MessageUtils.message("leave.to")+endDate))+MessageUtils.message("excel.workReport") + System.currentTimeMillis();
|
|
|
- long t3 = System.currentTimeMillis();
|
|
|
- System.out.println("处理数据耗时:"+(t3-t0)/1000+"s");
|
|
|
- System.out.println("计算总耗时:"+((t3-t0) - fetchDataTime)/1000+"s");
|
|
|
- System.out.println("分别耗时:"+calculateTime1/1000+"s,"+calculateTime2/1000+"s,"+calculateTime3/1000+"s,"+calculateTime4/1000+"s");
|
|
|
- System.out.println("阶段1中分别耗时:calculateTime5="+calculateTime5+"ms," + c1+"ms,"+c2+"ms");
|
|
|
- System.out.println("initListTime="+initListTime+"ms,addStringNumTime="+addStringNumTime+"ms");
|
|
|
httpRespMsg = excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,fileUrlSuffix,dataList,path);
|
|
|
} catch (NullPointerException e) {
|
|
|
//httpRespMsg.setError("验证失败或缺少数据");
|