|
@@ -28,6 +28,7 @@ import org.springframework.http.converter.json.MappingJackson2HttpMessageConvert
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.util.StringUtils;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import org.springframework.web.client.DefaultResponseErrorHandler;
|
|
|
import org.springframework.web.client.RestTemplate;
|
|
@@ -1572,7 +1573,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
new QueryWrapper<AuditWorkflowTimeSetting>().eq("dept_id", auditTargetUser.getDepartmentId())
|
|
|
.orderByAsc("seq"));
|
|
|
if (settings.size() == 0) {
|
|
|
- //直接进行项目经理审核
|
|
|
+ //当前无流程,直接审核通过
|
|
|
reportMapper.update(new Report().setState(1).setProjectAuditState(1).setProjectAuditTime(LocalDateTime.now()).setEvaluate(timeType.getNeedEvaluate()==1?evaluate:null),
|
|
|
new QueryWrapper<Report>().in("id", ids));
|
|
|
} else {
|
|
@@ -1610,8 +1611,6 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
}
|
|
|
upR.setIsFinalAudit(nextNode.getIsFinal());
|
|
|
break;
|
|
|
- } else {
|
|
|
- System.out.println("无匹配的中间审批流节点");
|
|
|
}
|
|
|
}
|
|
|
reportMapper.update(upR,
|
|
@@ -5295,4 +5294,52 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
}
|
|
|
reportMapper.update(upR, new QueryWrapper<Report>().in("id", targetRids));
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ public HttpRespMsg approveDeptAuditReport(User user, String auditDeptId) {
|
|
|
+ HttpRespMsg msg = new HttpRespMsg();
|
|
|
+ Integer companyId = user.getCompanyId();
|
|
|
+ QueryWrapper<Report> queryWrapper = new QueryWrapper<Report>().select("id, create_date, creator_id").eq("state", 0).eq("is_dept_audit", 1).eq("audit_deptid", auditDeptId).eq("company_id", companyId);
|
|
|
+ //审核人
|
|
|
+ List<Report> reportList = reportMapper.selectList(queryWrapper);
|
|
|
+ if (reportList.size() > 0) {
|
|
|
+ Report oneReport = reportList.get(0);
|
|
|
+ Report upR = new Report();
|
|
|
+ TimeType timeType = timeTypeMapper.selectById(companyId);
|
|
|
+ List<Integer> ids = reportList.stream().map(Report::getId).collect(Collectors.toList());
|
|
|
+ upR.setIsFinalAudit(1);
|
|
|
+ upR.setState(1);
|
|
|
+ upR.setProjectAuditState(1).setProjectAuditTime(LocalDateTime.now());
|
|
|
+ reportMapper.update(upR,
|
|
|
+ new QueryWrapper<Report>().in("id", ids));
|
|
|
+ //重新查询,获取最新状态的日报
|
|
|
+ reportList = reportMapper.selectList(new QueryWrapper<Report>().in("id", ids));
|
|
|
+ //对导入审核,添加记录
|
|
|
+ int channel = 1; //0-导入审核, 项目报告审核
|
|
|
+ ReportAuditLog log = new ReportAuditLog();
|
|
|
+ log.setAuditChannel(channel);
|
|
|
+ log.setCompanyId(companyId);
|
|
|
+ //log.setResult("通过");
|
|
|
+ log.setResult(MessageUtils.message("profession.approved"));
|
|
|
+ log.setUserId(user.getId());
|
|
|
+ log.setUserName(user.getName());
|
|
|
+ log.setProjectName("");
|
|
|
+ reportAuditLogMapper.insert(log);
|
|
|
+ //员工的日期
|
|
|
+ ReportAlogMembdate membdate = new ReportAlogMembdate();
|
|
|
+ membdate.setRlogId(log.getId());
|
|
|
+ membdate.setState(1);//通过
|
|
|
+ membdate.setCreateDate(oneReport.getCreateDate());
|
|
|
+ membdate.setUserId(oneReport.getCreatorId());
|
|
|
+ membdate.setUserName(userMapper.selectById(oneReport.getCreatorId()).getName());
|
|
|
+ reportAlogMembdateMapper.insert(membdate);
|
|
|
+
|
|
|
+ //日报的审核过程记录
|
|
|
+ saveApproveReportLog(reportList, user.getId(), user.getName());
|
|
|
+ } else {
|
|
|
+ msg.setError("无待审核日报");
|
|
|
+ }
|
|
|
+
|
|
|
+ return msg;
|
|
|
+ }
|
|
|
}
|