|
@@ -4402,14 +4402,13 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
String date = new SimpleDateFormat("yyyy-MM-dd").format((Date)data.get("createDate"));
|
|
|
map.put("workingTime", data.get("workingTime"));
|
|
|
map.put("createDate", date);
|
|
|
- map.put("cardTime", 0);
|
|
|
//针对景昱 5978 校验填报工时是否超过考勤
|
|
|
if(user.getCompanyId().equals(5978)){
|
|
|
map.put("exceedCardTime",0);
|
|
|
Optional<UserFvTime> first = userFvTimeList.stream().filter(u -> u.getWorkDate().isEqual(LocalDate.parse(date, df)) && u.getUserId().equals(id)).findFirst();
|
|
|
if(first.isPresent()){
|
|
|
- map.put("cardTime",first.get().getWorkHours());
|
|
|
if(first.get().getWorkHours()!=null){
|
|
|
+ map.put("cardTime",first.get().getWorkHours());
|
|
|
Optional<User> optional = userList.stream().filter(u -> u.getId().equals(id)).findFirst();
|
|
|
User targetUser = optional.get();
|
|
|
List<String> customList = userCustomList.stream().map(UserCustom::getName).collect(Collectors.toList());
|
|
@@ -8997,7 +8996,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public HttpRespMsg changeReminder(HttpServletRequest request) throws Exception {
|
|
|
+ public HttpRespMsg changeReminder(HttpServletRequest request,String createDate,String userId) throws Exception {
|
|
|
HttpRespMsg msg=new HttpRespMsg();
|
|
|
DateTimeFormatter df=DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
|
Integer companyId = userMapper.selectById(request.getHeader("token")).getCompanyId();
|
|
@@ -9006,11 +9005,17 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
HttpRespMsg userDailyWorkTime = getUserDailyWorkTime(request, now.with(TemporalAdjusters.firstDayOfMonth()).format(df), now.with(TemporalAdjusters.lastDayOfMonth()).format(df));
|
|
|
Map<String, Object> map = (Map<String, Object>) userDailyWorkTime.getData();
|
|
|
List<UserMonthWork> userDailyWorkTimeData = (List<UserMonthWork>) map.get("list");
|
|
|
+ if(!StringUtils.isEmpty(userId)){
|
|
|
+ userDailyWorkTimeData=userDailyWorkTimeData.stream().filter(u->u.userId.equals(userId)).collect(Collectors.toList());
|
|
|
+ }
|
|
|
List<Information> informationList=new ArrayList<>();
|
|
|
userDailyWorkTimeData.forEach(u-> {
|
|
|
List<Map<String, Object>> worktimeList = u.worktimeList;
|
|
|
List<Map<String, Object>> exceedCardTimeList = worktimeList.stream().filter(w -> Integer.valueOf(String.valueOf(w.get("exceedCardTime"))).equals(1)).collect(Collectors.toList());
|
|
|
if(exceedCardTimeList.size()>0){
|
|
|
+ if(!StringUtils.isEmpty(createDate)){
|
|
|
+ exceedCardTimeList=exceedCardTimeList.stream().filter(e->String.valueOf(e.get("createDate")).equals(createDate)).collect(Collectors.toList());
|
|
|
+ }
|
|
|
exceedCardTimeList.forEach(e->{
|
|
|
Information information=new Information();
|
|
|
information.setUserId(u.userId);
|
|
@@ -9028,10 +9033,9 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
}
|
|
|
});
|
|
|
if(informationList.size()>0){
|
|
|
- if(!informationService.saveBatch(informationList)){
|
|
|
- msg.setError("验证失败");
|
|
|
- }
|
|
|
+ informationService.saveBatch(informationList);
|
|
|
}
|
|
|
+ msg.setMsg("变更提醒发送成功");
|
|
|
return msg;
|
|
|
}
|
|
|
|
|
@@ -9048,22 +9052,16 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
mapList.forEach(m->{
|
|
|
List<Map<String, Object>> worktimeList = (List<Map<String, Object>>) m.worktimeList;
|
|
|
for (LocalDate date : days) {
|
|
|
- boolean match = worktimeList.stream().anyMatch(www -> www.get("createDate").equals(date.format(df)));
|
|
|
+ boolean match = worktimeList.stream().anyMatch(www -> String.valueOf(www.get("createDate")).equals(date.format(df)));
|
|
|
if(!match){
|
|
|
Map<String,Object> ww=new HashMap<>();
|
|
|
ww.put("createDate",date.format(df));
|
|
|
ww.put("exceedCardTime",0);
|
|
|
ww.put("workingTime",0);
|
|
|
-// ww.put("name",m.name);
|
|
|
-// ww.put("corpwxDeptId",m.corpwxDeptId);
|
|
|
-// ww.put("corpwxUserId",m.corpwxUserId);
|
|
|
-// ww.put("departmentName",m.departmentName);
|
|
|
-// ww.put("userId",m.userId);
|
|
|
worktimeList.add(ww);
|
|
|
}
|
|
|
if(worktimeList.size()>0){
|
|
|
worktimeList.forEach(w->{
|
|
|
- w.put("cardTime",0);
|
|
|
Optional<UserFvTime> first = userFvTimeList.stream().filter(u -> u.getWorkDate().isEqual(date) && u.getUserId().equals(m.userId)).findFirst();
|
|
|
if(first.isPresent()){
|
|
|
w.put("cardTime",first.get().getWorkHours());
|
|
@@ -9099,7 +9097,6 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
titleList.add("填报工时");
|
|
|
titleList.add("考勤工时");
|
|
|
titleList.add("是否异常");
|
|
|
- titleList.add("催办");
|
|
|
dataList.add(titleList);
|
|
|
for (Map<String, Object> map : mapList) {
|
|
|
List<String> item=new ArrayList<>();
|
|
@@ -9114,7 +9111,6 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
item.add(String.valueOf(map.get("workingTime")));
|
|
|
item.add(String.valueOf(map.get("cardTime")));
|
|
|
item.add(Integer.valueOf(String.valueOf(map.get("exceedCardTime")))==0?"否":"是");
|
|
|
- item.add(Integer.valueOf(String.valueOf(map.get("exceedCardTime")))==0?"":"变更提醒");
|
|
|
dataList.add(item);
|
|
|
}
|
|
|
String fileName="工时异常表"+System.currentTimeMillis();
|