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

@Slf4j @Slf4j
public class MissionServiceImpl extends BaseServiceImpl<ThMissionMapper, ThMission> implements IMissionService { public class MissionServiceImpl extends BaseServiceImpl<ThMissionMapper, ThMission> implements IMissionService {


@Resource
@Autowired
private ThMissionMapper thMissionMapper; private ThMissionMapper thMissionMapper;


@Autowired
private QuestionMapper questionMapper;

@Autowired
private ThInspectionMapper inspectionMapper;

@Autowired
private ReportMapper reportMapper;

@Autowired @Autowired
private RedisUtils redisUtils; private RedisUtils redisUtils;




@Override @Override
public boolean deleteBatch(List<Integer> idList) { public boolean deleteBatch(List<Integer> idList) {
Integer updateUser = ShiroUtils.getUserId();
//Integer updateUser = ShiroUtils.getUserId();
ThMission mission=new ThMission(UpdateOrCreateEnum.UPDATE.getCode()); ThMission mission=new ThMission(UpdateOrCreateEnum.UPDATE.getCode());
mission.setMark(MarkTypeEnum.NOTVALID.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 @Override

Loading…
Cancel
Save