修复了可以重复结项的BUG

master
白封羽 2022-06-30 18:56:08 +08:00
parent 5b045b322b
commit 63bcda51d7
1 changed files with 2 additions and 0 deletions

View File

@ -56,6 +56,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
throw new BadRequestException("项目不存在"); throw new BadRequestException("项目不存在");
if(!Objects.equals(staffId, targetProject.getProjectCreator())) if(!Objects.equals(staffId, targetProject.getProjectCreator()))
throw new BadRequestException("用户请求非法"); throw new BadRequestException("用户请求非法");
if(targetProject.getIsCompleted())
throw new BadRequestException("该项目已结项");
targetProject.setIsCompleted(true); targetProject.setIsCompleted(true);
targetProject.setProjectCloseTime(LocalDate.now()); targetProject.setProjectCloseTime(LocalDate.now());
if(baseMapper.updateById(targetProject)==1) if(baseMapper.updateById(targetProject)==1)