|
@@ -5082,20 +5082,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
//数据行
|
|
//数据行
|
|
//读取工作内容
|
|
//读取工作内容
|
|
String workContent = null;
|
|
String workContent = null;
|
|
- if (withCheckIn!=null) {
|
|
|
|
- int workContentIndex = projectNameStartIndex -1;
|
|
|
|
- if (row.getCell(workContentIndex) == null) {
|
|
|
|
- //msg.setError("第"+dataCount+"行缺少工作内容");工作内容为必填项
|
|
|
|
- msg.setError(MessageUtils.message("data.LackWorkContentByRow",dataCount));
|
|
|
|
- return msg;
|
|
|
|
- }
|
|
|
|
- workContent = row.getCell(workContentIndex).getStringCellValue().trim();
|
|
|
|
- if (StringUtils.isEmpty(workContent)) {
|
|
|
|
- //msg.setError("第"+dataCount+"行缺少工作内容");
|
|
|
|
- msg.setError(MessageUtils.message("data.LackWorkContentByRow",dataCount));
|
|
|
|
- return msg;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+
|
|
|
|
|
|
for (int i=1;i<projectNameStartIndex+projectList.size(); i++) {
|
|
for (int i=1;i<projectNameStartIndex+projectList.size(); i++) {
|
|
if (row.getCell(i) != null) {
|
|
if (row.getCell(i) != null) {
|
|
@@ -5130,6 +5117,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
return msg;
|
|
return msg;
|
|
}
|
|
}
|
|
User reportCreator = any.get();
|
|
User reportCreator = any.get();
|
|
|
|
+ double curRowTotalTime = 0;
|
|
for (int i=projectNameStartIndex; i < projectNameStartIndex + projectList.size(); i++) {
|
|
for (int i=projectNameStartIndex; i < projectNameStartIndex + projectList.size(); i++) {
|
|
if (row.getCell(i) == null) {
|
|
if (row.getCell(i) == null) {
|
|
continue;
|
|
continue;
|
|
@@ -5190,6 +5178,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
report.setCreateDate(LocalDate.parse(reportDate, dtf));
|
|
report.setCreateDate(LocalDate.parse(reportDate, dtf));
|
|
report.setCost(reportCreator.getCost()==null?new BigDecimal(0) : reportCreator.getCost().multiply(new BigDecimal(time)));
|
|
report.setCost(reportCreator.getCost()==null?new BigDecimal(0) : reportCreator.getCost().multiply(new BigDecimal(time)));
|
|
reportList.add(report);
|
|
reportList.add(report);
|
|
|
|
+ curRowTotalTime += time;
|
|
} else if (time < 0) {
|
|
} else if (time < 0) {
|
|
//msg.setError(username + "的工时存在负数,请检查修改");
|
|
//msg.setError(username + "的工时存在负数,请检查修改");
|
|
msg.setError(MessageUtils.message("report.negativeError",username));
|
|
msg.setError(MessageUtils.message("report.negativeError",username));
|
|
@@ -5197,6 +5186,23 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ //导入工时大于0时,需要有工作内容
|
|
|
|
+ if (curRowTotalTime > 0) {
|
|
|
|
+ if (withCheckIn!=null) {
|
|
|
|
+ int workContentIndex = projectNameStartIndex -1;
|
|
|
|
+ if (row.getCell(workContentIndex) == null) {
|
|
|
|
+ //msg.setError("第"+dataCount+"行缺少工作内容");工作内容为必填项
|
|
|
|
+ msg.setError(MessageUtils.message("data.LackWorkContentByRow",dataCount));
|
|
|
|
+ return msg;
|
|
|
|
+ }
|
|
|
|
+ workContent = row.getCell(workContentIndex).getStringCellValue().trim();
|
|
|
|
+ if (StringUtils.isEmpty(workContent)) {
|
|
|
|
+ //msg.setError("第"+dataCount+"行缺少工作内容");
|
|
|
|
+ msg.setError(MessageUtils.message("data.LackWorkContentByRow",dataCount));
|
|
|
|
+ return msg;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -6463,12 +6469,12 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
}else if(dingding!=null&&dingding.getContactNeedTranslate()==1){
|
|
}else if(dingding!=null&&dingding.getContactNeedTranslate()==1){
|
|
projectAuditorName = "$userName=" + userItem.getDingdingUserid() + "$";
|
|
projectAuditorName = "$userName=" + userItem.getDingdingUserid() + "$";
|
|
}
|
|
}
|
|
- item.add("待项目审核人" + "(" + projectAuditorName + ")审核");
|
|
|
|
|
|
+ item.add("待"+(companyId == 469?"部门主管":"项目审核人") + "(" + projectAuditorName + ")审核");
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
- item.add("待项目审核人" + "(" + projectAuditorName + ")审核");
|
|
|
|
|
|
+ item.add("待"+(companyId == 469?"部门主管":"项目审核人") + "(" + projectAuditorName + ")审核");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -6478,8 +6484,6 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
}
|
|
}
|
|
|
|
|
|
if (timeType.getEnableNewWeeklyfill() == 1) {
|
|
if (timeType.getEnableNewWeeklyfill() == 1) {
|
|
-// String createDate = new SimpleDateFormat("yyyy-MM-dd")
|
|
|
|
-// .format((java.sql.Date) map.get("createDate"));
|
|
|
|
ReportBatch batchItem = reportBatchMapper.selectOne(new QueryWrapper<ReportBatch>().eq("creator_id", map.get("creatorId")).eq("start_date", createDate).last("limit 1"));
|
|
ReportBatch batchItem = reportBatchMapper.selectOne(new QueryWrapper<ReportBatch>().eq("creator_id", map.get("creatorId")).eq("start_date", createDate).last("limit 1"));
|
|
if (batchItem != null) {
|
|
if (batchItem != null) {
|
|
item.add(batchItem.getSummary());
|
|
item.add(batchItem.getSummary());
|
|
@@ -9922,15 +9926,93 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public HttpRespMsg batchDenyHisReport(Integer reportAuditLogId, String reason, HttpServletRequest request) {
|
|
|
|
- List<ReportAlogMembdate> list = reportAlogMembdateMapper.selectList(new QueryWrapper<ReportAlogMembdate>().eq("rlog_id", reportAuditLogId));
|
|
|
|
- for (ReportAlogMembdate logMembItem : list) {
|
|
|
|
- HttpRespMsg msg = denyHisReport(logMembItem.getId(), reason, request);
|
|
|
|
- if (msg.code.equals("error")) {
|
|
|
|
- //异常需要跳出
|
|
|
|
- return msg;
|
|
|
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
|
+ public HttpRespMsg batchDenyHisReport(Integer reportAuditLogId, String reason, HttpServletRequest request) throws Exception {
|
|
|
|
+ List<ReportAlogMembdate> dataList = reportAlogMembdateMapper.selectList(new QueryWrapper<ReportAlogMembdate>().eq("rlog_id", reportAuditLogId));
|
|
|
|
+ for (ReportAlogMembdate item : dataList) {
|
|
|
|
+ int hisId = item.getId();
|
|
|
|
+ ReportAlogMembdate log = reportAlogMembdateMapper.selectById(hisId);
|
|
|
|
+ String userId = log.getUserId();
|
|
|
|
+ String createDate = DateTimeFormatter.ofPattern("yyyy-MM-dd").format(log.getCreateDate());
|
|
|
|
+ if (log.getState() != 1) {
|
|
|
|
+ //已通过的直接跳过
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ User user = userMapper.selectById(request.getHeader("Token"));
|
|
|
|
+ Company company = companyMapper.selectById(user.getCompanyId());
|
|
|
|
+ if (reason == null) {
|
|
|
|
+ reason = "-";
|
|
|
|
+ }
|
|
|
|
+ QueryWrapper<Report> eq = new QueryWrapper<Report>().eq("create_date", createDate).eq("creator_id", userId);
|
|
|
|
+ List<Report> list = reportMapper.selectList(eq);
|
|
|
|
+ Report oneReport = null;
|
|
|
|
+ if (list.size() == 0) {
|
|
|
|
+ //httpRespMsg.setError("日报已不存在");
|
|
|
|
+ throw new Exception(MessageUtils.message("profession.alreadyNull"));
|
|
|
|
+ } else {
|
|
|
|
+ if (list.get(0).getState() == 3) {
|
|
|
|
+ //只有已通过的历史记录才能撤销
|
|
|
|
+ continue;
|
|
|
|
+ } else if (list.get(0).getState() == 2) {
|
|
|
|
+ //只有已通过的历史记录才能撤销
|
|
|
|
+ //httpRespMsg.setError("该日报已被撤销,无法重复操作");
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ oneReport = list.get(0);
|
|
|
|
+ //直接进行项目经理审核驳回
|
|
|
|
+ reportMapper.update(new Report().setState(2)
|
|
|
|
+ .setRejectReason(reason).setRejectUserid(user.getId()).setRejectUsername(user.getName()),eq);
|
|
|
|
+
|
|
|
|
+ TimeType timeType = timeTypeMapper.selectById(company.getId());
|
|
|
|
+ if (timeType.getReportAuditType() == 2 || timeType.getReportAuditType() == 9) {
|
|
|
|
+ List<Report> rList = list;
|
|
|
|
+ //退回任务分组审核状态
|
|
|
|
+ List<Report> newList = new ArrayList<>();
|
|
|
|
+ for (Report r : rList) {
|
|
|
|
+ Report upR = new Report();
|
|
|
|
+ upR.setId(r.getId());
|
|
|
|
+ upR.setGroupAuditState(0);
|
|
|
|
+ String inchargerId = taskGroupMapper.selectById(r.getGroupId()).getInchargerId();
|
|
|
|
+ upR.setProjectAuditorId(inchargerId);
|
|
|
|
+ upR.setProjectAuditorName(userMapper.selectById(inchargerId).getName());
|
|
|
|
+ newList.add(upR);
|
|
|
|
+ }
|
|
|
|
+ updateBatchById(newList);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //修改审核记录的状态
|
|
|
|
+ log.setState(3);
|
|
|
|
+ reportAlogMembdateMapper.updateById(log);
|
|
|
|
+
|
|
|
|
+ saveDenyReportLog(list, user.getId(), user.getName(), reason);
|
|
|
|
+
|
|
|
|
+ List<Integer> collect = list.stream().map(Report::getProjectId).collect(Collectors.toList());
|
|
|
|
+ List<Project> projectList = projectMapper.selectList(new QueryWrapper<Project>().in("id", collect));
|
|
|
|
+ String pNames = projectList.stream().map(Project::getProjectName).collect(Collectors.joining(", ", "[", "]"));
|
|
|
|
+ //String str = "您"+createDate+"填写的日报中"+pNames+"项目被["+user.getName()+"]驳回。原因:" + reason;;
|
|
|
|
+ String str = MessageUtils.message("report.dailyReject",createDate,pNames,user.getName(),reason);
|
|
|
|
+ String fillUserId = oneReport.getCreatorId();
|
|
|
|
+
|
|
|
|
+ informationMapper.insert(new Information().setType(0).setContent(createDate).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(), createDate, pNames, reason, user.getName(), reporter.getDingdingUserid());
|
|
|
|
+ }
|
|
|
|
+ if (corpwxUserid != null) {
|
|
|
|
+ WxCorpInfo info = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", company.getId()));
|
|
|
|
+ wxCorpInfoService.sendWXCorpMsg(info, corpwxUserid, str, null, WxCorpInfoServiceImpl.TEXT_CARD_MSG_REPORT_DENY);
|
|
|
|
+ } else if (reporter.getWxOpenid() != null){
|
|
|
|
+ //发送个人微信通知
|
|
|
|
+ pushReject(str, reporter, user.getName(), reason);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
return new HttpRespMsg();
|
|
return new HttpRespMsg();
|
|
}
|
|
}
|
|
}
|
|
}
|