yusm 1 maand geleden
bovenliggende
commit
833b1f850b

+ 11 - 1
fhKeeper/formulahousekeeper/management-platform-mld/src/main/java/com/management/platform/controller/TaskController.java

@@ -204,6 +204,7 @@ public class TaskController {
         WxCorpInfo wxCorpInfo = wxCorpInfoService.getOne(new QueryWrapper<WxCorpInfo>().eq("company_id", user.getCompanyId()));
         int isInsert=0;
         boolean shouldResetAuditStatus = false;
+        boolean shouldUpdatetaskDailyAllocate = false;
         List<TaskType> typeList = taskTypeMapper.selectList(new QueryWrapper<TaskType>().eq("company_id", user.getCompanyId()));
         TaskType taskType = typeList.stream().filter(t->t.getId()==task.getTaskPlanType()).findAny().orElse(null);
         if (taskType == null){
@@ -502,6 +503,9 @@ public class TaskController {
             }
 
         }
+        if (task.getTaskStatus()>=2){
+            shouldUpdatetaskDailyAllocate=true;
+        }
         boolean saved = taskService.saveOrUpdate(task);
         //新增成功,给第一审核人发送信息提醒
         if (saved&&isInsert==1){
@@ -531,7 +535,8 @@ public class TaskController {
                 allocateArrayList.forEach(a->a.setTaskId(task.getId()));
                 taskDailyAllocateService.saveBatch(allocateArrayList);
             }
-        } else if (saved && shouldResetAuditStatus) {
+        }
+        else if (saved && shouldResetAuditStatus) {
             msgRecepientList=new ArrayList<>();
             //给第一审核人发送信息提醒
             log.info("撤销/驳回后小组长修改,给第一审核人发送信息提醒");
@@ -556,6 +561,11 @@ public class TaskController {
                 taskDailyAllocateService.remove(new QueryWrapper<TaskDailyAllocate>().eq("task_id",task.getId()));
                 taskDailyAllocateService.saveBatch(allocateArrayList);
             }
+        } else if (saved&&shouldUpdatetaskDailyAllocate) {
+            if (!allocateArrayList.isEmpty()) {
+                taskDailyAllocateService.remove(new QueryWrapper<TaskDailyAllocate>().eq("task_id",task.getId()));
+                taskDailyAllocateService.saveBatch(allocateArrayList);
+            }
         }
 
         if (task.getExecutorId() == null) {

+ 2 - 1
fhKeeper/formulahousekeeper/management-platform-mld/src/main/java/com/management/platform/mapper/TaskDailyAllocateMapper.java

@@ -2,6 +2,7 @@ package com.management.platform.mapper;
 
 import com.management.platform.entity.TaskDailyAllocate;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
 
 import java.time.LocalDateTime;
 import java.util.ArrayList;
@@ -17,7 +18,7 @@ import java.util.ArrayList;
 public interface TaskDailyAllocateMapper extends BaseMapper<TaskDailyAllocate> {
 
 
-    ArrayList<TaskDailyAllocate> getUserTaskTimeList(Integer taskId, String userId, LocalDateTime stateTime, LocalDateTime endTime);
+    ArrayList<TaskDailyAllocate> getUserTaskTimeList(@Param("taskId") Integer taskId,@Param("userId") String userId, @Param("startTime") LocalDateTime stateTime,@Param("endTime") LocalDateTime endTime);
 
 
     int getConflict(TaskDailyAllocate taskDailyAllocate);

+ 1 - 0
fhKeeper/formulahousekeeper/management-platform-mld/src/main/java/com/management/platform/service/impl/TaskServiceImpl.java

@@ -940,6 +940,7 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
                         taskExecutor.setExecutorName(user.getName());
                         taskExecutor.setExecutorColor(user.getColor());
                         taskExecutor.setPlanHours(hoursDifference);
+                        initworkHourExector=hoursDifference;
                         taskExecutor.setProjectId(task.getProjectId());
 
                         Integer count = taskMapper.getUserConflitTaskCount(user.getId(), task.getId(), task.getStartDate(), task.getEndDate());