|
@@ -24,6 +24,7 @@ import org.apache.poi.xssf.usermodel.XSSFSheet;
|
|
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
|
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
|
+import org.springframework.context.ApplicationContext;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.util.StringUtils;
|
|
import org.springframework.util.StringUtils;
|
|
@@ -78,6 +79,9 @@ public class ClueServiceImpl extends ServiceImpl<ClueMapper, Clue> implements Cl
|
|
@Resource
|
|
@Resource
|
|
private SysDictMapper sysDictMapper;
|
|
private SysDictMapper sysDictMapper;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private ApplicationContext applicationContext;
|
|
|
|
+
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@@ -188,7 +192,8 @@ public class ClueServiceImpl extends ServiceImpl<ClueMapper, Clue> implements Cl
|
|
Clue clue1 = clueMapper.selectById2Info(clue.getId());
|
|
Clue clue1 = clueMapper.selectById2Info(clue.getId());
|
|
clue1.setClueLogList(actionLogMapper.selectByInfoList(clue1.getId()));
|
|
clue1.setClueLogList(actionLogMapper.selectByInfoList(clue1.getId()));
|
|
clue1.setFiles(uploadFileMapper.selectByInfoList("clue", clue1.getId()));
|
|
clue1.setFiles(uploadFileMapper.selectByInfoList("clue", clue1.getId()));
|
|
- List<Task> tasks = taskMapper.selectList(new QueryWrapper<Task>().in("clue_id", clue.getId()));
|
|
|
|
|
|
+ List<Task> tasks = taskMapper.selectList(new QueryWrapper<Task>().in("clue_id", clue.getId())
|
|
|
|
+ .eq("is_delete",0));
|
|
for (Task task : tasks) {
|
|
for (Task task : tasks) {
|
|
String executorId = task.getExecutorId();
|
|
String executorId = task.getExecutorId();
|
|
List<String> ids1 = new ArrayList<>();
|
|
List<String> ids1 = new ArrayList<>();
|
|
@@ -197,7 +202,9 @@ public class ClueServiceImpl extends ServiceImpl<ClueMapper, Clue> implements Cl
|
|
for (String id : executorId.split(",")) {
|
|
for (String id : executorId.split(",")) {
|
|
ids1.add(id);
|
|
ids1.add(id);
|
|
}
|
|
}
|
|
- List<User> users = userMapper.selectList(new QueryWrapper<User>().in("id", ids1));
|
|
|
|
|
|
+ List<User> users = userMapper.selectList(new QueryWrapper<User>().in("id", ids1)
|
|
|
|
+ .eq("is_active",1)
|
|
|
|
+ );
|
|
for (User user : users) {
|
|
for (User user : users) {
|
|
userNames.add(user.getName());
|
|
userNames.add(user.getName());
|
|
}
|
|
}
|
|
@@ -754,5 +761,33 @@ public class ClueServiceImpl extends ServiceImpl<ClueMapper, Clue> implements Cl
|
|
return msg;
|
|
return msg;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
+ public HttpRespMsg delete(Clue clue, HttpServletRequest request) {
|
|
|
|
+ HttpRespMsg msg = new HttpRespMsg();
|
|
|
|
+ String ids1 = clue.getIds();
|
|
|
|
+ List<Integer> ids = new ArrayList<>();
|
|
|
|
+ User user = userMapper.selectById(request.getHeader("Token"));
|
|
|
|
+
|
|
|
|
+ if (!ids1.isEmpty()) {
|
|
|
|
+ for (String id : ids1.split(",")) {
|
|
|
|
+ ids.add(Integer.parseInt(id));
|
|
|
|
+ }
|
|
|
|
+ Integer taskCount = taskMapper.selectCount(new LambdaQueryWrapper<Task>()
|
|
|
|
+ .eq(Task::getIsDelete, 0)
|
|
|
|
+ .in(Task::getClueId, ids)
|
|
|
|
+ );
|
|
|
|
+ if(null != taskCount && taskCount > 0){
|
|
|
|
+ msg.setError("存在关联任务");
|
|
|
|
+ return msg;
|
|
|
|
+ }
|
|
|
|
+ ClueService proxy = applicationContext.getBean(ClueService.class);
|
|
|
|
+ proxy.isDelete(ids,user.getId());
|
|
|
|
+ msg.setMsg("操作成功");
|
|
|
|
+ } else {
|
|
|
|
+ msg.setError("请选择线索");
|
|
|
|
+ }
|
|
|
|
+ return msg;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
|
|
}
|
|
}
|