|
@@ -9024,36 +9024,33 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
Integer companyId = userMapper.selectById(request.getHeader("token")).getCompanyId();
|
|
|
WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new LambdaQueryWrapper<WxCorpInfo>().eq(WxCorpInfo::getCompanyId, companyId));
|
|
|
LocalDate now=LocalDate.now();
|
|
|
- HttpRespMsg userDailyWorkTime = getUserDailyWorkTime(request,startDate,endDate);
|
|
|
+ HttpRespMsg userDailyWorkTime = getUserDailyWorkTimeReminder(request,startDate,endDate,null,0);
|
|
|
Map<String, Object> map = (Map<String, Object>) userDailyWorkTime.getData();
|
|
|
- List<UserMonthWork> userDailyWorkTimeData = (List<UserMonthWork>) map.get("list");
|
|
|
+ List<Map<String, Object>> mapList = (List<Map<String, Object>>) map.get("list");
|
|
|
if(!StringUtils.isEmpty(userId)){
|
|
|
- userDailyWorkTimeData=userDailyWorkTimeData.stream().filter(u->u.userId.equals(userId)).collect(Collectors.toList());
|
|
|
+ mapList=mapList.stream().filter(u->String.valueOf(u.get("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);
|
|
|
- information.setTime(LocalDateTime.now());
|
|
|
- information.setContent(String.valueOf(e.get("createDate")));
|
|
|
- information.setType(0);
|
|
|
- information.setMsg("您在"+String.valueOf(e.get("createDate"))+"的日报考勤填报异常,请完成填报变更");
|
|
|
- informationList.add(information);
|
|
|
- reportMapper.denyReportWithUserAndCreateDate(u.userId,String.valueOf(e.get("createDate")));
|
|
|
- //发送企业微信消息
|
|
|
- if(wxCorpInfo!=null&&u.corpwxUserId!=null){
|
|
|
- wxCorpInfoService.sendWXCorpMsg(wxCorpInfo, u.corpwxUserId, "您在"+String.valueOf(e.get("createDate"))+"的日报考勤填报异常,请完成填报变更", null, WxCorpInfoServiceImpl.TEXT_CARD_MSG_REPORT_DENY);
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- });
|
|
|
+ List<Map<String, Object>> exceedCardTimeList = mapList.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(String.valueOf(e.get("userId")));
|
|
|
+ information.setTime(LocalDateTime.now());
|
|
|
+ information.setContent(String.valueOf(e.get("createDate")));
|
|
|
+ information.setType(0);
|
|
|
+ information.setMsg("您在"+String.valueOf(e.get("createDate"))+"的日报考勤填报异常,请完成填报变更");
|
|
|
+ informationList.add(information);
|
|
|
+ reportMapper.denyReportWithUserAndCreateDate(String.valueOf(e.get("userId")),String.valueOf(e.get("createDate")));
|
|
|
+ //发送企业微信消息
|
|
|
+ if(wxCorpInfo!=null&&e.get("corpwxUserId")!=null){
|
|
|
+ wxCorpInfoService.sendWXCorpMsg(wxCorpInfo,String.valueOf(e.get("corpwxUserId")), "您在"+String.valueOf(e.get("createDate"))+"的日报考勤填报异常,请完成填报变更", null, WxCorpInfoServiceImpl.TEXT_CARD_MSG_REPORT_DENY);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
if(informationList.size()>0){
|
|
|
informationService.saveBatch(informationList);
|
|
|
}
|