|
|
@@ -16915,6 +16915,67 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
return msg;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public HttpRespMsg batchDenyPassReport(String userId, String startDate, String endDate, String reason, HttpServletRequest request) {
|
|
|
+ //批量驳回员工已通过的日报
|
|
|
+ User user = userMapper.selectById(request.getHeader("TOKEN"));
|
|
|
+ TimeType timeType = timeTypeMapper.selectById(user.getCompanyId());
|
|
|
+ QueryWrapper<Report> queryWrapper = new QueryWrapper<Report>().select("id, creator_id, create_date, state, group_id").eq("creator_id", userId).eq("state", 1).between("create_date", startDate, endDate);
|
|
|
+ List<Report> passReportList = reportMapper.selectList(queryWrapper);
|
|
|
+ if (reason == null) {
|
|
|
+ reason = "-";
|
|
|
+ }
|
|
|
+ int count = passReportList.size();
|
|
|
+
|
|
|
+ if (count > 0) {
|
|
|
+ reportMapper.update(new Report().setState(2)
|
|
|
+ .setRejectReason(reason).setRejectUserid(user.getId()).setRejectUsername(user.getName()), queryWrapper);
|
|
|
+ if (timeType.getReportAuditType() == 2 || timeType.getReportAuditType() == 9) {
|
|
|
+ List<Report> newList = new ArrayList<>();
|
|
|
+ for (Report item : passReportList) {
|
|
|
+ //退回任务分组审核状态
|
|
|
+ Report upR = new Report();
|
|
|
+ upR.setId(item.getId());
|
|
|
+ upR.setGroupAuditState(0);
|
|
|
+ String inchargerId = taskGroupMapper.selectById(item.getGroupId()).getInchargerId();
|
|
|
+ upR.setProjectAuditorId(inchargerId);
|
|
|
+ upR.setProjectAuditorName(userMapper.selectById(inchargerId).getName());
|
|
|
+ newList.add(upR);
|
|
|
+ }
|
|
|
+ if (newList.size() > 0) {
|
|
|
+ updateBatchById(newList);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
|
+ Report oneReport = passReportList.get(0);
|
|
|
+
|
|
|
+ saveDenyReportLog(passReportList, user.getId(), user.getName(), reason);
|
|
|
+ String str = "您"+startDate+"至"+endDate+"填写的日报被批量驳回。原因:" + reason;
|
|
|
+ String fillUserId = passReportList.get(0).getCreatorId();
|
|
|
+ informationMapper.insert(new Information().setType(0).setContent(startDate).setUserId(fillUserId).setMsg(str));
|
|
|
+
|
|
|
+ //发送企业微信通知消息
|
|
|
+ User reporter = userMapper.selectById(fillUserId);
|
|
|
+ String corpwxUserid = reporter.getCorpwxUserid();
|
|
|
+ //先判断钉钉
|
|
|
+ if (reporter.getDingdingUserid() != null) {
|
|
|
+ projectMapper.selectById(oneReport.getProjectId()).getProjectName();
|
|
|
+ companyDingdingService.sendRejectReportMsg(reporter.getCompanyId(), dtf.format(oneReport.getCreateDate()), "多个项目", reason, user.getName(), reporter.getDingdingUserid());
|
|
|
+ }
|
|
|
+ if (corpwxUserid != null) {
|
|
|
+ WxCorpInfo info = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", user.getCompanyId()));
|
|
|
+ wxCorpInfoService.sendWXCorpMsg(info, corpwxUserid, str, null, WxCorpInfoServiceImpl.TEXT_CARD_MSG_REPORT_DENY);
|
|
|
+ } else if (reporter.getWxOpenid() != null){
|
|
|
+ //发送个人微信通知
|
|
|
+ pushReject(str, reporter, user.getName(), reason);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ HttpRespMsg msg = new HttpRespMsg();
|
|
|
+ msg.data = count;
|
|
|
+ return msg;
|
|
|
+ }
|
|
|
+
|
|
|
public String getWeek(DayOfWeek dayOfWeek){
|
|
|
//获取中文形式的星期几
|
|
|
String dayOfWeekChinese = "";
|