|
@@ -4394,16 +4394,18 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
String name = (String)data.get("name");
|
|
String name = (String)data.get("name");
|
|
String departmentName = (String) data.get("departmentName");
|
|
String departmentName = (String) data.get("departmentName");
|
|
String corpwxUserId = (String) data.get("corpwxUserId");
|
|
String corpwxUserId = (String) data.get("corpwxUserId");
|
|
- Integer corpwxDeptId = (Integer) data.get("corpwxDeptId");
|
|
|
|
|
|
+ String corpwxDeptId = (String) data.get("corpwxDeptId");
|
|
Map<String, Object> map = new HashMap<>();
|
|
Map<String, Object> map = new HashMap<>();
|
|
String date = new SimpleDateFormat("yyyy-MM-dd").format((Date)data.get("createDate"));
|
|
String date = new SimpleDateFormat("yyyy-MM-dd").format((Date)data.get("createDate"));
|
|
map.put("workingTime", data.get("workingTime"));
|
|
map.put("workingTime", data.get("workingTime"));
|
|
map.put("createDate", date);
|
|
map.put("createDate", date);
|
|
|
|
+ map.put("cardTime", 0);
|
|
//针对景昱 5978 校验填报工时是否超过考勤
|
|
//针对景昱 5978 校验填报工时是否超过考勤
|
|
if(user.getCompanyId().equals(5978)){
|
|
if(user.getCompanyId().equals(5978)){
|
|
map.put("exceedCardTime",0);
|
|
map.put("exceedCardTime",0);
|
|
Optional<UserFvTime> first = userFvTimeList.stream().filter(u -> u.getWorkDate().isEqual(LocalDate.parse(date, df)) && u.getUserId().equals(id)).findFirst();
|
|
Optional<UserFvTime> first = userFvTimeList.stream().filter(u -> u.getWorkDate().isEqual(LocalDate.parse(date, df)) && u.getUserId().equals(id)).findFirst();
|
|
if(first.isPresent()){
|
|
if(first.isPresent()){
|
|
|
|
+ map.put("cardTime",first.get().getWorkHours());
|
|
if(first.get().getWorkHours()!=null){
|
|
if(first.get().getWorkHours()!=null){
|
|
Optional<User> optional = userList.stream().filter(u -> u.getId().equals(id)).findFirst();
|
|
Optional<User> optional = userList.stream().filter(u -> u.getId().equals(id)).findFirst();
|
|
User targetUser = optional.get();
|
|
User targetUser = optional.get();
|
|
@@ -4438,7 +4440,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
lastUserData.name = name;
|
|
lastUserData.name = name;
|
|
lastUserData.departmentName = departmentName;
|
|
lastUserData.departmentName = departmentName;
|
|
lastUserData.corpwxUserId = corpwxUserId;
|
|
lastUserData.corpwxUserId = corpwxUserId;
|
|
- lastUserData.corpwxDeptId = departmentName;
|
|
|
|
|
|
+ lastUserData.corpwxDeptId = corpwxDeptId;
|
|
lastUserData.worktimeList = new ArrayList<>();
|
|
lastUserData.worktimeList = new ArrayList<>();
|
|
lastUserData.worktimeList.add(map);
|
|
lastUserData.worktimeList.add(map);
|
|
userMonthWorks.add(lastUserData);
|
|
userMonthWorks.add(lastUserData);
|
|
@@ -8999,4 +9001,91 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
}
|
|
}
|
|
return msg;
|
|
return msg;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public HttpRespMsg getUserDailyWorkTimeReminder(HttpServletRequest request, String startDate, String endDate) throws Exception {
|
|
|
|
+ HttpRespMsg msg=new HttpRespMsg();
|
|
|
|
+ DateTimeFormatter df=DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
|
|
+ HttpRespMsg userDailyWorkTime = getUserDailyWorkTime(request, startDate, endDate);
|
|
|
|
+ List<UserFvTime> userFvTimeList = userFvTimeMapper.selectList(new LambdaQueryWrapper<UserFvTime>().between(UserFvTime::getWorkDate, startDate, endDate));
|
|
|
|
+ Map<String, Object> objectMap = (Map<String, Object>) userDailyWorkTime.getData();
|
|
|
|
+ List<UserMonthWork > mapList = (List<UserMonthWork >) objectMap.get("list");
|
|
|
|
+ List<LocalDate> days = getDays(LocalDate.parse(startDate, df), LocalDate.parse(endDate, df));
|
|
|
|
+ List<Map<String, Object>> result=new ArrayList<>();
|
|
|
|
+ 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)));
|
|
|
|
+ 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());
|
|
|
|
+ }
|
|
|
|
+ w.put("name",m.name);
|
|
|
|
+ w.put("corpwxDeptId",m.corpwxDeptId);
|
|
|
|
+ w.put("corpwxUserId",m.corpwxUserId);
|
|
|
|
+ w.put("departmentName",m.departmentName);
|
|
|
|
+ w.put("userId",m.userId);
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ result.addAll(worktimeList);
|
|
|
|
+ });
|
|
|
|
+ Map<String,Object> map=new HashMap<>();
|
|
|
|
+ map.put("list",result);
|
|
|
|
+ msg.setData(map);
|
|
|
|
+ return msg;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public HttpRespMsg exportUserDailyWorkTimeReminder(HttpServletRequest request, String startDate, String endDate) throws Exception {
|
|
|
|
+ HttpRespMsg timeReminder = getUserDailyWorkTimeReminder(request, startDate, endDate);
|
|
|
|
+ Integer companyId = userMapper.selectById(request.getHeader("token")).getCompanyId();
|
|
|
|
+ WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new LambdaQueryWrapper<WxCorpInfo>().eq(WxCorpInfo::getCompanyId, companyId));
|
|
|
|
+ Map<String, Object> data = (Map<String, Object>) timeReminder.getData();
|
|
|
|
+ List<Map<String, Object>> mapList = (List<Map<String, Object>>) data.get("list");
|
|
|
|
+ List<List<String>> dataList=new ArrayList<>();
|
|
|
|
+ List<String> titleList=new ArrayList<>();
|
|
|
|
+ titleList.add("日期");
|
|
|
|
+ titleList.add("姓名");
|
|
|
|
+ titleList.add("部门");
|
|
|
|
+ titleList.add("填报工时");
|
|
|
|
+ titleList.add("考勤工时");
|
|
|
|
+ titleList.add("是否异常");
|
|
|
|
+ titleList.add("催办");
|
|
|
|
+ dataList.add(titleList);
|
|
|
|
+ for (Map<String, Object> map : mapList) {
|
|
|
|
+ List<String> item=new ArrayList<>();
|
|
|
|
+ item.add(String.valueOf(map.get("createDate")));
|
|
|
|
+ if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
|
|
|
|
+ item.add(String.valueOf(map.get("name")));
|
|
|
|
+ item.add(String.valueOf(map.get("departmentName")));
|
|
|
|
+ }else {
|
|
|
|
+ item.add("$userName="+String.valueOf(map.get("corpwxUserId"))+"$");
|
|
|
|
+ item.add("$departmentName="+String.valueOf(map.get("corpwxDeptId"))+"$");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ 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();
|
|
|
|
+ return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,fileName,dataList,path);
|
|
|
|
+ }
|
|
}
|
|
}
|