Browse Source

删除任务,同时删除巡检、问题、报告

tags/v1.1.0
qiujinyang 2 years ago
parent
commit
02497d9e8d
1 changed files with 20 additions and 3 deletions
  1. +20
    -3
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/MissionServiceImpl.java

+ 20
- 3
tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/MissionServiceImpl.java View File

@@ -51,9 +51,18 @@ import java.util.*;
@Slf4j
public class MissionServiceImpl extends BaseServiceImpl<ThMissionMapper, ThMission> implements IMissionService {

@Resource
@Autowired
private ThMissionMapper thMissionMapper;

@Autowired
private QuestionMapper questionMapper;

@Autowired
private ThInspectionMapper inspectionMapper;

@Autowired
private ReportMapper reportMapper;

@Autowired
private RedisUtils redisUtils;

@@ -294,10 +303,18 @@ public class MissionServiceImpl extends BaseServiceImpl<ThMissionMapper, ThMissi

@Override
public boolean deleteBatch(List<Integer> idList) {
Integer updateUser = ShiroUtils.getUserId();
//Integer updateUser = ShiroUtils.getUserId();
ThMission mission=new ThMission(UpdateOrCreateEnum.UPDATE.getCode());
mission.setMark(MarkTypeEnum.NOTVALID.getCode());
return thMissionMapper.update(mission,new LambdaUpdateWrapper<ThMission>().in(ThMission::getId,idList))>0;
boolean result=false;
if(thMissionMapper.update(mission,new LambdaUpdateWrapper<ThMission>().in(ThMission::getId,idList))>0){
Integer missionId = mission.getId();
questionMapper.delete(new LambdaQueryWrapper<Question>().eq(Question::getMissionId,missionId));
inspectionMapper.delete(new LambdaQueryWrapper<ThInspection>().eq(ThInspection::getMissionId,missionId));
reportMapper.delete(new LambdaQueryWrapper<Report>().eq(Report::getMissionId,missionId));
result=true;
}
return result;
}

@Override

Loading…
Cancel
Save