|
|
@@ -3,18 +3,21 @@ package com.hssx.pcbms.service.impl;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
+import com.hssx.pcbms.constant.Constant;
|
|
|
import com.hssx.pcbms.entity.Task;
|
|
|
+import com.hssx.pcbms.entity.TaskDynamic;
|
|
|
import com.hssx.pcbms.entity.TaskParticipants;
|
|
|
import com.hssx.pcbms.entity.vo.TaskDTO;
|
|
|
import com.hssx.pcbms.entity.vo.TaskVO;
|
|
|
+import com.hssx.pcbms.mapper.TaskDynamicMapper;
|
|
|
import com.hssx.pcbms.mapper.TaskMapper;
|
|
|
+import com.hssx.pcbms.mapper.UserMapper;
|
|
|
import com.hssx.pcbms.service.TaskParticipantsService;
|
|
|
import com.hssx.pcbms.service.TaskService;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.hssx.pcbms.util.HttpRespMsg;
|
|
|
import com.hssx.pcbms.util.ListUtil;
|
|
|
import com.hssx.pcbms.util.PageUtil;
|
|
|
-import org.apache.commons.collections4.collection.CompositeCollection;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
@@ -37,6 +40,10 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
|
|
|
private TaskMapper taskMapper;
|
|
|
@Resource
|
|
|
private TaskParticipantsService taskParticipantsService;
|
|
|
+ @Resource
|
|
|
+ private TaskDynamicMapper taskDynamicMapper;
|
|
|
+ @Resource
|
|
|
+ private UserMapper userMapper;
|
|
|
|
|
|
@Override
|
|
|
public HttpRespMsg addOrUpdate(Task task,String participantsIdes) {
|
|
|
@@ -44,6 +51,11 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
|
|
|
List<TaskParticipants> taskParticipants = new ArrayList<>();
|
|
|
if(null == task.getId()){
|
|
|
taskMapper.insert(task);
|
|
|
+ TaskDynamic taskDynamic = new TaskDynamic();
|
|
|
+ taskDynamic.setTaskId(task.getId());
|
|
|
+ taskDynamic.setTaskState(0);//待派发
|
|
|
+ taskDynamic.setStateContent(userMapper.selectById(task.getPublishId()).getName()+Constant.TASK_PULISH);
|
|
|
+ taskDynamicMapper.insert(taskDynamic);
|
|
|
if(participantsIdes.length()>0 && participantsIdes != ""){
|
|
|
List<Integer> ids = ListUtil.convertIntegerIdsArrayToList(participantsIdes);
|
|
|
for (Integer id : ids) {
|
|
|
@@ -55,7 +67,11 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
|
|
|
taskParticipantsService.saveBatch(taskParticipants);
|
|
|
}
|
|
|
}else{
|
|
|
+// if(task.getDelayTime()){
|
|
|
+//
|
|
|
+// }
|
|
|
taskMapper.updateById(task);
|
|
|
+
|
|
|
if(participantsIdes.length()>0 && participantsIdes != ""){
|
|
|
taskParticipantsService.remove(new QueryWrapper<TaskParticipants>().eq("task_id",task.getId()));
|
|
|
List<Integer> ids = ListUtil.convertIntegerIdsArrayToList(participantsIdes);
|