|
@@ -476,16 +476,23 @@ public class ReportController {
|
|
|
customData[i] = 0.0;
|
|
|
}
|
|
|
}
|
|
|
- if (projectAuditorId == null) {
|
|
|
+ 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++) {
|
|
|
projectAuditorId[i] = null;
|
|
|
}
|
|
|
- } else if (projectAuditorId.length < projectId.length) {
|
|
|
- //数组大小不对,后端无法确定项目和审核人的对应关系,必须前端全部传递过来
|
|
|
- HttpRespMsg msg = new HttpRespMsg();
|
|
|
- msg.setError("请检查每个项目的审核人是否设置");
|
|
|
- return msg;
|
|
|
+ }
|
|
|
+ else if (projectAuditorId.length < projectId.length) {
|
|
|
+ if (comTimeType.getReportAuditType() <= 1) {
|
|
|
+ //数组大小不对,后端无法确定项目和审核人的对应关系,必须前端全部传递过来
|
|
|
+ HttpRespMsg msg = new HttpRespMsg();
|
|
|
+ msg.setError("请检查每个项目的审核人是否设置");
|
|
|
+ return msg;
|
|
|
+ } else {
|
|
|
+ //自动扩充数组大小
|
|
|
+ projectAuditorId = Arrays.copyOf(projectAuditorId, projectId.length);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
if (overtimeHours == null) {
|
|
@@ -2396,13 +2403,13 @@ public class ReportController {
|
|
|
}
|
|
|
|
|
|
@RequestMapping("/getNoReportUserList")
|
|
|
- public HttpRespMsg getNoReportUserList(HttpServletRequest request, String startDate, String endDate,Integer noReportDeptId) {
|
|
|
- return reportService.getNoReportUserList(request, startDate, endDate,noReportDeptId);
|
|
|
+ public HttpRespMsg getNoReportUserList(HttpServletRequest request, String startDate, String endDate,Integer noReportDeptId, @RequestParam(required = false, defaultValue = "0") Integer onlyHaveAttendance) {
|
|
|
+ return reportService.getNoReportUserList(request, startDate, endDate,noReportDeptId, onlyHaveAttendance);
|
|
|
}
|
|
|
|
|
|
@RequestMapping("/exportNoReportUserList")
|
|
|
- public HttpRespMsg exportNoReportUserList(HttpServletRequest request, String startDate, String endDate,Integer noReportDeptId) {
|
|
|
- return reportService.exportNoReportUserList(request, startDate, endDate,noReportDeptId);
|
|
|
+ public HttpRespMsg exportNoReportUserList(HttpServletRequest request, String startDate, String endDate,Integer noReportDeptId, @RequestParam(required = false, defaultValue = "0") Integer onlyHaveAttendance) {
|
|
|
+ return reportService.exportNoReportUserList(request, startDate, endDate,noReportDeptId, onlyHaveAttendance);
|
|
|
}
|
|
|
|
|
|
@RequestMapping("/exportUserDailyWorkTime")
|
|
@@ -2958,6 +2965,33 @@ public class ReportController {
|
|
|
return msg;
|
|
|
}
|
|
|
|
|
|
+ @RequestMapping("/transferReportAuditor")
|
|
|
+ public HttpRespMsg transferReportAuditor(String userId, String targetAuditorId){
|
|
|
+ HttpRespMsg msg=new HttpRespMsg();
|
|
|
+ Integer companyId = userMapper.selectById(request.getHeader("token")).getCompanyId();
|
|
|
+ LambdaQueryWrapper<Report> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ queryWrapper.eq(Report::getState,0);
|
|
|
+ queryWrapper.eq(Report::getCompanyId,companyId);
|
|
|
+ queryWrapper.and(wrapper->wrapper.and(wr->wr.eq(Report::getAuditDeptManagerid,userId).eq(Report::getIsDeptAudit,1)).or(wr1->wr1.eq(Report::getProjectAuditorId,userId).eq(Report::getIsDeptAudit,0)));
|
|
|
+ List<Report> reportList = reportMapper.selectList(queryWrapper);
|
|
|
+ reportList.forEach(r->{
|
|
|
+ if (r.getIsDeptAudit() == 1) {
|
|
|
+ r.setAuditDeptManagerid(targetAuditorId);
|
|
|
+ } else {
|
|
|
+ r.setProjectAuditorId(targetAuditorId);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ if(!reportService.updateBatchById(reportList)){
|
|
|
+ msg.setError("验证失败");
|
|
|
+ return msg;
|
|
|
+ }
|
|
|
+ User user = userMapper.selectById(userId);
|
|
|
+ user.setIsActive(0);
|
|
|
+ userMapper.updateById(user);
|
|
|
+ participationMapper.delete(new LambdaQueryWrapper<Participation>().eq(Participation::getUserId,user.getId()));
|
|
|
+ return msg;
|
|
|
+ }
|
|
|
+
|
|
|
@RequestMapping("/changeReminder")
|
|
|
public HttpRespMsg changeReminder(String createDate,String userId,String startDate,String endDate) throws Exception {
|
|
|
return reportService.changeReminder(request,createDate,userId,startDate,endDate);
|