|
@@ -9949,39 +9949,37 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
QueryWrapper<Report> eq = new QueryWrapper<Report>().eq("create_date", createDate).eq("creator_id", userId);
|
|
|
List<Report> list = reportMapper.selectList(eq);
|
|
|
Report oneReport = null;
|
|
|
+ boolean shouldUpdateReport = true;
|
|
|
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;
|
|
|
- }
|
|
|
+ } else if (list.get(0).getState() == 3 || list.get(0).getState() == 2){
|
|
|
+ shouldUpdateReport = false;
|
|
|
}
|
|
|
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);
|
|
|
+ //直接进行项目经理审核驳回
|
|
|
+ if (shouldUpdateReport) {
|
|
|
+ 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);
|
|
|
+ }
|
|
|
+ if (newList.size() > 0) {
|
|
|
+ updateBatchById(newList);
|
|
|
+ }
|
|
|
}
|
|
|
- updateBatchById(newList);
|
|
|
}
|
|
|
|
|
|
//修改审核记录的状态
|