|
@@ -723,9 +723,13 @@ public class TaskProcessServiceImpl extends BaseServiceImpl<TaskProcessMapper, T
|
|
}
|
|
}
|
|
vos.add(vo);
|
|
vos.add(vo);
|
|
}
|
|
}
|
|
-
|
|
|
|
- vos.sort(Comparator.comparing(TaskPlanInfoVO::getEndTime).reversed());
|
|
|
|
- vosPage.setRecords(vos);
|
|
|
|
|
|
+ if (vos.size() > 0) {
|
|
|
|
+ List<TaskPlanInfoVO> collect = vos.stream()
|
|
|
|
+ .filter(vo -> vo.getEndTime() != null)
|
|
|
|
+ .sorted(Comparator.comparing(TaskPlanInfoVO::getEndTime).reversed())
|
|
|
|
+ .collect(Collectors.toList());
|
|
|
|
+ vosPage.setRecords(collect);
|
|
|
|
+ }
|
|
return vosPage;
|
|
return vosPage;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -886,6 +890,10 @@ public class TaskProcessServiceImpl extends BaseServiceImpl<TaskProcessMapper, T
|
|
planInformService.taskFinishedInform2("计划任务完成", taskProcessInfo.getAuditUserIds(), SecureUtil.getNickName(), taskProcessInfo.getStatus());
|
|
planInformService.taskFinishedInform2("计划任务完成", taskProcessInfo.getAuditUserIds(), SecureUtil.getNickName(), taskProcessInfo.getStatus());
|
|
|
|
|
|
} else if (dto.getUpdateType().equals("2")) {
|
|
} else if (dto.getUpdateType().equals("2")) {
|
|
|
|
+ //如果任务正在进行中,则提示要先暂停才能转移
|
|
|
|
+ if (planTaskInfo.getStatus() != 3){
|
|
|
|
+ throw new ServiceException("请先暂停任务,再转移");
|
|
|
|
+ }
|
|
//任务转移
|
|
//任务转移
|
|
TaskProcessInfo taskProcessInfo = new TaskProcessInfo();
|
|
TaskProcessInfo taskProcessInfo = new TaskProcessInfo();
|
|
taskProcessInfo.setId(SnowFlakeUtil.getId());
|
|
taskProcessInfo.setId(SnowFlakeUtil.getId());
|
|
@@ -999,7 +1007,7 @@ public class TaskProcessServiceImpl extends BaseServiceImpl<TaskProcessMapper, T
|
|
if (projectCostBudgetList.size() > 0) {
|
|
if (projectCostBudgetList.size() > 0) {
|
|
//审批人(总经理)
|
|
//审批人(总经理)
|
|
List<String> auditUserIds = new LinkedList<>();
|
|
List<String> auditUserIds = new LinkedList<>();
|
|
- List<Dept> query = jdbcTemplate.query("select id from blade_dept where dept_name = '总经理' and tenant_id = " + SecureUtil.getUser().getTenantId() + " and dept_type = 3", new BeanPropertyRowMapper<>(Dept.class));
|
|
|
|
|
|
+ List<Dept> query = jdbcTemplate.query("select id from blade_dept where dept_name = '总经理' and tenant_id = " + SecureUtil.getUser().getTenantId() + " and dept_type = 3 and is_deleted = 0", new BeanPropertyRowMapper<>(Dept.class));
|
|
if (query.size() == 1) {
|
|
if (query.size() == 1) {
|
|
Dept dept = query.get(0);
|
|
Dept dept = query.get(0);
|
|
List<User> users = jdbcTemplate.query("select id from blade_user where post_id like '%" + dept.getId() + "%' and role_id like '%" + dept.getId() + "%' and tenant_id = " + SecureUtil.getUser().getTenantId() + " and is_deleted = 0", new BeanPropertyRowMapper<>(User.class));
|
|
List<User> users = jdbcTemplate.query("select id from blade_user where post_id like '%" + dept.getId() + "%' and role_id like '%" + dept.getId() + "%' and tenant_id = " + SecureUtil.getUser().getTenantId() + " and is_deleted = 0", new BeanPropertyRowMapper<>(User.class));
|
|
@@ -1077,6 +1085,8 @@ public class TaskProcessServiceImpl extends BaseServiceImpl<TaskProcessMapper, T
|
|
|
|
|
|
//删除当前计划任务与日志关系信息(如果任务转移,那么就不属于该用户了,就应该在新用户写日志时,与新用户绑定)
|
|
//删除当前计划任务与日志关系信息(如果任务转移,那么就不属于该用户了,就应该在新用户写日志时,与新用户绑定)
|
|
jdbcTemplate.execute("delete from c_log_history_task_record where task_id = " + dataId);
|
|
jdbcTemplate.execute("delete from c_log_history_task_record where task_id = " + dataId);
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
} else if (taskStatus == 3) { //驳回审批
|
|
} else if (taskStatus == 3) { //驳回审批
|
|
@@ -1186,18 +1196,24 @@ public class TaskProcessServiceImpl extends BaseServiceImpl<TaskProcessMapper, T
|
|
switch (businessDataType) {
|
|
switch (businessDataType) {
|
|
case 1:
|
|
case 1:
|
|
//计划任务
|
|
//计划任务
|
|
- TaskProcessInfo taskProcessInfo1 = jdbcTemplate.query("select status from c_task_process_info where id = " + approveTaskId, new BeanPropertyRowMapper<>(TaskProcessInfo.class)).stream().findAny().orElse(null);
|
|
|
|
|
|
+ TaskProcessInfo taskProcessInfo1 = jdbcTemplate.query("select report_user_id,task_name,status from c_task_process_info where id = " + approveTaskId, new BeanPropertyRowMapper<>(TaskProcessInfo.class)).stream().findAny().orElse(null);
|
|
ProjectCostBudget projectCostBudget = jdbcTemplate.query("select plan_task_desc,task_user,id from c_project_cost_budget where id = " + dataId, new BeanPropertyRowMapper<>(ProjectCostBudget.class)).stream().findAny().orElse(null);
|
|
ProjectCostBudget projectCostBudget = jdbcTemplate.query("select plan_task_desc,task_user,id from c_project_cost_budget where id = " + dataId, new BeanPropertyRowMapper<>(ProjectCostBudget.class)).stream().findAny().orElse(null);
|
|
if (taskProcessInfo1 != null && projectCostBudget != null) {
|
|
if (taskProcessInfo1 != null && projectCostBudget != null) {
|
|
//获取任务完成时间
|
|
//获取任务完成时间
|
|
TaskPlanUpdateStatusInfo taskPlanUpdateStatusInfo = jdbcTemplate.query("select completion_time from c_task_plan_update_status_info where update_type = 1 and approve_task_id = " + approveTaskId + " and plan_task_id = " + dataId, new BeanPropertyRowMapper<>(TaskPlanUpdateStatusInfo.class)).stream().findAny().orElse(null);
|
|
TaskPlanUpdateStatusInfo taskPlanUpdateStatusInfo = jdbcTemplate.query("select completion_time from c_task_plan_update_status_info where update_type = 1 and approve_task_id = " + approveTaskId + " and plan_task_id = " + dataId, new BeanPropertyRowMapper<>(TaskPlanUpdateStatusInfo.class)).stream().findAny().orElse(null);
|
|
- if (taskPlanUpdateStatusInfo != null && taskProcessInfo1.getStatus().equals(2)) { //已完成的任务才推送
|
|
|
|
- //修改任务实际完成时间、金额
|
|
|
|
- LocalDate localDate = taskPlanUpdateStatusInfo.getCompletionTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
|
|
|
|
- projectCostBudgetService.taskFinishedStats(projectCostBudget.getId(), localDate);
|
|
|
|
|
|
+ if (taskProcessInfo1.getTaskName().contains("完成任务")){
|
|
|
|
+ if (taskPlanUpdateStatusInfo != null && taskProcessInfo1.getStatus().equals(2)) { //已完成的任务才推送
|
|
|
|
+ //修改任务实际完成时间、金额
|
|
|
|
+ LocalDate localDate = taskPlanUpdateStatusInfo.getCompletionTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
|
|
|
|
+ projectCostBudgetService.taskFinishedStats(projectCostBudget.getId(), localDate);
|
|
|
|
+ }
|
|
|
|
+ //日志操作信息
|
|
|
|
+ planInformService.taskFinishedInform(projectCostBudget.getPlanTaskDesc(), projectCostBudget.getTaskUser(), SecureUtil.getUserName(), taskProcessInfo1.getStatus());
|
|
|
|
+ }else if (taskProcessInfo1.getTaskName().contains("转移任务")){
|
|
|
|
+ projectCostBudgetService.taskChangeStats(Long.parseLong(dataId),taskProcessInfo1.getReportUserId());
|
|
|
|
+ //日志操作信息
|
|
|
|
+ planInformService.taskChangedInform(taskPlanUpdateStatusInfo.getStartTransferObject(),taskPlanUpdateStatusInfo.getTransferObject(), SecureUtil.getUserName(),projectCostBudget.getPlanTaskDesc());
|
|
}
|
|
}
|
|
- //日志操作信息
|
|
|
|
- planInformService.taskFinishedInform(projectCostBudget.getPlanTaskDesc(), projectCostBudget.getTaskUser(), SecureUtil.getUserName(), taskProcessInfo1.getStatus());
|
|
|
|
}
|
|
}
|
|
|
|
|
|
break;
|
|
break;
|
|
@@ -1303,8 +1319,9 @@ public class TaskProcessServiceImpl extends BaseServiceImpl<TaskProcessMapper, T
|
|
case 10:
|
|
case 10:
|
|
TaskProcessInfo taskProcessInfo10 = jdbcTemplate.query("select status,report_user_id from c_task_process_info where id = " + approveTaskId, new BeanPropertyRowMapper<>(TaskProcessInfo.class)).stream().findAny().orElse(null);
|
|
TaskProcessInfo taskProcessInfo10 = jdbcTemplate.query("select status,report_user_id from c_task_process_info where id = " + approveTaskId, new BeanPropertyRowMapper<>(TaskProcessInfo.class)).stream().findAny().orElse(null);
|
|
if (taskProcessInfo10 != null && taskProcessInfo10.getStatus().equals(2)) {
|
|
if (taskProcessInfo10 != null && taskProcessInfo10.getStatus().equals(2)) {
|
|
|
|
+ String name = projectInfoServiceImpl.getProjectNameByBudgetId(Long.parseLong(dataId));
|
|
//日志操作信息
|
|
//日志操作信息
|
|
- planInformService.taskFinishedInform("成本测算申请", taskProcessInfo10.getReportUserId(), SecureUtil.getNickName(), taskProcessInfo10.getStatus());
|
|
|
|
|
|
+ planInformService.taskFinishedInform(name +"-成本测算申请", taskProcessInfo10.getReportUserId(), SecureUtil.getNickName(), 4);
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
}
|
|
}
|