|
@@ -1005,25 +1005,25 @@ public class TaskProcessServiceImpl extends BaseServiceImpl<TaskProcessMapper, T
|
|
switch (businessDataType) {
|
|
switch (businessDataType) {
|
|
case 1: //计划任务
|
|
case 1: //计划任务
|
|
if (taskStatus == 2) { //通过审批
|
|
if (taskStatus == 2) { //通过审批
|
|
- //task_approve = 1 已审批 , status = 4 已完成
|
|
|
|
|
|
+ /*//task_approve = 1 已审批 , status = 4 已完成
|
|
jdbcTemplate.execute("update c_project_cost_budget set task_approve = 1,status = 4 where id = " + dataId);
|
|
jdbcTemplate.execute("update c_project_cost_budget set task_approve = 1,status = 4 where id = " + dataId);
|
|
|
|
|
|
//判断是否为转移任务,计划任务转移后,修改计划任务人id
|
|
//判断是否为转移任务,计划任务转移后,修改计划任务人id
|
|
TaskPlanUpdateStatusInfo taskPlanUpdateStatusInfo = jdbcTemplate.query("select * from c_task_plan_update_status_info where update_type = 2 and approve_task_id = " + approveTaskId + " and plan_task_id = " + dataId, new BeanPropertyRowMapper<>(TaskPlanUpdateStatusInfo.class)).stream().findAny().orElse(null);
|
|
TaskPlanUpdateStatusInfo taskPlanUpdateStatusInfo = jdbcTemplate.query("select * from c_task_plan_update_status_info where update_type = 2 and approve_task_id = " + approveTaskId + " and plan_task_id = " + dataId, new BeanPropertyRowMapper<>(TaskPlanUpdateStatusInfo.class)).stream().findAny().orElse(null);
|
|
if (taskPlanUpdateStatusInfo != null) {
|
|
if (taskPlanUpdateStatusInfo != null) {
|
|
jdbcTemplate.execute("update c_project_cost_budget set task_approve = 0,status = 2,task_user = " + taskPlanUpdateStatusInfo.getTransferObject() + " where id = " + taskPlanUpdateStatusInfo.getPlanTaskId());
|
|
jdbcTemplate.execute("update c_project_cost_budget set task_approve = 0,status = 2,task_user = " + taskPlanUpdateStatusInfo.getTransferObject() + " where id = " + taskPlanUpdateStatusInfo.getPlanTaskId());
|
|
|
|
+ */
|
|
|
|
+ //任务转移后,标记关系信息为转移任务
|
|
|
|
+ jdbcTemplate.execute("update c_expense_task_record set is_transfer = 1 where expense_info_type = 1 and task_id = " + approveTaskId + " and expense_info_id = " + dataId);
|
|
|
|
|
|
- //任务转移后,标记关系信息为转移任务
|
|
|
|
- jdbcTemplate.execute("update c_expense_task_record set is_transfer = 1 where expense_info_type = 1 and task_id = " + approveTaskId + " and expense_info_id = " + dataId);
|
|
|
|
|
|
+ //删除当前计划任务与日志关系信息(如果任务转移,那么就不属于该用户了,就应该在新用户写日志时,与新用户绑定)
|
|
|
|
+ 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) { //驳回审批
|
|
//task_approve = 0 未开始 , status = 2 进行中
|
|
//task_approve = 0 未开始 , status = 2 进行中
|
|
jdbcTemplate.execute("update c_project_cost_budget set task_approve = 0,status = 2 where id = " + dataId);
|
|
jdbcTemplate.execute("update c_project_cost_budget set task_approve = 0,status = 2 where id = " + dataId);
|
|
- }
|
|
|
|
|
|
+ }*/
|
|
break;
|
|
break;
|
|
|
|
|
|
case 2: //财务
|
|
case 2: //财务
|
|
@@ -1079,21 +1079,18 @@ public class TaskProcessServiceImpl extends BaseServiceImpl<TaskProcessMapper, T
|
|
switch (businessDataType) {
|
|
switch (businessDataType) {
|
|
case 1:
|
|
case 1:
|
|
//计划任务 task_approve = 1,status = 4 表示已完成,且通过审批
|
|
//计划任务 task_approve = 1,status = 4 表示已完成,且通过审批
|
|
|
|
+ TaskProcessInfo taskProcessInfo = jdbcTemplate.query("select status from c_task_process_info where id = " + approveTaskId, new BeanPropertyRowMapper<>(TaskProcessInfo.class)).stream().findAny().orElse(null);
|
|
ProjectCostBudget projectCostBudget = jdbcTemplate.query("select * from c_project_cost_budget where id = " + dataId, new BeanPropertyRowMapper<>(ProjectCostBudget.class)).stream().findAny().orElse(null);
|
|
ProjectCostBudget projectCostBudget = jdbcTemplate.query("select * from c_project_cost_budget where id = " + dataId, new BeanPropertyRowMapper<>(ProjectCostBudget.class)).stream().findAny().orElse(null);
|
|
- if (projectCostBudget != null && projectCostBudget.getStatus().equals(4) && projectCostBudget.getTaskApprove().equals(1)) {
|
|
|
|
|
|
+ if (taskProcessInfo != 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) {
|
|
|
|
|
|
+ if (taskPlanUpdateStatusInfo != null && taskProcessInfo.getStatus().equals(2)) { //已完成的任务才推送
|
|
//修改任务实际完成时间、金额
|
|
//修改任务实际完成时间、金额
|
|
LocalDate localDate = taskPlanUpdateStatusInfo.getCompletionTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
|
|
LocalDate localDate = taskPlanUpdateStatusInfo.getCompletionTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
|
|
projectCostBudgetService.taskFinishedStats(projectCostBudget.getId(), localDate);
|
|
projectCostBudgetService.taskFinishedStats(projectCostBudget.getId(), localDate);
|
|
}
|
|
}
|
|
-
|
|
|
|
//日志信息
|
|
//日志信息
|
|
- TaskProcessInfo taskProcessInfo = jdbcTemplate.query("select task_name from c_task_process_info where id = " + approveTaskId, new BeanPropertyRowMapper<>(TaskProcessInfo.class)).stream().findAny().orElse(null);
|
|
|
|
- if (taskProcessInfo != null) {
|
|
|
|
- planInformService.taskFinishedInform(taskProcessInfo.getTaskName(), projectCostBudget.getTaskUser(), SecureUtil.getUserName());
|
|
|
|
- }
|
|
|
|
|
|
+ planInformService.taskFinishedInform(projectCostBudget.getPlanTaskDesc(), projectCostBudget.getTaskUser(), SecureUtil.getUserName(), taskProcessInfo.getStatus());
|
|
}
|
|
}
|
|
|
|
|
|
break;
|
|
break;
|
|
@@ -1132,6 +1129,7 @@ public class TaskProcessServiceImpl extends BaseServiceImpl<TaskProcessMapper, T
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -1256,9 +1254,11 @@ public class TaskProcessServiceImpl extends BaseServiceImpl<TaskProcessMapper, T
|
|
*/
|
|
*/
|
|
public User getDepartmentHead(Long deptId) {
|
|
public User getDepartmentHead(Long deptId) {
|
|
if (ObjectUtil.isNotEmpty(deptId)) {
|
|
if (ObjectUtil.isNotEmpty(deptId)) {
|
|
- List<User> leaderUser = jdbcTemplate.query("select * from blade_user where tenant_id = " + SecureUtil.getUser().getTenantId() + " and dept_id = " + deptId + " and is_leader like '%" + deptId + "%'", new BeanPropertyRowMapper<>(User.class));
|
|
|
|
|
|
+ List<User> leaderUser = jdbcTemplate.query("select * from blade_user where tenant_id = " + SecureUtil.getUser().getTenantId() + " and is_leader like '%" + deptId + "%'", new BeanPropertyRowMapper<>(User.class));
|
|
if (leaderUser.size() == 1) {
|
|
if (leaderUser.size() == 1) {
|
|
return leaderUser.get(0);
|
|
return leaderUser.get(0);
|
|
|
|
+ } else if (leaderUser.size() > 1) {
|
|
|
|
+ throw new ServiceException("获取到多个部门负责人,请联系管理员");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return null;
|
|
return null;
|