|
@@ -477,7 +477,6 @@ public class ReportController {
|
|
|
customData[i] = 0.0;
|
|
|
}
|
|
|
}
|
|
|
- System.out.println("projectAuditorId:"+(projectAuditorId == null?"为Null":"Length="+projectAuditorId.length));
|
|
|
if (projectAuditorId == null || projectAuditorId.length == 0) {
|
|
|
projectAuditorId = new String[projectId.length];
|
|
|
for(int i=0;i<projectAuditorId.length; i++) {
|
|
@@ -1193,38 +1192,7 @@ public class ReportController {
|
|
|
//并非并行审核模式下的代填,需要设置审核状态
|
|
|
report.setState(0);
|
|
|
setReportWorkflowAuditor(auditWorkflowList, allDeptList, report,comTimeType);
|
|
|
-// if (auditWorkflowList.size() == 0) {
|
|
|
-// //没有自定义审核流,直接代填的,还是走正常的审核流程
|
|
|
-// report.setIsDeptAudit(0);
|
|
|
-// report.setIsFinalAudit(1);
|
|
|
-// report.setState(0);
|
|
|
-// } else {
|
|
|
-// System.out.println("代填的情况下,有自定义审核流程");
|
|
|
-
|
|
|
-// int projectLeaderNodeIndex = 0;
|
|
|
-// for (int t=0;t<auditWorkflowList.size(); t++) {
|
|
|
-// if (auditWorkflowList.get(t).getIsDeptAudit() == 0) {
|
|
|
-// projectLeaderNodeIndex = t;
|
|
|
-// break;
|
|
|
-// }
|
|
|
-// }
|
|
|
-// if (projectLeaderNodeIndex == auditWorkflowList.size() -1) {
|
|
|
-// //最后一个节点就是项目经理,那就不用审核了,直接通过
|
|
|
-// report.setState(1);
|
|
|
-// } else {
|
|
|
-// //否则取下一个节点,待审核
|
|
|
-// report.setState(0);
|
|
|
-// int nextIndex = projectLeaderNodeIndex + 1;
|
|
|
-// AuditWorkflowTimeSetting nextNode = auditWorkflowList.get(nextIndex);
|
|
|
-// report.setIsFinalAudit((nextIndex == auditWorkflowList.size()-1)?1:0);
|
|
|
-// report.setIsDeptAudit(nextNode.getIsDeptAudit());
|
|
|
-// report.setAuditDeptid(nextNode.getAuditDeptId());
|
|
|
-// report.setAuditDeptManagerid(nextNode.getAuditDeptId() != null?allDeptList.stream().filter(d->d.getDepartmentId().equals(nextNode.getAuditDeptId())).findFirst().get().getManagerId(): null);
|
|
|
-// }
|
|
|
-// }
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
if (taskId != null && taskId[i] != null && taskId[i] != 0) {
|
|
|
report.setTaskId(taskId[i]);
|
|
|
}
|
|
@@ -1607,11 +1575,18 @@ public class ReportController {
|
|
|
for (User creator : creatorList) {
|
|
|
if (!StringUtils.isEmpty(creator.getSuperiorId())) {
|
|
|
User superior = userMapper.selectById(creator.getSuperiorId());
|
|
|
+ //校验直属日报审核人是否已经离职
|
|
|
+ if (superior.getIsActive() == 0) {
|
|
|
+ HttpRespMsg msg = new HttpRespMsg();
|
|
|
+ msg.setError("直属日报审核人已离职,请联系管理员重新设置后再提交");
|
|
|
+ return msg;
|
|
|
+ }
|
|
|
if (!tempAuditorUserList.stream().anyMatch(item -> item.getId().equals(superior.getId()))) {
|
|
|
tempAuditorUserList.add(superior);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
for (Report report : reportList) {
|
|
|
report.setDepartmentAuditState(0);
|
|
|
//优先按照当前日报填写人的直属审核人审核
|
|
@@ -1631,6 +1606,14 @@ public class ReportController {
|
|
|
HttpRespMsg httpRespMsg=new HttpRespMsg();
|
|
|
httpRespMsg.setError("当前所在部门["+first.get().getDepartmentName()+"]不存在负责人,请联系管理员设置");
|
|
|
return httpRespMsg;
|
|
|
+ } else {
|
|
|
+ //检查部门负责人是否已经离职
|
|
|
+ User deptAuditor = userMapper.selectById(first.get().getManagerId());
|
|
|
+ if (deptAuditor.getIsActive() == 0) {
|
|
|
+ HttpRespMsg msg = new HttpRespMsg();
|
|
|
+ msg.setError("部门负责人已离职,请联系管理员重新设置后再提交");
|
|
|
+ return msg;
|
|
|
+ }
|
|
|
}
|
|
|
report.setAuditDeptid(first.get().getDepartmentId());
|
|
|
report.setProjectAuditorId(null);
|
|
@@ -1938,8 +1921,8 @@ public class ReportController {
|
|
|
}
|
|
|
}
|
|
|
HttpRespMsg httpRespMsg = reportService.editReport(reportList, createDate.length > 0 ? createDate[0] : null, targetUserList, hourCost, user.getCompanyId(), summary, weeklyAttachment);
|
|
|
- //填报自动通过功能:【上海绎维】、【火石演示】、【博通容合】、【威派格】使用
|
|
|
- if (company.getId() == 862 || company.getId() == 10 || company.getId() == 3344 || company.getId() == 936) {
|
|
|
+ //填报自动通过功能:【上海绎维】、【火石演示】、【博通容合】、【威派格】使用;以及设置了自动审核通过的公司
|
|
|
+ if (company.getId() == 862 || company.getId() == 3344 || company.getId() == 936 || comTimeType.getAutoProjectApprove()) {
|
|
|
//项目审核人是提交人的情况,直接审核
|
|
|
List<String> reportIds = new ArrayList<>();
|
|
|
for (int i = 0; i<id.length; i++) {
|
|
@@ -2971,7 +2954,7 @@ public class ReportController {
|
|
|
}
|
|
|
|
|
|
@RequestMapping("/denyByCheckId")
|
|
|
- public HttpRespMsg denyByCheckId(String userId){
|
|
|
+ public HttpRespMsg denyByCheckId(String userId, @RequestParam(required = false,defaultValue = "true") Boolean isPermanent, HttpServletRequest request){
|
|
|
HttpRespMsg msg=new HttpRespMsg();
|
|
|
Integer companyId = userMapper.selectById(request.getHeader("token")).getCompanyId();
|
|
|
LambdaQueryWrapper<Report> queryWrapper = new LambdaQueryWrapper<>();
|
|
@@ -2981,6 +2964,7 @@ public class ReportController {
|
|
|
List<Report> reportList = reportMapper.selectList(queryWrapper);
|
|
|
reportList.forEach(r->{
|
|
|
r.setState(2);
|
|
|
+ r.setRejectReason("审核人已离职,请重新提交日报");
|
|
|
});
|
|
|
if(!reportService.updateBatchById(reportList)){
|
|
|
msg.setError("验证失败");
|
|
@@ -2989,12 +2973,16 @@ public class ReportController {
|
|
|
User user = userMapper.selectById(userId);
|
|
|
user.setIsActive(0);
|
|
|
userMapper.updateById(user);
|
|
|
- participationMapper.delete(new LambdaQueryWrapper<Participation>().eq(Participation::getUserId,user.getId()));
|
|
|
+ if (isPermanent) {
|
|
|
+ //永久移除,需要删除
|
|
|
+ participationMapper.delete(new LambdaQueryWrapper<Participation>().eq(Participation::getUserId,user.getId()));
|
|
|
+ }
|
|
|
+
|
|
|
return msg;
|
|
|
}
|
|
|
|
|
|
@RequestMapping("/transferReportAuditor")
|
|
|
- public HttpRespMsg transferReportAuditor(String userId, String targetAuditorId){
|
|
|
+ public HttpRespMsg transferReportAuditor(String userId, String targetAuditorId,@RequestParam(required = false,defaultValue = "true") Boolean isPermanent){
|
|
|
HttpRespMsg msg=new HttpRespMsg();
|
|
|
Integer companyId = userMapper.selectById(request.getHeader("token")).getCompanyId();
|
|
|
LambdaQueryWrapper<Report> queryWrapper = new LambdaQueryWrapper<>();
|
|
@@ -3016,7 +3004,10 @@ public class ReportController {
|
|
|
User user = userMapper.selectById(userId);
|
|
|
user.setIsActive(0);
|
|
|
userMapper.updateById(user);
|
|
|
- participationMapper.delete(new LambdaQueryWrapper<Participation>().eq(Participation::getUserId,user.getId()));
|
|
|
+ if (isPermanent) {
|
|
|
+ //永久移除,需要删除
|
|
|
+ participationMapper.delete(new LambdaQueryWrapper<Participation>().eq(Participation::getUserId,user.getId()));
|
|
|
+ }
|
|
|
return msg;
|
|
|
}
|
|
|
|