|
@@ -1187,10 +1187,10 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
String str = null;
|
|
|
String fillUserId = null;
|
|
|
if (oneReport.getState() == -1) {//待部门直属领导审核
|
|
|
- str = "您"+date+"导入的日报中"+pNames+"项目被直属领导驳回。原因:" + reason+",请重新导入。";
|
|
|
+ str = "您"+date+"导入的日报中"+pNames+"项目被["+user.getName()+"]驳回。原因:" + reason+",请重新导入。";
|
|
|
fillUserId = oneReport.getFillUserid();
|
|
|
} else {
|
|
|
- str = "您"+date+"填写的日报中"+pNames+"项目被领导驳回。原因:" + reason;
|
|
|
+ str = "您"+date+"填写的日报中"+pNames+"项目被["+user.getName()+"]驳回。原因:" + reason;
|
|
|
fillUserId = oneReport.getCreatorId();
|
|
|
}
|
|
|
|
|
@@ -1802,30 +1802,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
String token = request.getHeader("TOKEN");
|
|
|
User user = userMapper.selectById(token);
|
|
|
Integer companyId = user.getCompanyId();
|
|
|
-
|
|
|
-// String startDate = month + "-01";
|
|
|
-// LocalDate ld = LocalDate.parse(startDate, DateTimeFormatter.ofPattern("yyyy-MM-dd"));
|
|
|
-// int year = ld.getYear();
|
|
|
-// boolean isLerpYear = false;
|
|
|
-// if (year%4==0&&year%100!=0) {
|
|
|
-// isLerpYear = true;
|
|
|
-// } else if (year%400==0) {
|
|
|
-// isLerpYear = true;
|
|
|
-// }
|
|
|
-//
|
|
|
-// int dm = ld.getMonthValue();
|
|
|
-// int maxDaysOfMonth = 28;
|
|
|
-// if (dm == 1 || dm == 3 || dm == 5 || dm == 7 || dm == 8 || dm == 10 || dm == 12) {
|
|
|
-// maxDaysOfMonth = 31;
|
|
|
-// } else if (dm == 2) {
|
|
|
-// if (isLerpYear) {
|
|
|
-// maxDaysOfMonth = 29;
|
|
|
-// }
|
|
|
-// } else {
|
|
|
-// maxDaysOfMonth = 30;
|
|
|
-// }
|
|
|
-
|
|
|
-// String endDate = month + "-"+maxDaysOfMonth;
|
|
|
+ String[] weekDayCHN = {"周一","周二","周三","周四","周五","周六","周日"};
|
|
|
HttpRespMsg msg = new HttpRespMsg();
|
|
|
List<Map<String, Object>> list = null;
|
|
|
//分角色权限:管理员看全部的,部门负责人看自己部门的,个人只能看自己的。
|
|
@@ -1877,12 +1854,19 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
lastUserId = id;
|
|
|
}
|
|
|
HashMap map = new HashMap();
|
|
|
- List<Integer> days = new ArrayList<>();
|
|
|
- LocalDate localStartDate = LocalDate.parse(startDate, DateTimeFormatter.ofPattern("yyyy-MM-dd"));
|
|
|
- LocalDate localEndDate = LocalDate.parse(startDate, DateTimeFormatter.ofPattern("yyyy-MM-dd"));
|
|
|
+ List<HashMap> days = new ArrayList<HashMap>();
|
|
|
+ DateTimeFormatter standFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
|
+ LocalDate localStartDate = LocalDate.parse(startDate, standFormatter);
|
|
|
+ LocalDate localEndDate = LocalDate.parse(endDate, standFormatter);
|
|
|
+ DateTimeFormatter mdFormat = DateTimeFormatter.ofPattern("M.d");
|
|
|
long count = localStartDate.until(localEndDate, ChronoUnit.DAYS);
|
|
|
- for (int i=1;i<=count;i++) {
|
|
|
- days.add(i);
|
|
|
+ for (int i=0;i<=count;i++) {
|
|
|
+ LocalDate d = localStartDate.plusDays(i);
|
|
|
+ String dow = weekDayCHN[d.getDayOfWeek().getValue()-1];
|
|
|
+ HashMap mapItem = new HashMap();
|
|
|
+ mapItem.put("label", mdFormat.format(d)+"/"+dow);
|
|
|
+ mapItem.put("date", standFormatter.format(d));
|
|
|
+ days.add(mapItem);
|
|
|
}
|
|
|
map.put("days", days);
|
|
|
map.put("list", userMonthWorks);
|
|
@@ -1895,19 +1879,18 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
HttpRespMsg msg = getUserDailyWorkTime(request, startDate, endDate);
|
|
|
String[] weekDayCHN = {"周一","周二","周三","周四","周五","周六","周日"};
|
|
|
HashMap map = (HashMap) msg.data;
|
|
|
- List<Integer> days = (List<Integer>)map.get("days");
|
|
|
+ List<HashMap> days = (List<HashMap>)map.get("days");
|
|
|
List<UserMonthWork> userMonthWorks = (List<UserMonthWork>) map.get("list");
|
|
|
List<List<String>> dataList = new ArrayList<>();
|
|
|
List<String> titleList = new ArrayList<>();
|
|
|
titleList.add("序号");
|
|
|
titleList.add("姓名");
|
|
|
days.forEach(d->{
|
|
|
- String dateStr = startDate;
|
|
|
- LocalDate date = LocalDate.parse(dateStr, DateTimeFormatter.ofPattern("yyyy-MM-dd"));
|
|
|
- date = date.plusDays(d-1);
|
|
|
- String chn = weekDayCHN[date.getDayOfWeek().getValue()-1];
|
|
|
- String m = ""+date.getMonthValue();
|
|
|
- titleList.add(m+"."+d+"/"+chn);
|
|
|
+// String dateStr = (String)d.get("date");
|
|
|
+// LocalDate date = LocalDate.parse(dateStr, DateTimeFormatter.ofPattern("yyyy-MM-dd"));
|
|
|
+// String chn = weekDayCHN[date.getDayOfWeek().getValue()-1];
|
|
|
+// String m = ""+date.getMonthValue();
|
|
|
+ titleList.add((String)d.get("label"));
|
|
|
});
|
|
|
dataList.add(titleList);
|
|
|
for (int i=0;i<userMonthWorks.size(); i++) {
|
|
@@ -1918,11 +1901,11 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
//找到那一天的工作时间
|
|
|
List<Map<String, Object>> worktimeList = userMonthWork.worktimeList;
|
|
|
days.forEach(d->{
|
|
|
- String dateStr = startDate;
|
|
|
- LocalDate date = LocalDate.parse(dateStr, DateTimeFormatter.ofPattern("yyyy-MM-dd"));
|
|
|
- //计算当前遍历到的那一天
|
|
|
- date = date.plusDays(d-1);
|
|
|
- final String fDateStr = DateTimeFormatter.ofPattern("yyyy-MM-dd").format(date);
|
|
|
+// String dateStr = startDate;
|
|
|
+// LocalDate date = LocalDate.parse(dateStr, DateTimeFormatter.ofPattern("yyyy-MM-dd"));
|
|
|
+// //计算当前遍历到的那一天
|
|
|
+// date = date.plusDays(d-1);
|
|
|
+ final String fDateStr = (String)d.get("date");
|
|
|
Optional<Map<String, Object>> op = worktimeList.stream().filter(m -> ((String) m.get("createDate")).equals(fDateStr)).findFirst();
|
|
|
if (op.isPresent()) {
|
|
|
Map<String, Object> createDateHour = op.get();
|
|
@@ -2595,7 +2578,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
long cnt = localStart.until(localEnd, ChronoUnit.DAYS);
|
|
|
//按人员过滤
|
|
|
for (User curUser: allRangeUserList) {
|
|
|
- for (int i=0;i<cnt; i++) {
|
|
|
+ for (int i=0;i<=cnt; i++) {
|
|
|
LocalDate date = localStart.plusDays(i);
|
|
|
final String dateStr = dtf.format(date);
|
|
|
if (!list.stream().anyMatch(item->item.get("id").equals(curUser.getId())&&sdf.format((java.sql.Date)item.get("createDate")).equals(dateStr))) {
|
|
@@ -2643,14 +2626,14 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
public HttpRespMsg exportNoReportUserList(HttpServletRequest request, String startDate, String endDate) {
|
|
|
HttpRespMsg msg = getNoReportUserList(request, startDate, endDate);
|
|
|
String[] weekDayCHN = {"周一","周二","周三","周四","周五","周六","周日"};
|
|
|
- HashMap map = (HashMap) msg.data;
|
|
|
- List<Integer> days = (List<Integer>)map.get("days");
|
|
|
- List<UserDailyWorkItem> dailyWorkItems = (List<UserDailyWorkItem>) map.get("list");
|
|
|
+ List<UserDailyWorkItem> dailyWorkItems = (List<UserDailyWorkItem>) msg.data;
|
|
|
List<List<String>> dataList = new ArrayList<>();
|
|
|
List<String> titleList = new ArrayList<>();
|
|
|
titleList.add("部门");
|
|
|
titleList.add("姓名");
|
|
|
titleList.add("未填日期");
|
|
|
+ dataList.add(titleList);
|
|
|
+
|
|
|
for (int i=0;i<dailyWorkItems.size(); i++) {
|
|
|
UserDailyWorkItem dataItem = dailyWorkItems.get(i);
|
|
|
List<String> line = new ArrayList<>();
|