|
@@ -148,6 +148,9 @@ public class TaskController {
|
|
@Resource
|
|
@Resource
|
|
private InformationMapper informationMapper;
|
|
private InformationMapper informationMapper;
|
|
|
|
|
|
|
|
+ @Resource
|
|
|
|
+ private TaskDailyAllocateService taskDailyAllocateService;
|
|
|
|
+
|
|
//用于控制线程锁
|
|
//用于控制线程锁
|
|
public static HashMap<String, CorpwxJobResult> corpwxJobCenter = new HashMap();
|
|
public static HashMap<String, CorpwxJobResult> corpwxJobCenter = new HashMap();
|
|
public static HashMap<String, Integer> corpddJobCenter = new HashMap();
|
|
public static HashMap<String, Integer> corpddJobCenter = new HashMap();
|
|
@@ -234,9 +237,17 @@ public class TaskController {
|
|
task.setTaskStatus(STATUS_FIRST_CHECK);
|
|
task.setTaskStatus(STATUS_FIRST_CHECK);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ ArrayList<TaskDailyAllocate> allocateArrayList = new ArrayList<>();
|
|
if (!StringUtils.isEmpty(executorListStr)) {
|
|
if (!StringUtils.isEmpty(executorListStr)) {
|
|
List<User> allUsers = userMapper.selectList(new QueryWrapper<User>().eq("company_id", user.getCompanyId()));
|
|
List<User> allUsers = userMapper.selectList(new QueryWrapper<User>().eq("company_id", user.getCompanyId()));
|
|
List<TaskExecutor> executorList = JSONArray.parseArray(executorListStr, TaskExecutor.class);
|
|
List<TaskExecutor> executorList = JSONArray.parseArray(executorListStr, TaskExecutor.class);
|
|
|
|
+ for (TaskExecutor taskExecutor : executorList) {
|
|
|
|
+ if (org.apache.commons.lang3.StringUtils.isNotEmpty(taskExecutor.getDailyAllocateListStr())){
|
|
|
|
+ String dailyAllocateListStr = taskExecutor.getDailyAllocateListStr();
|
|
|
|
+ List<TaskDailyAllocate> taskDailyAllocates = JSONArray.parseArray(dailyAllocateListStr, TaskDailyAllocate.class);
|
|
|
|
+ allocateArrayList.addAll(taskDailyAllocates);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
task.setExecutorList(executorList);
|
|
task.setExecutorList(executorList);
|
|
StringBuilder conflictExecutor = new StringBuilder();
|
|
StringBuilder conflictExecutor = new StringBuilder();
|
|
executorList.stream().forEach(ex->{
|
|
executorList.stream().forEach(ex->{
|
|
@@ -516,6 +527,9 @@ public class TaskController {
|
|
information.setJumpType(3);
|
|
information.setJumpType(3);
|
|
informationService.save(information);
|
|
informationService.save(information);
|
|
}
|
|
}
|
|
|
|
+ if (!allocateArrayList.isEmpty()) {
|
|
|
|
+ taskDailyAllocateService.saveBatch(allocateArrayList);
|
|
|
|
+ }
|
|
} else if (saved && shouldResetAuditStatus) {
|
|
} else if (saved && shouldResetAuditStatus) {
|
|
msgRecepientList=new ArrayList<>();
|
|
msgRecepientList=new ArrayList<>();
|
|
//给第一审核人发送信息提醒
|
|
//给第一审核人发送信息提醒
|
|
@@ -537,6 +551,10 @@ public class TaskController {
|
|
information.setUserId(owner.getId());
|
|
information.setUserId(owner.getId());
|
|
information.setTime(LocalDateTime.now());
|
|
information.setTime(LocalDateTime.now());
|
|
informationService.save(information);
|
|
informationService.save(information);
|
|
|
|
+ if (!allocateArrayList.isEmpty()) {
|
|
|
|
+ taskDailyAllocateService.remove(new QueryWrapper<TaskDailyAllocate>().eq("task_id",task.getId()));
|
|
|
|
+ taskDailyAllocateService.saveBatch(allocateArrayList);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
if (task.getExecutorId() == null) {
|
|
if (task.getExecutorId() == null) {
|
|
//清空执行人
|
|
//清空执行人
|
|
@@ -1040,6 +1058,15 @@ public class TaskController {
|
|
}
|
|
}
|
|
//查询任务的执行人
|
|
//查询任务的执行人
|
|
List<TaskExecutor> executorList = taskExecutorMapper.getInfoWithFileCharge(t.getId());
|
|
List<TaskExecutor> executorList = taskExecutorMapper.getInfoWithFileCharge(t.getId());
|
|
|
|
+ List<TaskDailyAllocate> allocateList = taskDailyAllocateService.list(new QueryWrapper<TaskDailyAllocate>().eq("task_id", id));
|
|
|
|
+ // 1. 按 userId 预先分组(避免后续重复筛选)
|
|
|
|
+ Map<String, List<TaskDailyAllocate>> allocateMap = allocateList.stream()
|
|
|
|
+ .collect(Collectors.groupingBy(TaskDailyAllocate::getUserId));
|
|
|
|
+
|
|
|
|
+ // 2. 直接为每个 executor 设置对应的分配记录
|
|
|
|
+ executorList.forEach(executor ->
|
|
|
|
+ executor.setDailyAllocateList(allocateMap.getOrDefault(executor.getExecutorId(), Collections.emptyList()))
|
|
|
|
+ );
|
|
|
|
|
|
t.setExecutorList(executorList);
|
|
t.setExecutorList(executorList);
|
|
//设置人员选择下拉列表
|
|
//设置人员选择下拉列表
|