|
@@ -1562,7 +1562,42 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
}
|
|
|
if (timeType.getReportAuditType() == 3) {
|
|
|
//审核通过的话,给抄送人发送审核通过提醒
|
|
|
-
|
|
|
+ for (Report report : reportList) {
|
|
|
+ if(report.getState()==1){
|
|
|
+ ReportAuditorSetting reportAuditorSetting = reportAuditorSettingMapper.selectById(report.getId());
|
|
|
+ if(reportAuditorSetting.getCcUserid() != null){
|
|
|
+ Optional<User> first = userList.stream().filter(ul -> ul.getId().equals(reportAuditorSetting.getCcUserid())).findFirst();
|
|
|
+ //取到抄送人
|
|
|
+ User u = first.get();
|
|
|
+ if(u.getCorpwxUserid()!=null){
|
|
|
+ if(wxCorpInfoList.size()>0){
|
|
|
+ JSONObject json=new JSONObject();
|
|
|
+ JSONArray dataJson=new JSONArray();
|
|
|
+ JSONObject item=new JSONObject();
|
|
|
+ item.put("key","审核结果");
|
|
|
+ item.put("value","通过");
|
|
|
+ dataJson.add(item);
|
|
|
+ JSONObject item1=new JSONObject();
|
|
|
+ item1.put("key","项目名称");
|
|
|
+ item1.put("value",projectList.stream().filter(pro->pro.getId().equals(report.getProjectId())).findFirst().get().getProjectName());
|
|
|
+ dataJson.add(item1);
|
|
|
+ JSONObject item2=new JSONObject();
|
|
|
+ item2.put("key","填报人员");
|
|
|
+ item2.put("value",userList.stream().filter(curU->curU.getId().equals(report.getCreatorId())).findFirst().get().getName());
|
|
|
+ dataJson.add(item2);
|
|
|
+ JSONObject item3=new JSONObject();
|
|
|
+ item3.put("key","工作日期");
|
|
|
+ item3.put("value",report.getCreateDate());
|
|
|
+ dataJson.add(item3);
|
|
|
+ json.put("template_id","tty9TkCAAAwOgmzwS2uFogWgOmPDdIRQ");
|
|
|
+ json.put("url","https://open.weixin.qq.com/connect/oauth2/authorize?appid=ww4e237fd6abb635af&redirect_uri=http://mobworktime.ttkuaiban.com/api/corpWXAuth&response_type=code&scope=snsapi_base&state=0#wechat_redirect");
|
|
|
+ json.put("content_item",dataJson);
|
|
|
+ wxCorpInfoService.sendWXCorpTemplateMsg(wxCorpInfoList.get(0),u.getCorpwxUserid(),json);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
//对导入审核,添加记录
|
|
|
int channel = oldState == -1?0:1; //0-导入审核, 项目报告审核
|
|
@@ -4005,6 +4040,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
List<Department> departmentList = departmentMapper.selectList(new QueryWrapper<Department>().eq("company_id", companyId));
|
|
|
//获取企业微信同步数据
|
|
|
List<Map> userCorpwxTimeMapList = userCorpwxTimeMapper.selectByAsk(companyId,startDate,endDate);
|
|
|
+
|
|
|
//请假人员名单
|
|
|
|
|
|
DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
@@ -4029,7 +4065,9 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
long cnt = localStart.until(localEnd, ChronoUnit.DAYS);
|
|
|
List<String> cpwxIds = new ArrayList<>();
|
|
|
//获取请假数据
|
|
|
- List<LeaveSheet> leaveSheetList = leaveSheetMapper.selectList(new QueryWrapper<LeaveSheet>().eq("company_id", user.getCompanyId()));
|
|
|
+ List<LeaveSheet> leaveSheetList = leaveSheetMapper.selectList(new QueryWrapper<LeaveSheet>().eq("company_id", user.getCompanyId())
|
|
|
+ .le("start_date", endDate)
|
|
|
+ .ge("end_date", startDate));
|
|
|
//已驳回的数据
|
|
|
List<Report> deniedReportList = reportMapper.selectList(new QueryWrapper<Report>().eq("company_id", companyId).eq("state", 2).between("create_date", startDate, endDate));
|
|
|
List<Report> waitingSubmitReportList = reportMapper.selectList(new QueryWrapper<Report>().eq("company_id", companyId).eq("state", 3).between("create_date", startDate, endDate));
|
|
@@ -4087,15 +4125,14 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
}
|
|
|
noRecord.name = curUser.getName();
|
|
|
//请假的
|
|
|
- List<LeaveSheet> leaveSheets = leaveSheetList.stream().filter(ls -> ls.getOwnerId().equals(curUser.getId())
|
|
|
- &&(ls.getStartDate().isAfter(LocalDate.parse(startDate))||ls.getStartDate().isEqual(LocalDate.parse(startDate)))
|
|
|
- &&(ls.getEndDate().isBefore(LocalDate.parse(endDate))||ls.getEndDate().isEqual(LocalDate.parse(endDate)))).collect(Collectors.toList());
|
|
|
- noReportDataList.add(noRecord);
|
|
|
- for (LeaveSheet leaveSheet : leaveSheets) {
|
|
|
- if(!(date.isBefore(leaveSheet.getStartDate())||date.isAfter(leaveSheet.getEndDate()))){
|
|
|
- noReportDataList.remove(noRecord);
|
|
|
+ for (LeaveSheet leaveSheet : leaveSheetList) {
|
|
|
+ if (leaveSheet.getOwnerId().equals(curUser.getId()) &&
|
|
|
+ (leaveSheet.getStartDate().isEqual(date) || leaveSheet.getEndDate().isEqual(date)
|
|
|
+ || (leaveSheet.getStartDate().isBefore(date) && leaveSheet.getEndDate().isAfter(date)))) {
|
|
|
+ noRecord.status = MessageUtils.message("leave.leave");
|
|
|
}
|
|
|
}
|
|
|
+ noReportDataList.add(noRecord);
|
|
|
}
|
|
|
}
|
|
|
}
|